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