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