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