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