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