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