Added config.h.in.
[yaz-moved-to-github.git] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --enable-yc             compile using YAZ' ASN.1 Compiler"
16 ac_help="$ac_help
17   --enable-tcpd           enable TCP wrapper for server if available"
18 ac_help="$ac_help
19   --enable-threads        enable threads if available"
20
21 # Initialize some variables set by options.
22 # The variables have the same names as the options, with
23 # dashes changed to underlines.
24 build=NONE
25 cache_file=./config.cache
26 exec_prefix=NONE
27 host=NONE
28 no_create=
29 nonopt=NONE
30 no_recursion=
31 prefix=NONE
32 program_prefix=NONE
33 program_suffix=NONE
34 program_transform_name=s,x,x,
35 silent=
36 site=
37 srcdir=
38 target=NONE
39 verbose=
40 x_includes=NONE
41 x_libraries=NONE
42 bindir='${exec_prefix}/bin'
43 sbindir='${exec_prefix}/sbin'
44 libexecdir='${exec_prefix}/libexec'
45 datadir='${prefix}/share'
46 sysconfdir='${prefix}/etc'
47 sharedstatedir='${prefix}/com'
48 localstatedir='${prefix}/var'
49 libdir='${exec_prefix}/lib'
50 includedir='${prefix}/include'
51 oldincludedir='/usr/include'
52 infodir='${prefix}/info'
53 mandir='${prefix}/man'
54
55 # Initialize some other variables.
56 subdirs=
57 MFLAGS= MAKEFLAGS=
58 SHELL=${CONFIG_SHELL-/bin/sh}
59 # Maximum number of lines to put in a shell here document.
60 ac_max_here_lines=12
61
62 ac_prev=
63 for ac_option
64 do
65
66   # If the previous option needs an argument, assign it.
67   if test -n "$ac_prev"; then
68     eval "$ac_prev=\$ac_option"
69     ac_prev=
70     continue
71   fi
72
73   case "$ac_option" in
74   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
75   *) ac_optarg= ;;
76   esac
77
78   # Accept the important Cygnus configure options, so we can diagnose typos.
79
80   case "$ac_option" in
81
82   -bindir | --bindir | --bindi | --bind | --bin | --bi)
83     ac_prev=bindir ;;
84   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
85     bindir="$ac_optarg" ;;
86
87   -build | --build | --buil | --bui | --bu)
88     ac_prev=build ;;
89   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
90     build="$ac_optarg" ;;
91
92   -cache-file | --cache-file | --cache-fil | --cache-fi \
93   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
94     ac_prev=cache_file ;;
95   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
96   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
97     cache_file="$ac_optarg" ;;
98
99   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
100     ac_prev=datadir ;;
101   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
102   | --da=*)
103     datadir="$ac_optarg" ;;
104
105   -disable-* | --disable-*)
106     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
107     # Reject names that are not valid shell variable names.
108     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
109       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
110     fi
111     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
112     eval "enable_${ac_feature}=no" ;;
113
114   -enable-* | --enable-*)
115     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
116     # Reject names that are not valid shell variable names.
117     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
118       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
119     fi
120     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
121     case "$ac_option" in
122       *=*) ;;
123       *) ac_optarg=yes ;;
124     esac
125     eval "enable_${ac_feature}='$ac_optarg'" ;;
126
127   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
128   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
129   | --exec | --exe | --ex)
130     ac_prev=exec_prefix ;;
131   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
132   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
133   | --exec=* | --exe=* | --ex=*)
134     exec_prefix="$ac_optarg" ;;
135
136   -gas | --gas | --ga | --g)
137     # Obsolete; use --with-gas.
138     with_gas=yes ;;
139
140   -help | --help | --hel | --he)
141     # Omit some internal or obsolete options to make the list less imposing.
142     # This message is too long to be a string in the A/UX 3.1 sh.
143     cat << EOF
144 Usage: configure [options] [host]
145 Options: [defaults in brackets after descriptions]
146 Configuration:
147   --cache-file=FILE       cache test results in FILE
148   --help                  print this message
149   --no-create             do not create output files
150   --quiet, --silent       do not print \`checking...' messages
151   --version               print the version of autoconf that created configure
152 Directory and file names:
153   --prefix=PREFIX         install architecture-independent files in PREFIX
154                           [$ac_default_prefix]
155   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
156                           [same as prefix]
157   --bindir=DIR            user executables in DIR [EPREFIX/bin]
158   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
159   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
160   --datadir=DIR           read-only architecture-independent data in DIR
161                           [PREFIX/share]
162   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
163   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
164                           [PREFIX/com]
165   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
166   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
167   --includedir=DIR        C header files in DIR [PREFIX/include]
168   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
169   --infodir=DIR           info documentation in DIR [PREFIX/info]
170   --mandir=DIR            man documentation in DIR [PREFIX/man]
171   --srcdir=DIR            find the sources in DIR [configure dir or ..]
172   --program-prefix=PREFIX prepend PREFIX to installed program names
173   --program-suffix=SUFFIX append SUFFIX to installed program names
174   --program-transform-name=PROGRAM
175                           run sed PROGRAM on installed program names
176 EOF
177     cat << EOF
178 Host type:
179   --build=BUILD           configure for building on BUILD [BUILD=HOST]
180   --host=HOST             configure for HOST [guessed]
181   --target=TARGET         configure for TARGET [TARGET=HOST]
182 Features and packages:
183   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
184   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
185   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
186   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
187   --x-includes=DIR        X include files are in DIR
188   --x-libraries=DIR       X library files are in DIR
189 EOF
190     if test -n "$ac_help"; then
191       echo "--enable and --with options recognized:$ac_help"
192     fi
193     exit 0 ;;
194
195   -host | --host | --hos | --ho)
196     ac_prev=host ;;
197   -host=* | --host=* | --hos=* | --ho=*)
198     host="$ac_optarg" ;;
199
200   -includedir | --includedir | --includedi | --included | --include \
201   | --includ | --inclu | --incl | --inc)
202     ac_prev=includedir ;;
203   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
204   | --includ=* | --inclu=* | --incl=* | --inc=*)
205     includedir="$ac_optarg" ;;
206
207   -infodir | --infodir | --infodi | --infod | --info | --inf)
208     ac_prev=infodir ;;
209   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
210     infodir="$ac_optarg" ;;
211
212   -libdir | --libdir | --libdi | --libd)
213     ac_prev=libdir ;;
214   -libdir=* | --libdir=* | --libdi=* | --libd=*)
215     libdir="$ac_optarg" ;;
216
217   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
218   | --libexe | --libex | --libe)
219     ac_prev=libexecdir ;;
220   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
221   | --libexe=* | --libex=* | --libe=*)
222     libexecdir="$ac_optarg" ;;
223
224   -localstatedir | --localstatedir | --localstatedi | --localstated \
225   | --localstate | --localstat | --localsta | --localst \
226   | --locals | --local | --loca | --loc | --lo)
227     ac_prev=localstatedir ;;
228   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
229   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
230   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
231     localstatedir="$ac_optarg" ;;
232
233   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
234     ac_prev=mandir ;;
235   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
236     mandir="$ac_optarg" ;;
237
238   -nfp | --nfp | --nf)
239     # Obsolete; use --without-fp.
240     with_fp=no ;;
241
242   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
243   | --no-cr | --no-c)
244     no_create=yes ;;
245
246   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
247   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
248     no_recursion=yes ;;
249
250   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
251   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
252   | --oldin | --oldi | --old | --ol | --o)
253     ac_prev=oldincludedir ;;
254   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
255   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
256   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
257     oldincludedir="$ac_optarg" ;;
258
259   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
260     ac_prev=prefix ;;
261   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
262     prefix="$ac_optarg" ;;
263
264   -program-prefix | --program-prefix | --program-prefi | --program-pref \
265   | --program-pre | --program-pr | --program-p)
266     ac_prev=program_prefix ;;
267   -program-prefix=* | --program-prefix=* | --program-prefi=* \
268   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
269     program_prefix="$ac_optarg" ;;
270
271   -program-suffix | --program-suffix | --program-suffi | --program-suff \
272   | --program-suf | --program-su | --program-s)
273     ac_prev=program_suffix ;;
274   -program-suffix=* | --program-suffix=* | --program-suffi=* \
275   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
276     program_suffix="$ac_optarg" ;;
277
278   -program-transform-name | --program-transform-name \
279   | --program-transform-nam | --program-transform-na \
280   | --program-transform-n | --program-transform- \
281   | --program-transform | --program-transfor \
282   | --program-transfo | --program-transf \
283   | --program-trans | --program-tran \
284   | --progr-tra | --program-tr | --program-t)
285     ac_prev=program_transform_name ;;
286   -program-transform-name=* | --program-transform-name=* \
287   | --program-transform-nam=* | --program-transform-na=* \
288   | --program-transform-n=* | --program-transform-=* \
289   | --program-transform=* | --program-transfor=* \
290   | --program-transfo=* | --program-transf=* \
291   | --program-trans=* | --program-tran=* \
292   | --progr-tra=* | --program-tr=* | --program-t=*)
293     program_transform_name="$ac_optarg" ;;
294
295   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
296   | -silent | --silent | --silen | --sile | --sil)
297     silent=yes ;;
298
299   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
300     ac_prev=sbindir ;;
301   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
302   | --sbi=* | --sb=*)
303     sbindir="$ac_optarg" ;;
304
305   -sharedstatedir | --sharedstatedir | --sharedstatedi \
306   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
307   | --sharedst | --shareds | --shared | --share | --shar \
308   | --sha | --sh)
309     ac_prev=sharedstatedir ;;
310   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
311   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
312   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
313   | --sha=* | --sh=*)
314     sharedstatedir="$ac_optarg" ;;
315
316   -site | --site | --sit)
317     ac_prev=site ;;
318   -site=* | --site=* | --sit=*)
319     site="$ac_optarg" ;;
320
321   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
322     ac_prev=srcdir ;;
323   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
324     srcdir="$ac_optarg" ;;
325
326   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
327   | --syscon | --sysco | --sysc | --sys | --sy)
328     ac_prev=sysconfdir ;;
329   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
330   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
331     sysconfdir="$ac_optarg" ;;
332
333   -target | --target | --targe | --targ | --tar | --ta | --t)
334     ac_prev=target ;;
335   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
336     target="$ac_optarg" ;;
337
338   -v | -verbose | --verbose | --verbos | --verbo | --verb)
339     verbose=yes ;;
340
341   -version | --version | --versio | --versi | --vers)
342     echo "configure generated by autoconf version 2.13"
343     exit 0 ;;
344
345   -with-* | --with-*)
346     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
347     # Reject names that are not valid shell variable names.
348     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
349       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
350     fi
351     ac_package=`echo $ac_package| sed 's/-/_/g'`
352     case "$ac_option" in
353       *=*) ;;
354       *) ac_optarg=yes ;;
355     esac
356     eval "with_${ac_package}='$ac_optarg'" ;;
357
358   -without-* | --without-*)
359     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
360     # Reject names that are not valid shell variable names.
361     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
362       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
363     fi
364     ac_package=`echo $ac_package| sed 's/-/_/g'`
365     eval "with_${ac_package}=no" ;;
366
367   --x)
368     # Obsolete; use --with-x.
369     with_x=yes ;;
370
371   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
372   | --x-incl | --x-inc | --x-in | --x-i)
373     ac_prev=x_includes ;;
374   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
375   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
376     x_includes="$ac_optarg" ;;
377
378   -x-libraries | --x-libraries | --x-librarie | --x-librari \
379   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
380     ac_prev=x_libraries ;;
381   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
382   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
383     x_libraries="$ac_optarg" ;;
384
385   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
386     ;;
387
388   *)
389     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
390       echo "configure: warning: $ac_option: invalid host type" 1>&2
391     fi
392     if test "x$nonopt" != xNONE; then
393       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
394     fi
395     nonopt="$ac_option"
396     ;;
397
398   esac
399 done
400
401 if test -n "$ac_prev"; then
402   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
403 fi
404
405 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
406
407 # File descriptor usage:
408 # 0 standard input
409 # 1 file creation
410 # 2 errors and warnings
411 # 3 some systems may open it to /dev/tty
412 # 4 used on the Kubota Titan
413 # 6 checking for... messages and results
414 # 5 compiler messages saved in config.log
415 if test "$silent" = yes; then
416   exec 6>/dev/null
417 else
418   exec 6>&1
419 fi
420 exec 5>./config.log
421
422 echo "\
423 This file contains any messages produced by compilers while
424 running configure, to aid debugging if configure makes a mistake.
425 " 1>&5
426
427 # Strip out --no-create and --no-recursion so they do not pile up.
428 # Also quote any args containing shell metacharacters.
429 ac_configure_args=
430 for ac_arg
431 do
432   case "$ac_arg" in
433   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
434   | --no-cr | --no-c) ;;
435   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
436   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
437   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
438   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
439   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
440   esac
441 done
442
443 # NLS nuisances.
444 # Only set these to C if already set.  These must not be set unconditionally
445 # because not all systems understand e.g. LANG=C (notably SCO).
446 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
447 # Non-C LC_CTYPE values break the ctype check.
448 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
449 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
450 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
451 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
452
453 # confdefs.h avoids OS command line length limits that DEFS can exceed.
454 rm -rf conftest* confdefs.h
455 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
456 echo > confdefs.h
457
458 # A filename unique to this package, relative to the directory that
459 # configure is in, which we can look for to find out if srcdir is correct.
460 ac_unique_file=include/yaz/yaz-version.h
461
462 # Find the source files, if location was not specified.
463 if test -z "$srcdir"; then
464   ac_srcdir_defaulted=yes
465   # Try the directory containing this script, then its parent.
466   ac_prog=$0
467   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
468   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
469   srcdir=$ac_confdir
470   if test ! -r $srcdir/$ac_unique_file; then
471     srcdir=..
472   fi
473 else
474   ac_srcdir_defaulted=no
475 fi
476 if test ! -r $srcdir/$ac_unique_file; then
477   if test "$ac_srcdir_defaulted" = yes; then
478     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
479   else
480     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
481   fi
482 fi
483 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
484
485 # Prefer explicitly selected file to automatically selected ones.
486 if test -z "$CONFIG_SITE"; then
487   if test "x$prefix" != xNONE; then
488     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
489   else
490     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
491   fi
492 fi
493 for ac_site_file in $CONFIG_SITE; do
494   if test -r "$ac_site_file"; then
495     echo "loading site script $ac_site_file"
496     . "$ac_site_file"
497   fi
498 done
499
500 if test -r "$cache_file"; then
501   echo "loading cache $cache_file"
502   . $cache_file
503 else
504   echo "creating cache $cache_file"
505   > $cache_file
506 fi
507
508 ac_ext=c
509 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
510 ac_cpp='$CPP $CPPFLAGS'
511 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
512 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
513 cross_compiling=$ac_cv_prog_cc_cross
514
515 ac_exeext=
516 ac_objext=o
517 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
518   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
519   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
520     ac_n= ac_c='
521 ' ac_t='        '
522   else
523     ac_n=-n ac_c= ac_t=
524   fi
525 else
526   ac_n= ac_c='\c' ac_t=
527 fi
528
529
530 ac_aux_dir=
531 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
532   if test -f $ac_dir/install-sh; then
533     ac_aux_dir=$ac_dir
534     ac_install_sh="$ac_aux_dir/install-sh -c"
535     break
536   elif test -f $ac_dir/install.sh; then
537     ac_aux_dir=$ac_dir
538     ac_install_sh="$ac_aux_dir/install.sh -c"
539     break
540   fi
541 done
542 if test -z "$ac_aux_dir"; then
543   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
544 fi
545 ac_config_guess=$ac_aux_dir/config.guess
546 ac_config_sub=$ac_aux_dir/config.sub
547 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
548
549 # Find a good install program.  We prefer a C program (faster),
550 # so one script is as good as another.  But avoid the broken or
551 # incompatible versions:
552 # SysV /etc/install, /usr/sbin/install
553 # SunOS /usr/etc/install
554 # IRIX /sbin/install
555 # AIX /bin/install
556 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
557 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
558 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
559 # ./install, which can be erroneously created by make from ./install.sh.
560 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
561 echo "configure:562: checking for a BSD compatible install" >&5
562 if test -z "$INSTALL"; then
563 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
564   echo $ac_n "(cached) $ac_c" 1>&6
565 else
566     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
567   for ac_dir in $PATH; do
568     # Account for people who put trailing slashes in PATH elements.
569     case "$ac_dir/" in
570     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
571     *)
572       # OSF1 and SCO ODT 3.0 have their own names for install.
573       # Don't use installbsd from OSF since it installs stuff as root
574       # by default.
575       for ac_prog in ginstall scoinst install; do
576         if test -f $ac_dir/$ac_prog; then
577           if test $ac_prog = install &&
578             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
579             # AIX install.  It has an incompatible calling convention.
580             :
581           else
582             ac_cv_path_install="$ac_dir/$ac_prog -c"
583             break 2
584           fi
585         fi
586       done
587       ;;
588     esac
589   done
590   IFS="$ac_save_IFS"
591
592 fi
593   if test "${ac_cv_path_install+set}" = set; then
594     INSTALL="$ac_cv_path_install"
595   else
596     # As a last resort, use the slow shell script.  We don't cache a
597     # path for INSTALL within a source directory, because that will
598     # break other packages using the cache if that directory is
599     # removed, or if the path is relative.
600     INSTALL="$ac_install_sh"
601   fi
602 fi
603 echo "$ac_t""$INSTALL" 1>&6
604
605 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
606 # It thinks the first close brace ends the variable substitution.
607 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
608
609 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
610
611 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
612
613 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
614 echo "configure:615: checking whether build environment is sane" >&5
615 # Just in case
616 sleep 1
617 echo timestamp > conftestfile
618 # Do `set' in a subshell so we don't clobber the current shell's
619 # arguments.  Must try -L first in case configure is actually a
620 # symlink; some systems play weird games with the mod time of symlinks
621 # (eg FreeBSD returns the mod time of the symlink's containing
622 # directory).
623 if (
624    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
625    if test "$*" = "X"; then
626       # -L didn't work.
627       set X `ls -t $srcdir/configure conftestfile`
628    fi
629    if test "$*" != "X $srcdir/configure conftestfile" \
630       && test "$*" != "X conftestfile $srcdir/configure"; then
631
632       # If neither matched, then we have a broken ls.  This can happen
633       # if, for instance, CONFIG_SHELL is bash and it inherits a
634       # broken ls alias from the environment.  This has actually
635       # happened.  Such a system could not be considered "sane".
636       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
637 alias in your environment" 1>&2; exit 1; }
638    fi
639
640    test "$2" = conftestfile
641    )
642 then
643    # Ok.
644    :
645 else
646    { echo "configure: error: newly created file is older than distributed files!
647 Check your system clock" 1>&2; exit 1; }
648 fi
649 rm -f conftest*
650 echo "$ac_t""yes" 1>&6
651 if test "$program_transform_name" = s,x,x,; then
652   program_transform_name=
653 else
654   # Double any \ or $.  echo might interpret backslashes.
655   cat <<\EOF_SED > conftestsed
656 s,\\,\\\\,g; s,\$,$$,g
657 EOF_SED
658   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
659   rm -f conftestsed
660 fi
661 test "$program_prefix" != NONE &&
662   program_transform_name="s,^,${program_prefix},; $program_transform_name"
663 # Use a double $ so make ignores it.
664 test "$program_suffix" != NONE &&
665   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
666
667 # sed with no file args requires a program.
668 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
669
670 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
671 echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5
672 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
673 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
674   echo $ac_n "(cached) $ac_c" 1>&6
675 else
676   cat > conftestmake <<\EOF
677 all:
678         @echo 'ac_maketemp="${MAKE}"'
679 EOF
680 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
681 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
682 if test -n "$ac_maketemp"; then
683   eval ac_cv_prog_make_${ac_make}_set=yes
684 else
685   eval ac_cv_prog_make_${ac_make}_set=no
686 fi
687 rm -f conftestmake
688 fi
689 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
690   echo "$ac_t""yes" 1>&6
691   SET_MAKE=
692 else
693   echo "$ac_t""no" 1>&6
694   SET_MAKE="MAKE=${MAKE-make}"
695 fi
696
697
698 PACKAGE=yaz
699
700 VERSION=1.6
701
702 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
703   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
704 fi
705 cat >> confdefs.h <<EOF
706 #define PACKAGE "$PACKAGE"
707 EOF
708
709 cat >> confdefs.h <<EOF
710 #define VERSION "$VERSION"
711 EOF
712
713
714
715 missing_dir=`cd $ac_aux_dir && pwd`
716 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
717 echo "configure:718: checking for working aclocal" >&5
718 # Run test in a subshell; some versions of sh will print an error if
719 # an executable is not found, even if stderr is redirected.
720 # Redirect stdin to placate older versions of autoconf.  Sigh.
721 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
722    ACLOCAL=aclocal
723    echo "$ac_t""found" 1>&6
724 else
725    ACLOCAL="$missing_dir/missing aclocal"
726    echo "$ac_t""missing" 1>&6
727 fi
728
729 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
730 echo "configure:731: checking for working autoconf" >&5
731 # Run test in a subshell; some versions of sh will print an error if
732 # an executable is not found, even if stderr is redirected.
733 # Redirect stdin to placate older versions of autoconf.  Sigh.
734 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
735    AUTOCONF=autoconf
736    echo "$ac_t""found" 1>&6
737 else
738    AUTOCONF="$missing_dir/missing autoconf"
739    echo "$ac_t""missing" 1>&6
740 fi
741
742 echo $ac_n "checking for working automake""... $ac_c" 1>&6
743 echo "configure:744: checking for working automake" >&5
744 # Run test in a subshell; some versions of sh will print an error if
745 # an executable is not found, even if stderr is redirected.
746 # Redirect stdin to placate older versions of autoconf.  Sigh.
747 if (automake --version) < /dev/null > /dev/null 2>&1; then
748    AUTOMAKE=automake
749    echo "$ac_t""found" 1>&6
750 else
751    AUTOMAKE="$missing_dir/missing automake"
752    echo "$ac_t""missing" 1>&6
753 fi
754
755 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
756 echo "configure:757: checking for working autoheader" >&5
757 # Run test in a subshell; some versions of sh will print an error if
758 # an executable is not found, even if stderr is redirected.
759 # Redirect stdin to placate older versions of autoconf.  Sigh.
760 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
761    AUTOHEADER=autoheader
762    echo "$ac_t""found" 1>&6
763 else
764    AUTOHEADER="$missing_dir/missing autoheader"
765    echo "$ac_t""missing" 1>&6
766 fi
767
768 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
769 echo "configure:770: checking for working makeinfo" >&5
770 # Run test in a subshell; some versions of sh will print an error if
771 # an executable is not found, even if stderr is redirected.
772 # Redirect stdin to placate older versions of autoconf.  Sigh.
773 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
774    MAKEINFO=makeinfo
775    echo "$ac_t""found" 1>&6
776 else
777    MAKEINFO="$missing_dir/missing makeinfo"
778    echo "$ac_t""missing" 1>&6
779 fi
780
781
782
783
784
785 # Extract the first word of "gcc", so it can be a program name with args.
786 set dummy gcc; ac_word=$2
787 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
788 echo "configure:789: checking for $ac_word" >&5
789 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
790   echo $ac_n "(cached) $ac_c" 1>&6
791 else
792   if test -n "$CC"; then
793   ac_cv_prog_CC="$CC" # Let the user override the test.
794 else
795   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
796   ac_dummy="$PATH"
797   for ac_dir in $ac_dummy; do
798     test -z "$ac_dir" && ac_dir=.
799     if test -f $ac_dir/$ac_word; then
800       ac_cv_prog_CC="gcc"
801       break
802     fi
803   done
804   IFS="$ac_save_ifs"
805 fi
806 fi
807 CC="$ac_cv_prog_CC"
808 if test -n "$CC"; then
809   echo "$ac_t""$CC" 1>&6
810 else
811   echo "$ac_t""no" 1>&6
812 fi
813
814 if test -z "$CC"; then
815   # Extract the first word of "cc", so it can be a program name with args.
816 set dummy cc; ac_word=$2
817 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
818 echo "configure:819: checking for $ac_word" >&5
819 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
820   echo $ac_n "(cached) $ac_c" 1>&6
821 else
822   if test -n "$CC"; then
823   ac_cv_prog_CC="$CC" # Let the user override the test.
824 else
825   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
826   ac_prog_rejected=no
827   ac_dummy="$PATH"
828   for ac_dir in $ac_dummy; do
829     test -z "$ac_dir" && ac_dir=.
830     if test -f $ac_dir/$ac_word; then
831       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
832         ac_prog_rejected=yes
833         continue
834       fi
835       ac_cv_prog_CC="cc"
836       break
837     fi
838   done
839   IFS="$ac_save_ifs"
840 if test $ac_prog_rejected = yes; then
841   # We found a bogon in the path, so make sure we never use it.
842   set dummy $ac_cv_prog_CC
843   shift
844   if test $# -gt 0; then
845     # We chose a different compiler from the bogus one.
846     # However, it has the same basename, so the bogon will be chosen
847     # first if we set CC to just the basename; use the full file name.
848     shift
849     set dummy "$ac_dir/$ac_word" "$@"
850     shift
851     ac_cv_prog_CC="$@"
852   fi
853 fi
854 fi
855 fi
856 CC="$ac_cv_prog_CC"
857 if test -n "$CC"; then
858   echo "$ac_t""$CC" 1>&6
859 else
860   echo "$ac_t""no" 1>&6
861 fi
862
863   if test -z "$CC"; then
864     case "`uname -s`" in
865     *win32* | *WIN32*)
866       # Extract the first word of "cl", so it can be a program name with args.
867 set dummy cl; ac_word=$2
868 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
869 echo "configure:870: checking for $ac_word" >&5
870 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
871   echo $ac_n "(cached) $ac_c" 1>&6
872 else
873   if test -n "$CC"; then
874   ac_cv_prog_CC="$CC" # Let the user override the test.
875 else
876   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
877   ac_dummy="$PATH"
878   for ac_dir in $ac_dummy; do
879     test -z "$ac_dir" && ac_dir=.
880     if test -f $ac_dir/$ac_word; then
881       ac_cv_prog_CC="cl"
882       break
883     fi
884   done
885   IFS="$ac_save_ifs"
886 fi
887 fi
888 CC="$ac_cv_prog_CC"
889 if test -n "$CC"; then
890   echo "$ac_t""$CC" 1>&6
891 else
892   echo "$ac_t""no" 1>&6
893 fi
894  ;;
895     esac
896   fi
897   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
898 fi
899
900 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
901 echo "configure:902: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
902
903 ac_ext=c
904 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
905 ac_cpp='$CPP $CPPFLAGS'
906 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
907 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
908 cross_compiling=$ac_cv_prog_cc_cross
909
910 cat > conftest.$ac_ext << EOF
911
912 #line 913 "configure"
913 #include "confdefs.h"
914
915 main(){return(0);}
916 EOF
917 if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
918   ac_cv_prog_cc_works=yes
919   # If we can't run a trivial program, we are probably using a cross compiler.
920   if (./conftest; exit) 2>/dev/null; then
921     ac_cv_prog_cc_cross=no
922   else
923     ac_cv_prog_cc_cross=yes
924   fi
925 else
926   echo "configure: failed program was:" >&5
927   cat conftest.$ac_ext >&5
928   ac_cv_prog_cc_works=no
929 fi
930 rm -fr conftest*
931 ac_ext=c
932 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
933 ac_cpp='$CPP $CPPFLAGS'
934 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
935 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
936 cross_compiling=$ac_cv_prog_cc_cross
937
938 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
939 if test $ac_cv_prog_cc_works = no; then
940   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
941 fi
942 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
943 echo "configure:944: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
944 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
945 cross_compiling=$ac_cv_prog_cc_cross
946
947 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
948 echo "configure:949: checking whether we are using GNU C" >&5
949 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
950   echo $ac_n "(cached) $ac_c" 1>&6
951 else
952   cat > conftest.c <<EOF
953 #ifdef __GNUC__
954   yes;
955 #endif
956 EOF
957 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
958   ac_cv_prog_gcc=yes
959 else
960   ac_cv_prog_gcc=no
961 fi
962 fi
963
964 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
965
966 if test $ac_cv_prog_gcc = yes; then
967   GCC=yes
968 else
969   GCC=
970 fi
971
972 ac_test_CFLAGS="${CFLAGS+set}"
973 ac_save_CFLAGS="$CFLAGS"
974 CFLAGS=
975 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
976 echo "configure:977: checking whether ${CC-cc} accepts -g" >&5
977 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   echo 'void f(){}' > conftest.c
981 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
982   ac_cv_prog_cc_g=yes
983 else
984   ac_cv_prog_cc_g=no
985 fi
986 rm -f conftest*
987
988 fi
989
990 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
991 if test "$ac_test_CFLAGS" = set; then
992   CFLAGS="$ac_save_CFLAGS"
993 elif test $ac_cv_prog_cc_g = yes; then
994   if test "$GCC" = yes; then
995     CFLAGS="-g -O2"
996   else
997     CFLAGS="-g"
998   fi
999 else
1000   if test "$GCC" = yes; then
1001     CFLAGS="-O2"
1002   else
1003     CFLAGS=
1004   fi
1005 fi
1006
1007 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1008 echo "configure:1009: checking how to run the C preprocessor" >&5
1009 # On Suns, sometimes $CPP names a directory.
1010 if test -n "$CPP" && test -d "$CPP"; then
1011   CPP=
1012 fi
1013 if test -z "$CPP"; then
1014 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1015   echo $ac_n "(cached) $ac_c" 1>&6
1016 else
1017     # This must be in double quotes, not single quotes, because CPP may get
1018   # substituted into the Makefile and "${CC-cc}" will confuse make.
1019   CPP="${CC-cc} -E"
1020   # On the NeXT, cc -E runs the code through the compiler's parser,
1021   # not just through cpp.
1022   cat > conftest.$ac_ext <<EOF
1023 #line 1024 "configure"
1024 #include "confdefs.h"
1025 #include <assert.h>
1026 Syntax Error
1027 EOF
1028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1029 { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1030 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1031 if test -z "$ac_err"; then
1032   :
1033 else
1034   echo "$ac_err" >&5
1035   echo "configure: failed program was:" >&5
1036   cat conftest.$ac_ext >&5
1037   rm -rf conftest*
1038   CPP="${CC-cc} -E -traditional-cpp"
1039   cat > conftest.$ac_ext <<EOF
1040 #line 1041 "configure"
1041 #include "confdefs.h"
1042 #include <assert.h>
1043 Syntax Error
1044 EOF
1045 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1046 { (eval echo configure:1047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1047 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1048 if test -z "$ac_err"; then
1049   :
1050 else
1051   echo "$ac_err" >&5
1052   echo "configure: failed program was:" >&5
1053   cat conftest.$ac_ext >&5
1054   rm -rf conftest*
1055   CPP="${CC-cc} -nologo -E"
1056   cat > conftest.$ac_ext <<EOF
1057 #line 1058 "configure"
1058 #include "confdefs.h"
1059 #include <assert.h>
1060 Syntax Error
1061 EOF
1062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1063 { (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1064 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1065 if test -z "$ac_err"; then
1066   :
1067 else
1068   echo "$ac_err" >&5
1069   echo "configure: failed program was:" >&5
1070   cat conftest.$ac_ext >&5
1071   rm -rf conftest*
1072   CPP=/lib/cpp
1073 fi
1074 rm -f conftest*
1075 fi
1076 rm -f conftest*
1077 fi
1078 rm -f conftest*
1079   ac_cv_prog_CPP="$CPP"
1080 fi
1081   CPP="$ac_cv_prog_CPP"
1082 else
1083   ac_cv_prog_CPP="$CPP"
1084 fi
1085 echo "$ac_t""$CPP" 1>&6
1086
1087 # Find a good install program.  We prefer a C program (faster),
1088 # so one script is as good as another.  But avoid the broken or
1089 # incompatible versions:
1090 # SysV /etc/install, /usr/sbin/install
1091 # SunOS /usr/etc/install
1092 # IRIX /sbin/install
1093 # AIX /bin/install
1094 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1095 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1096 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1097 # ./install, which can be erroneously created by make from ./install.sh.
1098 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1099 echo "configure:1100: checking for a BSD compatible install" >&5
1100 if test -z "$INSTALL"; then
1101 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1102   echo $ac_n "(cached) $ac_c" 1>&6
1103 else
1104     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1105   for ac_dir in $PATH; do
1106     # Account for people who put trailing slashes in PATH elements.
1107     case "$ac_dir/" in
1108     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1109     *)
1110       # OSF1 and SCO ODT 3.0 have their own names for install.
1111       # Don't use installbsd from OSF since it installs stuff as root
1112       # by default.
1113       for ac_prog in ginstall scoinst install; do
1114         if test -f $ac_dir/$ac_prog; then
1115           if test $ac_prog = install &&
1116             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1117             # AIX install.  It has an incompatible calling convention.
1118             :
1119           else
1120             ac_cv_path_install="$ac_dir/$ac_prog -c"
1121             break 2
1122           fi
1123         fi
1124       done
1125       ;;
1126     esac
1127   done
1128   IFS="$ac_save_IFS"
1129
1130 fi
1131   if test "${ac_cv_path_install+set}" = set; then
1132     INSTALL="$ac_cv_path_install"
1133   else
1134     # As a last resort, use the slow shell script.  We don't cache a
1135     # path for INSTALL within a source directory, because that will
1136     # break other packages using the cache if that directory is
1137     # removed, or if the path is relative.
1138     INSTALL="$ac_install_sh"
1139   fi
1140 fi
1141 echo "$ac_t""$INSTALL" 1>&6
1142
1143 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1144 # It thinks the first close brace ends the variable substitution.
1145 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1146
1147 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1148
1149 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1150
1151 # Extract the first word of "ranlib", so it can be a program name with args.
1152 set dummy ranlib; ac_word=$2
1153 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1154 echo "configure:1155: checking for $ac_word" >&5
1155 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1156   echo $ac_n "(cached) $ac_c" 1>&6
1157 else
1158   if test -n "$RANLIB"; then
1159   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1160 else
1161   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1162   ac_dummy="$PATH"
1163   for ac_dir in $ac_dummy; do
1164     test -z "$ac_dir" && ac_dir=.
1165     if test -f $ac_dir/$ac_word; then
1166       ac_cv_prog_RANLIB="ranlib"
1167       break
1168     fi
1169   done
1170   IFS="$ac_save_ifs"
1171   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1172 fi
1173 fi
1174 RANLIB="$ac_cv_prog_RANLIB"
1175 if test -n "$RANLIB"; then
1176   echo "$ac_t""$RANLIB" 1>&6
1177 else
1178   echo "$ac_t""no" 1>&6
1179 fi
1180
1181
1182
1183
1184 # Check whether --enable-yc or --disable-yc was given.
1185 if test "${enable_yc+set}" = set; then
1186   enableval="$enable_yc"
1187   :
1188 else
1189   enable_yc=yes
1190 fi
1191
1192 if test "$enable_yc" = "yes"; then
1193         ASNMODULE="z39.50"
1194         ILLMODULE="ill"
1195         ILLLIB=../ill/libill.a
1196         ASN_MAKEFILES="z39.50/Makefile ill/Makefile"
1197         cp -f include/yaz/z-proto.h include/yaz/proto.h
1198 else
1199         ILLMODULE=""
1200         ASNMODULE=asn
1201         ILLLIB=""
1202         ASN_MAKEFILES="asn/Makefile"
1203         cp -f include/yaz/prt-proto.h include/yaz/proto.h
1204 fi
1205 checkBoth=0
1206 echo $ac_n "checking for connect""... $ac_c" 1>&6
1207 echo "configure:1208: checking for connect" >&5
1208 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
1209   echo $ac_n "(cached) $ac_c" 1>&6
1210 else
1211   cat > conftest.$ac_ext <<EOF
1212 #line 1213 "configure"
1213 #include "confdefs.h"
1214 /* System header to define __stub macros and hopefully few prototypes,
1215     which can conflict with char connect(); below.  */
1216 #include <assert.h>
1217 /* Override any gcc2 internal prototype to avoid an error.  */
1218 /* We use char because int might match the return type of a gcc2
1219     builtin and then its argument prototype would still apply.  */
1220 char connect();
1221
1222 int main() {
1223
1224 /* The GNU C library defines this for functions which it implements
1225     to always fail with ENOSYS.  Some functions are actually named
1226     something starting with __ and the normal name is an alias.  */
1227 #if defined (__stub_connect) || defined (__stub___connect)
1228 choke me
1229 #else
1230 connect();
1231 #endif
1232
1233 ; return 0; }
1234 EOF
1235 if { (eval echo configure:1236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1236   rm -rf conftest*
1237   eval "ac_cv_func_connect=yes"
1238 else
1239   echo "configure: failed program was:" >&5
1240   cat conftest.$ac_ext >&5
1241   rm -rf conftest*
1242   eval "ac_cv_func_connect=no"
1243 fi
1244 rm -f conftest*
1245 fi
1246
1247 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
1248   echo "$ac_t""yes" 1>&6
1249   :
1250 else
1251   echo "$ac_t""no" 1>&6
1252 fi
1253
1254 if test "$ac_cv_func_connect" = "no"; then
1255         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
1256 echo "configure:1257: checking for main in -lsocket" >&5
1257 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
1258 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1259   echo $ac_n "(cached) $ac_c" 1>&6
1260 else
1261   ac_save_LIBS="$LIBS"
1262 LIBS="-lsocket  $LIBS"
1263 cat > conftest.$ac_ext <<EOF
1264 #line 1265 "configure"
1265 #include "confdefs.h"
1266
1267 int main() {
1268 main()
1269 ; return 0; }
1270 EOF
1271 if { (eval echo configure:1272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1272   rm -rf conftest*
1273   eval "ac_cv_lib_$ac_lib_var=yes"
1274 else
1275   echo "configure: failed program was:" >&5
1276   cat conftest.$ac_ext >&5
1277   rm -rf conftest*
1278   eval "ac_cv_lib_$ac_lib_var=no"
1279 fi
1280 rm -f conftest*
1281 LIBS="$ac_save_LIBS"
1282
1283 fi
1284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1285   echo "$ac_t""yes" 1>&6
1286   LIBS="$LIBS -lsocket"
1287 else
1288   echo "$ac_t""no" 1>&6
1289 checkBoth=1
1290 fi
1291
1292 fi
1293 if test "$checkBoth" = "1"; then
1294         oldLibs=$LIBS
1295         LIBS="$LIBS -lsocket -lnsl"
1296         echo $ac_n "checking for accept""... $ac_c" 1>&6
1297 echo "configure:1298: checking for accept" >&5
1298 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
1299   echo $ac_n "(cached) $ac_c" 1>&6
1300 else
1301   cat > conftest.$ac_ext <<EOF
1302 #line 1303 "configure"
1303 #include "confdefs.h"
1304 /* System header to define __stub macros and hopefully few prototypes,
1305     which can conflict with char accept(); below.  */
1306 #include <assert.h>
1307 /* Override any gcc2 internal prototype to avoid an error.  */
1308 /* We use char because int might match the return type of a gcc2
1309     builtin and then its argument prototype would still apply.  */
1310 char accept();
1311
1312 int main() {
1313
1314 /* The GNU C library defines this for functions which it implements
1315     to always fail with ENOSYS.  Some functions are actually named
1316     something starting with __ and the normal name is an alias.  */
1317 #if defined (__stub_accept) || defined (__stub___accept)
1318 choke me
1319 #else
1320 accept();
1321 #endif
1322
1323 ; return 0; }
1324 EOF
1325 if { (eval echo configure:1326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1326   rm -rf conftest*
1327   eval "ac_cv_func_accept=yes"
1328 else
1329   echo "configure: failed program was:" >&5
1330   cat conftest.$ac_ext >&5
1331   rm -rf conftest*
1332   eval "ac_cv_func_accept=no"
1333 fi
1334 rm -f conftest*
1335 fi
1336
1337 if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
1338   echo "$ac_t""yes" 1>&6
1339   :
1340 else
1341   echo "$ac_t""no" 1>&6
1342 LIBS=$oldLibs
1343 fi
1344
1345 fi
1346 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
1347 echo "configure:1348: checking for gethostbyname" >&5
1348 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
1349   echo $ac_n "(cached) $ac_c" 1>&6
1350 else
1351   cat > conftest.$ac_ext <<EOF
1352 #line 1353 "configure"
1353 #include "confdefs.h"
1354 /* System header to define __stub macros and hopefully few prototypes,
1355     which can conflict with char gethostbyname(); below.  */
1356 #include <assert.h>
1357 /* Override any gcc2 internal prototype to avoid an error.  */
1358 /* We use char because int might match the return type of a gcc2
1359     builtin and then its argument prototype would still apply.  */
1360 char gethostbyname();
1361
1362 int main() {
1363
1364 /* The GNU C library defines this for functions which it implements
1365     to always fail with ENOSYS.  Some functions are actually named
1366     something starting with __ and the normal name is an alias.  */
1367 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
1368 choke me
1369 #else
1370 gethostbyname();
1371 #endif
1372
1373 ; return 0; }
1374 EOF
1375 if { (eval echo configure:1376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1376   rm -rf conftest*
1377   eval "ac_cv_func_gethostbyname=yes"
1378 else
1379   echo "configure: failed program was:" >&5
1380   cat conftest.$ac_ext >&5
1381   rm -rf conftest*
1382   eval "ac_cv_func_gethostbyname=no"
1383 fi
1384 rm -f conftest*
1385 fi
1386
1387 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
1388   echo "$ac_t""yes" 1>&6
1389   :
1390 else
1391   echo "$ac_t""no" 1>&6
1392 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
1393 echo "configure:1394: checking for main in -lnsl" >&5
1394 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
1395 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1396   echo $ac_n "(cached) $ac_c" 1>&6
1397 else
1398   ac_save_LIBS="$LIBS"
1399 LIBS="-lnsl  $LIBS"
1400 cat > conftest.$ac_ext <<EOF
1401 #line 1402 "configure"
1402 #include "confdefs.h"
1403
1404 int main() {
1405 main()
1406 ; return 0; }
1407 EOF
1408 if { (eval echo configure:1409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1409   rm -rf conftest*
1410   eval "ac_cv_lib_$ac_lib_var=yes"
1411 else
1412   echo "configure: failed program was:" >&5
1413   cat conftest.$ac_ext >&5
1414   rm -rf conftest*
1415   eval "ac_cv_lib_$ac_lib_var=no"
1416 fi
1417 rm -f conftest*
1418 LIBS="$ac_save_LIBS"
1419
1420 fi
1421 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1422   echo "$ac_t""yes" 1>&6
1423   LIBS="$LIBS -lnsl"
1424 else
1425   echo "$ac_t""no" 1>&6
1426 fi
1427
1428 fi
1429
1430 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
1431 echo "configure:1432: checking for readline in -lreadline" >&5
1432 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
1433 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1434   echo $ac_n "(cached) $ac_c" 1>&6
1435 else
1436   ac_save_LIBS="$LIBS"
1437 LIBS="-lreadline  $LIBS"
1438 cat > conftest.$ac_ext <<EOF
1439 #line 1440 "configure"
1440 #include "confdefs.h"
1441 /* Override any gcc2 internal prototype to avoid an error.  */
1442 /* We use char because int might match the return type of a gcc2
1443     builtin and then its argument prototype would still apply.  */
1444 char readline();
1445
1446 int main() {
1447 readline()
1448 ; return 0; }
1449 EOF
1450 if { (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1451   rm -rf conftest*
1452   eval "ac_cv_lib_$ac_lib_var=yes"
1453 else
1454   echo "configure: failed program was:" >&5
1455   cat conftest.$ac_ext >&5
1456   rm -rf conftest*
1457   eval "ac_cv_lib_$ac_lib_var=no"
1458 fi
1459 rm -f conftest*
1460 LIBS="$ac_save_LIBS"
1461
1462 fi
1463 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1464   echo "$ac_t""yes" 1>&6
1465   LIBS="$LIBS -lreadline"
1466 else
1467   echo "$ac_t""no" 1>&6
1468 fi
1469
1470 if test "$ac_cv_lib_readline_readline" = "no"; then
1471         echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
1472 echo "configure:1473: checking for readline in -lreadline" >&5
1473 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
1474 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1475   echo $ac_n "(cached) $ac_c" 1>&6
1476 else
1477   ac_save_LIBS="$LIBS"
1478 LIBS="-lreadline  $LIBS"
1479 cat > conftest.$ac_ext <<EOF
1480 #line 1481 "configure"
1481 #include "confdefs.h"
1482 /* Override any gcc2 internal prototype to avoid an error.  */
1483 /* We use char because int might match the return type of a gcc2
1484     builtin and then its argument prototype would still apply.  */
1485 char readline();
1486
1487 int main() {
1488 readline()
1489 ; return 0; }
1490 EOF
1491 if { (eval echo configure:1492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1492   rm -rf conftest*
1493   eval "ac_cv_lib_$ac_lib_var=yes"
1494 else
1495   echo "configure: failed program was:" >&5
1496   cat conftest.$ac_ext >&5
1497   rm -rf conftest*
1498   eval "ac_cv_lib_$ac_lib_var=no"
1499 fi
1500 rm -f conftest*
1501 LIBS="$ac_save_LIBS"
1502
1503 fi
1504 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1505   echo "$ac_t""yes" 1>&6
1506   LIBS="$LIBS -lreadline -ltermcap"
1507 else
1508   echo "$ac_t""no" 1>&6
1509 fi
1510
1511 fi
1512 echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6
1513 echo "configure:1514: checking for add_history in -lhistory" >&5
1514 ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'`
1515 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1516   echo $ac_n "(cached) $ac_c" 1>&6
1517 else
1518   ac_save_LIBS="$LIBS"
1519 LIBS="-lhistory  $LIBS"
1520 cat > conftest.$ac_ext <<EOF
1521 #line 1522 "configure"
1522 #include "confdefs.h"
1523 /* Override any gcc2 internal prototype to avoid an error.  */
1524 /* We use char because int might match the return type of a gcc2
1525     builtin and then its argument prototype would still apply.  */
1526 char add_history();
1527
1528 int main() {
1529 add_history()
1530 ; return 0; }
1531 EOF
1532 if { (eval echo configure:1533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1533   rm -rf conftest*
1534   eval "ac_cv_lib_$ac_lib_var=yes"
1535 else
1536   echo "configure: failed program was:" >&5
1537   cat conftest.$ac_ext >&5
1538   rm -rf conftest*
1539   eval "ac_cv_lib_$ac_lib_var=no"
1540 fi
1541 rm -f conftest*
1542 LIBS="$ac_save_LIBS"
1543
1544 fi
1545 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1546   echo "$ac_t""yes" 1>&6
1547   LIBS="$LIBS -lhistory"
1548 else
1549   echo "$ac_t""no" 1>&6
1550 fi
1551
1552 if test "$ac_cv_lib_readline_readline" = "yes"; then
1553         for ac_hdr in readline/readline.h readline/history.h
1554 do
1555 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1556 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1557 echo "configure:1558: checking for $ac_hdr" >&5
1558 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1559   echo $ac_n "(cached) $ac_c" 1>&6
1560 else
1561   cat > conftest.$ac_ext <<EOF
1562 #line 1563 "configure"
1563 #include "confdefs.h"
1564 #include <$ac_hdr>
1565 EOF
1566 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1567 { (eval echo configure:1568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1568 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1569 if test -z "$ac_err"; then
1570   rm -rf conftest*
1571   eval "ac_cv_header_$ac_safe=yes"
1572 else
1573   echo "$ac_err" >&5
1574   echo "configure: failed program was:" >&5
1575   cat conftest.$ac_ext >&5
1576   rm -rf conftest*
1577   eval "ac_cv_header_$ac_safe=no"
1578 fi
1579 rm -f conftest*
1580 fi
1581 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1582   echo "$ac_t""yes" 1>&6
1583     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1584   cat >> confdefs.h <<EOF
1585 #define $ac_tr_hdr 1
1586 EOF
1587  
1588 else
1589   echo "$ac_t""no" 1>&6
1590 fi
1591 done
1592
1593 fi
1594 # Check whether --enable-tcpd or --disable-tcpd was given.
1595 if test "${enable_tcpd+set}" = set; then
1596   enableval="$enable_tcpd"
1597   :
1598 fi
1599
1600 if test "$enable_tcpd" = "yes"; then
1601         echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6
1602 echo "configure:1603: checking for working tcpd.h" >&5
1603         oldLibs=$LIBS
1604         LIBS="$LIBS -lwrap -lnsl"
1605         cat > conftest.$ac_ext <<EOF
1606 #line 1607 "configure"
1607 #include "confdefs.h"
1608 #include <syslog.h>
1609         #include <tcpd.h>
1610         int allow_severity = LOG_INFO;
1611         int deny_severity = LOG_WARNING;
1612 int main() {
1613 struct request_info request_info; int i;
1614         i = hosts_access(&request_info);
1615 ; return 0; }
1616 EOF
1617 if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1618   rm -rf conftest*
1619   tcpd_ok=1
1620 else
1621   echo "configure: failed program was:" >&5
1622   cat conftest.$ac_ext >&5
1623   rm -rf conftest*
1624   tcpd_ok=0
1625 fi
1626 rm -f conftest*
1627         if test "$tcpd_ok" = "0"; then
1628                 echo "$ac_t""no" 1>&6
1629                 LIBS=$oldLibs
1630         else
1631                 echo "$ac_t""yes" 1>&6
1632                 cat >> confdefs.h <<\EOF
1633 #define HAVE_TCPD_H 1
1634 EOF
1635
1636         fi
1637 fi
1638 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1639 echo "configure:1640: checking for ANSI C header files" >&5
1640 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1641   echo $ac_n "(cached) $ac_c" 1>&6
1642 else
1643   cat > conftest.$ac_ext <<EOF
1644 #line 1645 "configure"
1645 #include "confdefs.h"
1646 #include <stdlib.h>
1647 #include <stdarg.h>
1648 #include <string.h>
1649 #include <float.h>
1650 EOF
1651 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1652 { (eval echo configure:1653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1653 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1654 if test -z "$ac_err"; then
1655   rm -rf conftest*
1656   ac_cv_header_stdc=yes
1657 else
1658   echo "$ac_err" >&5
1659   echo "configure: failed program was:" >&5
1660   cat conftest.$ac_ext >&5
1661   rm -rf conftest*
1662   ac_cv_header_stdc=no
1663 fi
1664 rm -f conftest*
1665
1666 if test $ac_cv_header_stdc = yes; then
1667   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1668 cat > conftest.$ac_ext <<EOF
1669 #line 1670 "configure"
1670 #include "confdefs.h"
1671 #include <string.h>
1672 EOF
1673 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1674   egrep "memchr" >/dev/null 2>&1; then
1675   :
1676 else
1677   rm -rf conftest*
1678   ac_cv_header_stdc=no
1679 fi
1680 rm -f conftest*
1681
1682 fi
1683
1684 if test $ac_cv_header_stdc = yes; then
1685   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1686 cat > conftest.$ac_ext <<EOF
1687 #line 1688 "configure"
1688 #include "confdefs.h"
1689 #include <stdlib.h>
1690 EOF
1691 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1692   egrep "free" >/dev/null 2>&1; then
1693   :
1694 else
1695   rm -rf conftest*
1696   ac_cv_header_stdc=no
1697 fi
1698 rm -f conftest*
1699
1700 fi
1701
1702 if test $ac_cv_header_stdc = yes; then
1703   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1704 if test "$cross_compiling" = yes; then
1705   :
1706 else
1707   cat > conftest.$ac_ext <<EOF
1708 #line 1709 "configure"
1709 #include "confdefs.h"
1710 #include <ctype.h>
1711 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1712 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1713 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1714 int main () { int i; for (i = 0; i < 256; i++)
1715 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1716 exit (0); }
1717
1718 EOF
1719 if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1720 then
1721   :
1722 else
1723   echo "configure: failed program was:" >&5
1724   cat conftest.$ac_ext >&5
1725   rm -fr conftest*
1726   ac_cv_header_stdc=no
1727 fi
1728 rm -fr conftest*
1729 fi
1730
1731 fi
1732 fi
1733
1734 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1735 if test $ac_cv_header_stdc = yes; then
1736   cat >> confdefs.h <<\EOF
1737 #define STDC_HEADERS 1
1738 EOF
1739
1740 fi
1741
1742 if test "$ac_cv_header_stdc" = "no"; then
1743         echo "configure: warning: Your system doesn't seem to support ANSI C" 1>&2
1744 fi
1745 # Check whether --enable-threads or --disable-threads was given.
1746 if test "${enable_threads+set}" = set; then
1747   enableval="$enable_threads"
1748   :
1749 fi
1750
1751 if test "$enable_threads" = "yes"; then
1752         for ac_hdr in pthread.h threads.h
1753 do
1754 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1755 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1756 echo "configure:1757: checking for $ac_hdr" >&5
1757 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1758   echo $ac_n "(cached) $ac_c" 1>&6
1759 else
1760   cat > conftest.$ac_ext <<EOF
1761 #line 1762 "configure"
1762 #include "confdefs.h"
1763 #include <$ac_hdr>
1764 EOF
1765 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1766 { (eval echo configure:1767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1767 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1768 if test -z "$ac_err"; then
1769   rm -rf conftest*
1770   eval "ac_cv_header_$ac_safe=yes"
1771 else
1772   echo "$ac_err" >&5
1773   echo "configure: failed program was:" >&5
1774   cat conftest.$ac_ext >&5
1775   rm -rf conftest*
1776   eval "ac_cv_header_$ac_safe=no"
1777 fi
1778 rm -f conftest*
1779 fi
1780 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1781   echo "$ac_t""yes" 1>&6
1782     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1783   cat >> confdefs.h <<EOF
1784 #define $ac_tr_hdr 1
1785 EOF
1786  
1787 else
1788   echo "$ac_t""no" 1>&6
1789 fi
1790 done
1791
1792         echo $ac_n "checking for pthread_mutex_lock""... $ac_c" 1>&6
1793 echo "configure:1794: checking for pthread_mutex_lock" >&5
1794 if eval "test \"`echo '$''{'ac_cv_func_pthread_mutex_lock'+set}'`\" = set"; then
1795   echo $ac_n "(cached) $ac_c" 1>&6
1796 else
1797   cat > conftest.$ac_ext <<EOF
1798 #line 1799 "configure"
1799 #include "confdefs.h"
1800 /* System header to define __stub macros and hopefully few prototypes,
1801     which can conflict with char pthread_mutex_lock(); below.  */
1802 #include <assert.h>
1803 /* Override any gcc2 internal prototype to avoid an error.  */
1804 /* We use char because int might match the return type of a gcc2
1805     builtin and then its argument prototype would still apply.  */
1806 char pthread_mutex_lock();
1807
1808 int main() {
1809
1810 /* The GNU C library defines this for functions which it implements
1811     to always fail with ENOSYS.  Some functions are actually named
1812     something starting with __ and the normal name is an alias.  */
1813 #if defined (__stub_pthread_mutex_lock) || defined (__stub___pthread_mutex_lock)
1814 choke me
1815 #else
1816 pthread_mutex_lock();
1817 #endif
1818
1819 ; return 0; }
1820 EOF
1821 if { (eval echo configure:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1822   rm -rf conftest*
1823   eval "ac_cv_func_pthread_mutex_lock=yes"
1824 else
1825   echo "configure: failed program was:" >&5
1826   cat conftest.$ac_ext >&5
1827   rm -rf conftest*
1828   eval "ac_cv_func_pthread_mutex_lock=no"
1829 fi
1830 rm -f conftest*
1831 fi
1832
1833 if eval "test \"`echo '$ac_cv_func_'pthread_mutex_lock`\" = yes"; then
1834   echo "$ac_t""yes" 1>&6
1835   :
1836 else
1837   echo "$ac_t""no" 1>&6
1838 fi
1839
1840         if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
1841                 echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6
1842 echo "configure:1843: checking for main in -lpthread" >&5
1843 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'`
1844 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1845   echo $ac_n "(cached) $ac_c" 1>&6
1846 else
1847   ac_save_LIBS="$LIBS"
1848 LIBS="-lpthread  $LIBS"
1849 cat > conftest.$ac_ext <<EOF
1850 #line 1851 "configure"
1851 #include "confdefs.h"
1852
1853 int main() {
1854 main()
1855 ; return 0; }
1856 EOF
1857 if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1858   rm -rf conftest*
1859   eval "ac_cv_lib_$ac_lib_var=yes"
1860 else
1861   echo "configure: failed program was:" >&5
1862   cat conftest.$ac_ext >&5
1863   rm -rf conftest*
1864   eval "ac_cv_lib_$ac_lib_var=no"
1865 fi
1866 rm -f conftest*
1867 LIBS="$ac_save_LIBS"
1868
1869 fi
1870 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1871   echo "$ac_t""yes" 1>&6
1872     ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1873     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1874   cat >> confdefs.h <<EOF
1875 #define $ac_tr_lib 1
1876 EOF
1877
1878   LIBS="-lpthread $LIBS"
1879
1880 else
1881   echo "$ac_t""no" 1>&6
1882 fi
1883
1884         fi
1885         cat >> confdefs.h <<\EOF
1886 #define _REENTRANT 1
1887 EOF
1888
1889 fi
1890 YAZBIN_INSTALL="${bindir}"
1891 YAZTAB_INSTALL="${datadir}/tab"
1892 YAZLIB_INSTALL="-L${libdir} -lyaz $LIBS"
1893 YAZINC_INSTALL="-I${includedir}/yaz"
1894 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"
1895
1896 trap '' 1 2 15
1897 cat > confcache <<\EOF
1898 # This file is a shell script that caches the results of configure
1899 # tests run on this system so they can be shared between configure
1900 # scripts and configure runs.  It is not useful on other systems.
1901 # If it contains results you don't want to keep, you may remove or edit it.
1902 #
1903 # By default, configure uses ./config.cache as the cache file,
1904 # creating it if it does not exist already.  You can give configure
1905 # the --cache-file=FILE option to use a different cache file; that is
1906 # what configure does when it calls configure scripts in
1907 # subdirectories, so they share the cache.
1908 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1909 # config.status only pays attention to the cache file if you give it the
1910 # --recheck option to rerun configure.
1911 #
1912 EOF
1913 # The following way of writing the cache mishandles newlines in values,
1914 # but we know of no workaround that is simple, portable, and efficient.
1915 # So, don't put newlines in cache variables' values.
1916 # Ultrix sh set writes to stderr and can't be redirected directly,
1917 # and sets the high bit in the cache file unless we assign to the vars.
1918 (set) 2>&1 |
1919   case `(ac_space=' '; set | grep ac_space) 2>&1` in
1920   *ac_space=\ *)
1921     # `set' does not quote correctly, so add quotes (double-quote substitution
1922     # turns \\\\ into \\, and sed turns \\ into \).
1923     sed -n \
1924       -e "s/'/'\\\\''/g" \
1925       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
1926     ;;
1927   *)
1928     # `set' quotes correctly as required by POSIX, so do not add quotes.
1929     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
1930     ;;
1931   esac >> confcache
1932 if cmp -s $cache_file confcache; then
1933   :
1934 else
1935   if test -w $cache_file; then
1936     echo "updating cache $cache_file"
1937     cat confcache > $cache_file
1938   else
1939     echo "not updating unwritable cache $cache_file"
1940   fi
1941 fi
1942 rm -f confcache
1943
1944 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1945
1946 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1947 # Let make expand exec_prefix.
1948 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1949
1950 # Any assignment to VPATH causes Sun make to only execute
1951 # the first set of double-colon rules, so remove it if not needed.
1952 # If there is a colon in the path, we need to keep it.
1953 if test "x$srcdir" = x.; then
1954   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
1955 fi
1956
1957 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1958
1959 DEFS=-DHAVE_CONFIG_H
1960
1961 # Without the "./", some shells look in PATH for config.status.
1962 : ${CONFIG_STATUS=./config.status}
1963
1964 echo creating $CONFIG_STATUS
1965 rm -f $CONFIG_STATUS
1966 cat > $CONFIG_STATUS <<EOF
1967 #! /bin/sh
1968 # Generated automatically by configure.
1969 # Run this file to recreate the current configuration.
1970 # This directory was configured as follows,
1971 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1972 #
1973 # $0 $ac_configure_args
1974 #
1975 # Compiler output produced by configure, useful for debugging
1976 # configure, is in ./config.log if it exists.
1977
1978 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1979 for ac_option
1980 do
1981   case "\$ac_option" in
1982   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1983     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1984     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1985   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1986     echo "$CONFIG_STATUS generated by autoconf version 2.13"
1987     exit 0 ;;
1988   -help | --help | --hel | --he | --h)
1989     echo "\$ac_cs_usage"; exit 0 ;;
1990   *) echo "\$ac_cs_usage"; exit 1 ;;
1991   esac
1992 done
1993
1994 ac_given_srcdir=$srcdir
1995 ac_given_INSTALL="$INSTALL"
1996
1997 trap 'rm -fr `echo "Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile ill/Makefile zutil/Makefile comstack/Makefile ccl/Makefile tab/Makefile retrieval/Makefile server/Makefile include/Makefile include/yaz/Makefile lib/Makefile client/Makefile ztest/Makefile doc/Makefile include/yaz/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1998 EOF
1999 cat >> $CONFIG_STATUS <<EOF
2000
2001 # Protect against being on the right side of a sed subst in config.status.
2002 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2003  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2004 $ac_vpsub
2005 $extrasub
2006 s%@SHELL@%$SHELL%g
2007 s%@CFLAGS@%$CFLAGS%g
2008 s%@CPPFLAGS@%$CPPFLAGS%g
2009 s%@CXXFLAGS@%$CXXFLAGS%g
2010 s%@FFLAGS@%$FFLAGS%g
2011 s%@DEFS@%$DEFS%g
2012 s%@LDFLAGS@%$LDFLAGS%g
2013 s%@LIBS@%$LIBS%g
2014 s%@exec_prefix@%$exec_prefix%g
2015 s%@prefix@%$prefix%g
2016 s%@program_transform_name@%$program_transform_name%g
2017 s%@bindir@%$bindir%g
2018 s%@sbindir@%$sbindir%g
2019 s%@libexecdir@%$libexecdir%g
2020 s%@datadir@%$datadir%g
2021 s%@sysconfdir@%$sysconfdir%g
2022 s%@sharedstatedir@%$sharedstatedir%g
2023 s%@localstatedir@%$localstatedir%g
2024 s%@libdir@%$libdir%g
2025 s%@includedir@%$includedir%g
2026 s%@oldincludedir@%$oldincludedir%g
2027 s%@infodir@%$infodir%g
2028 s%@mandir@%$mandir%g
2029 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2030 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
2031 s%@INSTALL_DATA@%$INSTALL_DATA%g
2032 s%@PACKAGE@%$PACKAGE%g
2033 s%@VERSION@%$VERSION%g
2034 s%@ACLOCAL@%$ACLOCAL%g
2035 s%@AUTOCONF@%$AUTOCONF%g
2036 s%@AUTOMAKE@%$AUTOMAKE%g
2037 s%@AUTOHEADER@%$AUTOHEADER%g
2038 s%@MAKEINFO@%$MAKEINFO%g
2039 s%@SET_MAKE@%$SET_MAKE%g
2040 s%@CC@%$CC%g
2041 s%@CPP@%$CPP%g
2042 s%@RANLIB@%$RANLIB%g
2043 s%@ASNMODULE@%$ASNMODULE%g
2044 s%@ILLMODULE@%$ILLMODULE%g
2045 s%@ILLLIB@%$ILLLIB%g
2046 s%@SUBDIRS_VAR@%$SUBDIRS_VAR%g
2047
2048 CEOF
2049 EOF
2050
2051 cat >> $CONFIG_STATUS <<\EOF
2052
2053 # Split the substitutions into bite-sized pieces for seds with
2054 # small command number limits, like on Digital OSF/1 and HP-UX.
2055 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2056 ac_file=1 # Number of current file.
2057 ac_beg=1 # First line for current file.
2058 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2059 ac_more_lines=:
2060 ac_sed_cmds=""
2061 while $ac_more_lines; do
2062   if test $ac_beg -gt 1; then
2063     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2064   else
2065     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2066   fi
2067   if test ! -s conftest.s$ac_file; then
2068     ac_more_lines=false
2069     rm -f conftest.s$ac_file
2070   else
2071     if test -z "$ac_sed_cmds"; then
2072       ac_sed_cmds="sed -f conftest.s$ac_file"
2073     else
2074       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2075     fi
2076     ac_file=`expr $ac_file + 1`
2077     ac_beg=$ac_end
2078     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2079   fi
2080 done
2081 if test -z "$ac_sed_cmds"; then
2082   ac_sed_cmds=cat
2083 fi
2084 EOF
2085
2086 cat >> $CONFIG_STATUS <<EOF
2087
2088 CONFIG_FILES=\${CONFIG_FILES-"Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile ill/Makefile zutil/Makefile comstack/Makefile ccl/Makefile tab/Makefile retrieval/Makefile server/Makefile include/Makefile include/yaz/Makefile lib/Makefile client/Makefile ztest/Makefile doc/Makefile"}
2089 EOF
2090 cat >> $CONFIG_STATUS <<\EOF
2091 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2092   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2093   case "$ac_file" in
2094   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2095        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2096   *) ac_file_in="${ac_file}.in" ;;
2097   esac
2098
2099   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2100
2101   # Remove last slash and all that follows it.  Not all systems have dirname.
2102   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2103   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2104     # The file is in a subdirectory.
2105     test ! -d "$ac_dir" && mkdir "$ac_dir"
2106     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2107     # A "../" for each directory in $ac_dir_suffix.
2108     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2109   else
2110     ac_dir_suffix= ac_dots=
2111   fi
2112
2113   case "$ac_given_srcdir" in
2114   .)  srcdir=.
2115       if test -z "$ac_dots"; then top_srcdir=.
2116       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2117   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2118   *) # Relative path.
2119     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2120     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2121   esac
2122
2123   case "$ac_given_INSTALL" in
2124   [/$]*) INSTALL="$ac_given_INSTALL" ;;
2125   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2126   esac
2127
2128   echo creating "$ac_file"
2129   rm -f "$ac_file"
2130   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2131   case "$ac_file" in
2132   *Makefile*) ac_comsub="1i\\
2133 # $configure_input" ;;
2134   *) ac_comsub= ;;
2135   esac
2136
2137   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2138   sed -e "$ac_comsub
2139 s%@configure_input@%$configure_input%g
2140 s%@srcdir@%$srcdir%g
2141 s%@top_srcdir@%$top_srcdir%g
2142 s%@INSTALL@%$INSTALL%g
2143 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2144 fi; done
2145 rm -f conftest.s*
2146
2147 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2148 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2149 #
2150 # ac_d sets the value in "#define NAME VALUE" lines.
2151 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2152 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2153 ac_dC='\3'
2154 ac_dD='%g'
2155 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2156 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2157 ac_uB='\([      ]\)%\1#\2define\3'
2158 ac_uC=' '
2159 ac_uD='\4%g'
2160 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2161 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2162 ac_eB='$%\1#\2define\3'
2163 ac_eC=' '
2164 ac_eD='%g'
2165
2166 if test "${CONFIG_HEADERS+set}" != set; then
2167 EOF
2168 cat >> $CONFIG_STATUS <<EOF
2169   CONFIG_HEADERS="include/yaz/config.h"
2170 EOF
2171 cat >> $CONFIG_STATUS <<\EOF
2172 fi
2173 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2174   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2175   case "$ac_file" in
2176   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2177        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2178   *) ac_file_in="${ac_file}.in" ;;
2179   esac
2180
2181   echo creating $ac_file
2182
2183   rm -f conftest.frag conftest.in conftest.out
2184   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2185   cat $ac_file_inputs > conftest.in
2186
2187 EOF
2188
2189 # Transform confdefs.h into a sed script conftest.vals that substitutes
2190 # the proper values into config.h.in to produce config.h.  And first:
2191 # Protect against being on the right side of a sed subst in config.status.
2192 # Protect against being in an unquoted here document in config.status.
2193 rm -f conftest.vals
2194 cat > conftest.hdr <<\EOF
2195 s/[\\&%]/\\&/g
2196 s%[\\$`]%\\&%g
2197 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2198 s%ac_d%ac_u%gp
2199 s%ac_u%ac_e%gp
2200 EOF
2201 sed -n -f conftest.hdr confdefs.h > conftest.vals
2202 rm -f conftest.hdr
2203
2204 # This sed command replaces #undef with comments.  This is necessary, for
2205 # example, in the case of _POSIX_SOURCE, which is predefined and required
2206 # on some systems where configure will not decide to define it.
2207 cat >> conftest.vals <<\EOF
2208 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2209 EOF
2210
2211 # Break up conftest.vals because some shells have a limit on
2212 # the size of here documents, and old seds have small limits too.
2213
2214 rm -f conftest.tail
2215 while :
2216 do
2217   ac_lines=`grep -c . conftest.vals`
2218   # grep -c gives empty output for an empty file on some AIX systems.
2219   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2220   # Write a limited-size here document to conftest.frag.
2221   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2222   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2223   echo 'CEOF
2224   sed -f conftest.frag conftest.in > conftest.out
2225   rm -f conftest.in
2226   mv conftest.out conftest.in
2227 ' >> $CONFIG_STATUS
2228   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2229   rm -f conftest.vals
2230   mv conftest.tail conftest.vals
2231 done
2232 rm -f conftest.vals
2233
2234 cat >> $CONFIG_STATUS <<\EOF
2235   rm -f conftest.frag conftest.h
2236   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2237   cat conftest.in >> conftest.h
2238   rm -f conftest.in
2239   if cmp -s $ac_file conftest.h 2>/dev/null; then
2240     echo "$ac_file is unchanged"
2241     rm -f conftest.h
2242   else
2243     # Remove last slash and all that follows it.  Not all systems have dirname.
2244       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2245       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2246       # The file is in a subdirectory.
2247       test ! -d "$ac_dir" && mkdir "$ac_dir"
2248     fi
2249     rm -f $ac_file
2250     mv conftest.h $ac_file
2251   fi
2252 fi; done
2253
2254 EOF
2255 cat >> $CONFIG_STATUS <<EOF
2256
2257
2258 EOF
2259 cat >> $CONFIG_STATUS <<\EOF
2260 test -z "$CONFIG_HEADERS" || echo timestamp > include/yaz/stamp-h
2261
2262 exit 0
2263 EOF
2264 chmod +x $CONFIG_STATUS
2265 rm -fr confdefs* $ac_clean_files
2266 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2267