OSDN Git Service

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