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