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