ftp://ftp.uni-heidelberg.de/pub/X11/contrib/applications/xscreensaver-2.07.tar.gz
[xscreensaver] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.12 
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
16 Installation options:
17
18   --enable-subdir=DIR     Put the demo programs in a subdirectory of \`bindir',
19                           instead of putting them in bindir itself.  You can
20                           specify the name of the subdirectory.  For example,
21                           --exec-prefix=/usr/local/bin --enable-subdir=demos
22                           would put xscreensaver in /usr/local/bin/, and would
23                           put the demos in /usr/local/bin/demos/.  Note that if
24                           you do this, you must make sure that the directory
25                           is on your \$PATH before xscreensaver is started: the
26                           directory name is not hardcoded into the program.
27                           This merely sets the default installation location.
28
29   --disable-subdir        Just put the demos in \`bindir' (this is the default.)
30 "
31 ac_help="$ac_help
32   --with-x                use the X Window System"
33 ac_help="$ac_help
34
35 Server options:
36
37   --with-sgi-ext          Include support for the SGI SCREEN_SAVER
38                           server extension, if possible (this is the default).
39   --without-sgi-ext       Do not compile in support for this extension."
40 ac_help="$ac_help
41   --with-mit-ext          Include support for the MIT-SCREEN-SAVER
42                           server extension, if possible (this is the default).
43   --without-mit-ext       Do not compile in support for this extension."
44 ac_help="$ac_help
45   --with-xidle-ext        Include support for the XIDLE server extension,
46                           if possible (this is the default).
47   --without-xidle-ext     Do not compile in support for this extension."
48 ac_help="$ac_help
49
50 Toolkit options:
51
52   --with-motif            Use the Motif toolkit for the user interface,
53                           if possible (this is the default).
54   --without-motif         Do not use Motif."
55 ac_help="$ac_help
56   --with-athena           Use the Athena toolkit for the user interface, if
57                           possible (this is the default if Motif isn't used.)
58   --without-athena        Do not use Athena."
59 ac_help="$ac_help
60
61 Demo options:
62
63   --with-xpm              Include support for XPM files in some demos,
64                           if possible (this is the default).
65   --without-xpm           Do not compile in support for XPM files."
66 ac_help="$ac_help
67   --with-gl               Build those demos which depend on OpenGL,
68                           if possible (this is the default).
69   --without-gl            Do not build the OpenGL demos."
70 ac_help="$ac_help
71   --with-readdisplay      Include support for the XReadDisplay server
72                           extension if possible (this is the default).
73   --without-readdisplay   Do not compile in support for this extension."
74 ac_help="$ac_help
75   --with-zippy=PROGRAM    Some demos are able to run an external program and
76                           display its text; this names the program to use by
77                           default (though it can be overridden with X
78                           resources.)  If you don't specify this, the default
79                           is to use \"yow\" from the Emacs distribution (if you
80                           have it) or else to use \"fortune\"."
81 ac_help="$ac_help
82
83 Locking options:
84
85   --enable-locking        Compile in support for locking the display
86                           (this is the default.)
87   --disable-locking       Do not allow locking at all."
88 ac_help="$ac_help
89
90   --with-kerberos         Include support for Kerberos authentication,
91                           if possible (this is the default.)
92   --without-kerberos      Do not compile in support for Kerberos."
93 ac_help="$ac_help
94   --with-shadow           Include support for shadow password authentication,
95                           if possible (this is the default, if no Kerberos.)
96   --without-shadow        Do not compile in support for shadow passwords.
97 "
98
99 # Initialize some variables set by options.
100 # The variables have the same names as the options, with
101 # dashes changed to underlines.
102 build=NONE
103 cache_file=./config.cache
104 exec_prefix=NONE
105 host=NONE
106 no_create=
107 nonopt=NONE
108 no_recursion=
109 prefix=NONE
110 program_prefix=NONE
111 program_suffix=NONE
112 program_transform_name=s,x,x,
113 silent=
114 site=
115 srcdir=
116 target=NONE
117 verbose=
118 x_includes=NONE
119 x_libraries=NONE
120 bindir='${exec_prefix}/bin'
121 sbindir='${exec_prefix}/sbin'
122 libexecdir='${exec_prefix}/libexec'
123 datadir='${prefix}/share'
124 sysconfdir='${prefix}/etc'
125 sharedstatedir='${prefix}/com'
126 localstatedir='${prefix}/var'
127 libdir='${exec_prefix}/lib'
128 includedir='${prefix}/include'
129 oldincludedir='/usr/include'
130 infodir='${prefix}/info'
131 mandir='${prefix}/man'
132
133 # Initialize some other variables.
134 subdirs=
135 MFLAGS= MAKEFLAGS=
136 # Maximum number of lines to put in a shell here document.
137 ac_max_here_lines=12
138
139 ac_prev=
140 for ac_option
141 do
142
143   # If the previous option needs an argument, assign it.
144   if test -n "$ac_prev"; then
145     eval "$ac_prev=\$ac_option"
146     ac_prev=
147     continue
148   fi
149
150   case "$ac_option" in
151   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
152   *) ac_optarg= ;;
153   esac
154
155   # Accept the important Cygnus configure options, so we can diagnose typos.
156
157   case "$ac_option" in
158
159   -bindir | --bindir | --bindi | --bind | --bin | --bi)
160     ac_prev=bindir ;;
161   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
162     bindir="$ac_optarg" ;;
163
164   -build | --build | --buil | --bui | --bu)
165     ac_prev=build ;;
166   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
167     build="$ac_optarg" ;;
168
169   -cache-file | --cache-file | --cache-fil | --cache-fi \
170   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
171     ac_prev=cache_file ;;
172   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
173   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
174     cache_file="$ac_optarg" ;;
175
176   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
177     ac_prev=datadir ;;
178   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
179   | --da=*)
180     datadir="$ac_optarg" ;;
181
182   -disable-* | --disable-*)
183     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
184     # Reject names that are not valid shell variable names.
185     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
186       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
187     fi
188     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
189     eval "enable_${ac_feature}=no" ;;
190
191   -enable-* | --enable-*)
192     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
193     # Reject names that are not valid shell variable names.
194     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
195       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
196     fi
197     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
198     case "$ac_option" in
199       *=*) ;;
200       *) ac_optarg=yes ;;
201     esac
202     eval "enable_${ac_feature}='$ac_optarg'" ;;
203
204   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
205   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
206   | --exec | --exe | --ex)
207     ac_prev=exec_prefix ;;
208   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
209   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
210   | --exec=* | --exe=* | --ex=*)
211     exec_prefix="$ac_optarg" ;;
212
213   -gas | --gas | --ga | --g)
214     # Obsolete; use --with-gas.
215     with_gas=yes ;;
216
217   -help | --help | --hel | --he)
218     # Omit some internal or obsolete options to make the list less imposing.
219     # This message is too long to be a string in the A/UX 3.1 sh.
220     cat << EOF
221 Usage: configure [options] [host]
222 Options: [defaults in brackets after descriptions]
223 Configuration:
224   --cache-file=FILE       cache test results in FILE
225   --help                  print this message
226   --no-create             do not create output files
227   --quiet, --silent       do not print \`checking...' messages
228   --version               print the version of autoconf that created configure
229 Directory and file names:
230   --prefix=PREFIX         install architecture-independent files in PREFIX
231                           [$ac_default_prefix]
232   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
233                           [same as prefix]
234   --bindir=DIR            user executables in DIR [EPREFIX/bin]
235   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
236   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
237   --datadir=DIR           read-only architecture-independent data in DIR
238                           [PREFIX/share]
239   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
240   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
241                           [PREFIX/com]
242   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
243   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
244   --includedir=DIR        C header files in DIR [PREFIX/include]
245   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
246   --infodir=DIR           info documentation in DIR [PREFIX/info]
247   --mandir=DIR            man documentation in DIR [PREFIX/man]
248   --srcdir=DIR            find the sources in DIR [configure dir or ..]
249   --program-prefix=PREFIX prepend PREFIX to installed program names
250   --program-suffix=SUFFIX append SUFFIX to installed program names
251   --program-transform-name=PROGRAM
252                           run sed PROGRAM on installed program names
253 EOF
254     cat << EOF
255 Host type:
256   --build=BUILD           configure for building on BUILD [BUILD=HOST]
257   --host=HOST             configure for HOST [guessed]
258   --target=TARGET         configure for TARGET [TARGET=HOST]
259 Features and packages:
260   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
261   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
262   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
263   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
264   --x-includes=DIR        X include files are in DIR
265   --x-libraries=DIR       X library files are in DIR
266 EOF
267     if test -n "$ac_help"; then
268       echo "--enable and --with options recognized:$ac_help"
269     fi
270     exit 0 ;;
271
272   -host | --host | --hos | --ho)
273     ac_prev=host ;;
274   -host=* | --host=* | --hos=* | --ho=*)
275     host="$ac_optarg" ;;
276
277   -includedir | --includedir | --includedi | --included | --include \
278   | --includ | --inclu | --incl | --inc)
279     ac_prev=includedir ;;
280   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
281   | --includ=* | --inclu=* | --incl=* | --inc=*)
282     includedir="$ac_optarg" ;;
283
284   -infodir | --infodir | --infodi | --infod | --info | --inf)
285     ac_prev=infodir ;;
286   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
287     infodir="$ac_optarg" ;;
288
289   -libdir | --libdir | --libdi | --libd)
290     ac_prev=libdir ;;
291   -libdir=* | --libdir=* | --libdi=* | --libd=*)
292     libdir="$ac_optarg" ;;
293
294   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
295   | --libexe | --libex | --libe)
296     ac_prev=libexecdir ;;
297   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
298   | --libexe=* | --libex=* | --libe=*)
299     libexecdir="$ac_optarg" ;;
300
301   -localstatedir | --localstatedir | --localstatedi | --localstated \
302   | --localstate | --localstat | --localsta | --localst \
303   | --locals | --local | --loca | --loc | --lo)
304     ac_prev=localstatedir ;;
305   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
306   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
307   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
308     localstatedir="$ac_optarg" ;;
309
310   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
311     ac_prev=mandir ;;
312   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
313     mandir="$ac_optarg" ;;
314
315   -nfp | --nfp | --nf)
316     # Obsolete; use --without-fp.
317     with_fp=no ;;
318
319   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
320   | --no-cr | --no-c)
321     no_create=yes ;;
322
323   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
324   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
325     no_recursion=yes ;;
326
327   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
328   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
329   | --oldin | --oldi | --old | --ol | --o)
330     ac_prev=oldincludedir ;;
331   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
332   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
333   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
334     oldincludedir="$ac_optarg" ;;
335
336   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
337     ac_prev=prefix ;;
338   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
339     prefix="$ac_optarg" ;;
340
341   -program-prefix | --program-prefix | --program-prefi | --program-pref \
342   | --program-pre | --program-pr | --program-p)
343     ac_prev=program_prefix ;;
344   -program-prefix=* | --program-prefix=* | --program-prefi=* \
345   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
346     program_prefix="$ac_optarg" ;;
347
348   -program-suffix | --program-suffix | --program-suffi | --program-suff \
349   | --program-suf | --program-su | --program-s)
350     ac_prev=program_suffix ;;
351   -program-suffix=* | --program-suffix=* | --program-suffi=* \
352   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
353     program_suffix="$ac_optarg" ;;
354
355   -program-transform-name | --program-transform-name \
356   | --program-transform-nam | --program-transform-na \
357   | --program-transform-n | --program-transform- \
358   | --program-transform | --program-transfor \
359   | --program-transfo | --program-transf \
360   | --program-trans | --program-tran \
361   | --progr-tra | --program-tr | --program-t)
362     ac_prev=program_transform_name ;;
363   -program-transform-name=* | --program-transform-name=* \
364   | --program-transform-nam=* | --program-transform-na=* \
365   | --program-transform-n=* | --program-transform-=* \
366   | --program-transform=* | --program-transfor=* \
367   | --program-transfo=* | --program-transf=* \
368   | --program-trans=* | --program-tran=* \
369   | --progr-tra=* | --program-tr=* | --program-t=*)
370     program_transform_name="$ac_optarg" ;;
371
372   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
373   | -silent | --silent | --silen | --sile | --sil)
374     silent=yes ;;
375
376   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
377     ac_prev=sbindir ;;
378   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
379   | --sbi=* | --sb=*)
380     sbindir="$ac_optarg" ;;
381
382   -sharedstatedir | --sharedstatedir | --sharedstatedi \
383   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
384   | --sharedst | --shareds | --shared | --share | --shar \
385   | --sha | --sh)
386     ac_prev=sharedstatedir ;;
387   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
388   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
389   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
390   | --sha=* | --sh=*)
391     sharedstatedir="$ac_optarg" ;;
392
393   -site | --site | --sit)
394     ac_prev=site ;;
395   -site=* | --site=* | --sit=*)
396     site="$ac_optarg" ;;
397
398   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
399     ac_prev=srcdir ;;
400   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
401     srcdir="$ac_optarg" ;;
402
403   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
404   | --syscon | --sysco | --sysc | --sys | --sy)
405     ac_prev=sysconfdir ;;
406   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
407   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
408     sysconfdir="$ac_optarg" ;;
409
410   -target | --target | --targe | --targ | --tar | --ta | --t)
411     ac_prev=target ;;
412   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
413     target="$ac_optarg" ;;
414
415   -v | -verbose | --verbose | --verbos | --verbo | --verb)
416     verbose=yes ;;
417
418   -version | --version | --versio | --versi | --vers)
419     echo "configure generated by autoconf version 2.12"
420     exit 0 ;;
421
422   -with-* | --with-*)
423     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
424     # Reject names that are not valid shell variable names.
425     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
426       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
427     fi
428     ac_package=`echo $ac_package| sed 's/-/_/g'`
429     case "$ac_option" in
430       *=*) ;;
431       *) ac_optarg=yes ;;
432     esac
433     eval "with_${ac_package}='$ac_optarg'" ;;
434
435   -without-* | --without-*)
436     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
437     # Reject names that are not valid shell variable names.
438     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
439       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
440     fi
441     ac_package=`echo $ac_package| sed 's/-/_/g'`
442     eval "with_${ac_package}=no" ;;
443
444   --x)
445     # Obsolete; use --with-x.
446     with_x=yes ;;
447
448   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
449   | --x-incl | --x-inc | --x-in | --x-i)
450     ac_prev=x_includes ;;
451   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
452   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
453     x_includes="$ac_optarg" ;;
454
455   -x-libraries | --x-libraries | --x-librarie | --x-librari \
456   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
457     ac_prev=x_libraries ;;
458   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
459   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
460     x_libraries="$ac_optarg" ;;
461
462   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
463     ;;
464
465   *)
466     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
467       echo "configure: warning: $ac_option: invalid host type" 1>&2
468     fi
469     if test "x$nonopt" != xNONE; then
470       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
471     fi
472     nonopt="$ac_option"
473     ;;
474
475   esac
476 done
477
478 if test -n "$ac_prev"; then
479   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
480 fi
481
482 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
483
484 # File descriptor usage:
485 # 0 standard input
486 # 1 file creation
487 # 2 errors and warnings
488 # 3 some systems may open it to /dev/tty
489 # 4 used on the Kubota Titan
490 # 6 checking for... messages and results
491 # 5 compiler messages saved in config.log
492 if test "$silent" = yes; then
493   exec 6>/dev/null
494 else
495   exec 6>&1
496 fi
497 exec 5>./config.log
498
499 echo "\
500 This file contains any messages produced by compilers while
501 running configure, to aid debugging if configure makes a mistake.
502 " 1>&5
503
504 # Strip out --no-create and --no-recursion so they do not pile up.
505 # Also quote any args containing shell metacharacters.
506 ac_configure_args=
507 for ac_arg
508 do
509   case "$ac_arg" in
510   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
511   | --no-cr | --no-c) ;;
512   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
513   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
514   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
515   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
516   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
517   esac
518 done
519
520 # NLS nuisances.
521 # Only set these to C if already set.  These must not be set unconditionally
522 # because not all systems understand e.g. LANG=C (notably SCO).
523 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
524 # Non-C LC_CTYPE values break the ctype check.
525 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
526 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
527 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
528 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
529
530 # confdefs.h avoids OS command line length limits that DEFS can exceed.
531 rm -rf conftest* confdefs.h
532 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
533 echo > confdefs.h
534
535 # A filename unique to this package, relative to the directory that
536 # configure is in, which we can look for to find out if srcdir is correct.
537 ac_unique_file=driver/subprocs.c
538
539 # Find the source files, if location was not specified.
540 if test -z "$srcdir"; then
541   ac_srcdir_defaulted=yes
542   # Try the directory containing this script, then its parent.
543   ac_prog=$0
544   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
545   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
546   srcdir=$ac_confdir
547   if test ! -r $srcdir/$ac_unique_file; then
548     srcdir=..
549   fi
550 else
551   ac_srcdir_defaulted=no
552 fi
553 if test ! -r $srcdir/$ac_unique_file; then
554   if test "$ac_srcdir_defaulted" = yes; then
555     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
556   else
557     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
558   fi
559 fi
560 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
561
562 # Prefer explicitly selected file to automatically selected ones.
563 if test -z "$CONFIG_SITE"; then
564   if test "x$prefix" != xNONE; then
565     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
566   else
567     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
568   fi
569 fi
570 for ac_site_file in $CONFIG_SITE; do
571   if test -r "$ac_site_file"; then
572     echo "loading site script $ac_site_file"
573     . "$ac_site_file"
574   fi
575 done
576
577 if test -r "$cache_file"; then
578   echo "loading cache $cache_file"
579   . $cache_file
580 else
581   echo "creating cache $cache_file"
582   > $cache_file
583 fi
584
585 ac_ext=c
586 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
587 ac_cpp='$CPP $CPPFLAGS'
588 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
589 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
590 cross_compiling=$ac_cv_prog_cc_cross
591
592 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
593   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
594   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
595     ac_n= ac_c='
596 ' ac_t='        '
597   else
598     ac_n=-n ac_c= ac_t=
599   fi
600 else
601   ac_n= ac_c='\c' ac_t=
602 fi
603
604
605
606 ac_aux_dir=
607 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
608   if test -f $ac_dir/install-sh; then
609     ac_aux_dir=$ac_dir
610     ac_install_sh="$ac_aux_dir/install-sh -c"
611     break
612   elif test -f $ac_dir/install.sh; then
613     ac_aux_dir=$ac_dir
614     ac_install_sh="$ac_aux_dir/install.sh -c"
615     break
616   fi
617 done
618 if test -z "$ac_aux_dir"; then
619   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
620 fi
621 ac_config_guess=$ac_aux_dir/config.guess
622 ac_config_sub=$ac_aux_dir/config.sub
623 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
624
625
626 # Make sure we can run config.sub.
627 if $ac_config_sub sun4 >/dev/null 2>&1; then :
628 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
629 fi
630
631 echo $ac_n "checking host system type""... $ac_c" 1>&6
632 echo "configure:633: checking host system type" >&5
633
634 host_alias=$host
635 case "$host_alias" in
636 NONE)
637   case $nonopt in
638   NONE)
639     if host_alias=`$ac_config_guess`; then :
640     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
641     fi ;;
642   *) host_alias=$nonopt ;;
643   esac ;;
644 esac
645
646 host=`$ac_config_sub $host_alias`
647 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
648 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
649 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
650 echo "$ac_t""$host" 1>&6
651
652
653 # Extract the first word of "gcc", so it can be a program name with args.
654 set dummy gcc; ac_word=$2
655 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
656 echo "configure:657: checking for $ac_word" >&5
657 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
658   echo $ac_n "(cached) $ac_c" 1>&6
659 else
660   if test -n "$CC"; then
661   ac_cv_prog_CC="$CC" # Let the user override the test.
662 else
663   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
664   for ac_dir in $PATH; do
665     test -z "$ac_dir" && ac_dir=.
666     if test -f $ac_dir/$ac_word; then
667       ac_cv_prog_CC="gcc"
668       break
669     fi
670   done
671   IFS="$ac_save_ifs"
672 fi
673 fi
674 CC="$ac_cv_prog_CC"
675 if test -n "$CC"; then
676   echo "$ac_t""$CC" 1>&6
677 else
678   echo "$ac_t""no" 1>&6
679 fi
680
681 if test -z "$CC"; then
682   # Extract the first word of "cc", so it can be a program name with args.
683 set dummy cc; ac_word=$2
684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
685 echo "configure:686: checking for $ac_word" >&5
686 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
687   echo $ac_n "(cached) $ac_c" 1>&6
688 else
689   if test -n "$CC"; then
690   ac_cv_prog_CC="$CC" # Let the user override the test.
691 else
692   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
693   ac_prog_rejected=no
694   for ac_dir in $PATH; do
695     test -z "$ac_dir" && ac_dir=.
696     if test -f $ac_dir/$ac_word; then
697       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
698         ac_prog_rejected=yes
699         continue
700       fi
701       ac_cv_prog_CC="cc"
702       break
703     fi
704   done
705   IFS="$ac_save_ifs"
706 if test $ac_prog_rejected = yes; then
707   # We found a bogon in the path, so make sure we never use it.
708   set dummy $ac_cv_prog_CC
709   shift
710   if test $# -gt 0; then
711     # We chose a different compiler from the bogus one.
712     # However, it has the same basename, so the bogon will be chosen
713     # first if we set CC to just the basename; use the full file name.
714     shift
715     set dummy "$ac_dir/$ac_word" "$@"
716     shift
717     ac_cv_prog_CC="$@"
718   fi
719 fi
720 fi
721 fi
722 CC="$ac_cv_prog_CC"
723 if test -n "$CC"; then
724   echo "$ac_t""$CC" 1>&6
725 else
726   echo "$ac_t""no" 1>&6
727 fi
728
729   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
730 fi
731
732 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
733 echo "configure:734: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
734
735 ac_ext=c
736 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
737 ac_cpp='$CPP $CPPFLAGS'
738 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
739 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
740 cross_compiling=$ac_cv_prog_cc_cross
741
742 cat > conftest.$ac_ext <<EOF
743 #line 744 "configure"
744 #include "confdefs.h"
745 main(){return(0);}
746 EOF
747 if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
748   ac_cv_prog_cc_works=yes
749   # If we can't run a trivial program, we are probably using a cross compiler.
750   if (./conftest; exit) 2>/dev/null; then
751     ac_cv_prog_cc_cross=no
752   else
753     ac_cv_prog_cc_cross=yes
754   fi
755 else
756   echo "configure: failed program was:" >&5
757   cat conftest.$ac_ext >&5
758   ac_cv_prog_cc_works=no
759 fi
760 rm -fr conftest*
761
762 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
763 if test $ac_cv_prog_cc_works = no; then
764   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
765 fi
766 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
767 echo "configure:768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
768 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
769 cross_compiling=$ac_cv_prog_cc_cross
770
771 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
772 echo "configure:773: checking whether we are using GNU C" >&5
773 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
774   echo $ac_n "(cached) $ac_c" 1>&6
775 else
776   cat > conftest.c <<EOF
777 #ifdef __GNUC__
778   yes;
779 #endif
780 EOF
781 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
782   ac_cv_prog_gcc=yes
783 else
784   ac_cv_prog_gcc=no
785 fi
786 fi
787
788 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
789
790 if test $ac_cv_prog_gcc = yes; then
791   GCC=yes
792   ac_test_CFLAGS="${CFLAGS+set}"
793   ac_save_CFLAGS="$CFLAGS"
794   CFLAGS=
795   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
796 echo "configure:797: checking whether ${CC-cc} accepts -g" >&5
797 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
798   echo $ac_n "(cached) $ac_c" 1>&6
799 else
800   echo 'void f(){}' > conftest.c
801 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
802   ac_cv_prog_cc_g=yes
803 else
804   ac_cv_prog_cc_g=no
805 fi
806 rm -f conftest*
807
808 fi
809
810 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
811   if test "$ac_test_CFLAGS" = set; then
812     CFLAGS="$ac_save_CFLAGS"
813   elif test $ac_cv_prog_cc_g = yes; then
814     CFLAGS="-g -O2"
815   else
816     CFLAGS="-O2"
817   fi
818 else
819   GCC=
820   test "${CFLAGS+set}" = set || CFLAGS="-g"
821 fi
822
823
824 if test -z "$GCC"; then
825   echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
826 echo "configure:827: checking how to request ANSI compilation" >&5
827   case "$host" in
828     *-hpux*)
829       echo "$ac_t""HPUX: adding -Ae" 1>&6
830       CC="$CC -Ae"
831     ;;
832     *-aix*)
833       echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
834       CC="$CC -qlanglvl=ansi -qhalt=e"
835     ;;
836     *)
837       echo "$ac_t""no idea" 1>&6
838     ;;
839   esac
840 fi
841
842
843 echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
844 echo "configure:845: checking whether the compiler works on ANSI C" >&5
845 if test "$cross_compiling" = yes; then
846   { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
847 else
848   cat > conftest.$ac_ext <<EOF
849 #line 850 "configure"
850 #include "confdefs.h"
851  main(int ac, char **av) { return 0; } 
852 EOF
853 if { (eval echo configure:854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
854 then
855   echo "$ac_t""yes" 1>&6
856 else
857   echo "configure: failed program was:" >&5
858   cat conftest.$ac_ext >&5
859   rm -fr conftest*
860   echo "$ac_t""no" 1>&6
861    { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
862 fi
863 rm -fr conftest*
864 fi
865
866
867 case "$host" in
868   *-irix*)
869   if test -n "$GCC"; then
870     echo "$ac_t""Turning on gcc compiler warnings." 1>&6
871     CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
872   else
873     # not gcc
874     echo "$ac_t""Turning on SGI compiler warnings." 1>&6
875     CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
876   fi
877   ;;
878 esac
879
880
881 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
882 echo "configure:883: checking how to run the C preprocessor" >&5
883 # On Suns, sometimes $CPP names a directory.
884 if test -n "$CPP" && test -d "$CPP"; then
885   CPP=
886 fi
887 if test -z "$CPP"; then
888 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
889   echo $ac_n "(cached) $ac_c" 1>&6
890 else
891     # This must be in double quotes, not single quotes, because CPP may get
892   # substituted into the Makefile and "${CC-cc}" will confuse make.
893   CPP="${CC-cc} -E"
894   # On the NeXT, cc -E runs the code through the compiler's parser,
895   # not just through cpp.
896   cat > conftest.$ac_ext <<EOF
897 #line 898 "configure"
898 #include "confdefs.h"
899 #include <assert.h>
900 Syntax Error
901 EOF
902 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
903 { (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
904 ac_err=`grep -v '^ *+' conftest.out`
905 if test -z "$ac_err"; then
906   :
907 else
908   echo "$ac_err" >&5
909   echo "configure: failed program was:" >&5
910   cat conftest.$ac_ext >&5
911   rm -rf conftest*
912   CPP="${CC-cc} -E -traditional-cpp"
913   cat > conftest.$ac_ext <<EOF
914 #line 915 "configure"
915 #include "confdefs.h"
916 #include <assert.h>
917 Syntax Error
918 EOF
919 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
920 { (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
921 ac_err=`grep -v '^ *+' conftest.out`
922 if test -z "$ac_err"; then
923   :
924 else
925   echo "$ac_err" >&5
926   echo "configure: failed program was:" >&5
927   cat conftest.$ac_ext >&5
928   rm -rf conftest*
929   CPP=/lib/cpp
930 fi
931 rm -f conftest*
932 fi
933 rm -f conftest*
934   ac_cv_prog_CPP="$CPP"
935 fi
936   CPP="$ac_cv_prog_CPP"
937 else
938   ac_cv_prog_CPP="$CPP"
939 fi
940 echo "$ac_t""$CPP" 1>&6
941
942 # Find a good install program.  We prefer a C program (faster),
943 # so one script is as good as another.  But avoid the broken or
944 # incompatible versions:
945 # SysV /etc/install, /usr/sbin/install
946 # SunOS /usr/etc/install
947 # IRIX /sbin/install
948 # AIX /bin/install
949 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
950 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
951 # ./install, which can be erroneously created by make from ./install.sh.
952 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
953 echo "configure:954: checking for a BSD compatible install" >&5
954 if test -z "$INSTALL"; then
955 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
956   echo $ac_n "(cached) $ac_c" 1>&6
957 else
958     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
959   for ac_dir in $PATH; do
960     # Account for people who put trailing slashes in PATH elements.
961     case "$ac_dir/" in
962     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
963     *)
964       # OSF1 and SCO ODT 3.0 have their own names for install.
965       for ac_prog in ginstall installbsd scoinst install; do
966         if test -f $ac_dir/$ac_prog; then
967           if test $ac_prog = install &&
968             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
969             # AIX install.  It has an incompatible calling convention.
970             # OSF/1 installbsd also uses dspmsg, but is usable.
971             :
972           else
973             ac_cv_path_install="$ac_dir/$ac_prog -c"
974             break 2
975           fi
976         fi
977       done
978       ;;
979     esac
980   done
981   IFS="$ac_save_IFS"
982
983 fi
984   if test "${ac_cv_path_install+set}" = set; then
985     INSTALL="$ac_cv_path_install"
986   else
987     # As a last resort, use the slow shell script.  We don't cache a
988     # path for INSTALL within a source directory, because that will
989     # break other packages using the cache if that directory is
990     # removed, or if the path is relative.
991     INSTALL="$ac_install_sh"
992   fi
993 fi
994 echo "$ac_t""$INSTALL" 1>&6
995
996 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
997 # It thinks the first close brace ends the variable substitution.
998 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
999
1000 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1001
1002 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1003 echo "configure:1004: checking whether ${MAKE-make} sets \${MAKE}" >&5
1004 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1005 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1006   echo $ac_n "(cached) $ac_c" 1>&6
1007 else
1008   cat > conftestmake <<\EOF
1009 all:
1010         @echo 'ac_maketemp="${MAKE}"'
1011 EOF
1012 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1013 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1014 if test -n "$ac_maketemp"; then
1015   eval ac_cv_prog_make_${ac_make}_set=yes
1016 else
1017   eval ac_cv_prog_make_${ac_make}_set=no
1018 fi
1019 rm -f conftestmake
1020 fi
1021 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1022   echo "$ac_t""yes" 1>&6
1023   SET_MAKE=
1024 else
1025   echo "$ac_t""no" 1>&6
1026   SET_MAKE="MAKE=${MAKE-make}"
1027 fi
1028
1029
1030 echo $ac_n "checking for working const""... $ac_c" 1>&6
1031 echo "configure:1032: checking for working const" >&5
1032 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1033   echo $ac_n "(cached) $ac_c" 1>&6
1034 else
1035   cat > conftest.$ac_ext <<EOF
1036 #line 1037 "configure"
1037 #include "confdefs.h"
1038
1039 int main() {
1040
1041 /* Ultrix mips cc rejects this.  */
1042 typedef int charset[2]; const charset x;
1043 /* SunOS 4.1.1 cc rejects this.  */
1044 char const *const *ccp;
1045 char **p;
1046 /* NEC SVR4.0.2 mips cc rejects this.  */
1047 struct point {int x, y;};
1048 static struct point const zero = {0,0};
1049 /* AIX XL C 1.02.0.0 rejects this.
1050    It does not let you subtract one const X* pointer from another in an arm
1051    of an if-expression whose if-part is not a constant expression */
1052 const char *g = "string";
1053 ccp = &g + (g ? g-g : 0);
1054 /* HPUX 7.0 cc rejects these. */
1055 ++ccp;
1056 p = (char**) ccp;
1057 ccp = (char const *const *) p;
1058 { /* SCO 3.2v4 cc rejects this.  */
1059   char *t;
1060   char const *s = 0 ? (char *) 0 : (char const *) 0;
1061
1062   *t++ = 0;
1063 }
1064 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1065   int x[] = {25, 17};
1066   const int *foo = &x[0];
1067   ++foo;
1068 }
1069 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1070   typedef const int *iptr;
1071   iptr p = 0;
1072   ++p;
1073 }
1074 { /* AIX XL C 1.02.0.0 rejects this saying
1075      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1076   struct s { int j; const int *ap[3]; };
1077   struct s *b; b->j = 5;
1078 }
1079 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1080   const int foo = 10;
1081 }
1082
1083 ; return 0; }
1084 EOF
1085 if { (eval echo configure:1086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1086   rm -rf conftest*
1087   ac_cv_c_const=yes
1088 else
1089   echo "configure: failed program was:" >&5
1090   cat conftest.$ac_ext >&5
1091   rm -rf conftest*
1092   ac_cv_c_const=no
1093 fi
1094 rm -f conftest*
1095 fi
1096
1097 echo "$ac_t""$ac_cv_c_const" 1>&6
1098 if test $ac_cv_c_const = no; then
1099   cat >> confdefs.h <<\EOF
1100 #define const 
1101 EOF
1102
1103 fi
1104
1105 echo $ac_n "checking for inline""... $ac_c" 1>&6
1106 echo "configure:1107: checking for inline" >&5
1107 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1108   echo $ac_n "(cached) $ac_c" 1>&6
1109 else
1110   ac_cv_c_inline=no
1111 for ac_kw in inline __inline__ __inline; do
1112   cat > conftest.$ac_ext <<EOF
1113 #line 1114 "configure"
1114 #include "confdefs.h"
1115
1116 int main() {
1117 } $ac_kw foo() {
1118 ; return 0; }
1119 EOF
1120 if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1121   rm -rf conftest*
1122   ac_cv_c_inline=$ac_kw; break
1123 else
1124   echo "configure: failed program was:" >&5
1125   cat conftest.$ac_ext >&5
1126 fi
1127 rm -f conftest*
1128 done
1129
1130 fi
1131
1132 echo "$ac_t""$ac_cv_c_inline" 1>&6
1133 case "$ac_cv_c_inline" in
1134   inline | yes) ;;
1135   no) cat >> confdefs.h <<\EOF
1136 #define inline 
1137 EOF
1138  ;;
1139   *)  cat >> confdefs.h <<EOF
1140 #define inline $ac_cv_c_inline
1141 EOF
1142  ;;
1143 esac
1144
1145
1146 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1147 echo "configure:1148: checking for ANSI C header files" >&5
1148 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1149   echo $ac_n "(cached) $ac_c" 1>&6
1150 else
1151   cat > conftest.$ac_ext <<EOF
1152 #line 1153 "configure"
1153 #include "confdefs.h"
1154 #include <stdlib.h>
1155 #include <stdarg.h>
1156 #include <string.h>
1157 #include <float.h>
1158 EOF
1159 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1160 { (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1161 ac_err=`grep -v '^ *+' conftest.out`
1162 if test -z "$ac_err"; then
1163   rm -rf conftest*
1164   ac_cv_header_stdc=yes
1165 else
1166   echo "$ac_err" >&5
1167   echo "configure: failed program was:" >&5
1168   cat conftest.$ac_ext >&5
1169   rm -rf conftest*
1170   ac_cv_header_stdc=no
1171 fi
1172 rm -f conftest*
1173
1174 if test $ac_cv_header_stdc = yes; then
1175   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1176 cat > conftest.$ac_ext <<EOF
1177 #line 1178 "configure"
1178 #include "confdefs.h"
1179 #include <string.h>
1180 EOF
1181 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1182   egrep "memchr" >/dev/null 2>&1; then
1183   :
1184 else
1185   rm -rf conftest*
1186   ac_cv_header_stdc=no
1187 fi
1188 rm -f conftest*
1189
1190 fi
1191
1192 if test $ac_cv_header_stdc = yes; then
1193   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1194 cat > conftest.$ac_ext <<EOF
1195 #line 1196 "configure"
1196 #include "confdefs.h"
1197 #include <stdlib.h>
1198 EOF
1199 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1200   egrep "free" >/dev/null 2>&1; then
1201   :
1202 else
1203   rm -rf conftest*
1204   ac_cv_header_stdc=no
1205 fi
1206 rm -f conftest*
1207
1208 fi
1209
1210 if test $ac_cv_header_stdc = yes; then
1211   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1212 if test "$cross_compiling" = yes; then
1213   :
1214 else
1215   cat > conftest.$ac_ext <<EOF
1216 #line 1217 "configure"
1217 #include "confdefs.h"
1218 #include <ctype.h>
1219 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1220 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1221 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1222 int main () { int i; for (i = 0; i < 256; i++)
1223 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1224 exit (0); }
1225
1226 EOF
1227 if { (eval echo configure:1228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1228 then
1229   :
1230 else
1231   echo "configure: failed program was:" >&5
1232   cat conftest.$ac_ext >&5
1233   rm -fr conftest*
1234   ac_cv_header_stdc=no
1235 fi
1236 rm -fr conftest*
1237 fi
1238
1239 fi
1240 fi
1241
1242 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1243 if test $ac_cv_header_stdc = yes; then
1244   cat >> confdefs.h <<\EOF
1245 #define STDC_HEADERS 1
1246 EOF
1247
1248 fi
1249
1250 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1251 echo "configure:1252: checking whether time.h and sys/time.h may both be included" >&5
1252 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1253   echo $ac_n "(cached) $ac_c" 1>&6
1254 else
1255   cat > conftest.$ac_ext <<EOF
1256 #line 1257 "configure"
1257 #include "confdefs.h"
1258 #include <sys/types.h>
1259 #include <sys/time.h>
1260 #include <time.h>
1261 int main() {
1262 struct tm *tp;
1263 ; return 0; }
1264 EOF
1265 if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1266   rm -rf conftest*
1267   ac_cv_header_time=yes
1268 else
1269   echo "configure: failed program was:" >&5
1270   cat conftest.$ac_ext >&5
1271   rm -rf conftest*
1272   ac_cv_header_time=no
1273 fi
1274 rm -f conftest*
1275 fi
1276
1277 echo "$ac_t""$ac_cv_header_time" 1>&6
1278 if test $ac_cv_header_time = yes; then
1279   cat >> confdefs.h <<\EOF
1280 #define TIME_WITH_SYS_TIME 1
1281 EOF
1282
1283 fi
1284
1285 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1286 echo "configure:1287: checking for sys/wait.h that is POSIX.1 compatible" >&5
1287 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1288   echo $ac_n "(cached) $ac_c" 1>&6
1289 else
1290   cat > conftest.$ac_ext <<EOF
1291 #line 1292 "configure"
1292 #include "confdefs.h"
1293 #include <sys/types.h>
1294 #include <sys/wait.h>
1295 #ifndef WEXITSTATUS
1296 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1297 #endif
1298 #ifndef WIFEXITED
1299 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1300 #endif
1301 int main() {
1302 int s;
1303 wait (&s);
1304 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1305 ; return 0; }
1306 EOF
1307 if { (eval echo configure:1308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1308   rm -rf conftest*
1309   ac_cv_header_sys_wait_h=yes
1310 else
1311   echo "configure: failed program was:" >&5
1312   cat conftest.$ac_ext >&5
1313   rm -rf conftest*
1314   ac_cv_header_sys_wait_h=no
1315 fi
1316 rm -f conftest*
1317 fi
1318
1319 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1320 if test $ac_cv_header_sys_wait_h = yes; then
1321   cat >> confdefs.h <<\EOF
1322 #define HAVE_SYS_WAIT_H 1
1323 EOF
1324
1325 fi
1326
1327 ac_header_dirent=no
1328 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1329 do
1330 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1331 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1332 echo "configure:1333: checking for $ac_hdr that defines DIR" >&5
1333 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1334   echo $ac_n "(cached) $ac_c" 1>&6
1335 else
1336   cat > conftest.$ac_ext <<EOF
1337 #line 1338 "configure"
1338 #include "confdefs.h"
1339 #include <sys/types.h>
1340 #include <$ac_hdr>
1341 int main() {
1342 DIR *dirp = 0;
1343 ; return 0; }
1344 EOF
1345 if { (eval echo configure:1346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1346   rm -rf conftest*
1347   eval "ac_cv_header_dirent_$ac_safe=yes"
1348 else
1349   echo "configure: failed program was:" >&5
1350   cat conftest.$ac_ext >&5
1351   rm -rf conftest*
1352   eval "ac_cv_header_dirent_$ac_safe=no"
1353 fi
1354 rm -f conftest*
1355 fi
1356 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1357   echo "$ac_t""yes" 1>&6
1358     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1359   cat >> confdefs.h <<EOF
1360 #define $ac_tr_hdr 1
1361 EOF
1362  ac_header_dirent=$ac_hdr; break
1363 else
1364   echo "$ac_t""no" 1>&6
1365 fi
1366 done
1367 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1368 if test $ac_header_dirent = dirent.h; then
1369 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1370 echo "configure:1371: checking for opendir in -ldir" >&5
1371 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1372 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1373   echo $ac_n "(cached) $ac_c" 1>&6
1374 else
1375   ac_save_LIBS="$LIBS"
1376 LIBS="-ldir  $LIBS"
1377 cat > conftest.$ac_ext <<EOF
1378 #line 1379 "configure"
1379 #include "confdefs.h"
1380 /* Override any gcc2 internal prototype to avoid an error.  */
1381 /* We use char because int might match the return type of a gcc2
1382     builtin and then its argument prototype would still apply.  */
1383 char opendir();
1384
1385 int main() {
1386 opendir()
1387 ; return 0; }
1388 EOF
1389 if { (eval echo configure:1390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1390   rm -rf conftest*
1391   eval "ac_cv_lib_$ac_lib_var=yes"
1392 else
1393   echo "configure: failed program was:" >&5
1394   cat conftest.$ac_ext >&5
1395   rm -rf conftest*
1396   eval "ac_cv_lib_$ac_lib_var=no"
1397 fi
1398 rm -f conftest*
1399 LIBS="$ac_save_LIBS"
1400
1401 fi
1402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1403   echo "$ac_t""yes" 1>&6
1404   LIBS="$LIBS -ldir"
1405 else
1406   echo "$ac_t""no" 1>&6
1407 fi
1408
1409 else
1410 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1411 echo "configure:1412: checking for opendir in -lx" >&5
1412 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1413 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1414   echo $ac_n "(cached) $ac_c" 1>&6
1415 else
1416   ac_save_LIBS="$LIBS"
1417 LIBS="-lx  $LIBS"
1418 cat > conftest.$ac_ext <<EOF
1419 #line 1420 "configure"
1420 #include "confdefs.h"
1421 /* Override any gcc2 internal prototype to avoid an error.  */
1422 /* We use char because int might match the return type of a gcc2
1423     builtin and then its argument prototype would still apply.  */
1424 char opendir();
1425
1426 int main() {
1427 opendir()
1428 ; return 0; }
1429 EOF
1430 if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1431   rm -rf conftest*
1432   eval "ac_cv_lib_$ac_lib_var=yes"
1433 else
1434   echo "configure: failed program was:" >&5
1435   cat conftest.$ac_ext >&5
1436   rm -rf conftest*
1437   eval "ac_cv_lib_$ac_lib_var=no"
1438 fi
1439 rm -f conftest*
1440 LIBS="$ac_save_LIBS"
1441
1442 fi
1443 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1444   echo "$ac_t""yes" 1>&6
1445   LIBS="$LIBS -lx"
1446 else
1447   echo "$ac_t""no" 1>&6
1448 fi
1449
1450 fi
1451
1452
1453 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
1454 echo "configure:1455: checking for mode_t" >&5
1455 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
1456   echo $ac_n "(cached) $ac_c" 1>&6
1457 else
1458   cat > conftest.$ac_ext <<EOF
1459 #line 1460 "configure"
1460 #include "confdefs.h"
1461 #include <sys/types.h>
1462 #if STDC_HEADERS
1463 #include <stdlib.h>
1464 #include <stddef.h>
1465 #endif
1466 EOF
1467 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1468   egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1469   rm -rf conftest*
1470   ac_cv_type_mode_t=yes
1471 else
1472   rm -rf conftest*
1473   ac_cv_type_mode_t=no
1474 fi
1475 rm -f conftest*
1476
1477 fi
1478 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
1479 if test $ac_cv_type_mode_t = no; then
1480   cat >> confdefs.h <<\EOF
1481 #define mode_t int
1482 EOF
1483
1484 fi
1485
1486 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1487 echo "configure:1488: checking for pid_t" >&5
1488 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1489   echo $ac_n "(cached) $ac_c" 1>&6
1490 else
1491   cat > conftest.$ac_ext <<EOF
1492 #line 1493 "configure"
1493 #include "confdefs.h"
1494 #include <sys/types.h>
1495 #if STDC_HEADERS
1496 #include <stdlib.h>
1497 #include <stddef.h>
1498 #endif
1499 EOF
1500 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1501   egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1502   rm -rf conftest*
1503   ac_cv_type_pid_t=yes
1504 else
1505   rm -rf conftest*
1506   ac_cv_type_pid_t=no
1507 fi
1508 rm -f conftest*
1509
1510 fi
1511 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1512 if test $ac_cv_type_pid_t = no; then
1513   cat >> confdefs.h <<\EOF
1514 #define pid_t int
1515 EOF
1516
1517 fi
1518
1519 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1520 echo "configure:1521: checking return type of signal handlers" >&5
1521 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1522   echo $ac_n "(cached) $ac_c" 1>&6
1523 else
1524   cat > conftest.$ac_ext <<EOF
1525 #line 1526 "configure"
1526 #include "confdefs.h"
1527 #include <sys/types.h>
1528 #include <signal.h>
1529 #ifdef signal
1530 #undef signal
1531 #endif
1532 #ifdef __cplusplus
1533 extern "C" void (*signal (int, void (*)(int)))(int);
1534 #else
1535 void (*signal ()) ();
1536 #endif
1537
1538 int main() {
1539 int i;
1540 ; return 0; }
1541 EOF
1542 if { (eval echo configure:1543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1543   rm -rf conftest*
1544   ac_cv_type_signal=void
1545 else
1546   echo "configure: failed program was:" >&5
1547   cat conftest.$ac_ext >&5
1548   rm -rf conftest*
1549   ac_cv_type_signal=int
1550 fi
1551 rm -f conftest*
1552 fi
1553
1554 echo "$ac_t""$ac_cv_type_signal" 1>&6
1555 cat >> confdefs.h <<EOF
1556 #define RETSIGTYPE $ac_cv_type_signal
1557 EOF
1558
1559
1560 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1561 echo "configure:1562: checking for size_t" >&5
1562 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1563   echo $ac_n "(cached) $ac_c" 1>&6
1564 else
1565   cat > conftest.$ac_ext <<EOF
1566 #line 1567 "configure"
1567 #include "confdefs.h"
1568 #include <sys/types.h>
1569 #if STDC_HEADERS
1570 #include <stdlib.h>
1571 #include <stddef.h>
1572 #endif
1573 EOF
1574 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1575   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1576   rm -rf conftest*
1577   ac_cv_type_size_t=yes
1578 else
1579   rm -rf conftest*
1580   ac_cv_type_size_t=no
1581 fi
1582 rm -f conftest*
1583
1584 fi
1585 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1586 if test $ac_cv_type_size_t = no; then
1587   cat >> confdefs.h <<\EOF
1588 #define size_t unsigned
1589 EOF
1590
1591 fi
1592
1593
1594
1595 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
1596 echo "configure:1597: checking how to call gettimeofday" >&5
1597 if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
1598   echo $ac_n "(cached) $ac_c" 1>&6
1599 else
1600   cat > conftest.$ac_ext <<EOF
1601 #line 1602 "configure"
1602 #include "confdefs.h"
1603 #include <stdlib.h>
1604                   #include <sys/time.h>
1605 int main() {
1606 struct timeval tv; gettimeofday(&tv);
1607 ; return 0; }
1608 EOF
1609 if { (eval echo configure:1610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1610   rm -rf conftest*
1611   ac_gettimeofday_args=1
1612 else
1613   echo "configure: failed program was:" >&5
1614   cat conftest.$ac_ext >&5
1615   rm -rf conftest*
1616   cat > conftest.$ac_ext <<EOF
1617 #line 1618 "configure"
1618 #include "confdefs.h"
1619 #include <stdlib.h>
1620                                   #include <sys/time.h>
1621 int main() {
1622 struct timeval tv; struct timezone tzp;
1623                                   gettimeofday(&tv, &tzp);
1624 ; return 0; }
1625 EOF
1626 if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1627   rm -rf conftest*
1628   ac_gettimeofday_args=2
1629 else
1630   echo "configure: failed program was:" >&5
1631   cat conftest.$ac_ext >&5
1632   rm -rf conftest*
1633   ac_gettimeofday_args=0
1634 fi
1635 rm -f conftest*
1636 fi
1637 rm -f conftest*
1638   ac_cv_gettimeofday_args=$ac_gettimeofday_args
1639 fi
1640
1641 ac_gettimeofday_args=$ac_cv_gettimeofday_args
1642 if test $ac_gettimeofday_args = 1 ; then
1643   cat >> confdefs.h <<\EOF
1644 #define HAVE_GETTIMEOFDAY 1
1645 EOF
1646
1647   echo "$ac_t""one argument" 1>&6
1648 elif test $ac_gettimeofday_args = 2 ; then
1649   cat >> confdefs.h <<\EOF
1650 #define HAVE_GETTIMEOFDAY 1
1651 EOF
1652
1653   cat >> confdefs.h <<\EOF
1654 #define GETTIMEOFDAY_TWO_ARGS 1
1655 EOF
1656
1657   echo "$ac_t""two arguments" 1>&6
1658 else
1659   echo "$ac_t""unknown" 1>&6
1660 fi
1661
1662
1663 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
1664 do
1665 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1666 echo "configure:1667: checking for $ac_func" >&5
1667 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1668   echo $ac_n "(cached) $ac_c" 1>&6
1669 else
1670   cat > conftest.$ac_ext <<EOF
1671 #line 1672 "configure"
1672 #include "confdefs.h"
1673 /* System header to define __stub macros and hopefully few prototypes,
1674     which can conflict with char $ac_func(); below.  */
1675 #include <assert.h>
1676 /* Override any gcc2 internal prototype to avoid an error.  */
1677 /* We use char because int might match the return type of a gcc2
1678     builtin and then its argument prototype would still apply.  */
1679 char $ac_func();
1680
1681 int main() {
1682
1683 /* The GNU C library defines this for functions which it implements
1684     to always fail with ENOSYS.  Some functions are actually named
1685     something starting with __ and the normal name is an alias.  */
1686 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1687 choke me
1688 #else
1689 $ac_func();
1690 #endif
1691
1692 ; return 0; }
1693 EOF
1694 if { (eval echo configure:1695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1695   rm -rf conftest*
1696   eval "ac_cv_func_$ac_func=yes"
1697 else
1698   echo "configure: failed program was:" >&5
1699   cat conftest.$ac_ext >&5
1700   rm -rf conftest*
1701   eval "ac_cv_func_$ac_func=no"
1702 fi
1703 rm -f conftest*
1704 fi
1705
1706 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1707   echo "$ac_t""yes" 1>&6
1708     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1709   cat >> confdefs.h <<EOF
1710 #define $ac_tr_func 1
1711 EOF
1712  
1713 else
1714   echo "$ac_t""no" 1>&6
1715 fi
1716 done
1717
1718 for ac_hdr in unistd.h
1719 do
1720 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1721 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1722 echo "configure:1723: checking for $ac_hdr" >&5
1723 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1724   echo $ac_n "(cached) $ac_c" 1>&6
1725 else
1726   cat > conftest.$ac_ext <<EOF
1727 #line 1728 "configure"
1728 #include "confdefs.h"
1729 #include <$ac_hdr>
1730 EOF
1731 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1732 { (eval echo configure:1733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1733 ac_err=`grep -v '^ *+' conftest.out`
1734 if test -z "$ac_err"; then
1735   rm -rf conftest*
1736   eval "ac_cv_header_$ac_safe=yes"
1737 else
1738   echo "$ac_err" >&5
1739   echo "configure: failed program was:" >&5
1740   cat conftest.$ac_ext >&5
1741   rm -rf conftest*
1742   eval "ac_cv_header_$ac_safe=no"
1743 fi
1744 rm -f conftest*
1745 fi
1746 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1747   echo "$ac_t""yes" 1>&6
1748     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1749   cat >> confdefs.h <<EOF
1750 #define $ac_tr_hdr 1
1751 EOF
1752  
1753 else
1754   echo "$ac_t""no" 1>&6
1755 fi
1756 done
1757
1758
1759
1760
1761 # Check whether --enable-subdir or --disable-subdir was given.
1762 if test "${enable_subdir+set}" = set; then
1763   enableval="$enable_subdir"
1764   enable_subdir="$enableval"
1765 else
1766   enable_subdir=no
1767 fi
1768
1769 if test x"$enable_subdir" = xno; then
1770   HACKDIR='$(bindir)'
1771 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
1772   echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
1773   exit 1
1774 else
1775   HACKDIR='$(bindir)/'$enable_subdir
1776 fi
1777
1778
1779 # If we find X, set shell vars x_includes and x_libraries to the
1780 # paths, otherwise set no_x=yes.
1781 # Uses ac_ vars as temps to allow command line to override cache and checks.
1782 # --without-x overrides everything else, but does not touch the cache.
1783 echo $ac_n "checking for X""... $ac_c" 1>&6
1784 echo "configure:1785: checking for X" >&5
1785
1786 # Check whether --with-x or --without-x was given.
1787 if test "${with_x+set}" = set; then
1788   withval="$with_x"
1789   :
1790 fi
1791
1792 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
1793 if test "x$with_x" = xno; then
1794   # The user explicitly disabled X.
1795   have_x=disabled
1796 else
1797   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
1798     # Both variables are already set.
1799     have_x=yes
1800   else
1801 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
1802   echo $ac_n "(cached) $ac_c" 1>&6
1803 else
1804   # One or both of the vars are not set, and there is no cached value.
1805 ac_x_includes=NO ac_x_libraries=NO
1806 rm -fr conftestdir
1807 if mkdir conftestdir; then
1808   cd conftestdir
1809   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1810   cat > Imakefile <<'EOF'
1811 acfindx:
1812         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1813 EOF
1814   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1815     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1816     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1817     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
1818     for ac_extension in a so sl; do
1819       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1820         test -f $ac_im_libdir/libX11.$ac_extension; then
1821         ac_im_usrlibdir=$ac_im_libdir; break
1822       fi
1823     done
1824     # Screen out bogus values from the imake configuration.  They are
1825     # bogus both because they are the default anyway, and because
1826     # using them would break gcc on systems where it needs fixed includes.
1827     case "$ac_im_incroot" in
1828         /usr/include) ;;
1829         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1830     esac
1831     case "$ac_im_usrlibdir" in
1832         /usr/lib | /lib) ;;
1833         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1834     esac
1835   fi
1836   cd ..
1837   rm -fr conftestdir
1838 fi
1839
1840 if test "$ac_x_includes" = NO; then
1841   # Guess where to find include files, by looking for this one X11 .h file.
1842   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1843
1844   # First, try using that file with no special directory specified.
1845 cat > conftest.$ac_ext <<EOF
1846 #line 1847 "configure"
1847 #include "confdefs.h"
1848 #include <$x_direct_test_include>
1849 EOF
1850 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1851 { (eval echo configure:1852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1852 ac_err=`grep -v '^ *+' conftest.out`
1853 if test -z "$ac_err"; then
1854   rm -rf conftest*
1855   # We can compile using X headers with no special include directory.
1856 ac_x_includes=
1857 else
1858   echo "$ac_err" >&5
1859   echo "configure: failed program was:" >&5
1860   cat conftest.$ac_ext >&5
1861   rm -rf conftest*
1862   # Look for the header file in a standard set of common directories.
1863 # Check X11 before X11Rn because it is often a symlink to the current release.
1864   for ac_dir in               \
1865     /usr/X11/include          \
1866     /usr/X11R6/include        \
1867     /usr/X11R5/include        \
1868     /usr/X11R4/include        \
1869                               \
1870     /usr/include/X11          \
1871     /usr/include/X11R6        \
1872     /usr/include/X11R5        \
1873     /usr/include/X11R4        \
1874                               \
1875     /usr/local/X11/include    \
1876     /usr/local/X11R6/include  \
1877     /usr/local/X11R5/include  \
1878     /usr/local/X11R4/include  \
1879                               \
1880     /usr/local/include/X11    \
1881     /usr/local/include/X11R6  \
1882     /usr/local/include/X11R5  \
1883     /usr/local/include/X11R4  \
1884                               \
1885     /usr/X386/include         \
1886     /usr/x386/include         \
1887     /usr/XFree86/include/X11  \
1888                               \
1889     /usr/include              \
1890     /usr/local/include        \
1891     /usr/unsupported/include  \
1892     /usr/athena/include       \
1893     /usr/local/x11r5/include  \
1894     /usr/lpp/Xamples/include  \
1895                               \
1896     /usr/openwin/include      \
1897     /usr/openwin/share/include \
1898     ; \
1899   do
1900     if test -r "$ac_dir/$x_direct_test_include"; then
1901       ac_x_includes=$ac_dir
1902       break
1903     fi
1904   done
1905 fi
1906 rm -f conftest*
1907 fi # $ac_x_includes = NO
1908
1909 if test "$ac_x_libraries" = NO; then
1910   # Check for the libraries.
1911
1912   test -z "$x_direct_test_library" && x_direct_test_library=Xt
1913   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
1914
1915   # See if we find them without any special options.
1916   # Don't add to $LIBS permanently.
1917   ac_save_LIBS="$LIBS"
1918   LIBS="-l$x_direct_test_library $LIBS"
1919 cat > conftest.$ac_ext <<EOF
1920 #line 1921 "configure"
1921 #include "confdefs.h"
1922
1923 int main() {
1924 ${x_direct_test_function}()
1925 ; return 0; }
1926 EOF
1927 if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1928   rm -rf conftest*
1929   LIBS="$ac_save_LIBS"
1930 # We can link X programs with no special library path.
1931 ac_x_libraries=
1932 else
1933   echo "configure: failed program was:" >&5
1934   cat conftest.$ac_ext >&5
1935   rm -rf conftest*
1936   LIBS="$ac_save_LIBS"
1937 # First see if replacing the include by lib works.
1938 # Check X11 before X11Rn because it is often a symlink to the current release.
1939 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
1940     /usr/X11/lib          \
1941     /usr/X11R6/lib        \
1942     /usr/X11R5/lib        \
1943     /usr/X11R4/lib        \
1944                           \
1945     /usr/lib/X11          \
1946     /usr/lib/X11R6        \
1947     /usr/lib/X11R5        \
1948     /usr/lib/X11R4        \
1949                           \
1950     /usr/local/X11/lib    \
1951     /usr/local/X11R6/lib  \
1952     /usr/local/X11R5/lib  \
1953     /usr/local/X11R4/lib  \
1954                           \
1955     /usr/local/lib/X11    \
1956     /usr/local/lib/X11R6  \
1957     /usr/local/lib/X11R5  \
1958     /usr/local/lib/X11R4  \
1959                           \
1960     /usr/X386/lib         \
1961     /usr/x386/lib         \
1962     /usr/XFree86/lib/X11  \
1963                           \
1964     /usr/lib              \
1965     /usr/local/lib        \
1966     /usr/unsupported/lib  \
1967     /usr/athena/lib       \
1968     /usr/local/x11r5/lib  \
1969     /usr/lpp/Xamples/lib  \
1970     /lib/usr/lib/X11      \
1971                           \
1972     /usr/openwin/lib      \
1973     /usr/openwin/share/lib \
1974     ; \
1975 do
1976   for ac_extension in a so sl; do
1977     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
1978       ac_x_libraries=$ac_dir
1979       break 2
1980     fi
1981   done
1982 done
1983 fi
1984 rm -f conftest*
1985 fi # $ac_x_libraries = NO
1986
1987 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
1988   # Didn't find X anywhere.  Cache the known absence of X.
1989   ac_cv_have_x="have_x=no"
1990 else
1991   # Record where we found X for the cache.
1992   ac_cv_have_x="have_x=yes \
1993                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
1994 fi
1995 fi
1996   fi
1997   eval "$ac_cv_have_x"
1998 fi # $with_x != no
1999
2000 if test "$have_x" != yes; then
2001   echo "$ac_t""$have_x" 1>&6
2002   no_x=yes
2003 else
2004   # If each of the values was on the command line, it overrides each guess.
2005   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2006   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2007   # Update the cache value to reflect the command line values.
2008   ac_cv_have_x="have_x=yes \
2009                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2010   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2011 fi
2012
2013 if test "$no_x" = yes; then
2014   # Not all programs may use this symbol, but it does not hurt to define it.
2015   cat >> confdefs.h <<\EOF
2016 #define X_DISPLAY_MISSING 1
2017 EOF
2018
2019   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2020 else
2021   if test -n "$x_includes"; then
2022     X_CFLAGS="$X_CFLAGS -I$x_includes"
2023   fi
2024
2025   # It would also be nice to do this for all -L options, not just this one.
2026   if test -n "$x_libraries"; then
2027     X_LIBS="$X_LIBS -L$x_libraries"
2028     # For Solaris; some versions of Sun CC require a space after -R and
2029     # others require no space.  Words are not sufficient . . . .
2030     case "`(uname -sr) 2>/dev/null`" in
2031     "SunOS 5"*)
2032       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2033 echo "configure:2034: checking whether -R must be followed by a space" >&5
2034       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2035       cat > conftest.$ac_ext <<EOF
2036 #line 2037 "configure"
2037 #include "confdefs.h"
2038
2039 int main() {
2040
2041 ; return 0; }
2042 EOF
2043 if { (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2044   rm -rf conftest*
2045   ac_R_nospace=yes
2046 else
2047   echo "configure: failed program was:" >&5
2048   cat conftest.$ac_ext >&5
2049   rm -rf conftest*
2050   ac_R_nospace=no
2051 fi
2052 rm -f conftest*
2053       if test $ac_R_nospace = yes; then
2054         echo "$ac_t""no" 1>&6
2055         X_LIBS="$X_LIBS -R$x_libraries"
2056       else
2057         LIBS="$ac_xsave_LIBS -R $x_libraries"
2058         cat > conftest.$ac_ext <<EOF
2059 #line 2060 "configure"
2060 #include "confdefs.h"
2061
2062 int main() {
2063
2064 ; return 0; }
2065 EOF
2066 if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2067   rm -rf conftest*
2068   ac_R_space=yes
2069 else
2070   echo "configure: failed program was:" >&5
2071   cat conftest.$ac_ext >&5
2072   rm -rf conftest*
2073   ac_R_space=no
2074 fi
2075 rm -f conftest*
2076         if test $ac_R_space = yes; then
2077           echo "$ac_t""yes" 1>&6
2078           X_LIBS="$X_LIBS -R $x_libraries"
2079         else
2080           echo "$ac_t""neither works" 1>&6
2081         fi
2082       fi
2083       LIBS="$ac_xsave_LIBS"
2084     esac
2085   fi
2086
2087   # Check for system-dependent libraries X programs must link with.
2088   # Do this before checking for the system-independent R6 libraries
2089   # (-lICE), since we may need -lsocket or whatever for X linking.
2090
2091   if test "$ISC" = yes; then
2092     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2093   else
2094     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2095     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2096     # the Alpha needs dnet_stub (dnet does not exist).
2097     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2098 echo "configure:2099: checking for dnet_ntoa in -ldnet" >&5
2099 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2100 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2101   echo $ac_n "(cached) $ac_c" 1>&6
2102 else
2103   ac_save_LIBS="$LIBS"
2104 LIBS="-ldnet  $LIBS"
2105 cat > conftest.$ac_ext <<EOF
2106 #line 2107 "configure"
2107 #include "confdefs.h"
2108 /* Override any gcc2 internal prototype to avoid an error.  */
2109 /* We use char because int might match the return type of a gcc2
2110     builtin and then its argument prototype would still apply.  */
2111 char dnet_ntoa();
2112
2113 int main() {
2114 dnet_ntoa()
2115 ; return 0; }
2116 EOF
2117 if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2118   rm -rf conftest*
2119   eval "ac_cv_lib_$ac_lib_var=yes"
2120 else
2121   echo "configure: failed program was:" >&5
2122   cat conftest.$ac_ext >&5
2123   rm -rf conftest*
2124   eval "ac_cv_lib_$ac_lib_var=no"
2125 fi
2126 rm -f conftest*
2127 LIBS="$ac_save_LIBS"
2128
2129 fi
2130 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2131   echo "$ac_t""yes" 1>&6
2132   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2133 else
2134   echo "$ac_t""no" 1>&6
2135 fi
2136
2137     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2138       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2139 echo "configure:2140: checking for dnet_ntoa in -ldnet_stub" >&5
2140 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2141 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2142   echo $ac_n "(cached) $ac_c" 1>&6
2143 else
2144   ac_save_LIBS="$LIBS"
2145 LIBS="-ldnet_stub  $LIBS"
2146 cat > conftest.$ac_ext <<EOF
2147 #line 2148 "configure"
2148 #include "confdefs.h"
2149 /* Override any gcc2 internal prototype to avoid an error.  */
2150 /* We use char because int might match the return type of a gcc2
2151     builtin and then its argument prototype would still apply.  */
2152 char dnet_ntoa();
2153
2154 int main() {
2155 dnet_ntoa()
2156 ; return 0; }
2157 EOF
2158 if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2159   rm -rf conftest*
2160   eval "ac_cv_lib_$ac_lib_var=yes"
2161 else
2162   echo "configure: failed program was:" >&5
2163   cat conftest.$ac_ext >&5
2164   rm -rf conftest*
2165   eval "ac_cv_lib_$ac_lib_var=no"
2166 fi
2167 rm -f conftest*
2168 LIBS="$ac_save_LIBS"
2169
2170 fi
2171 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2172   echo "$ac_t""yes" 1>&6
2173   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2174 else
2175   echo "$ac_t""no" 1>&6
2176 fi
2177
2178     fi
2179
2180     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2181     # to get the SysV transport functions.
2182     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2183     # needs -lnsl.
2184     # The nsl library prevents programs from opening the X display
2185     # on Irix 5.2, according to dickey@clark.net.
2186     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2187 echo "configure:2188: checking for gethostbyname" >&5
2188 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2189   echo $ac_n "(cached) $ac_c" 1>&6
2190 else
2191   cat > conftest.$ac_ext <<EOF
2192 #line 2193 "configure"
2193 #include "confdefs.h"
2194 /* System header to define __stub macros and hopefully few prototypes,
2195     which can conflict with char gethostbyname(); below.  */
2196 #include <assert.h>
2197 /* Override any gcc2 internal prototype to avoid an error.  */
2198 /* We use char because int might match the return type of a gcc2
2199     builtin and then its argument prototype would still apply.  */
2200 char gethostbyname();
2201
2202 int main() {
2203
2204 /* The GNU C library defines this for functions which it implements
2205     to always fail with ENOSYS.  Some functions are actually named
2206     something starting with __ and the normal name is an alias.  */
2207 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2208 choke me
2209 #else
2210 gethostbyname();
2211 #endif
2212
2213 ; return 0; }
2214 EOF
2215 if { (eval echo configure:2216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2216   rm -rf conftest*
2217   eval "ac_cv_func_gethostbyname=yes"
2218 else
2219   echo "configure: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   rm -rf conftest*
2222   eval "ac_cv_func_gethostbyname=no"
2223 fi
2224 rm -f conftest*
2225 fi
2226
2227 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2228   echo "$ac_t""yes" 1>&6
2229   :
2230 else
2231   echo "$ac_t""no" 1>&6
2232 fi
2233
2234     if test $ac_cv_func_gethostbyname = no; then
2235       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2236 echo "configure:2237: checking for gethostbyname in -lnsl" >&5
2237 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2238 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2239   echo $ac_n "(cached) $ac_c" 1>&6
2240 else
2241   ac_save_LIBS="$LIBS"
2242 LIBS="-lnsl  $LIBS"
2243 cat > conftest.$ac_ext <<EOF
2244 #line 2245 "configure"
2245 #include "confdefs.h"
2246 /* Override any gcc2 internal prototype to avoid an error.  */
2247 /* We use char because int might match the return type of a gcc2
2248     builtin and then its argument prototype would still apply.  */
2249 char gethostbyname();
2250
2251 int main() {
2252 gethostbyname()
2253 ; return 0; }
2254 EOF
2255 if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2256   rm -rf conftest*
2257   eval "ac_cv_lib_$ac_lib_var=yes"
2258 else
2259   echo "configure: failed program was:" >&5
2260   cat conftest.$ac_ext >&5
2261   rm -rf conftest*
2262   eval "ac_cv_lib_$ac_lib_var=no"
2263 fi
2264 rm -f conftest*
2265 LIBS="$ac_save_LIBS"
2266
2267 fi
2268 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2269   echo "$ac_t""yes" 1>&6
2270   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2271 else
2272   echo "$ac_t""no" 1>&6
2273 fi
2274
2275     fi
2276
2277     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2278     # socket/setsockopt and other routines are undefined under SCO ODT
2279     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2280     # on later versions), says simon@lia.di.epfl.ch: it contains
2281     # gethostby* variants that don't use the nameserver (or something).
2282     # -lsocket must be given before -lnsl if both are needed.
2283     # We assume that if connect needs -lnsl, so does gethostbyname.
2284     echo $ac_n "checking for connect""... $ac_c" 1>&6
2285 echo "configure:2286: checking for connect" >&5
2286 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2287   echo $ac_n "(cached) $ac_c" 1>&6
2288 else
2289   cat > conftest.$ac_ext <<EOF
2290 #line 2291 "configure"
2291 #include "confdefs.h"
2292 /* System header to define __stub macros and hopefully few prototypes,
2293     which can conflict with char connect(); below.  */
2294 #include <assert.h>
2295 /* Override any gcc2 internal prototype to avoid an error.  */
2296 /* We use char because int might match the return type of a gcc2
2297     builtin and then its argument prototype would still apply.  */
2298 char connect();
2299
2300 int main() {
2301
2302 /* The GNU C library defines this for functions which it implements
2303     to always fail with ENOSYS.  Some functions are actually named
2304     something starting with __ and the normal name is an alias.  */
2305 #if defined (__stub_connect) || defined (__stub___connect)
2306 choke me
2307 #else
2308 connect();
2309 #endif
2310
2311 ; return 0; }
2312 EOF
2313 if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2314   rm -rf conftest*
2315   eval "ac_cv_func_connect=yes"
2316 else
2317   echo "configure: failed program was:" >&5
2318   cat conftest.$ac_ext >&5
2319   rm -rf conftest*
2320   eval "ac_cv_func_connect=no"
2321 fi
2322 rm -f conftest*
2323 fi
2324
2325 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2326   echo "$ac_t""yes" 1>&6
2327   :
2328 else
2329   echo "$ac_t""no" 1>&6
2330 fi
2331
2332     if test $ac_cv_func_connect = no; then
2333       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2334 echo "configure:2335: checking for connect in -lsocket" >&5
2335 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2336 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2337   echo $ac_n "(cached) $ac_c" 1>&6
2338 else
2339   ac_save_LIBS="$LIBS"
2340 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2341 cat > conftest.$ac_ext <<EOF
2342 #line 2343 "configure"
2343 #include "confdefs.h"
2344 /* Override any gcc2 internal prototype to avoid an error.  */
2345 /* We use char because int might match the return type of a gcc2
2346     builtin and then its argument prototype would still apply.  */
2347 char connect();
2348
2349 int main() {
2350 connect()
2351 ; return 0; }
2352 EOF
2353 if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2354   rm -rf conftest*
2355   eval "ac_cv_lib_$ac_lib_var=yes"
2356 else
2357   echo "configure: failed program was:" >&5
2358   cat conftest.$ac_ext >&5
2359   rm -rf conftest*
2360   eval "ac_cv_lib_$ac_lib_var=no"
2361 fi
2362 rm -f conftest*
2363 LIBS="$ac_save_LIBS"
2364
2365 fi
2366 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2367   echo "$ac_t""yes" 1>&6
2368   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
2369 else
2370   echo "$ac_t""no" 1>&6
2371 fi
2372
2373     fi
2374
2375     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
2376     echo $ac_n "checking for remove""... $ac_c" 1>&6
2377 echo "configure:2378: checking for remove" >&5
2378 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
2379   echo $ac_n "(cached) $ac_c" 1>&6
2380 else
2381   cat > conftest.$ac_ext <<EOF
2382 #line 2383 "configure"
2383 #include "confdefs.h"
2384 /* System header to define __stub macros and hopefully few prototypes,
2385     which can conflict with char remove(); below.  */
2386 #include <assert.h>
2387 /* Override any gcc2 internal prototype to avoid an error.  */
2388 /* We use char because int might match the return type of a gcc2
2389     builtin and then its argument prototype would still apply.  */
2390 char remove();
2391
2392 int main() {
2393
2394 /* The GNU C library defines this for functions which it implements
2395     to always fail with ENOSYS.  Some functions are actually named
2396     something starting with __ and the normal name is an alias.  */
2397 #if defined (__stub_remove) || defined (__stub___remove)
2398 choke me
2399 #else
2400 remove();
2401 #endif
2402
2403 ; return 0; }
2404 EOF
2405 if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2406   rm -rf conftest*
2407   eval "ac_cv_func_remove=yes"
2408 else
2409   echo "configure: failed program was:" >&5
2410   cat conftest.$ac_ext >&5
2411   rm -rf conftest*
2412   eval "ac_cv_func_remove=no"
2413 fi
2414 rm -f conftest*
2415 fi
2416
2417 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
2418   echo "$ac_t""yes" 1>&6
2419   :
2420 else
2421   echo "$ac_t""no" 1>&6
2422 fi
2423
2424     if test $ac_cv_func_remove = no; then
2425       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
2426 echo "configure:2427: checking for remove in -lposix" >&5
2427 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
2428 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2429   echo $ac_n "(cached) $ac_c" 1>&6
2430 else
2431   ac_save_LIBS="$LIBS"
2432 LIBS="-lposix  $LIBS"
2433 cat > conftest.$ac_ext <<EOF
2434 #line 2435 "configure"
2435 #include "confdefs.h"
2436 /* Override any gcc2 internal prototype to avoid an error.  */
2437 /* We use char because int might match the return type of a gcc2
2438     builtin and then its argument prototype would still apply.  */
2439 char remove();
2440
2441 int main() {
2442 remove()
2443 ; return 0; }
2444 EOF
2445 if { (eval echo configure:2446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2446   rm -rf conftest*
2447   eval "ac_cv_lib_$ac_lib_var=yes"
2448 else
2449   echo "configure: failed program was:" >&5
2450   cat conftest.$ac_ext >&5
2451   rm -rf conftest*
2452   eval "ac_cv_lib_$ac_lib_var=no"
2453 fi
2454 rm -f conftest*
2455 LIBS="$ac_save_LIBS"
2456
2457 fi
2458 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2459   echo "$ac_t""yes" 1>&6
2460   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
2461 else
2462   echo "$ac_t""no" 1>&6
2463 fi
2464
2465     fi
2466
2467     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2468     echo $ac_n "checking for shmat""... $ac_c" 1>&6
2469 echo "configure:2470: checking for shmat" >&5
2470 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
2471   echo $ac_n "(cached) $ac_c" 1>&6
2472 else
2473   cat > conftest.$ac_ext <<EOF
2474 #line 2475 "configure"
2475 #include "confdefs.h"
2476 /* System header to define __stub macros and hopefully few prototypes,
2477     which can conflict with char shmat(); below.  */
2478 #include <assert.h>
2479 /* Override any gcc2 internal prototype to avoid an error.  */
2480 /* We use char because int might match the return type of a gcc2
2481     builtin and then its argument prototype would still apply.  */
2482 char shmat();
2483
2484 int main() {
2485
2486 /* The GNU C library defines this for functions which it implements
2487     to always fail with ENOSYS.  Some functions are actually named
2488     something starting with __ and the normal name is an alias.  */
2489 #if defined (__stub_shmat) || defined (__stub___shmat)
2490 choke me
2491 #else
2492 shmat();
2493 #endif
2494
2495 ; return 0; }
2496 EOF
2497 if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2498   rm -rf conftest*
2499   eval "ac_cv_func_shmat=yes"
2500 else
2501   echo "configure: failed program was:" >&5
2502   cat conftest.$ac_ext >&5
2503   rm -rf conftest*
2504   eval "ac_cv_func_shmat=no"
2505 fi
2506 rm -f conftest*
2507 fi
2508
2509 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
2510   echo "$ac_t""yes" 1>&6
2511   :
2512 else
2513   echo "$ac_t""no" 1>&6
2514 fi
2515
2516     if test $ac_cv_func_shmat = no; then
2517       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
2518 echo "configure:2519: checking for shmat in -lipc" >&5
2519 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
2520 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2521   echo $ac_n "(cached) $ac_c" 1>&6
2522 else
2523   ac_save_LIBS="$LIBS"
2524 LIBS="-lipc  $LIBS"
2525 cat > conftest.$ac_ext <<EOF
2526 #line 2527 "configure"
2527 #include "confdefs.h"
2528 /* Override any gcc2 internal prototype to avoid an error.  */
2529 /* We use char because int might match the return type of a gcc2
2530     builtin and then its argument prototype would still apply.  */
2531 char shmat();
2532
2533 int main() {
2534 shmat()
2535 ; return 0; }
2536 EOF
2537 if { (eval echo configure:2538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2538   rm -rf conftest*
2539   eval "ac_cv_lib_$ac_lib_var=yes"
2540 else
2541   echo "configure: failed program was:" >&5
2542   cat conftest.$ac_ext >&5
2543   rm -rf conftest*
2544   eval "ac_cv_lib_$ac_lib_var=no"
2545 fi
2546 rm -f conftest*
2547 LIBS="$ac_save_LIBS"
2548
2549 fi
2550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2551   echo "$ac_t""yes" 1>&6
2552   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
2553 else
2554   echo "$ac_t""no" 1>&6
2555 fi
2556
2557     fi
2558   fi
2559
2560   # Check for libraries that X11R6 Xt/Xaw programs need.
2561   ac_save_LDFLAGS="$LDFLAGS"
2562   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
2563   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
2564   # check for ICE first), but we must link in the order -lSM -lICE or
2565   # we get undefined symbols.  So assume we have SM if we have ICE.
2566   # These have to be linked with before -lX11, unlike the other
2567   # libraries we check for below, so use a different variable.
2568   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
2569   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
2570 echo "configure:2571: checking for IceConnectionNumber in -lICE" >&5
2571 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
2572 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2573   echo $ac_n "(cached) $ac_c" 1>&6
2574 else
2575   ac_save_LIBS="$LIBS"
2576 LIBS="-lICE  $LIBS"
2577 cat > conftest.$ac_ext <<EOF
2578 #line 2579 "configure"
2579 #include "confdefs.h"
2580 /* Override any gcc2 internal prototype to avoid an error.  */
2581 /* We use char because int might match the return type of a gcc2
2582     builtin and then its argument prototype would still apply.  */
2583 char IceConnectionNumber();
2584
2585 int main() {
2586 IceConnectionNumber()
2587 ; return 0; }
2588 EOF
2589 if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2590   rm -rf conftest*
2591   eval "ac_cv_lib_$ac_lib_var=yes"
2592 else
2593   echo "configure: failed program was:" >&5
2594   cat conftest.$ac_ext >&5
2595   rm -rf conftest*
2596   eval "ac_cv_lib_$ac_lib_var=no"
2597 fi
2598 rm -f conftest*
2599 LIBS="$ac_save_LIBS"
2600
2601 fi
2602 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2603   echo "$ac_t""yes" 1>&6
2604   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
2605 else
2606   echo "$ac_t""no" 1>&6
2607 fi
2608
2609   LDFLAGS="$ac_save_LDFLAGS"
2610
2611 fi
2612
2613
2614 # Try and find the app-defaults directory.
2615 # It sucks that autoconf doesn't do this already...
2616 #
2617
2618
2619
2620
2621
2622
2623
2624
2625     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
2626 echo "configure:2627: checking for X app-defaults directory" >&5
2627 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
2628   echo $ac_n "(cached) $ac_c" 1>&6
2629 else
2630   
2631   rm -fr conftestdir
2632   if mkdir conftestdir; then
2633     cd conftestdir
2634     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2635     cat > Imakefile <<'EOF'
2636 acfindx:
2637         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
2638 EOF
2639     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2640       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
2641       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2642     fi
2643     cd ..
2644     rm -fr conftestdir
2645   fi
2646         # Look for the directory under a standard set of common directories.
2647   # Check X11 before X11Rn because it's often a symlink to the current release.
2648   for ac_dir in                                 \
2649     /usr/X11/lib/app-defaults                   \
2650     /usr/X11R6/lib/app-defaults                 \
2651     /usr/X11R6/lib/X11/app-defaults             \
2652     /usr/X11R5/lib/app-defaults                 \
2653     /usr/X11R5/lib/X11/app-defaults             \
2654     /usr/X11R4/lib/app-defaults                 \
2655     /usr/X11R4/lib/X11/app-defaults             \
2656                                                 \
2657     /usr/lib/X11/app-defaults                   \
2658     /usr/lib/X11R6/app-defaults                 \
2659     /usr/lib/X11R5/app-defaults                 \
2660     /usr/lib/X11R4/app-defaults                 \
2661                                                 \
2662     /usr/local/X11/lib/app-defaults             \
2663     /usr/local/X11R6/lib/app-defaults           \
2664     /usr/local/X11R5/lib/app-defaults           \
2665     /usr/local/X11R4/lib/app-defaults           \
2666                                                 \
2667     /usr/local/lib/X11/app-defaults             \
2668     /usr/local/lib/X11R6/app-defaults           \
2669     /usr/local/lib/X11R6/X11/app-defaults       \
2670     /usr/local/lib/X11R5/app-defaults           \
2671     /usr/local/lib/X11R5/X11/app-defaults       \
2672     /usr/local/lib/X11R4/app-defaults           \
2673     /usr/local/lib/X11R4/X11/app-defaults       \
2674                                                 \
2675     /usr/X386/lib/X11/app-defaults              \
2676     /usr/x386/lib/X11/app-defaults              \
2677     /usr/XFree86/lib/X11/app-defaults           \
2678                                                 \
2679     /usr/lib/X11/app-defaults                   \
2680     /usr/local/lib/X11/app-defaults             \
2681     /usr/unsupported/lib/X11/app-defaults       \
2682     /usr/athena/lib/X11/app-defaults            \
2683     /usr/local/x11r5/lib/X11/app-defaults       \
2684     /usr/lpp/Xamples/lib/X11/app-defaults       \
2685     /lib/usr/lib/X11/app-defaults               \
2686                                                 \
2687     /usr/openwin/lib/app-defaults               \
2688     /usr/openwin/lib/X11/app-defaults           \
2689     /usr/openwin/share/lib/app-defaults         \
2690     /usr/openwin/share/lib/X11/app-defaults     \
2691                                                 \
2692     /X11R6/lib/app-defaults                     \
2693     /X11R5/lib/app-defaults                     \
2694     /X11R4/lib/app-defaults                     \
2695     ; \
2696   do
2697     if test -d "$ac_dir"; then
2698       ac_x_app_defaults=$ac_dir
2699       break
2700     fi
2701   done
2702
2703       if test x"$ac_x_app_defaults" = x; then
2704         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
2705       else
2706         # Record where we found app-defaults for the cache.
2707         ac_cv_x_app_defaults="$ac_x_app_defaults"
2708       fi
2709 fi
2710
2711 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
2712     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
2713
2714 APPDEFAULTS=$ac_x_app_defaults
2715
2716
2717 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
2718 #
2719
2720
2721 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
2722 #
2723
2724
2725 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
2726 #
2727
2728
2729
2730 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
2731 # Use this sparingly; it probably doesn't work very well on X programs.
2732 #
2733
2734
2735
2736
2737
2738 # check for the HP XHPDisableReset server extension headers.
2739 #
2740
2741   ac_save_CPPFLAGS="$CPPFLAGS"
2742   if test \! -z "$includedir" ; then 
2743     CPPFLAGS="$CPPFLAGS -I$includedir"
2744   fi
2745   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2746   cat > conftest.$ac_ext <<EOF
2747 #line 2748 "configure"
2748 #include "confdefs.h"
2749 #include <X11/XHPlib.h>
2750 EOF
2751 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2752   egrep "XHPDisableReset" >/dev/null 2>&1; then
2753   rm -rf conftest*
2754   cat >> confdefs.h <<\EOF
2755 #define HAVE_XHPDISABLERESET 1
2756 EOF
2757
2758                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
2759 fi
2760 rm -f conftest*
2761
2762   CPPFLAGS="$ac_save_CPPFLAGS"
2763
2764
2765 # Check for the availability of the XPointer typedef, and define it otherwise.
2766 #
2767 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
2768 echo "configure:2769: checking for XPointer" >&5
2769 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
2770   echo $ac_n "(cached) $ac_c" 1>&6
2771 else
2772   
2773   ac_save_CPPFLAGS="$CPPFLAGS"
2774   if test \! -z "$includedir" ; then 
2775     CPPFLAGS="$CPPFLAGS -I$includedir"
2776   fi
2777   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2778   cat > conftest.$ac_ext <<EOF
2779 #line 2780 "configure"
2780 #include "confdefs.h"
2781 #include <X11/Xlib.h>
2782 int main() {
2783 XPointer foo = (XPointer) 0;
2784 ; return 0; }
2785 EOF
2786 if { (eval echo configure:2787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2787   rm -rf conftest*
2788   ac_cv_xpointer=yes
2789 else
2790   echo "configure: failed program was:" >&5
2791   cat conftest.$ac_ext >&5
2792   rm -rf conftest*
2793   ac_cv_xpointer=no
2794 fi
2795 rm -f conftest*
2796   CPPFLAGS="$ac_save_CPPFLAGS"
2797 fi
2798
2799 echo "$ac_t""$ac_cv_xpointer" 1>&6
2800 if test $ac_cv_xpointer != yes; then
2801   cat >> confdefs.h <<\EOF
2802 #define XPointer char*
2803 EOF
2804
2805 fi
2806
2807
2808 case "$host" in
2809   *-hpux*)
2810     # Thanks for not making xmkmf find this by default, you losers.
2811     if test -d /usr/lib/Motif1.2 ; then
2812       X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS"
2813       X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS"
2814     elif test -d /usr/lib/Motif1.1 ; then
2815       X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS"
2816       X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS"
2817     fi
2818
2819     # This too.  You losers.
2820     if test -d /usr/contrib/X11R6/include ; then
2821       X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS"
2822       X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS"
2823     elif test -d /usr/contrib/X11R5/include ; then
2824       X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS"
2825       X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS"
2826     fi
2827
2828   ;;
2829   *-solaris*)
2830     # Same to you, pinheads.  (Is this really the standard location now?
2831     # What happened to the joke that this kind of thing went in /opt?)
2832     if test -f /usr/dt/include/Xm/Xm.h ; then
2833       X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
2834       X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
2835
2836       # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
2837       echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
2838 echo "configure:2839: checking for regcmp in -lgen" >&5
2839 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
2840 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2841   echo $ac_n "(cached) $ac_c" 1>&6
2842 else
2843   ac_save_LIBS="$LIBS"
2844 LIBS="-lgen  $LIBS"
2845 cat > conftest.$ac_ext <<EOF
2846 #line 2847 "configure"
2847 #include "confdefs.h"
2848 /* Override any gcc2 internal prototype to avoid an error.  */
2849 /* We use char because int might match the return type of a gcc2
2850     builtin and then its argument prototype would still apply.  */
2851 char regcmp();
2852
2853 int main() {
2854 regcmp()
2855 ; return 0; }
2856 EOF
2857 if { (eval echo configure:2858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2858   rm -rf conftest*
2859   eval "ac_cv_lib_$ac_lib_var=yes"
2860 else
2861   echo "configure: failed program was:" >&5
2862   cat conftest.$ac_ext >&5
2863   rm -rf conftest*
2864   eval "ac_cv_lib_$ac_lib_var=no"
2865 fi
2866 rm -f conftest*
2867 LIBS="$ac_save_LIBS"
2868
2869 fi
2870 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2871   echo "$ac_t""yes" 1>&6
2872   X_LIBS="$X_LIBS -lgen"
2873 else
2874   echo "$ac_t""no" 1>&6
2875 fi
2876
2877     fi
2878   ;;
2879 esac
2880
2881
2882
2883 # Check for Xmu (some fucked up vendors don't ship it...)
2884 #
2885 have_xmu=no
2886
2887   ac_save_CPPFLAGS="$CPPFLAGS"
2888   if test \! -z "$includedir" ; then 
2889     CPPFLAGS="$CPPFLAGS -I$includedir"
2890   fi
2891   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2892   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
2893 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
2894 echo "configure:2895: checking for X11/Xmu/Error.h" >&5
2895 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2896   echo $ac_n "(cached) $ac_c" 1>&6
2897 else
2898   cat > conftest.$ac_ext <<EOF
2899 #line 2900 "configure"
2900 #include "confdefs.h"
2901 #include <X11/Xmu/Error.h>
2902 EOF
2903 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2904 { (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2905 ac_err=`grep -v '^ *+' conftest.out`
2906 if test -z "$ac_err"; then
2907   rm -rf conftest*
2908   eval "ac_cv_header_$ac_safe=yes"
2909 else
2910   echo "$ac_err" >&5
2911   echo "configure: failed program was:" >&5
2912   cat conftest.$ac_ext >&5
2913   rm -rf conftest*
2914   eval "ac_cv_header_$ac_safe=no"
2915 fi
2916 rm -f conftest*
2917 fi
2918 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2919   echo "$ac_t""yes" 1>&6
2920   have_xmu=yes
2921 else
2922   echo "$ac_t""no" 1>&6
2923 fi
2924
2925   CPPFLAGS="$ac_save_CPPFLAGS"
2926 if test $have_xmu = no ; then
2927   XMU_SRCS='$(UTILS_SRC)/xmu.c'
2928   XMU_OBJS='$(UTILS_BIN)/xmu.o'
2929 else
2930   XMU_SRCS=''
2931   XMU_OBJS=''
2932   SAVER_LIBS="-lXmu $SAVER_LIBS"
2933   HACK_LIBS="-lXmu $HACK_LIBS"
2934   cat >> confdefs.h <<\EOF
2935 #define HAVE_XMU 1
2936 EOF
2937
2938 fi
2939
2940
2941 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
2942 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
2943 #
2944 if test $have_xmu = yes ; then
2945   case "$host" in
2946     *-sunos4*)
2947     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
2948 echo "configure:2949: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
2949 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
2950   echo $ac_n "(cached) $ac_c" 1>&6
2951 else
2952   ac_save_LDFLAGS="$LDFLAGS"
2953                     if test \! -z "$x_libraries" ; then
2954                       LDFLAGS="$LDFLAGS -L$x_libraries"
2955                     fi
2956                     # Note: this trick never works!  (Generally.)
2957                     # We're only getting away with using AC_TRY_LINK
2958                     # with X libraries because we know it's SunOS.
2959                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
2960                     cat > conftest.$ac_ext <<EOF
2961 #line 2962 "configure"
2962 #include "confdefs.h"
2963
2964 int main() {
2965
2966 ; return 0; }
2967 EOF
2968 if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2969   rm -rf conftest*
2970   ac_cv_sunos_xmu_bug=no
2971 else
2972   echo "configure: failed program was:" >&5
2973   cat conftest.$ac_ext >&5
2974   rm -rf conftest*
2975   ac_cv_sunos_xmu_bug=yes
2976 fi
2977 rm -f conftest*
2978                     LDFLAGS="$ac_save_LDFLAGS"
2979 fi
2980
2981 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
2982     if test $ac_cv_sunos_xmu_bug = yes ; then
2983       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
2984 echo "configure:2985: checking whether the compiler understands -static" >&5
2985 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
2986   echo $ac_n "(cached) $ac_c" 1>&6
2987 else
2988   ac_save_LDFLAGS="$LDFLAGS"
2989                       LDFLAGS="$LDFLAGS -static"
2990                       cat > conftest.$ac_ext <<EOF
2991 #line 2992 "configure"
2992 #include "confdefs.h"
2993
2994 int main() {
2995
2996 ; return 0; }
2997 EOF
2998 if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2999   rm -rf conftest*
3000   ac_cv_ld_static=yes
3001 else
3002   echo "configure: failed program was:" >&5
3003   cat conftest.$ac_ext >&5
3004   rm -rf conftest*
3005   ac_cv_ld_static=no
3006 fi
3007 rm -f conftest*
3008                     LDFLAGS="$ac_save_LDFLAGS"
3009 fi
3010
3011 echo "$ac_t""$ac_cv_ld_static" 1>&6
3012       if test $ac_cv_ld_static = yes ; then
3013         LDFLAGS="$LDFLAGS -static"
3014       else
3015         LDFLAGS="$LDFLAGS -Bstatic"
3016       fi
3017     fi
3018     ;;
3019   esac
3020 fi
3021
3022
3023 # Check for the SGI SCREEN_SAVER server extension header.
3024 #
3025 have_sgi=no
3026 with_sgi_req=unspecified
3027 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3028 if test "${with_sgi_ext+set}" = set; then
3029   withval="$with_sgi_ext"
3030   with_sgi="$withval"; with_sgi_req="$withval"
3031 else
3032   with_sgi=yes
3033 fi
3034
3035 if test $with_sgi = yes; then
3036   
3037   ac_save_CPPFLAGS="$CPPFLAGS"
3038   if test \! -z "$includedir" ; then 
3039     CPPFLAGS="$CPPFLAGS -I$includedir"
3040   fi
3041   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3042   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3043 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3044 echo "configure:3045: checking for X11/extensions/XScreenSaver.h" >&5
3045 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3046   echo $ac_n "(cached) $ac_c" 1>&6
3047 else
3048   cat > conftest.$ac_ext <<EOF
3049 #line 3050 "configure"
3050 #include "confdefs.h"
3051 #include <X11/extensions/XScreenSaver.h>
3052 EOF
3053 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3054 { (eval echo configure:3055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3055 ac_err=`grep -v '^ *+' conftest.out`
3056 if test -z "$ac_err"; then
3057   rm -rf conftest*
3058   eval "ac_cv_header_$ac_safe=yes"
3059 else
3060   echo "$ac_err" >&5
3061   echo "configure: failed program was:" >&5
3062   cat conftest.$ac_ext >&5
3063   rm -rf conftest*
3064   eval "ac_cv_header_$ac_safe=no"
3065 fi
3066 rm -f conftest*
3067 fi
3068 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3069   echo "$ac_t""yes" 1>&6
3070   have_sgi=yes
3071                      cat >> confdefs.h <<\EOF
3072 #define HAVE_SGI_SAVER_EXTENSION 1
3073 EOF
3074
3075 else
3076   echo "$ac_t""no" 1>&6
3077 fi
3078
3079   CPPFLAGS="$ac_save_CPPFLAGS"
3080
3081 elif test $with_sgi != no; then
3082   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3083   exit 1
3084 fi
3085
3086 # Check for the MIT-SCREEN-SAVER server extension header,
3087 # unless the SGI extension has already been found.
3088 #
3089 have_mit=no
3090 with_mit_req=unspecified
3091 # Check whether --with-mit-ext or --without-mit-ext was given.
3092 if test "${with_mit_ext+set}" = set; then
3093   withval="$with_mit_ext"
3094   with_mit="$withval"; with_mit_req="$withval"
3095 else
3096   with_mit=yes
3097 fi
3098
3099 if test $have_sgi != yes; then
3100   if test $with_mit = yes; then
3101     
3102   ac_save_CPPFLAGS="$CPPFLAGS"
3103   if test \! -z "$includedir" ; then 
3104     CPPFLAGS="$CPPFLAGS -I$includedir"
3105   fi
3106   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3107   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3108 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3109 echo "configure:3110: checking for X11/extensions/scrnsaver.h" >&5
3110 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3111   echo $ac_n "(cached) $ac_c" 1>&6
3112 else
3113   cat > conftest.$ac_ext <<EOF
3114 #line 3115 "configure"
3115 #include "confdefs.h"
3116 #include <X11/extensions/scrnsaver.h>
3117 EOF
3118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3119 { (eval echo configure:3120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3120 ac_err=`grep -v '^ *+' conftest.out`
3121 if test -z "$ac_err"; then
3122   rm -rf conftest*
3123   eval "ac_cv_header_$ac_safe=yes"
3124 else
3125   echo "$ac_err" >&5
3126   echo "configure: failed program was:" >&5
3127   cat conftest.$ac_ext >&5
3128   rm -rf conftest*
3129   eval "ac_cv_header_$ac_safe=no"
3130 fi
3131 rm -f conftest*
3132 fi
3133 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3134   echo "$ac_t""yes" 1>&6
3135   have_mit=yes
3136 else
3137   echo "$ac_t""no" 1>&6
3138 fi
3139
3140   CPPFLAGS="$ac_save_CPPFLAGS"
3141
3142     # Now check to see if it's really in the library; XF86Free-3.3 ships
3143     # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
3144     #
3145     if test $have_mit = yes; then
3146       
3147   ac_save_CPPFLAGS="$CPPFLAGS"
3148   ac_save_LDFLAGS="$LDFLAGS"
3149   if test \! -z "$includedir" ; then 
3150     CPPFLAGS="$CPPFLAGS -I$includedir"
3151   fi
3152   if test \! -z "$includedir" ; then 
3153     CPPFLAGS="$CPPFLAGS -I$includedir"
3154   fi
3155   if test \! -z "$libdir" ; then
3156     LDFLAGS="$LDFLAGS -L$libdir"
3157   fi
3158   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3159   LDFLAGS="$LDFLAGS -L$x_libraries"
3160   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
3161 echo "configure:3162: checking for XScreenSaverRegister in -lXext" >&5
3162 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3163 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3164   echo $ac_n "(cached) $ac_c" 1>&6
3165 else
3166   ac_save_LIBS="$LIBS"
3167 LIBS="-lXext -lm $LIBS"
3168 cat > conftest.$ac_ext <<EOF
3169 #line 3170 "configure"
3170 #include "confdefs.h"
3171 /* Override any gcc2 internal prototype to avoid an error.  */
3172 /* We use char because int might match the return type of a gcc2
3173     builtin and then its argument prototype would still apply.  */
3174 char XScreenSaverRegister();
3175
3176 int main() {
3177 XScreenSaverRegister()
3178 ; return 0; }
3179 EOF
3180 if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3181   rm -rf conftest*
3182   eval "ac_cv_lib_$ac_lib_var=yes"
3183 else
3184   echo "configure: failed program was:" >&5
3185   cat conftest.$ac_ext >&5
3186   rm -rf conftest*
3187   eval "ac_cv_lib_$ac_lib_var=no"
3188 fi
3189 rm -f conftest*
3190 LIBS="$ac_save_LIBS"
3191
3192 fi
3193 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3194   echo "$ac_t""yes" 1>&6
3195     ac_tr_lib=HAVE_LIB`echo Xext | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3196     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3197   cat >> confdefs.h <<EOF
3198 #define $ac_tr_lib 1
3199 EOF
3200
3201   LIBS="-lXext $LIBS"
3202
3203 else
3204   echo "$ac_t""no" 1>&6
3205 have_mit=no
3206 fi
3207
3208   CPPFLAGS="$ac_save_CPPFLAGS"
3209   LDFLAGS="$ac_save_LDFLAGS"
3210
3211       if test $have_mit = no; then
3212         # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
3213         # of in Xext.  Thank you master, may I have another.
3214         
3215   ac_save_CPPFLAGS="$CPPFLAGS"
3216   ac_save_LDFLAGS="$LDFLAGS"
3217   if test \! -z "$includedir" ; then 
3218     CPPFLAGS="$CPPFLAGS -I$includedir"
3219   fi
3220   if test \! -z "$includedir" ; then 
3221     CPPFLAGS="$CPPFLAGS -I$includedir"
3222   fi
3223   if test \! -z "$libdir" ; then
3224     LDFLAGS="$LDFLAGS -L$libdir"
3225   fi
3226   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3227   LDFLAGS="$LDFLAGS -L$x_libraries"
3228   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
3229 echo "configure:3230: checking for XScreenSaverRegister in -lXExExt" >&5
3230 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3231 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3232   echo $ac_n "(cached) $ac_c" 1>&6
3233 else
3234   ac_save_LIBS="$LIBS"
3235 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
3236 cat > conftest.$ac_ext <<EOF
3237 #line 3238 "configure"
3238 #include "confdefs.h"
3239 /* Override any gcc2 internal prototype to avoid an error.  */
3240 /* We use char because int might match the return type of a gcc2
3241     builtin and then its argument prototype would still apply.  */
3242 char XScreenSaverRegister();
3243
3244 int main() {
3245 XScreenSaverRegister()
3246 ; return 0; }
3247 EOF
3248 if { (eval echo configure:3249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3249   rm -rf conftest*
3250   eval "ac_cv_lib_$ac_lib_var=yes"
3251 else
3252   echo "configure: failed program was:" >&5
3253   cat conftest.$ac_ext >&5
3254   rm -rf conftest*
3255   eval "ac_cv_lib_$ac_lib_var=no"
3256 fi
3257 rm -f conftest*
3258 LIBS="$ac_save_LIBS"
3259
3260 fi
3261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3262   echo "$ac_t""yes" 1>&6
3263   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
3264 else
3265   echo "$ac_t""no" 1>&6
3266 fi
3267
3268   CPPFLAGS="$ac_save_CPPFLAGS"
3269   LDFLAGS="$ac_save_LDFLAGS"
3270       fi
3271
3272       if test $have_mit = no; then
3273         # Double fuck!  Looks like some versions of XFree86 (whichever version
3274         # it is that comes with RedHat Linux 2.0 -- I can't find a version 
3275         # number) put this garbage in Xss instead of Xext.  Thank you master,
3276         #  may I have another.
3277         
3278   ac_save_CPPFLAGS="$CPPFLAGS"
3279   ac_save_LDFLAGS="$LDFLAGS"
3280   if test \! -z "$includedir" ; then 
3281     CPPFLAGS="$CPPFLAGS -I$includedir"
3282   fi
3283   if test \! -z "$includedir" ; then 
3284     CPPFLAGS="$CPPFLAGS -I$includedir"
3285   fi
3286   if test \! -z "$libdir" ; then
3287     LDFLAGS="$LDFLAGS -L$libdir"
3288   fi
3289   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3290   LDFLAGS="$LDFLAGS -L$x_libraries"
3291   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
3292 echo "configure:3293: checking for XScreenSaverRegister in -lXss" >&5
3293 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3294 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3295   echo $ac_n "(cached) $ac_c" 1>&6
3296 else
3297   ac_save_LIBS="$LIBS"
3298 LIBS="-lXss -lX11 -lXext -lm $LIBS"
3299 cat > conftest.$ac_ext <<EOF
3300 #line 3301 "configure"
3301 #include "confdefs.h"
3302 /* Override any gcc2 internal prototype to avoid an error.  */
3303 /* We use char because int might match the return type of a gcc2
3304     builtin and then its argument prototype would still apply.  */
3305 char XScreenSaverRegister();
3306
3307 int main() {
3308 XScreenSaverRegister()
3309 ; return 0; }
3310 EOF
3311 if { (eval echo configure:3312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3312   rm -rf conftest*
3313   eval "ac_cv_lib_$ac_lib_var=yes"
3314 else
3315   echo "configure: failed program was:" >&5
3316   cat conftest.$ac_ext >&5
3317   rm -rf conftest*
3318   eval "ac_cv_lib_$ac_lib_var=no"
3319 fi
3320 rm -f conftest*
3321 LIBS="$ac_save_LIBS"
3322
3323 fi
3324 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3325   echo "$ac_t""yes" 1>&6
3326   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
3327 else
3328   echo "$ac_t""no" 1>&6
3329 fi
3330
3331   CPPFLAGS="$ac_save_CPPFLAGS"
3332   LDFLAGS="$ac_save_LDFLAGS"
3333       fi
3334
3335     if test $have_mit = yes; then
3336       cat >> confdefs.h <<\EOF
3337 #define HAVE_MIT_SAVER_EXTENSION 1
3338 EOF
3339
3340     fi
3341
3342     fi
3343
3344   elif test $with_mit != no; then
3345     echo "error: must be yes or no: --with-mit-ext=$with_mit"
3346     exit 1
3347   fi
3348 fi
3349
3350
3351 # Check for the XIDLE server extension header,
3352 #
3353 have_xidle=no
3354 with_xidle_req=unspecified
3355 # Check whether --with-xidle-ext or --without-xidle-ext was given.
3356 if test "${with_xidle_ext+set}" = set; then
3357   withval="$with_xidle_ext"
3358   with_xidle="$withval"; with_xidle_req="$withval"
3359 else
3360   with_xidle=yes
3361 fi
3362
3363 if test $with_xidle = yes; then
3364   
3365   ac_save_CPPFLAGS="$CPPFLAGS"
3366   if test \! -z "$includedir" ; then 
3367     CPPFLAGS="$CPPFLAGS -I$includedir"
3368   fi
3369   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3370   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
3371 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
3372 echo "configure:3373: checking for X11/extensions/xidle.h" >&5
3373 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3374   echo $ac_n "(cached) $ac_c" 1>&6
3375 else
3376   cat > conftest.$ac_ext <<EOF
3377 #line 3378 "configure"
3378 #include "confdefs.h"
3379 #include <X11/extensions/xidle.h>
3380 EOF
3381 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3382 { (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3383 ac_err=`grep -v '^ *+' conftest.out`
3384 if test -z "$ac_err"; then
3385   rm -rf conftest*
3386   eval "ac_cv_header_$ac_safe=yes"
3387 else
3388   echo "$ac_err" >&5
3389   echo "configure: failed program was:" >&5
3390   cat conftest.$ac_ext >&5
3391   rm -rf conftest*
3392   eval "ac_cv_header_$ac_safe=no"
3393 fi
3394 rm -f conftest*
3395 fi
3396 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3397   echo "$ac_t""yes" 1>&6
3398   have_xidle=yes
3399                      cat >> confdefs.h <<\EOF
3400 #define HAVE_XIDLE_EXTENSION 1
3401 EOF
3402
3403 else
3404   echo "$ac_t""no" 1>&6
3405 fi
3406
3407   CPPFLAGS="$ac_save_CPPFLAGS"
3408 elif test $with_xidle != no; then
3409   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
3410   exit 1
3411 fi
3412
3413
3414 # Check for Motif and Athena --with and --without arguments.
3415 #
3416 have_motif=no
3417 have_athena=no
3418 with_motif_req=unspecified
3419 with_athena_req=unspecified
3420
3421 # Check whether --with-motif or --without-motif was given.
3422 if test "${with_motif+set}" = set; then
3423   withval="$with_motif"
3424   with_motif="$withval"; with_motif_req="$withval"
3425 else
3426   with_motif=no
3427 fi
3428
3429
3430 # Check whether --with-athena or --without-athena was given.
3431 if test "${with_athena+set}" = set; then
3432   withval="$with_athena"
3433   with_athena="$withval"; with_athena_req="$withval"
3434 else
3435   with_athena=no
3436 fi
3437
3438
3439 if test $with_motif != yes -a $with_motif != no ; then
3440   echo "error: must be yes or no: --with-motif=$with_motif"
3441   exit 1
3442 fi
3443
3444 if test $with_athena != yes -a $with_athena != no ; then
3445   echo "error: must be yes or no: --with-athena=$with_athena"
3446   exit 1
3447 fi
3448
3449
3450 # Saying --without-motif is the same as saying --with-athena.
3451 if test $with_motif_req = no ; then
3452   with_athena_req=yes
3453   with_athena=yes
3454 fi
3455
3456 # Saying --without-athena is the same as saying --with-motif.
3457 if test $with_athena_req = no ; then
3458   with_motif_req=yes
3459   with_motif=yes
3460 fi
3461
3462 # Check for Motif and Athena headers.
3463
3464 check_motif() {
3465   
3466   ac_save_CPPFLAGS="$CPPFLAGS"
3467   if test \! -z "$includedir" ; then 
3468     CPPFLAGS="$CPPFLAGS -I$includedir"
3469   fi
3470   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3471   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
3472 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
3473 echo "configure:3474: checking for Xm/Xm.h" >&5
3474 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3475   echo $ac_n "(cached) $ac_c" 1>&6
3476 else
3477   cat > conftest.$ac_ext <<EOF
3478 #line 3479 "configure"
3479 #include "confdefs.h"
3480 #include <Xm/Xm.h>
3481 EOF
3482 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3483 { (eval echo configure:3484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3484 ac_err=`grep -v '^ *+' conftest.out`
3485 if test -z "$ac_err"; then
3486   rm -rf conftest*
3487   eval "ac_cv_header_$ac_safe=yes"
3488 else
3489   echo "$ac_err" >&5
3490   echo "configure: failed program was:" >&5
3491   cat conftest.$ac_ext >&5
3492   rm -rf conftest*
3493   eval "ac_cv_header_$ac_safe=no"
3494 fi
3495 rm -f conftest*
3496 fi
3497 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3498   echo "$ac_t""yes" 1>&6
3499   have_motif=yes
3500                      cat >> confdefs.h <<\EOF
3501 #define HAVE_MOTIF 1
3502 EOF
3503
3504                      SAVER_LIBS="-lXm $SAVER_LIBS"
3505 else
3506   echo "$ac_t""no" 1>&6
3507 fi
3508
3509   CPPFLAGS="$ac_save_CPPFLAGS"
3510 }
3511
3512 check_athena() {
3513   
3514   ac_save_CPPFLAGS="$CPPFLAGS"
3515   if test \! -z "$includedir" ; then 
3516     CPPFLAGS="$CPPFLAGS -I$includedir"
3517   fi
3518   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3519   ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
3520 echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
3521 echo "configure:3522: checking for X11/Xaw/Dialog.h" >&5
3522 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3523   echo $ac_n "(cached) $ac_c" 1>&6
3524 else
3525   cat > conftest.$ac_ext <<EOF
3526 #line 3527 "configure"
3527 #include "confdefs.h"
3528 #include <X11/Xaw/Dialog.h>
3529 EOF
3530 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3531 { (eval echo configure:3532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3532 ac_err=`grep -v '^ *+' conftest.out`
3533 if test -z "$ac_err"; then
3534   rm -rf conftest*
3535   eval "ac_cv_header_$ac_safe=yes"
3536 else
3537   echo "$ac_err" >&5
3538   echo "configure: failed program was:" >&5
3539   cat conftest.$ac_ext >&5
3540   rm -rf conftest*
3541   eval "ac_cv_header_$ac_safe=no"
3542 fi
3543 rm -f conftest*
3544 fi
3545 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3546   echo "$ac_t""yes" 1>&6
3547   have_athena=yes
3548                     cat >> confdefs.h <<\EOF
3549 #define HAVE_ATHENA 1
3550 EOF
3551
3552                     SAVER_LIBS="-lXaw $SAVER_LIBS"
3553 else
3554   echo "$ac_t""no" 1>&6
3555 fi
3556
3557   CPPFLAGS="$ac_save_CPPFLAGS"
3558 }
3559
3560
3561 # If they asked for both motif and athena, check motif then athena.
3562 # If they asked for only motif, check motif then athena.
3563 # If they asked for only athena, check athena then motif.
3564 # If they asked for neither, check motif then athena.
3565
3566 if test $with_motif = yes; then
3567   # asked for both, or for motif only
3568   check_motif
3569   if test $have_motif = yes; then
3570     with_athena=no
3571     with_athena_req=no
3572   else
3573     check_athena
3574   fi
3575
3576 elif test $with_athena = yes; then
3577   # asked for athena only
3578   check_athena
3579   if test $have_athena = yes; then
3580     with_motif=no
3581   else
3582     check_motif
3583   fi
3584
3585 else
3586   # asked for neither
3587   check_motif
3588   if test $have_motif = yes; then
3589     with_athena=no
3590   else
3591     check_athena
3592   fi
3593
3594 fi
3595
3596
3597 # If we have Athena, check whether it's a version that includes
3598 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
3599 if test $have_athena = yes ; then
3600   echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
3601 echo "configure:3602: checking for XawViewportSetCoordinates in Viewport.h" >&5
3602 if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
3603   echo $ac_n "(cached) $ac_c" 1>&6
3604 else
3605   ac_cv_have_XawViewportSetCoordinates=no
3606                   
3607   ac_save_CPPFLAGS="$CPPFLAGS"
3608   if test \! -z "$includedir" ; then 
3609     CPPFLAGS="$CPPFLAGS -I$includedir"
3610   fi
3611   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3612   cat > conftest.$ac_ext <<EOF
3613 #line 3614 "configure"
3614 #include "confdefs.h"
3615 #include <X11/Xaw/Viewport.h>
3616 EOF
3617 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3618   egrep "XawViewportSetCoordinates" >/dev/null 2>&1; then
3619   rm -rf conftest*
3620   ac_cv_have_XawViewportSetCoordinates=yes
3621 fi
3622 rm -f conftest*
3623
3624   CPPFLAGS="$ac_save_CPPFLAGS"
3625 fi
3626
3627 echo "$ac_t""$ac_cv_have_XawViewportSetCoordinates" 1>&6
3628   if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
3629     cat >> confdefs.h <<\EOF
3630 #define HAVE_XawViewportSetCoordinates 1
3631 EOF
3632
3633   fi
3634 fi
3635
3636
3637 # If we have Motif, check whether it's really LessTif.
3638 #
3639 if test $have_motif = yes ; then
3640   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
3641 echo "configure:3642: checking whether Motif is really LessTif" >&5
3642 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
3643   echo $ac_n "(cached) $ac_c" 1>&6
3644 else
3645   
3646   ac_save_CPPFLAGS="$CPPFLAGS"
3647   if test \! -z "$includedir" ; then 
3648     CPPFLAGS="$CPPFLAGS -I$includedir"
3649   fi
3650   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3651   cat > conftest.$ac_ext <<EOF
3652 #line 3653 "configure"
3653 #include "confdefs.h"
3654 #include <Xm/Xm.h>
3655 int main() {
3656 long vers = LesstifVersion;
3657 ; return 0; }
3658 EOF
3659 if { (eval echo configure:3660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3660   rm -rf conftest*
3661   ac_cv_have_lesstif=yes
3662 else
3663   echo "configure: failed program was:" >&5
3664   cat conftest.$ac_ext >&5
3665   rm -rf conftest*
3666   ac_cv_have_lesstif=no
3667 fi
3668 rm -f conftest*
3669   CPPFLAGS="$ac_save_CPPFLAGS"
3670 fi
3671
3672 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
3673   have_lesstif=$ac_cv_have_lesstif
3674 fi
3675
3676
3677 # check for XPM header.
3678 #
3679 have_xpm=no
3680 with_xpm_req=unspecified
3681 # Check whether --with-xpm or --without-xpm was given.
3682 if test "${with_xpm+set}" = set; then
3683   withval="$with_xpm"
3684   with_xpm="$withval"; with_xpm_req="$withval"
3685 else
3686   with_xpm=yes
3687 fi
3688
3689 if test $with_xpm = yes; then
3690   
3691   ac_save_CPPFLAGS="$CPPFLAGS"
3692   if test \! -z "$includedir" ; then 
3693     CPPFLAGS="$CPPFLAGS -I$includedir"
3694   fi
3695   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3696   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
3697 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
3698 echo "configure:3699: checking for X11/xpm.h" >&5
3699 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3700   echo $ac_n "(cached) $ac_c" 1>&6
3701 else
3702   cat > conftest.$ac_ext <<EOF
3703 #line 3704 "configure"
3704 #include "confdefs.h"
3705 #include <X11/xpm.h>
3706 EOF
3707 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3708 { (eval echo configure:3709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3709 ac_err=`grep -v '^ *+' conftest.out`
3710 if test -z "$ac_err"; then
3711   rm -rf conftest*
3712   eval "ac_cv_header_$ac_safe=yes"
3713 else
3714   echo "$ac_err" >&5
3715   echo "configure: failed program was:" >&5
3716   cat conftest.$ac_ext >&5
3717   rm -rf conftest*
3718   eval "ac_cv_header_$ac_safe=no"
3719 fi
3720 rm -f conftest*
3721 fi
3722 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3723   echo "$ac_t""yes" 1>&6
3724   have_xpm=yes
3725                     cat >> confdefs.h <<\EOF
3726 #define HAVE_XPM 1
3727 EOF
3728
3729                     XPM_LIBS="-lXpm"
3730 else
3731   echo "$ac_t""no" 1>&6
3732 fi
3733
3734   CPPFLAGS="$ac_save_CPPFLAGS"
3735 elif test $with_xpm != no; then
3736   echo "error: must be yes or no: --with-xpm=$with_xpm"
3737   exit 1
3738 fi
3739
3740
3741 # check for the GL header
3742 #
3743 have_gl=no
3744 with_gl_req=unspecified
3745 # Check whether --with-gl or --without-gl was given.
3746 if test "${with_gl+set}" = set; then
3747   withval="$with_gl"
3748   with_gl="$withval"; with_gl_req="$withval"
3749 else
3750   with_gl=yes
3751 fi
3752
3753
3754 if test $with_gl = yes; then
3755   
3756   ac_save_CPPFLAGS="$CPPFLAGS"
3757   if test \! -z "$includedir" ; then 
3758     CPPFLAGS="$CPPFLAGS -I$includedir"
3759   fi
3760   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3761   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
3762 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
3763 echo "configure:3764: checking for GL/gl.h" >&5
3764 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3765   echo $ac_n "(cached) $ac_c" 1>&6
3766 else
3767   cat > conftest.$ac_ext <<EOF
3768 #line 3769 "configure"
3769 #include "confdefs.h"
3770 #include <GL/gl.h>
3771 EOF
3772 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3773 { (eval echo configure:3774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3774 ac_err=`grep -v '^ *+' conftest.out`
3775 if test -z "$ac_err"; then
3776   rm -rf conftest*
3777   eval "ac_cv_header_$ac_safe=yes"
3778 else
3779   echo "$ac_err" >&5
3780   echo "configure: failed program was:" >&5
3781   cat conftest.$ac_ext >&5
3782   rm -rf conftest*
3783   eval "ac_cv_header_$ac_safe=no"
3784 fi
3785 rm -f conftest*
3786 fi
3787 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3788   echo "$ac_t""yes" 1>&6
3789   have_gl=yes
3790 else
3791   echo "$ac_t""no" 1>&6
3792 fi
3793
3794   CPPFLAGS="$ac_save_CPPFLAGS"
3795   if test $have_gl = yes ; then
3796     
3797   ac_save_CPPFLAGS="$CPPFLAGS"
3798   if test \! -z "$includedir" ; then 
3799     CPPFLAGS="$CPPFLAGS -I$includedir"
3800   fi
3801   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3802   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
3803 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
3804 echo "configure:3805: checking for GL/glx.h" >&5
3805 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3806   echo $ac_n "(cached) $ac_c" 1>&6
3807 else
3808   cat > conftest.$ac_ext <<EOF
3809 #line 3810 "configure"
3810 #include "confdefs.h"
3811 #include <GL/glx.h>
3812 EOF
3813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3814 { (eval echo configure:3815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3815 ac_err=`grep -v '^ *+' conftest.out`
3816 if test -z "$ac_err"; then
3817   rm -rf conftest*
3818   eval "ac_cv_header_$ac_safe=yes"
3819 else
3820   echo "$ac_err" >&5
3821   echo "configure: failed program was:" >&5
3822   cat conftest.$ac_ext >&5
3823   rm -rf conftest*
3824   eval "ac_cv_header_$ac_safe=no"
3825 fi
3826 rm -f conftest*
3827 fi
3828 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3829   echo "$ac_t""yes" 1>&6
3830   have_gl=yes
3831 else
3832   echo "$ac_t""no" 1>&6
3833 fi
3834
3835   CPPFLAGS="$ac_save_CPPFLAGS"
3836   fi
3837
3838   # If we have the headers, try and figure out which vendor it's from.
3839   #
3840   if test $have_gl = yes ; then
3841
3842     cat >> confdefs.h <<\EOF
3843 #define HAVE_GL 1
3844 EOF
3845
3846     have_mesa_gl=no
3847     
3848   ac_save_CPPFLAGS="$CPPFLAGS"
3849   if test \! -z "$includedir" ; then 
3850     CPPFLAGS="$CPPFLAGS -I$includedir"
3851   fi
3852   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3853   cat > conftest.$ac_ext <<EOF
3854 #line 3855 "configure"
3855 #include "confdefs.h"
3856 #include <GL/glx.h>
3857 EOF
3858 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3859   egrep "Mesa" >/dev/null 2>&1; then
3860   rm -rf conftest*
3861   have_mesa_gl=yes
3862 fi
3863 rm -f conftest*
3864
3865   CPPFLAGS="$ac_save_CPPFLAGS"
3866     if test $have_mesa_gl = no ; then
3867       GL_LIBS="-lGL -lGLU"
3868     else
3869       cat >> confdefs.h <<\EOF
3870 #define HAVE_MESA_GL 1
3871 EOF
3872
3873       GL_LIBS="-lMesaGL -lMesaGLU"
3874     fi
3875   fi
3876
3877 elif test $with_gl != no; then
3878   echo "error: must be yes or no: --with-gl=$with_gl"
3879   exit 1
3880 fi
3881
3882
3883 # check for SGI XReadDisplay server extension header.
3884 #
3885 have_readdisplay=no
3886 with_readdisplay_req=unspecified
3887 # Check whether --with-readdisplay or --without-readdisplay was given.
3888 if test "${with_readdisplay+set}" = set; then
3889   withval="$with_readdisplay"
3890   with_readdisplay="$withval"; with_readdisplay_req="$withval"
3891 else
3892   with_readdisplay=yes
3893 fi
3894
3895 if test $with_readdisplay = yes; then
3896   
3897   ac_save_CPPFLAGS="$CPPFLAGS"
3898   if test \! -z "$includedir" ; then 
3899     CPPFLAGS="$CPPFLAGS -I$includedir"
3900   fi
3901   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3902   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
3903 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
3904 echo "configure:3905: checking for X11/extensions/readdisplay.h" >&5
3905 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3906   echo $ac_n "(cached) $ac_c" 1>&6
3907 else
3908   cat > conftest.$ac_ext <<EOF
3909 #line 3910 "configure"
3910 #include "confdefs.h"
3911 #include <X11/extensions/readdisplay.h>
3912 EOF
3913 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3914 { (eval echo configure:3915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3915 ac_err=`grep -v '^ *+' conftest.out`
3916 if test -z "$ac_err"; then
3917   rm -rf conftest*
3918   eval "ac_cv_header_$ac_safe=yes"
3919 else
3920   echo "$ac_err" >&5
3921   echo "configure: failed program was:" >&5
3922   cat conftest.$ac_ext >&5
3923   rm -rf conftest*
3924   eval "ac_cv_header_$ac_safe=no"
3925 fi
3926 rm -f conftest*
3927 fi
3928 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3929   echo "$ac_t""yes" 1>&6
3930   cat >> confdefs.h <<\EOF
3931 #define HAVE_READ_DISPLAY_EXTENSION 1
3932 EOF
3933
3934 else
3935   echo "$ac_t""no" 1>&6
3936 fi
3937
3938   CPPFLAGS="$ac_save_CPPFLAGS"
3939 elif test $with_readdisplay != no; then
3940   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
3941   exit 1
3942 fi
3943
3944
3945
3946 # Try to find a program to generate random text.
3947 #
3948 # Zippy is funnier than the idiocy generally spat out by `fortune',
3949 # so try to find that, by invoking Emacs and asking it where its 
3950 # libexec directory is ("yow" lives in there.)
3951 #
3952 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
3953 # and if so, use them.
3954 #
3955 # If that doesn't work, look in /usr/games, and if it's there, use
3956 # the full pathname.
3957 #
3958 with_zippy=""
3959 # Check whether --with-zippy or --without-zippy was given.
3960 if test "${with_zippy+set}" = set; then
3961   withval="$with_zippy"
3962   with_zippy="$withval"
3963 fi
3964
3965
3966 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
3967   $with_zippy=""
3968 fi
3969
3970 if test -n "$with_zippy" ; then
3971   ac_cv_zippy_program="$with_zippy"
3972
3973 elif test -n "$ac_cv_zippy_program"; then
3974   echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
3975
3976 else
3977
3978   for ac_prog in emacs
3979 do
3980 # Extract the first word of "$ac_prog", so it can be a program name with args.
3981 set dummy $ac_prog; ac_word=$2
3982 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3983 echo "configure:3984: checking for $ac_word" >&5
3984 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
3985   echo $ac_n "(cached) $ac_c" 1>&6
3986 else
3987   if test -n "$emacs_exe"; then
3988   ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
3989 else
3990   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3991   for ac_dir in $PATH; do
3992     test -z "$ac_dir" && ac_dir=.
3993     if test -f $ac_dir/$ac_word; then
3994       ac_cv_prog_emacs_exe="$ac_prog"
3995       break
3996     fi
3997   done
3998   IFS="$ac_save_ifs"
3999 fi
4000 fi
4001 emacs_exe="$ac_cv_prog_emacs_exe"
4002 if test -n "$emacs_exe"; then
4003   echo "$ac_t""$emacs_exe" 1>&6
4004 else
4005   echo "$ac_t""no" 1>&6
4006 fi
4007
4008 test -n "$emacs_exe" && break
4009 done
4010
4011   for ac_prog in xemacs
4012 do
4013 # Extract the first word of "$ac_prog", so it can be a program name with args.
4014 set dummy $ac_prog; ac_word=$2
4015 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4016 echo "configure:4017: checking for $ac_word" >&5
4017 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
4018   echo $ac_n "(cached) $ac_c" 1>&6
4019 else
4020   if test -n "$xemacs_exe"; then
4021   ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
4022 else
4023   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4024   for ac_dir in $PATH; do
4025     test -z "$ac_dir" && ac_dir=.
4026     if test -f $ac_dir/$ac_word; then
4027       ac_cv_prog_xemacs_exe="$ac_prog"
4028       break
4029     fi
4030   done
4031   IFS="$ac_save_ifs"
4032 fi
4033 fi
4034 xemacs_exe="$ac_cv_prog_xemacs_exe"
4035 if test -n "$xemacs_exe"; then
4036   echo "$ac_t""$xemacs_exe" 1>&6
4037 else
4038   echo "$ac_t""no" 1>&6
4039 fi
4040
4041 test -n "$xemacs_exe" && break
4042 done
4043
4044
4045   ac_cv_zippy_program=""
4046   eargs='-batch -q -nw --eval'
4047
4048   if test -n "$emacs_exe" ; then
4049     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
4050 echo "configure:4051: checking for emacs yow" >&5
4051     #
4052     # get emacs to tell us where the libexec directory is.
4053     #
4054     dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
4055          2>/dev/null | tail -1`
4056     dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
4057     #
4058     # try running libexec/yow and see if it exits without error.
4059     #
4060     if test x"$dir" != x -a -x $dir/yow ; then
4061       if $dir/yow >&- 2>&- ; then
4062         ac_cv_zippy_program="$dir/yow"
4063         echo "$ac_t""$ac_cv_zippy_program" 1>&6
4064       else
4065         echo "$ac_t""no" 1>&6
4066       fi
4067     fi
4068   fi
4069
4070   if test -z "$ac_cv_zippy_program" ; then
4071     echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
4072 echo "configure:4073: checking for xemacs yow" >&5
4073     if test -n "$xemacs_exe" ; then
4074       #
4075       # get xemacs to tell us where the libexec directory is.
4076       #
4077       dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
4078            2>/dev/null | tail -1`
4079       dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
4080       #
4081       # try running libexec/yow and see if it exits without error.
4082       #
4083       if test x"$dir" != x -a -x $dir/yow ; then
4084         if $dir/yow >&- 2>&- ; then
4085           ac_cv_zippy_program="$dir/yow"
4086           echo "$ac_t""$ac_cv_zippy_program" 1>&6
4087         else
4088           #
4089           # in some xemacs installations, the pathname of the yow.lines file
4090           # isn't hardcoded into the yow executable, and must be passed on 
4091           # the command line.  See if it's in libexec/../etc/.
4092
4093           # M4 sucks!!
4094           
4095           dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
4096           
4097
4098           yow="yow -f $dir_up/etc/yow.lines"
4099           if $dir/$yow >&- 2>&- ; then
4100             ac_cv_zippy_program="$dir/$yow"
4101             echo "$ac_t""$ac_cv_zippy_program" 1>&6
4102           else
4103             echo "$ac_t""no" 1>&6
4104           fi
4105         fi
4106       fi
4107     fi
4108   fi
4109
4110   # if that didn't work, try for some other programs...
4111   if test -z "$ac_cv_zippy_program" ; then
4112     fortune=''
4113     for ac_prog in fortune zippy yow
4114 do
4115 # Extract the first word of "$ac_prog", so it can be a program name with args.
4116 set dummy $ac_prog; ac_word=$2
4117 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4118 echo "configure:4119: checking for $ac_word" >&5
4119 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
4120   echo $ac_n "(cached) $ac_c" 1>&6
4121 else
4122   if test -n "$fortune"; then
4123   ac_cv_prog_fortune="$fortune" # Let the user override the test.
4124 else
4125   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4126   for ac_dir in $PATH; do
4127     test -z "$ac_dir" && ac_dir=.
4128     if test -f $ac_dir/$ac_word; then
4129       ac_cv_prog_fortune="$ac_prog"
4130       break
4131     fi
4132   done
4133   IFS="$ac_save_ifs"
4134 fi
4135 fi
4136 fortune="$ac_cv_prog_fortune"
4137 if test -n "$fortune"; then
4138   echo "$ac_t""$fortune" 1>&6
4139 else
4140   echo "$ac_t""no" 1>&6
4141 fi
4142
4143 test -n "$fortune" && break
4144 done
4145
4146     # if that didn't work, try for those programs in /usr/games...
4147     if test -z "$fortune" ; then
4148       for ac_prog in fortune zippy yow
4149 do
4150 # Extract the first word of "$ac_prog", so it can be a program name with args.
4151 set dummy $ac_prog; ac_word=$2
4152 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4153 echo "configure:4154: checking for $ac_word" >&5
4154 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
4155   echo $ac_n "(cached) $ac_c" 1>&6
4156 else
4157   case "$fortune" in
4158   /*)
4159   ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
4160   ;;
4161   *)
4162   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4163   for ac_dir in /usr/games:/usr/local/games$ac_dummy; do
4164     test -z "$ac_dir" && ac_dir=.
4165     if test -f $ac_dir/$ac_word; then
4166       ac_cv_path_fortune="$ac_dir/$ac_word"
4167       break
4168     fi
4169   done
4170   IFS="$ac_save_ifs"
4171   ;;
4172 esac
4173 fi
4174 fortune="$ac_cv_path_fortune"
4175 if test -n "$fortune"; then
4176   echo "$ac_t""$fortune" 1>&6
4177 else
4178   echo "$ac_t""no" 1>&6
4179 fi
4180
4181 test -n "$fortune" && break
4182 done
4183 test -n "$fortune" || fortune="fortune"
4184
4185     fi
4186   fi
4187 fi
4188
4189 if test -z "$ac_cv_zippy_program" ; then
4190   ac_cv_zippy_program=fortune
4191 fi
4192
4193 cat >> confdefs.h <<EOF
4194 #define ZIPPY_PROGRAM "$ac_cv_zippy_program"
4195 EOF
4196
4197
4198
4199
4200
4201 # Allow locking to be disabled at compile-time.
4202 #
4203 have_locking=yes
4204 have_kerberos=no
4205 with_kerberos_req=unspecified
4206 have_shadow=no
4207 with_shadow_req=unspecified
4208 need_setuid=no
4209
4210 # Check whether --enable-locking or --disable-locking was given.
4211 if test "${enable_locking+set}" = set; then
4212   enableval="$enable_locking"
4213   enable_locking="$enableval"
4214 else
4215   enable_locking=yes
4216 fi
4217
4218 if test $enable_locking = yes; then
4219
4220   # Check for Kerberos.
4221   #
4222   # Check whether --with-kerberos or --without-kerberos was given.
4223 if test "${with_kerberos+set}" = set; then
4224   withval="$with_kerberos"
4225   with_kerberos="$withval"; with_kerberos_req="$withval"
4226 else
4227   with_kerberos=yes
4228 fi
4229
4230   if test $with_kerberos = yes; then
4231     echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
4232 echo "configure:4233: checking for Kerberos" >&5
4233 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
4234   echo $ac_n "(cached) $ac_c" 1>&6
4235 else
4236   
4237   ac_save_CPPFLAGS="$CPPFLAGS"
4238   if test \! -z "$includedir" ; then 
4239     CPPFLAGS="$CPPFLAGS -I$includedir"
4240   fi
4241   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4242   cat > conftest.$ac_ext <<EOF
4243 #line 4244 "configure"
4244 #include "confdefs.h"
4245 #include <krb.h>
4246 int main() {
4247
4248 ; return 0; }
4249 EOF
4250 if { (eval echo configure:4251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4251   rm -rf conftest*
4252   ac_cv_kerberos=yes
4253 else
4254   echo "configure: failed program was:" >&5
4255   cat conftest.$ac_ext >&5
4256   rm -rf conftest*
4257   ac_cv_kerberos=no
4258 fi
4259 rm -f conftest*
4260   CPPFLAGS="$ac_save_CPPFLAGS"
4261 fi
4262
4263 echo "$ac_t""$ac_cv_kerberos" 1>&6
4264     if test $ac_cv_kerberos = yes ; then
4265       have_kerberos=yes
4266       cat >> confdefs.h <<\EOF
4267 #define HAVE_KERBEROS 1
4268 EOF
4269
4270       PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket"
4271     fi
4272   elif test $with_kerberos != no; then
4273     echo "error: must be yes or no: --with-kerberos=$with_kerberos"
4274     exit 1
4275   fi
4276
4277   # Next, check for the nine billion variants of shadow passwords...
4278
4279   passwd_cruft_done=no
4280   # Check whether --with-shadow or --without-shadow was given.
4281 if test "${with_shadow+set}" = set; then
4282   withval="$with_shadow"
4283   with_shadow="$withval"; with_shadow_req="$withval"
4284 else
4285   with_shadow=yes
4286 fi
4287
4288   if test $with_shadow = no; then
4289     passwd_cruft_done=yes
4290   elif test $with_shadow != yes; then
4291     echo "error: must be yes or no: --with-shadow=$with_shadow"
4292     exit 1
4293   fi
4294
4295
4296   # Sun's "adjunct" passwords.
4297   #
4298   if test $passwd_cruft_done = no ; then
4299     echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
4300 echo "configure:4301: checking for Sun-style shadow passwords" >&5
4301 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
4302   echo $ac_n "(cached) $ac_c" 1>&6
4303 else
4304   
4305   ac_save_CPPFLAGS="$CPPFLAGS"
4306   if test \! -z "$includedir" ; then 
4307     CPPFLAGS="$CPPFLAGS -I$includedir"
4308   fi
4309   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4310   cat > conftest.$ac_ext <<EOF
4311 #line 4312 "configure"
4312 #include "confdefs.h"
4313 #include <stdlib.h>
4314                                       #include <unistd.h>
4315                                       #include <sys/types.h>
4316                                       #include <sys/label.h>
4317                                       #include <sys/audit.h>
4318                                       #include <pwdadj.h>
4319 int main() {
4320 struct passwd_adjunct *p = getpwanam("nobody");
4321                          const char *pw = p->pwa_passwd;
4322 ; return 0; }
4323 EOF
4324 if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4325   rm -rf conftest*
4326   ac_cv_sun_adjunct=yes
4327 else
4328   echo "configure: failed program was:" >&5
4329   cat conftest.$ac_ext >&5
4330   rm -rf conftest*
4331   ac_cv_sun_adjunct=no
4332 fi
4333 rm -f conftest*
4334   CPPFLAGS="$ac_save_CPPFLAGS"
4335 fi
4336
4337 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
4338     if test $ac_cv_sun_adjunct = yes; then
4339       have_shadow=yes
4340       need_setuid=yes
4341       passwd_cruft_done=yes
4342       cat >> confdefs.h <<\EOF
4343 #define HAVE_ADJUNCT_PASSWD 1
4344 EOF
4345
4346     fi
4347   fi
4348
4349   # DEC and SCO so-called "enhanced" security.
4350   #
4351   if test $passwd_cruft_done = no ; then
4352     echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
4353 echo "configure:4354: checking for DEC-style shadow passwords" >&5
4354 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
4355   echo $ac_n "(cached) $ac_c" 1>&6
4356 else
4357   
4358   ac_save_CPPFLAGS="$CPPFLAGS"
4359   if test \! -z "$includedir" ; then 
4360     CPPFLAGS="$CPPFLAGS -I$includedir"
4361   fi
4362   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4363   cat > conftest.$ac_ext <<EOF
4364 #line 4365 "configure"
4365 #include "confdefs.h"
4366 #include <stdlib.h>
4367                                       #include <unistd.h>
4368                                       #include <sys/types.h>
4369                                       #include <pwd.h>
4370                                       #include <sys/security.h>
4371                                       #include <prot.h>
4372 int main() {
4373 struct pr_passwd *p;
4374                          const char *pw;
4375                          set_auth_parameters(0, 0);
4376                          check_auth_parameters();
4377                          p = getprpwnam("nobody");
4378                          pw = p->ufld.fd_encrypt;
4379 ; return 0; }
4380 EOF
4381 if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4382   rm -rf conftest*
4383   ac_cv_enhanced_passwd=yes
4384 else
4385   echo "configure: failed program was:" >&5
4386   cat conftest.$ac_ext >&5
4387   rm -rf conftest*
4388   ac_cv_enhanced_passwd=no
4389 fi
4390 rm -f conftest*
4391   CPPFLAGS="$ac_save_CPPFLAGS"
4392 fi
4393
4394 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
4395     if test $ac_cv_enhanced_passwd = yes; then
4396       have_shadow=yes
4397       need_setuid=yes
4398       passwd_cruft_done=yes
4399       cat >> confdefs.h <<\EOF
4400 #define HAVE_ENHANCED_PASSWD 1
4401 EOF
4402
4403
4404       # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
4405       # (I'm told it needs -lcurses too, but I don't understand why.)
4406       echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
4407 echo "configure:4408: checking for getprpwnam in -lprot" >&5
4408 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
4409 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4410   echo $ac_n "(cached) $ac_c" 1>&6
4411 else
4412   ac_save_LIBS="$LIBS"
4413 LIBS="-lprot -lx $LIBS"
4414 cat > conftest.$ac_ext <<EOF
4415 #line 4416 "configure"
4416 #include "confdefs.h"
4417 /* Override any gcc2 internal prototype to avoid an error.  */
4418 /* We use char because int might match the return type of a gcc2
4419     builtin and then its argument prototype would still apply.  */
4420 char getprpwnam();
4421
4422 int main() {
4423 getprpwnam()
4424 ; return 0; }
4425 EOF
4426 if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4427   rm -rf conftest*
4428   eval "ac_cv_lib_$ac_lib_var=yes"
4429 else
4430   echo "configure: failed program was:" >&5
4431   cat conftest.$ac_ext >&5
4432   rm -rf conftest*
4433   eval "ac_cv_lib_$ac_lib_var=no"
4434 fi
4435 rm -f conftest*
4436 LIBS="$ac_save_LIBS"
4437
4438 fi
4439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4440   echo "$ac_t""yes" 1>&6
4441   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
4442 else
4443   echo "$ac_t""no" 1>&6
4444 # On DEC, getprpwnam() is in -lsecurity
4445                     echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
4446 echo "configure:4447: checking for getprpwnam in -lsecurity" >&5
4447 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
4448 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4449   echo $ac_n "(cached) $ac_c" 1>&6
4450 else
4451   ac_save_LIBS="$LIBS"
4452 LIBS="-lsecurity  $LIBS"
4453 cat > conftest.$ac_ext <<EOF
4454 #line 4455 "configure"
4455 #include "confdefs.h"
4456 /* Override any gcc2 internal prototype to avoid an error.  */
4457 /* We use char because int might match the return type of a gcc2
4458     builtin and then its argument prototype would still apply.  */
4459 char getprpwnam();
4460
4461 int main() {
4462 getprpwnam()
4463 ; return 0; }
4464 EOF
4465 if { (eval echo configure:4466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4466   rm -rf conftest*
4467   eval "ac_cv_lib_$ac_lib_var=yes"
4468 else
4469   echo "configure: failed program was:" >&5
4470   cat conftest.$ac_ext >&5
4471   rm -rf conftest*
4472   eval "ac_cv_lib_$ac_lib_var=no"
4473 fi
4474 rm -f conftest*
4475 LIBS="$ac_save_LIBS"
4476
4477 fi
4478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4479   echo "$ac_t""yes" 1>&6
4480   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
4481 else
4482   echo "$ac_t""no" 1>&6
4483 fi
4484
4485 fi
4486
4487     fi
4488   fi
4489
4490   # HP's entry in the "Not Invented Here" Sweepstakes.
4491   #
4492   if test $passwd_cruft_done = no ; then
4493     echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
4494 echo "configure:4495: checking for HP-style shadow passwords" >&5
4495 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
4496   echo $ac_n "(cached) $ac_c" 1>&6
4497 else
4498   
4499   ac_save_CPPFLAGS="$CPPFLAGS"
4500   if test \! -z "$includedir" ; then 
4501     CPPFLAGS="$CPPFLAGS -I$includedir"
4502   fi
4503   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4504   cat > conftest.$ac_ext <<EOF
4505 #line 4506 "configure"
4506 #include "confdefs.h"
4507 #include <stdlib.h>
4508                                       #include <unistd.h>
4509                                       #include <sys/types.h>
4510                                       #include <pwd.h>
4511                                       #include <hpsecurity.h>
4512                                       #include <prot.h>
4513 int main() {
4514 struct s_passwd *p = getspwnam("nobody");
4515                          const char *pw = p->pw_passwd;
4516 ; return 0; }
4517 EOF
4518 if { (eval echo configure:4519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4519   rm -rf conftest*
4520   ac_cv_hpux_passwd=yes
4521 else
4522   echo "configure: failed program was:" >&5
4523   cat conftest.$ac_ext >&5
4524   rm -rf conftest*
4525   ac_cv_hpux_passwd=no
4526 fi
4527 rm -f conftest*
4528   CPPFLAGS="$ac_save_CPPFLAGS"
4529 fi
4530
4531 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
4532     if test $ac_cv_hpux_passwd = yes; then
4533       have_shadow=yes
4534       need_setuid=yes
4535       passwd_cruft_done=yes
4536       cat >> confdefs.h <<\EOF
4537 #define HAVE_HPUX_PASSWD 1
4538 EOF
4539
4540
4541       # on HPUX, bigcrypt is in -lsec
4542       echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
4543 echo "configure:4544: checking for bigcrypt in -lsec" >&5
4544 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
4545 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4546   echo $ac_n "(cached) $ac_c" 1>&6
4547 else
4548   ac_save_LIBS="$LIBS"
4549 LIBS="-lsec  $LIBS"
4550 cat > conftest.$ac_ext <<EOF
4551 #line 4552 "configure"
4552 #include "confdefs.h"
4553 /* Override any gcc2 internal prototype to avoid an error.  */
4554 /* We use char because int might match the return type of a gcc2
4555     builtin and then its argument prototype would still apply.  */
4556 char bigcrypt();
4557
4558 int main() {
4559 bigcrypt()
4560 ; return 0; }
4561 EOF
4562 if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4563   rm -rf conftest*
4564   eval "ac_cv_lib_$ac_lib_var=yes"
4565 else
4566   echo "configure: failed program was:" >&5
4567   cat conftest.$ac_ext >&5
4568   rm -rf conftest*
4569   eval "ac_cv_lib_$ac_lib_var=no"
4570 fi
4571 rm -f conftest*
4572 LIBS="$ac_save_LIBS"
4573
4574 fi
4575 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4576   echo "$ac_t""yes" 1>&6
4577   PASSWD_LIBS="$PASSWD_LIBS -lsec"
4578 else
4579   echo "$ac_t""no" 1>&6
4580 fi
4581
4582     fi
4583   fi
4584
4585   # Traditional (ha!) shadow passwords.
4586   #
4587   if test $passwd_cruft_done = no ; then
4588     echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
4589 echo "configure:4590: checking for generic shadow passwords" >&5
4590 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
4591   echo $ac_n "(cached) $ac_c" 1>&6
4592 else
4593   
4594   ac_save_CPPFLAGS="$CPPFLAGS"
4595   if test \! -z "$includedir" ; then 
4596     CPPFLAGS="$CPPFLAGS -I$includedir"
4597   fi
4598   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4599   cat > conftest.$ac_ext <<EOF
4600 #line 4601 "configure"
4601 #include "confdefs.h"
4602 #include <stdlib.h>
4603                                       #include <unistd.h>
4604                                       #include <sys/types.h>
4605                                       #include <pwd.h>
4606                                       #include <shadow.h>
4607 int main() {
4608 struct spwd *p = getspnam("nobody");
4609                          const char *pw = p->sp_pwdp;
4610 ; return 0; }
4611 EOF
4612 if { (eval echo configure:4613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4613   rm -rf conftest*
4614   ac_cv_shadow=yes
4615 else
4616   echo "configure: failed program was:" >&5
4617   cat conftest.$ac_ext >&5
4618   rm -rf conftest*
4619   ac_cv_shadow=no
4620 fi
4621 rm -f conftest*
4622   CPPFLAGS="$ac_save_CPPFLAGS"
4623 fi
4624
4625 echo "$ac_t""$ac_cv_shadow" 1>&6
4626     if test $ac_cv_shadow = yes; then
4627       have_shadow=yes
4628       need_setuid=yes
4629       passwd_cruft_done=yes
4630       cat >> confdefs.h <<\EOF
4631 #define HAVE_SHADOW_PASSWD 1
4632 EOF
4633
4634
4635       # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
4636       have_getspnam=no
4637       echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
4638 echo "configure:4639: checking for getspnam in -lc" >&5
4639 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
4640 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4641   echo $ac_n "(cached) $ac_c" 1>&6
4642 else
4643   ac_save_LIBS="$LIBS"
4644 LIBS="-lc  $LIBS"
4645 cat > conftest.$ac_ext <<EOF
4646 #line 4647 "configure"
4647 #include "confdefs.h"
4648 /* Override any gcc2 internal prototype to avoid an error.  */
4649 /* We use char because int might match the return type of a gcc2
4650     builtin and then its argument prototype would still apply.  */
4651 char getspnam();
4652
4653 int main() {
4654 getspnam()
4655 ; return 0; }
4656 EOF
4657 if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4658   rm -rf conftest*
4659   eval "ac_cv_lib_$ac_lib_var=yes"
4660 else
4661   echo "configure: failed program was:" >&5
4662   cat conftest.$ac_ext >&5
4663   rm -rf conftest*
4664   eval "ac_cv_lib_$ac_lib_var=no"
4665 fi
4666 rm -f conftest*
4667 LIBS="$ac_save_LIBS"
4668
4669 fi
4670 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4671   echo "$ac_t""yes" 1>&6
4672   have_getspnam=yes
4673 else
4674   echo "$ac_t""no" 1>&6
4675 fi
4676
4677       if test $have_getspnam = no ; then
4678         echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
4679 echo "configure:4680: checking for getspnam in -lgen" >&5
4680 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
4681 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4682   echo $ac_n "(cached) $ac_c" 1>&6
4683 else
4684   ac_save_LIBS="$LIBS"
4685 LIBS="-lgen  $LIBS"
4686 cat > conftest.$ac_ext <<EOF
4687 #line 4688 "configure"
4688 #include "confdefs.h"
4689 /* Override any gcc2 internal prototype to avoid an error.  */
4690 /* We use char because int might match the return type of a gcc2
4691     builtin and then its argument prototype would still apply.  */
4692 char getspnam();
4693
4694 int main() {
4695 getspnam()
4696 ; return 0; }
4697 EOF
4698 if { (eval echo configure:4699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4699   rm -rf conftest*
4700   eval "ac_cv_lib_$ac_lib_var=yes"
4701 else
4702   echo "configure: failed program was:" >&5
4703   cat conftest.$ac_ext >&5
4704   rm -rf conftest*
4705   eval "ac_cv_lib_$ac_lib_var=no"
4706 fi
4707 rm -f conftest*
4708 LIBS="$ac_save_LIBS"
4709
4710 fi
4711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4712   echo "$ac_t""yes" 1>&6
4713   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
4714 else
4715   echo "$ac_t""no" 1>&6
4716 fi
4717
4718       fi
4719     fi
4720   fi
4721
4722   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
4723   have_crypt=no
4724   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
4725 echo "configure:4726: checking for crypt in -lc" >&5
4726 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
4727 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4728   echo $ac_n "(cached) $ac_c" 1>&6
4729 else
4730   ac_save_LIBS="$LIBS"
4731 LIBS="-lc  $LIBS"
4732 cat > conftest.$ac_ext <<EOF
4733 #line 4734 "configure"
4734 #include "confdefs.h"
4735 /* Override any gcc2 internal prototype to avoid an error.  */
4736 /* We use char because int might match the return type of a gcc2
4737     builtin and then its argument prototype would still apply.  */
4738 char crypt();
4739
4740 int main() {
4741 crypt()
4742 ; return 0; }
4743 EOF
4744 if { (eval echo configure:4745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4745   rm -rf conftest*
4746   eval "ac_cv_lib_$ac_lib_var=yes"
4747 else
4748   echo "configure: failed program was:" >&5
4749   cat conftest.$ac_ext >&5
4750   rm -rf conftest*
4751   eval "ac_cv_lib_$ac_lib_var=no"
4752 fi
4753 rm -f conftest*
4754 LIBS="$ac_save_LIBS"
4755
4756 fi
4757 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4758   echo "$ac_t""yes" 1>&6
4759   have_crypt=yes
4760 else
4761   echo "$ac_t""no" 1>&6
4762 fi
4763
4764   if test $have_crypt = no ; then
4765     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
4766 echo "configure:4767: checking for crypt in -lcrypt" >&5
4767 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
4768 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4769   echo $ac_n "(cached) $ac_c" 1>&6
4770 else
4771   ac_save_LIBS="$LIBS"
4772 LIBS="-lcrypt  $LIBS"
4773 cat > conftest.$ac_ext <<EOF
4774 #line 4775 "configure"
4775 #include "confdefs.h"
4776 /* Override any gcc2 internal prototype to avoid an error.  */
4777 /* We use char because int might match the return type of a gcc2
4778     builtin and then its argument prototype would still apply.  */
4779 char crypt();
4780
4781 int main() {
4782 crypt()
4783 ; return 0; }
4784 EOF
4785 if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4786   rm -rf conftest*
4787   eval "ac_cv_lib_$ac_lib_var=yes"
4788 else
4789   echo "configure: failed program was:" >&5
4790   cat conftest.$ac_ext >&5
4791   rm -rf conftest*
4792   eval "ac_cv_lib_$ac_lib_var=no"
4793 fi
4794 rm -f conftest*
4795 LIBS="$ac_save_LIBS"
4796
4797 fi
4798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4799   echo "$ac_t""yes" 1>&6
4800   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
4801 else
4802   echo "$ac_t""no" 1>&6
4803 fi
4804
4805   fi
4806
4807
4808   # Most of the above shadow mechanisms will have set need_setuid to yes,
4809   # if they were found.  But, on some systems, we need setuid even when
4810   # using plain old vanilla passwords.
4811   #
4812   if test $need_setuid = no ; then
4813     case "$host" in
4814       *-hpux* | *-aix* | *-netbsd* )
4815         need_setuid=yes
4816       ;;
4817     esac
4818   fi
4819
4820 elif test $enable_locking = no; then
4821   cat >> confdefs.h <<\EOF
4822 #define NO_LOCKING 1
4823 EOF
4824
4825 else
4826   echo "error: must be yes or no: --enable-locking=$enable_locking"
4827   exit 1
4828 fi
4829
4830
4831
4832 if test \! -z "$includedir" ; then 
4833   INCLUDES="-I$includedir"
4834 fi
4835
4836 if test \! -z "$libdir" ; then
4837   LDFLAGS="$LDFLAGS -L$libdir"
4838 fi
4839
4840
4841 ##### should have options to override the DEPEND crap, I guess...
4842 DEPEND=makedepend
4843 DEPEND_FLAGS=
4844 DEPEND_DEFINES=
4845
4846
4847
4848 # Done testing things -- now substitute in some stuff for the Makefiles.
4849 #
4850 if test $have_motif = yes; then
4851   cat >> confdefs.h <<\EOF
4852 #define HAVE_MOTIF 1
4853 EOF
4854
4855   DIALOG_SRCS='$(MOTIF_SRCS)'
4856   DIALOG_OBJS='$(MOTIF_OBJS)'
4857 elif test $have_athena = yes; then
4858   cat >> confdefs.h <<\EOF
4859 #define HAVE_ATHENA 1
4860 EOF
4861
4862   DIALOG_SRCS='$(ATHENA_SRCS)'
4863   DIALOG_OBJS='$(ATHENA_OBJS)'
4864 else
4865   DIALOG_SRCS=''
4866   DIALOG_OBJS=''
4867 fi
4868
4869 if test $have_kerberos = yes; then
4870   PASSWD_SRCS='$(KERBEROS_SRCS)'
4871   PASSWD_OBJS='$(KERBEROS_OBJS)'
4872 else
4873   PASSWD_SRCS='$(PWENT_SRCS)'
4874   PASSWD_OBJS='$(PWENT_OBJS)'
4875 fi
4876
4877 if test $enable_locking = yes; then
4878   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
4879   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
4880 else
4881   LOCK_SRCS=''
4882   LOCK_OBJS=''
4883 fi
4884
4885 if test $need_setuid = yes; then
4886   NEED_SETUID=yes
4887   INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
4888 else
4889   NEED_SETUID=no
4890   INSTALL_SETUID='$(INSTALL_PROGRAM)'
4891 fi
4892
4893 tab='   '
4894 if test $have_gl = yes; then
4895   GL_EXES='$(GL_EXES)'
4896   GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'  \'
4897   GL_KLUDGE_2=${tab}
4898 else
4899   GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
4900   GL_KLUDGE_2='!'${tab}
4901 fi
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931 # Print some warnings before emitting the Makefiles.
4932 #
4933 warning=no
4934 warnsep='    #################################################################'
4935 warn() {
4936   if test $warning = no ; then
4937     echo '' ; echo "$warnsep" ; echo ''
4938     warning=yes
4939   fi
4940   echo "    Warning:" $*
4941 }
4942
4943 warn2() {
4944   echo "            " $*
4945 }
4946
4947 if test $with_sgi_req = yes -a $have_sgi = no ; then
4948   warn 'The SGI saver extension was requested, but was not found.'
4949 fi
4950
4951 if test $with_mit_req = yes -a $have_mit = no ; then
4952   warn 'The MIT saver extension was requested, but was not found.'
4953 fi
4954
4955 if test $with_xidle_req = yes -a $have_xidle = no ; then
4956   warn 'The XIdle extension was requested, but was not found.'
4957 fi
4958
4959 if test $have_motif = no -a $have_athena = no ; then
4960   warn  "Neither Motif nor Athena widgets seem to be available;"
4961   warn2 "one or the other is required."
4962
4963 elif test $with_motif_req = yes -a $have_motif = no ; then
4964   warn  "Use of Motif was requested, but it wasn't found;"
4965   warn2 "Athena will be used instead."
4966
4967 elif test $with_athena_req = yes -a $have_athena = no ; then
4968   warn  "Use of Athena was requested, but it wasn't found;"
4969   warn2 "Motif will be used instead."
4970 fi
4971
4972 if test $have_motif = yes -a $have_lesstif = yes ; then
4973   warn  "Motif is being used, but it appears to actually be LessTif."
4974   warn2 "XScreenSaver has been reported to have problems with some"
4975   warn2 "versions of LessTif (notably 0.79).  You might want to use"
4976   warn2 "Athena instead."
4977 fi
4978
4979 if test $with_xpm_req = yes -a $have_xpm = no ; then
4980   warn 'Use of XPM was requested, but it was not found.'
4981 fi
4982
4983 if test $with_gl_req = yes -a $have_gl = no ; then
4984   warn 'Use of GL was requested, but it was not found.'
4985 fi
4986
4987 if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
4988   warn 'Use of XReadDisplay was requested, but it was not found.'
4989 fi
4990
4991 if test $with_kerberos_req = yes -a $have_kerberos = no ; then
4992   warn 'Use of Kerberos was requested, but it was not found.'
4993 fi
4994
4995 if test $with_shadow_req = yes -a $have_shadow = no ; then
4996   warn 'Use of shadow passwords was requested, but they were not found.'
4997 fi
4998
4999 if test $warning = yes; then
5000   echo '' ; echo "$warnsep" ; echo ''
5001 fi
5002
5003
5004 trap '' 1 2 15
5005 cat > confcache <<\EOF
5006 # This file is a shell script that caches the results of configure
5007 # tests run on this system so they can be shared between configure
5008 # scripts and configure runs.  It is not useful on other systems.
5009 # If it contains results you don't want to keep, you may remove or edit it.
5010 #
5011 # By default, configure uses ./config.cache as the cache file,
5012 # creating it if it does not exist already.  You can give configure
5013 # the --cache-file=FILE option to use a different cache file; that is
5014 # what configure does when it calls configure scripts in
5015 # subdirectories, so they share the cache.
5016 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5017 # config.status only pays attention to the cache file if you give it the
5018 # --recheck option to rerun configure.
5019 #
5020 EOF
5021 # The following way of writing the cache mishandles newlines in values,
5022 # but we know of no workaround that is simple, portable, and efficient.
5023 # So, don't put newlines in cache variables' values.
5024 # Ultrix sh set writes to stderr and can't be redirected directly,
5025 # and sets the high bit in the cache file unless we assign to the vars.
5026 (set) 2>&1 |
5027   case `(ac_space=' '; set) 2>&1` in
5028   *ac_space=\ *)
5029     # `set' does not quote correctly, so add quotes (double-quote substitution
5030     # turns \\\\ into \\, and sed turns \\ into \).
5031     sed -n \
5032       -e "s/'/'\\\\''/g" \
5033       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5034     ;;
5035   *)
5036     # `set' quotes correctly as required by POSIX, so do not add quotes.
5037     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5038     ;;
5039   esac >> confcache
5040 if cmp -s $cache_file confcache; then
5041   :
5042 else
5043   if test -w $cache_file; then
5044     echo "updating cache $cache_file"
5045     cat confcache > $cache_file
5046   else
5047     echo "not updating unwritable cache $cache_file"
5048   fi
5049 fi
5050 rm -f confcache
5051
5052 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5053
5054 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5055 # Let make expand exec_prefix.
5056 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5057
5058 # Any assignment to VPATH causes Sun make to only execute
5059 # the first set of double-colon rules, so remove it if not needed.
5060 # If there is a colon in the path, we need to keep it.
5061 if test "x$srcdir" = x.; then
5062   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5063 fi
5064
5065 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5066
5067 DEFS=-DHAVE_CONFIG_H
5068
5069 # Without the "./", some shells look in PATH for config.status.
5070 : ${CONFIG_STATUS=./config.status}
5071
5072 echo creating $CONFIG_STATUS
5073 rm -f $CONFIG_STATUS
5074 cat > $CONFIG_STATUS <<EOF
5075 #! /bin/sh
5076 # Generated automatically by configure.
5077 # Run this file to recreate the current configuration.
5078 # This directory was configured as follows,
5079 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5080 #
5081 # $0 $ac_configure_args
5082 #
5083 # Compiler output produced by configure, useful for debugging
5084 # configure, is in ./config.log if it exists.
5085
5086 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5087 for ac_option
5088 do
5089   case "\$ac_option" in
5090   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5091     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5092     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5093   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5094     echo "$CONFIG_STATUS generated by autoconf version 2.12"
5095     exit 0 ;;
5096   -help | --help | --hel | --he | --h)
5097     echo "\$ac_cs_usage"; exit 0 ;;
5098   *) echo "\$ac_cs_usage"; exit 1 ;;
5099   esac
5100 done
5101
5102 ac_given_srcdir=$srcdir
5103 ac_given_INSTALL="$INSTALL"
5104
5105 trap 'rm -fr `echo "Makefile
5106           utils/Makefile
5107           driver/Makefile
5108           hacks/Makefile
5109           hacks/glx/Makefile
5110           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5111 EOF
5112 cat >> $CONFIG_STATUS <<EOF
5113
5114 # Protect against being on the right side of a sed subst in config.status.
5115 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5116  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5117 $ac_vpsub
5118 $extrasub
5119 s%@CFLAGS@%$CFLAGS%g
5120 s%@CPPFLAGS@%$CPPFLAGS%g
5121 s%@CXXFLAGS@%$CXXFLAGS%g
5122 s%@DEFS@%$DEFS%g
5123 s%@LDFLAGS@%$LDFLAGS%g
5124 s%@LIBS@%$LIBS%g
5125 s%@exec_prefix@%$exec_prefix%g
5126 s%@prefix@%$prefix%g
5127 s%@program_transform_name@%$program_transform_name%g
5128 s%@bindir@%$bindir%g
5129 s%@sbindir@%$sbindir%g
5130 s%@libexecdir@%$libexecdir%g
5131 s%@datadir@%$datadir%g
5132 s%@sysconfdir@%$sysconfdir%g
5133 s%@sharedstatedir@%$sharedstatedir%g
5134 s%@localstatedir@%$localstatedir%g
5135 s%@libdir@%$libdir%g
5136 s%@includedir@%$includedir%g
5137 s%@oldincludedir@%$oldincludedir%g
5138 s%@infodir@%$infodir%g
5139 s%@mandir@%$mandir%g
5140 s%@host@%$host%g
5141 s%@host_alias@%$host_alias%g
5142 s%@host_cpu@%$host_cpu%g
5143 s%@host_vendor@%$host_vendor%g
5144 s%@host_os@%$host_os%g
5145 s%@CC@%$CC%g
5146 s%@CPP@%$CPP%g
5147 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5148 s%@INSTALL_DATA@%$INSTALL_DATA%g
5149 s%@SET_MAKE@%$SET_MAKE%g
5150 s%@X_CFLAGS@%$X_CFLAGS%g
5151 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
5152 s%@X_LIBS@%$X_LIBS%g
5153 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
5154 s%@emacs_exe@%$emacs_exe%g
5155 s%@xemacs_exe@%$xemacs_exe%g
5156 s%@fortune@%$fortune%g
5157 s%@INCLUDES@%$INCLUDES%g
5158 s%@SAVER_LIBS@%$SAVER_LIBS%g
5159 s%@HACK_LIBS@%$HACK_LIBS%g
5160 s%@XPM_LIBS@%$XPM_LIBS%g
5161 s%@GL_LIBS@%$GL_LIBS%g
5162 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
5163 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
5164 s%@NEED_SETUID@%$NEED_SETUID%g
5165 s%@DIALOG_SRCS@%$DIALOG_SRCS%g
5166 s%@DIALOG_OBJS@%$DIALOG_OBJS%g
5167 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
5168 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
5169 s%@XMU_SRCS@%$XMU_SRCS%g
5170 s%@XMU_OBJS@%$XMU_OBJS%g
5171 s%@LOCK_SRCS@%$LOCK_SRCS%g
5172 s%@LOCK_OBJS@%$LOCK_OBJS%g
5173 s%@GL_EXES@%$GL_EXES%g
5174 s%@GL_KLUDGE_1@%$GL_KLUDGE_1%g
5175 s%@GL_KLUDGE_2@%$GL_KLUDGE_2%g
5176 s%@HACKDIR@%$HACKDIR%g
5177 s%@APPDEFAULTS@%$APPDEFAULTS%g
5178 s%@DEPEND@%$DEPEND%g
5179 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
5180 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
5181
5182 CEOF
5183 EOF
5184
5185 cat >> $CONFIG_STATUS <<\EOF
5186
5187 # Split the substitutions into bite-sized pieces for seds with
5188 # small command number limits, like on Digital OSF/1 and HP-UX.
5189 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5190 ac_file=1 # Number of current file.
5191 ac_beg=1 # First line for current file.
5192 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5193 ac_more_lines=:
5194 ac_sed_cmds=""
5195 while $ac_more_lines; do
5196   if test $ac_beg -gt 1; then
5197     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5198   else
5199     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5200   fi
5201   if test ! -s conftest.s$ac_file; then
5202     ac_more_lines=false
5203     rm -f conftest.s$ac_file
5204   else
5205     if test -z "$ac_sed_cmds"; then
5206       ac_sed_cmds="sed -f conftest.s$ac_file"
5207     else
5208       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5209     fi
5210     ac_file=`expr $ac_file + 1`
5211     ac_beg=$ac_end
5212     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5213   fi
5214 done
5215 if test -z "$ac_sed_cmds"; then
5216   ac_sed_cmds=cat
5217 fi
5218 EOF
5219
5220 cat >> $CONFIG_STATUS <<EOF
5221
5222 CONFIG_FILES=\${CONFIG_FILES-"Makefile
5223           utils/Makefile
5224           driver/Makefile
5225           hacks/Makefile
5226           hacks/glx/Makefile
5227           driver/XScreenSaver.ad"}
5228 EOF
5229 cat >> $CONFIG_STATUS <<\EOF
5230 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5231   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5232   case "$ac_file" in
5233   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5234        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5235   *) ac_file_in="${ac_file}.in" ;;
5236   esac
5237
5238   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5239
5240   # Remove last slash and all that follows it.  Not all systems have dirname.
5241   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5242   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5243     # The file is in a subdirectory.
5244     test ! -d "$ac_dir" && mkdir "$ac_dir"
5245     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5246     # A "../" for each directory in $ac_dir_suffix.
5247     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5248   else
5249     ac_dir_suffix= ac_dots=
5250   fi
5251
5252   case "$ac_given_srcdir" in
5253   .)  srcdir=.
5254       if test -z "$ac_dots"; then top_srcdir=.
5255       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5256   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5257   *) # Relative path.
5258     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5259     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5260   esac
5261
5262   case "$ac_given_INSTALL" in
5263   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5264   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5265   esac
5266
5267   echo creating "$ac_file"
5268   rm -f "$ac_file"
5269   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5270   case "$ac_file" in
5271   *Makefile*) ac_comsub="1i\\
5272 # $configure_input" ;;
5273   *) ac_comsub= ;;
5274   esac
5275
5276   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5277   sed -e "$ac_comsub
5278 s%@configure_input@%$configure_input%g
5279 s%@srcdir@%$srcdir%g
5280 s%@top_srcdir@%$top_srcdir%g
5281 s%@INSTALL@%$INSTALL%g
5282 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5283 fi; done
5284 rm -f conftest.s*
5285
5286 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5287 # NAME is the cpp macro being defined and VALUE is the value it is being given.
5288 #
5289 # ac_d sets the value in "#define NAME VALUE" lines.
5290 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5291 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5292 ac_dC='\3'
5293 ac_dD='%g'
5294 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5295 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5296 ac_uB='\([      ]\)%\1#\2define\3'
5297 ac_uC=' '
5298 ac_uD='\4%g'
5299 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5300 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5301 ac_eB='$%\1#\2define\3'
5302 ac_eC=' '
5303 ac_eD='%g'
5304
5305 if test "${CONFIG_HEADERS+set}" != set; then
5306 EOF
5307 cat >> $CONFIG_STATUS <<EOF
5308   CONFIG_HEADERS="config.h"
5309 EOF
5310 cat >> $CONFIG_STATUS <<\EOF
5311 fi
5312 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5313   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5314   case "$ac_file" in
5315   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5316        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5317   *) ac_file_in="${ac_file}.in" ;;
5318   esac
5319
5320   echo creating $ac_file
5321
5322   rm -f conftest.frag conftest.in conftest.out
5323   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5324   cat $ac_file_inputs > conftest.in
5325
5326 EOF
5327
5328 # Transform confdefs.h into a sed script conftest.vals that substitutes
5329 # the proper values into config.h.in to produce config.h.  And first:
5330 # Protect against being on the right side of a sed subst in config.status.
5331 # Protect against being in an unquoted here document in config.status.
5332 rm -f conftest.vals
5333 cat > conftest.hdr <<\EOF
5334 s/[\\&%]/\\&/g
5335 s%[\\$`]%\\&%g
5336 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5337 s%ac_d%ac_u%gp
5338 s%ac_u%ac_e%gp
5339 EOF
5340 sed -n -f conftest.hdr confdefs.h > conftest.vals
5341 rm -f conftest.hdr
5342
5343 # This sed command replaces #undef with comments.  This is necessary, for
5344 # example, in the case of _POSIX_SOURCE, which is predefined and required
5345 # on some systems where configure will not decide to define it.
5346 cat >> conftest.vals <<\EOF
5347 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5348 EOF
5349
5350 # Break up conftest.vals because some shells have a limit on
5351 # the size of here documents, and old seds have small limits too.
5352
5353 rm -f conftest.tail
5354 while :
5355 do
5356   ac_lines=`grep -c . conftest.vals`
5357   # grep -c gives empty output for an empty file on some AIX systems.
5358   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5359   # Write a limited-size here document to conftest.frag.
5360   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
5361   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5362   echo 'CEOF
5363   sed -f conftest.frag conftest.in > conftest.out
5364   rm -f conftest.in
5365   mv conftest.out conftest.in
5366 ' >> $CONFIG_STATUS
5367   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5368   rm -f conftest.vals
5369   mv conftest.tail conftest.vals
5370 done
5371 rm -f conftest.vals
5372
5373 cat >> $CONFIG_STATUS <<\EOF
5374   rm -f conftest.frag conftest.h
5375   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5376   cat conftest.in >> conftest.h
5377   rm -f conftest.in
5378   if cmp -s $ac_file conftest.h 2>/dev/null; then
5379     echo "$ac_file is unchanged"
5380     rm -f conftest.h
5381   else
5382     # Remove last slash and all that follows it.  Not all systems have dirname.
5383       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5384       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5385       # The file is in a subdirectory.
5386       test ! -d "$ac_dir" && mkdir "$ac_dir"
5387     fi
5388     rm -f $ac_file
5389     mv conftest.h $ac_file
5390   fi
5391 fi; done
5392
5393 EOF
5394 cat >> $CONFIG_STATUS <<EOF
5395
5396 EOF
5397 cat >> $CONFIG_STATUS <<\EOF
5398
5399 exit 0
5400 EOF
5401 chmod +x $CONFIG_STATUS
5402 rm -fr confdefs* $ac_clean_files
5403 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5404