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