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