import from HEAD:
[freeradius.git] / src / modules / rlm_sql / drivers / rlm_sql_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_help="$ac_help
15   --with-rlm-sql-postgresql-lib-dir=DIR       Directory for PostgreSQL library files []"
16 ac_help="$ac_help
17   --with-rlm-sql-postgresql-include-dir=DIR   Directory for PostgreSQL include files []"
18
19 # Initialize some variables set by options.
20 # The variables have the same names as the options, with
21 # dashes changed to underlines.
22 build=NONE
23 cache_file=./config.cache
24 exec_prefix=NONE
25 host=NONE
26 no_create=
27 nonopt=NONE
28 no_recursion=
29 prefix=NONE
30 program_prefix=NONE
31 program_suffix=NONE
32 program_transform_name=s,x,x,
33 silent=
34 site=
35 srcdir=
36 target=NONE
37 verbose=
38 x_includes=NONE
39 x_libraries=NONE
40 bindir='${exec_prefix}/bin'
41 sbindir='${exec_prefix}/sbin'
42 libexecdir='${exec_prefix}/libexec'
43 datadir='${prefix}/share'
44 sysconfdir='${prefix}/etc'
45 sharedstatedir='${prefix}/com'
46 localstatedir='${prefix}/var'
47 libdir='${exec_prefix}/lib'
48 includedir='${prefix}/include'
49 oldincludedir='/usr/include'
50 infodir='${prefix}/info'
51 mandir='${prefix}/man'
52
53 # Initialize some other variables.
54 subdirs=
55 MFLAGS= MAKEFLAGS=
56 SHELL=${CONFIG_SHELL-/bin/sh}
57 # Maximum number of lines to put in a shell here document.
58 ac_max_here_lines=12
59
60 ac_prev=
61 for ac_option
62 do
63
64   # If the previous option needs an argument, assign it.
65   if test -n "$ac_prev"; then
66     eval "$ac_prev=\$ac_option"
67     ac_prev=
68     continue
69   fi
70
71   case "$ac_option" in
72   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
73   *) ac_optarg= ;;
74   esac
75
76   # Accept the important Cygnus configure options, so we can diagnose typos.
77
78   case "$ac_option" in
79
80   -bindir | --bindir | --bindi | --bind | --bin | --bi)
81     ac_prev=bindir ;;
82   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
83     bindir="$ac_optarg" ;;
84
85   -build | --build | --buil | --bui | --bu)
86     ac_prev=build ;;
87   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
88     build="$ac_optarg" ;;
89
90   -cache-file | --cache-file | --cache-fil | --cache-fi \
91   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
92     ac_prev=cache_file ;;
93   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
94   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
95     cache_file="$ac_optarg" ;;
96
97   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
98     ac_prev=datadir ;;
99   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
100   | --da=*)
101     datadir="$ac_optarg" ;;
102
103   -disable-* | --disable-*)
104     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
105     # Reject names that are not valid shell variable names.
106     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
107       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
108     fi
109     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
110     eval "enable_${ac_feature}=no" ;;
111
112   -enable-* | --enable-*)
113     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
114     # Reject names that are not valid shell variable names.
115     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
116       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
117     fi
118     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
119     case "$ac_option" in
120       *=*) ;;
121       *) ac_optarg=yes ;;
122     esac
123     eval "enable_${ac_feature}='$ac_optarg'" ;;
124
125   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
126   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
127   | --exec | --exe | --ex)
128     ac_prev=exec_prefix ;;
129   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
130   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
131   | --exec=* | --exe=* | --ex=*)
132     exec_prefix="$ac_optarg" ;;
133
134   -gas | --gas | --ga | --g)
135     # Obsolete; use --with-gas.
136     with_gas=yes ;;
137
138   -help | --help | --hel | --he)
139     # Omit some internal or obsolete options to make the list less imposing.
140     # This message is too long to be a string in the A/UX 3.1 sh.
141     cat << EOF
142 Usage: configure [options] [host]
143 Options: [defaults in brackets after descriptions]
144 Configuration:
145   --cache-file=FILE       cache test results in FILE
146   --help                  print this message
147   --no-create             do not create output files
148   --quiet, --silent       do not print \`checking...' messages
149   --version               print the version of autoconf that created configure
150 Directory and file names:
151   --prefix=PREFIX         install architecture-independent files in PREFIX
152                           [$ac_default_prefix]
153   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
154                           [same as prefix]
155   --bindir=DIR            user executables in DIR [EPREFIX/bin]
156   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
157   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
158   --datadir=DIR           read-only architecture-independent data in DIR
159                           [PREFIX/share]
160   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
161   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
162                           [PREFIX/com]
163   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
164   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
165   --includedir=DIR        C header files in DIR [PREFIX/include]
166   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
167   --infodir=DIR           info documentation in DIR [PREFIX/info]
168   --mandir=DIR            man documentation in DIR [PREFIX/man]
169   --srcdir=DIR            find the sources in DIR [configure dir or ..]
170   --program-prefix=PREFIX prepend PREFIX to installed program names
171   --program-suffix=SUFFIX append SUFFIX to installed program names
172   --program-transform-name=PROGRAM
173                           run sed PROGRAM on installed program names
174 EOF
175     cat << EOF
176 Host type:
177   --build=BUILD           configure for building on BUILD [BUILD=HOST]
178   --host=HOST             configure for HOST [guessed]
179   --target=TARGET         configure for TARGET [TARGET=HOST]
180 Features and packages:
181   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
182   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
183   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
184   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
185   --x-includes=DIR        X include files are in DIR
186   --x-libraries=DIR       X library files are in DIR
187 EOF
188     if test -n "$ac_help"; then
189       echo "--enable and --with options recognized:$ac_help"
190     fi
191     exit 0 ;;
192
193   -host | --host | --hos | --ho)
194     ac_prev=host ;;
195   -host=* | --host=* | --hos=* | --ho=*)
196     host="$ac_optarg" ;;
197
198   -includedir | --includedir | --includedi | --included | --include \
199   | --includ | --inclu | --incl | --inc)
200     ac_prev=includedir ;;
201   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
202   | --includ=* | --inclu=* | --incl=* | --inc=*)
203     includedir="$ac_optarg" ;;
204
205   -infodir | --infodir | --infodi | --infod | --info | --inf)
206     ac_prev=infodir ;;
207   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
208     infodir="$ac_optarg" ;;
209
210   -libdir | --libdir | --libdi | --libd)
211     ac_prev=libdir ;;
212   -libdir=* | --libdir=* | --libdi=* | --libd=*)
213     libdir="$ac_optarg" ;;
214
215   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
216   | --libexe | --libex | --libe)
217     ac_prev=libexecdir ;;
218   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
219   | --libexe=* | --libex=* | --libe=*)
220     libexecdir="$ac_optarg" ;;
221
222   -localstatedir | --localstatedir | --localstatedi | --localstated \
223   | --localstate | --localstat | --localsta | --localst \
224   | --locals | --local | --loca | --loc | --lo)
225     ac_prev=localstatedir ;;
226   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
227   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
228   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
229     localstatedir="$ac_optarg" ;;
230
231   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
232     ac_prev=mandir ;;
233   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
234     mandir="$ac_optarg" ;;
235
236   -nfp | --nfp | --nf)
237     # Obsolete; use --without-fp.
238     with_fp=no ;;
239
240   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
241   | --no-cr | --no-c)
242     no_create=yes ;;
243
244   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
245   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
246     no_recursion=yes ;;
247
248   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
249   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
250   | --oldin | --oldi | --old | --ol | --o)
251     ac_prev=oldincludedir ;;
252   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
253   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
254   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
255     oldincludedir="$ac_optarg" ;;
256
257   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
258     ac_prev=prefix ;;
259   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
260     prefix="$ac_optarg" ;;
261
262   -program-prefix | --program-prefix | --program-prefi | --program-pref \
263   | --program-pre | --program-pr | --program-p)
264     ac_prev=program_prefix ;;
265   -program-prefix=* | --program-prefix=* | --program-prefi=* \
266   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
267     program_prefix="$ac_optarg" ;;
268
269   -program-suffix | --program-suffix | --program-suffi | --program-suff \
270   | --program-suf | --program-su | --program-s)
271     ac_prev=program_suffix ;;
272   -program-suffix=* | --program-suffix=* | --program-suffi=* \
273   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
274     program_suffix="$ac_optarg" ;;
275
276   -program-transform-name | --program-transform-name \
277   | --program-transform-nam | --program-transform-na \
278   | --program-transform-n | --program-transform- \
279   | --program-transform | --program-transfor \
280   | --program-transfo | --program-transf \
281   | --program-trans | --program-tran \
282   | --progr-tra | --program-tr | --program-t)
283     ac_prev=program_transform_name ;;
284   -program-transform-name=* | --program-transform-name=* \
285   | --program-transform-nam=* | --program-transform-na=* \
286   | --program-transform-n=* | --program-transform-=* \
287   | --program-transform=* | --program-transfor=* \
288   | --program-transfo=* | --program-transf=* \
289   | --program-trans=* | --program-tran=* \
290   | --progr-tra=* | --program-tr=* | --program-t=*)
291     program_transform_name="$ac_optarg" ;;
292
293   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
294   | -silent | --silent | --silen | --sile | --sil)
295     silent=yes ;;
296
297   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
298     ac_prev=sbindir ;;
299   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
300   | --sbi=* | --sb=*)
301     sbindir="$ac_optarg" ;;
302
303   -sharedstatedir | --sharedstatedir | --sharedstatedi \
304   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
305   | --sharedst | --shareds | --shared | --share | --shar \
306   | --sha | --sh)
307     ac_prev=sharedstatedir ;;
308   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
309   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
310   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
311   | --sha=* | --sh=*)
312     sharedstatedir="$ac_optarg" ;;
313
314   -site | --site | --sit)
315     ac_prev=site ;;
316   -site=* | --site=* | --sit=*)
317     site="$ac_optarg" ;;
318
319   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
320     ac_prev=srcdir ;;
321   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
322     srcdir="$ac_optarg" ;;
323
324   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
325   | --syscon | --sysco | --sysc | --sys | --sy)
326     ac_prev=sysconfdir ;;
327   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
328   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
329     sysconfdir="$ac_optarg" ;;
330
331   -target | --target | --targe | --targ | --tar | --ta | --t)
332     ac_prev=target ;;
333   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
334     target="$ac_optarg" ;;
335
336   -v | -verbose | --verbose | --verbos | --verbo | --verb)
337     verbose=yes ;;
338
339   -version | --version | --versio | --versi | --vers)
340     echo "configure generated by autoconf version 2.13"
341     exit 0 ;;
342
343   -with-* | --with-*)
344     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
345     # Reject names that are not valid shell variable names.
346     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
347       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
348     fi
349     ac_package=`echo $ac_package| sed 's/-/_/g'`
350     case "$ac_option" in
351       *=*) ;;
352       *) ac_optarg=yes ;;
353     esac
354     eval "with_${ac_package}='$ac_optarg'" ;;
355
356   -without-* | --without-*)
357     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
358     # Reject names that are not valid shell variable names.
359     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
360       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
361     fi
362     ac_package=`echo $ac_package| sed 's/-/_/g'`
363     eval "with_${ac_package}=no" ;;
364
365   --x)
366     # Obsolete; use --with-x.
367     with_x=yes ;;
368
369   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
370   | --x-incl | --x-inc | --x-in | --x-i)
371     ac_prev=x_includes ;;
372   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
373   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
374     x_includes="$ac_optarg" ;;
375
376   -x-libraries | --x-libraries | --x-librarie | --x-librari \
377   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
378     ac_prev=x_libraries ;;
379   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
380   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
381     x_libraries="$ac_optarg" ;;
382
383   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
384     ;;
385
386   *)
387     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
388       echo "configure: warning: $ac_option: invalid host type" 1>&2
389     fi
390     if test "x$nonopt" != xNONE; then
391       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
392     fi
393     nonopt="$ac_option"
394     ;;
395
396   esac
397 done
398
399 if test -n "$ac_prev"; then
400   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
401 fi
402
403 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
404
405 # File descriptor usage:
406 # 0 standard input
407 # 1 file creation
408 # 2 errors and warnings
409 # 3 some systems may open it to /dev/tty
410 # 4 used on the Kubota Titan
411 # 6 checking for... messages and results
412 # 5 compiler messages saved in config.log
413 if test "$silent" = yes; then
414   exec 6>/dev/null
415 else
416   exec 6>&1
417 fi
418 exec 5>./config.log
419
420 echo "\
421 This file contains any messages produced by compilers while
422 running configure, to aid debugging if configure makes a mistake.
423 " 1>&5
424
425 # Strip out --no-create and --no-recursion so they do not pile up.
426 # Also quote any args containing shell metacharacters.
427 ac_configure_args=
428 for ac_arg
429 do
430   case "$ac_arg" in
431   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
432   | --no-cr | --no-c) ;;
433   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
434   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
435   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
436   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
437   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
438   esac
439 done
440
441 # NLS nuisances.
442 # Only set these to C if already set.  These must not be set unconditionally
443 # because not all systems understand e.g. LANG=C (notably SCO).
444 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
445 # Non-C LC_CTYPE values break the ctype check.
446 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
447 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
448 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
449 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
450
451 # confdefs.h avoids OS command line length limits that DEFS can exceed.
452 rm -rf conftest* confdefs.h
453 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
454 echo > confdefs.h
455
456 # A filename unique to this package, relative to the directory that
457 # configure is in, which we can look for to find out if srcdir is correct.
458 ac_unique_file=sql_postgresql.c
459
460 # Find the source files, if location was not specified.
461 if test -z "$srcdir"; then
462   ac_srcdir_defaulted=yes
463   # Try the directory containing this script, then its parent.
464   ac_prog=$0
465   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
466   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
467   srcdir=$ac_confdir
468   if test ! -r $srcdir/$ac_unique_file; then
469     srcdir=..
470   fi
471 else
472   ac_srcdir_defaulted=no
473 fi
474 if test ! -r $srcdir/$ac_unique_file; then
475   if test "$ac_srcdir_defaulted" = yes; then
476     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
477   else
478     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
479   fi
480 fi
481 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
482
483 # Prefer explicitly selected file to automatically selected ones.
484 if test -z "$CONFIG_SITE"; then
485   if test "x$prefix" != xNONE; then
486     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
487   else
488     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
489   fi
490 fi
491 for ac_site_file in $CONFIG_SITE; do
492   if test -r "$ac_site_file"; then
493     echo "loading site script $ac_site_file"
494     . "$ac_site_file"
495   fi
496 done
497
498 if test -r "$cache_file"; then
499   echo "loading cache $cache_file"
500   . $cache_file
501 else
502   echo "creating cache $cache_file"
503   > $cache_file
504 fi
505
506 ac_ext=c
507 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
508 ac_cpp='$CPP $CPPFLAGS'
509 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
510 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
511 cross_compiling=$ac_cv_prog_cc_cross
512
513 ac_exeext=
514 ac_objext=o
515 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
516   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
517   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
518     ac_n= ac_c='
519 ' ac_t='        '
520   else
521     ac_n=-n ac_c= ac_t=
522   fi
523 else
524   ac_n= ac_c='\c' ac_t=
525 fi
526
527
528 # From configure.in Revision: 1.6 
529
530
531 fail=
532 SMART_LIBS=
533 SMART_CLFAGS=
534 if test x$with_rlm_sql_postgresql != xno; then
535
536         # Extract the first word of "gcc", so it can be a program name with args.
537 set dummy gcc; ac_word=$2
538 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
539 echo "configure:540: checking for $ac_word" >&5
540 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
541   echo $ac_n "(cached) $ac_c" 1>&6
542 else
543   if test -n "$CC"; then
544   ac_cv_prog_CC="$CC" # Let the user override the test.
545 else
546   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
547   ac_dummy="$PATH"
548   for ac_dir in $ac_dummy; do
549     test -z "$ac_dir" && ac_dir=.
550     if test -f $ac_dir/$ac_word; then
551       ac_cv_prog_CC="gcc"
552       break
553     fi
554   done
555   IFS="$ac_save_ifs"
556 fi
557 fi
558 CC="$ac_cv_prog_CC"
559 if test -n "$CC"; then
560   echo "$ac_t""$CC" 1>&6
561 else
562   echo "$ac_t""no" 1>&6
563 fi
564
565 if test -z "$CC"; then
566   # Extract the first word of "cc", so it can be a program name with args.
567 set dummy cc; ac_word=$2
568 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
569 echo "configure:570: checking for $ac_word" >&5
570 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
571   echo $ac_n "(cached) $ac_c" 1>&6
572 else
573   if test -n "$CC"; then
574   ac_cv_prog_CC="$CC" # Let the user override the test.
575 else
576   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
577   ac_prog_rejected=no
578   ac_dummy="$PATH"
579   for ac_dir in $ac_dummy; do
580     test -z "$ac_dir" && ac_dir=.
581     if test -f $ac_dir/$ac_word; then
582       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
583         ac_prog_rejected=yes
584         continue
585       fi
586       ac_cv_prog_CC="cc"
587       break
588     fi
589   done
590   IFS="$ac_save_ifs"
591 if test $ac_prog_rejected = yes; then
592   # We found a bogon in the path, so make sure we never use it.
593   set dummy $ac_cv_prog_CC
594   shift
595   if test $# -gt 0; then
596     # We chose a different compiler from the bogus one.
597     # However, it has the same basename, so the bogon will be chosen
598     # first if we set CC to just the basename; use the full file name.
599     shift
600     set dummy "$ac_dir/$ac_word" "$@"
601     shift
602     ac_cv_prog_CC="$@"
603   fi
604 fi
605 fi
606 fi
607 CC="$ac_cv_prog_CC"
608 if test -n "$CC"; then
609   echo "$ac_t""$CC" 1>&6
610 else
611   echo "$ac_t""no" 1>&6
612 fi
613
614   if test -z "$CC"; then
615     case "`uname -s`" in
616     *win32* | *WIN32*)
617       # Extract the first word of "cl", so it can be a program name with args.
618 set dummy cl; ac_word=$2
619 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
620 echo "configure:621: checking for $ac_word" >&5
621 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
622   echo $ac_n "(cached) $ac_c" 1>&6
623 else
624   if test -n "$CC"; then
625   ac_cv_prog_CC="$CC" # Let the user override the test.
626 else
627   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
628   ac_dummy="$PATH"
629   for ac_dir in $ac_dummy; do
630     test -z "$ac_dir" && ac_dir=.
631     if test -f $ac_dir/$ac_word; then
632       ac_cv_prog_CC="cl"
633       break
634     fi
635   done
636   IFS="$ac_save_ifs"
637 fi
638 fi
639 CC="$ac_cv_prog_CC"
640 if test -n "$CC"; then
641   echo "$ac_t""$CC" 1>&6
642 else
643   echo "$ac_t""no" 1>&6
644 fi
645  ;;
646     esac
647   fi
648   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
649 fi
650
651 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
652 echo "configure:653: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
653
654 ac_ext=c
655 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
656 ac_cpp='$CPP $CPPFLAGS'
657 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
658 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
659 cross_compiling=$ac_cv_prog_cc_cross
660
661 cat > conftest.$ac_ext << EOF
662
663 #line 664 "configure"
664 #include "confdefs.h"
665
666 main(){return(0);}
667 EOF
668 if { (eval echo configure:669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
669   ac_cv_prog_cc_works=yes
670   # If we can't run a trivial program, we are probably using a cross compiler.
671   if (./conftest; exit) 2>/dev/null; then
672     ac_cv_prog_cc_cross=no
673   else
674     ac_cv_prog_cc_cross=yes
675   fi
676 else
677   echo "configure: failed program was:" >&5
678   cat conftest.$ac_ext >&5
679   ac_cv_prog_cc_works=no
680 fi
681 rm -fr conftest*
682 ac_ext=c
683 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
684 ac_cpp='$CPP $CPPFLAGS'
685 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
686 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
687 cross_compiling=$ac_cv_prog_cc_cross
688
689 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
690 if test $ac_cv_prog_cc_works = no; then
691   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
692 fi
693 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
694 echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
695 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
696 cross_compiling=$ac_cv_prog_cc_cross
697
698 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
699 echo "configure:700: checking whether we are using GNU C" >&5
700 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
701   echo $ac_n "(cached) $ac_c" 1>&6
702 else
703   cat > conftest.c <<EOF
704 #ifdef __GNUC__
705   yes;
706 #endif
707 EOF
708 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
709   ac_cv_prog_gcc=yes
710 else
711   ac_cv_prog_gcc=no
712 fi
713 fi
714
715 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
716
717 if test $ac_cv_prog_gcc = yes; then
718   GCC=yes
719 else
720   GCC=
721 fi
722
723 ac_test_CFLAGS="${CFLAGS+set}"
724 ac_save_CFLAGS="$CFLAGS"
725 CFLAGS=
726 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
727 echo "configure:728: checking whether ${CC-cc} accepts -g" >&5
728 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
729   echo $ac_n "(cached) $ac_c" 1>&6
730 else
731   echo 'void f(){}' > conftest.c
732 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
733   ac_cv_prog_cc_g=yes
734 else
735   ac_cv_prog_cc_g=no
736 fi
737 rm -f conftest*
738
739 fi
740
741 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
742 if test "$ac_test_CFLAGS" = set; then
743   CFLAGS="$ac_save_CFLAGS"
744 elif test $ac_cv_prog_cc_g = yes; then
745   if test "$GCC" = yes; then
746     CFLAGS="-g -O2"
747   else
748     CFLAGS="-g"
749   fi
750 else
751   if test "$GCC" = yes; then
752     CFLAGS="-O2"
753   else
754     CFLAGS=
755   fi
756 fi
757
758
759                 rlm_sql_postgresql_lib_dir=
760         # Check whether --with-rlm-sql-postgresql-lib-dir or --without-rlm-sql-postgresql-lib-dir was given.
761 if test "${with_rlm_sql_postgresql_lib_dir+set}" = set; then
762   withval="$with_rlm_sql_postgresql_lib_dir"
763    case "$withval" in
764             no)
765                 { echo "configure: error: Need rlm-sql-postgresql-lib-dir" 1>&2; exit 1; }
766                 ;;
767             yes)
768                 ;;
769             *)
770                 rlm_sql_postgresql_lib_dir="$withval"
771                 ;;
772           esac 
773         
774 fi
775
776
777                 rlm_sql_postgresql_include_dir=
778         # Check whether --with-rlm-sql-postgresql-include-dir or --without-rlm-sql-postgresql-include-dir was given.
779 if test "${with_rlm_sql_postgresql_include_dir+set}" = set; then
780   withval="$with_rlm_sql_postgresql_include_dir"
781    case "$withval" in
782             no)
783                 { echo "configure: error: Need rlm-sql-postgresql-include-dir" 1>&2; exit 1; }
784                 ;;
785             yes)
786                 ;;
787             *)
788                 rlm_sql_postgresql_include_dir="$withval"
789                 ;;
790           esac 
791         
792 fi
793
794
795         smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql"
796         
797
798 ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__pm%'`
799 echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
800 echo "configure:801: checking for libpq-fe.h" >&5
801
802 old_CFLAGS="$CFLAGS"
803 smart_include=
804 smart_include_dir=
805
806 if test "x$smart_try_dir" != "x"; then
807   for try in $smart_try_dir; do
808     CFLAGS="$old_CFLAGS -I$try"
809     cat > conftest.$ac_ext <<EOF
810 #line 811 "configure"
811 #include "confdefs.h"
812
813                     #include <libpq-fe.h>
814 int main() {
815  int a = 1;
816 ; return 0; }
817 EOF
818 if { (eval echo configure:819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
819   rm -rf conftest*
820   smart_include="-I$try"
821 else
822   echo "configure: failed program was:" >&5
823   cat conftest.$ac_ext >&5
824   rm -rf conftest*
825   smart_include=
826 fi
827 rm -f conftest*
828     if test "x$smart_include" != "x"; then
829       break;
830     fi
831   done
832   CFLAGS="$old_CFLAGS"
833 fi
834
835 if test "x$smart_include" = "x"; then
836   cat > conftest.$ac_ext <<EOF
837 #line 838 "configure"
838 #include "confdefs.h"
839
840                   #include <libpq-fe.h>
841 int main() {
842  int a = 1;
843 ; return 0; }
844 EOF
845 if { (eval echo configure:846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
846   rm -rf conftest*
847   smart_include=" "
848 else
849   echo "configure: failed program was:" >&5
850   cat conftest.$ac_ext >&5
851   rm -rf conftest*
852   smart_include=
853 fi
854 rm -f conftest*
855 fi
856
857 if test "x$smart_include" = "x"; then
858   
859
860 if test "x$LOCATE" != "x"; then
861         DIRS=
862   file=libpq-fe.h
863
864   for x in `${LOCATE} $file 2>/dev/null`; do
865                                         base=`echo $x | sed "s%/${file}%%"`
866     if test "x$x" = "x$base"; then
867       continue;
868     fi
869
870     dir=`${DIRNAME} $x 2>/dev/null`
871                 exclude=`echo ${dir} | ${GREP} /home`
872     if test "x$exclude" != "x"; then
873       continue
874     fi
875
876                     already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
877     if test "x$already" = "x"; then
878       DIRS="$DIRS $dir"
879     fi
880   done
881 fi
882
883 eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
884
885
886   for try in $smart_include_dir /usr/local/include /opt/include; do
887     CFLAGS="$old_CFLAGS -I$try"
888     cat > conftest.$ac_ext <<EOF
889 #line 890 "configure"
890 #include "confdefs.h"
891
892                     #include <libpq-fe.h>
893 int main() {
894  int a = 1;
895 ; return 0; }
896 EOF
897 if { (eval echo configure:898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
898   rm -rf conftest*
899   smart_include="-I$try"
900 else
901   echo "configure: failed program was:" >&5
902   cat conftest.$ac_ext >&5
903   rm -rf conftest*
904   smart_include=
905 fi
906 rm -f conftest*
907     if test "x$smart_include" != "x"; then
908       break;
909     fi
910   done
911   CFLAGS="$old_CFLAGS"
912 fi
913
914 if test "x$smart_include" != "x"; then
915   echo "$ac_t""yes" 1>&6
916   eval "ac_cv_header_$ac_safe=yes"
917   CFLAGS="$old_CFLAGS $smart_include"
918   SMART_CFLAGS="$SMART_CFLAGS $smart_include"
919 else
920   echo "$ac_t""no" 1>&6
921 fi
922
923         if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then
924           fail="$fail libpq-fe.h"
925         fi
926
927         smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib"
928         
929
930 sm_lib_safe=`echo "pq" | sed 'y%./+-%__p_%'`
931 sm_func_safe=`echo "PQconnectdb" | sed 'y%./+-%__p_%'`
932 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
933 echo "configure:934: checking for PQconnectdb in -lpq" >&5
934
935 old_LIBS="$LIBS"
936 smart_lib=
937 smart_lib_dir=
938
939 if test "x$smart_try_dir" != "x"; then
940   for try in $smart_try_dir; do
941     LIBS="-L$try -lpq $old_LIBS"
942     cat > conftest.$ac_ext <<EOF
943 #line 944 "configure"
944 #include "confdefs.h"
945 extern char PQconnectdb();
946 int main() {
947  PQconnectdb()
948 ; return 0; }
949 EOF
950 if { (eval echo configure:951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
951   rm -rf conftest*
952   smart_lib="-L$try -lpq"
953 else
954   echo "configure: failed program was:" >&5
955   cat conftest.$ac_ext >&5
956 fi
957 rm -f conftest*
958     if test "x$smart_lib" != "x"; then
959       break;
960     fi
961   done
962   LIBS="$old_LIBS"
963 fi
964
965 if test "x$smart_lib" = "x"; then
966   LIBS="-lpq $old_LIBS"
967   cat > conftest.$ac_ext <<EOF
968 #line 969 "configure"
969 #include "confdefs.h"
970 extern char PQconnectdb();
971 int main() {
972  PQconnectdb()
973 ; return 0; }
974 EOF
975 if { (eval echo configure:976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
976   rm -rf conftest*
977   smart_lib="-lpq"
978 else
979   echo "configure: failed program was:" >&5
980   cat conftest.$ac_ext >&5
981 fi
982 rm -f conftest*
983   LIBS="$old_LIBS"
984 fi
985
986 if test "x$smart_lib" = "x"; then
987   
988
989 if test "x$LOCATE" != "x"; then
990         DIRS=
991   file=libpq${libltdl_cv_shlibext}
992
993   for x in `${LOCATE} $file 2>/dev/null`; do
994                                         base=`echo $x | sed "s%/${file}%%"`
995     if test "x$x" = "x$base"; then
996       continue;
997     fi
998
999     dir=`${DIRNAME} $x 2>/dev/null`
1000                 exclude=`echo ${dir} | ${GREP} /home`
1001     if test "x$exclude" != "x"; then
1002       continue
1003     fi
1004
1005                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1006     if test "x$already" = "x"; then
1007       DIRS="$DIRS $dir"
1008     fi
1009   done
1010 fi
1011
1012 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1013
1014   
1015
1016 if test "x$LOCATE" != "x"; then
1017         DIRS=
1018   file=libpq.a
1019
1020   for x in `${LOCATE} $file 2>/dev/null`; do
1021                                         base=`echo $x | sed "s%/${file}%%"`
1022     if test "x$x" = "x$base"; then
1023       continue;
1024     fi
1025
1026     dir=`${DIRNAME} $x 2>/dev/null`
1027                 exclude=`echo ${dir} | ${GREP} /home`
1028     if test "x$exclude" != "x"; then
1029       continue
1030     fi
1031
1032                     already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1033     if test "x$already" = "x"; then
1034       DIRS="$DIRS $dir"
1035     fi
1036   done
1037 fi
1038
1039 eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1040
1041
1042   for try in $smart_lib_dir /usr/local/lib /opt/lib; do
1043     LIBS="-L$try -lpq $old_LIBS"
1044     cat > conftest.$ac_ext <<EOF
1045 #line 1046 "configure"
1046 #include "confdefs.h"
1047 extern char PQconnectdb();
1048 int main() {
1049  PQconnectdb()
1050 ; return 0; }
1051 EOF
1052 if { (eval echo configure:1053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1053   rm -rf conftest*
1054   smart_lib="-L$try -lpq"
1055 else
1056   echo "configure: failed program was:" >&5
1057   cat conftest.$ac_ext >&5
1058 fi
1059 rm -f conftest*
1060     if test "x$smart_lib" != "x"; then
1061       break;
1062     fi
1063   done
1064   LIBS="$old_LIBS"
1065 fi
1066
1067 if test "x$smart_lib" != "x"; then
1068   echo "$ac_t""yes" 1>&6
1069   eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1070   LIBS="$smart_lib $old_LIBS"
1071   SMART_LIBS="$smart_lib $SMART_LIBS"
1072 else
1073   echo "$ac_t""no" 1>&6
1074 fi
1075
1076         if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then
1077           fail="$fail libpq"
1078         fi
1079
1080         targetname=rlm_sql_postgresql
1081 else
1082         targetname=
1083         echo \*\*\* module rlm_sql_postgresql is disabled.
1084 fi
1085
1086 if test x"$fail" != x""; then
1087         if test x"${enable_strict_dependencies}" = x"yes"; then
1088                 { echo "configure: error: set --without-rlm_sql_postgresql to disable it explicitly." 1>&2; exit 1; }
1089         else
1090                 echo "configure: warning: silently not building rlm_sql_postgresql." 1>&2
1091                 echo "configure: warning: FAILURE: rlm_sql_postgresql requires: $fail." 1>&2
1092                 if test x"$headersuggestion" != x; then
1093                         echo "configure: warning: $headersuggestion" 1>&2 
1094                 fi
1095                 if test x"$libsuggestion" != x; then
1096                         echo "configure: warning: $libsuggestion" 1>&2 
1097                 fi
1098                 targetname=""
1099         fi
1100 fi
1101
1102 postgresql_ldflags=$SMART_LIBS
1103 postgresql_cflags=$SMART_CFLAGS
1104
1105
1106
1107 trap '' 1 2 15
1108 cat > confcache <<\EOF
1109 # This file is a shell script that caches the results of configure
1110 # tests run on this system so they can be shared between configure
1111 # scripts and configure runs.  It is not useful on other systems.
1112 # If it contains results you don't want to keep, you may remove or edit it.
1113 #
1114 # By default, configure uses ./config.cache as the cache file,
1115 # creating it if it does not exist already.  You can give configure
1116 # the --cache-file=FILE option to use a different cache file; that is
1117 # what configure does when it calls configure scripts in
1118 # subdirectories, so they share the cache.
1119 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1120 # config.status only pays attention to the cache file if you give it the
1121 # --recheck option to rerun configure.
1122 #
1123 EOF
1124 # The following way of writing the cache mishandles newlines in values,
1125 # but we know of no workaround that is simple, portable, and efficient.
1126 # So, don't put newlines in cache variables' values.
1127 # Ultrix sh set writes to stderr and can't be redirected directly,
1128 # and sets the high bit in the cache file unless we assign to the vars.
1129 (set) 2>&1 |
1130   case `(ac_space=' '; set | grep ac_space) 2>&1` in
1131   *ac_space=\ *)
1132     # `set' does not quote correctly, so add quotes (double-quote substitution
1133     # turns \\\\ into \\, and sed turns \\ into \).
1134     sed -n \
1135       -e "s/'/'\\\\''/g" \
1136       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1137     ;;
1138   *)
1139     # `set' quotes correctly as required by POSIX, so do not add quotes.
1140     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1141     ;;
1142   esac >> confcache
1143 if cmp -s $cache_file confcache; then
1144   :
1145 else
1146   if test -w $cache_file; then
1147     echo "updating cache $cache_file"
1148     cat confcache > $cache_file
1149   else
1150     echo "not updating unwritable cache $cache_file"
1151   fi
1152 fi
1153 rm -f confcache
1154
1155 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1156
1157 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1158 # Let make expand exec_prefix.
1159 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1160
1161 # Any assignment to VPATH causes Sun make to only execute
1162 # the first set of double-colon rules, so remove it if not needed.
1163 # If there is a colon in the path, we need to keep it.
1164 if test "x$srcdir" = x.; then
1165   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
1166 fi
1167
1168 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1169
1170 # Transform confdefs.h into DEFS.
1171 # Protect against shell expansion while executing Makefile rules.
1172 # Protect against Makefile macro expansion.
1173 cat > conftest.defs <<\EOF
1174 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
1175 s%[     `~#$^&*(){}\\|;'"<>?]%\\&%g
1176 s%\[%\\&%g
1177 s%\]%\\&%g
1178 s%\$%$$%g
1179 EOF
1180 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1181 rm -f conftest.defs
1182
1183
1184 # Without the "./", some shells look in PATH for config.status.
1185 : ${CONFIG_STATUS=./config.status}
1186
1187 echo creating $CONFIG_STATUS
1188 rm -f $CONFIG_STATUS
1189 cat > $CONFIG_STATUS <<EOF
1190 #! /bin/sh
1191 # Generated automatically by configure.
1192 # Run this file to recreate the current configuration.
1193 # This directory was configured as follows,
1194 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1195 #
1196 # $0 $ac_configure_args
1197 #
1198 # Compiler output produced by configure, useful for debugging
1199 # configure, is in ./config.log if it exists.
1200
1201 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1202 for ac_option
1203 do
1204   case "\$ac_option" in
1205   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1206     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1207     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1208   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1209     echo "$CONFIG_STATUS generated by autoconf version 2.13"
1210     exit 0 ;;
1211   -help | --help | --hel | --he | --h)
1212     echo "\$ac_cs_usage"; exit 0 ;;
1213   *) echo "\$ac_cs_usage"; exit 1 ;;
1214   esac
1215 done
1216
1217 ac_given_srcdir=$srcdir
1218
1219 trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1220 EOF
1221 cat >> $CONFIG_STATUS <<EOF
1222
1223 # Protect against being on the right side of a sed subst in config.status.
1224 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1225  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1226 $ac_vpsub
1227 $extrasub
1228 s%@SHELL@%$SHELL%g
1229 s%@CFLAGS@%$CFLAGS%g
1230 s%@CPPFLAGS@%$CPPFLAGS%g
1231 s%@CXXFLAGS@%$CXXFLAGS%g
1232 s%@FFLAGS@%$FFLAGS%g
1233 s%@DEFS@%$DEFS%g
1234 s%@LDFLAGS@%$LDFLAGS%g
1235 s%@LIBS@%$LIBS%g
1236 s%@exec_prefix@%$exec_prefix%g
1237 s%@prefix@%$prefix%g
1238 s%@program_transform_name@%$program_transform_name%g
1239 s%@bindir@%$bindir%g
1240 s%@sbindir@%$sbindir%g
1241 s%@libexecdir@%$libexecdir%g
1242 s%@datadir@%$datadir%g
1243 s%@sysconfdir@%$sysconfdir%g
1244 s%@sharedstatedir@%$sharedstatedir%g
1245 s%@localstatedir@%$localstatedir%g
1246 s%@libdir@%$libdir%g
1247 s%@includedir@%$includedir%g
1248 s%@oldincludedir@%$oldincludedir%g
1249 s%@infodir@%$infodir%g
1250 s%@mandir@%$mandir%g
1251 s%@CC@%$CC%g
1252 s%@postgresql_ldflags@%$postgresql_ldflags%g
1253 s%@postgresql_cflags@%$postgresql_cflags%g
1254 s%@targetname@%$targetname%g
1255
1256 CEOF
1257 EOF
1258
1259 cat >> $CONFIG_STATUS <<\EOF
1260
1261 # Split the substitutions into bite-sized pieces for seds with
1262 # small command number limits, like on Digital OSF/1 and HP-UX.
1263 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
1264 ac_file=1 # Number of current file.
1265 ac_beg=1 # First line for current file.
1266 ac_end=$ac_max_sed_cmds # Line after last line for current file.
1267 ac_more_lines=:
1268 ac_sed_cmds=""
1269 while $ac_more_lines; do
1270   if test $ac_beg -gt 1; then
1271     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
1272   else
1273     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
1274   fi
1275   if test ! -s conftest.s$ac_file; then
1276     ac_more_lines=false
1277     rm -f conftest.s$ac_file
1278   else
1279     if test -z "$ac_sed_cmds"; then
1280       ac_sed_cmds="sed -f conftest.s$ac_file"
1281     else
1282       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
1283     fi
1284     ac_file=`expr $ac_file + 1`
1285     ac_beg=$ac_end
1286     ac_end=`expr $ac_end + $ac_max_sed_cmds`
1287   fi
1288 done
1289 if test -z "$ac_sed_cmds"; then
1290   ac_sed_cmds=cat
1291 fi
1292 EOF
1293
1294 cat >> $CONFIG_STATUS <<EOF
1295
1296 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
1297 EOF
1298 cat >> $CONFIG_STATUS <<\EOF
1299 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1300   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
1301   case "$ac_file" in
1302   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
1303        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1304   *) ac_file_in="${ac_file}.in" ;;
1305   esac
1306
1307   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
1308
1309   # Remove last slash and all that follows it.  Not all systems have dirname.
1310   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1311   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1312     # The file is in a subdirectory.
1313     test ! -d "$ac_dir" && mkdir "$ac_dir"
1314     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1315     # A "../" for each directory in $ac_dir_suffix.
1316     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1317   else
1318     ac_dir_suffix= ac_dots=
1319   fi
1320
1321   case "$ac_given_srcdir" in
1322   .)  srcdir=.
1323       if test -z "$ac_dots"; then top_srcdir=.
1324       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1325   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1326   *) # Relative path.
1327     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1328     top_srcdir="$ac_dots$ac_given_srcdir" ;;
1329   esac
1330
1331
1332   echo creating "$ac_file"
1333   rm -f "$ac_file"
1334   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1335   case "$ac_file" in
1336   *Makefile*) ac_comsub="1i\\
1337 # $configure_input" ;;
1338   *) ac_comsub= ;;
1339   esac
1340
1341   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
1342   sed -e "$ac_comsub
1343 s%@configure_input@%$configure_input%g
1344 s%@srcdir@%$srcdir%g
1345 s%@top_srcdir@%$top_srcdir%g
1346 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
1347 fi; done
1348 rm -f conftest.s*
1349
1350 EOF
1351 cat >> $CONFIG_STATUS <<EOF
1352
1353 EOF
1354 cat >> $CONFIG_STATUS <<\EOF
1355
1356 exit 0
1357 EOF
1358 chmod +x $CONFIG_STATUS
1359 rm -fr confdefs* $ac_clean_files
1360 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1361