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