Updating to version 1.3, release made by Mike Vanier (mvanier@bbb.caltech.edu).
[gnushogi.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   --with-x                use the X Window System"
16 ac_help="$ac_help
17   --with-top-part-bitmaps    Use top part of Kanji bitmaps only."
18 ac_help="$ac_help
19   --with-first-shogi-program=PROGNAME    
20         Use PROGNAME as the first shogi program (default: gnushogi)"
21 ac_help="$ac_help
22   --with-second-shogi-program=PROGNAME    
23         Use PROGNAME as the second shogi program (default: gnushogi)"
24 ac_help="$ac_help
25   --with-first-host=HOSTNAME    
26         Use HOSTNAME as the machine on which the first shogi program 
27         runs (default: localhost)"
28 ac_help="$ac_help
29   --with-second-host=HOSTNAME    
30         Use HOSTNAME as the machine on which the second shogi program 
31         runs (default: localhost)"
32 ac_help="$ac_help
33   --with-xshogi    
34         Compile the xshogi graphical interface to GNU shogi (default: yes)"
35
36 # Initialize some variables set by options.
37 # The variables have the same names as the options, with
38 # dashes changed to underlines.
39 build=NONE
40 cache_file=./config.cache
41 exec_prefix=NONE
42 host=NONE
43 no_create=
44 nonopt=NONE
45 no_recursion=
46 prefix=NONE
47 program_prefix=NONE
48 program_suffix=NONE
49 program_transform_name=s,x,x,
50 silent=
51 site=
52 srcdir=
53 target=NONE
54 verbose=
55 x_includes=NONE
56 x_libraries=NONE
57 bindir='${exec_prefix}/bin'
58 sbindir='${exec_prefix}/sbin'
59 libexecdir='${exec_prefix}/libexec'
60 datadir='${prefix}/share'
61 sysconfdir='${prefix}/etc'
62 sharedstatedir='${prefix}/com'
63 localstatedir='${prefix}/var'
64 libdir='${exec_prefix}/lib'
65 includedir='${prefix}/include'
66 oldincludedir='/usr/include'
67 infodir='${prefix}/info'
68 mandir='${prefix}/man'
69
70 # Initialize some other variables.
71 subdirs=
72 MFLAGS= MAKEFLAGS=
73 SHELL=${CONFIG_SHELL-/bin/sh}
74 # Maximum number of lines to put in a shell here document.
75 ac_max_here_lines=12
76
77 ac_prev=
78 for ac_option
79 do
80
81   # If the previous option needs an argument, assign it.
82   if test -n "$ac_prev"; then
83     eval "$ac_prev=\$ac_option"
84     ac_prev=
85     continue
86   fi
87
88   case "$ac_option" in
89   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
90   *) ac_optarg= ;;
91   esac
92
93   # Accept the important Cygnus configure options, so we can diagnose typos.
94
95   case "$ac_option" in
96
97   -bindir | --bindir | --bindi | --bind | --bin | --bi)
98     ac_prev=bindir ;;
99   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
100     bindir="$ac_optarg" ;;
101
102   -build | --build | --buil | --bui | --bu)
103     ac_prev=build ;;
104   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
105     build="$ac_optarg" ;;
106
107   -cache-file | --cache-file | --cache-fil | --cache-fi \
108   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
109     ac_prev=cache_file ;;
110   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
111   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
112     cache_file="$ac_optarg" ;;
113
114   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
115     ac_prev=datadir ;;
116   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
117   | --da=*)
118     datadir="$ac_optarg" ;;
119
120   -disable-* | --disable-*)
121     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
122     # Reject names that are not valid shell variable names.
123     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
124       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
125     fi
126     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
127     eval "enable_${ac_feature}=no" ;;
128
129   -enable-* | --enable-*)
130     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
131     # Reject names that are not valid shell variable names.
132     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
133       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
134     fi
135     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
136     case "$ac_option" in
137       *=*) ;;
138       *) ac_optarg=yes ;;
139     esac
140     eval "enable_${ac_feature}='$ac_optarg'" ;;
141
142   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
143   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
144   | --exec | --exe | --ex)
145     ac_prev=exec_prefix ;;
146   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
147   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
148   | --exec=* | --exe=* | --ex=*)
149     exec_prefix="$ac_optarg" ;;
150
151   -gas | --gas | --ga | --g)
152     # Obsolete; use --with-gas.
153     with_gas=yes ;;
154
155   -help | --help | --hel | --he)
156     # Omit some internal or obsolete options to make the list less imposing.
157     # This message is too long to be a string in the A/UX 3.1 sh.
158     cat << EOF
159 Usage: configure [options] [host]
160 Options: [defaults in brackets after descriptions]
161 Configuration:
162   --cache-file=FILE       cache test results in FILE
163   --help                  print this message
164   --no-create             do not create output files
165   --quiet, --silent       do not print \`checking...' messages
166   --version               print the version of autoconf that created configure
167 Directory and file names:
168   --prefix=PREFIX         install architecture-independent files in PREFIX
169                           [$ac_default_prefix]
170   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
171                           [same as prefix]
172   --bindir=DIR            user executables in DIR [EPREFIX/bin]
173   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
174   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
175   --datadir=DIR           read-only architecture-independent data in DIR
176                           [PREFIX/share]
177   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
178   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
179                           [PREFIX/com]
180   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
181   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
182   --includedir=DIR        C header files in DIR [PREFIX/include]
183   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
184   --infodir=DIR           info documentation in DIR [PREFIX/info]
185   --mandir=DIR            man documentation in DIR [PREFIX/man]
186   --srcdir=DIR            find the sources in DIR [configure dir or ..]
187   --program-prefix=PREFIX prepend PREFIX to installed program names
188   --program-suffix=SUFFIX append SUFFIX to installed program names
189   --program-transform-name=PROGRAM
190                           run sed PROGRAM on installed program names
191 EOF
192     cat << EOF
193 Host type:
194   --build=BUILD           configure for building on BUILD [BUILD=HOST]
195   --host=HOST             configure for HOST [guessed]
196   --target=TARGET         configure for TARGET [TARGET=HOST]
197 Features and packages:
198   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
199   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
200   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
201   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
202   --x-includes=DIR        X include files are in DIR
203   --x-libraries=DIR       X library files are in DIR
204 EOF
205     if test -n "$ac_help"; then
206       echo "--enable and --with options recognized:$ac_help"
207     fi
208     exit 0 ;;
209
210   -host | --host | --hos | --ho)
211     ac_prev=host ;;
212   -host=* | --host=* | --hos=* | --ho=*)
213     host="$ac_optarg" ;;
214
215   -includedir | --includedir | --includedi | --included | --include \
216   | --includ | --inclu | --incl | --inc)
217     ac_prev=includedir ;;
218   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
219   | --includ=* | --inclu=* | --incl=* | --inc=*)
220     includedir="$ac_optarg" ;;
221
222   -infodir | --infodir | --infodi | --infod | --info | --inf)
223     ac_prev=infodir ;;
224   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
225     infodir="$ac_optarg" ;;
226
227   -libdir | --libdir | --libdi | --libd)
228     ac_prev=libdir ;;
229   -libdir=* | --libdir=* | --libdi=* | --libd=*)
230     libdir="$ac_optarg" ;;
231
232   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
233   | --libexe | --libex | --libe)
234     ac_prev=libexecdir ;;
235   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
236   | --libexe=* | --libex=* | --libe=*)
237     libexecdir="$ac_optarg" ;;
238
239   -localstatedir | --localstatedir | --localstatedi | --localstated \
240   | --localstate | --localstat | --localsta | --localst \
241   | --locals | --local | --loca | --loc | --lo)
242     ac_prev=localstatedir ;;
243   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
244   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
245   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
246     localstatedir="$ac_optarg" ;;
247
248   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
249     ac_prev=mandir ;;
250   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
251     mandir="$ac_optarg" ;;
252
253   -nfp | --nfp | --nf)
254     # Obsolete; use --without-fp.
255     with_fp=no ;;
256
257   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
258   | --no-cr | --no-c)
259     no_create=yes ;;
260
261   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
262   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
263     no_recursion=yes ;;
264
265   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
266   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
267   | --oldin | --oldi | --old | --ol | --o)
268     ac_prev=oldincludedir ;;
269   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
270   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
271   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
272     oldincludedir="$ac_optarg" ;;
273
274   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
275     ac_prev=prefix ;;
276   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
277     prefix="$ac_optarg" ;;
278
279   -program-prefix | --program-prefix | --program-prefi | --program-pref \
280   | --program-pre | --program-pr | --program-p)
281     ac_prev=program_prefix ;;
282   -program-prefix=* | --program-prefix=* | --program-prefi=* \
283   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
284     program_prefix="$ac_optarg" ;;
285
286   -program-suffix | --program-suffix | --program-suffi | --program-suff \
287   | --program-suf | --program-su | --program-s)
288     ac_prev=program_suffix ;;
289   -program-suffix=* | --program-suffix=* | --program-suffi=* \
290   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
291     program_suffix="$ac_optarg" ;;
292
293   -program-transform-name | --program-transform-name \
294   | --program-transform-nam | --program-transform-na \
295   | --program-transform-n | --program-transform- \
296   | --program-transform | --program-transfor \
297   | --program-transfo | --program-transf \
298   | --program-trans | --program-tran \
299   | --progr-tra | --program-tr | --program-t)
300     ac_prev=program_transform_name ;;
301   -program-transform-name=* | --program-transform-name=* \
302   | --program-transform-nam=* | --program-transform-na=* \
303   | --program-transform-n=* | --program-transform-=* \
304   | --program-transform=* | --program-transfor=* \
305   | --program-transfo=* | --program-transf=* \
306   | --program-trans=* | --program-tran=* \
307   | --progr-tra=* | --program-tr=* | --program-t=*)
308     program_transform_name="$ac_optarg" ;;
309
310   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
311   | -silent | --silent | --silen | --sile | --sil)
312     silent=yes ;;
313
314   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
315     ac_prev=sbindir ;;
316   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
317   | --sbi=* | --sb=*)
318     sbindir="$ac_optarg" ;;
319
320   -sharedstatedir | --sharedstatedir | --sharedstatedi \
321   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
322   | --sharedst | --shareds | --shared | --share | --shar \
323   | --sha | --sh)
324     ac_prev=sharedstatedir ;;
325   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
326   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
327   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
328   | --sha=* | --sh=*)
329     sharedstatedir="$ac_optarg" ;;
330
331   -site | --site | --sit)
332     ac_prev=site ;;
333   -site=* | --site=* | --sit=*)
334     site="$ac_optarg" ;;
335
336   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
337     ac_prev=srcdir ;;
338   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
339     srcdir="$ac_optarg" ;;
340
341   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
342   | --syscon | --sysco | --sysc | --sys | --sy)
343     ac_prev=sysconfdir ;;
344   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
345   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
346     sysconfdir="$ac_optarg" ;;
347
348   -target | --target | --targe | --targ | --tar | --ta | --t)
349     ac_prev=target ;;
350   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
351     target="$ac_optarg" ;;
352
353   -v | -verbose | --verbose | --verbos | --verbo | --verb)
354     verbose=yes ;;
355
356   -version | --version | --versio | --versi | --vers)
357     echo "configure generated by autoconf version 2.13"
358     exit 0 ;;
359
360   -with-* | --with-*)
361     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
362     # Reject names that are not valid shell variable names.
363     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
364       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
365     fi
366     ac_package=`echo $ac_package| sed 's/-/_/g'`
367     case "$ac_option" in
368       *=*) ;;
369       *) ac_optarg=yes ;;
370     esac
371     eval "with_${ac_package}='$ac_optarg'" ;;
372
373   -without-* | --without-*)
374     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
375     # Reject names that are not valid shell variable names.
376     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
377       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
378     fi
379     ac_package=`echo $ac_package| sed 's/-/_/g'`
380     eval "with_${ac_package}=no" ;;
381
382   --x)
383     # Obsolete; use --with-x.
384     with_x=yes ;;
385
386   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
387   | --x-incl | --x-inc | --x-in | --x-i)
388     ac_prev=x_includes ;;
389   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
390   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
391     x_includes="$ac_optarg" ;;
392
393   -x-libraries | --x-libraries | --x-librarie | --x-librari \
394   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
395     ac_prev=x_libraries ;;
396   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
397   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
398     x_libraries="$ac_optarg" ;;
399
400   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
401     ;;
402
403   *)
404     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
405       echo "configure: warning: $ac_option: invalid host type" 1>&2
406     fi
407     if test "x$nonopt" != xNONE; then
408       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
409     fi
410     nonopt="$ac_option"
411     ;;
412
413   esac
414 done
415
416 if test -n "$ac_prev"; then
417   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
418 fi
419
420 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
421
422 # File descriptor usage:
423 # 0 standard input
424 # 1 file creation
425 # 2 errors and warnings
426 # 3 some systems may open it to /dev/tty
427 # 4 used on the Kubota Titan
428 # 6 checking for... messages and results
429 # 5 compiler messages saved in config.log
430 if test "$silent" = yes; then
431   exec 6>/dev/null
432 else
433   exec 6>&1
434 fi
435 exec 5>./config.log
436
437 echo "\
438 This file contains any messages produced by compilers while
439 running configure, to aid debugging if configure makes a mistake.
440 " 1>&5
441
442 # Strip out --no-create and --no-recursion so they do not pile up.
443 # Also quote any args containing shell metacharacters.
444 ac_configure_args=
445 for ac_arg
446 do
447   case "$ac_arg" in
448   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
449   | --no-cr | --no-c) ;;
450   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
451   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
452   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
453   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
454   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
455   esac
456 done
457
458 # NLS nuisances.
459 # Only set these to C if already set.  These must not be set unconditionally
460 # because not all systems understand e.g. LANG=C (notably SCO).
461 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
462 # Non-C LC_CTYPE values break the ctype check.
463 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
464 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
465 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
466 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
467
468 # confdefs.h avoids OS command line length limits that DEFS can exceed.
469 rm -rf conftest* confdefs.h
470 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
471 echo > confdefs.h
472
473 # A filename unique to this package, relative to the directory that
474 # configure is in, which we can look for to find out if srcdir is correct.
475 ac_unique_file=gnushogi/gnushogi.h
476
477 # Find the source files, if location was not specified.
478 if test -z "$srcdir"; then
479   ac_srcdir_defaulted=yes
480   # Try the directory containing this script, then its parent.
481   ac_prog=$0
482   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
483   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
484   srcdir=$ac_confdir
485   if test ! -r $srcdir/$ac_unique_file; then
486     srcdir=..
487   fi
488 else
489   ac_srcdir_defaulted=no
490 fi
491 if test ! -r $srcdir/$ac_unique_file; then
492   if test "$ac_srcdir_defaulted" = yes; then
493     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
494   else
495     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
496   fi
497 fi
498 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
499
500 # Prefer explicitly selected file to automatically selected ones.
501 if test -z "$CONFIG_SITE"; then
502   if test "x$prefix" != xNONE; then
503     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
504   else
505     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
506   fi
507 fi
508 for ac_site_file in $CONFIG_SITE; do
509   if test -r "$ac_site_file"; then
510     echo "loading site script $ac_site_file"
511     . "$ac_site_file"
512   fi
513 done
514
515 if test -r "$cache_file"; then
516   echo "loading cache $cache_file"
517   . $cache_file
518 else
519   echo "creating cache $cache_file"
520   > $cache_file
521 fi
522
523 ac_ext=c
524 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
525 ac_cpp='$CPP $CPPFLAGS'
526 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
527 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
528 cross_compiling=$ac_cv_prog_cc_cross
529
530 ac_exeext=
531 ac_objext=o
532 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
533   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
534   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
535     ac_n= ac_c='
536 ' ac_t='        '
537   else
538     ac_n=-n ac_c= ac_t=
539   fi
540 else
541   ac_n= ac_c='\c' ac_t=
542 fi
543
544
545
546
547
548 #
549 # Check for C compiler.
550 #
551
552 echo
553 echo $ac_n "checking for C compiler""... $ac_c" 1>&6
554 echo "configure:555: checking for C compiler" >&5
555 echo
556
557 # Extract the first word of "gcc", so it can be a program name with args.
558 set dummy gcc; ac_word=$2
559 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
560 echo "configure:561: checking for $ac_word" >&5
561 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
562   echo $ac_n "(cached) $ac_c" 1>&6
563 else
564   if test -n "$CC"; then
565   ac_cv_prog_CC="$CC" # Let the user override the test.
566 else
567   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
568   ac_dummy="$PATH"
569   for ac_dir in $ac_dummy; do
570     test -z "$ac_dir" && ac_dir=.
571     if test -f $ac_dir/$ac_word; then
572       ac_cv_prog_CC="gcc"
573       break
574     fi
575   done
576   IFS="$ac_save_ifs"
577 fi
578 fi
579 CC="$ac_cv_prog_CC"
580 if test -n "$CC"; then
581   echo "$ac_t""$CC" 1>&6
582 else
583   echo "$ac_t""no" 1>&6
584 fi
585
586 if test -z "$CC"; then
587   # Extract the first word of "cc", so it can be a program name with args.
588 set dummy cc; ac_word=$2
589 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
590 echo "configure:591: checking for $ac_word" >&5
591 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
592   echo $ac_n "(cached) $ac_c" 1>&6
593 else
594   if test -n "$CC"; then
595   ac_cv_prog_CC="$CC" # Let the user override the test.
596 else
597   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
598   ac_prog_rejected=no
599   ac_dummy="$PATH"
600   for ac_dir in $ac_dummy; do
601     test -z "$ac_dir" && ac_dir=.
602     if test -f $ac_dir/$ac_word; then
603       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
604         ac_prog_rejected=yes
605         continue
606       fi
607       ac_cv_prog_CC="cc"
608       break
609     fi
610   done
611   IFS="$ac_save_ifs"
612 if test $ac_prog_rejected = yes; then
613   # We found a bogon in the path, so make sure we never use it.
614   set dummy $ac_cv_prog_CC
615   shift
616   if test $# -gt 0; then
617     # We chose a different compiler from the bogus one.
618     # However, it has the same basename, so the bogon will be chosen
619     # first if we set CC to just the basename; use the full file name.
620     shift
621     set dummy "$ac_dir/$ac_word" "$@"
622     shift
623     ac_cv_prog_CC="$@"
624   fi
625 fi
626 fi
627 fi
628 CC="$ac_cv_prog_CC"
629 if test -n "$CC"; then
630   echo "$ac_t""$CC" 1>&6
631 else
632   echo "$ac_t""no" 1>&6
633 fi
634
635   if test -z "$CC"; then
636     case "`uname -s`" in
637     *win32* | *WIN32*)
638       # Extract the first word of "cl", so it can be a program name with args.
639 set dummy cl; ac_word=$2
640 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
641 echo "configure:642: checking for $ac_word" >&5
642 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
643   echo $ac_n "(cached) $ac_c" 1>&6
644 else
645   if test -n "$CC"; then
646   ac_cv_prog_CC="$CC" # Let the user override the test.
647 else
648   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
649   ac_dummy="$PATH"
650   for ac_dir in $ac_dummy; do
651     test -z "$ac_dir" && ac_dir=.
652     if test -f $ac_dir/$ac_word; then
653       ac_cv_prog_CC="cl"
654       break
655     fi
656   done
657   IFS="$ac_save_ifs"
658 fi
659 fi
660 CC="$ac_cv_prog_CC"
661 if test -n "$CC"; then
662   echo "$ac_t""$CC" 1>&6
663 else
664   echo "$ac_t""no" 1>&6
665 fi
666  ;;
667     esac
668   fi
669   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
670 fi
671
672 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
673 echo "configure:674: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
674
675 ac_ext=c
676 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
677 ac_cpp='$CPP $CPPFLAGS'
678 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
679 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
680 cross_compiling=$ac_cv_prog_cc_cross
681
682 cat > conftest.$ac_ext << EOF
683
684 #line 685 "configure"
685 #include "confdefs.h"
686
687 main(){return(0);}
688 EOF
689 if { (eval echo configure:690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
690   ac_cv_prog_cc_works=yes
691   # If we can't run a trivial program, we are probably using a cross compiler.
692   if (./conftest; exit) 2>/dev/null; then
693     ac_cv_prog_cc_cross=no
694   else
695     ac_cv_prog_cc_cross=yes
696   fi
697 else
698   echo "configure: failed program was:" >&5
699   cat conftest.$ac_ext >&5
700   ac_cv_prog_cc_works=no
701 fi
702 rm -fr conftest*
703 ac_ext=c
704 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
705 ac_cpp='$CPP $CPPFLAGS'
706 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
707 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
708 cross_compiling=$ac_cv_prog_cc_cross
709
710 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
711 if test $ac_cv_prog_cc_works = no; then
712   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
713 fi
714 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
715 echo "configure:716: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
716 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
717 cross_compiling=$ac_cv_prog_cc_cross
718
719 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
720 echo "configure:721: checking whether we are using GNU C" >&5
721 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
722   echo $ac_n "(cached) $ac_c" 1>&6
723 else
724   cat > conftest.c <<EOF
725 #ifdef __GNUC__
726   yes;
727 #endif
728 EOF
729 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
730   ac_cv_prog_gcc=yes
731 else
732   ac_cv_prog_gcc=no
733 fi
734 fi
735
736 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
737
738 if test $ac_cv_prog_gcc = yes; then
739   GCC=yes
740 else
741   GCC=
742 fi
743
744 ac_test_CFLAGS="${CFLAGS+set}"
745 ac_save_CFLAGS="$CFLAGS"
746 CFLAGS=
747 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
748 echo "configure:749: checking whether ${CC-cc} accepts -g" >&5
749 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
750   echo $ac_n "(cached) $ac_c" 1>&6
751 else
752   echo 'void f(){}' > conftest.c
753 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
754   ac_cv_prog_cc_g=yes
755 else
756   ac_cv_prog_cc_g=no
757 fi
758 rm -f conftest*
759
760 fi
761
762 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
763 if test "$ac_test_CFLAGS" = set; then
764   CFLAGS="$ac_save_CFLAGS"
765 elif test $ac_cv_prog_cc_g = yes; then
766   if test "$GCC" = yes; then
767     CFLAGS="-g -O2"
768   else
769     CFLAGS="-g"
770   fi
771 else
772   if test "$GCC" = yes; then
773     CFLAGS="-O2"
774   else
775     CFLAGS=
776   fi
777 fi
778
779
780
781 #
782 # Check for parser generators.
783 #
784
785 echo
786 echo $ac_n "checking for yacc/bison, lex/flex, and install""... $ac_c" 1>&6
787 echo "configure:788: checking for yacc/bison, lex/flex, and install" >&5
788 echo
789
790 for ac_prog in 'bison -y' byacc
791 do
792 # Extract the first word of "$ac_prog", so it can be a program name with args.
793 set dummy $ac_prog; ac_word=$2
794 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
795 echo "configure:796: checking for $ac_word" >&5
796 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
797   echo $ac_n "(cached) $ac_c" 1>&6
798 else
799   if test -n "$YACC"; then
800   ac_cv_prog_YACC="$YACC" # Let the user override the test.
801 else
802   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
803   ac_dummy="$PATH"
804   for ac_dir in $ac_dummy; do
805     test -z "$ac_dir" && ac_dir=.
806     if test -f $ac_dir/$ac_word; then
807       ac_cv_prog_YACC="$ac_prog"
808       break
809     fi
810   done
811   IFS="$ac_save_ifs"
812 fi
813 fi
814 YACC="$ac_cv_prog_YACC"
815 if test -n "$YACC"; then
816   echo "$ac_t""$YACC" 1>&6
817 else
818   echo "$ac_t""no" 1>&6
819 fi
820
821 test -n "$YACC" && break
822 done
823 test -n "$YACC" || YACC="yacc"
824
825 # Extract the first word of "flex", so it can be a program name with args.
826 set dummy flex; ac_word=$2
827 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
828 echo "configure:829: checking for $ac_word" >&5
829 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
830   echo $ac_n "(cached) $ac_c" 1>&6
831 else
832   if test -n "$LEX"; then
833   ac_cv_prog_LEX="$LEX" # Let the user override the test.
834 else
835   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
836   ac_dummy="$PATH"
837   for ac_dir in $ac_dummy; do
838     test -z "$ac_dir" && ac_dir=.
839     if test -f $ac_dir/$ac_word; then
840       ac_cv_prog_LEX="flex"
841       break
842     fi
843   done
844   IFS="$ac_save_ifs"
845   test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
846 fi
847 fi
848 LEX="$ac_cv_prog_LEX"
849 if test -n "$LEX"; then
850   echo "$ac_t""$LEX" 1>&6
851 else
852   echo "$ac_t""no" 1>&6
853 fi
854
855 if test -z "$LEXLIB"
856 then
857   case "$LEX" in
858   flex*) ac_lib=fl ;;
859   *) ac_lib=l ;;
860   esac
861   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
862 echo "configure:863: checking for yywrap in -l$ac_lib" >&5
863 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
864 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
865   echo $ac_n "(cached) $ac_c" 1>&6
866 else
867   ac_save_LIBS="$LIBS"
868 LIBS="-l$ac_lib  $LIBS"
869 cat > conftest.$ac_ext <<EOF
870 #line 871 "configure"
871 #include "confdefs.h"
872 /* Override any gcc2 internal prototype to avoid an error.  */
873 /* We use char because int might match the return type of a gcc2
874     builtin and then its argument prototype would still apply.  */
875 char yywrap();
876
877 int main() {
878 yywrap()
879 ; return 0; }
880 EOF
881 if { (eval echo configure:882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
882   rm -rf conftest*
883   eval "ac_cv_lib_$ac_lib_var=yes"
884 else
885   echo "configure: failed program was:" >&5
886   cat conftest.$ac_ext >&5
887   rm -rf conftest*
888   eval "ac_cv_lib_$ac_lib_var=no"
889 fi
890 rm -f conftest*
891 LIBS="$ac_save_LIBS"
892
893 fi
894 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
895   echo "$ac_t""yes" 1>&6
896   LEXLIB="-l$ac_lib"
897 else
898   echo "$ac_t""no" 1>&6
899 fi
900
901 fi
902
903 ac_aux_dir=
904 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
905   if test -f $ac_dir/install-sh; then
906     ac_aux_dir=$ac_dir
907     ac_install_sh="$ac_aux_dir/install-sh -c"
908     break
909   elif test -f $ac_dir/install.sh; then
910     ac_aux_dir=$ac_dir
911     ac_install_sh="$ac_aux_dir/install.sh -c"
912     break
913   fi
914 done
915 if test -z "$ac_aux_dir"; then
916   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
917 fi
918 ac_config_guess=$ac_aux_dir/config.guess
919 ac_config_sub=$ac_aux_dir/config.sub
920 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
921
922 # Find a good install program.  We prefer a C program (faster),
923 # so one script is as good as another.  But avoid the broken or
924 # incompatible versions:
925 # SysV /etc/install, /usr/sbin/install
926 # SunOS /usr/etc/install
927 # IRIX /sbin/install
928 # AIX /bin/install
929 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
930 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
931 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
932 # ./install, which can be erroneously created by make from ./install.sh.
933 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
934 echo "configure:935: checking for a BSD compatible install" >&5
935 if test -z "$INSTALL"; then
936 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
937   echo $ac_n "(cached) $ac_c" 1>&6
938 else
939     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
940   for ac_dir in $PATH; do
941     # Account for people who put trailing slashes in PATH elements.
942     case "$ac_dir/" in
943     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
944     *)
945       # OSF1 and SCO ODT 3.0 have their own names for install.
946       # Don't use installbsd from OSF since it installs stuff as root
947       # by default.
948       for ac_prog in ginstall scoinst install; do
949         if test -f $ac_dir/$ac_prog; then
950           if test $ac_prog = install &&
951             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
952             # AIX install.  It has an incompatible calling convention.
953             :
954           else
955             ac_cv_path_install="$ac_dir/$ac_prog -c"
956             break 2
957           fi
958         fi
959       done
960       ;;
961     esac
962   done
963   IFS="$ac_save_IFS"
964
965 fi
966   if test "${ac_cv_path_install+set}" = set; then
967     INSTALL="$ac_cv_path_install"
968   else
969     # As a last resort, use the slow shell script.  We don't cache a
970     # path for INSTALL within a source directory, because that will
971     # break other packages using the cache if that directory is
972     # removed, or if the path is relative.
973     INSTALL="$ac_install_sh"
974   fi
975 fi
976 echo "$ac_t""$INSTALL" 1>&6
977
978 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
979 # It thinks the first close brace ends the variable substitution.
980 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
981
982 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
983
984 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
985
986
987
988 #
989 # Check for X windows.
990 #
991
992 echo
993 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
994 echo "configure:995: checking how to run the C preprocessor" >&5
995 # On Suns, sometimes $CPP names a directory.
996 if test -n "$CPP" && test -d "$CPP"; then
997   CPP=
998 fi
999 if test -z "$CPP"; then
1000 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1001   echo $ac_n "(cached) $ac_c" 1>&6
1002 else
1003     # This must be in double quotes, not single quotes, because CPP may get
1004   # substituted into the Makefile and "${CC-cc}" will confuse make.
1005   CPP="${CC-cc} -E"
1006   # On the NeXT, cc -E runs the code through the compiler's parser,
1007   # not just through cpp.
1008   cat > conftest.$ac_ext <<EOF
1009 #line 1010 "configure"
1010 #include "confdefs.h"
1011 #include <assert.h>
1012 Syntax Error
1013 EOF
1014 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1015 { (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1016 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1017 if test -z "$ac_err"; then
1018   :
1019 else
1020   echo "$ac_err" >&5
1021   echo "configure: failed program was:" >&5
1022   cat conftest.$ac_ext >&5
1023   rm -rf conftest*
1024   CPP="${CC-cc} -E -traditional-cpp"
1025   cat > conftest.$ac_ext <<EOF
1026 #line 1027 "configure"
1027 #include "confdefs.h"
1028 #include <assert.h>
1029 Syntax Error
1030 EOF
1031 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1032 { (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1033 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1034 if test -z "$ac_err"; then
1035   :
1036 else
1037   echo "$ac_err" >&5
1038   echo "configure: failed program was:" >&5
1039   cat conftest.$ac_ext >&5
1040   rm -rf conftest*
1041   CPP="${CC-cc} -nologo -E"
1042   cat > conftest.$ac_ext <<EOF
1043 #line 1044 "configure"
1044 #include "confdefs.h"
1045 #include <assert.h>
1046 Syntax Error
1047 EOF
1048 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1049 { (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1050 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1051 if test -z "$ac_err"; then
1052   :
1053 else
1054   echo "$ac_err" >&5
1055   echo "configure: failed program was:" >&5
1056   cat conftest.$ac_ext >&5
1057   rm -rf conftest*
1058   CPP=/lib/cpp
1059 fi
1060 rm -f conftest*
1061 fi
1062 rm -f conftest*
1063 fi
1064 rm -f conftest*
1065   ac_cv_prog_CPP="$CPP"
1066 fi
1067   CPP="$ac_cv_prog_CPP"
1068 else
1069   ac_cv_prog_CPP="$CPP"
1070 fi
1071 echo "$ac_t""$CPP" 1>&6
1072
1073 # If we find X, set shell vars x_includes and x_libraries to the
1074 # paths, otherwise set no_x=yes.
1075 # Uses ac_ vars as temps to allow command line to override cache and checks.
1076 # --without-x overrides everything else, but does not touch the cache.
1077 echo $ac_n "checking for X""... $ac_c" 1>&6
1078 echo "configure:1079: checking for X" >&5
1079
1080 # Check whether --with-x or --without-x was given.
1081 if test "${with_x+set}" = set; then
1082   withval="$with_x"
1083   :
1084 fi
1085
1086 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
1087 if test "x$with_x" = xno; then
1088   # The user explicitly disabled X.
1089   have_x=disabled
1090 else
1091   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
1092     # Both variables are already set.
1093     have_x=yes
1094   else
1095 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
1096   echo $ac_n "(cached) $ac_c" 1>&6
1097 else
1098   # One or both of the vars are not set, and there is no cached value.
1099 ac_x_includes=NO ac_x_libraries=NO
1100 rm -fr conftestdir
1101 if mkdir conftestdir; then
1102   cd conftestdir
1103   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1104   cat > Imakefile <<'EOF'
1105 acfindx:
1106         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1107 EOF
1108   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1109     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1110     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1111     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
1112     for ac_extension in a so sl; do
1113       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1114         test -f $ac_im_libdir/libX11.$ac_extension; then
1115         ac_im_usrlibdir=$ac_im_libdir; break
1116       fi
1117     done
1118     # Screen out bogus values from the imake configuration.  They are
1119     # bogus both because they are the default anyway, and because
1120     # using them would break gcc on systems where it needs fixed includes.
1121     case "$ac_im_incroot" in
1122         /usr/include) ;;
1123         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1124     esac
1125     case "$ac_im_usrlibdir" in
1126         /usr/lib | /lib) ;;
1127         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1128     esac
1129   fi
1130   cd ..
1131   rm -fr conftestdir
1132 fi
1133
1134 if test "$ac_x_includes" = NO; then
1135   # Guess where to find include files, by looking for this one X11 .h file.
1136   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1137
1138   # First, try using that file with no special directory specified.
1139 cat > conftest.$ac_ext <<EOF
1140 #line 1141 "configure"
1141 #include "confdefs.h"
1142 #include <$x_direct_test_include>
1143 EOF
1144 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1145 { (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1146 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1147 if test -z "$ac_err"; then
1148   rm -rf conftest*
1149   # We can compile using X headers with no special include directory.
1150 ac_x_includes=
1151 else
1152   echo "$ac_err" >&5
1153   echo "configure: failed program was:" >&5
1154   cat conftest.$ac_ext >&5
1155   rm -rf conftest*
1156   # Look for the header file in a standard set of common directories.
1157 # Check X11 before X11Rn because it is often a symlink to the current release.
1158   for ac_dir in               \
1159     /usr/X11/include          \
1160     /usr/X11R6/include        \
1161     /usr/X11R5/include        \
1162     /usr/X11R4/include        \
1163                               \
1164     /usr/include/X11          \
1165     /usr/include/X11R6        \
1166     /usr/include/X11R5        \
1167     /usr/include/X11R4        \
1168                               \
1169     /usr/local/X11/include    \
1170     /usr/local/X11R6/include  \
1171     /usr/local/X11R5/include  \
1172     /usr/local/X11R4/include  \
1173                               \
1174     /usr/local/include/X11    \
1175     /usr/local/include/X11R6  \
1176     /usr/local/include/X11R5  \
1177     /usr/local/include/X11R4  \
1178                               \
1179     /usr/X386/include         \
1180     /usr/x386/include         \
1181     /usr/XFree86/include/X11  \
1182                               \
1183     /usr/include              \
1184     /usr/local/include        \
1185     /usr/unsupported/include  \
1186     /usr/athena/include       \
1187     /usr/local/x11r5/include  \
1188     /usr/lpp/Xamples/include  \
1189                               \
1190     /usr/openwin/include      \
1191     /usr/openwin/share/include \
1192     ; \
1193   do
1194     if test -r "$ac_dir/$x_direct_test_include"; then
1195       ac_x_includes=$ac_dir
1196       break
1197     fi
1198   done
1199 fi
1200 rm -f conftest*
1201 fi # $ac_x_includes = NO
1202
1203 if test "$ac_x_libraries" = NO; then
1204   # Check for the libraries.
1205
1206   test -z "$x_direct_test_library" && x_direct_test_library=Xt
1207   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
1208
1209   # See if we find them without any special options.
1210   # Don't add to $LIBS permanently.
1211   ac_save_LIBS="$LIBS"
1212   LIBS="-l$x_direct_test_library $LIBS"
1213 cat > conftest.$ac_ext <<EOF
1214 #line 1215 "configure"
1215 #include "confdefs.h"
1216
1217 int main() {
1218 ${x_direct_test_function}()
1219 ; return 0; }
1220 EOF
1221 if { (eval echo configure:1222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1222   rm -rf conftest*
1223   LIBS="$ac_save_LIBS"
1224 # We can link X programs with no special library path.
1225 ac_x_libraries=
1226 else
1227   echo "configure: failed program was:" >&5
1228   cat conftest.$ac_ext >&5
1229   rm -rf conftest*
1230   LIBS="$ac_save_LIBS"
1231 # First see if replacing the include by lib works.
1232 # Check X11 before X11Rn because it is often a symlink to the current release.
1233 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
1234     /usr/X11/lib          \
1235     /usr/X11R6/lib        \
1236     /usr/X11R5/lib        \
1237     /usr/X11R4/lib        \
1238                           \
1239     /usr/lib/X11          \
1240     /usr/lib/X11R6        \
1241     /usr/lib/X11R5        \
1242     /usr/lib/X11R4        \
1243                           \
1244     /usr/local/X11/lib    \
1245     /usr/local/X11R6/lib  \
1246     /usr/local/X11R5/lib  \
1247     /usr/local/X11R4/lib  \
1248                           \
1249     /usr/local/lib/X11    \
1250     /usr/local/lib/X11R6  \
1251     /usr/local/lib/X11R5  \
1252     /usr/local/lib/X11R4  \
1253                           \
1254     /usr/X386/lib         \
1255     /usr/x386/lib         \
1256     /usr/XFree86/lib/X11  \
1257                           \
1258     /usr/lib              \
1259     /usr/local/lib        \
1260     /usr/unsupported/lib  \
1261     /usr/athena/lib       \
1262     /usr/local/x11r5/lib  \
1263     /usr/lpp/Xamples/lib  \
1264     /lib/usr/lib/X11      \
1265                           \
1266     /usr/openwin/lib      \
1267     /usr/openwin/share/lib \
1268     ; \
1269 do
1270   for ac_extension in a so sl; do
1271     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
1272       ac_x_libraries=$ac_dir
1273       break 2
1274     fi
1275   done
1276 done
1277 fi
1278 rm -f conftest*
1279 fi # $ac_x_libraries = NO
1280
1281 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
1282   # Didn't find X anywhere.  Cache the known absence of X.
1283   ac_cv_have_x="have_x=no"
1284 else
1285   # Record where we found X for the cache.
1286   ac_cv_have_x="have_x=yes \
1287                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
1288 fi
1289 fi
1290   fi
1291   eval "$ac_cv_have_x"
1292 fi # $with_x != no
1293
1294 if test "$have_x" != yes; then
1295   echo "$ac_t""$have_x" 1>&6
1296   no_x=yes
1297 else
1298   # If each of the values was on the command line, it overrides each guess.
1299   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
1300   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
1301   # Update the cache value to reflect the command line values.
1302   ac_cv_have_x="have_x=yes \
1303                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
1304   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
1305 fi
1306
1307 if test "$no_x" = yes; then
1308   # Not all programs may use this symbol, but it does not hurt to define it.
1309   cat >> confdefs.h <<\EOF
1310 #define X_DISPLAY_MISSING 1
1311 EOF
1312
1313   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
1314 else
1315   if test -n "$x_includes"; then
1316     X_CFLAGS="$X_CFLAGS -I$x_includes"
1317   fi
1318
1319   # It would also be nice to do this for all -L options, not just this one.
1320   if test -n "$x_libraries"; then
1321     X_LIBS="$X_LIBS -L$x_libraries"
1322     # For Solaris; some versions of Sun CC require a space after -R and
1323     # others require no space.  Words are not sufficient . . . .
1324     case "`(uname -sr) 2>/dev/null`" in
1325     "SunOS 5"*)
1326       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
1327 echo "configure:1328: checking whether -R must be followed by a space" >&5
1328       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
1329       cat > conftest.$ac_ext <<EOF
1330 #line 1331 "configure"
1331 #include "confdefs.h"
1332
1333 int main() {
1334
1335 ; return 0; }
1336 EOF
1337 if { (eval echo configure:1338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1338   rm -rf conftest*
1339   ac_R_nospace=yes
1340 else
1341   echo "configure: failed program was:" >&5
1342   cat conftest.$ac_ext >&5
1343   rm -rf conftest*
1344   ac_R_nospace=no
1345 fi
1346 rm -f conftest*
1347       if test $ac_R_nospace = yes; then
1348         echo "$ac_t""no" 1>&6
1349         X_LIBS="$X_LIBS -R$x_libraries"
1350       else
1351         LIBS="$ac_xsave_LIBS -R $x_libraries"
1352         cat > conftest.$ac_ext <<EOF
1353 #line 1354 "configure"
1354 #include "confdefs.h"
1355
1356 int main() {
1357
1358 ; return 0; }
1359 EOF
1360 if { (eval echo configure:1361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1361   rm -rf conftest*
1362   ac_R_space=yes
1363 else
1364   echo "configure: failed program was:" >&5
1365   cat conftest.$ac_ext >&5
1366   rm -rf conftest*
1367   ac_R_space=no
1368 fi
1369 rm -f conftest*
1370         if test $ac_R_space = yes; then
1371           echo "$ac_t""yes" 1>&6
1372           X_LIBS="$X_LIBS -R $x_libraries"
1373         else
1374           echo "$ac_t""neither works" 1>&6
1375         fi
1376       fi
1377       LIBS="$ac_xsave_LIBS"
1378     esac
1379   fi
1380
1381   # Check for system-dependent libraries X programs must link with.
1382   # Do this before checking for the system-independent R6 libraries
1383   # (-lICE), since we may need -lsocket or whatever for X linking.
1384
1385   if test "$ISC" = yes; then
1386     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
1387   else
1388     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
1389     # libraries were built with DECnet support.  And karl@cs.umb.edu says
1390     # the Alpha needs dnet_stub (dnet does not exist).
1391     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
1392 echo "configure:1393: checking for dnet_ntoa in -ldnet" >&5
1393 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
1394 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1395   echo $ac_n "(cached) $ac_c" 1>&6
1396 else
1397   ac_save_LIBS="$LIBS"
1398 LIBS="-ldnet  $LIBS"
1399 cat > conftest.$ac_ext <<EOF
1400 #line 1401 "configure"
1401 #include "confdefs.h"
1402 /* Override any gcc2 internal prototype to avoid an error.  */
1403 /* We use char because int might match the return type of a gcc2
1404     builtin and then its argument prototype would still apply.  */
1405 char dnet_ntoa();
1406
1407 int main() {
1408 dnet_ntoa()
1409 ; return 0; }
1410 EOF
1411 if { (eval echo configure:1412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1412   rm -rf conftest*
1413   eval "ac_cv_lib_$ac_lib_var=yes"
1414 else
1415   echo "configure: failed program was:" >&5
1416   cat conftest.$ac_ext >&5
1417   rm -rf conftest*
1418   eval "ac_cv_lib_$ac_lib_var=no"
1419 fi
1420 rm -f conftest*
1421 LIBS="$ac_save_LIBS"
1422
1423 fi
1424 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1425   echo "$ac_t""yes" 1>&6
1426   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
1427 else
1428   echo "$ac_t""no" 1>&6
1429 fi
1430
1431     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
1432       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
1433 echo "configure:1434: checking for dnet_ntoa in -ldnet_stub" >&5
1434 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
1435 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1436   echo $ac_n "(cached) $ac_c" 1>&6
1437 else
1438   ac_save_LIBS="$LIBS"
1439 LIBS="-ldnet_stub  $LIBS"
1440 cat > conftest.$ac_ext <<EOF
1441 #line 1442 "configure"
1442 #include "confdefs.h"
1443 /* Override any gcc2 internal prototype to avoid an error.  */
1444 /* We use char because int might match the return type of a gcc2
1445     builtin and then its argument prototype would still apply.  */
1446 char dnet_ntoa();
1447
1448 int main() {
1449 dnet_ntoa()
1450 ; return 0; }
1451 EOF
1452 if { (eval echo configure:1453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1453   rm -rf conftest*
1454   eval "ac_cv_lib_$ac_lib_var=yes"
1455 else
1456   echo "configure: failed program was:" >&5
1457   cat conftest.$ac_ext >&5
1458   rm -rf conftest*
1459   eval "ac_cv_lib_$ac_lib_var=no"
1460 fi
1461 rm -f conftest*
1462 LIBS="$ac_save_LIBS"
1463
1464 fi
1465 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1466   echo "$ac_t""yes" 1>&6
1467   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
1468 else
1469   echo "$ac_t""no" 1>&6
1470 fi
1471
1472     fi
1473
1474     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
1475     # to get the SysV transport functions.
1476     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
1477     # needs -lnsl.
1478     # The nsl library prevents programs from opening the X display
1479     # on Irix 5.2, according to dickey@clark.net.
1480     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
1481 echo "configure:1482: checking for gethostbyname" >&5
1482 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
1483   echo $ac_n "(cached) $ac_c" 1>&6
1484 else
1485   cat > conftest.$ac_ext <<EOF
1486 #line 1487 "configure"
1487 #include "confdefs.h"
1488 /* System header to define __stub macros and hopefully few prototypes,
1489     which can conflict with char gethostbyname(); below.  */
1490 #include <assert.h>
1491 /* Override any gcc2 internal prototype to avoid an error.  */
1492 /* We use char because int might match the return type of a gcc2
1493     builtin and then its argument prototype would still apply.  */
1494 char gethostbyname();
1495
1496 int main() {
1497
1498 /* The GNU C library defines this for functions which it implements
1499     to always fail with ENOSYS.  Some functions are actually named
1500     something starting with __ and the normal name is an alias.  */
1501 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
1502 choke me
1503 #else
1504 gethostbyname();
1505 #endif
1506
1507 ; return 0; }
1508 EOF
1509 if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1510   rm -rf conftest*
1511   eval "ac_cv_func_gethostbyname=yes"
1512 else
1513   echo "configure: failed program was:" >&5
1514   cat conftest.$ac_ext >&5
1515   rm -rf conftest*
1516   eval "ac_cv_func_gethostbyname=no"
1517 fi
1518 rm -f conftest*
1519 fi
1520
1521 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
1522   echo "$ac_t""yes" 1>&6
1523   :
1524 else
1525   echo "$ac_t""no" 1>&6
1526 fi
1527
1528     if test $ac_cv_func_gethostbyname = no; then
1529       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
1530 echo "configure:1531: checking for gethostbyname in -lnsl" >&5
1531 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
1532 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1533   echo $ac_n "(cached) $ac_c" 1>&6
1534 else
1535   ac_save_LIBS="$LIBS"
1536 LIBS="-lnsl  $LIBS"
1537 cat > conftest.$ac_ext <<EOF
1538 #line 1539 "configure"
1539 #include "confdefs.h"
1540 /* Override any gcc2 internal prototype to avoid an error.  */
1541 /* We use char because int might match the return type of a gcc2
1542     builtin and then its argument prototype would still apply.  */
1543 char gethostbyname();
1544
1545 int main() {
1546 gethostbyname()
1547 ; return 0; }
1548 EOF
1549 if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1550   rm -rf conftest*
1551   eval "ac_cv_lib_$ac_lib_var=yes"
1552 else
1553   echo "configure: failed program was:" >&5
1554   cat conftest.$ac_ext >&5
1555   rm -rf conftest*
1556   eval "ac_cv_lib_$ac_lib_var=no"
1557 fi
1558 rm -f conftest*
1559 LIBS="$ac_save_LIBS"
1560
1561 fi
1562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1563   echo "$ac_t""yes" 1>&6
1564   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
1565 else
1566   echo "$ac_t""no" 1>&6
1567 fi
1568
1569     fi
1570
1571     # lieder@skyler.mavd.honeywell.com says without -lsocket,
1572     # socket/setsockopt and other routines are undefined under SCO ODT
1573     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
1574     # on later versions), says simon@lia.di.epfl.ch: it contains
1575     # gethostby* variants that don't use the nameserver (or something).
1576     # -lsocket must be given before -lnsl if both are needed.
1577     # We assume that if connect needs -lnsl, so does gethostbyname.
1578     echo $ac_n "checking for connect""... $ac_c" 1>&6
1579 echo "configure:1580: checking for connect" >&5
1580 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
1581   echo $ac_n "(cached) $ac_c" 1>&6
1582 else
1583   cat > conftest.$ac_ext <<EOF
1584 #line 1585 "configure"
1585 #include "confdefs.h"
1586 /* System header to define __stub macros and hopefully few prototypes,
1587     which can conflict with char connect(); below.  */
1588 #include <assert.h>
1589 /* Override any gcc2 internal prototype to avoid an error.  */
1590 /* We use char because int might match the return type of a gcc2
1591     builtin and then its argument prototype would still apply.  */
1592 char connect();
1593
1594 int main() {
1595
1596 /* The GNU C library defines this for functions which it implements
1597     to always fail with ENOSYS.  Some functions are actually named
1598     something starting with __ and the normal name is an alias.  */
1599 #if defined (__stub_connect) || defined (__stub___connect)
1600 choke me
1601 #else
1602 connect();
1603 #endif
1604
1605 ; return 0; }
1606 EOF
1607 if { (eval echo configure:1608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1608   rm -rf conftest*
1609   eval "ac_cv_func_connect=yes"
1610 else
1611   echo "configure: failed program was:" >&5
1612   cat conftest.$ac_ext >&5
1613   rm -rf conftest*
1614   eval "ac_cv_func_connect=no"
1615 fi
1616 rm -f conftest*
1617 fi
1618
1619 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
1620   echo "$ac_t""yes" 1>&6
1621   :
1622 else
1623   echo "$ac_t""no" 1>&6
1624 fi
1625
1626     if test $ac_cv_func_connect = no; then
1627       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
1628 echo "configure:1629: checking for connect in -lsocket" >&5
1629 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
1630 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1631   echo $ac_n "(cached) $ac_c" 1>&6
1632 else
1633   ac_save_LIBS="$LIBS"
1634 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
1635 cat > conftest.$ac_ext <<EOF
1636 #line 1637 "configure"
1637 #include "confdefs.h"
1638 /* Override any gcc2 internal prototype to avoid an error.  */
1639 /* We use char because int might match the return type of a gcc2
1640     builtin and then its argument prototype would still apply.  */
1641 char connect();
1642
1643 int main() {
1644 connect()
1645 ; return 0; }
1646 EOF
1647 if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1648   rm -rf conftest*
1649   eval "ac_cv_lib_$ac_lib_var=yes"
1650 else
1651   echo "configure: failed program was:" >&5
1652   cat conftest.$ac_ext >&5
1653   rm -rf conftest*
1654   eval "ac_cv_lib_$ac_lib_var=no"
1655 fi
1656 rm -f conftest*
1657 LIBS="$ac_save_LIBS"
1658
1659 fi
1660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1661   echo "$ac_t""yes" 1>&6
1662   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
1663 else
1664   echo "$ac_t""no" 1>&6
1665 fi
1666
1667     fi
1668
1669     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
1670     echo $ac_n "checking for remove""... $ac_c" 1>&6
1671 echo "configure:1672: checking for remove" >&5
1672 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
1673   echo $ac_n "(cached) $ac_c" 1>&6
1674 else
1675   cat > conftest.$ac_ext <<EOF
1676 #line 1677 "configure"
1677 #include "confdefs.h"
1678 /* System header to define __stub macros and hopefully few prototypes,
1679     which can conflict with char remove(); below.  */
1680 #include <assert.h>
1681 /* Override any gcc2 internal prototype to avoid an error.  */
1682 /* We use char because int might match the return type of a gcc2
1683     builtin and then its argument prototype would still apply.  */
1684 char remove();
1685
1686 int main() {
1687
1688 /* The GNU C library defines this for functions which it implements
1689     to always fail with ENOSYS.  Some functions are actually named
1690     something starting with __ and the normal name is an alias.  */
1691 #if defined (__stub_remove) || defined (__stub___remove)
1692 choke me
1693 #else
1694 remove();
1695 #endif
1696
1697 ; return 0; }
1698 EOF
1699 if { (eval echo configure:1700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1700   rm -rf conftest*
1701   eval "ac_cv_func_remove=yes"
1702 else
1703   echo "configure: failed program was:" >&5
1704   cat conftest.$ac_ext >&5
1705   rm -rf conftest*
1706   eval "ac_cv_func_remove=no"
1707 fi
1708 rm -f conftest*
1709 fi
1710
1711 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
1712   echo "$ac_t""yes" 1>&6
1713   :
1714 else
1715   echo "$ac_t""no" 1>&6
1716 fi
1717
1718     if test $ac_cv_func_remove = no; then
1719       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
1720 echo "configure:1721: checking for remove in -lposix" >&5
1721 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
1722 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1723   echo $ac_n "(cached) $ac_c" 1>&6
1724 else
1725   ac_save_LIBS="$LIBS"
1726 LIBS="-lposix  $LIBS"
1727 cat > conftest.$ac_ext <<EOF
1728 #line 1729 "configure"
1729 #include "confdefs.h"
1730 /* Override any gcc2 internal prototype to avoid an error.  */
1731 /* We use char because int might match the return type of a gcc2
1732     builtin and then its argument prototype would still apply.  */
1733 char remove();
1734
1735 int main() {
1736 remove()
1737 ; return 0; }
1738 EOF
1739 if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1740   rm -rf conftest*
1741   eval "ac_cv_lib_$ac_lib_var=yes"
1742 else
1743   echo "configure: failed program was:" >&5
1744   cat conftest.$ac_ext >&5
1745   rm -rf conftest*
1746   eval "ac_cv_lib_$ac_lib_var=no"
1747 fi
1748 rm -f conftest*
1749 LIBS="$ac_save_LIBS"
1750
1751 fi
1752 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1753   echo "$ac_t""yes" 1>&6
1754   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
1755 else
1756   echo "$ac_t""no" 1>&6
1757 fi
1758
1759     fi
1760
1761     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
1762     echo $ac_n "checking for shmat""... $ac_c" 1>&6
1763 echo "configure:1764: checking for shmat" >&5
1764 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
1765   echo $ac_n "(cached) $ac_c" 1>&6
1766 else
1767   cat > conftest.$ac_ext <<EOF
1768 #line 1769 "configure"
1769 #include "confdefs.h"
1770 /* System header to define __stub macros and hopefully few prototypes,
1771     which can conflict with char shmat(); below.  */
1772 #include <assert.h>
1773 /* Override any gcc2 internal prototype to avoid an error.  */
1774 /* We use char because int might match the return type of a gcc2
1775     builtin and then its argument prototype would still apply.  */
1776 char shmat();
1777
1778 int main() {
1779
1780 /* The GNU C library defines this for functions which it implements
1781     to always fail with ENOSYS.  Some functions are actually named
1782     something starting with __ and the normal name is an alias.  */
1783 #if defined (__stub_shmat) || defined (__stub___shmat)
1784 choke me
1785 #else
1786 shmat();
1787 #endif
1788
1789 ; return 0; }
1790 EOF
1791 if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1792   rm -rf conftest*
1793   eval "ac_cv_func_shmat=yes"
1794 else
1795   echo "configure: failed program was:" >&5
1796   cat conftest.$ac_ext >&5
1797   rm -rf conftest*
1798   eval "ac_cv_func_shmat=no"
1799 fi
1800 rm -f conftest*
1801 fi
1802
1803 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
1804   echo "$ac_t""yes" 1>&6
1805   :
1806 else
1807   echo "$ac_t""no" 1>&6
1808 fi
1809
1810     if test $ac_cv_func_shmat = no; then
1811       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
1812 echo "configure:1813: checking for shmat in -lipc" >&5
1813 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
1814 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1815   echo $ac_n "(cached) $ac_c" 1>&6
1816 else
1817   ac_save_LIBS="$LIBS"
1818 LIBS="-lipc  $LIBS"
1819 cat > conftest.$ac_ext <<EOF
1820 #line 1821 "configure"
1821 #include "confdefs.h"
1822 /* Override any gcc2 internal prototype to avoid an error.  */
1823 /* We use char because int might match the return type of a gcc2
1824     builtin and then its argument prototype would still apply.  */
1825 char shmat();
1826
1827 int main() {
1828 shmat()
1829 ; return 0; }
1830 EOF
1831 if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1832   rm -rf conftest*
1833   eval "ac_cv_lib_$ac_lib_var=yes"
1834 else
1835   echo "configure: failed program was:" >&5
1836   cat conftest.$ac_ext >&5
1837   rm -rf conftest*
1838   eval "ac_cv_lib_$ac_lib_var=no"
1839 fi
1840 rm -f conftest*
1841 LIBS="$ac_save_LIBS"
1842
1843 fi
1844 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1845   echo "$ac_t""yes" 1>&6
1846   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
1847 else
1848   echo "$ac_t""no" 1>&6
1849 fi
1850
1851     fi
1852   fi
1853
1854   # Check for libraries that X11R6 Xt/Xaw programs need.
1855   ac_save_LDFLAGS="$LDFLAGS"
1856   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
1857   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1858   # check for ICE first), but we must link in the order -lSM -lICE or
1859   # we get undefined symbols.  So assume we have SM if we have ICE.
1860   # These have to be linked with before -lX11, unlike the other
1861   # libraries we check for below, so use a different variable.
1862   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1863   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
1864 echo "configure:1865: checking for IceConnectionNumber in -lICE" >&5
1865 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
1866 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1867   echo $ac_n "(cached) $ac_c" 1>&6
1868 else
1869   ac_save_LIBS="$LIBS"
1870 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
1871 cat > conftest.$ac_ext <<EOF
1872 #line 1873 "configure"
1873 #include "confdefs.h"
1874 /* Override any gcc2 internal prototype to avoid an error.  */
1875 /* We use char because int might match the return type of a gcc2
1876     builtin and then its argument prototype would still apply.  */
1877 char IceConnectionNumber();
1878
1879 int main() {
1880 IceConnectionNumber()
1881 ; return 0; }
1882 EOF
1883 if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1884   rm -rf conftest*
1885   eval "ac_cv_lib_$ac_lib_var=yes"
1886 else
1887   echo "configure: failed program was:" >&5
1888   cat conftest.$ac_ext >&5
1889   rm -rf conftest*
1890   eval "ac_cv_lib_$ac_lib_var=no"
1891 fi
1892 rm -f conftest*
1893 LIBS="$ac_save_LIBS"
1894
1895 fi
1896 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1897   echo "$ac_t""yes" 1>&6
1898   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
1899 else
1900   echo "$ac_t""no" 1>&6
1901 fi
1902
1903   LDFLAGS="$ac_save_LDFLAGS"
1904
1905 fi
1906
1907
1908
1909 #
1910 # Check for other libraries.
1911 #
1912
1913 echo $ac_n "checking for clrtoeol in -lcurses""... $ac_c" 1>&6
1914 echo "configure:1915: checking for clrtoeol in -lcurses" >&5
1915 ac_lib_var=`echo curses'_'clrtoeol | sed 'y%./+-%__p_%'`
1916 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1917   echo $ac_n "(cached) $ac_c" 1>&6
1918 else
1919   ac_save_LIBS="$LIBS"
1920 LIBS="-lcurses  $LIBS"
1921 cat > conftest.$ac_ext <<EOF
1922 #line 1923 "configure"
1923 #include "confdefs.h"
1924 /* Override any gcc2 internal prototype to avoid an error.  */
1925 /* We use char because int might match the return type of a gcc2
1926     builtin and then its argument prototype would still apply.  */
1927 char clrtoeol();
1928
1929 int main() {
1930 clrtoeol()
1931 ; return 0; }
1932 EOF
1933 if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1934   rm -rf conftest*
1935   eval "ac_cv_lib_$ac_lib_var=yes"
1936 else
1937   echo "configure: failed program was:" >&5
1938   cat conftest.$ac_ext >&5
1939   rm -rf conftest*
1940   eval "ac_cv_lib_$ac_lib_var=no"
1941 fi
1942 rm -f conftest*
1943 LIBS="$ac_save_LIBS"
1944
1945 fi
1946 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1947   echo "$ac_t""yes" 1>&6
1948     ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1949     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1950   cat >> confdefs.h <<EOF
1951 #define $ac_tr_lib 1
1952 EOF
1953
1954   LIBS="-lcurses $LIBS"
1955
1956 else
1957   echo "$ac_t""no" 1>&6
1958 fi
1959
1960 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
1961 echo "configure:1962: checking for pow in -lm" >&5
1962 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
1963 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1964   echo $ac_n "(cached) $ac_c" 1>&6
1965 else
1966   ac_save_LIBS="$LIBS"
1967 LIBS="-lm  $LIBS"
1968 cat > conftest.$ac_ext <<EOF
1969 #line 1970 "configure"
1970 #include "confdefs.h"
1971 /* Override any gcc2 internal prototype to avoid an error.  */
1972 /* We use char because int might match the return type of a gcc2
1973     builtin and then its argument prototype would still apply.  */
1974 char pow();
1975
1976 int main() {
1977 pow()
1978 ; return 0; }
1979 EOF
1980 if { (eval echo configure:1981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1981   rm -rf conftest*
1982   eval "ac_cv_lib_$ac_lib_var=yes"
1983 else
1984   echo "configure: failed program was:" >&5
1985   cat conftest.$ac_ext >&5
1986   rm -rf conftest*
1987   eval "ac_cv_lib_$ac_lib_var=no"
1988 fi
1989 rm -f conftest*
1990 LIBS="$ac_save_LIBS"
1991
1992 fi
1993 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1994   echo "$ac_t""yes" 1>&6
1995     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1996     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1997   cat >> confdefs.h <<EOF
1998 #define $ac_tr_lib 1
1999 EOF
2000
2001   LIBS="-lm $LIBS"
2002
2003 else
2004   echo "$ac_t""no" 1>&6
2005 fi
2006
2007 echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
2008 echo "configure:2009: checking for tgoto in -ltermcap" >&5
2009 ac_lib_var=`echo termcap'_'tgoto | sed 'y%./+-%__p_%'`
2010 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   ac_save_LIBS="$LIBS"
2014 LIBS="-ltermcap  $LIBS"
2015 cat > conftest.$ac_ext <<EOF
2016 #line 2017 "configure"
2017 #include "confdefs.h"
2018 /* Override any gcc2 internal prototype to avoid an error.  */
2019 /* We use char because int might match the return type of a gcc2
2020     builtin and then its argument prototype would still apply.  */
2021 char tgoto();
2022
2023 int main() {
2024 tgoto()
2025 ; return 0; }
2026 EOF
2027 if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2028   rm -rf conftest*
2029   eval "ac_cv_lib_$ac_lib_var=yes"
2030 else
2031   echo "configure: failed program was:" >&5
2032   cat conftest.$ac_ext >&5
2033   rm -rf conftest*
2034   eval "ac_cv_lib_$ac_lib_var=no"
2035 fi
2036 rm -f conftest*
2037 LIBS="$ac_save_LIBS"
2038
2039 fi
2040 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2041   echo "$ac_t""yes" 1>&6
2042     ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2043     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2044   cat >> confdefs.h <<EOF
2045 #define $ac_tr_lib 1
2046 EOF
2047
2048   LIBS="-ltermcap $LIBS"
2049
2050 else
2051   echo "$ac_t""no" 1>&6
2052 fi
2053
2054
2055
2056 #
2057 # C compiler warnings.
2058 #
2059
2060 if [ $ac_cv_prog_gcc = yes ]
2061 then
2062 WARNINGS="-Wall -Wno-implicit-int"
2063 CEXTRAFLAGS="-fsigned-char -funroll-loops \$(HASH)"
2064 else
2065 # Who knows what warnings your compiler uses?
2066 WARNINGS=
2067 CEXTRAFLAGS="\$(HASH)"
2068 fi
2069
2070
2071
2072
2073
2074 #
2075 # Check for header files.
2076 #
2077
2078 echo
2079 echo $ac_n "checking for header files""... $ac_c" 1>&6
2080 echo "configure:2081: checking for header files" >&5
2081 echo
2082
2083 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2084 echo "configure:2085: checking for ANSI C header files" >&5
2085 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2086   echo $ac_n "(cached) $ac_c" 1>&6
2087 else
2088   cat > conftest.$ac_ext <<EOF
2089 #line 2090 "configure"
2090 #include "confdefs.h"
2091 #include <stdlib.h>
2092 #include <stdarg.h>
2093 #include <string.h>
2094 #include <float.h>
2095 EOF
2096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2097 { (eval echo configure:2098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2098 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2099 if test -z "$ac_err"; then
2100   rm -rf conftest*
2101   ac_cv_header_stdc=yes
2102 else
2103   echo "$ac_err" >&5
2104   echo "configure: failed program was:" >&5
2105   cat conftest.$ac_ext >&5
2106   rm -rf conftest*
2107   ac_cv_header_stdc=no
2108 fi
2109 rm -f conftest*
2110
2111 if test $ac_cv_header_stdc = yes; then
2112   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2113 cat > conftest.$ac_ext <<EOF
2114 #line 2115 "configure"
2115 #include "confdefs.h"
2116 #include <string.h>
2117 EOF
2118 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2119   egrep "memchr" >/dev/null 2>&1; then
2120   :
2121 else
2122   rm -rf conftest*
2123   ac_cv_header_stdc=no
2124 fi
2125 rm -f conftest*
2126
2127 fi
2128
2129 if test $ac_cv_header_stdc = yes; then
2130   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2131 cat > conftest.$ac_ext <<EOF
2132 #line 2133 "configure"
2133 #include "confdefs.h"
2134 #include <stdlib.h>
2135 EOF
2136 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2137   egrep "free" >/dev/null 2>&1; then
2138   :
2139 else
2140   rm -rf conftest*
2141   ac_cv_header_stdc=no
2142 fi
2143 rm -f conftest*
2144
2145 fi
2146
2147 if test $ac_cv_header_stdc = yes; then
2148   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2149 if test "$cross_compiling" = yes; then
2150   :
2151 else
2152   cat > conftest.$ac_ext <<EOF
2153 #line 2154 "configure"
2154 #include "confdefs.h"
2155 #include <ctype.h>
2156 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2157 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2158 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2159 int main () { int i; for (i = 0; i < 256; i++)
2160 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2161 exit (0); }
2162
2163 EOF
2164 if { (eval echo configure:2165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2165 then
2166   :
2167 else
2168   echo "configure: failed program was:" >&5
2169   cat conftest.$ac_ext >&5
2170   rm -fr conftest*
2171   ac_cv_header_stdc=no
2172 fi
2173 rm -fr conftest*
2174 fi
2175
2176 fi
2177 fi
2178
2179 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2180 if test $ac_cv_header_stdc = yes; then
2181   cat >> confdefs.h <<\EOF
2182 #define STDC_HEADERS 1
2183 EOF
2184
2185 fi
2186
2187 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
2188 echo "configure:2189: checking for sys/wait.h that is POSIX.1 compatible" >&5
2189 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
2190   echo $ac_n "(cached) $ac_c" 1>&6
2191 else
2192   cat > conftest.$ac_ext <<EOF
2193 #line 2194 "configure"
2194 #include "confdefs.h"
2195 #include <sys/types.h>
2196 #include <sys/wait.h>
2197 #ifndef WEXITSTATUS
2198 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
2199 #endif
2200 #ifndef WIFEXITED
2201 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
2202 #endif
2203 int main() {
2204 int s;
2205 wait (&s);
2206 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
2207 ; return 0; }
2208 EOF
2209 if { (eval echo configure:2210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2210   rm -rf conftest*
2211   ac_cv_header_sys_wait_h=yes
2212 else
2213   echo "configure: failed program was:" >&5
2214   cat conftest.$ac_ext >&5
2215   rm -rf conftest*
2216   ac_cv_header_sys_wait_h=no
2217 fi
2218 rm -f conftest*
2219 fi
2220
2221 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
2222 if test $ac_cv_header_sys_wait_h = yes; then
2223   cat >> confdefs.h <<\EOF
2224 #define HAVE_SYS_WAIT_H 1
2225 EOF
2226
2227 fi
2228
2229 for ac_hdr in fcntl.h sys/file.h sys/ioctl.h sys/time.h unistd.h
2230 do
2231 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2232 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2233 echo "configure:2234: checking for $ac_hdr" >&5
2234 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2235   echo $ac_n "(cached) $ac_c" 1>&6
2236 else
2237   cat > conftest.$ac_ext <<EOF
2238 #line 2239 "configure"
2239 #include "confdefs.h"
2240 #include <$ac_hdr>
2241 EOF
2242 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2243 { (eval echo configure:2244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2244 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2245 if test -z "$ac_err"; then
2246   rm -rf conftest*
2247   eval "ac_cv_header_$ac_safe=yes"
2248 else
2249   echo "$ac_err" >&5
2250   echo "configure: failed program was:" >&5
2251   cat conftest.$ac_ext >&5
2252   rm -rf conftest*
2253   eval "ac_cv_header_$ac_safe=no"
2254 fi
2255 rm -f conftest*
2256 fi
2257 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2258   echo "$ac_t""yes" 1>&6
2259     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2260   cat >> confdefs.h <<EOF
2261 #define $ac_tr_hdr 1
2262 EOF
2263  
2264 else
2265   echo "$ac_t""no" 1>&6
2266 fi
2267 done
2268
2269 for ac_hdr in time.h sys/time.h sys/filio.h
2270 do
2271 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2272 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2273 echo "configure:2274: checking for $ac_hdr" >&5
2274 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2275   echo $ac_n "(cached) $ac_c" 1>&6
2276 else
2277   cat > conftest.$ac_ext <<EOF
2278 #line 2279 "configure"
2279 #include "confdefs.h"
2280 #include <$ac_hdr>
2281 EOF
2282 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2283 { (eval echo configure:2284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2284 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2285 if test -z "$ac_err"; then
2286   rm -rf conftest*
2287   eval "ac_cv_header_$ac_safe=yes"
2288 else
2289   echo "$ac_err" >&5
2290   echo "configure: failed program was:" >&5
2291   cat conftest.$ac_ext >&5
2292   rm -rf conftest*
2293   eval "ac_cv_header_$ac_safe=no"
2294 fi
2295 rm -f conftest*
2296 fi
2297 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2298   echo "$ac_t""yes" 1>&6
2299     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2300   cat >> confdefs.h <<EOF
2301 #define $ac_tr_hdr 1
2302 EOF
2303  
2304 else
2305   echo "$ac_t""no" 1>&6
2306 fi
2307 done
2308
2309 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
2310 echo "configure:2311: checking whether time.h and sys/time.h may both be included" >&5
2311 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2312   echo $ac_n "(cached) $ac_c" 1>&6
2313 else
2314   cat > conftest.$ac_ext <<EOF
2315 #line 2316 "configure"
2316 #include "confdefs.h"
2317 #include <sys/types.h>
2318 #include <sys/time.h>
2319 #include <time.h>
2320 int main() {
2321 struct tm *tp;
2322 ; return 0; }
2323 EOF
2324 if { (eval echo configure:2325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2325   rm -rf conftest*
2326   ac_cv_header_time=yes
2327 else
2328   echo "configure: failed program was:" >&5
2329   cat conftest.$ac_ext >&5
2330   rm -rf conftest*
2331   ac_cv_header_time=no
2332 fi
2333 rm -f conftest*
2334 fi
2335
2336 echo "$ac_t""$ac_cv_header_time" 1>&6
2337 if test $ac_cv_header_time = yes; then
2338   cat >> confdefs.h <<\EOF
2339 #define TIME_WITH_SYS_TIME 1
2340 EOF
2341
2342 fi
2343
2344
2345
2346 #
2347 # Check for typedefs, structures, and compiler characteristics.
2348 #
2349
2350 echo 
2351 echo $ac_n "checking for typedefs""... $ac_c" 1>&6
2352 echo "configure:2353: checking for typedefs" >&5
2353 echo
2354
2355 echo $ac_n "checking for working const""... $ac_c" 1>&6
2356 echo "configure:2357: checking for working const" >&5
2357 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
2358   echo $ac_n "(cached) $ac_c" 1>&6
2359 else
2360   cat > conftest.$ac_ext <<EOF
2361 #line 2362 "configure"
2362 #include "confdefs.h"
2363
2364 int main() {
2365
2366 /* Ultrix mips cc rejects this.  */
2367 typedef int charset[2]; const charset x;
2368 /* SunOS 4.1.1 cc rejects this.  */
2369 char const *const *ccp;
2370 char **p;
2371 /* NEC SVR4.0.2 mips cc rejects this.  */
2372 struct point {int x, y;};
2373 static struct point const zero = {0,0};
2374 /* AIX XL C 1.02.0.0 rejects this.
2375    It does not let you subtract one const X* pointer from another in an arm
2376    of an if-expression whose if-part is not a constant expression */
2377 const char *g = "string";
2378 ccp = &g + (g ? g-g : 0);
2379 /* HPUX 7.0 cc rejects these. */
2380 ++ccp;
2381 p = (char**) ccp;
2382 ccp = (char const *const *) p;
2383 { /* SCO 3.2v4 cc rejects this.  */
2384   char *t;
2385   char const *s = 0 ? (char *) 0 : (char const *) 0;
2386
2387   *t++ = 0;
2388 }
2389 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
2390   int x[] = {25, 17};
2391   const int *foo = &x[0];
2392   ++foo;
2393 }
2394 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2395   typedef const int *iptr;
2396   iptr p = 0;
2397   ++p;
2398 }
2399 { /* AIX XL C 1.02.0.0 rejects this saying
2400      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2401   struct s { int j; const int *ap[3]; };
2402   struct s *b; b->j = 5;
2403 }
2404 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2405   const int foo = 10;
2406 }
2407
2408 ; return 0; }
2409 EOF
2410 if { (eval echo configure:2411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2411   rm -rf conftest*
2412   ac_cv_c_const=yes
2413 else
2414   echo "configure: failed program was:" >&5
2415   cat conftest.$ac_ext >&5
2416   rm -rf conftest*
2417   ac_cv_c_const=no
2418 fi
2419 rm -f conftest*
2420 fi
2421
2422 echo "$ac_t""$ac_cv_c_const" 1>&6
2423 if test $ac_cv_c_const = no; then
2424   cat >> confdefs.h <<\EOF
2425 #define const 
2426 EOF
2427
2428 fi
2429
2430 echo $ac_n "checking for size_t""... $ac_c" 1>&6
2431 echo "configure:2432: checking for size_t" >&5
2432 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
2433   echo $ac_n "(cached) $ac_c" 1>&6
2434 else
2435   cat > conftest.$ac_ext <<EOF
2436 #line 2437 "configure"
2437 #include "confdefs.h"
2438 #include <sys/types.h>
2439 #if STDC_HEADERS
2440 #include <stdlib.h>
2441 #include <stddef.h>
2442 #endif
2443 EOF
2444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2445   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2446   rm -rf conftest*
2447   ac_cv_type_size_t=yes
2448 else
2449   rm -rf conftest*
2450   ac_cv_type_size_t=no
2451 fi
2452 rm -f conftest*
2453
2454 fi
2455 echo "$ac_t""$ac_cv_type_size_t" 1>&6
2456 if test $ac_cv_type_size_t = no; then
2457   cat >> confdefs.h <<\EOF
2458 #define size_t unsigned
2459 EOF
2460
2461 fi
2462
2463 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
2464 echo "configure:2465: checking whether time.h and sys/time.h may both be included" >&5
2465 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2466   echo $ac_n "(cached) $ac_c" 1>&6
2467 else
2468   cat > conftest.$ac_ext <<EOF
2469 #line 2470 "configure"
2470 #include "confdefs.h"
2471 #include <sys/types.h>
2472 #include <sys/time.h>
2473 #include <time.h>
2474 int main() {
2475 struct tm *tp;
2476 ; return 0; }
2477 EOF
2478 if { (eval echo configure:2479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2479   rm -rf conftest*
2480   ac_cv_header_time=yes
2481 else
2482   echo "configure: failed program was:" >&5
2483   cat conftest.$ac_ext >&5
2484   rm -rf conftest*
2485   ac_cv_header_time=no
2486 fi
2487 rm -f conftest*
2488 fi
2489
2490 echo "$ac_t""$ac_cv_header_time" 1>&6
2491 if test $ac_cv_header_time = yes; then
2492   cat >> confdefs.h <<\EOF
2493 #define TIME_WITH_SYS_TIME 1
2494 EOF
2495
2496 fi
2497
2498 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
2499 echo "configure:2500: checking whether struct tm is in sys/time.h or time.h" >&5
2500 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
2501   echo $ac_n "(cached) $ac_c" 1>&6
2502 else
2503   cat > conftest.$ac_ext <<EOF
2504 #line 2505 "configure"
2505 #include "confdefs.h"
2506 #include <sys/types.h>
2507 #include <time.h>
2508 int main() {
2509 struct tm *tp; tp->tm_sec;
2510 ; return 0; }
2511 EOF
2512 if { (eval echo configure:2513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2513   rm -rf conftest*
2514   ac_cv_struct_tm=time.h
2515 else
2516   echo "configure: failed program was:" >&5
2517   cat conftest.$ac_ext >&5
2518   rm -rf conftest*
2519   ac_cv_struct_tm=sys/time.h
2520 fi
2521 rm -f conftest*
2522 fi
2523
2524 echo "$ac_t""$ac_cv_struct_tm" 1>&6
2525 if test $ac_cv_struct_tm = sys/time.h; then
2526   cat >> confdefs.h <<\EOF
2527 #define TM_IN_SYS_TIME 1
2528 EOF
2529
2530 fi
2531
2532
2533 echo 
2534 echo $ac_n "checking for compiler characteristics""... $ac_c" 1>&6
2535 echo "configure:2536: checking for compiler characteristics" >&5
2536 echo
2537
2538 echo $ac_n "checking size of long""... $ac_c" 1>&6
2539 echo "configure:2540: checking size of long" >&5
2540 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
2541   echo $ac_n "(cached) $ac_c" 1>&6
2542 else
2543   if test "$cross_compiling" = yes; then
2544     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2545 else
2546   cat > conftest.$ac_ext <<EOF
2547 #line 2548 "configure"
2548 #include "confdefs.h"
2549 #include <stdio.h>
2550 main()
2551 {
2552   FILE *f=fopen("conftestval", "w");
2553   if (!f) exit(1);
2554   fprintf(f, "%d\n", sizeof(long));
2555   exit(0);
2556 }
2557 EOF
2558 if { (eval echo configure:2559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2559 then
2560   ac_cv_sizeof_long=`cat conftestval`
2561 else
2562   echo "configure: failed program was:" >&5
2563   cat conftest.$ac_ext >&5
2564   rm -fr conftest*
2565   ac_cv_sizeof_long=0
2566 fi
2567 rm -fr conftest*
2568 fi
2569
2570 fi
2571 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
2572 cat >> confdefs.h <<EOF
2573 #define SIZEOF_LONG $ac_cv_sizeof_long
2574 EOF
2575
2576
2577
2578
2579 #
2580 # Check for library functions.
2581 #
2582
2583 echo
2584 echo $ac_n "checking for library functions""... $ac_c" 1>&6
2585 echo "configure:2586: checking for library functions" >&5
2586 echo
2587
2588 echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
2589 echo "configure:2590: checking whether setvbuf arguments are reversed" >&5
2590 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
2591   echo $ac_n "(cached) $ac_c" 1>&6
2592 else
2593   if test "$cross_compiling" = yes; then
2594     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2595 else
2596   cat > conftest.$ac_ext <<EOF
2597 #line 2598 "configure"
2598 #include "confdefs.h"
2599 #include <stdio.h>
2600 /* If setvbuf has the reversed format, exit 0. */
2601 main () {
2602   /* This call has the arguments reversed.
2603      A reversed system may check and see that the address of main
2604      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
2605   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
2606     exit(1);
2607   putc('\r', stdout);
2608   exit(0);                      /* Non-reversed systems segv here.  */
2609 }
2610 EOF
2611 if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2612 then
2613   ac_cv_func_setvbuf_reversed=yes
2614 else
2615   echo "configure: failed program was:" >&5
2616   cat conftest.$ac_ext >&5
2617   rm -fr conftest*
2618   ac_cv_func_setvbuf_reversed=no
2619 fi
2620 rm -fr conftest*
2621 fi
2622
2623 rm -f core core.* *.core
2624 fi
2625
2626 echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6
2627 if test $ac_cv_func_setvbuf_reversed = yes; then
2628   cat >> confdefs.h <<\EOF
2629 #define SETVBUF_REVERSED 1
2630 EOF
2631
2632 fi
2633
2634 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2635 echo "configure:2636: checking return type of signal handlers" >&5
2636 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2637   echo $ac_n "(cached) $ac_c" 1>&6
2638 else
2639   cat > conftest.$ac_ext <<EOF
2640 #line 2641 "configure"
2641 #include "confdefs.h"
2642 #include <sys/types.h>
2643 #include <signal.h>
2644 #ifdef signal
2645 #undef signal
2646 #endif
2647 #ifdef __cplusplus
2648 extern "C" void (*signal (int, void (*)(int)))(int);
2649 #else
2650 void (*signal ()) ();
2651 #endif
2652
2653 int main() {
2654 int i;
2655 ; return 0; }
2656 EOF
2657 if { (eval echo configure:2658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2658   rm -rf conftest*
2659   ac_cv_type_signal=void
2660 else
2661   echo "configure: failed program was:" >&5
2662   cat conftest.$ac_ext >&5
2663   rm -rf conftest*
2664   ac_cv_type_signal=int
2665 fi
2666 rm -f conftest*
2667 fi
2668
2669 echo "$ac_t""$ac_cv_type_signal" 1>&6
2670 cat >> confdefs.h <<EOF
2671 #define RETSIGTYPE $ac_cv_type_signal
2672 EOF
2673
2674
2675 for ac_func in gethostname gettimeofday strstr strtol
2676 do
2677 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2678 echo "configure:2679: checking for $ac_func" >&5
2679 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2680   echo $ac_n "(cached) $ac_c" 1>&6
2681 else
2682   cat > conftest.$ac_ext <<EOF
2683 #line 2684 "configure"
2684 #include "confdefs.h"
2685 /* System header to define __stub macros and hopefully few prototypes,
2686     which can conflict with char $ac_func(); below.  */
2687 #include <assert.h>
2688 /* Override any gcc2 internal prototype to avoid an error.  */
2689 /* We use char because int might match the return type of a gcc2
2690     builtin and then its argument prototype would still apply.  */
2691 char $ac_func();
2692
2693 int main() {
2694
2695 /* The GNU C library defines this for functions which it implements
2696     to always fail with ENOSYS.  Some functions are actually named
2697     something starting with __ and the normal name is an alias.  */
2698 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2699 choke me
2700 #else
2701 $ac_func();
2702 #endif
2703
2704 ; return 0; }
2705 EOF
2706 if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2707   rm -rf conftest*
2708   eval "ac_cv_func_$ac_func=yes"
2709 else
2710   echo "configure: failed program was:" >&5
2711   cat conftest.$ac_ext >&5
2712   rm -rf conftest*
2713   eval "ac_cv_func_$ac_func=no"
2714 fi
2715 rm -f conftest*
2716 fi
2717
2718 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2719   echo "$ac_t""yes" 1>&6
2720     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2721   cat >> confdefs.h <<EOF
2722 #define $ac_tr_func 1
2723 EOF
2724  
2725 else
2726   echo "$ac_t""no" 1>&6
2727 fi
2728 done
2729
2730 for ac_func in memcpy bcopy
2731 do
2732 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2733 echo "configure:2734: checking for $ac_func" >&5
2734 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2735   echo $ac_n "(cached) $ac_c" 1>&6
2736 else
2737   cat > conftest.$ac_ext <<EOF
2738 #line 2739 "configure"
2739 #include "confdefs.h"
2740 /* System header to define __stub macros and hopefully few prototypes,
2741     which can conflict with char $ac_func(); below.  */
2742 #include <assert.h>
2743 /* Override any gcc2 internal prototype to avoid an error.  */
2744 /* We use char because int might match the return type of a gcc2
2745     builtin and then its argument prototype would still apply.  */
2746 char $ac_func();
2747
2748 int main() {
2749
2750 /* The GNU C library defines this for functions which it implements
2751     to always fail with ENOSYS.  Some functions are actually named
2752     something starting with __ and the normal name is an alias.  */
2753 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2754 choke me
2755 #else
2756 $ac_func();
2757 #endif
2758
2759 ; return 0; }
2760 EOF
2761 if { (eval echo configure:2762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2762   rm -rf conftest*
2763   eval "ac_cv_func_$ac_func=yes"
2764 else
2765   echo "configure: failed program was:" >&5
2766   cat conftest.$ac_ext >&5
2767   rm -rf conftest*
2768   eval "ac_cv_func_$ac_func=no"
2769 fi
2770 rm -f conftest*
2771 fi
2772
2773 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2774   echo "$ac_t""yes" 1>&6
2775     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2776   cat >> confdefs.h <<EOF
2777 #define $ac_tr_func 1
2778 EOF
2779  
2780 else
2781   echo "$ac_t""no" 1>&6
2782 fi
2783 done
2784
2785 for ac_func in setlinebuf setvbuf
2786 do
2787 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2788 echo "configure:2789: checking for $ac_func" >&5
2789 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2790   echo $ac_n "(cached) $ac_c" 1>&6
2791 else
2792   cat > conftest.$ac_ext <<EOF
2793 #line 2794 "configure"
2794 #include "confdefs.h"
2795 /* System header to define __stub macros and hopefully few prototypes,
2796     which can conflict with char $ac_func(); below.  */
2797 #include <assert.h>
2798 /* Override any gcc2 internal prototype to avoid an error.  */
2799 /* We use char because int might match the return type of a gcc2
2800     builtin and then its argument prototype would still apply.  */
2801 char $ac_func();
2802
2803 int main() {
2804
2805 /* The GNU C library defines this for functions which it implements
2806     to always fail with ENOSYS.  Some functions are actually named
2807     something starting with __ and the normal name is an alias.  */
2808 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2809 choke me
2810 #else
2811 $ac_func();
2812 #endif
2813
2814 ; return 0; }
2815 EOF
2816 if { (eval echo configure:2817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2817   rm -rf conftest*
2818   eval "ac_cv_func_$ac_func=yes"
2819 else
2820   echo "configure: failed program was:" >&5
2821   cat conftest.$ac_ext >&5
2822   rm -rf conftest*
2823   eval "ac_cv_func_$ac_func=no"
2824 fi
2825 rm -f conftest*
2826 fi
2827
2828 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2829   echo "$ac_t""yes" 1>&6
2830     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2831   cat >> confdefs.h <<EOF
2832 #define $ac_tr_func 1
2833 EOF
2834  
2835 else
2836   echo "$ac_t""no" 1>&6
2837 fi
2838 done
2839
2840
2841
2842 #
2843 # Set various user-definable options.
2844 #
2845 # Valid OPT settings:
2846 # --with-top-part-bitmaps
2847 #
2848 # Other settings:
2849 # --with-first-shogi-program=PROGNAME
2850 # --with-second-shogi-program=PROGNAME
2851 # --with-first-host=HOSTNAME
2852 # --with-second-host=HOSTNAME
2853 #
2854
2855 OPT=
2856 FIRST_SHOGI_PROGRAM=gnushogi
2857 SECOND_SHOGI_PROGRAM=gnushogi
2858 FIRST_HOST=localhost
2859 SECOND_HOST=localhost
2860
2861 # Check whether --with-top-part-bitmaps or --without-top-part-bitmaps was given.
2862 if test "${with_top_part_bitmaps+set}" = set; then
2863   withval="$with_top_part_bitmaps"
2864   OPT=-DTOP_PART_BITMAPS
2865 fi
2866
2867
2868 # Check whether --with-first-shogi-program or --without-first-shogi-program was given.
2869 if test "${with_first_shogi_program+set}" = set; then
2870   withval="$with_first_shogi_program"
2871   FIRST_SHOGI_PROGRAM=$withval
2872 fi
2873
2874
2875 # Check whether --with-second-shogi-program or --without-second-shogi-program was given.
2876 if test "${with_second_shogi_program+set}" = set; then
2877   withval="$with_second_shogi_program"
2878   SECOND_SHOGI_PROGRAM=$withval
2879 fi
2880
2881
2882 # Check whether --with-first-host or --without-first-host was given.
2883 if test "${with_first_host+set}" = set; then
2884   withval="$with_first_host"
2885   FIRST_HOST=$withval
2886 fi
2887
2888
2889 # Check whether --with-second-host or --without-second-host was given.
2890 if test "${with_second_host+set}" = set; then
2891   withval="$with_second_host"
2892   SECOND_HOST=$withval
2893 fi
2894
2895
2896 # Check whether --with-xshogi or --without-xshogi was given.
2897 if test "${with_xshogi+set}" = set; then
2898   withval="$with_xshogi"
2899   with_xshogi=$withval
2900 else
2901   with_xshogi=yes
2902 fi
2903
2904
2905
2906
2907
2908
2909
2910
2911 if [ $with_xshogi = yes ]
2912 then
2913 XSHOGI=xshogi_compile
2914 XSHOGIINSTALL=xshogi_install
2915 XSHOGICLEAN=xshogi_clean
2916 else
2917 XSHOGI=
2918 XSHOGIINSTALL=
2919 XSHOGICLEAN=
2920 fi
2921
2922
2923
2924
2925
2926
2927 echo
2928 echo outputting files...
2929
2930 trap '' 1 2 15
2931 cat > confcache <<\EOF
2932 # This file is a shell script that caches the results of configure
2933 # tests run on this system so they can be shared between configure
2934 # scripts and configure runs.  It is not useful on other systems.
2935 # If it contains results you don't want to keep, you may remove or edit it.
2936 #
2937 # By default, configure uses ./config.cache as the cache file,
2938 # creating it if it does not exist already.  You can give configure
2939 # the --cache-file=FILE option to use a different cache file; that is
2940 # what configure does when it calls configure scripts in
2941 # subdirectories, so they share the cache.
2942 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2943 # config.status only pays attention to the cache file if you give it the
2944 # --recheck option to rerun configure.
2945 #
2946 EOF
2947 # The following way of writing the cache mishandles newlines in values,
2948 # but we know of no workaround that is simple, portable, and efficient.
2949 # So, don't put newlines in cache variables' values.
2950 # Ultrix sh set writes to stderr and can't be redirected directly,
2951 # and sets the high bit in the cache file unless we assign to the vars.
2952 (set) 2>&1 |
2953   case `(ac_space=' '; set | grep ac_space) 2>&1` in
2954   *ac_space=\ *)
2955     # `set' does not quote correctly, so add quotes (double-quote substitution
2956     # turns \\\\ into \\, and sed turns \\ into \).
2957     sed -n \
2958       -e "s/'/'\\\\''/g" \
2959       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2960     ;;
2961   *)
2962     # `set' quotes correctly as required by POSIX, so do not add quotes.
2963     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2964     ;;
2965   esac >> confcache
2966 if cmp -s $cache_file confcache; then
2967   :
2968 else
2969   if test -w $cache_file; then
2970     echo "updating cache $cache_file"
2971     cat confcache > $cache_file
2972   else
2973     echo "not updating unwritable cache $cache_file"
2974   fi
2975 fi
2976 rm -f confcache
2977
2978 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2979
2980 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2981 # Let make expand exec_prefix.
2982 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2983
2984 # Any assignment to VPATH causes Sun make to only execute
2985 # the first set of double-colon rules, so remove it if not needed.
2986 # If there is a colon in the path, we need to keep it.
2987 if test "x$srcdir" = x.; then
2988   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2989 fi
2990
2991 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2992
2993 DEFS=-DHAVE_CONFIG_H
2994
2995 # Without the "./", some shells look in PATH for config.status.
2996 : ${CONFIG_STATUS=./config.status}
2997
2998 echo creating $CONFIG_STATUS
2999 rm -f $CONFIG_STATUS
3000 cat > $CONFIG_STATUS <<EOF
3001 #! /bin/sh
3002 # Generated automatically by configure.
3003 # Run this file to recreate the current configuration.
3004 # This directory was configured as follows,
3005 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3006 #
3007 # $0 $ac_configure_args
3008 #
3009 # Compiler output produced by configure, useful for debugging
3010 # configure, is in ./config.log if it exists.
3011
3012 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3013 for ac_option
3014 do
3015   case "\$ac_option" in
3016   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3017     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3018     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3019   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3020     echo "$CONFIG_STATUS generated by autoconf version 2.13"
3021     exit 0 ;;
3022   -help | --help | --hel | --he | --h)
3023     echo "\$ac_cs_usage"; exit 0 ;;
3024   *) echo "\$ac_cs_usage"; exit 1 ;;
3025   esac
3026 done
3027
3028 ac_given_srcdir=$srcdir
3029 ac_given_INSTALL="$INSTALL"
3030
3031 trap 'rm -fr `echo "Makefile gnushogi/Makefile xshogi/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3032 EOF
3033 cat >> $CONFIG_STATUS <<EOF
3034
3035 # Protect against being on the right side of a sed subst in config.status.
3036 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3037  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3038 $ac_vpsub
3039 $extrasub
3040 s%@SHELL@%$SHELL%g
3041 s%@CFLAGS@%$CFLAGS%g
3042 s%@CPPFLAGS@%$CPPFLAGS%g
3043 s%@CXXFLAGS@%$CXXFLAGS%g
3044 s%@FFLAGS@%$FFLAGS%g
3045 s%@DEFS@%$DEFS%g
3046 s%@LDFLAGS@%$LDFLAGS%g
3047 s%@LIBS@%$LIBS%g
3048 s%@exec_prefix@%$exec_prefix%g
3049 s%@prefix@%$prefix%g
3050 s%@program_transform_name@%$program_transform_name%g
3051 s%@bindir@%$bindir%g
3052 s%@sbindir@%$sbindir%g
3053 s%@libexecdir@%$libexecdir%g
3054 s%@datadir@%$datadir%g
3055 s%@sysconfdir@%$sysconfdir%g
3056 s%@sharedstatedir@%$sharedstatedir%g
3057 s%@localstatedir@%$localstatedir%g
3058 s%@libdir@%$libdir%g
3059 s%@includedir@%$includedir%g
3060 s%@oldincludedir@%$oldincludedir%g
3061 s%@infodir@%$infodir%g
3062 s%@mandir@%$mandir%g
3063 s%@CC@%$CC%g
3064 s%@YACC@%$YACC%g
3065 s%@LEX@%$LEX%g
3066 s%@LEXLIB@%$LEXLIB%g
3067 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3068 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3069 s%@INSTALL_DATA@%$INSTALL_DATA%g
3070 s%@CPP@%$CPP%g
3071 s%@X_CFLAGS@%$X_CFLAGS%g
3072 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
3073 s%@X_LIBS@%$X_LIBS%g
3074 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
3075 s%@WARNINGS@%$WARNINGS%g
3076 s%@CEXTRAFLAGS@%$CEXTRAFLAGS%g
3077 s%@OPT@%$OPT%g
3078 s%@FIRST_SHOGI_PROGRAM@%$FIRST_SHOGI_PROGRAM%g
3079 s%@SECOND_SHOGI_PROGRAM@%$SECOND_SHOGI_PROGRAM%g
3080 s%@FIRST_HOST@%$FIRST_HOST%g
3081 s%@SECOND_HOST@%$SECOND_HOST%g
3082 s%@XSHOGI@%$XSHOGI%g
3083 s%@XSHOGIINSTALL@%$XSHOGIINSTALL%g
3084 s%@XSHOGICLEAN@%$XSHOGICLEAN%g
3085
3086 CEOF
3087 EOF
3088
3089 cat >> $CONFIG_STATUS <<\EOF
3090
3091 # Split the substitutions into bite-sized pieces for seds with
3092 # small command number limits, like on Digital OSF/1 and HP-UX.
3093 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3094 ac_file=1 # Number of current file.
3095 ac_beg=1 # First line for current file.
3096 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3097 ac_more_lines=:
3098 ac_sed_cmds=""
3099 while $ac_more_lines; do
3100   if test $ac_beg -gt 1; then
3101     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3102   else
3103     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3104   fi
3105   if test ! -s conftest.s$ac_file; then
3106     ac_more_lines=false
3107     rm -f conftest.s$ac_file
3108   else
3109     if test -z "$ac_sed_cmds"; then
3110       ac_sed_cmds="sed -f conftest.s$ac_file"
3111     else
3112       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3113     fi
3114     ac_file=`expr $ac_file + 1`
3115     ac_beg=$ac_end
3116     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3117   fi
3118 done
3119 if test -z "$ac_sed_cmds"; then
3120   ac_sed_cmds=cat
3121 fi
3122 EOF
3123
3124 cat >> $CONFIG_STATUS <<EOF
3125
3126 CONFIG_FILES=\${CONFIG_FILES-"Makefile gnushogi/Makefile xshogi/Makefile"}
3127 EOF
3128 cat >> $CONFIG_STATUS <<\EOF
3129 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3130   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3131   case "$ac_file" in
3132   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3133        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3134   *) ac_file_in="${ac_file}.in" ;;
3135   esac
3136
3137   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3138
3139   # Remove last slash and all that follows it.  Not all systems have dirname.
3140   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3141   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3142     # The file is in a subdirectory.
3143     test ! -d "$ac_dir" && mkdir "$ac_dir"
3144     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3145     # A "../" for each directory in $ac_dir_suffix.
3146     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3147   else
3148     ac_dir_suffix= ac_dots=
3149   fi
3150
3151   case "$ac_given_srcdir" in
3152   .)  srcdir=.
3153       if test -z "$ac_dots"; then top_srcdir=.
3154       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3155   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3156   *) # Relative path.
3157     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3158     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3159   esac
3160
3161   case "$ac_given_INSTALL" in
3162   [/$]*) INSTALL="$ac_given_INSTALL" ;;
3163   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3164   esac
3165
3166   echo creating "$ac_file"
3167   rm -f "$ac_file"
3168   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3169   case "$ac_file" in
3170   *Makefile*) ac_comsub="1i\\
3171 # $configure_input" ;;
3172   *) ac_comsub= ;;
3173   esac
3174
3175   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3176   sed -e "$ac_comsub
3177 s%@configure_input@%$configure_input%g
3178 s%@srcdir@%$srcdir%g
3179 s%@top_srcdir@%$top_srcdir%g
3180 s%@INSTALL@%$INSTALL%g
3181 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3182 fi; done
3183 rm -f conftest.s*
3184
3185 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3186 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3187 #
3188 # ac_d sets the value in "#define NAME VALUE" lines.
3189 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3190 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3191 ac_dC='\3'
3192 ac_dD='%g'
3193 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3194 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3195 ac_uB='\([      ]\)%\1#\2define\3'
3196 ac_uC=' '
3197 ac_uD='\4%g'
3198 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3199 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3200 ac_eB='$%\1#\2define\3'
3201 ac_eC=' '
3202 ac_eD='%g'
3203
3204 if test "${CONFIG_HEADERS+set}" != set; then
3205 EOF
3206 cat >> $CONFIG_STATUS <<EOF
3207   CONFIG_HEADERS="config.h"
3208 EOF
3209 cat >> $CONFIG_STATUS <<\EOF
3210 fi
3211 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3212   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3213   case "$ac_file" in
3214   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3215        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3216   *) ac_file_in="${ac_file}.in" ;;
3217   esac
3218
3219   echo creating $ac_file
3220
3221   rm -f conftest.frag conftest.in conftest.out
3222   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3223   cat $ac_file_inputs > conftest.in
3224
3225 EOF
3226
3227 # Transform confdefs.h into a sed script conftest.vals that substitutes
3228 # the proper values into config.h.in to produce config.h.  And first:
3229 # Protect against being on the right side of a sed subst in config.status.
3230 # Protect against being in an unquoted here document in config.status.
3231 rm -f conftest.vals
3232 cat > conftest.hdr <<\EOF
3233 s/[\\&%]/\\&/g
3234 s%[\\$`]%\\&%g
3235 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3236 s%ac_d%ac_u%gp
3237 s%ac_u%ac_e%gp
3238 EOF
3239 sed -n -f conftest.hdr confdefs.h > conftest.vals
3240 rm -f conftest.hdr
3241
3242 # This sed command replaces #undef with comments.  This is necessary, for
3243 # example, in the case of _POSIX_SOURCE, which is predefined and required
3244 # on some systems where configure will not decide to define it.
3245 cat >> conftest.vals <<\EOF
3246 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3247 EOF
3248
3249 # Break up conftest.vals because some shells have a limit on
3250 # the size of here documents, and old seds have small limits too.
3251
3252 rm -f conftest.tail
3253 while :
3254 do
3255   ac_lines=`grep -c . conftest.vals`
3256   # grep -c gives empty output for an empty file on some AIX systems.
3257   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3258   # Write a limited-size here document to conftest.frag.
3259   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3260   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3261   echo 'CEOF
3262   sed -f conftest.frag conftest.in > conftest.out
3263   rm -f conftest.in
3264   mv conftest.out conftest.in
3265 ' >> $CONFIG_STATUS
3266   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3267   rm -f conftest.vals
3268   mv conftest.tail conftest.vals
3269 done
3270 rm -f conftest.vals
3271
3272 cat >> $CONFIG_STATUS <<\EOF
3273   rm -f conftest.frag conftest.h
3274   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3275   cat conftest.in >> conftest.h
3276   rm -f conftest.in
3277   if cmp -s $ac_file conftest.h 2>/dev/null; then
3278     echo "$ac_file is unchanged"
3279     rm -f conftest.h
3280   else
3281     # Remove last slash and all that follows it.  Not all systems have dirname.
3282       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3283       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3284       # The file is in a subdirectory.
3285       test ! -d "$ac_dir" && mkdir "$ac_dir"
3286     fi
3287     rm -f $ac_file
3288     mv conftest.h $ac_file
3289   fi
3290 fi; done
3291
3292 EOF
3293 cat >> $CONFIG_STATUS <<EOF
3294
3295 EOF
3296 cat >> $CONFIG_STATUS <<\EOF
3297
3298 exit 0
3299 EOF
3300 chmod +x $CONFIG_STATUS
3301 rm -fr confdefs* $ac_clean_files
3302 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3303
3304