http://apple.doit.wisc.edu/mirrors/amug/linux/linuxppc/sources/tarballs/xscreensaver...
[xscreensaver] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
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 --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 Except where noted, all of the --with options below can also take a
30 directory argument: for example, --with-motif=/opt/Motif.  That would
31 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
32 to be added to the -L list, assuming those directories exist.
33
34 X Server Extension options:
35
36   --with-sgi-ext          Include support for the SGI SCREEN_SAVER
37                           server extension, if possible (this is the default).
38   --without-sgi-ext       Do not compile in support for this extension."
39 ac_help="$ac_help
40   --with-mit-ext          Include support for the MIT-SCREEN-SAVER
41                           server extension, if possible (this is the default).
42   --without-mit-ext       Do not compile in support for this extension."
43 ac_help="$ac_help
44   --with-xidle-ext        Include support for the XIDLE server extension,
45                           if possible (this is the default).
46   --without-xidle-ext     Do not compile in support for this extension."
47 ac_help="$ac_help
48   --with-xshm-ext         Include support for the XSHM (Shared Memory) server
49                           extension, if possible (this is the default).
50   --without-xshm-ext      Do not compile in support for this extension."
51 ac_help="$ac_help
52   --with-xdbe-ext         Include support for the DOUBLE-BUFFER server
53                           extension, if possible (this is the default).
54   --without-xdbe-ext      Do not compile in support for this extension."
55 ac_help="$ac_help
56   --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL server
57                           extension, if possible (this is the default).
58   --without-sgivc-ext     Do not compile in support for this extension."
59 ac_help="$ac_help
60   --with-dpms-ext         Include support for the DPMS server extension,
61                           if possible (this is the default).
62   --without-dpms-ext      Do not compile in support for this extension."
63 ac_help="$ac_help
64   --with-xf86vmode-ext    Include support for XFree86 virtual screens, if
65                           possible (this is the default).
66   --without-xf86vmode-ext Do not compile in support for this extension."
67 ac_help="$ac_help
68   --with-proc-interrupts  Include support for consulting the /proc/interrupts
69                           file to notice keyboard activity, if possible.
70   --without-proc-interrupts   Do not compile in support for this method."
71 ac_help="$ac_help
72
73 X Client Toolkit options:
74
75   --with-motif            Use the Motif toolkit for the user interface, if
76                           possible (this is the default).
77   --without-motif         Do not use Motif."
78 ac_help="$ac_help
79   --with-athena           Use the Athena toolkit for the user interface, if
80                           possible (this is the default if Motif isn't used.)
81   --without-athena        Do not use Athena."
82 ac_help="$ac_help
83
84 Graphics Demo options:
85
86   --with-xpm              Include support for XPM files in some demos,
87                           if possible (this is the default).
88   --without-xpm           Do not compile in support for XPM files."
89 ac_help="$ac_help
90   --with-gl               Build those demos which depend on OpenGL,
91                           if possible (this is the default).
92   --without-gl            Do not build the OpenGL demos."
93 ac_help="$ac_help
94   --with-readdisplay      Include support for the XReadDisplay server
95                           extension if possible (this is the default).
96   --without-readdisplay   Do not compile in support for this extension."
97 ac_help="$ac_help
98   --with-sgivideo         Include support for SGI's Iris Video Library
99                           if possible (this is the default).
100   --without-sgivideo       Do not compile in support for this library."
101 ac_help="$ac_help
102   --with-zippy=PROGRAM    Some demos are able to run an external program and
103                           display its text; this names the program to use by
104                           default (though it can be overridden with X
105                           resources.)  If you don't specify this, the default
106                           is to use \"yow\" from the Emacs distribution (if you
107                           have it) or else to use \"fortune\"."
108 ac_help="$ac_help
109
110 Screen Locking options:
111
112   --enable-locking        Compile in support for locking the display
113                           (this is the default.)
114   --disable-locking       Do not allow locking at all."
115 ac_help="$ac_help
116
117   --enable-vt-locking     Compile in support for locking Virtual Terminals.
118                           This is the default if the system supports it, and
119                           if locking support is included (--enable-locking.)
120   --disable-vt-locking    Do not allow locking of VTs, even if locking is
121                           enabled."
122 ac_help="$ac_help
123
124   --with-kerberos         Include support for Kerberos authentication,
125                           if possible (this is the default.)
126   --without-kerberos      Do not compile in support for Kerberos."
127 ac_help="$ac_help
128   --with-pam              Include support for PAM (Pluggable Authentication
129                           Modules) if possible (this is the default.)
130   --without-pam           Do not compile in support for PAM."
131 ac_help="$ac_help
132   --with-shadow           Include support for shadow password authentication,
133                           if possible (this is the default, if no Kerberos or
134                           PAM.)
135   --without-shadow        Do not compile in support for shadow passwords.
136 "
137
138 # Initialize some variables set by options.
139 # The variables have the same names as the options, with
140 # dashes changed to underlines.
141 build=NONE
142 cache_file=./config.cache
143 exec_prefix=NONE
144 host=NONE
145 no_create=
146 nonopt=NONE
147 no_recursion=
148 prefix=NONE
149 program_prefix=NONE
150 program_suffix=NONE
151 program_transform_name=s,x,x,
152 silent=
153 site=
154 srcdir=
155 target=NONE
156 verbose=
157 x_includes=NONE
158 x_libraries=NONE
159 bindir='${exec_prefix}/bin'
160 sbindir='${exec_prefix}/sbin'
161 libexecdir='${exec_prefix}/libexec'
162 datadir='${prefix}/share'
163 sysconfdir='${prefix}/etc'
164 sharedstatedir='${prefix}/com'
165 localstatedir='${prefix}/var'
166 libdir='${exec_prefix}/lib'
167 includedir='${prefix}/include'
168 oldincludedir='/usr/include'
169 infodir='${prefix}/info'
170 mandir='${prefix}/man'
171
172 # Initialize some other variables.
173 subdirs=
174 MFLAGS= MAKEFLAGS=
175 SHELL=${CONFIG_SHELL-/bin/sh}
176 # Maximum number of lines to put in a shell here document.
177 ac_max_here_lines=12
178
179 ac_prev=
180 for ac_option
181 do
182
183   # If the previous option needs an argument, assign it.
184   if test -n "$ac_prev"; then
185     eval "$ac_prev=\$ac_option"
186     ac_prev=
187     continue
188   fi
189
190   case "$ac_option" in
191   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
192   *) ac_optarg= ;;
193   esac
194
195   # Accept the important Cygnus configure options, so we can diagnose typos.
196
197   case "$ac_option" in
198
199   -bindir | --bindir | --bindi | --bind | --bin | --bi)
200     ac_prev=bindir ;;
201   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
202     bindir="$ac_optarg" ;;
203
204   -build | --build | --buil | --bui | --bu)
205     ac_prev=build ;;
206   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
207     build="$ac_optarg" ;;
208
209   -cache-file | --cache-file | --cache-fil | --cache-fi \
210   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
211     ac_prev=cache_file ;;
212   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
213   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
214     cache_file="$ac_optarg" ;;
215
216   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
217     ac_prev=datadir ;;
218   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
219   | --da=*)
220     datadir="$ac_optarg" ;;
221
222   -disable-* | --disable-*)
223     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
224     # Reject names that are not valid shell variable names.
225     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
226       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
227     fi
228     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
229     eval "enable_${ac_feature}=no" ;;
230
231   -enable-* | --enable-*)
232     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
233     # Reject names that are not valid shell variable names.
234     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
235       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
236     fi
237     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
238     case "$ac_option" in
239       *=*) ;;
240       *) ac_optarg=yes ;;
241     esac
242     eval "enable_${ac_feature}='$ac_optarg'" ;;
243
244   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
245   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
246   | --exec | --exe | --ex)
247     ac_prev=exec_prefix ;;
248   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
249   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
250   | --exec=* | --exe=* | --ex=*)
251     exec_prefix="$ac_optarg" ;;
252
253   -gas | --gas | --ga | --g)
254     # Obsolete; use --with-gas.
255     with_gas=yes ;;
256
257   -help | --help | --hel | --he)
258     # Omit some internal or obsolete options to make the list less imposing.
259     # This message is too long to be a string in the A/UX 3.1 sh.
260     cat << EOF
261 Usage: configure [options] [host]
262 Options: [defaults in brackets after descriptions]
263
264 Configuration:
265
266   --cache-file=FILE       cache test results in FILE
267   --help                  print this message
268   --no-create             do not create output files
269   --quiet, --silent       do not print \`checking...' messages
270   --version               print the version of autoconf that created configure
271
272 Directory and file names:
273
274   --prefix=PREFIX         install architecture-independent files in PREFIX
275                           [$ac_default_prefix]
276   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
277                           [same as prefix]
278   --bindir=DIR            user executables in DIR [EPREFIX/bin]
279   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
280   --includedir=DIR        C header files in DIR [PREFIX/include]
281   --x-includes=DIR        X include files are in DIR
282   --x-libraries=DIR       X library files are in DIR
283   --mandir=DIR            man documentation in DIR [PREFIX/man]
284   --srcdir=DIR            find the sources in DIR [configure dir or ..]
285   --program-prefix=PREFIX prepend PREFIX to installed program names
286   --program-suffix=SUFFIX append SUFFIX to installed program names
287   --program-transform-name=PROGRAM
288                           run sed PROGRAM on installed program names
289 EOF
290     cat << EOF
291
292 Host type:
293
294   --build=BUILD           configure for building on BUILD [BUILD=HOST]
295   --host=HOST             configure for HOST [guessed]
296   --target=TARGET         configure for TARGET [TARGET=HOST]
297 EOF
298     if test -n "$ac_help"; then
299       echo "$ac_help"
300     fi
301     exit 0 ;;
302
303   -host | --host | --hos | --ho)
304     ac_prev=host ;;
305   -host=* | --host=* | --hos=* | --ho=*)
306     host="$ac_optarg" ;;
307
308   -includedir | --includedir | --includedi | --included | --include \
309   | --includ | --inclu | --incl | --inc)
310     ac_prev=includedir ;;
311   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
312   | --includ=* | --inclu=* | --incl=* | --inc=*)
313     includedir="$ac_optarg" ;;
314
315   -infodir | --infodir | --infodi | --infod | --info | --inf)
316     ac_prev=infodir ;;
317   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
318     infodir="$ac_optarg" ;;
319
320   -libdir | --libdir | --libdi | --libd)
321     ac_prev=libdir ;;
322   -libdir=* | --libdir=* | --libdi=* | --libd=*)
323     libdir="$ac_optarg" ;;
324
325   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
326   | --libexe | --libex | --libe)
327     ac_prev=libexecdir ;;
328   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
329   | --libexe=* | --libex=* | --libe=*)
330     libexecdir="$ac_optarg" ;;
331
332   -localstatedir | --localstatedir | --localstatedi | --localstated \
333   | --localstate | --localstat | --localsta | --localst \
334   | --locals | --local | --loca | --loc | --lo)
335     ac_prev=localstatedir ;;
336   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
337   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
338   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
339     localstatedir="$ac_optarg" ;;
340
341   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
342     ac_prev=mandir ;;
343   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
344     mandir="$ac_optarg" ;;
345
346   -nfp | --nfp | --nf)
347     # Obsolete; use --without-fp.
348     with_fp=no ;;
349
350   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
351   | --no-cr | --no-c)
352     no_create=yes ;;
353
354   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
355   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
356     no_recursion=yes ;;
357
358   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
359   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
360   | --oldin | --oldi | --old | --ol | --o)
361     ac_prev=oldincludedir ;;
362   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
363   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
364   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
365     oldincludedir="$ac_optarg" ;;
366
367   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
368     ac_prev=prefix ;;
369   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
370     prefix="$ac_optarg" ;;
371
372   -program-prefix | --program-prefix | --program-prefi | --program-pref \
373   | --program-pre | --program-pr | --program-p)
374     ac_prev=program_prefix ;;
375   -program-prefix=* | --program-prefix=* | --program-prefi=* \
376   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
377     program_prefix="$ac_optarg" ;;
378
379   -program-suffix | --program-suffix | --program-suffi | --program-suff \
380   | --program-suf | --program-su | --program-s)
381     ac_prev=program_suffix ;;
382   -program-suffix=* | --program-suffix=* | --program-suffi=* \
383   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
384     program_suffix="$ac_optarg" ;;
385
386   -program-transform-name | --program-transform-name \
387   | --program-transform-nam | --program-transform-na \
388   | --program-transform-n | --program-transform- \
389   | --program-transform | --program-transfor \
390   | --program-transfo | --program-transf \
391   | --program-trans | --program-tran \
392   | --progr-tra | --program-tr | --program-t)
393     ac_prev=program_transform_name ;;
394   -program-transform-name=* | --program-transform-name=* \
395   | --program-transform-nam=* | --program-transform-na=* \
396   | --program-transform-n=* | --program-transform-=* \
397   | --program-transform=* | --program-transfor=* \
398   | --program-transfo=* | --program-transf=* \
399   | --program-trans=* | --program-tran=* \
400   | --progr-tra=* | --program-tr=* | --program-t=*)
401     program_transform_name="$ac_optarg" ;;
402
403   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
404   | -silent | --silent | --silen | --sile | --sil)
405     silent=yes ;;
406
407   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
408     ac_prev=sbindir ;;
409   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
410   | --sbi=* | --sb=*)
411     sbindir="$ac_optarg" ;;
412
413   -sharedstatedir | --sharedstatedir | --sharedstatedi \
414   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
415   | --sharedst | --shareds | --shared | --share | --shar \
416   | --sha | --sh)
417     ac_prev=sharedstatedir ;;
418   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
419   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
420   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
421   | --sha=* | --sh=*)
422     sharedstatedir="$ac_optarg" ;;
423
424   -site | --site | --sit)
425     ac_prev=site ;;
426   -site=* | --site=* | --sit=*)
427     site="$ac_optarg" ;;
428
429   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
430     ac_prev=srcdir ;;
431   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
432     srcdir="$ac_optarg" ;;
433
434   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
435   | --syscon | --sysco | --sysc | --sys | --sy)
436     ac_prev=sysconfdir ;;
437   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
438   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
439     sysconfdir="$ac_optarg" ;;
440
441   -target | --target | --targe | --targ | --tar | --ta | --t)
442     ac_prev=target ;;
443   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
444     target="$ac_optarg" ;;
445
446   -v | -verbose | --verbose | --verbos | --verbo | --verb)
447     verbose=yes ;;
448
449   -version | --version | --versio | --versi | --vers)
450     echo "configure generated by autoconf version 2.13"
451     exit 0 ;;
452
453   -with-* | --with-*)
454     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
455     # Reject names that are not valid shell variable names.
456     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
457       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
458     fi
459     ac_package=`echo $ac_package| sed 's/-/_/g'`
460     case "$ac_option" in
461       *=*) ;;
462       *) ac_optarg=yes ;;
463     esac
464     eval "with_${ac_package}='$ac_optarg'" ;;
465
466   -without-* | --without-*)
467     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
468     # Reject names that are not valid shell variable names.
469     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
470       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
471     fi
472     ac_package=`echo $ac_package| sed 's/-/_/g'`
473     eval "with_${ac_package}=no" ;;
474
475   --x)
476     # Obsolete; use --with-x.
477     with_x=yes ;;
478
479   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
480   | --x-incl | --x-inc | --x-in | --x-i)
481     ac_prev=x_includes ;;
482   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
483   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
484     x_includes="$ac_optarg" ;;
485
486   -x-libraries | --x-libraries | --x-librarie | --x-librari \
487   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
488     ac_prev=x_libraries ;;
489   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
490   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
491     x_libraries="$ac_optarg" ;;
492
493   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
494     ;;
495
496   *)
497     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
498       echo "configure: warning: $ac_option: invalid host type" 1>&2
499     fi
500     if test "x$nonopt" != xNONE; then
501       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
502     fi
503     nonopt="$ac_option"
504     ;;
505
506   esac
507 done
508
509 if test -n "$ac_prev"; then
510   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
511 fi
512
513 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
514
515 # File descriptor usage:
516 # 0 standard input
517 # 1 file creation
518 # 2 errors and warnings
519 # 3 some systems may open it to /dev/tty
520 # 4 used on the Kubota Titan
521 # 6 checking for... messages and results
522 # 5 compiler messages saved in config.log
523 if test "$silent" = yes; then
524   exec 6>/dev/null
525 else
526   exec 6>&1
527 fi
528 exec 5>./config.log
529
530 echo "\
531 This file contains any messages produced by compilers while
532 running configure, to aid debugging if configure makes a mistake.
533 " 1>&5
534
535 # Strip out --no-create and --no-recursion so they do not pile up.
536 # Also quote any args containing shell metacharacters.
537 ac_configure_args=
538 for ac_arg
539 do
540   case "$ac_arg" in
541   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
542   | --no-cr | --no-c) ;;
543   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
544   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
545   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
546   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
547   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
548   esac
549 done
550
551 # NLS nuisances.
552 # Only set these to C if already set.  These must not be set unconditionally
553 # because not all systems understand e.g. LANG=C (notably SCO).
554 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
555 # Non-C LC_CTYPE values break the ctype check.
556 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
557 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
558 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
559 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
560
561 # confdefs.h avoids OS command line length limits that DEFS can exceed.
562 rm -rf conftest* confdefs.h
563 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
564 echo > confdefs.h
565
566 # A filename unique to this package, relative to the directory that
567 # configure is in, which we can look for to find out if srcdir is correct.
568 ac_unique_file=driver/subprocs.c
569
570 # Find the source files, if location was not specified.
571 if test -z "$srcdir"; then
572   ac_srcdir_defaulted=yes
573   # Try the directory containing this script, then its parent.
574   ac_prog=$0
575   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
576   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
577   srcdir=$ac_confdir
578   if test ! -r $srcdir/$ac_unique_file; then
579     srcdir=..
580   fi
581 else
582   ac_srcdir_defaulted=no
583 fi
584 if test ! -r $srcdir/$ac_unique_file; then
585   if test "$ac_srcdir_defaulted" = yes; then
586     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
587   else
588     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
589   fi
590 fi
591 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
592
593 # Prefer explicitly selected file to automatically selected ones.
594 if test -z "$CONFIG_SITE"; then
595   if test "x$prefix" != xNONE; then
596     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
597   else
598     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
599   fi
600 fi
601 for ac_site_file in $CONFIG_SITE; do
602   if test -r "$ac_site_file"; then
603     echo "loading site script $ac_site_file"
604     . "$ac_site_file"
605   fi
606 done
607
608 if test -r "$cache_file"; then
609   echo "loading cache $cache_file"
610   . $cache_file
611 else
612   echo "creating cache $cache_file"
613   > $cache_file
614 fi
615
616 ac_ext=c
617 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
618 ac_cpp='$CPP $CPPFLAGS'
619 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
620 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
621 cross_compiling=$ac_cv_prog_cc_cross
622
623 ac_exeext=
624 ac_objext=o
625 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
626   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
627   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
628     ac_n= ac_c='
629 ' ac_t='        '
630   else
631     ac_n=-n ac_c= ac_t=
632   fi
633 else
634   ac_n= ac_c='\c' ac_t=
635 fi
636
637
638
639 echo "current directory: `pwd`"
640 echo "command line was: $0 $@"
641
642
643 ac_aux_dir=
644 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
645   if test -f $ac_dir/install-sh; then
646     ac_aux_dir=$ac_dir
647     ac_install_sh="$ac_aux_dir/install-sh -c"
648     break
649   elif test -f $ac_dir/install.sh; then
650     ac_aux_dir=$ac_dir
651     ac_install_sh="$ac_aux_dir/install.sh -c"
652     break
653   fi
654 done
655 if test -z "$ac_aux_dir"; then
656   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
657 fi
658 ac_config_guess=$ac_aux_dir/config.guess
659 ac_config_sub=$ac_aux_dir/config.sub
660 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
661
662
663 # Make sure we can run config.sub.
664 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
665 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
666 fi
667
668 echo $ac_n "checking host system type""... $ac_c" 1>&6
669 echo "configure:681: checking host system type" >&5
670
671 host_alias=$host
672 case "$host_alias" in
673 NONE)
674   case $nonopt in
675   NONE)
676     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
677     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
678     fi ;;
679   *) host_alias=$nonopt ;;
680   esac ;;
681 esac
682
683 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
684 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
685 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
686 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
687 echo "$ac_t""$host" 1>&6
688
689
690 # Extract the first word of "gcc", so it can be a program name with args.
691 set dummy gcc; ac_word=$2
692 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
693 echo "configure:705: checking for $ac_word" >&5
694 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
695   echo $ac_n "(cached) $ac_c" 1>&6
696 else
697   if test -n "$CC"; then
698   ac_cv_prog_CC="$CC" # Let the user override the test.
699 else
700   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
701   ac_dummy="$PATH"
702   for ac_dir in $ac_dummy; do
703     test -z "$ac_dir" && ac_dir=.
704     if test -f $ac_dir/$ac_word; then
705       ac_cv_prog_CC="gcc"
706       break
707     fi
708   done
709   IFS="$ac_save_ifs"
710 fi
711 fi
712 CC="$ac_cv_prog_CC"
713 if test -n "$CC"; then
714   echo "$ac_t""$CC" 1>&6
715 else
716   echo "$ac_t""no" 1>&6
717 fi
718
719 if test -z "$CC"; then
720   # Extract the first word of "cc", so it can be a program name with args.
721 set dummy cc; ac_word=$2
722 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
723 echo "configure:735: checking for $ac_word" >&5
724 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
725   echo $ac_n "(cached) $ac_c" 1>&6
726 else
727   if test -n "$CC"; then
728   ac_cv_prog_CC="$CC" # Let the user override the test.
729 else
730   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
731   ac_prog_rejected=no
732   ac_dummy="$PATH"
733   for ac_dir in $ac_dummy; do
734     test -z "$ac_dir" && ac_dir=.
735     if test -f $ac_dir/$ac_word; then
736       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
737         ac_prog_rejected=yes
738         continue
739       fi
740       ac_cv_prog_CC="cc"
741       break
742     fi
743   done
744   IFS="$ac_save_ifs"
745 if test $ac_prog_rejected = yes; then
746   # We found a bogon in the path, so make sure we never use it.
747   set dummy $ac_cv_prog_CC
748   shift
749   if test $# -gt 0; then
750     # We chose a different compiler from the bogus one.
751     # However, it has the same basename, so the bogon will be chosen
752     # first if we set CC to just the basename; use the full file name.
753     shift
754     set dummy "$ac_dir/$ac_word" "$@"
755     shift
756     ac_cv_prog_CC="$@"
757   fi
758 fi
759 fi
760 fi
761 CC="$ac_cv_prog_CC"
762 if test -n "$CC"; then
763   echo "$ac_t""$CC" 1>&6
764 else
765   echo "$ac_t""no" 1>&6
766 fi
767
768   if test -z "$CC"; then
769     case "`uname -s`" in
770     *win32* | *WIN32*)
771       # Extract the first word of "cl", so it can be a program name with args.
772 set dummy cl; ac_word=$2
773 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
774 echo "configure:786: checking for $ac_word" >&5
775 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
776   echo $ac_n "(cached) $ac_c" 1>&6
777 else
778   if test -n "$CC"; then
779   ac_cv_prog_CC="$CC" # Let the user override the test.
780 else
781   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
782   ac_dummy="$PATH"
783   for ac_dir in $ac_dummy; do
784     test -z "$ac_dir" && ac_dir=.
785     if test -f $ac_dir/$ac_word; then
786       ac_cv_prog_CC="cl"
787       break
788     fi
789   done
790   IFS="$ac_save_ifs"
791 fi
792 fi
793 CC="$ac_cv_prog_CC"
794 if test -n "$CC"; then
795   echo "$ac_t""$CC" 1>&6
796 else
797   echo "$ac_t""no" 1>&6
798 fi
799  ;;
800     esac
801   fi
802   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
803 fi
804
805 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
806 echo "configure:818: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
807
808 ac_ext=c
809 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
810 ac_cpp='$CPP $CPPFLAGS'
811 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
812 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
813 cross_compiling=$ac_cv_prog_cc_cross
814
815 cat > conftest.$ac_ext << EOF
816
817 #line 829 "configure"
818 #include "confdefs.h"
819
820 main(){return(0);}
821 EOF
822 if { (eval echo configure:834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
823   ac_cv_prog_cc_works=yes
824   # If we can't run a trivial program, we are probably using a cross compiler.
825   if (./conftest; exit) 2>/dev/null; then
826     ac_cv_prog_cc_cross=no
827   else
828     ac_cv_prog_cc_cross=yes
829   fi
830 else
831   echo "configure: failed program was:" >&5
832   cat conftest.$ac_ext >&5
833   ac_cv_prog_cc_works=no
834 fi
835 rm -fr conftest*
836 ac_ext=c
837 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
838 ac_cpp='$CPP $CPPFLAGS'
839 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
840 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
841 cross_compiling=$ac_cv_prog_cc_cross
842
843 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
844 if test $ac_cv_prog_cc_works = no; then
845   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
846 fi
847 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
848 echo "configure:860: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
849 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
850 cross_compiling=$ac_cv_prog_cc_cross
851
852 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
853 echo "configure:865: checking whether we are using GNU C" >&5
854 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
855   echo $ac_n "(cached) $ac_c" 1>&6
856 else
857   cat > conftest.c <<EOF
858 #ifdef __GNUC__
859   yes;
860 #endif
861 EOF
862 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
863   ac_cv_prog_gcc=yes
864 else
865   ac_cv_prog_gcc=no
866 fi
867 fi
868
869 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
870
871 if test $ac_cv_prog_gcc = yes; then
872   GCC=yes
873 else
874   GCC=
875 fi
876
877 ac_test_CFLAGS="${CFLAGS+set}"
878 ac_save_CFLAGS="$CFLAGS"
879 CFLAGS=
880 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
881 echo "configure:893: checking whether ${CC-cc} accepts -g" >&5
882 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
883   echo $ac_n "(cached) $ac_c" 1>&6
884 else
885   echo 'void f(){}' > conftest.c
886 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
887   ac_cv_prog_cc_g=yes
888 else
889   ac_cv_prog_cc_g=no
890 fi
891 rm -f conftest*
892
893 fi
894
895 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
896 if test "$ac_test_CFLAGS" = set; then
897   CFLAGS="$ac_save_CFLAGS"
898 elif test $ac_cv_prog_cc_g = yes; then
899   if test "$GCC" = yes; then
900     CFLAGS="-g -O2"
901   else
902     CFLAGS="-g"
903   fi
904 else
905   if test "$GCC" = yes; then
906     CFLAGS="-O2"
907   else
908     CFLAGS=
909   fi
910 fi
911
912
913 if test -z "$GCC"; then
914   echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
915 echo "configure:927: checking how to request ANSI compilation" >&5
916   case "$host" in
917     *-hpux*)
918       echo "$ac_t""HPUX: adding -Ae" 1>&6
919       CC="$CC -Ae"
920     ;;
921     *-aix*)
922       echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
923       CC="$CC -qlanglvl=ansi -qhalt=e"
924     ;;
925
926     *-dec-*)
927       echo "$ac_t""DEC: adding -std1" 1>&6
928       CC="$CC -std1"
929     ;;
930
931     *)
932       echo "$ac_t""no idea" 1>&6
933     ;;
934   esac
935 fi
936
937
938 echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
939 echo "configure:951: checking whether the compiler works on ANSI C" >&5
940 if test "$cross_compiling" = yes; then
941   { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
942 else
943   cat > conftest.$ac_ext <<EOF
944 #line 956 "configure"
945 #include "confdefs.h"
946  main(int ac, char **av) { return 0; } 
947 EOF
948 if { (eval echo configure:960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
949 then
950   echo "$ac_t""yes" 1>&6
951 else
952   echo "configure: failed program was:" >&5
953   cat conftest.$ac_ext >&5
954   rm -fr conftest*
955   echo "$ac_t""no" 1>&6
956    { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
957 fi
958 rm -fr conftest*
959 fi
960
961
962 case "$host" in
963   *-irix5* |*-irix6.0-3* )
964     if test -n "$GCC"; then
965       echo "$ac_t""Turning on gcc compiler warnings." 1>&6
966       CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
967     else
968       # not gcc
969       echo "$ac_t""Turning on SGI compiler warnings." 1>&6
970       CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
971     fi
972   ;;
973
974     *-linux-*)
975       echo "$ac_t""Turning on gcc compiler warnings." 1>&6
976       CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
977   ;;
978
979 #  *-dec-osf*)
980 #    if test -z "$GCC"; then
981 #      AC_MSG_RESULT(Turning on DEC C compiler warnings.)
982 #      CC="$CC -migrate -w0 -verbose -warnprotos"
983 #    fi
984 #  ;;
985
986 esac
987
988
989 # Try and determine whether ${INSTALL} can create intermediate directories,
990 # and if not, whether "mkdir -p" works instead.  This sets ${INSTALL_DIRS}.
991 # (But autoconf should earn its keep and do this for us!)
992 #
993
994
995
996 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
997 echo "configure:1009: checking how to run the C preprocessor" >&5
998 # On Suns, sometimes $CPP names a directory.
999 if test -n "$CPP" && test -d "$CPP"; then
1000   CPP=
1001 fi
1002 if test -z "$CPP"; then
1003 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1004   echo $ac_n "(cached) $ac_c" 1>&6
1005 else
1006     # This must be in double quotes, not single quotes, because CPP may get
1007   # substituted into the Makefile and "${CC-cc}" will confuse make.
1008   CPP="${CC-cc} -E"
1009   # On the NeXT, cc -E runs the code through the compiler's parser,
1010   # not just through cpp.
1011   cat > conftest.$ac_ext <<EOF
1012 #line 1024 "configure"
1013 #include "confdefs.h"
1014 #include <assert.h>
1015 Syntax Error
1016 EOF
1017 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1018 { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1019 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1020 if test -z "$ac_err"; then
1021   :
1022 else
1023   echo "$ac_err" >&5
1024   echo "configure: failed program was:" >&5
1025   cat conftest.$ac_ext >&5
1026   rm -rf conftest*
1027   CPP="${CC-cc} -E -traditional-cpp"
1028   cat > conftest.$ac_ext <<EOF
1029 #line 1041 "configure"
1030 #include "confdefs.h"
1031 #include <assert.h>
1032 Syntax Error
1033 EOF
1034 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1035 { (eval echo configure:1047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1036 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1037 if test -z "$ac_err"; then
1038   :
1039 else
1040   echo "$ac_err" >&5
1041   echo "configure: failed program was:" >&5
1042   cat conftest.$ac_ext >&5
1043   rm -rf conftest*
1044   CPP="${CC-cc} -nologo -E"
1045   cat > conftest.$ac_ext <<EOF
1046 #line 1058 "configure"
1047 #include "confdefs.h"
1048 #include <assert.h>
1049 Syntax Error
1050 EOF
1051 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1052 { (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1053 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1054 if test -z "$ac_err"; then
1055   :
1056 else
1057   echo "$ac_err" >&5
1058   echo "configure: failed program was:" >&5
1059   cat conftest.$ac_ext >&5
1060   rm -rf conftest*
1061   CPP=/lib/cpp
1062 fi
1063 rm -f conftest*
1064 fi
1065 rm -f conftest*
1066 fi
1067 rm -f conftest*
1068   ac_cv_prog_CPP="$CPP"
1069 fi
1070   CPP="$ac_cv_prog_CPP"
1071 else
1072   ac_cv_prog_CPP="$CPP"
1073 fi
1074 echo "$ac_t""$CPP" 1>&6
1075
1076 # Find a good install program.  We prefer a C program (faster),
1077 # so one script is as good as another.  But avoid the broken or
1078 # incompatible versions:
1079 # SysV /etc/install, /usr/sbin/install
1080 # SunOS /usr/etc/install
1081 # IRIX /sbin/install
1082 # AIX /bin/install
1083 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1084 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1085 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1086 # ./install, which can be erroneously created by make from ./install.sh.
1087 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1088 echo "configure:1100: checking for a BSD compatible install" >&5
1089 if test -z "$INSTALL"; then
1090 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1091   echo $ac_n "(cached) $ac_c" 1>&6
1092 else
1093     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1094   for ac_dir in $PATH; do
1095     # Account for people who put trailing slashes in PATH elements.
1096     case "$ac_dir/" in
1097     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1098     *)
1099       # OSF1 and SCO ODT 3.0 have their own names for install.
1100       # Don't use installbsd from OSF since it installs stuff as root
1101       # by default.
1102       for ac_prog in ginstall scoinst install; do
1103         if test -f $ac_dir/$ac_prog; then
1104           if test $ac_prog = install &&
1105             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1106             # AIX install.  It has an incompatible calling convention.
1107             :
1108           else
1109             ac_cv_path_install="$ac_dir/$ac_prog -c"
1110             break 2
1111           fi
1112         fi
1113       done
1114       ;;
1115     esac
1116   done
1117   IFS="$ac_save_IFS"
1118
1119 fi
1120   if test "${ac_cv_path_install+set}" = set; then
1121     INSTALL="$ac_cv_path_install"
1122   else
1123     # As a last resort, use the slow shell script.  We don't cache a
1124     # path for INSTALL within a source directory, because that will
1125     # break other packages using the cache if that directory is
1126     # removed, or if the path is relative.
1127     INSTALL="$ac_install_sh"
1128   fi
1129 fi
1130 echo "$ac_t""$INSTALL" 1>&6
1131
1132 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1133 # It thinks the first close brace ends the variable substitution.
1134 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1135
1136 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1137
1138 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1139
1140 INSTALL_DIRS='${INSTALL} -d'
1141    echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
1142 echo "configure:1154: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
1143    rm -rf conftestdir
1144    if mkdir conftestdir; then
1145       cd conftestdir >&-
1146
1147       ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
1148       if test -d dir1/dir2 ; then
1149         echo "$ac_t""yes" 1>&6
1150       else
1151         echo "$ac_t""no" 1>&6
1152         echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
1153 echo "configure:1165: checking whether \"mkdir -p\" creates intermediate directories" >&5
1154         rm -rf dir1
1155         mkdir -p dir1/dir2 >&- 2>&-
1156         if test -d dir1/dir2/. ; then
1157           echo "$ac_t""yes" 1>&6
1158           INSTALL_DIRS='mkdir -p'
1159         else
1160           echo "$ac_t""no" 1>&6
1161         fi
1162       fi
1163       cd .. >&-
1164       rm -rf conftestdir
1165    fi
1166
1167 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1168 echo "configure:1180: checking whether ${MAKE-make} sets \${MAKE}" >&5
1169 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1170 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1171   echo $ac_n "(cached) $ac_c" 1>&6
1172 else
1173   cat > conftestmake <<\EOF
1174 all:
1175         @echo 'ac_maketemp="${MAKE}"'
1176 EOF
1177 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1178 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1179 if test -n "$ac_maketemp"; then
1180   eval ac_cv_prog_make_${ac_make}_set=yes
1181 else
1182   eval ac_cv_prog_make_${ac_make}_set=no
1183 fi
1184 rm -f conftestmake
1185 fi
1186 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1187   echo "$ac_t""yes" 1>&6
1188   SET_MAKE=
1189 else
1190   echo "$ac_t""no" 1>&6
1191   SET_MAKE="MAKE=${MAKE-make}"
1192 fi
1193
1194
1195 echo $ac_n "checking for working const""... $ac_c" 1>&6
1196 echo "configure:1208: checking for working const" >&5
1197 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1198   echo $ac_n "(cached) $ac_c" 1>&6
1199 else
1200   cat > conftest.$ac_ext <<EOF
1201 #line 1213 "configure"
1202 #include "confdefs.h"
1203
1204 int main() {
1205
1206 /* Ultrix mips cc rejects this.  */
1207 typedef int charset[2]; const charset x;
1208 /* SunOS 4.1.1 cc rejects this.  */
1209 char const *const *ccp;
1210 char **p;
1211 /* NEC SVR4.0.2 mips cc rejects this.  */
1212 struct point {int x, y;};
1213 static struct point const zero = {0,0};
1214 /* AIX XL C 1.02.0.0 rejects this.
1215    It does not let you subtract one const X* pointer from another in an arm
1216    of an if-expression whose if-part is not a constant expression */
1217 const char *g = "string";
1218 ccp = &g + (g ? g-g : 0);
1219 /* HPUX 7.0 cc rejects these. */
1220 ++ccp;
1221 p = (char**) ccp;
1222 ccp = (char const *const *) p;
1223 { /* SCO 3.2v4 cc rejects this.  */
1224   char *t;
1225   char const *s = 0 ? (char *) 0 : (char const *) 0;
1226
1227   *t++ = 0;
1228 }
1229 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1230   int x[] = {25, 17};
1231   const int *foo = &x[0];
1232   ++foo;
1233 }
1234 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1235   typedef const int *iptr;
1236   iptr p = 0;
1237   ++p;
1238 }
1239 { /* AIX XL C 1.02.0.0 rejects this saying
1240      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1241   struct s { int j; const int *ap[3]; };
1242   struct s *b; b->j = 5;
1243 }
1244 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1245   const int foo = 10;
1246 }
1247
1248 ; return 0; }
1249 EOF
1250 if { (eval echo configure:1262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1251   rm -rf conftest*
1252   ac_cv_c_const=yes
1253 else
1254   echo "configure: failed program was:" >&5
1255   cat conftest.$ac_ext >&5
1256   rm -rf conftest*
1257   ac_cv_c_const=no
1258 fi
1259 rm -f conftest*
1260 fi
1261
1262 echo "$ac_t""$ac_cv_c_const" 1>&6
1263 if test $ac_cv_c_const = no; then
1264   cat >> confdefs.h <<\EOF
1265 #define const 
1266 EOF
1267
1268 fi
1269
1270 echo $ac_n "checking for inline""... $ac_c" 1>&6
1271 echo "configure:1283: checking for inline" >&5
1272 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1273   echo $ac_n "(cached) $ac_c" 1>&6
1274 else
1275   ac_cv_c_inline=no
1276 for ac_kw in inline __inline__ __inline; do
1277   cat > conftest.$ac_ext <<EOF
1278 #line 1290 "configure"
1279 #include "confdefs.h"
1280
1281 int main() {
1282 } $ac_kw foo() {
1283 ; return 0; }
1284 EOF
1285 if { (eval echo configure:1297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1286   rm -rf conftest*
1287   ac_cv_c_inline=$ac_kw; break
1288 else
1289   echo "configure: failed program was:" >&5
1290   cat conftest.$ac_ext >&5
1291 fi
1292 rm -f conftest*
1293 done
1294
1295 fi
1296
1297 echo "$ac_t""$ac_cv_c_inline" 1>&6
1298 case "$ac_cv_c_inline" in
1299   inline | yes) ;;
1300   no) cat >> confdefs.h <<\EOF
1301 #define inline 
1302 EOF
1303  ;;
1304   *)  cat >> confdefs.h <<EOF
1305 #define inline $ac_cv_c_inline
1306 EOF
1307  ;;
1308 esac
1309
1310
1311 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1312 echo "configure:1324: checking for ANSI C header files" >&5
1313 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1314   echo $ac_n "(cached) $ac_c" 1>&6
1315 else
1316   cat > conftest.$ac_ext <<EOF
1317 #line 1329 "configure"
1318 #include "confdefs.h"
1319 #include <stdlib.h>
1320 #include <stdarg.h>
1321 #include <string.h>
1322 #include <float.h>
1323 EOF
1324 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1325 { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1326 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1327 if test -z "$ac_err"; then
1328   rm -rf conftest*
1329   ac_cv_header_stdc=yes
1330 else
1331   echo "$ac_err" >&5
1332   echo "configure: failed program was:" >&5
1333   cat conftest.$ac_ext >&5
1334   rm -rf conftest*
1335   ac_cv_header_stdc=no
1336 fi
1337 rm -f conftest*
1338
1339 if test $ac_cv_header_stdc = yes; then
1340   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1341 cat > conftest.$ac_ext <<EOF
1342 #line 1354 "configure"
1343 #include "confdefs.h"
1344 #include <string.h>
1345 EOF
1346 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1347   egrep "memchr" >/dev/null 2>&1; then
1348   :
1349 else
1350   rm -rf conftest*
1351   ac_cv_header_stdc=no
1352 fi
1353 rm -f conftest*
1354
1355 fi
1356
1357 if test $ac_cv_header_stdc = yes; then
1358   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1359 cat > conftest.$ac_ext <<EOF
1360 #line 1372 "configure"
1361 #include "confdefs.h"
1362 #include <stdlib.h>
1363 EOF
1364 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1365   egrep "free" >/dev/null 2>&1; then
1366   :
1367 else
1368   rm -rf conftest*
1369   ac_cv_header_stdc=no
1370 fi
1371 rm -f conftest*
1372
1373 fi
1374
1375 if test $ac_cv_header_stdc = yes; then
1376   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1377 if test "$cross_compiling" = yes; then
1378   :
1379 else
1380   cat > conftest.$ac_ext <<EOF
1381 #line 1393 "configure"
1382 #include "confdefs.h"
1383 #include <ctype.h>
1384 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1385 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1386 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1387 int main () { int i; for (i = 0; i < 256; i++)
1388 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1389 exit (0); }
1390
1391 EOF
1392 if { (eval echo configure:1404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1393 then
1394   :
1395 else
1396   echo "configure: failed program was:" >&5
1397   cat conftest.$ac_ext >&5
1398   rm -fr conftest*
1399   ac_cv_header_stdc=no
1400 fi
1401 rm -fr conftest*
1402 fi
1403
1404 fi
1405 fi
1406
1407 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1408 if test $ac_cv_header_stdc = yes; then
1409   cat >> confdefs.h <<\EOF
1410 #define STDC_HEADERS 1
1411 EOF
1412
1413 fi
1414
1415 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1416 echo "configure:1428: checking whether time.h and sys/time.h may both be included" >&5
1417 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1418   echo $ac_n "(cached) $ac_c" 1>&6
1419 else
1420   cat > conftest.$ac_ext <<EOF
1421 #line 1433 "configure"
1422 #include "confdefs.h"
1423 #include <sys/types.h>
1424 #include <sys/time.h>
1425 #include <time.h>
1426 int main() {
1427 struct tm *tp;
1428 ; return 0; }
1429 EOF
1430 if { (eval echo configure:1442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1431   rm -rf conftest*
1432   ac_cv_header_time=yes
1433 else
1434   echo "configure: failed program was:" >&5
1435   cat conftest.$ac_ext >&5
1436   rm -rf conftest*
1437   ac_cv_header_time=no
1438 fi
1439 rm -f conftest*
1440 fi
1441
1442 echo "$ac_t""$ac_cv_header_time" 1>&6
1443 if test $ac_cv_header_time = yes; then
1444   cat >> confdefs.h <<\EOF
1445 #define TIME_WITH_SYS_TIME 1
1446 EOF
1447
1448 fi
1449
1450 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1451 echo "configure:1463: checking for sys/wait.h that is POSIX.1 compatible" >&5
1452 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1453   echo $ac_n "(cached) $ac_c" 1>&6
1454 else
1455   cat > conftest.$ac_ext <<EOF
1456 #line 1468 "configure"
1457 #include "confdefs.h"
1458 #include <sys/types.h>
1459 #include <sys/wait.h>
1460 #ifndef WEXITSTATUS
1461 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1462 #endif
1463 #ifndef WIFEXITED
1464 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1465 #endif
1466 int main() {
1467 int s;
1468 wait (&s);
1469 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1470 ; return 0; }
1471 EOF
1472 if { (eval echo configure:1484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1473   rm -rf conftest*
1474   ac_cv_header_sys_wait_h=yes
1475 else
1476   echo "configure: failed program was:" >&5
1477   cat conftest.$ac_ext >&5
1478   rm -rf conftest*
1479   ac_cv_header_sys_wait_h=no
1480 fi
1481 rm -f conftest*
1482 fi
1483
1484 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1485 if test $ac_cv_header_sys_wait_h = yes; then
1486   cat >> confdefs.h <<\EOF
1487 #define HAVE_SYS_WAIT_H 1
1488 EOF
1489
1490 fi
1491
1492 ac_header_dirent=no
1493 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1494 do
1495 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1496 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1497 echo "configure:1509: checking for $ac_hdr that defines DIR" >&5
1498 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1499   echo $ac_n "(cached) $ac_c" 1>&6
1500 else
1501   cat > conftest.$ac_ext <<EOF
1502 #line 1514 "configure"
1503 #include "confdefs.h"
1504 #include <sys/types.h>
1505 #include <$ac_hdr>
1506 int main() {
1507 DIR *dirp = 0;
1508 ; return 0; }
1509 EOF
1510 if { (eval echo configure:1522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1511   rm -rf conftest*
1512   eval "ac_cv_header_dirent_$ac_safe=yes"
1513 else
1514   echo "configure: failed program was:" >&5
1515   cat conftest.$ac_ext >&5
1516   rm -rf conftest*
1517   eval "ac_cv_header_dirent_$ac_safe=no"
1518 fi
1519 rm -f conftest*
1520 fi
1521 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1522   echo "$ac_t""yes" 1>&6
1523     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1524   cat >> confdefs.h <<EOF
1525 #define $ac_tr_hdr 1
1526 EOF
1527  ac_header_dirent=$ac_hdr; break
1528 else
1529   echo "$ac_t""no" 1>&6
1530 fi
1531 done
1532 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1533 if test $ac_header_dirent = dirent.h; then
1534 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1535 echo "configure:1547: checking for opendir in -ldir" >&5
1536 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1537 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1538   echo $ac_n "(cached) $ac_c" 1>&6
1539 else
1540   ac_save_LIBS="$LIBS"
1541 LIBS="-ldir  $LIBS"
1542 cat > conftest.$ac_ext <<EOF
1543 #line 1555 "configure"
1544 #include "confdefs.h"
1545 /* Override any gcc2 internal prototype to avoid an error.  */
1546 /* We use char because int might match the return type of a gcc2
1547     builtin and then its argument prototype would still apply.  */
1548 char opendir();
1549
1550 int main() {
1551 opendir()
1552 ; return 0; }
1553 EOF
1554 if { (eval echo configure:1566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1555   rm -rf conftest*
1556   eval "ac_cv_lib_$ac_lib_var=yes"
1557 else
1558   echo "configure: failed program was:" >&5
1559   cat conftest.$ac_ext >&5
1560   rm -rf conftest*
1561   eval "ac_cv_lib_$ac_lib_var=no"
1562 fi
1563 rm -f conftest*
1564 LIBS="$ac_save_LIBS"
1565
1566 fi
1567 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1568   echo "$ac_t""yes" 1>&6
1569   LIBS="$LIBS -ldir"
1570 else
1571   echo "$ac_t""no" 1>&6
1572 fi
1573
1574 else
1575 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1576 echo "configure:1588: checking for opendir in -lx" >&5
1577 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1578 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1579   echo $ac_n "(cached) $ac_c" 1>&6
1580 else
1581   ac_save_LIBS="$LIBS"
1582 LIBS="-lx  $LIBS"
1583 cat > conftest.$ac_ext <<EOF
1584 #line 1596 "configure"
1585 #include "confdefs.h"
1586 /* Override any gcc2 internal prototype to avoid an error.  */
1587 /* We use char because int might match the return type of a gcc2
1588     builtin and then its argument prototype would still apply.  */
1589 char opendir();
1590
1591 int main() {
1592 opendir()
1593 ; return 0; }
1594 EOF
1595 if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1596   rm -rf conftest*
1597   eval "ac_cv_lib_$ac_lib_var=yes"
1598 else
1599   echo "configure: failed program was:" >&5
1600   cat conftest.$ac_ext >&5
1601   rm -rf conftest*
1602   eval "ac_cv_lib_$ac_lib_var=no"
1603 fi
1604 rm -f conftest*
1605 LIBS="$ac_save_LIBS"
1606
1607 fi
1608 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1609   echo "$ac_t""yes" 1>&6
1610   LIBS="$LIBS -lx"
1611 else
1612   echo "$ac_t""no" 1>&6
1613 fi
1614
1615 fi
1616
1617
1618 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
1619 echo "configure:1631: checking for mode_t" >&5
1620 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
1621   echo $ac_n "(cached) $ac_c" 1>&6
1622 else
1623   cat > conftest.$ac_ext <<EOF
1624 #line 1636 "configure"
1625 #include "confdefs.h"
1626 #include <sys/types.h>
1627 #if STDC_HEADERS
1628 #include <stdlib.h>
1629 #include <stddef.h>
1630 #endif
1631 EOF
1632 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1633   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1634   rm -rf conftest*
1635   ac_cv_type_mode_t=yes
1636 else
1637   rm -rf conftest*
1638   ac_cv_type_mode_t=no
1639 fi
1640 rm -f conftest*
1641
1642 fi
1643 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
1644 if test $ac_cv_type_mode_t = no; then
1645   cat >> confdefs.h <<\EOF
1646 #define mode_t int
1647 EOF
1648
1649 fi
1650
1651 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1652 echo "configure:1664: checking for pid_t" >&5
1653 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1654   echo $ac_n "(cached) $ac_c" 1>&6
1655 else
1656   cat > conftest.$ac_ext <<EOF
1657 #line 1669 "configure"
1658 #include "confdefs.h"
1659 #include <sys/types.h>
1660 #if STDC_HEADERS
1661 #include <stdlib.h>
1662 #include <stddef.h>
1663 #endif
1664 EOF
1665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1666   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1667   rm -rf conftest*
1668   ac_cv_type_pid_t=yes
1669 else
1670   rm -rf conftest*
1671   ac_cv_type_pid_t=no
1672 fi
1673 rm -f conftest*
1674
1675 fi
1676 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1677 if test $ac_cv_type_pid_t = no; then
1678   cat >> confdefs.h <<\EOF
1679 #define pid_t int
1680 EOF
1681
1682 fi
1683
1684 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1685 echo "configure:1697: checking for size_t" >&5
1686 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1687   echo $ac_n "(cached) $ac_c" 1>&6
1688 else
1689   cat > conftest.$ac_ext <<EOF
1690 #line 1702 "configure"
1691 #include "confdefs.h"
1692 #include <sys/types.h>
1693 #if STDC_HEADERS
1694 #include <stdlib.h>
1695 #include <stddef.h>
1696 #endif
1697 EOF
1698 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1699   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1700   rm -rf conftest*
1701   ac_cv_type_size_t=yes
1702 else
1703   rm -rf conftest*
1704   ac_cv_type_size_t=no
1705 fi
1706 rm -f conftest*
1707
1708 fi
1709 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1710 if test $ac_cv_type_size_t = no; then
1711   cat >> confdefs.h <<\EOF
1712 #define size_t unsigned
1713 EOF
1714
1715 fi
1716
1717 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1718 echo "configure:1730: checking return type of signal handlers" >&5
1719 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1720   echo $ac_n "(cached) $ac_c" 1>&6
1721 else
1722   cat > conftest.$ac_ext <<EOF
1723 #line 1735 "configure"
1724 #include "confdefs.h"
1725 #include <sys/types.h>
1726 #include <signal.h>
1727 #ifdef signal
1728 #undef signal
1729 #endif
1730 #ifdef __cplusplus
1731 extern "C" void (*signal (int, void (*)(int)))(int);
1732 #else
1733 void (*signal ()) ();
1734 #endif
1735
1736 int main() {
1737 int i;
1738 ; return 0; }
1739 EOF
1740 if { (eval echo configure:1752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1741   rm -rf conftest*
1742   ac_cv_type_signal=void
1743 else
1744   echo "configure: failed program was:" >&5
1745   cat conftest.$ac_ext >&5
1746   rm -rf conftest*
1747   ac_cv_type_signal=int
1748 fi
1749 rm -f conftest*
1750 fi
1751
1752 echo "$ac_t""$ac_cv_type_signal" 1>&6
1753 cat >> confdefs.h <<EOF
1754 #define RETSIGTYPE $ac_cv_type_signal
1755 EOF
1756
1757
1758
1759 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
1760 echo "configure:1772: checking how to call gettimeofday" >&5
1761 if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
1762   echo $ac_n "(cached) $ac_c" 1>&6
1763 else
1764   cat > conftest.$ac_ext <<EOF
1765 #line 1777 "configure"
1766 #include "confdefs.h"
1767 #include <stdlib.h>
1768                   #include <sys/time.h>
1769 int main() {
1770 struct timeval tv; struct timezone tzp;
1771                   gettimeofday(&tv, &tzp);
1772 ; return 0; }
1773 EOF
1774 if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1775   rm -rf conftest*
1776   ac_gettimeofday_args=2
1777 else
1778   echo "configure: failed program was:" >&5
1779   cat conftest.$ac_ext >&5
1780   rm -rf conftest*
1781   cat > conftest.$ac_ext <<EOF
1782 #line 1794 "configure"
1783 #include "confdefs.h"
1784 #include <stdlib.h>
1785                                   #include <sys/time.h>
1786 int main() {
1787 struct timeval tv; gettimeofday(&tv);
1788 ; return 0; }
1789 EOF
1790 if { (eval echo configure:1802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1791   rm -rf conftest*
1792   ac_gettimeofday_args=1
1793 else
1794   echo "configure: failed program was:" >&5
1795   cat conftest.$ac_ext >&5
1796   rm -rf conftest*
1797   ac_gettimeofday_args=0
1798 fi
1799 rm -f conftest*
1800 fi
1801 rm -f conftest*
1802   ac_cv_gettimeofday_args=$ac_gettimeofday_args
1803 fi
1804
1805 ac_gettimeofday_args=$ac_cv_gettimeofday_args
1806 if test "$ac_gettimeofday_args" = 1 ; then
1807   cat >> confdefs.h <<\EOF
1808 #define HAVE_GETTIMEOFDAY 1
1809 EOF
1810
1811   echo "$ac_t""one argument" 1>&6
1812 elif test "$ac_gettimeofday_args" = 2 ; then
1813   cat >> confdefs.h <<\EOF
1814 #define HAVE_GETTIMEOFDAY 1
1815 EOF
1816
1817   cat >> confdefs.h <<\EOF
1818 #define GETTIMEOFDAY_TWO_ARGS 1
1819 EOF
1820
1821   echo "$ac_t""two arguments" 1>&6
1822 else
1823   echo "$ac_t""unknown" 1>&6
1824 fi
1825
1826
1827 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
1828 do
1829 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1830 echo "configure:1842: checking for $ac_func" >&5
1831 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1832   echo $ac_n "(cached) $ac_c" 1>&6
1833 else
1834   cat > conftest.$ac_ext <<EOF
1835 #line 1847 "configure"
1836 #include "confdefs.h"
1837 /* System header to define __stub macros and hopefully few prototypes,
1838     which can conflict with char $ac_func(); below.  */
1839 #include <assert.h>
1840 /* Override any gcc2 internal prototype to avoid an error.  */
1841 /* We use char because int might match the return type of a gcc2
1842     builtin and then its argument prototype would still apply.  */
1843 char $ac_func();
1844
1845 int main() {
1846
1847 /* The GNU C library defines this for functions which it implements
1848     to always fail with ENOSYS.  Some functions are actually named
1849     something starting with __ and the normal name is an alias.  */
1850 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1851 choke me
1852 #else
1853 $ac_func();
1854 #endif
1855
1856 ; return 0; }
1857 EOF
1858 if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1859   rm -rf conftest*
1860   eval "ac_cv_func_$ac_func=yes"
1861 else
1862   echo "configure: failed program was:" >&5
1863   cat conftest.$ac_ext >&5
1864   rm -rf conftest*
1865   eval "ac_cv_func_$ac_func=no"
1866 fi
1867 rm -f conftest*
1868 fi
1869
1870 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1871   echo "$ac_t""yes" 1>&6
1872     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1873   cat >> confdefs.h <<EOF
1874 #define $ac_tr_func 1
1875 EOF
1876  
1877 else
1878   echo "$ac_t""no" 1>&6
1879 fi
1880 done
1881
1882 for ac_func in sigaction syslog
1883 do
1884 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1885 echo "configure:1897: checking for $ac_func" >&5
1886 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1887   echo $ac_n "(cached) $ac_c" 1>&6
1888 else
1889   cat > conftest.$ac_ext <<EOF
1890 #line 1902 "configure"
1891 #include "confdefs.h"
1892 /* System header to define __stub macros and hopefully few prototypes,
1893     which can conflict with char $ac_func(); below.  */
1894 #include <assert.h>
1895 /* Override any gcc2 internal prototype to avoid an error.  */
1896 /* We use char because int might match the return type of a gcc2
1897     builtin and then its argument prototype would still apply.  */
1898 char $ac_func();
1899
1900 int main() {
1901
1902 /* The GNU C library defines this for functions which it implements
1903     to always fail with ENOSYS.  Some functions are actually named
1904     something starting with __ and the normal name is an alias.  */
1905 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1906 choke me
1907 #else
1908 $ac_func();
1909 #endif
1910
1911 ; return 0; }
1912 EOF
1913 if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1914   rm -rf conftest*
1915   eval "ac_cv_func_$ac_func=yes"
1916 else
1917   echo "configure: failed program was:" >&5
1918   cat conftest.$ac_ext >&5
1919   rm -rf conftest*
1920   eval "ac_cv_func_$ac_func=no"
1921 fi
1922 rm -f conftest*
1923 fi
1924
1925 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1926   echo "$ac_t""yes" 1>&6
1927     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1928   cat >> confdefs.h <<EOF
1929 #define $ac_tr_func 1
1930 EOF
1931  
1932 else
1933   echo "$ac_t""no" 1>&6
1934 fi
1935 done
1936
1937
1938 for ac_hdr in unistd.h crypt.h sys/select.h
1939 do
1940 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1941 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1942 echo "configure:1954: checking for $ac_hdr" >&5
1943 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1944   echo $ac_n "(cached) $ac_c" 1>&6
1945 else
1946   cat > conftest.$ac_ext <<EOF
1947 #line 1959 "configure"
1948 #include "confdefs.h"
1949 #include <$ac_hdr>
1950 EOF
1951 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1952 { (eval echo configure:1964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1953 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1954 if test -z "$ac_err"; then
1955   rm -rf conftest*
1956   eval "ac_cv_header_$ac_safe=yes"
1957 else
1958   echo "$ac_err" >&5
1959   echo "configure: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   rm -rf conftest*
1962   eval "ac_cv_header_$ac_safe=no"
1963 fi
1964 rm -f conftest*
1965 fi
1966 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1967   echo "$ac_t""yes" 1>&6
1968     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1969   cat >> confdefs.h <<EOF
1970 #define $ac_tr_hdr 1
1971 EOF
1972  
1973 else
1974   echo "$ac_t""no" 1>&6
1975 fi
1976 done
1977
1978
1979
1980
1981 # Check whether --enable-subdir or --disable-subdir was given.
1982 if test "${enable_subdir+set}" = set; then
1983   enableval="$enable_subdir"
1984   enable_subdir="$enableval"
1985 else
1986   enable_subdir=no
1987 fi
1988
1989 if test x"$enable_subdir" = xno; then
1990   HACKDIR='${bindir}'
1991 elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
1992   echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
1993   exit 1
1994 else
1995   # there must be a better way than this...
1996   if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
1997     # absolute path
1998     HACKDIR=$enable_subdir
1999   else
2000     # relative path
2001     HACKDIR='${bindir}/'$enable_subdir
2002   fi
2003 fi
2004
2005 # canonicalize slashes.
2006 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
2007
2008
2009 # If we find X, set shell vars x_includes and x_libraries to the
2010 # paths, otherwise set no_x=yes.
2011 # Uses ac_ vars as temps to allow command line to override cache and checks.
2012 # --without-x overrides everything else, but does not touch the cache.
2013 echo $ac_n "checking for X""... $ac_c" 1>&6
2014 echo "configure:2026: checking for X" >&5
2015
2016 # Check whether --with-x or --without-x was given.
2017 if test "${with_x+set}" = set; then
2018   withval="$with_x"
2019   :
2020 fi
2021
2022 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
2023 if test "x$with_x" = xno; then
2024   # The user explicitly disabled X.
2025   have_x=disabled
2026 else
2027   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
2028     # Both variables are already set.
2029     have_x=yes
2030   else
2031 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
2032   echo $ac_n "(cached) $ac_c" 1>&6
2033 else
2034   # One or both of the vars are not set, and there is no cached value.
2035 ac_x_includes=NO ac_x_libraries=NO
2036 rm -fr conftestdir
2037 if mkdir conftestdir; then
2038   cd conftestdir
2039   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2040   cat > Imakefile <<'EOF'
2041 acfindx:
2042         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
2043 EOF
2044   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2045     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2046     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2047     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
2048     for ac_extension in a so sl; do
2049       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
2050         test -f $ac_im_libdir/libX11.$ac_extension; then
2051         ac_im_usrlibdir=$ac_im_libdir; break
2052       fi
2053     done
2054     # Screen out bogus values from the imake configuration.  They are
2055     # bogus both because they are the default anyway, and because
2056     # using them would break gcc on systems where it needs fixed includes.
2057     case "$ac_im_incroot" in
2058         /usr/include) ;;
2059         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
2060     esac
2061     case "$ac_im_usrlibdir" in
2062         /usr/lib | /lib) ;;
2063         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
2064     esac
2065   fi
2066   cd ..
2067   rm -fr conftestdir
2068 fi
2069
2070 if test "$ac_x_includes" = NO; then
2071   # Guess where to find include files, by looking for this one X11 .h file.
2072   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
2073
2074   # First, try using that file with no special directory specified.
2075 cat > conftest.$ac_ext <<EOF
2076 #line 2088 "configure"
2077 #include "confdefs.h"
2078 #include <$x_direct_test_include>
2079 EOF
2080 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2081 { (eval echo configure:2093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2082 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2083 if test -z "$ac_err"; then
2084   rm -rf conftest*
2085   # We can compile using X headers with no special include directory.
2086 ac_x_includes=
2087 else
2088   echo "$ac_err" >&5
2089   echo "configure: failed program was:" >&5
2090   cat conftest.$ac_ext >&5
2091   rm -rf conftest*
2092   # Look for the header file in a standard set of common directories.
2093 # Check X11 before X11Rn because it is often a symlink to the current release.
2094   for ac_dir in               \
2095     /usr/X11/include          \
2096     /usr/X11R6/include        \
2097     /usr/X11R5/include        \
2098     /usr/X11R4/include        \
2099                               \
2100     /usr/include/X11          \
2101     /usr/include/X11R6        \
2102     /usr/include/X11R5        \
2103     /usr/include/X11R4        \
2104                               \
2105     /usr/local/X11/include    \
2106     /usr/local/X11R6/include  \
2107     /usr/local/X11R5/include  \
2108     /usr/local/X11R4/include  \
2109                               \
2110     /usr/local/include/X11    \
2111     /usr/local/include/X11R6  \
2112     /usr/local/include/X11R5  \
2113     /usr/local/include/X11R4  \
2114                               \
2115     /usr/X386/include         \
2116     /usr/x386/include         \
2117     /usr/XFree86/include/X11  \
2118                               \
2119     /usr/include              \
2120     /usr/local/include        \
2121     /usr/unsupported/include  \
2122     /usr/athena/include       \
2123     /usr/local/x11r5/include  \
2124     /usr/lpp/Xamples/include  \
2125                               \
2126     /usr/openwin/include      \
2127     /usr/openwin/share/include \
2128     ; \
2129   do
2130     if test -r "$ac_dir/$x_direct_test_include"; then
2131       ac_x_includes=$ac_dir
2132       break
2133     fi
2134   done
2135 fi
2136 rm -f conftest*
2137 fi # $ac_x_includes = NO
2138
2139 if test "$ac_x_libraries" = NO; then
2140   # Check for the libraries.
2141
2142   test -z "$x_direct_test_library" && x_direct_test_library=Xt
2143   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2144
2145   # See if we find them without any special options.
2146   # Don't add to $LIBS permanently.
2147   ac_save_LIBS="$LIBS"
2148   LIBS="-l$x_direct_test_library $LIBS"
2149 cat > conftest.$ac_ext <<EOF
2150 #line 2162 "configure"
2151 #include "confdefs.h"
2152
2153 int main() {
2154 ${x_direct_test_function}()
2155 ; return 0; }
2156 EOF
2157 if { (eval echo configure:2169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2158   rm -rf conftest*
2159   LIBS="$ac_save_LIBS"
2160 # We can link X programs with no special library path.
2161 ac_x_libraries=
2162 else
2163   echo "configure: failed program was:" >&5
2164   cat conftest.$ac_ext >&5
2165   rm -rf conftest*
2166   LIBS="$ac_save_LIBS"
2167 # First see if replacing the include by lib works.
2168 # Check X11 before X11Rn because it is often a symlink to the current release.
2169 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2170     /usr/X11/lib          \
2171     /usr/X11R6/lib        \
2172     /usr/X11R5/lib        \
2173     /usr/X11R4/lib        \
2174                           \
2175     /usr/lib/X11          \
2176     /usr/lib/X11R6        \
2177     /usr/lib/X11R5        \
2178     /usr/lib/X11R4        \
2179                           \
2180     /usr/local/X11/lib    \
2181     /usr/local/X11R6/lib  \
2182     /usr/local/X11R5/lib  \
2183     /usr/local/X11R4/lib  \
2184                           \
2185     /usr/local/lib/X11    \
2186     /usr/local/lib/X11R6  \
2187     /usr/local/lib/X11R5  \
2188     /usr/local/lib/X11R4  \
2189                           \
2190     /usr/X386/lib         \
2191     /usr/x386/lib         \
2192     /usr/XFree86/lib/X11  \
2193                           \
2194     /usr/lib              \
2195     /usr/local/lib        \
2196     /usr/unsupported/lib  \
2197     /usr/athena/lib       \
2198     /usr/local/x11r5/lib  \
2199     /usr/lpp/Xamples/lib  \
2200     /lib/usr/lib/X11      \
2201                           \
2202     /usr/openwin/lib      \
2203     /usr/openwin/share/lib \
2204     ; \
2205 do
2206   for ac_extension in a so sl; do
2207     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2208       ac_x_libraries=$ac_dir
2209       break 2
2210     fi
2211   done
2212 done
2213 fi
2214 rm -f conftest*
2215 fi # $ac_x_libraries = NO
2216
2217 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2218   # Didn't find X anywhere.  Cache the known absence of X.
2219   ac_cv_have_x="have_x=no"
2220 else
2221   # Record where we found X for the cache.
2222   ac_cv_have_x="have_x=yes \
2223                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2224 fi
2225 fi
2226   fi
2227   eval "$ac_cv_have_x"
2228 fi # $with_x != no
2229
2230 if test "$have_x" != yes; then
2231   echo "$ac_t""$have_x" 1>&6
2232   no_x=yes
2233 else
2234   # If each of the values was on the command line, it overrides each guess.
2235   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2236   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2237   # Update the cache value to reflect the command line values.
2238   ac_cv_have_x="have_x=yes \
2239                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2240   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2241 fi
2242
2243 if test "$no_x" = yes; then
2244   # Not all programs may use this symbol, but it does not hurt to define it.
2245   cat >> confdefs.h <<\EOF
2246 #define X_DISPLAY_MISSING 1
2247 EOF
2248
2249   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2250 else
2251   if test -n "$x_includes"; then
2252     X_CFLAGS="$X_CFLAGS -I$x_includes"
2253   fi
2254
2255   # It would also be nice to do this for all -L options, not just this one.
2256   if test -n "$x_libraries"; then
2257     X_LIBS="$X_LIBS -L$x_libraries"
2258     # For Solaris; some versions of Sun CC require a space after -R and
2259     # others require no space.  Words are not sufficient . . . .
2260     case "`(uname -sr) 2>/dev/null`" in
2261     "SunOS 5"*)
2262       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2263 echo "configure:2275: checking whether -R must be followed by a space" >&5
2264       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2265       cat > conftest.$ac_ext <<EOF
2266 #line 2278 "configure"
2267 #include "confdefs.h"
2268
2269 int main() {
2270
2271 ; return 0; }
2272 EOF
2273 if { (eval echo configure:2285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2274   rm -rf conftest*
2275   ac_R_nospace=yes
2276 else
2277   echo "configure: failed program was:" >&5
2278   cat conftest.$ac_ext >&5
2279   rm -rf conftest*
2280   ac_R_nospace=no
2281 fi
2282 rm -f conftest*
2283       if test $ac_R_nospace = yes; then
2284         echo "$ac_t""no" 1>&6
2285         X_LIBS="$X_LIBS -R$x_libraries"
2286       else
2287         LIBS="$ac_xsave_LIBS -R $x_libraries"
2288         cat > conftest.$ac_ext <<EOF
2289 #line 2301 "configure"
2290 #include "confdefs.h"
2291
2292 int main() {
2293
2294 ; return 0; }
2295 EOF
2296 if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2297   rm -rf conftest*
2298   ac_R_space=yes
2299 else
2300   echo "configure: failed program was:" >&5
2301   cat conftest.$ac_ext >&5
2302   rm -rf conftest*
2303   ac_R_space=no
2304 fi
2305 rm -f conftest*
2306         if test $ac_R_space = yes; then
2307           echo "$ac_t""yes" 1>&6
2308           X_LIBS="$X_LIBS -R $x_libraries"
2309         else
2310           echo "$ac_t""neither works" 1>&6
2311         fi
2312       fi
2313       LIBS="$ac_xsave_LIBS"
2314     esac
2315   fi
2316
2317   # Check for system-dependent libraries X programs must link with.
2318   # Do this before checking for the system-independent R6 libraries
2319   # (-lICE), since we may need -lsocket or whatever for X linking.
2320
2321   if test "$ISC" = yes; then
2322     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2323   else
2324     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2325     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2326     # the Alpha needs dnet_stub (dnet does not exist).
2327     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2328 echo "configure:2340: checking for dnet_ntoa in -ldnet" >&5
2329 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2330 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2331   echo $ac_n "(cached) $ac_c" 1>&6
2332 else
2333   ac_save_LIBS="$LIBS"
2334 LIBS="-ldnet  $LIBS"
2335 cat > conftest.$ac_ext <<EOF
2336 #line 2348 "configure"
2337 #include "confdefs.h"
2338 /* Override any gcc2 internal prototype to avoid an error.  */
2339 /* We use char because int might match the return type of a gcc2
2340     builtin and then its argument prototype would still apply.  */
2341 char dnet_ntoa();
2342
2343 int main() {
2344 dnet_ntoa()
2345 ; return 0; }
2346 EOF
2347 if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2348   rm -rf conftest*
2349   eval "ac_cv_lib_$ac_lib_var=yes"
2350 else
2351   echo "configure: failed program was:" >&5
2352   cat conftest.$ac_ext >&5
2353   rm -rf conftest*
2354   eval "ac_cv_lib_$ac_lib_var=no"
2355 fi
2356 rm -f conftest*
2357 LIBS="$ac_save_LIBS"
2358
2359 fi
2360 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2361   echo "$ac_t""yes" 1>&6
2362   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2363 else
2364   echo "$ac_t""no" 1>&6
2365 fi
2366
2367     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2368       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2369 echo "configure:2381: checking for dnet_ntoa in -ldnet_stub" >&5
2370 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2371 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2372   echo $ac_n "(cached) $ac_c" 1>&6
2373 else
2374   ac_save_LIBS="$LIBS"
2375 LIBS="-ldnet_stub  $LIBS"
2376 cat > conftest.$ac_ext <<EOF
2377 #line 2389 "configure"
2378 #include "confdefs.h"
2379 /* Override any gcc2 internal prototype to avoid an error.  */
2380 /* We use char because int might match the return type of a gcc2
2381     builtin and then its argument prototype would still apply.  */
2382 char dnet_ntoa();
2383
2384 int main() {
2385 dnet_ntoa()
2386 ; return 0; }
2387 EOF
2388 if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2389   rm -rf conftest*
2390   eval "ac_cv_lib_$ac_lib_var=yes"
2391 else
2392   echo "configure: failed program was:" >&5
2393   cat conftest.$ac_ext >&5
2394   rm -rf conftest*
2395   eval "ac_cv_lib_$ac_lib_var=no"
2396 fi
2397 rm -f conftest*
2398 LIBS="$ac_save_LIBS"
2399
2400 fi
2401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2402   echo "$ac_t""yes" 1>&6
2403   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2404 else
2405   echo "$ac_t""no" 1>&6
2406 fi
2407
2408     fi
2409
2410     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2411     # to get the SysV transport functions.
2412     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2413     # needs -lnsl.
2414     # The nsl library prevents programs from opening the X display
2415     # on Irix 5.2, according to dickey@clark.net.
2416     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2417 echo "configure:2429: checking for gethostbyname" >&5
2418 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2419   echo $ac_n "(cached) $ac_c" 1>&6
2420 else
2421   cat > conftest.$ac_ext <<EOF
2422 #line 2434 "configure"
2423 #include "confdefs.h"
2424 /* System header to define __stub macros and hopefully few prototypes,
2425     which can conflict with char gethostbyname(); below.  */
2426 #include <assert.h>
2427 /* Override any gcc2 internal prototype to avoid an error.  */
2428 /* We use char because int might match the return type of a gcc2
2429     builtin and then its argument prototype would still apply.  */
2430 char gethostbyname();
2431
2432 int main() {
2433
2434 /* The GNU C library defines this for functions which it implements
2435     to always fail with ENOSYS.  Some functions are actually named
2436     something starting with __ and the normal name is an alias.  */
2437 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2438 choke me
2439 #else
2440 gethostbyname();
2441 #endif
2442
2443 ; return 0; }
2444 EOF
2445 if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2446   rm -rf conftest*
2447   eval "ac_cv_func_gethostbyname=yes"
2448 else
2449   echo "configure: failed program was:" >&5
2450   cat conftest.$ac_ext >&5
2451   rm -rf conftest*
2452   eval "ac_cv_func_gethostbyname=no"
2453 fi
2454 rm -f conftest*
2455 fi
2456
2457 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2458   echo "$ac_t""yes" 1>&6
2459   :
2460 else
2461   echo "$ac_t""no" 1>&6
2462 fi
2463
2464     if test $ac_cv_func_gethostbyname = no; then
2465       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2466 echo "configure:2478: checking for gethostbyname in -lnsl" >&5
2467 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2468 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2469   echo $ac_n "(cached) $ac_c" 1>&6
2470 else
2471   ac_save_LIBS="$LIBS"
2472 LIBS="-lnsl  $LIBS"
2473 cat > conftest.$ac_ext <<EOF
2474 #line 2486 "configure"
2475 #include "confdefs.h"
2476 /* Override any gcc2 internal prototype to avoid an error.  */
2477 /* We use char because int might match the return type of a gcc2
2478     builtin and then its argument prototype would still apply.  */
2479 char gethostbyname();
2480
2481 int main() {
2482 gethostbyname()
2483 ; return 0; }
2484 EOF
2485 if { (eval echo configure:2497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2486   rm -rf conftest*
2487   eval "ac_cv_lib_$ac_lib_var=yes"
2488 else
2489   echo "configure: failed program was:" >&5
2490   cat conftest.$ac_ext >&5
2491   rm -rf conftest*
2492   eval "ac_cv_lib_$ac_lib_var=no"
2493 fi
2494 rm -f conftest*
2495 LIBS="$ac_save_LIBS"
2496
2497 fi
2498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2499   echo "$ac_t""yes" 1>&6
2500   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2501 else
2502   echo "$ac_t""no" 1>&6
2503 fi
2504
2505     fi
2506
2507     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2508     # socket/setsockopt and other routines are undefined under SCO ODT
2509     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2510     # on later versions), says simon@lia.di.epfl.ch: it contains
2511     # gethostby* variants that don't use the nameserver (or something).
2512     # -lsocket must be given before -lnsl if both are needed.
2513     # We assume that if connect needs -lnsl, so does gethostbyname.
2514     echo $ac_n "checking for connect""... $ac_c" 1>&6
2515 echo "configure:2527: checking for connect" >&5
2516 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2517   echo $ac_n "(cached) $ac_c" 1>&6
2518 else
2519   cat > conftest.$ac_ext <<EOF
2520 #line 2532 "configure"
2521 #include "confdefs.h"
2522 /* System header to define __stub macros and hopefully few prototypes,
2523     which can conflict with char connect(); below.  */
2524 #include <assert.h>
2525 /* Override any gcc2 internal prototype to avoid an error.  */
2526 /* We use char because int might match the return type of a gcc2
2527     builtin and then its argument prototype would still apply.  */
2528 char connect();
2529
2530 int main() {
2531
2532 /* The GNU C library defines this for functions which it implements
2533     to always fail with ENOSYS.  Some functions are actually named
2534     something starting with __ and the normal name is an alias.  */
2535 #if defined (__stub_connect) || defined (__stub___connect)
2536 choke me
2537 #else
2538 connect();
2539 #endif
2540
2541 ; return 0; }
2542 EOF
2543 if { (eval echo configure:2555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2544   rm -rf conftest*
2545   eval "ac_cv_func_connect=yes"
2546 else
2547   echo "configure: failed program was:" >&5
2548   cat conftest.$ac_ext >&5
2549   rm -rf conftest*
2550   eval "ac_cv_func_connect=no"
2551 fi
2552 rm -f conftest*
2553 fi
2554
2555 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2556   echo "$ac_t""yes" 1>&6
2557   :
2558 else
2559   echo "$ac_t""no" 1>&6
2560 fi
2561
2562     if test $ac_cv_func_connect = no; then
2563       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2564 echo "configure:2576: checking for connect in -lsocket" >&5
2565 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2566 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2567   echo $ac_n "(cached) $ac_c" 1>&6
2568 else
2569   ac_save_LIBS="$LIBS"
2570 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2571 cat > conftest.$ac_ext <<EOF
2572 #line 2584 "configure"
2573 #include "confdefs.h"
2574 /* Override any gcc2 internal prototype to avoid an error.  */
2575 /* We use char because int might match the return type of a gcc2
2576     builtin and then its argument prototype would still apply.  */
2577 char connect();
2578
2579 int main() {
2580 connect()
2581 ; return 0; }
2582 EOF
2583 if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2584   rm -rf conftest*
2585   eval "ac_cv_lib_$ac_lib_var=yes"
2586 else
2587   echo "configure: failed program was:" >&5
2588   cat conftest.$ac_ext >&5
2589   rm -rf conftest*
2590   eval "ac_cv_lib_$ac_lib_var=no"
2591 fi
2592 rm -f conftest*
2593 LIBS="$ac_save_LIBS"
2594
2595 fi
2596 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2597   echo "$ac_t""yes" 1>&6
2598   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
2599 else
2600   echo "$ac_t""no" 1>&6
2601 fi
2602
2603     fi
2604
2605     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
2606     echo $ac_n "checking for remove""... $ac_c" 1>&6
2607 echo "configure:2619: checking for remove" >&5
2608 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
2609   echo $ac_n "(cached) $ac_c" 1>&6
2610 else
2611   cat > conftest.$ac_ext <<EOF
2612 #line 2624 "configure"
2613 #include "confdefs.h"
2614 /* System header to define __stub macros and hopefully few prototypes,
2615     which can conflict with char remove(); below.  */
2616 #include <assert.h>
2617 /* Override any gcc2 internal prototype to avoid an error.  */
2618 /* We use char because int might match the return type of a gcc2
2619     builtin and then its argument prototype would still apply.  */
2620 char remove();
2621
2622 int main() {
2623
2624 /* The GNU C library defines this for functions which it implements
2625     to always fail with ENOSYS.  Some functions are actually named
2626     something starting with __ and the normal name is an alias.  */
2627 #if defined (__stub_remove) || defined (__stub___remove)
2628 choke me
2629 #else
2630 remove();
2631 #endif
2632
2633 ; return 0; }
2634 EOF
2635 if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2636   rm -rf conftest*
2637   eval "ac_cv_func_remove=yes"
2638 else
2639   echo "configure: failed program was:" >&5
2640   cat conftest.$ac_ext >&5
2641   rm -rf conftest*
2642   eval "ac_cv_func_remove=no"
2643 fi
2644 rm -f conftest*
2645 fi
2646
2647 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
2648   echo "$ac_t""yes" 1>&6
2649   :
2650 else
2651   echo "$ac_t""no" 1>&6
2652 fi
2653
2654     if test $ac_cv_func_remove = no; then
2655       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
2656 echo "configure:2668: checking for remove in -lposix" >&5
2657 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
2658 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2659   echo $ac_n "(cached) $ac_c" 1>&6
2660 else
2661   ac_save_LIBS="$LIBS"
2662 LIBS="-lposix  $LIBS"
2663 cat > conftest.$ac_ext <<EOF
2664 #line 2676 "configure"
2665 #include "confdefs.h"
2666 /* Override any gcc2 internal prototype to avoid an error.  */
2667 /* We use char because int might match the return type of a gcc2
2668     builtin and then its argument prototype would still apply.  */
2669 char remove();
2670
2671 int main() {
2672 remove()
2673 ; return 0; }
2674 EOF
2675 if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2676   rm -rf conftest*
2677   eval "ac_cv_lib_$ac_lib_var=yes"
2678 else
2679   echo "configure: failed program was:" >&5
2680   cat conftest.$ac_ext >&5
2681   rm -rf conftest*
2682   eval "ac_cv_lib_$ac_lib_var=no"
2683 fi
2684 rm -f conftest*
2685 LIBS="$ac_save_LIBS"
2686
2687 fi
2688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2689   echo "$ac_t""yes" 1>&6
2690   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
2691 else
2692   echo "$ac_t""no" 1>&6
2693 fi
2694
2695     fi
2696
2697     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2698     echo $ac_n "checking for shmat""... $ac_c" 1>&6
2699 echo "configure:2711: checking for shmat" >&5
2700 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
2701   echo $ac_n "(cached) $ac_c" 1>&6
2702 else
2703   cat > conftest.$ac_ext <<EOF
2704 #line 2716 "configure"
2705 #include "confdefs.h"
2706 /* System header to define __stub macros and hopefully few prototypes,
2707     which can conflict with char shmat(); below.  */
2708 #include <assert.h>
2709 /* Override any gcc2 internal prototype to avoid an error.  */
2710 /* We use char because int might match the return type of a gcc2
2711     builtin and then its argument prototype would still apply.  */
2712 char shmat();
2713
2714 int main() {
2715
2716 /* The GNU C library defines this for functions which it implements
2717     to always fail with ENOSYS.  Some functions are actually named
2718     something starting with __ and the normal name is an alias.  */
2719 #if defined (__stub_shmat) || defined (__stub___shmat)
2720 choke me
2721 #else
2722 shmat();
2723 #endif
2724
2725 ; return 0; }
2726 EOF
2727 if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2728   rm -rf conftest*
2729   eval "ac_cv_func_shmat=yes"
2730 else
2731   echo "configure: failed program was:" >&5
2732   cat conftest.$ac_ext >&5
2733   rm -rf conftest*
2734   eval "ac_cv_func_shmat=no"
2735 fi
2736 rm -f conftest*
2737 fi
2738
2739 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
2740   echo "$ac_t""yes" 1>&6
2741   :
2742 else
2743   echo "$ac_t""no" 1>&6
2744 fi
2745
2746     if test $ac_cv_func_shmat = no; then
2747       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
2748 echo "configure:2760: checking for shmat in -lipc" >&5
2749 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
2750 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2751   echo $ac_n "(cached) $ac_c" 1>&6
2752 else
2753   ac_save_LIBS="$LIBS"
2754 LIBS="-lipc  $LIBS"
2755 cat > conftest.$ac_ext <<EOF
2756 #line 2768 "configure"
2757 #include "confdefs.h"
2758 /* Override any gcc2 internal prototype to avoid an error.  */
2759 /* We use char because int might match the return type of a gcc2
2760     builtin and then its argument prototype would still apply.  */
2761 char shmat();
2762
2763 int main() {
2764 shmat()
2765 ; return 0; }
2766 EOF
2767 if { (eval echo configure:2779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2768   rm -rf conftest*
2769   eval "ac_cv_lib_$ac_lib_var=yes"
2770 else
2771   echo "configure: failed program was:" >&5
2772   cat conftest.$ac_ext >&5
2773   rm -rf conftest*
2774   eval "ac_cv_lib_$ac_lib_var=no"
2775 fi
2776 rm -f conftest*
2777 LIBS="$ac_save_LIBS"
2778
2779 fi
2780 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2781   echo "$ac_t""yes" 1>&6
2782   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
2783 else
2784   echo "$ac_t""no" 1>&6
2785 fi
2786
2787     fi
2788   fi
2789
2790   # Check for libraries that X11R6 Xt/Xaw programs need.
2791   ac_save_LDFLAGS="$LDFLAGS"
2792   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
2793   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
2794   # check for ICE first), but we must link in the order -lSM -lICE or
2795   # we get undefined symbols.  So assume we have SM if we have ICE.
2796   # These have to be linked with before -lX11, unlike the other
2797   # libraries we check for below, so use a different variable.
2798   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
2799   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
2800 echo "configure:2812: checking for IceConnectionNumber in -lICE" >&5
2801 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
2802 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2803   echo $ac_n "(cached) $ac_c" 1>&6
2804 else
2805   ac_save_LIBS="$LIBS"
2806 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
2807 cat > conftest.$ac_ext <<EOF
2808 #line 2820 "configure"
2809 #include "confdefs.h"
2810 /* Override any gcc2 internal prototype to avoid an error.  */
2811 /* We use char because int might match the return type of a gcc2
2812     builtin and then its argument prototype would still apply.  */
2813 char IceConnectionNumber();
2814
2815 int main() {
2816 IceConnectionNumber()
2817 ; return 0; }
2818 EOF
2819 if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2820   rm -rf conftest*
2821   eval "ac_cv_lib_$ac_lib_var=yes"
2822 else
2823   echo "configure: failed program was:" >&5
2824   cat conftest.$ac_ext >&5
2825   rm -rf conftest*
2826   eval "ac_cv_lib_$ac_lib_var=no"
2827 fi
2828 rm -f conftest*
2829 LIBS="$ac_save_LIBS"
2830
2831 fi
2832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2833   echo "$ac_t""yes" 1>&6
2834   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
2835 else
2836   echo "$ac_t""no" 1>&6
2837 fi
2838
2839   LDFLAGS="$ac_save_LDFLAGS"
2840
2841 fi
2842
2843
2844 if test "$have_x" != yes; then
2845   { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
2846 fi
2847
2848
2849 # Try and find the app-defaults directory.
2850 # It sucks that autoconf doesn't do this already...
2851 #
2852
2853
2854
2855
2856
2857
2858
2859
2860     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
2861 echo "configure:2873: checking for X app-defaults directory" >&5
2862 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
2863   echo $ac_n "(cached) $ac_c" 1>&6
2864 else
2865   
2866   rm -fr conftestdir
2867   if mkdir conftestdir; then
2868     cd conftestdir >&-
2869     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2870     cat > Imakefile <<'EOF'
2871 acfindx:
2872         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
2873 EOF
2874     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2875       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
2876       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2877     fi
2878     cd .. >&-
2879     rm -fr conftestdir
2880   fi
2881       if test x"$ac_x_app_defaults" = x; then
2882         
2883   # Look for the directory under a standard set of common directories.
2884   # Check X11 before X11Rn because it's often a symlink to the current release.
2885   for ac_dir in                                 \
2886     /usr/X11/lib/app-defaults                   \
2887     /usr/X11R6/lib/app-defaults                 \
2888     /usr/X11R6/lib/X11/app-defaults             \
2889     /usr/X11R5/lib/app-defaults                 \
2890     /usr/X11R5/lib/X11/app-defaults             \
2891     /usr/X11R4/lib/app-defaults                 \
2892     /usr/X11R4/lib/X11/app-defaults             \
2893                                                 \
2894     /usr/lib/X11/app-defaults                   \
2895     /usr/lib/X11R6/app-defaults                 \
2896     /usr/lib/X11R5/app-defaults                 \
2897     /usr/lib/X11R4/app-defaults                 \
2898                                                 \
2899     /usr/local/X11/lib/app-defaults             \
2900     /usr/local/X11R6/lib/app-defaults           \
2901     /usr/local/X11R5/lib/app-defaults           \
2902     /usr/local/X11R4/lib/app-defaults           \
2903                                                 \
2904     /usr/local/lib/X11/app-defaults             \
2905     /usr/local/lib/X11R6/app-defaults           \
2906     /usr/local/lib/X11R6/X11/app-defaults       \
2907     /usr/local/lib/X11R5/app-defaults           \
2908     /usr/local/lib/X11R5/X11/app-defaults       \
2909     /usr/local/lib/X11R4/app-defaults           \
2910     /usr/local/lib/X11R4/X11/app-defaults       \
2911                                                 \
2912     /usr/X386/lib/X11/app-defaults              \
2913     /usr/x386/lib/X11/app-defaults              \
2914     /usr/XFree86/lib/X11/app-defaults           \
2915                                                 \
2916     /usr/lib/X11/app-defaults                   \
2917     /usr/local/lib/X11/app-defaults             \
2918     /usr/unsupported/lib/X11/app-defaults       \
2919     /usr/athena/lib/X11/app-defaults            \
2920     /usr/local/x11r5/lib/X11/app-defaults       \
2921     /usr/lpp/Xamples/lib/X11/app-defaults       \
2922     /lib/usr/lib/X11/app-defaults               \
2923                                                 \
2924     /usr/openwin/lib/app-defaults               \
2925     /usr/openwin/lib/X11/app-defaults           \
2926     /usr/openwin/share/lib/app-defaults         \
2927     /usr/openwin/share/lib/X11/app-defaults     \
2928                                                 \
2929     /X11R6/lib/app-defaults                     \
2930     /X11R5/lib/app-defaults                     \
2931     /X11R4/lib/app-defaults                     \
2932     ; \
2933   do
2934     if test -d "$ac_dir"; then
2935       ac_x_app_defaults=$ac_dir
2936       break
2937     fi
2938   done
2939
2940       fi
2941       if test x"$ac_x_app_defaults" = x; then
2942         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
2943       else
2944         # Record where we found app-defaults for the cache.
2945         ac_cv_x_app_defaults="$ac_x_app_defaults"
2946       fi
2947 fi
2948
2949 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
2950     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
2951
2952 APPDEFAULTS=$ac_x_app_defaults
2953
2954
2955 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
2956 #
2957
2958
2959 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
2960 #
2961
2962
2963 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
2964 #
2965
2966
2967
2968 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
2969 # Use this sparingly; it probably doesn't work very well on X programs.
2970 #
2971
2972
2973 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
2974 # (But not the -L directories!)
2975 #
2976
2977
2978
2979
2980 # Usage: HANDLE_X_PATH_ARG([variable_name],
2981 #                          [--command-line-option],
2982 #                          [descriptive string])
2983 #
2984 # All of the --with options take three forms:
2985 #
2986 #   --with-foo (or --with-foo=yes)
2987 #   --without-foo (or --with-foo=no)
2988 #   --with-foo=/DIR
2989 #
2990 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
2991 # a directory (string beginning with a slash) it checks to see whether
2992 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
2993 # as appropriate.
2994 #
2995
2996
2997
2998
2999 # check for the HP XHPDisableReset server extension headers.
3000 #
3001
3002   ac_save_CPPFLAGS="$CPPFLAGS"
3003   if test \! -z "$includedir" ; then 
3004     CPPFLAGS="$CPPFLAGS -I$includedir"
3005   fi
3006   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3007   cat > conftest.$ac_ext <<EOF
3008 #line 3020 "configure"
3009 #include "confdefs.h"
3010 #include <X11/XHPlib.h>
3011 EOF
3012 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3013   egrep "XHPDisableReset" >/dev/null 2>&1; then
3014   rm -rf conftest*
3015   cat >> confdefs.h <<\EOF
3016 #define HAVE_XHPDISABLERESET 1
3017 EOF
3018
3019                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
3020 fi
3021 rm -f conftest*
3022
3023   CPPFLAGS="$ac_save_CPPFLAGS"
3024
3025
3026 # Check for the availability of the XPointer typedef, and define it otherwise.
3027 #
3028 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
3029 echo "configure:3041: checking for XPointer" >&5
3030 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
3031   echo $ac_n "(cached) $ac_c" 1>&6
3032 else
3033   
3034   ac_save_CPPFLAGS="$CPPFLAGS"
3035   if test \! -z "$includedir" ; then 
3036     CPPFLAGS="$CPPFLAGS -I$includedir"
3037   fi
3038   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3039   cat > conftest.$ac_ext <<EOF
3040 #line 3052 "configure"
3041 #include "confdefs.h"
3042 #include <X11/Xlib.h>
3043 int main() {
3044 XPointer foo = (XPointer) 0;
3045 ; return 0; }
3046 EOF
3047 if { (eval echo configure:3059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3048   rm -rf conftest*
3049   ac_cv_xpointer=yes
3050 else
3051   echo "configure: failed program was:" >&5
3052   cat conftest.$ac_ext >&5
3053   rm -rf conftest*
3054   ac_cv_xpointer=no
3055 fi
3056 rm -f conftest*
3057   CPPFLAGS="$ac_save_CPPFLAGS"
3058 fi
3059
3060 echo "$ac_t""$ac_cv_xpointer" 1>&6
3061 if test "$ac_cv_xpointer" != yes; then
3062   cat >> confdefs.h <<\EOF
3063 #define XPointer char*
3064 EOF
3065
3066 fi
3067
3068
3069 # Random special-cases for certain pathological OSes.  You know who you are.
3070 #
3071 case "$host" in
3072   *-hpux*)
3073
3074     # The following arcana was gleaned from conversations with
3075     # Eric Schwartz <erics@col.hp.com>:
3076     #
3077     # On HPUX 10.x, the parts of X that HP considers "standard" live in
3078     # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
3079     # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
3080     # Also, there are symlinks from /usr/include/ and /usr/lib/ into
3081     # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
3082     # you don't need any -I or -L arguments.
3083     #
3084     # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
3085     # are the same division as 10.x.  However, there are no symlinks to
3086     # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
3087     # arguments are always necessary.
3088     #
3089     # However, X11R6 was available on HPUX 9.x as a patch: if that
3090     # patch was installed, then all of X11R6 went in to
3091     # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
3092     #
3093     # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
3094     # whether R5 was available as a patch; R6 undoubtedly was not.)
3095     #
3096     # So.  We try and use the highest numbered pair of
3097     # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
3098     # that are available.  We do not mix and match different versions
3099     # of X.
3100     #
3101     # Questions I still don't know the answers to: (do you?)
3102     #
3103     #   * Does HPUX 10.x come with /usr/contrib/X11R6/ standard?  
3104     #     Or does that need to be installed separately?
3105     #
3106     #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
3107     #     /usr/contrib/X11R6/ could be installed as a patch, what was in
3108     #     that contrib directory?  Did it contain so-called "standard"
3109     #     X11R6, or did it include Xaw and Xmu as well?  If the former,
3110     #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
3111     #     be a situation where one had to reach into the R5 headers and
3112     #     libs to find Xmu?  That is, must both R6 and R5 directories
3113     #     be on the -I and -L lists in that case?
3114     #
3115     for version in X11R6 X11R5 X11R4 ; do
3116       # if either pair of directories exists...
3117       if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib ; then
3118          # if contrib exists, use it...
3119          if test -d /usr/contrib/$version/lib ; then
3120            X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
3121            X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
3122          fi
3123          # if the "standard" one exists, use it.
3124          if test -d /usr/lib/$version ; then
3125            X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
3126            X_LIBS="$X_LIBS -L/usr/lib/$version"
3127          fi
3128          # since at least one of the pair exists, go no farther.
3129          break
3130       fi
3131     done
3132
3133     # Now find Motif.  Thanks for not making xmkmf find this by
3134     # default, you losers.
3135     #
3136     if test -d /usr/lib/Motif1.2 ; then
3137       X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
3138       X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
3139     elif test -d /usr/lib/Motif1.1 ; then
3140       X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
3141       X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
3142     fi
3143
3144     # Now let's check for the pseudo-standard locations for OpenGL and XPM.
3145     #
3146     if test -d /opt/Mesa/lib ; then
3147       X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
3148       X_LIBS="-L/opt/Mesa/lib $X_LIBS"
3149     fi
3150
3151     if test -d /opt/xpm/lib/X11 ; then
3152       X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
3153       X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
3154     fi
3155
3156     # On HPUX, default to installing in /opt/xscreensaver/ instead of
3157     # in /usr/local/, unless there is already an xscreensaver in
3158     # /usr/local/bin/.  This can be overridden with the --prefix arg
3159     # to configure.  I'm not sure this is the right thing to do, but
3160     # Richard Lloyd says so...
3161     #
3162     if test \! -x /usr/local/bin/xscreensaver ; then
3163       ac_default_prefix=/opt/xscreensaver
3164     fi
3165
3166   ;;
3167   *-solaris*)
3168
3169     # Thanks for not making xmkmf find this by default, pinheads.
3170     # And thanks for moving things around again, too.  Is this
3171     # really the standard location now?  What happened to the
3172     # joke that this kind of thing went in /opt?
3173     # cthomp says "answer: CDE (Common Disorganized Environment)"
3174     #
3175     if test -f /usr/dt/include/Xm/Xm.h ; then
3176       X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
3177       X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
3178
3179       # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
3180       echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
3181 echo "configure:3193: checking for regcmp in -lgen" >&5
3182 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
3183 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3184   echo $ac_n "(cached) $ac_c" 1>&6
3185 else
3186   ac_save_LIBS="$LIBS"
3187 LIBS="-lgen  $LIBS"
3188 cat > conftest.$ac_ext <<EOF
3189 #line 3201 "configure"
3190 #include "confdefs.h"
3191 /* Override any gcc2 internal prototype to avoid an error.  */
3192 /* We use char because int might match the return type of a gcc2
3193     builtin and then its argument prototype would still apply.  */
3194 char regcmp();
3195
3196 int main() {
3197 regcmp()
3198 ; return 0; }
3199 EOF
3200 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3201   rm -rf conftest*
3202   eval "ac_cv_lib_$ac_lib_var=yes"
3203 else
3204   echo "configure: failed program was:" >&5
3205   cat conftest.$ac_ext >&5
3206   rm -rf conftest*
3207   eval "ac_cv_lib_$ac_lib_var=no"
3208 fi
3209 rm -f conftest*
3210 LIBS="$ac_save_LIBS"
3211
3212 fi
3213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3214   echo "$ac_t""yes" 1>&6
3215   X_LIBS="$X_LIBS -lgen"
3216 else
3217   echo "$ac_t""no" 1>&6
3218 fi
3219
3220     fi
3221   ;;
3222 esac
3223
3224
3225
3226 # Check for Xmu (some fucked up vendors don't ship it...)
3227 #
3228 have_xmu=no
3229
3230   ac_save_CPPFLAGS="$CPPFLAGS"
3231   if test \! -z "$includedir" ; then 
3232     CPPFLAGS="$CPPFLAGS -I$includedir"
3233   fi
3234   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3235   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
3236 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
3237 echo "configure:3249: checking for X11/Xmu/Error.h" >&5
3238 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3239   echo $ac_n "(cached) $ac_c" 1>&6
3240 else
3241   cat > conftest.$ac_ext <<EOF
3242 #line 3254 "configure"
3243 #include "confdefs.h"
3244 #include <X11/Xmu/Error.h>
3245 EOF
3246 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3247 { (eval echo configure:3259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3248 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3249 if test -z "$ac_err"; then
3250   rm -rf conftest*
3251   eval "ac_cv_header_$ac_safe=yes"
3252 else
3253   echo "$ac_err" >&5
3254   echo "configure: failed program was:" >&5
3255   cat conftest.$ac_ext >&5
3256   rm -rf conftest*
3257   eval "ac_cv_header_$ac_safe=no"
3258 fi
3259 rm -f conftest*
3260 fi
3261 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3262   echo "$ac_t""yes" 1>&6
3263   have_xmu=yes
3264 else
3265   echo "$ac_t""no" 1>&6
3266 fi
3267
3268   CPPFLAGS="$ac_save_CPPFLAGS"
3269 if test "$have_xmu" = no ; then
3270   XMU_SRCS='$(UTILS_SRC)/xmu.c'
3271   XMU_OBJS='$(UTILS_BIN)/xmu.o'
3272 else
3273   XMU_SRCS=''
3274   XMU_OBJS=''
3275   SAVER_LIBS="-lXmu $SAVER_LIBS"
3276   HACK_LIBS="-lXmu $HACK_LIBS"
3277   TOOLKIT_LIBS="-lXmu $TOOLKIT_LIBS"
3278   cat >> confdefs.h <<\EOF
3279 #define HAVE_XMU 1
3280 EOF
3281
3282 fi
3283
3284
3285 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
3286 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
3287 #
3288 if test "$have_xmu" = yes ; then
3289   case "$host" in
3290     *-sunos4*)
3291     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
3292 echo "configure:3304: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
3293 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
3294   echo $ac_n "(cached) $ac_c" 1>&6
3295 else
3296   ac_save_LDFLAGS="$LDFLAGS"
3297                     if test \! -z "$x_libraries" ; then
3298                       LDFLAGS="$LDFLAGS -L$x_libraries"
3299                     fi
3300                     # Note: this trick never works!  (Generally.)
3301                     # We're only getting away with using AC_TRY_LINK
3302                     # with X libraries because we know it's SunOS.
3303                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
3304                     cat > conftest.$ac_ext <<EOF
3305 #line 3317 "configure"
3306 #include "confdefs.h"
3307
3308 int main() {
3309
3310 ; return 0; }
3311 EOF
3312 if { (eval echo configure:3324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3313   rm -rf conftest*
3314   ac_cv_sunos_xmu_bug=no
3315 else
3316   echo "configure: failed program was:" >&5
3317   cat conftest.$ac_ext >&5
3318   rm -rf conftest*
3319   ac_cv_sunos_xmu_bug=yes
3320 fi
3321 rm -f conftest*
3322                     LDFLAGS="$ac_save_LDFLAGS"
3323 fi
3324
3325 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3326     if test "$ac_cv_sunos_xmu_bug" = yes ; then
3327       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3328 echo "configure:3340: checking whether the compiler understands -static" >&5
3329 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3330   echo $ac_n "(cached) $ac_c" 1>&6
3331 else
3332   ac_save_LDFLAGS="$LDFLAGS"
3333                       LDFLAGS="$LDFLAGS -static"
3334                       cat > conftest.$ac_ext <<EOF
3335 #line 3347 "configure"
3336 #include "confdefs.h"
3337
3338 int main() {
3339
3340 ; return 0; }
3341 EOF
3342 if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3343   rm -rf conftest*
3344   ac_cv_ld_static=yes
3345 else
3346   echo "configure: failed program was:" >&5
3347   cat conftest.$ac_ext >&5
3348   rm -rf conftest*
3349   ac_cv_ld_static=no
3350 fi
3351 rm -f conftest*
3352                     LDFLAGS="$ac_save_LDFLAGS"
3353 fi
3354
3355 echo "$ac_t""$ac_cv_ld_static" 1>&6
3356       if test "$ac_cv_ld_static" = yes ; then
3357         LDFLAGS="$LDFLAGS -static"
3358       else
3359         LDFLAGS="$LDFLAGS -Bstatic"
3360       fi
3361     fi
3362     ;;
3363   esac
3364 fi
3365
3366
3367 # Check for the SGI SCREEN_SAVER server extension header.
3368 #
3369 have_sgi=no
3370 with_sgi_req=unspecified
3371 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3372 if test "${with_sgi_ext+set}" = set; then
3373   withval="$with_sgi_ext"
3374   with_sgi="$withval"; with_sgi_req="$withval"
3375 else
3376   with_sgi=yes
3377 fi
3378
3379
3380
3381    case "$with_sgi" in
3382     yes) ;;
3383     no)  ;;
3384
3385     /*)
3386      echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
3387 echo "configure:3399: checking for SGI SCREEN_SAVER headers" >&5
3388      d=$with_sgi/include
3389      if test -d $d; then
3390        X_CFLAGS="-I$d $X_CFLAGS"
3391        echo "$ac_t""$d" 1>&6
3392      else
3393        echo "$ac_t""not found ($d: no such directory)" 1>&6
3394      fi
3395
3396      echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
3397 echo "configure:3409: checking for SGI SCREEN_SAVER libs" >&5
3398      d=$with_sgi/lib
3399      if test -d $d; then
3400        X_LIBS="-L$d $X_LIBS"
3401        echo "$ac_t""$d" 1>&6
3402      else
3403        echo "$ac_t""not found ($d: no such directory)" 1>&6
3404      fi
3405
3406      # replace the directory string with "yes".
3407      with_sgi_req="yes"
3408      with_sgi=$with_sgi_req
3409      ;;
3410
3411     *)
3412      echo ""
3413      echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
3414      echo "       If it is a directory, then \`DIR/include' will be added to"
3415      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3416      exit 1
3417      ;;
3418    esac
3419
3420    # why is this necessary?
3421    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3422    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3423    withval=
3424   
3425
3426 if test "$with_sgi" = yes; then
3427   
3428   ac_save_CPPFLAGS="$CPPFLAGS"
3429   if test \! -z "$includedir" ; then 
3430     CPPFLAGS="$CPPFLAGS -I$includedir"
3431   fi
3432   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3433   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3434 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3435 echo "configure:3447: checking for X11/extensions/XScreenSaver.h" >&5
3436 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3437   echo $ac_n "(cached) $ac_c" 1>&6
3438 else
3439   cat > conftest.$ac_ext <<EOF
3440 #line 3452 "configure"
3441 #include "confdefs.h"
3442 #include <X11/extensions/XScreenSaver.h>
3443 EOF
3444 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3445 { (eval echo configure:3457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3446 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3447 if test -z "$ac_err"; then
3448   rm -rf conftest*
3449   eval "ac_cv_header_$ac_safe=yes"
3450 else
3451   echo "$ac_err" >&5
3452   echo "configure: failed program was:" >&5
3453   cat conftest.$ac_ext >&5
3454   rm -rf conftest*
3455   eval "ac_cv_header_$ac_safe=no"
3456 fi
3457 rm -f conftest*
3458 fi
3459 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3460   echo "$ac_t""yes" 1>&6
3461   have_sgi=yes
3462                      cat >> confdefs.h <<\EOF
3463 #define HAVE_SGI_SAVER_EXTENSION 1
3464 EOF
3465
3466 else
3467   echo "$ac_t""no" 1>&6
3468 fi
3469
3470   CPPFLAGS="$ac_save_CPPFLAGS"
3471
3472 elif test "$with_sgi" != no; then
3473   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3474   exit 1
3475 fi
3476
3477 # Check for the MIT-SCREEN-SAVER server extension header,
3478 # unless the SGI extension has already been found.
3479 #
3480 have_mit=no
3481 with_mit_req=unspecified
3482 # Check whether --with-mit-ext or --without-mit-ext was given.
3483 if test "${with_mit_ext+set}" = set; then
3484   withval="$with_mit_ext"
3485   with_mit="$withval"; with_mit_req="$withval"
3486 else
3487   with_mit=yes
3488 fi
3489
3490
3491
3492    case "$with_mit" in
3493     yes) ;;
3494     no)  ;;
3495
3496     /*)
3497      echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
3498 echo "configure:3510: checking for MIT-SCREEN-SAVER headers" >&5
3499      d=$with_mit/include
3500      if test -d $d; then
3501        X_CFLAGS="-I$d $X_CFLAGS"
3502        echo "$ac_t""$d" 1>&6
3503      else
3504        echo "$ac_t""not found ($d: no such directory)" 1>&6
3505      fi
3506
3507      echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
3508 echo "configure:3520: checking for MIT-SCREEN-SAVER libs" >&5
3509      d=$with_mit/lib
3510      if test -d $d; then
3511        X_LIBS="-L$d $X_LIBS"
3512        echo "$ac_t""$d" 1>&6
3513      else
3514        echo "$ac_t""not found ($d: no such directory)" 1>&6
3515      fi
3516
3517      # replace the directory string with "yes".
3518      with_mit_req="yes"
3519      with_mit=$with_mit_req
3520      ;;
3521
3522     *)
3523      echo ""
3524      echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory."
3525      echo "       If it is a directory, then \`DIR/include' will be added to"
3526      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3527      exit 1
3528      ;;
3529    esac
3530
3531    # why is this necessary?
3532    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3533    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3534    withval=
3535   
3536
3537 if test "$have_sgi" != yes; then
3538   if test "$with_mit" = yes; then
3539     
3540   ac_save_CPPFLAGS="$CPPFLAGS"
3541   if test \! -z "$includedir" ; then 
3542     CPPFLAGS="$CPPFLAGS -I$includedir"
3543   fi
3544   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3545   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3546 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3547 echo "configure:3559: checking for X11/extensions/scrnsaver.h" >&5
3548 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3549   echo $ac_n "(cached) $ac_c" 1>&6
3550 else
3551   cat > conftest.$ac_ext <<EOF
3552 #line 3564 "configure"
3553 #include "confdefs.h"
3554 #include <X11/extensions/scrnsaver.h>
3555 EOF
3556 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3557 { (eval echo configure:3569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3558 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3559 if test -z "$ac_err"; then
3560   rm -rf conftest*
3561   eval "ac_cv_header_$ac_safe=yes"
3562 else
3563   echo "$ac_err" >&5
3564   echo "configure: failed program was:" >&5
3565   cat conftest.$ac_ext >&5
3566   rm -rf conftest*
3567   eval "ac_cv_header_$ac_safe=no"
3568 fi
3569 rm -f conftest*
3570 fi
3571 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3572   echo "$ac_t""yes" 1>&6
3573   have_mit=yes
3574 else
3575   echo "$ac_t""no" 1>&6
3576 fi
3577
3578   CPPFLAGS="$ac_save_CPPFLAGS"
3579
3580     # Now check to see if it's really in the library; XF86Free-3.3 ships
3581     # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
3582     #
3583     if test "$have_mit" = yes; then
3584       
3585   ac_save_CPPFLAGS="$CPPFLAGS"
3586   ac_save_LDFLAGS="$LDFLAGS"
3587
3588   if test \! -z "$includedir" ; then 
3589     CPPFLAGS="$CPPFLAGS -I$includedir"
3590   fi
3591   # note: $X_CFLAGS includes $x_includes
3592   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3593
3594   if test \! -z "$libdir" ; then
3595     LDFLAGS="$LDFLAGS -L$libdir"
3596   fi
3597   # note: $X_LIBS includes $x_libraries
3598   LDFLAGS="$LDFLAGS $X_LIBS"
3599
3600   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
3601 echo "configure:3613: checking for XScreenSaverRegister in -lXext" >&5
3602 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3603 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   ac_save_LIBS="$LIBS"
3607 LIBS="-lXext -lm $LIBS"
3608 cat > conftest.$ac_ext <<EOF
3609 #line 3621 "configure"
3610 #include "confdefs.h"
3611 /* Override any gcc2 internal prototype to avoid an error.  */
3612 /* We use char because int might match the return type of a gcc2
3613     builtin and then its argument prototype would still apply.  */
3614 char XScreenSaverRegister();
3615
3616 int main() {
3617 XScreenSaverRegister()
3618 ; return 0; }
3619 EOF
3620 if { (eval echo configure:3632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3621   rm -rf conftest*
3622   eval "ac_cv_lib_$ac_lib_var=yes"
3623 else
3624   echo "configure: failed program was:" >&5
3625   cat conftest.$ac_ext >&5
3626   rm -rf conftest*
3627   eval "ac_cv_lib_$ac_lib_var=no"
3628 fi
3629 rm -f conftest*
3630 LIBS="$ac_save_LIBS"
3631
3632 fi
3633 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3634   echo "$ac_t""yes" 1>&6
3635     ac_tr_lib=HAVE_LIB`echo Xext | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3636     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3637   cat >> confdefs.h <<EOF
3638 #define $ac_tr_lib 1
3639 EOF
3640
3641   LIBS="-lXext $LIBS"
3642
3643 else
3644   echo "$ac_t""no" 1>&6
3645 have_mit=no
3646 fi
3647
3648   CPPFLAGS="$ac_save_CPPFLAGS"
3649   LDFLAGS="$ac_save_LDFLAGS"
3650
3651       if test "$have_mit" = no; then
3652         # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
3653         # of in Xext.  Thank you master, may I have another.
3654         
3655   ac_save_CPPFLAGS="$CPPFLAGS"
3656   ac_save_LDFLAGS="$LDFLAGS"
3657
3658   if test \! -z "$includedir" ; then 
3659     CPPFLAGS="$CPPFLAGS -I$includedir"
3660   fi
3661   # note: $X_CFLAGS includes $x_includes
3662   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3663
3664   if test \! -z "$libdir" ; then
3665     LDFLAGS="$LDFLAGS -L$libdir"
3666   fi
3667   # note: $X_LIBS includes $x_libraries
3668   LDFLAGS="$LDFLAGS $X_LIBS"
3669
3670   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
3671 echo "configure:3683: checking for XScreenSaverRegister in -lXExExt" >&5
3672 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3673 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3674   echo $ac_n "(cached) $ac_c" 1>&6
3675 else
3676   ac_save_LIBS="$LIBS"
3677 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
3678 cat > conftest.$ac_ext <<EOF
3679 #line 3691 "configure"
3680 #include "confdefs.h"
3681 /* Override any gcc2 internal prototype to avoid an error.  */
3682 /* We use char because int might match the return type of a gcc2
3683     builtin and then its argument prototype would still apply.  */
3684 char XScreenSaverRegister();
3685
3686 int main() {
3687 XScreenSaverRegister()
3688 ; return 0; }
3689 EOF
3690 if { (eval echo configure:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3691   rm -rf conftest*
3692   eval "ac_cv_lib_$ac_lib_var=yes"
3693 else
3694   echo "configure: failed program was:" >&5
3695   cat conftest.$ac_ext >&5
3696   rm -rf conftest*
3697   eval "ac_cv_lib_$ac_lib_var=no"
3698 fi
3699 rm -f conftest*
3700 LIBS="$ac_save_LIBS"
3701
3702 fi
3703 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3704   echo "$ac_t""yes" 1>&6
3705   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
3706 else
3707   echo "$ac_t""no" 1>&6
3708 fi
3709
3710   CPPFLAGS="$ac_save_CPPFLAGS"
3711   LDFLAGS="$ac_save_LDFLAGS"
3712       fi
3713
3714       if test "$have_mit" = no; then
3715         # Double fuck!  Looks like some versions of XFree86 (whichever version
3716         # it is that comes with RedHat Linux 2.0 -- I can't find a version 
3717         # number) put this garbage in Xss instead of Xext.  Thank you master,
3718         #  may I have another.
3719         
3720   ac_save_CPPFLAGS="$CPPFLAGS"
3721   ac_save_LDFLAGS="$LDFLAGS"
3722
3723   if test \! -z "$includedir" ; then 
3724     CPPFLAGS="$CPPFLAGS -I$includedir"
3725   fi
3726   # note: $X_CFLAGS includes $x_includes
3727   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3728
3729   if test \! -z "$libdir" ; then
3730     LDFLAGS="$LDFLAGS -L$libdir"
3731   fi
3732   # note: $X_LIBS includes $x_libraries
3733   LDFLAGS="$LDFLAGS $X_LIBS"
3734
3735   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
3736 echo "configure:3748: checking for XScreenSaverRegister in -lXss" >&5
3737 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3738 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3739   echo $ac_n "(cached) $ac_c" 1>&6
3740 else
3741   ac_save_LIBS="$LIBS"
3742 LIBS="-lXss -lX11 -lXext -lm $LIBS"
3743 cat > conftest.$ac_ext <<EOF
3744 #line 3756 "configure"
3745 #include "confdefs.h"
3746 /* Override any gcc2 internal prototype to avoid an error.  */
3747 /* We use char because int might match the return type of a gcc2
3748     builtin and then its argument prototype would still apply.  */
3749 char XScreenSaverRegister();
3750
3751 int main() {
3752 XScreenSaverRegister()
3753 ; return 0; }
3754 EOF
3755 if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3756   rm -rf conftest*
3757   eval "ac_cv_lib_$ac_lib_var=yes"
3758 else
3759   echo "configure: failed program was:" >&5
3760   cat conftest.$ac_ext >&5
3761   rm -rf conftest*
3762   eval "ac_cv_lib_$ac_lib_var=no"
3763 fi
3764 rm -f conftest*
3765 LIBS="$ac_save_LIBS"
3766
3767 fi
3768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3769   echo "$ac_t""yes" 1>&6
3770   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
3771 else
3772   echo "$ac_t""no" 1>&6
3773 fi
3774
3775   CPPFLAGS="$ac_save_CPPFLAGS"
3776   LDFLAGS="$ac_save_LDFLAGS"
3777       fi
3778
3779     if test "$have_mit" = yes; then
3780       cat >> confdefs.h <<\EOF
3781 #define HAVE_MIT_SAVER_EXTENSION 1
3782 EOF
3783
3784     fi
3785
3786     fi
3787
3788   elif test "$with_mit" != no; then
3789     echo "error: must be yes or no: --with-mit-ext=$with_mit"
3790     exit 1
3791   fi
3792 fi
3793
3794
3795 # Check for the XIDLE server extension header.
3796 #
3797 have_xidle=no
3798 with_xidle_req=unspecified
3799 # Check whether --with-xidle-ext or --without-xidle-ext was given.
3800 if test "${with_xidle_ext+set}" = set; then
3801   withval="$with_xidle_ext"
3802   with_xidle="$withval"; with_xidle_req="$withval"
3803 else
3804   with_xidle=yes
3805 fi
3806
3807
3808
3809    case "$with_xidle" in
3810     yes) ;;
3811     no)  ;;
3812
3813     /*)
3814      echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
3815 echo "configure:3827: checking for XIDLE headers" >&5
3816      d=$with_xidle/include
3817      if test -d $d; then
3818        X_CFLAGS="-I$d $X_CFLAGS"
3819        echo "$ac_t""$d" 1>&6
3820      else
3821        echo "$ac_t""not found ($d: no such directory)" 1>&6
3822      fi
3823
3824      echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
3825 echo "configure:3837: checking for XIDLE libs" >&5
3826      d=$with_xidle/lib
3827      if test -d $d; then
3828        X_LIBS="-L$d $X_LIBS"
3829        echo "$ac_t""$d" 1>&6
3830      else
3831        echo "$ac_t""not found ($d: no such directory)" 1>&6
3832      fi
3833
3834      # replace the directory string with "yes".
3835      with_xidle_req="yes"
3836      with_xidle=$with_xidle_req
3837      ;;
3838
3839     *)
3840      echo ""
3841      echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
3842      echo "       If it is a directory, then \`DIR/include' will be added to"
3843      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3844      exit 1
3845      ;;
3846    esac
3847
3848    # why is this necessary?
3849    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3850    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3851    withval=
3852   
3853
3854 if test "$with_xidle" = yes; then
3855   
3856   ac_save_CPPFLAGS="$CPPFLAGS"
3857   if test \! -z "$includedir" ; then 
3858     CPPFLAGS="$CPPFLAGS -I$includedir"
3859   fi
3860   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3861   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
3862 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
3863 echo "configure:3875: checking for X11/extensions/xidle.h" >&5
3864 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3865   echo $ac_n "(cached) $ac_c" 1>&6
3866 else
3867   cat > conftest.$ac_ext <<EOF
3868 #line 3880 "configure"
3869 #include "confdefs.h"
3870 #include <X11/extensions/xidle.h>
3871 EOF
3872 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3873 { (eval echo configure:3885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3874 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3875 if test -z "$ac_err"; then
3876   rm -rf conftest*
3877   eval "ac_cv_header_$ac_safe=yes"
3878 else
3879   echo "$ac_err" >&5
3880   echo "configure: failed program was:" >&5
3881   cat conftest.$ac_ext >&5
3882   rm -rf conftest*
3883   eval "ac_cv_header_$ac_safe=no"
3884 fi
3885 rm -f conftest*
3886 fi
3887 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3888   echo "$ac_t""yes" 1>&6
3889   have_xidle=yes
3890                      cat >> confdefs.h <<\EOF
3891 #define HAVE_XIDLE_EXTENSION 1
3892 EOF
3893
3894 else
3895   echo "$ac_t""no" 1>&6
3896 fi
3897
3898   CPPFLAGS="$ac_save_CPPFLAGS"
3899 elif test "$with_xidle" != no; then
3900   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
3901   exit 1
3902 fi
3903
3904
3905 # Check for the XSHM server extension header.
3906 #
3907 have_xshm=no
3908 with_xshm_req=unspecified
3909 # Check whether --with-xshm-ext or --without-xshm-ext was given.
3910 if test "${with_xshm_ext+set}" = set; then
3911   withval="$with_xshm_ext"
3912   with_xshm="$withval"; with_xshm_req="$withval"
3913 else
3914   with_xshm=yes
3915 fi
3916
3917
3918
3919    case "$with_xshm" in
3920     yes) ;;
3921     no)  ;;
3922
3923     /*)
3924      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
3925 echo "configure:3937: checking for XSHM headers" >&5
3926      d=$with_xshm/include
3927      if test -d $d; then
3928        X_CFLAGS="-I$d $X_CFLAGS"
3929        echo "$ac_t""$d" 1>&6
3930      else
3931        echo "$ac_t""not found ($d: no such directory)" 1>&6
3932      fi
3933
3934      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
3935 echo "configure:3947: checking for XSHM libs" >&5
3936      d=$with_xshm/lib
3937      if test -d $d; then
3938        X_LIBS="-L$d $X_LIBS"
3939        echo "$ac_t""$d" 1>&6
3940      else
3941        echo "$ac_t""not found ($d: no such directory)" 1>&6
3942      fi
3943
3944      # replace the directory string with "yes".
3945      with_xshm_req="yes"
3946      with_xshm=$with_xshm_req
3947      ;;
3948
3949     *)
3950      echo ""
3951      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
3952      echo "       If it is a directory, then \`DIR/include' will be added to"
3953      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3954      exit 1
3955      ;;
3956    esac
3957
3958    # why is this necessary?
3959    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3960    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3961    withval=
3962   
3963
3964 if test "$with_xshm" = yes; then
3965
3966   # first check for Xshm.h.
3967   
3968   ac_save_CPPFLAGS="$CPPFLAGS"
3969   if test \! -z "$includedir" ; then 
3970     CPPFLAGS="$CPPFLAGS -I$includedir"
3971   fi
3972   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3973   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
3974 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
3975 echo "configure:3987: checking for X11/extensions/XShm.h" >&5
3976 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3977   echo $ac_n "(cached) $ac_c" 1>&6
3978 else
3979   cat > conftest.$ac_ext <<EOF
3980 #line 3992 "configure"
3981 #include "confdefs.h"
3982 #include <X11/extensions/XShm.h>
3983 EOF
3984 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3985 { (eval echo configure:3997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3986 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3987 if test -z "$ac_err"; then
3988   rm -rf conftest*
3989   eval "ac_cv_header_$ac_safe=yes"
3990 else
3991   echo "$ac_err" >&5
3992   echo "configure: failed program was:" >&5
3993   cat conftest.$ac_ext >&5
3994   rm -rf conftest*
3995   eval "ac_cv_header_$ac_safe=no"
3996 fi
3997 rm -f conftest*
3998 fi
3999 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4000   echo "$ac_t""yes" 1>&6
4001   have_xshm=yes
4002 else
4003   echo "$ac_t""no" 1>&6
4004 fi
4005
4006   CPPFLAGS="$ac_save_CPPFLAGS"
4007
4008   # if that succeeded, then check for sys/ipc.h.
4009   if test "$have_xshm" = yes; then
4010     have_xshm=no
4011     
4012   ac_save_CPPFLAGS="$CPPFLAGS"
4013   if test \! -z "$includedir" ; then 
4014     CPPFLAGS="$CPPFLAGS -I$includedir"
4015   fi
4016   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4017   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
4018 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
4019 echo "configure:4031: checking for sys/ipc.h" >&5
4020 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4021   echo $ac_n "(cached) $ac_c" 1>&6
4022 else
4023   cat > conftest.$ac_ext <<EOF
4024 #line 4036 "configure"
4025 #include "confdefs.h"
4026 #include <sys/ipc.h>
4027 EOF
4028 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4029 { (eval echo configure:4041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4030 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4031 if test -z "$ac_err"; then
4032   rm -rf conftest*
4033   eval "ac_cv_header_$ac_safe=yes"
4034 else
4035   echo "$ac_err" >&5
4036   echo "configure: failed program was:" >&5
4037   cat conftest.$ac_ext >&5
4038   rm -rf conftest*
4039   eval "ac_cv_header_$ac_safe=no"
4040 fi
4041 rm -f conftest*
4042 fi
4043 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4044   echo "$ac_t""yes" 1>&6
4045   have_xshm=yes
4046 else
4047   echo "$ac_t""no" 1>&6
4048 fi
4049
4050   CPPFLAGS="$ac_save_CPPFLAGS"
4051   fi
4052
4053   # if that succeeded, then check for sys/shm.h.
4054   if test "$have_xshm" = yes; then
4055     have_xshm=no
4056     
4057   ac_save_CPPFLAGS="$CPPFLAGS"
4058   if test \! -z "$includedir" ; then 
4059     CPPFLAGS="$CPPFLAGS -I$includedir"
4060   fi
4061   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4062   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
4063 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
4064 echo "configure:4076: checking for sys/shm.h" >&5
4065 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4066   echo $ac_n "(cached) $ac_c" 1>&6
4067 else
4068   cat > conftest.$ac_ext <<EOF
4069 #line 4081 "configure"
4070 #include "confdefs.h"
4071 #include <sys/shm.h>
4072 EOF
4073 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4074 { (eval echo configure:4086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4075 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4076 if test -z "$ac_err"; then
4077   rm -rf conftest*
4078   eval "ac_cv_header_$ac_safe=yes"
4079 else
4080   echo "$ac_err" >&5
4081   echo "configure: failed program was:" >&5
4082   cat conftest.$ac_ext >&5
4083   rm -rf conftest*
4084   eval "ac_cv_header_$ac_safe=no"
4085 fi
4086 rm -f conftest*
4087 fi
4088 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4089   echo "$ac_t""yes" 1>&6
4090   have_xshm=yes
4091 else
4092   echo "$ac_t""no" 1>&6
4093 fi
4094
4095   CPPFLAGS="$ac_save_CPPFLAGS"
4096   fi
4097
4098   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
4099   # to exist, but the library code to not exist.  And even better, the library
4100   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
4101   # lib doesn't exist, give up.
4102   #
4103   case "$host" in
4104     *-aix*)
4105       have_xshm=no
4106       
4107   ac_save_CPPFLAGS="$CPPFLAGS"
4108   ac_save_LDFLAGS="$LDFLAGS"
4109
4110   if test \! -z "$includedir" ; then 
4111     CPPFLAGS="$CPPFLAGS -I$includedir"
4112   fi
4113   # note: $X_CFLAGS includes $x_includes
4114   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4115
4116   if test \! -z "$libdir" ; then
4117     LDFLAGS="$LDFLAGS -L$libdir"
4118   fi
4119   # note: $X_LIBS includes $x_libraries
4120   LDFLAGS="$LDFLAGS $X_LIBS"
4121
4122   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
4123 echo "configure:4135: checking for XShmQueryExtension in -lXextSam" >&5
4124 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
4125 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4126   echo $ac_n "(cached) $ac_c" 1>&6
4127 else
4128   ac_save_LIBS="$LIBS"
4129 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
4130 cat > conftest.$ac_ext <<EOF
4131 #line 4143 "configure"
4132 #include "confdefs.h"
4133 /* Override any gcc2 internal prototype to avoid an error.  */
4134 /* We use char because int might match the return type of a gcc2
4135     builtin and then its argument prototype would still apply.  */
4136 char XShmQueryExtension();
4137
4138 int main() {
4139 XShmQueryExtension()
4140 ; return 0; }
4141 EOF
4142 if { (eval echo configure:4154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4143   rm -rf conftest*
4144   eval "ac_cv_lib_$ac_lib_var=yes"
4145 else
4146   echo "configure: failed program was:" >&5
4147   cat conftest.$ac_ext >&5
4148   rm -rf conftest*
4149   eval "ac_cv_lib_$ac_lib_var=no"
4150 fi
4151 rm -f conftest*
4152 LIBS="$ac_save_LIBS"
4153
4154 fi
4155 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4156   echo "$ac_t""yes" 1>&6
4157   have_xshm=yes; SAVER_LIBS="$SAVER_LIBS -lXextSam"
4158 else
4159   echo "$ac_t""no" 1>&6
4160 fi
4161
4162   CPPFLAGS="$ac_save_CPPFLAGS"
4163   LDFLAGS="$ac_save_LDFLAGS"
4164     ;;
4165   esac
4166
4167   # if that succeeded, then we've really got it.
4168   if test "$have_xshm" = yes; then
4169     cat >> confdefs.h <<\EOF
4170 #define HAVE_XSHM_EXTENSION 1
4171 EOF
4172
4173   fi
4174
4175 elif test "$with_xshm" != no; then
4176   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
4177   exit 1
4178 fi
4179
4180
4181 # Check for the DOUBLE-BUFFER server extension header.
4182 #
4183 have_xdbe=no
4184 with_xdbe_req=unspecified
4185 # Check whether --with-xdbe-ext or --without-xdbe-ext was given.
4186 if test "${with_xdbe_ext+set}" = set; then
4187   withval="$with_xdbe_ext"
4188   with_xdbe="$withval"; with_xdbe_req="$withval"
4189 else
4190   with_xdbe=yes
4191 fi
4192
4193
4194
4195    case "$with_xdbe" in
4196     yes) ;;
4197     no)  ;;
4198
4199     /*)
4200      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
4201 echo "configure:4213: checking for DOUBLE-BUFFER headers" >&5
4202      d=$with_xdbe/include
4203      if test -d $d; then
4204        X_CFLAGS="-I$d $X_CFLAGS"
4205        echo "$ac_t""$d" 1>&6
4206      else
4207        echo "$ac_t""not found ($d: no such directory)" 1>&6
4208      fi
4209
4210      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
4211 echo "configure:4223: checking for DOUBLE-BUFFER libs" >&5
4212      d=$with_xdbe/lib
4213      if test -d $d; then
4214        X_LIBS="-L$d $X_LIBS"
4215        echo "$ac_t""$d" 1>&6
4216      else
4217        echo "$ac_t""not found ($d: no such directory)" 1>&6
4218      fi
4219
4220      # replace the directory string with "yes".
4221      with_xdbe_req="yes"
4222      with_xdbe=$with_xdbe_req
4223      ;;
4224
4225     *)
4226      echo ""
4227      echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
4228      echo "       If it is a directory, then \`DIR/include' will be added to"
4229      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4230      exit 1
4231      ;;
4232    esac
4233
4234    # why is this necessary?
4235    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4236    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4237    withval=
4238   
4239
4240 if test "$with_xdbe" = yes; then
4241
4242   
4243   ac_save_CPPFLAGS="$CPPFLAGS"
4244   if test \! -z "$includedir" ; then 
4245     CPPFLAGS="$CPPFLAGS -I$includedir"
4246   fi
4247   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4248   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
4249 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
4250 echo "configure:4262: checking for X11/extensions/Xdbe.h" >&5
4251 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4252   echo $ac_n "(cached) $ac_c" 1>&6
4253 else
4254   cat > conftest.$ac_ext <<EOF
4255 #line 4267 "configure"
4256 #include "confdefs.h"
4257 #include <X11/extensions/Xdbe.h>
4258 EOF
4259 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4260 { (eval echo configure:4272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4261 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4262 if test -z "$ac_err"; then
4263   rm -rf conftest*
4264   eval "ac_cv_header_$ac_safe=yes"
4265 else
4266   echo "$ac_err" >&5
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -rf conftest*
4270   eval "ac_cv_header_$ac_safe=no"
4271 fi
4272 rm -f conftest*
4273 fi
4274 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4275   echo "$ac_t""yes" 1>&6
4276   have_xdbe=yes
4277 else
4278   echo "$ac_t""no" 1>&6
4279 fi
4280
4281   CPPFLAGS="$ac_save_CPPFLAGS"
4282   if test "$have_xdbe" = yes; then
4283     cat >> confdefs.h <<\EOF
4284 #define HAVE_DOUBLE_BUFFER_EXTENSION 1
4285 EOF
4286     
4287   fi
4288
4289 elif test "$with_xdbe" != no; then
4290   echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
4291   exit 1
4292 fi
4293
4294
4295 # Check for the SGI-VIDEO-CONTROL server extension header.
4296 #
4297 have_sgivc=no
4298 with_sgivc_req=unspecified
4299 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
4300 if test "${with_sgivc_ext+set}" = set; then
4301   withval="$with_sgivc_ext"
4302   with_sgivc="$withval"; with_sgivc_req="$withval"
4303 else
4304   with_sgivc=yes
4305 fi
4306
4307
4308
4309    case "$with_sgivc" in
4310     yes) ;;
4311     no)  ;;
4312
4313     /*)
4314      echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
4315 echo "configure:4327: checking for SGI-VIDEO-CONTROL headers" >&5
4316      d=$with_sgivc/include
4317      if test -d $d; then
4318        X_CFLAGS="-I$d $X_CFLAGS"
4319        echo "$ac_t""$d" 1>&6
4320      else
4321        echo "$ac_t""not found ($d: no such directory)" 1>&6
4322      fi
4323
4324      echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
4325 echo "configure:4337: checking for SGI-VIDEO-CONTROL libs" >&5
4326      d=$with_sgivc/lib
4327      if test -d $d; then
4328        X_LIBS="-L$d $X_LIBS"
4329        echo "$ac_t""$d" 1>&6
4330      else
4331        echo "$ac_t""not found ($d: no such directory)" 1>&6
4332      fi
4333
4334      # replace the directory string with "yes".
4335      with_sgivc_req="yes"
4336      with_sgivc=$with_sgivc_req
4337      ;;
4338
4339     *)
4340      echo ""
4341      echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
4342      echo "       If it is a directory, then \`DIR/include' will be added to"
4343      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4344      exit 1
4345      ;;
4346    esac
4347
4348    # why is this necessary?
4349    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4350    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4351    withval=
4352   
4353
4354 if test "$with_sgivc" = yes; then
4355
4356   # first check for XSGIvc.h
4357   
4358   ac_save_CPPFLAGS="$CPPFLAGS"
4359   if test \! -z "$includedir" ; then 
4360     CPPFLAGS="$CPPFLAGS -I$includedir"
4361   fi
4362   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4363   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
4364 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
4365 echo "configure:4377: checking for X11/extensions/XSGIvc.h" >&5
4366 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4367   echo $ac_n "(cached) $ac_c" 1>&6
4368 else
4369   cat > conftest.$ac_ext <<EOF
4370 #line 4382 "configure"
4371 #include "confdefs.h"
4372 #include <X11/extensions/XSGIvc.h>
4373 EOF
4374 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4375 { (eval echo configure:4387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4376 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4377 if test -z "$ac_err"; then
4378   rm -rf conftest*
4379   eval "ac_cv_header_$ac_safe=yes"
4380 else
4381   echo "$ac_err" >&5
4382   echo "configure: failed program was:" >&5
4383   cat conftest.$ac_ext >&5
4384   rm -rf conftest*
4385   eval "ac_cv_header_$ac_safe=no"
4386 fi
4387 rm -f conftest*
4388 fi
4389 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4390   echo "$ac_t""yes" 1>&6
4391   have_sgivc=yes
4392 else
4393   echo "$ac_t""no" 1>&6
4394 fi
4395
4396   CPPFLAGS="$ac_save_CPPFLAGS"
4397
4398   # if that succeeded, then check for the -lXsgivc
4399   if test "$have_sgivc" = yes; then
4400     have_sgivc=no
4401     
4402   ac_save_CPPFLAGS="$CPPFLAGS"
4403   ac_save_LDFLAGS="$LDFLAGS"
4404
4405   if test \! -z "$includedir" ; then 
4406     CPPFLAGS="$CPPFLAGS -I$includedir"
4407   fi
4408   # note: $X_CFLAGS includes $x_includes
4409   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4410
4411   if test \! -z "$libdir" ; then
4412     LDFLAGS="$LDFLAGS -L$libdir"
4413   fi
4414   # note: $X_LIBS includes $x_libraries
4415   LDFLAGS="$LDFLAGS $X_LIBS"
4416
4417   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
4418 echo "configure:4430: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
4419 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
4420 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4421   echo $ac_n "(cached) $ac_c" 1>&6
4422 else
4423   ac_save_LIBS="$LIBS"
4424 LIBS="-lXsgivc -lXext -lX11 $LIBS"
4425 cat > conftest.$ac_ext <<EOF
4426 #line 4438 "configure"
4427 #include "confdefs.h"
4428 /* Override any gcc2 internal prototype to avoid an error.  */
4429 /* We use char because int might match the return type of a gcc2
4430     builtin and then its argument prototype would still apply.  */
4431 char XSGIvcQueryGammaMap();
4432
4433 int main() {
4434 XSGIvcQueryGammaMap()
4435 ; return 0; }
4436 EOF
4437 if { (eval echo configure:4449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4438   rm -rf conftest*
4439   eval "ac_cv_lib_$ac_lib_var=yes"
4440 else
4441   echo "configure: failed program was:" >&5
4442   cat conftest.$ac_ext >&5
4443   rm -rf conftest*
4444   eval "ac_cv_lib_$ac_lib_var=no"
4445 fi
4446 rm -f conftest*
4447 LIBS="$ac_save_LIBS"
4448
4449 fi
4450 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4451   echo "$ac_t""yes" 1>&6
4452   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
4453 else
4454   echo "$ac_t""no" 1>&6
4455 fi
4456
4457   CPPFLAGS="$ac_save_CPPFLAGS"
4458   LDFLAGS="$ac_save_LDFLAGS"
4459   fi
4460
4461   # if that succeeded, then we've really got it.
4462   if test "$have_sgivc" = yes; then
4463     cat >> confdefs.h <<\EOF
4464 #define HAVE_SGI_VC_EXTENSION 1
4465 EOF
4466
4467   fi
4468
4469 elif test "$with_sgivc" != no; then
4470   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
4471   exit 1
4472 fi
4473
4474
4475 # Check for the DPMS server extension header.
4476 #
4477 have_dpms=no
4478 with_dpms_req=unspecified
4479 # Check whether --with-dpms-ext or --without-dpms-ext was given.
4480 if test "${with_dpms_ext+set}" = set; then
4481   withval="$with_dpms_ext"
4482   with_dpms="$withval"; with_dpms_req="$withval"
4483 else
4484   with_dpms=yes
4485 fi
4486
4487
4488
4489    case "$with_dpms" in
4490     yes) ;;
4491     no)  ;;
4492
4493     /*)
4494      echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
4495 echo "configure:4507: checking for DPMS headers" >&5
4496      d=$with_dpms/include
4497      if test -d $d; then
4498        X_CFLAGS="-I$d $X_CFLAGS"
4499        echo "$ac_t""$d" 1>&6
4500      else
4501        echo "$ac_t""not found ($d: no such directory)" 1>&6
4502      fi
4503
4504      echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
4505 echo "configure:4517: checking for DPMS libs" >&5
4506      d=$with_dpms/lib
4507      if test -d $d; then
4508        X_LIBS="-L$d $X_LIBS"
4509        echo "$ac_t""$d" 1>&6
4510      else
4511        echo "$ac_t""not found ($d: no such directory)" 1>&6
4512      fi
4513
4514      # replace the directory string with "yes".
4515      with_dpms_req="yes"
4516      with_dpms=$with_dpms_req
4517      ;;
4518
4519     *)
4520      echo ""
4521      echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
4522      echo "       If it is a directory, then \`DIR/include' will be added to"
4523      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4524      exit 1
4525      ;;
4526    esac
4527
4528    # why is this necessary?
4529    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4530    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4531    withval=
4532   
4533
4534 if test "$with_dpms" = yes; then
4535
4536   # first check for dpms.h
4537   
4538   ac_save_CPPFLAGS="$CPPFLAGS"
4539   if test \! -z "$includedir" ; then 
4540     CPPFLAGS="$CPPFLAGS -I$includedir"
4541   fi
4542   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4543   ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
4544 echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
4545 echo "configure:4557: checking for X11/extensions/dpms.h" >&5
4546 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4547   echo $ac_n "(cached) $ac_c" 1>&6
4548 else
4549   cat > conftest.$ac_ext <<EOF
4550 #line 4562 "configure"
4551 #include "confdefs.h"
4552 #include <X11/extensions/dpms.h>
4553 EOF
4554 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4555 { (eval echo configure:4567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4556 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4557 if test -z "$ac_err"; then
4558   rm -rf conftest*
4559   eval "ac_cv_header_$ac_safe=yes"
4560 else
4561   echo "$ac_err" >&5
4562   echo "configure: failed program was:" >&5
4563   cat conftest.$ac_ext >&5
4564   rm -rf conftest*
4565   eval "ac_cv_header_$ac_safe=no"
4566 fi
4567 rm -f conftest*
4568 fi
4569 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4570   echo "$ac_t""yes" 1>&6
4571   have_dpms=yes
4572 else
4573   echo "$ac_t""no" 1>&6
4574 fi
4575
4576   CPPFLAGS="$ac_save_CPPFLAGS"
4577
4578   # if that succeeded, then check for the -lXdpms
4579   if test "$have_dpms" = yes; then
4580     have_dpms=no
4581     
4582   ac_save_CPPFLAGS="$CPPFLAGS"
4583   ac_save_LDFLAGS="$LDFLAGS"
4584
4585   if test \! -z "$includedir" ; then 
4586     CPPFLAGS="$CPPFLAGS -I$includedir"
4587   fi
4588   # note: $X_CFLAGS includes $x_includes
4589   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4590
4591   if test \! -z "$libdir" ; then
4592     LDFLAGS="$LDFLAGS -L$libdir"
4593   fi
4594   # note: $X_LIBS includes $x_libraries
4595   LDFLAGS="$LDFLAGS $X_LIBS"
4596
4597   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
4598 echo "configure:4610: checking for DPMSInfo in -lXdpms" >&5
4599 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
4600 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4601   echo $ac_n "(cached) $ac_c" 1>&6
4602 else
4603   ac_save_LIBS="$LIBS"
4604 LIBS="-lXdpms -lXext -lX11 $LIBS"
4605 cat > conftest.$ac_ext <<EOF
4606 #line 4618 "configure"
4607 #include "confdefs.h"
4608 /* Override any gcc2 internal prototype to avoid an error.  */
4609 /* We use char because int might match the return type of a gcc2
4610     builtin and then its argument prototype would still apply.  */
4611 char DPMSInfo();
4612
4613 int main() {
4614 DPMSInfo()
4615 ; return 0; }
4616 EOF
4617 if { (eval echo configure:4629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4618   rm -rf conftest*
4619   eval "ac_cv_lib_$ac_lib_var=yes"
4620 else
4621   echo "configure: failed program was:" >&5
4622   cat conftest.$ac_ext >&5
4623   rm -rf conftest*
4624   eval "ac_cv_lib_$ac_lib_var=no"
4625 fi
4626 rm -f conftest*
4627 LIBS="$ac_save_LIBS"
4628
4629 fi
4630 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4631   echo "$ac_t""yes" 1>&6
4632   have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"
4633 else
4634   echo "$ac_t""no" 1>&6
4635 fi
4636
4637   CPPFLAGS="$ac_save_CPPFLAGS"
4638   LDFLAGS="$ac_save_LDFLAGS"
4639   fi
4640
4641   # if that succeeded, then we've really got it.
4642   if test "$have_dpms" = yes; then
4643     cat >> confdefs.h <<\EOF
4644 #define HAVE_DPMS_EXTENSION 1
4645 EOF
4646
4647   fi
4648
4649 elif test "$with_dpms" != no; then
4650   echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
4651   exit 1
4652 fi
4653
4654
4655 # Check for the XF86VMODE server extension header.
4656 #
4657 have_xf86vmode=no
4658 with_xf86vmode_req=unspecified
4659 # Check whether --with-xf86vmode-ext or --without-xf86vmode-ext was given.
4660 if test "${with_xf86vmode_ext+set}" = set; then
4661   withval="$with_xf86vmode_ext"
4662   with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
4663 else
4664   with_xf86vmode=yes
4665 fi
4666
4667
4668
4669    case "$with_xf86vmode" in
4670     yes) ;;
4671     no)  ;;
4672
4673     /*)
4674      echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
4675 echo "configure:4687: checking for xf86vmode headers" >&5
4676      d=$with_xf86vmode/include
4677      if test -d $d; then
4678        X_CFLAGS="-I$d $X_CFLAGS"
4679        echo "$ac_t""$d" 1>&6
4680      else
4681        echo "$ac_t""not found ($d: no such directory)" 1>&6
4682      fi
4683
4684      echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
4685 echo "configure:4697: checking for xf86vmode libs" >&5
4686      d=$with_xf86vmode/lib
4687      if test -d $d; then
4688        X_LIBS="-L$d $X_LIBS"
4689        echo "$ac_t""$d" 1>&6
4690      else
4691        echo "$ac_t""not found ($d: no such directory)" 1>&6
4692      fi
4693
4694      # replace the directory string with "yes".
4695      with_xf86vmode_req="yes"
4696      with_xf86vmode=$with_xf86vmode_req
4697      ;;
4698
4699     *)
4700      echo ""
4701      echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory."
4702      echo "       If it is a directory, then \`DIR/include' will be added to"
4703      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4704      exit 1
4705      ;;
4706    esac
4707
4708    # why is this necessary?
4709    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4710    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4711    withval=
4712   
4713
4714 if test "$with_xf86vmode" = yes; then
4715
4716   # first check for xf86vmode.h
4717   
4718   ac_save_CPPFLAGS="$CPPFLAGS"
4719   if test \! -z "$includedir" ; then 
4720     CPPFLAGS="$CPPFLAGS -I$includedir"
4721   fi
4722   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4723   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
4724 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
4725 echo "configure:4737: checking for X11/extensions/xf86vmode.h" >&5
4726 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4727   echo $ac_n "(cached) $ac_c" 1>&6
4728 else
4729   cat > conftest.$ac_ext <<EOF
4730 #line 4742 "configure"
4731 #include "confdefs.h"
4732 #include <X11/extensions/xf86vmode.h>
4733 EOF
4734 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4735 { (eval echo configure:4747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4736 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4737 if test -z "$ac_err"; then
4738   rm -rf conftest*
4739   eval "ac_cv_header_$ac_safe=yes"
4740 else
4741   echo "$ac_err" >&5
4742   echo "configure: failed program was:" >&5
4743   cat conftest.$ac_ext >&5
4744   rm -rf conftest*
4745   eval "ac_cv_header_$ac_safe=no"
4746 fi
4747 rm -f conftest*
4748 fi
4749 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4750   echo "$ac_t""yes" 1>&6
4751   have_xf86vmode=yes
4752 else
4753   echo "$ac_t""no" 1>&6
4754 fi
4755
4756   CPPFLAGS="$ac_save_CPPFLAGS"
4757
4758   # if that succeeded, then check for the -lXxf86vm
4759   if test "$have_xf86vmode" = yes; then
4760     have_xf86vmode=no
4761     
4762   ac_save_CPPFLAGS="$CPPFLAGS"
4763   ac_save_LDFLAGS="$LDFLAGS"
4764
4765   if test \! -z "$includedir" ; then 
4766     CPPFLAGS="$CPPFLAGS -I$includedir"
4767   fi
4768   # note: $X_CFLAGS includes $x_includes
4769   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4770
4771   if test \! -z "$libdir" ; then
4772     LDFLAGS="$LDFLAGS -L$libdir"
4773   fi
4774   # note: $X_LIBS includes $x_libraries
4775   LDFLAGS="$LDFLAGS $X_LIBS"
4776
4777   echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
4778 echo "configure:4790: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
4779 ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
4780 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4781   echo $ac_n "(cached) $ac_c" 1>&6
4782 else
4783   ac_save_LIBS="$LIBS"
4784 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
4785 cat > conftest.$ac_ext <<EOF
4786 #line 4798 "configure"
4787 #include "confdefs.h"
4788 /* Override any gcc2 internal prototype to avoid an error.  */
4789 /* We use char because int might match the return type of a gcc2
4790     builtin and then its argument prototype would still apply.  */
4791 char XF86VidModeGetViewPort();
4792
4793 int main() {
4794 XF86VidModeGetViewPort()
4795 ; return 0; }
4796 EOF
4797 if { (eval echo configure:4809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4798   rm -rf conftest*
4799   eval "ac_cv_lib_$ac_lib_var=yes"
4800 else
4801   echo "configure: failed program was:" >&5
4802   cat conftest.$ac_ext >&5
4803   rm -rf conftest*
4804   eval "ac_cv_lib_$ac_lib_var=no"
4805 fi
4806 rm -f conftest*
4807 LIBS="$ac_save_LIBS"
4808
4809 fi
4810 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4811   echo "$ac_t""yes" 1>&6
4812   have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
4813 else
4814   echo "$ac_t""no" 1>&6
4815 fi
4816
4817   CPPFLAGS="$ac_save_CPPFLAGS"
4818   LDFLAGS="$ac_save_LDFLAGS"
4819   fi
4820
4821   # if that succeeded, then we've really got it.
4822   if test "$have_xf86vmode" = yes; then
4823     cat >> confdefs.h <<\EOF
4824 #define HAVE_XF86VMODE 1
4825 EOF
4826
4827   fi
4828
4829 elif test "$with_xf86vmode" != no; then
4830   echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
4831   exit 1
4832 fi
4833
4834
4835 # Check for /proc/interrupts
4836 #
4837 have_proc_interrupts=no
4838 with_proc_interrupts_req=unspecified
4839 # Check whether --with-proc-interrupts or --without-proc-interrupts was given.
4840 if test "${with_proc_interrupts+set}" = set; then
4841   withval="$with_proc_interrupts"
4842   with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
4843 else
4844   with_proc_interrupts=yes
4845 fi
4846
4847
4848 if test "$with_proc_interrupts" = yes; then
4849
4850    echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
4851 echo "configure:4863: checking whether /proc/interrupts contains keyboard data" >&5
4852    if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
4853   echo $ac_n "(cached) $ac_c" 1>&6
4854 else
4855   ac_cv_have_proc_interrupts=no
4856      if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
4857        ac_cv_have_proc_interrupts=yes
4858      fi
4859     
4860 fi
4861
4862    have_proc_interrupts=$ac_cv_have_proc_interrupts
4863
4864   echo "$ac_t""$have_proc_interrupts" 1>&6
4865
4866   if test "$have_proc_interrupts" = yes; then
4867     cat >> confdefs.h <<\EOF
4868 #define HAVE_PROC_INTERRUPTS 1
4869 EOF
4870
4871   fi
4872
4873 elif test "$with_proc_interrupts" != no; then
4874   echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
4875   exit 1
4876 fi
4877
4878
4879
4880 # Check for Motif and Athena --with and --without arguments.
4881 #
4882 have_motif=no
4883 have_athena=no
4884 have_athena3d=no
4885 with_motif_req=unspecified
4886 with_athena_req=unspecified
4887
4888 # Check whether --with-motif or --without-motif was given.
4889 if test "${with_motif+set}" = set; then
4890   withval="$with_motif"
4891   with_motif="$withval"; with_motif_req="$withval"
4892 else
4893   with_motif=no
4894 fi
4895
4896
4897
4898    case "$with_motif" in
4899     yes) ;;
4900     no)  ;;
4901
4902     /*)
4903      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
4904 echo "configure:4916: checking for Motif headers" >&5
4905      d=$with_motif/include
4906      if test -d $d; then
4907        X_CFLAGS="-I$d $X_CFLAGS"
4908        echo "$ac_t""$d" 1>&6
4909      else
4910        echo "$ac_t""not found ($d: no such directory)" 1>&6
4911      fi
4912
4913      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
4914 echo "configure:4926: checking for Motif libs" >&5
4915      d=$with_motif/lib
4916      if test -d $d; then
4917        X_LIBS="-L$d $X_LIBS"
4918        echo "$ac_t""$d" 1>&6
4919      else
4920        echo "$ac_t""not found ($d: no such directory)" 1>&6
4921      fi
4922
4923      # replace the directory string with "yes".
4924      with_motif_req="yes"
4925      with_motif=$with_motif_req
4926      ;;
4927
4928     *)
4929      echo ""
4930      echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory."
4931      echo "       If it is a directory, then \`DIR/include' will be added to"
4932      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4933      exit 1
4934      ;;
4935    esac
4936
4937    # why is this necessary?
4938    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4939    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4940    withval=
4941   
4942
4943 # Check whether --with-athena or --without-athena was given.
4944 if test "${with_athena+set}" = set; then
4945   withval="$with_athena"
4946   with_athena="$withval"; with_athena_req="$withval"
4947 else
4948   with_athena=no
4949 fi
4950
4951
4952
4953    case "$with_athena" in
4954     yes) ;;
4955     no)  ;;
4956
4957     /*)
4958      echo $ac_n "checking for Athena headers""... $ac_c" 1>&6
4959 echo "configure:4971: checking for Athena headers" >&5
4960      d=$with_athena/include
4961      if test -d $d; then
4962        X_CFLAGS="-I$d $X_CFLAGS"
4963        echo "$ac_t""$d" 1>&6
4964      else
4965        echo "$ac_t""not found ($d: no such directory)" 1>&6
4966      fi
4967
4968      echo $ac_n "checking for Athena libs""... $ac_c" 1>&6
4969 echo "configure:4981: checking for Athena libs" >&5
4970      d=$with_athena/lib
4971      if test -d $d; then
4972        X_LIBS="-L$d $X_LIBS"
4973        echo "$ac_t""$d" 1>&6
4974      else
4975        echo "$ac_t""not found ($d: no such directory)" 1>&6
4976      fi
4977
4978      # replace the directory string with "yes".
4979      with_athena_req="yes"
4980      with_athena=$with_athena_req
4981      ;;
4982
4983     *)
4984      echo ""
4985      echo "error: argument to --with-athena must be \"yes\", \"no\", or a directory."
4986      echo "       If it is a directory, then \`DIR/include' will be added to"
4987      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4988      exit 1
4989      ;;
4990    esac
4991
4992    # why is this necessary?
4993    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4994    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4995    withval=
4996   
4997
4998 if test "$with_motif" != yes -a "$with_motif" != no ; then
4999   echo "error: must be yes or no: --with-motif=$with_motif"
5000   exit 1
5001 fi
5002
5003 if test "$with_athena" != yes -a "$with_athena" != no ; then
5004   echo "error: must be yes or no: --with-athena=$with_athena"
5005   exit 1
5006 fi
5007
5008
5009 # Saying --without-motif is the same as saying --with-athena.
5010 if test "$with_motif_req" = no ; then
5011   with_athena_req=yes
5012   with_athena=yes
5013 fi
5014
5015 # Saying --without-athena is the same as saying --with-motif.
5016 if test "$with_athena_req" = no ; then
5017   with_motif_req=yes
5018   with_motif=yes
5019 fi
5020
5021 # Check for Motif and Athena headers.
5022
5023 check_motif() {
5024   
5025   ac_save_CPPFLAGS="$CPPFLAGS"
5026   if test \! -z "$includedir" ; then 
5027     CPPFLAGS="$CPPFLAGS -I$includedir"
5028   fi
5029   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5030   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
5031 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
5032 echo "configure:5044: checking for Xm/Xm.h" >&5
5033 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5034   echo $ac_n "(cached) $ac_c" 1>&6
5035 else
5036   cat > conftest.$ac_ext <<EOF
5037 #line 5049 "configure"
5038 #include "confdefs.h"
5039 #include <Xm/Xm.h>
5040 EOF
5041 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5042 { (eval echo configure:5054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5043 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5044 if test -z "$ac_err"; then
5045   rm -rf conftest*
5046   eval "ac_cv_header_$ac_safe=yes"
5047 else
5048   echo "$ac_err" >&5
5049   echo "configure: failed program was:" >&5
5050   cat conftest.$ac_ext >&5
5051   rm -rf conftest*
5052   eval "ac_cv_header_$ac_safe=no"
5053 fi
5054 rm -f conftest*
5055 fi
5056 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5057   echo "$ac_t""yes" 1>&6
5058   have_motif=yes
5059                      cat >> confdefs.h <<\EOF
5060 #define HAVE_MOTIF 1
5061 EOF
5062
5063                      TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS"
5064 else
5065   echo "$ac_t""no" 1>&6
5066 fi
5067
5068   CPPFLAGS="$ac_save_CPPFLAGS"
5069 }
5070
5071 check_athena() {
5072   have_athena=no
5073   have_athena3d=no
5074   
5075   ac_save_CPPFLAGS="$CPPFLAGS"
5076   if test \! -z "$includedir" ; then 
5077     CPPFLAGS="$CPPFLAGS -I$includedir"
5078   fi
5079   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5080   ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
5081 echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
5082 echo "configure:5094: checking for X11/Xaw/Dialog.h" >&5
5083 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086   cat > conftest.$ac_ext <<EOF
5087 #line 5099 "configure"
5088 #include "confdefs.h"
5089 #include <X11/Xaw/Dialog.h>
5090 EOF
5091 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5092 { (eval echo configure:5104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5093 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5094 if test -z "$ac_err"; then
5095   rm -rf conftest*
5096   eval "ac_cv_header_$ac_safe=yes"
5097 else
5098   echo "$ac_err" >&5
5099   echo "configure: failed program was:" >&5
5100   cat conftest.$ac_ext >&5
5101   rm -rf conftest*
5102   eval "ac_cv_header_$ac_safe=no"
5103 fi
5104 rm -f conftest*
5105 fi
5106 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5107   echo "$ac_t""yes" 1>&6
5108   have_athena=yes
5109 else
5110   echo "$ac_t""no" 1>&6
5111 fi
5112
5113   CPPFLAGS="$ac_save_CPPFLAGS"
5114   if test "$have_athena" = yes; then
5115     
5116   ac_save_CPPFLAGS="$CPPFLAGS"
5117   ac_save_LDFLAGS="$LDFLAGS"
5118
5119   if test \! -z "$includedir" ; then 
5120     CPPFLAGS="$CPPFLAGS -I$includedir"
5121   fi
5122   # note: $X_CFLAGS includes $x_includes
5123   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5124
5125   if test \! -z "$libdir" ; then
5126     LDFLAGS="$LDFLAGS -L$libdir"
5127   fi
5128   # note: $X_LIBS includes $x_libraries
5129   LDFLAGS="$LDFLAGS $X_LIBS"
5130
5131   echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
5132 echo "configure:5144: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
5133 ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
5134 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5135   echo $ac_n "(cached) $ac_c" 1>&6
5136 else
5137   ac_save_LIBS="$LIBS"
5138 LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS"
5139 cat > conftest.$ac_ext <<EOF
5140 #line 5152 "configure"
5141 #include "confdefs.h"
5142 /* Override any gcc2 internal prototype to avoid an error.  */
5143 /* We use char because int might match the return type of a gcc2
5144     builtin and then its argument prototype would still apply.  */
5145 char Xaw3dComputeTopShadowRGB();
5146
5147 int main() {
5148 Xaw3dComputeTopShadowRGB()
5149 ; return 0; }
5150 EOF
5151 if { (eval echo configure:5163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5152   rm -rf conftest*
5153   eval "ac_cv_lib_$ac_lib_var=yes"
5154 else
5155   echo "configure: failed program was:" >&5
5156   cat conftest.$ac_ext >&5
5157   rm -rf conftest*
5158   eval "ac_cv_lib_$ac_lib_var=no"
5159 fi
5160 rm -f conftest*
5161 LIBS="$ac_save_LIBS"
5162
5163 fi
5164 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5165   echo "$ac_t""yes" 1>&6
5166   have_athena=yes; have_athena3d=yes
5167 else
5168   echo "$ac_t""no" 1>&6
5169 fi
5170
5171   CPPFLAGS="$ac_save_CPPFLAGS"
5172   LDFLAGS="$ac_save_LDFLAGS"
5173   fi
5174
5175   if test "$have_athena3d" = yes; then
5176     TOOLKIT_LIBS="-lXaw3d $TOOLKIT_LIBS"
5177   elif test "$have_athena" = yes; then
5178     TOOLKIT_LIBS="-lXaw $TOOLKIT_LIBS"
5179   fi
5180 }
5181
5182
5183 # If they asked for both motif and athena, check motif then athena.
5184 # If they asked for only motif, check motif then athena.
5185 # If they asked for only athena, check athena then motif.
5186 # If they asked for neither, check motif then athena.
5187
5188 proselytize_motif=yes
5189 if test "$with_motif" = yes; then
5190   # asked for both, or for motif only
5191   check_motif
5192   if test "$have_motif" = yes; then
5193     with_athena=no
5194     with_athena_req=no
5195   else
5196     check_athena
5197   fi
5198
5199 elif test "$with_athena" = yes; then
5200   # asked for athena only
5201   check_athena
5202   if test "$have_athena" = yes; then
5203     with_motif=no
5204     proselytize_motif=no
5205   else
5206     check_motif
5207   fi
5208
5209 else
5210   # asked for neither
5211   check_motif
5212   if test "$have_motif" = yes; then
5213     with_athena=no
5214   else
5215     check_athena
5216   fi
5217
5218 fi
5219
5220 if test "$have_motif" = yes; then
5221   proselytize_motif=no
5222 fi
5223
5224 # If we have Athena, check whether it's a version that includes
5225 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
5226 if test "$have_athena" = yes ; then
5227   echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
5228 echo "configure:5240: checking for XawViewportSetCoordinates in Viewport.h" >&5
5229 if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
5230   echo $ac_n "(cached) $ac_c" 1>&6
5231 else
5232   ac_cv_have_XawViewportSetCoordinates=no
5233                   
5234   ac_save_CPPFLAGS="$CPPFLAGS"
5235   if test \! -z "$includedir" ; then 
5236     CPPFLAGS="$CPPFLAGS -I$includedir"
5237   fi
5238   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5239   cat > conftest.$ac_ext <<EOF
5240 #line 5252 "configure"
5241 #include "confdefs.h"
5242 #include <X11/Xaw/Viewport.h>
5243 EOF
5244 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5245   egrep "XawViewportSetCoordinates" >/dev/null 2>&1; then
5246   rm -rf conftest*
5247   ac_cv_have_XawViewportSetCoordinates=yes
5248 fi
5249 rm -f conftest*
5250
5251   CPPFLAGS="$ac_save_CPPFLAGS"
5252 fi
5253
5254 echo "$ac_t""$ac_cv_have_XawViewportSetCoordinates" 1>&6
5255   if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
5256     cat >> confdefs.h <<\EOF
5257 #define HAVE_XawViewportSetCoordinates 1
5258 EOF
5259
5260   fi
5261 fi
5262
5263
5264 # If we have Motif, check whether it's really LessTif.
5265 #
5266 have_lesstif=no
5267 if test "$have_motif" = yes ; then
5268   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
5269 echo "configure:5281: checking whether Motif is really LessTif" >&5
5270 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
5271   echo $ac_n "(cached) $ac_c" 1>&6
5272 else
5273   
5274   ac_save_CPPFLAGS="$CPPFLAGS"
5275   if test \! -z "$includedir" ; then 
5276     CPPFLAGS="$CPPFLAGS -I$includedir"
5277   fi
5278   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5279   cat > conftest.$ac_ext <<EOF
5280 #line 5292 "configure"
5281 #include "confdefs.h"
5282 #include <Xm/Xm.h>
5283 int main() {
5284 long vers = LesstifVersion;
5285 ; return 0; }
5286 EOF
5287 if { (eval echo configure:5299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5288   rm -rf conftest*
5289   ac_cv_have_lesstif=yes
5290 else
5291   echo "configure: failed program was:" >&5
5292   cat conftest.$ac_ext >&5
5293   rm -rf conftest*
5294   ac_cv_have_lesstif=no
5295 fi
5296 rm -f conftest*
5297   CPPFLAGS="$ac_save_CPPFLAGS"
5298 fi
5299
5300 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
5301   have_lesstif=$ac_cv_have_lesstif
5302 fi
5303
5304 # don't cache these
5305 unset ac_cv_lesstif_version
5306 unset ac_cv_lesstif_version_string
5307
5308 lesstif_version=unknown
5309 lesstif_version_string=unknown
5310
5311 if test "$have_lesstif" = yes ; then
5312   ltv=unknown
5313   echo unknown > conftest-lt
5314   echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
5315 echo "configure:5327: checking LessTif version number" >&5
5316 if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
5317   echo $ac_n "(cached) $ac_c" 1>&6
5318 else
5319   
5320   ac_save_CPPFLAGS="$CPPFLAGS"
5321   if test \! -z "$includedir" ; then 
5322     CPPFLAGS="$CPPFLAGS -I$includedir"
5323   fi
5324   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5325   if test "$cross_compiling" = yes; then
5326   ac_cv_lesstif_version=unknown
5327                      ac_cv_lesstif_version_string=unknown
5328 else
5329   cat > conftest.$ac_ext <<EOF
5330 #line 5342 "configure"
5331 #include "confdefs.h"
5332 #include <stdio.h>
5333                      #include <Xm/Xm.h>
5334                      int main() {
5335                        FILE *f = fopen("conftest-lt", "w");
5336                        if (!f) exit(1);
5337                        fprintf(f, "%d %d.%d\n", LesstifVersion,
5338                           LESSTIF_VERSION, LESSTIF_REVISION);
5339                        fclose(f);
5340                        exit(0);
5341                      }
5342 EOF
5343 if { (eval echo configure:5355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5344 then
5345   ltv=`cat conftest-lt`
5346                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
5347                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
5348 else
5349   echo "configure: failed program was:" >&5
5350   cat conftest.$ac_ext >&5
5351   rm -fr conftest*
5352   ac_cv_lesstif_version=unknown
5353                      ac_cv_lesstif_version_string=unknown
5354 fi
5355 rm -fr conftest*
5356 fi
5357
5358   CPPFLAGS="$ac_save_CPPFLAGS"
5359 fi
5360
5361 echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
5362   rm -f conftest-lt
5363   lesstif_version=$ac_cv_lesstif_version
5364   lesstif_version_string=$ac_cv_lesstif_version_string
5365
5366 fi
5367
5368
5369 if test "$have_motif" = yes ; then
5370   mtv=unknown
5371   echo unknown > conftest-mt
5372   echo $ac_n "checking Motif version number""... $ac_c" 1>&6
5373 echo "configure:5385: checking Motif version number" >&5
5374 if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
5375   echo $ac_n "(cached) $ac_c" 1>&6
5376 else
5377   
5378   ac_save_CPPFLAGS="$CPPFLAGS"
5379   if test \! -z "$includedir" ; then 
5380     CPPFLAGS="$CPPFLAGS -I$includedir"
5381   fi
5382   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5383   if test "$cross_compiling" = yes; then
5384   ac_cv_motif_version=unknown
5385                      ac_cv_motif_version_string=unknown
5386 else
5387   cat > conftest.$ac_ext <<EOF
5388 #line 5400 "configure"
5389 #include "confdefs.h"
5390 #include <stdio.h>
5391                      #include <Xm/Xm.h>
5392                      int main() {
5393                        FILE *f = fopen("conftest-mt", "w");
5394                        if (!f) exit(1);
5395                        fprintf(f, "%d %d.%d\n", XmVersion,
5396                           XmVERSION, XmREVISION);
5397                        fclose(f);
5398                        exit(0);
5399                      }
5400 EOF
5401 if { (eval echo configure:5413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5402 then
5403   mtv=`cat conftest-mt`
5404                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
5405                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
5406 else
5407   echo "configure: failed program was:" >&5
5408   cat conftest.$ac_ext >&5
5409   rm -fr conftest*
5410   ac_cv_motif_version=unknown
5411                      ac_cv_motif_version_string=unknown
5412 fi
5413 rm -fr conftest*
5414 fi
5415
5416   CPPFLAGS="$ac_save_CPPFLAGS"
5417 fi
5418
5419 echo "$ac_t""$ac_cv_motif_version_string" 1>&6
5420   rm -f conftest-mt
5421   motif_version=$ac_cv_motif_version
5422   motif_version_string=$ac_cv_motif_version_string
5423
5424 fi
5425
5426
5427 # If this is Motif 2.x, and we have XPM, then link against XPM as well.
5428 # The deal is, Motif 2.x requires XPM -- but it's a compilation option of
5429 # the library whether to build the XPM code into libXm, or whether to rely
5430 # on an external libXm.  So the only way to tell whether XPM is a link-time
5431 # requirement is to examine libXm.a, which is very difficult to do in an
5432 # autoconf script.  So... if it's Motif 2.x, we always link against XPM if
5433 # the XPM lib exists (and this will be a no-op if libXm happens to already
5434 # have the XPM code in it.)
5435 #
5436 motif_requires_xpm=no
5437 if test "$have_motif" = yes ; then
5438    echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
5439 echo "configure:5451: checking whether Motif requires XPM" >&5
5440    if test "$motif_version" -ge 2000; then
5441      motif_requires_xpm=yes
5442      echo "$ac_t""maybe" 1>&6
5443    else
5444      echo "$ac_t""no" 1>&6
5445    fi
5446 fi
5447
5448
5449
5450 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
5451 # Extension".   Why this extension isn't in -lXext with all the others,
5452 # I have no idea.
5453 #
5454 have_xp_ext=no
5455 if test "$have_motif" = yes ; then
5456    have_xp_ext=no
5457    
5458   ac_save_CPPFLAGS="$CPPFLAGS"
5459   ac_save_LDFLAGS="$LDFLAGS"
5460
5461   if test \! -z "$includedir" ; then 
5462     CPPFLAGS="$CPPFLAGS -I$includedir"
5463   fi
5464   # note: $X_CFLAGS includes $x_includes
5465   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5466
5467   if test \! -z "$libdir" ; then
5468     LDFLAGS="$LDFLAGS -L$libdir"
5469   fi
5470   # note: $X_LIBS includes $x_libraries
5471   LDFLAGS="$LDFLAGS $X_LIBS"
5472
5473   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
5474 echo "configure:5486: checking for XpQueryExtension in -lXp" >&5
5475 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
5476 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5477   echo $ac_n "(cached) $ac_c" 1>&6
5478 else
5479   ac_save_LIBS="$LIBS"
5480 LIBS="-lXp -lX11 -lXext -lm $LIBS"
5481 cat > conftest.$ac_ext <<EOF
5482 #line 5494 "configure"
5483 #include "confdefs.h"
5484 /* Override any gcc2 internal prototype to avoid an error.  */
5485 /* We use char because int might match the return type of a gcc2
5486     builtin and then its argument prototype would still apply.  */
5487 char XpQueryExtension();
5488
5489 int main() {
5490 XpQueryExtension()
5491 ; return 0; }
5492 EOF
5493 if { (eval echo configure:5505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5494   rm -rf conftest*
5495   eval "ac_cv_lib_$ac_lib_var=yes"
5496 else
5497   echo "configure: failed program was:" >&5
5498   cat conftest.$ac_ext >&5
5499   rm -rf conftest*
5500   eval "ac_cv_lib_$ac_lib_var=no"
5501 fi
5502 rm -f conftest*
5503 LIBS="$ac_save_LIBS"
5504
5505 fi
5506 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5507   echo "$ac_t""yes" 1>&6
5508   have_xp_ext=yes; TOOLKIT_LIBS="$TOOLKIT_LIBS -lXp"
5509 else
5510   echo "$ac_t""no" 1>&6
5511 fi
5512
5513   CPPFLAGS="$ac_save_CPPFLAGS"
5514   LDFLAGS="$ac_save_LDFLAGS"
5515 fi
5516
5517
5518 # Check for _Xsetlocale in -lXintl, since at least some recent versions
5519 # of Motif (on Linux) need it.
5520 #
5521 have_xintl=no
5522 if test "$have_motif" = yes ; then
5523   
5524   ac_save_CPPFLAGS="$CPPFLAGS"
5525   ac_save_LDFLAGS="$LDFLAGS"
5526
5527   if test \! -z "$includedir" ; then 
5528     CPPFLAGS="$CPPFLAGS -I$includedir"
5529   fi
5530   # note: $X_CFLAGS includes $x_includes
5531   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5532
5533   if test \! -z "$libdir" ; then
5534     LDFLAGS="$LDFLAGS -L$libdir"
5535   fi
5536   # note: $X_LIBS includes $x_libraries
5537   LDFLAGS="$LDFLAGS $X_LIBS"
5538
5539   echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
5540 echo "configure:5552: checking for _Xsetlocale in -lXintl" >&5
5541 ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
5542 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5543   echo $ac_n "(cached) $ac_c" 1>&6
5544 else
5545   ac_save_LIBS="$LIBS"
5546 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
5547 cat > conftest.$ac_ext <<EOF
5548 #line 5560 "configure"
5549 #include "confdefs.h"
5550 /* Override any gcc2 internal prototype to avoid an error.  */
5551 /* We use char because int might match the return type of a gcc2
5552     builtin and then its argument prototype would still apply.  */
5553 char _Xsetlocale();
5554
5555 int main() {
5556 _Xsetlocale()
5557 ; return 0; }
5558 EOF
5559 if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5560   rm -rf conftest*
5561   eval "ac_cv_lib_$ac_lib_var=yes"
5562 else
5563   echo "configure: failed program was:" >&5
5564   cat conftest.$ac_ext >&5
5565   rm -rf conftest*
5566   eval "ac_cv_lib_$ac_lib_var=no"
5567 fi
5568 rm -f conftest*
5569 LIBS="$ac_save_LIBS"
5570
5571 fi
5572 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5573   echo "$ac_t""yes" 1>&6
5574   have_xintl=yes
5575 else
5576   echo "$ac_t""no" 1>&6
5577 have_xintl=no
5578 fi
5579
5580   CPPFLAGS="$ac_save_CPPFLAGS"
5581   LDFLAGS="$ac_save_LDFLAGS"
5582   if test "$have_xintl" = yes; then
5583     TOOLKIT_LIBS="$TOOLKIT_LIBS -lXintl"
5584   fi
5585 fi
5586
5587
5588 # check for XPM header.
5589 #
5590 have_xpm=no
5591 with_xpm_req=unspecified
5592 # Check whether --with-xpm or --without-xpm was given.
5593 if test "${with_xpm+set}" = set; then
5594   withval="$with_xpm"
5595   with_xpm="$withval"; with_xpm_req="$withval"
5596 else
5597   with_xpm=yes
5598 fi
5599
5600
5601
5602    case "$with_xpm" in
5603     yes) ;;
5604     no)  ;;
5605
5606     /*)
5607      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
5608 echo "configure:5620: checking for XPM headers" >&5
5609      d=$with_xpm/include
5610      if test -d $d; then
5611        X_CFLAGS="-I$d $X_CFLAGS"
5612        echo "$ac_t""$d" 1>&6
5613      else
5614        echo "$ac_t""not found ($d: no such directory)" 1>&6
5615      fi
5616
5617      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
5618 echo "configure:5630: checking for XPM libs" >&5
5619      d=$with_xpm/lib
5620      if test -d $d; then
5621        X_LIBS="-L$d $X_LIBS"
5622        echo "$ac_t""$d" 1>&6
5623      else
5624        echo "$ac_t""not found ($d: no such directory)" 1>&6
5625      fi
5626
5627      # replace the directory string with "yes".
5628      with_xpm_req="yes"
5629      with_xpm=$with_xpm_req
5630      ;;
5631
5632     *)
5633      echo ""
5634      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
5635      echo "       If it is a directory, then \`DIR/include' will be added to"
5636      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5637      exit 1
5638      ;;
5639    esac
5640
5641    # why is this necessary?
5642    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5643    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5644    withval=
5645   
5646
5647 if test "$with_xpm" = yes; then
5648   
5649   ac_save_CPPFLAGS="$CPPFLAGS"
5650   if test \! -z "$includedir" ; then 
5651     CPPFLAGS="$CPPFLAGS -I$includedir"
5652   fi
5653   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5654   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
5655 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
5656 echo "configure:5668: checking for X11/xpm.h" >&5
5657 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5658   echo $ac_n "(cached) $ac_c" 1>&6
5659 else
5660   cat > conftest.$ac_ext <<EOF
5661 #line 5673 "configure"
5662 #include "confdefs.h"
5663 #include <X11/xpm.h>
5664 EOF
5665 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5666 { (eval echo configure:5678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5667 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5668 if test -z "$ac_err"; then
5669   rm -rf conftest*
5670   eval "ac_cv_header_$ac_safe=yes"
5671 else
5672   echo "$ac_err" >&5
5673   echo "configure: failed program was:" >&5
5674   cat conftest.$ac_ext >&5
5675   rm -rf conftest*
5676   eval "ac_cv_header_$ac_safe=no"
5677 fi
5678 rm -f conftest*
5679 fi
5680 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5681   echo "$ac_t""yes" 1>&6
5682   have_xpm=yes
5683                     cat >> confdefs.h <<\EOF
5684 #define HAVE_XPM 1
5685 EOF
5686
5687                     XPM_LIBS="-lXpm"
5688 else
5689   echo "$ac_t""no" 1>&6
5690 fi
5691
5692   CPPFLAGS="$ac_save_CPPFLAGS"
5693 elif test "$with_xpm" != no; then
5694   echo "error: must be yes or no: --with-xpm=$with_xpm"
5695   exit 1
5696 fi
5697
5698 # See comment near $motif_requires_xpm, above.
5699 # Need to do this here, after both Motif and XPM have been checked for.
5700 #
5701 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
5702   if test "$motif_requires_xpm" = yes ; then
5703     TOOLKIT_LIBS="$TOOLKIT_LIBS $XPM_LIBS"
5704   fi
5705 fi
5706
5707
5708 # check for the GL header
5709 #
5710 have_gl=no
5711 ac_have_mesa_gl=no
5712 with_gl_req=unspecified
5713 # Check whether --with-gl or --without-gl was given.
5714 if test "${with_gl+set}" = set; then
5715   withval="$with_gl"
5716   with_gl="$withval"; with_gl_req="$withval"
5717 else
5718   with_gl=yes
5719 fi
5720
5721
5722
5723    case "$with_gl" in
5724     yes) ;;
5725     no)  ;;
5726
5727     /*)
5728      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
5729 echo "configure:5741: checking for GL headers" >&5
5730      d=$with_gl/include
5731      if test -d $d; then
5732        X_CFLAGS="-I$d $X_CFLAGS"
5733        echo "$ac_t""$d" 1>&6
5734      else
5735        echo "$ac_t""not found ($d: no such directory)" 1>&6
5736      fi
5737
5738      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
5739 echo "configure:5751: checking for GL libs" >&5
5740      d=$with_gl/lib
5741      if test -d $d; then
5742        X_LIBS="-L$d $X_LIBS"
5743        echo "$ac_t""$d" 1>&6
5744      else
5745        echo "$ac_t""not found ($d: no such directory)" 1>&6
5746      fi
5747
5748      # replace the directory string with "yes".
5749      with_gl_req="yes"
5750      with_gl=$with_gl_req
5751      ;;
5752
5753     *)
5754      echo ""
5755      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
5756      echo "       If it is a directory, then \`DIR/include' will be added to"
5757      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5758      exit 1
5759      ;;
5760    esac
5761
5762    # why is this necessary?
5763    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5764    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5765    withval=
5766   
5767
5768 ac_mesagl_version=unknown
5769 ac_mesagl_version_string=unknown
5770
5771 if test "$with_gl" = yes; then
5772   
5773   ac_save_CPPFLAGS="$CPPFLAGS"
5774   if test \! -z "$includedir" ; then 
5775     CPPFLAGS="$CPPFLAGS -I$includedir"
5776   fi
5777   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5778   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
5779 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
5780 echo "configure:5792: checking for GL/gl.h" >&5
5781 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5782   echo $ac_n "(cached) $ac_c" 1>&6
5783 else
5784   cat > conftest.$ac_ext <<EOF
5785 #line 5797 "configure"
5786 #include "confdefs.h"
5787 #include <GL/gl.h>
5788 EOF
5789 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5790 { (eval echo configure:5802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5791 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5792 if test -z "$ac_err"; then
5793   rm -rf conftest*
5794   eval "ac_cv_header_$ac_safe=yes"
5795 else
5796   echo "$ac_err" >&5
5797   echo "configure: failed program was:" >&5
5798   cat conftest.$ac_ext >&5
5799   rm -rf conftest*
5800   eval "ac_cv_header_$ac_safe=no"
5801 fi
5802 rm -f conftest*
5803 fi
5804 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5805   echo "$ac_t""yes" 1>&6
5806   have_gl=yes
5807 else
5808   echo "$ac_t""no" 1>&6
5809 fi
5810
5811   CPPFLAGS="$ac_save_CPPFLAGS"
5812   if test "$have_gl" = yes ; then
5813     
5814   ac_save_CPPFLAGS="$CPPFLAGS"
5815   if test \! -z "$includedir" ; then 
5816     CPPFLAGS="$CPPFLAGS -I$includedir"
5817   fi
5818   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5819   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
5820 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
5821 echo "configure:5833: checking for GL/glx.h" >&5
5822 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5823   echo $ac_n "(cached) $ac_c" 1>&6
5824 else
5825   cat > conftest.$ac_ext <<EOF
5826 #line 5838 "configure"
5827 #include "confdefs.h"
5828 #include <GL/glx.h>
5829 EOF
5830 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5831 { (eval echo configure:5843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5832 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5833 if test -z "$ac_err"; then
5834   rm -rf conftest*
5835   eval "ac_cv_header_$ac_safe=yes"
5836 else
5837   echo "$ac_err" >&5
5838   echo "configure: failed program was:" >&5
5839   cat conftest.$ac_ext >&5
5840   rm -rf conftest*
5841   eval "ac_cv_header_$ac_safe=no"
5842 fi
5843 rm -f conftest*
5844 fi
5845 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5846   echo "$ac_t""yes" 1>&6
5847   have_gl=yes
5848 else
5849   echo "$ac_t""no" 1>&6
5850 fi
5851
5852   CPPFLAGS="$ac_save_CPPFLAGS"
5853   fi
5854
5855   # If we have the headers, try and figure out which vendor it's from.
5856   #
5857   if test "$have_gl" = yes ; then
5858
5859     cat >> confdefs.h <<\EOF
5860 #define HAVE_GL 1
5861 EOF
5862
5863
5864     # We need to know whether it's MesaGL so that we know which libraries
5865     # to link against.
5866     #
5867     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
5868 echo "configure:5880: checking whether GL is really MesaGL" >&5
5869     if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
5870   echo $ac_n "(cached) $ac_c" 1>&6
5871 else
5872   ac_cv_have_mesa_gl=no
5873        
5874   ac_save_CPPFLAGS="$CPPFLAGS"
5875   if test \! -z "$includedir" ; then 
5876     CPPFLAGS="$CPPFLAGS -I$includedir"
5877   fi
5878   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5879   cat > conftest.$ac_ext <<EOF
5880 #line 5892 "configure"
5881 #include "confdefs.h"
5882 #include <GL/glx.h>
5883 EOF
5884 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5885   egrep "Mesa" >/dev/null 2>&1; then
5886   rm -rf conftest*
5887   ac_cv_have_mesa_gl=yes
5888 fi
5889 rm -f conftest*
5890
5891   CPPFLAGS="$ac_save_CPPFLAGS"
5892       
5893 fi
5894
5895     ac_have_mesa_gl=$ac_cv_have_mesa_gl
5896     echo "$ac_t""$ac_have_mesa_gl" 1>&6
5897
5898     if test "$ac_have_mesa_gl" = no ; then
5899       gl_lib_1="GL"
5900       GL_LIBS="-lGL -lGLU"
5901     else
5902       cat >> confdefs.h <<\EOF
5903 #define HAVE_MESA_GL 1
5904 EOF
5905
5906       gl_lib_1="MesaGL"
5907       GL_LIBS="-lMesaGL -lMesaGLU"
5908     fi
5909
5910
5911     # If it's MesaGL, we'd like to issue a warning if the version number
5912     # is less than or equal to 2.6, because that version had a security bug.
5913     #
5914     if test "$ac_have_mesa_gl" = yes; then
5915
5916       # don't cache these.
5917       unset ac_cv_mesagl_version
5918       unset ac_cv_mesagl_version_string
5919
5920       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
5921 echo "configure:5933: checking MesaGL version number" >&5
5922       if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
5923   echo $ac_n "(cached) $ac_c" 1>&6
5924 else
5925   cat > conftest.$ac_ext <<EOF
5926 #line 5938 "configure"
5927 #include "confdefs.h"
5928 #include <GL/gl.h>
5929 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
5930 EOF
5931
5932          ac_save_CPPFLAGS="$CPPFLAGS"
5933          if test \! -z "$includedir" ; then 
5934            CPPFLAGS="$CPPFLAGS -I$includedir"
5935          fi
5936          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5937
5938           # M4 sucks!!
5939          
5940          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
5941               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
5942          
5943
5944          rm -f conftest.$ac_ext
5945
5946          CPPFLAGS="$ac_save_CPPFLAGS"
5947
5948          if test "$mglv" = ""; then
5949            ac_mesagl_version=unknown
5950            ac_mesagl_version_string=unknown
5951          else
5952            ac_mesagl_version_string=$mglv
5953            maj=`echo $mglv | sed -n 's/\..*//p'`
5954            min=`echo $mglv | sed -n 's/.*\.//p'`
5955            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
5956            if test -z "$ac_mesagl_version"; then
5957              ac_mesagl_version=unknown
5958              ac_mesagl_version_string=unknown
5959            fi
5960          fi
5961          ac_cv_mesagl_version=$ac_mesagl_version
5962          ac_cv_mesagl_version_string=$ac_mesagl_version_string
5963       
5964 fi
5965
5966       ac_mesagl_version=$ac_cv_mesagl_version
5967       ac_mesagl_version_string=$ac_cv_mesagl_version_string
5968       echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
5969     fi
5970
5971
5972     # If it's MesaGL, check to see if it requires -lpthread.
5973     #
5974     have_pthread=no
5975     mesa_requires_pthread=no
5976     if test "$ac_have_mesa_gl" = yes; then
5977
5978       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
5979 echo "configure:5991: checking for pthread_create in -lpthread" >&5
5980 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
5981 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5982   echo $ac_n "(cached) $ac_c" 1>&6
5983 else
5984   ac_save_LIBS="$LIBS"
5985 LIBS="-lpthread  $LIBS"
5986 cat > conftest.$ac_ext <<EOF
5987 #line 5999 "configure"
5988 #include "confdefs.h"
5989 /* Override any gcc2 internal prototype to avoid an error.  */
5990 /* We use char because int might match the return type of a gcc2
5991     builtin and then its argument prototype would still apply.  */
5992 char pthread_create();
5993
5994 int main() {
5995 pthread_create()
5996 ; return 0; }
5997 EOF
5998 if { (eval echo configure:6010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5999   rm -rf conftest*
6000   eval "ac_cv_lib_$ac_lib_var=yes"
6001 else
6002   echo "configure: failed program was:" >&5
6003   cat conftest.$ac_ext >&5
6004   rm -rf conftest*
6005   eval "ac_cv_lib_$ac_lib_var=no"
6006 fi
6007 rm -f conftest*
6008 LIBS="$ac_save_LIBS"
6009
6010 fi
6011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6012   echo "$ac_t""yes" 1>&6
6013   have_pthread=yes
6014 else
6015   echo "$ac_t""no" 1>&6
6016 fi
6017
6018       if test "$have_pthread" = yes; then
6019         
6020   ac_save_CPPFLAGS="$CPPFLAGS"
6021   ac_save_LDFLAGS="$LDFLAGS"
6022
6023   if test \! -z "$includedir" ; then 
6024     CPPFLAGS="$CPPFLAGS -I$includedir"
6025   fi
6026   # note: $X_CFLAGS includes $x_includes
6027   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6028
6029   if test \! -z "$libdir" ; then
6030     LDFLAGS="$LDFLAGS -L$libdir"
6031   fi
6032   # note: $X_LIBS includes $x_libraries
6033   LDFLAGS="$LDFLAGS $X_LIBS"
6034
6035   echo $ac_n "checking for gl_get_thread_context in -l$gl_lib_1""... $ac_c" 1>&6
6036 echo "configure:6048: checking for gl_get_thread_context in -l$gl_lib_1" >&5
6037 ac_lib_var=`echo $gl_lib_1'_'gl_get_thread_context | sed 'y%./+-%__p_%'`
6038 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6039   echo $ac_n "(cached) $ac_c" 1>&6
6040 else
6041   ac_save_LIBS="$LIBS"
6042 LIBS="-l$gl_lib_1 $GL_LIBS -lpthread -lX11 -lXext -lm $LIBS"
6043 cat > conftest.$ac_ext <<EOF
6044 #line 6056 "configure"
6045 #include "confdefs.h"
6046 /* Override any gcc2 internal prototype to avoid an error.  */
6047 /* We use char because int might match the return type of a gcc2
6048     builtin and then its argument prototype would still apply.  */
6049 char gl_get_thread_context();
6050
6051 int main() {
6052 gl_get_thread_context()
6053 ; return 0; }
6054 EOF
6055 if { (eval echo configure:6067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6056   rm -rf conftest*
6057   eval "ac_cv_lib_$ac_lib_var=yes"
6058 else
6059   echo "configure: failed program was:" >&5
6060   cat conftest.$ac_ext >&5
6061   rm -rf conftest*
6062   eval "ac_cv_lib_$ac_lib_var=no"
6063 fi
6064 rm -f conftest*
6065 LIBS="$ac_save_LIBS"
6066
6067 fi
6068 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6069   echo "$ac_t""yes" 1>&6
6070   mesa_requires_pthread=yes
6071 else
6072   echo "$ac_t""no" 1>&6
6073 fi
6074
6075   CPPFLAGS="$ac_save_CPPFLAGS"
6076   LDFLAGS="$ac_save_LDFLAGS"
6077       fi
6078
6079       if test "$mesa_requires_pthread" = yes; then
6080         GL_LIBS="$GL_LIBS -lpthread"
6081       fi
6082     fi
6083
6084     # Check for OpenGL 1.1 features.
6085     #
6086     
6087   ac_save_CPPFLAGS="$CPPFLAGS"
6088   ac_save_LDFLAGS="$LDFLAGS"
6089
6090   if test \! -z "$includedir" ; then 
6091     CPPFLAGS="$CPPFLAGS -I$includedir"
6092   fi
6093   # note: $X_CFLAGS includes $x_includes
6094   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6095
6096   if test \! -z "$libdir" ; then
6097     LDFLAGS="$LDFLAGS -L$libdir"
6098   fi
6099   # note: $X_LIBS includes $x_libraries
6100   LDFLAGS="$LDFLAGS $X_LIBS"
6101
6102   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
6103 echo "configure:6115: checking for glBindTexture in -l$gl_lib_1" >&5
6104 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
6105 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6106   echo $ac_n "(cached) $ac_c" 1>&6
6107 else
6108   ac_save_LIBS="$LIBS"
6109 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
6110 cat > conftest.$ac_ext <<EOF
6111 #line 6123 "configure"
6112 #include "confdefs.h"
6113 /* Override any gcc2 internal prototype to avoid an error.  */
6114 /* We use char because int might match the return type of a gcc2
6115     builtin and then its argument prototype would still apply.  */
6116 char glBindTexture();
6117
6118 int main() {
6119 glBindTexture()
6120 ; return 0; }
6121 EOF
6122 if { (eval echo configure:6134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6123   rm -rf conftest*
6124   eval "ac_cv_lib_$ac_lib_var=yes"
6125 else
6126   echo "configure: failed program was:" >&5
6127   cat conftest.$ac_ext >&5
6128   rm -rf conftest*
6129   eval "ac_cv_lib_$ac_lib_var=no"
6130 fi
6131 rm -f conftest*
6132 LIBS="$ac_save_LIBS"
6133
6134 fi
6135 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6136   echo "$ac_t""yes" 1>&6
6137   cat >> confdefs.h <<\EOF
6138 #define HAVE_GLBINDTEXTURE 1
6139 EOF
6140
6141 else
6142   echo "$ac_t""no" 1>&6
6143 fi
6144
6145   CPPFLAGS="$ac_save_CPPFLAGS"
6146   LDFLAGS="$ac_save_LDFLAGS"
6147
6148
6149     # Check whether the `xscreensaver' executable should link against GL.
6150     # See comments in utils/visual-gl.c for why this is sometimes necessary.
6151     #
6152     echo $ac_n "checking whether drastic GL measures must be taken""... $ac_c" 1>&6
6153 echo "configure:6165: checking whether drastic GL measures must be taken" >&5
6154     case "$host" in
6155       *-sgi*)
6156         echo "$ac_t""yes -- hello, SGI." 1>&6
6157         cat >> confdefs.h <<\EOF
6158 #define DAEMON_USE_GL 1
6159 EOF
6160
6161         SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
6162         SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
6163         SAVER_GL_LIBS="$GL_LIBS"
6164       ;;
6165       *)
6166         echo "$ac_t""no -- non-SGI." 1>&6
6167         SAVER_GL_SRCS=''
6168         SAVER_GL_OBJS=''
6169         SAVER_GL_LIBS=''
6170       ;;
6171     esac
6172
6173   fi
6174
6175 elif test "$with_gl" != no; then
6176   echo "error: must be yes or no: --with-gl=$with_gl"
6177   exit 1
6178 fi
6179
6180
6181 # check for SGI XReadDisplay server extension header.
6182 #
6183 have_readdisplay=no
6184 with_readdisplay_req=unspecified
6185 # Check whether --with-readdisplay or --without-readdisplay was given.
6186 if test "${with_readdisplay+set}" = set; then
6187   withval="$with_readdisplay"
6188   with_readdisplay="$withval"; with_readdisplay_req="$withval"
6189 else
6190   with_readdisplay=yes
6191 fi
6192
6193
6194
6195    case "$with_readdisplay" in
6196     yes) ;;
6197     no)  ;;
6198
6199     /*)
6200      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
6201 echo "configure:6213: checking for XReadDisplay headers" >&5
6202      d=$with_readdisplay/include
6203      if test -d $d; then
6204        X_CFLAGS="-I$d $X_CFLAGS"
6205        echo "$ac_t""$d" 1>&6
6206      else
6207        echo "$ac_t""not found ($d: no such directory)" 1>&6
6208      fi
6209
6210      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
6211 echo "configure:6223: checking for XReadDisplay libs" >&5
6212      d=$with_readdisplay/lib
6213      if test -d $d; then
6214        X_LIBS="-L$d $X_LIBS"
6215        echo "$ac_t""$d" 1>&6
6216      else
6217        echo "$ac_t""not found ($d: no such directory)" 1>&6
6218      fi
6219
6220      # replace the directory string with "yes".
6221      with_readdisplay_req="yes"
6222      with_readdisplay=$with_readdisplay_req
6223      ;;
6224
6225     *)
6226      echo ""
6227      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
6228      echo "       If it is a directory, then \`DIR/include' will be added to"
6229      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6230      exit 1
6231      ;;
6232    esac
6233
6234    # why is this necessary?
6235    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6236    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6237    withval=
6238   
6239
6240 if test "$with_readdisplay" = yes; then
6241   
6242   ac_save_CPPFLAGS="$CPPFLAGS"
6243   if test \! -z "$includedir" ; then 
6244     CPPFLAGS="$CPPFLAGS -I$includedir"
6245   fi
6246   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6247   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
6248 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
6249 echo "configure:6261: checking for X11/extensions/readdisplay.h" >&5
6250 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6251   echo $ac_n "(cached) $ac_c" 1>&6
6252 else
6253   cat > conftest.$ac_ext <<EOF
6254 #line 6266 "configure"
6255 #include "confdefs.h"
6256 #include <X11/extensions/readdisplay.h>
6257 EOF
6258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6259 { (eval echo configure:6271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6260 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6261 if test -z "$ac_err"; then
6262   rm -rf conftest*
6263   eval "ac_cv_header_$ac_safe=yes"
6264 else
6265   echo "$ac_err" >&5
6266   echo "configure: failed program was:" >&5
6267   cat conftest.$ac_ext >&5
6268   rm -rf conftest*
6269   eval "ac_cv_header_$ac_safe=no"
6270 fi
6271 rm -f conftest*
6272 fi
6273 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6274   echo "$ac_t""yes" 1>&6
6275   cat >> confdefs.h <<\EOF
6276 #define HAVE_READ_DISPLAY_EXTENSION 1
6277 EOF
6278
6279 else
6280   echo "$ac_t""no" 1>&6
6281 fi
6282
6283   CPPFLAGS="$ac_save_CPPFLAGS"
6284 elif test "$with_readdisplay" != no; then
6285   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
6286   exit 1
6287 fi
6288
6289
6290 # check for SGI's Iris Video Library header.
6291 #
6292 have_sgivideo=no
6293 with_sgivideo_req=unspecified
6294 # Check whether --with-sgivideo or --without-sgivideo was given.
6295 if test "${with_sgivideo+set}" = set; then
6296   withval="$with_sgivideo"
6297   with_sgivideo="$withval"; with_sgivideo_req="$withval"
6298 else
6299   with_sgivideo=yes
6300 fi
6301
6302
6303
6304    case "$with_sgivideo" in
6305     yes) ;;
6306     no)  ;;
6307
6308     /*)
6309      echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
6310 echo "configure:6322: checking for Iris Video headers" >&5
6311      d=$with_sgivideo/include
6312      if test -d $d; then
6313        X_CFLAGS="-I$d $X_CFLAGS"
6314        echo "$ac_t""$d" 1>&6
6315      else
6316        echo "$ac_t""not found ($d: no such directory)" 1>&6
6317      fi
6318
6319      echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
6320 echo "configure:6332: checking for Iris Video libs" >&5
6321      d=$with_sgivideo/lib
6322      if test -d $d; then
6323        X_LIBS="-L$d $X_LIBS"
6324        echo "$ac_t""$d" 1>&6
6325      else
6326        echo "$ac_t""not found ($d: no such directory)" 1>&6
6327      fi
6328
6329      # replace the directory string with "yes".
6330      with_sgivideo_req="yes"
6331      with_sgivideo=$with_sgivideo_req
6332      ;;
6333
6334     *)
6335      echo ""
6336      echo "error: argument to --with-sgivideo must be \"yes\", \"no\", or a directory."
6337      echo "       If it is a directory, then \`DIR/include' will be added to"
6338      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6339      exit 1
6340      ;;
6341    esac
6342
6343    # why is this necessary?
6344    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6345    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6346    withval=
6347   
6348
6349 if test "$with_sgivideo" = yes; then
6350   
6351   ac_save_CPPFLAGS="$CPPFLAGS"
6352   if test \! -z "$includedir" ; then 
6353     CPPFLAGS="$CPPFLAGS -I$includedir"
6354   fi
6355   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6356   ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
6357 echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
6358 echo "configure:6370: checking for dmedia/vl.h" >&5
6359 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6360   echo $ac_n "(cached) $ac_c" 1>&6
6361 else
6362   cat > conftest.$ac_ext <<EOF
6363 #line 6375 "configure"
6364 #include "confdefs.h"
6365 #include <dmedia/vl.h>
6366 EOF
6367 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6368 { (eval echo configure:6380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6369 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6370 if test -z "$ac_err"; then
6371   rm -rf conftest*
6372   eval "ac_cv_header_$ac_safe=yes"
6373 else
6374   echo "$ac_err" >&5
6375   echo "configure: failed program was:" >&5
6376   cat conftest.$ac_ext >&5
6377   rm -rf conftest*
6378   eval "ac_cv_header_$ac_safe=no"
6379 fi
6380 rm -f conftest*
6381 fi
6382 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6383   echo "$ac_t""yes" 1>&6
6384   have_sgivideo=yes
6385 else
6386   echo "$ac_t""no" 1>&6
6387 fi
6388
6389   CPPFLAGS="$ac_save_CPPFLAGS"
6390   if test "$have_sgivideo" = yes; then
6391     have_sgivideo=no
6392     echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
6393 echo "configure:6405: checking for vlOpenVideo in -lvl" >&5
6394 ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
6395 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6396   echo $ac_n "(cached) $ac_c" 1>&6
6397 else
6398   ac_save_LIBS="$LIBS"
6399 LIBS="-lvl  $LIBS"
6400 cat > conftest.$ac_ext <<EOF
6401 #line 6413 "configure"
6402 #include "confdefs.h"
6403 /* Override any gcc2 internal prototype to avoid an error.  */
6404 /* We use char because int might match the return type of a gcc2
6405     builtin and then its argument prototype would still apply.  */
6406 char vlOpenVideo();
6407
6408 int main() {
6409 vlOpenVideo()
6410 ; return 0; }
6411 EOF
6412 if { (eval echo configure:6424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6413   rm -rf conftest*
6414   eval "ac_cv_lib_$ac_lib_var=yes"
6415 else
6416   echo "configure: failed program was:" >&5
6417   cat conftest.$ac_ext >&5
6418   rm -rf conftest*
6419   eval "ac_cv_lib_$ac_lib_var=no"
6420 fi
6421 rm -f conftest*
6422 LIBS="$ac_save_LIBS"
6423
6424 fi
6425 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6426   echo "$ac_t""yes" 1>&6
6427   have_sgivideo=yes
6428 else
6429   echo "$ac_t""no" 1>&6
6430 fi
6431
6432     if test "$have_sgivideo" = yes; then
6433       SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
6434       SGI_VIDEO_LIBS="-lvl"
6435       cat >> confdefs.h <<\EOF
6436 #define HAVE_SGI_VIDEO 1
6437 EOF
6438
6439     fi
6440   fi
6441 elif test "$with_sgivideo" != no; then
6442   echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
6443   exit 1
6444 fi
6445
6446
6447
6448 # Try to find a program to generate random text.
6449 #
6450 # Zippy is funnier than the idiocy generally spat out by `fortune',
6451 # so try to find that, by invoking Emacs and asking it where its 
6452 # libexec directory is ("yow" lives in there.)
6453 #
6454 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
6455 # and if so, use them.
6456 #
6457 # If that doesn't work, look in /usr/games, and if it's there, use
6458 # the full pathname.
6459 #
6460 with_zippy_req=""
6461 # Check whether --with-zippy or --without-zippy was given.
6462 if test "${with_zippy+set}" = set; then
6463   withval="$with_zippy"
6464    with_zippy_req="$withval"; with_zippy="$withval" 
6465 else
6466    with_zippy_req="$withval"; with_zippy="$withval" 
6467 fi
6468
6469
6470 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
6471   with_zippy=""
6472   with_zippy_req=""
6473 fi
6474
6475 if test -n "$with_zippy_req" ; then
6476   ac_cv_zippy_program=""
6477   case "$with_zippy_req" in
6478     /*)
6479       echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
6480 echo "configure:6492: checking for $with_zippy_req" >&5
6481       if test -x "$with_zippy_req" ; then
6482         echo "$ac_t""yes" 1>&6
6483       else
6484         echo "$ac_t""no" 1>&6
6485         with_zippy=""
6486       fi
6487     ;;
6488     *)
6489       # don't cache
6490       unset ac_cv_path_zip2
6491       # Extract the first word of "$with_zippy_req", so it can be a program name with args.
6492 set dummy $with_zippy_req; ac_word=$2
6493 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6494 echo "configure:6506: checking for $ac_word" >&5
6495 if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
6496   echo $ac_n "(cached) $ac_c" 1>&6
6497 else
6498   case "$zip2" in
6499   /*)
6500   ac_cv_path_zip2="$zip2" # Let the user override the test with a path.
6501   ;;
6502   ?:/*)                  
6503   ac_cv_path_zip2="$zip2" # Let the user override the test with a dos path.
6504   ;;
6505   *)
6506   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6507   ac_dummy="$PATH"
6508   for ac_dir in $ac_dummy; do 
6509     test -z "$ac_dir" && ac_dir=.
6510     if test -f $ac_dir/$ac_word; then
6511       ac_cv_path_zip2="$ac_dir/$ac_word"
6512       break
6513     fi
6514   done
6515   IFS="$ac_save_ifs"
6516   ;;
6517 esac
6518 fi
6519 zip2="$ac_cv_path_zip2"
6520 if test -n "$zip2"; then
6521   echo "$ac_t""$zip2" 1>&6
6522 else
6523   echo "$ac_t""no" 1>&6
6524 fi
6525
6526       if test "$zip2" = ""; then
6527         with_zippy=""
6528       fi
6529     ;;
6530   esac
6531   ac_cv_zippy_program="$with_zippy"
6532
6533 elif test -n "$ac_cv_zippy_program"; then
6534   echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
6535 fi
6536
6537 if test ! -n "$ac_cv_zippy_program"; then
6538
6539   for ac_prog in emacs
6540 do
6541 # Extract the first word of "$ac_prog", so it can be a program name with args.
6542 set dummy $ac_prog; ac_word=$2
6543 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6544 echo "configure:6556: checking for $ac_word" >&5
6545 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
6546   echo $ac_n "(cached) $ac_c" 1>&6
6547 else
6548   if test -n "$emacs_exe"; then
6549   ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
6550 else
6551   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6552   ac_dummy="$PATH"
6553   for ac_dir in $ac_dummy; do
6554     test -z "$ac_dir" && ac_dir=.
6555     if test -f $ac_dir/$ac_word; then
6556       ac_cv_prog_emacs_exe="$ac_prog"
6557       break
6558     fi
6559   done
6560   IFS="$ac_save_ifs"
6561 fi
6562 fi
6563 emacs_exe="$ac_cv_prog_emacs_exe"
6564 if test -n "$emacs_exe"; then
6565   echo "$ac_t""$emacs_exe" 1>&6
6566 else
6567   echo "$ac_t""no" 1>&6
6568 fi
6569
6570 test -n "$emacs_exe" && break
6571 done
6572
6573   for ac_prog in xemacs
6574 do
6575 # Extract the first word of "$ac_prog", so it can be a program name with args.
6576 set dummy $ac_prog; ac_word=$2
6577 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6578 echo "configure:6590: checking for $ac_word" >&5
6579 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
6580   echo $ac_n "(cached) $ac_c" 1>&6
6581 else
6582   if test -n "$xemacs_exe"; then
6583   ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
6584 else
6585   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6586   ac_dummy="$PATH"
6587   for ac_dir in $ac_dummy; do
6588     test -z "$ac_dir" && ac_dir=.
6589     if test -f $ac_dir/$ac_word; then
6590       ac_cv_prog_xemacs_exe="$ac_prog"
6591       break
6592     fi
6593   done
6594   IFS="$ac_save_ifs"
6595 fi
6596 fi
6597 xemacs_exe="$ac_cv_prog_xemacs_exe"
6598 if test -n "$xemacs_exe"; then
6599   echo "$ac_t""$xemacs_exe" 1>&6
6600 else
6601   echo "$ac_t""no" 1>&6
6602 fi
6603
6604 test -n "$xemacs_exe" && break
6605 done
6606
6607
6608   ac_cv_zippy_program=""
6609   eargs='-batch -q -nw --eval'
6610
6611   if test -n "$emacs_exe" ; then
6612     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
6613 echo "configure:6625: checking for emacs yow" >&5
6614     #
6615     # get emacs to tell us where the libexec directory is.
6616     #
6617     dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
6618          2>/dev/null | tail -1`
6619     dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
6620     #
6621     # try running libexec/yow and see if it exits without error.
6622     #
6623     if test x"$dir" != x -a -x "$dir/yow" ; then
6624       if $dir/yow >&- 2>&- ; then
6625         ac_cv_zippy_program="$dir/yow"
6626         echo "$ac_t""$ac_cv_zippy_program" 1>&6
6627       else
6628         echo "$ac_t""no" 1>&6
6629       fi
6630     fi
6631   fi
6632
6633   if test -z "$ac_cv_zippy_program" ; then
6634     echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
6635 echo "configure:6647: checking for xemacs yow" >&5
6636     if test -n "$xemacs_exe" ; then
6637       #
6638       # get xemacs to tell us where the libexec directory is.
6639       #
6640       dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
6641            2>/dev/null | tail -1`
6642       dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
6643       #
6644       # try running libexec/yow and see if it exits without error.
6645       #
6646       if test x"$dir" != x -a -x "$dir/yow" ; then
6647         if $dir/yow >&- 2>&- ; then
6648           ac_cv_zippy_program="$dir/yow"
6649           echo "$ac_t""$ac_cv_zippy_program" 1>&6
6650         else
6651           #
6652           # in some xemacs installations, the pathname of the yow.lines file
6653           # isn't hardcoded into the yow executable, and must be passed on 
6654           # the command line.  See if it's in libexec/../etc/.
6655
6656           # M4 sucks!!
6657           
6658           dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
6659           
6660
6661           yowlines="$dir_up/etc/yow.lines"
6662           if $dir/yow -f $yowlines >&- 2>&- ; then
6663             ac_cv_zippy_program="$dir/yow -f $yowlines"
6664             echo "$ac_t""$ac_cv_zippy_program" 1>&6
6665           else
6666             #
6667             # In newer XEmacs releases, yow.lines is in a different place,
6668             # and the easiest way to get it is by calling the new function
6669             # `locate-data-file'.
6670             #
6671             yowlines=`$xemacs_exe $eargs \
6672               '(princ (concat (locate-data-file "yow.lines") "\n"))' \
6673               2>/dev/null | tail -1`
6674             if $dir/yow -f $yowlines >&- 2>&- ; then
6675               ac_cv_zippy_program="$dir/yow -f $yowlines"
6676               echo "$ac_t""$ac_cv_zippy_program" 1>&6
6677             else
6678               echo "$ac_t""no" 1>&6
6679             fi
6680           fi
6681         fi
6682       fi
6683     fi
6684   fi
6685
6686   # if that didn't work, try for some other programs...
6687   if test -z "$ac_cv_zippy_program" ; then
6688     fortune=''
6689     for ac_prog in fortune zippy yow
6690 do
6691 # Extract the first word of "$ac_prog", so it can be a program name with args.
6692 set dummy $ac_prog; ac_word=$2
6693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6694 echo "configure:6706: checking for $ac_word" >&5
6695 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
6696   echo $ac_n "(cached) $ac_c" 1>&6
6697 else
6698   if test -n "$fortune"; then
6699   ac_cv_prog_fortune="$fortune" # Let the user override the test.
6700 else
6701   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6702   ac_dummy="$PATH"
6703   for ac_dir in $ac_dummy; do
6704     test -z "$ac_dir" && ac_dir=.
6705     if test -f $ac_dir/$ac_word; then
6706       ac_cv_prog_fortune="$ac_prog"
6707       break
6708     fi
6709   done
6710   IFS="$ac_save_ifs"
6711 fi
6712 fi
6713 fortune="$ac_cv_prog_fortune"
6714 if test -n "$fortune"; then
6715   echo "$ac_t""$fortune" 1>&6
6716 else
6717   echo "$ac_t""no" 1>&6
6718 fi
6719
6720 test -n "$fortune" && break
6721 done
6722
6723     # if that didn't work, try for those programs in /usr/games...
6724     if test -z "$fortune" ; then
6725       for ac_prog in fortune zippy yow
6726 do
6727 # Extract the first word of "$ac_prog", so it can be a program name with args.
6728 set dummy $ac_prog; ac_word=$2
6729 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6730 echo "configure:6742: checking for $ac_word" >&5
6731 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
6732   echo $ac_n "(cached) $ac_c" 1>&6
6733 else
6734   case "$fortune" in
6735   /*)
6736   ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
6737   ;;
6738   ?:/*)                  
6739   ac_cv_path_fortune="$fortune" # Let the user override the test with a dos path.
6740   ;;
6741   *)
6742   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
6743   ac_dummy="/usr/games:/usr/local/games"
6744   for ac_dir in $ac_dummy; do 
6745     test -z "$ac_dir" && ac_dir=.
6746     if test -f $ac_dir/$ac_word; then
6747       ac_cv_path_fortune="$ac_dir/$ac_word"
6748       break
6749     fi
6750   done
6751   IFS="$ac_save_ifs"
6752   ;;
6753 esac
6754 fi
6755 fortune="$ac_cv_path_fortune"
6756 if test -n "$fortune"; then
6757   echo "$ac_t""$fortune" 1>&6
6758 else
6759   echo "$ac_t""no" 1>&6
6760 fi
6761
6762 test -n "$fortune" && break
6763 done
6764 test -n "$fortune" || fortune="fortune"
6765
6766     fi
6767   fi
6768 fi
6769
6770 if test -z "$ac_cv_zippy_program" ; then
6771   ac_cv_zippy_program=fortune
6772 fi
6773
6774 cat >> confdefs.h <<EOF
6775 #define ZIPPY_PROGRAM "$ac_cv_zippy_program"
6776 EOF
6777
6778
6779
6780
6781
6782 # Allow locking to be disabled at compile-time.
6783 #
6784 have_kerberos=no
6785 with_kerberos_req=unspecified
6786 have_shadow=no
6787 with_shadow_req=unspecified
6788 have_pam=no
6789 with_pam_req=unspecified
6790 need_setuid=no
6791
6792 # Check whether --enable-locking or --disable-locking was given.
6793 if test "${enable_locking+set}" = set; then
6794   enableval="$enable_locking"
6795   enable_locking="$enableval"
6796 else
6797   enable_locking=yes
6798 fi
6799
6800 if test "$enable_locking" = yes; then
6801   true
6802 elif test "$enable_locking" = no; then
6803   cat >> confdefs.h <<\EOF
6804 #define NO_LOCKING 1
6805 EOF
6806
6807 else
6808   echo "error: must be yes or no: --enable-locking=$enable_locking"
6809   exit 1
6810 fi
6811
6812
6813
6814 # Check to see if we can lock Virtual-Terminal switching, but allow that 
6815 # to be disabled at compile-time.
6816 #
6817 ac_vt_lockswitch=no
6818 # Check whether --enable-vt-locking or --disable-vt-locking was given.
6819 if test "${enable_vt_locking+set}" = set; then
6820   enableval="$enable_vt_locking"
6821   enable_vt_locking="$enableval"
6822 else
6823   enable_vt_locking=yes
6824 fi
6825
6826 if test "$enable_vt_locking" = yes; then
6827
6828   echo $ac_n "checking for the VT_LOCKSWITCH ioctl""... $ac_c" 1>&6
6829 echo "configure:6841: checking for the VT_LOCKSWITCH ioctl" >&5
6830   if eval "test \"`echo '$''{'ac_cv_vt_lockswitch'+set}'`\" = set"; then
6831   echo $ac_n "(cached) $ac_c" 1>&6
6832 else
6833   cat > conftest.$ac_ext <<EOF
6834 #line 6846 "configure"
6835 #include "confdefs.h"
6836 #include <fcntl.h>
6837                     #include <sys/ioctl.h>
6838                     #include <sys/vt.h>
6839 int main() {
6840 int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;
6841 ; return 0; }
6842 EOF
6843 if { (eval echo configure:6855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6844   rm -rf conftest*
6845   ac_cv_vt_lockswitch=yes
6846 else
6847   echo "configure: failed program was:" >&5
6848   cat conftest.$ac_ext >&5
6849   rm -rf conftest*
6850   ac_cv_vt_lockswitch=no
6851 fi
6852 rm -f conftest*
6853 fi
6854
6855   ac_vt_lockswitch=$ac_cv_vt_lockswitch
6856   echo "$ac_t""$ac_vt_lockswitch" 1>&6
6857
6858 elif test "$enable_vt_locking" = no; then
6859   true
6860 else
6861   echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
6862   exit 1
6863 fi
6864
6865 if test "$ac_vt_lockswitch" = yes; then
6866   cat >> confdefs.h <<\EOF
6867 #define HAVE_VT_LOCKSWITCH 1
6868 EOF
6869
6870   # the VT_LOCKSWITCH ioctl can only be used when running as root.
6871   # #### but it doesn't work yet, so don't worry about that for now.
6872 #  need_setuid=yes
6873 fi
6874
6875
6876
6877 if test "$enable_locking" = yes; then
6878
6879   # Check for Kerberos.
6880   #
6881   # Check whether --with-kerberos or --without-kerberos was given.
6882 if test "${with_kerberos+set}" = set; then
6883   withval="$with_kerberos"
6884   with_kerberos="$withval"; with_kerberos_req="$withval"
6885 else
6886   with_kerberos=yes
6887 fi
6888
6889
6890   
6891    case "$with_kerberos" in
6892     yes) ;;
6893     no)  ;;
6894
6895     /*)
6896      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
6897 echo "configure:6909: checking for Kerberos headers" >&5
6898      d=$with_kerberos/include
6899      if test -d $d; then
6900        X_CFLAGS="-I$d $X_CFLAGS"
6901        echo "$ac_t""$d" 1>&6
6902      else
6903        echo "$ac_t""not found ($d: no such directory)" 1>&6
6904      fi
6905
6906      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
6907 echo "configure:6919: checking for Kerberos libs" >&5
6908      d=$with_kerberos/lib
6909      if test -d $d; then
6910        X_LIBS="-L$d $X_LIBS"
6911        echo "$ac_t""$d" 1>&6
6912      else
6913        echo "$ac_t""not found ($d: no such directory)" 1>&6
6914      fi
6915
6916      # replace the directory string with "yes".
6917      with_kerberos_req="yes"
6918      with_kerberos=$with_kerberos_req
6919      ;;
6920
6921     *)
6922      echo ""
6923      echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory."
6924      echo "       If it is a directory, then \`DIR/include' will be added to"
6925      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6926      exit 1
6927      ;;
6928    esac
6929
6930    # why is this necessary?
6931    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6932    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6933    withval=
6934   
6935
6936   if test "$with_kerberos" = yes; then
6937     echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
6938 echo "configure:6950: checking for Kerberos" >&5
6939 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
6940   echo $ac_n "(cached) $ac_c" 1>&6
6941 else
6942   
6943   ac_save_CPPFLAGS="$CPPFLAGS"
6944   if test \! -z "$includedir" ; then 
6945     CPPFLAGS="$CPPFLAGS -I$includedir"
6946   fi
6947   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6948   cat > conftest.$ac_ext <<EOF
6949 #line 6961 "configure"
6950 #include "confdefs.h"
6951 #include <krb.h>
6952 int main() {
6953
6954 ; return 0; }
6955 EOF
6956 if { (eval echo configure:6968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6957   rm -rf conftest*
6958   ac_cv_kerberos=yes
6959 else
6960   echo "configure: failed program was:" >&5
6961   cat conftest.$ac_ext >&5
6962   rm -rf conftest*
6963   ac_cv_kerberos=no
6964 fi
6965 rm -f conftest*
6966   CPPFLAGS="$ac_save_CPPFLAGS"
6967 fi
6968
6969 echo "$ac_t""$ac_cv_kerberos" 1>&6
6970     if test "$ac_cv_kerberos" = yes ; then
6971       have_kerberos=yes
6972       cat >> confdefs.h <<\EOF
6973 #define HAVE_KERBEROS 1
6974 EOF
6975
6976
6977       # from Tim Showalter <tjs+@andrew.cmu.edu>
6978       PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
6979       echo $ac_n "checking for res_search""... $ac_c" 1>&6
6980 echo "configure:6992: checking for res_search" >&5
6981 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
6982   echo $ac_n "(cached) $ac_c" 1>&6
6983 else
6984   cat > conftest.$ac_ext <<EOF
6985 #line 6997 "configure"
6986 #include "confdefs.h"
6987 /* System header to define __stub macros and hopefully few prototypes,
6988     which can conflict with char res_search(); below.  */
6989 #include <assert.h>
6990 /* Override any gcc2 internal prototype to avoid an error.  */
6991 /* We use char because int might match the return type of a gcc2
6992     builtin and then its argument prototype would still apply.  */
6993 char res_search();
6994
6995 int main() {
6996
6997 /* The GNU C library defines this for functions which it implements
6998     to always fail with ENOSYS.  Some functions are actually named
6999     something starting with __ and the normal name is an alias.  */
7000 #if defined (__stub_res_search) || defined (__stub___res_search)
7001 choke me
7002 #else
7003 res_search();
7004 #endif
7005
7006 ; return 0; }
7007 EOF
7008 if { (eval echo configure:7020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7009   rm -rf conftest*
7010   eval "ac_cv_func_res_search=yes"
7011 else
7012   echo "configure: failed program was:" >&5
7013   cat conftest.$ac_ext >&5
7014   rm -rf conftest*
7015   eval "ac_cv_func_res_search=no"
7016 fi
7017 rm -f conftest*
7018 fi
7019
7020 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
7021   echo "$ac_t""yes" 1>&6
7022   :
7023 else
7024   echo "$ac_t""no" 1>&6
7025 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
7026 echo "configure:7038: checking for res_search in -lresolv" >&5
7027 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
7028 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7029   echo $ac_n "(cached) $ac_c" 1>&6
7030 else
7031   ac_save_LIBS="$LIBS"
7032 LIBS="-lresolv  $LIBS"
7033 cat > conftest.$ac_ext <<EOF
7034 #line 7046 "configure"
7035 #include "confdefs.h"
7036 /* Override any gcc2 internal prototype to avoid an error.  */
7037 /* We use char because int might match the return type of a gcc2
7038     builtin and then its argument prototype would still apply.  */
7039 char res_search();
7040
7041 int main() {
7042 res_search()
7043 ; return 0; }
7044 EOF
7045 if { (eval echo configure:7057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7046   rm -rf conftest*
7047   eval "ac_cv_lib_$ac_lib_var=yes"
7048 else
7049   echo "configure: failed program was:" >&5
7050   cat conftest.$ac_ext >&5
7051   rm -rf conftest*
7052   eval "ac_cv_lib_$ac_lib_var=no"
7053 fi
7054 rm -f conftest*
7055 LIBS="$ac_save_LIBS"
7056
7057 fi
7058 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7059   echo "$ac_t""yes" 1>&6
7060   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
7061 else
7062   echo "$ac_t""no" 1>&6
7063 echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
7064         
7065 fi
7066
7067 fi
7068
7069
7070     fi
7071   elif test "$with_kerberos" != no; then
7072     echo "error: must be yes or no: --with-kerberos=$with_kerberos"
7073     exit 1
7074   fi
7075   
7076   # Check for PAM.
7077   # Check whether --with-pam or --without-pam was given.
7078 if test "${with_pam+set}" = set; then
7079   withval="$with_pam"
7080   with_pam="$withval"; with_pam_req="$withval"
7081 else
7082   with_pam=yes
7083 fi
7084
7085
7086   
7087    case "$with_pam" in
7088     yes) ;;
7089     no)  ;;
7090
7091     /*)
7092      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
7093 echo "configure:7105: checking for PAM headers" >&5
7094      d=$with_pam/include
7095      if test -d $d; then
7096        X_CFLAGS="-I$d $X_CFLAGS"
7097        echo "$ac_t""$d" 1>&6
7098      else
7099        echo "$ac_t""not found ($d: no such directory)" 1>&6
7100      fi
7101
7102      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
7103 echo "configure:7115: checking for PAM libs" >&5
7104      d=$with_pam/lib
7105      if test -d $d; then
7106        X_LIBS="-L$d $X_LIBS"
7107        echo "$ac_t""$d" 1>&6
7108      else
7109        echo "$ac_t""not found ($d: no such directory)" 1>&6
7110      fi
7111
7112      # replace the directory string with "yes".
7113      with_pam_req="yes"
7114      with_pam=$with_pam_req
7115      ;;
7116
7117     *)
7118      echo ""
7119      echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
7120      echo "       If it is a directory, then \`DIR/include' will be added to"
7121      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7122      exit 1
7123      ;;
7124    esac
7125
7126    # why is this necessary?
7127    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
7128    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
7129    withval=
7130   
7131
7132   if test "$with_pam" = yes; then
7133     echo $ac_n "checking for PAM""... $ac_c" 1>&6
7134 echo "configure:7146: checking for PAM" >&5
7135 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
7136   echo $ac_n "(cached) $ac_c" 1>&6
7137 else
7138   
7139   ac_save_CPPFLAGS="$CPPFLAGS"
7140   if test \! -z "$includedir" ; then 
7141     CPPFLAGS="$CPPFLAGS -I$includedir"
7142   fi
7143   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7144   cat > conftest.$ac_ext <<EOF
7145 #line 7157 "configure"
7146 #include "confdefs.h"
7147 #include <security/pam_appl.h>
7148 int main() {
7149
7150 ; return 0; }
7151 EOF
7152 if { (eval echo configure:7164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7153   rm -rf conftest*
7154   ac_cv_pam=yes
7155 else
7156   echo "configure: failed program was:" >&5
7157   cat conftest.$ac_ext >&5
7158   rm -rf conftest*
7159   ac_cv_pam=no
7160 fi
7161 rm -f conftest*
7162   CPPFLAGS="$ac_save_CPPFLAGS"
7163 fi
7164
7165 echo "$ac_t""$ac_cv_pam" 1>&6
7166     if test "$ac_cv_pam" = yes ; then
7167           have_pam=yes
7168           cat >> confdefs.h <<\EOF
7169 #define HAVE_PAM 1
7170 EOF
7171
7172           PASSWD_LIBS="${PASSWD_LIBS} -lpam -ldl"
7173
7174
7175           echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
7176 echo "configure:7188: checking how to call pam_strerror" >&5
7177           if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
7178   echo $ac_n "(cached) $ac_c" 1>&6
7179 else
7180   cat > conftest.$ac_ext <<EOF
7181 #line 7193 "configure"
7182 #include "confdefs.h"
7183 #include <stdio.h>
7184                             #include <stdlib.h>
7185                             #include <security/pam_appl.h>
7186 int main() {
7187 pam_handle_t *pamh = 0;
7188                             char *s = pam_strerror(pamh, PAM_SUCCESS);
7189 ; return 0; }
7190 EOF
7191 if { (eval echo configure:7203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7192   rm -rf conftest*
7193   ac_pam_strerror_args=2
7194 else
7195   echo "configure: failed program was:" >&5
7196   cat conftest.$ac_ext >&5
7197   rm -rf conftest*
7198   cat > conftest.$ac_ext <<EOF
7199 #line 7211 "configure"
7200 #include "confdefs.h"
7201 #include <stdio.h>
7202                                             #include <stdlib.h>
7203                                             #include <security/pam_appl.h>
7204 int main() {
7205 char *s =
7206                                              pam_strerror(PAM_SUCCESS);
7207 ; return 0; }
7208 EOF
7209 if { (eval echo configure:7221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7210   rm -rf conftest*
7211   ac_pam_strerror_args=1
7212 else
7213   echo "configure: failed program was:" >&5
7214   cat conftest.$ac_ext >&5
7215   rm -rf conftest*
7216   ac_pam_strerror_args=0
7217 fi
7218 rm -f conftest*
7219 fi
7220 rm -f conftest*
7221             ac_cv_pam_strerror_args=$ac_pam_strerror_args
7222 fi
7223
7224           ac_pam_strerror_args=$ac_cv_pam_strerror_args
7225           if test "$ac_pam_strerror_args" = 1 ; then
7226             echo "$ac_t""one argument" 1>&6
7227           elif test "$ac_pam_strerror_args" = 2 ; then
7228             cat >> confdefs.h <<\EOF
7229 #define PAM_STRERROR_TWO_ARGS 1
7230 EOF
7231
7232             echo "$ac_t""two arguments" 1>&6
7233           else
7234             echo "$ac_t""unknown" 1>&6
7235           fi
7236     fi
7237   elif test "$with_pam" != no; then
7238         echo "error: must be yes or no: --with-pam=$with_pam"
7239         exit 1
7240   fi
7241
7242   # Next, check for the nine billion variants of shadow passwords...
7243
7244   pwent_cruft_done=no
7245   # Check whether --with-shadow or --without-shadow was given.
7246 if test "${with_shadow+set}" = set; then
7247   withval="$with_shadow"
7248   with_shadow="$withval"; with_shadow_req="$withval"
7249 else
7250   with_shadow=yes
7251 fi
7252
7253
7254   
7255    case "$with_shadow" in
7256     yes) ;;
7257     no)  ;;
7258
7259     /*)
7260      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
7261 echo "configure:7273: checking for shadow password headers" >&5
7262      d=$with_shadow/include
7263      if test -d $d; then
7264        X_CFLAGS="-I$d $X_CFLAGS"
7265        echo "$ac_t""$d" 1>&6
7266      else
7267        echo "$ac_t""not found ($d: no such directory)" 1>&6
7268      fi
7269
7270      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
7271 echo "configure:7283: checking for shadow password libs" >&5
7272      d=$with_shadow/lib
7273      if test -d $d; then
7274        X_LIBS="-L$d $X_LIBS"
7275        echo "$ac_t""$d" 1>&6
7276      else
7277        echo "$ac_t""not found ($d: no such directory)" 1>&6
7278      fi
7279
7280      # replace the directory string with "yes".
7281      with_shadow_req="yes"
7282      with_shadow=$with_shadow_req
7283      ;;
7284
7285     *)
7286      echo ""
7287      echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory."
7288      echo "       If it is a directory, then \`DIR/include' will be added to"
7289      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7290      exit 1
7291      ;;
7292    esac
7293
7294    # why is this necessary?
7295    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
7296    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
7297    withval=
7298   
7299
7300   if test "$with_shadow" = no; then
7301     pwent_cruft_done=yes
7302   elif test "$with_shadow" != yes; then
7303     echo "error: must be yes or no: --with-shadow=$with_shadow"
7304     exit 1
7305   fi
7306
7307
7308   # Sun's "adjunct" passwords.
7309   #
7310   if test "$pwent_cruft_done" = no ; then
7311     echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
7312 echo "configure:7324: checking for Sun-style shadow passwords" >&5
7313 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
7314   echo $ac_n "(cached) $ac_c" 1>&6
7315 else
7316   
7317   ac_save_CPPFLAGS="$CPPFLAGS"
7318   if test \! -z "$includedir" ; then 
7319     CPPFLAGS="$CPPFLAGS -I$includedir"
7320   fi
7321   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7322   cat > conftest.$ac_ext <<EOF
7323 #line 7335 "configure"
7324 #include "confdefs.h"
7325 #include <stdlib.h>
7326                                       #include <unistd.h>
7327                                       #include <sys/types.h>
7328                                       #include <sys/label.h>
7329                                       #include <sys/audit.h>
7330                                       #include <pwdadj.h>
7331 int main() {
7332 struct passwd_adjunct *p = getpwanam("nobody");
7333                          const char *pw = p->pwa_passwd;
7334 ; return 0; }
7335 EOF
7336 if { (eval echo configure:7348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7337   rm -rf conftest*
7338   ac_cv_sun_adjunct=yes
7339 else
7340   echo "configure: failed program was:" >&5
7341   cat conftest.$ac_ext >&5
7342   rm -rf conftest*
7343   ac_cv_sun_adjunct=no
7344 fi
7345 rm -f conftest*
7346   CPPFLAGS="$ac_save_CPPFLAGS"
7347 fi
7348
7349 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
7350     if test "$ac_cv_sun_adjunct" = yes; then
7351       have_shadow=yes
7352       need_setuid=yes
7353       pwent_cruft_done=yes
7354       cat >> confdefs.h <<\EOF
7355 #define HAVE_ADJUNCT_PASSWD 1
7356 EOF
7357
7358     fi
7359   fi
7360
7361   # DEC and SCO so-called "enhanced" security.
7362   #
7363   if test "$pwent_cruft_done" = no ; then
7364     echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
7365 echo "configure:7377: checking for DEC-style shadow passwords" >&5
7366 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
7367   echo $ac_n "(cached) $ac_c" 1>&6
7368 else
7369   
7370   ac_save_CPPFLAGS="$CPPFLAGS"
7371   if test \! -z "$includedir" ; then 
7372     CPPFLAGS="$CPPFLAGS -I$includedir"
7373   fi
7374   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7375   cat > conftest.$ac_ext <<EOF
7376 #line 7388 "configure"
7377 #include "confdefs.h"
7378 #include <stdlib.h>
7379                                       #include <unistd.h>
7380                                       #include <sys/types.h>
7381                                       #include <pwd.h>
7382                                       #include <sys/security.h>
7383                                       #include <prot.h>
7384 int main() {
7385 struct pr_passwd *p;
7386                          const char *pw;
7387                          set_auth_parameters(0, 0);
7388                          check_auth_parameters();
7389                          p = getprpwnam("nobody");
7390                          pw = p->ufld.fd_encrypt;
7391 ; return 0; }
7392 EOF
7393 if { (eval echo configure:7405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7394   rm -rf conftest*
7395   ac_cv_enhanced_passwd=yes
7396 else
7397   echo "configure: failed program was:" >&5
7398   cat conftest.$ac_ext >&5
7399   rm -rf conftest*
7400   ac_cv_enhanced_passwd=no
7401 fi
7402 rm -f conftest*
7403   CPPFLAGS="$ac_save_CPPFLAGS"
7404 fi
7405
7406 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
7407     if test $ac_cv_enhanced_passwd = yes; then
7408       have_shadow=yes
7409       need_setuid=yes
7410       pwent_cruft_done=yes
7411       cat >> confdefs.h <<\EOF
7412 #define HAVE_ENHANCED_PASSWD 1
7413 EOF
7414
7415
7416       # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
7417       # (I'm told it needs -lcurses too, but I don't understand why.)
7418       echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
7419 echo "configure:7431: checking for getprpwnam in -lprot" >&5
7420 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
7421 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7422   echo $ac_n "(cached) $ac_c" 1>&6
7423 else
7424   ac_save_LIBS="$LIBS"
7425 LIBS="-lprot -lx $LIBS"
7426 cat > conftest.$ac_ext <<EOF
7427 #line 7439 "configure"
7428 #include "confdefs.h"
7429 /* Override any gcc2 internal prototype to avoid an error.  */
7430 /* We use char because int might match the return type of a gcc2
7431     builtin and then its argument prototype would still apply.  */
7432 char getprpwnam();
7433
7434 int main() {
7435 getprpwnam()
7436 ; return 0; }
7437 EOF
7438 if { (eval echo configure:7450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7439   rm -rf conftest*
7440   eval "ac_cv_lib_$ac_lib_var=yes"
7441 else
7442   echo "configure: failed program was:" >&5
7443   cat conftest.$ac_ext >&5
7444   rm -rf conftest*
7445   eval "ac_cv_lib_$ac_lib_var=no"
7446 fi
7447 rm -f conftest*
7448 LIBS="$ac_save_LIBS"
7449
7450 fi
7451 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7452   echo "$ac_t""yes" 1>&6
7453   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
7454 else
7455   echo "$ac_t""no" 1>&6
7456 # On DEC, getprpwnam() is in -lsecurity
7457                     echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
7458 echo "configure:7470: checking for getprpwnam in -lsecurity" >&5
7459 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
7460 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7461   echo $ac_n "(cached) $ac_c" 1>&6
7462 else
7463   ac_save_LIBS="$LIBS"
7464 LIBS="-lsecurity  $LIBS"
7465 cat > conftest.$ac_ext <<EOF
7466 #line 7478 "configure"
7467 #include "confdefs.h"
7468 /* Override any gcc2 internal prototype to avoid an error.  */
7469 /* We use char because int might match the return type of a gcc2
7470     builtin and then its argument prototype would still apply.  */
7471 char getprpwnam();
7472
7473 int main() {
7474 getprpwnam()
7475 ; return 0; }
7476 EOF
7477 if { (eval echo configure:7489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7478   rm -rf conftest*
7479   eval "ac_cv_lib_$ac_lib_var=yes"
7480 else
7481   echo "configure: failed program was:" >&5
7482   cat conftest.$ac_ext >&5
7483   rm -rf conftest*
7484   eval "ac_cv_lib_$ac_lib_var=no"
7485 fi
7486 rm -f conftest*
7487 LIBS="$ac_save_LIBS"
7488
7489 fi
7490 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7491   echo "$ac_t""yes" 1>&6
7492   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
7493 else
7494   echo "$ac_t""no" 1>&6
7495 fi
7496
7497 fi
7498
7499     fi
7500   fi
7501
7502   # HP's entry in the "Not Invented Here" Sweepstakes.
7503   #
7504   if test "$pwent_cruft_done" = no ; then
7505     echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
7506 echo "configure:7518: checking for HP-style shadow passwords" >&5
7507 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
7508   echo $ac_n "(cached) $ac_c" 1>&6
7509 else
7510   
7511   ac_save_CPPFLAGS="$CPPFLAGS"
7512   if test \! -z "$includedir" ; then 
7513     CPPFLAGS="$CPPFLAGS -I$includedir"
7514   fi
7515   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7516   cat > conftest.$ac_ext <<EOF
7517 #line 7529 "configure"
7518 #include "confdefs.h"
7519 #include <stdlib.h>
7520                                       #include <unistd.h>
7521                                       #include <sys/types.h>
7522                                       #include <pwd.h>
7523                                       #include <hpsecurity.h>
7524                                       #include <prot.h>
7525 int main() {
7526 struct s_passwd *p = getspwnam("nobody");
7527                          const char *pw = p->pw_passwd;
7528 ; return 0; }
7529 EOF
7530 if { (eval echo configure:7542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7531   rm -rf conftest*
7532   ac_cv_hpux_passwd=yes
7533 else
7534   echo "configure: failed program was:" >&5
7535   cat conftest.$ac_ext >&5
7536   rm -rf conftest*
7537   ac_cv_hpux_passwd=no
7538 fi
7539 rm -f conftest*
7540   CPPFLAGS="$ac_save_CPPFLAGS"
7541 fi
7542
7543 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
7544     if test "$ac_cv_hpux_passwd" = yes; then
7545       have_shadow=yes
7546       need_setuid=yes
7547       pwent_cruft_done=yes
7548       cat >> confdefs.h <<\EOF
7549 #define HAVE_HPUX_PASSWD 1
7550 EOF
7551
7552
7553       # on HPUX, bigcrypt is in -lsec
7554       echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
7555 echo "configure:7567: checking for bigcrypt in -lsec" >&5
7556 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
7557 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7558   echo $ac_n "(cached) $ac_c" 1>&6
7559 else
7560   ac_save_LIBS="$LIBS"
7561 LIBS="-lsec  $LIBS"
7562 cat > conftest.$ac_ext <<EOF
7563 #line 7575 "configure"
7564 #include "confdefs.h"
7565 /* Override any gcc2 internal prototype to avoid an error.  */
7566 /* We use char because int might match the return type of a gcc2
7567     builtin and then its argument prototype would still apply.  */
7568 char bigcrypt();
7569
7570 int main() {
7571 bigcrypt()
7572 ; return 0; }
7573 EOF
7574 if { (eval echo configure:7586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7575   rm -rf conftest*
7576   eval "ac_cv_lib_$ac_lib_var=yes"
7577 else
7578   echo "configure: failed program was:" >&5
7579   cat conftest.$ac_ext >&5
7580   rm -rf conftest*
7581   eval "ac_cv_lib_$ac_lib_var=no"
7582 fi
7583 rm -f conftest*
7584 LIBS="$ac_save_LIBS"
7585
7586 fi
7587 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7588   echo "$ac_t""yes" 1>&6
7589   PASSWD_LIBS="$PASSWD_LIBS -lsec"
7590 else
7591   echo "$ac_t""no" 1>&6
7592 fi
7593
7594     fi
7595   fi
7596
7597   # Traditional (ha!) shadow passwords.
7598   #
7599   if test "$pwent_cruft_done" = no ; then
7600     echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
7601 echo "configure:7613: checking for generic shadow passwords" >&5
7602 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
7603   echo $ac_n "(cached) $ac_c" 1>&6
7604 else
7605   
7606   ac_save_CPPFLAGS="$CPPFLAGS"
7607   if test \! -z "$includedir" ; then 
7608     CPPFLAGS="$CPPFLAGS -I$includedir"
7609   fi
7610   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7611   cat > conftest.$ac_ext <<EOF
7612 #line 7624 "configure"
7613 #include "confdefs.h"
7614 #include <stdlib.h>
7615                                       #include <unistd.h>
7616                                       #include <sys/types.h>
7617                                       #include <pwd.h>
7618                                       #include <shadow.h>
7619 int main() {
7620 struct spwd *p = getspnam("nobody");
7621                          const char *pw = p->sp_pwdp;
7622 ; return 0; }
7623 EOF
7624 if { (eval echo configure:7636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7625   rm -rf conftest*
7626   ac_cv_shadow=yes
7627 else
7628   echo "configure: failed program was:" >&5
7629   cat conftest.$ac_ext >&5
7630   rm -rf conftest*
7631   ac_cv_shadow=no
7632 fi
7633 rm -f conftest*
7634   CPPFLAGS="$ac_save_CPPFLAGS"
7635 fi
7636
7637 echo "$ac_t""$ac_cv_shadow" 1>&6
7638     if test "$ac_cv_shadow" = yes; then
7639       have_shadow=yes
7640       need_setuid=yes
7641       pwent_cruft_done=yes
7642       cat >> confdefs.h <<\EOF
7643 #define HAVE_SHADOW_PASSWD 1
7644 EOF
7645
7646
7647       # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
7648       have_getspnam=no
7649       echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
7650 echo "configure:7662: checking for getspnam in -lc" >&5
7651 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
7652 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7653   echo $ac_n "(cached) $ac_c" 1>&6
7654 else
7655   ac_save_LIBS="$LIBS"
7656 LIBS="-lc  $LIBS"
7657 cat > conftest.$ac_ext <<EOF
7658 #line 7670 "configure"
7659 #include "confdefs.h"
7660 /* Override any gcc2 internal prototype to avoid an error.  */
7661 /* We use char because int might match the return type of a gcc2
7662     builtin and then its argument prototype would still apply.  */
7663 char getspnam();
7664
7665 int main() {
7666 getspnam()
7667 ; return 0; }
7668 EOF
7669 if { (eval echo configure:7681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7670   rm -rf conftest*
7671   eval "ac_cv_lib_$ac_lib_var=yes"
7672 else
7673   echo "configure: failed program was:" >&5
7674   cat conftest.$ac_ext >&5
7675   rm -rf conftest*
7676   eval "ac_cv_lib_$ac_lib_var=no"
7677 fi
7678 rm -f conftest*
7679 LIBS="$ac_save_LIBS"
7680
7681 fi
7682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7683   echo "$ac_t""yes" 1>&6
7684   have_getspnam=yes
7685 else
7686   echo "$ac_t""no" 1>&6
7687 fi
7688
7689       if test "$have_getspnam" = no ; then
7690         echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
7691 echo "configure:7703: checking for getspnam in -lgen" >&5
7692 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
7693 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7694   echo $ac_n "(cached) $ac_c" 1>&6
7695 else
7696   ac_save_LIBS="$LIBS"
7697 LIBS="-lgen  $LIBS"
7698 cat > conftest.$ac_ext <<EOF
7699 #line 7711 "configure"
7700 #include "confdefs.h"
7701 /* Override any gcc2 internal prototype to avoid an error.  */
7702 /* We use char because int might match the return type of a gcc2
7703     builtin and then its argument prototype would still apply.  */
7704 char getspnam();
7705
7706 int main() {
7707 getspnam()
7708 ; return 0; }
7709 EOF
7710 if { (eval echo configure:7722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7711   rm -rf conftest*
7712   eval "ac_cv_lib_$ac_lib_var=yes"
7713 else
7714   echo "configure: failed program was:" >&5
7715   cat conftest.$ac_ext >&5
7716   rm -rf conftest*
7717   eval "ac_cv_lib_$ac_lib_var=no"
7718 fi
7719 rm -f conftest*
7720 LIBS="$ac_save_LIBS"
7721
7722 fi
7723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7724   echo "$ac_t""yes" 1>&6
7725   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
7726 else
7727   echo "$ac_t""no" 1>&6
7728 fi
7729
7730       fi
7731     fi
7732   fi
7733
7734   # On FreeBSD, getpwnam() and friends work just like on non-shadow-password
7735   # systems -- except you only get stuff in the pw_passwd field if the running
7736   # program is setuid.  So, guess that we've got this lossage to contend with
7737   # if /etc/master.passwd exists, and default to a setuid installation.
7738   #
7739   if test "$pwent_cruft_done" = no ; then
7740     echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
7741 echo "configure:7753: checking for FreeBSD-style shadow passwords" >&5
7742 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
7743   echo $ac_n "(cached) $ac_c" 1>&6
7744 else
7745   if test -f /etc/master.passwd ; then
7746                       ac_cv_master_passwd=yes
7747                     else
7748                       ac_cv_master_passwd=no
7749                     fi
7750 fi
7751
7752 echo "$ac_t""$ac_cv_master_passwd" 1>&6
7753     if test "$ac_cv_master_passwd" = yes; then
7754       need_setuid=yes
7755       pwent_cruft_done=yes
7756     fi
7757   fi
7758
7759   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
7760   have_crypt=no
7761   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
7762 echo "configure:7774: checking for crypt in -lc" >&5
7763 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
7764 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7765   echo $ac_n "(cached) $ac_c" 1>&6
7766 else
7767   ac_save_LIBS="$LIBS"
7768 LIBS="-lc  $LIBS"
7769 cat > conftest.$ac_ext <<EOF
7770 #line 7782 "configure"
7771 #include "confdefs.h"
7772 /* Override any gcc2 internal prototype to avoid an error.  */
7773 /* We use char because int might match the return type of a gcc2
7774     builtin and then its argument prototype would still apply.  */
7775 char crypt();
7776
7777 int main() {
7778 crypt()
7779 ; return 0; }
7780 EOF
7781 if { (eval echo configure:7793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7782   rm -rf conftest*
7783   eval "ac_cv_lib_$ac_lib_var=yes"
7784 else
7785   echo "configure: failed program was:" >&5
7786   cat conftest.$ac_ext >&5
7787   rm -rf conftest*
7788   eval "ac_cv_lib_$ac_lib_var=no"
7789 fi
7790 rm -f conftest*
7791 LIBS="$ac_save_LIBS"
7792
7793 fi
7794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7795   echo "$ac_t""yes" 1>&6
7796   have_crypt=yes
7797 else
7798   echo "$ac_t""no" 1>&6
7799 fi
7800
7801   if test "$have_crypt" = no ; then
7802     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7803 echo "configure:7815: checking for crypt in -lcrypt" >&5
7804 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7805 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7806   echo $ac_n "(cached) $ac_c" 1>&6
7807 else
7808   ac_save_LIBS="$LIBS"
7809 LIBS="-lcrypt  $LIBS"
7810 cat > conftest.$ac_ext <<EOF
7811 #line 7823 "configure"
7812 #include "confdefs.h"
7813 /* Override any gcc2 internal prototype to avoid an error.  */
7814 /* We use char because int might match the return type of a gcc2
7815     builtin and then its argument prototype would still apply.  */
7816 char crypt();
7817
7818 int main() {
7819 crypt()
7820 ; return 0; }
7821 EOF
7822 if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7823   rm -rf conftest*
7824   eval "ac_cv_lib_$ac_lib_var=yes"
7825 else
7826   echo "configure: failed program was:" >&5
7827   cat conftest.$ac_ext >&5
7828   rm -rf conftest*
7829   eval "ac_cv_lib_$ac_lib_var=no"
7830 fi
7831 rm -f conftest*
7832 LIBS="$ac_save_LIBS"
7833
7834 fi
7835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7836   echo "$ac_t""yes" 1>&6
7837   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
7838 else
7839   echo "$ac_t""no" 1>&6
7840 fi
7841
7842   fi
7843
7844
7845   # Most of the above shadow mechanisms will have set need_setuid to yes,
7846   # if they were found.  But, on some systems, we need setuid even when
7847   # using plain old vanilla passwords.
7848   #
7849   if test "$need_setuid" = no ; then
7850     case "$host" in
7851       *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
7852         need_setuid=yes
7853       ;;
7854     esac
7855   fi
7856
7857 fi
7858
7859
7860 # for the "sonar" hack -- check how to ping.
7861 #
7862 echo $ac_n "checking for struct icmp""... $ac_c" 1>&6
7863 echo "configure:7875: checking for struct icmp" >&5
7864 if eval "test \"`echo '$''{'ac_cv_have_icmp'+set}'`\" = set"; then
7865   echo $ac_n "(cached) $ac_c" 1>&6
7866 else
7867   cat > conftest.$ac_ext <<EOF
7868 #line 7880 "configure"
7869 #include "confdefs.h"
7870 #include <stdlib.h>
7871                   #include <stdio.h>
7872                   #include <math.h>
7873                   #include <unistd.h>
7874                   #include <limits.h>
7875                   #include <signal.h>
7876                   #include <fcntl.h>
7877                   #include <sys/types.h>
7878                   #include <sys/time.h>
7879                   #include <sys/ipc.h>
7880                   #include <sys/shm.h>
7881                   #include <sys/socket.h>
7882                   #include <netinet/in_systm.h>
7883                   #include <netinet/in.h>
7884                   #include <netinet/ip.h>
7885                   #include <netinet/ip_icmp.h>
7886                   #include <netinet/udp.h>
7887                   #include <arpa/inet.h>
7888                   #include <netdb.h>
7889 int main() {
7890 struct icmp i;
7891                   struct sockaddr s;
7892                   struct sockaddr_in si;
7893                   struct ip ip;
7894                   i.icmp_type = ICMP_ECHO;
7895                   i.icmp_code = 0;
7896                   i.icmp_cksum = 0;
7897                   i.icmp_id = 0;
7898                   i.icmp_seq = 0;
7899                   si.sin_family = AF_INET;
7900                   ip.ip_hl = 0;
7901 ; return 0; }
7902 EOF
7903 if { (eval echo configure:7915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7904   rm -rf conftest*
7905   ac_cv_have_icmp=yes
7906 else
7907   echo "configure: failed program was:" >&5
7908   cat conftest.$ac_ext >&5
7909   rm -rf conftest*
7910   ac_cv_have_icmp=no
7911 fi
7912 rm -f conftest*
7913 fi
7914
7915 ac_have_icmp=$ac_cv_have_icmp
7916 echo "$ac_t""$ac_cv_have_icmp" 1>&6
7917
7918 echo $ac_n "checking for struct icmphdr""... $ac_c" 1>&6
7919 echo "configure:7931: checking for struct icmphdr" >&5
7920 if eval "test \"`echo '$''{'ac_cv_have_icmphdr'+set}'`\" = set"; then
7921   echo $ac_n "(cached) $ac_c" 1>&6
7922 else
7923   cat > conftest.$ac_ext <<EOF
7924 #line 7936 "configure"
7925 #include "confdefs.h"
7926 #include <stdlib.h>
7927                   #include <stdio.h>
7928                   #include <math.h>
7929                   #include <unistd.h>
7930                   #include <limits.h>
7931                   #include <signal.h>
7932                   #include <fcntl.h>
7933                   #include <sys/types.h>
7934                   #include <sys/time.h>
7935                   #include <sys/ipc.h>
7936                   #include <sys/shm.h>
7937                   #include <sys/socket.h>
7938                   #include <netinet/in_systm.h>
7939                   #include <netinet/in.h>
7940                   #include <netinet/ip.h>
7941                   #include <netinet/ip_icmp.h>
7942                   #include <netinet/udp.h>
7943                   #include <arpa/inet.h>
7944                   #include <netdb.h>
7945 int main() {
7946 struct icmphdr i;
7947                   struct sockaddr s;
7948                   struct sockaddr_in si;
7949                   struct ip ip;
7950                   i.type = ICMP_ECHO;
7951                   i.code = 0;
7952                   i.cksum = 0;
7953                   i.un.echo.id = 0;
7954                   i.un.echo.sequence = 0;
7955                   si.sin_family = AF_INET;
7956                   ip.ip_hl = 0;
7957 ; return 0; }
7958 EOF
7959 if { (eval echo configure:7971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7960   rm -rf conftest*
7961   ac_cv_have_icmphdr=yes
7962 else
7963   echo "configure: failed program was:" >&5
7964   cat conftest.$ac_ext >&5
7965   rm -rf conftest*
7966   ac_cv_have_icmphdr=no
7967 fi
7968 rm -f conftest*
7969 fi
7970
7971 ac_have_icmphdr=$ac_cv_have_icmphdr
7972 echo "$ac_t""$ac_cv_have_icmphdr" 1>&6
7973
7974 if test "$ac_have_icmp" = yes ; then
7975   cat >> confdefs.h <<\EOF
7976 #define HAVE_ICMP 1
7977 EOF
7978
7979 fi
7980 if test "$ac_have_icmphdr" = yes ; then
7981   cat >> confdefs.h <<\EOF
7982 #define HAVE_ICMPHDR 1
7983 EOF
7984
7985 fi
7986
7987
7988
7989 ########################## end of tests.
7990
7991
7992 if test \! -z "$includedir" ; then 
7993   INCLUDES="-I$includedir"
7994 fi
7995
7996 if test \! -z "$libdir" ; then
7997   LDFLAGS="$LDFLAGS -L$libdir"
7998 fi
7999
8000
8001 ##### should have options to override the DEPEND crap, I guess...
8002 DEPEND=makedepend
8003 DEPEND_FLAGS=
8004 DEPEND_DEFINES=
8005
8006
8007 # Done testing things -- now substitute in some stuff for the Makefiles.
8008 #
8009 if test "$have_motif" = yes; then
8010   cat >> confdefs.h <<\EOF
8011 #define HAVE_MOTIF 1
8012 EOF
8013
8014   TOOLKIT_SRCS='$(MOTIF_SRCS)'
8015   TOOLKIT_OBJS='$(MOTIF_OBJS)'
8016 elif test "$have_athena" = yes; then
8017   cat >> confdefs.h <<\EOF
8018 #define HAVE_ATHENA 1
8019 EOF
8020
8021   TOOLKIT_SRCS='$(ATHENA_SRCS)'
8022   TOOLKIT_OBJS='$(ATHENA_OBJS)'
8023 else
8024   TOOLKIT_SRCS=''
8025   TOOLKIT_OBJS=''
8026 fi
8027
8028 if test "$have_kerberos" = yes; then
8029   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
8030   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
8031 fi
8032 if test "$have_pam" = yes; then
8033   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
8034   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
8035   INSTALL_PAM="install-pam"
8036 fi
8037   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
8038   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
8039
8040
8041 if test "$enable_locking" = yes; then
8042   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
8043   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
8044 else
8045   LOCK_SRCS=''
8046   LOCK_OBJS=''
8047 fi
8048
8049 if test "$need_setuid" = yes; then
8050   NEED_SETUID=yes
8051   INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
8052 else
8053   NEED_SETUID=no
8054   INSTALL_SETUID='$(INSTALL_PROGRAM)'
8055 fi
8056
8057 tab='   '
8058 if test "$have_gl" = yes; then
8059   GL_EXES='$(GL_EXES)'
8060   GL_MEN='$(GL_MEN)'
8061   GL_KLUDGE="${tab}  "
8062 else
8063   GL_KLUDGE="  -${tab}  "
8064 fi
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102 # Print some warnings before emitting the Makefiles.
8103 #
8104 warn_prefix_1="    Warning:"
8105 warn_prefix_2="       Note:"
8106 warn_prefix="$warn_prefix_1"
8107
8108 warning=no
8109 warnsep='    #################################################################'
8110
8111 warnpre() {
8112   if test "$warning" = no ; then
8113     echo '' ; echo "$warnsep" ; echo ''
8114     warning=yes
8115   fi
8116 }
8117
8118 warn() {
8119   warnpre
8120   if test "$warning" = long ; then echo '' ; fi
8121   warning=yes
8122   echo "$warn_prefix $@"
8123 }
8124
8125 warnL() {
8126   was=$warning
8127   warnpre
8128   warning=yes
8129   if test "$was" != no ; then echo '' ; fi
8130   echo "$warn_prefix $@"
8131 }
8132
8133 warn2() {
8134   echo "             $@"
8135   warning=long
8136 }
8137
8138 note() {
8139   warn_prefix="$warn_prefix_2"
8140   warn $@
8141   warn_prefix="$warn_prefix_1"
8142 }
8143
8144 noteL() {
8145   warn_prefix="$warn_prefix_2"
8146   warnL $@
8147   warn_prefix="$warn_prefix_1"
8148 }
8149
8150
8151 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
8152   warn 'The SGI saver extension was requested, but was not found.'
8153 fi
8154
8155 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
8156   warn 'The MIT saver extension was requested, but was not found.'
8157 fi
8158
8159 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
8160   warn 'The XIdle extension was requested, but was not found.'
8161 fi
8162
8163 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
8164   warn 'The XSHM extension was requested, but was not found.'
8165 fi
8166
8167 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
8168   warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
8169 fi
8170
8171 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
8172   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
8173 fi
8174
8175 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
8176   warn 'The DPMS extension was requested, but was not found.'
8177 fi
8178
8179 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
8180   warn 'The XF86VMODE extension was requested, but was not found.'
8181 fi
8182
8183 if test "$have_motif" = no -a "$have_athena" = no ; then
8184   warnL "Neither Motif nor Athena widgets seem to be available;"
8185   warn2 "the \`xscreensaver-demo' program requires one or the"
8186   warn2 "other."
8187   proselytize_motif=no
8188
8189 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
8190   warnL "Use of Motif was requested, but it wasn't found;"
8191   warn2 "Athena will be used instead."
8192
8193 elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
8194   warnL "Use of Athena was requested, but it wasn't found;"
8195   warn2 "Motif will be used instead."
8196 fi
8197
8198 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
8199
8200   preferred_lesstif=0.86
8201
8202   if test "$lesstif_version" = unknown; then
8203     warnL "Unable to determine the LessTif version number!"
8204     warn2 "Make sure you are using version $preferred_lesstif or newer."
8205     warn2 "See <http://www.lesstif.org/>."
8206
8207   elif test \! $lesstif_version -gt 82; then
8208     warnL "LessTif version $lesstif_version_string is being used."
8209     warn2 "LessTif versions 0.82 and earlier are too buggy to"
8210     warn2 "use with XScreenSaver; it is strongly recommended"
8211     warn2 "that you upgrade to at least version $preferred_lesstif!"
8212     warn2 "See <http://www.lesstif.org/>."
8213   fi
8214 fi
8215
8216 if test "$proselytize_motif" = yes ; then
8217     warnL "Athena widgets are being used instead of Motif."
8218     warn2 "The \`xscreensaver-demo' program looks much better"
8219     warn2 "with Motif.  Wouldn't you rather be using Motif?"
8220     warn2 "It is shipped by every commercial Unix vendor;"
8221     warn2 "and there is a free implementation available as"
8222     warn2 "well: see <http://www.lesstif.org/>."
8223 fi
8224
8225
8226 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
8227   preferred_mesagl=3.0
8228
8229   if test "$ac_mesagl_version" = unknown; then
8230     warnL "Unable to determine the MesaGL version number!"
8231     warn2 "Make sure you are using version $preferred_mesagl or newer."
8232
8233   elif test \! "$ac_mesagl_version" -gt 2006; then
8234     warnL "MesaGL version $ac_mesagl_version_string is being used."
8235     warn2 "MesaGL versions 2.6 and earlier have a security bug."
8236     warn2 "It is strongly recommended that you upgrade to at"
8237     warn2 "least version $preferred_mesagl."
8238   fi
8239 fi
8240
8241
8242 if test "$have_xpm" = no ; then
8243   if test "$with_xpm_req" = yes ; then
8244     warnL 'Use of XPM was requested, but it was not found.'
8245   elif test "$with_xpm_req" = no ; then
8246     noteL 'The XPM library is not being used.'
8247   else
8248     noteL 'The XPM library was not found.'
8249   fi
8250
8251   echo ''
8252   warn2 'Some of the demos will not be as colorful as they'
8253   warn2 'could be.  You might want to consider installing XPM'
8254   warn2 'and re-running configure.  (Remember to delete the'
8255   warn2 'config.cache file first.)  You can find XPM at most'
8256   warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
8257 fi
8258
8259 if test "$have_gl" = no ; then
8260   if test "$with_gl_req" = yes ; then
8261     warnL 'Use of GL was requested, but it was not found.'
8262   elif test "$with_gl_req" = no ; then
8263     noteL 'The OpenGL 3D library is not being used.'
8264   else
8265     noteL 'The OpenGL 3D library was not found.'
8266   fi
8267
8268   echo ''
8269   warn2 'Those demos which use 3D will not be built or installed.'
8270   warn2 'You might want to consider installing OpenGL and'
8271   warn2 're-running configure.  (Remember to delete the'
8272   warn2 "config.cache file first.)  If your vendor doesn't ship"
8273   warn2 'their own implementation of OpenGL, you can get a free'
8274   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
8275   warn2 'info, see <http://www.opengl.org/>.'
8276
8277 fi
8278
8279 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
8280   warn 'Use of XReadDisplay was requested, but it was not found.'
8281 fi
8282
8283 if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
8284   warn 'Use of the Iris Video Library was requested, but it was not found.'
8285 fi
8286
8287 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
8288   warn 'Use of Kerberos was requested, but it was not found.'
8289 fi
8290
8291 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
8292   warn 'Use of PAM was requested, but it was not found.'
8293 fi
8294
8295 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
8296   warn 'Use of shadow passwords was requested, but they were not found.'
8297 fi
8298
8299 if test -n "$with_zippy_req"; then
8300   if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
8301     warnL "$with_zippy_req was requested as the Zippy program,"
8302     warn2 "but was not found.  The default will be used instead."
8303   fi
8304 fi
8305
8306 if test "$warning" != no; then
8307   echo '' ; echo "$warnsep" ; echo ''
8308 fi
8309
8310
8311 trap '' 1 2 15
8312 cat > confcache <<\EOF
8313 # This file is a shell script that caches the results of configure
8314 # tests run on this system so they can be shared between configure
8315 # scripts and configure runs.  It is not useful on other systems.
8316 # If it contains results you don't want to keep, you may remove or edit it.
8317 #
8318 # By default, configure uses ./config.cache as the cache file,
8319 # creating it if it does not exist already.  You can give configure
8320 # the --cache-file=FILE option to use a different cache file; that is
8321 # what configure does when it calls configure scripts in
8322 # subdirectories, so they share the cache.
8323 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8324 # config.status only pays attention to the cache file if you give it the
8325 # --recheck option to rerun configure.
8326 #
8327 EOF
8328 # The following way of writing the cache mishandles newlines in values,
8329 # but we know of no workaround that is simple, portable, and efficient.
8330 # So, don't put newlines in cache variables' values.
8331 # Ultrix sh set writes to stderr and can't be redirected directly,
8332 # and sets the high bit in the cache file unless we assign to the vars.
8333 (set) 2>&1 |
8334   case `(ac_space=' '; set | grep ac_space) 2>&1` in
8335   *ac_space=\ *)
8336     # `set' does not quote correctly, so add quotes (double-quote substitution
8337     # turns \\\\ into \\, and sed turns \\ into \).
8338     sed -n \
8339       -e "s/'/'\\\\''/g" \
8340       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8341     ;;
8342   *)
8343     # `set' quotes correctly as required by POSIX, so do not add quotes.
8344     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8345     ;;
8346   esac >> confcache
8347 if cmp -s $cache_file confcache; then
8348   :
8349 else
8350   if test -w $cache_file; then
8351     echo "updating cache $cache_file"
8352     cat confcache > $cache_file
8353   else
8354     echo "not updating unwritable cache $cache_file"
8355   fi
8356 fi
8357 rm -f confcache
8358
8359 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8360
8361 test "x$prefix" = xNONE && prefix=$ac_default_prefix
8362 # Let make expand exec_prefix.
8363 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8364
8365 # Any assignment to VPATH causes Sun make to only execute
8366 # the first set of double-colon rules, so remove it if not needed.
8367 # If there is a colon in the path, we need to keep it.
8368 if test "x$srcdir" = x.; then
8369   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
8370 fi
8371
8372 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8373
8374 DEFS=-DHAVE_CONFIG_H
8375
8376 # Without the "./", some shells look in PATH for config.status.
8377 : ${CONFIG_STATUS=./config.status}
8378
8379 echo creating $CONFIG_STATUS
8380 rm -f $CONFIG_STATUS
8381 cat > $CONFIG_STATUS <<EOF
8382 #! /bin/sh
8383 # Generated automatically by configure.
8384 # Run this file to recreate the current configuration.
8385 # This directory was configured as follows,
8386 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8387 #
8388 # $0 $ac_configure_args
8389 #
8390 # Compiler output produced by configure, useful for debugging
8391 # configure, is in ./config.log if it exists.
8392
8393 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8394 for ac_option
8395 do
8396   case "\$ac_option" in
8397   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
8398     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
8399     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
8400   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
8401     echo "$CONFIG_STATUS generated by autoconf version 2.13"
8402     exit 0 ;;
8403   -help | --help | --hel | --he | --h)
8404     echo "\$ac_cs_usage"; exit 0 ;;
8405   *) echo "\$ac_cs_usage"; exit 1 ;;
8406   esac
8407 done
8408
8409 ac_given_srcdir=$srcdir
8410 ac_given_INSTALL="$INSTALL"
8411
8412 trap 'rm -fr `echo "Makefile
8413           utils/Makefile
8414           driver/Makefile
8415           hacks/Makefile
8416           hacks/glx/Makefile
8417           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
8418 EOF
8419 cat >> $CONFIG_STATUS <<EOF
8420
8421 # Protect against being on the right side of a sed subst in config.status.
8422 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
8423  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
8424 $ac_vpsub
8425 $extrasub
8426 s%@SHELL@%$SHELL%g
8427 s%@CFLAGS@%$CFLAGS%g
8428 s%@CPPFLAGS@%$CPPFLAGS%g
8429 s%@CXXFLAGS@%$CXXFLAGS%g
8430 s%@FFLAGS@%$FFLAGS%g
8431 s%@DEFS@%$DEFS%g
8432 s%@LDFLAGS@%$LDFLAGS%g
8433 s%@LIBS@%$LIBS%g
8434 s%@exec_prefix@%$exec_prefix%g
8435 s%@prefix@%$prefix%g
8436 s%@program_transform_name@%$program_transform_name%g
8437 s%@bindir@%$bindir%g
8438 s%@sbindir@%$sbindir%g
8439 s%@libexecdir@%$libexecdir%g
8440 s%@datadir@%$datadir%g
8441 s%@sysconfdir@%$sysconfdir%g
8442 s%@sharedstatedir@%$sharedstatedir%g
8443 s%@localstatedir@%$localstatedir%g
8444 s%@libdir@%$libdir%g
8445 s%@includedir@%$includedir%g
8446 s%@oldincludedir@%$oldincludedir%g
8447 s%@infodir@%$infodir%g
8448 s%@mandir@%$mandir%g
8449 s%@host@%$host%g
8450 s%@host_alias@%$host_alias%g
8451 s%@host_cpu@%$host_cpu%g
8452 s%@host_vendor@%$host_vendor%g
8453 s%@host_os@%$host_os%g
8454 s%@CC@%$CC%g
8455 s%@CPP@%$CPP%g
8456 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
8457 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
8458 s%@INSTALL_DATA@%$INSTALL_DATA%g
8459 s%@SET_MAKE@%$SET_MAKE%g
8460 s%@X_CFLAGS@%$X_CFLAGS%g
8461 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
8462 s%@X_LIBS@%$X_LIBS%g
8463 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
8464 s%@zip2@%$zip2%g
8465 s%@emacs_exe@%$emacs_exe%g
8466 s%@xemacs_exe@%$xemacs_exe%g
8467 s%@fortune@%$fortune%g
8468 s%@INCLUDES@%$INCLUDES%g
8469 s%@SAVER_LIBS@%$SAVER_LIBS%g
8470 s%@TOOLKIT_LIBS@%$TOOLKIT_LIBS%g
8471 s%@HACK_LIBS@%$HACK_LIBS%g
8472 s%@XPM_LIBS@%$XPM_LIBS%g
8473 s%@GL_LIBS@%$GL_LIBS%g
8474 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
8475 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
8476 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
8477 s%@NEED_SETUID@%$NEED_SETUID%g
8478 s%@INSTALL_PAM@%$INSTALL_PAM%g
8479 s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
8480 s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
8481 s%@TOOLKIT_SRCS@%$TOOLKIT_SRCS%g
8482 s%@TOOLKIT_OBJS@%$TOOLKIT_OBJS%g
8483 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
8484 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
8485 s%@XMU_SRCS@%$XMU_SRCS%g
8486 s%@XMU_OBJS@%$XMU_OBJS%g
8487 s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
8488 s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
8489 s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
8490 s%@LOCK_SRCS@%$LOCK_SRCS%g
8491 s%@LOCK_OBJS@%$LOCK_OBJS%g
8492 s%@GL_EXES@%$GL_EXES%g
8493 s%@GL_MEN@%$GL_MEN%g
8494 s%@GL_KLUDGE@%$GL_KLUDGE%g
8495 s%@HACKDIR@%$HACKDIR%g
8496 s%@APPDEFAULTS@%$APPDEFAULTS%g
8497 s%@DEPEND@%$DEPEND%g
8498 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
8499 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
8500
8501 CEOF
8502 EOF
8503
8504 cat >> $CONFIG_STATUS <<\EOF
8505
8506 # Split the substitutions into bite-sized pieces for seds with
8507 # small command number limits, like on Digital OSF/1 and HP-UX.
8508 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
8509 ac_file=1 # Number of current file.
8510 ac_beg=1 # First line for current file.
8511 ac_end=$ac_max_sed_cmds # Line after last line for current file.
8512 ac_more_lines=:
8513 ac_sed_cmds=""
8514 while $ac_more_lines; do
8515   if test $ac_beg -gt 1; then
8516     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
8517   else
8518     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
8519   fi
8520   if test ! -s conftest.s$ac_file; then
8521     ac_more_lines=false
8522     rm -f conftest.s$ac_file
8523   else
8524     if test -z "$ac_sed_cmds"; then
8525       ac_sed_cmds="sed -f conftest.s$ac_file"
8526     else
8527       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
8528     fi
8529     ac_file=`expr $ac_file + 1`
8530     ac_beg=$ac_end
8531     ac_end=`expr $ac_end + $ac_max_sed_cmds`
8532   fi
8533 done
8534 if test -z "$ac_sed_cmds"; then
8535   ac_sed_cmds=cat
8536 fi
8537 EOF
8538
8539 cat >> $CONFIG_STATUS <<EOF
8540
8541 CONFIG_FILES=\${CONFIG_FILES-"Makefile
8542           utils/Makefile
8543           driver/Makefile
8544           hacks/Makefile
8545           hacks/glx/Makefile
8546           driver/XScreenSaver.ad"}
8547 EOF
8548 cat >> $CONFIG_STATUS <<\EOF
8549 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
8550   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8551   case "$ac_file" in
8552   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8553        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8554   *) ac_file_in="${ac_file}.in" ;;
8555   esac
8556
8557   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
8558
8559   # Remove last slash and all that follows it.  Not all systems have dirname.
8560   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8561   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8562     # The file is in a subdirectory.
8563     test ! -d "$ac_dir" && mkdir "$ac_dir"
8564     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
8565     # A "../" for each directory in $ac_dir_suffix.
8566     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
8567   else
8568     ac_dir_suffix= ac_dots=
8569   fi
8570
8571   case "$ac_given_srcdir" in
8572   .)  srcdir=.
8573       if test -z "$ac_dots"; then top_srcdir=.
8574       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
8575   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
8576   *) # Relative path.
8577     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
8578     top_srcdir="$ac_dots$ac_given_srcdir" ;;
8579   esac
8580
8581   case "$ac_given_INSTALL" in
8582   [/$]*) INSTALL="$ac_given_INSTALL" ;;
8583   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
8584   esac
8585
8586   echo creating "$ac_file"
8587   rm -f "$ac_file"
8588   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
8589   case "$ac_file" in
8590   *Makefile*) ac_comsub="1i\\
8591 # $configure_input" ;;
8592   *) ac_comsub= ;;
8593   esac
8594
8595   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8596   sed -e "$ac_comsub
8597 s%@configure_input@%$configure_input%g
8598 s%@srcdir@%$srcdir%g
8599 s%@top_srcdir@%$top_srcdir%g
8600 s%@INSTALL@%$INSTALL%g
8601 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
8602 fi; done
8603 rm -f conftest.s*
8604
8605 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
8606 # NAME is the cpp macro being defined and VALUE is the value it is being given.
8607 #
8608 # ac_d sets the value in "#define NAME VALUE" lines.
8609 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
8610 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
8611 ac_dC='\3'
8612 ac_dD='%g'
8613 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
8614 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8615 ac_uB='\([      ]\)%\1#\2define\3'
8616 ac_uC=' '
8617 ac_uD='\4%g'
8618 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
8619 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
8620 ac_eB='$%\1#\2define\3'
8621 ac_eC=' '
8622 ac_eD='%g'
8623
8624 if test "${CONFIG_HEADERS+set}" != set; then
8625 EOF
8626 cat >> $CONFIG_STATUS <<EOF
8627   CONFIG_HEADERS="config.h"
8628 EOF
8629 cat >> $CONFIG_STATUS <<\EOF
8630 fi
8631 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
8632   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
8633   case "$ac_file" in
8634   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
8635        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
8636   *) ac_file_in="${ac_file}.in" ;;
8637   esac
8638
8639   echo creating $ac_file
8640
8641   rm -f conftest.frag conftest.in conftest.out
8642   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
8643   cat $ac_file_inputs > conftest.in
8644
8645 EOF
8646
8647 # Transform confdefs.h into a sed script conftest.vals that substitutes
8648 # the proper values into config.h.in to produce config.h.  And first:
8649 # Protect against being on the right side of a sed subst in config.status.
8650 # Protect against being in an unquoted here document in config.status.
8651 rm -f conftest.vals
8652 cat > conftest.hdr <<\EOF
8653 s/[\\&%]/\\&/g
8654 s%[\\$`]%\\&%g
8655 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
8656 s%ac_d%ac_u%gp
8657 s%ac_u%ac_e%gp
8658 EOF
8659 sed -n -f conftest.hdr confdefs.h > conftest.vals
8660 rm -f conftest.hdr
8661
8662 # This sed command replaces #undef with comments.  This is necessary, for
8663 # example, in the case of _POSIX_SOURCE, which is predefined and required
8664 # on some systems where configure will not decide to define it.
8665 cat >> conftest.vals <<\EOF
8666 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
8667 EOF
8668
8669 # Break up conftest.vals because some shells have a limit on
8670 # the size of here documents, and old seds have small limits too.
8671
8672 rm -f conftest.tail
8673 while :
8674 do
8675   ac_lines=`grep -c . conftest.vals`
8676   # grep -c gives empty output for an empty file on some AIX systems.
8677   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
8678   # Write a limited-size here document to conftest.frag.
8679   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
8680   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
8681   echo 'CEOF
8682   sed -f conftest.frag conftest.in > conftest.out
8683   rm -f conftest.in
8684   mv conftest.out conftest.in
8685 ' >> $CONFIG_STATUS
8686   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
8687   rm -f conftest.vals
8688   mv conftest.tail conftest.vals
8689 done
8690 rm -f conftest.vals
8691
8692 cat >> $CONFIG_STATUS <<\EOF
8693   rm -f conftest.frag conftest.h
8694   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
8695   cat conftest.in >> conftest.h
8696   rm -f conftest.in
8697   if cmp -s $ac_file conftest.h 2>/dev/null; then
8698     echo "$ac_file is unchanged"
8699     rm -f conftest.h
8700   else
8701     # Remove last slash and all that follows it.  Not all systems have dirname.
8702       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
8703       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
8704       # The file is in a subdirectory.
8705       test ! -d "$ac_dir" && mkdir "$ac_dir"
8706     fi
8707     rm -f $ac_file
8708     mv conftest.h $ac_file
8709   fi
8710 fi; done
8711
8712 EOF
8713 cat >> $CONFIG_STATUS <<EOF
8714
8715 EOF
8716 cat >> $CONFIG_STATUS <<\EOF
8717
8718 exit 0
8719 EOF
8720 chmod +x $CONFIG_STATUS
8721 rm -fr confdefs* $ac_clean_files
8722 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
8723
8724
8725 # You are in a twisty maze of namespaces and syntaxes, all alike.
8726 # Fuck the skull of Unix.
8727 #
8728 eval bindir=${bindir}
8729 eval bindir=${bindir}
8730 eval bindir=${bindir}
8731 eval bindir=${bindir}
8732 eval bindir=${bindir}
8733 eval bindir=${bindir}
8734 eval HACKDIR=${HACKDIR}
8735 eval HACKDIR=${HACKDIR}
8736 eval HACKDIR=${HACKDIR}
8737 eval HACKDIR=${HACKDIR}
8738 eval HACKDIR=${HACKDIR}
8739 eval HACKDIR=${HACKDIR}
8740
8741 # canonicalize slashes.
8742 bindir=`echo  "${bindir}"  | sed 's@/$@@;s@//*@/@g'`
8743 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
8744
8745
8746 # Sanity check the subdir
8747 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
8748   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
8749     echo ""
8750     { echo "configure: error: \"--enable-subdir=${bindir}/${bad_choice}\" won't work.
8751                    There will be an executable installed with that name, so
8752                    that can't be the name of a directory as well.  Please
8753                    re-configure with a different directory name." 1>&2; exit 1; }
8754   fi
8755 done
8756
8757
8758 do_dir_warning=no
8759
8760 # Now let's see if there's a previous RPM version already installed.  Blargh!
8761
8762 # M4 sucks!!
8763
8764 rpmv=`(rpm -qv xscreensaver) 2>&- | \
8765       sed 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-[0-9][0-9]*$/\1/'`
8766
8767
8768 if test \! -z "$rpmv" ; then
8769   rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
8770   rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
8771
8772   warning=no
8773   warnL "There is already an installed RPM of xscreensaver $rpmv"
8774   warn2 "on this system.  You might want to remove it (with"
8775   warn2 '"rpm -ve xscreensaver") before running "make install"'
8776   warn2 "from this directory."
8777   echo ""
8778   warn2 "Alternately, you could build this version of xscreensaver"
8779   warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
8780   warn2 "file is included.  See the RPM documentation for more info."
8781   echo ""
8782
8783   if test "$rpmbdir" = "$rpmhdir" ; then
8784     warn2 "The RPM version was installed in $rpmbdir."
8785   else
8786     warn2 "The RPM version was installed in $rpmbdir,"
8787     warn2 "with demos in $rpmhdir."
8788   fi
8789
8790   do_dir_warning=yes
8791 fi
8792
8793
8794 if test "${bindir}" = "${HACKDIR}" ; then
8795   do_dir_warning=yes
8796 fi
8797
8798 if test "$do_dir_warning" = yes; then
8799   echo ""
8800   echo "$warnsep"
8801   echo ""
8802   echo '      When you run "make install", the "xscreensaver",'
8803   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
8804   echo "      will be installed in ${bindir}."
8805   echo ""
8806   echo "      The various graphics demos (90+ different executables) will"
8807   echo "      also be installed in ${HACKDIR}."
8808   echo ""
8809   echo "      If you would prefer the demos to be installed elsewhere"
8810   echo "      (for example, in a dedicated directory) you should re-run"
8811   echo "      configure with the --enable-subdir=DIR option.  For more"
8812   echo "      information, run $0 --help."
8813   echo ""
8814   echo "$warnsep"
8815   echo ""
8816 fi