http://ftp.x.org/contrib/applications/xscreensaver-3.03.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
1916 # If we find X, set shell vars x_includes and x_libraries to the
1917 # paths, otherwise set no_x=yes.
1918 # Uses ac_ vars as temps to allow command line to override cache and checks.
1919 # --without-x overrides everything else, but does not touch the cache.
1920 echo $ac_n "checking for X""... $ac_c" 1>&6
1921 echo "configure:1933: checking for X" >&5
1922
1923 # Check whether --with-x or --without-x was given.
1924 if test "${with_x+set}" = set; then
1925   withval="$with_x"
1926   :
1927 fi
1928
1929 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
1930 if test "x$with_x" = xno; then
1931   # The user explicitly disabled X.
1932   have_x=disabled
1933 else
1934   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
1935     # Both variables are already set.
1936     have_x=yes
1937   else
1938 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
1939   echo $ac_n "(cached) $ac_c" 1>&6
1940 else
1941   # One or both of the vars are not set, and there is no cached value.
1942 ac_x_includes=NO ac_x_libraries=NO
1943 rm -fr conftestdir
1944 if mkdir conftestdir; then
1945   cd conftestdir
1946   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1947   cat > Imakefile <<'EOF'
1948 acfindx:
1949         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1950 EOF
1951   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
1952     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1953     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
1954     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
1955     for ac_extension in a so sl; do
1956       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1957         test -f $ac_im_libdir/libX11.$ac_extension; then
1958         ac_im_usrlibdir=$ac_im_libdir; break
1959       fi
1960     done
1961     # Screen out bogus values from the imake configuration.  They are
1962     # bogus both because they are the default anyway, and because
1963     # using them would break gcc on systems where it needs fixed includes.
1964     case "$ac_im_incroot" in
1965         /usr/include) ;;
1966         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1967     esac
1968     case "$ac_im_usrlibdir" in
1969         /usr/lib | /lib) ;;
1970         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1971     esac
1972   fi
1973   cd ..
1974   rm -fr conftestdir
1975 fi
1976
1977 if test "$ac_x_includes" = NO; then
1978   # Guess where to find include files, by looking for this one X11 .h file.
1979   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1980
1981   # First, try using that file with no special directory specified.
1982 cat > conftest.$ac_ext <<EOF
1983 #line 1995 "configure"
1984 #include "confdefs.h"
1985 #include <$x_direct_test_include>
1986 EOF
1987 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1988 { (eval echo configure:2000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1989 ac_err=`grep -v '^ *+' conftest.out`
1990 if test -z "$ac_err"; then
1991   rm -rf conftest*
1992   # We can compile using X headers with no special include directory.
1993 ac_x_includes=
1994 else
1995   echo "$ac_err" >&5
1996   echo "configure: failed program was:" >&5
1997   cat conftest.$ac_ext >&5
1998   rm -rf conftest*
1999   # Look for the header file in a standard set of common directories.
2000 # Check X11 before X11Rn because it is often a symlink to the current release.
2001   for ac_dir in               \
2002     /usr/X11/include          \
2003     /usr/X11R6/include        \
2004     /usr/X11R5/include        \
2005     /usr/X11R4/include        \
2006                               \
2007     /usr/include/X11          \
2008     /usr/include/X11R6        \
2009     /usr/include/X11R5        \
2010     /usr/include/X11R4        \
2011                               \
2012     /usr/local/X11/include    \
2013     /usr/local/X11R6/include  \
2014     /usr/local/X11R5/include  \
2015     /usr/local/X11R4/include  \
2016                               \
2017     /usr/local/include/X11    \
2018     /usr/local/include/X11R6  \
2019     /usr/local/include/X11R5  \
2020     /usr/local/include/X11R4  \
2021                               \
2022     /usr/X386/include         \
2023     /usr/x386/include         \
2024     /usr/XFree86/include/X11  \
2025                               \
2026     /usr/include              \
2027     /usr/local/include        \
2028     /usr/unsupported/include  \
2029     /usr/athena/include       \
2030     /usr/local/x11r5/include  \
2031     /usr/lpp/Xamples/include  \
2032                               \
2033     /usr/openwin/include      \
2034     /usr/openwin/share/include \
2035     ; \
2036   do
2037     if test -r "$ac_dir/$x_direct_test_include"; then
2038       ac_x_includes=$ac_dir
2039       break
2040     fi
2041   done
2042 fi
2043 rm -f conftest*
2044 fi # $ac_x_includes = NO
2045
2046 if test "$ac_x_libraries" = NO; then
2047   # Check for the libraries.
2048
2049   test -z "$x_direct_test_library" && x_direct_test_library=Xt
2050   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2051
2052   # See if we find them without any special options.
2053   # Don't add to $LIBS permanently.
2054   ac_save_LIBS="$LIBS"
2055   LIBS="-l$x_direct_test_library $LIBS"
2056 cat > conftest.$ac_ext <<EOF
2057 #line 2069 "configure"
2058 #include "confdefs.h"
2059
2060 int main() {
2061 ${x_direct_test_function}()
2062 ; return 0; }
2063 EOF
2064 if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2065   rm -rf conftest*
2066   LIBS="$ac_save_LIBS"
2067 # We can link X programs with no special library path.
2068 ac_x_libraries=
2069 else
2070   echo "configure: failed program was:" >&5
2071   cat conftest.$ac_ext >&5
2072   rm -rf conftest*
2073   LIBS="$ac_save_LIBS"
2074 # First see if replacing the include by lib works.
2075 # Check X11 before X11Rn because it is often a symlink to the current release.
2076 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2077     /usr/X11/lib          \
2078     /usr/X11R6/lib        \
2079     /usr/X11R5/lib        \
2080     /usr/X11R4/lib        \
2081                           \
2082     /usr/lib/X11          \
2083     /usr/lib/X11R6        \
2084     /usr/lib/X11R5        \
2085     /usr/lib/X11R4        \
2086                           \
2087     /usr/local/X11/lib    \
2088     /usr/local/X11R6/lib  \
2089     /usr/local/X11R5/lib  \
2090     /usr/local/X11R4/lib  \
2091                           \
2092     /usr/local/lib/X11    \
2093     /usr/local/lib/X11R6  \
2094     /usr/local/lib/X11R5  \
2095     /usr/local/lib/X11R4  \
2096                           \
2097     /usr/X386/lib         \
2098     /usr/x386/lib         \
2099     /usr/XFree86/lib/X11  \
2100                           \
2101     /usr/lib              \
2102     /usr/local/lib        \
2103     /usr/unsupported/lib  \
2104     /usr/athena/lib       \
2105     /usr/local/x11r5/lib  \
2106     /usr/lpp/Xamples/lib  \
2107     /lib/usr/lib/X11      \
2108                           \
2109     /usr/openwin/lib      \
2110     /usr/openwin/share/lib \
2111     ; \
2112 do
2113   for ac_extension in a so sl; do
2114     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2115       ac_x_libraries=$ac_dir
2116       break 2
2117     fi
2118   done
2119 done
2120 fi
2121 rm -f conftest*
2122 fi # $ac_x_libraries = NO
2123
2124 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2125   # Didn't find X anywhere.  Cache the known absence of X.
2126   ac_cv_have_x="have_x=no"
2127 else
2128   # Record where we found X for the cache.
2129   ac_cv_have_x="have_x=yes \
2130                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2131 fi
2132 fi
2133   fi
2134   eval "$ac_cv_have_x"
2135 fi # $with_x != no
2136
2137 if test "$have_x" != yes; then
2138   echo "$ac_t""$have_x" 1>&6
2139   no_x=yes
2140 else
2141   # If each of the values was on the command line, it overrides each guess.
2142   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2143   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2144   # Update the cache value to reflect the command line values.
2145   ac_cv_have_x="have_x=yes \
2146                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2147   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2148 fi
2149
2150 if test "$no_x" = yes; then
2151   # Not all programs may use this symbol, but it does not hurt to define it.
2152   cat >> confdefs.h <<\EOF
2153 #define X_DISPLAY_MISSING 1
2154 EOF
2155
2156   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2157 else
2158   if test -n "$x_includes"; then
2159     X_CFLAGS="$X_CFLAGS -I$x_includes"
2160   fi
2161
2162   # It would also be nice to do this for all -L options, not just this one.
2163   if test -n "$x_libraries"; then
2164     X_LIBS="$X_LIBS -L$x_libraries"
2165     # For Solaris; some versions of Sun CC require a space after -R and
2166     # others require no space.  Words are not sufficient . . . .
2167     case "`(uname -sr) 2>/dev/null`" in
2168     "SunOS 5"*)
2169       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2170 echo "configure:2182: checking whether -R must be followed by a space" >&5
2171       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2172       cat > conftest.$ac_ext <<EOF
2173 #line 2185 "configure"
2174 #include "confdefs.h"
2175
2176 int main() {
2177
2178 ; return 0; }
2179 EOF
2180 if { (eval echo configure:2192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2181   rm -rf conftest*
2182   ac_R_nospace=yes
2183 else
2184   echo "configure: failed program was:" >&5
2185   cat conftest.$ac_ext >&5
2186   rm -rf conftest*
2187   ac_R_nospace=no
2188 fi
2189 rm -f conftest*
2190       if test $ac_R_nospace = yes; then
2191         echo "$ac_t""no" 1>&6
2192         X_LIBS="$X_LIBS -R$x_libraries"
2193       else
2194         LIBS="$ac_xsave_LIBS -R $x_libraries"
2195         cat > conftest.$ac_ext <<EOF
2196 #line 2208 "configure"
2197 #include "confdefs.h"
2198
2199 int main() {
2200
2201 ; return 0; }
2202 EOF
2203 if { (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2204   rm -rf conftest*
2205   ac_R_space=yes
2206 else
2207   echo "configure: failed program was:" >&5
2208   cat conftest.$ac_ext >&5
2209   rm -rf conftest*
2210   ac_R_space=no
2211 fi
2212 rm -f conftest*
2213         if test $ac_R_space = yes; then
2214           echo "$ac_t""yes" 1>&6
2215           X_LIBS="$X_LIBS -R $x_libraries"
2216         else
2217           echo "$ac_t""neither works" 1>&6
2218         fi
2219       fi
2220       LIBS="$ac_xsave_LIBS"
2221     esac
2222   fi
2223
2224   # Check for system-dependent libraries X programs must link with.
2225   # Do this before checking for the system-independent R6 libraries
2226   # (-lICE), since we may need -lsocket or whatever for X linking.
2227
2228   if test "$ISC" = yes; then
2229     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2230   else
2231     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2232     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2233     # the Alpha needs dnet_stub (dnet does not exist).
2234     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2235 echo "configure:2247: checking for dnet_ntoa in -ldnet" >&5
2236 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2237 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2238   echo $ac_n "(cached) $ac_c" 1>&6
2239 else
2240   ac_save_LIBS="$LIBS"
2241 LIBS="-ldnet  $LIBS"
2242 cat > conftest.$ac_ext <<EOF
2243 #line 2255 "configure"
2244 #include "confdefs.h"
2245 /* Override any gcc2 internal prototype to avoid an error.  */
2246 /* We use char because int might match the return type of a gcc2
2247     builtin and then its argument prototype would still apply.  */
2248 char dnet_ntoa();
2249
2250 int main() {
2251 dnet_ntoa()
2252 ; return 0; }
2253 EOF
2254 if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2255   rm -rf conftest*
2256   eval "ac_cv_lib_$ac_lib_var=yes"
2257 else
2258   echo "configure: failed program was:" >&5
2259   cat conftest.$ac_ext >&5
2260   rm -rf conftest*
2261   eval "ac_cv_lib_$ac_lib_var=no"
2262 fi
2263 rm -f conftest*
2264 LIBS="$ac_save_LIBS"
2265
2266 fi
2267 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2268   echo "$ac_t""yes" 1>&6
2269   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2270 else
2271   echo "$ac_t""no" 1>&6
2272 fi
2273
2274     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2275       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2276 echo "configure:2288: checking for dnet_ntoa in -ldnet_stub" >&5
2277 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2278 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2279   echo $ac_n "(cached) $ac_c" 1>&6
2280 else
2281   ac_save_LIBS="$LIBS"
2282 LIBS="-ldnet_stub  $LIBS"
2283 cat > conftest.$ac_ext <<EOF
2284 #line 2296 "configure"
2285 #include "confdefs.h"
2286 /* Override any gcc2 internal prototype to avoid an error.  */
2287 /* We use char because int might match the return type of a gcc2
2288     builtin and then its argument prototype would still apply.  */
2289 char dnet_ntoa();
2290
2291 int main() {
2292 dnet_ntoa()
2293 ; return 0; }
2294 EOF
2295 if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2296   rm -rf conftest*
2297   eval "ac_cv_lib_$ac_lib_var=yes"
2298 else
2299   echo "configure: failed program was:" >&5
2300   cat conftest.$ac_ext >&5
2301   rm -rf conftest*
2302   eval "ac_cv_lib_$ac_lib_var=no"
2303 fi
2304 rm -f conftest*
2305 LIBS="$ac_save_LIBS"
2306
2307 fi
2308 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2309   echo "$ac_t""yes" 1>&6
2310   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2311 else
2312   echo "$ac_t""no" 1>&6
2313 fi
2314
2315     fi
2316
2317     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2318     # to get the SysV transport functions.
2319     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2320     # needs -lnsl.
2321     # The nsl library prevents programs from opening the X display
2322     # on Irix 5.2, according to dickey@clark.net.
2323     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2324 echo "configure:2336: checking for gethostbyname" >&5
2325 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2326   echo $ac_n "(cached) $ac_c" 1>&6
2327 else
2328   cat > conftest.$ac_ext <<EOF
2329 #line 2341 "configure"
2330 #include "confdefs.h"
2331 /* System header to define __stub macros and hopefully few prototypes,
2332     which can conflict with char gethostbyname(); below.  */
2333 #include <assert.h>
2334 /* Override any gcc2 internal prototype to avoid an error.  */
2335 /* We use char because int might match the return type of a gcc2
2336     builtin and then its argument prototype would still apply.  */
2337 char gethostbyname();
2338
2339 int main() {
2340
2341 /* The GNU C library defines this for functions which it implements
2342     to always fail with ENOSYS.  Some functions are actually named
2343     something starting with __ and the normal name is an alias.  */
2344 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2345 choke me
2346 #else
2347 gethostbyname();
2348 #endif
2349
2350 ; return 0; }
2351 EOF
2352 if { (eval echo configure:2364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2353   rm -rf conftest*
2354   eval "ac_cv_func_gethostbyname=yes"
2355 else
2356   echo "configure: failed program was:" >&5
2357   cat conftest.$ac_ext >&5
2358   rm -rf conftest*
2359   eval "ac_cv_func_gethostbyname=no"
2360 fi
2361 rm -f conftest*
2362 fi
2363
2364 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2365   echo "$ac_t""yes" 1>&6
2366   :
2367 else
2368   echo "$ac_t""no" 1>&6
2369 fi
2370
2371     if test $ac_cv_func_gethostbyname = no; then
2372       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2373 echo "configure:2385: checking for gethostbyname in -lnsl" >&5
2374 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2375 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2376   echo $ac_n "(cached) $ac_c" 1>&6
2377 else
2378   ac_save_LIBS="$LIBS"
2379 LIBS="-lnsl  $LIBS"
2380 cat > conftest.$ac_ext <<EOF
2381 #line 2393 "configure"
2382 #include "confdefs.h"
2383 /* Override any gcc2 internal prototype to avoid an error.  */
2384 /* We use char because int might match the return type of a gcc2
2385     builtin and then its argument prototype would still apply.  */
2386 char gethostbyname();
2387
2388 int main() {
2389 gethostbyname()
2390 ; return 0; }
2391 EOF
2392 if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2393   rm -rf conftest*
2394   eval "ac_cv_lib_$ac_lib_var=yes"
2395 else
2396   echo "configure: failed program was:" >&5
2397   cat conftest.$ac_ext >&5
2398   rm -rf conftest*
2399   eval "ac_cv_lib_$ac_lib_var=no"
2400 fi
2401 rm -f conftest*
2402 LIBS="$ac_save_LIBS"
2403
2404 fi
2405 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2406   echo "$ac_t""yes" 1>&6
2407   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2408 else
2409   echo "$ac_t""no" 1>&6
2410 fi
2411
2412     fi
2413
2414     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2415     # socket/setsockopt and other routines are undefined under SCO ODT
2416     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2417     # on later versions), says simon@lia.di.epfl.ch: it contains
2418     # gethostby* variants that don't use the nameserver (or something).
2419     # -lsocket must be given before -lnsl if both are needed.
2420     # We assume that if connect needs -lnsl, so does gethostbyname.
2421     echo $ac_n "checking for connect""... $ac_c" 1>&6
2422 echo "configure:2434: checking for connect" >&5
2423 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2424   echo $ac_n "(cached) $ac_c" 1>&6
2425 else
2426   cat > conftest.$ac_ext <<EOF
2427 #line 2439 "configure"
2428 #include "confdefs.h"
2429 /* System header to define __stub macros and hopefully few prototypes,
2430     which can conflict with char connect(); below.  */
2431 #include <assert.h>
2432 /* Override any gcc2 internal prototype to avoid an error.  */
2433 /* We use char because int might match the return type of a gcc2
2434     builtin and then its argument prototype would still apply.  */
2435 char connect();
2436
2437 int main() {
2438
2439 /* The GNU C library defines this for functions which it implements
2440     to always fail with ENOSYS.  Some functions are actually named
2441     something starting with __ and the normal name is an alias.  */
2442 #if defined (__stub_connect) || defined (__stub___connect)
2443 choke me
2444 #else
2445 connect();
2446 #endif
2447
2448 ; return 0; }
2449 EOF
2450 if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2451   rm -rf conftest*
2452   eval "ac_cv_func_connect=yes"
2453 else
2454   echo "configure: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   rm -rf conftest*
2457   eval "ac_cv_func_connect=no"
2458 fi
2459 rm -f conftest*
2460 fi
2461
2462 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2463   echo "$ac_t""yes" 1>&6
2464   :
2465 else
2466   echo "$ac_t""no" 1>&6
2467 fi
2468
2469     if test $ac_cv_func_connect = no; then
2470       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2471 echo "configure:2483: checking for connect in -lsocket" >&5
2472 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2473 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2474   echo $ac_n "(cached) $ac_c" 1>&6
2475 else
2476   ac_save_LIBS="$LIBS"
2477 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2478 cat > conftest.$ac_ext <<EOF
2479 #line 2491 "configure"
2480 #include "confdefs.h"
2481 /* Override any gcc2 internal prototype to avoid an error.  */
2482 /* We use char because int might match the return type of a gcc2
2483     builtin and then its argument prototype would still apply.  */
2484 char connect();
2485
2486 int main() {
2487 connect()
2488 ; return 0; }
2489 EOF
2490 if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2491   rm -rf conftest*
2492   eval "ac_cv_lib_$ac_lib_var=yes"
2493 else
2494   echo "configure: failed program was:" >&5
2495   cat conftest.$ac_ext >&5
2496   rm -rf conftest*
2497   eval "ac_cv_lib_$ac_lib_var=no"
2498 fi
2499 rm -f conftest*
2500 LIBS="$ac_save_LIBS"
2501
2502 fi
2503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2504   echo "$ac_t""yes" 1>&6
2505   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
2506 else
2507   echo "$ac_t""no" 1>&6
2508 fi
2509
2510     fi
2511
2512     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
2513     echo $ac_n "checking for remove""... $ac_c" 1>&6
2514 echo "configure:2526: checking for remove" >&5
2515 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
2516   echo $ac_n "(cached) $ac_c" 1>&6
2517 else
2518   cat > conftest.$ac_ext <<EOF
2519 #line 2531 "configure"
2520 #include "confdefs.h"
2521 /* System header to define __stub macros and hopefully few prototypes,
2522     which can conflict with char remove(); below.  */
2523 #include <assert.h>
2524 /* Override any gcc2 internal prototype to avoid an error.  */
2525 /* We use char because int might match the return type of a gcc2
2526     builtin and then its argument prototype would still apply.  */
2527 char remove();
2528
2529 int main() {
2530
2531 /* The GNU C library defines this for functions which it implements
2532     to always fail with ENOSYS.  Some functions are actually named
2533     something starting with __ and the normal name is an alias.  */
2534 #if defined (__stub_remove) || defined (__stub___remove)
2535 choke me
2536 #else
2537 remove();
2538 #endif
2539
2540 ; return 0; }
2541 EOF
2542 if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2543   rm -rf conftest*
2544   eval "ac_cv_func_remove=yes"
2545 else
2546   echo "configure: failed program was:" >&5
2547   cat conftest.$ac_ext >&5
2548   rm -rf conftest*
2549   eval "ac_cv_func_remove=no"
2550 fi
2551 rm -f conftest*
2552 fi
2553
2554 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
2555   echo "$ac_t""yes" 1>&6
2556   :
2557 else
2558   echo "$ac_t""no" 1>&6
2559 fi
2560
2561     if test $ac_cv_func_remove = no; then
2562       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
2563 echo "configure:2575: checking for remove in -lposix" >&5
2564 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
2565 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2566   echo $ac_n "(cached) $ac_c" 1>&6
2567 else
2568   ac_save_LIBS="$LIBS"
2569 LIBS="-lposix  $LIBS"
2570 cat > conftest.$ac_ext <<EOF
2571 #line 2583 "configure"
2572 #include "confdefs.h"
2573 /* Override any gcc2 internal prototype to avoid an error.  */
2574 /* We use char because int might match the return type of a gcc2
2575     builtin and then its argument prototype would still apply.  */
2576 char remove();
2577
2578 int main() {
2579 remove()
2580 ; return 0; }
2581 EOF
2582 if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2583   rm -rf conftest*
2584   eval "ac_cv_lib_$ac_lib_var=yes"
2585 else
2586   echo "configure: failed program was:" >&5
2587   cat conftest.$ac_ext >&5
2588   rm -rf conftest*
2589   eval "ac_cv_lib_$ac_lib_var=no"
2590 fi
2591 rm -f conftest*
2592 LIBS="$ac_save_LIBS"
2593
2594 fi
2595 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2596   echo "$ac_t""yes" 1>&6
2597   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
2598 else
2599   echo "$ac_t""no" 1>&6
2600 fi
2601
2602     fi
2603
2604     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2605     echo $ac_n "checking for shmat""... $ac_c" 1>&6
2606 echo "configure:2618: checking for shmat" >&5
2607 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
2608   echo $ac_n "(cached) $ac_c" 1>&6
2609 else
2610   cat > conftest.$ac_ext <<EOF
2611 #line 2623 "configure"
2612 #include "confdefs.h"
2613 /* System header to define __stub macros and hopefully few prototypes,
2614     which can conflict with char shmat(); below.  */
2615 #include <assert.h>
2616 /* Override any gcc2 internal prototype to avoid an error.  */
2617 /* We use char because int might match the return type of a gcc2
2618     builtin and then its argument prototype would still apply.  */
2619 char shmat();
2620
2621 int main() {
2622
2623 /* The GNU C library defines this for functions which it implements
2624     to always fail with ENOSYS.  Some functions are actually named
2625     something starting with __ and the normal name is an alias.  */
2626 #if defined (__stub_shmat) || defined (__stub___shmat)
2627 choke me
2628 #else
2629 shmat();
2630 #endif
2631
2632 ; return 0; }
2633 EOF
2634 if { (eval echo configure:2646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2635   rm -rf conftest*
2636   eval "ac_cv_func_shmat=yes"
2637 else
2638   echo "configure: failed program was:" >&5
2639   cat conftest.$ac_ext >&5
2640   rm -rf conftest*
2641   eval "ac_cv_func_shmat=no"
2642 fi
2643 rm -f conftest*
2644 fi
2645
2646 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
2647   echo "$ac_t""yes" 1>&6
2648   :
2649 else
2650   echo "$ac_t""no" 1>&6
2651 fi
2652
2653     if test $ac_cv_func_shmat = no; then
2654       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
2655 echo "configure:2667: checking for shmat in -lipc" >&5
2656 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
2657 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2658   echo $ac_n "(cached) $ac_c" 1>&6
2659 else
2660   ac_save_LIBS="$LIBS"
2661 LIBS="-lipc  $LIBS"
2662 cat > conftest.$ac_ext <<EOF
2663 #line 2675 "configure"
2664 #include "confdefs.h"
2665 /* Override any gcc2 internal prototype to avoid an error.  */
2666 /* We use char because int might match the return type of a gcc2
2667     builtin and then its argument prototype would still apply.  */
2668 char shmat();
2669
2670 int main() {
2671 shmat()
2672 ; return 0; }
2673 EOF
2674 if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2675   rm -rf conftest*
2676   eval "ac_cv_lib_$ac_lib_var=yes"
2677 else
2678   echo "configure: failed program was:" >&5
2679   cat conftest.$ac_ext >&5
2680   rm -rf conftest*
2681   eval "ac_cv_lib_$ac_lib_var=no"
2682 fi
2683 rm -f conftest*
2684 LIBS="$ac_save_LIBS"
2685
2686 fi
2687 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2688   echo "$ac_t""yes" 1>&6
2689   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
2690 else
2691   echo "$ac_t""no" 1>&6
2692 fi
2693
2694     fi
2695   fi
2696
2697   # Check for libraries that X11R6 Xt/Xaw programs need.
2698   ac_save_LDFLAGS="$LDFLAGS"
2699   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
2700   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
2701   # check for ICE first), but we must link in the order -lSM -lICE or
2702   # we get undefined symbols.  So assume we have SM if we have ICE.
2703   # These have to be linked with before -lX11, unlike the other
2704   # libraries we check for below, so use a different variable.
2705   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
2706   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
2707 echo "configure:2719: checking for IceConnectionNumber in -lICE" >&5
2708 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
2709 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2710   echo $ac_n "(cached) $ac_c" 1>&6
2711 else
2712   ac_save_LIBS="$LIBS"
2713 LIBS="-lICE  $LIBS"
2714 cat > conftest.$ac_ext <<EOF
2715 #line 2727 "configure"
2716 #include "confdefs.h"
2717 /* Override any gcc2 internal prototype to avoid an error.  */
2718 /* We use char because int might match the return type of a gcc2
2719     builtin and then its argument prototype would still apply.  */
2720 char IceConnectionNumber();
2721
2722 int main() {
2723 IceConnectionNumber()
2724 ; return 0; }
2725 EOF
2726 if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2727   rm -rf conftest*
2728   eval "ac_cv_lib_$ac_lib_var=yes"
2729 else
2730   echo "configure: failed program was:" >&5
2731   cat conftest.$ac_ext >&5
2732   rm -rf conftest*
2733   eval "ac_cv_lib_$ac_lib_var=no"
2734 fi
2735 rm -f conftest*
2736 LIBS="$ac_save_LIBS"
2737
2738 fi
2739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2740   echo "$ac_t""yes" 1>&6
2741   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
2742 else
2743   echo "$ac_t""no" 1>&6
2744 fi
2745
2746   LDFLAGS="$ac_save_LDFLAGS"
2747
2748 fi
2749
2750
2751 # Try and find the app-defaults directory.
2752 # It sucks that autoconf doesn't do this already...
2753 #
2754
2755
2756
2757
2758
2759
2760
2761
2762     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
2763 echo "configure:2775: checking for X app-defaults directory" >&5
2764 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
2765   echo $ac_n "(cached) $ac_c" 1>&6
2766 else
2767   
2768   rm -fr conftestdir
2769   if mkdir conftestdir; then
2770     cd conftestdir >&-
2771     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2772     cat > Imakefile <<'EOF'
2773 acfindx:
2774         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
2775 EOF
2776     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2777       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
2778       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2779     fi
2780     cd .. >&-
2781     rm -fr conftestdir
2782   fi
2783       if test x"$ac_x_app_defaults" = x; then
2784         
2785   # Look for the directory under a standard set of common directories.
2786   # Check X11 before X11Rn because it's often a symlink to the current release.
2787   for ac_dir in                                 \
2788     /usr/X11/lib/app-defaults                   \
2789     /usr/X11R6/lib/app-defaults                 \
2790     /usr/X11R6/lib/X11/app-defaults             \
2791     /usr/X11R5/lib/app-defaults                 \
2792     /usr/X11R5/lib/X11/app-defaults             \
2793     /usr/X11R4/lib/app-defaults                 \
2794     /usr/X11R4/lib/X11/app-defaults             \
2795                                                 \
2796     /usr/lib/X11/app-defaults                   \
2797     /usr/lib/X11R6/app-defaults                 \
2798     /usr/lib/X11R5/app-defaults                 \
2799     /usr/lib/X11R4/app-defaults                 \
2800                                                 \
2801     /usr/local/X11/lib/app-defaults             \
2802     /usr/local/X11R6/lib/app-defaults           \
2803     /usr/local/X11R5/lib/app-defaults           \
2804     /usr/local/X11R4/lib/app-defaults           \
2805                                                 \
2806     /usr/local/lib/X11/app-defaults             \
2807     /usr/local/lib/X11R6/app-defaults           \
2808     /usr/local/lib/X11R6/X11/app-defaults       \
2809     /usr/local/lib/X11R5/app-defaults           \
2810     /usr/local/lib/X11R5/X11/app-defaults       \
2811     /usr/local/lib/X11R4/app-defaults           \
2812     /usr/local/lib/X11R4/X11/app-defaults       \
2813                                                 \
2814     /usr/X386/lib/X11/app-defaults              \
2815     /usr/x386/lib/X11/app-defaults              \
2816     /usr/XFree86/lib/X11/app-defaults           \
2817                                                 \
2818     /usr/lib/X11/app-defaults                   \
2819     /usr/local/lib/X11/app-defaults             \
2820     /usr/unsupported/lib/X11/app-defaults       \
2821     /usr/athena/lib/X11/app-defaults            \
2822     /usr/local/x11r5/lib/X11/app-defaults       \
2823     /usr/lpp/Xamples/lib/X11/app-defaults       \
2824     /lib/usr/lib/X11/app-defaults               \
2825                                                 \
2826     /usr/openwin/lib/app-defaults               \
2827     /usr/openwin/lib/X11/app-defaults           \
2828     /usr/openwin/share/lib/app-defaults         \
2829     /usr/openwin/share/lib/X11/app-defaults     \
2830                                                 \
2831     /X11R6/lib/app-defaults                     \
2832     /X11R5/lib/app-defaults                     \
2833     /X11R4/lib/app-defaults                     \
2834     ; \
2835   do
2836     if test -d "$ac_dir"; then
2837       ac_x_app_defaults=$ac_dir
2838       break
2839     fi
2840   done
2841
2842       fi
2843       if test x"$ac_x_app_defaults" = x; then
2844         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
2845       else
2846         # Record where we found app-defaults for the cache.
2847         ac_cv_x_app_defaults="$ac_x_app_defaults"
2848       fi
2849 fi
2850
2851 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
2852     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
2853
2854 APPDEFAULTS=$ac_x_app_defaults
2855
2856
2857 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
2858 #
2859
2860
2861 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
2862 #
2863
2864
2865 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
2866 #
2867
2868
2869
2870 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
2871 # Use this sparingly; it probably doesn't work very well on X programs.
2872 #
2873
2874
2875 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
2876 # (But not the -L directories!)
2877 #
2878
2879
2880
2881
2882 # Usage: HANDLE_X_PATH_ARG([variable_name],
2883 #                          [--command-line-option],
2884 #                          [descriptive string])
2885 #
2886 # All of the --with options take three forms:
2887 #
2888 #   --with-foo (or --with-foo=yes)
2889 #   --without-foo (or --with-foo=no)
2890 #   --with-foo=/DIR
2891 #
2892 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
2893 # a directory (string beginning with a slash) it checks to see whether
2894 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
2895 # as appropriate.
2896 #
2897
2898
2899
2900
2901 # check for the HP XHPDisableReset server extension headers.
2902 #
2903
2904   ac_save_CPPFLAGS="$CPPFLAGS"
2905   if test \! -z "$includedir" ; then 
2906     CPPFLAGS="$CPPFLAGS -I$includedir"
2907   fi
2908   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2909   cat > conftest.$ac_ext <<EOF
2910 #line 2922 "configure"
2911 #include "confdefs.h"
2912 #include <X11/XHPlib.h>
2913 EOF
2914 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2915   egrep "XHPDisableReset" >/dev/null 2>&1; then
2916   rm -rf conftest*
2917   cat >> confdefs.h <<\EOF
2918 #define HAVE_XHPDISABLERESET 1
2919 EOF
2920
2921                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
2922 fi
2923 rm -f conftest*
2924
2925   CPPFLAGS="$ac_save_CPPFLAGS"
2926
2927
2928 # Check for the availability of the XPointer typedef, and define it otherwise.
2929 #
2930 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
2931 echo "configure:2943: checking for XPointer" >&5
2932 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
2933   echo $ac_n "(cached) $ac_c" 1>&6
2934 else
2935   
2936   ac_save_CPPFLAGS="$CPPFLAGS"
2937   if test \! -z "$includedir" ; then 
2938     CPPFLAGS="$CPPFLAGS -I$includedir"
2939   fi
2940   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
2941   cat > conftest.$ac_ext <<EOF
2942 #line 2954 "configure"
2943 #include "confdefs.h"
2944 #include <X11/Xlib.h>
2945 int main() {
2946 XPointer foo = (XPointer) 0;
2947 ; return 0; }
2948 EOF
2949 if { (eval echo configure:2961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2950   rm -rf conftest*
2951   ac_cv_xpointer=yes
2952 else
2953   echo "configure: failed program was:" >&5
2954   cat conftest.$ac_ext >&5
2955   rm -rf conftest*
2956   ac_cv_xpointer=no
2957 fi
2958 rm -f conftest*
2959   CPPFLAGS="$ac_save_CPPFLAGS"
2960 fi
2961
2962 echo "$ac_t""$ac_cv_xpointer" 1>&6
2963 if test "$ac_cv_xpointer" != yes; then
2964   cat >> confdefs.h <<\EOF
2965 #define XPointer char*
2966 EOF
2967
2968 fi
2969
2970
2971 # Random special-cases for certain pathological OSes.  You know who you are.
2972 #
2973 case "$host" in
2974   *-hpux*)
2975
2976     # The following arcana was gleaned from conversations with
2977     # Eric Schwartz <erics@col.hp.com>:
2978     #
2979     # On HPUX 10.x, the parts of X that HP considers "standard" live in
2980     # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
2981     # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
2982     # Also, there are symlinks from /usr/include/ and /usr/lib/ into
2983     # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
2984     # you don't need any -I or -L arguments.
2985     #
2986     # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
2987     # are the same division as 10.x.  However, there are no symlinks to
2988     # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
2989     # arguments are always necessary.
2990     #
2991     # However, X11R6 was available on HPUX 9.x as a patch: if that
2992     # patch was installed, then all of X11R6 went in to
2993     # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
2994     #
2995     # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
2996     # whether R5 was available as a patch; R6 undoubtedly was not.)
2997     #
2998     # So.  We try and use the highest numbered pair of
2999     # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
3000     # that are available.  We do not mix and match different versions
3001     # of X.
3002     #
3003     # Questions I still don't know the answers to: (do you?)
3004     #
3005     #   * Does HPUX 10.x come with /usr/contrib/X11R6/ standard?  
3006     #     Or does that need to be installed separately?
3007     #
3008     #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
3009     #     /usr/contrib/X11R6/ could be installed as a patch, what was in
3010     #     that contrib directory?  Did it contain so-called "standard"
3011     #     X11R6, or did it include Xaw and Xmu as well?  If the former,
3012     #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
3013     #     be a situation where one had to reach into the R5 headers and
3014     #     libs to find Xmu?  That is, must both R6 and R5 directories
3015     #     be on the -I and -L lists in that case?
3016     #
3017     for version in X11R6 X11R5 X11R4 ; do
3018       # if either pair of directories exists...
3019       if test -d /usr/lib/$version || test -d /usr/contrib/$version/lib ; then
3020          # if contrib exists, use it...
3021          if test -d /usr/contrib/$version/lib ; then
3022            X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
3023            X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
3024          fi
3025          # if the "standard" one exists, use it.
3026          if test -d /usr/lib/$version ; then
3027            X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
3028            X_LIBS="$X_LIBS -L/usr/lib/$version"
3029          fi
3030          # since at least one of the pair exists, go no farther.
3031          break
3032       fi
3033     done
3034
3035     # Now find Motif.  Thanks for not making xmkmf find this by
3036     # default, you losers.
3037     #
3038     if test -d /usr/lib/Motif1.2 ; then
3039       X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
3040       X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
3041     elif test -d /usr/lib/Motif1.1 ; then
3042       X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
3043       X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
3044     fi
3045
3046     # Now let's check for the pseudo-standard locations for OpenGL and XPM.
3047     #
3048     if test -d /opt/Mesa/lib ; then
3049       X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
3050       X_LIBS="-L/opt/Mesa/lib $X_LIBS"
3051     fi
3052
3053     if test -d /opt/xpm/lib/X11 ; then
3054       X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
3055       X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
3056     fi
3057
3058     # On HPUX, default to installing in /opt/xscreensaver/ instead of
3059     # in /usr/local/, unless there is already an xscreensaver in
3060     # /usr/local/bin/.  This can be overridden with the --prefix arg
3061     # to configure.  I'm not sure this is the right thing to do, but
3062     # Richard Lloyd says so...
3063     #
3064     if test \! -x /usr/local/bin/xscreensaver ; then
3065       ac_default_prefix=/opt/xscreensaver
3066     fi
3067
3068   ;;
3069   *-solaris*)
3070
3071     # Thanks for not making xmkmf find this by default, pinheads.
3072     # And thanks for moving things around again, too.  Is this
3073     # really the standard location now?  What happened to the
3074     # joke that this kind of thing went in /opt?
3075     # cthomp says "answer: CDE (Common Disorganized Environment)"
3076     #
3077     if test -f /usr/dt/include/Xm/Xm.h ; then
3078       X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
3079       X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
3080
3081       # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
3082       echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
3083 echo "configure:3095: checking for regcmp in -lgen" >&5
3084 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
3085 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3086   echo $ac_n "(cached) $ac_c" 1>&6
3087 else
3088   ac_save_LIBS="$LIBS"
3089 LIBS="-lgen  $LIBS"
3090 cat > conftest.$ac_ext <<EOF
3091 #line 3103 "configure"
3092 #include "confdefs.h"
3093 /* Override any gcc2 internal prototype to avoid an error.  */
3094 /* We use char because int might match the return type of a gcc2
3095     builtin and then its argument prototype would still apply.  */
3096 char regcmp();
3097
3098 int main() {
3099 regcmp()
3100 ; return 0; }
3101 EOF
3102 if { (eval echo configure:3114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3103   rm -rf conftest*
3104   eval "ac_cv_lib_$ac_lib_var=yes"
3105 else
3106   echo "configure: failed program was:" >&5
3107   cat conftest.$ac_ext >&5
3108   rm -rf conftest*
3109   eval "ac_cv_lib_$ac_lib_var=no"
3110 fi
3111 rm -f conftest*
3112 LIBS="$ac_save_LIBS"
3113
3114 fi
3115 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3116   echo "$ac_t""yes" 1>&6
3117   X_LIBS="$X_LIBS -lgen"
3118 else
3119   echo "$ac_t""no" 1>&6
3120 fi
3121
3122     fi
3123   ;;
3124 esac
3125
3126
3127
3128 # Check for Xmu (some fucked up vendors don't ship it...)
3129 #
3130 have_xmu=no
3131
3132   ac_save_CPPFLAGS="$CPPFLAGS"
3133   if test \! -z "$includedir" ; then 
3134     CPPFLAGS="$CPPFLAGS -I$includedir"
3135   fi
3136   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3137   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
3138 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
3139 echo "configure:3151: checking for X11/Xmu/Error.h" >&5
3140 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3141   echo $ac_n "(cached) $ac_c" 1>&6
3142 else
3143   cat > conftest.$ac_ext <<EOF
3144 #line 3156 "configure"
3145 #include "confdefs.h"
3146 #include <X11/Xmu/Error.h>
3147 EOF
3148 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3149 { (eval echo configure:3161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3150 ac_err=`grep -v '^ *+' conftest.out`
3151 if test -z "$ac_err"; then
3152   rm -rf conftest*
3153   eval "ac_cv_header_$ac_safe=yes"
3154 else
3155   echo "$ac_err" >&5
3156   echo "configure: failed program was:" >&5
3157   cat conftest.$ac_ext >&5
3158   rm -rf conftest*
3159   eval "ac_cv_header_$ac_safe=no"
3160 fi
3161 rm -f conftest*
3162 fi
3163 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3164   echo "$ac_t""yes" 1>&6
3165   have_xmu=yes
3166 else
3167   echo "$ac_t""no" 1>&6
3168 fi
3169
3170   CPPFLAGS="$ac_save_CPPFLAGS"
3171 if test "$have_xmu" = no ; then
3172   XMU_SRCS='$(UTILS_SRC)/xmu.c'
3173   XMU_OBJS='$(UTILS_BIN)/xmu.o'
3174 else
3175   XMU_SRCS=''
3176   XMU_OBJS=''
3177   SAVER_LIBS="-lXmu $SAVER_LIBS"
3178   HACK_LIBS="-lXmu $HACK_LIBS"
3179   cat >> confdefs.h <<\EOF
3180 #define HAVE_XMU 1
3181 EOF
3182
3183 fi
3184
3185
3186 # See comp.windows.x FAQ question 124 about _get_wmShellWidgetClass on 4.1.x.
3187 # The right fix is to get OpenWindows 3.0 patches 100512-02 and 100573-03.
3188 #
3189 if test "$have_xmu" = yes ; then
3190   case "$host" in
3191     *-sunos4*)
3192     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
3193 echo "configure:3205: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
3194 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
3195   echo $ac_n "(cached) $ac_c" 1>&6
3196 else
3197   ac_save_LDFLAGS="$LDFLAGS"
3198                     if test \! -z "$x_libraries" ; then
3199                       LDFLAGS="$LDFLAGS -L$x_libraries"
3200                     fi
3201                     # Note: this trick never works!  (Generally.)
3202                     # We're only getting away with using AC_TRY_LINK
3203                     # with X libraries because we know it's SunOS.
3204                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
3205                     cat > conftest.$ac_ext <<EOF
3206 #line 3218 "configure"
3207 #include "confdefs.h"
3208
3209 int main() {
3210
3211 ; return 0; }
3212 EOF
3213 if { (eval echo configure:3225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3214   rm -rf conftest*
3215   ac_cv_sunos_xmu_bug=no
3216 else
3217   echo "configure: failed program was:" >&5
3218   cat conftest.$ac_ext >&5
3219   rm -rf conftest*
3220   ac_cv_sunos_xmu_bug=yes
3221 fi
3222 rm -f conftest*
3223                     LDFLAGS="$ac_save_LDFLAGS"
3224 fi
3225
3226 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3227     if test "$ac_cv_sunos_xmu_bug" = yes ; then
3228       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3229 echo "configure:3241: checking whether the compiler understands -static" >&5
3230 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3231   echo $ac_n "(cached) $ac_c" 1>&6
3232 else
3233   ac_save_LDFLAGS="$LDFLAGS"
3234                       LDFLAGS="$LDFLAGS -static"
3235                       cat > conftest.$ac_ext <<EOF
3236 #line 3248 "configure"
3237 #include "confdefs.h"
3238
3239 int main() {
3240
3241 ; return 0; }
3242 EOF
3243 if { (eval echo configure:3255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3244   rm -rf conftest*
3245   ac_cv_ld_static=yes
3246 else
3247   echo "configure: failed program was:" >&5
3248   cat conftest.$ac_ext >&5
3249   rm -rf conftest*
3250   ac_cv_ld_static=no
3251 fi
3252 rm -f conftest*
3253                     LDFLAGS="$ac_save_LDFLAGS"
3254 fi
3255
3256 echo "$ac_t""$ac_cv_ld_static" 1>&6
3257       if test "$ac_cv_ld_static" = yes ; then
3258         LDFLAGS="$LDFLAGS -static"
3259       else
3260         LDFLAGS="$LDFLAGS -Bstatic"
3261       fi
3262     fi
3263     ;;
3264   esac
3265 fi
3266
3267
3268 # Check for the SGI SCREEN_SAVER server extension header.
3269 #
3270 have_sgi=no
3271 with_sgi_req=unspecified
3272 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3273 if test "${with_sgi_ext+set}" = set; then
3274   withval="$with_sgi_ext"
3275   with_sgi="$withval"; with_sgi_req="$withval"
3276 else
3277   with_sgi=yes
3278 fi
3279
3280
3281
3282    case "$with_sgi" in
3283     yes) ;;
3284     no)  ;;
3285
3286     /*)
3287      echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
3288 echo "configure:3300: checking for SGI SCREEN_SAVER headers" >&5
3289      d=$with_sgi/include
3290      if test -d $d; then
3291        X_CFLAGS="-I$d $X_CFLAGS"
3292        echo "$ac_t""$d" 1>&6
3293      else
3294        echo "$ac_t""not found ($d: no such directory)" 1>&6
3295      fi
3296
3297      echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
3298 echo "configure:3310: checking for SGI SCREEN_SAVER libs" >&5
3299      d=$with_sgi/lib
3300      if test -d $d; then
3301        X_LIBS="-L$d $X_LIBS"
3302        echo "$ac_t""$d" 1>&6
3303      else
3304        echo "$ac_t""not found ($d: no such directory)" 1>&6
3305      fi
3306
3307      # replace the directory string with "yes".
3308      with_sgi_req="yes"
3309      with_sgi=$with_sgi_req
3310      ;;
3311
3312     *)
3313      echo ""
3314      echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
3315      echo "       If it is a directory, then \`DIR/include' will be added to"
3316      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3317      exit 1
3318      ;;
3319    esac
3320
3321    # why is this necessary?
3322    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3323    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3324    withval=
3325   
3326
3327 if test "$with_sgi" = yes; then
3328   
3329   ac_save_CPPFLAGS="$CPPFLAGS"
3330   if test \! -z "$includedir" ; then 
3331     CPPFLAGS="$CPPFLAGS -I$includedir"
3332   fi
3333   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3334   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3335 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3336 echo "configure:3348: checking for X11/extensions/XScreenSaver.h" >&5
3337 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3338   echo $ac_n "(cached) $ac_c" 1>&6
3339 else
3340   cat > conftest.$ac_ext <<EOF
3341 #line 3353 "configure"
3342 #include "confdefs.h"
3343 #include <X11/extensions/XScreenSaver.h>
3344 EOF
3345 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3346 { (eval echo configure:3358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3347 ac_err=`grep -v '^ *+' conftest.out`
3348 if test -z "$ac_err"; then
3349   rm -rf conftest*
3350   eval "ac_cv_header_$ac_safe=yes"
3351 else
3352   echo "$ac_err" >&5
3353   echo "configure: failed program was:" >&5
3354   cat conftest.$ac_ext >&5
3355   rm -rf conftest*
3356   eval "ac_cv_header_$ac_safe=no"
3357 fi
3358 rm -f conftest*
3359 fi
3360 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3361   echo "$ac_t""yes" 1>&6
3362   have_sgi=yes
3363                      cat >> confdefs.h <<\EOF
3364 #define HAVE_SGI_SAVER_EXTENSION 1
3365 EOF
3366
3367 else
3368   echo "$ac_t""no" 1>&6
3369 fi
3370
3371   CPPFLAGS="$ac_save_CPPFLAGS"
3372
3373 elif test "$with_sgi" != no; then
3374   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3375   exit 1
3376 fi
3377
3378 # Check for the MIT-SCREEN-SAVER server extension header,
3379 # unless the SGI extension has already been found.
3380 #
3381 have_mit=no
3382 with_mit_req=unspecified
3383 # Check whether --with-mit-ext or --without-mit-ext was given.
3384 if test "${with_mit_ext+set}" = set; then
3385   withval="$with_mit_ext"
3386   with_mit="$withval"; with_mit_req="$withval"
3387 else
3388   with_mit=yes
3389 fi
3390
3391
3392
3393    case "$with_mit" in
3394     yes) ;;
3395     no)  ;;
3396
3397     /*)
3398      echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
3399 echo "configure:3411: checking for MIT-SCREEN-SAVER headers" >&5
3400      d=$with_mit/include
3401      if test -d $d; then
3402        X_CFLAGS="-I$d $X_CFLAGS"
3403        echo "$ac_t""$d" 1>&6
3404      else
3405        echo "$ac_t""not found ($d: no such directory)" 1>&6
3406      fi
3407
3408      echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
3409 echo "configure:3421: checking for MIT-SCREEN-SAVER libs" >&5
3410      d=$with_mit/lib
3411      if test -d $d; then
3412        X_LIBS="-L$d $X_LIBS"
3413        echo "$ac_t""$d" 1>&6
3414      else
3415        echo "$ac_t""not found ($d: no such directory)" 1>&6
3416      fi
3417
3418      # replace the directory string with "yes".
3419      with_mit_req="yes"
3420      with_mit=$with_mit_req
3421      ;;
3422
3423     *)
3424      echo ""
3425      echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory."
3426      echo "       If it is a directory, then \`DIR/include' will be added to"
3427      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3428      exit 1
3429      ;;
3430    esac
3431
3432    # why is this necessary?
3433    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3434    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3435    withval=
3436   
3437
3438 if test "$have_sgi" != yes; then
3439   if test "$with_mit" = yes; then
3440     
3441   ac_save_CPPFLAGS="$CPPFLAGS"
3442   if test \! -z "$includedir" ; then 
3443     CPPFLAGS="$CPPFLAGS -I$includedir"
3444   fi
3445   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3446   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3447 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3448 echo "configure:3460: checking for X11/extensions/scrnsaver.h" >&5
3449 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3450   echo $ac_n "(cached) $ac_c" 1>&6
3451 else
3452   cat > conftest.$ac_ext <<EOF
3453 #line 3465 "configure"
3454 #include "confdefs.h"
3455 #include <X11/extensions/scrnsaver.h>
3456 EOF
3457 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3458 { (eval echo configure:3470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3459 ac_err=`grep -v '^ *+' conftest.out`
3460 if test -z "$ac_err"; then
3461   rm -rf conftest*
3462   eval "ac_cv_header_$ac_safe=yes"
3463 else
3464   echo "$ac_err" >&5
3465   echo "configure: failed program was:" >&5
3466   cat conftest.$ac_ext >&5
3467   rm -rf conftest*
3468   eval "ac_cv_header_$ac_safe=no"
3469 fi
3470 rm -f conftest*
3471 fi
3472 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3473   echo "$ac_t""yes" 1>&6
3474   have_mit=yes
3475 else
3476   echo "$ac_t""no" 1>&6
3477 fi
3478
3479   CPPFLAGS="$ac_save_CPPFLAGS"
3480
3481     # Now check to see if it's really in the library; XF86Free-3.3 ships
3482     # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
3483     #
3484     if test "$have_mit" = yes; then
3485       
3486   ac_save_CPPFLAGS="$CPPFLAGS"
3487   ac_save_LDFLAGS="$LDFLAGS"
3488
3489   if test \! -z "$includedir" ; then 
3490     CPPFLAGS="$CPPFLAGS -I$includedir"
3491   fi
3492   # note: $X_CFLAGS includes $x_includes
3493   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3494
3495   if test \! -z "$libdir" ; then
3496     LDFLAGS="$LDFLAGS -L$libdir"
3497   fi
3498   # note: $X_LIBS includes $x_libraries
3499   LDFLAGS="$LDFLAGS $X_LIBS"
3500
3501   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
3502 echo "configure:3514: checking for XScreenSaverRegister in -lXext" >&5
3503 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3504 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3505   echo $ac_n "(cached) $ac_c" 1>&6
3506 else
3507   ac_save_LIBS="$LIBS"
3508 LIBS="-lXext -lm $LIBS"
3509 cat > conftest.$ac_ext <<EOF
3510 #line 3522 "configure"
3511 #include "confdefs.h"
3512 /* Override any gcc2 internal prototype to avoid an error.  */
3513 /* We use char because int might match the return type of a gcc2
3514     builtin and then its argument prototype would still apply.  */
3515 char XScreenSaverRegister();
3516
3517 int main() {
3518 XScreenSaverRegister()
3519 ; return 0; }
3520 EOF
3521 if { (eval echo configure:3533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3522   rm -rf conftest*
3523   eval "ac_cv_lib_$ac_lib_var=yes"
3524 else
3525   echo "configure: failed program was:" >&5
3526   cat conftest.$ac_ext >&5
3527   rm -rf conftest*
3528   eval "ac_cv_lib_$ac_lib_var=no"
3529 fi
3530 rm -f conftest*
3531 LIBS="$ac_save_LIBS"
3532
3533 fi
3534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3535   echo "$ac_t""yes" 1>&6
3536     ac_tr_lib=HAVE_LIB`echo Xext | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3537     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3538   cat >> confdefs.h <<EOF
3539 #define $ac_tr_lib 1
3540 EOF
3541
3542   LIBS="-lXext $LIBS"
3543
3544 else
3545   echo "$ac_t""no" 1>&6
3546 have_mit=no
3547 fi
3548
3549   CPPFLAGS="$ac_save_CPPFLAGS"
3550   LDFLAGS="$ac_save_LDFLAGS"
3551
3552       if test "$have_mit" = no; then
3553         # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
3554         # of in Xext.  Thank you master, may I have another.
3555         
3556   ac_save_CPPFLAGS="$CPPFLAGS"
3557   ac_save_LDFLAGS="$LDFLAGS"
3558
3559   if test \! -z "$includedir" ; then 
3560     CPPFLAGS="$CPPFLAGS -I$includedir"
3561   fi
3562   # note: $X_CFLAGS includes $x_includes
3563   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3564
3565   if test \! -z "$libdir" ; then
3566     LDFLAGS="$LDFLAGS -L$libdir"
3567   fi
3568   # note: $X_LIBS includes $x_libraries
3569   LDFLAGS="$LDFLAGS $X_LIBS"
3570
3571   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
3572 echo "configure:3584: checking for XScreenSaverRegister in -lXExExt" >&5
3573 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3574 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3575   echo $ac_n "(cached) $ac_c" 1>&6
3576 else
3577   ac_save_LIBS="$LIBS"
3578 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
3579 cat > conftest.$ac_ext <<EOF
3580 #line 3592 "configure"
3581 #include "confdefs.h"
3582 /* Override any gcc2 internal prototype to avoid an error.  */
3583 /* We use char because int might match the return type of a gcc2
3584     builtin and then its argument prototype would still apply.  */
3585 char XScreenSaverRegister();
3586
3587 int main() {
3588 XScreenSaverRegister()
3589 ; return 0; }
3590 EOF
3591 if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3592   rm -rf conftest*
3593   eval "ac_cv_lib_$ac_lib_var=yes"
3594 else
3595   echo "configure: failed program was:" >&5
3596   cat conftest.$ac_ext >&5
3597   rm -rf conftest*
3598   eval "ac_cv_lib_$ac_lib_var=no"
3599 fi
3600 rm -f conftest*
3601 LIBS="$ac_save_LIBS"
3602
3603 fi
3604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3605   echo "$ac_t""yes" 1>&6
3606   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
3607 else
3608   echo "$ac_t""no" 1>&6
3609 fi
3610
3611   CPPFLAGS="$ac_save_CPPFLAGS"
3612   LDFLAGS="$ac_save_LDFLAGS"
3613       fi
3614
3615       if test "$have_mit" = no; then
3616         # Double fuck!  Looks like some versions of XFree86 (whichever version
3617         # it is that comes with RedHat Linux 2.0 -- I can't find a version 
3618         # number) put this garbage in Xss instead of Xext.  Thank you master,
3619         #  may I have another.
3620         
3621   ac_save_CPPFLAGS="$CPPFLAGS"
3622   ac_save_LDFLAGS="$LDFLAGS"
3623
3624   if test \! -z "$includedir" ; then 
3625     CPPFLAGS="$CPPFLAGS -I$includedir"
3626   fi
3627   # note: $X_CFLAGS includes $x_includes
3628   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3629
3630   if test \! -z "$libdir" ; then
3631     LDFLAGS="$LDFLAGS -L$libdir"
3632   fi
3633   # note: $X_LIBS includes $x_libraries
3634   LDFLAGS="$LDFLAGS $X_LIBS"
3635
3636   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
3637 echo "configure:3649: checking for XScreenSaverRegister in -lXss" >&5
3638 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
3639 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3640   echo $ac_n "(cached) $ac_c" 1>&6
3641 else
3642   ac_save_LIBS="$LIBS"
3643 LIBS="-lXss -lX11 -lXext -lm $LIBS"
3644 cat > conftest.$ac_ext <<EOF
3645 #line 3657 "configure"
3646 #include "confdefs.h"
3647 /* Override any gcc2 internal prototype to avoid an error.  */
3648 /* We use char because int might match the return type of a gcc2
3649     builtin and then its argument prototype would still apply.  */
3650 char XScreenSaverRegister();
3651
3652 int main() {
3653 XScreenSaverRegister()
3654 ; return 0; }
3655 EOF
3656 if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3657   rm -rf conftest*
3658   eval "ac_cv_lib_$ac_lib_var=yes"
3659 else
3660   echo "configure: failed program was:" >&5
3661   cat conftest.$ac_ext >&5
3662   rm -rf conftest*
3663   eval "ac_cv_lib_$ac_lib_var=no"
3664 fi
3665 rm -f conftest*
3666 LIBS="$ac_save_LIBS"
3667
3668 fi
3669 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3670   echo "$ac_t""yes" 1>&6
3671   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
3672 else
3673   echo "$ac_t""no" 1>&6
3674 fi
3675
3676   CPPFLAGS="$ac_save_CPPFLAGS"
3677   LDFLAGS="$ac_save_LDFLAGS"
3678       fi
3679
3680     if test "$have_mit" = yes; then
3681       cat >> confdefs.h <<\EOF
3682 #define HAVE_MIT_SAVER_EXTENSION 1
3683 EOF
3684
3685     fi
3686
3687     fi
3688
3689   elif test "$with_mit" != no; then
3690     echo "error: must be yes or no: --with-mit-ext=$with_mit"
3691     exit 1
3692   fi
3693 fi
3694
3695
3696 # Check for the XIDLE server extension header.
3697 #
3698 have_xidle=no
3699 with_xidle_req=unspecified
3700 # Check whether --with-xidle-ext or --without-xidle-ext was given.
3701 if test "${with_xidle_ext+set}" = set; then
3702   withval="$with_xidle_ext"
3703   with_xidle="$withval"; with_xidle_req="$withval"
3704 else
3705   with_xidle=yes
3706 fi
3707
3708
3709
3710    case "$with_xidle" in
3711     yes) ;;
3712     no)  ;;
3713
3714     /*)
3715      echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
3716 echo "configure:3728: checking for XIDLE headers" >&5
3717      d=$with_xidle/include
3718      if test -d $d; then
3719        X_CFLAGS="-I$d $X_CFLAGS"
3720        echo "$ac_t""$d" 1>&6
3721      else
3722        echo "$ac_t""not found ($d: no such directory)" 1>&6
3723      fi
3724
3725      echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
3726 echo "configure:3738: checking for XIDLE libs" >&5
3727      d=$with_xidle/lib
3728      if test -d $d; then
3729        X_LIBS="-L$d $X_LIBS"
3730        echo "$ac_t""$d" 1>&6
3731      else
3732        echo "$ac_t""not found ($d: no such directory)" 1>&6
3733      fi
3734
3735      # replace the directory string with "yes".
3736      with_xidle_req="yes"
3737      with_xidle=$with_xidle_req
3738      ;;
3739
3740     *)
3741      echo ""
3742      echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
3743      echo "       If it is a directory, then \`DIR/include' will be added to"
3744      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3745      exit 1
3746      ;;
3747    esac
3748
3749    # why is this necessary?
3750    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3751    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3752    withval=
3753   
3754
3755 if test "$with_xidle" = yes; then
3756   
3757   ac_save_CPPFLAGS="$CPPFLAGS"
3758   if test \! -z "$includedir" ; then 
3759     CPPFLAGS="$CPPFLAGS -I$includedir"
3760   fi
3761   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3762   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
3763 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
3764 echo "configure:3776: checking for X11/extensions/xidle.h" >&5
3765 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3766   echo $ac_n "(cached) $ac_c" 1>&6
3767 else
3768   cat > conftest.$ac_ext <<EOF
3769 #line 3781 "configure"
3770 #include "confdefs.h"
3771 #include <X11/extensions/xidle.h>
3772 EOF
3773 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3774 { (eval echo configure:3786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3775 ac_err=`grep -v '^ *+' conftest.out`
3776 if test -z "$ac_err"; then
3777   rm -rf conftest*
3778   eval "ac_cv_header_$ac_safe=yes"
3779 else
3780   echo "$ac_err" >&5
3781   echo "configure: failed program was:" >&5
3782   cat conftest.$ac_ext >&5
3783   rm -rf conftest*
3784   eval "ac_cv_header_$ac_safe=no"
3785 fi
3786 rm -f conftest*
3787 fi
3788 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3789   echo "$ac_t""yes" 1>&6
3790   have_xidle=yes
3791                      cat >> confdefs.h <<\EOF
3792 #define HAVE_XIDLE_EXTENSION 1
3793 EOF
3794
3795 else
3796   echo "$ac_t""no" 1>&6
3797 fi
3798
3799   CPPFLAGS="$ac_save_CPPFLAGS"
3800 elif test "$with_xidle" != no; then
3801   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
3802   exit 1
3803 fi
3804
3805
3806 # Check for the XSHM server extension header.
3807 #
3808 have_xshm=no
3809 with_xshm_req=unspecified
3810 # Check whether --with-xshm-ext or --without-xshm-ext was given.
3811 if test "${with_xshm_ext+set}" = set; then
3812   withval="$with_xshm_ext"
3813   with_xshm="$withval"; with_xshm_req="$withval"
3814 else
3815   with_xshm=yes
3816 fi
3817
3818
3819
3820    case "$with_xshm" in
3821     yes) ;;
3822     no)  ;;
3823
3824     /*)
3825      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
3826 echo "configure:3838: checking for XSHM headers" >&5
3827      d=$with_xshm/include
3828      if test -d $d; then
3829        X_CFLAGS="-I$d $X_CFLAGS"
3830        echo "$ac_t""$d" 1>&6
3831      else
3832        echo "$ac_t""not found ($d: no such directory)" 1>&6
3833      fi
3834
3835      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
3836 echo "configure:3848: checking for XSHM libs" >&5
3837      d=$with_xshm/lib
3838      if test -d $d; then
3839        X_LIBS="-L$d $X_LIBS"
3840        echo "$ac_t""$d" 1>&6
3841      else
3842        echo "$ac_t""not found ($d: no such directory)" 1>&6
3843      fi
3844
3845      # replace the directory string with "yes".
3846      with_xshm_req="yes"
3847      with_xshm=$with_xshm_req
3848      ;;
3849
3850     *)
3851      echo ""
3852      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
3853      echo "       If it is a directory, then \`DIR/include' will be added to"
3854      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3855      exit 1
3856      ;;
3857    esac
3858
3859    # why is this necessary?
3860    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
3861    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
3862    withval=
3863   
3864
3865 if test "$with_xshm" = yes; then
3866
3867   # first check for Xshm.h.
3868   
3869   ac_save_CPPFLAGS="$CPPFLAGS"
3870   if test \! -z "$includedir" ; then 
3871     CPPFLAGS="$CPPFLAGS -I$includedir"
3872   fi
3873   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3874   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
3875 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
3876 echo "configure:3888: checking for X11/extensions/XShm.h" >&5
3877 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3878   echo $ac_n "(cached) $ac_c" 1>&6
3879 else
3880   cat > conftest.$ac_ext <<EOF
3881 #line 3893 "configure"
3882 #include "confdefs.h"
3883 #include <X11/extensions/XShm.h>
3884 EOF
3885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3886 { (eval echo configure:3898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3887 ac_err=`grep -v '^ *+' conftest.out`
3888 if test -z "$ac_err"; then
3889   rm -rf conftest*
3890   eval "ac_cv_header_$ac_safe=yes"
3891 else
3892   echo "$ac_err" >&5
3893   echo "configure: failed program was:" >&5
3894   cat conftest.$ac_ext >&5
3895   rm -rf conftest*
3896   eval "ac_cv_header_$ac_safe=no"
3897 fi
3898 rm -f conftest*
3899 fi
3900 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3901   echo "$ac_t""yes" 1>&6
3902   have_xshm=yes
3903 else
3904   echo "$ac_t""no" 1>&6
3905 fi
3906
3907   CPPFLAGS="$ac_save_CPPFLAGS"
3908
3909   # if that succeeded, then check for sys/ipc.h.
3910   if test "$have_xshm" = yes; then
3911     have_xshm=no
3912     
3913   ac_save_CPPFLAGS="$CPPFLAGS"
3914   if test \! -z "$includedir" ; then 
3915     CPPFLAGS="$CPPFLAGS -I$includedir"
3916   fi
3917   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3918   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
3919 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
3920 echo "configure:3932: checking for sys/ipc.h" >&5
3921 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3922   echo $ac_n "(cached) $ac_c" 1>&6
3923 else
3924   cat > conftest.$ac_ext <<EOF
3925 #line 3937 "configure"
3926 #include "confdefs.h"
3927 #include <sys/ipc.h>
3928 EOF
3929 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3930 { (eval echo configure:3942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3931 ac_err=`grep -v '^ *+' conftest.out`
3932 if test -z "$ac_err"; then
3933   rm -rf conftest*
3934   eval "ac_cv_header_$ac_safe=yes"
3935 else
3936   echo "$ac_err" >&5
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -rf conftest*
3940   eval "ac_cv_header_$ac_safe=no"
3941 fi
3942 rm -f conftest*
3943 fi
3944 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3945   echo "$ac_t""yes" 1>&6
3946   have_xshm=yes
3947 else
3948   echo "$ac_t""no" 1>&6
3949 fi
3950
3951   CPPFLAGS="$ac_save_CPPFLAGS"
3952   fi
3953
3954   # if that succeeded, then check for sys/shm.h.
3955   if test "$have_xshm" = yes; then
3956     have_xshm=no
3957     
3958   ac_save_CPPFLAGS="$CPPFLAGS"
3959   if test \! -z "$includedir" ; then 
3960     CPPFLAGS="$CPPFLAGS -I$includedir"
3961   fi
3962   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3963   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
3964 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
3965 echo "configure:3977: checking for sys/shm.h" >&5
3966 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3967   echo $ac_n "(cached) $ac_c" 1>&6
3968 else
3969   cat > conftest.$ac_ext <<EOF
3970 #line 3982 "configure"
3971 #include "confdefs.h"
3972 #include <sys/shm.h>
3973 EOF
3974 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3975 { (eval echo configure:3987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3976 ac_err=`grep -v '^ *+' conftest.out`
3977 if test -z "$ac_err"; then
3978   rm -rf conftest*
3979   eval "ac_cv_header_$ac_safe=yes"
3980 else
3981   echo "$ac_err" >&5
3982   echo "configure: failed program was:" >&5
3983   cat conftest.$ac_ext >&5
3984   rm -rf conftest*
3985   eval "ac_cv_header_$ac_safe=no"
3986 fi
3987 rm -f conftest*
3988 fi
3989 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3990   echo "$ac_t""yes" 1>&6
3991   have_xshm=yes
3992 else
3993   echo "$ac_t""no" 1>&6
3994 fi
3995
3996   CPPFLAGS="$ac_save_CPPFLAGS"
3997   fi
3998
3999   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
4000   # to exist, but the library code to not exist.  And even better, the library
4001   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
4002   # lib doesn't exist, give up.
4003   #
4004   case "$host" in
4005     *-aix*)
4006       have_xshm=no
4007       
4008   ac_save_CPPFLAGS="$CPPFLAGS"
4009   ac_save_LDFLAGS="$LDFLAGS"
4010
4011   if test \! -z "$includedir" ; then 
4012     CPPFLAGS="$CPPFLAGS -I$includedir"
4013   fi
4014   # note: $X_CFLAGS includes $x_includes
4015   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4016
4017   if test \! -z "$libdir" ; then
4018     LDFLAGS="$LDFLAGS -L$libdir"
4019   fi
4020   # note: $X_LIBS includes $x_libraries
4021   LDFLAGS="$LDFLAGS $X_LIBS"
4022
4023   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
4024 echo "configure:4036: checking for XShmQueryExtension in -lXextSam" >&5
4025 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
4026 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4027   echo $ac_n "(cached) $ac_c" 1>&6
4028 else
4029   ac_save_LIBS="$LIBS"
4030 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
4031 cat > conftest.$ac_ext <<EOF
4032 #line 4044 "configure"
4033 #include "confdefs.h"
4034 /* Override any gcc2 internal prototype to avoid an error.  */
4035 /* We use char because int might match the return type of a gcc2
4036     builtin and then its argument prototype would still apply.  */
4037 char XShmQueryExtension();
4038
4039 int main() {
4040 XShmQueryExtension()
4041 ; return 0; }
4042 EOF
4043 if { (eval echo configure:4055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4044   rm -rf conftest*
4045   eval "ac_cv_lib_$ac_lib_var=yes"
4046 else
4047   echo "configure: failed program was:" >&5
4048   cat conftest.$ac_ext >&5
4049   rm -rf conftest*
4050   eval "ac_cv_lib_$ac_lib_var=no"
4051 fi
4052 rm -f conftest*
4053 LIBS="$ac_save_LIBS"
4054
4055 fi
4056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4057   echo "$ac_t""yes" 1>&6
4058   have_xshm=yes; SAVER_LIBS="$SAVER_LIBS -lXextSam"
4059 else
4060   echo "$ac_t""no" 1>&6
4061 fi
4062
4063   CPPFLAGS="$ac_save_CPPFLAGS"
4064   LDFLAGS="$ac_save_LDFLAGS"
4065     ;;
4066   esac
4067
4068   # if that succeeded, then we've really got it.
4069   if test "$have_xshm" = yes; then
4070     cat >> confdefs.h <<\EOF
4071 #define HAVE_XSHM_EXTENSION 1
4072 EOF
4073
4074   fi
4075
4076 elif test "$with_xshm" != no; then
4077   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
4078   exit 1
4079 fi
4080
4081
4082 # Check for the SGI-VIDEO-CONTROL server extension header.
4083 #
4084 have_sgivc=no
4085 with_sgivc_req=unspecified
4086 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
4087 if test "${with_sgivc_ext+set}" = set; then
4088   withval="$with_sgivc_ext"
4089   with_sgivc="$withval"; with_sgivc_req="$withval"
4090 else
4091   with_sgivc=yes
4092 fi
4093
4094
4095
4096    case "$with_sgivc" in
4097     yes) ;;
4098     no)  ;;
4099
4100     /*)
4101      echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
4102 echo "configure:4114: checking for SGI-VIDEO-CONTROL headers" >&5
4103      d=$with_sgivc/include
4104      if test -d $d; then
4105        X_CFLAGS="-I$d $X_CFLAGS"
4106        echo "$ac_t""$d" 1>&6
4107      else
4108        echo "$ac_t""not found ($d: no such directory)" 1>&6
4109      fi
4110
4111      echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
4112 echo "configure:4124: checking for SGI-VIDEO-CONTROL libs" >&5
4113      d=$with_sgivc/lib
4114      if test -d $d; then
4115        X_LIBS="-L$d $X_LIBS"
4116        echo "$ac_t""$d" 1>&6
4117      else
4118        echo "$ac_t""not found ($d: no such directory)" 1>&6
4119      fi
4120
4121      # replace the directory string with "yes".
4122      with_sgivc_req="yes"
4123      with_sgivc=$with_sgivc_req
4124      ;;
4125
4126     *)
4127      echo ""
4128      echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
4129      echo "       If it is a directory, then \`DIR/include' will be added to"
4130      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4131      exit 1
4132      ;;
4133    esac
4134
4135    # why is this necessary?
4136    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4137    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4138    withval=
4139   
4140
4141 if test "$with_sgivc" = yes; then
4142
4143   # first check for XSGIvc.h
4144   
4145   ac_save_CPPFLAGS="$CPPFLAGS"
4146   if test \! -z "$includedir" ; then 
4147     CPPFLAGS="$CPPFLAGS -I$includedir"
4148   fi
4149   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4150   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
4151 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
4152 echo "configure:4164: checking for X11/extensions/XSGIvc.h" >&5
4153 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4154   echo $ac_n "(cached) $ac_c" 1>&6
4155 else
4156   cat > conftest.$ac_ext <<EOF
4157 #line 4169 "configure"
4158 #include "confdefs.h"
4159 #include <X11/extensions/XSGIvc.h>
4160 EOF
4161 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4162 { (eval echo configure:4174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4163 ac_err=`grep -v '^ *+' conftest.out`
4164 if test -z "$ac_err"; then
4165   rm -rf conftest*
4166   eval "ac_cv_header_$ac_safe=yes"
4167 else
4168   echo "$ac_err" >&5
4169   echo "configure: failed program was:" >&5
4170   cat conftest.$ac_ext >&5
4171   rm -rf conftest*
4172   eval "ac_cv_header_$ac_safe=no"
4173 fi
4174 rm -f conftest*
4175 fi
4176 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4177   echo "$ac_t""yes" 1>&6
4178   have_sgivc=yes
4179 else
4180   echo "$ac_t""no" 1>&6
4181 fi
4182
4183   CPPFLAGS="$ac_save_CPPFLAGS"
4184
4185   # if that succeeded, then check for the -lXsgivc
4186   if test "$have_sgivc" = yes; then
4187     have_sgivc=no
4188     
4189   ac_save_CPPFLAGS="$CPPFLAGS"
4190   ac_save_LDFLAGS="$LDFLAGS"
4191
4192   if test \! -z "$includedir" ; then 
4193     CPPFLAGS="$CPPFLAGS -I$includedir"
4194   fi
4195   # note: $X_CFLAGS includes $x_includes
4196   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4197
4198   if test \! -z "$libdir" ; then
4199     LDFLAGS="$LDFLAGS -L$libdir"
4200   fi
4201   # note: $X_LIBS includes $x_libraries
4202   LDFLAGS="$LDFLAGS $X_LIBS"
4203
4204   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
4205 echo "configure:4217: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
4206 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
4207 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4208   echo $ac_n "(cached) $ac_c" 1>&6
4209 else
4210   ac_save_LIBS="$LIBS"
4211 LIBS="-lXsgivc -lXext -lX11 $LIBS"
4212 cat > conftest.$ac_ext <<EOF
4213 #line 4225 "configure"
4214 #include "confdefs.h"
4215 /* Override any gcc2 internal prototype to avoid an error.  */
4216 /* We use char because int might match the return type of a gcc2
4217     builtin and then its argument prototype would still apply.  */
4218 char XSGIvcQueryGammaMap();
4219
4220 int main() {
4221 XSGIvcQueryGammaMap()
4222 ; return 0; }
4223 EOF
4224 if { (eval echo configure:4236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4225   rm -rf conftest*
4226   eval "ac_cv_lib_$ac_lib_var=yes"
4227 else
4228   echo "configure: failed program was:" >&5
4229   cat conftest.$ac_ext >&5
4230   rm -rf conftest*
4231   eval "ac_cv_lib_$ac_lib_var=no"
4232 fi
4233 rm -f conftest*
4234 LIBS="$ac_save_LIBS"
4235
4236 fi
4237 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4238   echo "$ac_t""yes" 1>&6
4239   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
4240 else
4241   echo "$ac_t""no" 1>&6
4242 fi
4243
4244   CPPFLAGS="$ac_save_CPPFLAGS"
4245   LDFLAGS="$ac_save_LDFLAGS"
4246   fi
4247
4248   # if that succeeded, then we've really got it.
4249   if test "$have_sgivc" = yes; then
4250     cat >> confdefs.h <<\EOF
4251 #define HAVE_SGI_VC_EXTENSION 1
4252 EOF
4253
4254   fi
4255
4256 elif test "$with_sgivc" != no; then
4257   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
4258   exit 1
4259 fi
4260
4261
4262 # Check for the DPMS server extension header.
4263 #
4264 have_dpms=no
4265 with_dpms_req=unspecified
4266 # Check whether --with-dpms-ext or --without-dpms-ext was given.
4267 if test "${with_dpms_ext+set}" = set; then
4268   withval="$with_dpms_ext"
4269   with_dpms="$withval"; with_dpms_req="$withval"
4270 else
4271   with_dpms=yes
4272 fi
4273
4274
4275
4276    case "$with_dpms" in
4277     yes) ;;
4278     no)  ;;
4279
4280     /*)
4281      echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
4282 echo "configure:4294: checking for DPMS headers" >&5
4283      d=$with_dpms/include
4284      if test -d $d; then
4285        X_CFLAGS="-I$d $X_CFLAGS"
4286        echo "$ac_t""$d" 1>&6
4287      else
4288        echo "$ac_t""not found ($d: no such directory)" 1>&6
4289      fi
4290
4291      echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
4292 echo "configure:4304: checking for DPMS libs" >&5
4293      d=$with_dpms/lib
4294      if test -d $d; then
4295        X_LIBS="-L$d $X_LIBS"
4296        echo "$ac_t""$d" 1>&6
4297      else
4298        echo "$ac_t""not found ($d: no such directory)" 1>&6
4299      fi
4300
4301      # replace the directory string with "yes".
4302      with_dpms_req="yes"
4303      with_dpms=$with_dpms_req
4304      ;;
4305
4306     *)
4307      echo ""
4308      echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
4309      echo "       If it is a directory, then \`DIR/include' will be added to"
4310      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4311      exit 1
4312      ;;
4313    esac
4314
4315    # why is this necessary?
4316    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4317    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4318    withval=
4319   
4320
4321 if test "$with_dpms" = yes; then
4322
4323   # first check for dpms.h
4324   
4325   ac_save_CPPFLAGS="$CPPFLAGS"
4326   if test \! -z "$includedir" ; then 
4327     CPPFLAGS="$CPPFLAGS -I$includedir"
4328   fi
4329   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4330   ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
4331 echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
4332 echo "configure:4344: checking for X11/extensions/dpms.h" >&5
4333 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4334   echo $ac_n "(cached) $ac_c" 1>&6
4335 else
4336   cat > conftest.$ac_ext <<EOF
4337 #line 4349 "configure"
4338 #include "confdefs.h"
4339 #include <X11/extensions/dpms.h>
4340 EOF
4341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4342 { (eval echo configure:4354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4343 ac_err=`grep -v '^ *+' conftest.out`
4344 if test -z "$ac_err"; then
4345   rm -rf conftest*
4346   eval "ac_cv_header_$ac_safe=yes"
4347 else
4348   echo "$ac_err" >&5
4349   echo "configure: failed program was:" >&5
4350   cat conftest.$ac_ext >&5
4351   rm -rf conftest*
4352   eval "ac_cv_header_$ac_safe=no"
4353 fi
4354 rm -f conftest*
4355 fi
4356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4357   echo "$ac_t""yes" 1>&6
4358   have_dpms=yes
4359 else
4360   echo "$ac_t""no" 1>&6
4361 fi
4362
4363   CPPFLAGS="$ac_save_CPPFLAGS"
4364
4365   # if that succeeded, then check for the -lXdpms
4366   if test "$have_dpms" = yes; then
4367     have_dpms=no
4368     
4369   ac_save_CPPFLAGS="$CPPFLAGS"
4370   ac_save_LDFLAGS="$LDFLAGS"
4371
4372   if test \! -z "$includedir" ; then 
4373     CPPFLAGS="$CPPFLAGS -I$includedir"
4374   fi
4375   # note: $X_CFLAGS includes $x_includes
4376   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4377
4378   if test \! -z "$libdir" ; then
4379     LDFLAGS="$LDFLAGS -L$libdir"
4380   fi
4381   # note: $X_LIBS includes $x_libraries
4382   LDFLAGS="$LDFLAGS $X_LIBS"
4383
4384   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
4385 echo "configure:4397: checking for DPMSInfo in -lXdpms" >&5
4386 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
4387 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4388   echo $ac_n "(cached) $ac_c" 1>&6
4389 else
4390   ac_save_LIBS="$LIBS"
4391 LIBS="-lXdpms -lXext -lX11 $LIBS"
4392 cat > conftest.$ac_ext <<EOF
4393 #line 4405 "configure"
4394 #include "confdefs.h"
4395 /* Override any gcc2 internal prototype to avoid an error.  */
4396 /* We use char because int might match the return type of a gcc2
4397     builtin and then its argument prototype would still apply.  */
4398 char DPMSInfo();
4399
4400 int main() {
4401 DPMSInfo()
4402 ; return 0; }
4403 EOF
4404 if { (eval echo configure:4416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4405   rm -rf conftest*
4406   eval "ac_cv_lib_$ac_lib_var=yes"
4407 else
4408   echo "configure: failed program was:" >&5
4409   cat conftest.$ac_ext >&5
4410   rm -rf conftest*
4411   eval "ac_cv_lib_$ac_lib_var=no"
4412 fi
4413 rm -f conftest*
4414 LIBS="$ac_save_LIBS"
4415
4416 fi
4417 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4418   echo "$ac_t""yes" 1>&6
4419   have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"
4420 else
4421   echo "$ac_t""no" 1>&6
4422 fi
4423
4424   CPPFLAGS="$ac_save_CPPFLAGS"
4425   LDFLAGS="$ac_save_LDFLAGS"
4426   fi
4427
4428   # if that succeeded, then we've really got it.
4429   if test "$have_dpms" = yes; then
4430     cat >> confdefs.h <<\EOF
4431 #define HAVE_DPMS_EXTENSION 1
4432 EOF
4433
4434   fi
4435
4436 elif test "$with_dpms" != no; then
4437   echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
4438   exit 1
4439 fi
4440
4441
4442
4443 # Check for Motif and Athena --with and --without arguments.
4444 #
4445 have_motif=no
4446 have_athena=no
4447 have_athena3d=no
4448 with_motif_req=unspecified
4449 with_athena_req=unspecified
4450
4451 # Check whether --with-motif or --without-motif was given.
4452 if test "${with_motif+set}" = set; then
4453   withval="$with_motif"
4454   with_motif="$withval"; with_motif_req="$withval"
4455 else
4456   with_motif=no
4457 fi
4458
4459
4460
4461    case "$with_motif" in
4462     yes) ;;
4463     no)  ;;
4464
4465     /*)
4466      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
4467 echo "configure:4479: checking for Motif headers" >&5
4468      d=$with_motif/include
4469      if test -d $d; then
4470        X_CFLAGS="-I$d $X_CFLAGS"
4471        echo "$ac_t""$d" 1>&6
4472      else
4473        echo "$ac_t""not found ($d: no such directory)" 1>&6
4474      fi
4475
4476      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
4477 echo "configure:4489: checking for Motif libs" >&5
4478      d=$with_motif/lib
4479      if test -d $d; then
4480        X_LIBS="-L$d $X_LIBS"
4481        echo "$ac_t""$d" 1>&6
4482      else
4483        echo "$ac_t""not found ($d: no such directory)" 1>&6
4484      fi
4485
4486      # replace the directory string with "yes".
4487      with_motif_req="yes"
4488      with_motif=$with_motif_req
4489      ;;
4490
4491     *)
4492      echo ""
4493      echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory."
4494      echo "       If it is a directory, then \`DIR/include' will be added to"
4495      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4496      exit 1
4497      ;;
4498    esac
4499
4500    # why is this necessary?
4501    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4502    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4503    withval=
4504   
4505
4506 # Check whether --with-athena or --without-athena was given.
4507 if test "${with_athena+set}" = set; then
4508   withval="$with_athena"
4509   with_athena="$withval"; with_athena_req="$withval"
4510 else
4511   with_athena=no
4512 fi
4513
4514
4515
4516    case "$with_athena" in
4517     yes) ;;
4518     no)  ;;
4519
4520     /*)
4521      echo $ac_n "checking for Athena headers""... $ac_c" 1>&6
4522 echo "configure:4534: checking for Athena headers" >&5
4523      d=$with_athena/include
4524      if test -d $d; then
4525        X_CFLAGS="-I$d $X_CFLAGS"
4526        echo "$ac_t""$d" 1>&6
4527      else
4528        echo "$ac_t""not found ($d: no such directory)" 1>&6
4529      fi
4530
4531      echo $ac_n "checking for Athena libs""... $ac_c" 1>&6
4532 echo "configure:4544: checking for Athena libs" >&5
4533      d=$with_athena/lib
4534      if test -d $d; then
4535        X_LIBS="-L$d $X_LIBS"
4536        echo "$ac_t""$d" 1>&6
4537      else
4538        echo "$ac_t""not found ($d: no such directory)" 1>&6
4539      fi
4540
4541      # replace the directory string with "yes".
4542      with_athena_req="yes"
4543      with_athena=$with_athena_req
4544      ;;
4545
4546     *)
4547      echo ""
4548      echo "error: argument to --with-athena must be \"yes\", \"no\", or a directory."
4549      echo "       If it is a directory, then \`DIR/include' will be added to"
4550      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4551      exit 1
4552      ;;
4553    esac
4554
4555    # why is this necessary?
4556    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
4557    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
4558    withval=
4559   
4560
4561 if test "$with_motif" != yes -a "$with_motif" != no ; then
4562   echo "error: must be yes or no: --with-motif=$with_motif"
4563   exit 1
4564 fi
4565
4566 if test "$with_athena" != yes -a "$with_athena" != no ; then
4567   echo "error: must be yes or no: --with-athena=$with_athena"
4568   exit 1
4569 fi
4570
4571
4572 # Saying --without-motif is the same as saying --with-athena.
4573 if test "$with_motif_req" = no ; then
4574   with_athena_req=yes
4575   with_athena=yes
4576 fi
4577
4578 # Saying --without-athena is the same as saying --with-motif.
4579 if test "$with_athena_req" = no ; then
4580   with_motif_req=yes
4581   with_motif=yes
4582 fi
4583
4584 # Check for Motif and Athena headers.
4585
4586 check_motif() {
4587   
4588   ac_save_CPPFLAGS="$CPPFLAGS"
4589   if test \! -z "$includedir" ; then 
4590     CPPFLAGS="$CPPFLAGS -I$includedir"
4591   fi
4592   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4593   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
4594 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
4595 echo "configure:4607: checking for Xm/Xm.h" >&5
4596 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4597   echo $ac_n "(cached) $ac_c" 1>&6
4598 else
4599   cat > conftest.$ac_ext <<EOF
4600 #line 4612 "configure"
4601 #include "confdefs.h"
4602 #include <Xm/Xm.h>
4603 EOF
4604 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4605 { (eval echo configure:4617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4606 ac_err=`grep -v '^ *+' conftest.out`
4607 if test -z "$ac_err"; then
4608   rm -rf conftest*
4609   eval "ac_cv_header_$ac_safe=yes"
4610 else
4611   echo "$ac_err" >&5
4612   echo "configure: failed program was:" >&5
4613   cat conftest.$ac_ext >&5
4614   rm -rf conftest*
4615   eval "ac_cv_header_$ac_safe=no"
4616 fi
4617 rm -f conftest*
4618 fi
4619 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4620   echo "$ac_t""yes" 1>&6
4621   have_motif=yes
4622                      cat >> confdefs.h <<\EOF
4623 #define HAVE_MOTIF 1
4624 EOF
4625
4626                      TOOLKIT_LIBS="-lXm $TOOLKIT_LIBS"
4627 else
4628   echo "$ac_t""no" 1>&6
4629 fi
4630
4631   CPPFLAGS="$ac_save_CPPFLAGS"
4632 }
4633
4634 check_athena() {
4635   have_athena=no
4636   have_athena3d=no
4637   
4638   ac_save_CPPFLAGS="$CPPFLAGS"
4639   if test \! -z "$includedir" ; then 
4640     CPPFLAGS="$CPPFLAGS -I$includedir"
4641   fi
4642   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4643   ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
4644 echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
4645 echo "configure:4657: checking for X11/Xaw/Dialog.h" >&5
4646 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4647   echo $ac_n "(cached) $ac_c" 1>&6
4648 else
4649   cat > conftest.$ac_ext <<EOF
4650 #line 4662 "configure"
4651 #include "confdefs.h"
4652 #include <X11/Xaw/Dialog.h>
4653 EOF
4654 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4655 { (eval echo configure:4667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4656 ac_err=`grep -v '^ *+' conftest.out`
4657 if test -z "$ac_err"; then
4658   rm -rf conftest*
4659   eval "ac_cv_header_$ac_safe=yes"
4660 else
4661   echo "$ac_err" >&5
4662   echo "configure: failed program was:" >&5
4663   cat conftest.$ac_ext >&5
4664   rm -rf conftest*
4665   eval "ac_cv_header_$ac_safe=no"
4666 fi
4667 rm -f conftest*
4668 fi
4669 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4670   echo "$ac_t""yes" 1>&6
4671   have_athena=yes
4672 else
4673   echo "$ac_t""no" 1>&6
4674 fi
4675
4676   CPPFLAGS="$ac_save_CPPFLAGS"
4677   if test "$have_athena" = yes; then
4678     
4679   ac_save_CPPFLAGS="$CPPFLAGS"
4680   ac_save_LDFLAGS="$LDFLAGS"
4681
4682   if test \! -z "$includedir" ; then 
4683     CPPFLAGS="$CPPFLAGS -I$includedir"
4684   fi
4685   # note: $X_CFLAGS includes $x_includes
4686   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4687
4688   if test \! -z "$libdir" ; then
4689     LDFLAGS="$LDFLAGS -L$libdir"
4690   fi
4691   # note: $X_LIBS includes $x_libraries
4692   LDFLAGS="$LDFLAGS $X_LIBS"
4693
4694   echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
4695 echo "configure:4707: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
4696 ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
4697 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4698   echo $ac_n "(cached) $ac_c" 1>&6
4699 else
4700   ac_save_LIBS="$LIBS"
4701 LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS"
4702 cat > conftest.$ac_ext <<EOF
4703 #line 4715 "configure"
4704 #include "confdefs.h"
4705 /* Override any gcc2 internal prototype to avoid an error.  */
4706 /* We use char because int might match the return type of a gcc2
4707     builtin and then its argument prototype would still apply.  */
4708 char Xaw3dComputeTopShadowRGB();
4709
4710 int main() {
4711 Xaw3dComputeTopShadowRGB()
4712 ; return 0; }
4713 EOF
4714 if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4715   rm -rf conftest*
4716   eval "ac_cv_lib_$ac_lib_var=yes"
4717 else
4718   echo "configure: failed program was:" >&5
4719   cat conftest.$ac_ext >&5
4720   rm -rf conftest*
4721   eval "ac_cv_lib_$ac_lib_var=no"
4722 fi
4723 rm -f conftest*
4724 LIBS="$ac_save_LIBS"
4725
4726 fi
4727 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4728   echo "$ac_t""yes" 1>&6
4729   have_athena=yes; have_athena3d=yes
4730 else
4731   echo "$ac_t""no" 1>&6
4732 fi
4733
4734   CPPFLAGS="$ac_save_CPPFLAGS"
4735   LDFLAGS="$ac_save_LDFLAGS"
4736   fi
4737
4738   if test "$have_athena3d" = yes; then
4739     TOOLKIT_LIBS="-lXaw3d $TOOLKIT_LIBS"
4740   elif test "$have_athena" = yes; then
4741     TOOLKIT_LIBS="-lXaw $TOOLKIT_LIBS"
4742   fi
4743 }
4744
4745
4746 # If they asked for both motif and athena, check motif then athena.
4747 # If they asked for only motif, check motif then athena.
4748 # If they asked for only athena, check athena then motif.
4749 # If they asked for neither, check motif then athena.
4750
4751 proselytize_motif=yes
4752 if test "$with_motif" = yes; then
4753   # asked for both, or for motif only
4754   check_motif
4755   if test "$have_motif" = yes; then
4756     with_athena=no
4757     with_athena_req=no
4758   else
4759     check_athena
4760   fi
4761
4762 elif test "$with_athena" = yes; then
4763   # asked for athena only
4764   check_athena
4765   if test "$have_athena" = yes; then
4766     with_motif=no
4767     proselytize_motif=no
4768   else
4769     check_motif
4770   fi
4771
4772 else
4773   # asked for neither
4774   check_motif
4775   if test "$have_motif" = yes; then
4776     with_athena=no
4777   else
4778     check_athena
4779   fi
4780
4781 fi
4782
4783 if test "$have_motif" = yes; then
4784   proselytize_motif=no
4785 fi
4786
4787 # If we have Athena, check whether it's a version that includes
4788 # XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
4789 if test "$have_athena" = yes ; then
4790   echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
4791 echo "configure:4803: checking for XawViewportSetCoordinates in Viewport.h" >&5
4792 if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
4793   echo $ac_n "(cached) $ac_c" 1>&6
4794 else
4795   ac_cv_have_XawViewportSetCoordinates=no
4796                   
4797   ac_save_CPPFLAGS="$CPPFLAGS"
4798   if test \! -z "$includedir" ; then 
4799     CPPFLAGS="$CPPFLAGS -I$includedir"
4800   fi
4801   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4802   cat > conftest.$ac_ext <<EOF
4803 #line 4815 "configure"
4804 #include "confdefs.h"
4805 #include <X11/Xaw/Viewport.h>
4806 EOF
4807 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4808   egrep "XawViewportSetCoordinates" >/dev/null 2>&1; then
4809   rm -rf conftest*
4810   ac_cv_have_XawViewportSetCoordinates=yes
4811 fi
4812 rm -f conftest*
4813
4814   CPPFLAGS="$ac_save_CPPFLAGS"
4815 fi
4816
4817 echo "$ac_t""$ac_cv_have_XawViewportSetCoordinates" 1>&6
4818   if test "$ac_cv_have_XawViewportSetCoordinates" = yes ; then
4819     cat >> confdefs.h <<\EOF
4820 #define HAVE_XawViewportSetCoordinates 1
4821 EOF
4822
4823   fi
4824 fi
4825
4826
4827 # If we have Motif, check whether it's really LessTif.
4828 #
4829 have_lesstif=no
4830 if test "$have_motif" = yes ; then
4831   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
4832 echo "configure:4844: checking whether Motif is really LessTif" >&5
4833 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
4834   echo $ac_n "(cached) $ac_c" 1>&6
4835 else
4836   
4837   ac_save_CPPFLAGS="$CPPFLAGS"
4838   if test \! -z "$includedir" ; then 
4839     CPPFLAGS="$CPPFLAGS -I$includedir"
4840   fi
4841   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4842   cat > conftest.$ac_ext <<EOF
4843 #line 4855 "configure"
4844 #include "confdefs.h"
4845 #include <Xm/Xm.h>
4846 int main() {
4847 long vers = LesstifVersion;
4848 ; return 0; }
4849 EOF
4850 if { (eval echo configure:4862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4851   rm -rf conftest*
4852   ac_cv_have_lesstif=yes
4853 else
4854   echo "configure: failed program was:" >&5
4855   cat conftest.$ac_ext >&5
4856   rm -rf conftest*
4857   ac_cv_have_lesstif=no
4858 fi
4859 rm -f conftest*
4860   CPPFLAGS="$ac_save_CPPFLAGS"
4861 fi
4862
4863 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
4864   have_lesstif=$ac_cv_have_lesstif
4865 fi
4866
4867 # don't cache these
4868 unset ac_cv_lesstif_version
4869 unset ac_cv_lesstif_version_string
4870
4871 lesstif_version=unknown
4872 lesstif_version_string=unknown
4873
4874 if test "$have_lesstif" = yes ; then
4875   ltv=unknown
4876   echo unknown > conftest-lt
4877   echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
4878 echo "configure:4890: checking LessTif version number" >&5
4879 if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
4880   echo $ac_n "(cached) $ac_c" 1>&6
4881 else
4882   
4883   ac_save_CPPFLAGS="$CPPFLAGS"
4884   if test \! -z "$includedir" ; then 
4885     CPPFLAGS="$CPPFLAGS -I$includedir"
4886   fi
4887   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4888   if test "$cross_compiling" = yes; then
4889   ac_cv_lesstif_version=unknown
4890                      ac_cv_lesstif_version_string=unknown
4891 else
4892   cat > conftest.$ac_ext <<EOF
4893 #line 4905 "configure"
4894 #include "confdefs.h"
4895 #include <stdio.h>
4896                      #include <Xm/Xm.h>
4897                      int main() {
4898                        FILE *f = fopen("conftest-lt", "w");
4899                        if (!f) exit(1);
4900                        fprintf(f, "%d %d.%d\n", LesstifVersion,
4901                           LESSTIF_VERSION, LESSTIF_REVISION);
4902                        fclose(f);
4903                        exit(0);
4904                      }
4905 EOF
4906 if { (eval echo configure:4918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
4907 then
4908   ltv=`cat conftest-lt`
4909                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
4910                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
4911 else
4912   echo "configure: failed program was:" >&5
4913   cat conftest.$ac_ext >&5
4914   rm -fr conftest*
4915   ac_cv_lesstif_version=unknown
4916                      ac_cv_lesstif_version_string=unknown
4917 fi
4918 rm -fr conftest*
4919 fi
4920
4921   CPPFLAGS="$ac_save_CPPFLAGS"
4922 fi
4923
4924 echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
4925   rm -f conftest-lt
4926   lesstif_version=$ac_cv_lesstif_version
4927   lesstif_version_string=$ac_cv_lesstif_version_string
4928
4929 fi
4930
4931
4932 # Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
4933 # Extension".   Why this extension isn't in -lXext with all the others,
4934 # I have no idea.
4935 #
4936 have_xp_ext=no
4937 if test "$have_motif" = yes ; then
4938    have_xp_ext=no
4939    
4940   ac_save_CPPFLAGS="$CPPFLAGS"
4941   ac_save_LDFLAGS="$LDFLAGS"
4942
4943   if test \! -z "$includedir" ; then 
4944     CPPFLAGS="$CPPFLAGS -I$includedir"
4945   fi
4946   # note: $X_CFLAGS includes $x_includes
4947   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4948
4949   if test \! -z "$libdir" ; then
4950     LDFLAGS="$LDFLAGS -L$libdir"
4951   fi
4952   # note: $X_LIBS includes $x_libraries
4953   LDFLAGS="$LDFLAGS $X_LIBS"
4954
4955   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
4956 echo "configure:4968: checking for XpQueryExtension in -lXp" >&5
4957 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
4958 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4959   echo $ac_n "(cached) $ac_c" 1>&6
4960 else
4961   ac_save_LIBS="$LIBS"
4962 LIBS="-lXp -lX11 -lXext -lm $LIBS"
4963 cat > conftest.$ac_ext <<EOF
4964 #line 4976 "configure"
4965 #include "confdefs.h"
4966 /* Override any gcc2 internal prototype to avoid an error.  */
4967 /* We use char because int might match the return type of a gcc2
4968     builtin and then its argument prototype would still apply.  */
4969 char XpQueryExtension();
4970
4971 int main() {
4972 XpQueryExtension()
4973 ; return 0; }
4974 EOF
4975 if { (eval echo configure:4987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4976   rm -rf conftest*
4977   eval "ac_cv_lib_$ac_lib_var=yes"
4978 else
4979   echo "configure: failed program was:" >&5
4980   cat conftest.$ac_ext >&5
4981   rm -rf conftest*
4982   eval "ac_cv_lib_$ac_lib_var=no"
4983 fi
4984 rm -f conftest*
4985 LIBS="$ac_save_LIBS"
4986
4987 fi
4988 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4989   echo "$ac_t""yes" 1>&6
4990   have_xp_ext=yes; TOOLKIT_LIBS="$TOOLKIT_LIBS -lXp"
4991 else
4992   echo "$ac_t""no" 1>&6
4993 fi
4994
4995   CPPFLAGS="$ac_save_CPPFLAGS"
4996   LDFLAGS="$ac_save_LDFLAGS"
4997 fi
4998
4999
5000 # check for XPM header.
5001 #
5002 have_xpm=no
5003 with_xpm_req=unspecified
5004 # Check whether --with-xpm or --without-xpm was given.
5005 if test "${with_xpm+set}" = set; then
5006   withval="$with_xpm"
5007   with_xpm="$withval"; with_xpm_req="$withval"
5008 else
5009   with_xpm=yes
5010 fi
5011
5012
5013
5014    case "$with_xpm" in
5015     yes) ;;
5016     no)  ;;
5017
5018     /*)
5019      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
5020 echo "configure:5032: checking for XPM headers" >&5
5021      d=$with_xpm/include
5022      if test -d $d; then
5023        X_CFLAGS="-I$d $X_CFLAGS"
5024        echo "$ac_t""$d" 1>&6
5025      else
5026        echo "$ac_t""not found ($d: no such directory)" 1>&6
5027      fi
5028
5029      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
5030 echo "configure:5042: checking for XPM libs" >&5
5031      d=$with_xpm/lib
5032      if test -d $d; then
5033        X_LIBS="-L$d $X_LIBS"
5034        echo "$ac_t""$d" 1>&6
5035      else
5036        echo "$ac_t""not found ($d: no such directory)" 1>&6
5037      fi
5038
5039      # replace the directory string with "yes".
5040      with_xpm_req="yes"
5041      with_xpm=$with_xpm_req
5042      ;;
5043
5044     *)
5045      echo ""
5046      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
5047      echo "       If it is a directory, then \`DIR/include' will be added to"
5048      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5049      exit 1
5050      ;;
5051    esac
5052
5053    # why is this necessary?
5054    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5055    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5056    withval=
5057   
5058
5059 if test "$with_xpm" = yes; then
5060   
5061   ac_save_CPPFLAGS="$CPPFLAGS"
5062   if test \! -z "$includedir" ; then 
5063     CPPFLAGS="$CPPFLAGS -I$includedir"
5064   fi
5065   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5066   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
5067 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
5068 echo "configure:5080: checking for X11/xpm.h" >&5
5069 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5070   echo $ac_n "(cached) $ac_c" 1>&6
5071 else
5072   cat > conftest.$ac_ext <<EOF
5073 #line 5085 "configure"
5074 #include "confdefs.h"
5075 #include <X11/xpm.h>
5076 EOF
5077 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5078 { (eval echo configure:5090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5079 ac_err=`grep -v '^ *+' conftest.out`
5080 if test -z "$ac_err"; then
5081   rm -rf conftest*
5082   eval "ac_cv_header_$ac_safe=yes"
5083 else
5084   echo "$ac_err" >&5
5085   echo "configure: failed program was:" >&5
5086   cat conftest.$ac_ext >&5
5087   rm -rf conftest*
5088   eval "ac_cv_header_$ac_safe=no"
5089 fi
5090 rm -f conftest*
5091 fi
5092 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5093   echo "$ac_t""yes" 1>&6
5094   have_xpm=yes
5095                     cat >> confdefs.h <<\EOF
5096 #define HAVE_XPM 1
5097 EOF
5098
5099                     XPM_LIBS="-lXpm"
5100 else
5101   echo "$ac_t""no" 1>&6
5102 fi
5103
5104   CPPFLAGS="$ac_save_CPPFLAGS"
5105 elif test "$with_xpm" != no; then
5106   echo "error: must be yes or no: --with-xpm=$with_xpm"
5107   exit 1
5108 fi
5109
5110
5111 # check for the GL header
5112 #
5113 have_gl=no
5114 ac_have_mesa_gl=no
5115 with_gl_req=unspecified
5116 # Check whether --with-gl or --without-gl was given.
5117 if test "${with_gl+set}" = set; then
5118   withval="$with_gl"
5119   with_gl="$withval"; with_gl_req="$withval"
5120 else
5121   with_gl=yes
5122 fi
5123
5124
5125
5126    case "$with_gl" in
5127     yes) ;;
5128     no)  ;;
5129
5130     /*)
5131      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
5132 echo "configure:5144: checking for GL headers" >&5
5133      d=$with_gl/include
5134      if test -d $d; then
5135        X_CFLAGS="-I$d $X_CFLAGS"
5136        echo "$ac_t""$d" 1>&6
5137      else
5138        echo "$ac_t""not found ($d: no such directory)" 1>&6
5139      fi
5140
5141      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
5142 echo "configure:5154: checking for GL libs" >&5
5143      d=$with_gl/lib
5144      if test -d $d; then
5145        X_LIBS="-L$d $X_LIBS"
5146        echo "$ac_t""$d" 1>&6
5147      else
5148        echo "$ac_t""not found ($d: no such directory)" 1>&6
5149      fi
5150
5151      # replace the directory string with "yes".
5152      with_gl_req="yes"
5153      with_gl=$with_gl_req
5154      ;;
5155
5156     *)
5157      echo ""
5158      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
5159      echo "       If it is a directory, then \`DIR/include' will be added to"
5160      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5161      exit 1
5162      ;;
5163    esac
5164
5165    # why is this necessary?
5166    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5167    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5168    withval=
5169   
5170
5171 ac_mesagl_version=unknown
5172 ac_mesagl_version_string=unknown
5173
5174 if test "$with_gl" = yes; then
5175   
5176   ac_save_CPPFLAGS="$CPPFLAGS"
5177   if test \! -z "$includedir" ; then 
5178     CPPFLAGS="$CPPFLAGS -I$includedir"
5179   fi
5180   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5181   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
5182 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
5183 echo "configure:5195: checking for GL/gl.h" >&5
5184 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5185   echo $ac_n "(cached) $ac_c" 1>&6
5186 else
5187   cat > conftest.$ac_ext <<EOF
5188 #line 5200 "configure"
5189 #include "confdefs.h"
5190 #include <GL/gl.h>
5191 EOF
5192 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5193 { (eval echo configure:5205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5194 ac_err=`grep -v '^ *+' conftest.out`
5195 if test -z "$ac_err"; then
5196   rm -rf conftest*
5197   eval "ac_cv_header_$ac_safe=yes"
5198 else
5199   echo "$ac_err" >&5
5200   echo "configure: failed program was:" >&5
5201   cat conftest.$ac_ext >&5
5202   rm -rf conftest*
5203   eval "ac_cv_header_$ac_safe=no"
5204 fi
5205 rm -f conftest*
5206 fi
5207 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5208   echo "$ac_t""yes" 1>&6
5209   have_gl=yes
5210 else
5211   echo "$ac_t""no" 1>&6
5212 fi
5213
5214   CPPFLAGS="$ac_save_CPPFLAGS"
5215   if test "$have_gl" = yes ; then
5216     
5217   ac_save_CPPFLAGS="$CPPFLAGS"
5218   if test \! -z "$includedir" ; then 
5219     CPPFLAGS="$CPPFLAGS -I$includedir"
5220   fi
5221   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5222   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
5223 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
5224 echo "configure:5236: checking for GL/glx.h" >&5
5225 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5226   echo $ac_n "(cached) $ac_c" 1>&6
5227 else
5228   cat > conftest.$ac_ext <<EOF
5229 #line 5241 "configure"
5230 #include "confdefs.h"
5231 #include <GL/glx.h>
5232 EOF
5233 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5234 { (eval echo configure:5246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5235 ac_err=`grep -v '^ *+' conftest.out`
5236 if test -z "$ac_err"; then
5237   rm -rf conftest*
5238   eval "ac_cv_header_$ac_safe=yes"
5239 else
5240   echo "$ac_err" >&5
5241   echo "configure: failed program was:" >&5
5242   cat conftest.$ac_ext >&5
5243   rm -rf conftest*
5244   eval "ac_cv_header_$ac_safe=no"
5245 fi
5246 rm -f conftest*
5247 fi
5248 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5249   echo "$ac_t""yes" 1>&6
5250   have_gl=yes
5251 else
5252   echo "$ac_t""no" 1>&6
5253 fi
5254
5255   CPPFLAGS="$ac_save_CPPFLAGS"
5256   fi
5257
5258   # If we have the headers, try and figure out which vendor it's from.
5259   #
5260   if test "$have_gl" = yes ; then
5261
5262     cat >> confdefs.h <<\EOF
5263 #define HAVE_GL 1
5264 EOF
5265
5266
5267     # We need to know whether it's MesaGL so that we know which libraries
5268     # to link against.
5269     #
5270     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
5271 echo "configure:5283: checking whether GL is really MesaGL" >&5
5272     if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
5273   echo $ac_n "(cached) $ac_c" 1>&6
5274 else
5275   ac_cv_have_mesa_gl=no
5276        
5277   ac_save_CPPFLAGS="$CPPFLAGS"
5278   if test \! -z "$includedir" ; then 
5279     CPPFLAGS="$CPPFLAGS -I$includedir"
5280   fi
5281   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5282   cat > conftest.$ac_ext <<EOF
5283 #line 5295 "configure"
5284 #include "confdefs.h"
5285 #include <GL/glx.h>
5286 EOF
5287 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5288   egrep "Mesa" >/dev/null 2>&1; then
5289   rm -rf conftest*
5290   ac_cv_have_mesa_gl=yes
5291 fi
5292 rm -f conftest*
5293
5294   CPPFLAGS="$ac_save_CPPFLAGS"
5295       
5296 fi
5297
5298     ac_have_mesa_gl=$ac_cv_have_mesa_gl
5299     echo "$ac_t""$ac_have_mesa_gl" 1>&6
5300
5301     if test "$ac_have_mesa_gl" = no ; then
5302       gl_lib_1="GL"
5303       GL_LIBS="-lGL -lGLU"
5304     else
5305       cat >> confdefs.h <<\EOF
5306 #define HAVE_MESA_GL 1
5307 EOF
5308
5309       gl_lib_1="MesaGL"
5310       GL_LIBS="-lMesaGL -lMesaGLU"
5311     fi
5312
5313
5314     # If it's MesaGL, we'd like to issue a warning if the version number
5315     # is less than or equal to 2.6, because that version had a security bug.
5316     #
5317     if test "$ac_have_mesa_gl" = yes; then
5318
5319       # don't cache these.
5320       unset ac_cv_mesagl_version
5321       unset ac_cv_mesagl_version_string
5322
5323       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
5324 echo "configure:5336: checking MesaGL version number" >&5
5325       if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
5326   echo $ac_n "(cached) $ac_c" 1>&6
5327 else
5328   cat > conftest.$ac_ext <<EOF
5329 #line 5341 "configure"
5330 #include "confdefs.h"
5331 #include <GL/gl.h>
5332 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
5333 EOF
5334
5335          ac_save_CPPFLAGS="$CPPFLAGS"
5336          if test \! -z "$includedir" ; then 
5337            CPPFLAGS="$CPPFLAGS -I$includedir"
5338          fi
5339          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5340
5341           # M4 sucks!!
5342          
5343          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
5344               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
5345          
5346
5347          rm -f conftest.$ac_ext
5348
5349          CPPFLAGS="$ac_save_CPPFLAGS"
5350
5351          if test "$mglv" = ""; then
5352            ac_mesagl_version=unknown
5353            ac_mesagl_version_string=unknown
5354          else
5355            ac_mesagl_version_string=$mglv
5356            maj=`echo $mglv | sed -n 's/\..*//p'`
5357            min=`echo $mglv | sed -n 's/.*\.//p'`
5358            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
5359            if test -z "$ac_mesagl_version"; then
5360              ac_mesagl_version=unknown
5361              ac_mesagl_version_string=unknown
5362            fi
5363          fi
5364          ac_cv_mesagl_version=$ac_mesagl_version
5365          ac_cv_mesagl_version_string=$ac_mesagl_version_string
5366       
5367 fi
5368
5369       ac_mesagl_version=$ac_cv_mesagl_version
5370       ac_mesagl_version_string=$ac_cv_mesagl_version_string
5371       echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
5372     fi
5373
5374
5375     # Check for OpenGL 1.1 features.
5376     #
5377     
5378   ac_save_CPPFLAGS="$CPPFLAGS"
5379   ac_save_LDFLAGS="$LDFLAGS"
5380
5381   if test \! -z "$includedir" ; then 
5382     CPPFLAGS="$CPPFLAGS -I$includedir"
5383   fi
5384   # note: $X_CFLAGS includes $x_includes
5385   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5386
5387   if test \! -z "$libdir" ; then
5388     LDFLAGS="$LDFLAGS -L$libdir"
5389   fi
5390   # note: $X_LIBS includes $x_libraries
5391   LDFLAGS="$LDFLAGS $X_LIBS"
5392
5393   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
5394 echo "configure:5406: checking for glBindTexture in -l$gl_lib_1" >&5
5395 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
5396 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5397   echo $ac_n "(cached) $ac_c" 1>&6
5398 else
5399   ac_save_LIBS="$LIBS"
5400 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
5401 cat > conftest.$ac_ext <<EOF
5402 #line 5414 "configure"
5403 #include "confdefs.h"
5404 /* Override any gcc2 internal prototype to avoid an error.  */
5405 /* We use char because int might match the return type of a gcc2
5406     builtin and then its argument prototype would still apply.  */
5407 char glBindTexture();
5408
5409 int main() {
5410 glBindTexture()
5411 ; return 0; }
5412 EOF
5413 if { (eval echo configure:5425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5414   rm -rf conftest*
5415   eval "ac_cv_lib_$ac_lib_var=yes"
5416 else
5417   echo "configure: failed program was:" >&5
5418   cat conftest.$ac_ext >&5
5419   rm -rf conftest*
5420   eval "ac_cv_lib_$ac_lib_var=no"
5421 fi
5422 rm -f conftest*
5423 LIBS="$ac_save_LIBS"
5424
5425 fi
5426 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5427   echo "$ac_t""yes" 1>&6
5428   cat >> confdefs.h <<\EOF
5429 #define HAVE_GLBINDTEXTURE 1
5430 EOF
5431
5432 else
5433   echo "$ac_t""no" 1>&6
5434 fi
5435
5436   CPPFLAGS="$ac_save_CPPFLAGS"
5437   LDFLAGS="$ac_save_LDFLAGS"
5438
5439   fi
5440
5441 elif test "$with_gl" != no; then
5442   echo "error: must be yes or no: --with-gl=$with_gl"
5443   exit 1
5444 fi
5445
5446
5447 # check for SGI XReadDisplay server extension header.
5448 #
5449 have_readdisplay=no
5450 with_readdisplay_req=unspecified
5451 # Check whether --with-readdisplay or --without-readdisplay was given.
5452 if test "${with_readdisplay+set}" = set; then
5453   withval="$with_readdisplay"
5454   with_readdisplay="$withval"; with_readdisplay_req="$withval"
5455 else
5456   with_readdisplay=yes
5457 fi
5458
5459
5460
5461    case "$with_readdisplay" in
5462     yes) ;;
5463     no)  ;;
5464
5465     /*)
5466      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
5467 echo "configure:5479: checking for XReadDisplay headers" >&5
5468      d=$with_readdisplay/include
5469      if test -d $d; then
5470        X_CFLAGS="-I$d $X_CFLAGS"
5471        echo "$ac_t""$d" 1>&6
5472      else
5473        echo "$ac_t""not found ($d: no such directory)" 1>&6
5474      fi
5475
5476      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
5477 echo "configure:5489: checking for XReadDisplay libs" >&5
5478      d=$with_readdisplay/lib
5479      if test -d $d; then
5480        X_LIBS="-L$d $X_LIBS"
5481        echo "$ac_t""$d" 1>&6
5482      else
5483        echo "$ac_t""not found ($d: no such directory)" 1>&6
5484      fi
5485
5486      # replace the directory string with "yes".
5487      with_readdisplay_req="yes"
5488      with_readdisplay=$with_readdisplay_req
5489      ;;
5490
5491     *)
5492      echo ""
5493      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
5494      echo "       If it is a directory, then \`DIR/include' will be added to"
5495      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5496      exit 1
5497      ;;
5498    esac
5499
5500    # why is this necessary?
5501    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5502    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5503    withval=
5504   
5505
5506 if test "$with_readdisplay" = yes; then
5507   
5508   ac_save_CPPFLAGS="$CPPFLAGS"
5509   if test \! -z "$includedir" ; then 
5510     CPPFLAGS="$CPPFLAGS -I$includedir"
5511   fi
5512   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5513   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
5514 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
5515 echo "configure:5527: checking for X11/extensions/readdisplay.h" >&5
5516 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5517   echo $ac_n "(cached) $ac_c" 1>&6
5518 else
5519   cat > conftest.$ac_ext <<EOF
5520 #line 5532 "configure"
5521 #include "confdefs.h"
5522 #include <X11/extensions/readdisplay.h>
5523 EOF
5524 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5525 { (eval echo configure:5537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5526 ac_err=`grep -v '^ *+' conftest.out`
5527 if test -z "$ac_err"; then
5528   rm -rf conftest*
5529   eval "ac_cv_header_$ac_safe=yes"
5530 else
5531   echo "$ac_err" >&5
5532   echo "configure: failed program was:" >&5
5533   cat conftest.$ac_ext >&5
5534   rm -rf conftest*
5535   eval "ac_cv_header_$ac_safe=no"
5536 fi
5537 rm -f conftest*
5538 fi
5539 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5540   echo "$ac_t""yes" 1>&6
5541   cat >> confdefs.h <<\EOF
5542 #define HAVE_READ_DISPLAY_EXTENSION 1
5543 EOF
5544
5545 else
5546   echo "$ac_t""no" 1>&6
5547 fi
5548
5549   CPPFLAGS="$ac_save_CPPFLAGS"
5550 elif test "$with_readdisplay" != no; then
5551   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
5552   exit 1
5553 fi
5554
5555
5556 # check for SGI's Iris Video Library header.
5557 #
5558 have_sgivideo=no
5559 with_sgivideo_req=unspecified
5560 # Check whether --with-sgivideo or --without-sgivideo was given.
5561 if test "${with_sgivideo+set}" = set; then
5562   withval="$with_sgivideo"
5563   with_sgivideo="$withval"; with_sgivideo_req="$withval"
5564 else
5565   with_sgivideo=yes
5566 fi
5567
5568
5569
5570    case "$with_sgivideo" in
5571     yes) ;;
5572     no)  ;;
5573
5574     /*)
5575      echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
5576 echo "configure:5588: checking for Iris Video headers" >&5
5577      d=$with_sgivideo/include
5578      if test -d $d; then
5579        X_CFLAGS="-I$d $X_CFLAGS"
5580        echo "$ac_t""$d" 1>&6
5581      else
5582        echo "$ac_t""not found ($d: no such directory)" 1>&6
5583      fi
5584
5585      echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
5586 echo "configure:5598: checking for Iris Video libs" >&5
5587      d=$with_sgivideo/lib
5588      if test -d $d; then
5589        X_LIBS="-L$d $X_LIBS"
5590        echo "$ac_t""$d" 1>&6
5591      else
5592        echo "$ac_t""not found ($d: no such directory)" 1>&6
5593      fi
5594
5595      # replace the directory string with "yes".
5596      with_sgivideo_req="yes"
5597      with_sgivideo=$with_sgivideo_req
5598      ;;
5599
5600     *)
5601      echo ""
5602      echo "error: argument to --with-sgivideo must be \"yes\", \"no\", or a directory."
5603      echo "       If it is a directory, then \`DIR/include' will be added to"
5604      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5605      exit 1
5606      ;;
5607    esac
5608
5609    # why is this necessary?
5610    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
5611    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
5612    withval=
5613   
5614
5615 if test "$with_sgivideo" = yes; then
5616   
5617   ac_save_CPPFLAGS="$CPPFLAGS"
5618   if test \! -z "$includedir" ; then 
5619     CPPFLAGS="$CPPFLAGS -I$includedir"
5620   fi
5621   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5622   ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
5623 echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
5624 echo "configure:5636: checking for dmedia/vl.h" >&5
5625 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5626   echo $ac_n "(cached) $ac_c" 1>&6
5627 else
5628   cat > conftest.$ac_ext <<EOF
5629 #line 5641 "configure"
5630 #include "confdefs.h"
5631 #include <dmedia/vl.h>
5632 EOF
5633 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5634 { (eval echo configure:5646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5635 ac_err=`grep -v '^ *+' conftest.out`
5636 if test -z "$ac_err"; then
5637   rm -rf conftest*
5638   eval "ac_cv_header_$ac_safe=yes"
5639 else
5640   echo "$ac_err" >&5
5641   echo "configure: failed program was:" >&5
5642   cat conftest.$ac_ext >&5
5643   rm -rf conftest*
5644   eval "ac_cv_header_$ac_safe=no"
5645 fi
5646 rm -f conftest*
5647 fi
5648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5649   echo "$ac_t""yes" 1>&6
5650   have_sgivideo=yes
5651 else
5652   echo "$ac_t""no" 1>&6
5653 fi
5654
5655   CPPFLAGS="$ac_save_CPPFLAGS"
5656   if test "$have_sgivideo" = yes; then
5657     have_sgivideo=no
5658     echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
5659 echo "configure:5671: checking for vlOpenVideo in -lvl" >&5
5660 ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
5661 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5662   echo $ac_n "(cached) $ac_c" 1>&6
5663 else
5664   ac_save_LIBS="$LIBS"
5665 LIBS="-lvl  $LIBS"
5666 cat > conftest.$ac_ext <<EOF
5667 #line 5679 "configure"
5668 #include "confdefs.h"
5669 /* Override any gcc2 internal prototype to avoid an error.  */
5670 /* We use char because int might match the return type of a gcc2
5671     builtin and then its argument prototype would still apply.  */
5672 char vlOpenVideo();
5673
5674 int main() {
5675 vlOpenVideo()
5676 ; return 0; }
5677 EOF
5678 if { (eval echo configure:5690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5679   rm -rf conftest*
5680   eval "ac_cv_lib_$ac_lib_var=yes"
5681 else
5682   echo "configure: failed program was:" >&5
5683   cat conftest.$ac_ext >&5
5684   rm -rf conftest*
5685   eval "ac_cv_lib_$ac_lib_var=no"
5686 fi
5687 rm -f conftest*
5688 LIBS="$ac_save_LIBS"
5689
5690 fi
5691 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5692   echo "$ac_t""yes" 1>&6
5693   have_sgivideo=yes
5694 else
5695   echo "$ac_t""no" 1>&6
5696 fi
5697
5698     if test "$have_sgivideo" = yes; then
5699       SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
5700       SGI_VIDEO_LIBS="-lvl"
5701       cat >> confdefs.h <<\EOF
5702 #define HAVE_SGI_VIDEO 1
5703 EOF
5704
5705     fi
5706   fi
5707 elif test "$with_sgivideo" != no; then
5708   echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
5709   exit 1
5710 fi
5711
5712
5713
5714 # Try to find a program to generate random text.
5715 #
5716 # Zippy is funnier than the idiocy generally spat out by `fortune',
5717 # so try to find that, by invoking Emacs and asking it where its 
5718 # libexec directory is ("yow" lives in there.)
5719 #
5720 # If that doesn't work, see if fortune, zippy, or yow are on $PATH,
5721 # and if so, use them.
5722 #
5723 # If that doesn't work, look in /usr/games, and if it's there, use
5724 # the full pathname.
5725 #
5726 with_zippy_req=""
5727 # Check whether --with-zippy or --without-zippy was given.
5728 if test "${with_zippy+set}" = set; then
5729   withval="$with_zippy"
5730    with_zippy_req="$withval"; with_zippy="$withval" 
5731 else
5732    with_zippy_req="$withval"; with_zippy="$withval" 
5733 fi
5734
5735
5736 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
5737   with_zippy=""
5738   with_zippy_req=""
5739 fi
5740
5741 if test -n "$with_zippy_req" ; then
5742   ac_cv_zippy_program=""
5743   case "$with_zippy_req" in
5744     /*)
5745       echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
5746 echo "configure:5758: checking for $with_zippy_req" >&5
5747       if test -x "$with_zippy_req" ; then
5748         echo "$ac_t""yes" 1>&6
5749       else
5750         echo "$ac_t""no" 1>&6
5751         with_zippy=""
5752       fi
5753     ;;
5754     *)
5755       # don't cache
5756       unset ac_cv_path_zip2
5757       # Extract the first word of "$with_zippy_req", so it can be a program name with args.
5758 set dummy $with_zippy_req; ac_word=$2
5759 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5760 echo "configure:5772: checking for $ac_word" >&5
5761 if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
5762   echo $ac_n "(cached) $ac_c" 1>&6
5763 else
5764   case "$zip2" in
5765   /*)
5766   ac_cv_path_zip2="$zip2" # Let the user override the test with a path.
5767   ;;
5768   *)
5769   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5770   for ac_dir in $PATH; do
5771     test -z "$ac_dir" && ac_dir=.
5772     if test -f $ac_dir/$ac_word; then
5773       ac_cv_path_zip2="$ac_dir/$ac_word"
5774       break
5775     fi
5776   done
5777   IFS="$ac_save_ifs"
5778   ;;
5779 esac
5780 fi
5781 zip2="$ac_cv_path_zip2"
5782 if test -n "$zip2"; then
5783   echo "$ac_t""$zip2" 1>&6
5784 else
5785   echo "$ac_t""no" 1>&6
5786 fi
5787
5788       if test "$zip2" = ""; then
5789         with_zippy=""
5790       fi
5791     ;;
5792   esac
5793   ac_cv_zippy_program="$with_zippy"
5794
5795 elif test -n "$ac_cv_zippy_program"; then
5796   echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
5797 fi
5798
5799 if test ! -n "$ac_cv_zippy_program"; then
5800
5801   for ac_prog in emacs
5802 do
5803 # Extract the first word of "$ac_prog", so it can be a program name with args.
5804 set dummy $ac_prog; ac_word=$2
5805 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5806 echo "configure:5818: checking for $ac_word" >&5
5807 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
5808   echo $ac_n "(cached) $ac_c" 1>&6
5809 else
5810   if test -n "$emacs_exe"; then
5811   ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
5812 else
5813   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5814   for ac_dir in $PATH; do
5815     test -z "$ac_dir" && ac_dir=.
5816     if test -f $ac_dir/$ac_word; then
5817       ac_cv_prog_emacs_exe="$ac_prog"
5818       break
5819     fi
5820   done
5821   IFS="$ac_save_ifs"
5822 fi
5823 fi
5824 emacs_exe="$ac_cv_prog_emacs_exe"
5825 if test -n "$emacs_exe"; then
5826   echo "$ac_t""$emacs_exe" 1>&6
5827 else
5828   echo "$ac_t""no" 1>&6
5829 fi
5830
5831 test -n "$emacs_exe" && break
5832 done
5833
5834   for ac_prog in xemacs
5835 do
5836 # Extract the first word of "$ac_prog", so it can be a program name with args.
5837 set dummy $ac_prog; ac_word=$2
5838 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5839 echo "configure:5851: checking for $ac_word" >&5
5840 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
5841   echo $ac_n "(cached) $ac_c" 1>&6
5842 else
5843   if test -n "$xemacs_exe"; then
5844   ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
5845 else
5846   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5847   for ac_dir in $PATH; do
5848     test -z "$ac_dir" && ac_dir=.
5849     if test -f $ac_dir/$ac_word; then
5850       ac_cv_prog_xemacs_exe="$ac_prog"
5851       break
5852     fi
5853   done
5854   IFS="$ac_save_ifs"
5855 fi
5856 fi
5857 xemacs_exe="$ac_cv_prog_xemacs_exe"
5858 if test -n "$xemacs_exe"; then
5859   echo "$ac_t""$xemacs_exe" 1>&6
5860 else
5861   echo "$ac_t""no" 1>&6
5862 fi
5863
5864 test -n "$xemacs_exe" && break
5865 done
5866
5867
5868   ac_cv_zippy_program=""
5869   eargs='-batch -q -nw --eval'
5870
5871   if test -n "$emacs_exe" ; then
5872     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
5873 echo "configure:5885: checking for emacs yow" >&5
5874     #
5875     # get emacs to tell us where the libexec directory is.
5876     #
5877     dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
5878          2>/dev/null | tail -1`
5879     dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
5880     #
5881     # try running libexec/yow and see if it exits without error.
5882     #
5883     if test x"$dir" != x -a -x "$dir/yow" ; then
5884       if $dir/yow >&- 2>&- ; then
5885         ac_cv_zippy_program="$dir/yow"
5886         echo "$ac_t""$ac_cv_zippy_program" 1>&6
5887       else
5888         echo "$ac_t""no" 1>&6
5889       fi
5890     fi
5891   fi
5892
5893   if test -z "$ac_cv_zippy_program" ; then
5894     echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
5895 echo "configure:5907: checking for xemacs yow" >&5
5896     if test -n "$xemacs_exe" ; then
5897       #
5898       # get xemacs to tell us where the libexec directory is.
5899       #
5900       dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
5901            2>/dev/null | tail -1`
5902       dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
5903       #
5904       # try running libexec/yow and see if it exits without error.
5905       #
5906       if test x"$dir" != x -a -x "$dir/yow" ; then
5907         if $dir/yow >&- 2>&- ; then
5908           ac_cv_zippy_program="$dir/yow"
5909           echo "$ac_t""$ac_cv_zippy_program" 1>&6
5910         else
5911           #
5912           # in some xemacs installations, the pathname of the yow.lines file
5913           # isn't hardcoded into the yow executable, and must be passed on 
5914           # the command line.  See if it's in libexec/../etc/.
5915
5916           # M4 sucks!!
5917           
5918           dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
5919           
5920
5921           yow="yow -f $dir_up/etc/yow.lines"
5922           if $dir/$yow >&- 2>&- ; then
5923             ac_cv_zippy_program="$dir/$yow"
5924             echo "$ac_t""$ac_cv_zippy_program" 1>&6
5925           else
5926             echo "$ac_t""no" 1>&6
5927           fi
5928         fi
5929       fi
5930     fi
5931   fi
5932
5933   # if that didn't work, try for some other programs...
5934   if test -z "$ac_cv_zippy_program" ; then
5935     fortune=''
5936     for ac_prog in fortune zippy yow
5937 do
5938 # Extract the first word of "$ac_prog", so it can be a program name with args.
5939 set dummy $ac_prog; ac_word=$2
5940 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5941 echo "configure:5953: checking for $ac_word" >&5
5942 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
5943   echo $ac_n "(cached) $ac_c" 1>&6
5944 else
5945   if test -n "$fortune"; then
5946   ac_cv_prog_fortune="$fortune" # Let the user override the test.
5947 else
5948   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5949   for ac_dir in $PATH; do
5950     test -z "$ac_dir" && ac_dir=.
5951     if test -f $ac_dir/$ac_word; then
5952       ac_cv_prog_fortune="$ac_prog"
5953       break
5954     fi
5955   done
5956   IFS="$ac_save_ifs"
5957 fi
5958 fi
5959 fortune="$ac_cv_prog_fortune"
5960 if test -n "$fortune"; then
5961   echo "$ac_t""$fortune" 1>&6
5962 else
5963   echo "$ac_t""no" 1>&6
5964 fi
5965
5966 test -n "$fortune" && break
5967 done
5968
5969     # if that didn't work, try for those programs in /usr/games...
5970     if test -z "$fortune" ; then
5971       for ac_prog in fortune zippy yow
5972 do
5973 # Extract the first word of "$ac_prog", so it can be a program name with args.
5974 set dummy $ac_prog; ac_word=$2
5975 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
5976 echo "configure:5988: checking for $ac_word" >&5
5977 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
5978   echo $ac_n "(cached) $ac_c" 1>&6
5979 else
5980   case "$fortune" in
5981   /*)
5982   ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
5983   ;;
5984   *)
5985   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5986   for ac_dir in /usr/games:/usr/local/games$ac_dummy; do
5987     test -z "$ac_dir" && ac_dir=.
5988     if test -f $ac_dir/$ac_word; then
5989       ac_cv_path_fortune="$ac_dir/$ac_word"
5990       break
5991     fi
5992   done
5993   IFS="$ac_save_ifs"
5994   ;;
5995 esac
5996 fi
5997 fortune="$ac_cv_path_fortune"
5998 if test -n "$fortune"; then
5999   echo "$ac_t""$fortune" 1>&6
6000 else
6001   echo "$ac_t""no" 1>&6
6002 fi
6003
6004 test -n "$fortune" && break
6005 done
6006 test -n "$fortune" || fortune="fortune"
6007
6008     fi
6009   fi
6010 fi
6011
6012 if test -z "$ac_cv_zippy_program" ; then
6013   ac_cv_zippy_program=fortune
6014 fi
6015
6016 cat >> confdefs.h <<EOF
6017 #define ZIPPY_PROGRAM "$ac_cv_zippy_program"
6018 EOF
6019
6020
6021
6022
6023
6024 # Allow locking to be disabled at compile-time.
6025 #
6026 have_kerberos=no
6027 with_kerberos_req=unspecified
6028 have_shadow=no
6029 with_shadow_req=unspecified
6030 have_pam=no
6031 with_pam_req=unspecified
6032 need_setuid=no
6033
6034 # Check whether --enable-locking or --disable-locking was given.
6035 if test "${enable_locking+set}" = set; then
6036   enableval="$enable_locking"
6037   enable_locking="$enableval"
6038 else
6039   enable_locking=yes
6040 fi
6041
6042 if test "$enable_locking" = yes; then
6043   true
6044 elif test "$enable_locking" = no; then
6045   cat >> confdefs.h <<\EOF
6046 #define NO_LOCKING 1
6047 EOF
6048
6049 else
6050   echo "error: must be yes or no: --enable-locking=$enable_locking"
6051   exit 1
6052 fi
6053
6054
6055
6056 # Check to see if we can lock Virtual-Terminal switching, but allow that 
6057 # to be disabled at compile-time.
6058 #
6059 ac_vt_lockswitch=no
6060 # Check whether --enable-vt-locking or --disable-vt-locking was given.
6061 if test "${enable_vt_locking+set}" = set; then
6062   enableval="$enable_vt_locking"
6063   enable_vt_locking="$enableval"
6064 else
6065   enable_vt_locking=yes
6066 fi
6067
6068 if test "$enable_vt_locking" = yes; then
6069
6070   echo $ac_n "checking for the VT_LOCKSWITCH ioctl""... $ac_c" 1>&6
6071 echo "configure:6083: checking for the VT_LOCKSWITCH ioctl" >&5
6072   if eval "test \"`echo '$''{'ac_cv_vt_lockswitch'+set}'`\" = set"; then
6073   echo $ac_n "(cached) $ac_c" 1>&6
6074 else
6075   cat > conftest.$ac_ext <<EOF
6076 #line 6088 "configure"
6077 #include "confdefs.h"
6078 #include <fcntl.h>
6079                     #include <sys/ioctl.h>
6080                     #include <sys/vt.h>
6081 int main() {
6082 int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;
6083 ; return 0; }
6084 EOF
6085 if { (eval echo configure:6097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6086   rm -rf conftest*
6087   ac_cv_vt_lockswitch=yes
6088 else
6089   echo "configure: failed program was:" >&5
6090   cat conftest.$ac_ext >&5
6091   rm -rf conftest*
6092   ac_cv_vt_lockswitch=no
6093 fi
6094 rm -f conftest*
6095 fi
6096
6097   ac_vt_lockswitch=$ac_cv_vt_lockswitch
6098   echo "$ac_t""$ac_vt_lockswitch" 1>&6
6099
6100 elif test "$enable_locking" = no; then
6101   true
6102 else
6103   echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
6104   exit 1
6105 fi
6106
6107 if test "$ac_vt_lockswitch" = yes; then
6108   cat >> confdefs.h <<\EOF
6109 #define HAVE_VT_LOCKSWITCH 1
6110 EOF
6111
6112   # the VT_LOCKSWITCH ioctl can only be used when running as root.
6113   # #### but it doesn't work yet, so don't worry about that for now.
6114 #  need_setuid=yes
6115 fi
6116
6117
6118
6119 if test "$enable_locking" = yes; then
6120
6121   # Check for Kerberos.
6122   #
6123   # Check whether --with-kerberos or --without-kerberos was given.
6124 if test "${with_kerberos+set}" = set; then
6125   withval="$with_kerberos"
6126   with_kerberos="$withval"; with_kerberos_req="$withval"
6127 else
6128   with_kerberos=yes
6129 fi
6130
6131
6132   
6133    case "$with_kerberos" in
6134     yes) ;;
6135     no)  ;;
6136
6137     /*)
6138      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
6139 echo "configure:6151: checking for Kerberos headers" >&5
6140      d=$with_kerberos/include
6141      if test -d $d; then
6142        X_CFLAGS="-I$d $X_CFLAGS"
6143        echo "$ac_t""$d" 1>&6
6144      else
6145        echo "$ac_t""not found ($d: no such directory)" 1>&6
6146      fi
6147
6148      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
6149 echo "configure:6161: checking for Kerberos libs" >&5
6150      d=$with_kerberos/lib
6151      if test -d $d; then
6152        X_LIBS="-L$d $X_LIBS"
6153        echo "$ac_t""$d" 1>&6
6154      else
6155        echo "$ac_t""not found ($d: no such directory)" 1>&6
6156      fi
6157
6158      # replace the directory string with "yes".
6159      with_kerberos_req="yes"
6160      with_kerberos=$with_kerberos_req
6161      ;;
6162
6163     *)
6164      echo ""
6165      echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory."
6166      echo "       If it is a directory, then \`DIR/include' will be added to"
6167      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6168      exit 1
6169      ;;
6170    esac
6171
6172    # why is this necessary?
6173    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6174    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6175    withval=
6176   
6177
6178   if test "$with_kerberos" = yes; then
6179     echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
6180 echo "configure:6192: checking for Kerberos" >&5
6181 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
6182   echo $ac_n "(cached) $ac_c" 1>&6
6183 else
6184   
6185   ac_save_CPPFLAGS="$CPPFLAGS"
6186   if test \! -z "$includedir" ; then 
6187     CPPFLAGS="$CPPFLAGS -I$includedir"
6188   fi
6189   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6190   cat > conftest.$ac_ext <<EOF
6191 #line 6203 "configure"
6192 #include "confdefs.h"
6193 #include <krb.h>
6194 int main() {
6195
6196 ; return 0; }
6197 EOF
6198 if { (eval echo configure:6210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6199   rm -rf conftest*
6200   ac_cv_kerberos=yes
6201 else
6202   echo "configure: failed program was:" >&5
6203   cat conftest.$ac_ext >&5
6204   rm -rf conftest*
6205   ac_cv_kerberos=no
6206 fi
6207 rm -f conftest*
6208   CPPFLAGS="$ac_save_CPPFLAGS"
6209 fi
6210
6211 echo "$ac_t""$ac_cv_kerberos" 1>&6
6212     if test "$ac_cv_kerberos" = yes ; then
6213       have_kerberos=yes
6214       cat >> confdefs.h <<\EOF
6215 #define HAVE_KERBEROS 1
6216 EOF
6217
6218
6219       # from Tim Showalter <tjs+@andrew.cmu.edu>
6220       PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
6221       echo $ac_n "checking for res_search""... $ac_c" 1>&6
6222 echo "configure:6234: checking for res_search" >&5
6223 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
6224   echo $ac_n "(cached) $ac_c" 1>&6
6225 else
6226   cat > conftest.$ac_ext <<EOF
6227 #line 6239 "configure"
6228 #include "confdefs.h"
6229 /* System header to define __stub macros and hopefully few prototypes,
6230     which can conflict with char res_search(); below.  */
6231 #include <assert.h>
6232 /* Override any gcc2 internal prototype to avoid an error.  */
6233 /* We use char because int might match the return type of a gcc2
6234     builtin and then its argument prototype would still apply.  */
6235 char res_search();
6236
6237 int main() {
6238
6239 /* The GNU C library defines this for functions which it implements
6240     to always fail with ENOSYS.  Some functions are actually named
6241     something starting with __ and the normal name is an alias.  */
6242 #if defined (__stub_res_search) || defined (__stub___res_search)
6243 choke me
6244 #else
6245 res_search();
6246 #endif
6247
6248 ; return 0; }
6249 EOF
6250 if { (eval echo configure:6262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6251   rm -rf conftest*
6252   eval "ac_cv_func_res_search=yes"
6253 else
6254   echo "configure: failed program was:" >&5
6255   cat conftest.$ac_ext >&5
6256   rm -rf conftest*
6257   eval "ac_cv_func_res_search=no"
6258 fi
6259 rm -f conftest*
6260 fi
6261
6262 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
6263   echo "$ac_t""yes" 1>&6
6264   :
6265 else
6266   echo "$ac_t""no" 1>&6
6267 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
6268 echo "configure:6280: checking for res_search in -lresolv" >&5
6269 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
6270 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6271   echo $ac_n "(cached) $ac_c" 1>&6
6272 else
6273   ac_save_LIBS="$LIBS"
6274 LIBS="-lresolv  $LIBS"
6275 cat > conftest.$ac_ext <<EOF
6276 #line 6288 "configure"
6277 #include "confdefs.h"
6278 /* Override any gcc2 internal prototype to avoid an error.  */
6279 /* We use char because int might match the return type of a gcc2
6280     builtin and then its argument prototype would still apply.  */
6281 char res_search();
6282
6283 int main() {
6284 res_search()
6285 ; return 0; }
6286 EOF
6287 if { (eval echo configure:6299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6288   rm -rf conftest*
6289   eval "ac_cv_lib_$ac_lib_var=yes"
6290 else
6291   echo "configure: failed program was:" >&5
6292   cat conftest.$ac_ext >&5
6293   rm -rf conftest*
6294   eval "ac_cv_lib_$ac_lib_var=no"
6295 fi
6296 rm -f conftest*
6297 LIBS="$ac_save_LIBS"
6298
6299 fi
6300 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6301   echo "$ac_t""yes" 1>&6
6302   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
6303 else
6304   echo "$ac_t""no" 1>&6
6305 echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
6306         
6307 fi
6308
6309 fi
6310
6311
6312     fi
6313   elif test "$with_kerberos" != no; then
6314     echo "error: must be yes or no: --with-kerberos=$with_kerberos"
6315     exit 1
6316   fi
6317   
6318   # Check for PAM.
6319   # Check whether --with-pam or --without-pam was given.
6320 if test "${with_pam+set}" = set; then
6321   withval="$with_pam"
6322   with_pam="$withval"; with_pam_req="$withval"
6323 else
6324   with_pam=no
6325 fi
6326
6327 #### Leave PAM off by default for now, since it's buggy on Solaris
6328 #### (and probably Linux, but it's so hard to tell...)
6329
6330   
6331    case "$with_pam" in
6332     yes) ;;
6333     no)  ;;
6334
6335     /*)
6336      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
6337 echo "configure:6349: checking for PAM headers" >&5
6338      d=$with_pam/include
6339      if test -d $d; then
6340        X_CFLAGS="-I$d $X_CFLAGS"
6341        echo "$ac_t""$d" 1>&6
6342      else
6343        echo "$ac_t""not found ($d: no such directory)" 1>&6
6344      fi
6345
6346      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
6347 echo "configure:6359: checking for PAM libs" >&5
6348      d=$with_pam/lib
6349      if test -d $d; then
6350        X_LIBS="-L$d $X_LIBS"
6351        echo "$ac_t""$d" 1>&6
6352      else
6353        echo "$ac_t""not found ($d: no such directory)" 1>&6
6354      fi
6355
6356      # replace the directory string with "yes".
6357      with_pam_req="yes"
6358      with_pam=$with_pam_req
6359      ;;
6360
6361     *)
6362      echo ""
6363      echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
6364      echo "       If it is a directory, then \`DIR/include' will be added to"
6365      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6366      exit 1
6367      ;;
6368    esac
6369
6370    # why is this necessary?
6371    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6372    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6373    withval=
6374   
6375
6376   if test "$with_pam" = yes; then
6377     echo $ac_n "checking for PAM""... $ac_c" 1>&6
6378 echo "configure:6390: checking for PAM" >&5
6379 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
6380   echo $ac_n "(cached) $ac_c" 1>&6
6381 else
6382   
6383   ac_save_CPPFLAGS="$CPPFLAGS"
6384   if test \! -z "$includedir" ; then 
6385     CPPFLAGS="$CPPFLAGS -I$includedir"
6386   fi
6387   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6388   cat > conftest.$ac_ext <<EOF
6389 #line 6401 "configure"
6390 #include "confdefs.h"
6391 #include <security/pam_appl.h>
6392 int main() {
6393
6394 ; return 0; }
6395 EOF
6396 if { (eval echo configure:6408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6397   rm -rf conftest*
6398   ac_cv_pam=yes
6399 else
6400   echo "configure: failed program was:" >&5
6401   cat conftest.$ac_ext >&5
6402   rm -rf conftest*
6403   ac_cv_pam=no
6404 fi
6405 rm -f conftest*
6406   CPPFLAGS="$ac_save_CPPFLAGS"
6407 fi
6408
6409 echo "$ac_t""$ac_cv_pam" 1>&6
6410     if test "$ac_cv_pam" = yes ; then
6411           have_pam=yes
6412           cat >> confdefs.h <<\EOF
6413 #define HAVE_PAM 1
6414 EOF
6415
6416           PASSWD_LIBS="${PASSWD_LIBS} -lpam -ldl"
6417     fi
6418   elif test "$with_pam" != no; then
6419         echo "error: must be yes or no: --with-pam=$with_pam"
6420         exit 1
6421   fi
6422
6423   # Next, check for the nine billion variants of shadow passwords...
6424
6425   pwent_cruft_done=no
6426   # Check whether --with-shadow or --without-shadow was given.
6427 if test "${with_shadow+set}" = set; then
6428   withval="$with_shadow"
6429   with_shadow="$withval"; with_shadow_req="$withval"
6430 else
6431   with_shadow=yes
6432 fi
6433
6434
6435   
6436    case "$with_shadow" in
6437     yes) ;;
6438     no)  ;;
6439
6440     /*)
6441      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
6442 echo "configure:6454: checking for shadow password headers" >&5
6443      d=$with_shadow/include
6444      if test -d $d; then
6445        X_CFLAGS="-I$d $X_CFLAGS"
6446        echo "$ac_t""$d" 1>&6
6447      else
6448        echo "$ac_t""not found ($d: no such directory)" 1>&6
6449      fi
6450
6451      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
6452 echo "configure:6464: checking for shadow password libs" >&5
6453      d=$with_shadow/lib
6454      if test -d $d; then
6455        X_LIBS="-L$d $X_LIBS"
6456        echo "$ac_t""$d" 1>&6
6457      else
6458        echo "$ac_t""not found ($d: no such directory)" 1>&6
6459      fi
6460
6461      # replace the directory string with "yes".
6462      with_shadow_req="yes"
6463      with_shadow=$with_shadow_req
6464      ;;
6465
6466     *)
6467      echo ""
6468      echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory."
6469      echo "       If it is a directory, then \`DIR/include' will be added to"
6470      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6471      exit 1
6472      ;;
6473    esac
6474
6475    # why is this necessary?
6476    # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
6477    # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
6478    withval=
6479   
6480
6481   if test "$with_shadow" = no; then
6482     pwent_cruft_done=yes
6483   elif test "$with_shadow" != yes; then
6484     echo "error: must be yes or no: --with-shadow=$with_shadow"
6485     exit 1
6486   fi
6487
6488
6489   # Sun's "adjunct" passwords.
6490   #
6491   if test "$pwent_cruft_done" = no ; then
6492     echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
6493 echo "configure:6505: checking for Sun-style shadow passwords" >&5
6494 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
6495   echo $ac_n "(cached) $ac_c" 1>&6
6496 else
6497   
6498   ac_save_CPPFLAGS="$CPPFLAGS"
6499   if test \! -z "$includedir" ; then 
6500     CPPFLAGS="$CPPFLAGS -I$includedir"
6501   fi
6502   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6503   cat > conftest.$ac_ext <<EOF
6504 #line 6516 "configure"
6505 #include "confdefs.h"
6506 #include <stdlib.h>
6507                                       #include <unistd.h>
6508                                       #include <sys/types.h>
6509                                       #include <sys/label.h>
6510                                       #include <sys/audit.h>
6511                                       #include <pwdadj.h>
6512 int main() {
6513 struct passwd_adjunct *p = getpwanam("nobody");
6514                          const char *pw = p->pwa_passwd;
6515 ; return 0; }
6516 EOF
6517 if { (eval echo configure:6529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6518   rm -rf conftest*
6519   ac_cv_sun_adjunct=yes
6520 else
6521   echo "configure: failed program was:" >&5
6522   cat conftest.$ac_ext >&5
6523   rm -rf conftest*
6524   ac_cv_sun_adjunct=no
6525 fi
6526 rm -f conftest*
6527   CPPFLAGS="$ac_save_CPPFLAGS"
6528 fi
6529
6530 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
6531     if test "$ac_cv_sun_adjunct" = yes; then
6532       have_shadow=yes
6533       need_setuid=yes
6534       pwent_cruft_done=yes
6535       cat >> confdefs.h <<\EOF
6536 #define HAVE_ADJUNCT_PASSWD 1
6537 EOF
6538
6539     fi
6540   fi
6541
6542   # DEC and SCO so-called "enhanced" security.
6543   #
6544   if test "$pwent_cruft_done" = no ; then
6545     echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
6546 echo "configure:6558: checking for DEC-style shadow passwords" >&5
6547 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
6548   echo $ac_n "(cached) $ac_c" 1>&6
6549 else
6550   
6551   ac_save_CPPFLAGS="$CPPFLAGS"
6552   if test \! -z "$includedir" ; then 
6553     CPPFLAGS="$CPPFLAGS -I$includedir"
6554   fi
6555   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6556   cat > conftest.$ac_ext <<EOF
6557 #line 6569 "configure"
6558 #include "confdefs.h"
6559 #include <stdlib.h>
6560                                       #include <unistd.h>
6561                                       #include <sys/types.h>
6562                                       #include <pwd.h>
6563                                       #include <sys/security.h>
6564                                       #include <prot.h>
6565 int main() {
6566 struct pr_passwd *p;
6567                          const char *pw;
6568                          set_auth_parameters(0, 0);
6569                          check_auth_parameters();
6570                          p = getprpwnam("nobody");
6571                          pw = p->ufld.fd_encrypt;
6572 ; return 0; }
6573 EOF
6574 if { (eval echo configure:6586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6575   rm -rf conftest*
6576   ac_cv_enhanced_passwd=yes
6577 else
6578   echo "configure: failed program was:" >&5
6579   cat conftest.$ac_ext >&5
6580   rm -rf conftest*
6581   ac_cv_enhanced_passwd=no
6582 fi
6583 rm -f conftest*
6584   CPPFLAGS="$ac_save_CPPFLAGS"
6585 fi
6586
6587 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
6588     if test $ac_cv_enhanced_passwd = yes; then
6589       have_shadow=yes
6590       need_setuid=yes
6591       pwent_cruft_done=yes
6592       cat >> confdefs.h <<\EOF
6593 #define HAVE_ENHANCED_PASSWD 1
6594 EOF
6595
6596
6597       # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
6598       # (I'm told it needs -lcurses too, but I don't understand why.)
6599       echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
6600 echo "configure:6612: checking for getprpwnam in -lprot" >&5
6601 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
6602 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6603   echo $ac_n "(cached) $ac_c" 1>&6
6604 else
6605   ac_save_LIBS="$LIBS"
6606 LIBS="-lprot -lx $LIBS"
6607 cat > conftest.$ac_ext <<EOF
6608 #line 6620 "configure"
6609 #include "confdefs.h"
6610 /* Override any gcc2 internal prototype to avoid an error.  */
6611 /* We use char because int might match the return type of a gcc2
6612     builtin and then its argument prototype would still apply.  */
6613 char getprpwnam();
6614
6615 int main() {
6616 getprpwnam()
6617 ; return 0; }
6618 EOF
6619 if { (eval echo configure:6631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6620   rm -rf conftest*
6621   eval "ac_cv_lib_$ac_lib_var=yes"
6622 else
6623   echo "configure: failed program was:" >&5
6624   cat conftest.$ac_ext >&5
6625   rm -rf conftest*
6626   eval "ac_cv_lib_$ac_lib_var=no"
6627 fi
6628 rm -f conftest*
6629 LIBS="$ac_save_LIBS"
6630
6631 fi
6632 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6633   echo "$ac_t""yes" 1>&6
6634   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
6635 else
6636   echo "$ac_t""no" 1>&6
6637 # On DEC, getprpwnam() is in -lsecurity
6638                     echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
6639 echo "configure:6651: checking for getprpwnam in -lsecurity" >&5
6640 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
6641 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6642   echo $ac_n "(cached) $ac_c" 1>&6
6643 else
6644   ac_save_LIBS="$LIBS"
6645 LIBS="-lsecurity  $LIBS"
6646 cat > conftest.$ac_ext <<EOF
6647 #line 6659 "configure"
6648 #include "confdefs.h"
6649 /* Override any gcc2 internal prototype to avoid an error.  */
6650 /* We use char because int might match the return type of a gcc2
6651     builtin and then its argument prototype would still apply.  */
6652 char getprpwnam();
6653
6654 int main() {
6655 getprpwnam()
6656 ; return 0; }
6657 EOF
6658 if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6659   rm -rf conftest*
6660   eval "ac_cv_lib_$ac_lib_var=yes"
6661 else
6662   echo "configure: failed program was:" >&5
6663   cat conftest.$ac_ext >&5
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=no"
6666 fi
6667 rm -f conftest*
6668 LIBS="$ac_save_LIBS"
6669
6670 fi
6671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6672   echo "$ac_t""yes" 1>&6
6673   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
6674 else
6675   echo "$ac_t""no" 1>&6
6676 fi
6677
6678 fi
6679
6680     fi
6681   fi
6682
6683   # HP's entry in the "Not Invented Here" Sweepstakes.
6684   #
6685   if test "$pwent_cruft_done" = no ; then
6686     echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
6687 echo "configure:6699: checking for HP-style shadow passwords" >&5
6688 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
6689   echo $ac_n "(cached) $ac_c" 1>&6
6690 else
6691   
6692   ac_save_CPPFLAGS="$CPPFLAGS"
6693   if test \! -z "$includedir" ; then 
6694     CPPFLAGS="$CPPFLAGS -I$includedir"
6695   fi
6696   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6697   cat > conftest.$ac_ext <<EOF
6698 #line 6710 "configure"
6699 #include "confdefs.h"
6700 #include <stdlib.h>
6701                                       #include <unistd.h>
6702                                       #include <sys/types.h>
6703                                       #include <pwd.h>
6704                                       #include <hpsecurity.h>
6705                                       #include <prot.h>
6706 int main() {
6707 struct s_passwd *p = getspwnam("nobody");
6708                          const char *pw = p->pw_passwd;
6709 ; return 0; }
6710 EOF
6711 if { (eval echo configure:6723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6712   rm -rf conftest*
6713   ac_cv_hpux_passwd=yes
6714 else
6715   echo "configure: failed program was:" >&5
6716   cat conftest.$ac_ext >&5
6717   rm -rf conftest*
6718   ac_cv_hpux_passwd=no
6719 fi
6720 rm -f conftest*
6721   CPPFLAGS="$ac_save_CPPFLAGS"
6722 fi
6723
6724 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
6725     if test "$ac_cv_hpux_passwd" = yes; then
6726       have_shadow=yes
6727       need_setuid=yes
6728       pwent_cruft_done=yes
6729       cat >> confdefs.h <<\EOF
6730 #define HAVE_HPUX_PASSWD 1
6731 EOF
6732
6733
6734       # on HPUX, bigcrypt is in -lsec
6735       echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
6736 echo "configure:6748: checking for bigcrypt in -lsec" >&5
6737 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
6738 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6739   echo $ac_n "(cached) $ac_c" 1>&6
6740 else
6741   ac_save_LIBS="$LIBS"
6742 LIBS="-lsec  $LIBS"
6743 cat > conftest.$ac_ext <<EOF
6744 #line 6756 "configure"
6745 #include "confdefs.h"
6746 /* Override any gcc2 internal prototype to avoid an error.  */
6747 /* We use char because int might match the return type of a gcc2
6748     builtin and then its argument prototype would still apply.  */
6749 char bigcrypt();
6750
6751 int main() {
6752 bigcrypt()
6753 ; return 0; }
6754 EOF
6755 if { (eval echo configure:6767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6756   rm -rf conftest*
6757   eval "ac_cv_lib_$ac_lib_var=yes"
6758 else
6759   echo "configure: failed program was:" >&5
6760   cat conftest.$ac_ext >&5
6761   rm -rf conftest*
6762   eval "ac_cv_lib_$ac_lib_var=no"
6763 fi
6764 rm -f conftest*
6765 LIBS="$ac_save_LIBS"
6766
6767 fi
6768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6769   echo "$ac_t""yes" 1>&6
6770   PASSWD_LIBS="$PASSWD_LIBS -lsec"
6771 else
6772   echo "$ac_t""no" 1>&6
6773 fi
6774
6775     fi
6776   fi
6777
6778   # Traditional (ha!) shadow passwords.
6779   #
6780   if test "$pwent_cruft_done" = no ; then
6781     echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
6782 echo "configure:6794: checking for generic shadow passwords" >&5
6783 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
6784   echo $ac_n "(cached) $ac_c" 1>&6
6785 else
6786   
6787   ac_save_CPPFLAGS="$CPPFLAGS"
6788   if test \! -z "$includedir" ; then 
6789     CPPFLAGS="$CPPFLAGS -I$includedir"
6790   fi
6791   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6792   cat > conftest.$ac_ext <<EOF
6793 #line 6805 "configure"
6794 #include "confdefs.h"
6795 #include <stdlib.h>
6796                                       #include <unistd.h>
6797                                       #include <sys/types.h>
6798                                       #include <pwd.h>
6799                                       #include <shadow.h>
6800 int main() {
6801 struct spwd *p = getspnam("nobody");
6802                          const char *pw = p->sp_pwdp;
6803 ; return 0; }
6804 EOF
6805 if { (eval echo configure:6817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6806   rm -rf conftest*
6807   ac_cv_shadow=yes
6808 else
6809   echo "configure: failed program was:" >&5
6810   cat conftest.$ac_ext >&5
6811   rm -rf conftest*
6812   ac_cv_shadow=no
6813 fi
6814 rm -f conftest*
6815   CPPFLAGS="$ac_save_CPPFLAGS"
6816 fi
6817
6818 echo "$ac_t""$ac_cv_shadow" 1>&6
6819     if test "$ac_cv_shadow" = yes; then
6820       have_shadow=yes
6821       need_setuid=yes
6822       pwent_cruft_done=yes
6823       cat >> confdefs.h <<\EOF
6824 #define HAVE_SHADOW_PASSWD 1
6825 EOF
6826
6827
6828       # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
6829       have_getspnam=no
6830       echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
6831 echo "configure:6843: checking for getspnam in -lc" >&5
6832 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
6833 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6834   echo $ac_n "(cached) $ac_c" 1>&6
6835 else
6836   ac_save_LIBS="$LIBS"
6837 LIBS="-lc  $LIBS"
6838 cat > conftest.$ac_ext <<EOF
6839 #line 6851 "configure"
6840 #include "confdefs.h"
6841 /* Override any gcc2 internal prototype to avoid an error.  */
6842 /* We use char because int might match the return type of a gcc2
6843     builtin and then its argument prototype would still apply.  */
6844 char getspnam();
6845
6846 int main() {
6847 getspnam()
6848 ; return 0; }
6849 EOF
6850 if { (eval echo configure:6862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6851   rm -rf conftest*
6852   eval "ac_cv_lib_$ac_lib_var=yes"
6853 else
6854   echo "configure: failed program was:" >&5
6855   cat conftest.$ac_ext >&5
6856   rm -rf conftest*
6857   eval "ac_cv_lib_$ac_lib_var=no"
6858 fi
6859 rm -f conftest*
6860 LIBS="$ac_save_LIBS"
6861
6862 fi
6863 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6864   echo "$ac_t""yes" 1>&6
6865   have_getspnam=yes
6866 else
6867   echo "$ac_t""no" 1>&6
6868 fi
6869
6870       if test "$have_getspnam" = no ; then
6871         echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
6872 echo "configure:6884: checking for getspnam in -lgen" >&5
6873 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
6874 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6875   echo $ac_n "(cached) $ac_c" 1>&6
6876 else
6877   ac_save_LIBS="$LIBS"
6878 LIBS="-lgen  $LIBS"
6879 cat > conftest.$ac_ext <<EOF
6880 #line 6892 "configure"
6881 #include "confdefs.h"
6882 /* Override any gcc2 internal prototype to avoid an error.  */
6883 /* We use char because int might match the return type of a gcc2
6884     builtin and then its argument prototype would still apply.  */
6885 char getspnam();
6886
6887 int main() {
6888 getspnam()
6889 ; return 0; }
6890 EOF
6891 if { (eval echo configure:6903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6892   rm -rf conftest*
6893   eval "ac_cv_lib_$ac_lib_var=yes"
6894 else
6895   echo "configure: failed program was:" >&5
6896   cat conftest.$ac_ext >&5
6897   rm -rf conftest*
6898   eval "ac_cv_lib_$ac_lib_var=no"
6899 fi
6900 rm -f conftest*
6901 LIBS="$ac_save_LIBS"
6902
6903 fi
6904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6905   echo "$ac_t""yes" 1>&6
6906   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
6907 else
6908   echo "$ac_t""no" 1>&6
6909 fi
6910
6911       fi
6912     fi
6913   fi
6914
6915   # On FreeBSD, getpwnam() and friends work just like on non-shadow-password
6916   # systems -- except you only get stuff in the pw_passwd field if the running
6917   # program is setuid.  So, guess that we've got this lossage to contend with
6918   # if /etc/master.passwd exists, and default to a setuid installation.
6919   #
6920   if test "$pwent_cruft_done" = no ; then
6921     echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
6922 echo "configure:6934: checking for FreeBSD-style shadow passwords" >&5
6923 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
6924   echo $ac_n "(cached) $ac_c" 1>&6
6925 else
6926   if test -f /etc/master.passwd ; then
6927                       ac_cv_master_passwd=yes
6928                     else
6929                       ac_cv_master_passwd=no
6930                     fi
6931 fi
6932
6933 echo "$ac_t""$ac_cv_master_passwd" 1>&6
6934     if test "$ac_cv_master_passwd" = yes; then
6935       need_setuid=yes
6936       pwent_cruft_done=yes
6937     fi
6938   fi
6939
6940   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
6941   have_crypt=no
6942   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
6943 echo "configure:6955: checking for crypt in -lc" >&5
6944 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
6945 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6946   echo $ac_n "(cached) $ac_c" 1>&6
6947 else
6948   ac_save_LIBS="$LIBS"
6949 LIBS="-lc  $LIBS"
6950 cat > conftest.$ac_ext <<EOF
6951 #line 6963 "configure"
6952 #include "confdefs.h"
6953 /* Override any gcc2 internal prototype to avoid an error.  */
6954 /* We use char because int might match the return type of a gcc2
6955     builtin and then its argument prototype would still apply.  */
6956 char crypt();
6957
6958 int main() {
6959 crypt()
6960 ; return 0; }
6961 EOF
6962 if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
6963   rm -rf conftest*
6964   eval "ac_cv_lib_$ac_lib_var=yes"
6965 else
6966   echo "configure: failed program was:" >&5
6967   cat conftest.$ac_ext >&5
6968   rm -rf conftest*
6969   eval "ac_cv_lib_$ac_lib_var=no"
6970 fi
6971 rm -f conftest*
6972 LIBS="$ac_save_LIBS"
6973
6974 fi
6975 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6976   echo "$ac_t""yes" 1>&6
6977   have_crypt=yes
6978 else
6979   echo "$ac_t""no" 1>&6
6980 fi
6981
6982   if test "$have_crypt" = no ; then
6983     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6984 echo "configure:6996: checking for crypt in -lcrypt" >&5
6985 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6986 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6987   echo $ac_n "(cached) $ac_c" 1>&6
6988 else
6989   ac_save_LIBS="$LIBS"
6990 LIBS="-lcrypt  $LIBS"
6991 cat > conftest.$ac_ext <<EOF
6992 #line 7004 "configure"
6993 #include "confdefs.h"
6994 /* Override any gcc2 internal prototype to avoid an error.  */
6995 /* We use char because int might match the return type of a gcc2
6996     builtin and then its argument prototype would still apply.  */
6997 char crypt();
6998
6999 int main() {
7000 crypt()
7001 ; return 0; }
7002 EOF
7003 if { (eval echo configure:7015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
7004   rm -rf conftest*
7005   eval "ac_cv_lib_$ac_lib_var=yes"
7006 else
7007   echo "configure: failed program was:" >&5
7008   cat conftest.$ac_ext >&5
7009   rm -rf conftest*
7010   eval "ac_cv_lib_$ac_lib_var=no"
7011 fi
7012 rm -f conftest*
7013 LIBS="$ac_save_LIBS"
7014
7015 fi
7016 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7017   echo "$ac_t""yes" 1>&6
7018   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
7019 else
7020   echo "$ac_t""no" 1>&6
7021 fi
7022
7023   fi
7024
7025
7026   # Most of the above shadow mechanisms will have set need_setuid to yes,
7027   # if they were found.  But, on some systems, we need setuid even when
7028   # using plain old vanilla passwords.
7029   #
7030   if test "$need_setuid" = no ; then
7031     case "$host" in
7032       *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
7033         need_setuid=yes
7034       ;;
7035     esac
7036   fi
7037
7038 fi
7039
7040
7041 if test \! -z "$includedir" ; then 
7042   INCLUDES="-I$includedir"
7043 fi
7044
7045 if test \! -z "$libdir" ; then
7046   LDFLAGS="$LDFLAGS -L$libdir"
7047 fi
7048
7049
7050 ##### should have options to override the DEPEND crap, I guess...
7051 DEPEND=makedepend
7052 DEPEND_FLAGS=
7053 DEPEND_DEFINES=
7054
7055
7056 # Done testing things -- now substitute in some stuff for the Makefiles.
7057 #
7058 if test "$have_motif" = yes; then
7059   cat >> confdefs.h <<\EOF
7060 #define HAVE_MOTIF 1
7061 EOF
7062
7063   TOOLKIT_SRCS='$(MOTIF_SRCS)'
7064   TOOLKIT_OBJS='$(MOTIF_OBJS)'
7065 elif test "$have_athena" = yes; then
7066   cat >> confdefs.h <<\EOF
7067 #define HAVE_ATHENA 1
7068 EOF
7069
7070   TOOLKIT_SRCS='$(ATHENA_SRCS)'
7071   TOOLKIT_OBJS='$(ATHENA_OBJS)'
7072 else
7073   TOOLKIT_SRCS=''
7074   TOOLKIT_OBJS=''
7075 fi
7076
7077 if test "$have_kerberos" = yes; then
7078   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
7079   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
7080 fi
7081 if test "$have_pam" = yes; then
7082   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
7083   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
7084   INSTALL_PAM="install-pam"
7085 fi
7086   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
7087   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
7088
7089
7090 if test "$enable_locking" = yes; then
7091   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
7092   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
7093 else
7094   LOCK_SRCS=''
7095   LOCK_OBJS=''
7096 fi
7097
7098 if test "$need_setuid" = yes; then
7099   NEED_SETUID=yes
7100   INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
7101 else
7102   NEED_SETUID=no
7103   INSTALL_SETUID='$(INSTALL_PROGRAM)'
7104 fi
7105
7106 tab='   '
7107 if test "$have_gl" = yes; then
7108   GL_EXES='$(GL_EXES)'
7109   GL_KLUDGE=${tab}
7110 else
7111   GL_KLUDGE='  -'${tab}
7112 fi
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146 # Print some warnings before emitting the Makefiles.
7147 #
7148 warn_prefix_1="    Warning:"
7149 warn_prefix_2="       Note:"
7150 warn_prefix="$warn_prefix_1"
7151
7152 warning=no
7153 warnsep='    #################################################################'
7154
7155 warnpre() {
7156   if test "$warning" = no ; then
7157     echo '' ; echo "$warnsep" ; echo ''
7158     warning=yes
7159   fi
7160 }
7161
7162 warn() {
7163   warnpre
7164   if test "$warning" = long ; then echo '' ; fi
7165   warning=yes
7166   echo "$warn_prefix $@"
7167 }
7168
7169 warnL() {
7170   was=$warning
7171   warnpre
7172   warning=yes
7173   if test "$was" != no ; then echo '' ; fi
7174   echo "$warn_prefix $@"
7175 }
7176
7177 warn2() {
7178   echo "             $@"
7179   warning=long
7180 }
7181
7182 note() {
7183   warn_prefix="$warn_prefix_2"
7184   warn $@
7185   warn_prefix="$warn_prefix_1"
7186 }
7187
7188 noteL() {
7189   warn_prefix="$warn_prefix_2"
7190   warnL $@
7191   warn_prefix="$warn_prefix_1"
7192 }
7193
7194
7195 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
7196   warn 'The SGI saver extension was requested, but was not found.'
7197 fi
7198
7199 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
7200   warn 'The MIT saver extension was requested, but was not found.'
7201 fi
7202
7203 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
7204   warn 'The XIdle extension was requested, but was not found.'
7205 fi
7206
7207 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
7208   warn 'The XSHM extension was requested, but was not found.'
7209 fi
7210
7211 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
7212   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
7213 fi
7214
7215 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
7216   warn 'The DPMS extension was requested, but was not found.'
7217 fi
7218
7219 if test "$have_motif" = no -a "$have_athena" = no ; then
7220   warnL "Neither Motif nor Athena widgets seem to be available;"
7221   warn2 "the \`xscreensaver-demo' program requires one or the"
7222   warn2 "other."
7223   proselytize_motif=no
7224
7225 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
7226   warnL "Use of Motif was requested, but it wasn't found;"
7227   warn2 "Athena will be used instead."
7228
7229 elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
7230   warnL "Use of Athena was requested, but it wasn't found;"
7231   warn2 "Motif will be used instead."
7232 fi
7233
7234 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
7235
7236   preferred_lesstif=0.86
7237
7238   if test "$lesstif_version" = unknown; then
7239     warnL "Unable to determine the LessTif version number!"
7240     warn2 "Make sure you are using version $preferred_lesstif or newer."
7241     warn2 "See <http://www.lesstif.org/>."
7242
7243   elif test \! $lesstif_version -gt 82; then
7244     warnL "LessTif version $lesstif_version_string is being used."
7245     warn2 "LessTif versions 0.82 and earlier are too buggy to"
7246     warn2 "use with XScreenSaver; it is strongly recommended"
7247     warn2 "that you upgrade to at least version $preferred_lesstif!"
7248     warn2 "See <http://www.lesstif.org/>."
7249   fi
7250 fi
7251
7252 if test "$proselytize_motif" = yes ; then
7253     warnL "Athena widgets are being used instead of Motif."
7254     warn2 "The \`xscreensaver-demo' program looks much better"
7255     warn2 "with Motif.  Wouldn't you rather be using Motif?"
7256     warn2 "It is shipped by every commercial Unix vendor;"
7257     warn2 "and there is a free implementation available as"
7258     warn2 "well: see <http://www.lesstif.org/>."
7259 fi
7260
7261
7262 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
7263   preferred_mesagl=2.7
7264
7265   if test "$ac_mesagl_version" = unknown; then
7266     warnL "Unable to determine the MesaGL version number!"
7267     warn2 "Make sure you are using version $preferred_mesagl or newer."
7268
7269   elif test \! "$ac_mesagl_version" -gt 2006; then
7270     warnL "MesaGL version $ac_mesagl_version_string is being used."
7271     warn2 "MesaGL versions 2.6 and earlier have a security bug."
7272     warn2 "It is strongly recommended that you upgrade to at"
7273     warn2 "least version $preferred_mesagl."
7274   fi
7275 fi
7276
7277
7278 if test "$have_xpm" = no ; then
7279   if test "$with_xpm_req" = yes ; then
7280     warnL 'Use of XPM was requested, but it was not found.'
7281   elif test "$with_xpm_req" = no ; then
7282     noteL 'The XPM library is not being used.'
7283   else
7284     noteL 'The XPM library was not found.'
7285   fi
7286
7287   echo ''
7288   warn2 'Some of the demos will not be as colorful as they'
7289   warn2 'could be.  You might want to consider installing XPM'
7290   warn2 'and re-running configure.  (Remember to delete the'
7291   warn2 'config.cache file first.)  You can find XPM at most'
7292   warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
7293 fi
7294
7295 if test "$have_gl" = no ; then
7296   if test "$with_gl_req" = yes ; then
7297     warnL 'Use of GL was requested, but it was not found.'
7298   elif test "$with_gl_req" = no ; then
7299     noteL 'The OpenGL 3D library is not being used.'
7300   else
7301     noteL 'The OpenGL 3D library was not found.'
7302   fi
7303
7304   echo ''
7305   warn2 'Those demos which use 3D will not be built or installed.'
7306   warn2 'You might want to consider installing OpenGL and'
7307   warn2 're-running configure.  (Remember to delete the'
7308   warn2 "config.cache file first.)  If your vendor doesn't ship"
7309   warn2 'their own implementation of OpenGL, you can get a free'
7310   warn2 'version at <http://www.ssec.wisc.edu/~brianp/Mesa.html>.'
7311   warn2 'For general OpenGL info, see <http://www.opengl.org/>.'
7312
7313 fi
7314
7315 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
7316   warn 'Use of XReadDisplay was requested, but it was not found.'
7317 fi
7318
7319 if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
7320   warn 'Use of the Iris Video Library was requested, but it was not found.'
7321 fi
7322
7323 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
7324   warn 'Use of Kerberos was requested, but it was not found.'
7325 fi
7326
7327 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
7328   warn 'Use of PAM was requested, but it was not found.'
7329 fi
7330
7331 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
7332   warn 'Use of shadow passwords was requested, but they were not found.'
7333 fi
7334
7335 if test -n "$with_zippy_req"; then
7336   if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
7337     warnL "$with_zippy_req was requested as the Zippy program,"
7338     warn2 "but was not found.  The default will be used instead."
7339   fi
7340 fi
7341
7342 if test "$warning" != no; then
7343   echo '' ; echo "$warnsep" ; echo ''
7344 fi
7345
7346
7347 trap '' 1 2 15
7348 cat > confcache <<\EOF
7349 # This file is a shell script that caches the results of configure
7350 # tests run on this system so they can be shared between configure
7351 # scripts and configure runs.  It is not useful on other systems.
7352 # If it contains results you don't want to keep, you may remove or edit it.
7353 #
7354 # By default, configure uses ./config.cache as the cache file,
7355 # creating it if it does not exist already.  You can give configure
7356 # the --cache-file=FILE option to use a different cache file; that is
7357 # what configure does when it calls configure scripts in
7358 # subdirectories, so they share the cache.
7359 # Giving --cache-file=/dev/null disables caching, for debugging configure.
7360 # config.status only pays attention to the cache file if you give it the
7361 # --recheck option to rerun configure.
7362 #
7363 EOF
7364 # The following way of writing the cache mishandles newlines in values,
7365 # but we know of no workaround that is simple, portable, and efficient.
7366 # So, don't put newlines in cache variables' values.
7367 # Ultrix sh set writes to stderr and can't be redirected directly,
7368 # and sets the high bit in the cache file unless we assign to the vars.
7369 (set) 2>&1 |
7370   case `(ac_space=' '; set) 2>&1` in
7371   *ac_space=\ *)
7372     # `set' does not quote correctly, so add quotes (double-quote substitution
7373     # turns \\\\ into \\, and sed turns \\ into \).
7374     sed -n \
7375       -e "s/'/'\\\\''/g" \
7376       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
7377     ;;
7378   *)
7379     # `set' quotes correctly as required by POSIX, so do not add quotes.
7380     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
7381     ;;
7382   esac >> confcache
7383 if cmp -s $cache_file confcache; then
7384   :
7385 else
7386   if test -w $cache_file; then
7387     echo "updating cache $cache_file"
7388     cat confcache > $cache_file
7389   else
7390     echo "not updating unwritable cache $cache_file"
7391   fi
7392 fi
7393 rm -f confcache
7394
7395 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
7396
7397 test "x$prefix" = xNONE && prefix=$ac_default_prefix
7398 # Let make expand exec_prefix.
7399 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
7400
7401 # Any assignment to VPATH causes Sun make to only execute
7402 # the first set of double-colon rules, so remove it if not needed.
7403 # If there is a colon in the path, we need to keep it.
7404 if test "x$srcdir" = x.; then
7405   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
7406 fi
7407
7408 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
7409
7410 DEFS=-DHAVE_CONFIG_H
7411
7412 # Without the "./", some shells look in PATH for config.status.
7413 : ${CONFIG_STATUS=./config.status}
7414
7415 echo creating $CONFIG_STATUS
7416 rm -f $CONFIG_STATUS
7417 cat > $CONFIG_STATUS <<EOF
7418 #! /bin/sh
7419 # Generated automatically by configure.
7420 # Run this file to recreate the current configuration.
7421 # This directory was configured as follows,
7422 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7423 #
7424 # $0 $ac_configure_args
7425 #
7426 # Compiler output produced by configure, useful for debugging
7427 # configure, is in ./config.log if it exists.
7428
7429 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
7430 for ac_option
7431 do
7432   case "\$ac_option" in
7433   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
7434     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
7435     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
7436   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
7437     echo "$CONFIG_STATUS generated by autoconf version 2.12"
7438     exit 0 ;;
7439   -help | --help | --hel | --he | --h)
7440     echo "\$ac_cs_usage"; exit 0 ;;
7441   *) echo "\$ac_cs_usage"; exit 1 ;;
7442   esac
7443 done
7444
7445 ac_given_srcdir=$srcdir
7446 ac_given_INSTALL="$INSTALL"
7447
7448 trap 'rm -fr `echo "Makefile
7449           utils/Makefile
7450           driver/Makefile
7451           hacks/Makefile
7452           hacks/glx/Makefile
7453           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
7454 EOF
7455 cat >> $CONFIG_STATUS <<EOF
7456
7457 # Protect against being on the right side of a sed subst in config.status.
7458 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
7459  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
7460 $ac_vpsub
7461 $extrasub
7462 s%@CFLAGS@%$CFLAGS%g
7463 s%@CPPFLAGS@%$CPPFLAGS%g
7464 s%@CXXFLAGS@%$CXXFLAGS%g
7465 s%@DEFS@%$DEFS%g
7466 s%@LDFLAGS@%$LDFLAGS%g
7467 s%@LIBS@%$LIBS%g
7468 s%@exec_prefix@%$exec_prefix%g
7469 s%@prefix@%$prefix%g
7470 s%@program_transform_name@%$program_transform_name%g
7471 s%@bindir@%$bindir%g
7472 s%@sbindir@%$sbindir%g
7473 s%@libexecdir@%$libexecdir%g
7474 s%@datadir@%$datadir%g
7475 s%@sysconfdir@%$sysconfdir%g
7476 s%@sharedstatedir@%$sharedstatedir%g
7477 s%@localstatedir@%$localstatedir%g
7478 s%@libdir@%$libdir%g
7479 s%@includedir@%$includedir%g
7480 s%@oldincludedir@%$oldincludedir%g
7481 s%@infodir@%$infodir%g
7482 s%@mandir@%$mandir%g
7483 s%@host@%$host%g
7484 s%@host_alias@%$host_alias%g
7485 s%@host_cpu@%$host_cpu%g
7486 s%@host_vendor@%$host_vendor%g
7487 s%@host_os@%$host_os%g
7488 s%@CC@%$CC%g
7489 s%@CPP@%$CPP%g
7490 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
7491 s%@INSTALL_DATA@%$INSTALL_DATA%g
7492 s%@SET_MAKE@%$SET_MAKE%g
7493 s%@X_CFLAGS@%$X_CFLAGS%g
7494 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
7495 s%@X_LIBS@%$X_LIBS%g
7496 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
7497 s%@zip2@%$zip2%g
7498 s%@emacs_exe@%$emacs_exe%g
7499 s%@xemacs_exe@%$xemacs_exe%g
7500 s%@fortune@%$fortune%g
7501 s%@INCLUDES@%$INCLUDES%g
7502 s%@SAVER_LIBS@%$SAVER_LIBS%g
7503 s%@TOOLKIT_LIBS@%$TOOLKIT_LIBS%g
7504 s%@HACK_LIBS@%$HACK_LIBS%g
7505 s%@XPM_LIBS@%$XPM_LIBS%g
7506 s%@GL_LIBS@%$GL_LIBS%g
7507 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
7508 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
7509 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
7510 s%@NEED_SETUID@%$NEED_SETUID%g
7511 s%@INSTALL_PAM@%$INSTALL_PAM%g
7512 s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
7513 s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
7514 s%@TOOLKIT_SRCS@%$TOOLKIT_SRCS%g
7515 s%@TOOLKIT_OBJS@%$TOOLKIT_OBJS%g
7516 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
7517 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
7518 s%@XMU_SRCS@%$XMU_SRCS%g
7519 s%@XMU_OBJS@%$XMU_OBJS%g
7520 s%@LOCK_SRCS@%$LOCK_SRCS%g
7521 s%@LOCK_OBJS@%$LOCK_OBJS%g
7522 s%@GL_EXES@%$GL_EXES%g
7523 s%@GL_KLUDGE@%$GL_KLUDGE%g
7524 s%@HACKDIR@%$HACKDIR%g
7525 s%@APPDEFAULTS@%$APPDEFAULTS%g
7526 s%@DEPEND@%$DEPEND%g
7527 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
7528 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
7529
7530 CEOF
7531 EOF
7532
7533 cat >> $CONFIG_STATUS <<\EOF
7534
7535 # Split the substitutions into bite-sized pieces for seds with
7536 # small command number limits, like on Digital OSF/1 and HP-UX.
7537 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7538 ac_file=1 # Number of current file.
7539 ac_beg=1 # First line for current file.
7540 ac_end=$ac_max_sed_cmds # Line after last line for current file.
7541 ac_more_lines=:
7542 ac_sed_cmds=""
7543 while $ac_more_lines; do
7544   if test $ac_beg -gt 1; then
7545     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7546   else
7547     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7548   fi
7549   if test ! -s conftest.s$ac_file; then
7550     ac_more_lines=false
7551     rm -f conftest.s$ac_file
7552   else
7553     if test -z "$ac_sed_cmds"; then
7554       ac_sed_cmds="sed -f conftest.s$ac_file"
7555     else
7556       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7557     fi
7558     ac_file=`expr $ac_file + 1`
7559     ac_beg=$ac_end
7560     ac_end=`expr $ac_end + $ac_max_sed_cmds`
7561   fi
7562 done
7563 if test -z "$ac_sed_cmds"; then
7564   ac_sed_cmds=cat
7565 fi
7566 EOF
7567
7568 cat >> $CONFIG_STATUS <<EOF
7569
7570 CONFIG_FILES=\${CONFIG_FILES-"Makefile
7571           utils/Makefile
7572           driver/Makefile
7573           hacks/Makefile
7574           hacks/glx/Makefile
7575           driver/XScreenSaver.ad"}
7576 EOF
7577 cat >> $CONFIG_STATUS <<\EOF
7578 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7579   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7580   case "$ac_file" in
7581   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7582        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7583   *) ac_file_in="${ac_file}.in" ;;
7584   esac
7585
7586   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7587
7588   # Remove last slash and all that follows it.  Not all systems have dirname.
7589   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7590   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7591     # The file is in a subdirectory.
7592     test ! -d "$ac_dir" && mkdir "$ac_dir"
7593     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7594     # A "../" for each directory in $ac_dir_suffix.
7595     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7596   else
7597     ac_dir_suffix= ac_dots=
7598   fi
7599
7600   case "$ac_given_srcdir" in
7601   .)  srcdir=.
7602       if test -z "$ac_dots"; then top_srcdir=.
7603       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7604   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7605   *) # Relative path.
7606     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7607     top_srcdir="$ac_dots$ac_given_srcdir" ;;
7608   esac
7609
7610   case "$ac_given_INSTALL" in
7611   [/$]*) INSTALL="$ac_given_INSTALL" ;;
7612   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
7613   esac
7614
7615   echo creating "$ac_file"
7616   rm -f "$ac_file"
7617   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7618   case "$ac_file" in
7619   *Makefile*) ac_comsub="1i\\
7620 # $configure_input" ;;
7621   *) ac_comsub= ;;
7622   esac
7623
7624   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7625   sed -e "$ac_comsub
7626 s%@configure_input@%$configure_input%g
7627 s%@srcdir@%$srcdir%g
7628 s%@top_srcdir@%$top_srcdir%g
7629 s%@INSTALL@%$INSTALL%g
7630 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7631 fi; done
7632 rm -f conftest.s*
7633
7634 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7635 # NAME is the cpp macro being defined and VALUE is the value it is being given.
7636 #
7637 # ac_d sets the value in "#define NAME VALUE" lines.
7638 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
7639 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
7640 ac_dC='\3'
7641 ac_dD='%g'
7642 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7643 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7644 ac_uB='\([      ]\)%\1#\2define\3'
7645 ac_uC=' '
7646 ac_uD='\4%g'
7647 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7648 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
7649 ac_eB='$%\1#\2define\3'
7650 ac_eC=' '
7651 ac_eD='%g'
7652
7653 if test "${CONFIG_HEADERS+set}" != set; then
7654 EOF
7655 cat >> $CONFIG_STATUS <<EOF
7656   CONFIG_HEADERS="config.h"
7657 EOF
7658 cat >> $CONFIG_STATUS <<\EOF
7659 fi
7660 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7661   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7662   case "$ac_file" in
7663   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7664        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7665   *) ac_file_in="${ac_file}.in" ;;
7666   esac
7667
7668   echo creating $ac_file
7669
7670   rm -f conftest.frag conftest.in conftest.out
7671   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7672   cat $ac_file_inputs > conftest.in
7673
7674 EOF
7675
7676 # Transform confdefs.h into a sed script conftest.vals that substitutes
7677 # the proper values into config.h.in to produce config.h.  And first:
7678 # Protect against being on the right side of a sed subst in config.status.
7679 # Protect against being in an unquoted here document in config.status.
7680 rm -f conftest.vals
7681 cat > conftest.hdr <<\EOF
7682 s/[\\&%]/\\&/g
7683 s%[\\$`]%\\&%g
7684 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
7685 s%ac_d%ac_u%gp
7686 s%ac_u%ac_e%gp
7687 EOF
7688 sed -n -f conftest.hdr confdefs.h > conftest.vals
7689 rm -f conftest.hdr
7690
7691 # This sed command replaces #undef with comments.  This is necessary, for
7692 # example, in the case of _POSIX_SOURCE, which is predefined and required
7693 # on some systems where configure will not decide to define it.
7694 cat >> conftest.vals <<\EOF
7695 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
7696 EOF
7697
7698 # Break up conftest.vals because some shells have a limit on
7699 # the size of here documents, and old seds have small limits too.
7700
7701 rm -f conftest.tail
7702 while :
7703 do
7704   ac_lines=`grep -c . conftest.vals`
7705   # grep -c gives empty output for an empty file on some AIX systems.
7706   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7707   # Write a limited-size here document to conftest.frag.
7708   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
7709   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7710   echo 'CEOF
7711   sed -f conftest.frag conftest.in > conftest.out
7712   rm -f conftest.in
7713   mv conftest.out conftest.in
7714 ' >> $CONFIG_STATUS
7715   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7716   rm -f conftest.vals
7717   mv conftest.tail conftest.vals
7718 done
7719 rm -f conftest.vals
7720
7721 cat >> $CONFIG_STATUS <<\EOF
7722   rm -f conftest.frag conftest.h
7723   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
7724   cat conftest.in >> conftest.h
7725   rm -f conftest.in
7726   if cmp -s $ac_file conftest.h 2>/dev/null; then
7727     echo "$ac_file is unchanged"
7728     rm -f conftest.h
7729   else
7730     # Remove last slash and all that follows it.  Not all systems have dirname.
7731       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7732       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7733       # The file is in a subdirectory.
7734       test ! -d "$ac_dir" && mkdir "$ac_dir"
7735     fi
7736     rm -f $ac_file
7737     mv conftest.h $ac_file
7738   fi
7739 fi; done
7740
7741 EOF
7742 cat >> $CONFIG_STATUS <<EOF
7743
7744 EOF
7745 cat >> $CONFIG_STATUS <<\EOF
7746
7747 exit 0
7748 EOF
7749 chmod +x $CONFIG_STATUS
7750 rm -fr confdefs* $ac_clean_files
7751 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7752
7753
7754 # You are in a twisty maze of namespaces and syntaxes, all alike.
7755 # Fuck the skull of Unix.
7756 #
7757 eval bindir=${bindir}
7758 eval bindir=${bindir}
7759 eval bindir=${bindir}
7760 eval bindir=${bindir}
7761 eval bindir=${bindir}
7762 eval bindir=${bindir}
7763 eval HACKDIR=${HACKDIR}
7764 eval HACKDIR=${HACKDIR}
7765 eval HACKDIR=${HACKDIR}
7766 eval HACKDIR=${HACKDIR}
7767 eval HACKDIR=${HACKDIR}
7768 eval HACKDIR=${HACKDIR}
7769
7770 echo ""
7771 echo "$warnsep"
7772 echo ""
7773 echo '      When you run "make install", the "xscreensaver",'
7774 echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
7775 echo "      will be installed in ${bindir}."
7776 echo ""
7777 echo "      The various graphics demos (80+ different executables) will"
7778 echo "      be installed in ${HACKDIR}."
7779 echo ""
7780 echo "      If you would prefer the demos to be installed elsewhere"
7781 echo "      (for example, in a dedicated directory) you should re-run"
7782 echo "      configure with the --enable-subdir=DIR option.  For more"
7783 echo "      information, run $0 --help."
7784 echo ""
7785 echo "$warnsep"
7786 echo ""