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