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