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