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