OSDN Git Service

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