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