ftp://ftp.demon.nl/disk1/redhat-contrib/libc5/SRPMS/xscreensaver-2.14-1.src.rpm
[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 return type of signal handlers""... $ac_c" 1>&6
1532 echo "configure:1533: checking return type of signal handlers" >&5
1533 if eval "test \"`echo '$''{'ac_cv_type_signal'+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 #include <signal.h>
1541 #ifdef signal
1542 #undef signal
1543 #endif
1544 #ifdef __cplusplus
1545 extern "C" void (*signal (int, void (*)(int)))(int);
1546 #else
1547 void (*signal ()) ();
1548 #endif
1549
1550 int main() {
1551 int i;
1552 ; return 0; }
1553 EOF
1554 if { (eval echo configure:1555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1555   rm -rf conftest*
1556   ac_cv_type_signal=void
1557 else
1558   echo "configure: failed program was:" >&5
1559   cat conftest.$ac_ext >&5
1560   rm -rf conftest*
1561   ac_cv_type_signal=int
1562 fi
1563 rm -f conftest*
1564 fi
1565
1566 echo "$ac_t""$ac_cv_type_signal" 1>&6
1567 cat >> confdefs.h <<EOF
1568 #define RETSIGTYPE $ac_cv_type_signal
1569 EOF
1570
1571
1572 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1573 echo "configure:1574: checking for size_t" >&5
1574 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1575   echo $ac_n "(cached) $ac_c" 1>&6
1576 else
1577   cat > conftest.$ac_ext <<EOF
1578 #line 1579 "configure"
1579 #include "confdefs.h"
1580 #include <sys/types.h>
1581 #if STDC_HEADERS
1582 #include <stdlib.h>
1583 #include <stddef.h>
1584 #endif
1585 EOF
1586 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1587   egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1588   rm -rf conftest*
1589   ac_cv_type_size_t=yes
1590 else
1591   rm -rf conftest*
1592   ac_cv_type_size_t=no
1593 fi
1594 rm -f conftest*
1595
1596 fi
1597 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1598 if test $ac_cv_type_size_t = no; then
1599   cat >> confdefs.h <<\EOF
1600 #define size_t unsigned
1601 EOF
1602
1603 fi
1604
1605
1606
1607 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
1608 echo "configure:1609: checking how to call gettimeofday" >&5
1609 if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
1610   echo $ac_n "(cached) $ac_c" 1>&6
1611 else
1612   cat > conftest.$ac_ext <<EOF
1613 #line 1614 "configure"
1614 #include "confdefs.h"
1615 #include <stdlib.h>
1616                   #include <sys/time.h>
1617 int main() {
1618 struct timeval tv; gettimeofday(&tv);
1619 ; return 0; }
1620 EOF
1621 if { (eval echo configure:1622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1622   rm -rf conftest*
1623   ac_gettimeofday_args=1
1624 else
1625   echo "configure: failed program was:" >&5
1626   cat conftest.$ac_ext >&5
1627   rm -rf conftest*
1628   cat > conftest.$ac_ext <<EOF
1629 #line 1630 "configure"
1630 #include "confdefs.h"
1631 #include <stdlib.h>
1632                                   #include <sys/time.h>
1633 int main() {
1634 struct timeval tv; struct timezone tzp;
1635                                   gettimeofday(&tv, &tzp);
1636 ; return 0; }
1637 EOF
1638 if { (eval echo configure:1639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1639   rm -rf conftest*
1640   ac_gettimeofday_args=2
1641 else
1642   echo "configure: failed program was:" >&5
1643   cat conftest.$ac_ext >&5
1644   rm -rf conftest*
1645   ac_gettimeofday_args=0
1646 fi
1647 rm -f conftest*
1648 fi
1649 rm -f conftest*
1650   ac_cv_gettimeofday_args=$ac_gettimeofday_args
1651 fi
1652
1653 ac_gettimeofday_args=$ac_cv_gettimeofday_args
1654 if test $ac_gettimeofday_args = 1 ; then
1655   cat >> confdefs.h <<\EOF
1656 #define HAVE_GETTIMEOFDAY 1
1657 EOF
1658
1659   echo "$ac_t""one argument" 1>&6
1660 elif test $ac_gettimeofday_args = 2 ; then
1661   cat >> confdefs.h <<\EOF
1662 #define HAVE_GETTIMEOFDAY 1
1663 EOF
1664
1665   cat >> confdefs.h <<\EOF
1666 #define GETTIMEOFDAY_TWO_ARGS 1
1667 EOF
1668
1669   echo "$ac_t""two arguments" 1>&6
1670 else
1671   echo "$ac_t""unknown" 1>&6
1672 fi
1673
1674
1675 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
1676 do
1677 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1678 echo "configure:1679: checking for $ac_func" >&5
1679 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1680   echo $ac_n "(cached) $ac_c" 1>&6
1681 else
1682   cat > conftest.$ac_ext <<EOF
1683 #line 1684 "configure"
1684 #include "confdefs.h"
1685 /* System header to define __stub macros and hopefully few prototypes,
1686     which can conflict with char $ac_func(); below.  */
1687 #include <assert.h>
1688 /* Override any gcc2 internal prototype to avoid an error.  */
1689 /* We use char because int might match the return type of a gcc2
1690     builtin and then its argument prototype would still apply.  */
1691 char $ac_func();
1692
1693 int main() {
1694
1695 /* The GNU C library defines this for functions which it implements
1696     to always fail with ENOSYS.  Some functions are actually named
1697     something starting with __ and the normal name is an alias.  */
1698 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1699 choke me
1700 #else
1701 $ac_func();
1702 #endif
1703
1704 ; return 0; }
1705 EOF
1706 if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1707   rm -rf conftest*
1708   eval "ac_cv_func_$ac_func=yes"
1709 else
1710   echo "configure: failed program was:" >&5
1711   cat conftest.$ac_ext >&5
1712   rm -rf conftest*
1713   eval "ac_cv_func_$ac_func=no"
1714 fi
1715 rm -f conftest*
1716 fi
1717
1718 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1719   echo "$ac_t""yes" 1>&6
1720     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1721   cat >> confdefs.h <<EOF
1722 #define $ac_tr_func 1
1723 EOF
1724  
1725 else
1726   echo "$ac_t""no" 1>&6
1727 fi
1728 done
1729
1730 for ac_hdr in unistd.h
1731 do
1732 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1733 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1734 echo "configure:1735: checking for $ac_hdr" >&5
1735 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1736   echo $ac_n "(cached) $ac_c" 1>&6
1737 else
1738   cat > conftest.$ac_ext <<EOF
1739 #line 1740 "configure"
1740 #include "confdefs.h"
1741 #include <$ac_hdr>
1742 EOF
1743 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1744 { (eval echo configure:1745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1745 ac_err=`grep -v '^ *+' conftest.out`
1746 if test -z "$ac_err"; then
1747   rm -rf conftest*
1748   eval "ac_cv_header_$ac_safe=yes"
1749 else
1750   echo "$ac_err" >&5
1751   echo "configure: failed program was:" >&5
1752   cat conftest.$ac_ext >&5
1753   rm -rf conftest*
1754   eval "ac_cv_header_$ac_safe=no"
1755 fi
1756 rm -f conftest*
1757 fi
1758 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1759   echo "$ac_t""yes" 1>&6
1760     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1761   cat >> confdefs.h <<EOF
1762 #define $ac_tr_hdr 1
1763 EOF
1764  
1765 else
1766   echo "$ac_t""no" 1>&6
1767 fi
1768 done
1769
1770
1771
1772
1773 # Check whether --enable-subdir or --disable-subdir was given.
1774 if test "${enable_subdir+set}" = set; then
1775   enableval="$enable_subdir"
1776   enable_subdir="$enableval"
1777 else
1778   enable_subdir=no
1779 fi
1780
1781 if test x"$enable_subdir" = xno; then
1782   HACKDIR='$(bindir)'
1783 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
1784   echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
1785   exit 1
1786 else
1787   HACKDIR='$(bindir)/'$enable_subdir
1788 fi
1789
1790
1791 # If we find X, set shell vars x_includes and x_libraries to the
1792 # paths, otherwise set no_x=yes.
1793 # Uses ac_ vars as temps to allow command line to override cache and checks.
1794 # --without-x overrides everything else, but does not touch the cache.
1795 echo $ac_n "checking for X""... $ac_c" 1>&6
1796 echo "configure:1797: checking for X" >&5
1797
1798 # Check whether --with-x or --without-x was given.
1799 if test "${with_x+set}" = set; then
1800   withval="$with_x"
1801   :
1802 fi
1803
1804 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
1805 if test "x$with_x" = xno; then
1806   # The user explicitly disabled X.
1807   have_x=disabled
1808 else
1809   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
1810     # Both variables are already set.
1811     have_x=yes
1812   else
1813 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
1814   echo $ac_n "(cached) $ac_c" 1>&6
1815 else
1816   # One or both of the vars are not set, and there is no cached value.
1817 ac_x_includes=NO ac_x_libraries=NO
1818 rm -fr conftestdir
1819 if mkdir conftestdir; then
1820   cd conftestdir
1821   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1822   cat > Imakefile <<'EOF'
1823 acfindx:
1824         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1825 EOF
1826   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1827     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1828     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1829     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
1830     for ac_extension in a so sl; do
1831       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1832         test -f $ac_im_libdir/libX11.$ac_extension; then
1833         ac_im_usrlibdir=$ac_im_libdir; break
1834       fi
1835     done
1836     # Screen out bogus values from the imake configuration.  They are
1837     # bogus both because they are the default anyway, and because
1838     # using them would break gcc on systems where it needs fixed includes.
1839     case "$ac_im_incroot" in
1840         /usr/include) ;;
1841         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1842     esac
1843     case "$ac_im_usrlibdir" in
1844         /usr/lib | /lib) ;;
1845         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1846     esac
1847   fi
1848   cd ..
1849   rm -fr conftestdir
1850 fi
1851
1852 if test "$ac_x_includes" = NO; then
1853   # Guess where to find include files, by looking for this one X11 .h file.
1854   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1855
1856   # First, try using that file with no special directory specified.
1857 cat > conftest.$ac_ext <<EOF
1858 #line 1859 "configure"
1859 #include "confdefs.h"
1860 #include <$x_direct_test_include>
1861 EOF
1862 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1863 { (eval echo configure:1864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1864 ac_err=`grep -v '^ *+' conftest.out`
1865 if test -z "$ac_err"; then
1866   rm -rf conftest*
1867   # We can compile using X headers with no special include directory.
1868 ac_x_includes=
1869 else
1870   echo "$ac_err" >&5
1871   echo "configure: failed program was:" >&5
1872   cat conftest.$ac_ext >&5
1873   rm -rf conftest*
1874   # Look for the header file in a standard set of common directories.
1875 # Check X11 before X11Rn because it is often a symlink to the current release.
1876   for ac_dir in               \
1877     /usr/X11/include          \
1878     /usr/X11R6/include        \
1879     /usr/X11R5/include        \
1880     /usr/X11R4/include        \
1881                               \
1882     /usr/include/X11          \
1883     /usr/include/X11R6        \
1884     /usr/include/X11R5        \
1885     /usr/include/X11R4        \
1886                               \
1887     /usr/local/X11/include    \
1888     /usr/local/X11R6/include  \
1889     /usr/local/X11R5/include  \
1890     /usr/local/X11R4/include  \
1891                               \
1892     /usr/local/include/X11    \
1893     /usr/local/include/X11R6  \
1894     /usr/local/include/X11R5  \
1895     /usr/local/include/X11R4  \
1896                               \
1897     /usr/X386/include         \
1898     /usr/x386/include         \
1899     /usr/XFree86/include/X11  \
1900                               \
1901     /usr/include              \
1902     /usr/local/include        \
1903     /usr/unsupported/include  \
1904     /usr/athena/include       \
1905     /usr/local/x11r5/include  \
1906     /usr/lpp/Xamples/include  \
1907                               \
1908     /usr/openwin/include      \
1909     /usr/openwin/share/include \
1910     ; \
1911   do
1912     if test -r "$ac_dir/$x_direct_test_include"; then
1913       ac_x_includes=$ac_dir
1914       break
1915     fi
1916   done
1917 fi
1918 rm -f conftest*
1919 fi # $ac_x_includes = NO
1920
1921 if test "$ac_x_libraries" = NO; then
1922   # Check for the libraries.
1923
1924   test -z "$x_direct_test_library" && x_direct_test_library=Xt
1925   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
1926
1927   # See if we find them without any special options.
1928   # Don't add to $LIBS permanently.
1929   ac_save_LIBS="$LIBS"
1930   LIBS="-l$x_direct_test_library $LIBS"
1931 cat > conftest.$ac_ext <<EOF
1932 #line 1933 "configure"
1933 #include "confdefs.h"
1934
1935 int main() {
1936 ${x_direct_test_function}()
1937 ; return 0; }
1938 EOF
1939 if { (eval echo configure:1940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1940   rm -rf conftest*
1941   LIBS="$ac_save_LIBS"
1942 # We can link X programs with no special library path.
1943 ac_x_libraries=
1944 else
1945   echo "configure: failed program was:" >&5
1946   cat conftest.$ac_ext >&5
1947   rm -rf conftest*
1948   LIBS="$ac_save_LIBS"
1949 # First see if replacing the include by lib works.
1950 # Check X11 before X11Rn because it is often a symlink to the current release.
1951 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
1952     /usr/X11/lib          \
1953     /usr/X11R6/lib        \
1954     /usr/X11R5/lib        \
1955     /usr/X11R4/lib        \
1956                           \
1957     /usr/lib/X11          \
1958     /usr/lib/X11R6        \
1959     /usr/lib/X11R5        \
1960     /usr/lib/X11R4        \
1961                           \
1962     /usr/local/X11/lib    \
1963     /usr/local/X11R6/lib  \
1964     /usr/local/X11R5/lib  \
1965     /usr/local/X11R4/lib  \
1966                           \
1967     /usr/local/lib/X11    \
1968     /usr/local/lib/X11R6  \
1969     /usr/local/lib/X11R5  \
1970     /usr/local/lib/X11R4  \
1971                           \
1972     /usr/X386/lib         \
1973     /usr/x386/lib         \
1974     /usr/XFree86/lib/X11  \
1975                           \
1976     /usr/lib              \
1977     /usr/local/lib        \
1978     /usr/unsupported/lib  \
1979     /usr/athena/lib       \
1980     /usr/local/x11r5/lib  \
1981     /usr/lpp/Xamples/lib  \
1982     /lib/usr/lib/X11      \
1983                           \
1984     /usr/openwin/lib      \
1985     /usr/openwin/share/lib \
1986     ; \
1987 do
1988   for ac_extension in a so sl; do
1989     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
1990       ac_x_libraries=$ac_dir
1991       break 2
1992     fi
1993   done
1994 done
1995 fi
1996 rm -f conftest*
1997 fi # $ac_x_libraries = NO
1998
1999 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2000   # Didn't find X anywhere.  Cache the known absence of X.
2001   ac_cv_have_x="have_x=no"
2002 else
2003   # Record where we found X for the cache.
2004   ac_cv_have_x="have_x=yes \
2005                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2006 fi
2007 fi
2008   fi
2009   eval "$ac_cv_have_x"
2010 fi # $with_x != no
2011
2012 if test "$have_x" != yes; then
2013   echo "$ac_t""$have_x" 1>&6
2014   no_x=yes
2015 else
2016   # If each of the values was on the command line, it overrides each guess.
2017   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2018   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2019   # Update the cache value to reflect the command line values.
2020   ac_cv_have_x="have_x=yes \
2021                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2022   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2023 fi
2024
2025 if test "$no_x" = yes; then
2026   # Not all programs may use this symbol, but it does not hurt to define it.
2027   cat >> confdefs.h <<\EOF
2028 #define X_DISPLAY_MISSING 1
2029 EOF
2030
2031   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2032 else
2033   if test -n "$x_includes"; then
2034     X_CFLAGS="$X_CFLAGS -I$x_includes"
2035   fi
2036
2037   # It would also be nice to do this for all -L options, not just this one.
2038   if test -n "$x_libraries"; then
2039     X_LIBS="$X_LIBS -L$x_libraries"
2040     # For Solaris; some versions of Sun CC require a space after -R and
2041     # others require no space.  Words are not sufficient . . . .
2042     case "`(uname -sr) 2>/dev/null`" in
2043     "SunOS 5"*)
2044       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2045 echo "configure:2046: checking whether -R must be followed by a space" >&5
2046       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2047       cat > conftest.$ac_ext <<EOF
2048 #line 2049 "configure"
2049 #include "confdefs.h"
2050
2051 int main() {
2052
2053 ; return 0; }
2054 EOF
2055 if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2056   rm -rf conftest*
2057   ac_R_nospace=yes
2058 else
2059   echo "configure: failed program was:" >&5
2060   cat conftest.$ac_ext >&5
2061   rm -rf conftest*
2062   ac_R_nospace=no
2063 fi
2064 rm -f conftest*
2065       if test $ac_R_nospace = yes; then
2066         echo "$ac_t""no" 1>&6
2067         X_LIBS="$X_LIBS -R$x_libraries"
2068       else
2069         LIBS="$ac_xsave_LIBS -R $x_libraries"
2070         cat > conftest.$ac_ext <<EOF
2071 #line 2072 "configure"
2072 #include "confdefs.h"
2073
2074 int main() {
2075
2076 ; return 0; }
2077 EOF
2078 if { (eval echo configure:2079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2079   rm -rf conftest*
2080   ac_R_space=yes
2081 else
2082   echo "configure: failed program was:" >&5
2083   cat conftest.$ac_ext >&5
2084   rm -rf conftest*
2085   ac_R_space=no
2086 fi
2087 rm -f conftest*
2088         if test $ac_R_space = yes; then
2089           echo "$ac_t""yes" 1>&6
2090           X_LIBS="$X_LIBS -R $x_libraries"
2091         else
2092           echo "$ac_t""neither works" 1>&6
2093         fi
2094       fi
2095       LIBS="$ac_xsave_LIBS"
2096     esac
2097   fi
2098
2099   # Check for system-dependent libraries X programs must link with.
2100   # Do this before checking for the system-independent R6 libraries
2101   # (-lICE), since we may need -lsocket or whatever for X linking.
2102
2103   if test "$ISC" = yes; then
2104     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2105   else
2106     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2107     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2108     # the Alpha needs dnet_stub (dnet does not exist).
2109     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2110 echo "configure:2111: checking for dnet_ntoa in -ldnet" >&5
2111 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2112 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2113   echo $ac_n "(cached) $ac_c" 1>&6
2114 else
2115   ac_save_LIBS="$LIBS"
2116 LIBS="-ldnet  $LIBS"
2117 cat > conftest.$ac_ext <<EOF
2118 #line 2119 "configure"
2119 #include "confdefs.h"
2120 /* Override any gcc2 internal prototype to avoid an error.  */
2121 /* We use char because int might match the return type of a gcc2
2122     builtin and then its argument prototype would still apply.  */
2123 char dnet_ntoa();
2124
2125 int main() {
2126 dnet_ntoa()
2127 ; return 0; }
2128 EOF
2129 if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2130   rm -rf conftest*
2131   eval "ac_cv_lib_$ac_lib_var=yes"
2132 else
2133   echo "configure: failed program was:" >&5
2134   cat conftest.$ac_ext >&5
2135   rm -rf conftest*
2136   eval "ac_cv_lib_$ac_lib_var=no"
2137 fi
2138 rm -f conftest*
2139 LIBS="$ac_save_LIBS"
2140
2141 fi
2142 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2143   echo "$ac_t""yes" 1>&6
2144   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2145 else
2146   echo "$ac_t""no" 1>&6
2147 fi
2148
2149     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2150       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2151 echo "configure:2152: checking for dnet_ntoa in -ldnet_stub" >&5
2152 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2153 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2154   echo $ac_n "(cached) $ac_c" 1>&6
2155 else
2156   ac_save_LIBS="$LIBS"
2157 LIBS="-ldnet_stub  $LIBS"
2158 cat > conftest.$ac_ext <<EOF
2159 #line 2160 "configure"
2160 #include "confdefs.h"
2161 /* Override any gcc2 internal prototype to avoid an error.  */
2162 /* We use char because int might match the return type of a gcc2
2163     builtin and then its argument prototype would still apply.  */
2164 char dnet_ntoa();
2165
2166 int main() {
2167 dnet_ntoa()
2168 ; return 0; }
2169 EOF
2170 if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2171   rm -rf conftest*
2172   eval "ac_cv_lib_$ac_lib_var=yes"
2173 else
2174   echo "configure: failed program was:" >&5
2175   cat conftest.$ac_ext >&5
2176   rm -rf conftest*
2177   eval "ac_cv_lib_$ac_lib_var=no"
2178 fi
2179 rm -f conftest*
2180 LIBS="$ac_save_LIBS"
2181
2182 fi
2183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2184   echo "$ac_t""yes" 1>&6
2185   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2186 else
2187   echo "$ac_t""no" 1>&6
2188 fi
2189
2190     fi
2191
2192     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2193     # to get the SysV transport functions.
2194     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2195     # needs -lnsl.
2196     # The nsl library prevents programs from opening the X display
2197     # on Irix 5.2, according to dickey@clark.net.
2198     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2199 echo "configure:2200: checking for gethostbyname" >&5
2200 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2201   echo $ac_n "(cached) $ac_c" 1>&6
2202 else
2203   cat > conftest.$ac_ext <<EOF
2204 #line 2205 "configure"
2205 #include "confdefs.h"
2206 /* System header to define __stub macros and hopefully few prototypes,
2207     which can conflict with char gethostbyname(); below.  */
2208 #include <assert.h>
2209 /* Override any gcc2 internal prototype to avoid an error.  */
2210 /* We use char because int might match the return type of a gcc2
2211     builtin and then its argument prototype would still apply.  */
2212 char gethostbyname();
2213
2214 int main() {
2215
2216 /* The GNU C library defines this for functions which it implements
2217     to always fail with ENOSYS.  Some functions are actually named
2218     something starting with __ and the normal name is an alias.  */
2219 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2220 choke me
2221 #else
2222 gethostbyname();
2223 #endif
2224
2225 ; return 0; }
2226 EOF
2227 if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2228   rm -rf conftest*
2229   eval "ac_cv_func_gethostbyname=yes"
2230 else
2231   echo "configure: failed program was:" >&5
2232   cat conftest.$ac_ext >&5
2233   rm -rf conftest*
2234   eval "ac_cv_func_gethostbyname=no"
2235 fi
2236 rm -f conftest*
2237 fi
2238
2239 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2240   echo "$ac_t""yes" 1>&6
2241   :
2242 else
2243   echo "$ac_t""no" 1>&6
2244 fi
2245
2246     if test $ac_cv_func_gethostbyname = no; then
2247       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2248 echo "configure:2249: checking for gethostbyname in -lnsl" >&5
2249 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2250 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2251   echo $ac_n "(cached) $ac_c" 1>&6
2252 else
2253   ac_save_LIBS="$LIBS"
2254 LIBS="-lnsl  $LIBS"
2255 cat > conftest.$ac_ext <<EOF
2256 #line 2257 "configure"
2257 #include "confdefs.h"
2258 /* Override any gcc2 internal prototype to avoid an error.  */
2259 /* We use char because int might match the return type of a gcc2
2260     builtin and then its argument prototype would still apply.  */
2261 char gethostbyname();
2262
2263 int main() {
2264 gethostbyname()
2265 ; return 0; }
2266 EOF
2267 if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2268   rm -rf conftest*
2269   eval "ac_cv_lib_$ac_lib_var=yes"
2270 else
2271   echo "configure: failed program was:" >&5
2272   cat conftest.$ac_ext >&5
2273   rm -rf conftest*
2274   eval "ac_cv_lib_$ac_lib_var=no"
2275 fi
2276 rm -f conftest*
2277 LIBS="$ac_save_LIBS"
2278
2279 fi
2280 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2281   echo "$ac_t""yes" 1>&6
2282   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2283 else
2284   echo "$ac_t""no" 1>&6
2285 fi
2286
2287     fi
2288
2289     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2290     # socket/setsockopt and other routines are undefined under SCO ODT
2291     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2292     # on later versions), says simon@lia.di.epfl.ch: it contains
2293     # gethostby* variants that don't use the nameserver (or something).
2294     # -lsocket must be given before -lnsl if both are needed.
2295     # We assume that if connect needs -lnsl, so does gethostbyname.
2296     echo $ac_n "checking for connect""... $ac_c" 1>&6
2297 echo "configure:2298: checking for connect" >&5
2298 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2299   echo $ac_n "(cached) $ac_c" 1>&6
2300 else
2301   cat > conftest.$ac_ext <<EOF
2302 #line 2303 "configure"
2303 #include "confdefs.h"
2304 /* System header to define __stub macros and hopefully few prototypes,
2305     which can conflict with char connect(); below.  */
2306 #include <assert.h>
2307 /* Override any gcc2 internal prototype to avoid an error.  */
2308 /* We use char because int might match the return type of a gcc2
2309     builtin and then its argument prototype would still apply.  */
2310 char connect();
2311
2312 int main() {
2313
2314 /* The GNU C library defines this for functions which it implements
2315     to always fail with ENOSYS.  Some functions are actually named
2316     something starting with __ and the normal name is an alias.  */
2317 #if defined (__stub_connect) || defined (__stub___connect)
2318 choke me
2319 #else
2320 connect();
2321 #endif
2322
2323 ; return 0; }
2324 EOF
2325 if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2326   rm -rf conftest*
2327   eval "ac_cv_func_connect=yes"
2328 else
2329   echo "configure: failed program was:" >&5
2330   cat conftest.$ac_ext >&5
2331   rm -rf conftest*
2332   eval "ac_cv_func_connect=no"
2333 fi
2334 rm -f conftest*
2335 fi
2336
2337 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2338   echo "$ac_t""yes" 1>&6
2339   :
2340 else
2341   echo "$ac_t""no" 1>&6
2342 fi
2343
2344     if test $ac_cv_func_connect = no; then
2345       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2346 echo "configure:2347: checking for connect in -lsocket" >&5
2347 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2348 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2349   echo $ac_n "(cached) $ac_c" 1>&6
2350 else
2351   ac_save_LIBS="$LIBS"
2352 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2353 cat > conftest.$ac_ext <<EOF
2354 #line 2355 "configure"
2355 #include "confdefs.h"
2356 /* Override any gcc2 internal prototype to avoid an error.  */
2357 /* We use char because int might match the return type of a gcc2
2358     builtin and then its argument prototype would still apply.  */
2359 char connect();
2360
2361 int main() {
2362 connect()
2363 ; return 0; }
2364 EOF
2365 if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2366   rm -rf conftest*
2367   eval "ac_cv_lib_$ac_lib_var=yes"
2368 else
2369   echo "configure: failed program was:" >&5
2370   cat conftest.$ac_ext >&5
2371   rm -rf conftest*
2372   eval "ac_cv_lib_$ac_lib_var=no"
2373 fi
2374 rm -f conftest*
2375 LIBS="$ac_save_LIBS"
2376
2377 fi
2378 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2379   echo "$ac_t""yes" 1>&6
2380   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
2381 else
2382   echo "$ac_t""no" 1>&6
2383 fi
2384
2385     fi
2386
2387     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
2388     echo $ac_n "checking for remove""... $ac_c" 1>&6
2389 echo "configure:2390: checking for remove" >&5
2390 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
2391   echo $ac_n "(cached) $ac_c" 1>&6
2392 else
2393   cat > conftest.$ac_ext <<EOF
2394 #line 2395 "configure"
2395 #include "confdefs.h"
2396 /* System header to define __stub macros and hopefully few prototypes,
2397     which can conflict with char remove(); below.  */
2398 #include <assert.h>
2399 /* Override any gcc2 internal prototype to avoid an error.  */
2400 /* We use char because int might match the return type of a gcc2
2401     builtin and then its argument prototype would still apply.  */
2402 char remove();
2403
2404 int main() {
2405
2406 /* The GNU C library defines this for functions which it implements
2407     to always fail with ENOSYS.  Some functions are actually named
2408     something starting with __ and the normal name is an alias.  */
2409 #if defined (__stub_remove) || defined (__stub___remove)
2410 choke me
2411 #else
2412 remove();
2413 #endif
2414
2415 ; return 0; }
2416 EOF
2417 if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2418   rm -rf conftest*
2419   eval "ac_cv_func_remove=yes"
2420 else
2421   echo "configure: failed program was:" >&5
2422   cat conftest.$ac_ext >&5
2423   rm -rf conftest*
2424   eval "ac_cv_func_remove=no"
2425 fi
2426 rm -f conftest*
2427 fi
2428
2429 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
2430   echo "$ac_t""yes" 1>&6
2431   :
2432 else
2433   echo "$ac_t""no" 1>&6
2434 fi
2435
2436     if test $ac_cv_func_remove = no; then
2437       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
2438 echo "configure:2439: checking for remove in -lposix" >&5
2439 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
2440 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2441   echo $ac_n "(cached) $ac_c" 1>&6
2442 else
2443   ac_save_LIBS="$LIBS"
2444 LIBS="-lposix  $LIBS"
2445 cat > conftest.$ac_ext <<EOF
2446 #line 2447 "configure"
2447 #include "confdefs.h"
2448 /* Override any gcc2 internal prototype to avoid an error.  */
2449 /* We use char because int might match the return type of a gcc2
2450     builtin and then its argument prototype would still apply.  */
2451 char remove();
2452
2453 int main() {
2454 remove()
2455 ; return 0; }
2456 EOF
2457 if { (eval echo configure:2458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2458   rm -rf conftest*
2459   eval "ac_cv_lib_$ac_lib_var=yes"
2460 else
2461   echo "configure: failed program was:" >&5
2462   cat conftest.$ac_ext >&5
2463   rm -rf conftest*
2464   eval "ac_cv_lib_$ac_lib_var=no"
2465 fi
2466 rm -f conftest*
2467 LIBS="$ac_save_LIBS"
2468
2469 fi
2470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2471   echo "$ac_t""yes" 1>&6
2472   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
2473 else
2474   echo "$ac_t""no" 1>&6
2475 fi
2476
2477     fi
2478
2479     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2480     echo $ac_n "checking for shmat""... $ac_c" 1>&6
2481 echo "configure:2482: checking for shmat" >&5
2482 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
2483   echo $ac_n "(cached) $ac_c" 1>&6
2484 else
2485   cat > conftest.$ac_ext <<EOF
2486 #line 2487 "configure"
2487 #include "confdefs.h"
2488 /* System header to define __stub macros and hopefully few prototypes,
2489     which can conflict with char shmat(); below.  */
2490 #include <assert.h>
2491 /* Override any gcc2 internal prototype to avoid an error.  */
2492 /* We use char because int might match the return type of a gcc2
2493     builtin and then its argument prototype would still apply.  */
2494 char shmat();
2495
2496 int main() {
2497
2498 /* The GNU C library defines this for functions which it implements
2499     to always fail with ENOSYS.  Some functions are actually named
2500     something starting with __ and the normal name is an alias.  */
2501 #if defined (__stub_shmat) || defined (__stub___shmat)
2502 choke me
2503 #else
2504 shmat();
2505 #endif
2506
2507 ; return 0; }
2508 EOF
2509 if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2510   rm -rf conftest*
2511   eval "ac_cv_func_shmat=yes"
2512 else
2513   echo "configure: failed program was:" >&5
2514   cat conftest.$ac_ext >&5
2515   rm -rf conftest*
2516   eval "ac_cv_func_shmat=no"
2517 fi
2518 rm -f conftest*
2519 fi
2520
2521 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
2522   echo "$ac_t""yes" 1>&6
2523   :
2524 else
2525   echo "$ac_t""no" 1>&6
2526 fi
2527
2528     if test $ac_cv_func_shmat = no; then
2529       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
2530 echo "configure:2531: checking for shmat in -lipc" >&5
2531 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
2532 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2533   echo $ac_n "(cached) $ac_c" 1>&6
2534 else
2535   ac_save_LIBS="$LIBS"
2536 LIBS="-lipc  $LIBS"
2537 cat > conftest.$ac_ext <<EOF
2538 #line 2539 "configure"
2539 #include "confdefs.h"
2540 /* Override any gcc2 internal prototype to avoid an error.  */
2541 /* We use char because int might match the return type of a gcc2
2542     builtin and then its argument prototype would still apply.  */
2543 char shmat();
2544
2545 int main() {
2546 shmat()
2547 ; return 0; }
2548 EOF
2549 if { (eval echo configure:2550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2550   rm -rf conftest*
2551   eval "ac_cv_lib_$ac_lib_var=yes"
2552 else
2553   echo "configure: failed program was:" >&5
2554   cat conftest.$ac_ext >&5
2555   rm -rf conftest*
2556   eval "ac_cv_lib_$ac_lib_var=no"
2557 fi
2558 rm -f conftest*
2559 LIBS="$ac_save_LIBS"
2560
2561 fi
2562 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2563   echo "$ac_t""yes" 1>&6
2564   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
2565 else
2566   echo "$ac_t""no" 1>&6
2567 fi
2568
2569     fi
2570   fi
2571
2572   # Check for libraries that X11R6 Xt/Xaw programs need.
2573   ac_save_LDFLAGS="$LDFLAGS"
2574   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
2575   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
2576   # check for ICE first), but we must link in the order -lSM -lICE or
2577   # we get undefined symbols.  So assume we have SM if we have ICE.
2578   # These have to be linked with before -lX11, unlike the other
2579   # libraries we check for below, so use a different variable.
2580   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
2581   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
2582 echo "configure:2583: checking for IceConnectionNumber in -lICE" >&5
2583 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
2584 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2585   echo $ac_n "(cached) $ac_c" 1>&6
2586 else
2587   ac_save_LIBS="$LIBS"
2588 LIBS="-lICE  $LIBS"
2589 cat > conftest.$ac_ext <<EOF
2590 #line 2591 "configure"
2591 #include "confdefs.h"
2592 /* Override any gcc2 internal prototype to avoid an error.  */
2593 /* We use char because int might match the return type of a gcc2
2594     builtin and then its argument prototype would still apply.  */
2595 char IceConnectionNumber();
2596
2597 int main() {
2598 IceConnectionNumber()
2599 ; return 0; }
2600 EOF
2601 if { (eval echo configure:2602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2602   rm -rf conftest*
2603   eval "ac_cv_lib_$ac_lib_var=yes"
2604 else
2605   echo "configure: failed program was:" >&5
2606   cat conftest.$ac_ext >&5
2607   rm -rf conftest*
2608   eval "ac_cv_lib_$ac_lib_var=no"
2609 fi
2610 rm -f conftest*
2611 LIBS="$ac_save_LIBS"
2612
2613 fi
2614 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2615   echo "$ac_t""yes" 1>&6
2616   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
2617 else
2618   echo "$ac_t""no" 1>&6
2619 fi
2620
2621   LDFLAGS="$ac_save_LDFLAGS"
2622
2623 fi
2624
2625
2626 # Try and find the app-defaults directory.
2627 # It sucks that autoconf doesn't do this already...
2628 #
2629
2630
2631
2632
2633
2634
2635
2636
2637     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
2638 echo "configure:2639: checking for X app-defaults directory" >&5
2639 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
2640   echo $ac_n "(cached) $ac_c" 1>&6
2641 else
2642   
2643   rm -fr conftestdir
2644   if mkdir conftestdir; then
2645     cd conftestdir
2646     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2647     cat > Imakefile <<'EOF'
2648 acfindx:
2649         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
2650 EOF
2651     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2652       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
2653       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2654     fi
2655     cd ..
2656     rm -fr conftestdir
2657   fi
2658         # Look for the directory under a standard set of common directories.
2659   # Check X11 before X11Rn because it's often a symlink to the current release.
2660   for ac_dir in                                 \
2661     /usr/X11/lib/app-defaults                   \
2662     /usr/X11R6/lib/app-defaults                 \
2663     /usr/X11R6/lib/X11/app-defaults             \
2664     /usr/X11R5/lib/app-defaults                 \
2665     /usr/X11R5/lib/X11/app-defaults             \
2666     /usr/X11R4/lib/app-defaults                 \
2667     /usr/X11R4/lib/X11/app-defaults             \
2668                                                 \
2669     /usr/lib/X11/app-defaults                   \
2670     /usr/lib/X11R6/app-defaults                 \
2671     /usr/lib/X11R5/app-defaults                 \
2672     /usr/lib/X11R4/app-defaults                 \
2673                                                 \
2674     /usr/local/X11/lib/app-defaults             \
2675     /usr/local/X11R6/lib/app-defaults           \
2676     /usr/local/X11R5/lib/app-defaults           \
2677     /usr/local/X11R4/lib/app-defaults           \
2678                                                 \
2679     /usr/local/lib/X11/app-defaults             \
2680     /usr/local/lib/X11R6/app-defaults           \
2681     /usr/local/lib/X11R6/X11/app-defaults       \
2682     /usr/local/lib/X11R5/app-defaults           \
2683     /usr/local/lib/X11R5/X11/app-defaults       \
2684     /usr/local/lib/X11R4/app-defaults           \
2685     /usr/local/lib/X11R4/X11/app-defaults       \
2686                                                 \
2687     /usr/X386/lib/X11/app-defaults              \
2688     /usr/x386/lib/X11/app-defaults              \
2689     /usr/XFree86/lib/X11/app-defaults           \
2690                                                 \
2691     /usr/lib/X11/app-defaults                   \
2692     /usr/local/lib/X11/app-defaults             \
2693     /usr/unsupported/lib/X11/app-defaults       \
2694     /usr/athena/lib/X11/app-defaults            \
2695     /usr/local/x11r5/lib/X11/app-defaults       \
2696     /usr/lpp/Xamples/lib/X11/app-defaults       \
2697     /lib/usr/lib/X11/app-defaults               \
2698                                                 \
2699     /usr/openwin/lib/app-defaults               \
2700     /usr/openwin/lib/X11/app-defaults           \
2701     /usr/openwin/share/lib/app-defaults         \
2702     /usr/openwin/share/lib/X11/app-defaults     \
2703                                                 \
2704     /X11R6/lib/app-defaults                     \
2705     /X11R5/lib/app-defaults                     \
2706     /X11R4/lib/app-defaults                     \
2707     ; \
2708   do
2709     if test -d "$ac_dir"; then
2710       ac_x_app_defaults=$ac_dir
2711       break
2712     fi
2713   done
2714
2715       if test x"$ac_x_app_defaults" = x; then
2716         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
2717       else
2718         # Record where we found app-defaults for the cache.
2719         ac_cv_x_app_defaults="$ac_x_app_defaults"
2720       fi
2721 fi
2722
2723 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
2724     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
2725
2726 APPDEFAULTS=$ac_x_app_defaults
2727
2728
2729 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
2730 #
2731
2732
2733 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
2734 #
2735
2736
2737 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
2738 #
2739
2740
2741
2742 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
2743 # Use this sparingly; it probably doesn't work very well on X programs.
2744 #
2745
2746
2747 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
2748 # (But not the -L directories!)
2749 #
2750
2751
2752
2753
2754
2755
2756 # check for the HP XHPDisableReset server extension headers.
2757 #
2758
2759   ac_save_CPPFLAGS="$CPPFLAGS"
2760   if test \! -z "$includedir" ; then 
2761     CPPFLAGS="$CPPFLAGS -I$includedir"
2762   fi
2763   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2764   cat > conftest.$ac_ext <<EOF
2765 #line 2766 "configure"
2766 #include "confdefs.h"
2767 #include <X11/XHPlib.h>
2768 EOF
2769 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2770   egrep "XHPDisableReset" >/dev/null 2>&1; then
2771   rm -rf conftest*
2772   cat >> confdefs.h <<\EOF
2773 #define HAVE_XHPDISABLERESET 1
2774 EOF
2775
2776                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
2777 fi
2778 rm -f conftest*
2779
2780   CPPFLAGS="$ac_save_CPPFLAGS"
2781
2782
2783 # Check for the availability of the XPointer typedef, and define it otherwise.
2784 #
2785 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
2786 echo "configure:2787: checking for XPointer" >&5
2787 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
2788   echo $ac_n "(cached) $ac_c" 1>&6
2789 else
2790   
2791   ac_save_CPPFLAGS="$CPPFLAGS"
2792   if test \! -z "$includedir" ; then 
2793     CPPFLAGS="$CPPFLAGS -I$includedir"
2794   fi
2795   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2796   cat > conftest.$ac_ext <<EOF
2797 #line 2798 "configure"
2798 #include "confdefs.h"
2799 #include <X11/Xlib.h>
2800 int main() {
2801 XPointer foo = (XPointer) 0;
2802 ; return 0; }
2803 EOF
2804 if { (eval echo configure:2805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2805   rm -rf conftest*
2806   ac_cv_xpointer=yes
2807 else
2808   echo "configure: failed program was:" >&5
2809   cat conftest.$ac_ext >&5
2810   rm -rf conftest*
2811   ac_cv_xpointer=no
2812 fi
2813 rm -f conftest*
2814   CPPFLAGS="$ac_save_CPPFLAGS"
2815 fi
2816
2817 echo "$ac_t""$ac_cv_xpointer" 1>&6
2818 if test $ac_cv_xpointer != yes; then
2819   cat >> confdefs.h <<\EOF
2820 #define XPointer char*
2821 EOF
2822
2823 fi
2824
2825
2826 case "$host" in
2827   *-hpux*)
2828     # Thanks for not making xmkmf find this by default, you losers.
2829     if test -d /usr/lib/Motif1.2 ; then
2830       X_CFLAGS="-I/usr/include/Motif1.2 $X_CFLAGS"
2831       X_LIBS="-L/usr/lib/Motif1.2 $X_LIBS"
2832     elif test -d /usr/lib/Motif1.1 ; then
2833       X_CFLAGS="-I/usr/include/Motif1.1 $X_CFLAGS"
2834       X_LIBS="-L/usr/lib/Motif1.1 $X_LIBS"
2835     fi
2836
2837     # This too.  You losers.
2838     if test -d /usr/contrib/X11R6/include ; then
2839       X_CFLAGS="-I/usr/contrib/X11R6/include $X_CFLAGS"
2840       X_LIBS="-L/usr/contrib/X11R6/lib $X_LIBS"
2841     elif test -d /usr/contrib/X11R5/include ; then
2842       X_CFLAGS="-I/usr/contrib/X11R5/include $X_CFLAGS"
2843       X_LIBS="-L/usr/contrib/X11R5/lib $X_LIBS"
2844     fi
2845
2846   ;;
2847   *-solaris*)
2848     # Same to you, pinheads.  (Is this really the standard location now?
2849     # What happened to the joke that this kind of thing went in /opt?)
2850     if test -f /usr/dt/include/Xm/Xm.h ; then
2851       X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
2852       X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
2853
2854       # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
2855       echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
2856 echo "configure:2857: checking for regcmp in -lgen" >&5
2857 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
2858 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2859   echo $ac_n "(cached) $ac_c" 1>&6
2860 else
2861   ac_save_LIBS="$LIBS"
2862 LIBS="-lgen  $LIBS"
2863 cat > conftest.$ac_ext <<EOF
2864 #line 2865 "configure"
2865 #include "confdefs.h"
2866 /* Override any gcc2 internal prototype to avoid an error.  */
2867 /* We use char because int might match the return type of a gcc2
2868     builtin and then its argument prototype would still apply.  */
2869 char regcmp();
2870
2871 int main() {
2872 regcmp()
2873 ; return 0; }
2874 EOF
2875 if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2876   rm -rf conftest*
2877   eval "ac_cv_lib_$ac_lib_var=yes"
2878 else
2879   echo "configure: failed program was:" >&5
2880   cat conftest.$ac_ext >&5
2881   rm -rf conftest*
2882   eval "ac_cv_lib_$ac_lib_var=no"
2883 fi
2884 rm -f conftest*
2885 LIBS="$ac_save_LIBS"
2886
2887 fi
2888 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2889   echo "$ac_t""yes" 1>&6
2890   X_LIBS="$X_LIBS -lgen"
2891 else
2892   echo "$ac_t""no" 1>&6
2893 fi
2894
2895     fi
2896   ;;
2897 esac
2898
2899
2900
2901 # Check for Xmu (some fucked up vendors don't ship it...)
2902 #
2903 have_xmu=no
2904
2905   ac_save_CPPFLAGS="$CPPFLAGS"
2906   if test \! -z "$includedir" ; then 
2907     CPPFLAGS="$CPPFLAGS -I$includedir"
2908   fi
2909   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2910   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
2911 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
2912 echo "configure:2913: checking for X11/Xmu/Error.h" >&5
2913 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2914   echo $ac_n "(cached) $ac_c" 1>&6
2915 else
2916   cat > conftest.$ac_ext <<EOF
2917 #line 2918 "configure"
2918 #include "confdefs.h"
2919 #include <X11/Xmu/Error.h>
2920 EOF
2921 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2922 { (eval echo configure:2923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2923 ac_err=`grep -v '^ *+' conftest.out`
2924 if test -z "$ac_err"; then
2925   rm -rf conftest*
2926   eval "ac_cv_header_$ac_safe=yes"
2927 else
2928   echo "$ac_err" >&5
2929   echo "configure: failed program was:" >&5
2930   cat conftest.$ac_ext >&5
2931   rm -rf conftest*
2932   eval "ac_cv_header_$ac_safe=no"
2933 fi
2934 rm -f conftest*
2935 fi
2936 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2937   echo "$ac_t""yes" 1>&6
2938   have_xmu=yes
2939 else
2940   echo "$ac_t""no" 1>&6
2941 fi
2942
2943   CPPFLAGS="$ac_save_CPPFLAGS"
2944 if test $have_xmu = no ; then
2945   XMU_SRCS='$(UTILS_SRC)/xmu.c'
2946   XMU_OBJS='$(UTILS_BIN)/xmu.o'
2947 else
2948   XMU_SRCS=''
2949   XMU_OBJS=''
2950   SAVER_LIBS="-lXmu $SAVER_LIBS"
2951   HACK_LIBS="-lXmu $HACK_LIBS"
2952   cat >> confdefs.h <<\EOF
2953 #define HAVE_XMU 1
2954 EOF
2955
2956 fi
2957
2958
2959 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
2960 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
2961 #
2962 if test $have_xmu = yes ; then
2963   case "$host" in
2964     *-sunos4*)
2965     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
2966 echo "configure:2967: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
2967 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
2968   echo $ac_n "(cached) $ac_c" 1>&6
2969 else
2970   ac_save_LDFLAGS="$LDFLAGS"
2971                     if test \! -z "$x_libraries" ; then
2972                       LDFLAGS="$LDFLAGS -L$x_libraries"
2973                     fi
2974                     # Note: this trick never works!  (Generally.)
2975                     # We're only getting away with using AC_TRY_LINK
2976                     # with X libraries because we know it's SunOS.
2977                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
2978                     cat > conftest.$ac_ext <<EOF
2979 #line 2980 "configure"
2980 #include "confdefs.h"
2981
2982 int main() {
2983
2984 ; return 0; }
2985 EOF
2986 if { (eval echo configure:2987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2987   rm -rf conftest*
2988   ac_cv_sunos_xmu_bug=no
2989 else
2990   echo "configure: failed program was:" >&5
2991   cat conftest.$ac_ext >&5
2992   rm -rf conftest*
2993   ac_cv_sunos_xmu_bug=yes
2994 fi
2995 rm -f conftest*
2996                     LDFLAGS="$ac_save_LDFLAGS"
2997 fi
2998
2999 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3000     if test $ac_cv_sunos_xmu_bug = yes ; then
3001       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3002 echo "configure:3003: checking whether the compiler understands -static" >&5
3003 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3004   echo $ac_n "(cached) $ac_c" 1>&6
3005 else
3006   ac_save_LDFLAGS="$LDFLAGS"
3007                       LDFLAGS="$LDFLAGS -static"
3008                       cat > conftest.$ac_ext <<EOF
3009 #line 3010 "configure"
3010 #include "confdefs.h"
3011
3012 int main() {
3013
3014 ; return 0; }
3015 EOF
3016 if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3017   rm -rf conftest*
3018   ac_cv_ld_static=yes
3019 else
3020   echo "configure: failed program was:" >&5
3021   cat conftest.$ac_ext >&5
3022   rm -rf conftest*
3023   ac_cv_ld_static=no
3024 fi
3025 rm -f conftest*
3026                     LDFLAGS="$ac_save_LDFLAGS"
3027 fi
3028
3029 echo "$ac_t""$ac_cv_ld_static" 1>&6
3030       if test $ac_cv_ld_static = yes ; then
3031         LDFLAGS="$LDFLAGS -static"
3032       else
3033         LDFLAGS="$LDFLAGS -Bstatic"
3034       fi
3035     fi
3036     ;;
3037   esac
3038 fi
3039
3040
3041 # Check for the SGI SCREEN_SAVER server extension header.
3042 #
3043 have_sgi=no
3044 with_sgi_req=unspecified
3045 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3046 if test "${with_sgi_ext+set}" = set; then
3047   withval="$with_sgi_ext"
3048   with_sgi="$withval"; with_sgi_req="$withval"
3049 else
3050   with_sgi=yes
3051 fi
3052
3053 if test $with_sgi = yes; then
3054   
3055   ac_save_CPPFLAGS="$CPPFLAGS"
3056   if test \! -z "$includedir" ; then 
3057     CPPFLAGS="$CPPFLAGS -I$includedir"
3058   fi
3059   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3060   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3061 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3062 echo "configure:3063: checking for X11/extensions/XScreenSaver.h" >&5
3063 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3064   echo $ac_n "(cached) $ac_c" 1>&6
3065 else
3066   cat > conftest.$ac_ext <<EOF
3067 #line 3068 "configure"
3068 #include "confdefs.h"
3069 #include <X11/extensions/XScreenSaver.h>
3070 EOF
3071 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3072 { (eval echo configure:3073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3073 ac_err=`grep -v '^ *+' conftest.out`
3074 if test -z "$ac_err"; then
3075   rm -rf conftest*
3076   eval "ac_cv_header_$ac_safe=yes"
3077 else
3078   echo "$ac_err" >&5
3079   echo "configure: failed program was:" >&5
3080   cat conftest.$ac_ext >&5
3081   rm -rf conftest*
3082   eval "ac_cv_header_$ac_safe=no"
3083 fi
3084 rm -f conftest*
3085 fi
3086 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3087   echo "$ac_t""yes" 1>&6
3088   have_sgi=yes
3089                      cat >> confdefs.h <<\EOF
3090 #define HAVE_SGI_SAVER_EXTENSION 1
3091 EOF
3092
3093 else
3094   echo "$ac_t""no" 1>&6
3095 fi
3096
3097   CPPFLAGS="$ac_save_CPPFLAGS"
3098
3099 elif test $with_sgi != no; then
3100   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3101   exit 1
3102 fi
3103
3104 # Check for the MIT-SCREEN-SAVER server extension header,
3105 # unless the SGI extension has already been found.
3106 #
3107 have_mit=no
3108 with_mit_req=unspecified
3109 # Check whether --with-mit-ext or --without-mit-ext was given.
3110 if test "${with_mit_ext+set}" = set; then
3111   withval="$with_mit_ext"
3112   with_mit="$withval"; with_mit_req="$withval"
3113 else
3114   with_mit=yes
3115 fi
3116
3117 if test $have_sgi != yes; then
3118   if test $with_mit = yes; then
3119     
3120   ac_save_CPPFLAGS="$CPPFLAGS"
3121   if test \! -z "$includedir" ; then 
3122     CPPFLAGS="$CPPFLAGS -I$includedir"
3123   fi
3124   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3125   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3126 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3127 echo "configure:3128: checking for X11/extensions/scrnsaver.h" >&5
3128 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3129   echo $ac_n "(cached) $ac_c" 1>&6
3130 else
3131   cat > conftest.$ac_ext <<EOF
3132 #line 3133 "configure"
3133 #include "confdefs.h"
3134 #include <X11/extensions/scrnsaver.h>
3135 EOF
3136 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3137 { (eval echo configure:3138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3138 ac_err=`grep -v '^ *+' conftest.out`
3139 if test -z "$ac_err"; then
3140   rm -rf conftest*
3141   eval "ac_cv_header_$ac_safe=yes"
3142 else
3143   echo "$ac_err" >&5
3144   echo "configure: failed program was:" >&5
3145   cat conftest.$ac_ext >&5
3146   rm -rf conftest*
3147   eval "ac_cv_header_$ac_safe=no"
3148 fi
3149 rm -f conftest*
3150 fi
3151 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3152   echo "$ac_t""yes" 1>&6
3153   have_mit=yes
3154 else
3155   echo "$ac_t""no" 1>&6
3156 fi
3157
3158   CPPFLAGS="$ac_save_CPPFLAGS"
3159
3160     # Now check to see if it's really in the library; XF86Free-3.3 ships
3161     # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
3162     #
3163     if test $have_mit = yes; then
3164       
3165   ac_save_CPPFLAGS="$CPPFLAGS"
3166   ac_save_LDFLAGS="$LDFLAGS"
3167   if test \! -z "$includedir" ; then 
3168     CPPFLAGS="$CPPFLAGS -I$includedir"
3169   fi
3170   if test \! -z "$includedir" ; then 
3171     CPPFLAGS="$CPPFLAGS -I$includedir"
3172   fi
3173   if test \! -z "$libdir" ; then
3174     LDFLAGS="$LDFLAGS -L$libdir"
3175   fi
3176   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3177   if test \! -z "$x_libraries" ; then
3178     LDFLAGS="$LDFLAGS -L$x_libraries"
3179   fi
3180   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
3181 echo "configure:3182: checking for XScreenSaverRegister in -lXext" >&5
3182 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3183 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3184   echo $ac_n "(cached) $ac_c" 1>&6
3185 else
3186   ac_save_LIBS="$LIBS"
3187 LIBS="-lXext -lm $LIBS"
3188 cat > conftest.$ac_ext <<EOF
3189 #line 3190 "configure"
3190 #include "confdefs.h"
3191 /* Override any gcc2 internal prototype to avoid an error.  */
3192 /* We use char because int might match the return type of a gcc2
3193     builtin and then its argument prototype would still apply.  */
3194 char XScreenSaverRegister();
3195
3196 int main() {
3197 XScreenSaverRegister()
3198 ; return 0; }
3199 EOF
3200 if { (eval echo configure:3201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3201   rm -rf conftest*
3202   eval "ac_cv_lib_$ac_lib_var=yes"
3203 else
3204   echo "configure: failed program was:" >&5
3205   cat conftest.$ac_ext >&5
3206   rm -rf conftest*
3207   eval "ac_cv_lib_$ac_lib_var=no"
3208 fi
3209 rm -f conftest*
3210 LIBS="$ac_save_LIBS"
3211
3212 fi
3213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3214   echo "$ac_t""yes" 1>&6
3215     ac_tr_lib=HAVE_LIB`echo Xext | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3216     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3217   cat >> confdefs.h <<EOF
3218 #define $ac_tr_lib 1
3219 EOF
3220
3221   LIBS="-lXext $LIBS"
3222
3223 else
3224   echo "$ac_t""no" 1>&6
3225 have_mit=no
3226 fi
3227
3228   CPPFLAGS="$ac_save_CPPFLAGS"
3229   LDFLAGS="$ac_save_LDFLAGS"
3230
3231       if test $have_mit = no; then
3232         # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
3233         # of in Xext.  Thank you master, may I have another.
3234         
3235   ac_save_CPPFLAGS="$CPPFLAGS"
3236   ac_save_LDFLAGS="$LDFLAGS"
3237   if test \! -z "$includedir" ; then 
3238     CPPFLAGS="$CPPFLAGS -I$includedir"
3239   fi
3240   if test \! -z "$includedir" ; then 
3241     CPPFLAGS="$CPPFLAGS -I$includedir"
3242   fi
3243   if test \! -z "$libdir" ; then
3244     LDFLAGS="$LDFLAGS -L$libdir"
3245   fi
3246   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3247   if test \! -z "$x_libraries" ; then
3248     LDFLAGS="$LDFLAGS -L$x_libraries"
3249   fi
3250   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
3251 echo "configure:3252: checking for XScreenSaverRegister in -lXExExt" >&5
3252 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3253 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3254   echo $ac_n "(cached) $ac_c" 1>&6
3255 else
3256   ac_save_LIBS="$LIBS"
3257 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
3258 cat > conftest.$ac_ext <<EOF
3259 #line 3260 "configure"
3260 #include "confdefs.h"
3261 /* Override any gcc2 internal prototype to avoid an error.  */
3262 /* We use char because int might match the return type of a gcc2
3263     builtin and then its argument prototype would still apply.  */
3264 char XScreenSaverRegister();
3265
3266 int main() {
3267 XScreenSaverRegister()
3268 ; return 0; }
3269 EOF
3270 if { (eval echo configure:3271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3271   rm -rf conftest*
3272   eval "ac_cv_lib_$ac_lib_var=yes"
3273 else
3274   echo "configure: failed program was:" >&5
3275   cat conftest.$ac_ext >&5
3276   rm -rf conftest*
3277   eval "ac_cv_lib_$ac_lib_var=no"
3278 fi
3279 rm -f conftest*
3280 LIBS="$ac_save_LIBS"
3281
3282 fi
3283 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3284   echo "$ac_t""yes" 1>&6
3285   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
3286 else
3287   echo "$ac_t""no" 1>&6
3288 fi
3289
3290   CPPFLAGS="$ac_save_CPPFLAGS"
3291   LDFLAGS="$ac_save_LDFLAGS"
3292       fi
3293
3294       if test $have_mit = no; then
3295         # Double fuck!  Looks like some versions of XFree86 (whichever version
3296         # it is that comes with RedHat Linux 2.0 -- I can't find a version 
3297         # number) put this garbage in Xss instead of Xext.  Thank you master,
3298         #  may I have another.
3299         
3300   ac_save_CPPFLAGS="$CPPFLAGS"
3301   ac_save_LDFLAGS="$LDFLAGS"
3302   if test \! -z "$includedir" ; then 
3303     CPPFLAGS="$CPPFLAGS -I$includedir"
3304   fi
3305   if test \! -z "$includedir" ; then 
3306     CPPFLAGS="$CPPFLAGS -I$includedir"
3307   fi
3308   if test \! -z "$libdir" ; then
3309     LDFLAGS="$LDFLAGS -L$libdir"
3310   fi
3311   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3312   if test \! -z "$x_libraries" ; then
3313     LDFLAGS="$LDFLAGS -L$x_libraries"
3314   fi
3315   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
3316 echo "configure:3317: checking for XScreenSaverRegister in -lXss" >&5
3317 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3318 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3319   echo $ac_n "(cached) $ac_c" 1>&6
3320 else
3321   ac_save_LIBS="$LIBS"
3322 LIBS="-lXss -lX11 -lXext -lm $LIBS"
3323 cat > conftest.$ac_ext <<EOF
3324 #line 3325 "configure"
3325 #include "confdefs.h"
3326 /* Override any gcc2 internal prototype to avoid an error.  */
3327 /* We use char because int might match the return type of a gcc2
3328     builtin and then its argument prototype would still apply.  */
3329 char XScreenSaverRegister();
3330
3331 int main() {
3332 XScreenSaverRegister()
3333 ; return 0; }
3334 EOF
3335 if { (eval echo configure:3336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3336   rm -rf conftest*
3337   eval "ac_cv_lib_$ac_lib_var=yes"
3338 else
3339   echo "configure: failed program was:" >&5
3340   cat conftest.$ac_ext >&5
3341   rm -rf conftest*
3342   eval "ac_cv_lib_$ac_lib_var=no"
3343 fi
3344 rm -f conftest*
3345 LIBS="$ac_save_LIBS"
3346
3347 fi
3348 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3349   echo "$ac_t""yes" 1>&6
3350   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
3351 else
3352   echo "$ac_t""no" 1>&6
3353 fi
3354
3355   CPPFLAGS="$ac_save_CPPFLAGS"
3356   LDFLAGS="$ac_save_LDFLAGS"
3357       fi
3358
3359     if test $have_mit = yes; then
3360       cat >> confdefs.h <<\EOF
3361 #define HAVE_MIT_SAVER_EXTENSION 1
3362 EOF
3363
3364     fi
3365
3366     fi
3367
3368   elif test $with_mit != no; then
3369     echo "error: must be yes or no: --with-mit-ext=$with_mit"
3370     exit 1
3371   fi
3372 fi
3373
3374
3375 # Check for the XIDLE server extension header.
3376 #
3377 have_xidle=no
3378 with_xidle_req=unspecified
3379 # Check whether --with-xidle-ext or --without-xidle-ext was given.
3380 if test "${with_xidle_ext+set}" = set; then
3381   withval="$with_xidle_ext"
3382   with_xidle="$withval"; with_xidle_req="$withval"
3383 else
3384   with_xidle=yes
3385 fi
3386
3387 if test $with_xidle = yes; then
3388   
3389   ac_save_CPPFLAGS="$CPPFLAGS"
3390   if test \! -z "$includedir" ; then 
3391     CPPFLAGS="$CPPFLAGS -I$includedir"
3392   fi
3393   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3394   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
3395 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
3396 echo "configure:3397: checking for X11/extensions/xidle.h" >&5
3397 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3398   echo $ac_n "(cached) $ac_c" 1>&6
3399 else
3400   cat > conftest.$ac_ext <<EOF
3401 #line 3402 "configure"
3402 #include "confdefs.h"
3403 #include <X11/extensions/xidle.h>
3404 EOF
3405 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3406 { (eval echo configure:3407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3407 ac_err=`grep -v '^ *+' conftest.out`
3408 if test -z "$ac_err"; then
3409   rm -rf conftest*
3410   eval "ac_cv_header_$ac_safe=yes"
3411 else
3412   echo "$ac_err" >&5
3413   echo "configure: failed program was:" >&5
3414   cat conftest.$ac_ext >&5
3415   rm -rf conftest*
3416   eval "ac_cv_header_$ac_safe=no"
3417 fi
3418 rm -f conftest*
3419 fi
3420 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3421   echo "$ac_t""yes" 1>&6
3422   have_xidle=yes
3423                      cat >> confdefs.h <<\EOF
3424 #define HAVE_XIDLE_EXTENSION 1
3425 EOF
3426
3427 else
3428   echo "$ac_t""no" 1>&6
3429 fi
3430
3431   CPPFLAGS="$ac_save_CPPFLAGS"
3432 elif test $with_xidle != no; then
3433   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
3434   exit 1
3435 fi
3436
3437
3438 # Check for the XSHM server extension header.
3439 #
3440 have_xshm=no
3441 with_xshm_req=unspecified
3442 # Check whether --with-xshm-ext or --without-xshm-ext was given.
3443 if test "${with_xshm_ext+set}" = set; then
3444   withval="$with_xshm_ext"
3445   with_xshm="$withval"; with_xshm_req="$withval"
3446 else
3447   with_xshm=yes
3448 fi
3449
3450 if test $with_xshm = yes; then
3451
3452   # first check for Xshm.h.
3453   
3454   ac_save_CPPFLAGS="$CPPFLAGS"
3455   if test \! -z "$includedir" ; then 
3456     CPPFLAGS="$CPPFLAGS -I$includedir"
3457   fi
3458   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3459   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
3460 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
3461 echo "configure:3462: checking for X11/extensions/XShm.h" >&5
3462 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3463   echo $ac_n "(cached) $ac_c" 1>&6
3464 else
3465   cat > conftest.$ac_ext <<EOF
3466 #line 3467 "configure"
3467 #include "confdefs.h"
3468 #include <X11/extensions/XShm.h>
3469 EOF
3470 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3471 { (eval echo configure:3472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3472 ac_err=`grep -v '^ *+' conftest.out`
3473 if test -z "$ac_err"; then
3474   rm -rf conftest*
3475   eval "ac_cv_header_$ac_safe=yes"
3476 else
3477   echo "$ac_err" >&5
3478   echo "configure: failed program was:" >&5
3479   cat conftest.$ac_ext >&5
3480   rm -rf conftest*
3481   eval "ac_cv_header_$ac_safe=no"
3482 fi
3483 rm -f conftest*
3484 fi
3485 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3486   echo "$ac_t""yes" 1>&6
3487   have_xshm=yes
3488 else
3489   echo "$ac_t""no" 1>&6
3490 fi
3491
3492   CPPFLAGS="$ac_save_CPPFLAGS"
3493
3494   # if that succeeded, then check for sys/ipc.h.
3495   if test $have_xshm = yes; then
3496     have_xshm=no
3497     
3498   ac_save_CPPFLAGS="$CPPFLAGS"
3499   if test \! -z "$includedir" ; then 
3500     CPPFLAGS="$CPPFLAGS -I$includedir"
3501   fi
3502   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3503   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
3504 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
3505 echo "configure:3506: checking for sys/ipc.h" >&5
3506 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3507   echo $ac_n "(cached) $ac_c" 1>&6
3508 else
3509   cat > conftest.$ac_ext <<EOF
3510 #line 3511 "configure"
3511 #include "confdefs.h"
3512 #include <sys/ipc.h>
3513 EOF
3514 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3515 { (eval echo configure:3516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3516 ac_err=`grep -v '^ *+' conftest.out`
3517 if test -z "$ac_err"; then
3518   rm -rf conftest*
3519   eval "ac_cv_header_$ac_safe=yes"
3520 else
3521   echo "$ac_err" >&5
3522   echo "configure: failed program was:" >&5
3523   cat conftest.$ac_ext >&5
3524   rm -rf conftest*
3525   eval "ac_cv_header_$ac_safe=no"
3526 fi
3527 rm -f conftest*
3528 fi
3529 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3530   echo "$ac_t""yes" 1>&6
3531   have_xshm=yes
3532 else
3533   echo "$ac_t""no" 1>&6
3534 fi
3535
3536   CPPFLAGS="$ac_save_CPPFLAGS"
3537   fi
3538
3539   # if that succeeded, then check for sys/shm.h.
3540   if test $have_xshm = yes; then
3541     have_xshm=no
3542     
3543   ac_save_CPPFLAGS="$CPPFLAGS"
3544   if test \! -z "$includedir" ; then 
3545     CPPFLAGS="$CPPFLAGS -I$includedir"
3546   fi
3547   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3548   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
3549 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
3550 echo "configure:3551: checking for sys/shm.h" >&5
3551 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3552   echo $ac_n "(cached) $ac_c" 1>&6
3553 else
3554   cat > conftest.$ac_ext <<EOF
3555 #line 3556 "configure"
3556 #include "confdefs.h"
3557 #include <sys/shm.h>
3558 EOF
3559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3560 { (eval echo configure:3561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3561 ac_err=`grep -v '^ *+' conftest.out`
3562 if test -z "$ac_err"; then
3563   rm -rf conftest*
3564   eval "ac_cv_header_$ac_safe=yes"
3565 else
3566   echo "$ac_err" >&5
3567   echo "configure: failed program was:" >&5
3568   cat conftest.$ac_ext >&5
3569   rm -rf conftest*
3570   eval "ac_cv_header_$ac_safe=no"
3571 fi
3572 rm -f conftest*
3573 fi
3574 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3575   echo "$ac_t""yes" 1>&6
3576   have_xshm=yes
3577 else
3578   echo "$ac_t""no" 1>&6
3579 fi
3580
3581   CPPFLAGS="$ac_save_CPPFLAGS"
3582   fi
3583
3584   # if that succeeded, then we've really got it.
3585   if test $have_xshm = yes; then
3586     cat >> confdefs.h <<\EOF
3587 #define HAVE_XSHM_EXTENSION 1
3588 EOF
3589
3590   fi
3591
3592 elif test $with_xshm != no; then
3593   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
3594   exit 1
3595 fi
3596
3597
3598 # Check for the SGI-VIDEO-CONTROL server extension header.
3599 #
3600 have_sgivc=no
3601 with_sgivc_req=unspecified
3602 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
3603 if test "${with_sgivc_ext+set}" = set; then
3604   withval="$with_sgivc_ext"
3605   with_sgivc="$withval"; with_sgivc_req="$withval"
3606 else
3607   with_sgivc=yes
3608 fi
3609
3610 if test $with_sgivc = yes; then
3611
3612   # first check for XSGIvc.h
3613   
3614   ac_save_CPPFLAGS="$CPPFLAGS"
3615   if test \! -z "$includedir" ; then 
3616     CPPFLAGS="$CPPFLAGS -I$includedir"
3617   fi
3618   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3619   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
3620 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
3621 echo "configure:3622: checking for X11/extensions/XSGIvc.h" >&5
3622 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3623   echo $ac_n "(cached) $ac_c" 1>&6
3624 else
3625   cat > conftest.$ac_ext <<EOF
3626 #line 3627 "configure"
3627 #include "confdefs.h"
3628 #include <X11/extensions/XSGIvc.h>
3629 EOF
3630 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3631 { (eval echo configure:3632: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3632 ac_err=`grep -v '^ *+' conftest.out`
3633 if test -z "$ac_err"; then
3634   rm -rf conftest*
3635   eval "ac_cv_header_$ac_safe=yes"
3636 else
3637   echo "$ac_err" >&5
3638   echo "configure: failed program was:" >&5
3639   cat conftest.$ac_ext >&5
3640   rm -rf conftest*
3641   eval "ac_cv_header_$ac_safe=no"
3642 fi
3643 rm -f conftest*
3644 fi
3645 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3646   echo "$ac_t""yes" 1>&6
3647   have_sgivc=yes
3648 else
3649   echo "$ac_t""no" 1>&6
3650 fi
3651
3652   CPPFLAGS="$ac_save_CPPFLAGS"
3653
3654   # if that succeeded, then check for the -lXsgivc
3655   if test $have_sgivc = yes; then
3656     have_sgivc=no
3657     
3658   ac_save_CPPFLAGS="$CPPFLAGS"
3659   ac_save_LDFLAGS="$LDFLAGS"
3660   if test \! -z "$includedir" ; then 
3661     CPPFLAGS="$CPPFLAGS -I$includedir"
3662   fi
3663   if test \! -z "$includedir" ; then 
3664     CPPFLAGS="$CPPFLAGS -I$includedir"
3665   fi
3666   if test \! -z "$libdir" ; then
3667     LDFLAGS="$LDFLAGS -L$libdir"
3668   fi
3669   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3670   if test \! -z "$x_libraries" ; then
3671     LDFLAGS="$LDFLAGS -L$x_libraries"
3672   fi
3673   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
3674 echo "configure:3675: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
3675 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
3676 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   ac_save_LIBS="$LIBS"
3680 LIBS="-lXsgivc -lXext -lX11 $LIBS"
3681 cat > conftest.$ac_ext <<EOF
3682 #line 3683 "configure"
3683 #include "confdefs.h"
3684 /* Override any gcc2 internal prototype to avoid an error.  */
3685 /* We use char because int might match the return type of a gcc2
3686     builtin and then its argument prototype would still apply.  */
3687 char XSGIvcQueryGammaMap();
3688
3689 int main() {
3690 XSGIvcQueryGammaMap()
3691 ; return 0; }
3692 EOF
3693 if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3694   rm -rf conftest*
3695   eval "ac_cv_lib_$ac_lib_var=yes"
3696 else
3697   echo "configure: failed program was:" >&5
3698   cat conftest.$ac_ext >&5
3699   rm -rf conftest*
3700   eval "ac_cv_lib_$ac_lib_var=no"
3701 fi
3702 rm -f conftest*
3703 LIBS="$ac_save_LIBS"
3704
3705 fi
3706 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3707   echo "$ac_t""yes" 1>&6
3708   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
3709 else
3710   echo "$ac_t""no" 1>&6
3711 fi
3712
3713   CPPFLAGS="$ac_save_CPPFLAGS"
3714   LDFLAGS="$ac_save_LDFLAGS"
3715   fi
3716
3717   # if that succeeded, then we've really got it.
3718   if test $have_sgivc = yes; then
3719     cat >> confdefs.h <<\EOF
3720 #define HAVE_SGI_VC_EXTENSION 1
3721 EOF
3722
3723   fi
3724
3725 elif test $with_sgivc != no; then
3726   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
3727   exit 1
3728 fi
3729
3730
3731
3732
3733
3734
3735
3736
3737 # Check for Motif and Athena --with and --without arguments.
3738 #
3739 have_motif=no
3740 have_athena=no
3741 with_motif_req=unspecified
3742 with_athena_req=unspecified
3743
3744 # Check whether --with-motif or --without-motif was given.
3745 if test "${with_motif+set}" = set; then
3746   withval="$with_motif"
3747   with_motif="$withval"; with_motif_req="$withval"
3748 else
3749   with_motif=no
3750 fi
3751
3752
3753 # Check whether --with-athena or --without-athena was given.
3754 if test "${with_athena+set}" = set; then
3755   withval="$with_athena"
3756   with_athena="$withval"; with_athena_req="$withval"
3757 else
3758   with_athena=no
3759 fi
3760
3761
3762 if test $with_motif != yes -a $with_motif != no ; then
3763   echo "error: must be yes or no: --with-motif=$with_motif"
3764   exit 1
3765 fi
3766
3767 if test $with_athena != yes -a $with_athena != no ; then
3768   echo "error: must be yes or no: --with-athena=$with_athena"
3769   exit 1
3770 fi
3771
3772
3773 # Saying --without-motif is the same as saying --with-athena.
3774 if test $with_motif_req = no ; then
3775   with_athena_req=yes
3776   with_athena=yes
3777 fi
3778
3779 # Saying --without-athena is the same as saying --with-motif.
3780 if test $with_athena_req = no ; then
3781   with_motif_req=yes
3782   with_motif=yes
3783 fi
3784
3785 # Check for Motif and Athena headers.
3786
3787 check_motif() {
3788   
3789   ac_save_CPPFLAGS="$CPPFLAGS"
3790   if test \! -z "$includedir" ; then 
3791     CPPFLAGS="$CPPFLAGS -I$includedir"
3792   fi
3793   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3794   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
3795 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
3796 echo "configure:3797: checking for Xm/Xm.h" >&5
3797 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3798   echo $ac_n "(cached) $ac_c" 1>&6
3799 else
3800   cat > conftest.$ac_ext <<EOF
3801 #line 3802 "configure"
3802 #include "confdefs.h"
3803 #include <Xm/Xm.h>
3804 EOF
3805 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3806 { (eval echo configure:3807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3807 ac_err=`grep -v '^ *+' conftest.out`
3808 if test -z "$ac_err"; then
3809   rm -rf conftest*
3810   eval "ac_cv_header_$ac_safe=yes"
3811 else
3812   echo "$ac_err" >&5
3813   echo "configure: failed program was:" >&5
3814   cat conftest.$ac_ext >&5
3815   rm -rf conftest*
3816   eval "ac_cv_header_$ac_safe=no"
3817 fi
3818 rm -f conftest*
3819 fi
3820 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3821   echo "$ac_t""yes" 1>&6
3822   have_motif=yes
3823                      cat >> confdefs.h <<\EOF
3824 #define HAVE_MOTIF 1
3825 EOF
3826
3827                      SAVER_LIBS="-lXm $SAVER_LIBS"
3828 else
3829   echo "$ac_t""no" 1>&6
3830 fi
3831
3832   CPPFLAGS="$ac_save_CPPFLAGS"
3833 }
3834
3835 check_athena() {
3836   
3837   ac_save_CPPFLAGS="$CPPFLAGS"
3838   if test \! -z "$includedir" ; then 
3839     CPPFLAGS="$CPPFLAGS -I$includedir"
3840   fi
3841   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3842   ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
3843 echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
3844 echo "configure:3845: checking for X11/Xaw/Dialog.h" >&5
3845 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3846   echo $ac_n "(cached) $ac_c" 1>&6
3847 else
3848   cat > conftest.$ac_ext <<EOF
3849 #line 3850 "configure"
3850 #include "confdefs.h"
3851 #include <X11/Xaw/Dialog.h>
3852 EOF
3853 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3854 { (eval echo configure:3855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3855 ac_err=`grep -v '^ *+' conftest.out`
3856 if test -z "$ac_err"; then
3857   rm -rf conftest*
3858   eval "ac_cv_header_$ac_safe=yes"
3859 else
3860   echo "$ac_err" >&5
3861   echo "configure: failed program was:" >&5
3862   cat conftest.$ac_ext >&5
3863   rm -rf conftest*
3864   eval "ac_cv_header_$ac_safe=no"
3865 fi
3866 rm -f conftest*
3867 fi
3868 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3869   echo "$ac_t""yes" 1>&6
3870   have_athena=yes
3871                     cat >> confdefs.h <<\EOF
3872 #define HAVE_ATHENA 1
3873 EOF
3874
3875                     SAVER_LIBS="-lXaw $SAVER_LIBS"
3876 else
3877   echo "$ac_t""no" 1>&6
3878 fi
3879
3880   CPPFLAGS="$ac_save_CPPFLAGS"
3881 }
3882
3883
3884 # If they asked for both motif and athena, check motif then athena.
3885 # If they asked for only motif, check motif then athena.
3886 # If they asked for only athena, check athena then motif.
3887 # If they asked for neither, check motif then athena.
3888
3889 proselytize_motif=yes
3890 if test $with_motif = yes; then
3891   # asked for both, or for motif only
3892   check_motif
3893   if test $have_motif = yes; then
3894     with_athena=no
3895     with_athena_req=no
3896   else
3897     check_athena
3898   fi
3899
3900 elif test $with_athena = yes; then
3901   # asked for athena only
3902   check_athena
3903   if test $have_athena = yes; then
3904     with_motif=no
3905     proselytize_motif=no
3906   else
3907     check_motif
3908   fi
3909
3910 else
3911   # asked for neither
3912   check_motif
3913   if test $have_motif = yes; then
3914     with_athena=no
3915   else
3916     check_athena
3917   fi
3918
3919 fi
3920
3921 if test $have_motif = yes; then
3922   proselytize_motif=no
3923 fi
3924
3925 # If we have Athena, check whether it's a version that includes
3926 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
3927 if test $have_athena = yes ; then
3928   echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
3929 echo "configure:3930: checking for XawViewportSetCoordinates in Viewport.h" >&5
3930 if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
3931   echo $ac_n "(cached) $ac_c" 1>&6
3932 else
3933   ac_cv_have_XawViewportSetCoordinates=no
3934                   
3935   ac_save_CPPFLAGS="$CPPFLAGS"
3936   if test \! -z "$includedir" ; then 
3937     CPPFLAGS="$CPPFLAGS -I$includedir"
3938   fi
3939   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3940   cat > conftest.$ac_ext <<EOF
3941 #line 3942 "configure"
3942 #include "confdefs.h"
3943 #include <X11/Xaw/Viewport.h>
3944 EOF
3945 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3946   egrep "XawViewportSetCoordinates" >/dev/null 2>&1; then
3947   rm -rf conftest*
3948   ac_cv_have_XawViewportSetCoordinates=yes
3949 fi
3950 rm -f conftest*
3951
3952   CPPFLAGS="$ac_save_CPPFLAGS"
3953 fi
3954
3955 echo "$ac_t""$ac_cv_have_XawViewportSetCoordinates" 1>&6
3956   if test $ac_cv_have_XawViewportSetCoordinates = yes ; then
3957     cat >> confdefs.h <<\EOF
3958 #define HAVE_XawViewportSetCoordinates 1
3959 EOF
3960
3961   fi
3962 fi
3963
3964
3965 # If we have Motif, check whether it's really LessTif.
3966 #
3967 have_lesstif=no
3968 if test $have_motif = yes ; then
3969   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
3970 echo "configure:3971: checking whether Motif is really LessTif" >&5
3971 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
3972   echo $ac_n "(cached) $ac_c" 1>&6
3973 else
3974   
3975   ac_save_CPPFLAGS="$CPPFLAGS"
3976   if test \! -z "$includedir" ; then 
3977     CPPFLAGS="$CPPFLAGS -I$includedir"
3978   fi
3979   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3980   cat > conftest.$ac_ext <<EOF
3981 #line 3982 "configure"
3982 #include "confdefs.h"
3983 #include <Xm/Xm.h>
3984 int main() {
3985 long vers = LesstifVersion;
3986 ; return 0; }
3987 EOF
3988 if { (eval echo configure:3989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3989   rm -rf conftest*
3990   ac_cv_have_lesstif=yes
3991 else
3992   echo "configure: failed program was:" >&5
3993   cat conftest.$ac_ext >&5
3994   rm -rf conftest*
3995   ac_cv_have_lesstif=no
3996 fi
3997 rm -f conftest*
3998   CPPFLAGS="$ac_save_CPPFLAGS"
3999 fi
4000
4001 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
4002   have_lesstif=$ac_cv_have_lesstif
4003 fi
4004
4005 # don't cache this
4006 unset ac_cv_good_lesstif
4007
4008 good_lesstif=no
4009 if test $have_lesstif = yes ; then
4010   # It must be at least "GNU Lesstif 0.82".
4011   # #### If you change this, also sync the warning message lower down.
4012   echo $ac_n "checking whether LessTif is of a recent enough vintage""... $ac_c" 1>&6
4013 echo "configure:4014: checking whether LessTif is of a recent enough vintage" >&5
4014 if eval "test \"`echo '$''{'ac_cv_good_lesstif'+set}'`\" = set"; then
4015   echo $ac_n "(cached) $ac_c" 1>&6
4016 else
4017   
4018   ac_save_CPPFLAGS="$CPPFLAGS"
4019   if test \! -z "$includedir" ; then 
4020     CPPFLAGS="$CPPFLAGS -I$includedir"
4021   fi
4022   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4023   if test "$cross_compiling" = yes; then
4024   # cross compiling?  Make an ass out of umption.
4025                                ac_cv_good_lesstif=yes
4026 else
4027   cat > conftest.$ac_ext <<EOF
4028 #line 4029 "configure"
4029 #include "confdefs.h"
4030 #include <Xm/Xm.h>
4031                                 int main() { exit(LesstifVersion < 82); }
4032 EOF
4033 if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4034 then
4035   ac_cv_good_lesstif=yes
4036 else
4037   echo "configure: failed program was:" >&5
4038   cat conftest.$ac_ext >&5
4039   rm -fr conftest*
4040   ac_cv_good_lesstif=no
4041 fi
4042 rm -fr conftest*
4043 fi
4044
4045   CPPFLAGS="$ac_save_CPPFLAGS"
4046 fi
4047
4048 echo "$ac_t""$ac_cv_good_lesstif" 1>&6
4049   good_lesstif=$ac_cv_good_lesstif
4050 fi
4051
4052
4053 # check for XPM header.
4054 #
4055 have_xpm=no
4056 with_xpm_req=unspecified
4057 # Check whether --with-xpm or --without-xpm was given.
4058 if test "${with_xpm+set}" = set; then
4059   withval="$with_xpm"
4060   with_xpm="$withval"; with_xpm_req="$withval"
4061 else
4062   with_xpm=yes
4063 fi
4064
4065 if test $with_xpm = yes; then
4066   
4067   ac_save_CPPFLAGS="$CPPFLAGS"
4068   if test \! -z "$includedir" ; then 
4069     CPPFLAGS="$CPPFLAGS -I$includedir"
4070   fi
4071   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4072   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
4073 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
4074 echo "configure:4075: checking for X11/xpm.h" >&5
4075 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4076   echo $ac_n "(cached) $ac_c" 1>&6
4077 else
4078   cat > conftest.$ac_ext <<EOF
4079 #line 4080 "configure"
4080 #include "confdefs.h"
4081 #include <X11/xpm.h>
4082 EOF
4083 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4084 { (eval echo configure:4085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4085 ac_err=`grep -v '^ *+' conftest.out`
4086 if test -z "$ac_err"; then
4087   rm -rf conftest*
4088   eval "ac_cv_header_$ac_safe=yes"
4089 else
4090   echo "$ac_err" >&5
4091   echo "configure: failed program was:" >&5
4092   cat conftest.$ac_ext >&5
4093   rm -rf conftest*
4094   eval "ac_cv_header_$ac_safe=no"
4095 fi
4096 rm -f conftest*
4097 fi
4098 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4099   echo "$ac_t""yes" 1>&6
4100   have_xpm=yes
4101                     cat >> confdefs.h <<\EOF
4102 #define HAVE_XPM 1
4103 EOF
4104
4105                     XPM_LIBS="-lXpm"
4106 else
4107   echo "$ac_t""no" 1>&6
4108 fi
4109
4110   CPPFLAGS="$ac_save_CPPFLAGS"
4111 elif test $with_xpm != no; then
4112   echo "error: must be yes or no: --with-xpm=$with_xpm"
4113   exit 1
4114 fi
4115
4116
4117 # check for the GL header
4118 #
4119 have_gl=no
4120 with_gl_req=unspecified
4121 # Check whether --with-gl or --without-gl was given.
4122 if test "${with_gl+set}" = set; then
4123   withval="$with_gl"
4124   with_gl="$withval"; with_gl_req="$withval"
4125 else
4126   with_gl=yes
4127 fi
4128
4129
4130 if test $with_gl = yes; then
4131   
4132   ac_save_CPPFLAGS="$CPPFLAGS"
4133   if test \! -z "$includedir" ; then 
4134     CPPFLAGS="$CPPFLAGS -I$includedir"
4135   fi
4136   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4137   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
4138 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
4139 echo "configure:4140: checking for GL/gl.h" >&5
4140 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4141   echo $ac_n "(cached) $ac_c" 1>&6
4142 else
4143   cat > conftest.$ac_ext <<EOF
4144 #line 4145 "configure"
4145 #include "confdefs.h"
4146 #include <GL/gl.h>
4147 EOF
4148 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4149 { (eval echo configure:4150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4150 ac_err=`grep -v '^ *+' conftest.out`
4151 if test -z "$ac_err"; then
4152   rm -rf conftest*
4153   eval "ac_cv_header_$ac_safe=yes"
4154 else
4155   echo "$ac_err" >&5
4156   echo "configure: failed program was:" >&5
4157   cat conftest.$ac_ext >&5
4158   rm -rf conftest*
4159   eval "ac_cv_header_$ac_safe=no"
4160 fi
4161 rm -f conftest*
4162 fi
4163 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4164   echo "$ac_t""yes" 1>&6
4165   have_gl=yes
4166 else
4167   echo "$ac_t""no" 1>&6
4168 fi
4169
4170   CPPFLAGS="$ac_save_CPPFLAGS"
4171   if test $have_gl = yes ; then
4172     
4173   ac_save_CPPFLAGS="$CPPFLAGS"
4174   if test \! -z "$includedir" ; then 
4175     CPPFLAGS="$CPPFLAGS -I$includedir"
4176   fi
4177   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4178   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
4179 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
4180 echo "configure:4181: checking for GL/glx.h" >&5
4181 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4182   echo $ac_n "(cached) $ac_c" 1>&6
4183 else
4184   cat > conftest.$ac_ext <<EOF
4185 #line 4186 "configure"
4186 #include "confdefs.h"
4187 #include <GL/glx.h>
4188 EOF
4189 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4190 { (eval echo configure:4191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4191 ac_err=`grep -v '^ *+' conftest.out`
4192 if test -z "$ac_err"; then
4193   rm -rf conftest*
4194   eval "ac_cv_header_$ac_safe=yes"
4195 else
4196   echo "$ac_err" >&5
4197   echo "configure: failed program was:" >&5
4198   cat conftest.$ac_ext >&5
4199   rm -rf conftest*
4200   eval "ac_cv_header_$ac_safe=no"
4201 fi
4202 rm -f conftest*
4203 fi
4204 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4205   echo "$ac_t""yes" 1>&6
4206   have_gl=yes
4207 else
4208   echo "$ac_t""no" 1>&6
4209 fi
4210
4211   CPPFLAGS="$ac_save_CPPFLAGS"
4212   fi
4213
4214   # If we have the headers, try and figure out which vendor it's from.
4215   #
4216   if test $have_gl = yes ; then
4217
4218     cat >> confdefs.h <<\EOF
4219 #define HAVE_GL 1
4220 EOF
4221
4222     have_mesa_gl=no
4223     
4224   ac_save_CPPFLAGS="$CPPFLAGS"
4225   if test \! -z "$includedir" ; then 
4226     CPPFLAGS="$CPPFLAGS -I$includedir"
4227   fi
4228   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4229   cat > conftest.$ac_ext <<EOF
4230 #line 4231 "configure"
4231 #include "confdefs.h"
4232 #include <GL/glx.h>
4233 EOF
4234 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4235   egrep "Mesa" >/dev/null 2>&1; then
4236   rm -rf conftest*
4237   have_mesa_gl=yes
4238 fi
4239 rm -f conftest*
4240
4241   CPPFLAGS="$ac_save_CPPFLAGS"
4242     if test $have_mesa_gl = no ; then
4243       GL_LIBS="-lGL -lGLU"
4244     else
4245       cat >> confdefs.h <<\EOF
4246 #define HAVE_MESA_GL 1
4247 EOF
4248
4249       GL_LIBS="-lMesaGL -lMesaGLU"
4250     fi
4251   fi
4252
4253 elif test $with_gl != no; then
4254   echo "error: must be yes or no: --with-gl=$with_gl"
4255   exit 1
4256 fi
4257
4258
4259 # check for SGI XReadDisplay server extension header.
4260 #
4261 have_readdisplay=no
4262 with_readdisplay_req=unspecified
4263 # Check whether --with-readdisplay or --without-readdisplay was given.
4264 if test "${with_readdisplay+set}" = set; then
4265   withval="$with_readdisplay"
4266   with_readdisplay="$withval"; with_readdisplay_req="$withval"
4267 else
4268   with_readdisplay=yes
4269 fi
4270
4271 if test $with_readdisplay = yes; then
4272   
4273   ac_save_CPPFLAGS="$CPPFLAGS"
4274   if test \! -z "$includedir" ; then 
4275     CPPFLAGS="$CPPFLAGS -I$includedir"
4276   fi
4277   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4278   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
4279 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
4280 echo "configure:4281: checking for X11/extensions/readdisplay.h" >&5
4281 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4282   echo $ac_n "(cached) $ac_c" 1>&6
4283 else
4284   cat > conftest.$ac_ext <<EOF
4285 #line 4286 "configure"
4286 #include "confdefs.h"
4287 #include <X11/extensions/readdisplay.h>
4288 EOF
4289 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4290 { (eval echo configure:4291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4291 ac_err=`grep -v '^ *+' conftest.out`
4292 if test -z "$ac_err"; then
4293   rm -rf conftest*
4294   eval "ac_cv_header_$ac_safe=yes"
4295 else
4296   echo "$ac_err" >&5
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299   rm -rf conftest*
4300   eval "ac_cv_header_$ac_safe=no"
4301 fi
4302 rm -f conftest*
4303 fi
4304 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4305   echo "$ac_t""yes" 1>&6
4306   cat >> confdefs.h <<\EOF
4307 #define HAVE_READ_DISPLAY_EXTENSION 1
4308 EOF
4309
4310 else
4311   echo "$ac_t""no" 1>&6
4312 fi
4313
4314   CPPFLAGS="$ac_save_CPPFLAGS"
4315 elif test $with_readdisplay != no; then
4316   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
4317   exit 1
4318 fi
4319
4320
4321 # check for SGI's Iris Video Library header.
4322 #
4323 have_sgivideo=no
4324 with_sgivideo_req=unspecified
4325 # Check whether --with-sgivideo or --without-sgivideo was given.
4326 if test "${with_sgivideo+set}" = set; then
4327   withval="$with_sgivideo"
4328   with_sgivideo="$withval"; with_sgivideo_req="$withval"
4329 else
4330   with_sgivideo=yes
4331 fi
4332
4333 if test $with_sgivideo = yes; then
4334   
4335   ac_save_CPPFLAGS="$CPPFLAGS"
4336   if test \! -z "$includedir" ; then 
4337     CPPFLAGS="$CPPFLAGS -I$includedir"
4338   fi
4339   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4340   ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
4341 echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
4342 echo "configure:4343: checking for dmedia/vl.h" >&5
4343 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4344   echo $ac_n "(cached) $ac_c" 1>&6
4345 else
4346   cat > conftest.$ac_ext <<EOF
4347 #line 4348 "configure"
4348 #include "confdefs.h"
4349 #include <dmedia/vl.h>
4350 EOF
4351 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4352 { (eval echo configure:4353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4353 ac_err=`grep -v '^ *+' conftest.out`
4354 if test -z "$ac_err"; then
4355   rm -rf conftest*
4356   eval "ac_cv_header_$ac_safe=yes"
4357 else
4358   echo "$ac_err" >&5
4359   echo "configure: failed program was:" >&5
4360   cat conftest.$ac_ext >&5
4361   rm -rf conftest*
4362   eval "ac_cv_header_$ac_safe=no"
4363 fi
4364 rm -f conftest*
4365 fi
4366 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4367   echo "$ac_t""yes" 1>&6
4368   have_sgivideo=yes
4369 else
4370   echo "$ac_t""no" 1>&6
4371 fi
4372
4373   CPPFLAGS="$ac_save_CPPFLAGS"
4374   if test $have_sgivideo = yes; then
4375     have_sgivideo=no
4376     echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
4377 echo "configure:4378: checking for vlOpenVideo in -lvl" >&5
4378 ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
4379 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4380   echo $ac_n "(cached) $ac_c" 1>&6
4381 else
4382   ac_save_LIBS="$LIBS"
4383 LIBS="-lvl  $LIBS"
4384 cat > conftest.$ac_ext <<EOF
4385 #line 4386 "configure"
4386 #include "confdefs.h"
4387 /* Override any gcc2 internal prototype to avoid an error.  */
4388 /* We use char because int might match the return type of a gcc2
4389     builtin and then its argument prototype would still apply.  */
4390 char vlOpenVideo();
4391
4392 int main() {
4393 vlOpenVideo()
4394 ; return 0; }
4395 EOF
4396 if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4397   rm -rf conftest*
4398   eval "ac_cv_lib_$ac_lib_var=yes"
4399 else
4400   echo "configure: failed program was:" >&5
4401   cat conftest.$ac_ext >&5
4402   rm -rf conftest*
4403   eval "ac_cv_lib_$ac_lib_var=no"
4404 fi
4405 rm -f conftest*
4406 LIBS="$ac_save_LIBS"
4407
4408 fi
4409 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4410   echo "$ac_t""yes" 1>&6
4411   have_sgivideo=yes
4412 else
4413   echo "$ac_t""no" 1>&6
4414 fi
4415
4416     if test $have_sgivideo = yes; then
4417       SGI_VIDEO_OBJS="$(UTILS_SRC)/sgivideo.o"
4418       SGI_VIDEO_LIBS="-lvl"
4419       cat >> confdefs.h <<\EOF
4420 #define HAVE_SGI_VIDEO 1
4421 EOF
4422
4423     fi
4424   fi
4425 elif test $with_sgivideo != no; then
4426   echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
4427   exit 1
4428 fi
4429
4430
4431
4432 # Try to find a program to generate random text.
4433 #
4434 # Zippy is funnier than the idiocy generally spat out by `fortune',
4435 # so try to find that, by invoking Emacs and asking it where its 
4436 # libexec directory is ("yow" lives in there.)
4437 #
4438 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
4439 # and if so, use them.
4440 #
4441 # If that doesn't work, look in /usr/games, and if it's there, use
4442 # the full pathname.
4443 #
4444 with_zippy_req=""
4445 # Check whether --with-zippy or --without-zippy was given.
4446 if test "${with_zippy+set}" = set; then
4447   withval="$with_zippy"
4448    with_zippy_req="$withval"; with_zippy="$withval" 
4449 else
4450    with_zippy_req="$withval"; with_zippy="$withval" 
4451 fi
4452
4453
4454 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
4455   with_zippy=""
4456   with_zippy_req=""
4457 fi
4458
4459 if test -n "$with_zippy_req" ; then
4460   ac_cv_zippy_program=""
4461   case "$with_zippy_req" in
4462     /*)
4463       echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
4464 echo "configure:4465: checking for $with_zippy_req" >&5
4465       if test -x "$with_zippy_req" ; then
4466         echo "$ac_t""yes" 1>&6
4467       else
4468         echo "$ac_t""no" 1>&6
4469         with_zippy=""
4470       fi
4471     ;;
4472     *)
4473       # don't cache
4474       unset ac_cv_path_zip2
4475       # Extract the first word of "$with_zippy_req", so it can be a program name with args.
4476 set dummy $with_zippy_req; ac_word=$2
4477 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4478 echo "configure:4479: checking for $ac_word" >&5
4479 if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
4480   echo $ac_n "(cached) $ac_c" 1>&6
4481 else
4482   case "$zip2" in
4483   /*)
4484   ac_cv_path_zip2="$zip2" # Let the user override the test with a path.
4485   ;;
4486   *)
4487   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4488   for ac_dir in $PATH; do
4489     test -z "$ac_dir" && ac_dir=.
4490     if test -f $ac_dir/$ac_word; then
4491       ac_cv_path_zip2="$ac_dir/$ac_word"
4492       break
4493     fi
4494   done
4495   IFS="$ac_save_ifs"
4496   ;;
4497 esac
4498 fi
4499 zip2="$ac_cv_path_zip2"
4500 if test -n "$zip2"; then
4501   echo "$ac_t""$zip2" 1>&6
4502 else
4503   echo "$ac_t""no" 1>&6
4504 fi
4505
4506       if test "$zip2" = ""; then
4507         with_zippy=""
4508       fi
4509     ;;
4510   esac
4511   ac_cv_zippy_program="$with_zippy"
4512
4513 elif test -n "$ac_cv_zippy_program"; then
4514   echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
4515 fi
4516
4517 if test ! -n "$ac_cv_zippy_program"; then
4518
4519   for ac_prog in emacs
4520 do
4521 # Extract the first word of "$ac_prog", so it can be a program name with args.
4522 set dummy $ac_prog; ac_word=$2
4523 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4524 echo "configure:4525: checking for $ac_word" >&5
4525 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
4526   echo $ac_n "(cached) $ac_c" 1>&6
4527 else
4528   if test -n "$emacs_exe"; then
4529   ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
4530 else
4531   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4532   for ac_dir in $PATH; do
4533     test -z "$ac_dir" && ac_dir=.
4534     if test -f $ac_dir/$ac_word; then
4535       ac_cv_prog_emacs_exe="$ac_prog"
4536       break
4537     fi
4538   done
4539   IFS="$ac_save_ifs"
4540 fi
4541 fi
4542 emacs_exe="$ac_cv_prog_emacs_exe"
4543 if test -n "$emacs_exe"; then
4544   echo "$ac_t""$emacs_exe" 1>&6
4545 else
4546   echo "$ac_t""no" 1>&6
4547 fi
4548
4549 test -n "$emacs_exe" && break
4550 done
4551
4552   for ac_prog in xemacs
4553 do
4554 # Extract the first word of "$ac_prog", so it can be a program name with args.
4555 set dummy $ac_prog; ac_word=$2
4556 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4557 echo "configure:4558: checking for $ac_word" >&5
4558 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
4559   echo $ac_n "(cached) $ac_c" 1>&6
4560 else
4561   if test -n "$xemacs_exe"; then
4562   ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
4563 else
4564   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4565   for ac_dir in $PATH; do
4566     test -z "$ac_dir" && ac_dir=.
4567     if test -f $ac_dir/$ac_word; then
4568       ac_cv_prog_xemacs_exe="$ac_prog"
4569       break
4570     fi
4571   done
4572   IFS="$ac_save_ifs"
4573 fi
4574 fi
4575 xemacs_exe="$ac_cv_prog_xemacs_exe"
4576 if test -n "$xemacs_exe"; then
4577   echo "$ac_t""$xemacs_exe" 1>&6
4578 else
4579   echo "$ac_t""no" 1>&6
4580 fi
4581
4582 test -n "$xemacs_exe" && break
4583 done
4584
4585
4586   ac_cv_zippy_program=""
4587   eargs='-batch -q -nw --eval'
4588
4589   if test -n "$emacs_exe" ; then
4590     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
4591 echo "configure:4592: checking for emacs yow" >&5
4592     #
4593     # get emacs to tell us where the libexec directory is.
4594     #
4595     dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
4596          2>/dev/null | tail -1`
4597     dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
4598     #
4599     # try running libexec/yow and see if it exits without error.
4600     #
4601     if test x"$dir" != x -a -x $dir/yow ; then
4602       if $dir/yow >&- 2>&- ; then
4603         ac_cv_zippy_program="$dir/yow"
4604         echo "$ac_t""$ac_cv_zippy_program" 1>&6
4605       else
4606         echo "$ac_t""no" 1>&6
4607       fi
4608     fi
4609   fi
4610
4611   if test -z "$ac_cv_zippy_program" ; then
4612     echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
4613 echo "configure:4614: checking for xemacs yow" >&5
4614     if test -n "$xemacs_exe" ; then
4615       #
4616       # get xemacs to tell us where the libexec directory is.
4617       #
4618       dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
4619            2>/dev/null | tail -1`
4620       dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
4621       #
4622       # try running libexec/yow and see if it exits without error.
4623       #
4624       if test x"$dir" != x -a -x $dir/yow ; then
4625         if $dir/yow >&- 2>&- ; then
4626           ac_cv_zippy_program="$dir/yow"
4627           echo "$ac_t""$ac_cv_zippy_program" 1>&6
4628         else
4629           #
4630           # in some xemacs installations, the pathname of the yow.lines file
4631           # isn't hardcoded into the yow executable, and must be passed on 
4632           # the command line.  See if it's in libexec/../etc/.
4633
4634           # M4 sucks!!
4635           
4636           dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
4637           
4638
4639           yow="yow -f $dir_up/etc/yow.lines"
4640           if $dir/$yow >&- 2>&- ; then
4641             ac_cv_zippy_program="$dir/$yow"
4642             echo "$ac_t""$ac_cv_zippy_program" 1>&6
4643           else
4644             echo "$ac_t""no" 1>&6
4645           fi
4646         fi
4647       fi
4648     fi
4649   fi
4650
4651   # if that didn't work, try for some other programs...
4652   if test -z "$ac_cv_zippy_program" ; then
4653     fortune=''
4654     for ac_prog in fortune zippy yow
4655 do
4656 # Extract the first word of "$ac_prog", so it can be a program name with args.
4657 set dummy $ac_prog; ac_word=$2
4658 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4659 echo "configure:4660: checking for $ac_word" >&5
4660 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
4661   echo $ac_n "(cached) $ac_c" 1>&6
4662 else
4663   if test -n "$fortune"; then
4664   ac_cv_prog_fortune="$fortune" # Let the user override the test.
4665 else
4666   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4667   for ac_dir in $PATH; do
4668     test -z "$ac_dir" && ac_dir=.
4669     if test -f $ac_dir/$ac_word; then
4670       ac_cv_prog_fortune="$ac_prog"
4671       break
4672     fi
4673   done
4674   IFS="$ac_save_ifs"
4675 fi
4676 fi
4677 fortune="$ac_cv_prog_fortune"
4678 if test -n "$fortune"; then
4679   echo "$ac_t""$fortune" 1>&6
4680 else
4681   echo "$ac_t""no" 1>&6
4682 fi
4683
4684 test -n "$fortune" && break
4685 done
4686
4687     # if that didn't work, try for those programs in /usr/games...
4688     if test -z "$fortune" ; then
4689       for ac_prog in fortune zippy yow
4690 do
4691 # Extract the first word of "$ac_prog", so it can be a program name with args.
4692 set dummy $ac_prog; ac_word=$2
4693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4694 echo "configure:4695: checking for $ac_word" >&5
4695 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
4696   echo $ac_n "(cached) $ac_c" 1>&6
4697 else
4698   case "$fortune" in
4699   /*)
4700   ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
4701   ;;
4702   *)
4703   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4704   for ac_dir in /usr/games:/usr/local/games$ac_dummy; do
4705     test -z "$ac_dir" && ac_dir=.
4706     if test -f $ac_dir/$ac_word; then
4707       ac_cv_path_fortune="$ac_dir/$ac_word"
4708       break
4709     fi
4710   done
4711   IFS="$ac_save_ifs"
4712   ;;
4713 esac
4714 fi
4715 fortune="$ac_cv_path_fortune"
4716 if test -n "$fortune"; then
4717   echo "$ac_t""$fortune" 1>&6
4718 else
4719   echo "$ac_t""no" 1>&6
4720 fi
4721
4722 test -n "$fortune" && break
4723 done
4724 test -n "$fortune" || fortune="fortune"
4725
4726     fi
4727   fi
4728 fi
4729
4730 if test -z "$ac_cv_zippy_program" ; then
4731   ac_cv_zippy_program=fortune
4732 fi
4733
4734 cat >> confdefs.h <<EOF
4735 #define ZIPPY_PROGRAM "$ac_cv_zippy_program"
4736 EOF
4737
4738
4739
4740
4741
4742 # Allow locking to be disabled at compile-time.
4743 #
4744 have_locking=yes
4745 have_kerberos=no
4746 with_kerberos_req=unspecified
4747 have_shadow=no
4748 with_shadow_req=unspecified
4749 need_setuid=no
4750
4751 # Check whether --enable-locking or --disable-locking was given.
4752 if test "${enable_locking+set}" = set; then
4753   enableval="$enable_locking"
4754   enable_locking="$enableval"
4755 else
4756   enable_locking=yes
4757 fi
4758
4759 if test $enable_locking = yes; then
4760
4761   # Check for Kerberos.
4762   #
4763   # Check whether --with-kerberos or --without-kerberos was given.
4764 if test "${with_kerberos+set}" = set; then
4765   withval="$with_kerberos"
4766   with_kerberos="$withval"; with_kerberos_req="$withval"
4767 else
4768   with_kerberos=yes
4769 fi
4770
4771   if test $with_kerberos = yes; then
4772     echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
4773 echo "configure:4774: checking for Kerberos" >&5
4774 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
4775   echo $ac_n "(cached) $ac_c" 1>&6
4776 else
4777   
4778   ac_save_CPPFLAGS="$CPPFLAGS"
4779   if test \! -z "$includedir" ; then 
4780     CPPFLAGS="$CPPFLAGS -I$includedir"
4781   fi
4782   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4783   cat > conftest.$ac_ext <<EOF
4784 #line 4785 "configure"
4785 #include "confdefs.h"
4786 #include <krb.h>
4787 int main() {
4788
4789 ; return 0; }
4790 EOF
4791 if { (eval echo configure:4792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4792   rm -rf conftest*
4793   ac_cv_kerberos=yes
4794 else
4795   echo "configure: failed program was:" >&5
4796   cat conftest.$ac_ext >&5
4797   rm -rf conftest*
4798   ac_cv_kerberos=no
4799 fi
4800 rm -f conftest*
4801   CPPFLAGS="$ac_save_CPPFLAGS"
4802 fi
4803
4804 echo "$ac_t""$ac_cv_kerberos" 1>&6
4805     if test $ac_cv_kerberos = yes ; then
4806       have_kerberos=yes
4807       cat >> confdefs.h <<\EOF
4808 #define HAVE_KERBEROS 1
4809 EOF
4810
4811       PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lnsl -lsocket"
4812     fi
4813   elif test $with_kerberos != no; then
4814     echo "error: must be yes or no: --with-kerberos=$with_kerberos"
4815     exit 1
4816   fi
4817
4818   # Next, check for the nine billion variants of shadow passwords...
4819
4820   passwd_cruft_done=no
4821   # Check whether --with-shadow or --without-shadow was given.
4822 if test "${with_shadow+set}" = set; then
4823   withval="$with_shadow"
4824   with_shadow="$withval"; with_shadow_req="$withval"
4825 else
4826   with_shadow=yes
4827 fi
4828
4829   if test $with_shadow = no; then
4830     passwd_cruft_done=yes
4831   elif test $with_shadow != yes; then
4832     echo "error: must be yes or no: --with-shadow=$with_shadow"
4833     exit 1
4834   fi
4835
4836
4837   # Sun's "adjunct" passwords.
4838   #
4839   if test $passwd_cruft_done = no ; then
4840     echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
4841 echo "configure:4842: checking for Sun-style shadow passwords" >&5
4842 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
4843   echo $ac_n "(cached) $ac_c" 1>&6
4844 else
4845   
4846   ac_save_CPPFLAGS="$CPPFLAGS"
4847   if test \! -z "$includedir" ; then 
4848     CPPFLAGS="$CPPFLAGS -I$includedir"
4849   fi
4850   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4851   cat > conftest.$ac_ext <<EOF
4852 #line 4853 "configure"
4853 #include "confdefs.h"
4854 #include <stdlib.h>
4855                                       #include <unistd.h>
4856                                       #include <sys/types.h>
4857                                       #include <sys/label.h>
4858                                       #include <sys/audit.h>
4859                                       #include <pwdadj.h>
4860 int main() {
4861 struct passwd_adjunct *p = getpwanam("nobody");
4862                          const char *pw = p->pwa_passwd;
4863 ; return 0; }
4864 EOF
4865 if { (eval echo configure:4866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4866   rm -rf conftest*
4867   ac_cv_sun_adjunct=yes
4868 else
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   ac_cv_sun_adjunct=no
4873 fi
4874 rm -f conftest*
4875   CPPFLAGS="$ac_save_CPPFLAGS"
4876 fi
4877
4878 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
4879     if test $ac_cv_sun_adjunct = yes; then
4880       have_shadow=yes
4881       need_setuid=yes
4882       passwd_cruft_done=yes
4883       cat >> confdefs.h <<\EOF
4884 #define HAVE_ADJUNCT_PASSWD 1
4885 EOF
4886
4887     fi
4888   fi
4889
4890   # DEC and SCO so-called "enhanced" security.
4891   #
4892   if test $passwd_cruft_done = no ; then
4893     echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
4894 echo "configure:4895: checking for DEC-style shadow passwords" >&5
4895 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
4896   echo $ac_n "(cached) $ac_c" 1>&6
4897 else
4898   
4899   ac_save_CPPFLAGS="$CPPFLAGS"
4900   if test \! -z "$includedir" ; then 
4901     CPPFLAGS="$CPPFLAGS -I$includedir"
4902   fi
4903   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4904   cat > conftest.$ac_ext <<EOF
4905 #line 4906 "configure"
4906 #include "confdefs.h"
4907 #include <stdlib.h>
4908                                       #include <unistd.h>
4909                                       #include <sys/types.h>
4910                                       #include <pwd.h>
4911                                       #include <sys/security.h>
4912                                       #include <prot.h>
4913 int main() {
4914 struct pr_passwd *p;
4915                          const char *pw;
4916                          set_auth_parameters(0, 0);
4917                          check_auth_parameters();
4918                          p = getprpwnam("nobody");
4919                          pw = p->ufld.fd_encrypt;
4920 ; return 0; }
4921 EOF
4922 if { (eval echo configure:4923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4923   rm -rf conftest*
4924   ac_cv_enhanced_passwd=yes
4925 else
4926   echo "configure: failed program was:" >&5
4927   cat conftest.$ac_ext >&5
4928   rm -rf conftest*
4929   ac_cv_enhanced_passwd=no
4930 fi
4931 rm -f conftest*
4932   CPPFLAGS="$ac_save_CPPFLAGS"
4933 fi
4934
4935 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
4936     if test $ac_cv_enhanced_passwd = yes; then
4937       have_shadow=yes
4938       need_setuid=yes
4939       passwd_cruft_done=yes
4940       cat >> confdefs.h <<\EOF
4941 #define HAVE_ENHANCED_PASSWD 1
4942 EOF
4943
4944
4945       # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
4946       # (I'm told it needs -lcurses too, but I don't understand why.)
4947       echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
4948 echo "configure:4949: checking for getprpwnam in -lprot" >&5
4949 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
4950 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4951   echo $ac_n "(cached) $ac_c" 1>&6
4952 else
4953   ac_save_LIBS="$LIBS"
4954 LIBS="-lprot -lx $LIBS"
4955 cat > conftest.$ac_ext <<EOF
4956 #line 4957 "configure"
4957 #include "confdefs.h"
4958 /* Override any gcc2 internal prototype to avoid an error.  */
4959 /* We use char because int might match the return type of a gcc2
4960     builtin and then its argument prototype would still apply.  */
4961 char getprpwnam();
4962
4963 int main() {
4964 getprpwnam()
4965 ; return 0; }
4966 EOF
4967 if { (eval echo configure:4968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4968   rm -rf conftest*
4969   eval "ac_cv_lib_$ac_lib_var=yes"
4970 else
4971   echo "configure: failed program was:" >&5
4972   cat conftest.$ac_ext >&5
4973   rm -rf conftest*
4974   eval "ac_cv_lib_$ac_lib_var=no"
4975 fi
4976 rm -f conftest*
4977 LIBS="$ac_save_LIBS"
4978
4979 fi
4980 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4981   echo "$ac_t""yes" 1>&6
4982   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
4983 else
4984   echo "$ac_t""no" 1>&6
4985 # On DEC, getprpwnam() is in -lsecurity
4986                     echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
4987 echo "configure:4988: checking for getprpwnam in -lsecurity" >&5
4988 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
4989 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4990   echo $ac_n "(cached) $ac_c" 1>&6
4991 else
4992   ac_save_LIBS="$LIBS"
4993 LIBS="-lsecurity  $LIBS"
4994 cat > conftest.$ac_ext <<EOF
4995 #line 4996 "configure"
4996 #include "confdefs.h"
4997 /* Override any gcc2 internal prototype to avoid an error.  */
4998 /* We use char because int might match the return type of a gcc2
4999     builtin and then its argument prototype would still apply.  */
5000 char getprpwnam();
5001
5002 int main() {
5003 getprpwnam()
5004 ; return 0; }
5005 EOF
5006 if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5007   rm -rf conftest*
5008   eval "ac_cv_lib_$ac_lib_var=yes"
5009 else
5010   echo "configure: failed program was:" >&5
5011   cat conftest.$ac_ext >&5
5012   rm -rf conftest*
5013   eval "ac_cv_lib_$ac_lib_var=no"
5014 fi
5015 rm -f conftest*
5016 LIBS="$ac_save_LIBS"
5017
5018 fi
5019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5020   echo "$ac_t""yes" 1>&6
5021   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
5022 else
5023   echo "$ac_t""no" 1>&6
5024 fi
5025
5026 fi
5027
5028     fi
5029   fi
5030
5031   # HP's entry in the "Not Invented Here" Sweepstakes.
5032   #
5033   if test $passwd_cruft_done = no ; then
5034     echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
5035 echo "configure:5036: checking for HP-style shadow passwords" >&5
5036 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
5037   echo $ac_n "(cached) $ac_c" 1>&6
5038 else
5039   
5040   ac_save_CPPFLAGS="$CPPFLAGS"
5041   if test \! -z "$includedir" ; then 
5042     CPPFLAGS="$CPPFLAGS -I$includedir"
5043   fi
5044   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5045   cat > conftest.$ac_ext <<EOF
5046 #line 5047 "configure"
5047 #include "confdefs.h"
5048 #include <stdlib.h>
5049                                       #include <unistd.h>
5050                                       #include <sys/types.h>
5051                                       #include <pwd.h>
5052                                       #include <hpsecurity.h>
5053                                       #include <prot.h>
5054 int main() {
5055 struct s_passwd *p = getspwnam("nobody");
5056                          const char *pw = p->pw_passwd;
5057 ; return 0; }
5058 EOF
5059 if { (eval echo configure:5060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5060   rm -rf conftest*
5061   ac_cv_hpux_passwd=yes
5062 else
5063   echo "configure: failed program was:" >&5
5064   cat conftest.$ac_ext >&5
5065   rm -rf conftest*
5066   ac_cv_hpux_passwd=no
5067 fi
5068 rm -f conftest*
5069   CPPFLAGS="$ac_save_CPPFLAGS"
5070 fi
5071
5072 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
5073     if test $ac_cv_hpux_passwd = yes; then
5074       have_shadow=yes
5075       need_setuid=yes
5076       passwd_cruft_done=yes
5077       cat >> confdefs.h <<\EOF
5078 #define HAVE_HPUX_PASSWD 1
5079 EOF
5080
5081
5082       # on HPUX, bigcrypt is in -lsec
5083       echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
5084 echo "configure:5085: checking for bigcrypt in -lsec" >&5
5085 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
5086 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5087   echo $ac_n "(cached) $ac_c" 1>&6
5088 else
5089   ac_save_LIBS="$LIBS"
5090 LIBS="-lsec  $LIBS"
5091 cat > conftest.$ac_ext <<EOF
5092 #line 5093 "configure"
5093 #include "confdefs.h"
5094 /* Override any gcc2 internal prototype to avoid an error.  */
5095 /* We use char because int might match the return type of a gcc2
5096     builtin and then its argument prototype would still apply.  */
5097 char bigcrypt();
5098
5099 int main() {
5100 bigcrypt()
5101 ; return 0; }
5102 EOF
5103 if { (eval echo configure:5104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5104   rm -rf conftest*
5105   eval "ac_cv_lib_$ac_lib_var=yes"
5106 else
5107   echo "configure: failed program was:" >&5
5108   cat conftest.$ac_ext >&5
5109   rm -rf conftest*
5110   eval "ac_cv_lib_$ac_lib_var=no"
5111 fi
5112 rm -f conftest*
5113 LIBS="$ac_save_LIBS"
5114
5115 fi
5116 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5117   echo "$ac_t""yes" 1>&6
5118   PASSWD_LIBS="$PASSWD_LIBS -lsec"
5119 else
5120   echo "$ac_t""no" 1>&6
5121 fi
5122
5123     fi
5124   fi
5125
5126   # Traditional (ha!) shadow passwords.
5127   #
5128   if test $passwd_cruft_done = no ; then
5129     echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
5130 echo "configure:5131: checking for generic shadow passwords" >&5
5131 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
5132   echo $ac_n "(cached) $ac_c" 1>&6
5133 else
5134   
5135   ac_save_CPPFLAGS="$CPPFLAGS"
5136   if test \! -z "$includedir" ; then 
5137     CPPFLAGS="$CPPFLAGS -I$includedir"
5138   fi
5139   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5140   cat > conftest.$ac_ext <<EOF
5141 #line 5142 "configure"
5142 #include "confdefs.h"
5143 #include <stdlib.h>
5144                                       #include <unistd.h>
5145                                       #include <sys/types.h>
5146                                       #include <pwd.h>
5147                                       #include <shadow.h>
5148 int main() {
5149 struct spwd *p = getspnam("nobody");
5150                          const char *pw = p->sp_pwdp;
5151 ; return 0; }
5152 EOF
5153 if { (eval echo configure:5154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5154   rm -rf conftest*
5155   ac_cv_shadow=yes
5156 else
5157   echo "configure: failed program was:" >&5
5158   cat conftest.$ac_ext >&5
5159   rm -rf conftest*
5160   ac_cv_shadow=no
5161 fi
5162 rm -f conftest*
5163   CPPFLAGS="$ac_save_CPPFLAGS"
5164 fi
5165
5166 echo "$ac_t""$ac_cv_shadow" 1>&6
5167     if test $ac_cv_shadow = yes; then
5168       have_shadow=yes
5169       need_setuid=yes
5170       passwd_cruft_done=yes
5171       cat >> confdefs.h <<\EOF
5172 #define HAVE_SHADOW_PASSWD 1
5173 EOF
5174
5175
5176       # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
5177       have_getspnam=no
5178       echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
5179 echo "configure:5180: checking for getspnam in -lc" >&5
5180 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
5181 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5182   echo $ac_n "(cached) $ac_c" 1>&6
5183 else
5184   ac_save_LIBS="$LIBS"
5185 LIBS="-lc  $LIBS"
5186 cat > conftest.$ac_ext <<EOF
5187 #line 5188 "configure"
5188 #include "confdefs.h"
5189 /* Override any gcc2 internal prototype to avoid an error.  */
5190 /* We use char because int might match the return type of a gcc2
5191     builtin and then its argument prototype would still apply.  */
5192 char getspnam();
5193
5194 int main() {
5195 getspnam()
5196 ; return 0; }
5197 EOF
5198 if { (eval echo configure:5199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5199   rm -rf conftest*
5200   eval "ac_cv_lib_$ac_lib_var=yes"
5201 else
5202   echo "configure: failed program was:" >&5
5203   cat conftest.$ac_ext >&5
5204   rm -rf conftest*
5205   eval "ac_cv_lib_$ac_lib_var=no"
5206 fi
5207 rm -f conftest*
5208 LIBS="$ac_save_LIBS"
5209
5210 fi
5211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5212   echo "$ac_t""yes" 1>&6
5213   have_getspnam=yes
5214 else
5215   echo "$ac_t""no" 1>&6
5216 fi
5217
5218       if test $have_getspnam = no ; then
5219         echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
5220 echo "configure:5221: checking for getspnam in -lgen" >&5
5221 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
5222 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5223   echo $ac_n "(cached) $ac_c" 1>&6
5224 else
5225   ac_save_LIBS="$LIBS"
5226 LIBS="-lgen  $LIBS"
5227 cat > conftest.$ac_ext <<EOF
5228 #line 5229 "configure"
5229 #include "confdefs.h"
5230 /* Override any gcc2 internal prototype to avoid an error.  */
5231 /* We use char because int might match the return type of a gcc2
5232     builtin and then its argument prototype would still apply.  */
5233 char getspnam();
5234
5235 int main() {
5236 getspnam()
5237 ; return 0; }
5238 EOF
5239 if { (eval echo configure:5240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5240   rm -rf conftest*
5241   eval "ac_cv_lib_$ac_lib_var=yes"
5242 else
5243   echo "configure: failed program was:" >&5
5244   cat conftest.$ac_ext >&5
5245   rm -rf conftest*
5246   eval "ac_cv_lib_$ac_lib_var=no"
5247 fi
5248 rm -f conftest*
5249 LIBS="$ac_save_LIBS"
5250
5251 fi
5252 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5253   echo "$ac_t""yes" 1>&6
5254   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
5255 else
5256   echo "$ac_t""no" 1>&6
5257 fi
5258
5259       fi
5260     fi
5261   fi
5262
5263   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
5264   have_crypt=no
5265   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
5266 echo "configure:5267: checking for crypt in -lc" >&5
5267 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
5268 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5269   echo $ac_n "(cached) $ac_c" 1>&6
5270 else
5271   ac_save_LIBS="$LIBS"
5272 LIBS="-lc  $LIBS"
5273 cat > conftest.$ac_ext <<EOF
5274 #line 5275 "configure"
5275 #include "confdefs.h"
5276 /* Override any gcc2 internal prototype to avoid an error.  */
5277 /* We use char because int might match the return type of a gcc2
5278     builtin and then its argument prototype would still apply.  */
5279 char crypt();
5280
5281 int main() {
5282 crypt()
5283 ; return 0; }
5284 EOF
5285 if { (eval echo configure:5286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5286   rm -rf conftest*
5287   eval "ac_cv_lib_$ac_lib_var=yes"
5288 else
5289   echo "configure: failed program was:" >&5
5290   cat conftest.$ac_ext >&5
5291   rm -rf conftest*
5292   eval "ac_cv_lib_$ac_lib_var=no"
5293 fi
5294 rm -f conftest*
5295 LIBS="$ac_save_LIBS"
5296
5297 fi
5298 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5299   echo "$ac_t""yes" 1>&6
5300   have_crypt=yes
5301 else
5302   echo "$ac_t""no" 1>&6
5303 fi
5304
5305   if test $have_crypt = no ; then
5306     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
5307 echo "configure:5308: checking for crypt in -lcrypt" >&5
5308 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
5309 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5310   echo $ac_n "(cached) $ac_c" 1>&6
5311 else
5312   ac_save_LIBS="$LIBS"
5313 LIBS="-lcrypt  $LIBS"
5314 cat > conftest.$ac_ext <<EOF
5315 #line 5316 "configure"
5316 #include "confdefs.h"
5317 /* Override any gcc2 internal prototype to avoid an error.  */
5318 /* We use char because int might match the return type of a gcc2
5319     builtin and then its argument prototype would still apply.  */
5320 char crypt();
5321
5322 int main() {
5323 crypt()
5324 ; return 0; }
5325 EOF
5326 if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5327   rm -rf conftest*
5328   eval "ac_cv_lib_$ac_lib_var=yes"
5329 else
5330   echo "configure: failed program was:" >&5
5331   cat conftest.$ac_ext >&5
5332   rm -rf conftest*
5333   eval "ac_cv_lib_$ac_lib_var=no"
5334 fi
5335 rm -f conftest*
5336 LIBS="$ac_save_LIBS"
5337
5338 fi
5339 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5340   echo "$ac_t""yes" 1>&6
5341   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
5342 else
5343   echo "$ac_t""no" 1>&6
5344 fi
5345
5346   fi
5347
5348
5349   # Most of the above shadow mechanisms will have set need_setuid to yes,
5350   # if they were found.  But, on some systems, we need setuid even when
5351   # using plain old vanilla passwords.
5352   #
5353   if test $need_setuid = no ; then
5354     case "$host" in
5355       *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
5356         need_setuid=yes
5357       ;;
5358     esac
5359   fi
5360
5361 elif test $enable_locking = no; then
5362   cat >> confdefs.h <<\EOF
5363 #define NO_LOCKING 1
5364 EOF
5365
5366 else
5367   echo "error: must be yes or no: --enable-locking=$enable_locking"
5368   exit 1
5369 fi
5370
5371
5372
5373 if test \! -z "$includedir" ; then 
5374   INCLUDES="-I$includedir"
5375 fi
5376
5377 if test \! -z "$libdir" ; then
5378   LDFLAGS="$LDFLAGS -L$libdir"
5379 fi
5380
5381
5382 ##### should have options to override the DEPEND crap, I guess...
5383 DEPEND=makedepend
5384 DEPEND_FLAGS=
5385 DEPEND_DEFINES=
5386
5387
5388
5389 # Done testing things -- now substitute in some stuff for the Makefiles.
5390 #
5391 if test $have_motif = yes; then
5392   cat >> confdefs.h <<\EOF
5393 #define HAVE_MOTIF 1
5394 EOF
5395
5396   DIALOG_SRCS='$(MOTIF_SRCS)'
5397   DIALOG_OBJS='$(MOTIF_OBJS)'
5398 elif test $have_athena = yes; then
5399   cat >> confdefs.h <<\EOF
5400 #define HAVE_ATHENA 1
5401 EOF
5402
5403   DIALOG_SRCS='$(ATHENA_SRCS)'
5404   DIALOG_OBJS='$(ATHENA_OBJS)'
5405 else
5406   DIALOG_SRCS=''
5407   DIALOG_OBJS=''
5408 fi
5409
5410 if test $have_kerberos = yes; then
5411   PASSWD_SRCS='$(KERBEROS_SRCS)'
5412   PASSWD_OBJS='$(KERBEROS_OBJS)'
5413 else
5414   PASSWD_SRCS='$(PWENT_SRCS)'
5415   PASSWD_OBJS='$(PWENT_OBJS)'
5416 fi
5417
5418 if test $enable_locking = yes; then
5419   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
5420   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
5421 else
5422   LOCK_SRCS=''
5423   LOCK_OBJS=''
5424 fi
5425
5426 if test $need_setuid = yes; then
5427   NEED_SETUID=yes
5428   INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
5429 else
5430   NEED_SETUID=no
5431   INSTALL_SETUID='$(INSTALL_PROGRAM)'
5432 fi
5433
5434 tab='   '
5435 if test $have_gl = yes; then
5436   GL_EXES='$(GL_EXES)'
5437   GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'  \'
5438   GL_KLUDGE_2=${tab}
5439 else
5440   GL_KLUDGE_1=${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}${tab}'\n'
5441   GL_KLUDGE_2='!'${tab}
5442 fi
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474 # Print some warnings before emitting the Makefiles.
5475 #
5476 warning=no
5477 warnsep='    #################################################################'
5478 warnpre() {
5479   if test $warning = no ; then
5480     echo '' ; echo "$warnsep" ; echo ''
5481     warning=yes
5482   fi
5483 }
5484
5485 warn() {
5486   warnpre
5487   if test $warning = long ; then echo '' ; fi
5488   warning=yes
5489   echo "    Warning: $@"
5490 }
5491
5492 warnL() {
5493   was=$warning
5494   warnpre
5495   warning=yes
5496   if test $was != no ; then echo '' ; fi
5497   echo "    Warning: $@"
5498 }
5499
5500 warn2() {
5501   echo "             $@"
5502   warning=long
5503 }
5504
5505 if test $with_sgi_req = yes -a $have_sgi = no ; then
5506   warn 'The SGI saver extension was requested, but was not found.'
5507 fi
5508
5509 if test $with_mit_req = yes -a $have_mit = no ; then
5510   warn 'The MIT saver extension was requested, but was not found.'
5511 fi
5512
5513 if test $with_xidle_req = yes -a $have_xidle = no ; then
5514   warn 'The XIdle extension was requested, but was not found.'
5515 fi
5516
5517 if test $with_xshm_req = yes -a $have_xshm = no ; then
5518   warn 'The XSHM extension was requested, but was not found.'
5519 fi
5520
5521 if test $with_sgivc_req = yes -a $have_sgivc = no ; then
5522   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
5523 fi
5524
5525 if test $have_motif = no -a $have_athena = no ; then
5526   warnL "Neither Motif nor Athena widgets seem to be available;"
5527   warn2 "one or the other is required."
5528   proselytize_motif=no
5529
5530 elif test $with_motif_req = yes -a $have_motif = no ; then
5531   warnL "Use of Motif was requested, but it wasn't found;"
5532   warn2 "Athena will be used instead."
5533
5534 elif test $with_athena_req = yes -a $have_athena = no ; then
5535   warnL "Use of Athena was requested, but it wasn't found;"
5536   warn2 "Motif will be used instead."
5537 fi
5538
5539 if test $have_motif = yes -a $have_lesstif = yes ; then
5540   if test $good_lesstif != yes ; then
5541     warnL "Motif is being used, but it appears to actually be"
5542     warn2 "LessTif, and the version number is less than 0.82!"
5543     warn2 "Such old versions of LessTif are too buggy to use"
5544     warn2 "with XScreenSaver; it is strongly recommended that"
5545     warn2 "you upgrade!  See <http://www.lesstif.org/>."
5546   fi
5547 fi
5548
5549 if test $proselytize_motif = yes ; then
5550     warnL "Athena widgets are being used instead of Motif."
5551     warn2 "XScreenSaver looks much better with Motif, and has"
5552     warn2 "a few extra features as well.  Wouldn't you rather"
5553     warn2 "be using Motif?  It is shipped by every commercial"
5554     warn2 "Unix vendor; and there is a free implementation"
5555     warn2 "available as well: see <http://www.lesstif.org/>."
5556 fi
5557
5558 if test $with_xpm_req = yes -a $have_xpm = no ; then
5559   warn 'Use of XPM was requested, but it was not found.'
5560 fi
5561
5562 if test $with_gl_req = yes -a $have_gl = no ; then
5563   warn 'Use of GL was requested, but it was not found.'
5564 fi
5565
5566 if test $with_readdisplay_req = yes -a $have_readdisplay = no ; then
5567   warn 'Use of XReadDisplay was requested, but it was not found.'
5568 fi
5569
5570 if test $with_sgivideo_req = yes -a $have_sgivideo = no ; then
5571   warn 'Use of the Iris Video Library was requested, but it was not found.'
5572 fi
5573
5574 if test $with_kerberos_req = yes -a $have_kerberos = no ; then
5575   warn 'Use of Kerberos was requested, but it was not found.'
5576 fi
5577
5578 if test $with_shadow_req = yes -a $have_shadow = no ; then
5579   warn 'Use of shadow passwords was requested, but they were not found.'
5580 fi
5581
5582 if test -n "$with_zippy_req"; then
5583   if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
5584     warnL "$with_zippy_req was requested as the Zippy program,"
5585     warn2 "but was not found.  The default will be used instead."
5586   fi
5587 fi
5588
5589 if test $warning != no; then
5590   echo '' ; echo "$warnsep" ; echo ''
5591 fi
5592
5593
5594 trap '' 1 2 15
5595 cat > confcache <<\EOF
5596 # This file is a shell script that caches the results of configure
5597 # tests run on this system so they can be shared between configure
5598 # scripts and configure runs.  It is not useful on other systems.
5599 # If it contains results you don't want to keep, you may remove or edit it.
5600 #
5601 # By default, configure uses ./config.cache as the cache file,
5602 # creating it if it does not exist already.  You can give configure
5603 # the --cache-file=FILE option to use a different cache file; that is
5604 # what configure does when it calls configure scripts in
5605 # subdirectories, so they share the cache.
5606 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5607 # config.status only pays attention to the cache file if you give it the
5608 # --recheck option to rerun configure.
5609 #
5610 EOF
5611 # The following way of writing the cache mishandles newlines in values,
5612 # but we know of no workaround that is simple, portable, and efficient.
5613 # So, don't put newlines in cache variables' values.
5614 # Ultrix sh set writes to stderr and can't be redirected directly,
5615 # and sets the high bit in the cache file unless we assign to the vars.
5616 (set) 2>&1 |
5617   case `(ac_space=' '; set) 2>&1` in
5618   *ac_space=\ *)
5619     # `set' does not quote correctly, so add quotes (double-quote substitution
5620     # turns \\\\ into \\, and sed turns \\ into \).
5621     sed -n \
5622       -e "s/'/'\\\\''/g" \
5623       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5624     ;;
5625   *)
5626     # `set' quotes correctly as required by POSIX, so do not add quotes.
5627     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5628     ;;
5629   esac >> confcache
5630 if cmp -s $cache_file confcache; then
5631   :
5632 else
5633   if test -w $cache_file; then
5634     echo "updating cache $cache_file"
5635     cat confcache > $cache_file
5636   else
5637     echo "not updating unwritable cache $cache_file"
5638   fi
5639 fi
5640 rm -f confcache
5641
5642 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5643
5644 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5645 # Let make expand exec_prefix.
5646 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5647
5648 # Any assignment to VPATH causes Sun make to only execute
5649 # the first set of double-colon rules, so remove it if not needed.
5650 # If there is a colon in the path, we need to keep it.
5651 if test "x$srcdir" = x.; then
5652   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5653 fi
5654
5655 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5656
5657 DEFS=-DHAVE_CONFIG_H
5658
5659 # Without the "./", some shells look in PATH for config.status.
5660 : ${CONFIG_STATUS=./config.status}
5661
5662 echo creating $CONFIG_STATUS
5663 rm -f $CONFIG_STATUS
5664 cat > $CONFIG_STATUS <<EOF
5665 #! /bin/sh
5666 # Generated automatically by configure.
5667 # Run this file to recreate the current configuration.
5668 # This directory was configured as follows,
5669 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5670 #
5671 # $0 $ac_configure_args
5672 #
5673 # Compiler output produced by configure, useful for debugging
5674 # configure, is in ./config.log if it exists.
5675
5676 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5677 for ac_option
5678 do
5679   case "\$ac_option" in
5680   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5681     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5682     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5683   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5684     echo "$CONFIG_STATUS generated by autoconf version 2.12"
5685     exit 0 ;;
5686   -help | --help | --hel | --he | --h)
5687     echo "\$ac_cs_usage"; exit 0 ;;
5688   *) echo "\$ac_cs_usage"; exit 1 ;;
5689   esac
5690 done
5691
5692 ac_given_srcdir=$srcdir
5693 ac_given_INSTALL="$INSTALL"
5694
5695 trap 'rm -fr `echo "Makefile
5696           utils/Makefile
5697           driver/Makefile
5698           hacks/Makefile
5699           hacks/glx/Makefile
5700           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5701 EOF
5702 cat >> $CONFIG_STATUS <<EOF
5703
5704 # Protect against being on the right side of a sed subst in config.status.
5705 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5706  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5707 $ac_vpsub
5708 $extrasub
5709 s%@CFLAGS@%$CFLAGS%g
5710 s%@CPPFLAGS@%$CPPFLAGS%g
5711 s%@CXXFLAGS@%$CXXFLAGS%g
5712 s%@DEFS@%$DEFS%g
5713 s%@LDFLAGS@%$LDFLAGS%g
5714 s%@LIBS@%$LIBS%g
5715 s%@exec_prefix@%$exec_prefix%g
5716 s%@prefix@%$prefix%g
5717 s%@program_transform_name@%$program_transform_name%g
5718 s%@bindir@%$bindir%g
5719 s%@sbindir@%$sbindir%g
5720 s%@libexecdir@%$libexecdir%g
5721 s%@datadir@%$datadir%g
5722 s%@sysconfdir@%$sysconfdir%g
5723 s%@sharedstatedir@%$sharedstatedir%g
5724 s%@localstatedir@%$localstatedir%g
5725 s%@libdir@%$libdir%g
5726 s%@includedir@%$includedir%g
5727 s%@oldincludedir@%$oldincludedir%g
5728 s%@infodir@%$infodir%g
5729 s%@mandir@%$mandir%g
5730 s%@host@%$host%g
5731 s%@host_alias@%$host_alias%g
5732 s%@host_cpu@%$host_cpu%g
5733 s%@host_vendor@%$host_vendor%g
5734 s%@host_os@%$host_os%g
5735 s%@CC@%$CC%g
5736 s%@CPP@%$CPP%g
5737 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5738 s%@INSTALL_DATA@%$INSTALL_DATA%g
5739 s%@SET_MAKE@%$SET_MAKE%g
5740 s%@X_CFLAGS@%$X_CFLAGS%g
5741 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
5742 s%@X_LIBS@%$X_LIBS%g
5743 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
5744 s%@zip2@%$zip2%g
5745 s%@emacs_exe@%$emacs_exe%g
5746 s%@xemacs_exe@%$xemacs_exe%g
5747 s%@fortune@%$fortune%g
5748 s%@INCLUDES@%$INCLUDES%g
5749 s%@SAVER_LIBS@%$SAVER_LIBS%g
5750 s%@HACK_LIBS@%$HACK_LIBS%g
5751 s%@XPM_LIBS@%$XPM_LIBS%g
5752 s%@GL_LIBS@%$GL_LIBS%g
5753 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
5754 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
5755 s%@NEED_SETUID@%$NEED_SETUID%g
5756 s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
5757 s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
5758 s%@DIALOG_SRCS@%$DIALOG_SRCS%g
5759 s%@DIALOG_OBJS@%$DIALOG_OBJS%g
5760 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
5761 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
5762 s%@XMU_SRCS@%$XMU_SRCS%g
5763 s%@XMU_OBJS@%$XMU_OBJS%g
5764 s%@LOCK_SRCS@%$LOCK_SRCS%g
5765 s%@LOCK_OBJS@%$LOCK_OBJS%g
5766 s%@GL_EXES@%$GL_EXES%g
5767 s%@GL_KLUDGE_1@%$GL_KLUDGE_1%g
5768 s%@GL_KLUDGE_2@%$GL_KLUDGE_2%g
5769 s%@HACKDIR@%$HACKDIR%g
5770 s%@APPDEFAULTS@%$APPDEFAULTS%g
5771 s%@DEPEND@%$DEPEND%g
5772 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
5773 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
5774
5775 CEOF
5776 EOF
5777
5778 cat >> $CONFIG_STATUS <<\EOF
5779
5780 # Split the substitutions into bite-sized pieces for seds with
5781 # small command number limits, like on Digital OSF/1 and HP-UX.
5782 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5783 ac_file=1 # Number of current file.
5784 ac_beg=1 # First line for current file.
5785 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5786 ac_more_lines=:
5787 ac_sed_cmds=""
5788 while $ac_more_lines; do
5789   if test $ac_beg -gt 1; then
5790     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5791   else
5792     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5793   fi
5794   if test ! -s conftest.s$ac_file; then
5795     ac_more_lines=false
5796     rm -f conftest.s$ac_file
5797   else
5798     if test -z "$ac_sed_cmds"; then
5799       ac_sed_cmds="sed -f conftest.s$ac_file"
5800     else
5801       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5802     fi
5803     ac_file=`expr $ac_file + 1`
5804     ac_beg=$ac_end
5805     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5806   fi
5807 done
5808 if test -z "$ac_sed_cmds"; then
5809   ac_sed_cmds=cat
5810 fi
5811 EOF
5812
5813 cat >> $CONFIG_STATUS <<EOF
5814
5815 CONFIG_FILES=\${CONFIG_FILES-"Makefile
5816           utils/Makefile
5817           driver/Makefile
5818           hacks/Makefile
5819           hacks/glx/Makefile
5820           driver/XScreenSaver.ad"}
5821 EOF
5822 cat >> $CONFIG_STATUS <<\EOF
5823 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5824   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5825   case "$ac_file" in
5826   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5827        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5828   *) ac_file_in="${ac_file}.in" ;;
5829   esac
5830
5831   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5832
5833   # Remove last slash and all that follows it.  Not all systems have dirname.
5834   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5835   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5836     # The file is in a subdirectory.
5837     test ! -d "$ac_dir" && mkdir "$ac_dir"
5838     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5839     # A "../" for each directory in $ac_dir_suffix.
5840     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5841   else
5842     ac_dir_suffix= ac_dots=
5843   fi
5844
5845   case "$ac_given_srcdir" in
5846   .)  srcdir=.
5847       if test -z "$ac_dots"; then top_srcdir=.
5848       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5849   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5850   *) # Relative path.
5851     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5852     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5853   esac
5854
5855   case "$ac_given_INSTALL" in
5856   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5857   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5858   esac
5859
5860   echo creating "$ac_file"
5861   rm -f "$ac_file"
5862   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5863   case "$ac_file" in
5864   *Makefile*) ac_comsub="1i\\
5865 # $configure_input" ;;
5866   *) ac_comsub= ;;
5867   esac
5868
5869   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5870   sed -e "$ac_comsub
5871 s%@configure_input@%$configure_input%g
5872 s%@srcdir@%$srcdir%g
5873 s%@top_srcdir@%$top_srcdir%g
5874 s%@INSTALL@%$INSTALL%g
5875 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5876 fi; done
5877 rm -f conftest.s*
5878
5879 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5880 # NAME is the cpp macro being defined and VALUE is the value it is being given.
5881 #
5882 # ac_d sets the value in "#define NAME VALUE" lines.
5883 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5884 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5885 ac_dC='\3'
5886 ac_dD='%g'
5887 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5888 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5889 ac_uB='\([      ]\)%\1#\2define\3'
5890 ac_uC=' '
5891 ac_uD='\4%g'
5892 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5893 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5894 ac_eB='$%\1#\2define\3'
5895 ac_eC=' '
5896 ac_eD='%g'
5897
5898 if test "${CONFIG_HEADERS+set}" != set; then
5899 EOF
5900 cat >> $CONFIG_STATUS <<EOF
5901   CONFIG_HEADERS="config.h"
5902 EOF
5903 cat >> $CONFIG_STATUS <<\EOF
5904 fi
5905 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5906   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5907   case "$ac_file" in
5908   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5909        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5910   *) ac_file_in="${ac_file}.in" ;;
5911   esac
5912
5913   echo creating $ac_file
5914
5915   rm -f conftest.frag conftest.in conftest.out
5916   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5917   cat $ac_file_inputs > conftest.in
5918
5919 EOF
5920
5921 # Transform confdefs.h into a sed script conftest.vals that substitutes
5922 # the proper values into config.h.in to produce config.h.  And first:
5923 # Protect against being on the right side of a sed subst in config.status.
5924 # Protect against being in an unquoted here document in config.status.
5925 rm -f conftest.vals
5926 cat > conftest.hdr <<\EOF
5927 s/[\\&%]/\\&/g
5928 s%[\\$`]%\\&%g
5929 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5930 s%ac_d%ac_u%gp
5931 s%ac_u%ac_e%gp
5932 EOF
5933 sed -n -f conftest.hdr confdefs.h > conftest.vals
5934 rm -f conftest.hdr
5935
5936 # This sed command replaces #undef with comments.  This is necessary, for
5937 # example, in the case of _POSIX_SOURCE, which is predefined and required
5938 # on some systems where configure will not decide to define it.
5939 cat >> conftest.vals <<\EOF
5940 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5941 EOF
5942
5943 # Break up conftest.vals because some shells have a limit on
5944 # the size of here documents, and old seds have small limits too.
5945
5946 rm -f conftest.tail
5947 while :
5948 do
5949   ac_lines=`grep -c . conftest.vals`
5950   # grep -c gives empty output for an empty file on some AIX systems.
5951   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5952   # Write a limited-size here document to conftest.frag.
5953   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
5954   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5955   echo 'CEOF
5956   sed -f conftest.frag conftest.in > conftest.out
5957   rm -f conftest.in
5958   mv conftest.out conftest.in
5959 ' >> $CONFIG_STATUS
5960   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5961   rm -f conftest.vals
5962   mv conftest.tail conftest.vals
5963 done
5964 rm -f conftest.vals
5965
5966 cat >> $CONFIG_STATUS <<\EOF
5967   rm -f conftest.frag conftest.h
5968   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5969   cat conftest.in >> conftest.h
5970   rm -f conftest.in
5971   if cmp -s $ac_file conftest.h 2>/dev/null; then
5972     echo "$ac_file is unchanged"
5973     rm -f conftest.h
5974   else
5975     # Remove last slash and all that follows it.  Not all systems have dirname.
5976       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5977       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5978       # The file is in a subdirectory.
5979       test ! -d "$ac_dir" && mkdir "$ac_dir"
5980     fi
5981     rm -f $ac_file
5982     mv conftest.h $ac_file
5983   fi
5984 fi; done
5985
5986 EOF
5987 cat >> $CONFIG_STATUS <<EOF
5988
5989 EOF
5990 cat >> $CONFIG_STATUS <<\EOF
5991
5992 exit 0
5993 EOF
5994 chmod +x $CONFIG_STATUS
5995 rm -fr confdefs* $ac_clean_files
5996 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5997