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