cf10db7056d314d393cf40e717d2fc8d045d9076
[ir-tcl-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.7 
5 # Copyright (C) 1992, 1993, 1994 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-yazdir           Yaz directory"
16 ac_help="$ac_help
17   --with-mosidir          MOSI directory"
18 ac_help="$ac_help
19   --with-x                use the X Window System"
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
59 ac_prev=
60 for ac_option
61 do
62
63   # If the previous option needs an argument, assign it.
64   if test -n "$ac_prev"; then
65     eval "$ac_prev=\$ac_option"
66     ac_prev=
67     continue
68   fi
69
70   case "$ac_option" in
71   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
72   *) ac_optarg= ;;
73   esac
74
75   # Accept the important Cygnus configure options, so we can diagnose typos.
76
77   case "$ac_option" in
78
79   -bindir | --bindir | --bindi | --bind | --bin | --bi)
80     ac_prev=bindir ;;
81   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
82     bindir="$ac_optarg" ;;
83
84   -build | --build | --buil | --bui | --bu)
85     ac_prev=build ;;
86   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
87     build="$ac_optarg" ;;
88
89   -cache-file | --cache-file | --cache-fil | --cache-fi \
90   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
91     ac_prev=cache_file ;;
92   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
93   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
94     cache_file="$ac_optarg" ;;
95
96   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
97     ac_prev=datadir ;;
98   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
99   | --da=*)
100     datadir="$ac_optarg" ;;
101
102   -disable-* | --disable-*)
103     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
104     # Reject names that are not valid shell variable names.
105     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
106       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
107     fi
108     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
109     eval "enable_${ac_feature}=no" ;;
110
111   -enable-* | --enable-*)
112     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
113     # Reject names that are not valid shell variable names.
114     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
115       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
116     fi
117     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
118     case "$ac_option" in
119       *=*) ;;
120       *) ac_optarg=yes ;;
121     esac
122     eval "enable_${ac_feature}='$ac_optarg'" ;;
123
124   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
125   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
126   | --exec | --exe | --ex)
127     ac_prev=exec_prefix ;;
128   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
129   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
130   | --exec=* | --exe=* | --ex=*)
131     exec_prefix="$ac_optarg" ;;
132
133   -gas | --gas | --ga | --g)
134     # Obsolete; use --with-gas.
135     with_gas=yes ;;
136
137   -help | --help | --hel | --he)
138     # Omit some internal or obsolete options to make the list less imposing.
139     # This message is too long to be a string in the A/UX 3.1 sh.
140     cat << EOF
141 Usage: configure [options] [host]
142 Options: [defaults in brackets after descriptions]
143 Configuration:
144   --cache-file=FILE       cache test results in FILE
145   --help                  print this message
146   --no-create             do not create output files
147   --quiet, --silent       do not print \`checking...' messages
148   --version               print the version of autoconf that created configure
149 Directory and file names:
150   --prefix=PREFIX         install architecture-independent files in PREFIX
151                           [$ac_default_prefix]
152   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
153                           [same as prefix]
154   --bindir=DIR            user executables in DIR [EPREFIX/bin]
155   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
156   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
157   --datadir=DIR           read-only architecture-independent data in DIR
158                           [PREFIX/share]
159   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
160   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
161                           [PREFIX/com]
162   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
163   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
164   --includedir=DIR        C header files in DIR [PREFIX/include]
165   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
166   --infodir=DIR           info documentation in DIR [PREFIX/info]
167   --mandir=DIR            man documentation in DIR [PREFIX/man]
168   --srcdir=DIR            find the sources in DIR [configure dir or ..]
169   --program-prefix=PREFIX prepend PREFIX to installed program names
170   --program-suffix=SUFFIX append SUFFIX to installed program names
171   --program-transform-name=PROGRAM
172                           run sed PROGRAM on installed program names
173 EOF
174     cat << EOF
175 Host type:
176   --build=BUILD           configure for building on BUILD [BUILD=HOST]
177   --host=HOST             configure for HOST [guessed]
178   --target=TARGET         configure for TARGET [TARGET=HOST]
179 Features and packages:
180   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
181   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
182   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
183   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
184   --x-includes=DIR        X include files are in DIR
185   --x-libraries=DIR       X library files are in DIR
186 EOF
187     if test -n "$ac_help"; then
188       echo "--enable and --with options recognized:$ac_help"
189     fi
190     exit 0 ;;
191
192   -host | --host | --hos | --ho)
193     ac_prev=host ;;
194   -host=* | --host=* | --hos=* | --ho=*)
195     host="$ac_optarg" ;;
196
197   -includedir | --includedir | --includedi | --included | --include \
198   | --includ | --inclu | --incl | --inc)
199     ac_prev=includedir ;;
200   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
201   | --includ=* | --inclu=* | --incl=* | --inc=*)
202     includedir="$ac_optarg" ;;
203
204   -infodir | --infodir | --infodi | --infod | --info | --inf)
205     ac_prev=infodir ;;
206   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
207     infodir="$ac_optarg" ;;
208
209   -libdir | --libdir | --libdi | --libd)
210     ac_prev=libdir ;;
211   -libdir=* | --libdir=* | --libdi=* | --libd=*)
212     libdir="$ac_optarg" ;;
213
214   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
215   | --libexe | --libex | --libe)
216     ac_prev=libexecdir ;;
217   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
218   | --libexe=* | --libex=* | --libe=*)
219     libexecdir="$ac_optarg" ;;
220
221   -localstatedir | --localstatedir | --localstatedi | --localstated \
222   | --localstate | --localstat | --localsta | --localst \
223   | --locals | --local | --loca | --loc | --lo)
224     ac_prev=localstatedir ;;
225   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
226   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
227   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
228     localstatedir="$ac_optarg" ;;
229
230   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
231     ac_prev=mandir ;;
232   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
233     mandir="$ac_optarg" ;;
234
235   -nfp | --nfp | --nf)
236     # Obsolete; use --without-fp.
237     with_fp=no ;;
238
239   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
240   | --no-cr | --no-c)
241     no_create=yes ;;
242
243   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
244   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
245     no_recursion=yes ;;
246
247   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
248   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
249   | --oldin | --oldi | --old | --ol | --o)
250     ac_prev=oldincludedir ;;
251   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
252   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
253   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
254     oldincludedir="$ac_optarg" ;;
255
256   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
257     ac_prev=prefix ;;
258   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
259     prefix="$ac_optarg" ;;
260
261   -program-prefix | --program-prefix | --program-prefi | --program-pref \
262   | --program-pre | --program-pr | --program-p)
263     ac_prev=program_prefix ;;
264   -program-prefix=* | --program-prefix=* | --program-prefi=* \
265   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
266     program_prefix="$ac_optarg" ;;
267
268   -program-suffix | --program-suffix | --program-suffi | --program-suff \
269   | --program-suf | --program-su | --program-s)
270     ac_prev=program_suffix ;;
271   -program-suffix=* | --program-suffix=* | --program-suffi=* \
272   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
273     program_suffix="$ac_optarg" ;;
274
275   -program-transform-name | --program-transform-name \
276   | --program-transform-nam | --program-transform-na \
277   | --program-transform-n | --program-transform- \
278   | --program-transform | --program-transfor \
279   | --program-transfo | --program-transf \
280   | --program-trans | --program-tran \
281   | --progr-tra | --program-tr | --program-t)
282     ac_prev=program_transform_name ;;
283   -program-transform-name=* | --program-transform-name=* \
284   | --program-transform-nam=* | --program-transform-na=* \
285   | --program-transform-n=* | --program-transform-=* \
286   | --program-transform=* | --program-transfor=* \
287   | --program-transfo=* | --program-transf=* \
288   | --program-trans=* | --program-tran=* \
289   | --progr-tra=* | --program-tr=* | --program-t=*)
290     program_transform_name="$ac_optarg" ;;
291
292   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
293   | -silent | --silent | --silen | --sile | --sil)
294     silent=yes ;;
295
296   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
297     ac_prev=sbindir ;;
298   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
299   | --sbi=* | --sb=*)
300     sbindir="$ac_optarg" ;;
301
302   -sharedstatedir | --sharedstatedir | --sharedstatedi \
303   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
304   | --sharedst | --shareds | --shared | --share | --shar \
305   | --sha | --sh)
306     ac_prev=sharedstatedir ;;
307   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
308   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
309   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
310   | --sha=* | --sh=*)
311     sharedstatedir="$ac_optarg" ;;
312
313   -site | --site | --sit)
314     ac_prev=site ;;
315   -site=* | --site=* | --sit=*)
316     site="$ac_optarg" ;;
317
318   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
319     ac_prev=srcdir ;;
320   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
321     srcdir="$ac_optarg" ;;
322
323   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
324   | --syscon | --sysco | --sysc | --sys | --sy)
325     ac_prev=sysconfdir ;;
326   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
327   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
328     sysconfdir="$ac_optarg" ;;
329
330   -target | --target | --targe | --targ | --tar | --ta | --t)
331     ac_prev=target ;;
332   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
333     target="$ac_optarg" ;;
334
335   -v | -verbose | --verbose | --verbos | --verbo | --verb)
336     verbose=yes ;;
337
338   -version | --version | --versio | --versi | --vers)
339     echo "configure generated by autoconf version 2.7"
340     exit 0 ;;
341
342   -with-* | --with-*)
343     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
344     # Reject names that are not valid shell variable names.
345     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
346       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
347     fi
348     ac_package=`echo $ac_package| sed 's/-/_/g'`
349     case "$ac_option" in
350       *=*) ;;
351       *) ac_optarg=yes ;;
352     esac
353     eval "with_${ac_package}='$ac_optarg'" ;;
354
355   -without-* | --without-*)
356     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
357     # Reject names that are not valid shell variable names.
358     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
359       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
360     fi
361     ac_package=`echo $ac_package| sed 's/-/_/g'`
362     eval "with_${ac_package}=no" ;;
363
364   --x)
365     # Obsolete; use --with-x.
366     with_x=yes ;;
367
368   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
369   | --x-incl | --x-inc | --x-in | --x-i)
370     ac_prev=x_includes ;;
371   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
372   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
373     x_includes="$ac_optarg" ;;
374
375   -x-libraries | --x-libraries | --x-librarie | --x-librari \
376   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
377     ac_prev=x_libraries ;;
378   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
379   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
380     x_libraries="$ac_optarg" ;;
381
382   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
383     ;;
384
385   *)
386     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
387       echo "configure: warning: $ac_option: invalid host type" 1>&2
388     fi
389     if test "x$nonopt" != xNONE; then
390       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
391     fi
392     nonopt="$ac_option"
393     ;;
394
395   esac
396 done
397
398 if test -n "$ac_prev"; then
399   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
400 fi
401
402 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
403
404 # File descriptor usage:
405 # 0 standard input
406 # 1 file creation
407 # 2 errors and warnings
408 # 3 some systems may open it to /dev/tty
409 # 4 used on the Kubota Titan
410 # 6 checking for... messages and results
411 # 5 compiler messages saved in config.log
412 if test "$silent" = yes; then
413   exec 6>/dev/null
414 else
415   exec 6>&1
416 fi
417 exec 5>./config.log
418
419 echo "\
420 This file contains any messages produced by compilers while
421 running configure, to aid debugging if configure makes a mistake.
422 " 1>&5
423
424 # Strip out --no-create and --no-recursion so they do not pile up.
425 # Also quote any args containing shell metacharacters.
426 ac_configure_args=
427 for ac_arg
428 do
429   case "$ac_arg" in
430   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
431   | --no-cr | --no-c) ;;
432   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
433   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
434   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
435   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
436   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
437   esac
438 done
439
440 # NLS nuisances.
441 # Only set LANG and LC_ALL to C if already set.
442 # These must not be set unconditionally because not all systems understand
443 # e.g. LANG=C (notably SCO).
444 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
445 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
446
447 # confdefs.h avoids OS command line length limits that DEFS can exceed.
448 rm -rf conftest* confdefs.h
449 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
450 echo > confdefs.h
451
452 # A filename unique to this package, relative to the directory that
453 # configure is in, which we can look for to find out if srcdir is correct.
454 ac_unique_file=ir-tcl.h
455
456 # Find the source files, if location was not specified.
457 if test -z "$srcdir"; then
458   ac_srcdir_defaulted=yes
459   # Try the directory containing this script, then its parent.
460   ac_prog=$0
461   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
462   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
463   srcdir=$ac_confdir
464   if test ! -r $srcdir/$ac_unique_file; then
465     srcdir=..
466   fi
467 else
468   ac_srcdir_defaulted=no
469 fi
470 if test ! -r $srcdir/$ac_unique_file; then
471   if test "$ac_srcdir_defaulted" = yes; then
472     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
473   else
474     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
475   fi
476 fi
477 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
478
479 # Prefer explicitly selected file to automatically selected ones.
480 if test -z "$CONFIG_SITE"; then
481   if test "x$prefix" != xNONE; then
482     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
483   else
484     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
485   fi
486 fi
487 for ac_site_file in $CONFIG_SITE; do
488   if test -r "$ac_site_file"; then
489     echo "loading site script $ac_site_file"
490     . "$ac_site_file"
491   fi
492 done
493
494 if test -r "$cache_file"; then
495   echo "loading cache $cache_file"
496   . $cache_file
497 else
498   echo "creating cache $cache_file"
499   > $cache_file
500 fi
501
502 ac_ext=c
503 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
504 ac_cpp='echo $CPP $CPPFLAGS 1>&5;
505 $CPP $CPPFLAGS'
506 ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5;
507 ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
508 ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5;
509 ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
510
511 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
512   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
513   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
514     ac_n= ac_c='
515 ' ac_t='        '
516   else
517     ac_n=-n ac_c= ac_t=
518   fi
519 else
520   ac_n= ac_c='\c' ac_t=
521 fi
522
523
524 CC=${CC-cc}
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540 ac_aux_dir=
541 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
542   if test -f $ac_dir/install-sh; then
543     ac_aux_dir=$ac_dir
544     ac_install_sh="$ac_aux_dir/install-sh -c"
545     break
546   elif test -f $ac_dir/install.sh; then
547     ac_aux_dir=$ac_dir
548     ac_install_sh="$ac_aux_dir/install.sh -c"
549     break
550   fi
551 done
552 if test -z "$ac_aux_dir"; then
553   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
554 fi
555 ac_config_guess=$ac_aux_dir/config.guess
556 ac_config_sub=$ac_aux_dir/config.sub
557 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
558
559 # Find a good install program.  We prefer a C program (faster),
560 # so one script is as good as another.  But avoid the broken or
561 # incompatible versions:
562 # SysV /etc/install, /usr/sbin/install
563 # SunOS /usr/etc/install
564 # IRIX /sbin/install
565 # AIX /bin/install
566 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
567 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
568 # ./install, which can be erroneously created by make from ./install.sh.
569 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
570 if test -z "$INSTALL"; then
571 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
572   echo $ac_n "(cached) $ac_c" 1>&6
573 else
574     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
575   for ac_dir in $PATH; do
576     # Account for people who put trailing slashes in PATH elements.
577     case "$ac_dir/" in
578     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
579     *)
580       # OSF1 and SCO ODT 3.0 have their own names for install.
581       for ac_prog in ginstall installbsd scoinst install; do
582         if test -f $ac_dir/$ac_prog; then
583           if test $ac_prog = install &&
584             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
585             # AIX install.  It has an incompatible calling convention.
586             # OSF/1 installbsd also uses dspmsg, but is usable.
587             :
588           else
589             ac_cv_path_install="$ac_dir/$ac_prog -c"
590             break 2
591           fi
592         fi
593       done
594       ;;
595     esac
596   done
597   IFS="$ac_save_ifs"
598
599 fi
600   if test "${ac_cv_path_install+set}" = set; then
601     INSTALL="$ac_cv_path_install"
602   else
603     # As a last resort, use the slow shell script.  We don't cache a
604     # path for INSTALL within a source directory, because that will
605     # break other packages using the cache if that directory is
606     # removed, or if the path is relative.
607     INSTALL="$ac_install_sh"
608   fi
609 fi
610 echo "$ac_t""$INSTALL" 1>&6
611
612 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
613 # It thinks the first close brace ends the variable substitution.
614 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
615
616 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
617
618 if test "x$prefix" = xNONE; then
619 echo $ac_n "checking for prefix by ""... $ac_c" 1>&6
620 # Extract the first word of "tclsh", so it can be a program name with args.
621 set dummy tclsh; ac_word=$2
622 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
623 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
624   echo $ac_n "(cached) $ac_c" 1>&6
625 else
626   case "$TCLSH" in
627   /*)
628   ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path.
629   ;;
630   *)
631   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
632   for ac_dir in $PATH; do
633     test -z "$ac_dir" && ac_dir=.
634     if test -f $ac_dir/$ac_word; then
635       ac_cv_path_TCLSH="$ac_dir/$ac_word"
636       break
637     fi
638   done
639   IFS="$ac_save_ifs"
640   ;;
641 esac
642 fi
643 TCLSH="$ac_cv_path_TCLSH"
644 if test -n "$TCLSH"; then
645   echo "$ac_t""$TCLSH" 1>&6
646 else
647   echo "$ac_t""no" 1>&6
648 fi
649
650   if test -n "$ac_cv_path_TCLSH"; then
651     prefix=`echo $ac_cv_path_TCLSH|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
652   fi
653 fi
654
655 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
656 # On Suns, sometimes $CPP names a directory.
657 if test -n "$CPP" && test -d "$CPP"; then
658   CPP=
659 fi
660 if test -z "$CPP"; then
661 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
662   echo $ac_n "(cached) $ac_c" 1>&6
663 else
664     # This must be in double quotes, not single quotes, because CPP may get
665   # substituted into the Makefile and "${CC-cc}" will confuse make.
666   CPP="${CC-cc} -E"
667   # On the NeXT, cc -E runs the code through the compiler's parser,
668   # not just through cpp.
669   cat > conftest.$ac_ext <<EOF
670 #line 671 "configure"
671 #include "confdefs.h"
672 #include <assert.h>
673 Syntax Error
674 EOF
675 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
676 ac_err=`grep -v '^ *+' conftest.out`
677 if test -z "$ac_err"; then
678   :
679 else
680   echo "$ac_err" >&5
681   rm -rf conftest*
682   CPP="${CC-cc} -E -traditional-cpp"
683   cat > conftest.$ac_ext <<EOF
684 #line 685 "configure"
685 #include "confdefs.h"
686 #include <assert.h>
687 Syntax Error
688 EOF
689 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
690 ac_err=`grep -v '^ *+' conftest.out`
691 if test -z "$ac_err"; then
692   :
693 else
694   echo "$ac_err" >&5
695   rm -rf conftest*
696   CPP=/lib/cpp
697 fi
698 rm -f conftest*
699 fi
700 rm -f conftest*
701   ac_cv_prog_CPP="$CPP"
702 fi
703   CPP="$ac_cv_prog_CPP"
704 else
705   ac_cv_prog_CPP="$CPP"
706 fi
707 echo "$ac_t""$CPP" 1>&6
708
709 # If we cannot run a trivial program, we must be cross compiling.
710 echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
711 if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
712   echo $ac_n "(cached) $ac_c" 1>&6
713 else
714   if test "$cross_compiling" = yes; then
715   ac_cv_c_cross=yes
716 else
717 cat > conftest.$ac_ext <<EOF
718 #line 719 "configure"
719 #include "confdefs.h"
720 main(){return(0);}
721 EOF
722 eval $ac_link
723 if test -s conftest && (./conftest; exit) 2>/dev/null; then
724   ac_cv_c_cross=no
725 else
726   ac_cv_c_cross=yes
727 fi
728 fi
729 rm -fr conftest*
730 fi
731
732 echo "$ac_t""$ac_cv_c_cross" 1>&6
733 cross_compiling=$ac_cv_c_cross
734
735 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
736 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
737   echo $ac_n "(cached) $ac_c" 1>&6
738 else
739   cat > conftest.$ac_ext <<EOF
740 #line 741 "configure"
741 #include "confdefs.h"
742 #include <stdlib.h>
743 #include <stdarg.h>
744 #include <string.h>
745 #include <float.h>
746 EOF
747 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
748 ac_err=`grep -v '^ *+' conftest.out`
749 if test -z "$ac_err"; then
750   rm -rf conftest*
751   ac_cv_header_stdc=yes
752 else
753   echo "$ac_err" >&5
754   rm -rf conftest*
755   ac_cv_header_stdc=no
756 fi
757 rm -f conftest*
758
759 if test $ac_cv_header_stdc = yes; then
760   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
761 cat > conftest.$ac_ext <<EOF
762 #line 763 "configure"
763 #include "confdefs.h"
764 #include <string.h>
765 EOF
766 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
767   egrep "memchr" >/dev/null 2>&1; then
768   :
769 else
770   rm -rf conftest*
771   ac_cv_header_stdc=no
772 fi
773 rm -f conftest*
774
775 fi
776
777 if test $ac_cv_header_stdc = yes; then
778   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
779 cat > conftest.$ac_ext <<EOF
780 #line 781 "configure"
781 #include "confdefs.h"
782 #include <stdlib.h>
783 EOF
784 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
785   egrep "free" >/dev/null 2>&1; then
786   :
787 else
788   rm -rf conftest*
789   ac_cv_header_stdc=no
790 fi
791 rm -f conftest*
792
793 fi
794
795 if test $ac_cv_header_stdc = yes; then
796   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
797 if test "$cross_compiling" = yes; then
798   :
799 else
800 cat > conftest.$ac_ext <<EOF
801 #line 802 "configure"
802 #include "confdefs.h"
803 #include <ctype.h>
804 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
805 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
806 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
807 int main () { int i; for (i = 0; i < 256; i++)
808 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
809 exit (0); }
810
811 EOF
812 eval $ac_link
813 if test -s conftest && (./conftest; exit) 2>/dev/null; then
814   :
815 else
816   ac_cv_header_stdc=no
817 fi
818 fi
819 rm -fr conftest*
820 fi
821 fi
822
823 echo "$ac_t""$ac_cv_header_stdc" 1>&6
824 if test $ac_cv_header_stdc = yes; then
825   cat >> confdefs.h <<\EOF
826 #define STDC_HEADERS 1
827 EOF
828
829 fi
830
831 if test "$ac_cv_header_stdc" = no; then
832         echo "configure: warning: Your system doesn't seem to support ANSI C" 1>&2
833 fi
834 echo $ac_n "checking for YAZ directory""... $ac_c" 1>&6
835 # Check whether --with-yazdir or --without-yazdir was given.
836 if test "${with_yazdir+set}" = set; then
837   withval="$with_yazdir"
838   YAZDIR=$withval
839 fi
840
841 if test "$YAZDIR" = "yes"; then
842         YAZDIR="../yaz-1.2"
843 elif test "$YAZDIR" = ""; then
844         YAZDIR=../yaz
845         for i in ../yaz* ../yaz; do
846             if test -d $i; then
847                 YAZDIR=$i
848             fi
849         done
850 fi
851 if test ! -d $YAZDIR; then
852         echo "configure: warning: YAZ directory ${YAZDIR} doesn't exist" 1>&2
853 else
854         echo "$ac_t""$YAZDIR" 1>&6
855 fi
856 echo $ac_n "checking for MOSI""... $ac_c" 1>&6
857 # Check whether --with-mosidir or --without-mosidir was given.
858 if test "${with_mosidir+set}" = set; then
859   withval="$with_mosidir"
860   MOSIDIR=$withval
861 fi
862
863 if test "$MOSIDIR" = "yes"; then
864         MOSIDIR="../xtimosi/src"
865 elif test "$MOSIDIR" = ""; then
866         MOSIDIR="../xtimosi/src"
867 fi
868 if test -r ${YAZDIR}/lib/librfc.a; then
869         MOSI=1
870         MOSIDIR=$MOSIDIR
871         MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
872         MOSIINC='-I$(MOSIDIR)'
873         MOSITELL=yes
874 else
875         MOSI=0
876         MOSIDIR=$MOSIDIR
877         MOSILIB='# $(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a'
878         MOSIINC='# -I$(MOSIDIR)'
879         MOSITELL=no
880 fi
881 echo "$ac_t""$MOSITELL" 1>&6
882 if test "x$prefix" = xNONE; then
883         tryprefix=/usr/local
884 else
885         tryprefix=${prefix}
886 fi
887 if test -r ${tryprefix}/lib/tclConfig.sh; then
888         echo $ac_n "checking for Tcl""... $ac_c" 1>&6
889         source ${tryprefix}/lib/tclConfig.sh
890         TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}"
891         TCLINC=-I${TCL_PREFIX}/include
892         RANLIB=$TCL_RANLIB
893         SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
894         SHLIB_LD=$TCL_SHLIB_LD
895         SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
896         SHLIB_VERSION=$TCL_SHLIB_VERSION
897         SHLIB_IRTCL=irtcl${TCL_SHLIB_SUFFIX}
898         echo "$ac_t""$TCL_VERSION" 1>&6
899 else
900         SHLIB_CFLAGS=""
901         SHLIB_LD="shared-linker"
902         SHLIB_SUFFIX=""
903         SHLIB_VERSION=""
904         SHLIB_IRTCL="irtcl-shared"
905         # Extract the first word of "ranlib", so it can be a program name with args.
906 set dummy ranlib; ac_word=$2
907 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
908 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
909   echo $ac_n "(cached) $ac_c" 1>&6
910 else
911   if test -n "$RANLIB"; then
912   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
913 else
914   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
915   for ac_dir in $PATH; do
916     test -z "$ac_dir" && ac_dir=.
917     if test -f $ac_dir/$ac_word; then
918       ac_cv_prog_RANLIB="ranlib"
919       break
920     fi
921   done
922   IFS="$ac_save_ifs"
923   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
924 fi
925 fi
926 RANLIB="$ac_cv_prog_RANLIB"
927 if test -n "$RANLIB"; then
928   echo "$ac_t""$RANLIB" 1>&6
929 else
930   echo "$ac_t""no" 1>&6
931 fi
932
933         checkBoth=0
934         echo $ac_n "checking for connect""... $ac_c" 1>&6
935 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
936   echo $ac_n "(cached) $ac_c" 1>&6
937 else
938   cat > conftest.$ac_ext <<EOF
939 #line 940 "configure"
940 #include "confdefs.h"
941 /* System header to define __stub macros and hopefully few prototypes,
942     which can conflict with char connect(); below.  */
943 #include <assert.h>
944 /* Override any gcc2 internal prototype to avoid an error.  */
945 char connect();
946
947 int main() { return 0; }
948 int t() {
949
950 /* The GNU C library defines this for functions which it implements
951     to always fail with ENOSYS.  Some functions are actually named
952     something starting with __ and the normal name is an alias.  */
953 #if defined (__stub_connect) || defined (__stub___connect)
954 choke me
955 #else
956 connect();
957 #endif
958
959 ; return 0; }
960 EOF
961 if eval $ac_link; then
962   rm -rf conftest*
963   eval "ac_cv_func_connect=yes"
964 else
965   rm -rf conftest*
966   eval "ac_cv_func_connect=no"
967 fi
968 rm -f conftest*
969
970 fi
971 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
972   echo "$ac_t""yes" 1>&6
973   tk_checkSocket=0
974 else
975   echo "$ac_t""no" 1>&6
976 tk_checkSocket=1
977 fi
978
979         if test "$tk_checkSocket" = 1; then
980                 echo $ac_n "checking for -lsocket""... $ac_c" 1>&6
981 ac_lib_var=`echo socket | tr '.-/+' '___p'`
982 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
983   echo $ac_n "(cached) $ac_c" 1>&6
984 else
985   ac_save_LIBS="$LIBS"
986 LIBS="-lsocket  $LIBS"
987 cat > conftest.$ac_ext <<EOF
988 #line 989 "configure"
989 #include "confdefs.h"
990
991 int main() { return 0; }
992 int t() {
993 main()
994 ; return 0; }
995 EOF
996 if eval $ac_link; then
997   rm -rf conftest*
998   eval "ac_cv_lib_$ac_lib_var=yes"
999 else
1000   rm -rf conftest*
1001   eval "ac_cv_lib_$ac_lib_var=no"
1002 fi
1003 rm -f conftest*
1004 LIBS="$ac_save_LIBS"
1005
1006 fi
1007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1008   echo "$ac_t""yes" 1>&6
1009   LIBS="$LIBS -lsocket"
1010 else
1011   echo "$ac_t""no" 1>&6
1012 checkBoth=1
1013 fi
1014
1015         fi
1016         if test "$checkBoth" = 1; then
1017                 tk_oldLibs=$LIBS
1018                 LIBS="$LIBS -lsocket -lnsl"
1019                 echo $ac_n "checking for accept""... $ac_c" 1>&6
1020 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
1021   echo $ac_n "(cached) $ac_c" 1>&6
1022 else
1023   cat > conftest.$ac_ext <<EOF
1024 #line 1025 "configure"
1025 #include "confdefs.h"
1026 /* System header to define __stub macros and hopefully few prototypes,
1027     which can conflict with char accept(); below.  */
1028 #include <assert.h>
1029 /* Override any gcc2 internal prototype to avoid an error.  */
1030 char accept();
1031
1032 int main() { return 0; }
1033 int t() {
1034
1035 /* The GNU C library defines this for functions which it implements
1036     to always fail with ENOSYS.  Some functions are actually named
1037     something starting with __ and the normal name is an alias.  */
1038 #if defined (__stub_accept) || defined (__stub___accept)
1039 choke me
1040 #else
1041 accept();
1042 #endif
1043
1044 ; return 0; }
1045 EOF
1046 if eval $ac_link; then
1047   rm -rf conftest*
1048   eval "ac_cv_func_accept=yes"
1049 else
1050   rm -rf conftest*
1051   eval "ac_cv_func_accept=no"
1052 fi
1053 rm -f conftest*
1054
1055 fi
1056 if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
1057   echo "$ac_t""yes" 1>&6
1058   :
1059 else
1060   echo "$ac_t""no" 1>&6
1061 LIBS=$tk_oldLibs
1062 fi
1063
1064         fi
1065         echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
1066 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
1067   echo $ac_n "(cached) $ac_c" 1>&6
1068 else
1069   cat > conftest.$ac_ext <<EOF
1070 #line 1071 "configure"
1071 #include "confdefs.h"
1072 /* System header to define __stub macros and hopefully few prototypes,
1073     which can conflict with char gethostbyname(); below.  */
1074 #include <assert.h>
1075 /* Override any gcc2 internal prototype to avoid an error.  */
1076 char gethostbyname();
1077
1078 int main() { return 0; }
1079 int t() {
1080
1081 /* The GNU C library defines this for functions which it implements
1082     to always fail with ENOSYS.  Some functions are actually named
1083     something starting with __ and the normal name is an alias.  */
1084 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
1085 choke me
1086 #else
1087 gethostbyname();
1088 #endif
1089
1090 ; return 0; }
1091 EOF
1092 if eval $ac_link; then
1093   rm -rf conftest*
1094   eval "ac_cv_func_gethostbyname=yes"
1095 else
1096   rm -rf conftest*
1097   eval "ac_cv_func_gethostbyname=no"
1098 fi
1099 rm -f conftest*
1100
1101 fi
1102 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
1103   echo "$ac_t""yes" 1>&6
1104   :
1105 else
1106   echo "$ac_t""no" 1>&6
1107 echo $ac_n "checking for -lnsl""... $ac_c" 1>&6
1108 ac_lib_var=`echo nsl | tr '.-/+' '___p'`
1109 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1110   echo $ac_n "(cached) $ac_c" 1>&6
1111 else
1112   ac_save_LIBS="$LIBS"
1113 LIBS="-lnsl  $LIBS"
1114 cat > conftest.$ac_ext <<EOF
1115 #line 1116 "configure"
1116 #include "confdefs.h"
1117
1118 int main() { return 0; }
1119 int t() {
1120 main()
1121 ; return 0; }
1122 EOF
1123 if eval $ac_link; then
1124   rm -rf conftest*
1125   eval "ac_cv_lib_$ac_lib_var=yes"
1126 else
1127   rm -rf conftest*
1128   eval "ac_cv_lib_$ac_lib_var=no"
1129 fi
1130 rm -f conftest*
1131 LIBS="$ac_save_LIBS"
1132
1133 fi
1134 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1135   echo "$ac_t""yes" 1>&6
1136   LIBS="$LIBS -lnsl"
1137 else
1138   echo "$ac_t""no" 1>&6
1139 fi
1140
1141 fi
1142
1143         echo $ac_n "checking for Tcl""... $ac_c" 1>&6
1144         TCL_VERSION=nope
1145         for i in "" 7.4 7.5 7.6 8.0; do
1146                 if test -r ${tryprefix}/lib/libtcl${i}.a; then
1147                         TCL_VERSION=$i
1148                 fi
1149         done
1150         if test "$TCL_VERSION" = nope; then
1151                 echo "configure: warning: Didn't find Tcl" 1>&2
1152                 TCL_LIB_SPEC=-ltcl
1153                 TCLINC=" # -I.. Tcl/Tk include path"
1154         else
1155                 if test "$TCL_VERSION" = ""; then
1156                         echo "$ac_t""7.3" 1>&6
1157                 else
1158                         echo "$ac_t""$TCL_VERSION" 1>&6
1159                 fi
1160                 TCL_LIB_SPEC=${tryprefix}/lib/libtcl${TCL_VERSION}.a
1161                 TCLINC=-I${tryprefix}/include
1162         fi
1163         TCLLIB="${TCL_LIB_SPEC} ${LIBS} -lm"
1164 fi
1165 if test -r ${tryprefix}/lib/tkConfig.sh; then
1166         echo $ac_n "checking for Tk""... $ac_c" 1>&6
1167         source ${tryprefix}/lib/tkConfig.sh
1168         echo "$ac_t""$TK_VERSION" 1>&6
1169         TKINC=${TK_XINCLUDES}
1170         TKLIB="${TK_LIB_SPEC} ${TCL_LIB_SPEC} ${TK_LIBS}"
1171 else
1172         echo $ac_n "checking for Tk""... $ac_c" 1>&6
1173         TK_VERSION=nope
1174         for i in "" 4.0 4.1 4.2 8.0; do
1175                 if test -r ${tryprefix}/lib/libtk${i}.a; then
1176                         TK_VERSION=$i
1177                 fi
1178         done
1179         if test "$TK_VERSION" = nope; then
1180                 echo "configure: warning: Didn't find Tk" 1>&2
1181                 TKLIB=-ltk
1182         else
1183                 TKLIB=${tryprefix}/lib/libtk${TK_VERSION}.a
1184                 if test "$TK_VERSION" = ""; then
1185                         echo "$ac_t""3.x" 1>&6
1186                 else
1187                         echo "$ac_t""$TK_VERSION" 1>&6
1188                 fi
1189         fi
1190         # If we find X, set shell vars x_includes and x_libraries to the
1191 # paths, otherwise set no_x=yes.
1192 # Uses ac_ vars as temps to allow command line to override cache and checks.
1193 # --without-x overrides everything else, but does not touch the cache.
1194 echo $ac_n "checking for X""... $ac_c" 1>&6
1195
1196 # Check whether --with-x or --without-x was given.
1197 if test "${with_x+set}" = set; then
1198   withval="$with_x"
1199   :
1200 fi
1201
1202 if test "x$with_x" = xno; then
1203   no_x=yes
1204 else
1205   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
1206     no_x=
1207   else
1208 if eval "test \"`echo '$''{'ac_cv_path_x'+set}'`\" = set"; then
1209   echo $ac_n "(cached) $ac_c" 1>&6
1210 else
1211   # One or both of the vars are not set, and there is no cached value.
1212 no_x=yes
1213 rm -fr conftestdir
1214 if mkdir conftestdir; then
1215   cd conftestdir
1216   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1217   cat > Imakefile <<'EOF'
1218 acfindx:
1219         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1220 EOF
1221   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1222     no_x=
1223     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1224     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1225     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
1226     for ac_extension in a so sl; do
1227       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1228         test -f $ac_im_libdir/libX11.$ac_extension; then
1229         ac_im_usrlibdir=$ac_im_libdir; break
1230       fi
1231     done
1232     # Screen out bogus values from the imake configuration.
1233     case "$ac_im_incroot" in
1234         /usr/include) ;;
1235         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1236     esac
1237     case "$ac_im_usrlibdir" in
1238         /usr/lib | /lib) ;;
1239         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1240     esac
1241   fi
1242   cd ..
1243   rm -fr conftestdir
1244 fi
1245
1246 if test "$no_x" = yes; then
1247 test -z "$x_direct_test_library" && x_direct_test_library=Xt
1248 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
1249 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1250 cat > conftest.$ac_ext <<EOF
1251 #line 1252 "configure"
1252 #include "confdefs.h"
1253 #include <$x_direct_test_include>
1254 EOF
1255 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1256 ac_err=`grep -v '^ *+' conftest.out`
1257 if test -z "$ac_err"; then
1258   rm -rf conftest*
1259   no_x= ac_x_includes=
1260 else
1261   echo "$ac_err" >&5
1262   rm -rf conftest*
1263     for ac_dir in               \
1264     /usr/X11R6/include        \
1265     /usr/X11R5/include        \
1266     /usr/X11R4/include        \
1267                               \
1268     /usr/include/X11R6        \
1269     /usr/include/X11R5        \
1270     /usr/include/X11R4        \
1271                               \
1272     /usr/local/X11R6/include  \
1273     /usr/local/X11R5/include  \
1274     /usr/local/X11R4/include  \
1275                               \
1276     /usr/local/include/X11R6  \
1277     /usr/local/include/X11R5  \
1278     /usr/local/include/X11R4  \
1279                               \
1280     /usr/X11/include          \
1281     /usr/include/X11          \
1282     /usr/local/X11/include    \
1283     /usr/local/include/X11    \
1284                               \
1285     /usr/X386/include         \
1286     /usr/x386/include         \
1287     /usr/XFree86/include/X11  \
1288                               \
1289     /usr/include              \
1290     /usr/local/include        \
1291     /usr/unsupported/include  \
1292     /usr/athena/include       \
1293     /usr/local/x11r5/include  \
1294     /usr/lpp/Xamples/include  \
1295                               \
1296     /usr/openwin/include      \
1297     /usr/openwin/share/include \
1298     ; \
1299   do
1300     if test -r "$ac_dir/$x_direct_test_include"; then
1301       no_x= ac_x_includes=$ac_dir
1302       break
1303     fi
1304   done
1305 fi
1306 rm -f conftest*
1307
1308 # Check for the libraries.
1309 # See if we find them without any special options.
1310 # Don't add to $LIBS permanently.
1311 ac_save_LIBS="$LIBS"
1312 LIBS="-l$x_direct_test_library $LIBS"
1313 cat > conftest.$ac_ext <<EOF
1314 #line 1315 "configure"
1315 #include "confdefs.h"
1316
1317 int main() { return 0; }
1318 int t() {
1319 ${x_direct_test_function}()
1320 ; return 0; }
1321 EOF
1322 if eval $ac_link; then
1323   rm -rf conftest*
1324   LIBS="$ac_save_LIBS" no_x= ac_x_libraries=
1325 else
1326   rm -rf conftest*
1327   LIBS="$ac_save_LIBS"
1328 # First see if replacing the include by lib works.
1329 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
1330     /usr/X11R6/lib        \
1331     /usr/X11R5/lib        \
1332     /usr/X11R4/lib        \
1333                           \
1334     /usr/lib/X11R6        \
1335     /usr/lib/X11R5        \
1336     /usr/lib/X11R4        \
1337                           \
1338     /usr/local/X11R6/lib  \
1339     /usr/local/X11R5/lib  \
1340     /usr/local/X11R4/lib  \
1341                           \
1342     /usr/local/lib/X11R6  \
1343     /usr/local/lib/X11R5  \
1344     /usr/local/lib/X11R4  \
1345                           \
1346     /usr/X11/lib          \
1347     /usr/lib/X11          \
1348     /usr/local/X11/lib    \
1349     /usr/local/lib/X11    \
1350                           \
1351     /usr/X386/lib         \
1352     /usr/x386/lib         \
1353     /usr/XFree86/lib/X11  \
1354                           \
1355     /usr/lib              \
1356     /usr/local/lib        \
1357     /usr/unsupported/lib  \
1358     /usr/athena/lib       \
1359     /usr/local/x11r5/lib  \
1360     /usr/lpp/Xamples/lib  \
1361                           \
1362     /usr/openwin/lib      \
1363     /usr/openwin/share/lib \
1364     ; \
1365 do
1366   for ac_extension in a so sl; do
1367     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
1368       no_x= ac_x_libraries=$ac_dir
1369       break 2
1370     fi
1371   done
1372 done
1373 fi
1374 rm -f conftest*
1375
1376 fi
1377 if test "$no_x" = yes; then
1378   ac_cv_path_x="no_x=yes"
1379 else
1380   ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
1381 fi
1382 fi
1383   fi
1384   eval "$ac_cv_path_x"
1385 fi # $with_x != no
1386
1387 if test "$no_x" = yes; then
1388   echo "$ac_t""no" 1>&6
1389 else
1390   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
1391   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
1392   ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
1393   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
1394 fi
1395
1396         not_really_there=""
1397         if test "$no_x" = ""; then
1398                 if test "$x_includes" = ""; then
1399                         cat > conftest.$ac_ext <<EOF
1400 #line 1401 "configure"
1401 #include "confdefs.h"
1402 #include <X11/XIntrinsic.h>
1403 EOF
1404 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1405 ac_err=`grep -v '^ *+' conftest.out`
1406 if test -z "$ac_err"; then
1407   :
1408 else
1409   echo "$ac_err" >&5
1410   rm -rf conftest*
1411   not_really_there="yes"
1412 fi
1413 rm -f conftest*
1414                 else
1415                         if test ! -r $x_includes/X11/Intrinsic.h; then
1416                                 not_really_there="yes"
1417                         fi
1418                 fi
1419         fi
1420         if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
1421                 echo checking for X11 header files
1422                 XINCLUDES="# no special path needed"
1423                 cat > conftest.$ac_ext <<EOF
1424 #line 1425 "configure"
1425 #include "confdefs.h"
1426 #include <X11/Intrinsic.h>
1427 EOF
1428 eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1429 ac_err=`grep -v '^ *+' conftest.out`
1430 if test -z "$ac_err"; then
1431   :
1432 else
1433   echo "$ac_err" >&5
1434   rm -rf conftest*
1435   XINCLUDES="nope"
1436 fi
1437 rm -f conftest*
1438                 if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include"
1439                         for i in $dirs ; do
1440                                 if test -r $i/X11/Intrinsic.h; then
1441                                         XINCLUDES=" -I$i"
1442                                 fi
1443                         done
1444                 fi
1445         else
1446                 if test "$x_includes" != ""; then
1447                         XINCLUDES=-I$x_includes
1448                 else
1449                         XINCLUDES="# no special path needed"
1450                 fi
1451         fi
1452         if test "$XINCLUDES" = nope; then
1453                 echo "Warning:  couldn't find any X11 include files."
1454                 XINCLUDES="# no include files found"
1455         fi
1456         if test "$no_x" = yes; then
1457                 XLIBSW=nope
1458                 if test "$XLIBSW" = nope; then
1459                         dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
1460                 for i in $dirs ; do
1461                         if test -r $i/libX11.a; then
1462                                 XLIBSW="-L$i -lX11"
1463                         fi
1464                 done
1465         fi
1466         else
1467                 if test "$x_libraries" = ""; then
1468                         XLIBSW=-lX11
1469                 else
1470                         XLIBSW="-L$x_libraries -lX11"
1471                 fi
1472         fi
1473         if test "$XLIBSW" = nope ; then
1474                 echo $ac_n "checking for -lXwindow""... $ac_c" 1>&6
1475 ac_lib_var=`echo Xwindow | tr '.-/+' '___p'`
1476 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1477   echo $ac_n "(cached) $ac_c" 1>&6
1478 else
1479   ac_save_LIBS="$LIBS"
1480 LIBS="-lXwindow  $LIBS"
1481 cat > conftest.$ac_ext <<EOF
1482 #line 1483 "configure"
1483 #include "confdefs.h"
1484
1485 int main() { return 0; }
1486 int t() {
1487 XCreateWindow()
1488 ; return 0; }
1489 EOF
1490 if eval $ac_link; then
1491   rm -rf conftest*
1492   eval "ac_cv_lib_$ac_lib_var=yes"
1493 else
1494   rm -rf conftest*
1495   eval "ac_cv_lib_$ac_lib_var=no"
1496 fi
1497 rm -f conftest*
1498 LIBS="$ac_save_LIBS"
1499
1500 fi
1501 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1502   echo "$ac_t""yes" 1>&6
1503   XLIBSW=-lXwindow
1504 else
1505   echo "$ac_t""no" 1>&6
1506 fi
1507
1508         fi
1509         if test "$XLIBSW" = nope ; then
1510                 echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
1511                 XLIBSW=-lX11
1512         fi
1513         TKINC=$XINCLUDES
1514         TKLIB="${TKLIB} ${XLIBSW} ${TCLLIB}"
1515 fi
1516 trap '' 1 2 15
1517 cat > confcache <<\EOF
1518 # This file is a shell script that caches the results of configure
1519 # tests run on this system so they can be shared between configure
1520 # scripts and configure runs.  It is not useful on other systems.
1521 # If it contains results you don't want to keep, you may remove or edit it.
1522 #
1523 # By default, configure uses ./config.cache as the cache file,
1524 # creating it if it does not exist already.  You can give configure
1525 # the --cache-file=FILE option to use a different cache file; that is
1526 # what configure does when it calls configure scripts in
1527 # subdirectories, so they share the cache.
1528 # Giving --cache-file=/dev/null disables caching, for debugging configure.
1529 # config.status only pays attention to the cache file if you give it the
1530 # --recheck option to rerun configure.
1531 #
1532 EOF
1533 # Ultrix sh set writes to stderr and can't be redirected directly,
1534 # and sets the high bit in the cache file unless we assign to the vars.
1535 (set) 2>&1 |
1536   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
1537   >> confcache
1538 if cmp -s $cache_file confcache; then
1539   :
1540 else
1541   if test -w $cache_file; then
1542     echo "updating cache $cache_file"
1543     cat confcache > $cache_file
1544   else
1545     echo "not updating unwritable cache $cache_file"
1546   fi
1547 fi
1548 rm -f confcache
1549
1550 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
1551
1552 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1553 # Let make expand exec_prefix.
1554 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
1555
1556 # Any assignment to VPATH causes Sun make to only execute
1557 # the first set of double-colon rules, so remove it if not needed.
1558 # If there is a colon in the path, we need to keep it.
1559 if test "x$srcdir" = x.; then
1560   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
1561 fi
1562
1563 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
1564
1565 # Transform confdefs.h into DEFS.
1566 # Protect against shell expansion while executing Makefile rules.
1567 # Protect against Makefile macro expansion.
1568 cat > conftest.defs <<\EOF
1569 s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
1570 s%[     `~#$^&*(){}\\|;'"<>?]%\\&%g
1571 s%\[%\\&%g
1572 s%\]%\\&%g
1573 s%\$%$$%g
1574 EOF
1575 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
1576 rm -f conftest.defs
1577
1578
1579 # Without the "./", some shells look in PATH for config.status.
1580 : ${CONFIG_STATUS=./config.status}
1581
1582 echo creating $CONFIG_STATUS
1583 rm -f $CONFIG_STATUS
1584 cat > $CONFIG_STATUS <<EOF
1585 #! /bin/sh
1586 # Generated automatically by configure.
1587 # Run this file to recreate the current configuration.
1588 # This directory was configured as follows,
1589 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1590 #
1591 # $0 $ac_configure_args
1592 #
1593 # Compiler output produced by configure, useful for debugging
1594 # configure, is in ./config.log if it exists.
1595
1596 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
1597 for ac_option
1598 do
1599   case "\$ac_option" in
1600   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1601     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
1602     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
1603   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
1604     echo "$CONFIG_STATUS generated by autoconf version 2.7"
1605     exit 0 ;;
1606   -help | --help | --hel | --he | --h)
1607     echo "\$ac_cs_usage"; exit 0 ;;
1608   *) echo "\$ac_cs_usage"; exit 1 ;;
1609   esac
1610 done
1611
1612 ac_given_srcdir=$srcdir
1613 ac_given_INSTALL="$INSTALL"
1614
1615 trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1616 EOF
1617 cat >> $CONFIG_STATUS <<EOF
1618
1619 # Protect against being on the right side of a sed subst in config.status.
1620 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
1621  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
1622 $ac_vpsub
1623 $extrasub
1624 s%@CFLAGS@%$CFLAGS%g
1625 s%@CPPFLAGS@%$CPPFLAGS%g
1626 s%@CXXFLAGS@%$CXXFLAGS%g
1627 s%@DEFS@%$DEFS%g
1628 s%@LDFLAGS@%$LDFLAGS%g
1629 s%@LIBS@%$LIBS%g
1630 s%@exec_prefix@%$exec_prefix%g
1631 s%@prefix@%$prefix%g
1632 s%@program_transform_name@%$program_transform_name%g
1633 s%@bindir@%$bindir%g
1634 s%@sbindir@%$sbindir%g
1635 s%@libexecdir@%$libexecdir%g
1636 s%@datadir@%$datadir%g
1637 s%@sysconfdir@%$sysconfdir%g
1638 s%@sharedstatedir@%$sharedstatedir%g
1639 s%@localstatedir@%$localstatedir%g
1640 s%@libdir@%$libdir%g
1641 s%@includedir@%$includedir%g
1642 s%@oldincludedir@%$oldincludedir%g
1643 s%@infodir@%$infodir%g
1644 s%@mandir@%$mandir%g
1645 s%@CC@%$CC%g
1646 s%@TCLLIB@%$TCLLIB%g
1647 s%@TKLIB@%$TKLIB%g
1648 s%@TCLINC@%$TCLINC%g
1649 s%@TKINC@%$TKINC%g
1650 s%@YAZDIR@%$YAZDIR%g
1651 s%@MOSI@%$MOSI%g
1652 s%@MOSIDIR@%$MOSIDIR%g
1653 s%@MOSILIB@%$MOSILIB%g
1654 s%@MOSIINC@%$MOSIINC%g
1655 s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
1656 s%@SHLIB_LD@%$SHLIB_LD%g
1657 s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
1658 s%@SHLIB_VERSION@%$SHLIB_VERSION%g
1659 s%@SHLIB_IRTCL@%$SHLIB_IRTCL%g
1660 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
1661 s%@INSTALL_DATA@%$INSTALL_DATA%g
1662 s%@TCLSH@%$TCLSH%g
1663 s%@CPP@%$CPP%g
1664 s%@RANLIB@%$RANLIB%g
1665
1666 CEOF
1667 EOF
1668 cat >> $CONFIG_STATUS <<EOF
1669
1670 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
1671 EOF
1672 cat >> $CONFIG_STATUS <<\EOF
1673 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
1674   # Support "outfile[:infile]", defaulting infile="outfile.in".
1675   case "$ac_file" in
1676   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
1677        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1678   *) ac_file_in="${ac_file}.in" ;;
1679   esac
1680
1681   # Adjust relative srcdir, etc. for subdirectories.
1682
1683   # Remove last slash and all that follows it.  Not all systems have dirname.
1684   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
1685   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
1686     # The file is in a subdirectory.
1687     test ! -d "$ac_dir" && mkdir "$ac_dir"
1688     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
1689     # A "../" for each directory in $ac_dir_suffix.
1690     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
1691   else
1692     ac_dir_suffix= ac_dots=
1693   fi
1694
1695   case "$ac_given_srcdir" in
1696   .)  srcdir=.
1697       if test -z "$ac_dots"; then top_srcdir=.
1698       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
1699   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
1700   *) # Relative path.
1701     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
1702     top_srcdir="$ac_dots$ac_given_srcdir" ;;
1703   esac
1704
1705   case "$ac_given_INSTALL" in
1706   [/$]*) INSTALL="$ac_given_INSTALL" ;;
1707   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
1708   esac
1709   echo creating "$ac_file"
1710   rm -f "$ac_file"
1711   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
1712   case "$ac_file" in
1713   *Makefile*) ac_comsub="1i\\
1714 # $configure_input" ;;
1715   *) ac_comsub= ;;
1716   esac
1717   sed -e "$ac_comsub
1718 s%@configure_input@%$configure_input%g
1719 s%@srcdir@%$srcdir%g
1720 s%@top_srcdir@%$top_srcdir%g
1721 s%@INSTALL@%$INSTALL%g
1722 " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
1723 fi; done
1724 rm -f conftest.subs
1725
1726
1727
1728 exit 0
1729 EOF
1730 chmod +x $CONFIG_STATUS
1731 rm -fr confdefs* $ac_clean_files
1732 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1733