]> granicus.if.org Git - postgresql/blob - configure
Provide some initial support for building the ODBC driver for
[postgresql] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local/pgsql
15 ac_help="$ac_help
16   --with-includes=DIRS    look for additional header files in DIRS"
17 ac_help="$ac_help
18   --with-libraries=DIRS   look for additional libraries in DIRS"
19 ac_help="$ac_help
20   --with-libs=DIRS        alternative spelling of --with-libraries"
21 ac_help="$ac_help
22   --enable-locale         enable locale support"
23 ac_help="$ac_help
24   --enable-recode         enable character set recode support"
25 ac_help="$ac_help
26   --enable-multibyte      enable multibyte character support"
27 ac_help="$ac_help
28   --enable-nls[=LANGUAGES]     enable Native Language Support"
29 ac_help="$ac_help
30   --with-pgport=PORTNUM   change default port number [5432]"
31 ac_help="$ac_help
32   --with-maxbackends=N    set default maximum number of connections [32]"
33 ac_help="$ac_help
34   --disable-shared        do not build shared libraries"
35 ac_help="$ac_help
36   --disable-rpath         do not embed shared library search path in executables"
37 ac_help="$ac_help
38   --enable-debug          build with debugging symbols (-g)"
39 ac_help="$ac_help
40   --enable-depend         turn on automatic dependency tracking"
41 ac_help="$ac_help
42   --enable-cassert        enable assertion checks (for debugging)"
43 ac_help="$ac_help
44   --with-tcl              build Tcl and Tk interfaces"
45 ac_help="$ac_help
46   --without-tk            do not build Tk interfaces if Tcl is enabled"
47 ac_help="$ac_help
48   --with-tclconfig=DIR    tclConfig.sh and tkConfig.sh are in DIR"
49 ac_help="$ac_help
50   --with-tkconfig=DIR     tkConfig.sh is in DIR"
51 ac_help="$ac_help
52   --enable-pltcl-unknown  build PL/Tcl unknown support (if Tcl is enabled)"
53 ac_help="$ac_help
54   --enable-pltcl-utf      build PL/Tcl UTF support (if Tcl is enabled)"
55 ac_help="$ac_help
56   --with-perl             build Perl interface and PL/Perl"
57 ac_help="$ac_help
58   --with-python           build Python interface module"
59 ac_help="$ac_help
60   --with-java             build JDBC interface and Java tools"
61 ac_help="$ac_help
62   --with-krb4[=DIR]       build with Kerberos 4 support [/usr/athena]"
63 ac_help="$ac_help
64   --with-krb5[=DIR]       build with Kerberos 5 support [/usr/athena]"
65 ac_help="$ac_help
66   --with-krb-srvnam=NAME  name of the service principal in Kerberos [postgres]"
67 ac_help="$ac_help
68   --with-pam[=DIR]        build with PAM support [/usr]"
69 ac_help="$ac_help
70   --with-openssl[=DIR]    build with OpenSSL support [/usr/local/ssl]"
71 ac_help="$ac_help
72   --enable-odbc           build the ODBC driver package"
73 ac_help="$ac_help
74   --with-unixodbc         build ODBC driver for unixODBC"
75 ac_help="$ac_help
76   --with-iodbc            build ODBC driver for iODBC"
77 ac_help="$ac_help
78   --with-odbcinst=DIR     default directory for odbcinst.ini [sysconfdir]"
79 ac_help="$ac_help
80   --with-CXX              build C++ modules (libpq++)"
81 ac_help="$ac_help
82   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
83 ac_help="$ac_help
84   --enable-syslog         enable logging to syslog"
85
86 # Initialize some variables set by options.
87 # The variables have the same names as the options, with
88 # dashes changed to underlines.
89 build=NONE
90 cache_file=./config.cache
91 exec_prefix=NONE
92 host=NONE
93 no_create=
94 nonopt=NONE
95 no_recursion=
96 prefix=NONE
97 program_prefix=NONE
98 program_suffix=NONE
99 program_transform_name=s,x,x,
100 silent=
101 site=
102 srcdir=
103 target=NONE
104 verbose=
105 x_includes=NONE
106 x_libraries=NONE
107 bindir='${exec_prefix}/bin'
108 sbindir='${exec_prefix}/sbin'
109 libexecdir='${exec_prefix}/libexec'
110 datadir='${prefix}/share'
111 sysconfdir='${prefix}/etc'
112 sharedstatedir='${prefix}/com'
113 localstatedir='${prefix}/var'
114 libdir='${exec_prefix}/lib'
115 includedir='${prefix}/include'
116 oldincludedir='/usr/include'
117 docdir='${prefix}/doc'
118 mandir='${prefix}/man'
119
120 # Initialize some other variables.
121 subdirs=
122 MFLAGS= MAKEFLAGS=
123 SHELL=${CONFIG_SHELL-/bin/sh}
124 # Maximum number of lines to put in a shell here document.
125 ac_max_here_lines=12
126
127 ac_prev=
128 for ac_option
129 do
130
131   # If the previous option needs an argument, assign it.
132   if test -n "$ac_prev"; then
133     eval "$ac_prev=\$ac_option"
134     ac_prev=
135     continue
136   fi
137
138   case "$ac_option" in
139   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
140   *) ac_optarg= ;;
141   esac
142
143   # Accept the important Cygnus configure options, so we can diagnose typos.
144
145   case "$ac_option" in
146
147   -bindir | --bindir | --bindi | --bind | --bin | --bi)
148     ac_prev=bindir ;;
149   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
150     bindir="$ac_optarg" ;;
151
152   -build | --build | --buil | --bui | --bu)
153     ac_prev=build ;;
154   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
155     build="$ac_optarg" ;;
156
157   -cache-file | --cache-file | --cache-fil | --cache-fi \
158   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
159     ac_prev=cache_file ;;
160   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
161   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
162     cache_file="$ac_optarg" ;;
163
164   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
165     ac_prev=datadir ;;
166   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
167   | --da=*)
168     datadir="$ac_optarg" ;;
169
170   -disable-* | --disable-*)
171     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
172     # Reject names that are not valid shell variable names.
173     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
174       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
175     fi
176     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
177     eval "enable_${ac_feature}=no" ;;
178
179   -enable-* | --enable-*)
180     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
181     # Reject names that are not valid shell variable names.
182     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
183       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
184     fi
185     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
186     case "$ac_option" in
187       *=*) ;;
188       *) ac_optarg=yes ;;
189     esac
190     eval "enable_${ac_feature}='$ac_optarg'" ;;
191
192   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
193   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
194   | --exec | --exe | --ex)
195     ac_prev=exec_prefix ;;
196   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
197   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
198   | --exec=* | --exe=* | --ex=*)
199     exec_prefix="$ac_optarg" ;;
200
201   -gas | --gas | --ga | --g)
202     # Obsolete; use --with-gas.
203     with_gas=yes ;;
204
205   -help | --help | --hel | --he)
206     # Omit some internal or obsolete options to make the list less imposing.
207     # This message is too long to be a string in the A/UX 3.1 sh.
208     cat << EOF
209 Usage: configure [options] [host]
210 Options: [defaults in brackets after descriptions]
211 Configuration:
212   --cache-file=FILE       cache test results in FILE
213   --help                  print this message
214   --no-create             do not create output files
215   --quiet, --silent       do not print \`checking...' messages
216   --version               print the version of autoconf that created configure
217 Directory and file names:
218   --prefix=PREFIX         install architecture-independent files in PREFIX
219                           [$ac_default_prefix]
220   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
221                           [same as prefix]
222   --bindir=DIR            user executables in DIR [EPREFIX/bin]
223   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
224   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
225   --datadir=DIR           read-only architecture-independent data in DIR
226                           [PREFIX/share]
227   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
228   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
229                           [PREFIX/com]
230   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
231   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
232   --includedir=DIR        C header files in DIR [PREFIX/include]
233   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
234   --docdir=DIR           doc documentation in DIR [PREFIX/doc]
235   --mandir=DIR            man documentation in DIR [PREFIX/man]
236   --srcdir=DIR            find the sources in DIR [configure dir or ..]
237   --program-prefix=PREFIX prepend PREFIX to installed program names
238   --program-suffix=SUFFIX append SUFFIX to installed program names
239   --program-transform-name=PROGRAM
240                           run sed PROGRAM on installed program names
241 EOF
242     cat << EOF
243 Host type:
244   --build=BUILD           configure for building on BUILD [BUILD=HOST]
245   --host=HOST             configure for HOST [guessed]
246   --target=TARGET         configure for TARGET [TARGET=HOST]
247 Features and packages:
248   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
249   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
250   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
251   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
252   --x-includes=DIR        X include files are in DIR
253   --x-libraries=DIR       X library files are in DIR
254 EOF
255     if test -n "$ac_help"; then
256       echo "--enable and --with options recognized:$ac_help"
257     fi
258     exit 0 ;;
259
260   -host | --host | --hos | --ho)
261     ac_prev=host ;;
262   -host=* | --host=* | --hos=* | --ho=*)
263     host="$ac_optarg" ;;
264
265   -includedir | --includedir | --includedi | --included | --include \
266   | --includ | --inclu | --incl | --inc)
267     ac_prev=includedir ;;
268   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
269   | --includ=* | --inclu=* | --incl=* | --inc=*)
270     includedir="$ac_optarg" ;;
271
272   -docdir | --docdir | --infodi | --infod | --doc | --inf)
273     ac_prev=docdir ;;
274   -docdir=* | --docdir=* | --infodi=* | --infod=* | --doc=* | --inf=*)
275     docdir="$ac_optarg" ;;
276
277   -libdir | --libdir | --libdi | --libd)
278     ac_prev=libdir ;;
279   -libdir=* | --libdir=* | --libdi=* | --libd=*)
280     libdir="$ac_optarg" ;;
281
282   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
283   | --libexe | --libex | --libe)
284     ac_prev=libexecdir ;;
285   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
286   | --libexe=* | --libex=* | --libe=*)
287     libexecdir="$ac_optarg" ;;
288
289   -localstatedir | --localstatedir | --localstatedi | --localstated \
290   | --localstate | --localstat | --localsta | --localst \
291   | --locals | --local | --loca | --loc | --lo)
292     ac_prev=localstatedir ;;
293   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
294   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
295   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
296     localstatedir="$ac_optarg" ;;
297
298   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
299     ac_prev=mandir ;;
300   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
301     mandir="$ac_optarg" ;;
302
303   -nfp | --nfp | --nf)
304     # Obsolete; use --without-fp.
305     with_fp=no ;;
306
307   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
308   | --no-cr | --no-c)
309     no_create=yes ;;
310
311   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
312   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
313     no_recursion=yes ;;
314
315   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
316   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
317   | --oldin | --oldi | --old | --ol | --o)
318     ac_prev=oldincludedir ;;
319   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
320   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
321   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
322     oldincludedir="$ac_optarg" ;;
323
324   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
325     ac_prev=prefix ;;
326   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
327     prefix="$ac_optarg" ;;
328
329   -program-prefix | --program-prefix | --program-prefi | --program-pref \
330   | --program-pre | --program-pr | --program-p)
331     ac_prev=program_prefix ;;
332   -program-prefix=* | --program-prefix=* | --program-prefi=* \
333   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
334     program_prefix="$ac_optarg" ;;
335
336   -program-suffix | --program-suffix | --program-suffi | --program-suff \
337   | --program-suf | --program-su | --program-s)
338     ac_prev=program_suffix ;;
339   -program-suffix=* | --program-suffix=* | --program-suffi=* \
340   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
341     program_suffix="$ac_optarg" ;;
342
343   -program-transform-name | --program-transform-name \
344   | --program-transform-nam | --program-transform-na \
345   | --program-transform-n | --program-transform- \
346   | --program-transform | --program-transfor \
347   | --program-transfo | --program-transf \
348   | --program-trans | --program-tran \
349   | --progr-tra | --program-tr | --program-t)
350     ac_prev=program_transform_name ;;
351   -program-transform-name=* | --program-transform-name=* \
352   | --program-transform-nam=* | --program-transform-na=* \
353   | --program-transform-n=* | --program-transform-=* \
354   | --program-transform=* | --program-transfor=* \
355   | --program-transfo=* | --program-transf=* \
356   | --program-trans=* | --program-tran=* \
357   | --progr-tra=* | --program-tr=* | --program-t=*)
358     program_transform_name="$ac_optarg" ;;
359
360   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
361   | -silent | --silent | --silen | --sile | --sil)
362     silent=yes ;;
363
364   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
365     ac_prev=sbindir ;;
366   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
367   | --sbi=* | --sb=*)
368     sbindir="$ac_optarg" ;;
369
370   -sharedstatedir | --sharedstatedir | --sharedstatedi \
371   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
372   | --sharedst | --shareds | --shared | --share | --shar \
373   | --sha | --sh)
374     ac_prev=sharedstatedir ;;
375   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
376   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
377   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
378   | --sha=* | --sh=*)
379     sharedstatedir="$ac_optarg" ;;
380
381   -site | --site | --sit)
382     ac_prev=site ;;
383   -site=* | --site=* | --sit=*)
384     site="$ac_optarg" ;;
385
386   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
387     ac_prev=srcdir ;;
388   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
389     srcdir="$ac_optarg" ;;
390
391   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
392   | --syscon | --sysco | --sysc | --sys | --sy)
393     ac_prev=sysconfdir ;;
394   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
395   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
396     sysconfdir="$ac_optarg" ;;
397
398   -target | --target | --targe | --targ | --tar | --ta | --t)
399     ac_prev=target ;;
400   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
401     target="$ac_optarg" ;;
402
403   -v | -verbose | --verbose | --verbos | --verbo | --verb)
404     verbose=yes ;;
405
406   -version | --version | --versio | --versi | --vers)
407     echo "configure generated by autoconf version 2.13"
408     exit 0 ;;
409
410   -with-* | --with-*)
411     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
412     # Reject names that are not valid shell variable names.
413     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
414       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
415     fi
416     ac_package=`echo $ac_package| sed 's/-/_/g'`
417     case "$ac_option" in
418       *=*) ;;
419       *) ac_optarg=yes ;;
420     esac
421     eval "with_${ac_package}='$ac_optarg'" ;;
422
423   -without-* | --without-*)
424     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
425     # Reject names that are not valid shell variable names.
426     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
427       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
428     fi
429     ac_package=`echo $ac_package| sed 's/-/_/g'`
430     eval "with_${ac_package}=no" ;;
431
432   --x)
433     # Obsolete; use --with-x.
434     with_x=yes ;;
435
436   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
437   | --x-incl | --x-inc | --x-in | --x-i)
438     ac_prev=x_includes ;;
439   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
440   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
441     x_includes="$ac_optarg" ;;
442
443   -x-libraries | --x-libraries | --x-librarie | --x-librari \
444   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
445     ac_prev=x_libraries ;;
446   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
447   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
448     x_libraries="$ac_optarg" ;;
449
450   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
451     ;;
452
453   *)
454     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
455       echo "configure: warning: $ac_option: invalid host type" 1>&2
456     fi
457     if test "x$nonopt" != xNONE; then
458       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
459     fi
460     nonopt="$ac_option"
461     ;;
462
463   esac
464 done
465
466 if test -n "$ac_prev"; then
467   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
468 fi
469
470 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
471
472 # File descriptor usage:
473 # 0 standard input
474 # 1 file creation
475 # 2 errors and warnings
476 # 3 some systems may open it to /dev/tty
477 # 4 used on the Kubota Titan
478 # 6 checking for... messages and results
479 # 5 compiler messages saved in config.log
480 if test "$silent" = yes; then
481   exec 6>/dev/null
482 else
483   exec 6>&1
484 fi
485 exec 5>./config.log
486
487 echo "\
488 This file contains any messages produced by compilers while
489 running configure, to aid debugging if configure makes a mistake.
490 " 1>&5
491
492 # Strip out --no-create and --no-recursion so they do not pile up.
493 # Also quote any args containing shell metacharacters.
494 ac_configure_args=
495 for ac_arg
496 do
497   case "$ac_arg" in
498   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
499   | --no-cr | --no-c) ;;
500   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
501   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
502   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
503   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
504   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
505   esac
506 done
507
508 # NLS nuisances.
509 # Only set these to C if already set.  These must not be set unconditionally
510 # because not all systems understand e.g. LANG=C (notably SCO).
511 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
512 # Non-C LC_CTYPE values break the ctype check.
513 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
514 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
515 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
516 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
517
518 # confdefs.h avoids OS command line length limits that DEFS can exceed.
519 rm -rf conftest* confdefs.h
520 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
521 echo > confdefs.h
522
523 # A filename unique to this package, relative to the directory that
524 # configure is in, which we can look for to find out if srcdir is correct.
525 ac_unique_file=src/backend/access/common/heaptuple.c
526
527 # Find the source files, if location was not specified.
528 if test -z "$srcdir"; then
529   ac_srcdir_defaulted=yes
530   # Try the directory containing this script, then its parent.
531   ac_prog=$0
532   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
533   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
534   srcdir=$ac_confdir
535   if test ! -r $srcdir/$ac_unique_file; then
536     srcdir=..
537   fi
538 else
539   ac_srcdir_defaulted=no
540 fi
541 if test ! -r $srcdir/$ac_unique_file; then
542   if test "$ac_srcdir_defaulted" = yes; then
543     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
544   else
545     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
546   fi
547 fi
548 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
549
550 # Prefer explicitly selected file to automatically selected ones.
551 if test -z "$CONFIG_SITE"; then
552   if test "x$prefix" != xNONE; then
553     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
554   else
555     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
556   fi
557 fi
558 for ac_site_file in $CONFIG_SITE; do
559   if test -r "$ac_site_file"; then
560     echo "loading site script $ac_site_file"
561     . "$ac_site_file"
562   fi
563 done
564
565 if test -r "$cache_file"; then
566   echo "loading cache $cache_file"
567   . $cache_file
568 else
569   echo "creating cache $cache_file"
570   > $cache_file
571 fi
572
573 ac_ext=c
574 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
575 ac_cpp='$CPP $CPPFLAGS'
576 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
577 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
578 cross_compiling=$ac_cv_prog_cc_cross
579
580 ac_exeext=
581 ac_objext=o
582 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
583   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
584   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
585     ac_n= ac_c='
586 ' ac_t='        '
587   else
588     ac_n=-n ac_c= ac_t=
589   fi
590 else
591   ac_n= ac_c='\c' ac_t=
592 fi
593
594
595
596
597
598
599
600
601
602 ac_aux_dir=
603 for ac_dir in config $srcdir/config; do
604   if test -f $ac_dir/install-sh; then
605     ac_aux_dir=$ac_dir
606     ac_install_sh="$ac_aux_dir/install-sh -c"
607     break
608   elif test -f $ac_dir/install.sh; then
609     ac_aux_dir=$ac_dir
610     ac_install_sh="$ac_aux_dir/install.sh -c"
611     break
612   fi
613 done
614 if test -z "$ac_aux_dir"; then
615   { echo "configure: error: can not find install-sh or install.sh in config $srcdir/config" 1>&2; exit 1; }
616 fi
617 ac_config_guess=$ac_aux_dir/config.guess
618 ac_config_sub=$ac_aux_dir/config.sub
619 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
620
621
622 VERSION='7.2devel'
623
624 cat >> confdefs.h <<EOF
625 #define PG_VERSION "$VERSION"
626 EOF
627
628
629 unset CDPATH
630
631
632 # Make sure we can run config.sub.
633 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
634 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
635 fi
636
637 echo $ac_n "checking host system type""... $ac_c" 1>&6
638 echo "configure:639: checking host system type" >&5
639
640 host_alias=$host
641 case "$host_alias" in
642 NONE)
643   case $nonopt in
644   NONE)
645     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
646     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
647     fi ;;
648   *) host_alias=$nonopt ;;
649   esac ;;
650 esac
651
652 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
653 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
654 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
655 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
656 echo "$ac_t""$host" 1>&6
657
658
659
660
661
662 template=
663 echo $ac_n "checking which template to use""... $ac_c" 1>&6
664 echo "configure:665: checking which template to use" >&5
665
666 # Check whether --with-template was given
667 if test x"${with_template+set}" = xset; then
668   case $with_template in
669     yes)
670       { echo "configure: error: argument required for --with-template option" 1>&2; exit 1; }
671       ;;
672     no)
673       { echo "configure: error: argument required for --with-template option" 1>&2; exit 1; }
674       ;;
675     *)
676       withval=$with_template
677       
678   case $withval in
679     list)   echo; ls "$srcdir/src/template"; exit;;
680     *)      if test -f "$srcdir/src/template/$with_template" ; then
681               template=$withval
682             else
683               { echo "configure: error: '$withval' is not a valid template name. Use 'list' for a list." 1>&2; exit 1; }
684             fi;;
685   esac
686
687       ;;
688   esac # $with_template
689 else
690   
691   # --with-template not given
692
693 case $host_os in
694      aix*) template=aix ;;
695     beos*) template=beos ;;
696     bsdi*) template=bsdi ;;
697   cygwin*) template=win ;;
698   darwin*) template=darwin ;;
699     dgux*) template=dgux ;;
700  freebsd*) template=freebsd ;;
701     hpux*) template=hpux ;;
702     irix*) template=irix5 ;;
703    linux*) template=linux ;;
704   netbsd*) template=netbsd ;;
705 nextstep*) template=nextstep ;;
706  openbsd*) template=openbsd ;;
707      osf*) template=osf ;;
708      qnx*) template=qnx4 ;;
709      sco*) template=sco ;;
710  solaris*) template=solaris ;;
711    sunos*) template=sunos4 ;;
712  sysv4.2*)
713         case $host_vendor in
714           univel) template=univel ;;
715         esac ;;
716    sysv4*) template=svr4 ;;
717    sysv5*) template=unixware ;;
718   ultrix*) template=ultrix4 ;;
719 esac
720
721   if test x"$template" = x"" ; then
722     { echo "configure: error: 
723 *******************************************************************
724 PostgreSQL has apparently not been ported to your platform yet.
725 To try a manual configuration, look into the src/template directory
726 for a similar platform and use the '--with-template=' option.
727
728 Please also contact <pgsql-ports@postgresql.org> to see about
729 rectifying this.  Include the above 'checking host system type...'
730 line.
731 *******************************************************************
732 " 1>&2; exit 1; }
733   fi
734
735
736 fi
737
738 echo "$ac_t""$template" 1>&6
739
740 PORTNAME=$template
741
742
743
744
745
746
747
748 # Pick right test-and-set (TAS) code.  Most platforms have inline
749 # assembler code in src/include/storage/s_lock.h, so we just use
750 # a dummy file here.
751 case $host in
752   *-*-hpux*)        need_tas=yes; tas_file=hpux.s ;;
753   sparc-*-solaris*) need_tas=yes; tas_file=solaris_sparc.s ;;
754   i?86-*-solaris)   need_tas=yes; tas_file=solaris_i386.s ;;
755   *)                need_tas=no;  tas_file=dummy.s ;;
756 esac
757
758
759 if test "$need_tas" = yes ; then
760   TAS=tas.o
761 fi
762
763
764
765
766 ##
767 ## Command line options
768 ##
769
770
771 #
772 # Add non-standard directories to the include path
773 #
774 # Check whether --with-includes was given
775 if test x"${with_includes+set}" = xset; then
776   case $with_includes in
777     yes)
778       { echo "configure: error: argument required for --with-includes option" 1>&2; exit 1; }
779       ;;
780     no)
781       { echo "configure: error: argument required for --with-includes option" 1>&2; exit 1; }
782       ;;
783   esac # $with_includes
784 fi
785
786
787 #
788 # Add non-standard directories to the library search path
789 #
790 # Check whether --with-libraries was given
791 if test x"${with_libraries+set}" = xset; then
792   case $with_libraries in
793     yes)
794       { echo "configure: error: argument required for --with-libraries option" 1>&2; exit 1; }
795       ;;
796     no)
797       { echo "configure: error: argument required for --with-libraries option" 1>&2; exit 1; }
798       ;;
799     *)
800       withval=$with_libraries
801       LIBRARY_DIRS=$withval
802       ;;
803   esac # $with_libraries
804 fi
805
806 # Check whether --with-libs was given
807 if test x"${with_libs+set}" = xset; then
808   case $with_libs in
809     yes)
810       { echo "configure: error: argument required for --with-libs option" 1>&2; exit 1; }
811       ;;
812     no)
813       { echo "configure: error: argument required for --with-libs option" 1>&2; exit 1; }
814       ;;
815     *)
816       withval=$with_libs
817       LIBRARY_DIRS=$withval
818       ;;
819   esac # $with_libs
820 fi
821
822
823 #
824 # Locale (--enable-locale)
825 #
826 echo $ac_n "checking whether to build with locale support""... $ac_c" 1>&6
827 echo "configure:828: checking whether to build with locale support" >&5
828 # Check whether --enable-locale was given
829 if test x"${enable_locale+set}" = xset; then
830   case $enable_locale in
831     yes)
832       cat >> confdefs.h <<\EOF
833 #define USE_LOCALE 1
834 EOF
835
836       ;;
837     no)
838       :
839       ;;
840     *)
841       enableval=$enable_locale
842       { echo "configure: error: no argument expected for --enable-locale option" 1>&2; exit 1; }
843       ;;
844   esac # $enable_locale
845 else
846   enable_locale=no
847
848 fi
849 echo "$ac_t""$enable_locale" 1>&6
850
851
852 #
853 # Character set recode (--enable-recode)
854 #
855 echo $ac_n "checking whether to build with recode support""... $ac_c" 1>&6
856 echo "configure:857: checking whether to build with recode support" >&5
857 # Check whether --enable-recode was given
858 if test x"${enable_recode+set}" = xset; then
859   case $enable_recode in
860     yes)
861       cat >> confdefs.h <<\EOF
862 #define CYR_RECODE 1
863 EOF
864
865       ;;
866     no)
867       :
868       ;;
869     *)
870       enableval=$enable_recode
871       { echo "configure: error: no argument expected for --enable-recode option" 1>&2; exit 1; }
872       ;;
873   esac # $enable_recode
874 else
875   enable_recode=no
876
877 fi
878 echo "$ac_t""$enable_recode" 1>&6
879
880
881 #
882 # Multibyte support
883 #
884 MULTIBYTE=
885 echo $ac_n "checking whether to build with multibyte character support""... $ac_c" 1>&6
886 echo "configure:887: checking whether to build with multibyte character support" >&5
887
888 # Check whether --enable-multibyte was given
889 if test x"${enable_multibyte+set}" = xset; then
890   case $enable_multibyte in
891     yes)
892       MULTIBYTE=SQL_ASCII
893       ;;
894     no)
895       :
896       ;;
897     *)
898       enableval=$enable_multibyte
899       enable_multibyte=yes
900
901   case $enableval in
902     SQL_ASCII|EUC_JP|EUC_CN|EUC_KR|EUC_TW|UNICODE|MULE_INTERNAL|LATIN1|LATIN2|LATIN3|LATIN4|LATIN5|KOI8|WIN|ALT)
903       MULTIBYTE=$enableval;;
904     *)
905       { echo "configure: error: argument to --enable-multibyte must be one of:
906   SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW,
907   UNICODE, MULE_INTERNAL,
908   LATIN1, LATIN2, LATIN3, LATIN4, LATIN5,
909   KOI8, WIN, ALT
910 Or do not specify an argument to the option to use the default." 1>&2; exit 1; };;
911   esac
912
913       ;;
914   esac # $enable_multibyte
915 else
916   enable_multibyte=no
917 fi
918
919 if test "$enable_multibyte" = yes; then
920   
921   cat >> confdefs.h <<\EOF
922 #define MULTIBYTE 1
923 EOF
924
925   echo "$ac_t""yes, default $MULTIBYTE" 1>&6
926
927 else
928   echo "$ac_t""no" 1>&6
929 fi
930
931
932
933
934 #
935 # NLS
936 #
937 echo $ac_n "checking whether NLS is wanted""... $ac_c" 1>&6
938 echo "configure:939: checking whether NLS is wanted" >&5
939 # Check whether --enable-nls was given
940 if test x"${enable_nls+set}" = xset; then
941   case $enable_nls in
942     yes)
943       :
944       ;;
945     no)
946       :
947       ;;
948     *)
949       enableval=$enable_nls
950       enable_nls=yes
951 WANTED_LANGUAGES=$enableval
952       ;;
953   esac # $enable_nls
954 else
955   enable_nls=no
956 fi
957
958 if test "$enable_nls" = yes; then
959   cat >> confdefs.h <<\EOF
960 #define ENABLE_NLS 1
961 EOF
962
963 fi
964
965 echo "$ac_t""$enable_nls" 1>&6
966
967
968
969 #
970 # Default port number (--with-pgport), default 5432
971 #
972 echo $ac_n "checking for default port number""... $ac_c" 1>&6
973 echo "configure:974: checking for default port number" >&5
974 # Check whether --with-pgport was given
975 if test x"${with_pgport+set}" = xset; then
976   case $with_pgport in
977     yes)
978       { echo "configure: error: argument required for --with-pgport option" 1>&2; exit 1; }
979       ;;
980     no)
981       { echo "configure: error: argument required for --with-pgport option" 1>&2; exit 1; }
982       ;;
983     *)
984       withval=$with_pgport
985       default_port=$withval
986       ;;
987   esac # $with_pgport
988 else
989   default_port=5432
990 fi
991 echo "$ac_t""$default_port" 1>&6
992 # Need both of these because some places want an integer and some a string
993 cat >> confdefs.h <<EOF
994 #define DEF_PGPORT ${default_port}
995 EOF
996
997 cat >> confdefs.h <<EOF
998 #define DEF_PGPORT_STR "${default_port}"
999 EOF
1000
1001
1002
1003 #
1004 # Maximum number of allowed connections (--with-maxbackends), default 32
1005 #
1006 echo $ac_n "checking for default soft limit on number of connections""... $ac_c" 1>&6
1007 echo "configure:1008: checking for default soft limit on number of connections" >&5
1008 # Check whether --with-maxbackends was given
1009 if test x"${with_maxbackends+set}" = xset; then
1010   case $with_maxbackends in
1011     yes)
1012       { echo "configure: error: argument required for --with-maxbackends option" 1>&2; exit 1; }
1013       ;;
1014     no)
1015       { echo "configure: error: argument required for --with-maxbackends option" 1>&2; exit 1; }
1016       ;;
1017   esac # $with_maxbackends
1018 else
1019   with_maxbackends=32
1020 fi
1021 echo "$ac_t""$with_maxbackends" 1>&6
1022 cat >> confdefs.h <<EOF
1023 #define DEF_MAXBACKENDS $with_maxbackends
1024 EOF
1025
1026
1027
1028 #
1029 # Option to disable shared libraries
1030 #
1031 # Check whether --enable-shared was given
1032 if test x"${enable_shared+set}" = xset; then
1033   case $enable_shared in
1034     yes)
1035       :
1036       ;;
1037     no)
1038       :
1039       ;;
1040     *)
1041       enableval=$enable_shared
1042       { echo "configure: error: no argument expected for --enable-shared option" 1>&2; exit 1; }
1043       ;;
1044   esac # $enable_shared
1045 else
1046   enable_shared=yes
1047
1048 fi
1049
1050
1051 #
1052 # '-rpath'-like feature can be disabled
1053 #
1054 # Check whether --enable-rpath was given
1055 if test x"${enable_rpath+set}" = xset; then
1056   case $enable_rpath in
1057     yes)
1058       :
1059       ;;
1060     no)
1061       :
1062       ;;
1063     *)
1064       enableval=$enable_rpath
1065       { echo "configure: error: no argument expected for --enable-rpath option" 1>&2; exit 1; }
1066       ;;
1067   esac # $enable_rpath
1068 else
1069   enable_rpath=yes
1070
1071 fi
1072
1073
1074
1075 #
1076 # --enable-debug adds -g to compiler flags
1077 #
1078 # Check whether --enable-debug was given
1079 if test x"${enable_debug+set}" = xset; then
1080   case $enable_debug in
1081     yes)
1082       :
1083       ;;
1084     no)
1085       :
1086       ;;
1087     *)
1088       enableval=$enable_debug
1089       { echo "configure: error: no argument expected for --enable-debug option" 1>&2; exit 1; }
1090       ;;
1091   esac # $enable_debug
1092 else
1093   enable_debug=no
1094
1095 fi
1096
1097
1098 #
1099 # C compiler
1100 #
1101
1102 # For historical reasons you can also use --with-CC to specify the C compiler
1103 # to use, although the standard way to do this is to set the CC environment
1104 # variable.
1105 # Check whether --with-CC was given
1106 if test x"${with_CC+set}" = xset; then
1107   case $with_CC in
1108     yes)
1109       { echo "configure: error: argument required for --with-CC option" 1>&2; exit 1; }
1110       ;;
1111     no)
1112       { echo "configure: error: argument required for --with-CC option" 1>&2; exit 1; }
1113       ;;
1114     *)
1115       withval=$with_CC
1116       CC=$with_CC
1117       ;;
1118   esac # $with_CC
1119 fi
1120
1121 # On AIX, default compiler to xlc.
1122 if test "$template" = aix && test -z "$CC" ; then CC=xlc; fi
1123
1124 # Save CFLAGS from the environment
1125 has_environ_CFLAGS="${CFLAGS+yes}"
1126 save_CFLAGS=$CFLAGS
1127
1128 # Extract the first word of "gcc", so it can be a program name with args.
1129 set dummy gcc; ac_word=$2
1130 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1131 echo "configure:1132: checking for $ac_word" >&5
1132 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1133   echo $ac_n "(cached) $ac_c" 1>&6
1134 else
1135   if test -n "$CC"; then
1136   ac_cv_prog_CC="$CC" # Let the user override the test.
1137 else
1138   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1139   ac_dummy="$PATH"
1140   for ac_dir in $ac_dummy; do
1141     test -z "$ac_dir" && ac_dir=.
1142     if test -f $ac_dir/$ac_word; then
1143       ac_cv_prog_CC="gcc"
1144       break
1145     fi
1146   done
1147   IFS="$ac_save_ifs"
1148 fi
1149 fi
1150 CC="$ac_cv_prog_CC"
1151 if test -n "$CC"; then
1152   echo "$ac_t""$CC" 1>&6
1153 else
1154   echo "$ac_t""no" 1>&6
1155 fi
1156
1157 if test -z "$CC"; then
1158   # Extract the first word of "cc", so it can be a program name with args.
1159 set dummy cc; ac_word=$2
1160 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1161 echo "configure:1162: checking for $ac_word" >&5
1162 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1163   echo $ac_n "(cached) $ac_c" 1>&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1169   ac_prog_rejected=no
1170   ac_dummy="$PATH"
1171   for ac_dir in $ac_dummy; do
1172     test -z "$ac_dir" && ac_dir=.
1173     if test -f $ac_dir/$ac_word; then
1174       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1175         ac_prog_rejected=yes
1176         continue
1177       fi
1178       ac_cv_prog_CC="cc"
1179       break
1180     fi
1181   done
1182   IFS="$ac_save_ifs"
1183 if test $ac_prog_rejected = yes; then
1184   # We found a bogon in the path, so make sure we never use it.
1185   set dummy $ac_cv_prog_CC
1186   shift
1187   if test $# -gt 0; then
1188     # We chose a different compiler from the bogus one.
1189     # However, it has the same basename, so the bogon will be chosen
1190     # first if we set CC to just the basename; use the full file name.
1191     shift
1192     set dummy "$ac_dir/$ac_word" "$@"
1193     shift
1194     ac_cv_prog_CC="$@"
1195   fi
1196 fi
1197 fi
1198 fi
1199 CC="$ac_cv_prog_CC"
1200 if test -n "$CC"; then
1201   echo "$ac_t""$CC" 1>&6
1202 else
1203   echo "$ac_t""no" 1>&6
1204 fi
1205
1206   if test -z "$CC"; then
1207     case "`uname -s`" in
1208     *win32* | *WIN32*)
1209       # Extract the first word of "cl", so it can be a program name with args.
1210 set dummy cl; ac_word=$2
1211 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1212 echo "configure:1213: checking for $ac_word" >&5
1213 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1214   echo $ac_n "(cached) $ac_c" 1>&6
1215 else
1216   if test -n "$CC"; then
1217   ac_cv_prog_CC="$CC" # Let the user override the test.
1218 else
1219   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1220   ac_dummy="$PATH"
1221   for ac_dir in $ac_dummy; do
1222     test -z "$ac_dir" && ac_dir=.
1223     if test -f $ac_dir/$ac_word; then
1224       ac_cv_prog_CC="cl"
1225       break
1226     fi
1227   done
1228   IFS="$ac_save_ifs"
1229 fi
1230 fi
1231 CC="$ac_cv_prog_CC"
1232 if test -n "$CC"; then
1233   echo "$ac_t""$CC" 1>&6
1234 else
1235   echo "$ac_t""no" 1>&6
1236 fi
1237  ;;
1238     esac
1239   fi
1240   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1241 fi
1242
1243 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1244 echo "configure:1245: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1245
1246 ac_ext=c
1247 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1248 ac_cpp='$CPP $CPPFLAGS'
1249 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1250 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1251 cross_compiling=$ac_cv_prog_cc_cross
1252
1253 cat > conftest.$ac_ext << EOF
1254
1255 #line 1256 "configure"
1256 #include "confdefs.h"
1257
1258 main(){return(0);}
1259 EOF
1260 if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1261   ac_cv_prog_cc_works=yes
1262   # If we can't run a trivial program, we are probably using a cross compiler.
1263   if (./conftest; exit) 2>/dev/null; then
1264     ac_cv_prog_cc_cross=no
1265   else
1266     ac_cv_prog_cc_cross=yes
1267   fi
1268 else
1269   echo "configure: failed program was:" >&5
1270   cat conftest.$ac_ext >&5
1271   ac_cv_prog_cc_works=no
1272 fi
1273 rm -fr conftest*
1274 ac_ext=c
1275 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1276 ac_cpp='$CPP $CPPFLAGS'
1277 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1278 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1279 cross_compiling=$ac_cv_prog_cc_cross
1280
1281 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1282 if test $ac_cv_prog_cc_works = no; then
1283   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1284 fi
1285 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1286 echo "configure:1287: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1287 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1288 cross_compiling=$ac_cv_prog_cc_cross
1289
1290 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1291 echo "configure:1292: checking whether we are using GNU C" >&5
1292 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1293   echo $ac_n "(cached) $ac_c" 1>&6
1294 else
1295   cat > conftest.c <<EOF
1296 #ifdef __GNUC__
1297   yes;
1298 #endif
1299 EOF
1300 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1301   ac_cv_prog_gcc=yes
1302 else
1303   ac_cv_prog_gcc=no
1304 fi
1305 fi
1306
1307 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1308
1309 if test $ac_cv_prog_gcc = yes; then
1310   GCC=yes
1311 else
1312   GCC=
1313 fi
1314
1315 ac_test_CFLAGS="${CFLAGS+set}"
1316 ac_save_CFLAGS="$CFLAGS"
1317 CFLAGS=
1318 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1319 echo "configure:1320: checking whether ${CC-cc} accepts -g" >&5
1320 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1321   echo $ac_n "(cached) $ac_c" 1>&6
1322 else
1323   echo 'void f(){}' > conftest.c
1324 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1325   ac_cv_prog_cc_g=yes
1326 else
1327   ac_cv_prog_cc_g=no
1328 fi
1329 rm -f conftest*
1330
1331 fi
1332
1333 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1334 if test "$ac_test_CFLAGS" = set; then
1335   CFLAGS="$ac_save_CFLAGS"
1336 elif test $ac_cv_prog_cc_g = yes; then
1337   if test "$GCC" = yes; then
1338     CFLAGS="-g -O2"
1339   else
1340     CFLAGS="-g"
1341   fi
1342 else
1343   if test "$GCC" = yes; then
1344     CFLAGS="-O2"
1345   else
1346     CFLAGS=
1347   fi
1348 fi
1349
1350 # Read the template
1351 . "$srcdir/src/template/$template" || exit
1352
1353 if test "$has_environ_CFLAGS" = yes; then
1354   CFLAGS=$save_CFLAGS
1355 fi
1356 if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
1357   CFLAGS="$CFLAGS -g"
1358 fi
1359 echo "using CFLAGS=$CFLAGS"
1360 # Check if the compiler still works with the template settings
1361 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1362 echo "configure:1363: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1363
1364 ac_ext=c
1365 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1366 ac_cpp='$CPP $CPPFLAGS'
1367 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1368 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1369 cross_compiling=$ac_cv_prog_cc_cross
1370
1371 cat > conftest.$ac_ext << EOF
1372
1373 #line 1374 "configure"
1374 #include "confdefs.h"
1375
1376 main(){return(0);}
1377 EOF
1378 if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1379   ac_cv_prog_cc_works=yes
1380   # If we can't run a trivial program, we are probably using a cross compiler.
1381   if (./conftest; exit) 2>/dev/null; then
1382     ac_cv_prog_cc_cross=no
1383   else
1384     ac_cv_prog_cc_cross=yes
1385   fi
1386 else
1387   echo "configure: failed program was:" >&5
1388   cat conftest.$ac_ext >&5
1389   ac_cv_prog_cc_works=no
1390 fi
1391 rm -fr conftest*
1392 ac_ext=c
1393 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1394 ac_cpp='$CPP $CPPFLAGS'
1395 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1396 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1397 cross_compiling=$ac_cv_prog_cc_cross
1398
1399 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1400 if test $ac_cv_prog_cc_works = no; then
1401   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1402 fi
1403 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1404 echo "configure:1405: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1405 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1406 cross_compiling=$ac_cv_prog_cc_cross
1407
1408 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1409 echo "configure:1410: checking for Cygwin environment" >&5
1410 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1411   echo $ac_n "(cached) $ac_c" 1>&6
1412 else
1413   cat > conftest.$ac_ext <<EOF
1414 #line 1415 "configure"
1415 #include "confdefs.h"
1416
1417 int main() {
1418
1419 #ifndef __CYGWIN__
1420 #define __CYGWIN__ __CYGWIN32__
1421 #endif
1422 return __CYGWIN__;
1423 ; return 0; }
1424 EOF
1425 if { (eval echo configure:1426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1426   rm -rf conftest*
1427   ac_cv_cygwin=yes
1428 else
1429   echo "configure: failed program was:" >&5
1430   cat conftest.$ac_ext >&5
1431   rm -rf conftest*
1432   ac_cv_cygwin=no
1433 fi
1434 rm -f conftest*
1435 rm -f conftest*
1436 fi
1437
1438 echo "$ac_t""$ac_cv_cygwin" 1>&6
1439 CYGWIN=
1440 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1441 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1442 echo "configure:1443: checking for mingw32 environment" >&5
1443 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1444   echo $ac_n "(cached) $ac_c" 1>&6
1445 else
1446   cat > conftest.$ac_ext <<EOF
1447 #line 1448 "configure"
1448 #include "confdefs.h"
1449
1450 int main() {
1451 return __MINGW32__;
1452 ; return 0; }
1453 EOF
1454 if { (eval echo configure:1455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1455   rm -rf conftest*
1456   ac_cv_mingw32=yes
1457 else
1458   echo "configure: failed program was:" >&5
1459   cat conftest.$ac_ext >&5
1460   rm -rf conftest*
1461   ac_cv_mingw32=no
1462 fi
1463 rm -f conftest*
1464 rm -f conftest*
1465 fi
1466
1467 echo "$ac_t""$ac_cv_mingw32" 1>&6
1468 MINGW32=
1469 test "$ac_cv_mingw32" = yes && MINGW32=yes
1470
1471
1472 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1473 echo "configure:1474: checking for executable suffix" >&5
1474 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1475   echo $ac_n "(cached) $ac_c" 1>&6
1476 else
1477   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1478   ac_cv_exeext=.exe
1479 else
1480   rm -f conftest*
1481   echo 'int main () { return 0; }' > conftest.$ac_ext
1482   ac_cv_exeext=
1483   if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1484     for file in conftest.*; do
1485       case $file in
1486       *.c | *.o | *.obj) ;;
1487       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1488       esac
1489     done
1490   else
1491     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1492   fi
1493   rm -f conftest*
1494   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1495 fi
1496 fi
1497
1498 EXEEXT=""
1499 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1500 echo "$ac_t""${ac_cv_exeext}" 1>&6
1501 ac_exeext=$EXEEXT
1502
1503 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1504 echo "configure:1505: checking how to run the C preprocessor" >&5
1505 # On Suns, sometimes $CPP names a directory.
1506 if test -n "$CPP" && test -d "$CPP"; then
1507   CPP=
1508 fi
1509 if test -z "$CPP"; then
1510 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1511   echo $ac_n "(cached) $ac_c" 1>&6
1512 else
1513     # This must be in double quotes, not single quotes, because CPP may get
1514   # substituted into the Makefile and "${CC-cc}" will confuse make.
1515   CPP="${CC-cc} -E"
1516   # On the NeXT, cc -E runs the code through the compiler's parser,
1517   # not just through cpp.
1518   cat > conftest.$ac_ext <<EOF
1519 #line 1520 "configure"
1520 #include "confdefs.h"
1521 #include <assert.h>
1522 Syntax Error
1523 EOF
1524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1525 { (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1526 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1527 if test -z "$ac_err"; then
1528   :
1529 else
1530   echo "$ac_err" >&5
1531   echo "configure: failed program was:" >&5
1532   cat conftest.$ac_ext >&5
1533   rm -rf conftest*
1534   CPP="${CC-cc} -E -traditional-cpp"
1535   cat > conftest.$ac_ext <<EOF
1536 #line 1537 "configure"
1537 #include "confdefs.h"
1538 #include <assert.h>
1539 Syntax Error
1540 EOF
1541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1542 { (eval echo configure:1543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1544 if test -z "$ac_err"; then
1545   :
1546 else
1547   echo "$ac_err" >&5
1548   echo "configure: failed program was:" >&5
1549   cat conftest.$ac_ext >&5
1550   rm -rf conftest*
1551   CPP="${CC-cc} -nologo -E"
1552   cat > conftest.$ac_ext <<EOF
1553 #line 1554 "configure"
1554 #include "confdefs.h"
1555 #include <assert.h>
1556 Syntax Error
1557 EOF
1558 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1559 { (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1560 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1561 if test -z "$ac_err"; then
1562   :
1563 else
1564   echo "$ac_err" >&5
1565   echo "configure: failed program was:" >&5
1566   cat conftest.$ac_ext >&5
1567   rm -rf conftest*
1568   CPP=/lib/cpp
1569 fi
1570 rm -f conftest*
1571 fi
1572 rm -f conftest*
1573 fi
1574 rm -f conftest*
1575   ac_cv_prog_CPP="$CPP"
1576 fi
1577   CPP="$ac_cv_prog_CPP"
1578 else
1579   ac_cv_prog_CPP="$CPP"
1580 fi
1581 echo "$ac_t""$CPP" 1>&6
1582
1583 if test $ac_cv_prog_gcc = yes; then
1584     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
1585 echo "configure:1586: checking whether ${CC-cc} needs -traditional" >&5
1586 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
1587   echo $ac_n "(cached) $ac_c" 1>&6
1588 else
1589     ac_pattern="Autoconf.*'x'"
1590   cat > conftest.$ac_ext <<EOF
1591 #line 1592 "configure"
1592 #include "confdefs.h"
1593 #include <sgtty.h>
1594 Autoconf TIOCGETP
1595 EOF
1596 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1597   egrep "$ac_pattern" >/dev/null 2>&1; then
1598   rm -rf conftest*
1599   ac_cv_prog_gcc_traditional=yes
1600 else
1601   rm -rf conftest*
1602   ac_cv_prog_gcc_traditional=no
1603 fi
1604 rm -f conftest*
1605
1606
1607   if test $ac_cv_prog_gcc_traditional = no; then
1608     cat > conftest.$ac_ext <<EOF
1609 #line 1610 "configure"
1610 #include "confdefs.h"
1611 #include <termio.h>
1612 Autoconf TCGETA
1613 EOF
1614 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1615   egrep "$ac_pattern" >/dev/null 2>&1; then
1616   rm -rf conftest*
1617   ac_cv_prog_gcc_traditional=yes
1618 fi
1619 rm -f conftest*
1620
1621   fi
1622 fi
1623
1624 echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
1625   if test $ac_cv_prog_gcc_traditional = yes; then
1626     CC="$CC -traditional"
1627   fi
1628 fi
1629
1630
1631
1632 # Create compiler version string
1633 if test x"$GCC" = x"yes" ; then
1634   cc_string="GCC `${CC} --version`"
1635 else
1636   cc_string=$CC
1637 fi
1638 cat >> confdefs.h <<EOF
1639 #define PG_VERSION_STR "PostgreSQL $VERSION on $host, compiled by $cc_string"
1640 EOF
1641
1642
1643
1644 #
1645 # Automatic dependency tracking
1646 #
1647 # Check whether --enable-depend was given
1648 if test x"${enable_depend+set}" = xset; then
1649   case $enable_depend in
1650     yes)
1651       autodepend=yes
1652       ;;
1653     no)
1654       :
1655       ;;
1656     *)
1657       enableval=$enable_depend
1658       { echo "configure: error: no argument expected for --enable-depend option" 1>&2; exit 1; }
1659       ;;
1660   esac # $enable_depend
1661 else
1662   enable_depend=no
1663
1664 fi
1665
1666
1667
1668 #
1669 # Enable assert checks
1670 #
1671 # Check whether --enable-cassert was given
1672 if test x"${enable_cassert+set}" = xset; then
1673   case $enable_cassert in
1674     yes)
1675       cat >> confdefs.h <<\EOF
1676 #define USE_ASSERT_CHECKING 1
1677 EOF
1678
1679       ;;
1680     no)
1681       :
1682       ;;
1683     *)
1684       enableval=$enable_cassert
1685       { echo "configure: error: no argument expected for --enable-cassert option" 1>&2; exit 1; }
1686       ;;
1687   esac # $enable_cassert
1688 else
1689   enable_cassert=no
1690
1691 fi
1692
1693
1694 #
1695 # Include directories
1696 #
1697 ac_save_IFS=$IFS
1698 IFS="${IFS}:"
1699 # SRCH_INC comes from the template file
1700 for dir in $with_includes $SRCH_INC; do
1701   if test -d "$dir"; then
1702     INCLUDES="$INCLUDES -I$dir"
1703   else
1704     echo "configure: warning: *** Include directory $dir does not exist." 1>&2
1705   fi
1706 done
1707 IFS=$ac_save_IFS
1708
1709
1710
1711 #
1712 # Library directories
1713 #
1714 ac_save_IFS=$IFS
1715 IFS="${IFS}:"
1716 # LIBRARY_DIRS comes from command line, SRCH_LIB from template file.
1717 for dir in $LIBRARY_DIRS $SRCH_LIB; do
1718   if test -d "$dir"; then
1719     LIBDIRS="$LIBDIRS -L$dir"
1720   else
1721     echo "configure: warning: *** Library directory $dir does not exist." 1>&2
1722   fi
1723 done
1724 IFS=$ac_save_IFS
1725
1726
1727 #
1728 # Tcl/Tk
1729 #
1730 echo $ac_n "checking whether to build with Tcl""... $ac_c" 1>&6
1731 echo "configure:1732: checking whether to build with Tcl" >&5
1732 # Check whether --with-tcl was given
1733 if test x"${with_tcl+set}" = xset; then
1734   case $with_tcl in
1735     yes)
1736       :
1737       ;;
1738     no)
1739       :
1740       ;;
1741     *)
1742       withval=$with_tcl
1743       { echo "configure: error: no argument expected for --with-tcl option" 1>&2; exit 1; }
1744       ;;
1745   esac # $with_tcl
1746 else
1747   with_tcl=no
1748
1749 fi
1750 echo "$ac_t""$with_tcl" 1>&6
1751
1752
1753 # If Tcl is enabled (above) then Tk is also, unless the user disables it using --without-tk
1754 echo $ac_n "checking whether to build with Tk""... $ac_c" 1>&6
1755 echo "configure:1756: checking whether to build with Tk" >&5
1756 if test "$with_tcl" = yes; then
1757   # Check whether --with-tk was given
1758 if test x"${with_tk+set}" = xset; then
1759   case $with_tk in
1760     yes)
1761       :
1762       ;;
1763     no)
1764       :
1765       ;;
1766     *)
1767       withval=$with_tk
1768       { echo "configure: error: no argument expected for --with-tk option" 1>&2; exit 1; }
1769       ;;
1770   esac # $with_tk
1771 else
1772   with_tk=yes
1773
1774 fi
1775 else
1776   with_tk=no
1777 fi
1778 echo "$ac_t""$with_tk" 1>&6
1779
1780
1781
1782 # We see if the path to the TCL/TK configuration scripts is specified.
1783 # This will override the use of tclsh to find the paths to search.
1784
1785 # Check whether --with-tclconfig was given
1786 if test x"${with_tclconfig+set}" = xset; then
1787   case $with_tclconfig in
1788     yes)
1789       { echo "configure: error: argument required for --with-tclconfig option" 1>&2; exit 1; }
1790       ;;
1791     no)
1792       { echo "configure: error: argument required for --with-tclconfig option" 1>&2; exit 1; }
1793       ;;
1794   esac # $with_tclconfig
1795 fi
1796
1797 # We see if the path to the TK configuration scripts is specified.
1798 # This will override the use of tclsh to find the paths to search.
1799
1800 # Check whether --with-tkconfig was given
1801 if test x"${with_tkconfig+set}" = xset; then
1802   case $with_tkconfig in
1803     yes)
1804       { echo "configure: error: argument required for --with-tkconfig option" 1>&2; exit 1; }
1805       ;;
1806     no)
1807       { echo "configure: error: argument required for --with-tkconfig option" 1>&2; exit 1; }
1808       ;;
1809   esac # $with_tkconfig
1810 fi
1811
1812
1813 #
1814 # If Tcl is enabled (above) then check for pltcl_unknown_support
1815 #
1816 echo $ac_n "checking whether to build with PL/Tcl unknown support""... $ac_c" 1>&6
1817 echo "configure:1818: checking whether to build with PL/Tcl unknown support" >&5
1818 if test "$with_tcl" = yes; then
1819   # Check whether --enable-pltcl-unknown was given
1820 if test x"${enable_pltcl_unknown+set}" = xset; then
1821   case $enable_pltcl_unknown in
1822     yes)
1823       cat >> confdefs.h <<\EOF
1824 #define ENABLE_PLTCL_UNKNOWN 1
1825 EOF
1826
1827       ;;
1828     no)
1829       :
1830       ;;
1831     *)
1832       enableval=$enable_pltcl_unknown
1833       { echo "configure: error: no argument expected for --enable-pltcl-unknown option" 1>&2; exit 1; }
1834       ;;
1835   esac # $enable_pltcl_unknown
1836 else
1837   enable_pltcl_unknown=no
1838
1839 fi
1840 else
1841   enable_pltcl_unknown=no
1842 fi
1843 echo "$ac_t""$enable_pltcl_unknown" 1>&6
1844
1845
1846
1847 #
1848 # If Tcl is enabled (above) then check for pltcl_utf
1849 #
1850 echo $ac_n "checking whether to build with PL/Tcl with UTF support""... $ac_c" 1>&6
1851 echo "configure:1852: checking whether to build with PL/Tcl with UTF support" >&5
1852 if test "$with_tcl" = yes; then
1853   # Check whether --enable-pltcl-utf was given
1854 if test x"${enable_pltcl_utf+set}" = xset; then
1855   case $enable_pltcl_utf in
1856     yes)
1857       cat >> confdefs.h <<\EOF
1858 #define ENABLE_PLTCL_UTF 1
1859 EOF
1860
1861       ;;
1862     no)
1863       :
1864       ;;
1865     *)
1866       enableval=$enable_pltcl_utf
1867       { echo "configure: error: no argument expected for --enable-pltcl-utf option" 1>&2; exit 1; }
1868       ;;
1869   esac # $enable_pltcl_utf
1870 else
1871   enable_pltcl_utf=no
1872
1873 fi
1874 else
1875   enable_pltcl_utf=no
1876 fi
1877 echo "$ac_t""$enable_pltcl_utf" 1>&6
1878
1879
1880
1881 #
1882 # Optionally build Perl modules (Pg.pm and PL/Perl)
1883 #
1884 echo $ac_n "checking whether to build Perl modules""... $ac_c" 1>&6
1885 echo "configure:1886: checking whether to build Perl modules" >&5
1886 # Check whether --with-perl was given
1887 if test x"${with_perl+set}" = xset; then
1888   case $with_perl in
1889     yes)
1890       :
1891       ;;
1892     no)
1893       :
1894       ;;
1895     *)
1896       withval=$with_perl
1897       { echo "configure: error: no argument expected for --with-perl option" 1>&2; exit 1; }
1898       ;;
1899   esac # $with_perl
1900 else
1901   with_perl=no
1902
1903 fi
1904 echo "$ac_t""$with_perl" 1>&6
1905
1906
1907 #
1908 # Optionally build Python interface module
1909 #
1910 echo $ac_n "checking whether to build Python modules""... $ac_c" 1>&6
1911 echo "configure:1912: checking whether to build Python modules" >&5
1912 # Check whether --with-python was given
1913 if test x"${with_python+set}" = xset; then
1914   case $with_python in
1915     yes)
1916       :
1917       ;;
1918     no)
1919       :
1920       ;;
1921     *)
1922       withval=$with_python
1923       { echo "configure: error: no argument expected for --with-python option" 1>&2; exit 1; }
1924       ;;
1925   esac # $with_python
1926 else
1927   with_python=no
1928
1929 fi
1930 echo "$ac_t""$with_python" 1>&6
1931
1932
1933 #
1934 # Optionally build the Java/JDBC tools
1935 #
1936 echo $ac_n "checking whether to build Java/JDBC tools""... $ac_c" 1>&6
1937 echo "configure:1938: checking whether to build Java/JDBC tools" >&5
1938 # Check whether --with-java was given
1939 if test x"${with_java+set}" = xset; then
1940   case $with_java in
1941     yes)
1942       echo "$ac_t""yes" 1>&6
1943
1944   for ac_prog in jakarta-ant ant ant.sh ant.bat
1945 do
1946 # Extract the first word of "$ac_prog", so it can be a program name with args.
1947 set dummy $ac_prog; ac_word=$2
1948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1949 echo "configure:1950: checking for $ac_word" >&5
1950 if eval "test \"`echo '$''{'ac_cv_path_ANT'+set}'`\" = set"; then
1951   echo $ac_n "(cached) $ac_c" 1>&6
1952 else
1953   case "$ANT" in
1954   /*)
1955   ac_cv_path_ANT="$ANT" # Let the user override the test with a path.
1956   ;;
1957   ?:/*)                  
1958   ac_cv_path_ANT="$ANT" # Let the user override the test with a dos path.
1959   ;;
1960   *)
1961   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1962   ac_dummy="$PATH"
1963   for ac_dir in $ac_dummy; do 
1964     test -z "$ac_dir" && ac_dir=.
1965     if test -f $ac_dir/$ac_word; then
1966       ac_cv_path_ANT="$ac_dir/$ac_word"
1967       break
1968     fi
1969   done
1970   IFS="$ac_save_ifs"
1971   ;;
1972 esac
1973 fi
1974 ANT="$ac_cv_path_ANT"
1975 if test -n "$ANT"; then
1976   echo "$ac_t""$ANT" 1>&6
1977 else
1978   echo "$ac_t""no" 1>&6
1979 fi
1980
1981 test -n "$ANT" && break
1982 done
1983
1984   
1985   echo $ac_n "checking whether $ANT works""... $ac_c" 1>&6
1986 echo "configure:1987: checking whether $ANT works" >&5
1987 if eval "test \"`echo '$''{'pgac_cv_prog_ant_works'+set}'`\" = set"; then
1988   echo $ac_n "(cached) $ac_c" 1>&6
1989 else
1990   
1991     cat > conftest.java << EOF
1992 public class conftest {
1993     int testmethod(int a, int b) {
1994         return a + b;
1995     }
1996 }
1997 EOF
1998
1999     cat > conftest.xml << EOF
2000 <project name="conftest" default="conftest">
2001  <target name="conftest">
2002   <javac srcdir="." includes="conftest.java">
2003   </javac>
2004  </target>
2005 </project>
2006 EOF
2007
2008     pgac_cmd='$ANT -buildfile conftest.xml 1>&2'
2009     { (eval echo configure:2010: \"$pgac_cmd\") 1>&5; (eval $pgac_cmd) 2>&5; }
2010     pgac_save_status=$?
2011     if test $? = 0 && test -f ./conftest.class ; then
2012       pgac_cv_prog_ant_works=yes
2013     else
2014       echo "configure: failed java program was:" >&5
2015       cat conftest.java >&5
2016       echo "configure: failed build file was:" >&5
2017       cat conftest.xml >&5
2018       pgac_cv_prog_ant_works=no
2019     fi
2020
2021     rm -f conftest* core core.* *.core
2022   
2023 fi
2024
2025 echo "$ac_t""$pgac_cv_prog_ant_works" 1>&6
2026
2027   if test "$pgac_cv_prog_ant_works" != yes; then
2028     { echo "configure: error: ant does not work" 1>&2; exit 1; }
2029   fi
2030
2031
2032 if test -z "$ANT"; then
2033   { echo "configure: error: Ant is required to build Java components" 1>&2; exit 1; }
2034 fi
2035       ;;
2036     no)
2037       echo "$ac_t""no" 1>&6
2038       ;;
2039     *)
2040       withval=$with_java
2041       { echo "configure: error: no argument expected for --with-java option" 1>&2; exit 1; }
2042       ;;
2043   esac # $with_java
2044 else
2045   with_java=no
2046 echo "$ac_t""no" 1>&6
2047 fi
2048
2049
2050
2051 #
2052 # Kerberos 4
2053 #
2054 # Check whether --with-krb4 was given
2055 if test x"${with_krb4+set}" = xset; then
2056   case $with_krb4 in
2057     yes)
2058       krb4_prefix=/usr/athena
2059       ;;
2060     no)
2061       :
2062       ;;
2063     *)
2064       withval=$with_krb4
2065       with_krb4=yes
2066 krb4_prefix=$withval
2067       ;;
2068   esac # $with_krb4
2069 else
2070   with_krb4=no
2071 fi
2072
2073 if test "$with_krb4" = yes; then
2074   
2075   echo "$ac_t""building with Kerberos 4 support" 1>&6
2076   cat >> confdefs.h <<\EOF
2077 #define KRB4 1
2078 EOF
2079
2080
2081   if test -d "$krb4_prefix/include"; then
2082     INCLUDES="$INCLUDES -I$krb4_prefix/include"
2083   fi
2084   if test -d "$krb4_prefix/lib"; then
2085     LIBDIRS="$LIBDIRS -L$krb4_prefix/lib"
2086   fi
2087
2088   krb_srvtab="/etc/srvtab"
2089
2090 fi
2091
2092
2093
2094
2095
2096 #
2097 # Kerberos 5
2098 #
2099 # Check whether --with-krb5 was given
2100 if test x"${with_krb5+set}" = xset; then
2101   case $with_krb5 in
2102     yes)
2103       krb5_prefix=/usr/athena
2104       ;;
2105     no)
2106       :
2107       ;;
2108     *)
2109       withval=$with_krb5
2110       with_krb5=yes
2111 krb5_prefix=$withval
2112       ;;
2113   esac # $with_krb5
2114 else
2115   with_krb5=no
2116 fi
2117
2118 if test "$with_krb5" = yes; then
2119   
2120   echo "$ac_t""building with Kerberos 5 support" 1>&6
2121   cat >> confdefs.h <<\EOF
2122 #define KRB5 1
2123 EOF
2124
2125
2126   if test -d "$krb5_prefix/include"; then
2127     INCLUDES="$INCLUDES -I$krb5_prefix/include"
2128   fi
2129   if test -d "$krb5_prefix/lib"; then
2130     LIBDIRS="$LIBDIRS -L$krb5_prefix/lib"
2131   fi
2132
2133   krb_srvtab="FILE:\$(sysconfdir)/krb5.keytab"
2134
2135 fi
2136
2137
2138
2139
2140
2141 # Using both Kerberos 4 and Kerberos 5 at the same time isn't going to work.
2142 if test "$with_krb4" = yes && test "$with_krb5" = yes ; then
2143   { echo "configure: error: Kerberos 4 and Kerberos 5 support cannot be combined" 1>&2; exit 1; }
2144 fi
2145
2146
2147
2148
2149 #
2150 # Kerberos configuration parameters
2151 #
2152 # Check whether --with-krb-srvnam was given
2153 if test x"${with_krb_srvnam+set}" = xset; then
2154   case $with_krb_srvnam in
2155     yes)
2156       { echo "configure: error: argument required for --with-krb-srvnam option" 1>&2; exit 1; }
2157       ;;
2158     no)
2159       { echo "configure: error: argument required for --with-krb-srvnam option" 1>&2; exit 1; }
2160       ;;
2161   esac # $with_krb_srvnam
2162 else
2163   with_krb_srvnam="postgres"
2164 fi
2165 cat >> confdefs.h <<EOF
2166 #define PG_KRB_SRVNAM "$with_krb_srvnam"
2167 EOF
2168
2169
2170
2171 #
2172 # PAM
2173 #
2174 echo $ac_n "checking whether to build with PAM support""... $ac_c" 1>&6
2175 echo "configure:2176: checking whether to build with PAM support" >&5
2176 # Check whether --with-pam was given
2177 if test x"${with_pam+set}" = xset; then
2178   case $with_pam in
2179     yes)
2180       pam_prefix=/usr
2181       ;;
2182     no)
2183       :
2184       ;;
2185     *)
2186       withval=$with_pam
2187       with_pam=yes
2188 pam_prefix=$withval
2189       ;;
2190   esac # $with_pam
2191 else
2192   with_pam=no
2193 fi
2194
2195 if test "$with_pam" = yes; then
2196   
2197   echo "$ac_t""yes" 1>&6
2198   cat >> confdefs.h <<\EOF
2199 #define USE_PAM 1
2200 EOF
2201
2202
2203
2204 else
2205   echo "$ac_t""no" 1>&6
2206 fi
2207
2208
2209
2210
2211
2212 #
2213 # OpenSSL
2214 #
2215 # Check whether --with-openssl was given
2216 if test x"${with_openssl+set}" = xset; then
2217   case $with_openssl in
2218     yes)
2219       openssl_prefix=/usr/local/ssl
2220       ;;
2221     no)
2222       :
2223       ;;
2224     *)
2225       withval=$with_openssl
2226       with_openssl=yes
2227 openssl_prefix=$withval
2228       ;;
2229   esac # $with_openssl
2230 else
2231   with_openssl=no
2232 fi
2233
2234 if test "$with_openssl" = yes; then
2235   
2236   echo "$ac_t""building with OpenSSL support" 1>&6
2237   cat >> confdefs.h <<\EOF
2238 #define USE_SSL 1
2239 EOF
2240
2241
2242   if test -d "${openssl_prefix}/include" ; then
2243     INCLUDES="$INCLUDES -I${openssl_prefix}/include"
2244   fi
2245   if test -d "${openssl_prefix}/lib" ; then
2246     LIBDIRS="$LIBDIRS -L${openssl_prefix}/lib"
2247   fi
2248
2249 fi
2250
2251
2252
2253
2254
2255
2256 #
2257 # Optionally enable the building of the ODBC driver
2258 #
2259  
2260 # Old option name
2261 if test "${with_odbc+set}" = set && test "${enable_odbc+set}" != set; then
2262   enable_odbc=$with_odbc
2263 fi
2264  
2265 echo $ac_n "checking whether to build the ODBC driver""... $ac_c" 1>&6
2266 echo "configure:2267: checking whether to build the ODBC driver" >&5
2267 # Check whether --enable-odbc was given
2268 if test x"${enable_odbc+set}" = xset; then
2269   case $enable_odbc in
2270     yes)
2271       :
2272       ;;
2273     no)
2274       :
2275       ;;
2276     *)
2277       enableval=$enable_odbc
2278       { echo "configure: error: no argument expected for --enable-odbc option" 1>&2; exit 1; }
2279       ;;
2280   esac # $enable_odbc
2281 else
2282   enable_odbc=no
2283
2284 fi
2285 # Check whether --with-unixodbc was given
2286 if test x"${with_unixodbc+set}" = xset; then
2287   case $with_unixodbc in
2288     yes)
2289       :
2290       ;;
2291     no)
2292       :
2293       ;;
2294     *)
2295       withval=$with_unixodbc
2296       { echo "configure: error: no argument expected for --with-unixodbc option" 1>&2; exit 1; }
2297       ;;
2298   esac # $with_unixodbc
2299 else
2300   with_unixodbc=no
2301
2302 fi
2303 # Check whether --with-iodbc was given
2304 if test x"${with_iodbc+set}" = xset; then
2305   case $with_iodbc in
2306     yes)
2307       :
2308       ;;
2309     no)
2310       :
2311       ;;
2312     *)
2313       withval=$with_iodbc
2314       { echo "configure: error: no argument expected for --with-iodbc option" 1>&2; exit 1; }
2315       ;;
2316   esac # $with_iodbc
2317 else
2318   with_iodbc=no
2319
2320 fi
2321 if test "$with_unixodbc" = yes && test "$with_iodbc" = yes; then
2322   { echo "configure: error: ODBC driver cannot be built for both unixODBC and iODBC" 1>&2; exit 1; }
2323 fi
2324 if test "$with_unixodbc" = yes || test "$with_iodbc" = yes; then
2325   enable_odbc=yes
2326 fi
2327 case $enable_odbc:$with_unixodbc:$with_iodbc in
2328   yes:no:no)    echo "$ac_t""yes (stand-alone)" 1>&6;;
2329   yes:yes:no)   echo "$ac_t""yes (unixODBC)" 1>&6; cat >> confdefs.h <<\EOF
2330 #define WITH_UNIXODBC 1
2331 EOF
2332 ;;
2333   yes:no:yes)   echo "$ac_t""yes (iODBC)" 1>&6; cat >> confdefs.h <<\EOF
2334 #define WITH_IODBC 1
2335 EOF
2336 ;;
2337   no:*)         echo "$ac_t""no" 1>&6;;
2338 esac
2339
2340
2341
2342
2343
2344 # Allow for overriding the default location of the odbcinst.ini
2345 # file which is normally ${sysconfdir} (i.e., ${prefix}/etc).
2346 # Check whether --with-odbcinst was given
2347 if test x"${with_odbcinst+set}" = xset; then
2348   case $with_odbcinst in
2349     yes)
2350       { echo "configure: error: argument required for --with-odbcinst option" 1>&2; exit 1; }
2351       ;;
2352     no)
2353       { echo "configure: error: argument required for --with-odbcinst option" 1>&2; exit 1; }
2354       ;;
2355     *)
2356       withval=$with_odbcinst
2357       odbcinst_ini_dir=$withval
2358       ;;
2359   esac # $with_odbcinst
2360 else
2361   odbcinst_ini_dir="\${sysconfdir}"
2362 fi
2363
2364
2365
2366
2367 # Assume system is ELF if it predefines __ELF__ as 1,
2368 # otherwise believe host_os based default.
2369 case $host_os in
2370     freebsd1*|freebsd2*) elf=no;;
2371     freebsd3*|freebsd4*) elf=yes;;
2372 esac
2373
2374 cat > conftest.$ac_ext <<EOF
2375 #line 2376 "configure"
2376 #include "confdefs.h"
2377 #if __ELF__
2378   yes
2379 #endif
2380
2381 EOF
2382 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2383   egrep "yes" >/dev/null 2>&1; then
2384   rm -rf conftest*
2385   ELF_SYS=true
2386 else
2387   rm -rf conftest*
2388   if test "X$elf" = "Xyes" ; then
2389   ELF_SYS=true
2390 else
2391   ELF_SYS=
2392 fi
2393 fi
2394 rm -f conftest*
2395
2396
2397
2398
2399
2400 #
2401 # Optionally build C++ code (i.e., libpq++)
2402 #
2403 echo $ac_n "checking whether to build C++ modules""... $ac_c" 1>&6
2404 echo "configure:2405: checking whether to build C++ modules" >&5
2405 # Check whether --with-CXX was given
2406 if test x"${with_CXX+set}" = xset; then
2407   case $with_CXX in
2408     yes)
2409       :
2410       ;;
2411     no)
2412       :
2413       ;;
2414     *)
2415       withval=$with_CXX
2416       with_CXX=yes
2417 CXX=$withval
2418       ;;
2419   esac # $with_CXX
2420 else
2421   with_CXX=no
2422 fi
2423
2424 if test "$with_CXX" = yes; then
2425   
2426   echo "$ac_t""yes" 1>&6
2427
2428   # If the user has specified CXXFLAGS in the environment, leave it
2429   # alone, else use a default.
2430
2431   has_environ_CXXFLAGS="${CXXFLAGS+yes}"
2432   for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
2433 do
2434 # Extract the first word of "$ac_prog", so it can be a program name with args.
2435 set dummy $ac_prog; ac_word=$2
2436 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2437 echo "configure:2438: checking for $ac_word" >&5
2438 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
2439   echo $ac_n "(cached) $ac_c" 1>&6
2440 else
2441   if test -n "$CXX"; then
2442   ac_cv_prog_CXX="$CXX" # Let the user override the test.
2443 else
2444   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2445   ac_dummy="$PATH"
2446   for ac_dir in $ac_dummy; do
2447     test -z "$ac_dir" && ac_dir=.
2448     if test -f $ac_dir/$ac_word; then
2449       ac_cv_prog_CXX="$ac_prog"
2450       break
2451     fi
2452   done
2453   IFS="$ac_save_ifs"
2454 fi
2455 fi
2456 CXX="$ac_cv_prog_CXX"
2457 if test -n "$CXX"; then
2458   echo "$ac_t""$CXX" 1>&6
2459 else
2460   echo "$ac_t""no" 1>&6
2461 fi
2462
2463 test -n "$CXX" && break
2464 done
2465 test -n "$CXX" || CXX="gcc"
2466
2467
2468 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2469 echo "configure:2470: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
2470
2471 ac_ext=C
2472 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2473 ac_cpp='$CXXCPP $CPPFLAGS'
2474 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2475 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2476 cross_compiling=$ac_cv_prog_cxx_cross
2477
2478 cat > conftest.$ac_ext << EOF
2479
2480 #line 2481 "configure"
2481 #include "confdefs.h"
2482
2483 int main(){return(0);}
2484 EOF
2485 if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2486   ac_cv_prog_cxx_works=yes
2487   # If we can't run a trivial program, we are probably using a cross compiler.
2488   if (./conftest; exit) 2>/dev/null; then
2489     ac_cv_prog_cxx_cross=no
2490   else
2491     ac_cv_prog_cxx_cross=yes
2492   fi
2493 else
2494   echo "configure: failed program was:" >&5
2495   cat conftest.$ac_ext >&5
2496   ac_cv_prog_cxx_works=no
2497 fi
2498 rm -fr conftest*
2499 ac_ext=c
2500 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2501 ac_cpp='$CPP $CPPFLAGS'
2502 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2503 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2504 cross_compiling=$ac_cv_prog_cc_cross
2505
2506 echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
2507 if test $ac_cv_prog_cxx_works = no; then
2508   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
2509 fi
2510 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2511 echo "configure:2512: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
2512 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
2513 cross_compiling=$ac_cv_prog_cxx_cross
2514
2515 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
2516 echo "configure:2517: checking whether we are using GNU C++" >&5
2517 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
2518   echo $ac_n "(cached) $ac_c" 1>&6
2519 else
2520   cat > conftest.C <<EOF
2521 #ifdef __GNUC__
2522   yes;
2523 #endif
2524 EOF
2525 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2526   ac_cv_prog_gxx=yes
2527 else
2528   ac_cv_prog_gxx=no
2529 fi
2530 fi
2531
2532 echo "$ac_t""$ac_cv_prog_gxx" 1>&6
2533
2534 if test $ac_cv_prog_gxx = yes; then
2535   GXX=yes
2536 else
2537   GXX=
2538 fi
2539
2540 ac_test_CXXFLAGS="${CXXFLAGS+set}"
2541 ac_save_CXXFLAGS="$CXXFLAGS"
2542 CXXFLAGS=
2543 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
2544 echo "configure:2545: checking whether ${CXX-g++} accepts -g" >&5
2545 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
2546   echo $ac_n "(cached) $ac_c" 1>&6
2547 else
2548   echo 'void f(){}' > conftest.cc
2549 if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
2550   ac_cv_prog_cxx_g=yes
2551 else
2552   ac_cv_prog_cxx_g=no
2553 fi
2554 rm -f conftest*
2555
2556 fi
2557
2558 echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
2559 if test "$ac_test_CXXFLAGS" = set; then
2560   CXXFLAGS="$ac_save_CXXFLAGS"
2561 elif test $ac_cv_prog_cxx_g = yes; then
2562   if test "$GXX" = yes; then
2563     CXXFLAGS="-g -O2"
2564   else
2565     CXXFLAGS="-g"
2566   fi
2567 else
2568   if test "$GXX" = yes; then
2569     CXXFLAGS="-O2"
2570   else
2571     CXXFLAGS=
2572   fi
2573 fi
2574
2575   if test "$has_environ_CXXFLAGS" != yes; then
2576     if test "$GXX" = yes; then
2577       CXXFLAGS=-O2
2578     else
2579       case $template in
2580         osf)            CXXFLAGS='-O4 -Olimit 2000' ;;
2581         unixware)       CXXFLAGS='-O' ;;
2582         *)              CXXFLAGS= ;;
2583       esac
2584     fi
2585   fi
2586   if test "$enable_debug" = yes && test "$ac_cv_prog_cxx_g" = yes; then
2587     CXXFLAGS="$CXXFLAGS -g"
2588   fi
2589   echo "using CXXFLAGS=$CXXFLAGS"
2590
2591   echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
2592 echo "configure:2593: checking how to run the C++ preprocessor" >&5
2593 if test -z "$CXXCPP"; then
2594 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
2595   echo $ac_n "(cached) $ac_c" 1>&6
2596 else
2597   ac_ext=C
2598 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2599 ac_cpp='$CXXCPP $CPPFLAGS'
2600 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2601 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2602 cross_compiling=$ac_cv_prog_cxx_cross
2603   CXXCPP="${CXX-g++} -E"
2604   cat > conftest.$ac_ext <<EOF
2605 #line 2606 "configure"
2606 #include "confdefs.h"
2607 #include <stdlib.h>
2608 EOF
2609 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2610 { (eval echo configure:2611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2611 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2612 if test -z "$ac_err"; then
2613   :
2614 else
2615   echo "$ac_err" >&5
2616   echo "configure: failed program was:" >&5
2617   cat conftest.$ac_ext >&5
2618   rm -rf conftest*
2619   CXXCPP=/lib/cpp
2620 fi
2621 rm -f conftest*
2622   ac_cv_prog_CXXCPP="$CXXCPP"
2623 ac_ext=c
2624 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2625 ac_cpp='$CPP $CPPFLAGS'
2626 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2627 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2628 cross_compiling=$ac_cv_prog_cc_cross
2629 fi
2630 fi
2631 CXXCPP="$ac_cv_prog_CXXCPP"
2632 echo "$ac_t""$CXXCPP" 1>&6
2633
2634   
2635   
2636 ac_ext=C
2637 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2638 ac_cpp='$CXXCPP $CPPFLAGS'
2639 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2640 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2641 cross_compiling=$ac_cv_prog_cxx_cross
2642
2643 ac_safe=`echo "string" | sed 'y%./+-%__p_%'`
2644 echo $ac_n "checking for string""... $ac_c" 1>&6
2645 echo "configure:2646: checking for string" >&5
2646 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2647   echo $ac_n "(cached) $ac_c" 1>&6
2648 else
2649   cat > conftest.$ac_ext <<EOF
2650 #line 2651 "configure"
2651 #include "confdefs.h"
2652 #include <string>
2653 EOF
2654 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2655 { (eval echo configure:2656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2656 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2657 if test -z "$ac_err"; then
2658   rm -rf conftest*
2659   eval "ac_cv_header_$ac_safe=yes"
2660 else
2661   echo "$ac_err" >&5
2662   echo "configure: failed program was:" >&5
2663   cat conftest.$ac_ext >&5
2664   rm -rf conftest*
2665   eval "ac_cv_header_$ac_safe=no"
2666 fi
2667 rm -f conftest*
2668 fi
2669 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2670   echo "$ac_t""yes" 1>&6
2671   cat >> confdefs.h <<\EOF
2672 #define HAVE_CXX_STRING_HEADER 1
2673 EOF
2674
2675 else
2676   echo "$ac_t""no" 1>&6
2677 fi
2678
2679
2680 if test x"$ac_cv_header_string" != xyes ; then
2681   echo $ac_n "checking for class string in <string.h>""... $ac_c" 1>&6
2682 echo "configure:2683: checking for class string in <string.h>" >&5
2683 if eval "test \"`echo '$''{'pgac_cv_class_string_in_string_h'+set}'`\" = set"; then
2684   echo $ac_n "(cached) $ac_c" 1>&6
2685 else
2686   cat > conftest.$ac_ext <<EOF
2687 #line 2688 "configure"
2688 #include "confdefs.h"
2689 #include <stdio.h>
2690 #include <stdlib.h>
2691 #include <string.h>
2692
2693 int main() {
2694 string foo = "test"
2695 ; return 0; }
2696 EOF
2697 if { (eval echo configure:2698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2698   rm -rf conftest*
2699   pgac_cv_class_string_in_string_h=yes
2700 else
2701   echo "configure: failed program was:" >&5
2702   cat conftest.$ac_ext >&5
2703   rm -rf conftest*
2704   pgac_cv_class_string_in_string_h=no
2705 fi
2706 rm -f conftest*
2707 fi
2708
2709 echo "$ac_t""$pgac_cv_class_string_in_string_h" 1>&6
2710
2711   if test x"$pgac_cv_class_string_in_string_h" != xyes ; then
2712     { echo "configure: error: neither <string> nor <string.h> seem to define the C++ class \`string\'" 1>&2; exit 1; }
2713   fi
2714 fi
2715 ac_ext=c
2716 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2717 ac_cpp='$CPP $CPPFLAGS'
2718 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2719 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2720 cross_compiling=$ac_cv_prog_cc_cross
2721
2722   
2723 echo $ac_n "checking for namespace std in C++""... $ac_c" 1>&6
2724 echo "configure:2725: checking for namespace std in C++" >&5
2725 if eval "test \"`echo '$''{'pgac_cv_cxx_namespace_std'+set}'`\" = set"; then
2726   echo $ac_n "(cached) $ac_c" 1>&6
2727 else
2728   
2729
2730 ac_ext=C
2731 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2732 ac_cpp='$CXXCPP $CPPFLAGS'
2733 ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2734 ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2735 cross_compiling=$ac_cv_prog_cxx_cross
2736
2737 cat > conftest.$ac_ext <<EOF
2738 #line 2739 "configure"
2739 #include "confdefs.h"
2740 #include <stdio.h>
2741 #include <stdlib.h>
2742 #ifdef HAVE_CXX_STRING_HEADER
2743 #include <string>
2744 #endif
2745 using namespace std;
2746
2747 int main() {
2748
2749 ; return 0; }
2750 EOF
2751 if { (eval echo configure:2752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2752   rm -rf conftest*
2753   pgac_cv_cxx_namespace_std=yes
2754 else
2755   echo "configure: failed program was:" >&5
2756   cat conftest.$ac_ext >&5
2757   rm -rf conftest*
2758   pgac_cv_cxx_namespace_std=no
2759 fi
2760 rm -f conftest*
2761 ac_ext=c
2762 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2763 ac_cpp='$CPP $CPPFLAGS'
2764 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2765 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2766 cross_compiling=$ac_cv_prog_cc_cross
2767
2768 fi
2769
2770 echo "$ac_t""$pgac_cv_cxx_namespace_std" 1>&6
2771
2772 if test $pgac_cv_cxx_namespace_std = yes ; then
2773     cat >> confdefs.h <<\EOF
2774 #define HAVE_NAMESPACE_STD 1
2775 EOF
2776
2777 fi
2778
2779 else
2780   echo "$ac_t""no" 1>&6
2781 fi
2782
2783
2784
2785 CPPFLAGS="$CPPFLAGS $INCLUDES"
2786 LDFLAGS="$LDFLAGS $LIBDIRS"
2787
2788 echo "using CPPFLAGS=$CPPFLAGS"
2789 echo "using LDFLAGS=$LDFLAGS"
2790
2791
2792 for ac_prog in mawk gawk nawk awk
2793 do
2794 # Extract the first word of "$ac_prog", so it can be a program name with args.
2795 set dummy $ac_prog; ac_word=$2
2796 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2797 echo "configure:2798: checking for $ac_word" >&5
2798 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2799   echo $ac_n "(cached) $ac_c" 1>&6
2800 else
2801   if test -n "$AWK"; then
2802   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2803 else
2804   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2805   ac_dummy="$PATH"
2806   for ac_dir in $ac_dummy; do
2807     test -z "$ac_dir" && ac_dir=.
2808     if test -f $ac_dir/$ac_word; then
2809       ac_cv_prog_AWK="$ac_prog"
2810       break
2811     fi
2812   done
2813   IFS="$ac_save_ifs"
2814 fi
2815 fi
2816 AWK="$ac_cv_prog_AWK"
2817 if test -n "$AWK"; then
2818   echo "$ac_t""$AWK" 1>&6
2819 else
2820   echo "$ac_t""no" 1>&6
2821 fi
2822
2823 test -n "$AWK" && break
2824 done
2825
2826 echo $ac_n "checking for flex""... $ac_c" 1>&6
2827 echo "configure:2828: checking for flex" >&5
2828 if eval "test \"`echo '$''{'pgac_cv_path_flex'+set}'`\" = set"; then
2829   echo $ac_n "(cached) $ac_c" 1>&6
2830 else
2831   # Let the user override the test
2832 if test -n "$FLEX"; then
2833   pgac_cv_path_flex=$FLEX
2834 else
2835   pgac_save_IFS=$IFS
2836   IFS=:
2837   for pgac_dir in $PATH; do
2838     if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
2839       pgac_dir=`pwd`
2840     fi
2841     for pgac_prog in flex lex; do
2842       pgac_candidate="$pgac_dir/$pgac_prog"
2843       if test -f "$pgac_candidate" \
2844         && $pgac_candidate --version </dev/null >/dev/null 2>&1
2845       then
2846         echo '%%'  > conftest.l
2847         if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
2848           if $pgac_candidate --version | grep '2\.5\.3' >/dev/null 2>&1; then
2849             pgac_broken_flex=$pgac_candidate
2850             continue
2851           fi
2852
2853           pgac_cv_path_flex=$pgac_candidate
2854           break 2
2855         fi
2856       fi
2857     done
2858   done
2859   IFS=$pgac_save_IFS
2860   rm -f conftest.l
2861   : ${pgac_cv_path_flex=no}
2862 fi
2863
2864 fi
2865
2866 echo "$ac_t""$pgac_cv_path_flex" 1>&6
2867 if test x"$pgac_cv_path_flex" = x"no"; then
2868   if test -n "$pgac_broken_flex"; then
2869     echo "configure: warning: 
2870 *** The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
2871 *** should get version 2.5.4 or later." 1>&2
2872   fi
2873
2874   echo "configure: warning: 
2875 *** Without Flex you will not be able to build PostgreSQL from CVS or
2876 *** change any of the scanner definition files.  You can obtain Flex from
2877 *** a GNU mirror site.  (If you are using the official distribution of
2878 *** PostgreSQL then you do not need to worry about this because the Flex
2879 *** output is pre-generated.)" 1>&2
2880 fi
2881
2882 if test x"$pgac_cv_path_flex" = x"no"; then
2883   FLEX=
2884 else
2885   FLEX=$pgac_cv_path_flex
2886 fi
2887
2888
2889
2890
2891 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2892 echo "configure:2893: checking whether ln -s works" >&5
2893 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2894   echo $ac_n "(cached) $ac_c" 1>&6
2895 else
2896   rm -f conftestdata
2897 if ln -s X conftestdata 2>/dev/null
2898 then
2899   rm -f conftestdata
2900   ac_cv_prog_LN_S="ln -s"
2901 else
2902   ac_cv_prog_LN_S=ln
2903 fi
2904 fi
2905 LN_S="$ac_cv_prog_LN_S"
2906 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2907   echo "$ac_t""yes" 1>&6
2908 else
2909   echo "$ac_t""no" 1>&6
2910 fi
2911
2912 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2913 if test "${with_gnu_ld+set}" = set; then
2914   withval="$with_gnu_ld"
2915   test "$withval" = no || with_gnu_ld=yes
2916 else
2917   with_gnu_ld=no
2918 fi
2919
2920 ac_prog=ld
2921 if test "$ac_cv_prog_gcc" = yes; then
2922   # Check if gcc -print-prog-name=ld gives a path.
2923   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2924 echo "configure:2925: checking for ld used by GCC" >&5
2925   case $host in
2926   *-*-mingw*)
2927     # gcc leaves a trailing carriage return which upsets mingw
2928     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2929   *)
2930     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2931   esac
2932   case "$ac_prog" in
2933     # Accept absolute paths.
2934     [\\/]* | [A-Za-z]:[\\/]*)
2935       re_direlt='/[^/][^/]*/\.\./'
2936       # Canonicalize the path of ld
2937       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2938       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2939         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2940       done
2941       test -z "$LD" && LD="$ac_prog"
2942       ;;
2943   "")
2944     # If it fails, then pretend we aren't using GCC.
2945     ac_prog=ld
2946     ;;
2947   *)
2948     # If it is relative, then search for the first ld in PATH.
2949     with_gnu_ld=unknown
2950     ;;
2951   esac
2952 elif test "$with_gnu_ld" = yes; then
2953   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2954 echo "configure:2955: checking for GNU ld" >&5
2955 else
2956   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2957 echo "configure:2958: checking for non-GNU ld" >&5
2958 fi
2959 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2960   echo $ac_n "(cached) $ac_c" 1>&6
2961 else
2962   if test -z "$LD"; then
2963   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2964   for ac_dir in $PATH; do
2965     test -z "$ac_dir" && ac_dir=.
2966     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2967       ac_cv_path_LD="$ac_dir/$ac_prog"
2968       # Check to see if the program is GNU ld.  I'd rather use --version,
2969       # but apparently some GNU ld's only accept -v.
2970       # Break only if it was the GNU/non-GNU ld that we prefer.
2971       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2972         test "$with_gnu_ld" != no && break
2973       else
2974         test "$with_gnu_ld" != yes && break
2975       fi
2976     fi
2977   done
2978   IFS="$ac_save_ifs"
2979 else
2980   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2981 fi
2982 fi
2983
2984 LD="$ac_cv_path_LD"
2985 if test -n "$LD"; then
2986   echo "$ac_t""$LD" 1>&6
2987 else
2988   echo "$ac_t""no" 1>&6
2989 fi
2990 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2991 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2992 echo "configure:2993: checking if the linker ($LD) is GNU ld" >&5
2993 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2994   echo $ac_n "(cached) $ac_c" 1>&6
2995 else
2996   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2997 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2998   ac_cv_prog_gnu_ld=yes
2999 else
3000   ac_cv_prog_gnu_ld=no
3001 fi
3002 fi
3003
3004 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3005 with_gnu_ld=$ac_cv_prog_gnu_ld
3006
3007
3008
3009
3010 case $host_os in sysv5*)
3011   echo $ac_n "checking whether ld -R works""... $ac_c" 1>&6
3012 echo "configure:3013: checking whether ld -R works" >&5
3013 if eval "test \"`echo '$''{'pgac_cv_prog_ld_R'+set}'`\" = set"; then
3014   echo $ac_n "(cached) $ac_c" 1>&6
3015 else
3016   
3017     pgac_save_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -Wl,-R/usr/lib"
3018     cat > conftest.$ac_ext <<EOF
3019 #line 3020 "configure"
3020 #include "confdefs.h"
3021
3022 int main() {
3023
3024 ; return 0; }
3025 EOF
3026 if { (eval echo configure:3027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3027   rm -rf conftest*
3028   pgac_cv_prog_ld_R=yes
3029 else
3030   echo "configure: failed program was:" >&5
3031   cat conftest.$ac_ext >&5
3032   rm -rf conftest*
3033   pgac_cv_prog_ld_R=no
3034 fi
3035 rm -f conftest*
3036     LDFLAGS=$pgac_save_LDFLAGS
3037   
3038 fi
3039
3040 echo "$ac_t""$pgac_cv_prog_ld_R" 1>&6
3041   ld_R_works=$pgac_cv_prog_ld_R
3042   
3043 esac
3044 # Extract the first word of "ranlib", so it can be a program name with args.
3045 set dummy ranlib; ac_word=$2
3046 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3047 echo "configure:3048: checking for $ac_word" >&5
3048 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
3049   echo $ac_n "(cached) $ac_c" 1>&6
3050 else
3051   if test -n "$RANLIB"; then
3052   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3053 else
3054   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3055   ac_dummy="$PATH"
3056   for ac_dir in $ac_dummy; do
3057     test -z "$ac_dir" && ac_dir=.
3058     if test -f $ac_dir/$ac_word; then
3059       ac_cv_prog_RANLIB="ranlib"
3060       break
3061     fi
3062   done
3063   IFS="$ac_save_ifs"
3064   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3065 fi
3066 fi
3067 RANLIB="$ac_cv_prog_RANLIB"
3068 if test -n "$RANLIB"; then
3069   echo "$ac_t""$RANLIB" 1>&6
3070 else
3071   echo "$ac_t""no" 1>&6
3072 fi
3073
3074 for ac_prog in lorder
3075 do
3076 # Extract the first word of "$ac_prog", so it can be a program name with args.
3077 set dummy $ac_prog; ac_word=$2
3078 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3079 echo "configure:3080: checking for $ac_word" >&5
3080 if eval "test \"`echo '$''{'ac_cv_prog_LORDER'+set}'`\" = set"; then
3081   echo $ac_n "(cached) $ac_c" 1>&6
3082 else
3083   if test -n "$LORDER"; then
3084   ac_cv_prog_LORDER="$LORDER" # Let the user override the test.
3085 else
3086   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3087   ac_dummy="$PATH"
3088   for ac_dir in $ac_dummy; do
3089     test -z "$ac_dir" && ac_dir=.
3090     if test -f $ac_dir/$ac_word; then
3091       ac_cv_prog_LORDER="$ac_prog"
3092       break
3093     fi
3094   done
3095   IFS="$ac_save_ifs"
3096 fi
3097 fi
3098 LORDER="$ac_cv_prog_LORDER"
3099 if test -n "$LORDER"; then
3100   echo "$ac_t""$LORDER" 1>&6
3101 else
3102   echo "$ac_t""no" 1>&6
3103 fi
3104
3105 test -n "$LORDER" && break
3106 done
3107
3108 # Extract the first word of "tar", so it can be a program name with args.
3109 set dummy tar; ac_word=$2
3110 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3111 echo "configure:3112: checking for $ac_word" >&5
3112 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
3113   echo $ac_n "(cached) $ac_c" 1>&6
3114 else
3115   case "$TAR" in
3116   /*)
3117   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
3118   ;;
3119   ?:/*)                  
3120   ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path.
3121   ;;
3122   *)
3123   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3124   ac_dummy="$PATH"
3125   for ac_dir in $ac_dummy; do 
3126     test -z "$ac_dir" && ac_dir=.
3127     if test -f $ac_dir/$ac_word; then
3128       ac_cv_path_TAR="$ac_dir/$ac_word"
3129       break
3130     fi
3131   done
3132   IFS="$ac_save_ifs"
3133   ;;
3134 esac
3135 fi
3136 TAR="$ac_cv_path_TAR"
3137 if test -n "$TAR"; then
3138   echo "$ac_t""$TAR" 1>&6
3139 else
3140   echo "$ac_t""no" 1>&6
3141 fi
3142
3143
3144 for ac_prog in 'bison -y'
3145 do
3146 # Extract the first word of "$ac_prog", so it can be a program name with args.
3147 set dummy $ac_prog; ac_word=$2
3148 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3149 echo "configure:3150: checking for $ac_word" >&5
3150 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
3151   echo $ac_n "(cached) $ac_c" 1>&6
3152 else
3153   if test -n "$YACC"; then
3154   ac_cv_prog_YACC="$YACC" # Let the user override the test.
3155 else
3156   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3157   ac_dummy="$PATH"
3158   for ac_dir in $ac_dummy; do
3159     test -z "$ac_dir" && ac_dir=.
3160     if test -f $ac_dir/$ac_word; then
3161       ac_cv_prog_YACC="$ac_prog"
3162       break
3163     fi
3164   done
3165   IFS="$ac_save_ifs"
3166 fi
3167 fi
3168 YACC="$ac_cv_prog_YACC"
3169 if test -n "$YACC"; then
3170   echo "$ac_t""$YACC" 1>&6
3171 else
3172   echo "$ac_t""no" 1>&6
3173 fi
3174
3175 test -n "$YACC" && break
3176 done
3177
3178 if test -z "$YACC"; then
3179   echo "configure: warning: 
3180 *** Without Bison you will not be able to build PostgreSQL from CVS or
3181 *** change any of the parser definition files.  You can obtain Bison from
3182 *** a GNU mirror site.  (If you are using the official distribution of
3183 *** PostgreSQL then you do not need to worry about this because the Bison
3184 *** output is pre-generated.)  To use a different yacc program (possible,
3185 *** but not recommended), set the environment variable YACC before running
3186 *** 'configure'." 1>&2
3187 fi
3188
3189
3190 if test "$with_tk" = yes; then
3191     # Extract the first word of "wish", so it can be a program name with args.
3192 set dummy wish; ac_word=$2
3193 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3194 echo "configure:3195: checking for $ac_word" >&5
3195 if eval "test \"`echo '$''{'ac_cv_path_WISH'+set}'`\" = set"; then
3196   echo $ac_n "(cached) $ac_c" 1>&6
3197 else
3198   case "$WISH" in
3199   /*)
3200   ac_cv_path_WISH="$WISH" # Let the user override the test with a path.
3201   ;;
3202   ?:/*)                  
3203   ac_cv_path_WISH="$WISH" # Let the user override the test with a dos path.
3204   ;;
3205   *)
3206   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3207   ac_dummy="$PATH"
3208   for ac_dir in $ac_dummy; do 
3209     test -z "$ac_dir" && ac_dir=.
3210     if test -f $ac_dir/$ac_word; then
3211       ac_cv_path_WISH="$ac_dir/$ac_word"
3212       break
3213     fi
3214   done
3215   IFS="$ac_save_ifs"
3216   ;;
3217 esac
3218 fi
3219 WISH="$ac_cv_path_WISH"
3220 if test -n "$WISH"; then
3221   echo "$ac_t""$WISH" 1>&6
3222 else
3223   echo "$ac_t""no" 1>&6
3224 fi
3225
3226     test -z "$WISH" && { echo "configure: error: 'wish' is required for Tk support" 1>&2; exit 1; }
3227 fi
3228
3229 # Extract the first word of "perl", so it can be a program name with args.
3230 set dummy perl; ac_word=$2
3231 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3232 echo "configure:3233: checking for $ac_word" >&5
3233 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
3234   echo $ac_n "(cached) $ac_c" 1>&6
3235 else
3236   case "$PERL" in
3237   /*)
3238   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
3239   ;;
3240   ?:/*)                  
3241   ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
3242   ;;
3243   *)
3244   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3245   ac_dummy="$PATH"
3246   for ac_dir in $ac_dummy; do 
3247     test -z "$ac_dir" && ac_dir=.
3248     if test -f $ac_dir/$ac_word; then
3249       ac_cv_path_PERL="$ac_dir/$ac_word"
3250       break
3251     fi
3252   done
3253   IFS="$ac_save_ifs"
3254   ;;
3255 esac
3256 fi
3257 PERL="$ac_cv_path_PERL"
3258 if test -n "$PERL"; then
3259   echo "$ac_t""$PERL" 1>&6
3260 else
3261   echo "$ac_t""no" 1>&6
3262 fi
3263
3264 if test "$with_perl" = yes; then
3265   
3266
3267 echo $ac_n "checking Perl installation directories""... $ac_c" 1>&6
3268 echo "configure:3269: checking Perl installation directories" >&5
3269
3270 # These are the ones we currently need.  Others can be added easily.
3271 perl_installsitearch=`$PERL -MConfig -e 'print $Config{installsitearch}'`
3272 perl_installsitelib=`$PERL -MConfig -e 'print $Config{installsitelib}'`
3273 perl_installman3dir=`$PERL -MConfig -e 'print $Config{installman3dir}'`
3274
3275
3276 echo "$ac_t""done" 1>&6
3277
3278 fi
3279
3280 if test "$with_python" = yes; then
3281   # Extract the first word of "python", so it can be a program name with args.
3282 set dummy python; ac_word=$2
3283 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3284 echo "configure:3285: checking for $ac_word" >&5
3285 if eval "test \"`echo '$''{'ac_cv_path_PYTHON'+set}'`\" = set"; then
3286   echo $ac_n "(cached) $ac_c" 1>&6
3287 else
3288   case "$PYTHON" in
3289   /*)
3290   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
3291   ;;
3292   ?:/*)                  
3293   ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a dos path.
3294   ;;
3295   *)
3296   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3297   ac_dummy="$PATH"
3298   for ac_dir in $ac_dummy; do 
3299     test -z "$ac_dir" && ac_dir=.
3300     if test -f $ac_dir/$ac_word; then
3301       ac_cv_path_PYTHON="$ac_dir/$ac_word"
3302       break
3303     fi
3304   done
3305   IFS="$ac_save_ifs"
3306   ;;
3307 esac
3308 fi
3309 PYTHON="$ac_cv_path_PYTHON"
3310 if test -n "$PYTHON"; then
3311   echo "$ac_t""$PYTHON" 1>&6
3312 else
3313   echo "$ac_t""no" 1>&6
3314 fi
3315
3316 if test x"$PYTHON" = x""; then
3317   { echo "configure: error: Python not found" 1>&2; exit 1; }
3318 fi
3319
3320   
3321 echo $ac_n "checking Python installation directories""... $ac_c" 1>&6
3322 echo "configure:3323: checking Python installation directories" >&5
3323 python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
3324 python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
3325 python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
3326 python_configdir="${python_execprefix}/lib/python${python_version}/config"
3327 python_moduledir="${python_prefix}/lib/python${python_version}/site-packages"
3328 python_moduleexecdir="${python_execprefix}/lib/python${python_version}/site-packages"
3329 python_includespec="-I${python_prefix}/include/python${python_version}"
3330 if test "$python_prefix" != "$python_execprefix"; then
3331   python_includespec="-I${python_execprefix}/include/python${python_version} $python_includespec"
3332 fi
3333
3334 # This should be enough of a message.
3335 if test "$python_prefix" != "$python_execprefix"; then
3336   echo "$ac_t""$python_prefix/lib/python${python_version} and $python_execprefix/lib/python${python_version}" 1>&6
3337 else
3338   echo "$ac_t""$python_prefix/lib/python${python_version}" 1>&6
3339 fi
3340
3341
3342   
3343
3344   
3345 echo $ac_n "checking how to link an embedded Python application""... $ac_c" 1>&6
3346 echo "configure:3347: checking how to link an embedded Python application" >&5
3347
3348 _python_libs=`grep '^LIBS=' $python_configdir/Makefile | sed 's/^.*=//'`
3349 _python_libc=`grep '^LIBC=' $python_configdir/Makefile | sed 's/^.*=//'`
3350 _python_libm=`grep '^LIBM=' $python_configdir/Makefile | sed 's/^.*=//'`
3351 _python_liblocalmod=`grep '^LOCALMODLIBS=' $python_configdir/Makefile | sed 's/^.*=//'`
3352 _python_libbasemod=`grep '^BASEMODLIBS=' $python_configdir/Makefile | sed 's/^.*=//'`
3353
3354 pgac_tab="      " # tab character
3355 python_libspec=`echo X"-L$python_configdir $_python_libs $_python_libc $_python_libm -lpython$python_version $_python_liblocalmod $_python_libbasemod" | sed -e 's/^X//' -e "s/[ $pgac_tab][ $pgac_tab]*/ /g"`
3356
3357 echo "$ac_t""${python_libspec}" 1>&6
3358
3359
3360 fi
3361
3362
3363 ##
3364 ## Libraries
3365 ##
3366
3367
3368 echo $ac_n "checking for readline""... $ac_c" 1>&6
3369 echo "configure:3370: checking for readline" >&5
3370
3371 if eval "test \"`echo '$''{'pgac_cv_check_readline'+set}'`\" = set"; then
3372   echo $ac_n "(cached) $ac_c" 1>&6
3373 else
3374   pgac_cv_check_readline=no
3375 for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
3376   for pgac_rllib in -lreadline -ledit ; do
3377     pgac_save_LIBS=$LIBS
3378     LIBS="${pgac_rllib}${pgac_lib} $LIBS"
3379     cat > conftest.$ac_ext <<EOF
3380 #line 3381 "configure"
3381 #include "confdefs.h"
3382 /* Override any gcc2 internal prototype to avoid an error.  */
3383 /* We use char because int might match the return type of a gcc2
3384     builtin and then its argument prototype would still apply.  */
3385 char readline();
3386
3387 int main() {
3388 readline()
3389 ; return 0; }
3390 EOF
3391 if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3392   rm -rf conftest*
3393   
3394       # NetBSD and OpenBSD have a broken linker that does not
3395       # recognize dependent libraries
3396       case $host_os in netbsd* | openbsd* )
3397         case $pgac_lib in
3398           *curses*) ;;
3399           *) pgac_lib=" -lcurses" ;;
3400         esac
3401       esac
3402
3403       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
3404       break 2
3405     
3406 else
3407   echo "configure: failed program was:" >&5
3408   cat conftest.$ac_ext >&5
3409 fi
3410 rm -f conftest*
3411     LIBS=$pgac_save_LIBS
3412   done
3413 done
3414 LIBS=$pgac_save_LIBS
3415
3416 fi
3417
3418 if test "$pgac_cv_check_readline" != no ; then
3419   cat >> confdefs.h <<\EOF
3420 #define HAVE_LIBREADLINE 1
3421 EOF
3422
3423   LIBS="$pgac_cv_check_readline $LIBS"
3424   echo "$ac_t""yes ($pgac_cv_check_readline)" 1>&6
3425 else
3426   echo "$ac_t""no" 1>&6
3427 fi
3428
3429 echo $ac_n "checking for library containing using_history""... $ac_c" 1>&6
3430 echo "configure:3431: checking for library containing using_history" >&5
3431 if eval "test \"`echo '$''{'ac_cv_search_using_history'+set}'`\" = set"; then
3432   echo $ac_n "(cached) $ac_c" 1>&6
3433 else
3434   ac_func_search_save_LIBS="$LIBS"
3435 ac_cv_search_using_history="no"
3436 cat > conftest.$ac_ext <<EOF
3437 #line 3438 "configure"
3438 #include "confdefs.h"
3439 /* Override any gcc2 internal prototype to avoid an error.  */
3440 /* We use char because int might match the return type of a gcc2
3441     builtin and then its argument prototype would still apply.  */
3442 char using_history();
3443
3444 int main() {
3445 using_history()
3446 ; return 0; }
3447 EOF
3448 if { (eval echo configure:3449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3449   rm -rf conftest*
3450   ac_cv_search_using_history="none required"
3451 else
3452   echo "configure: failed program was:" >&5
3453   cat conftest.$ac_ext >&5
3454 fi
3455 rm -f conftest*
3456 test "$ac_cv_search_using_history" = "no" && for i in history; do
3457 LIBS="-l$i  $ac_func_search_save_LIBS"
3458 cat > conftest.$ac_ext <<EOF
3459 #line 3460 "configure"
3460 #include "confdefs.h"
3461 /* Override any gcc2 internal prototype to avoid an error.  */
3462 /* We use char because int might match the return type of a gcc2
3463     builtin and then its argument prototype would still apply.  */
3464 char using_history();
3465
3466 int main() {
3467 using_history()
3468 ; return 0; }
3469 EOF
3470 if { (eval echo configure:3471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3471   rm -rf conftest*
3472   ac_cv_search_using_history="-l$i"
3473 break
3474 else
3475   echo "configure: failed program was:" >&5
3476   cat conftest.$ac_ext >&5
3477 fi
3478 rm -f conftest*
3479 done
3480 LIBS="$ac_func_search_save_LIBS"
3481 fi
3482
3483 echo "$ac_t""$ac_cv_search_using_history" 1>&6
3484 if test "$ac_cv_search_using_history" != "no"; then
3485   test "$ac_cv_search_using_history" = "none required" || LIBS="$ac_cv_search_using_history $LIBS"
3486   cat >> confdefs.h <<\EOF
3487 #define HAVE_HISTORY_FUNCTIONS 1
3488 EOF
3489
3490 else :
3491   
3492 fi
3493
3494 if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
3495 then
3496         echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6
3497 echo "configure:3498: checking for main in -lbsd" >&5
3498 ac_lib_var=`echo bsd'_'main | sed 'y%./+-%__p_%'`
3499 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3500   echo $ac_n "(cached) $ac_c" 1>&6
3501 else
3502   ac_save_LIBS="$LIBS"
3503 LIBS="-lbsd  $LIBS"
3504 cat > conftest.$ac_ext <<EOF
3505 #line 3506 "configure"
3506 #include "confdefs.h"
3507
3508 int main() {
3509 main()
3510 ; return 0; }
3511 EOF
3512 if { (eval echo configure:3513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3513   rm -rf conftest*
3514   eval "ac_cv_lib_$ac_lib_var=yes"
3515 else
3516   echo "configure: failed program was:" >&5
3517   cat conftest.$ac_ext >&5
3518   rm -rf conftest*
3519   eval "ac_cv_lib_$ac_lib_var=no"
3520 fi
3521 rm -f conftest*
3522 LIBS="$ac_save_LIBS"
3523
3524 fi
3525 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3526   echo "$ac_t""yes" 1>&6
3527     ac_tr_lib=HAVE_LIB`echo bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3528     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3529   cat >> confdefs.h <<EOF
3530 #define $ac_tr_lib 1
3531 EOF
3532
3533   LIBS="-lbsd $LIBS"
3534
3535 else
3536   echo "$ac_t""no" 1>&6
3537 fi
3538
3539 fi
3540 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
3541 echo "configure:3542: checking for setproctitle in -lutil" >&5
3542 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
3543 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3544   echo $ac_n "(cached) $ac_c" 1>&6
3545 else
3546   ac_save_LIBS="$LIBS"
3547 LIBS="-lutil  $LIBS"
3548 cat > conftest.$ac_ext <<EOF
3549 #line 3550 "configure"
3550 #include "confdefs.h"
3551 /* Override any gcc2 internal prototype to avoid an error.  */
3552 /* We use char because int might match the return type of a gcc2
3553     builtin and then its argument prototype would still apply.  */
3554 char setproctitle();
3555
3556 int main() {
3557 setproctitle()
3558 ; return 0; }
3559 EOF
3560 if { (eval echo configure:3561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3561   rm -rf conftest*
3562   eval "ac_cv_lib_$ac_lib_var=yes"
3563 else
3564   echo "configure: failed program was:" >&5
3565   cat conftest.$ac_ext >&5
3566   rm -rf conftest*
3567   eval "ac_cv_lib_$ac_lib_var=no"
3568 fi
3569 rm -f conftest*
3570 LIBS="$ac_save_LIBS"
3571
3572 fi
3573 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3574   echo "$ac_t""yes" 1>&6
3575     ac_tr_lib=HAVE_LIB`echo util | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3576     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3577   cat >> confdefs.h <<EOF
3578 #define $ac_tr_lib 1
3579 EOF
3580
3581   LIBS="-lutil $LIBS"
3582
3583 else
3584   echo "$ac_t""no" 1>&6
3585 fi
3586
3587 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
3588 echo "configure:3589: checking for main in -lm" >&5
3589 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
3590 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3591   echo $ac_n "(cached) $ac_c" 1>&6
3592 else
3593   ac_save_LIBS="$LIBS"
3594 LIBS="-lm  $LIBS"
3595 cat > conftest.$ac_ext <<EOF
3596 #line 3597 "configure"
3597 #include "confdefs.h"
3598
3599 int main() {
3600 main()
3601 ; return 0; }
3602 EOF
3603 if { (eval echo configure:3604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3604   rm -rf conftest*
3605   eval "ac_cv_lib_$ac_lib_var=yes"
3606 else
3607   echo "configure: failed program was:" >&5
3608   cat conftest.$ac_ext >&5
3609   rm -rf conftest*
3610   eval "ac_cv_lib_$ac_lib_var=no"
3611 fi
3612 rm -f conftest*
3613 LIBS="$ac_save_LIBS"
3614
3615 fi
3616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3617   echo "$ac_t""yes" 1>&6
3618     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3619     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3620   cat >> confdefs.h <<EOF
3621 #define $ac_tr_lib 1
3622 EOF
3623
3624   LIBS="-lm $LIBS"
3625
3626 else
3627   echo "$ac_t""no" 1>&6
3628 fi
3629
3630 echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
3631 echo "configure:3632: checking for main in -ldl" >&5
3632 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
3633 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3634   echo $ac_n "(cached) $ac_c" 1>&6
3635 else
3636   ac_save_LIBS="$LIBS"
3637 LIBS="-ldl  $LIBS"
3638 cat > conftest.$ac_ext <<EOF
3639 #line 3640 "configure"
3640 #include "confdefs.h"
3641
3642 int main() {
3643 main()
3644 ; return 0; }
3645 EOF
3646 if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3647   rm -rf conftest*
3648   eval "ac_cv_lib_$ac_lib_var=yes"
3649 else
3650   echo "configure: failed program was:" >&5
3651   cat conftest.$ac_ext >&5
3652   rm -rf conftest*
3653   eval "ac_cv_lib_$ac_lib_var=no"
3654 fi
3655 rm -f conftest*
3656 LIBS="$ac_save_LIBS"
3657
3658 fi
3659 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3660   echo "$ac_t""yes" 1>&6
3661     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3662     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3663   cat >> confdefs.h <<EOF
3664 #define $ac_tr_lib 1
3665 EOF
3666
3667   LIBS="-ldl $LIBS"
3668
3669 else
3670   echo "$ac_t""no" 1>&6
3671 fi
3672
3673 echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3674 echo "configure:3675: checking for main in -lsocket" >&5
3675 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3676 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   ac_save_LIBS="$LIBS"
3680 LIBS="-lsocket  $LIBS"
3681 cat > conftest.$ac_ext <<EOF
3682 #line 3683 "configure"
3683 #include "confdefs.h"
3684
3685 int main() {
3686 main()
3687 ; return 0; }
3688 EOF
3689 if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3690   rm -rf conftest*
3691   eval "ac_cv_lib_$ac_lib_var=yes"
3692 else
3693   echo "configure: failed program was:" >&5
3694   cat conftest.$ac_ext >&5
3695   rm -rf conftest*
3696   eval "ac_cv_lib_$ac_lib_var=no"
3697 fi
3698 rm -f conftest*
3699 LIBS="$ac_save_LIBS"
3700
3701 fi
3702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3703   echo "$ac_t""yes" 1>&6
3704     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3705     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3706   cat >> confdefs.h <<EOF
3707 #define $ac_tr_lib 1
3708 EOF
3709
3710   LIBS="-lsocket $LIBS"
3711
3712 else
3713   echo "$ac_t""no" 1>&6
3714 fi
3715
3716 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3717 echo "configure:3718: checking for main in -lnsl" >&5
3718 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3719 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3720   echo $ac_n "(cached) $ac_c" 1>&6
3721 else
3722   ac_save_LIBS="$LIBS"
3723 LIBS="-lnsl  $LIBS"
3724 cat > conftest.$ac_ext <<EOF
3725 #line 3726 "configure"
3726 #include "confdefs.h"
3727
3728 int main() {
3729 main()
3730 ; return 0; }
3731 EOF
3732 if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3733   rm -rf conftest*
3734   eval "ac_cv_lib_$ac_lib_var=yes"
3735 else
3736   echo "configure: failed program was:" >&5
3737   cat conftest.$ac_ext >&5
3738   rm -rf conftest*
3739   eval "ac_cv_lib_$ac_lib_var=no"
3740 fi
3741 rm -f conftest*
3742 LIBS="$ac_save_LIBS"
3743
3744 fi
3745 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3746   echo "$ac_t""yes" 1>&6
3747     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3748     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3749   cat >> confdefs.h <<EOF
3750 #define $ac_tr_lib 1
3751 EOF
3752
3753   LIBS="-lnsl $LIBS"
3754
3755 else
3756   echo "$ac_t""no" 1>&6
3757 fi
3758
3759 echo $ac_n "checking for main in -lipc""... $ac_c" 1>&6
3760 echo "configure:3761: checking for main in -lipc" >&5
3761 ac_lib_var=`echo ipc'_'main | sed 'y%./+-%__p_%'`
3762 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3763   echo $ac_n "(cached) $ac_c" 1>&6
3764 else
3765   ac_save_LIBS="$LIBS"
3766 LIBS="-lipc  $LIBS"
3767 cat > conftest.$ac_ext <<EOF
3768 #line 3769 "configure"
3769 #include "confdefs.h"
3770
3771 int main() {
3772 main()
3773 ; return 0; }
3774 EOF
3775 if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3776   rm -rf conftest*
3777   eval "ac_cv_lib_$ac_lib_var=yes"
3778 else
3779   echo "configure: failed program was:" >&5
3780   cat conftest.$ac_ext >&5
3781   rm -rf conftest*
3782   eval "ac_cv_lib_$ac_lib_var=no"
3783 fi
3784 rm -f conftest*
3785 LIBS="$ac_save_LIBS"
3786
3787 fi
3788 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3789   echo "$ac_t""yes" 1>&6
3790     ac_tr_lib=HAVE_LIB`echo ipc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3791     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3792   cat >> confdefs.h <<EOF
3793 #define $ac_tr_lib 1
3794 EOF
3795
3796   LIBS="-lipc $LIBS"
3797
3798 else
3799   echo "$ac_t""no" 1>&6
3800 fi
3801
3802 echo $ac_n "checking for main in -lIPC""... $ac_c" 1>&6
3803 echo "configure:3804: checking for main in -lIPC" >&5
3804 ac_lib_var=`echo IPC'_'main | sed 'y%./+-%__p_%'`
3805 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3806   echo $ac_n "(cached) $ac_c" 1>&6
3807 else
3808   ac_save_LIBS="$LIBS"
3809 LIBS="-lIPC  $LIBS"
3810 cat > conftest.$ac_ext <<EOF
3811 #line 3812 "configure"
3812 #include "confdefs.h"
3813
3814 int main() {
3815 main()
3816 ; return 0; }
3817 EOF
3818 if { (eval echo configure:3819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3819   rm -rf conftest*
3820   eval "ac_cv_lib_$ac_lib_var=yes"
3821 else
3822   echo "configure: failed program was:" >&5
3823   cat conftest.$ac_ext >&5
3824   rm -rf conftest*
3825   eval "ac_cv_lib_$ac_lib_var=no"
3826 fi
3827 rm -f conftest*
3828 LIBS="$ac_save_LIBS"
3829
3830 fi
3831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3832   echo "$ac_t""yes" 1>&6
3833     ac_tr_lib=HAVE_LIB`echo IPC | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3834     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3835   cat >> confdefs.h <<EOF
3836 #define $ac_tr_lib 1
3837 EOF
3838
3839   LIBS="-lIPC $LIBS"
3840
3841 else
3842   echo "$ac_t""no" 1>&6
3843 fi
3844
3845 echo $ac_n "checking for main in -llc""... $ac_c" 1>&6
3846 echo "configure:3847: checking for main in -llc" >&5
3847 ac_lib_var=`echo lc'_'main | sed 'y%./+-%__p_%'`
3848 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3849   echo $ac_n "(cached) $ac_c" 1>&6
3850 else
3851   ac_save_LIBS="$LIBS"
3852 LIBS="-llc  $LIBS"
3853 cat > conftest.$ac_ext <<EOF
3854 #line 3855 "configure"
3855 #include "confdefs.h"
3856
3857 int main() {
3858 main()
3859 ; return 0; }
3860 EOF
3861 if { (eval echo configure:3862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3862   rm -rf conftest*
3863   eval "ac_cv_lib_$ac_lib_var=yes"
3864 else
3865   echo "configure: failed program was:" >&5
3866   cat conftest.$ac_ext >&5
3867   rm -rf conftest*
3868   eval "ac_cv_lib_$ac_lib_var=no"
3869 fi
3870 rm -f conftest*
3871 LIBS="$ac_save_LIBS"
3872
3873 fi
3874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3875   echo "$ac_t""yes" 1>&6
3876     ac_tr_lib=HAVE_LIB`echo lc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3877     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3878   cat >> confdefs.h <<EOF
3879 #define $ac_tr_lib 1
3880 EOF
3881
3882   LIBS="-llc $LIBS"
3883
3884 else
3885   echo "$ac_t""no" 1>&6
3886 fi
3887
3888 echo $ac_n "checking for main in -ldld""... $ac_c" 1>&6
3889 echo "configure:3890: checking for main in -ldld" >&5
3890 ac_lib_var=`echo dld'_'main | sed 'y%./+-%__p_%'`
3891 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3892   echo $ac_n "(cached) $ac_c" 1>&6
3893 else
3894   ac_save_LIBS="$LIBS"
3895 LIBS="-ldld  $LIBS"
3896 cat > conftest.$ac_ext <<EOF
3897 #line 3898 "configure"
3898 #include "confdefs.h"
3899
3900 int main() {
3901 main()
3902 ; return 0; }
3903 EOF
3904 if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3905   rm -rf conftest*
3906   eval "ac_cv_lib_$ac_lib_var=yes"
3907 else
3908   echo "configure: failed program was:" >&5
3909   cat conftest.$ac_ext >&5
3910   rm -rf conftest*
3911   eval "ac_cv_lib_$ac_lib_var=no"
3912 fi
3913 rm -f conftest*
3914 LIBS="$ac_save_LIBS"
3915
3916 fi
3917 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3918   echo "$ac_t""yes" 1>&6
3919     ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3920     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3921   cat >> confdefs.h <<EOF
3922 #define $ac_tr_lib 1
3923 EOF
3924
3925   LIBS="-ldld $LIBS"
3926
3927 else
3928   echo "$ac_t""no" 1>&6
3929 fi
3930
3931 echo $ac_n "checking for main in -lld""... $ac_c" 1>&6
3932 echo "configure:3933: checking for main in -lld" >&5
3933 ac_lib_var=`echo ld'_'main | sed 'y%./+-%__p_%'`
3934 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3935   echo $ac_n "(cached) $ac_c" 1>&6
3936 else
3937   ac_save_LIBS="$LIBS"
3938 LIBS="-lld  $LIBS"
3939 cat > conftest.$ac_ext <<EOF
3940 #line 3941 "configure"
3941 #include "confdefs.h"
3942
3943 int main() {
3944 main()
3945 ; return 0; }
3946 EOF
3947 if { (eval echo configure:3948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3948   rm -rf conftest*
3949   eval "ac_cv_lib_$ac_lib_var=yes"
3950 else
3951   echo "configure: failed program was:" >&5
3952   cat conftest.$ac_ext >&5
3953   rm -rf conftest*
3954   eval "ac_cv_lib_$ac_lib_var=no"
3955 fi
3956 rm -f conftest*
3957 LIBS="$ac_save_LIBS"
3958
3959 fi
3960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3961   echo "$ac_t""yes" 1>&6
3962     ac_tr_lib=HAVE_LIB`echo ld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3963     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3964   cat >> confdefs.h <<EOF
3965 #define $ac_tr_lib 1
3966 EOF
3967
3968   LIBS="-lld $LIBS"
3969
3970 else
3971   echo "$ac_t""no" 1>&6
3972 fi
3973
3974 echo $ac_n "checking for main in -lcompat""... $ac_c" 1>&6
3975 echo "configure:3976: checking for main in -lcompat" >&5
3976 ac_lib_var=`echo compat'_'main | sed 'y%./+-%__p_%'`
3977 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3978   echo $ac_n "(cached) $ac_c" 1>&6
3979 else
3980   ac_save_LIBS="$LIBS"
3981 LIBS="-lcompat  $LIBS"
3982 cat > conftest.$ac_ext <<EOF
3983 #line 3984 "configure"
3984 #include "confdefs.h"
3985
3986 int main() {
3987 main()
3988 ; return 0; }
3989 EOF
3990 if { (eval echo configure:3991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3991   rm -rf conftest*
3992   eval "ac_cv_lib_$ac_lib_var=yes"
3993 else
3994   echo "configure: failed program was:" >&5
3995   cat conftest.$ac_ext >&5
3996   rm -rf conftest*
3997   eval "ac_cv_lib_$ac_lib_var=no"
3998 fi
3999 rm -f conftest*
4000 LIBS="$ac_save_LIBS"
4001
4002 fi
4003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4004   echo "$ac_t""yes" 1>&6
4005     ac_tr_lib=HAVE_LIB`echo compat | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4006     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4007   cat >> confdefs.h <<EOF
4008 #define $ac_tr_lib 1
4009 EOF
4010
4011   LIBS="-lcompat $LIBS"
4012
4013 else
4014   echo "$ac_t""no" 1>&6
4015 fi
4016
4017 echo $ac_n "checking for main in -lBSD""... $ac_c" 1>&6
4018 echo "configure:4019: checking for main in -lBSD" >&5
4019 ac_lib_var=`echo BSD'_'main | sed 'y%./+-%__p_%'`
4020 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4021   echo $ac_n "(cached) $ac_c" 1>&6
4022 else
4023   ac_save_LIBS="$LIBS"
4024 LIBS="-lBSD  $LIBS"
4025 cat > conftest.$ac_ext <<EOF
4026 #line 4027 "configure"
4027 #include "confdefs.h"
4028
4029 int main() {
4030 main()
4031 ; return 0; }
4032 EOF
4033 if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4034   rm -rf conftest*
4035   eval "ac_cv_lib_$ac_lib_var=yes"
4036 else
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -rf conftest*
4040   eval "ac_cv_lib_$ac_lib_var=no"
4041 fi
4042 rm -f conftest*
4043 LIBS="$ac_save_LIBS"
4044
4045 fi
4046 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4047   echo "$ac_t""yes" 1>&6
4048     ac_tr_lib=HAVE_LIB`echo BSD | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4049     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4050   cat >> confdefs.h <<EOF
4051 #define $ac_tr_lib 1
4052 EOF
4053
4054   LIBS="-lBSD $LIBS"
4055
4056 else
4057   echo "$ac_t""no" 1>&6
4058 fi
4059
4060 echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4061 echo "configure:4062: checking for main in -lgen" >&5
4062 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
4063 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4064   echo $ac_n "(cached) $ac_c" 1>&6
4065 else
4066   ac_save_LIBS="$LIBS"
4067 LIBS="-lgen  $LIBS"
4068 cat > conftest.$ac_ext <<EOF
4069 #line 4070 "configure"
4070 #include "confdefs.h"
4071
4072 int main() {
4073 main()
4074 ; return 0; }
4075 EOF
4076 if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4077   rm -rf conftest*
4078   eval "ac_cv_lib_$ac_lib_var=yes"
4079 else
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   eval "ac_cv_lib_$ac_lib_var=no"
4084 fi
4085 rm -f conftest*
4086 LIBS="$ac_save_LIBS"
4087
4088 fi
4089 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4090   echo "$ac_t""yes" 1>&6
4091     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4092     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4093   cat >> confdefs.h <<EOF
4094 #define $ac_tr_lib 1
4095 EOF
4096
4097   LIBS="-lgen $LIBS"
4098
4099 else
4100   echo "$ac_t""no" 1>&6
4101 fi
4102
4103 echo $ac_n "checking for main in -lPW""... $ac_c" 1>&6
4104 echo "configure:4105: checking for main in -lPW" >&5
4105 ac_lib_var=`echo PW'_'main | sed 'y%./+-%__p_%'`
4106 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4107   echo $ac_n "(cached) $ac_c" 1>&6
4108 else
4109   ac_save_LIBS="$LIBS"
4110 LIBS="-lPW  $LIBS"
4111 cat > conftest.$ac_ext <<EOF
4112 #line 4113 "configure"
4113 #include "confdefs.h"
4114
4115 int main() {
4116 main()
4117 ; return 0; }
4118 EOF
4119 if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4120   rm -rf conftest*
4121   eval "ac_cv_lib_$ac_lib_var=yes"
4122 else
4123   echo "configure: failed program was:" >&5
4124   cat conftest.$ac_ext >&5
4125   rm -rf conftest*
4126   eval "ac_cv_lib_$ac_lib_var=no"
4127 fi
4128 rm -f conftest*
4129 LIBS="$ac_save_LIBS"
4130
4131 fi
4132 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4133   echo "$ac_t""yes" 1>&6
4134     ac_tr_lib=HAVE_LIB`echo PW | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4135     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4136   cat >> confdefs.h <<EOF
4137 #define $ac_tr_lib 1
4138 EOF
4139
4140   LIBS="-lPW $LIBS"
4141
4142 else
4143   echo "$ac_t""no" 1>&6
4144 fi
4145
4146 echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
4147 echo "configure:4148: checking for main in -lresolv" >&5
4148 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'`
4149 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4150   echo $ac_n "(cached) $ac_c" 1>&6
4151 else
4152   ac_save_LIBS="$LIBS"
4153 LIBS="-lresolv  $LIBS"
4154 cat > conftest.$ac_ext <<EOF
4155 #line 4156 "configure"
4156 #include "confdefs.h"
4157
4158 int main() {
4159 main()
4160 ; return 0; }
4161 EOF
4162 if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4163   rm -rf conftest*
4164   eval "ac_cv_lib_$ac_lib_var=yes"
4165 else
4166   echo "configure: failed program was:" >&5
4167   cat conftest.$ac_ext >&5
4168   rm -rf conftest*
4169   eval "ac_cv_lib_$ac_lib_var=no"
4170 fi
4171 rm -f conftest*
4172 LIBS="$ac_save_LIBS"
4173
4174 fi
4175 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4176   echo "$ac_t""yes" 1>&6
4177     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4178     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4179   cat >> confdefs.h <<EOF
4180 #define $ac_tr_lib 1
4181 EOF
4182
4183   LIBS="-lresolv $LIBS"
4184
4185 else
4186   echo "$ac_t""no" 1>&6
4187 fi
4188
4189 # QNX:
4190 echo $ac_n "checking for main in -lunix""... $ac_c" 1>&6
4191 echo "configure:4192: checking for main in -lunix" >&5
4192 ac_lib_var=`echo unix'_'main | sed 'y%./+-%__p_%'`
4193 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4194   echo $ac_n "(cached) $ac_c" 1>&6
4195 else
4196   ac_save_LIBS="$LIBS"
4197 LIBS="-lunix  $LIBS"
4198 cat > conftest.$ac_ext <<EOF
4199 #line 4200 "configure"
4200 #include "confdefs.h"
4201
4202 int main() {
4203 main()
4204 ; return 0; }
4205 EOF
4206 if { (eval echo configure:4207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4207   rm -rf conftest*
4208   eval "ac_cv_lib_$ac_lib_var=yes"
4209 else
4210   echo "configure: failed program was:" >&5
4211   cat conftest.$ac_ext >&5
4212   rm -rf conftest*
4213   eval "ac_cv_lib_$ac_lib_var=no"
4214 fi
4215 rm -f conftest*
4216 LIBS="$ac_save_LIBS"
4217
4218 fi
4219 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4220   echo "$ac_t""yes" 1>&6
4221     ac_tr_lib=HAVE_LIB`echo [unix] | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4222     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4223   cat >> confdefs.h <<EOF
4224 #define $ac_tr_lib 1
4225 EOF
4226
4227   LIBS="-lunix $LIBS"
4228
4229 else
4230   echo "$ac_t""no" 1>&6
4231 fi
4232
4233
4234 echo $ac_n "checking for library containing crypt""... $ac_c" 1>&6
4235 echo "configure:4236: checking for library containing crypt" >&5
4236 if eval "test \"`echo '$''{'ac_cv_search_crypt'+set}'`\" = set"; then
4237   echo $ac_n "(cached) $ac_c" 1>&6
4238 else
4239   ac_func_search_save_LIBS="$LIBS"
4240 ac_cv_search_crypt="no"
4241 cat > conftest.$ac_ext <<EOF
4242 #line 4243 "configure"
4243 #include "confdefs.h"
4244 /* Override any gcc2 internal prototype to avoid an error.  */
4245 /* We use char because int might match the return type of a gcc2
4246     builtin and then its argument prototype would still apply.  */
4247 char crypt();
4248
4249 int main() {
4250 crypt()
4251 ; return 0; }
4252 EOF
4253 if { (eval echo configure:4254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4254   rm -rf conftest*
4255   ac_cv_search_crypt="none required"
4256 else
4257   echo "configure: failed program was:" >&5
4258   cat conftest.$ac_ext >&5
4259 fi
4260 rm -f conftest*
4261 test "$ac_cv_search_crypt" = "no" && for i in crypt; do
4262 LIBS="-l$i  $ac_func_search_save_LIBS"
4263 cat > conftest.$ac_ext <<EOF
4264 #line 4265 "configure"
4265 #include "confdefs.h"
4266 /* Override any gcc2 internal prototype to avoid an error.  */
4267 /* We use char because int might match the return type of a gcc2
4268     builtin and then its argument prototype would still apply.  */
4269 char crypt();
4270
4271 int main() {
4272 crypt()
4273 ; return 0; }
4274 EOF
4275 if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4276   rm -rf conftest*
4277   ac_cv_search_crypt="-l$i"
4278 break
4279 else
4280   echo "configure: failed program was:" >&5
4281   cat conftest.$ac_ext >&5
4282 fi
4283 rm -f conftest*
4284 done
4285 LIBS="$ac_func_search_save_LIBS"
4286 fi
4287
4288 echo "$ac_t""$ac_cv_search_crypt" 1>&6
4289 if test "$ac_cv_search_crypt" != "no"; then
4290   test "$ac_cv_search_crypt" = "none required" || LIBS="$ac_cv_search_crypt $LIBS"
4291   
4292 else :
4293   
4294 fi
4295 # BeOS:
4296 echo $ac_n "checking for __inet_ntoa in -lbind""... $ac_c" 1>&6
4297 echo "configure:4298: checking for __inet_ntoa in -lbind" >&5
4298 ac_lib_var=`echo bind'_'__inet_ntoa | sed 'y%./+-%__p_%'`
4299 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4300   echo $ac_n "(cached) $ac_c" 1>&6
4301 else
4302   ac_save_LIBS="$LIBS"
4303 LIBS="-lbind  $LIBS"
4304 cat > conftest.$ac_ext <<EOF
4305 #line 4306 "configure"
4306 #include "confdefs.h"
4307 /* Override any gcc2 internal prototype to avoid an error.  */
4308 /* We use char because int might match the return type of a gcc2
4309     builtin and then its argument prototype would still apply.  */
4310 char __inet_ntoa();
4311
4312 int main() {
4313 __inet_ntoa()
4314 ; return 0; }
4315 EOF
4316 if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4317   rm -rf conftest*
4318   eval "ac_cv_lib_$ac_lib_var=yes"
4319 else
4320   echo "configure: failed program was:" >&5
4321   cat conftest.$ac_ext >&5
4322   rm -rf conftest*
4323   eval "ac_cv_lib_$ac_lib_var=no"
4324 fi
4325 rm -f conftest*
4326 LIBS="$ac_save_LIBS"
4327
4328 fi
4329 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4330   echo "$ac_t""yes" 1>&6
4331     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4332     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4333   cat >> confdefs.h <<EOF
4334 #define $ac_tr_lib 1
4335 EOF
4336
4337   LIBS="-lbind $LIBS"
4338
4339 else
4340   echo "$ac_t""no" 1>&6
4341 fi
4342
4343 # Only consider libz to be present if we find <zlib.h> as well;
4344 # furthermore, check that <zlib.h> defines z_streamp (versions before
4345 # about 1.0.4 did not).  While we could work around the lack of z_streamp,
4346 # it seems unwise to encourage people to use such old zlib versions...
4347 cat > conftest.$ac_ext <<EOF
4348 #line 4349 "configure"
4349 #include "confdefs.h"
4350 #include <zlib.h>
4351 EOF
4352 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4353   egrep "z_streamp" >/dev/null 2>&1; then
4354   rm -rf conftest*
4355   
4356 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
4357 echo "configure:4358: checking for inflate in -lz" >&5
4358 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
4359 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4360   echo $ac_n "(cached) $ac_c" 1>&6
4361 else
4362   ac_save_LIBS="$LIBS"
4363 LIBS="-lz  $LIBS"
4364 cat > conftest.$ac_ext <<EOF
4365 #line 4366 "configure"
4366 #include "confdefs.h"
4367 /* Override any gcc2 internal prototype to avoid an error.  */
4368 /* We use char because int might match the return type of a gcc2
4369     builtin and then its argument prototype would still apply.  */
4370 char inflate();
4371
4372 int main() {
4373 inflate()
4374 ; return 0; }
4375 EOF
4376 if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4377   rm -rf conftest*
4378   eval "ac_cv_lib_$ac_lib_var=yes"
4379 else
4380   echo "configure: failed program was:" >&5
4381   cat conftest.$ac_ext >&5
4382   rm -rf conftest*
4383   eval "ac_cv_lib_$ac_lib_var=no"
4384 fi
4385 rm -f conftest*
4386 LIBS="$ac_save_LIBS"
4387
4388 fi
4389 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4390   echo "$ac_t""yes" 1>&6
4391     ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4392     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4393   cat >> confdefs.h <<EOF
4394 #define $ac_tr_lib 1
4395 EOF
4396
4397   LIBS="-lz $LIBS"
4398
4399 else
4400   echo "$ac_t""no" 1>&6
4401 fi
4402
4403
4404 fi
4405 rm -f conftest*
4406
4407 # Solaris:
4408
4409 echo $ac_n "checking for library containing fdatasync""... $ac_c" 1>&6
4410 echo "configure:4411: checking for library containing fdatasync" >&5
4411 if eval "test \"`echo '$''{'ac_cv_search_fdatasync'+set}'`\" = set"; then
4412   echo $ac_n "(cached) $ac_c" 1>&6
4413 else
4414   ac_func_search_save_LIBS="$LIBS"
4415 ac_cv_search_fdatasync="no"
4416 cat > conftest.$ac_ext <<EOF
4417 #line 4418 "configure"
4418 #include "confdefs.h"
4419 /* Override any gcc2 internal prototype to avoid an error.  */
4420 /* We use char because int might match the return type of a gcc2
4421     builtin and then its argument prototype would still apply.  */
4422 char fdatasync();
4423
4424 int main() {
4425 fdatasync()
4426 ; return 0; }
4427 EOF
4428 if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4429   rm -rf conftest*
4430   ac_cv_search_fdatasync="none required"
4431 else
4432   echo "configure: failed program was:" >&5
4433   cat conftest.$ac_ext >&5
4434 fi
4435 rm -f conftest*
4436 test "$ac_cv_search_fdatasync" = "no" && for i in rt posix4; do
4437 LIBS="-l$i  $ac_func_search_save_LIBS"
4438 cat > conftest.$ac_ext <<EOF
4439 #line 4440 "configure"
4440 #include "confdefs.h"
4441 /* Override any gcc2 internal prototype to avoid an error.  */
4442 /* We use char because int might match the return type of a gcc2
4443     builtin and then its argument prototype would still apply.  */
4444 char fdatasync();
4445
4446 int main() {
4447 fdatasync()
4448 ; return 0; }
4449 EOF
4450 if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4451   rm -rf conftest*
4452   ac_cv_search_fdatasync="-l$i"
4453 break
4454 else
4455   echo "configure: failed program was:" >&5
4456   cat conftest.$ac_ext >&5
4457 fi
4458 rm -f conftest*
4459 done
4460 LIBS="$ac_func_search_save_LIBS"
4461 fi
4462
4463 echo "$ac_t""$ac_cv_search_fdatasync" 1>&6
4464 if test "$ac_cv_search_fdatasync" != "no"; then
4465   test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS"
4466   
4467 else :
4468   
4469 fi
4470
4471 if test "$with_krb4" = yes ; then
4472   echo $ac_n "checking for des_encrypt in -ldes""... $ac_c" 1>&6
4473 echo "configure:4474: checking for des_encrypt in -ldes" >&5
4474 ac_lib_var=`echo des'_'des_encrypt | sed 'y%./+-%__p_%'`
4475 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4476   echo $ac_n "(cached) $ac_c" 1>&6
4477 else
4478   ac_save_LIBS="$LIBS"
4479 LIBS="-ldes  $LIBS"
4480 cat > conftest.$ac_ext <<EOF
4481 #line 4482 "configure"
4482 #include "confdefs.h"
4483 /* Override any gcc2 internal prototype to avoid an error.  */
4484 /* We use char because int might match the return type of a gcc2
4485     builtin and then its argument prototype would still apply.  */
4486 char des_encrypt();
4487
4488 int main() {
4489 des_encrypt()
4490 ; return 0; }
4491 EOF
4492 if { (eval echo configure:4493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4493   rm -rf conftest*
4494   eval "ac_cv_lib_$ac_lib_var=yes"
4495 else
4496   echo "configure: failed program was:" >&5
4497   cat conftest.$ac_ext >&5
4498   rm -rf conftest*
4499   eval "ac_cv_lib_$ac_lib_var=no"
4500 fi
4501 rm -f conftest*
4502 LIBS="$ac_save_LIBS"
4503
4504 fi
4505 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4506   echo "$ac_t""yes" 1>&6
4507     ac_tr_lib=HAVE_LIB`echo des | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4508     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4509   cat >> confdefs.h <<EOF
4510 #define $ac_tr_lib 1
4511 EOF
4512
4513   LIBS="-ldes $LIBS"
4514
4515 else
4516   echo "$ac_t""no" 1>&6
4517 { echo "configure: error: library 'des' is required for Kerberos 4" 1>&2; exit 1; }
4518 fi
4519
4520   echo $ac_n "checking for krb_sendauth in -lkrb""... $ac_c" 1>&6
4521 echo "configure:4522: checking for krb_sendauth in -lkrb" >&5
4522 ac_lib_var=`echo krb'_'krb_sendauth | sed 'y%./+-%__p_%'`
4523 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4524   echo $ac_n "(cached) $ac_c" 1>&6
4525 else
4526   ac_save_LIBS="$LIBS"
4527 LIBS="-lkrb  $LIBS"
4528 cat > conftest.$ac_ext <<EOF
4529 #line 4530 "configure"
4530 #include "confdefs.h"
4531 /* Override any gcc2 internal prototype to avoid an error.  */
4532 /* We use char because int might match the return type of a gcc2
4533     builtin and then its argument prototype would still apply.  */
4534 char krb_sendauth();
4535
4536 int main() {
4537 krb_sendauth()
4538 ; return 0; }
4539 EOF
4540 if { (eval echo configure:4541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4541   rm -rf conftest*
4542   eval "ac_cv_lib_$ac_lib_var=yes"
4543 else
4544   echo "configure: failed program was:" >&5
4545   cat conftest.$ac_ext >&5
4546   rm -rf conftest*
4547   eval "ac_cv_lib_$ac_lib_var=no"
4548 fi
4549 rm -f conftest*
4550 LIBS="$ac_save_LIBS"
4551
4552 fi
4553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4554   echo "$ac_t""yes" 1>&6
4555     ac_tr_lib=HAVE_LIB`echo krb | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4556     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4557   cat >> confdefs.h <<EOF
4558 #define $ac_tr_lib 1
4559 EOF
4560
4561   LIBS="-lkrb $LIBS"
4562
4563 else
4564   echo "$ac_t""no" 1>&6
4565 { echo "configure: error: library 'krb' is required for Kerberos 4" 1>&2; exit 1; }
4566 fi
4567
4568 fi
4569
4570 if test "$with_krb5" = yes ; then
4571   echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6
4572 echo "configure:4573: checking for com_err in -lcom_err" >&5
4573 ac_lib_var=`echo com_err'_'com_err | sed 'y%./+-%__p_%'`
4574 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4575   echo $ac_n "(cached) $ac_c" 1>&6
4576 else
4577   ac_save_LIBS="$LIBS"
4578 LIBS="-lcom_err  $LIBS"
4579 cat > conftest.$ac_ext <<EOF
4580 #line 4581 "configure"
4581 #include "confdefs.h"
4582 /* Override any gcc2 internal prototype to avoid an error.  */
4583 /* We use char because int might match the return type of a gcc2
4584     builtin and then its argument prototype would still apply.  */
4585 char com_err();
4586
4587 int main() {
4588 com_err()
4589 ; return 0; }
4590 EOF
4591 if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4592   rm -rf conftest*
4593   eval "ac_cv_lib_$ac_lib_var=yes"
4594 else
4595   echo "configure: failed program was:" >&5
4596   cat conftest.$ac_ext >&5
4597   rm -rf conftest*
4598   eval "ac_cv_lib_$ac_lib_var=no"
4599 fi
4600 rm -f conftest*
4601 LIBS="$ac_save_LIBS"
4602
4603 fi
4604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4605   echo "$ac_t""yes" 1>&6
4606     ac_tr_lib=HAVE_LIB`echo com_err | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4607     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4608   cat >> confdefs.h <<EOF
4609 #define $ac_tr_lib 1
4610 EOF
4611
4612   LIBS="-lcom_err $LIBS"
4613
4614 else
4615   echo "$ac_t""no" 1>&6
4616 { echo "configure: error: library 'com_err' is required for Kerberos 5" 1>&2; exit 1; }
4617 fi
4618
4619   echo $ac_n "checking for krb5_encrypt in -lcrypto""... $ac_c" 1>&6
4620 echo "configure:4621: checking for krb5_encrypt in -lcrypto" >&5
4621 ac_lib_var=`echo crypto'_'krb5_encrypt | sed 'y%./+-%__p_%'`
4622 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4623   echo $ac_n "(cached) $ac_c" 1>&6
4624 else
4625   ac_save_LIBS="$LIBS"
4626 LIBS="-lcrypto  $LIBS"
4627 cat > conftest.$ac_ext <<EOF
4628 #line 4629 "configure"
4629 #include "confdefs.h"
4630 /* Override any gcc2 internal prototype to avoid an error.  */
4631 /* We use char because int might match the return type of a gcc2
4632     builtin and then its argument prototype would still apply.  */
4633 char krb5_encrypt();
4634
4635 int main() {
4636 krb5_encrypt()
4637 ; return 0; }
4638 EOF
4639 if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4640   rm -rf conftest*
4641   eval "ac_cv_lib_$ac_lib_var=yes"
4642 else
4643   echo "configure: failed program was:" >&5
4644   cat conftest.$ac_ext >&5
4645   rm -rf conftest*
4646   eval "ac_cv_lib_$ac_lib_var=no"
4647 fi
4648 rm -f conftest*
4649 LIBS="$ac_save_LIBS"
4650
4651 fi
4652 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4653   echo "$ac_t""yes" 1>&6
4654     ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4655     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4656   cat >> confdefs.h <<EOF
4657 #define $ac_tr_lib 1
4658 EOF
4659
4660   LIBS="-lcrypto $LIBS"
4661
4662 else
4663   echo "$ac_t""no" 1>&6
4664 echo $ac_n "checking for krb5_encrypt in -lk5crypto""... $ac_c" 1>&6
4665 echo "configure:4666: checking for krb5_encrypt in -lk5crypto" >&5
4666 ac_lib_var=`echo k5crypto'_'krb5_encrypt | sed 'y%./+-%__p_%'`
4667 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4668   echo $ac_n "(cached) $ac_c" 1>&6
4669 else
4670   ac_save_LIBS="$LIBS"
4671 LIBS="-lk5crypto  $LIBS"
4672 cat > conftest.$ac_ext <<EOF
4673 #line 4674 "configure"
4674 #include "confdefs.h"
4675 /* Override any gcc2 internal prototype to avoid an error.  */
4676 /* We use char because int might match the return type of a gcc2
4677     builtin and then its argument prototype would still apply.  */
4678 char krb5_encrypt();
4679
4680 int main() {
4681 krb5_encrypt()
4682 ; return 0; }
4683 EOF
4684 if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4685   rm -rf conftest*
4686   eval "ac_cv_lib_$ac_lib_var=yes"
4687 else
4688   echo "configure: failed program was:" >&5
4689   cat conftest.$ac_ext >&5
4690   rm -rf conftest*
4691   eval "ac_cv_lib_$ac_lib_var=no"
4692 fi
4693 rm -f conftest*
4694 LIBS="$ac_save_LIBS"
4695
4696 fi
4697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4698   echo "$ac_t""yes" 1>&6
4699     ac_tr_lib=HAVE_LIB`echo k5crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4700     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4701   cat >> confdefs.h <<EOF
4702 #define $ac_tr_lib 1
4703 EOF
4704
4705   LIBS="-lk5crypto $LIBS"
4706
4707 else
4708   echo "$ac_t""no" 1>&6
4709 { echo "configure: error: library 'crypto' or 'k5crypto' is required for Kerberos 5" 1>&2; exit 1; }
4710 fi
4711
4712 fi
4713
4714   echo $ac_n "checking for krb5_sendauth in -lkrb5""... $ac_c" 1>&6
4715 echo "configure:4716: checking for krb5_sendauth in -lkrb5" >&5
4716 ac_lib_var=`echo krb5'_'krb5_sendauth | sed 'y%./+-%__p_%'`
4717 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4718   echo $ac_n "(cached) $ac_c" 1>&6
4719 else
4720   ac_save_LIBS="$LIBS"
4721 LIBS="-lkrb5  $LIBS"
4722 cat > conftest.$ac_ext <<EOF
4723 #line 4724 "configure"
4724 #include "confdefs.h"
4725 /* Override any gcc2 internal prototype to avoid an error.  */
4726 /* We use char because int might match the return type of a gcc2
4727     builtin and then its argument prototype would still apply.  */
4728 char krb5_sendauth();
4729
4730 int main() {
4731 krb5_sendauth()
4732 ; return 0; }
4733 EOF
4734 if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4735   rm -rf conftest*
4736   eval "ac_cv_lib_$ac_lib_var=yes"
4737 else
4738   echo "configure: failed program was:" >&5
4739   cat conftest.$ac_ext >&5
4740   rm -rf conftest*
4741   eval "ac_cv_lib_$ac_lib_var=no"
4742 fi
4743 rm -f conftest*
4744 LIBS="$ac_save_LIBS"
4745
4746 fi
4747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4748   echo "$ac_t""yes" 1>&6
4749     ac_tr_lib=HAVE_LIB`echo krb5 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4750     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4751   cat >> confdefs.h <<EOF
4752 #define $ac_tr_lib 1
4753 EOF
4754
4755   LIBS="-lkrb5 $LIBS"
4756
4757 else
4758   echo "$ac_t""no" 1>&6
4759 { echo "configure: error: library 'krb5' is required for Kerberos 5" 1>&2; exit 1; }
4760 fi
4761
4762 fi
4763
4764 if test "$with_openssl" = yes ; then
4765     echo $ac_n "checking for CRYPTO_new_ex_data in -lcrypto""... $ac_c" 1>&6
4766 echo "configure:4767: checking for CRYPTO_new_ex_data in -lcrypto" >&5
4767 ac_lib_var=`echo crypto'_'CRYPTO_new_ex_data | sed 'y%./+-%__p_%'`
4768 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4769   echo $ac_n "(cached) $ac_c" 1>&6
4770 else
4771   ac_save_LIBS="$LIBS"
4772 LIBS="-lcrypto  $LIBS"
4773 cat > conftest.$ac_ext <<EOF
4774 #line 4775 "configure"
4775 #include "confdefs.h"
4776 /* Override any gcc2 internal prototype to avoid an error.  */
4777 /* We use char because int might match the return type of a gcc2
4778     builtin and then its argument prototype would still apply.  */
4779 char CRYPTO_new_ex_data();
4780
4781 int main() {
4782 CRYPTO_new_ex_data()
4783 ; return 0; }
4784 EOF
4785 if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4786   rm -rf conftest*
4787   eval "ac_cv_lib_$ac_lib_var=yes"
4788 else
4789   echo "configure: failed program was:" >&5
4790   cat conftest.$ac_ext >&5
4791   rm -rf conftest*
4792   eval "ac_cv_lib_$ac_lib_var=no"
4793 fi
4794 rm -f conftest*
4795 LIBS="$ac_save_LIBS"
4796
4797 fi
4798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4799   echo "$ac_t""yes" 1>&6
4800     ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4801     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4802   cat >> confdefs.h <<EOF
4803 #define $ac_tr_lib 1
4804 EOF
4805
4806   LIBS="-lcrypto $LIBS"
4807
4808 else
4809   echo "$ac_t""no" 1>&6
4810 { echo "configure: error: library 'crypto' is required for OpenSSL" 1>&2; exit 1; }
4811 fi
4812
4813   echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
4814 echo "configure:4815: checking for SSL_library_init in -lssl" >&5
4815 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-%__p_%'`
4816 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4817   echo $ac_n "(cached) $ac_c" 1>&6
4818 else
4819   ac_save_LIBS="$LIBS"
4820 LIBS="-lssl  $LIBS"
4821 cat > conftest.$ac_ext <<EOF
4822 #line 4823 "configure"
4823 #include "confdefs.h"
4824 /* Override any gcc2 internal prototype to avoid an error.  */
4825 /* We use char because int might match the return type of a gcc2
4826     builtin and then its argument prototype would still apply.  */
4827 char SSL_library_init();
4828
4829 int main() {
4830 SSL_library_init()
4831 ; return 0; }
4832 EOF
4833 if { (eval echo configure:4834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4834   rm -rf conftest*
4835   eval "ac_cv_lib_$ac_lib_var=yes"
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840   eval "ac_cv_lib_$ac_lib_var=no"
4841 fi
4842 rm -f conftest*
4843 LIBS="$ac_save_LIBS"
4844
4845 fi
4846 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4847   echo "$ac_t""yes" 1>&6
4848     ac_tr_lib=HAVE_LIB`echo ssl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4849     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4850   cat >> confdefs.h <<EOF
4851 #define $ac_tr_lib 1
4852 EOF
4853
4854   LIBS="-lssl $LIBS"
4855
4856 else
4857   echo "$ac_t""no" 1>&6
4858 { echo "configure: error: library 'ssl' is required for OpenSSL" 1>&2; exit 1; }
4859 fi
4860
4861 fi
4862
4863 if test "$with_pam" = yes ; then
4864   echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
4865 echo "configure:4866: checking for pam_start in -lpam" >&5
4866 ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
4867 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4868   echo $ac_n "(cached) $ac_c" 1>&6
4869 else
4870   ac_save_LIBS="$LIBS"
4871 LIBS="-lpam  $LIBS"
4872 cat > conftest.$ac_ext <<EOF
4873 #line 4874 "configure"
4874 #include "confdefs.h"
4875 /* Override any gcc2 internal prototype to avoid an error.  */
4876 /* We use char because int might match the return type of a gcc2
4877     builtin and then its argument prototype would still apply.  */
4878 char pam_start();
4879
4880 int main() {
4881 pam_start()
4882 ; return 0; }
4883 EOF
4884 if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4885   rm -rf conftest*
4886   eval "ac_cv_lib_$ac_lib_var=yes"
4887 else
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   eval "ac_cv_lib_$ac_lib_var=no"
4892 fi
4893 rm -f conftest*
4894 LIBS="$ac_save_LIBS"
4895
4896 fi
4897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4898   echo "$ac_t""yes" 1>&6
4899     ac_tr_lib=HAVE_LIB`echo pam | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4900     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4901   cat >> confdefs.h <<EOF
4902 #define $ac_tr_lib 1
4903 EOF
4904
4905   LIBS="-lpam $LIBS"
4906
4907 else
4908   echo "$ac_t""no" 1>&6
4909 { echo "configure: error: library 'pam' is required for PAM" 1>&2; exit 1; }
4910 fi
4911
4912 fi
4913
4914 if test "$enable_nls" = yes ; then
4915   
4916   
4917 echo $ac_n "checking for library containing gettext""... $ac_c" 1>&6
4918 echo "configure:4919: checking for library containing gettext" >&5
4919 if eval "test \"`echo '$''{'ac_cv_search_gettext'+set}'`\" = set"; then
4920   echo $ac_n "(cached) $ac_c" 1>&6
4921 else
4922   ac_func_search_save_LIBS="$LIBS"
4923 ac_cv_search_gettext="no"
4924 cat > conftest.$ac_ext <<EOF
4925 #line 4926 "configure"
4926 #include "confdefs.h"
4927 /* Override any gcc2 internal prototype to avoid an error.  */
4928 /* We use char because int might match the return type of a gcc2
4929     builtin and then its argument prototype would still apply.  */
4930 char gettext();
4931
4932 int main() {
4933 gettext()
4934 ; return 0; }
4935 EOF
4936 if { (eval echo configure:4937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4937   rm -rf conftest*
4938   ac_cv_search_gettext="none required"
4939 else
4940   echo "configure: failed program was:" >&5
4941   cat conftest.$ac_ext >&5
4942 fi
4943 rm -f conftest*
4944 test "$ac_cv_search_gettext" = "no" && for i in intl; do
4945 LIBS="-l$i  $ac_func_search_save_LIBS"
4946 cat > conftest.$ac_ext <<EOF
4947 #line 4948 "configure"
4948 #include "confdefs.h"
4949 /* Override any gcc2 internal prototype to avoid an error.  */
4950 /* We use char because int might match the return type of a gcc2
4951     builtin and then its argument prototype would still apply.  */
4952 char gettext();
4953
4954 int main() {
4955 gettext()
4956 ; return 0; }
4957 EOF
4958 if { (eval echo configure:4959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4959   rm -rf conftest*
4960   ac_cv_search_gettext="-l$i"
4961 break
4962 else
4963   echo "configure: failed program was:" >&5
4964   cat conftest.$ac_ext >&5
4965 fi
4966 rm -f conftest*
4967 done
4968 LIBS="$ac_func_search_save_LIBS"
4969 fi
4970
4971 echo "$ac_t""$ac_cv_search_gettext" 1>&6
4972 if test "$ac_cv_search_gettext" != "no"; then
4973   test "$ac_cv_search_gettext" = "none required" || LIBS="$ac_cv_search_gettext $LIBS"
4974   
4975 else :
4976   { echo "configure: error: a gettext implementation is required for NLS" 1>&2; exit 1; }
4977 fi
4978   ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
4979 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
4980 echo "configure:4981: checking for libintl.h" >&5
4981 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4982   echo $ac_n "(cached) $ac_c" 1>&6
4983 else
4984   cat > conftest.$ac_ext <<EOF
4985 #line 4986 "configure"
4986 #include "confdefs.h"
4987 #include <libintl.h>
4988 EOF
4989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4990 { (eval echo configure:4991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4991 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4992 if test -z "$ac_err"; then
4993   rm -rf conftest*
4994   eval "ac_cv_header_$ac_safe=yes"
4995 else
4996   echo "$ac_err" >&5
4997   echo "configure: failed program was:" >&5
4998   cat conftest.$ac_ext >&5
4999   rm -rf conftest*
5000   eval "ac_cv_header_$ac_safe=no"
5001 fi
5002 rm -f conftest*
5003 fi
5004 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5005   echo "$ac_t""yes" 1>&6
5006   :
5007 else
5008   echo "$ac_t""no" 1>&6
5009 { echo "configure: error: header file <libintl.h> is required for NLS" 1>&2; exit 1; }
5010 fi
5011
5012   for ac_prog in msgfmt
5013 do
5014 # Extract the first word of "$ac_prog", so it can be a program name with args.
5015 set dummy $ac_prog; ac_word=$2
5016 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5017 echo "configure:5018: checking for $ac_word" >&5
5018 if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
5019   echo $ac_n "(cached) $ac_c" 1>&6
5020 else
5021   if test -n "$MSGFMT"; then
5022   ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
5023 else
5024   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5025   ac_dummy="$PATH"
5026   for ac_dir in $ac_dummy; do
5027     test -z "$ac_dir" && ac_dir=.
5028     if test -f $ac_dir/$ac_word; then
5029       ac_cv_prog_MSGFMT="$ac_prog"
5030       break
5031     fi
5032   done
5033   IFS="$ac_save_ifs"
5034 fi
5035 fi
5036 MSGFMT="$ac_cv_prog_MSGFMT"
5037 if test -n "$MSGFMT"; then
5038   echo "$ac_t""$MSGFMT" 1>&6
5039 else
5040   echo "$ac_t""no" 1>&6
5041 fi
5042
5043 test -n "$MSGFMT" && break
5044 done
5045
5046   if test -z "$MSGFMT"; then
5047     { echo "configure: error: msgfmt is required for NLS" 1>&2; exit 1; }
5048   fi
5049   for ac_prog in msgmerge
5050 do
5051 # Extract the first word of "$ac_prog", so it can be a program name with args.
5052 set dummy $ac_prog; ac_word=$2
5053 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5054 echo "configure:5055: checking for $ac_word" >&5
5055 if eval "test \"`echo '$''{'ac_cv_prog_MSGMERGE'+set}'`\" = set"; then
5056   echo $ac_n "(cached) $ac_c" 1>&6
5057 else
5058   if test -n "$MSGMERGE"; then
5059   ac_cv_prog_MSGMERGE="$MSGMERGE" # Let the user override the test.
5060 else
5061   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5062   ac_dummy="$PATH"
5063   for ac_dir in $ac_dummy; do
5064     test -z "$ac_dir" && ac_dir=.
5065     if test -f $ac_dir/$ac_word; then
5066       ac_cv_prog_MSGMERGE="$ac_prog"
5067       break
5068     fi
5069   done
5070   IFS="$ac_save_ifs"
5071 fi
5072 fi
5073 MSGMERGE="$ac_cv_prog_MSGMERGE"
5074 if test -n "$MSGMERGE"; then
5075   echo "$ac_t""$MSGMERGE" 1>&6
5076 else
5077   echo "$ac_t""no" 1>&6
5078 fi
5079
5080 test -n "$MSGMERGE" && break
5081 done
5082
5083   for ac_prog in xgettext
5084 do
5085 # Extract the first word of "$ac_prog", so it can be a program name with args.
5086 set dummy $ac_prog; ac_word=$2
5087 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5088 echo "configure:5089: checking for $ac_word" >&5
5089 if eval "test \"`echo '$''{'ac_cv_prog_XGETTEXT'+set}'`\" = set"; then
5090   echo $ac_n "(cached) $ac_c" 1>&6
5091 else
5092   if test -n "$XGETTEXT"; then
5093   ac_cv_prog_XGETTEXT="$XGETTEXT" # Let the user override the test.
5094 else
5095   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
5096   ac_dummy="$PATH"
5097   for ac_dir in $ac_dummy; do
5098     test -z "$ac_dir" && ac_dir=.
5099     if test -f $ac_dir/$ac_word; then
5100       ac_cv_prog_XGETTEXT="$ac_prog"
5101       break
5102     fi
5103   done
5104   IFS="$ac_save_ifs"
5105 fi
5106 fi
5107 XGETTEXT="$ac_cv_prog_XGETTEXT"
5108 if test -n "$XGETTEXT"; then
5109   echo "$ac_t""$XGETTEXT" 1>&6
5110 else
5111   echo "$ac_t""no" 1>&6
5112 fi
5113
5114 test -n "$XGETTEXT" && break
5115 done
5116
5117
5118   # Note: share/locale is always the default, independent of $datadir
5119   localedir='${prefix}/share/locale'
5120   if test x"$prefix" = x"NONE"; then
5121     exp_localedir="$ac_default_prefix/share/locale"
5122   else
5123     exp_localedir="$prefix/share/locale"
5124   fi
5125
5126   
5127   cat >> confdefs.h <<EOF
5128 #define LOCALEDIR "$exp_localedir"
5129 EOF
5130
5131
5132 fi
5133
5134 ##
5135 ## Header files
5136 ##
5137 for ac_hdr in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/types.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h
5138 do
5139 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5140 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5141 echo "configure:5142: checking for $ac_hdr" >&5
5142 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5143   echo $ac_n "(cached) $ac_c" 1>&6
5144 else
5145   cat > conftest.$ac_ext <<EOF
5146 #line 5147 "configure"
5147 #include "confdefs.h"
5148 #include <$ac_hdr>
5149 EOF
5150 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5151 { (eval echo configure:5152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5152 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5153 if test -z "$ac_err"; then
5154   rm -rf conftest*
5155   eval "ac_cv_header_$ac_safe=yes"
5156 else
5157   echo "$ac_err" >&5
5158   echo "configure: failed program was:" >&5
5159   cat conftest.$ac_ext >&5
5160   rm -rf conftest*
5161   eval "ac_cv_header_$ac_safe=no"
5162 fi
5163 rm -f conftest*
5164 fi
5165 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5166   echo "$ac_t""yes" 1>&6
5167     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5168   cat >> confdefs.h <<EOF
5169 #define $ac_tr_hdr 1
5170 EOF
5171  
5172 else
5173   echo "$ac_t""no" 1>&6
5174 fi
5175 done
5176
5177
5178 for ac_hdr in netinet/in.h
5179 do
5180 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5181 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5182 echo "configure:5183: checking for $ac_hdr" >&5
5183 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5184   echo $ac_n "(cached) $ac_c" 1>&6
5185 else
5186   cat > conftest.$ac_ext <<EOF
5187 #line 5188 "configure"
5188 #include "confdefs.h"
5189 #include <$ac_hdr>
5190 EOF
5191 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5192 { (eval echo configure:5193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5193 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5194 if test -z "$ac_err"; then
5195   rm -rf conftest*
5196   eval "ac_cv_header_$ac_safe=yes"
5197 else
5198   echo "$ac_err" >&5
5199   echo "configure: failed program was:" >&5
5200   cat conftest.$ac_ext >&5
5201   rm -rf conftest*
5202   eval "ac_cv_header_$ac_safe=no"
5203 fi
5204 rm -f conftest*
5205 fi
5206 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5207   echo "$ac_t""yes" 1>&6
5208     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5209   cat >> confdefs.h <<EOF
5210 #define $ac_tr_hdr 1
5211 EOF
5212  
5213 else
5214   echo "$ac_t""no" 1>&6
5215 fi
5216 done
5217
5218 echo $ac_n "checking for netinet/tcp.h""... $ac_c" 1>&6
5219 echo "configure:5220: checking for netinet/tcp.h" >&5
5220 cat > conftest.$ac_ext <<EOF
5221 #line 5222 "configure"
5222 #include "confdefs.h"
5223
5224 #ifdef HAVE_NETINET_IN_H
5225 #include <netinet/in.h>
5226 #endif
5227 #include <netinet/tcp.h>
5228
5229 EOF
5230 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5231 { (eval echo configure:5232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5232 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5233 if test -z "$ac_err"; then
5234   rm -rf conftest*
5235   cat >> confdefs.h <<\EOF
5236 #define HAVE_NETINET_TCP_H 1
5237 EOF
5238  echo "$ac_t""yes" 1>&6
5239 else
5240   echo "$ac_err" >&5
5241   echo "configure: failed program was:" >&5
5242   cat conftest.$ac_ext >&5
5243   rm -rf conftest*
5244   echo "$ac_t""no" 1>&6
5245 fi
5246 rm -f conftest*
5247
5248 echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
5249 echo "configure:5250: checking whether string.h and strings.h may both be included" >&5
5250 if eval "test \"`echo '$''{'pgac_cv_header_strings_both'+set}'`\" = set"; then
5251   echo $ac_n "(cached) $ac_c" 1>&6
5252 else
5253   cat > conftest.$ac_ext <<EOF
5254 #line 5255 "configure"
5255 #include "confdefs.h"
5256 #include <string.h>
5257 #include <strings.h>
5258
5259 EOF
5260 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5261 { (eval echo configure:5262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5262 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5263 if test -z "$ac_err"; then
5264   rm -rf conftest*
5265   cat > conftest.$ac_ext <<EOF
5266 #line 5267 "configure"
5267 #include "confdefs.h"
5268 #include <string.h>
5269 #include <strings.h>
5270
5271 int main() {
5272 int n = strcasecmp("a", "b");
5273 ; return 0; }
5274 EOF
5275 if { (eval echo configure:5276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5276   rm -rf conftest*
5277   pgac_cv_header_strings_both=yes
5278 else
5279   echo "configure: failed program was:" >&5
5280   cat conftest.$ac_ext >&5
5281   rm -rf conftest*
5282   pgac_cv_header_strings_both=no
5283 fi
5284 rm -f conftest*
5285 else
5286   echo "$ac_err" >&5
5287   echo "configure: failed program was:" >&5
5288   cat conftest.$ac_ext >&5
5289   rm -rf conftest*
5290   pgac_cv_header_strings_both=no
5291 fi
5292 rm -f conftest*
5293 fi
5294
5295 echo "$ac_t""$pgac_cv_header_strings_both" 1>&6
5296 if test x"$pgac_cv_header_strings_both" = x"yes"; then
5297   cat >> confdefs.h <<\EOF
5298 #define STRING_H_WITH_STRINGS_H 1
5299 EOF
5300
5301 fi
5302
5303 for ac_hdr in readline/readline.h readline.h
5304 do
5305 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5306 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5307 echo "configure:5308: checking for $ac_hdr" >&5
5308 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5309   echo $ac_n "(cached) $ac_c" 1>&6
5310 else
5311   cat > conftest.$ac_ext <<EOF
5312 #line 5313 "configure"
5313 #include "confdefs.h"
5314 #include <$ac_hdr>
5315 EOF
5316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5317 { (eval echo configure:5318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5319 if test -z "$ac_err"; then
5320   rm -rf conftest*
5321   eval "ac_cv_header_$ac_safe=yes"
5322 else
5323   echo "$ac_err" >&5
5324   echo "configure: failed program was:" >&5
5325   cat conftest.$ac_ext >&5
5326   rm -rf conftest*
5327   eval "ac_cv_header_$ac_safe=no"
5328 fi
5329 rm -f conftest*
5330 fi
5331 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5332   echo "$ac_t""yes" 1>&6
5333     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5334   cat >> confdefs.h <<EOF
5335 #define $ac_tr_hdr 1
5336 EOF
5337  break
5338 else
5339   echo "$ac_t""no" 1>&6
5340 fi
5341 done
5342
5343 for ac_hdr in readline/history.h history.h
5344 do
5345 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5346 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5347 echo "configure:5348: checking for $ac_hdr" >&5
5348 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5349   echo $ac_n "(cached) $ac_c" 1>&6
5350 else
5351   cat > conftest.$ac_ext <<EOF
5352 #line 5353 "configure"
5353 #include "confdefs.h"
5354 #include <$ac_hdr>
5355 EOF
5356 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5357 { (eval echo configure:5358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5358 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5359 if test -z "$ac_err"; then
5360   rm -rf conftest*
5361   eval "ac_cv_header_$ac_safe=yes"
5362 else
5363   echo "$ac_err" >&5
5364   echo "configure: failed program was:" >&5
5365   cat conftest.$ac_ext >&5
5366   rm -rf conftest*
5367   eval "ac_cv_header_$ac_safe=no"
5368 fi
5369 rm -f conftest*
5370 fi
5371 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5372   echo "$ac_t""yes" 1>&6
5373     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5374   cat >> confdefs.h <<EOF
5375 #define $ac_tr_hdr 1
5376 EOF
5377  break
5378 else
5379   echo "$ac_t""no" 1>&6
5380 fi
5381 done
5382
5383
5384 if test "$with_krb4" = yes ; then
5385   ac_safe=`echo "krb.h" | sed 'y%./+-%__p_%'`
5386 echo $ac_n "checking for krb.h""... $ac_c" 1>&6
5387 echo "configure:5388: checking for krb.h" >&5
5388 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5389   echo $ac_n "(cached) $ac_c" 1>&6
5390 else
5391   cat > conftest.$ac_ext <<EOF
5392 #line 5393 "configure"
5393 #include "confdefs.h"
5394 #include <krb.h>
5395 EOF
5396 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5397 { (eval echo configure:5398: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5398 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5399 if test -z "$ac_err"; then
5400   rm -rf conftest*
5401   eval "ac_cv_header_$ac_safe=yes"
5402 else
5403   echo "$ac_err" >&5
5404   echo "configure: failed program was:" >&5
5405   cat conftest.$ac_ext >&5
5406   rm -rf conftest*
5407   eval "ac_cv_header_$ac_safe=no"
5408 fi
5409 rm -f conftest*
5410 fi
5411 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5412   echo "$ac_t""yes" 1>&6
5413   :
5414 else
5415   echo "$ac_t""no" 1>&6
5416 { echo "configure: error: header file <krb.h> is required for Kerberos 4" 1>&2; exit 1; }
5417 fi
5418
5419 fi
5420
5421 if test "$with_krb5" = yes ; then
5422   ac_safe=`echo "krb5.h" | sed 'y%./+-%__p_%'`
5423 echo $ac_n "checking for krb5.h""... $ac_c" 1>&6
5424 echo "configure:5425: checking for krb5.h" >&5
5425 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5426   echo $ac_n "(cached) $ac_c" 1>&6
5427 else
5428   cat > conftest.$ac_ext <<EOF
5429 #line 5430 "configure"
5430 #include "confdefs.h"
5431 #include <krb5.h>
5432 EOF
5433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5434 { (eval echo configure:5435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5436 if test -z "$ac_err"; then
5437   rm -rf conftest*
5438   eval "ac_cv_header_$ac_safe=yes"
5439 else
5440   echo "$ac_err" >&5
5441   echo "configure: failed program was:" >&5
5442   cat conftest.$ac_ext >&5
5443   rm -rf conftest*
5444   eval "ac_cv_header_$ac_safe=no"
5445 fi
5446 rm -f conftest*
5447 fi
5448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5449   echo "$ac_t""yes" 1>&6
5450   :
5451 else
5452   echo "$ac_t""no" 1>&6
5453 { echo "configure: error: header file <krb5.h> is required for Kerberos 5" 1>&2; exit 1; }
5454 fi
5455
5456   ac_safe=`echo "com_err.h" | sed 'y%./+-%__p_%'`
5457 echo $ac_n "checking for com_err.h""... $ac_c" 1>&6
5458 echo "configure:5459: checking for com_err.h" >&5
5459 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5460   echo $ac_n "(cached) $ac_c" 1>&6
5461 else
5462   cat > conftest.$ac_ext <<EOF
5463 #line 5464 "configure"
5464 #include "confdefs.h"
5465 #include <com_err.h>
5466 EOF
5467 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5468 { (eval echo configure:5469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5469 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5470 if test -z "$ac_err"; then
5471   rm -rf conftest*
5472   eval "ac_cv_header_$ac_safe=yes"
5473 else
5474   echo "$ac_err" >&5
5475   echo "configure: failed program was:" >&5
5476   cat conftest.$ac_ext >&5
5477   rm -rf conftest*
5478   eval "ac_cv_header_$ac_safe=no"
5479 fi
5480 rm -f conftest*
5481 fi
5482 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5483   echo "$ac_t""yes" 1>&6
5484   :
5485 else
5486   echo "$ac_t""no" 1>&6
5487 { echo "configure: error: header file <com_err.h> is required for Kerberos 5" 1>&2; exit 1; }
5488 fi
5489
5490 fi
5491
5492 if test "$with_openssl" = yes ; then
5493   ac_safe=`echo "openssl/ssl.h" | sed 'y%./+-%__p_%'`
5494 echo $ac_n "checking for openssl/ssl.h""... $ac_c" 1>&6
5495 echo "configure:5496: checking for openssl/ssl.h" >&5
5496 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5497   echo $ac_n "(cached) $ac_c" 1>&6
5498 else
5499   cat > conftest.$ac_ext <<EOF
5500 #line 5501 "configure"
5501 #include "confdefs.h"
5502 #include <openssl/ssl.h>
5503 EOF
5504 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5505 { (eval echo configure:5506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5506 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5507 if test -z "$ac_err"; then
5508   rm -rf conftest*
5509   eval "ac_cv_header_$ac_safe=yes"
5510 else
5511   echo "$ac_err" >&5
5512   echo "configure: failed program was:" >&5
5513   cat conftest.$ac_ext >&5
5514   rm -rf conftest*
5515   eval "ac_cv_header_$ac_safe=no"
5516 fi
5517 rm -f conftest*
5518 fi
5519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5520   echo "$ac_t""yes" 1>&6
5521   :
5522 else
5523   echo "$ac_t""no" 1>&6
5524 { echo "configure: error: header file <openssl/ssl.h> is required for OpenSSL" 1>&2; exit 1; }
5525 fi
5526
5527   ac_safe=`echo "openssl/err.h" | sed 'y%./+-%__p_%'`
5528 echo $ac_n "checking for openssl/err.h""... $ac_c" 1>&6
5529 echo "configure:5530: checking for openssl/err.h" >&5
5530 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5531   echo $ac_n "(cached) $ac_c" 1>&6
5532 else
5533   cat > conftest.$ac_ext <<EOF
5534 #line 5535 "configure"
5535 #include "confdefs.h"
5536 #include <openssl/err.h>
5537 EOF
5538 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5539 { (eval echo configure:5540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5540 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5541 if test -z "$ac_err"; then
5542   rm -rf conftest*
5543   eval "ac_cv_header_$ac_safe=yes"
5544 else
5545   echo "$ac_err" >&5
5546   echo "configure: failed program was:" >&5
5547   cat conftest.$ac_ext >&5
5548   rm -rf conftest*
5549   eval "ac_cv_header_$ac_safe=no"
5550 fi
5551 rm -f conftest*
5552 fi
5553 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5554   echo "$ac_t""yes" 1>&6
5555   :
5556 else
5557   echo "$ac_t""no" 1>&6
5558 { echo "configure: error: header file <openssl/err.h> is required for OpenSSL" 1>&2; exit 1; }
5559 fi
5560
5561 fi
5562
5563 if test "$with_pam" = yes ; then
5564   ac_safe=`echo "security/pam_appl.h" | sed 'y%./+-%__p_%'`
5565 echo $ac_n "checking for security/pam_appl.h""... $ac_c" 1>&6
5566 echo "configure:5567: checking for security/pam_appl.h" >&5
5567 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5568   echo $ac_n "(cached) $ac_c" 1>&6
5569 else
5570   cat > conftest.$ac_ext <<EOF
5571 #line 5572 "configure"
5572 #include "confdefs.h"
5573 #include <security/pam_appl.h>
5574 EOF
5575 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5576 { (eval echo configure:5577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5577 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5578 if test -z "$ac_err"; then
5579   rm -rf conftest*
5580   eval "ac_cv_header_$ac_safe=yes"
5581 else
5582   echo "$ac_err" >&5
5583   echo "configure: failed program was:" >&5
5584   cat conftest.$ac_ext >&5
5585   rm -rf conftest*
5586   eval "ac_cv_header_$ac_safe=no"
5587 fi
5588 rm -f conftest*
5589 fi
5590 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5591   echo "$ac_t""yes" 1>&6
5592   :
5593 else
5594   echo "$ac_t""no" 1>&6
5595 { echo "configure: error: header file <security/pam_appl.h> is required for PAM" 1>&2; exit 1; }
5596 fi
5597
5598 fi
5599
5600
5601 ##
5602 ## Types, structures, compiler characteristics
5603 ##
5604 echo $ac_n "checking for working const""... $ac_c" 1>&6
5605 echo "configure:5606: checking for working const" >&5
5606 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
5607   echo $ac_n "(cached) $ac_c" 1>&6
5608 else
5609   cat > conftest.$ac_ext <<EOF
5610 #line 5611 "configure"
5611 #include "confdefs.h"
5612
5613 int main() {
5614
5615 /* Ultrix mips cc rejects this.  */
5616 typedef int charset[2]; const charset x;
5617 /* SunOS 4.1.1 cc rejects this.  */
5618 char const *const *ccp;
5619 char **p;
5620 /* NEC SVR4.0.2 mips cc rejects this.  */
5621 struct point {int x, y;};
5622 static struct point const zero = {0,0};
5623 /* AIX XL C 1.02.0.0 rejects this.
5624    It does not let you subtract one const X* pointer from another in an arm
5625    of an if-expression whose if-part is not a constant expression */
5626 const char *g = "string";
5627 ccp = &g + (g ? g-g : 0);
5628 /* HPUX 7.0 cc rejects these. */
5629 ++ccp;
5630 p = (char**) ccp;
5631 ccp = (char const *const *) p;
5632 { /* SCO 3.2v4 cc rejects this.  */
5633   char *t;
5634   char const *s = 0 ? (char *) 0 : (char const *) 0;
5635
5636   *t++ = 0;
5637 }
5638 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
5639   int x[] = {25, 17};
5640   const int *foo = &x[0];
5641   ++foo;
5642 }
5643 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
5644   typedef const int *iptr;
5645   iptr p = 0;
5646   ++p;
5647 }
5648 { /* AIX XL C 1.02.0.0 rejects this saying
5649      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
5650   struct s { int j; const int *ap[3]; };
5651   struct s *b; b->j = 5;
5652 }
5653 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
5654   const int foo = 10;
5655 }
5656
5657 ; return 0; }
5658 EOF
5659 if { (eval echo configure:5660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5660   rm -rf conftest*
5661   ac_cv_c_const=yes
5662 else
5663   echo "configure: failed program was:" >&5
5664   cat conftest.$ac_ext >&5
5665   rm -rf conftest*
5666   ac_cv_c_const=no
5667 fi
5668 rm -f conftest*
5669 fi
5670
5671 echo "$ac_t""$ac_cv_c_const" 1>&6
5672 if test $ac_cv_c_const = no; then
5673   cat >> confdefs.h <<\EOF
5674 #define const 
5675 EOF
5676
5677 fi
5678
5679 echo $ac_n "checking for inline""... $ac_c" 1>&6
5680 echo "configure:5681: checking for inline" >&5
5681 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
5682   echo $ac_n "(cached) $ac_c" 1>&6
5683 else
5684   ac_cv_c_inline=no
5685 for ac_kw in inline __inline__ __inline; do
5686   cat > conftest.$ac_ext <<EOF
5687 #line 5688 "configure"
5688 #include "confdefs.h"
5689
5690 int main() {
5691 } $ac_kw foo() {
5692 ; return 0; }
5693 EOF
5694 if { (eval echo configure:5695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5695   rm -rf conftest*
5696   ac_cv_c_inline=$ac_kw; break
5697 else
5698   echo "configure: failed program was:" >&5
5699   cat conftest.$ac_ext >&5
5700 fi
5701 rm -f conftest*
5702 done
5703
5704 fi
5705
5706 echo "$ac_t""$ac_cv_c_inline" 1>&6
5707 case "$ac_cv_c_inline" in
5708   inline | yes) ;;
5709   no) cat >> confdefs.h <<\EOF
5710 #define inline 
5711 EOF
5712  ;;
5713   *)  cat >> confdefs.h <<EOF
5714 #define inline $ac_cv_c_inline
5715 EOF
5716  ;;
5717 esac
5718
5719
5720
5721 echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
5722 echo "configure:5723: checking for preprocessor stringizing operator" >&5
5723 if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
5724   echo $ac_n "(cached) $ac_c" 1>&6
5725 else
5726   cat > conftest.$ac_ext <<EOF
5727 #line 5728 "configure"
5728 #include "confdefs.h"
5729
5730 #define x(y) #y
5731
5732 char *s = x(teststring);
5733
5734 EOF
5735 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5736   egrep "#teststring" >/dev/null 2>&1; then
5737   rm -rf conftest*
5738   ac_cv_c_stringize=no
5739 else
5740   rm -rf conftest*
5741   ac_cv_c_stringize=yes
5742 fi
5743 rm -f conftest*
5744
5745 fi
5746
5747 if test "${ac_cv_c_stringize}" = yes
5748 then
5749         cat >> confdefs.h <<\EOF
5750 #define HAVE_STRINGIZE 1
5751 EOF
5752
5753 fi
5754 echo "$ac_t""${ac_cv_c_stringize}" 1>&6
5755
5756 echo $ac_n "checking for signed types""... $ac_c" 1>&6
5757 echo "configure:5758: checking for signed types" >&5
5758 if eval "test \"`echo '$''{'pgac_cv_c_signed'+set}'`\" = set"; then
5759   echo $ac_n "(cached) $ac_c" 1>&6
5760 else
5761   cat > conftest.$ac_ext <<EOF
5762 #line 5763 "configure"
5763 #include "confdefs.h"
5764
5765 int main() {
5766 signed char c; signed short s; signed int i;
5767 ; return 0; }
5768 EOF
5769 if { (eval echo configure:5770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5770   rm -rf conftest*
5771   pgac_cv_c_signed=yes
5772 else
5773   echo "configure: failed program was:" >&5
5774   cat conftest.$ac_ext >&5
5775   rm -rf conftest*
5776   pgac_cv_c_signed=no
5777 fi
5778 rm -f conftest*
5779 fi
5780
5781 echo "$ac_t""$pgac_cv_c_signed" 1>&6
5782 if test x"$pgac_cv_c_signed" = xno ; then
5783   cat >> confdefs.h <<\EOF
5784 #define signed 
5785 EOF
5786
5787 fi
5788 echo $ac_n "checking for volatile""... $ac_c" 1>&6
5789 echo "configure:5790: checking for volatile" >&5
5790 if eval "test \"`echo '$''{'pgac_cv_c_volatile'+set}'`\" = set"; then
5791   echo $ac_n "(cached) $ac_c" 1>&6
5792 else
5793   cat > conftest.$ac_ext <<EOF
5794 #line 5795 "configure"
5795 #include "confdefs.h"
5796
5797 int main() {
5798 extern volatile int i;
5799 ; return 0; }
5800 EOF
5801 if { (eval echo configure:5802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5802   rm -rf conftest*
5803   pgac_cv_c_volatile=yes
5804 else
5805   echo "configure: failed program was:" >&5
5806   cat conftest.$ac_ext >&5
5807   rm -rf conftest*
5808   pgac_cv_c_volatile=no
5809 fi
5810 rm -f conftest*
5811 fi
5812
5813 echo "$ac_t""$pgac_cv_c_volatile" 1>&6
5814 if test x"$pgac_cv_c_volatile" = xno ; then
5815   cat >> confdefs.h <<\EOF
5816 #define volatile 
5817 EOF
5818
5819 fi
5820 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
5821 echo "configure:5822: checking whether struct tm is in sys/time.h or time.h" >&5
5822 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
5823   echo $ac_n "(cached) $ac_c" 1>&6
5824 else
5825   cat > conftest.$ac_ext <<EOF
5826 #line 5827 "configure"
5827 #include "confdefs.h"
5828 #include <sys/types.h>
5829 #include <time.h>
5830 int main() {
5831 struct tm *tp; tp->tm_sec;
5832 ; return 0; }
5833 EOF
5834 if { (eval echo configure:5835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5835   rm -rf conftest*
5836   ac_cv_struct_tm=time.h
5837 else
5838   echo "configure: failed program was:" >&5
5839   cat conftest.$ac_ext >&5
5840   rm -rf conftest*
5841   ac_cv_struct_tm=sys/time.h
5842 fi
5843 rm -f conftest*
5844 fi
5845
5846 echo "$ac_t""$ac_cv_struct_tm" 1>&6
5847 if test $ac_cv_struct_tm = sys/time.h; then
5848   cat >> confdefs.h <<\EOF
5849 #define TM_IN_SYS_TIME 1
5850 EOF
5851
5852 fi
5853
5854 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
5855 echo "configure:5856: checking for tm_zone in struct tm" >&5
5856 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
5857   echo $ac_n "(cached) $ac_c" 1>&6
5858 else
5859   cat > conftest.$ac_ext <<EOF
5860 #line 5861 "configure"
5861 #include "confdefs.h"
5862 #include <sys/types.h>
5863 #include <$ac_cv_struct_tm>
5864 int main() {
5865 struct tm tm; tm.tm_zone;
5866 ; return 0; }
5867 EOF
5868 if { (eval echo configure:5869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5869   rm -rf conftest*
5870   ac_cv_struct_tm_zone=yes
5871 else
5872   echo "configure: failed program was:" >&5
5873   cat conftest.$ac_ext >&5
5874   rm -rf conftest*
5875   ac_cv_struct_tm_zone=no
5876 fi
5877 rm -f conftest*
5878 fi
5879
5880 echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
5881 if test "$ac_cv_struct_tm_zone" = yes; then
5882   cat >> confdefs.h <<\EOF
5883 #define HAVE_TM_ZONE 1
5884 EOF
5885
5886 else
5887   echo $ac_n "checking for tzname""... $ac_c" 1>&6
5888 echo "configure:5889: checking for tzname" >&5
5889 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
5890   echo $ac_n "(cached) $ac_c" 1>&6
5891 else
5892   cat > conftest.$ac_ext <<EOF
5893 #line 5894 "configure"
5894 #include "confdefs.h"
5895 #include <time.h>
5896 #ifndef tzname /* For SGI.  */
5897 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
5898 #endif
5899 int main() {
5900 atoi(*tzname);
5901 ; return 0; }
5902 EOF
5903 if { (eval echo configure:5904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5904   rm -rf conftest*
5905   ac_cv_var_tzname=yes
5906 else
5907   echo "configure: failed program was:" >&5
5908   cat conftest.$ac_ext >&5
5909   rm -rf conftest*
5910   ac_cv_var_tzname=no
5911 fi
5912 rm -f conftest*
5913 fi
5914
5915 echo "$ac_t""$ac_cv_var_tzname" 1>&6
5916   if test $ac_cv_var_tzname = yes; then
5917     cat >> confdefs.h <<\EOF
5918 #define HAVE_TZNAME 1
5919 EOF
5920
5921   fi
5922 fi
5923
5924 echo $ac_n "checking for union semun""... $ac_c" 1>&6
5925 echo "configure:5926: checking for union semun" >&5
5926 if eval "test \"`echo '$''{'pgac_cv_union_semun'+set}'`\" = set"; then
5927   echo $ac_n "(cached) $ac_c" 1>&6
5928 else
5929   cat > conftest.$ac_ext <<EOF
5930 #line 5931 "configure"
5931 #include "confdefs.h"
5932 #include <sys/types.h>
5933 #include <sys/ipc.h>
5934 #include <sys/sem.h>
5935 int main() {
5936 union semun semun;
5937 ; return 0; }
5938 EOF
5939 if { (eval echo configure:5940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5940   rm -rf conftest*
5941   pgac_cv_union_semun=yes
5942 else
5943   echo "configure: failed program was:" >&5
5944   cat conftest.$ac_ext >&5
5945   rm -rf conftest*
5946   pgac_cv_union_semun=no
5947 fi
5948 rm -f conftest*
5949 fi
5950
5951 echo "$ac_t""$pgac_cv_union_semun" 1>&6
5952 if test x"$pgac_cv_union_semun" = xyes ; then
5953   cat >> confdefs.h <<\EOF
5954 #define HAVE_UNION_SEMUN 1
5955 EOF
5956
5957 fi
5958 echo $ac_n "checking for struct cmsgcred""... $ac_c" 1>&6
5959 echo "configure:5960: checking for struct cmsgcred" >&5
5960 if eval "test \"`echo '$''{'pgac_cv_struct_cmsgcred'+set}'`\" = set"; then
5961   echo $ac_n "(cached) $ac_c" 1>&6
5962 else
5963   cat > conftest.$ac_ext <<EOF
5964 #line 5965 "configure"
5965 #include "confdefs.h"
5966 #include <sys/param.h>
5967 #include <sys/socket.h>
5968 #include <sys/ucred.h>
5969 int main() {
5970 struct cmsgcred sockcred;
5971 ; return 0; }
5972 EOF
5973 if { (eval echo configure:5974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5974   rm -rf conftest*
5975   pgac_cv_struct_cmsgcred=yes
5976 else
5977   echo "configure: failed program was:" >&5
5978   cat conftest.$ac_ext >&5
5979   rm -rf conftest*
5980   pgac_cv_struct_cmsgcred=no
5981 fi
5982 rm -f conftest*
5983 fi
5984
5985 echo "$ac_t""$pgac_cv_struct_cmsgcred" 1>&6
5986 if test x"$pgac_cv_struct_cmsgcred" = xyes ; then
5987   cat >> confdefs.h <<\EOF
5988 #define HAVE_STRUCT_CMSGCRED 1
5989 EOF
5990
5991 fi
5992 echo $ac_n "checking for struct fcred""... $ac_c" 1>&6
5993 echo "configure:5994: checking for struct fcred" >&5
5994 if eval "test \"`echo '$''{'pgac_cv_struct_fcred'+set}'`\" = set"; then
5995   echo $ac_n "(cached) $ac_c" 1>&6
5996 else
5997   cat > conftest.$ac_ext <<EOF
5998 #line 5999 "configure"
5999 #include "confdefs.h"
6000 #include <sys/param.h>
6001 #include <sys/socket.h>
6002 #include <sys/ucred.h>
6003 int main() {
6004 struct fcred sockcred;
6005 ; return 0; }
6006 EOF
6007 if { (eval echo configure:6008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6008   rm -rf conftest*
6009   pgac_cv_struct_fcred=yes
6010 else
6011   echo "configure: failed program was:" >&5
6012   cat conftest.$ac_ext >&5
6013   rm -rf conftest*
6014   pgac_cv_struct_fcred=no
6015 fi
6016 rm -f conftest*
6017 fi
6018
6019 echo "$ac_t""$pgac_cv_struct_fcred" 1>&6
6020 if test x"$pgac_cv_struct_fcred" = xyes ; then
6021   cat >> confdefs.h <<\EOF
6022 #define HAVE_STRUCT_FCRED 1
6023 EOF
6024
6025 fi
6026 echo $ac_n "checking for struct sockcred""... $ac_c" 1>&6
6027 echo "configure:6028: checking for struct sockcred" >&5
6028 if eval "test \"`echo '$''{'pgac_cv_struct_sockcred'+set}'`\" = set"; then
6029   echo $ac_n "(cached) $ac_c" 1>&6
6030 else
6031   cat > conftest.$ac_ext <<EOF
6032 #line 6033 "configure"
6033 #include "confdefs.h"
6034 #include <sys/param.h>
6035 #include <sys/socket.h>
6036 #include <sys/ucred.h>
6037 int main() {
6038 struct sockcred sockcred;
6039 ; return 0; }
6040 EOF
6041 if { (eval echo configure:6042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6042   rm -rf conftest*
6043   pgac_cv_struct_sockcred=yes
6044 else
6045   echo "configure: failed program was:" >&5
6046   cat conftest.$ac_ext >&5
6047   rm -rf conftest*
6048   pgac_cv_struct_sockcred=no
6049 fi
6050 rm -f conftest*
6051 fi
6052
6053 echo "$ac_t""$pgac_cv_struct_sockcred" 1>&6
6054 if test x"$pgac_cv_struct_sockcred" = xyes ; then
6055   cat >> confdefs.h <<\EOF
6056 #define HAVE_STRUCT_SOCKCRED 1
6057 EOF
6058
6059 fi
6060 echo $ac_n "checking for struct sockaddr_un""... $ac_c" 1>&6
6061 echo "configure:6062: checking for struct sockaddr_un" >&5
6062 if eval "test \"`echo '$''{'pgac_cv_struct_sockaddr_un'+set}'`\" = set"; then
6063   echo $ac_n "(cached) $ac_c" 1>&6
6064 else
6065   cat > conftest.$ac_ext <<EOF
6066 #line 6067 "configure"
6067 #include "confdefs.h"
6068 #include <sys/types.h>
6069 #ifdef HAVE_SYS_UN_H
6070 #include <sys/un.h>
6071 #endif
6072 int main() {
6073 struct sockaddr_un un;
6074 ; return 0; }
6075 EOF
6076 if { (eval echo configure:6077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6077   rm -rf conftest*
6078   pgac_cv_struct_sockaddr_un=yes
6079 else
6080   echo "configure: failed program was:" >&5
6081   cat conftest.$ac_ext >&5
6082   rm -rf conftest*
6083   pgac_cv_struct_sockaddr_un=no
6084 fi
6085 rm -f conftest*
6086 fi
6087
6088 echo "$ac_t""$pgac_cv_struct_sockaddr_un" 1>&6
6089 if test x"$pgac_cv_struct_sockaddr_un" = xyes; then
6090   cat >> confdefs.h <<\EOF
6091 #define HAVE_STRUCT_SOCKADDR_UN 1
6092 EOF
6093
6094 fi
6095
6096 ##
6097 ## Functions, global variables
6098 ##
6099 echo $ac_n "checking for int timezone""... $ac_c" 1>&6
6100 echo "configure:6101: checking for int timezone" >&5
6101 if eval "test \"`echo '$''{'pgac_cv_var_int_timezone'+set}'`\" = set"; then
6102   echo $ac_n "(cached) $ac_c" 1>&6
6103 else
6104   cat > conftest.$ac_ext <<EOF
6105 #line 6106 "configure"
6106 #include "confdefs.h"
6107 #include <time.h>
6108 int res;
6109 int main() {
6110 res = timezone / 60;
6111 ; return 0; }
6112 EOF
6113 if { (eval echo configure:6114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6114   rm -rf conftest*
6115   pgac_cv_var_int_timezone=yes
6116 else
6117   echo "configure: failed program was:" >&5
6118   cat conftest.$ac_ext >&5
6119   rm -rf conftest*
6120   pgac_cv_var_int_timezone=no
6121 fi
6122 rm -f conftest*
6123 fi
6124
6125 echo "$ac_t""$pgac_cv_var_int_timezone" 1>&6
6126 if test x"$pgac_cv_var_int_timezone" = xyes ; then
6127   cat >> confdefs.h <<\EOF
6128 #define HAVE_INT_TIMEZONE 
6129 EOF
6130
6131 fi
6132 echo $ac_n "checking types of arguments for accept()""... $ac_c" 1>&6
6133 echo "configure:6134: checking types of arguments for accept()" >&5
6134  if eval "test \"`echo '$''{'ac_cv_func_accept_arg1'+set}'`\" = set"; then
6135   echo $ac_n "(cached) $ac_c" 1>&6
6136 else
6137    if eval "test \"`echo '$''{'ac_cv_func_accept_arg2'+set}'`\" = set"; then
6138   echo $ac_n "(cached) $ac_c" 1>&6
6139 else
6140     if eval "test \"`echo '$''{'ac_cv_func_accept_arg3'+set}'`\" = set"; then
6141   echo $ac_n "(cached) $ac_c" 1>&6
6142 else
6143      for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
6144      for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
6145       for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
6146        cat > conftest.$ac_ext <<EOF
6147 #line 6148 "configure"
6148 #include "confdefs.h"
6149 #ifdef HAVE_SYS_TYPES_H
6150 #include <sys/types.h>
6151 #endif
6152 #ifdef HAVE_SYS_SOCKET_H
6153 #include <sys/socket.h>
6154 #endif
6155 extern int accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
6156 int main() {
6157
6158 ; return 0; }
6159 EOF
6160 if { (eval echo configure:6161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6161   rm -rf conftest*
6162   ac_not_found=no; break 3
6163 else
6164   echo "configure: failed program was:" >&5
6165   cat conftest.$ac_ext >&5
6166   rm -rf conftest*
6167   ac_not_found=yes
6168 fi
6169 rm -f conftest*
6170       done
6171      done
6172     done
6173     if test "$ac_not_found" = yes; then
6174       { echo "configure: error: could not determine argument types" 1>&2; exit 1; }
6175     fi
6176     if test "$ac_cv_func_accept_arg3" = "void"; then
6177       ac_cv_func_accept_arg3=int
6178     fi
6179    
6180 fi
6181   
6182 fi
6183  
6184 fi
6185  echo "$ac_t""$ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" 1>&6
6186  cat >> confdefs.h <<EOF
6187 #define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
6188 EOF
6189
6190  cat >> confdefs.h <<EOF
6191 #define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
6192 EOF
6193
6194  cat >> confdefs.h <<EOF
6195 #define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
6196 EOF
6197
6198
6199 echo $ac_n "checking whether gettimeofday takes only one argument""... $ac_c" 1>&6
6200 echo "configure:6201: checking whether gettimeofday takes only one argument" >&5
6201 if eval "test \"`echo '$''{'pgac_cv_func_gettimeofday_1arg'+set}'`\" = set"; then
6202   echo $ac_n "(cached) $ac_c" 1>&6
6203 else
6204   cat > conftest.$ac_ext <<EOF
6205 #line 6206 "configure"
6206 #include "confdefs.h"
6207 #include <sys/time.h>
6208 int main() {
6209 struct timeval *tp;
6210 struct timezone *tzp;
6211 gettimeofday(tp,tzp);
6212 ; return 0; }
6213 EOF
6214 if { (eval echo configure:6215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6215   rm -rf conftest*
6216   pgac_cv_func_gettimeofday_1arg=no
6217 else
6218   echo "configure: failed program was:" >&5
6219   cat conftest.$ac_ext >&5
6220   rm -rf conftest*
6221   pgac_cv_func_gettimeofday_1arg=yes
6222 fi
6223 rm -f conftest*
6224 fi
6225
6226 echo "$ac_t""$pgac_cv_func_gettimeofday_1arg" 1>&6
6227 if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
6228   cat >> confdefs.h <<\EOF
6229 #define GETTIMEOFDAY_1ARG 
6230 EOF
6231
6232 fi
6233
6234 for ac_func in fcvt getopt_long memmove pstat setproctitle setsid sigprocmask sysconf waitpid dlopen fdatasync
6235 do
6236 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6237 echo "configure:6238: checking for $ac_func" >&5
6238 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6239   echo $ac_n "(cached) $ac_c" 1>&6
6240 else
6241   cat > conftest.$ac_ext <<EOF
6242 #line 6243 "configure"
6243 #include "confdefs.h"
6244 /* System header to define __stub macros and hopefully few prototypes,
6245     which can conflict with char $ac_func(); below.  */
6246 #include <assert.h>
6247 /* Override any gcc2 internal prototype to avoid an error.  */
6248 /* We use char because int might match the return type of a gcc2
6249     builtin and then its argument prototype would still apply.  */
6250 char $ac_func();
6251
6252 int main() {
6253
6254 /* The GNU C library defines this for functions which it implements
6255     to always fail with ENOSYS.  Some functions are actually named
6256     something starting with __ and the normal name is an alias.  */
6257 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6258 choke me
6259 #else
6260 $ac_func();
6261 #endif
6262
6263 ; return 0; }
6264 EOF
6265 if { (eval echo configure:6266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6266   rm -rf conftest*
6267   eval "ac_cv_func_$ac_func=yes"
6268 else
6269   echo "configure: failed program was:" >&5
6270   cat conftest.$ac_ext >&5
6271   rm -rf conftest*
6272   eval "ac_cv_func_$ac_func=no"
6273 fi
6274 rm -f conftest*
6275 fi
6276
6277 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6278   echo "$ac_t""yes" 1>&6
6279     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6280   cat >> confdefs.h <<EOF
6281 #define $ac_tr_func 1
6282 EOF
6283  
6284 else
6285   echo "$ac_t""no" 1>&6
6286 fi
6287 done
6288
6289
6290 cat > conftest.$ac_ext <<EOF
6291 #line 6292 "configure"
6292 #include "confdefs.h"
6293 #include <unistd.h>
6294 EOF
6295 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6296   egrep "fdatasync" >/dev/null 2>&1; then
6297   rm -rf conftest*
6298   cat >> confdefs.h <<\EOF
6299 #define HAVE_FDATASYNC_DECL 1
6300 EOF
6301
6302 fi
6303 rm -f conftest*
6304
6305
6306 echo $ac_n "checking for PS_STRINGS""... $ac_c" 1>&6
6307 echo "configure:6308: checking for PS_STRINGS" >&5
6308 if eval "test \"`echo '$''{'pgac_cv_var_PS_STRINGS'+set}'`\" = set"; then
6309   echo $ac_n "(cached) $ac_c" 1>&6
6310 else
6311   cat > conftest.$ac_ext <<EOF
6312 #line 6313 "configure"
6313 #include "confdefs.h"
6314 #include <machine/vmparam.h>
6315 #include <sys/exec.h>
6316
6317 int main() {
6318 PS_STRINGS->ps_nargvstr = 1;
6319 PS_STRINGS->ps_argvstr = "foo";
6320 ; return 0; }
6321 EOF
6322 if { (eval echo configure:6323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6323   rm -rf conftest*
6324   pgac_cv_var_PS_STRINGS=yes
6325 else
6326   echo "configure: failed program was:" >&5
6327   cat conftest.$ac_ext >&5
6328   rm -rf conftest*
6329   pgac_cv_var_PS_STRINGS=no
6330 fi
6331 rm -f conftest*
6332 fi
6333
6334 echo "$ac_t""$pgac_cv_var_PS_STRINGS" 1>&6
6335 if test "$pgac_cv_var_PS_STRINGS" = yes ; then
6336   cat >> confdefs.h <<\EOF
6337 #define HAVE_PS_STRINGS 
6338 EOF
6339
6340 fi
6341
6342 SNPRINTF=''
6343 echo $ac_n "checking for snprintf""... $ac_c" 1>&6
6344 echo "configure:6345: checking for snprintf" >&5
6345 if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then
6346   echo $ac_n "(cached) $ac_c" 1>&6
6347 else
6348   cat > conftest.$ac_ext <<EOF
6349 #line 6350 "configure"
6350 #include "confdefs.h"
6351 /* System header to define __stub macros and hopefully few prototypes,
6352     which can conflict with char snprintf(); below.  */
6353 #include <assert.h>
6354 /* Override any gcc2 internal prototype to avoid an error.  */
6355 /* We use char because int might match the return type of a gcc2
6356     builtin and then its argument prototype would still apply.  */
6357 char snprintf();
6358
6359 int main() {
6360
6361 /* The GNU C library defines this for functions which it implements
6362     to always fail with ENOSYS.  Some functions are actually named
6363     something starting with __ and the normal name is an alias.  */
6364 #if defined (__stub_snprintf) || defined (__stub___snprintf)
6365 choke me
6366 #else
6367 snprintf();
6368 #endif
6369
6370 ; return 0; }
6371 EOF
6372 if { (eval echo configure:6373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6373   rm -rf conftest*
6374   eval "ac_cv_func_snprintf=yes"
6375 else
6376   echo "configure: failed program was:" >&5
6377   cat conftest.$ac_ext >&5
6378   rm -rf conftest*
6379   eval "ac_cv_func_snprintf=no"
6380 fi
6381 rm -f conftest*
6382 fi
6383
6384 if eval "test \"`echo '$ac_cv_func_'snprintf`\" = yes"; then
6385   echo "$ac_t""yes" 1>&6
6386   cat >> confdefs.h <<\EOF
6387 #define HAVE_SNPRINTF 1
6388 EOF
6389
6390 else
6391   echo "$ac_t""no" 1>&6
6392 SNPRINTF='snprintf.o'
6393 fi
6394
6395 echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
6396 echo "configure:6397: checking for vsnprintf" >&5
6397 if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
6398   echo $ac_n "(cached) $ac_c" 1>&6
6399 else
6400   cat > conftest.$ac_ext <<EOF
6401 #line 6402 "configure"
6402 #include "confdefs.h"
6403 /* System header to define __stub macros and hopefully few prototypes,
6404     which can conflict with char vsnprintf(); below.  */
6405 #include <assert.h>
6406 /* Override any gcc2 internal prototype to avoid an error.  */
6407 /* We use char because int might match the return type of a gcc2
6408     builtin and then its argument prototype would still apply.  */
6409 char vsnprintf();
6410
6411 int main() {
6412
6413 /* The GNU C library defines this for functions which it implements
6414     to always fail with ENOSYS.  Some functions are actually named
6415     something starting with __ and the normal name is an alias.  */
6416 #if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
6417 choke me
6418 #else
6419 vsnprintf();
6420 #endif
6421
6422 ; return 0; }
6423 EOF
6424 if { (eval echo configure:6425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6425   rm -rf conftest*
6426   eval "ac_cv_func_vsnprintf=yes"
6427 else
6428   echo "configure: failed program was:" >&5
6429   cat conftest.$ac_ext >&5
6430   rm -rf conftest*
6431   eval "ac_cv_func_vsnprintf=no"
6432 fi
6433 rm -f conftest*
6434 fi
6435
6436 if eval "test \"`echo '$ac_cv_func_'vsnprintf`\" = yes"; then
6437   echo "$ac_t""yes" 1>&6
6438   cat >> confdefs.h <<\EOF
6439 #define HAVE_VSNPRINTF 1
6440 EOF
6441
6442 else
6443   echo "$ac_t""no" 1>&6
6444 SNPRINTF='snprintf.o'
6445 fi
6446
6447
6448 cat > conftest.$ac_ext <<EOF
6449 #line 6450 "configure"
6450 #include "confdefs.h"
6451 #include <stdio.h>
6452 EOF
6453 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6454   egrep "snprintf" >/dev/null 2>&1; then
6455   rm -rf conftest*
6456   cat >> confdefs.h <<\EOF
6457 #define HAVE_SNPRINTF_DECL 1
6458 EOF
6459
6460 fi
6461 rm -f conftest*
6462
6463 cat > conftest.$ac_ext <<EOF
6464 #line 6465 "configure"
6465 #include "confdefs.h"
6466 #include <stdio.h>
6467 EOF
6468 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6469   egrep "vsnprintf" >/dev/null 2>&1; then
6470   rm -rf conftest*
6471   cat >> confdefs.h <<\EOF
6472 #define HAVE_VSNPRINTF_DECL 1
6473 EOF
6474
6475 fi
6476 rm -f conftest*
6477
6478
6479 # do this one the hard way in case isinf() is a macro
6480 echo $ac_n "checking for isinf""... $ac_c" 1>&6
6481 echo "configure:6482: checking for isinf" >&5
6482 if eval "test \"`echo '$''{'ac_cv_func_isinf'+set}'`\" = set"; then
6483   echo $ac_n "(cached) $ac_c" 1>&6
6484 else
6485   cat > conftest.$ac_ext <<EOF
6486 #line 6487 "configure"
6487 #include "confdefs.h"
6488 #include <math.h>
6489
6490 int main() {
6491 double x = 0.0; int res = isinf(x);
6492 ; return 0; }
6493 EOF
6494 if { (eval echo configure:6495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6495   rm -rf conftest*
6496   ac_cv_func_isinf=yes
6497 else
6498   echo "configure: failed program was:" >&5
6499   cat conftest.$ac_ext >&5
6500   rm -rf conftest*
6501   ac_cv_func_isinf=no
6502 fi
6503 rm -f conftest*
6504 fi
6505
6506 echo "$ac_t""$ac_cv_func_isinf" 1>&6
6507
6508 if test $ac_cv_func_isinf = yes ; then
6509   cat >> confdefs.h <<\EOF
6510 #define HAVE_ISINF 1
6511 EOF
6512
6513   ISINF=
6514 else
6515   ISINF='isinf.o'
6516   # Look for a way to implement a substitute for isinf()
6517   for ac_func in fpclass fp_class fp_class_d class
6518 do
6519 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6520 echo "configure:6521: checking for $ac_func" >&5
6521 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6522   echo $ac_n "(cached) $ac_c" 1>&6
6523 else
6524   cat > conftest.$ac_ext <<EOF
6525 #line 6526 "configure"
6526 #include "confdefs.h"
6527 /* System header to define __stub macros and hopefully few prototypes,
6528     which can conflict with char $ac_func(); below.  */
6529 #include <assert.h>
6530 /* Override any gcc2 internal prototype to avoid an error.  */
6531 /* We use char because int might match the return type of a gcc2
6532     builtin and then its argument prototype would still apply.  */
6533 char $ac_func();
6534
6535 int main() {
6536
6537 /* The GNU C library defines this for functions which it implements
6538     to always fail with ENOSYS.  Some functions are actually named
6539     something starting with __ and the normal name is an alias.  */
6540 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6541 choke me
6542 #else
6543 $ac_func();
6544 #endif
6545
6546 ; return 0; }
6547 EOF
6548 if { (eval echo configure:6549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6549   rm -rf conftest*
6550   eval "ac_cv_func_$ac_func=yes"
6551 else
6552   echo "configure: failed program was:" >&5
6553   cat conftest.$ac_ext >&5
6554   rm -rf conftest*
6555   eval "ac_cv_func_$ac_func=no"
6556 fi
6557 rm -f conftest*
6558 fi
6559
6560 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6561   echo "$ac_t""yes" 1>&6
6562     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6563   cat >> confdefs.h <<EOF
6564 #define $ac_tr_func 1
6565 EOF
6566  break
6567 else
6568   echo "$ac_t""no" 1>&6
6569 fi
6570 done
6571
6572 fi
6573
6574
6575 echo $ac_n "checking for getrusage""... $ac_c" 1>&6
6576 echo "configure:6577: checking for getrusage" >&5
6577 if eval "test \"`echo '$''{'ac_cv_func_getrusage'+set}'`\" = set"; then
6578   echo $ac_n "(cached) $ac_c" 1>&6
6579 else
6580   cat > conftest.$ac_ext <<EOF
6581 #line 6582 "configure"
6582 #include "confdefs.h"
6583 /* System header to define __stub macros and hopefully few prototypes,
6584     which can conflict with char getrusage(); below.  */
6585 #include <assert.h>
6586 /* Override any gcc2 internal prototype to avoid an error.  */
6587 /* We use char because int might match the return type of a gcc2
6588     builtin and then its argument prototype would still apply.  */
6589 char getrusage();
6590
6591 int main() {
6592
6593 /* The GNU C library defines this for functions which it implements
6594     to always fail with ENOSYS.  Some functions are actually named
6595     something starting with __ and the normal name is an alias.  */
6596 #if defined (__stub_getrusage) || defined (__stub___getrusage)
6597 choke me
6598 #else
6599 getrusage();
6600 #endif
6601
6602 ; return 0; }
6603 EOF
6604 if { (eval echo configure:6605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6605   rm -rf conftest*
6606   eval "ac_cv_func_getrusage=yes"
6607 else
6608   echo "configure: failed program was:" >&5
6609   cat conftest.$ac_ext >&5
6610   rm -rf conftest*
6611   eval "ac_cv_func_getrusage=no"
6612 fi
6613 rm -f conftest*
6614 fi
6615
6616 if eval "test \"`echo '$ac_cv_func_'getrusage`\" = yes"; then
6617   echo "$ac_t""yes" 1>&6
6618   cat >> confdefs.h <<\EOF
6619 #define HAVE_GETRUSAGE 1
6620 EOF
6621
6622 else
6623   echo "$ac_t""no" 1>&6
6624 GETRUSAGE='getrusage.o'
6625 fi
6626
6627
6628 echo $ac_n "checking for srandom""... $ac_c" 1>&6
6629 echo "configure:6630: checking for srandom" >&5
6630 if eval "test \"`echo '$''{'ac_cv_func_srandom'+set}'`\" = set"; then
6631   echo $ac_n "(cached) $ac_c" 1>&6
6632 else
6633   cat > conftest.$ac_ext <<EOF
6634 #line 6635 "configure"
6635 #include "confdefs.h"
6636 /* System header to define __stub macros and hopefully few prototypes,
6637     which can conflict with char srandom(); below.  */
6638 #include <assert.h>
6639 /* Override any gcc2 internal prototype to avoid an error.  */
6640 /* We use char because int might match the return type of a gcc2
6641     builtin and then its argument prototype would still apply.  */
6642 char srandom();
6643
6644 int main() {
6645
6646 /* The GNU C library defines this for functions which it implements
6647     to always fail with ENOSYS.  Some functions are actually named
6648     something starting with __ and the normal name is an alias.  */
6649 #if defined (__stub_srandom) || defined (__stub___srandom)
6650 choke me
6651 #else
6652 srandom();
6653 #endif
6654
6655 ; return 0; }
6656 EOF
6657 if { (eval echo configure:6658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6658   rm -rf conftest*
6659   eval "ac_cv_func_srandom=yes"
6660 else
6661   echo "configure: failed program was:" >&5
6662   cat conftest.$ac_ext >&5
6663   rm -rf conftest*
6664   eval "ac_cv_func_srandom=no"
6665 fi
6666 rm -f conftest*
6667 fi
6668
6669 if eval "test \"`echo '$ac_cv_func_'srandom`\" = yes"; then
6670   echo "$ac_t""yes" 1>&6
6671   cat >> confdefs.h <<\EOF
6672 #define HAVE_SRANDOM 1
6673 EOF
6674
6675 else
6676   echo "$ac_t""no" 1>&6
6677 SRANDOM='srandom.o'
6678 fi
6679
6680
6681 echo $ac_n "checking for gethostname""... $ac_c" 1>&6
6682 echo "configure:6683: checking for gethostname" >&5
6683 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
6684   echo $ac_n "(cached) $ac_c" 1>&6
6685 else
6686   cat > conftest.$ac_ext <<EOF
6687 #line 6688 "configure"
6688 #include "confdefs.h"
6689 /* System header to define __stub macros and hopefully few prototypes,
6690     which can conflict with char gethostname(); below.  */
6691 #include <assert.h>
6692 /* Override any gcc2 internal prototype to avoid an error.  */
6693 /* We use char because int might match the return type of a gcc2
6694     builtin and then its argument prototype would still apply.  */
6695 char gethostname();
6696
6697 int main() {
6698
6699 /* The GNU C library defines this for functions which it implements
6700     to always fail with ENOSYS.  Some functions are actually named
6701     something starting with __ and the normal name is an alias.  */
6702 #if defined (__stub_gethostname) || defined (__stub___gethostname)
6703 choke me
6704 #else
6705 gethostname();
6706 #endif
6707
6708 ; return 0; }
6709 EOF
6710 if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6711   rm -rf conftest*
6712   eval "ac_cv_func_gethostname=yes"
6713 else
6714   echo "configure: failed program was:" >&5
6715   cat conftest.$ac_ext >&5
6716   rm -rf conftest*
6717   eval "ac_cv_func_gethostname=no"
6718 fi
6719 rm -f conftest*
6720 fi
6721
6722 if eval "test \"`echo '$ac_cv_func_'gethostname`\" = yes"; then
6723   echo "$ac_t""yes" 1>&6
6724   cat >> confdefs.h <<\EOF
6725 #define HAVE_GETHOSTNAME 1
6726 EOF
6727
6728 else
6729   echo "$ac_t""no" 1>&6
6730 GETHOSTNAME='gethostname.o'
6731 fi
6732
6733
6734 echo $ac_n "checking for random""... $ac_c" 1>&6
6735 echo "configure:6736: checking for random" >&5
6736 if eval "test \"`echo '$''{'ac_cv_func_random'+set}'`\" = set"; then
6737   echo $ac_n "(cached) $ac_c" 1>&6
6738 else
6739   cat > conftest.$ac_ext <<EOF
6740 #line 6741 "configure"
6741 #include "confdefs.h"
6742 /* System header to define __stub macros and hopefully few prototypes,
6743     which can conflict with char random(); below.  */
6744 #include <assert.h>
6745 /* Override any gcc2 internal prototype to avoid an error.  */
6746 /* We use char because int might match the return type of a gcc2
6747     builtin and then its argument prototype would still apply.  */
6748 char random();
6749
6750 int main() {
6751
6752 /* The GNU C library defines this for functions which it implements
6753     to always fail with ENOSYS.  Some functions are actually named
6754     something starting with __ and the normal name is an alias.  */
6755 #if defined (__stub_random) || defined (__stub___random)
6756 choke me
6757 #else
6758 random();
6759 #endif
6760
6761 ; return 0; }
6762 EOF
6763 if { (eval echo configure:6764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6764   rm -rf conftest*
6765   eval "ac_cv_func_random=yes"
6766 else
6767   echo "configure: failed program was:" >&5
6768   cat conftest.$ac_ext >&5
6769   rm -rf conftest*
6770   eval "ac_cv_func_random=no"
6771 fi
6772 rm -f conftest*
6773 fi
6774
6775 if eval "test \"`echo '$ac_cv_func_'random`\" = yes"; then
6776   echo "$ac_t""yes" 1>&6
6777   cat >> confdefs.h <<\EOF
6778 #define HAVE_RANDOM 1
6779 EOF
6780
6781 else
6782   echo "$ac_t""no" 1>&6
6783 MISSING_RANDOM='random.o'
6784 fi
6785
6786
6787 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
6788 echo "configure:6789: checking for inet_aton" >&5
6789 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
6790   echo $ac_n "(cached) $ac_c" 1>&6
6791 else
6792   cat > conftest.$ac_ext <<EOF
6793 #line 6794 "configure"
6794 #include "confdefs.h"
6795 /* System header to define __stub macros and hopefully few prototypes,
6796     which can conflict with char inet_aton(); below.  */
6797 #include <assert.h>
6798 /* Override any gcc2 internal prototype to avoid an error.  */
6799 /* We use char because int might match the return type of a gcc2
6800     builtin and then its argument prototype would still apply.  */
6801 char inet_aton();
6802
6803 int main() {
6804
6805 /* The GNU C library defines this for functions which it implements
6806     to always fail with ENOSYS.  Some functions are actually named
6807     something starting with __ and the normal name is an alias.  */
6808 #if defined (__stub_inet_aton) || defined (__stub___inet_aton)
6809 choke me
6810 #else
6811 inet_aton();
6812 #endif
6813
6814 ; return 0; }
6815 EOF
6816 if { (eval echo configure:6817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6817   rm -rf conftest*
6818   eval "ac_cv_func_inet_aton=yes"
6819 else
6820   echo "configure: failed program was:" >&5
6821   cat conftest.$ac_ext >&5
6822   rm -rf conftest*
6823   eval "ac_cv_func_inet_aton=no"
6824 fi
6825 rm -f conftest*
6826 fi
6827
6828 if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then
6829   echo "$ac_t""yes" 1>&6
6830   cat >> confdefs.h <<\EOF
6831 #define HAVE_INET_ATON 1
6832 EOF
6833
6834 else
6835   echo "$ac_t""no" 1>&6
6836 INET_ATON='inet_aton.o'
6837 fi
6838
6839
6840 echo $ac_n "checking for strerror""... $ac_c" 1>&6
6841 echo "configure:6842: checking for strerror" >&5
6842 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
6843   echo $ac_n "(cached) $ac_c" 1>&6
6844 else
6845   cat > conftest.$ac_ext <<EOF
6846 #line 6847 "configure"
6847 #include "confdefs.h"
6848 /* System header to define __stub macros and hopefully few prototypes,
6849     which can conflict with char strerror(); below.  */
6850 #include <assert.h>
6851 /* Override any gcc2 internal prototype to avoid an error.  */
6852 /* We use char because int might match the return type of a gcc2
6853     builtin and then its argument prototype would still apply.  */
6854 char strerror();
6855
6856 int main() {
6857
6858 /* The GNU C library defines this for functions which it implements
6859     to always fail with ENOSYS.  Some functions are actually named
6860     something starting with __ and the normal name is an alias.  */
6861 #if defined (__stub_strerror) || defined (__stub___strerror)
6862 choke me
6863 #else
6864 strerror();
6865 #endif
6866
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6870   rm -rf conftest*
6871   eval "ac_cv_func_strerror=yes"
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   eval "ac_cv_func_strerror=no"
6877 fi
6878 rm -f conftest*
6879 fi
6880
6881 if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
6882   echo "$ac_t""yes" 1>&6
6883   cat >> confdefs.h <<\EOF
6884 #define HAVE_STRERROR 1
6885 EOF
6886
6887 else
6888   echo "$ac_t""no" 1>&6
6889 STRERROR='strerror.o'
6890 fi
6891
6892
6893 echo $ac_n "checking for strdup""... $ac_c" 1>&6
6894 echo "configure:6895: checking for strdup" >&5
6895 if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then
6896   echo $ac_n "(cached) $ac_c" 1>&6
6897 else
6898   cat > conftest.$ac_ext <<EOF
6899 #line 6900 "configure"
6900 #include "confdefs.h"
6901 /* System header to define __stub macros and hopefully few prototypes,
6902     which can conflict with char strdup(); below.  */
6903 #include <assert.h>
6904 /* Override any gcc2 internal prototype to avoid an error.  */
6905 /* We use char because int might match the return type of a gcc2
6906     builtin and then its argument prototype would still apply.  */
6907 char strdup();
6908
6909 int main() {
6910
6911 /* The GNU C library defines this for functions which it implements
6912     to always fail with ENOSYS.  Some functions are actually named
6913     something starting with __ and the normal name is an alias.  */
6914 #if defined (__stub_strdup) || defined (__stub___strdup)
6915 choke me
6916 #else
6917 strdup();
6918 #endif
6919
6920 ; return 0; }
6921 EOF
6922 if { (eval echo configure:6923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6923   rm -rf conftest*
6924   eval "ac_cv_func_strdup=yes"
6925 else
6926   echo "configure: failed program was:" >&5
6927   cat conftest.$ac_ext >&5
6928   rm -rf conftest*
6929   eval "ac_cv_func_strdup=no"
6930 fi
6931 rm -f conftest*
6932 fi
6933
6934 if eval "test \"`echo '$ac_cv_func_'strdup`\" = yes"; then
6935   echo "$ac_t""yes" 1>&6
6936   cat >> confdefs.h <<\EOF
6937 #define HAVE_STRDUP 1
6938 EOF
6939
6940 else
6941   echo "$ac_t""no" 1>&6
6942 STRDUP='../../utils/strdup.o'
6943 fi
6944
6945
6946 echo $ac_n "checking for strtol""... $ac_c" 1>&6
6947 echo "configure:6948: checking for strtol" >&5
6948 if eval "test \"`echo '$''{'ac_cv_func_strtol'+set}'`\" = set"; then
6949   echo $ac_n "(cached) $ac_c" 1>&6
6950 else
6951   cat > conftest.$ac_ext <<EOF
6952 #line 6953 "configure"
6953 #include "confdefs.h"
6954 /* System header to define __stub macros and hopefully few prototypes,
6955     which can conflict with char strtol(); below.  */
6956 #include <assert.h>
6957 /* Override any gcc2 internal prototype to avoid an error.  */
6958 /* We use char because int might match the return type of a gcc2
6959     builtin and then its argument prototype would still apply.  */
6960 char strtol();
6961
6962 int main() {
6963
6964 /* The GNU C library defines this for functions which it implements
6965     to always fail with ENOSYS.  Some functions are actually named
6966     something starting with __ and the normal name is an alias.  */
6967 #if defined (__stub_strtol) || defined (__stub___strtol)
6968 choke me
6969 #else
6970 strtol();
6971 #endif
6972
6973 ; return 0; }
6974 EOF
6975 if { (eval echo configure:6976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6976   rm -rf conftest*
6977   eval "ac_cv_func_strtol=yes"
6978 else
6979   echo "configure: failed program was:" >&5
6980   cat conftest.$ac_ext >&5
6981   rm -rf conftest*
6982   eval "ac_cv_func_strtol=no"
6983 fi
6984 rm -f conftest*
6985 fi
6986
6987 if eval "test \"`echo '$ac_cv_func_'strtol`\" = yes"; then
6988   echo "$ac_t""yes" 1>&6
6989   cat >> confdefs.h <<\EOF
6990 #define HAVE_STRTOL 1
6991 EOF
6992
6993 else
6994   echo "$ac_t""no" 1>&6
6995 STRTOL='strtol.o'
6996 fi
6997
6998
6999 echo $ac_n "checking for strtoul""... $ac_c" 1>&6
7000 echo "configure:7001: checking for strtoul" >&5
7001 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then
7002   echo $ac_n "(cached) $ac_c" 1>&6
7003 else
7004   cat > conftest.$ac_ext <<EOF
7005 #line 7006 "configure"
7006 #include "confdefs.h"
7007 /* System header to define __stub macros and hopefully few prototypes,
7008     which can conflict with char strtoul(); below.  */
7009 #include <assert.h>
7010 /* Override any gcc2 internal prototype to avoid an error.  */
7011 /* We use char because int might match the return type of a gcc2
7012     builtin and then its argument prototype would still apply.  */
7013 char strtoul();
7014
7015 int main() {
7016
7017 /* The GNU C library defines this for functions which it implements
7018     to always fail with ENOSYS.  Some functions are actually named
7019     something starting with __ and the normal name is an alias.  */
7020 #if defined (__stub_strtoul) || defined (__stub___strtoul)
7021 choke me
7022 #else
7023 strtoul();
7024 #endif
7025
7026 ; return 0; }
7027 EOF
7028 if { (eval echo configure:7029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7029   rm -rf conftest*
7030   eval "ac_cv_func_strtoul=yes"
7031 else
7032   echo "configure: failed program was:" >&5
7033   cat conftest.$ac_ext >&5
7034   rm -rf conftest*
7035   eval "ac_cv_func_strtoul=no"
7036 fi
7037 rm -f conftest*
7038 fi
7039
7040 if eval "test \"`echo '$ac_cv_func_'strtoul`\" = yes"; then
7041   echo "$ac_t""yes" 1>&6
7042   cat >> confdefs.h <<\EOF
7043 #define HAVE_STRTOUL 1
7044 EOF
7045
7046 else
7047   echo "$ac_t""no" 1>&6
7048 STRTOUL='strtoul.o'
7049 fi
7050
7051
7052 echo $ac_n "checking for strcasecmp""... $ac_c" 1>&6
7053 echo "configure:7054: checking for strcasecmp" >&5
7054 if eval "test \"`echo '$''{'ac_cv_func_strcasecmp'+set}'`\" = set"; then
7055   echo $ac_n "(cached) $ac_c" 1>&6
7056 else
7057   cat > conftest.$ac_ext <<EOF
7058 #line 7059 "configure"
7059 #include "confdefs.h"
7060 /* System header to define __stub macros and hopefully few prototypes,
7061     which can conflict with char strcasecmp(); below.  */
7062 #include <assert.h>
7063 /* Override any gcc2 internal prototype to avoid an error.  */
7064 /* We use char because int might match the return type of a gcc2
7065     builtin and then its argument prototype would still apply.  */
7066 char strcasecmp();
7067
7068 int main() {
7069
7070 /* The GNU C library defines this for functions which it implements
7071     to always fail with ENOSYS.  Some functions are actually named
7072     something starting with __ and the normal name is an alias.  */
7073 #if defined (__stub_strcasecmp) || defined (__stub___strcasecmp)
7074 choke me
7075 #else
7076 strcasecmp();
7077 #endif
7078
7079 ; return 0; }
7080 EOF
7081 if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7082   rm -rf conftest*
7083   eval "ac_cv_func_strcasecmp=yes"
7084 else
7085   echo "configure: failed program was:" >&5
7086   cat conftest.$ac_ext >&5
7087   rm -rf conftest*
7088   eval "ac_cv_func_strcasecmp=no"
7089 fi
7090 rm -f conftest*
7091 fi
7092
7093 if eval "test \"`echo '$ac_cv_func_'strcasecmp`\" = yes"; then
7094   echo "$ac_t""yes" 1>&6
7095   cat >> confdefs.h <<\EOF
7096 #define HAVE_STRCASECMP 1
7097 EOF
7098
7099 else
7100   echo "$ac_t""no" 1>&6
7101 STRCASECMP='strcasecmp.o'
7102 fi
7103
7104
7105 echo $ac_n "checking for cbrt""... $ac_c" 1>&6
7106 echo "configure:7107: checking for cbrt" >&5
7107 if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then
7108   echo $ac_n "(cached) $ac_c" 1>&6
7109 else
7110   cat > conftest.$ac_ext <<EOF
7111 #line 7112 "configure"
7112 #include "confdefs.h"
7113 /* System header to define __stub macros and hopefully few prototypes,
7114     which can conflict with char cbrt(); below.  */
7115 #include <assert.h>
7116 /* Override any gcc2 internal prototype to avoid an error.  */
7117 /* We use char because int might match the return type of a gcc2
7118     builtin and then its argument prototype would still apply.  */
7119 char cbrt();
7120
7121 int main() {
7122
7123 /* The GNU C library defines this for functions which it implements
7124     to always fail with ENOSYS.  Some functions are actually named
7125     something starting with __ and the normal name is an alias.  */
7126 #if defined (__stub_cbrt) || defined (__stub___cbrt)
7127 choke me
7128 #else
7129 cbrt();
7130 #endif
7131
7132 ; return 0; }
7133 EOF
7134 if { (eval echo configure:7135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7135   rm -rf conftest*
7136   eval "ac_cv_func_cbrt=yes"
7137 else
7138   echo "configure: failed program was:" >&5
7139   cat conftest.$ac_ext >&5
7140   rm -rf conftest*
7141   eval "ac_cv_func_cbrt=no"
7142 fi
7143 rm -f conftest*
7144 fi
7145
7146 if eval "test \"`echo '$ac_cv_func_'cbrt`\" = yes"; then
7147   echo "$ac_t""yes" 1>&6
7148   cat >> confdefs.h <<\EOF
7149 #define HAVE_CBRT 1
7150 EOF
7151
7152 else
7153   echo "$ac_t""no" 1>&6
7154 echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6
7155 echo "configure:7156: checking for cbrt in -lm" >&5
7156 ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'`
7157 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7158   echo $ac_n "(cached) $ac_c" 1>&6
7159 else
7160   ac_save_LIBS="$LIBS"
7161 LIBS="-lm  $LIBS"
7162 cat > conftest.$ac_ext <<EOF
7163 #line 7164 "configure"
7164 #include "confdefs.h"
7165 /* Override any gcc2 internal prototype to avoid an error.  */
7166 /* We use char because int might match the return type of a gcc2
7167     builtin and then its argument prototype would still apply.  */
7168 char cbrt();
7169
7170 int main() {
7171 cbrt()
7172 ; return 0; }
7173 EOF
7174 if { (eval echo configure:7175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7175   rm -rf conftest*
7176   eval "ac_cv_lib_$ac_lib_var=yes"
7177 else
7178   echo "configure: failed program was:" >&5
7179   cat conftest.$ac_ext >&5
7180   rm -rf conftest*
7181   eval "ac_cv_lib_$ac_lib_var=no"
7182 fi
7183 rm -f conftest*
7184 LIBS="$ac_save_LIBS"
7185
7186 fi
7187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7188   echo "$ac_t""yes" 1>&6
7189   cat >> confdefs.h <<\EOF
7190 #define HAVE_CBRT 1
7191 EOF
7192
7193 else
7194   echo "$ac_t""no" 1>&6
7195 fi
7196
7197 fi
7198
7199
7200 # On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
7201 # this hackery with HPUXMATHLIB allows us to cope.
7202 HPUXMATHLIB=""
7203 case $host_cpu in
7204   hppa1.1) 
7205         if [ -r /lib/pa1.1/libm.a ] ; then
7206             HPUXMATHLIB="-L /lib/pa1.1 -lm"
7207         fi ;;
7208 esac
7209
7210
7211 echo $ac_n "checking for rint""... $ac_c" 1>&6
7212 echo "configure:7213: checking for rint" >&5
7213 if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then
7214   echo $ac_n "(cached) $ac_c" 1>&6
7215 else
7216   cat > conftest.$ac_ext <<EOF
7217 #line 7218 "configure"
7218 #include "confdefs.h"
7219 /* System header to define __stub macros and hopefully few prototypes,
7220     which can conflict with char rint(); below.  */
7221 #include <assert.h>
7222 /* Override any gcc2 internal prototype to avoid an error.  */
7223 /* We use char because int might match the return type of a gcc2
7224     builtin and then its argument prototype would still apply.  */
7225 char rint();
7226
7227 int main() {
7228
7229 /* The GNU C library defines this for functions which it implements
7230     to always fail with ENOSYS.  Some functions are actually named
7231     something starting with __ and the normal name is an alias.  */
7232 #if defined (__stub_rint) || defined (__stub___rint)
7233 choke me
7234 #else
7235 rint();
7236 #endif
7237
7238 ; return 0; }
7239 EOF
7240 if { (eval echo configure:7241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7241   rm -rf conftest*
7242   eval "ac_cv_func_rint=yes"
7243 else
7244   echo "configure: failed program was:" >&5
7245   cat conftest.$ac_ext >&5
7246   rm -rf conftest*
7247   eval "ac_cv_func_rint=no"
7248 fi
7249 rm -f conftest*
7250 fi
7251
7252 if eval "test \"`echo '$ac_cv_func_'rint`\" = yes"; then
7253   echo "$ac_t""yes" 1>&6
7254   cat >> confdefs.h <<\EOF
7255 #define HAVE_RINT 1
7256 EOF
7257
7258 else
7259   echo "$ac_t""no" 1>&6
7260 echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6
7261 echo "configure:7262: checking for rint in -lm" >&5
7262 ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'`
7263 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7264   echo $ac_n "(cached) $ac_c" 1>&6
7265 else
7266   ac_save_LIBS="$LIBS"
7267 LIBS="-lm $HPUXMATHLIB $LIBS"
7268 cat > conftest.$ac_ext <<EOF
7269 #line 7270 "configure"
7270 #include "confdefs.h"
7271 /* Override any gcc2 internal prototype to avoid an error.  */
7272 /* We use char because int might match the return type of a gcc2
7273     builtin and then its argument prototype would still apply.  */
7274 char rint();
7275
7276 int main() {
7277 rint()
7278 ; return 0; }
7279 EOF
7280 if { (eval echo configure:7281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7281   rm -rf conftest*
7282   eval "ac_cv_lib_$ac_lib_var=yes"
7283 else
7284   echo "configure: failed program was:" >&5
7285   cat conftest.$ac_ext >&5
7286   rm -rf conftest*
7287   eval "ac_cv_lib_$ac_lib_var=no"
7288 fi
7289 rm -f conftest*
7290 LIBS="$ac_save_LIBS"
7291
7292 fi
7293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7294   echo "$ac_t""yes" 1>&6
7295   cat >> confdefs.h <<\EOF
7296 #define HAVE_RINT 1
7297 EOF
7298
7299 else
7300   echo "$ac_t""no" 1>&6
7301 fi
7302
7303 fi
7304
7305
7306
7307 # Readline versions < 2.1 don't have rl_completion_append_character
7308 echo $ac_n "checking for rl_completion_append_character""... $ac_c" 1>&6
7309 echo "configure:7310: checking for rl_completion_append_character" >&5
7310 cat > conftest.$ac_ext <<EOF
7311 #line 7312 "configure"
7312 #include "confdefs.h"
7313 #include <stdio.h>
7314 #ifdef HAVE_READLINE_READLINE_H
7315 # include <readline/readline.h>
7316 #elif defined(HAVE_READLINE_H)
7317 # include <readline.h>
7318 #endif
7319
7320 int main() {
7321 rl_completion_append_character = 'x';
7322 ; return 0; }
7323 EOF
7324 if { (eval echo configure:7325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7325   rm -rf conftest*
7326   echo "$ac_t""yes" 1>&6
7327 cat >> confdefs.h <<\EOF
7328 #define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
7329 EOF
7330
7331 else
7332   echo "configure: failed program was:" >&5
7333   cat conftest.$ac_ext >&5
7334   rm -rf conftest*
7335   echo "$ac_t""no" 1>&6
7336 fi
7337 rm -f conftest*
7338
7339 for ac_func in rl_completion_matches rl_filename_completion_function
7340 do
7341 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7342 echo "configure:7343: checking for $ac_func" >&5
7343 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7344   echo $ac_n "(cached) $ac_c" 1>&6
7345 else
7346   cat > conftest.$ac_ext <<EOF
7347 #line 7348 "configure"
7348 #include "confdefs.h"
7349 /* System header to define __stub macros and hopefully few prototypes,
7350     which can conflict with char $ac_func(); below.  */
7351 #include <assert.h>
7352 /* Override any gcc2 internal prototype to avoid an error.  */
7353 /* We use char because int might match the return type of a gcc2
7354     builtin and then its argument prototype would still apply.  */
7355 char $ac_func();
7356
7357 int main() {
7358
7359 /* The GNU C library defines this for functions which it implements
7360     to always fail with ENOSYS.  Some functions are actually named
7361     something starting with __ and the normal name is an alias.  */
7362 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7363 choke me
7364 #else
7365 $ac_func();
7366 #endif
7367
7368 ; return 0; }
7369 EOF
7370 if { (eval echo configure:7371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7371   rm -rf conftest*
7372   eval "ac_cv_func_$ac_func=yes"
7373 else
7374   echo "configure: failed program was:" >&5
7375   cat conftest.$ac_ext >&5
7376   rm -rf conftest*
7377   eval "ac_cv_func_$ac_func=no"
7378 fi
7379 rm -f conftest*
7380 fi
7381
7382 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7383   echo "$ac_t""yes" 1>&6
7384     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7385   cat >> confdefs.h <<EOF
7386 #define $ac_tr_func 1
7387 EOF
7388  
7389 else
7390   echo "$ac_t""no" 1>&6
7391 fi
7392 done
7393
7394
7395
7396 echo $ac_n "checking for finite""... $ac_c" 1>&6
7397 echo "configure:7398: checking for finite" >&5
7398 cat > conftest.$ac_ext <<EOF
7399 #line 7400 "configure"
7400 #include "confdefs.h"
7401 #include <math.h>
7402 int main() {
7403 int dummy=finite(1.0);
7404 ; return 0; }
7405 EOF
7406 if { (eval echo configure:7407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7407   rm -rf conftest*
7408   cat >> confdefs.h <<\EOF
7409 #define HAVE_FINITE 1
7410 EOF
7411  echo "$ac_t""yes" 1>&6
7412 else
7413   echo "configure: failed program was:" >&5
7414   cat conftest.$ac_ext >&5
7415   rm -rf conftest*
7416   echo "$ac_t""no" 1>&6
7417 fi
7418 rm -f conftest*
7419
7420 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
7421 echo "configure:7422: checking for sigsetjmp" >&5
7422 cat > conftest.$ac_ext <<EOF
7423 #line 7424 "configure"
7424 #include "confdefs.h"
7425 #include <setjmp.h>
7426 int main() {
7427 sigjmp_buf x; sigsetjmp(x, 1);
7428 ; return 0; }
7429 EOF
7430 if { (eval echo configure:7431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7431   rm -rf conftest*
7432   cat >> confdefs.h <<\EOF
7433 #define HAVE_SIGSETJMP 1
7434 EOF
7435  echo "$ac_t""yes" 1>&6
7436 else
7437   echo "configure: failed program was:" >&5
7438   cat conftest.$ac_ext >&5
7439   rm -rf conftest*
7440   echo "$ac_t""no" 1>&6
7441 fi
7442 rm -f conftest*
7443
7444
7445 # Check whether --enable-syslog was given
7446 if test x"${enable_syslog+set}" = xset; then
7447   case $enable_syslog in
7448     yes)
7449       echo $ac_n "checking for syslog""... $ac_c" 1>&6
7450 echo "configure:7451: checking for syslog" >&5
7451 if eval "test \"`echo '$''{'ac_cv_func_syslog'+set}'`\" = set"; then
7452   echo $ac_n "(cached) $ac_c" 1>&6
7453 else
7454   cat > conftest.$ac_ext <<EOF
7455 #line 7456 "configure"
7456 #include "confdefs.h"
7457 /* System header to define __stub macros and hopefully few prototypes,
7458     which can conflict with char syslog(); below.  */
7459 #include <assert.h>
7460 /* Override any gcc2 internal prototype to avoid an error.  */
7461 /* We use char because int might match the return type of a gcc2
7462     builtin and then its argument prototype would still apply.  */
7463 char syslog();
7464
7465 int main() {
7466
7467 /* The GNU C library defines this for functions which it implements
7468     to always fail with ENOSYS.  Some functions are actually named
7469     something starting with __ and the normal name is an alias.  */
7470 #if defined (__stub_syslog) || defined (__stub___syslog)
7471 choke me
7472 #else
7473 syslog();
7474 #endif
7475
7476 ; return 0; }
7477 EOF
7478 if { (eval echo configure:7479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7479   rm -rf conftest*
7480   eval "ac_cv_func_syslog=yes"
7481 else
7482   echo "configure: failed program was:" >&5
7483   cat conftest.$ac_ext >&5
7484   rm -rf conftest*
7485   eval "ac_cv_func_syslog=no"
7486 fi
7487 rm -f conftest*
7488 fi
7489
7490 if eval "test \"`echo '$ac_cv_func_'syslog`\" = yes"; then
7491   echo "$ac_t""yes" 1>&6
7492   cat >> confdefs.h <<\EOF
7493 #define ENABLE_SYSLOG 1
7494 EOF
7495
7496 else
7497   echo "$ac_t""no" 1>&6
7498 { echo "configure: error: no syslog interface found" 1>&2; exit 1; }
7499 fi
7500
7501       ;;
7502     no)
7503       :
7504       ;;
7505     *)
7506       enableval=$enable_syslog
7507       { echo "configure: error: no argument expected for --enable-syslog option" 1>&2; exit 1; }
7508       ;;
7509   esac # $enable_syslog
7510 else
7511   enable_syslog=no
7512
7513 fi
7514
7515
7516 echo $ac_n "checking for optreset""... $ac_c" 1>&6
7517 echo "configure:7518: checking for optreset" >&5
7518 if eval "test \"`echo '$''{'pgac_cv_var_int_optreset'+set}'`\" = set"; then
7519   echo $ac_n "(cached) $ac_c" 1>&6
7520 else
7521   cat > conftest.$ac_ext <<EOF
7522 #line 7523 "configure"
7523 #include "confdefs.h"
7524 #include <unistd.h>
7525 int main() {
7526 extern int optreset; optreset = 1;
7527 ; return 0; }
7528 EOF
7529 if { (eval echo configure:7530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7530   rm -rf conftest*
7531   pgac_cv_var_int_optreset=yes
7532 else
7533   echo "configure: failed program was:" >&5
7534   cat conftest.$ac_ext >&5
7535   rm -rf conftest*
7536   pgac_cv_var_int_optreset=no
7537 fi
7538 rm -f conftest*
7539 fi
7540
7541 echo "$ac_t""$pgac_cv_var_int_optreset" 1>&6
7542 if test x"$pgac_cv_var_int_optreset" = x"yes"; then
7543   cat >> confdefs.h <<\EOF
7544 #define HAVE_INT_OPTRESET 1
7545 EOF
7546
7547 fi
7548
7549
7550 # This test makes sure that run tests work at all.  Sometimes a shared
7551 # library is found by the linker, but the runtime linker can't find it.
7552 # This check should come after all modifications of compiler or linker
7553 # variables, and before any other run tests.
7554 echo $ac_n "checking test program""... $ac_c" 1>&6
7555 echo "configure:7556: checking test program" >&5
7556 if test "$cross_compiling" = yes; then
7557   echo "$ac_t""cross-compiling" 1>&6
7558 else
7559   cat > conftest.$ac_ext <<EOF
7560 #line 7561 "configure"
7561 #include "confdefs.h"
7562 int main() { return 0; }
7563 EOF
7564 if { (eval echo configure:7565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7565 then
7566   echo "$ac_t""ok" 1>&6
7567 else
7568   echo "configure: failed program was:" >&5
7569   cat conftest.$ac_ext >&5
7570   rm -fr conftest*
7571   echo "$ac_t""failed" 1>&6
7572 { echo "configure: error: 
7573 *** Could not execute a simple test program.  This may be a problem
7574 *** related to locating shared libraries.  Check the file 'config.log'
7575 *** for the exact reason." 1>&2; exit 1; }
7576 fi
7577 rm -fr conftest*
7578 fi
7579
7580
7581
7582
7583 echo $ac_n "checking whether long int is 64 bits""... $ac_c" 1>&6
7584 echo "configure:7585: checking whether long int is 64 bits" >&5
7585 if eval "test \"`echo '$''{'pgac_cv_type_long_int_64'+set}'`\" = set"; then
7586   echo $ac_n "(cached) $ac_c" 1>&6
7587 else
7588   if test "$cross_compiling" = yes; then
7589   pgac_cv_type_long_int_64=no
7590 echo "configure: warning: 64 bit arithmetic disabled when cross-compiling" 1>&2
7591 else
7592   cat > conftest.$ac_ext <<EOF
7593 #line 7594 "configure"
7594 #include "confdefs.h"
7595 typedef long int int64;
7596
7597 /*
7598  * These are globals to discourage the compiler from folding all the
7599  * arithmetic tests down to compile-time constants.
7600  */
7601 int64 a = 20000001;
7602 int64 b = 40000005;
7603
7604 int does_int64_work()
7605 {
7606   int64 c,d;
7607
7608   if (sizeof(int64) != 8)
7609     return 0;                   /* definitely not the right size */
7610
7611   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
7612   c = a * b;
7613   d = (c + b) / b;
7614   if (d != a+1)
7615     return 0;
7616   return 1;
7617 }
7618 main() {
7619   exit(! does_int64_work());
7620 }
7621 EOF
7622 if { (eval echo configure:7623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7623 then
7624   pgac_cv_type_long_int_64=yes
7625 else
7626   echo "configure: failed program was:" >&5
7627   cat conftest.$ac_ext >&5
7628   rm -fr conftest*
7629   pgac_cv_type_long_int_64=no
7630 fi
7631 rm -fr conftest*
7632 fi
7633
7634 fi
7635
7636 echo "$ac_t""$pgac_cv_type_long_int_64" 1>&6
7637
7638 HAVE_LONG_INT_64=$pgac_cv_type_long_int_64
7639 if test x"$pgac_cv_type_long_int_64" = xyes ; then
7640   cat >> confdefs.h <<\EOF
7641 #define HAVE_LONG_INT_64 
7642 EOF
7643
7644 fi
7645
7646
7647 if test x"$HAVE_LONG_INT_64" = x"no" ; then
7648   echo $ac_n "checking whether long long int is 64 bits""... $ac_c" 1>&6
7649 echo "configure:7650: checking whether long long int is 64 bits" >&5
7650 if eval "test \"`echo '$''{'pgac_cv_type_long_long_int_64'+set}'`\" = set"; then
7651   echo $ac_n "(cached) $ac_c" 1>&6
7652 else
7653   if test "$cross_compiling" = yes; then
7654   pgac_cv_type_long_long_int_64=no
7655 echo "configure: warning: 64 bit arithmetic disabled when cross-compiling" 1>&2
7656 else
7657   cat > conftest.$ac_ext <<EOF
7658 #line 7659 "configure"
7659 #include "confdefs.h"
7660 typedef long long int int64;
7661
7662 /*
7663  * These are globals to discourage the compiler from folding all the
7664  * arithmetic tests down to compile-time constants.
7665  */
7666 int64 a = 20000001;
7667 int64 b = 40000005;
7668
7669 int does_int64_work()
7670 {
7671   int64 c,d;
7672
7673   if (sizeof(int64) != 8)
7674     return 0;                   /* definitely not the right size */
7675
7676   /* Do perfunctory checks to see if 64-bit arithmetic seems to work */
7677   c = a * b;
7678   d = (c + b) / b;
7679   if (d != a+1)
7680     return 0;
7681   return 1;
7682 }
7683 main() {
7684   exit(! does_int64_work());
7685 }
7686 EOF
7687 if { (eval echo configure:7688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7688 then
7689   pgac_cv_type_long_long_int_64=yes
7690 else
7691   echo "configure: failed program was:" >&5
7692   cat conftest.$ac_ext >&5
7693   rm -fr conftest*
7694   pgac_cv_type_long_long_int_64=no
7695 fi
7696 rm -fr conftest*
7697 fi
7698
7699 fi
7700
7701 echo "$ac_t""$pgac_cv_type_long_long_int_64" 1>&6
7702
7703 HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64
7704 if test x"$pgac_cv_type_long_long_int_64" = xyes ; then
7705   cat >> confdefs.h <<\EOF
7706 #define HAVE_LONG_LONG_INT_64 
7707 EOF
7708
7709 fi
7710
7711 fi
7712
7713
7714
7715 if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
7716   cat > conftest.$ac_ext <<EOF
7717 #line 7718 "configure"
7718 #include "confdefs.h"
7719
7720 #define INT64CONST(x)  x##LL
7721 long long int foo = INT64CONST(0x1234567890123456);
7722
7723 int main() {
7724
7725 ; return 0; }
7726 EOF
7727 if { (eval echo configure:7728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7728   rm -rf conftest*
7729   cat >> confdefs.h <<\EOF
7730 #define HAVE_LL_CONSTANTS 1
7731 EOF
7732
7733 else
7734   echo "configure: failed program was:" >&5
7735   cat conftest.$ac_ext >&5
7736 fi
7737 rm -f conftest*
7738 fi
7739
7740
7741
7742 if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
7743   if [ x$SNPRINTF = x ] ; then
7744     echo $ac_n "checking whether snprintf handles 'long long int' as %lld""... $ac_c" 1>&6
7745 echo "configure:7746: checking whether snprintf handles 'long long int' as %lld" >&5
7746     if test "$cross_compiling" = yes; then
7747    echo "$ac_t""assuming not on target machine" 1>&6
7748         # Force usage of our own snprintf, since we cannot test foreign snprintf
7749         SNPRINTF='snprintf.o'
7750         INT64_FORMAT='"%lld"'
7751   
7752 else
7753   cat > conftest.$ac_ext <<EOF
7754 #line 7755 "configure"
7755 #include "confdefs.h"
7756 #include <stdio.h>
7757 typedef long long int int64;
7758 #define INT64_FORMAT "%lld"
7759
7760 int64 a = 20000001;
7761 int64 b = 40000005;
7762
7763 int does_int64_snprintf_work()
7764 {
7765   int64 c;
7766   char buf[100];
7767
7768   if (sizeof(int64) != 8)
7769     return 0;                   /* doesn't look like the right size */
7770
7771   c = a * b;
7772   snprintf(buf, 100, INT64_FORMAT, c);
7773   if (strcmp(buf, "800000140000005") != 0)
7774     return 0;                   /* either multiply or snprintf is busted */
7775   return 1;
7776 }
7777 main() {
7778   exit(! does_int64_snprintf_work());
7779 }
7780 EOF
7781 if { (eval echo configure:7782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7782 then
7783    echo "$ac_t""yes" 1>&6
7784           INT64_FORMAT='"%lld"'
7785         
7786 else
7787   echo "configure: failed program was:" >&5
7788   cat conftest.$ac_ext >&5
7789   rm -fr conftest*
7790    echo "$ac_t""no" 1>&6
7791     echo $ac_n "checking whether snprintf handles 'long long int' as %qd""... $ac_c" 1>&6
7792 echo "configure:7793: checking whether snprintf handles 'long long int' as %qd" >&5 
7793     if test "$cross_compiling" = yes; then
7794    echo "$ac_t""assuming not on target machine" 1>&6
7795         # Force usage of our own snprintf, since we cannot test foreign snprintf
7796         SNPRINTF='snprintf.o'
7797         INT64_FORMAT='"%lld"'
7798   
7799 else
7800   cat > conftest.$ac_ext <<EOF
7801 #line 7802 "configure"
7802 #include "confdefs.h"
7803 #include <stdio.h>
7804 typedef long long int int64;
7805 #define INT64_FORMAT "%qd"
7806    
7807 int64 a = 20000001;
7808 int64 b = 40000005;
7809    
7810 int does_int64_snprintf_work()
7811 {  
7812   int64 c;
7813   char buf[100];
7814
7815   if (sizeof(int64) != 8)
7816     return 0;     /* doesn't look like the right size */
7817
7818   c = a * b;
7819   snprintf(buf, 100, INT64_FORMAT, c);
7820   if (strcmp(buf, "800000140000005") != 0)
7821     return 0;     /* either multiply or snprintf is busted */
7822   return 1;
7823 }
7824 main() {
7825   exit(! does_int64_snprintf_work());
7826 }
7827 EOF
7828 if { (eval echo configure:7829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7829 then
7830    echo "$ac_t""yes" 1>&6
7831     INT64_FORMAT='"%qd"'
7832   
7833 else
7834   echo "configure: failed program was:" >&5
7835   cat conftest.$ac_ext >&5
7836   rm -fr conftest*
7837    echo "$ac_t""no" 1>&6
7838         # Force usage of our own snprintf, since system snprintf is broken
7839         SNPRINTF='snprintf.o'
7840         INT64_FORMAT='"%lld"'
7841   
7842 fi
7843 rm -fr conftest*
7844 fi
7845  
7846 fi
7847 rm -fr conftest*
7848 fi
7849
7850   else
7851     # here if we previously decided we needed to use our own snprintf
7852     INT64_FORMAT='"%lld"'
7853   fi
7854 else
7855   # Here if we are not using 'long long int' at all
7856   INT64_FORMAT='"%ld"'
7857 fi
7858
7859 cat >> confdefs.h <<EOF
7860 #define INT64_FORMAT $INT64_FORMAT
7861 EOF
7862
7863
7864
7865 for ac_func in strtoll strtoq
7866 do
7867 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7868 echo "configure:7869: checking for $ac_func" >&5
7869 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7870   echo $ac_n "(cached) $ac_c" 1>&6
7871 else
7872   cat > conftest.$ac_ext <<EOF
7873 #line 7874 "configure"
7874 #include "confdefs.h"
7875 /* System header to define __stub macros and hopefully few prototypes,
7876     which can conflict with char $ac_func(); below.  */
7877 #include <assert.h>
7878 /* Override any gcc2 internal prototype to avoid an error.  */
7879 /* We use char because int might match the return type of a gcc2
7880     builtin and then its argument prototype would still apply.  */
7881 char $ac_func();
7882
7883 int main() {
7884
7885 /* The GNU C library defines this for functions which it implements
7886     to always fail with ENOSYS.  Some functions are actually named
7887     something starting with __ and the normal name is an alias.  */
7888 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7889 choke me
7890 #else
7891 $ac_func();
7892 #endif
7893
7894 ; return 0; }
7895 EOF
7896 if { (eval echo configure:7897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7897   rm -rf conftest*
7898   eval "ac_cv_func_$ac_func=yes"
7899 else
7900   echo "configure: failed program was:" >&5
7901   cat conftest.$ac_ext >&5
7902   rm -rf conftest*
7903   eval "ac_cv_func_$ac_func=no"
7904 fi
7905 rm -f conftest*
7906 fi
7907
7908 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7909   echo "$ac_t""yes" 1>&6
7910     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7911   cat >> confdefs.h <<EOF
7912 #define $ac_tr_func 1
7913 EOF
7914  break
7915 else
7916   echo "$ac_t""no" 1>&6
7917 fi
7918 done
7919
7920 for ac_func in strtoull strtouq
7921 do
7922 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7923 echo "configure:7924: checking for $ac_func" >&5
7924 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7925   echo $ac_n "(cached) $ac_c" 1>&6
7926 else
7927   cat > conftest.$ac_ext <<EOF
7928 #line 7929 "configure"
7929 #include "confdefs.h"
7930 /* System header to define __stub macros and hopefully few prototypes,
7931     which can conflict with char $ac_func(); below.  */
7932 #include <assert.h>
7933 /* Override any gcc2 internal prototype to avoid an error.  */
7934 /* We use char because int might match the return type of a gcc2
7935     builtin and then its argument prototype would still apply.  */
7936 char $ac_func();
7937
7938 int main() {
7939
7940 /* The GNU C library defines this for functions which it implements
7941     to always fail with ENOSYS.  Some functions are actually named
7942     something starting with __ and the normal name is an alias.  */
7943 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7944 choke me
7945 #else
7946 $ac_func();
7947 #endif
7948
7949 ; return 0; }
7950 EOF
7951 if { (eval echo configure:7952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7952   rm -rf conftest*
7953   eval "ac_cv_func_$ac_func=yes"
7954 else
7955   echo "configure: failed program was:" >&5
7956   cat conftest.$ac_ext >&5
7957   rm -rf conftest*
7958   eval "ac_cv_func_$ac_func=no"
7959 fi
7960 rm -f conftest*
7961 fi
7962
7963 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7964   echo "$ac_t""yes" 1>&6
7965     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7966   cat >> confdefs.h <<EOF
7967 #define $ac_tr_func 1
7968 EOF
7969  break
7970 else
7971   echo "$ac_t""no" 1>&6
7972 fi
7973 done
7974
7975
7976 echo $ac_n "checking for atexit""... $ac_c" 1>&6
7977 echo "configure:7978: checking for atexit" >&5
7978 if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
7979   echo $ac_n "(cached) $ac_c" 1>&6
7980 else
7981   cat > conftest.$ac_ext <<EOF
7982 #line 7983 "configure"
7983 #include "confdefs.h"
7984 /* System header to define __stub macros and hopefully few prototypes,
7985     which can conflict with char atexit(); below.  */
7986 #include <assert.h>
7987 /* Override any gcc2 internal prototype to avoid an error.  */
7988 /* We use char because int might match the return type of a gcc2
7989     builtin and then its argument prototype would still apply.  */
7990 char atexit();
7991
7992 int main() {
7993
7994 /* The GNU C library defines this for functions which it implements
7995     to always fail with ENOSYS.  Some functions are actually named
7996     something starting with __ and the normal name is an alias.  */
7997 #if defined (__stub_atexit) || defined (__stub___atexit)
7998 choke me
7999 #else
8000 atexit();
8001 #endif
8002
8003 ; return 0; }
8004 EOF
8005 if { (eval echo configure:8006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8006   rm -rf conftest*
8007   eval "ac_cv_func_atexit=yes"
8008 else
8009   echo "configure: failed program was:" >&5
8010   cat conftest.$ac_ext >&5
8011   rm -rf conftest*
8012   eval "ac_cv_func_atexit=no"
8013 fi
8014 rm -f conftest*
8015 fi
8016
8017 if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then
8018   echo "$ac_t""yes" 1>&6
8019   cat >> confdefs.h <<\EOF
8020 #define HAVE_ATEXIT 1
8021 EOF
8022
8023 else
8024   echo "$ac_t""no" 1>&6
8025 for ac_func in on_exit
8026 do
8027 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8028 echo "configure:8029: checking for $ac_func" >&5
8029 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
8030   echo $ac_n "(cached) $ac_c" 1>&6
8031 else
8032   cat > conftest.$ac_ext <<EOF
8033 #line 8034 "configure"
8034 #include "confdefs.h"
8035 /* System header to define __stub macros and hopefully few prototypes,
8036     which can conflict with char $ac_func(); below.  */
8037 #include <assert.h>
8038 /* Override any gcc2 internal prototype to avoid an error.  */
8039 /* We use char because int might match the return type of a gcc2
8040     builtin and then its argument prototype would still apply.  */
8041 char $ac_func();
8042
8043 int main() {
8044
8045 /* The GNU C library defines this for functions which it implements
8046     to always fail with ENOSYS.  Some functions are actually named
8047     something starting with __ and the normal name is an alias.  */
8048 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8049 choke me
8050 #else
8051 $ac_func();
8052 #endif
8053
8054 ; return 0; }
8055 EOF
8056 if { (eval echo configure:8057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8057   rm -rf conftest*
8058   eval "ac_cv_func_$ac_func=yes"
8059 else
8060   echo "configure: failed program was:" >&5
8061   cat conftest.$ac_ext >&5
8062   rm -rf conftest*
8063   eval "ac_cv_func_$ac_func=no"
8064 fi
8065 rm -f conftest*
8066 fi
8067
8068 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
8069   echo "$ac_t""yes" 1>&6
8070     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
8071   cat >> confdefs.h <<EOF
8072 #define $ac_tr_func 1
8073 EOF
8074  cat >> confdefs.h <<\EOF
8075 #define HAVE_ON_EXIT 1
8076 EOF
8077
8078 else
8079   echo "$ac_t""no" 1>&6
8080 { echo "configure: error: neither atexit() nor on_exit() found" 1>&2; exit 1; }
8081 fi
8082 done
8083
8084 fi
8085
8086
8087
8088 echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
8089 echo "configure:8090: checking size of unsigned long" >&5
8090 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then
8091   echo $ac_n "(cached) $ac_c" 1>&6
8092 else
8093   if test "$cross_compiling" = yes; then
8094   ac_cv_sizeof_unsigned_long=4
8095 else
8096   cat > conftest.$ac_ext <<EOF
8097 #line 8098 "configure"
8098 #include "confdefs.h"
8099 #include <stdio.h>
8100 main()
8101 {
8102   FILE *f=fopen("conftestval", "w");
8103   if (!f) exit(1);
8104   fprintf(f, "%d\n", sizeof(unsigned long));
8105   exit(0);
8106 }
8107 EOF
8108 if { (eval echo configure:8109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8109 then
8110   ac_cv_sizeof_unsigned_long=`cat conftestval`
8111 else
8112   echo "configure: failed program was:" >&5
8113   cat conftest.$ac_ext >&5
8114   rm -fr conftest*
8115   ac_cv_sizeof_unsigned_long=0
8116 fi
8117 rm -fr conftest*
8118 fi
8119
8120 fi
8121 echo "$ac_t""$ac_cv_sizeof_unsigned_long" 1>&6
8122 cat >> confdefs.h <<EOF
8123 #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
8124 EOF
8125
8126
8127 cat >> confdefs.h <<EOF
8128 #define SIZEOF_DATUM $ac_cv_sizeof_unsigned_long
8129 EOF
8130
8131
8132
8133 echo $ac_n "checking alignment of short""... $ac_c" 1>&6
8134 echo "configure:8135: checking alignment of short" >&5
8135 if eval "test \"`echo '$''{'pgac_cv_alignof_short'+set}'`\" = set"; then
8136   echo $ac_n "(cached) $ac_c" 1>&6
8137 else
8138   if test "$cross_compiling" = yes; then
8139   pgac_cv_alignof_short='sizeof(short)'
8140 else
8141   cat > conftest.$ac_ext <<EOF
8142 #line 8143 "configure"
8143 #include "confdefs.h"
8144 #include <stdio.h>
8145 struct { char filler; short field; } mystruct;
8146 main()
8147 {
8148   FILE *f=fopen("conftestval", "w");
8149   if (!f) exit(1);
8150   fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
8151   exit(0);
8152 }
8153 EOF
8154 if { (eval echo configure:8155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8155 then
8156   pgac_cv_alignof_short=`cat conftestval`
8157 else
8158   echo "configure: failed program was:" >&5
8159   cat conftest.$ac_ext >&5
8160   rm -fr conftest*
8161   pgac_cv_alignof_short='sizeof(short)'
8162 fi
8163 rm -fr conftest*
8164 fi
8165
8166 fi
8167 echo "$ac_t""$pgac_cv_alignof_short" 1>&6
8168 cat >> confdefs.h <<EOF
8169 #define ALIGNOF_SHORT $pgac_cv_alignof_short
8170 EOF
8171
8172
8173 echo $ac_n "checking alignment of int""... $ac_c" 1>&6
8174 echo "configure:8175: checking alignment of int" >&5
8175 if eval "test \"`echo '$''{'pgac_cv_alignof_int'+set}'`\" = set"; then
8176   echo $ac_n "(cached) $ac_c" 1>&6
8177 else
8178   if test "$cross_compiling" = yes; then
8179   pgac_cv_alignof_int='sizeof(int)'
8180 else
8181   cat > conftest.$ac_ext <<EOF
8182 #line 8183 "configure"
8183 #include "confdefs.h"
8184 #include <stdio.h>
8185 struct { char filler; int field; } mystruct;
8186 main()
8187 {
8188   FILE *f=fopen("conftestval", "w");
8189   if (!f) exit(1);
8190   fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
8191   exit(0);
8192 }
8193 EOF
8194 if { (eval echo configure:8195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8195 then
8196   pgac_cv_alignof_int=`cat conftestval`
8197 else
8198   echo "configure: failed program was:" >&5
8199   cat conftest.$ac_ext >&5
8200   rm -fr conftest*
8201   pgac_cv_alignof_int='sizeof(int)'
8202 fi
8203 rm -fr conftest*
8204 fi
8205
8206 fi
8207 echo "$ac_t""$pgac_cv_alignof_int" 1>&6
8208 cat >> confdefs.h <<EOF
8209 #define ALIGNOF_INT $pgac_cv_alignof_int
8210 EOF
8211
8212
8213 echo $ac_n "checking alignment of long""... $ac_c" 1>&6
8214 echo "configure:8215: checking alignment of long" >&5
8215 if eval "test \"`echo '$''{'pgac_cv_alignof_long'+set}'`\" = set"; then
8216   echo $ac_n "(cached) $ac_c" 1>&6
8217 else
8218   if test "$cross_compiling" = yes; then
8219   pgac_cv_alignof_long='sizeof(long)'
8220 else
8221   cat > conftest.$ac_ext <<EOF
8222 #line 8223 "configure"
8223 #include "confdefs.h"
8224 #include <stdio.h>
8225 struct { char filler; long field; } mystruct;
8226 main()
8227 {
8228   FILE *f=fopen("conftestval", "w");
8229   if (!f) exit(1);
8230   fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
8231   exit(0);
8232 }
8233 EOF
8234 if { (eval echo configure:8235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8235 then
8236   pgac_cv_alignof_long=`cat conftestval`
8237 else
8238   echo "configure: failed program was:" >&5
8239   cat conftest.$ac_ext >&5
8240   rm -fr conftest*
8241   pgac_cv_alignof_long='sizeof(long)'
8242 fi
8243 rm -fr conftest*
8244 fi
8245
8246 fi
8247 echo "$ac_t""$pgac_cv_alignof_long" 1>&6
8248 cat >> confdefs.h <<EOF
8249 #define ALIGNOF_LONG $pgac_cv_alignof_long
8250 EOF
8251
8252
8253 if [ x"$HAVE_LONG_LONG_INT_64" = xyes ] ; then
8254   echo $ac_n "checking alignment of long long int""... $ac_c" 1>&6
8255 echo "configure:8256: checking alignment of long long int" >&5
8256 if eval "test \"`echo '$''{'pgac_cv_alignof_long_long_int'+set}'`\" = set"; then
8257   echo $ac_n "(cached) $ac_c" 1>&6
8258 else
8259   if test "$cross_compiling" = yes; then
8260   pgac_cv_alignof_long_long_int='sizeof(long long int)'
8261 else
8262   cat > conftest.$ac_ext <<EOF
8263 #line 8264 "configure"
8264 #include "confdefs.h"
8265 #include <stdio.h>
8266 struct { char filler; long long int field; } mystruct;
8267 main()
8268 {
8269   FILE *f=fopen("conftestval", "w");
8270   if (!f) exit(1);
8271   fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
8272   exit(0);
8273 }
8274 EOF
8275 if { (eval echo configure:8276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8276 then
8277   pgac_cv_alignof_long_long_int=`cat conftestval`
8278 else
8279   echo "configure: failed program was:" >&5
8280   cat conftest.$ac_ext >&5
8281   rm -fr conftest*
8282   pgac_cv_alignof_long_long_int='sizeof(long long int)'
8283 fi
8284 rm -fr conftest*
8285 fi
8286
8287 fi
8288 echo "$ac_t""$pgac_cv_alignof_long_long_int" 1>&6
8289 cat >> confdefs.h <<EOF
8290 #define ALIGNOF_LONG_LONG_INT $pgac_cv_alignof_long_long_int
8291 EOF
8292
8293
8294 fi
8295 echo $ac_n "checking alignment of double""... $ac_c" 1>&6
8296 echo "configure:8297: checking alignment of double" >&5
8297 if eval "test \"`echo '$''{'pgac_cv_alignof_double'+set}'`\" = set"; then
8298   echo $ac_n "(cached) $ac_c" 1>&6
8299 else
8300   if test "$cross_compiling" = yes; then
8301   pgac_cv_alignof_double='sizeof(double)'
8302 else
8303   cat > conftest.$ac_ext <<EOF
8304 #line 8305 "configure"
8305 #include "confdefs.h"
8306 #include <stdio.h>
8307 struct { char filler; double field; } mystruct;
8308 main()
8309 {
8310   FILE *f=fopen("conftestval", "w");
8311   if (!f) exit(1);
8312   fprintf(f, "%d\n", ((char*) & mystruct.field) - ((char*) & mystruct));
8313   exit(0);
8314 }
8315 EOF
8316 if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8317 then
8318   pgac_cv_alignof_double=`cat conftestval`
8319 else
8320   echo "configure: failed program was:" >&5
8321   cat conftest.$ac_ext >&5
8322   rm -fr conftest*
8323   pgac_cv_alignof_double='sizeof(double)'
8324 fi
8325 rm -fr conftest*
8326 fi
8327
8328 fi
8329 echo "$ac_t""$pgac_cv_alignof_double" 1>&6
8330 cat >> confdefs.h <<EOF
8331 #define ALIGNOF_DOUBLE $pgac_cv_alignof_double
8332 EOF
8333
8334
8335
8336
8337 if test $pgac_cv_alignof_double != 'sizeof(double)' ; then
8338   MAX_ALIGNOF=$pgac_cv_alignof_long
8339   if test $MAX_ALIGNOF -lt $pgac_cv_alignof_double ; then
8340     MAX_ALIGNOF=$pgac_cv_alignof_double
8341   fi
8342   if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $pgac_cv_alignof_long_long_int ; then
8343     MAX_ALIGNOF="$pgac_cv_alignof_long_long_int"
8344   fi
8345 else
8346     MAX_ALIGNOF="$pgac_cv_alignof_double"
8347 fi
8348 cat >> confdefs.h <<EOF
8349 #define MAXIMUM_ALIGNOF $MAX_ALIGNOF
8350 EOF
8351
8352
8353 echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
8354 echo "configure:8355: checking for POSIX signal interface" >&5
8355 if eval "test \"`echo '$''{'pgac_cv_func_posix_signals'+set}'`\" = set"; then
8356   echo $ac_n "(cached) $ac_c" 1>&6
8357 else
8358   cat > conftest.$ac_ext <<EOF
8359 #line 8360 "configure"
8360 #include "confdefs.h"
8361 #include <signal.h>
8362
8363 int main() {
8364 struct sigaction act, oact;
8365 sigemptyset(&act.sa_mask);
8366 act.sa_flags = SA_RESTART;
8367 sigaction(0, &act, &oact);
8368 ; return 0; }
8369 EOF
8370 if { (eval echo configure:8371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8371   rm -rf conftest*
8372   pgac_cv_func_posix_signals=yes
8373 else
8374   echo "configure: failed program was:" >&5
8375   cat conftest.$ac_ext >&5
8376   rm -rf conftest*
8377   pgac_cv_func_posix_signals=no
8378 fi
8379 rm -f conftest*
8380 fi
8381
8382 echo "$ac_t""$pgac_cv_func_posix_signals" 1>&6
8383 if test x"$pgac_cv_func_posix_signals" = xyes ; then
8384   cat >> confdefs.h <<\EOF
8385 #define HAVE_POSIX_SIGNALS 
8386 EOF
8387
8388 fi
8389 HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
8390
8391
8392
8393 # Check for Tcl configuration script tclConfig.sh
8394 if test "$with_tcl" = yes; then
8395     for ac_prog in tclsh tcl
8396 do
8397 # Extract the first word of "$ac_prog", so it can be a program name with args.
8398 set dummy $ac_prog; ac_word=$2
8399 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8400 echo "configure:8401: checking for $ac_word" >&5
8401 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
8402   echo $ac_n "(cached) $ac_c" 1>&6
8403 else
8404   case "$TCLSH" in
8405   /*)
8406   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
8407   ;;
8408   ?:/*)                  
8409   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a dos path.
8410   ;;
8411   *)
8412   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8413   ac_dummy="$PATH"
8414   for ac_dir in $ac_dummy; do 
8415     test -z "$ac_dir" && ac_dir=.
8416     if test -f $ac_dir/$ac_word; then
8417       ac_cv_path_TCLSH="$ac_dir/$ac_word"
8418       break
8419     fi
8420   done
8421   IFS="$ac_save_ifs"
8422   ;;
8423 esac
8424 fi
8425 TCLSH="$ac_cv_path_TCLSH"
8426 if test -n "$TCLSH"; then
8427   echo "$ac_t""$TCLSH" 1>&6
8428 else
8429   echo "$ac_t""no" 1>&6
8430 fi
8431
8432 test -n "$TCLSH" && break
8433 done
8434
8435 echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
8436 echo "configure:8437: checking for tclConfig.sh" >&5
8437 # Let user override test
8438 if test -z "$TCL_CONFIG_SH"; then
8439     pgac_test_dirs="$with_tclconfig"
8440
8441     set X $pgac_test_dirs; shift
8442     if test $# -eq 0; then
8443         test -z "$TCLSH" && { echo "configure: error: unable to locate tclConfig.sh because no Tcl shell was found" 1>&2; exit 1; }
8444         set X `echo 'puts $auto_path' | $TCLSH`; shift
8445     fi
8446
8447     for pgac_dir do
8448         if test -r "$pgac_dir/tclConfig.sh"; then
8449             TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
8450             break
8451         fi
8452     done
8453 fi
8454
8455 if test -z "$TCL_CONFIG_SH"; then
8456     echo "$ac_t""no" 1>&6
8457     { echo "configure: error: file \`tclConfig.sh' is required for Tcl" 1>&2; exit 1; }
8458 else
8459     echo "$ac_t""$TCL_CONFIG_SH" 1>&6
8460 fi
8461
8462
8463
8464 fi
8465
8466 # Check for Tk configuration script tkConfig.sh
8467 if test "$with_tk" = yes; then
8468     echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
8469 echo "configure:8470: checking for tkConfig.sh" >&5
8470 # Let user override test
8471 if test -z "$TK_CONFIG_SH"; then
8472     pgac_test_dirs="$with_tkconfig $with_tclconfig"
8473
8474     set X $pgac_test_dirs; shift
8475     if test $# -eq 0; then
8476         test -z "$TCLSH" && { echo "configure: error: unable to locate tkConfig.sh because no Tcl shell was found" 1>&2; exit 1; }
8477         set X `echo 'puts $auto_path' | $TCLSH`; shift
8478     fi
8479
8480     for pgac_dir do
8481         if test -r "$pgac_dir/tkConfig.sh"; then
8482             TK_CONFIG_SH=$pgac_dir/tkConfig.sh
8483             break
8484         fi
8485     done
8486 fi
8487
8488 if test -z "$TK_CONFIG_SH"; then
8489     echo "$ac_t""no" 1>&6
8490     { echo "configure: error: file \`tkConfig.sh' is required for Tk" 1>&2; exit 1; }
8491 else
8492     echo "$ac_t""$TK_CONFIG_SH" 1>&6
8493 fi
8494
8495
8496
8497 fi
8498
8499
8500 #
8501 # Check for DocBook and tools
8502 #
8503 for ac_prog in onsgmls nsgmls
8504 do
8505 # Extract the first word of "$ac_prog", so it can be a program name with args.
8506 set dummy $ac_prog; ac_word=$2
8507 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8508 echo "configure:8509: checking for $ac_word" >&5
8509 if eval "test \"`echo '$''{'ac_cv_prog_NSGMLS'+set}'`\" = set"; then
8510   echo $ac_n "(cached) $ac_c" 1>&6
8511 else
8512   if test -n "$NSGMLS"; then
8513   ac_cv_prog_NSGMLS="$NSGMLS" # Let the user override the test.
8514 else
8515   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8516   ac_dummy="$PATH"
8517   for ac_dir in $ac_dummy; do
8518     test -z "$ac_dir" && ac_dir=.
8519     if test -f $ac_dir/$ac_word; then
8520       ac_cv_prog_NSGMLS="$ac_prog"
8521       break
8522     fi
8523   done
8524   IFS="$ac_save_ifs"
8525 fi
8526 fi
8527 NSGMLS="$ac_cv_prog_NSGMLS"
8528 if test -n "$NSGMLS"; then
8529   echo "$ac_t""$NSGMLS" 1>&6
8530 else
8531   echo "$ac_t""no" 1>&6
8532 fi
8533
8534 test -n "$NSGMLS" && break
8535 done
8536
8537 # If you don't have nsgmls you won't get very far, so save the cycles.
8538 if test -n "$NSGMLS"; then
8539   for ac_prog in openjade jade
8540 do
8541 # Extract the first word of "$ac_prog", so it can be a program name with args.
8542 set dummy $ac_prog; ac_word=$2
8543 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8544 echo "configure:8545: checking for $ac_word" >&5
8545 if eval "test \"`echo '$''{'ac_cv_prog_JADE'+set}'`\" = set"; then
8546   echo $ac_n "(cached) $ac_c" 1>&6
8547 else
8548   if test -n "$JADE"; then
8549   ac_cv_prog_JADE="$JADE" # Let the user override the test.
8550 else
8551   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8552   ac_dummy="$PATH"
8553   for ac_dir in $ac_dummy; do
8554     test -z "$ac_dir" && ac_dir=.
8555     if test -f $ac_dir/$ac_word; then
8556       ac_cv_prog_JADE="$ac_prog"
8557       break
8558     fi
8559   done
8560   IFS="$ac_save_ifs"
8561 fi
8562 fi
8563 JADE="$ac_cv_prog_JADE"
8564 if test -n "$JADE"; then
8565   echo "$ac_t""$JADE" 1>&6
8566 else
8567   echo "$ac_t""no" 1>&6
8568 fi
8569
8570 test -n "$JADE" && break
8571 done
8572
8573   
8574 echo $ac_n "checking for DocBook V3.1""... $ac_c" 1>&6
8575 echo "configure:8576: checking for DocBook V3.1" >&5
8576 if eval "test \"`echo '$''{'pgac_cv_check_docbook'+set}'`\" = set"; then
8577   echo $ac_n "(cached) $ac_c" 1>&6
8578 else
8579   cat >conftest.sgml <<EOF
8580 <!doctype book PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
8581 <book>
8582  <title>test</title>
8583  <chapter>
8584   <title>random</title>
8585    <sect1>
8586     <title>testsect</title>
8587     <para>text</para>
8588   </sect1>
8589  </chapter>
8590 </book>
8591 EOF
8592
8593 ${NSGMLS-false} -s conftest.sgml 1>&5 2>&1
8594 if test $? -eq 0; then
8595   pgac_cv_check_docbook=yes
8596 else
8597   pgac_cv_check_docbook=no
8598 fi
8599 rm -f conftest.sgml
8600 fi
8601
8602 echo "$ac_t""$pgac_cv_check_docbook" 1>&6
8603
8604 have_docbook=$pgac_cv_check_docbook
8605
8606
8607   echo $ac_n "checking for DocBook stylesheets""... $ac_c" 1>&6
8608 echo "configure:8609: checking for DocBook stylesheets" >&5
8609 if eval "test \"`echo '$''{'pgac_cv_path_stylesheets'+set}'`\" = set"; then
8610   echo $ac_n "(cached) $ac_c" 1>&6
8611 else
8612   if test -n "$DOCBOOKSTYLE"; then
8613   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
8614 else
8615   for pgac_prefix in /usr /usr/local /opt; do
8616     for pgac_infix in share lib; do
8617       for pgac_postfix in \
8618         sgml/stylesheets/nwalsh-modular \
8619         sgml/stylesheets/docbook \
8620         sgml/docbook/dsssl/modular
8621       do
8622         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
8623         if test -r "$pgac_candidate/html/docbook.dsl" \
8624            && test -r "$pgac_candidate/print/docbook.dsl"
8625         then
8626           pgac_cv_path_stylesheets=$pgac_candidate
8627           break 3
8628         fi
8629       done
8630     done
8631   done
8632 fi
8633 fi
8634
8635 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
8636
8637 if test -n "$DOCBOOKSTYLE"; then
8638   echo "$ac_t""$DOCBOOKSTYLE" 1>&6
8639 else
8640   echo "$ac_t""no" 1>&6
8641 fi
8642   for ac_prog in sgmlspl
8643 do
8644 # Extract the first word of "$ac_prog", so it can be a program name with args.
8645 set dummy $ac_prog; ac_word=$2
8646 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8647 echo "configure:8648: checking for $ac_word" >&5
8648 if eval "test \"`echo '$''{'ac_cv_prog_SGMLSPL'+set}'`\" = set"; then
8649   echo $ac_n "(cached) $ac_c" 1>&6
8650 else
8651   if test -n "$SGMLSPL"; then
8652   ac_cv_prog_SGMLSPL="$SGMLSPL" # Let the user override the test.
8653 else
8654   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8655   ac_dummy="$PATH"
8656   for ac_dir in $ac_dummy; do
8657     test -z "$ac_dir" && ac_dir=.
8658     if test -f $ac_dir/$ac_word; then
8659       ac_cv_prog_SGMLSPL="$ac_prog"
8660       break
8661     fi
8662   done
8663   IFS="$ac_save_ifs"
8664 fi
8665 fi
8666 SGMLSPL="$ac_cv_prog_SGMLSPL"
8667 if test -n "$SGMLSPL"; then
8668   echo "$ac_t""$SGMLSPL" 1>&6
8669 else
8670   echo "$ac_t""no" 1>&6
8671 fi
8672
8673 test -n "$SGMLSPL" && break
8674 done
8675
8676 fi
8677
8678 abs_top_srcdir=
8679
8680
8681 # prepare build tree if outside source tree
8682 # Note 1: test -ef might not exist, but it's more reliable than `pwd`.
8683 # Note 2: /bin/pwd might be better than shell's built-in at getting
8684 #         a symlink-free name.
8685 if ( test "$srcdir" -ef . ) >/dev/null 2>&1 || test "`cd $srcdir && /bin/pwd`" = "`/bin/pwd`"; then
8686     :
8687 else
8688     abs_top_srcdir=`cd $srcdir && pwd`
8689     echo $ac_n "preparing build tree... $ac_c" 1>&6
8690     /bin/sh "$srcdir/config/prep_buildtree" "$abs_top_srcdir" "." \
8691       || { echo "configure: error: failed" 1>&2; exit 1; }
8692     echo "$ac_t""done" 1>&6
8693 fi
8694
8695 trap '' 1 2 15
8696 cat > confcache <<\EOF
8697 # This file is a shell script that caches the results of configure
8698 # tests run on this system so they can be shared between configure
8699 # scripts and configure runs.  It is not useful on other systems.
8700 # If it contains results you don't want to keep, you may remove or edit it.
8701 #
8702 # By default, configure uses ./config.cache as the cache file,
8703 # creating it if it does not exist already.  You can give configure
8704 # the --cache-file=FILE option to use a different cache file; that is
8705 # what configure does when it calls configure scripts in
8706 # subdirectories, so they share the cache.
8707 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8708 # config.status only pays attention to the cache file if you give it the
8709 # --recheck option to rerun configure.
8710 #
8711 EOF
8712 # The following way of writing the cache mishandles newlines in values,
8713 # but we know of no workaround that is simple, portable, and efficient.
8714 # So, don't put newlines in cache variables' values.
8715 # Ultrix sh set writes to stderr and can't be redirected directly,
8716 # and sets the high bit in the cache file unless we assign to the vars.
8717 (set) 2>&1 |
8718   case `(ac_space=' '; set | grep ac_space) 2>&1` in
8719   *ac_space=\ *)
8720     # `set' does not quote correctly, so add quotes (double-quote substitution
8721     # turns \\\\ into \\, and sed turns \\ into \).
8722     sed -n \
8723       -e "s/'/'\\\\''/g" \
8724       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8725     ;;
8726   *)
8727     # `set' quotes correctly as required by POSIX, so do not add quotes.
8728     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8729     ;;
8730   esac >> confcache
8731 if cmp -s $cache_file confcache; then
8732   :
8733 else
8734   if test -w $cache_file; then
8735     echo "updating cache $cache_file"
8736     cat confcache > $cache_file
8737   else
8738     echo "not updating unwritable cache $cache_file"
8739   fi
8740 fi
8741 rm -f confcache
8742
8743 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8744
8745 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8746 # Let make expand exec_prefix.
8747 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8748
8749 # Any assignment to VPATH causes Sun make to only execute
8750 # the first set of double-colon rules, so remove it if not needed.
8751 # If there is a colon in the path, we need to keep it.
8752 if test "x$srcdir" = x.; then
8753   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8754 fi
8755
8756 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8757
8758 DEFS=-DHAVE_CONFIG_H
8759
8760 # Without the "./", some shells look in PATH for config.status.
8761 : ${CONFIG_STATUS=./config.status}
8762
8763 echo creating $CONFIG_STATUS
8764 rm -f $CONFIG_STATUS
8765 cat > $CONFIG_STATUS <<EOF
8766 #! /bin/sh
8767 # Generated automatically by configure.
8768 # Run this file to recreate the current configuration.
8769 # This directory was configured as follows,
8770 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8771 #
8772 # $0 $ac_configure_args
8773 #
8774 # Compiler output produced by configure, useful for debugging
8775 # configure, is in ./config.log if it exists.
8776
8777 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8778 for ac_option
8779 do
8780   case "\$ac_option" in
8781   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8782     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8783     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8784   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8785     echo "$CONFIG_STATUS generated by autoconf version 2.13"
8786     exit 0 ;;
8787   -help | --help | --hel | --he | --h)
8788     echo "\$ac_cs_usage"; exit 0 ;;
8789   *) echo "\$ac_cs_usage"; exit 1 ;;
8790   esac
8791 done
8792
8793 ac_given_srcdir=$srcdir
8794
8795 trap 'rm -fr `echo "
8796   GNUmakefile
8797   src/GNUmakefile
8798   src/Makefile.global
8799   src/backend/port/Makefile
8800  src/include/pg_config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8801 EOF
8802 cat >> $CONFIG_STATUS <<EOF
8803
8804 # Protect against being on the right side of a sed subst in config.status.
8805 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8806  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8807 $ac_vpsub
8808 $extrasub
8809 s%@SHELL@%$SHELL%g
8810 s%@CFLAGS@%$CFLAGS%g
8811 s%@CPPFLAGS@%$CPPFLAGS%g
8812 s%@CXXFLAGS@%$CXXFLAGS%g
8813 s%@FFLAGS@%$FFLAGS%g
8814 s%@DEFS@%$DEFS%g
8815 s%@LDFLAGS@%$LDFLAGS%g
8816 s%@LIBS@%$LIBS%g
8817 s%@exec_prefix@%$exec_prefix%g
8818 s%@prefix@%$prefix%g
8819 s%@program_transform_name@%$program_transform_name%g
8820 s%@bindir@%$bindir%g
8821 s%@sbindir@%$sbindir%g
8822 s%@libexecdir@%$libexecdir%g
8823 s%@datadir@%$datadir%g
8824 s%@sysconfdir@%$sysconfdir%g
8825 s%@sharedstatedir@%$sharedstatedir%g
8826 s%@localstatedir@%$localstatedir%g
8827 s%@libdir@%$libdir%g
8828 s%@includedir@%$includedir%g
8829 s%@oldincludedir@%$oldincludedir%g
8830 s%@docdir@%$docdir%g
8831 s%@mandir@%$mandir%g
8832 s%@VERSION@%$VERSION%g
8833 s%@host@%$host%g
8834 s%@host_alias@%$host_alias%g
8835 s%@host_cpu@%$host_cpu%g
8836 s%@host_vendor@%$host_vendor%g
8837 s%@host_os@%$host_os%g
8838 s%@PORTNAME@%$PORTNAME%g
8839 s%@TAS@%$TAS%g
8840 s%@MULTIBYTE@%$MULTIBYTE%g
8841 s%@enable_nls@%$enable_nls%g
8842 s%@WANTED_LANGUAGES@%$WANTED_LANGUAGES%g
8843 s%@default_port@%$default_port%g
8844 s%@enable_shared@%$enable_shared%g
8845 s%@enable_rpath@%$enable_rpath%g
8846 s%@CC@%$CC%g
8847 s%@EXEEXT@%$EXEEXT%g
8848 s%@CPP@%$CPP%g
8849 s%@GCC@%$GCC%g
8850 s%@autodepend@%$autodepend%g
8851 s%@INCLUDES@%$INCLUDES%g
8852 s%@with_tcl@%$with_tcl%g
8853 s%@with_tk@%$with_tk%g
8854 s%@enable_pltcl_unknown@%$enable_pltcl_unknown%g
8855 s%@enable_pltcl_utf@%$enable_pltcl_utf%g
8856 s%@with_perl@%$with_perl%g
8857 s%@with_python@%$with_python%g
8858 s%@ANT@%$ANT%g
8859 s%@with_java@%$with_java%g
8860 s%@with_krb4@%$with_krb4%g
8861 s%@with_krb5@%$with_krb5%g
8862 s%@krb_srvtab@%$krb_srvtab%g
8863 s%@with_pam@%$with_pam%g
8864 s%@with_openssl@%$with_openssl%g
8865 s%@enable_odbc@%$enable_odbc%g
8866 s%@with_unixodbc@%$with_unixodbc%g
8867 s%@with_iodbc@%$with_iodbc%g
8868 s%@odbcinst_ini_dir@%$odbcinst_ini_dir%g
8869 s%@ELF_SYS@%$ELF_SYS%g
8870 s%@CXX@%$CXX%g
8871 s%@CXXCPP@%$CXXCPP%g
8872 s%@GXX@%$GXX%g
8873 s%@with_CXX@%$with_CXX%g
8874 s%@AWK@%$AWK%g
8875 s%@FLEX@%$FLEX%g
8876 s%@FLEXFLAGS@%$FLEXFLAGS%g
8877 s%@LN_S@%$LN_S%g
8878 s%@LD@%$LD%g
8879 s%@with_gnu_ld@%$with_gnu_ld%g
8880 s%@ld_R_works@%$ld_R_works%g
8881 s%@RANLIB@%$RANLIB%g
8882 s%@LORDER@%$LORDER%g
8883 s%@TAR@%$TAR%g
8884 s%@YACC@%$YACC%g
8885 s%@YFLAGS@%$YFLAGS%g
8886 s%@WISH@%$WISH%g
8887 s%@PERL@%$PERL%g
8888 s%@perl_installsitearch@%$perl_installsitearch%g
8889 s%@perl_installsitelib@%$perl_installsitelib%g
8890 s%@perl_installman3dir@%$perl_installman3dir%g
8891 s%@PYTHON@%$PYTHON%g
8892 s%@python_version@%$python_version%g
8893 s%@python_prefix@%$python_prefix%g
8894 s%@python_execprefix@%$python_execprefix%g
8895 s%@python_configdir@%$python_configdir%g
8896 s%@python_moduledir@%$python_moduledir%g
8897 s%@python_moduleexecdir@%$python_moduleexecdir%g
8898 s%@python_includespec@%$python_includespec%g
8899 s%@python_libspec@%$python_libspec%g
8900 s%@MSGFMT@%$MSGFMT%g
8901 s%@MSGMERGE@%$MSGMERGE%g
8902 s%@XGETTEXT@%$XGETTEXT%g
8903 s%@localedir@%$localedir%g
8904 s%@SNPRINTF@%$SNPRINTF%g
8905 s%@ISINF@%$ISINF%g
8906 s%@GETRUSAGE@%$GETRUSAGE%g
8907 s%@SRANDOM@%$SRANDOM%g
8908 s%@GETHOSTNAME@%$GETHOSTNAME%g
8909 s%@MISSING_RANDOM@%$MISSING_RANDOM%g
8910 s%@INET_ATON@%$INET_ATON%g
8911 s%@STRERROR@%$STRERROR%g
8912 s%@STRDUP@%$STRDUP%g
8913 s%@STRTOL@%$STRTOL%g
8914 s%@STRTOUL@%$STRTOUL%g
8915 s%@STRCASECMP@%$STRCASECMP%g
8916 s%@HPUXMATHLIB@%$HPUXMATHLIB%g
8917 s%@HAVE_POSIX_SIGNALS@%$HAVE_POSIX_SIGNALS%g
8918 s%@TCLSH@%$TCLSH%g
8919 s%@TCL_CONFIG_SH@%$TCL_CONFIG_SH%g
8920 s%@TK_CONFIG_SH@%$TK_CONFIG_SH%g
8921 s%@NSGMLS@%$NSGMLS%g
8922 s%@JADE@%$JADE%g
8923 s%@have_docbook@%$have_docbook%g
8924 s%@DOCBOOKSTYLE@%$DOCBOOKSTYLE%g
8925 s%@SGMLSPL@%$SGMLSPL%g
8926 s%@abs_top_srcdir@%$abs_top_srcdir%g
8927
8928 CEOF
8929 EOF
8930
8931 cat >> $CONFIG_STATUS <<\EOF
8932
8933 # Split the substitutions into bite-sized pieces for seds with
8934 # small command number limits, like on Digital OSF/1 and HP-UX.
8935 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8936 ac_file=1 # Number of current file.
8937 ac_beg=1 # First line for current file.
8938 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8939 ac_more_lines=:
8940 ac_sed_cmds=""
8941 while $ac_more_lines; do
8942   if test $ac_beg -gt 1; then
8943     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8944   else
8945     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8946   fi
8947   if test ! -s conftest.s$ac_file; then
8948     ac_more_lines=false
8949     rm -f conftest.s$ac_file
8950   else
8951     if test -z "$ac_sed_cmds"; then
8952       ac_sed_cmds="sed -f conftest.s$ac_file"
8953     else
8954       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8955     fi
8956     ac_file=`expr $ac_file + 1`
8957     ac_beg=$ac_end
8958     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8959   fi
8960 done
8961 if test -z "$ac_sed_cmds"; then
8962   ac_sed_cmds=cat
8963 fi
8964 EOF
8965
8966 cat >> $CONFIG_STATUS <<EOF
8967
8968 CONFIG_FILES=\${CONFIG_FILES-"GNUmakefile
8969   src/GNUmakefile
8970   src/Makefile.global
8971   src/backend/port/Makefile
8972 "}
8973 EOF
8974 cat >> $CONFIG_STATUS <<\EOF
8975 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8976   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8977   case "$ac_file" in
8978   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8979        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8980   *) ac_file_in="${ac_file}.in" ;;
8981   esac
8982
8983   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8984
8985   # Remove last slash and all that follows it.  Not all systems have dirname.
8986   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8987   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8988     # The file is in a subdirectory.
8989     test ! -d "$ac_dir" && mkdir "$ac_dir"
8990     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8991     # A "../" for each directory in $ac_dir_suffix.
8992     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8993   else
8994     ac_dir_suffix= ac_dots=
8995   fi
8996
8997   case "$ac_given_srcdir" in
8998   .)  srcdir=.
8999       if test -z "$ac_dots"; then top_srcdir=.
9000       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9001   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9002   *) # Relative path.
9003     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9004     top_srcdir="$ac_dots$ac_given_srcdir" ;;
9005   esac
9006
9007
9008   echo creating "$ac_file"
9009   rm -f "$ac_file"
9010   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9011   case "$ac_file" in
9012   *Makefile*) ac_comsub="1i\\
9013 # $configure_input" ;;
9014   *) ac_comsub= ;;
9015   esac
9016
9017   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9018   sed -e "$ac_comsub
9019 s%@configure_input@%$configure_input%g
9020 s%@srcdir@%$srcdir%g
9021 s%@top_srcdir@%$top_srcdir%g
9022 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9023 fi; done
9024 rm -f conftest.s*
9025
9026 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9027 # NAME is the cpp macro being defined and VALUE is the value it is being given.
9028 #
9029 # ac_d sets the value in "#define NAME VALUE" lines.
9030 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
9031 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
9032 ac_dC='\3'
9033 ac_dD='%g'
9034 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9035 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9036 ac_uB='\([      ]\)%\1#\2define\3'
9037 ac_uC=' '
9038 ac_uD='\4%g'
9039 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9040 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9041 ac_eB='$%\1#\2define\3'
9042 ac_eC=' '
9043 ac_eD='%g'
9044
9045 if test "${CONFIG_HEADERS+set}" != set; then
9046 EOF
9047 cat >> $CONFIG_STATUS <<EOF
9048   CONFIG_HEADERS="src/include/pg_config.h"
9049 EOF
9050 cat >> $CONFIG_STATUS <<\EOF
9051 fi
9052 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
9053   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9054   case "$ac_file" in
9055   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9056        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9057   *) ac_file_in="${ac_file}.in" ;;
9058   esac
9059
9060   echo creating $ac_file
9061
9062   rm -f conftest.frag conftest.in conftest.out
9063   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9064   cat $ac_file_inputs > conftest.in
9065
9066 EOF
9067
9068 # Transform confdefs.h into a sed script conftest.vals that substitutes
9069 # the proper values into config.h.in to produce config.h.  And first:
9070 # Protect against being on the right side of a sed subst in config.status.
9071 # Protect against being in an unquoted here document in config.status.
9072 rm -f conftest.vals
9073 cat > conftest.hdr <<\EOF
9074 s/[\\&%]/\\&/g
9075 s%[\\$`]%\\&%g
9076 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9077 s%ac_d%ac_u%gp
9078 s%ac_u%ac_e%gp
9079 EOF
9080 sed -n -f conftest.hdr confdefs.h > conftest.vals
9081 rm -f conftest.hdr
9082
9083 # This sed command replaces #undef with comments.  This is necessary, for
9084 # example, in the case of _POSIX_SOURCE, which is predefined and required
9085 # on some systems where configure will not decide to define it.
9086 cat >> conftest.vals <<\EOF
9087 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9088 EOF
9089
9090 # Break up conftest.vals because some shells have a limit on
9091 # the size of here documents, and old seds have small limits too.
9092
9093 rm -f conftest.tail
9094 while :
9095 do
9096   ac_lines=`grep -c . conftest.vals`
9097   # grep -c gives empty output for an empty file on some AIX systems.
9098   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9099   # Write a limited-size here document to conftest.frag.
9100   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9101   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9102   echo 'CEOF
9103   sed -f conftest.frag conftest.in > conftest.out
9104   rm -f conftest.in
9105   mv conftest.out conftest.in
9106 ' >> $CONFIG_STATUS
9107   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9108   rm -f conftest.vals
9109   mv conftest.tail conftest.vals
9110 done
9111 rm -f conftest.vals
9112
9113 cat >> $CONFIG_STATUS <<\EOF
9114   rm -f conftest.frag conftest.h
9115   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
9116   cat conftest.in >> conftest.h
9117   rm -f conftest.in
9118   if cmp -s $ac_file conftest.h 2>/dev/null; then
9119     echo "$ac_file is unchanged"
9120     rm -f conftest.h
9121   else
9122     # Remove last slash and all that follows it.  Not all systems have dirname.
9123       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9124       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9125       # The file is in a subdirectory.
9126       test ! -d "$ac_dir" && mkdir "$ac_dir"
9127     fi
9128     rm -f $ac_file
9129     mv conftest.h $ac_file
9130   fi
9131 fi; done
9132
9133 EOF
9134
9135 cat >> $CONFIG_STATUS <<EOF
9136 ac_sources="src/backend/port/dynloader/${template}.c src/backend/port/dynloader/${template}.h src/include/port/${template}.h src/makefiles/Makefile.${template} src/backend/port/tas/${tas_file}"
9137 ac_dests="src/backend/port/dynloader.c src/include/dynloader.h src/include/pg_config_os.h src/Makefile.port src/backend/port/tas.s"
9138 EOF
9139
9140 cat >> $CONFIG_STATUS <<\EOF
9141 srcdir=$ac_given_srcdir
9142 while test -n "$ac_sources"; do
9143   set $ac_dests; ac_dest=$1; shift; ac_dests=$*
9144   set $ac_sources; ac_source=$1; shift; ac_sources=$*
9145
9146   echo "linking $srcdir/$ac_source to $ac_dest"
9147
9148   if test ! -r $srcdir/$ac_source; then
9149     { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
9150   fi
9151   rm -f $ac_dest
9152
9153   # Make relative symlinks.
9154   # Remove last slash and all that follows it.  Not all systems have dirname.
9155   ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
9156   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
9157     # The dest file is in a subdirectory.
9158     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
9159     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
9160     # A "../" for each directory in $ac_dest_dir_suffix.
9161     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
9162   else
9163     ac_dest_dir_suffix= ac_dots=
9164   fi
9165
9166   case "$srcdir" in
9167   [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
9168   *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
9169   esac
9170
9171   # Make a symlink if possible; otherwise try a hard link.
9172   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
9173     ln $srcdir/$ac_source $ac_dest; then :
9174   else
9175     { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
9176   fi
9177 done
9178 EOF
9179 cat >> $CONFIG_STATUS <<EOF
9180
9181 EOF
9182 cat >> $CONFIG_STATUS <<\EOF
9183
9184 # Update timestamp for pg_config.h (see Makefile.global)
9185 test x"$CONFIG_HEADERS" != x"" && echo >src/include/stamp-h
9186
9187 exit 0
9188 EOF
9189 chmod +x $CONFIG_STATUS
9190 rm -fr confdefs* $ac_clean_files
9191 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9192