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