http://ftp.x.org/contrib/applications/xscreensaver-3.21.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 gl_halfassed=no
6878 # Check whether --with-gl or --without-gl was given.
6879 if test "${with_gl+set}" = set; then
6880   withval="$with_gl"
6881   with_gl="$withval"; with_gl_req="$withval"
6882 else
6883   with_gl=yes
6884 fi
6885
6886
6887
6888    case "$with_gl" in
6889     yes) ;;
6890     no)  ;;
6891
6892     /*)
6893      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
6894 echo "configure:6906: checking for GL headers" >&5
6895      d=$with_gl/include
6896      if test -d $d; then
6897        X_CFLAGS="-I$d $X_CFLAGS"
6898        echo "$ac_t""$d" 1>&6
6899      else
6900        echo "$ac_t""not found ($d: no such directory)" 1>&6
6901      fi
6902
6903      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
6904 echo "configure:6916: checking for GL libs" >&5
6905      d=$with_gl/lib
6906      if test -d $d; then
6907        X_LIBS="-L$d $X_LIBS"
6908        echo "$ac_t""$d" 1>&6
6909      else
6910        echo "$ac_t""not found ($d: no such directory)" 1>&6
6911      fi
6912
6913      # replace the directory string with "yes".
6914      with_gl_req="yes"
6915      with_gl=$with_gl_req
6916      ;;
6917
6918     *)
6919      echo ""
6920      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
6921      echo "       If it is a directory, then \`DIR/include' will be added to"
6922      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6923      exit 1
6924      ;;
6925    esac
6926   
6927
6928 ac_mesagl_version=unknown
6929 ac_mesagl_version_string=unknown
6930
6931 if test "$with_gl" = yes; then
6932   
6933   ac_save_CPPFLAGS="$CPPFLAGS"
6934   if test \! -z "$includedir" ; then 
6935     CPPFLAGS="$CPPFLAGS -I$includedir"
6936   fi
6937   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6938   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
6939 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
6940 echo "configure:6952: checking for GL/gl.h" >&5
6941 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6942   echo $ac_n "(cached) $ac_c" 1>&6
6943 else
6944   cat > conftest.$ac_ext <<EOF
6945 #line 6957 "configure"
6946 #include "confdefs.h"
6947 #include <GL/gl.h>
6948 EOF
6949 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6950 { (eval echo configure:6962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6951 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6952 if test -z "$ac_err"; then
6953   rm -rf conftest*
6954   eval "ac_cv_header_$ac_safe=yes"
6955 else
6956   echo "$ac_err" >&5
6957   echo "configure: failed program was:" >&5
6958   cat conftest.$ac_ext >&5
6959   rm -rf conftest*
6960   eval "ac_cv_header_$ac_safe=no"
6961 fi
6962 rm -f conftest*
6963 fi
6964 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6965   echo "$ac_t""yes" 1>&6
6966   have_gl=yes
6967 else
6968   echo "$ac_t""no" 1>&6
6969 fi
6970
6971   CPPFLAGS="$ac_save_CPPFLAGS"
6972   if test "$have_gl" = yes ; then
6973     
6974   ac_save_CPPFLAGS="$CPPFLAGS"
6975   if test \! -z "$includedir" ; then 
6976     CPPFLAGS="$CPPFLAGS -I$includedir"
6977   fi
6978   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6979   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
6980 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
6981 echo "configure:6993: checking for GL/glx.h" >&5
6982 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6983   echo $ac_n "(cached) $ac_c" 1>&6
6984 else
6985   cat > conftest.$ac_ext <<EOF
6986 #line 6998 "configure"
6987 #include "confdefs.h"
6988 #include <GL/glx.h>
6989 EOF
6990 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6991 { (eval echo configure:7003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6992 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6993 if test -z "$ac_err"; then
6994   rm -rf conftest*
6995   eval "ac_cv_header_$ac_safe=yes"
6996 else
6997   echo "$ac_err" >&5
6998   echo "configure: failed program was:" >&5
6999   cat conftest.$ac_ext >&5
7000   rm -rf conftest*
7001   eval "ac_cv_header_$ac_safe=no"
7002 fi
7003 rm -f conftest*
7004 fi
7005 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7006   echo "$ac_t""yes" 1>&6
7007   have_gl=yes
7008 else
7009   echo "$ac_t""no" 1>&6
7010 fi
7011
7012   CPPFLAGS="$ac_save_CPPFLAGS"
7013   fi
7014
7015   # If we have the headers, try and figure out which vendor it's from.
7016   #
7017   if test "$have_gl" = yes ; then
7018
7019     # We need to know whether it's MesaGL so that we know which libraries
7020     # to link against.
7021     #
7022     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
7023 echo "configure:7035: checking whether GL is really MesaGL" >&5
7024 if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
7025   echo $ac_n "(cached) $ac_c" 1>&6
7026 else
7027   ac_cv_have_mesa_gl=no
7028        
7029   ac_save_CPPFLAGS="$CPPFLAGS"
7030   if test \! -z "$includedir" ; then 
7031     CPPFLAGS="$CPPFLAGS -I$includedir"
7032   fi
7033   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7034   cat > conftest.$ac_ext <<EOF
7035 #line 7047 "configure"
7036 #include "confdefs.h"
7037 #include <GL/glx.h>
7038 EOF
7039 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7040   egrep "Mesa" >/dev/null 2>&1; then
7041   rm -rf conftest*
7042   ac_cv_have_mesa_gl=yes
7043 fi
7044 rm -f conftest*
7045
7046   CPPFLAGS="$ac_save_CPPFLAGS"
7047       
7048 fi
7049
7050 echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
7051     ac_have_mesa_gl=$ac_cv_have_mesa_gl
7052  
7053
7054     gl_lib_1=""
7055     GL_LIBS=""
7056
7057
7058     # Some versions of MesaGL are compiled to require -lpthread.
7059     # So if the Mesa headers exist, and -lpthread exists, then always
7060     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
7061     #
7062     if test "$ac_have_mesa_gl" = yes; then
7063       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
7064 echo "configure:7076: checking for pthread_create in -lpthread" >&5
7065 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
7066 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7067   echo $ac_n "(cached) $ac_c" 1>&6
7068 else
7069   ac_save_LIBS="$LIBS"
7070 LIBS="-lpthread  $LIBS"
7071 cat > conftest.$ac_ext <<EOF
7072 #line 7084 "configure"
7073 #include "confdefs.h"
7074 /* Override any gcc2 internal prototype to avoid an error.  */
7075 /* We use char because int might match the return type of a gcc2
7076     builtin and then its argument prototype would still apply.  */
7077 char pthread_create();
7078
7079 int main() {
7080 pthread_create()
7081 ; return 0; }
7082 EOF
7083 if { (eval echo configure:7095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7084   rm -rf conftest*
7085   eval "ac_cv_lib_$ac_lib_var=yes"
7086 else
7087   echo "configure: failed program was:" >&5
7088   cat conftest.$ac_ext >&5
7089   rm -rf conftest*
7090   eval "ac_cv_lib_$ac_lib_var=no"
7091 fi
7092 rm -f conftest*
7093 LIBS="$ac_save_LIBS"
7094
7095 fi
7096 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7097   echo "$ac_t""yes" 1>&6
7098   GL_LIBS="-lpthread"
7099 else
7100   echo "$ac_t""no" 1>&6
7101 fi
7102
7103     fi
7104
7105
7106     # If we have Mesa headers, check to see if we can link against -lMesaGL.
7107     # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
7108     # Else, warn that GL is busted.  (We have the headers, but no libs.)
7109     #
7110
7111     if test "$ac_have_mesa_gl" = yes ; then
7112       
7113   ac_save_CPPFLAGS="$CPPFLAGS"
7114   ac_save_LDFLAGS="$LDFLAGS"
7115 #  ac_save_LIBS="$LIBS"
7116
7117   if test \! -z "$includedir" ; then 
7118     CPPFLAGS="$CPPFLAGS -I$includedir"
7119   fi
7120   # note: $X_CFLAGS includes $x_includes
7121   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7122
7123   if test \! -z "$libdir" ; then
7124     LDFLAGS="$LDFLAGS -L$libdir"
7125   fi
7126   # note: $X_LIBS includes $x_libraries
7127   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7128
7129   echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
7130 echo "configure:7142: checking for glXCreateContext in -lMesaGL" >&5
7131 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
7132 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7133   echo $ac_n "(cached) $ac_c" 1>&6
7134 else
7135   ac_save_LIBS="$LIBS"
7136 LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
7137 cat > conftest.$ac_ext <<EOF
7138 #line 7150 "configure"
7139 #include "confdefs.h"
7140 /* Override any gcc2 internal prototype to avoid an error.  */
7141 /* We use char because int might match the return type of a gcc2
7142     builtin and then its argument prototype would still apply.  */
7143 char glXCreateContext();
7144
7145 int main() {
7146 glXCreateContext()
7147 ; return 0; }
7148 EOF
7149 if { (eval echo configure:7161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7150   rm -rf conftest*
7151   eval "ac_cv_lib_$ac_lib_var=yes"
7152 else
7153   echo "configure: failed program was:" >&5
7154   cat conftest.$ac_ext >&5
7155   rm -rf conftest*
7156   eval "ac_cv_lib_$ac_lib_var=no"
7157 fi
7158 rm -f conftest*
7159 LIBS="$ac_save_LIBS"
7160
7161 fi
7162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7163   echo "$ac_t""yes" 1>&6
7164   gl_lib_1="MesaGL"
7165                       GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
7166 else
7167   echo "$ac_t""no" 1>&6
7168 fi
7169
7170   CPPFLAGS="$ac_save_CPPFLAGS"
7171   LDFLAGS="$ac_save_LDFLAGS"
7172 #  LIBS="$ac_save_LIBS"
7173   
7174     fi
7175
7176     if test "$gl_lib_1" = "" ; then
7177       
7178   ac_save_CPPFLAGS="$CPPFLAGS"
7179   ac_save_LDFLAGS="$LDFLAGS"
7180 #  ac_save_LIBS="$LIBS"
7181
7182   if test \! -z "$includedir" ; then 
7183     CPPFLAGS="$CPPFLAGS -I$includedir"
7184   fi
7185   # note: $X_CFLAGS includes $x_includes
7186   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7187
7188   if test \! -z "$libdir" ; then
7189     LDFLAGS="$LDFLAGS -L$libdir"
7190   fi
7191   # note: $X_LIBS includes $x_libraries
7192   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7193
7194   echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
7195 echo "configure:7207: checking for glXCreateContext in -lGL" >&5
7196 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
7197 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7198   echo $ac_n "(cached) $ac_c" 1>&6
7199 else
7200   ac_save_LIBS="$LIBS"
7201 LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
7202 cat > conftest.$ac_ext <<EOF
7203 #line 7215 "configure"
7204 #include "confdefs.h"
7205 /* Override any gcc2 internal prototype to avoid an error.  */
7206 /* We use char because int might match the return type of a gcc2
7207     builtin and then its argument prototype would still apply.  */
7208 char glXCreateContext();
7209
7210 int main() {
7211 glXCreateContext()
7212 ; return 0; }
7213 EOF
7214 if { (eval echo configure:7226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7215   rm -rf conftest*
7216   eval "ac_cv_lib_$ac_lib_var=yes"
7217 else
7218   echo "configure: failed program was:" >&5
7219   cat conftest.$ac_ext >&5
7220   rm -rf conftest*
7221   eval "ac_cv_lib_$ac_lib_var=no"
7222 fi
7223 rm -f conftest*
7224 LIBS="$ac_save_LIBS"
7225
7226 fi
7227 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7228   echo "$ac_t""yes" 1>&6
7229   gl_lib_1="GL"
7230                       GL_LIBS="-lGL -lGLU $GL_LIBS"
7231 else
7232   echo "$ac_t""no" 1>&6
7233 fi
7234
7235   CPPFLAGS="$ac_save_CPPFLAGS"
7236   LDFLAGS="$ac_save_LDFLAGS"
7237 #  LIBS="$ac_save_LIBS"
7238   
7239     fi
7240
7241     if test "$gl_lib_1" = "" ; then
7242       # we have headers, but no libs -- bail.
7243       have_gl=no
7244       ac_have_mesa_gl=no
7245       gl_halfassed=yes
7246     else
7247       # linking works -- we can build the GL hacks.
7248       cat >> confdefs.h <<\EOF
7249 #define HAVE_GL 1
7250 EOF
7251
7252       if test "$ac_have_mesa_gl" = yes ; then
7253         cat >> confdefs.h <<\EOF
7254 #define HAVE_MESA_GL 1
7255 EOF
7256
7257       fi
7258     fi
7259   fi
7260
7261
7262   # Now that we know we have GL headers and libs, do some more GL testing.
7263   #
7264
7265   if test "$have_gl" = yes ; then
7266     # If it's MesaGL, we'd like to issue a warning if the version number
7267     # is less than or equal to 2.6, because that version had a security bug.
7268     #
7269     if test "$ac_have_mesa_gl" = yes; then
7270
7271       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
7272 echo "configure:7284: checking MesaGL version number" >&5
7273 if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
7274   echo $ac_n "(cached) $ac_c" 1>&6
7275 else
7276   cat > conftest.$ac_ext <<EOF
7277 #line 7289 "configure"
7278 #include "confdefs.h"
7279 #include <GL/gl.h>
7280 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
7281 EOF
7282
7283          ac_save_CPPFLAGS="$CPPFLAGS"
7284          if test \! -z "$includedir" ; then 
7285            CPPFLAGS="$CPPFLAGS -I$includedir"
7286          fi
7287          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7288
7289           # M4 sucks!!
7290          
7291          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
7292               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
7293          
7294
7295          rm -f conftest.$ac_ext
7296
7297          CPPFLAGS="$ac_save_CPPFLAGS"
7298
7299          if test "$mglv" = ""; then
7300            ac_mesagl_version=unknown
7301            ac_mesagl_version_string=unknown
7302          else
7303            ac_mesagl_version_string=$mglv
7304            maj=`echo $mglv | sed -n 's/\..*//p'`
7305            min=`echo $mglv | sed -n 's/.*\.//p'`
7306            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
7307            if test -z "$ac_mesagl_version"; then
7308              ac_mesagl_version=unknown
7309              ac_mesagl_version_string=unknown
7310            fi
7311          fi
7312          ac_cv_mesagl_version=$ac_mesagl_version
7313          ac_cv_mesagl_version_string=$ac_mesagl_version_string
7314       
7315 fi
7316
7317 echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
7318       ac_mesagl_version=$ac_cv_mesagl_version
7319       ac_mesagl_version_string=$ac_cv_mesagl_version_string
7320     fi
7321
7322
7323     # Check for OpenGL 1.1 features.
7324     #
7325     
7326   ac_save_CPPFLAGS="$CPPFLAGS"
7327   ac_save_LDFLAGS="$LDFLAGS"
7328 #  ac_save_LIBS="$LIBS"
7329
7330   if test \! -z "$includedir" ; then 
7331     CPPFLAGS="$CPPFLAGS -I$includedir"
7332   fi
7333   # note: $X_CFLAGS includes $x_includes
7334   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7335
7336   if test \! -z "$libdir" ; then
7337     LDFLAGS="$LDFLAGS -L$libdir"
7338   fi
7339   # note: $X_LIBS includes $x_libraries
7340   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7341
7342   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
7343 echo "configure:7355: checking for glBindTexture in -l$gl_lib_1" >&5
7344 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
7345 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7346   echo $ac_n "(cached) $ac_c" 1>&6
7347 else
7348   ac_save_LIBS="$LIBS"
7349 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
7350 cat > conftest.$ac_ext <<EOF
7351 #line 7363 "configure"
7352 #include "confdefs.h"
7353 /* Override any gcc2 internal prototype to avoid an error.  */
7354 /* We use char because int might match the return type of a gcc2
7355     builtin and then its argument prototype would still apply.  */
7356 char glBindTexture();
7357
7358 int main() {
7359 glBindTexture()
7360 ; return 0; }
7361 EOF
7362 if { (eval echo configure:7374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7363   rm -rf conftest*
7364   eval "ac_cv_lib_$ac_lib_var=yes"
7365 else
7366   echo "configure: failed program was:" >&5
7367   cat conftest.$ac_ext >&5
7368   rm -rf conftest*
7369   eval "ac_cv_lib_$ac_lib_var=no"
7370 fi
7371 rm -f conftest*
7372 LIBS="$ac_save_LIBS"
7373
7374 fi
7375 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7376   echo "$ac_t""yes" 1>&6
7377   cat >> confdefs.h <<\EOF
7378 #define HAVE_GLBINDTEXTURE 1
7379 EOF
7380
7381 else
7382   echo "$ac_t""no" 1>&6
7383 true
7384 fi
7385
7386   CPPFLAGS="$ac_save_CPPFLAGS"
7387   LDFLAGS="$ac_save_LDFLAGS"
7388 #  LIBS="$ac_save_LIBS"
7389   
7390
7391
7392     # Check whether the `xscreensaver' executable should link against GL.
7393     # See comments in utils/visual-gl.c for why this is sometimes necessary.
7394     #
7395     echo $ac_n "checking whether drastic GL measures must be taken""... $ac_c" 1>&6
7396 echo "configure:7408: checking whether drastic GL measures must be taken" >&5
7397     case "$host" in
7398       *-sgi*)
7399         echo "$ac_t""yes -- hello, SGI." 1>&6
7400         cat >> confdefs.h <<\EOF
7401 #define DAEMON_USE_GL 1
7402 EOF
7403
7404         SAVER_GL_SRCS='$(UTILS_SRC)/visual-gl.c'
7405         SAVER_GL_OBJS='$(UTILS_BIN)/visual-gl.o'
7406         SAVER_GL_LIBS="$GL_LIBS"
7407       ;;
7408       *)
7409         echo "$ac_t""no -- non-SGI." 1>&6
7410         SAVER_GL_SRCS=''
7411         SAVER_GL_OBJS=''
7412         SAVER_GL_LIBS=''
7413       ;;
7414     esac
7415
7416   fi
7417
7418 elif test "$with_gl" != no; then
7419   echo "error: must be yes or no: --with-gl=$with_gl"
7420   exit 1
7421 fi
7422
7423
7424 ###############################################################################
7425 #
7426 #       Check for -lgle.
7427 #
7428 ###############################################################################
7429
7430 have_gle=no
7431 with_gle_req=unspecified
7432 gle_halfassed=no
7433 # Check whether --with-gle or --without-gle was given.
7434 if test "${with_gle+set}" = set; then
7435   withval="$with_gle"
7436   with_gle="$withval"; with_gle_req="$withval"
7437 else
7438   with_gle=yes
7439 fi
7440
7441
7442
7443    case "$with_gle" in
7444     yes) ;;
7445     no)  ;;
7446
7447     /*)
7448      echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
7449 echo "configure:7461: checking for GLE headers" >&5
7450      d=$with_gle/include
7451      if test -d $d; then
7452        X_CFLAGS="-I$d $X_CFLAGS"
7453        echo "$ac_t""$d" 1>&6
7454      else
7455        echo "$ac_t""not found ($d: no such directory)" 1>&6
7456      fi
7457
7458      echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
7459 echo "configure:7471: checking for GLE libs" >&5
7460      d=$with_gle/lib
7461      if test -d $d; then
7462        X_LIBS="-L$d $X_LIBS"
7463        echo "$ac_t""$d" 1>&6
7464      else
7465        echo "$ac_t""not found ($d: no such directory)" 1>&6
7466      fi
7467
7468      # replace the directory string with "yes".
7469      with_gle_req="yes"
7470      with_gle=$with_gle_req
7471      ;;
7472
7473     *)
7474      echo ""
7475      echo "error: argument to --with-gle must be \"yes\", \"no\", or a directory."
7476      echo "       If it is a directory, then \`DIR/include' will be added to"
7477      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7478      exit 1
7479      ;;
7480    esac
7481   
7482
7483 GLE_LIBS=""
7484
7485 if test "$with_gle" = yes; then
7486
7487   
7488   ac_save_CPPFLAGS="$CPPFLAGS"
7489   if test \! -z "$includedir" ; then 
7490     CPPFLAGS="$CPPFLAGS -I$includedir"
7491   fi
7492   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7493   ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
7494 echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
7495 echo "configure:7507: checking for GL/gutil.h" >&5
7496 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7497   echo $ac_n "(cached) $ac_c" 1>&6
7498 else
7499   cat > conftest.$ac_ext <<EOF
7500 #line 7512 "configure"
7501 #include "confdefs.h"
7502 #include <GL/gutil.h>
7503 EOF
7504 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7505 { (eval echo configure:7517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7506 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7507 if test -z "$ac_err"; then
7508   rm -rf conftest*
7509   eval "ac_cv_header_$ac_safe=yes"
7510 else
7511   echo "$ac_err" >&5
7512   echo "configure: failed program was:" >&5
7513   cat conftest.$ac_ext >&5
7514   rm -rf conftest*
7515   eval "ac_cv_header_$ac_safe=no"
7516 fi
7517 rm -f conftest*
7518 fi
7519 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7520   echo "$ac_t""yes" 1>&6
7521   have_gle=yes
7522 else
7523   echo "$ac_t""no" 1>&6
7524 fi
7525
7526   CPPFLAGS="$ac_save_CPPFLAGS"
7527   if test "$have_gle" = yes ; then
7528     
7529   ac_save_CPPFLAGS="$CPPFLAGS"
7530   if test \! -z "$includedir" ; then 
7531     CPPFLAGS="$CPPFLAGS -I$includedir"
7532   fi
7533   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7534   ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
7535 echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
7536 echo "configure:7548: checking for GL/tube.h" >&5
7537 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7538   echo $ac_n "(cached) $ac_c" 1>&6
7539 else
7540   cat > conftest.$ac_ext <<EOF
7541 #line 7553 "configure"
7542 #include "confdefs.h"
7543 #include <GL/tube.h>
7544 EOF
7545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7546 { (eval echo configure:7558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7548 if test -z "$ac_err"; then
7549   rm -rf conftest*
7550   eval "ac_cv_header_$ac_safe=yes"
7551 else
7552   echo "$ac_err" >&5
7553   echo "configure: failed program was:" >&5
7554   cat conftest.$ac_ext >&5
7555   rm -rf conftest*
7556   eval "ac_cv_header_$ac_safe=no"
7557 fi
7558 rm -f conftest*
7559 fi
7560 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7561   echo "$ac_t""yes" 1>&6
7562   have_gle=yes
7563 else
7564   echo "$ac_t""no" 1>&6
7565 fi
7566
7567   CPPFLAGS="$ac_save_CPPFLAGS"
7568   fi
7569
7570   if test "$have_gle" = yes ; then
7571     have_gle=no
7572     gle_halfassed=yes
7573     
7574   ac_save_CPPFLAGS="$CPPFLAGS"
7575   ac_save_LDFLAGS="$LDFLAGS"
7576 #  ac_save_LIBS="$LIBS"
7577
7578   if test \! -z "$includedir" ; then 
7579     CPPFLAGS="$CPPFLAGS -I$includedir"
7580   fi
7581   # note: $X_CFLAGS includes $x_includes
7582   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7583
7584   if test \! -z "$libdir" ; then
7585     LDFLAGS="$LDFLAGS -L$libdir"
7586   fi
7587   # note: $X_LIBS includes $x_libraries
7588   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7589
7590   echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
7591 echo "configure:7603: checking for gleCreateGC in -lgle" >&5
7592 ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
7593 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7594   echo $ac_n "(cached) $ac_c" 1>&6
7595 else
7596   ac_save_LIBS="$LIBS"
7597 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
7598 cat > conftest.$ac_ext <<EOF
7599 #line 7611 "configure"
7600 #include "confdefs.h"
7601 /* Override any gcc2 internal prototype to avoid an error.  */
7602 /* We use char because int might match the return type of a gcc2
7603     builtin and then its argument prototype would still apply.  */
7604 char gleCreateGC();
7605
7606 int main() {
7607 gleCreateGC()
7608 ; return 0; }
7609 EOF
7610 if { (eval echo configure:7622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7611   rm -rf conftest*
7612   eval "ac_cv_lib_$ac_lib_var=yes"
7613 else
7614   echo "configure: failed program was:" >&5
7615   cat conftest.$ac_ext >&5
7616   rm -rf conftest*
7617   eval "ac_cv_lib_$ac_lib_var=no"
7618 fi
7619 rm -f conftest*
7620 LIBS="$ac_save_LIBS"
7621
7622 fi
7623 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7624   echo "$ac_t""yes" 1>&6
7625   have_gle=yes; gle_halfassed=no, GLE_LIBS="-lgle"
7626 else
7627   echo "$ac_t""no" 1>&6
7628 fi
7629
7630   CPPFLAGS="$ac_save_CPPFLAGS"
7631   LDFLAGS="$ac_save_LDFLAGS"
7632 #  LIBS="$ac_save_LIBS"
7633   
7634   fi
7635   if test "$have_gle" = yes ; then
7636     have_gle=no
7637     gle_halfassed=yes
7638     
7639   ac_save_CPPFLAGS="$CPPFLAGS"
7640   ac_save_LDFLAGS="$LDFLAGS"
7641 #  ac_save_LIBS="$LIBS"
7642
7643   if test \! -z "$includedir" ; then 
7644     CPPFLAGS="$CPPFLAGS -I$includedir"
7645   fi
7646   # note: $X_CFLAGS includes $x_includes
7647   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7648
7649   if test \! -z "$libdir" ; then
7650     LDFLAGS="$LDFLAGS -L$libdir"
7651   fi
7652   # note: $X_LIBS includes $x_libraries
7653   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7654
7655   echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
7656 echo "configure:7668: checking for uview_direction_d in -lmatrix" >&5
7657 ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
7658 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7659   echo $ac_n "(cached) $ac_c" 1>&6
7660 else
7661   ac_save_LIBS="$LIBS"
7662 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
7663 cat > conftest.$ac_ext <<EOF
7664 #line 7676 "configure"
7665 #include "confdefs.h"
7666 /* Override any gcc2 internal prototype to avoid an error.  */
7667 /* We use char because int might match the return type of a gcc2
7668     builtin and then its argument prototype would still apply.  */
7669 char uview_direction_d();
7670
7671 int main() {
7672 uview_direction_d()
7673 ; return 0; }
7674 EOF
7675 if { (eval echo configure:7687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7676   rm -rf conftest*
7677   eval "ac_cv_lib_$ac_lib_var=yes"
7678 else
7679   echo "configure: failed program was:" >&5
7680   cat conftest.$ac_ext >&5
7681   rm -rf conftest*
7682   eval "ac_cv_lib_$ac_lib_var=no"
7683 fi
7684 rm -f conftest*
7685 LIBS="$ac_save_LIBS"
7686
7687 fi
7688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7689   echo "$ac_t""yes" 1>&6
7690   have_gle=yes; gle_halfassed=no, 
7691                     GLE_LIBS="$GLE_LIBS -lmatrix"
7692 else
7693   echo "$ac_t""no" 1>&6
7694 fi
7695
7696   CPPFLAGS="$ac_save_CPPFLAGS"
7697   LDFLAGS="$ac_save_LDFLAGS"
7698 #  LIBS="$ac_save_LIBS"
7699   
7700   fi
7701
7702   if test "$have_gle" = yes ; then
7703     cat >> confdefs.h <<\EOF
7704 #define HAVE_GLE 1
7705 EOF
7706
7707   fi
7708
7709 elif test "$with_gle" != no; then
7710   echo "error: must be yes or no: --with-gle=$with_gle"
7711   exit 1
7712
7713 fi
7714
7715
7716
7717 ###############################################################################
7718 #
7719 #       Check for -lXpm.
7720 #
7721 ###############################################################################
7722
7723 have_xpm=no
7724 with_xpm_req=unspecified
7725 # Check whether --with-xpm or --without-xpm was given.
7726 if test "${with_xpm+set}" = set; then
7727   withval="$with_xpm"
7728   with_xpm="$withval"; with_xpm_req="$withval"
7729 else
7730   with_xpm=yes
7731 fi
7732
7733
7734
7735    case "$with_xpm" in
7736     yes) ;;
7737     no)  ;;
7738
7739     /*)
7740      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
7741 echo "configure:7753: checking for XPM headers" >&5
7742      d=$with_xpm/include
7743      if test -d $d; then
7744        X_CFLAGS="-I$d $X_CFLAGS"
7745        echo "$ac_t""$d" 1>&6
7746      else
7747        echo "$ac_t""not found ($d: no such directory)" 1>&6
7748      fi
7749
7750      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
7751 echo "configure:7763: checking for XPM libs" >&5
7752      d=$with_xpm/lib
7753      if test -d $d; then
7754        X_LIBS="-L$d $X_LIBS"
7755        echo "$ac_t""$d" 1>&6
7756      else
7757        echo "$ac_t""not found ($d: no such directory)" 1>&6
7758      fi
7759
7760      # replace the directory string with "yes".
7761      with_xpm_req="yes"
7762      with_xpm=$with_xpm_req
7763      ;;
7764
7765     *)
7766      echo ""
7767      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
7768      echo "       If it is a directory, then \`DIR/include' will be added to"
7769      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7770      exit 1
7771      ;;
7772    esac
7773   
7774
7775 if test "$with_xpm" = yes; then
7776   
7777   ac_save_CPPFLAGS="$CPPFLAGS"
7778   if test \! -z "$includedir" ; then 
7779     CPPFLAGS="$CPPFLAGS -I$includedir"
7780   fi
7781   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7782   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
7783 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
7784 echo "configure:7796: checking for X11/xpm.h" >&5
7785 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7786   echo $ac_n "(cached) $ac_c" 1>&6
7787 else
7788   cat > conftest.$ac_ext <<EOF
7789 #line 7801 "configure"
7790 #include "confdefs.h"
7791 #include <X11/xpm.h>
7792 EOF
7793 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7794 { (eval echo configure:7806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7795 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7796 if test -z "$ac_err"; then
7797   rm -rf conftest*
7798   eval "ac_cv_header_$ac_safe=yes"
7799 else
7800   echo "$ac_err" >&5
7801   echo "configure: failed program was:" >&5
7802   cat conftest.$ac_ext >&5
7803   rm -rf conftest*
7804   eval "ac_cv_header_$ac_safe=no"
7805 fi
7806 rm -f conftest*
7807 fi
7808 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7809   echo "$ac_t""yes" 1>&6
7810   have_xpm=yes
7811                     cat >> confdefs.h <<\EOF
7812 #define HAVE_XPM 1
7813 EOF
7814
7815                     XPM_LIBS="-lXpm"
7816 else
7817   echo "$ac_t""no" 1>&6
7818 fi
7819
7820   CPPFLAGS="$ac_save_CPPFLAGS"
7821 elif test "$with_xpm" != no; then
7822   echo "error: must be yes or no: --with-xpm=$with_xpm"
7823   exit 1
7824 fi
7825
7826 # See comment near $motif_requires_xpm, above.
7827 # Need to do this here, after both Motif and XPM have been checked for.
7828 #
7829 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
7830   if test "$motif_requires_xpm" = yes ; then
7831     MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
7832   fi
7833 fi
7834
7835
7836 ###############################################################################
7837 #
7838 #       Check for the XSHM server extension.
7839 #
7840 ###############################################################################
7841
7842 have_xshm=no
7843 with_xshm_req=unspecified
7844 # Check whether --with-xshm-ext or --without-xshm-ext was given.
7845 if test "${with_xshm_ext+set}" = set; then
7846   withval="$with_xshm_ext"
7847   with_xshm="$withval"; with_xshm_req="$withval"
7848 else
7849   with_xshm=yes
7850 fi
7851
7852
7853
7854    case "$with_xshm" in
7855     yes) ;;
7856     no)  ;;
7857
7858     /*)
7859      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
7860 echo "configure:7872: checking for XSHM headers" >&5
7861      d=$with_xshm/include
7862      if test -d $d; then
7863        X_CFLAGS="-I$d $X_CFLAGS"
7864        echo "$ac_t""$d" 1>&6
7865      else
7866        echo "$ac_t""not found ($d: no such directory)" 1>&6
7867      fi
7868
7869      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
7870 echo "configure:7882: checking for XSHM libs" >&5
7871      d=$with_xshm/lib
7872      if test -d $d; then
7873        X_LIBS="-L$d $X_LIBS"
7874        echo "$ac_t""$d" 1>&6
7875      else
7876        echo "$ac_t""not found ($d: no such directory)" 1>&6
7877      fi
7878
7879      # replace the directory string with "yes".
7880      with_xshm_req="yes"
7881      with_xshm=$with_xshm_req
7882      ;;
7883
7884     *)
7885      echo ""
7886      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
7887      echo "       If it is a directory, then \`DIR/include' will be added to"
7888      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7889      exit 1
7890      ;;
7891    esac
7892   
7893
7894 if test "$with_xshm" = yes; then
7895
7896   # first check for Xshm.h.
7897   
7898   ac_save_CPPFLAGS="$CPPFLAGS"
7899   if test \! -z "$includedir" ; then 
7900     CPPFLAGS="$CPPFLAGS -I$includedir"
7901   fi
7902   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7903   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
7904 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
7905 echo "configure:7917: checking for X11/extensions/XShm.h" >&5
7906 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7907   echo $ac_n "(cached) $ac_c" 1>&6
7908 else
7909   cat > conftest.$ac_ext <<EOF
7910 #line 7922 "configure"
7911 #include "confdefs.h"
7912 #include <X11/extensions/XShm.h>
7913 EOF
7914 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7915 { (eval echo configure:7927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7916 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7917 if test -z "$ac_err"; then
7918   rm -rf conftest*
7919   eval "ac_cv_header_$ac_safe=yes"
7920 else
7921   echo "$ac_err" >&5
7922   echo "configure: failed program was:" >&5
7923   cat conftest.$ac_ext >&5
7924   rm -rf conftest*
7925   eval "ac_cv_header_$ac_safe=no"
7926 fi
7927 rm -f conftest*
7928 fi
7929 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7930   echo "$ac_t""yes" 1>&6
7931   have_xshm=yes
7932 else
7933   echo "$ac_t""no" 1>&6
7934 fi
7935
7936   CPPFLAGS="$ac_save_CPPFLAGS"
7937
7938   # if that succeeded, then check for sys/ipc.h.
7939   if test "$have_xshm" = yes; then
7940     have_xshm=no
7941     
7942   ac_save_CPPFLAGS="$CPPFLAGS"
7943   if test \! -z "$includedir" ; then 
7944     CPPFLAGS="$CPPFLAGS -I$includedir"
7945   fi
7946   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7947   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
7948 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
7949 echo "configure:7961: checking for sys/ipc.h" >&5
7950 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7951   echo $ac_n "(cached) $ac_c" 1>&6
7952 else
7953   cat > conftest.$ac_ext <<EOF
7954 #line 7966 "configure"
7955 #include "confdefs.h"
7956 #include <sys/ipc.h>
7957 EOF
7958 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7959 { (eval echo configure:7971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7960 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7961 if test -z "$ac_err"; then
7962   rm -rf conftest*
7963   eval "ac_cv_header_$ac_safe=yes"
7964 else
7965   echo "$ac_err" >&5
7966   echo "configure: failed program was:" >&5
7967   cat conftest.$ac_ext >&5
7968   rm -rf conftest*
7969   eval "ac_cv_header_$ac_safe=no"
7970 fi
7971 rm -f conftest*
7972 fi
7973 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7974   echo "$ac_t""yes" 1>&6
7975   have_xshm=yes
7976 else
7977   echo "$ac_t""no" 1>&6
7978 fi
7979
7980   CPPFLAGS="$ac_save_CPPFLAGS"
7981   fi
7982
7983   # if that succeeded, then check for sys/shm.h.
7984   if test "$have_xshm" = yes; then
7985     have_xshm=no
7986     
7987   ac_save_CPPFLAGS="$CPPFLAGS"
7988   if test \! -z "$includedir" ; then 
7989     CPPFLAGS="$CPPFLAGS -I$includedir"
7990   fi
7991   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7992   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
7993 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
7994 echo "configure:8006: checking for sys/shm.h" >&5
7995 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7996   echo $ac_n "(cached) $ac_c" 1>&6
7997 else
7998   cat > conftest.$ac_ext <<EOF
7999 #line 8011 "configure"
8000 #include "confdefs.h"
8001 #include <sys/shm.h>
8002 EOF
8003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8004 { (eval echo configure:8016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8006 if test -z "$ac_err"; then
8007   rm -rf conftest*
8008   eval "ac_cv_header_$ac_safe=yes"
8009 else
8010   echo "$ac_err" >&5
8011   echo "configure: failed program was:" >&5
8012   cat conftest.$ac_ext >&5
8013   rm -rf conftest*
8014   eval "ac_cv_header_$ac_safe=no"
8015 fi
8016 rm -f conftest*
8017 fi
8018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8019   echo "$ac_t""yes" 1>&6
8020   have_xshm=yes
8021 else
8022   echo "$ac_t""no" 1>&6
8023 fi
8024
8025   CPPFLAGS="$ac_save_CPPFLAGS"
8026   fi
8027
8028   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
8029   # to exist, but the library code to not exist.  And even better, the library
8030   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
8031   # lib doesn't exist, give up.  (This lib gets added to X_EXTRA_LIBS, and
8032   # that's not quite right, but close enough.)
8033   #
8034   case "$host" in
8035     *-aix*)
8036       if  `uname -v` -eq 3 ; then
8037         have_xshm=no
8038         
8039   ac_save_CPPFLAGS="$CPPFLAGS"
8040   ac_save_LDFLAGS="$LDFLAGS"
8041 #  ac_save_LIBS="$LIBS"
8042
8043   if test \! -z "$includedir" ; then 
8044     CPPFLAGS="$CPPFLAGS -I$includedir"
8045   fi
8046   # note: $X_CFLAGS includes $x_includes
8047   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8048
8049   if test \! -z "$libdir" ; then
8050     LDFLAGS="$LDFLAGS -L$libdir"
8051   fi
8052   # note: $X_LIBS includes $x_libraries
8053   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8054
8055   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
8056 echo "configure:8068: checking for XShmQueryExtension in -lXextSam" >&5
8057 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
8058 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8059   echo $ac_n "(cached) $ac_c" 1>&6
8060 else
8061   ac_save_LIBS="$LIBS"
8062 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
8063 cat > conftest.$ac_ext <<EOF
8064 #line 8076 "configure"
8065 #include "confdefs.h"
8066 /* Override any gcc2 internal prototype to avoid an error.  */
8067 /* We use char because int might match the return type of a gcc2
8068     builtin and then its argument prototype would still apply.  */
8069 char XShmQueryExtension();
8070
8071 int main() {
8072 XShmQueryExtension()
8073 ; return 0; }
8074 EOF
8075 if { (eval echo configure:8087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8076   rm -rf conftest*
8077   eval "ac_cv_lib_$ac_lib_var=yes"
8078 else
8079   echo "configure: failed program was:" >&5
8080   cat conftest.$ac_ext >&5
8081   rm -rf conftest*
8082   eval "ac_cv_lib_$ac_lib_var=no"
8083 fi
8084 rm -f conftest*
8085 LIBS="$ac_save_LIBS"
8086
8087 fi
8088 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8089   echo "$ac_t""yes" 1>&6
8090   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
8091 else
8092   echo "$ac_t""no" 1>&6
8093 true
8094 fi
8095
8096   CPPFLAGS="$ac_save_CPPFLAGS"
8097   LDFLAGS="$ac_save_LDFLAGS"
8098 #  LIBS="$ac_save_LIBS"
8099   
8100       fi
8101     ;;
8102   esac
8103
8104   # if that succeeded, then we've really got it.
8105   if test "$have_xshm" = yes; then
8106     cat >> confdefs.h <<\EOF
8107 #define HAVE_XSHM_EXTENSION 1
8108 EOF
8109
8110   fi
8111
8112 elif test "$with_xshm" != no; then
8113   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
8114   exit 1
8115 fi
8116
8117
8118 ###############################################################################
8119 #
8120 #       Check for the DOUBLE-BUFFER server extension.
8121 #
8122 ###############################################################################
8123
8124 have_xdbe=no
8125 with_xdbe_req=unspecified
8126 # Check whether --with-xdbe-ext or --without-xdbe-ext was given.
8127 if test "${with_xdbe_ext+set}" = set; then
8128   withval="$with_xdbe_ext"
8129   with_xdbe="$withval"; with_xdbe_req="$withval"
8130 else
8131   with_xdbe=yes
8132 fi
8133
8134
8135
8136    case "$with_xdbe" in
8137     yes) ;;
8138     no)  ;;
8139
8140     /*)
8141      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
8142 echo "configure:8154: checking for DOUBLE-BUFFER headers" >&5
8143      d=$with_xdbe/include
8144      if test -d $d; then
8145        X_CFLAGS="-I$d $X_CFLAGS"
8146        echo "$ac_t""$d" 1>&6
8147      else
8148        echo "$ac_t""not found ($d: no such directory)" 1>&6
8149      fi
8150
8151      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
8152 echo "configure:8164: checking for DOUBLE-BUFFER libs" >&5
8153      d=$with_xdbe/lib
8154      if test -d $d; then
8155        X_LIBS="-L$d $X_LIBS"
8156        echo "$ac_t""$d" 1>&6
8157      else
8158        echo "$ac_t""not found ($d: no such directory)" 1>&6
8159      fi
8160
8161      # replace the directory string with "yes".
8162      with_xdbe_req="yes"
8163      with_xdbe=$with_xdbe_req
8164      ;;
8165
8166     *)
8167      echo ""
8168      echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
8169      echo "       If it is a directory, then \`DIR/include' will be added to"
8170      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8171      exit 1
8172      ;;
8173    esac
8174   
8175
8176 if test "$with_xdbe" = yes; then
8177
8178   
8179   ac_save_CPPFLAGS="$CPPFLAGS"
8180   if test \! -z "$includedir" ; then 
8181     CPPFLAGS="$CPPFLAGS -I$includedir"
8182   fi
8183   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8184   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
8185 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
8186 echo "configure:8198: checking for X11/extensions/Xdbe.h" >&5
8187 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8188   echo $ac_n "(cached) $ac_c" 1>&6
8189 else
8190   cat > conftest.$ac_ext <<EOF
8191 #line 8203 "configure"
8192 #include "confdefs.h"
8193 #include <X11/extensions/Xdbe.h>
8194 EOF
8195 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8196 { (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8197 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8198 if test -z "$ac_err"; then
8199   rm -rf conftest*
8200   eval "ac_cv_header_$ac_safe=yes"
8201 else
8202   echo "$ac_err" >&5
8203   echo "configure: failed program was:" >&5
8204   cat conftest.$ac_ext >&5
8205   rm -rf conftest*
8206   eval "ac_cv_header_$ac_safe=no"
8207 fi
8208 rm -f conftest*
8209 fi
8210 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8211   echo "$ac_t""yes" 1>&6
8212   have_xdbe=yes
8213 else
8214   echo "$ac_t""no" 1>&6
8215 fi
8216
8217   CPPFLAGS="$ac_save_CPPFLAGS"
8218   if test "$have_xdbe" = yes; then
8219     cat >> confdefs.h <<\EOF
8220 #define HAVE_DOUBLE_BUFFER_EXTENSION 1
8221 EOF
8222     
8223   fi
8224
8225 elif test "$with_xdbe" != no; then
8226   echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
8227   exit 1
8228 fi
8229
8230
8231 ###############################################################################
8232 #
8233 #       Check for the SGI XReadDisplay server extension.
8234 #
8235 #       Note: this has to be down here, rather than up with the other server
8236 #       extension tests, so that the output of `configure --help' is in the
8237 #       right order.  Arrgh!
8238 #
8239 ###############################################################################
8240
8241 have_readdisplay=no
8242 with_readdisplay_req=unspecified
8243 # Check whether --with-readdisplay or --without-readdisplay was given.
8244 if test "${with_readdisplay+set}" = set; then
8245   withval="$with_readdisplay"
8246   with_readdisplay="$withval"; with_readdisplay_req="$withval"
8247 else
8248   with_readdisplay=yes
8249 fi
8250
8251
8252
8253    case "$with_readdisplay" in
8254     yes) ;;
8255     no)  ;;
8256
8257     /*)
8258      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
8259 echo "configure:8271: checking for XReadDisplay headers" >&5
8260      d=$with_readdisplay/include
8261      if test -d $d; then
8262        X_CFLAGS="-I$d $X_CFLAGS"
8263        echo "$ac_t""$d" 1>&6
8264      else
8265        echo "$ac_t""not found ($d: no such directory)" 1>&6
8266      fi
8267
8268      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
8269 echo "configure:8281: checking for XReadDisplay libs" >&5
8270      d=$with_readdisplay/lib
8271      if test -d $d; then
8272        X_LIBS="-L$d $X_LIBS"
8273        echo "$ac_t""$d" 1>&6
8274      else
8275        echo "$ac_t""not found ($d: no such directory)" 1>&6
8276      fi
8277
8278      # replace the directory string with "yes".
8279      with_readdisplay_req="yes"
8280      with_readdisplay=$with_readdisplay_req
8281      ;;
8282
8283     *)
8284      echo ""
8285      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
8286      echo "       If it is a directory, then \`DIR/include' will be added to"
8287      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8288      exit 1
8289      ;;
8290    esac
8291   
8292
8293 if test "$with_readdisplay" = yes; then
8294   
8295   ac_save_CPPFLAGS="$CPPFLAGS"
8296   if test \! -z "$includedir" ; then 
8297     CPPFLAGS="$CPPFLAGS -I$includedir"
8298   fi
8299   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8300   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
8301 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
8302 echo "configure:8314: checking for X11/extensions/readdisplay.h" >&5
8303 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8304   echo $ac_n "(cached) $ac_c" 1>&6
8305 else
8306   cat > conftest.$ac_ext <<EOF
8307 #line 8319 "configure"
8308 #include "confdefs.h"
8309 #include <X11/extensions/readdisplay.h>
8310 EOF
8311 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8312 { (eval echo configure:8324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8313 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8314 if test -z "$ac_err"; then
8315   rm -rf conftest*
8316   eval "ac_cv_header_$ac_safe=yes"
8317 else
8318   echo "$ac_err" >&5
8319   echo "configure: failed program was:" >&5
8320   cat conftest.$ac_ext >&5
8321   rm -rf conftest*
8322   eval "ac_cv_header_$ac_safe=no"
8323 fi
8324 rm -f conftest*
8325 fi
8326 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8327   echo "$ac_t""yes" 1>&6
8328   cat >> confdefs.h <<\EOF
8329 #define HAVE_READ_DISPLAY_EXTENSION 1
8330 EOF
8331
8332 else
8333   echo "$ac_t""no" 1>&6
8334 fi
8335
8336   CPPFLAGS="$ac_save_CPPFLAGS"
8337 elif test "$with_readdisplay" != no; then
8338   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
8339   exit 1
8340 fi
8341
8342
8343 ###############################################################################
8344 #
8345 #       Check for the SGI Iris Video Library.
8346 #
8347 ###############################################################################
8348
8349 have_sgivideo=no
8350 with_sgivideo_req=unspecified
8351 # Check whether --with-sgivideo or --without-sgivideo was given.
8352 if test "${with_sgivideo+set}" = set; then
8353   withval="$with_sgivideo"
8354   with_sgivideo="$withval"; with_sgivideo_req="$withval"
8355 else
8356   with_sgivideo=yes
8357 fi
8358
8359
8360
8361    case "$with_sgivideo" in
8362     yes) ;;
8363     no)  ;;
8364
8365     /*)
8366      echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
8367 echo "configure:8379: checking for Iris Video headers" >&5
8368      d=$with_sgivideo/include
8369      if test -d $d; then
8370        X_CFLAGS="-I$d $X_CFLAGS"
8371        echo "$ac_t""$d" 1>&6
8372      else
8373        echo "$ac_t""not found ($d: no such directory)" 1>&6
8374      fi
8375
8376      echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
8377 echo "configure:8389: checking for Iris Video libs" >&5
8378      d=$with_sgivideo/lib
8379      if test -d $d; then
8380        X_LIBS="-L$d $X_LIBS"
8381        echo "$ac_t""$d" 1>&6
8382      else
8383        echo "$ac_t""not found ($d: no such directory)" 1>&6
8384      fi
8385
8386      # replace the directory string with "yes".
8387      with_sgivideo_req="yes"
8388      with_sgivideo=$with_sgivideo_req
8389      ;;
8390
8391     *)
8392      echo ""
8393      echo "error: argument to --with-sgivideo must be \"yes\", \"no\", or a directory."
8394      echo "       If it is a directory, then \`DIR/include' will be added to"
8395      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8396      exit 1
8397      ;;
8398    esac
8399   
8400
8401 if test "$with_sgivideo" = yes; then
8402   
8403   ac_save_CPPFLAGS="$CPPFLAGS"
8404   if test \! -z "$includedir" ; then 
8405     CPPFLAGS="$CPPFLAGS -I$includedir"
8406   fi
8407   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8408   ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
8409 echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
8410 echo "configure:8422: checking for dmedia/vl.h" >&5
8411 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8412   echo $ac_n "(cached) $ac_c" 1>&6
8413 else
8414   cat > conftest.$ac_ext <<EOF
8415 #line 8427 "configure"
8416 #include "confdefs.h"
8417 #include <dmedia/vl.h>
8418 EOF
8419 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8420 { (eval echo configure:8432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8421 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8422 if test -z "$ac_err"; then
8423   rm -rf conftest*
8424   eval "ac_cv_header_$ac_safe=yes"
8425 else
8426   echo "$ac_err" >&5
8427   echo "configure: failed program was:" >&5
8428   cat conftest.$ac_ext >&5
8429   rm -rf conftest*
8430   eval "ac_cv_header_$ac_safe=no"
8431 fi
8432 rm -f conftest*
8433 fi
8434 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8435   echo "$ac_t""yes" 1>&6
8436   have_sgivideo=yes
8437 else
8438   echo "$ac_t""no" 1>&6
8439 fi
8440
8441   CPPFLAGS="$ac_save_CPPFLAGS"
8442   if test "$have_sgivideo" = yes; then
8443     have_sgivideo=no
8444     echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
8445 echo "configure:8457: checking for vlOpenVideo in -lvl" >&5
8446 ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
8447 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8448   echo $ac_n "(cached) $ac_c" 1>&6
8449 else
8450   ac_save_LIBS="$LIBS"
8451 LIBS="-lvl  $LIBS"
8452 cat > conftest.$ac_ext <<EOF
8453 #line 8465 "configure"
8454 #include "confdefs.h"
8455 /* Override any gcc2 internal prototype to avoid an error.  */
8456 /* We use char because int might match the return type of a gcc2
8457     builtin and then its argument prototype would still apply.  */
8458 char vlOpenVideo();
8459
8460 int main() {
8461 vlOpenVideo()
8462 ; return 0; }
8463 EOF
8464 if { (eval echo configure:8476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8465   rm -rf conftest*
8466   eval "ac_cv_lib_$ac_lib_var=yes"
8467 else
8468   echo "configure: failed program was:" >&5
8469   cat conftest.$ac_ext >&5
8470   rm -rf conftest*
8471   eval "ac_cv_lib_$ac_lib_var=no"
8472 fi
8473 rm -f conftest*
8474 LIBS="$ac_save_LIBS"
8475
8476 fi
8477 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8478   echo "$ac_t""yes" 1>&6
8479   have_sgivideo=yes
8480 else
8481   echo "$ac_t""no" 1>&6
8482 fi
8483
8484     if test "$have_sgivideo" = yes; then
8485       SGI_VIDEO_OBJS="$(UTILS_BIN)/sgivideo.o"
8486       SGI_VIDEO_LIBS="-lvl"
8487       cat >> confdefs.h <<\EOF
8488 #define HAVE_SGI_VIDEO 1
8489 EOF
8490
8491     fi
8492   fi
8493 elif test "$with_sgivideo" != no; then
8494   echo "error: must be yes or no: --with-sgivideo=$with_sgivideo"
8495   exit 1
8496 fi
8497
8498
8499 ###############################################################################
8500 #
8501 #       Check for a program to generate random text.
8502 #
8503 #       Zippy is funnier than the idiocy generally spat out by `fortune',
8504 #       so try to find that, by invoking Emacs and asking it where its 
8505 #       libexec directory is ("yow" lives in there.)
8506 #
8507 #       If that doesn't work, see if fortune, zippy, or yow are on $PATH,
8508 #       and if so, use them.
8509 #
8510 #       If that doesn't work, look in /usr/games, and if it's there, use
8511 #       the full pathname.
8512 #
8513 ###############################################################################
8514
8515 with_zippy_req=""
8516 # Check whether --with-zippy or --without-zippy was given.
8517 if test "${with_zippy+set}" = set; then
8518   withval="$with_zippy"
8519   with_zippy_req="$withval"; with_zippy="$withval"
8520 else
8521   with_zippy=yes
8522 fi
8523
8524
8525 if test "$with_zippy" = no || test "$with_zippy" = yes ; then
8526   with_zippy=""
8527   with_zippy_req=""
8528 fi
8529
8530 if test -n "$with_zippy_req" ; then
8531   ac_cv_zippy_program=""
8532   case "$with_zippy_req" in
8533     /*)
8534       echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
8535 echo "configure:8547: checking for $with_zippy_req" >&5
8536       if test -x "$with_zippy_req" ; then
8537         echo "$ac_t""yes" 1>&6
8538       else
8539         echo "$ac_t""no" 1>&6
8540         with_zippy=""
8541       fi
8542     ;;
8543     *)
8544       # don't cache
8545       unset ac_cv_path_zip2
8546       # Extract the first word of "$with_zippy_req", so it can be a program name with args.
8547 set dummy $with_zippy_req; ac_word=$2
8548 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8549 echo "configure:8561: checking for $ac_word" >&5
8550 if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
8551   echo $ac_n "(cached) $ac_c" 1>&6
8552 else
8553   case "$zip2" in
8554   /*)
8555   ac_cv_path_zip2="$zip2" # Let the user override the test with a path.
8556   ;;
8557   ?:/*)                  
8558   ac_cv_path_zip2="$zip2" # Let the user override the test with a dos path.
8559   ;;
8560   *)
8561   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8562   ac_dummy="$PATH"
8563   for ac_dir in $ac_dummy; do 
8564     test -z "$ac_dir" && ac_dir=.
8565     if test -f $ac_dir/$ac_word; then
8566       ac_cv_path_zip2="$ac_dir/$ac_word"
8567       break
8568     fi
8569   done
8570   IFS="$ac_save_ifs"
8571   ;;
8572 esac
8573 fi
8574 zip2="$ac_cv_path_zip2"
8575 if test -n "$zip2"; then
8576   echo "$ac_t""$zip2" 1>&6
8577 else
8578   echo "$ac_t""no" 1>&6
8579 fi
8580
8581       if test "$zip2" = ""; then
8582         with_zippy=""
8583       fi
8584     ;;
8585   esac
8586   ac_cv_zippy_program="$with_zippy"
8587
8588 elif test -n "$ac_cv_zippy_program"; then
8589   echo "$ac_t""checking for zippy... (cached) $ac_cv_zippy_program" 1>&6
8590 fi
8591
8592 if test ! -n "$ac_cv_zippy_program"; then
8593
8594   for ac_prog in emacs
8595 do
8596 # Extract the first word of "$ac_prog", so it can be a program name with args.
8597 set dummy $ac_prog; ac_word=$2
8598 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8599 echo "configure:8611: checking for $ac_word" >&5
8600 if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
8601   echo $ac_n "(cached) $ac_c" 1>&6
8602 else
8603   if test -n "$emacs_exe"; then
8604   ac_cv_prog_emacs_exe="$emacs_exe" # Let the user override the test.
8605 else
8606   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8607   ac_dummy="$PATH"
8608   for ac_dir in $ac_dummy; do
8609     test -z "$ac_dir" && ac_dir=.
8610     if test -f $ac_dir/$ac_word; then
8611       ac_cv_prog_emacs_exe="$ac_prog"
8612       break
8613     fi
8614   done
8615   IFS="$ac_save_ifs"
8616 fi
8617 fi
8618 emacs_exe="$ac_cv_prog_emacs_exe"
8619 if test -n "$emacs_exe"; then
8620   echo "$ac_t""$emacs_exe" 1>&6
8621 else
8622   echo "$ac_t""no" 1>&6
8623 fi
8624
8625 test -n "$emacs_exe" && break
8626 done
8627
8628   for ac_prog in xemacs
8629 do
8630 # Extract the first word of "$ac_prog", so it can be a program name with args.
8631 set dummy $ac_prog; ac_word=$2
8632 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8633 echo "configure:8645: checking for $ac_word" >&5
8634 if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
8635   echo $ac_n "(cached) $ac_c" 1>&6
8636 else
8637   if test -n "$xemacs_exe"; then
8638   ac_cv_prog_xemacs_exe="$xemacs_exe" # Let the user override the test.
8639 else
8640   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8641   ac_dummy="$PATH"
8642   for ac_dir in $ac_dummy; do
8643     test -z "$ac_dir" && ac_dir=.
8644     if test -f $ac_dir/$ac_word; then
8645       ac_cv_prog_xemacs_exe="$ac_prog"
8646       break
8647     fi
8648   done
8649   IFS="$ac_save_ifs"
8650 fi
8651 fi
8652 xemacs_exe="$ac_cv_prog_xemacs_exe"
8653 if test -n "$xemacs_exe"; then
8654   echo "$ac_t""$xemacs_exe" 1>&6
8655 else
8656   echo "$ac_t""no" 1>&6
8657 fi
8658
8659 test -n "$xemacs_exe" && break
8660 done
8661
8662
8663   ac_cv_zippy_program=""
8664   eargs='-batch -q -nw --eval'
8665
8666   if test -n "$emacs_exe" ; then
8667     echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
8668 echo "configure:8680: checking for emacs yow" >&5
8669     #
8670     # get emacs to tell us where the libexec directory is.
8671     #
8672     dir=`$emacs_exe $eargs '(princ (concat exec-directory "\n"))' \
8673          2>/dev/null | tail -1`
8674     dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
8675     #
8676     # try running libexec/yow and see if it exits without error.
8677     #
8678     if test x"$dir" != x -a -x "$dir/yow" ; then
8679       if $dir/yow >&- 2>&- ; then
8680         ac_cv_zippy_program="$dir/yow"
8681         echo "$ac_t""$ac_cv_zippy_program" 1>&6
8682       else
8683         echo "$ac_t""no" 1>&6
8684       fi
8685     fi
8686   fi
8687
8688   if test -z "$ac_cv_zippy_program" ; then
8689     echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
8690 echo "configure:8702: checking for xemacs yow" >&5
8691     if test -n "$xemacs_exe" ; then
8692       #
8693       # get xemacs to tell us where the libexec directory is.
8694       #
8695       dir=`$xemacs_exe $eargs '(princ (concat exec-directory "\n"))' \
8696            2>/dev/null | tail -1`
8697       dir=`echo "$dir" | sed 's@///*@/@g;s@/$@@'`
8698       #
8699       # try running libexec/yow and see if it exits without error.
8700       #
8701       if test x"$dir" != x -a -x "$dir/yow" ; then
8702         if $dir/yow >&- 2>&- ; then
8703           ac_cv_zippy_program="$dir/yow"
8704           echo "$ac_t""$ac_cv_zippy_program" 1>&6
8705         else
8706           #
8707           # in some xemacs installations, the pathname of the yow.lines file
8708           # isn't hardcoded into the yow executable, and must be passed on 
8709           # the command line.  See if it's in libexec/../etc/.
8710
8711           # M4 sucks!!
8712           
8713           dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
8714           
8715
8716           yowlines="$dir_up/etc/yow.lines"
8717           if $dir/yow -f $yowlines >&- 2>&- ; then
8718             ac_cv_zippy_program="$dir/yow -f $yowlines"
8719             echo "$ac_t""$ac_cv_zippy_program" 1>&6
8720           else
8721             #
8722             # In newer XEmacs releases, yow.lines is in a different place,
8723             # and the easiest way to get it is by calling the new function
8724             # `locate-data-file'.
8725             #
8726             yowlines=`$xemacs_exe $eargs \
8727               '(princ (concat (locate-data-file "yow.lines") "\n"))' \
8728               2>/dev/null | tail -1`
8729             if $dir/yow -f $yowlines >&- 2>&- ; then
8730               ac_cv_zippy_program="$dir/yow -f $yowlines"
8731               echo "$ac_t""$ac_cv_zippy_program" 1>&6
8732             else
8733               echo "$ac_t""no" 1>&6
8734             fi
8735           fi
8736         fi
8737       fi
8738     fi
8739   fi
8740
8741   # if that didn't work, try for some other programs...
8742   if test -z "$ac_cv_zippy_program" ; then
8743     fortune=''
8744     for ac_prog in fortune zippy yow
8745 do
8746 # Extract the first word of "$ac_prog", so it can be a program name with args.
8747 set dummy $ac_prog; ac_word=$2
8748 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8749 echo "configure:8761: checking for $ac_word" >&5
8750 if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
8751   echo $ac_n "(cached) $ac_c" 1>&6
8752 else
8753   if test -n "$fortune"; then
8754   ac_cv_prog_fortune="$fortune" # Let the user override the test.
8755 else
8756   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8757   ac_dummy="$PATH"
8758   for ac_dir in $ac_dummy; do
8759     test -z "$ac_dir" && ac_dir=.
8760     if test -f $ac_dir/$ac_word; then
8761       ac_cv_prog_fortune="$ac_prog"
8762       break
8763     fi
8764   done
8765   IFS="$ac_save_ifs"
8766 fi
8767 fi
8768 fortune="$ac_cv_prog_fortune"
8769 if test -n "$fortune"; then
8770   echo "$ac_t""$fortune" 1>&6
8771 else
8772   echo "$ac_t""no" 1>&6
8773 fi
8774
8775 test -n "$fortune" && break
8776 done
8777
8778     # if that didn't work, try for those programs in /usr/games...
8779     if test -z "$fortune" ; then
8780       for ac_prog in fortune zippy yow
8781 do
8782 # Extract the first word of "$ac_prog", so it can be a program name with args.
8783 set dummy $ac_prog; ac_word=$2
8784 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8785 echo "configure:8797: checking for $ac_word" >&5
8786 if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
8787   echo $ac_n "(cached) $ac_c" 1>&6
8788 else
8789   case "$fortune" in
8790   /*)
8791   ac_cv_path_fortune="$fortune" # Let the user override the test with a path.
8792   ;;
8793   ?:/*)                  
8794   ac_cv_path_fortune="$fortune" # Let the user override the test with a dos path.
8795   ;;
8796   *)
8797   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
8798   ac_dummy="/usr/games:/usr/local/games:$PATH"
8799   for ac_dir in $ac_dummy; do 
8800     test -z "$ac_dir" && ac_dir=.
8801     if test -f $ac_dir/$ac_word; then
8802       ac_cv_path_fortune="$ac_dir/$ac_word"
8803       break
8804     fi
8805   done
8806   IFS="$ac_save_ifs"
8807   ;;
8808 esac
8809 fi
8810 fortune="$ac_cv_path_fortune"
8811 if test -n "$fortune"; then
8812   echo "$ac_t""$fortune" 1>&6
8813 else
8814   echo "$ac_t""no" 1>&6
8815 fi
8816
8817 test -n "$fortune" && break
8818 done
8819 test -n "$fortune" || fortune="fortune"
8820
8821     fi
8822   fi
8823 fi
8824
8825 if test -z "$ac_cv_zippy_program" ; then
8826   ac_cv_zippy_program=fortune
8827 fi
8828
8829 cat >> confdefs.h <<EOF
8830 #define ZIPPY_PROGRAM "$ac_cv_zippy_program"
8831 EOF
8832
8833
8834
8835 ###############################################################################
8836 #
8837 #       Done testing.  Now, set up the various -I and -L variables,
8838 #       and decide which GUI program to build by default.
8839 #
8840 ###############################################################################
8841
8842 DEPEND=makedepend
8843 DEPEND_FLAGS=
8844 DEPEND_DEFINES=
8845
8846
8847 if test \! -z "$includedir" ; then 
8848   INCLUDES="$INCLUDES -I$includedir"
8849 fi
8850
8851 if test \! -z "$libdir" ; then
8852   LDFLAGS="$LDFLAGS -L$libdir"
8853 fi
8854
8855
8856 DEMO_MAN="xscreensaver-demo-old.man"
8857 ALL_DEMO_PROGRAMS=
8858 if test "$have_athena" = yes; then
8859   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw
8860   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
8861 fi
8862 if test "$have_athena3d" = yes; then
8863   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xaw3d
8864   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
8865 fi
8866 if test "$have_motif" = yes; then
8867   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
8868   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
8869 fi
8870 if test "$have_gtk" = yes; then
8871   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
8872   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
8873   DEMO_MAN="xscreensaver-demo.man"
8874 fi
8875
8876
8877 if test "$have_kerberos" = yes; then
8878   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
8879   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
8880 fi
8881 if test "$have_pam" = yes; then
8882   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
8883   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
8884   INSTALL_PAM="install-pam"
8885 fi
8886   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
8887   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
8888
8889
8890 if test "$enable_locking" = yes; then
8891   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
8892   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
8893 else
8894   LOCK_SRCS='$(NOLOCK_SRCS_1)'
8895   LOCK_OBJS='$(NOLOCK_OBJS_1)'
8896 fi
8897
8898 if test "$need_setuid" = yes; then
8899   NEED_SETUID=yes
8900   INSTALL_SETUID='$(INSTALL) $(SUID_FLAGS)'
8901 else
8902   NEED_SETUID=no
8903   INSTALL_SETUID='$(INSTALL_PROGRAM)'
8904 fi
8905
8906 tab='   '
8907 if test "$have_gl" = yes; then
8908   GL_EXES='$(GL_EXES)'
8909   GL_MEN='$(GL_MEN)'
8910   GL_KLUDGE="${tab}  "
8911 else
8912   GL_KLUDGE="-${tab}  "
8913 fi
8914
8915 if test "$have_gle" = yes; then
8916   GLE_EXES='$(GLE_EXES)'
8917   GLE_MEN='$(GLE_MEN)'
8918   GLE_KLUDGE="${tab}   "
8919 else
8920   GLE_KLUDGE="-${tab}   "
8921 fi
8922
8923
8924 ###############################################################################
8925 #
8926 #       Perform substitutions and write Makefiles.
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
8965
8966
8967
8968
8969 APPDEFAULTS=$ac_x_app_defaults
8970
8971
8972
8973
8974
8975
8976
8977 trap '' 1 2 15
8978 cat > confcache <<\EOF
8979 # This file is a shell script that caches the results of configure
8980 # tests run on this system so they can be shared between configure
8981 # scripts and configure runs.  It is not useful on other systems.
8982 # If it contains results you don't want to keep, you may remove or edit it.
8983 #
8984 # By default, configure uses ./config.cache as the cache file,
8985 # creating it if it does not exist already.  You can give configure
8986 # the --cache-file=FILE option to use a different cache file; that is
8987 # what configure does when it calls configure scripts in
8988 # subdirectories, so they share the cache.
8989 # Giving --cache-file=/dev/null disables caching, for debugging configure.
8990 # config.status only pays attention to the cache file if you give it the
8991 # --recheck option to rerun configure.
8992 #
8993 EOF
8994 # The following way of writing the cache mishandles newlines in values,
8995 # but we know of no workaround that is simple, portable, and efficient.
8996 # So, don't put newlines in cache variables' values.
8997 # Ultrix sh set writes to stderr and can't be redirected directly,
8998 # and sets the high bit in the cache file unless we assign to the vars.
8999 (set) 2>&1 |
9000   case `(ac_space=' '; set | grep ac_space) 2>&1` in
9001   *ac_space=\ *)
9002     # `set' does not quote correctly, so add quotes (double-quote substitution
9003     # turns \\\\ into \\, and sed turns \\ into \).
9004     sed -n \
9005       -e "s/'/'\\\\''/g" \
9006       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
9007     ;;
9008   *)
9009     # `set' quotes correctly as required by POSIX, so do not add quotes.
9010     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
9011     ;;
9012   esac >> confcache
9013 if cmp -s $cache_file confcache; then
9014   :
9015 else
9016   if test -w $cache_file; then
9017     echo "updating cache $cache_file"
9018     cat confcache > $cache_file
9019   else
9020     echo "not updating unwritable cache $cache_file"
9021   fi
9022 fi
9023 rm -f confcache
9024
9025 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
9026
9027 test "x$prefix" = xNONE && prefix=$ac_default_prefix
9028 # Let make expand exec_prefix.
9029 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
9030
9031 # Any assignment to VPATH causes Sun make to only execute
9032 # the first set of double-colon rules, so remove it if not needed.
9033 # If there is a colon in the path, we need to keep it.
9034 if test "x$srcdir" = x.; then
9035   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
9036 fi
9037
9038 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
9039
9040 DEFS=-DHAVE_CONFIG_H
9041
9042 # Without the "./", some shells look in PATH for config.status.
9043 : ${CONFIG_STATUS=./config.status}
9044
9045 echo creating $CONFIG_STATUS
9046 rm -f $CONFIG_STATUS
9047 cat > $CONFIG_STATUS <<EOF
9048 #! /bin/sh
9049 # Generated automatically by configure.
9050 # Run this file to recreate the current configuration.
9051 # This directory was configured as follows,
9052 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
9053 #
9054 # $0 $ac_configure_args
9055 #
9056 # Compiler output produced by configure, useful for debugging
9057 # configure, is in ./config.log if it exists.
9058
9059 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
9060 for ac_option
9061 do
9062   case "\$ac_option" in
9063   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
9064     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
9065     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
9066   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
9067     echo "$CONFIG_STATUS generated by autoconf version 2.13"
9068     exit 0 ;;
9069   -help | --help | --hel | --he | --h)
9070     echo "\$ac_cs_usage"; exit 0 ;;
9071   *) echo "\$ac_cs_usage"; exit 1 ;;
9072   esac
9073 done
9074
9075 ac_given_srcdir=$srcdir
9076 ac_given_INSTALL="$INSTALL"
9077
9078 trap 'rm -fr `echo "Makefile
9079           utils/Makefile
9080           driver/Makefile
9081           hacks/Makefile
9082           hacks/glx/Makefile
9083           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
9084 EOF
9085 cat >> $CONFIG_STATUS <<EOF
9086
9087 # Protect against being on the right side of a sed subst in config.status.
9088 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
9089  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
9090 $ac_vpsub
9091 $extrasub
9092 s%@SHELL@%$SHELL%g
9093 s%@CFLAGS@%$CFLAGS%g
9094 s%@CPPFLAGS@%$CPPFLAGS%g
9095 s%@CXXFLAGS@%$CXXFLAGS%g
9096 s%@FFLAGS@%$FFLAGS%g
9097 s%@DEFS@%$DEFS%g
9098 s%@LDFLAGS@%$LDFLAGS%g
9099 s%@LIBS@%$LIBS%g
9100 s%@exec_prefix@%$exec_prefix%g
9101 s%@prefix@%$prefix%g
9102 s%@program_transform_name@%$program_transform_name%g
9103 s%@bindir@%$bindir%g
9104 s%@sbindir@%$sbindir%g
9105 s%@libexecdir@%$libexecdir%g
9106 s%@datadir@%$datadir%g
9107 s%@sysconfdir@%$sysconfdir%g
9108 s%@sharedstatedir@%$sharedstatedir%g
9109 s%@localstatedir@%$localstatedir%g
9110 s%@libdir@%$libdir%g
9111 s%@includedir@%$includedir%g
9112 s%@oldincludedir@%$oldincludedir%g
9113 s%@infodir@%$infodir%g
9114 s%@mandir@%$mandir%g
9115 s%@host@%$host%g
9116 s%@host_alias@%$host_alias%g
9117 s%@host_cpu@%$host_cpu%g
9118 s%@host_vendor@%$host_vendor%g
9119 s%@host_os@%$host_os%g
9120 s%@CC@%$CC%g
9121 s%@CPP@%$CPP%g
9122 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
9123 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
9124 s%@INSTALL_DATA@%$INSTALL_DATA%g
9125 s%@SET_MAKE@%$SET_MAKE%g
9126 s%@PERL@%$PERL%g
9127 s%@X_CFLAGS@%$X_CFLAGS%g
9128 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
9129 s%@X_LIBS@%$X_LIBS%g
9130 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
9131 s%@glib_config@%$glib_config%g
9132 s%@gtk_config@%$gtk_config%g
9133 s%@zip2@%$zip2%g
9134 s%@emacs_exe@%$emacs_exe%g
9135 s%@xemacs_exe@%$xemacs_exe%g
9136 s%@fortune@%$fortune%g
9137 s%@INCLUDES@%$INCLUDES%g
9138 s%@PREFERRED_DEMO_PROGRAM@%$PREFERRED_DEMO_PROGRAM%g
9139 s%@ALL_DEMO_PROGRAMS@%$ALL_DEMO_PROGRAMS%g
9140 s%@DEMO_MAN@%$DEMO_MAN%g
9141 s%@SAVER_LIBS@%$SAVER_LIBS%g
9142 s%@MOTIF_LIBS@%$MOTIF_LIBS%g
9143 s%@GTK_LIBS@%$GTK_LIBS%g
9144 s%@ATHENA_LIBS@%$ATHENA_LIBS%g
9145 s%@ATHENA3D_LIBS@%$ATHENA3D_LIBS%g
9146 s%@HACK_LIBS@%$HACK_LIBS%g
9147 s%@XPM_LIBS@%$XPM_LIBS%g
9148 s%@GL_LIBS@%$GL_LIBS%g
9149 s%@GLE_LIBS@%$GLE_LIBS%g
9150 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
9151 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
9152 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
9153 s%@NEED_SETUID@%$NEED_SETUID%g
9154 s%@INSTALL_PAM@%$INSTALL_PAM%g
9155 s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
9156 s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
9157 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
9158 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
9159 s%@XMU_SRCS@%$XMU_SRCS%g
9160 s%@XMU_OBJS@%$XMU_OBJS%g
9161 s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
9162 s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
9163 s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
9164 s%@LOCK_SRCS@%$LOCK_SRCS%g
9165 s%@LOCK_OBJS@%$LOCK_OBJS%g
9166 s%@GL_EXES@%$GL_EXES%g
9167 s%@GL_MEN@%$GL_MEN%g
9168 s%@GL_KLUDGE@%$GL_KLUDGE%g
9169 s%@GLE_EXES@%$GLE_EXES%g
9170 s%@GLE_MEN@%$GLE_MEN%g
9171 s%@GLE_KLUDGE@%$GLE_KLUDGE%g
9172 s%@HACKDIR@%$HACKDIR%g
9173 s%@APPDEFAULTS@%$APPDEFAULTS%g
9174 s%@DEPEND@%$DEPEND%g
9175 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
9176 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
9177
9178 CEOF
9179 EOF
9180
9181 cat >> $CONFIG_STATUS <<\EOF
9182
9183 # Split the substitutions into bite-sized pieces for seds with
9184 # small command number limits, like on Digital OSF/1 and HP-UX.
9185 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
9186 ac_file=1 # Number of current file.
9187 ac_beg=1 # First line for current file.
9188 ac_end=$ac_max_sed_cmds # Line after last line for current file.
9189 ac_more_lines=:
9190 ac_sed_cmds=""
9191 while $ac_more_lines; do
9192   if test $ac_beg -gt 1; then
9193     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
9194   else
9195     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
9196   fi
9197   if test ! -s conftest.s$ac_file; then
9198     ac_more_lines=false
9199     rm -f conftest.s$ac_file
9200   else
9201     if test -z "$ac_sed_cmds"; then
9202       ac_sed_cmds="sed -f conftest.s$ac_file"
9203     else
9204       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
9205     fi
9206     ac_file=`expr $ac_file + 1`
9207     ac_beg=$ac_end
9208     ac_end=`expr $ac_end + $ac_max_sed_cmds`
9209   fi
9210 done
9211 if test -z "$ac_sed_cmds"; then
9212   ac_sed_cmds=cat
9213 fi
9214 EOF
9215
9216 cat >> $CONFIG_STATUS <<EOF
9217
9218 CONFIG_FILES=\${CONFIG_FILES-"Makefile
9219           utils/Makefile
9220           driver/Makefile
9221           hacks/Makefile
9222           hacks/glx/Makefile
9223           driver/XScreenSaver.ad"}
9224 EOF
9225 cat >> $CONFIG_STATUS <<\EOF
9226 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
9227   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9228   case "$ac_file" in
9229   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9230        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9231   *) ac_file_in="${ac_file}.in" ;;
9232   esac
9233
9234   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
9235
9236   # Remove last slash and all that follows it.  Not all systems have dirname.
9237   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9238   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9239     # The file is in a subdirectory.
9240     test ! -d "$ac_dir" && mkdir "$ac_dir"
9241     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9242     # A "../" for each directory in $ac_dir_suffix.
9243     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9244   else
9245     ac_dir_suffix= ac_dots=
9246   fi
9247
9248   case "$ac_given_srcdir" in
9249   .)  srcdir=.
9250       if test -z "$ac_dots"; then top_srcdir=.
9251       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9252   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9253   *) # Relative path.
9254     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9255     top_srcdir="$ac_dots$ac_given_srcdir" ;;
9256   esac
9257
9258   case "$ac_given_INSTALL" in
9259   [/$]*) INSTALL="$ac_given_INSTALL" ;;
9260   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
9261   esac
9262
9263   echo creating "$ac_file"
9264   rm -f "$ac_file"
9265   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9266   case "$ac_file" in
9267   *Makefile*) ac_comsub="1i\\
9268 # $configure_input" ;;
9269   *) ac_comsub= ;;
9270   esac
9271
9272   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9273   sed -e "$ac_comsub
9274 s%@configure_input@%$configure_input%g
9275 s%@srcdir@%$srcdir%g
9276 s%@top_srcdir@%$top_srcdir%g
9277 s%@INSTALL@%$INSTALL%g
9278 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9279 fi; done
9280 rm -f conftest.s*
9281
9282 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9283 # NAME is the cpp macro being defined and VALUE is the value it is being given.
9284 #
9285 # ac_d sets the value in "#define NAME VALUE" lines.
9286 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
9287 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
9288 ac_dC='\3'
9289 ac_dD='%g'
9290 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9291 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9292 ac_uB='\([      ]\)%\1#\2define\3'
9293 ac_uC=' '
9294 ac_uD='\4%g'
9295 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9296 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
9297 ac_eB='$%\1#\2define\3'
9298 ac_eC=' '
9299 ac_eD='%g'
9300
9301 if test "${CONFIG_HEADERS+set}" != set; then
9302 EOF
9303 cat >> $CONFIG_STATUS <<EOF
9304   CONFIG_HEADERS="config.h"
9305 EOF
9306 cat >> $CONFIG_STATUS <<\EOF
9307 fi
9308 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
9309   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9310   case "$ac_file" in
9311   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9312        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9313   *) ac_file_in="${ac_file}.in" ;;
9314   esac
9315
9316   echo creating $ac_file
9317
9318   rm -f conftest.frag conftest.in conftest.out
9319   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9320   cat $ac_file_inputs > conftest.in
9321
9322 EOF
9323
9324 # Transform confdefs.h into a sed script conftest.vals that substitutes
9325 # the proper values into config.h.in to produce config.h.  And first:
9326 # Protect against being on the right side of a sed subst in config.status.
9327 # Protect against being in an unquoted here document in config.status.
9328 rm -f conftest.vals
9329 cat > conftest.hdr <<\EOF
9330 s/[\\&%]/\\&/g
9331 s%[\\$`]%\\&%g
9332 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9333 s%ac_d%ac_u%gp
9334 s%ac_u%ac_e%gp
9335 EOF
9336 sed -n -f conftest.hdr confdefs.h > conftest.vals
9337 rm -f conftest.hdr
9338
9339 # This sed command replaces #undef with comments.  This is necessary, for
9340 # example, in the case of _POSIX_SOURCE, which is predefined and required
9341 # on some systems where configure will not decide to define it.
9342 cat >> conftest.vals <<\EOF
9343 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9344 EOF
9345
9346 # Break up conftest.vals because some shells have a limit on
9347 # the size of here documents, and old seds have small limits too.
9348
9349 rm -f conftest.tail
9350 while :
9351 do
9352   ac_lines=`grep -c . conftest.vals`
9353   # grep -c gives empty output for an empty file on some AIX systems.
9354   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9355   # Write a limited-size here document to conftest.frag.
9356   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9357   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9358   echo 'CEOF
9359   sed -f conftest.frag conftest.in > conftest.out
9360   rm -f conftest.in
9361   mv conftest.out conftest.in
9362 ' >> $CONFIG_STATUS
9363   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9364   rm -f conftest.vals
9365   mv conftest.tail conftest.vals
9366 done
9367 rm -f conftest.vals
9368
9369 cat >> $CONFIG_STATUS <<\EOF
9370   rm -f conftest.frag conftest.h
9371   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
9372   cat conftest.in >> conftest.h
9373   rm -f conftest.in
9374   if cmp -s $ac_file conftest.h 2>/dev/null; then
9375     echo "$ac_file is unchanged"
9376     rm -f conftest.h
9377   else
9378     # Remove last slash and all that follows it.  Not all systems have dirname.
9379       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9380       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9381       # The file is in a subdirectory.
9382       test ! -d "$ac_dir" && mkdir "$ac_dir"
9383     fi
9384     rm -f $ac_file
9385     mv conftest.h $ac_file
9386   fi
9387 fi; done
9388
9389 EOF
9390 cat >> $CONFIG_STATUS <<EOF
9391
9392 EOF
9393 cat >> $CONFIG_STATUS <<\EOF
9394
9395 exit 0
9396 EOF
9397 chmod +x $CONFIG_STATUS
9398 rm -fr confdefs* $ac_clean_files
9399 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9400
9401
9402 ###############################################################################
9403 #
9404 #       Print some warnings at the end.
9405 #
9406 ###############################################################################
9407
9408 warn_prefix_1="    Warning:"
9409 warn_prefix_2="       Note:"
9410 warn_prefix="$warn_prefix_1"
9411
9412 warning=no
9413 warnsep='    #################################################################'
9414
9415 warnpre() {
9416   if test "$warning" = no ; then
9417     echo '' ; echo "$warnsep" ; echo ''
9418     warning=yes
9419   fi
9420 }
9421
9422 warn() {
9423   warnpre
9424   if test "$warning" = long ; then echo '' ; fi
9425   warning=yes
9426   echo "$warn_prefix $@"
9427 }
9428
9429 warnL() {
9430   was=$warning
9431   warnpre
9432   warning=yes
9433   if test "$was" != no ; then echo '' ; fi
9434   echo "$warn_prefix $@"
9435 }
9436
9437 warn2() {
9438   echo "             $@"
9439   warning=long
9440 }
9441
9442 note() {
9443   warn_prefix="$warn_prefix_2"
9444   warn $@
9445   warn_prefix="$warn_prefix_1"
9446 }
9447
9448 noteL() {
9449   warn_prefix="$warn_prefix_2"
9450   warnL $@
9451   warn_prefix="$warn_prefix_1"
9452 }
9453
9454
9455 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
9456   warn 'The SGI saver extension was requested, but was not found.'
9457 fi
9458
9459 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
9460   warn 'The MIT saver extension was requested, but was not found.'
9461 fi
9462
9463 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
9464   warn 'The XIdle extension was requested, but was not found.'
9465 fi
9466
9467 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
9468   warn 'The XSHM extension was requested, but was not found.'
9469 fi
9470
9471 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
9472   warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
9473 fi
9474
9475 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
9476   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
9477 fi
9478
9479 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
9480   warn 'The DPMS extension was requested, but was not found.'
9481 fi
9482
9483 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
9484   warn 'The XF86VMODE extension was requested, but was not found.'
9485 fi
9486
9487 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
9488   warn "Checking of /proc/interrupts was requested, but it's bogus."
9489 fi
9490
9491
9492 if test "$have_motif" = no -a "$have_gtk" = no -a "$have_athena" = no ; then
9493   warnL "None of Motif, Gtk, or Athena widgets seem to be available;"
9494   warn2 "the \`xscreensaver-demo' program requires one of these."
9495
9496 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
9497   warnL "Use of Motif was requested, but it wasn't found;"
9498   if test "$have_gtk" = yes; then
9499     warn2 "Gtk will be used instead."
9500   else
9501     warn2 "Athena will be used instead."
9502   fi
9503
9504 elif test "$jurassic_gtk" = yes ; then
9505
9506   pref_gtk=1.2
9507
9508   v="$ac_gtk_version_string"
9509   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
9510     warnL "Use of Gtk was requested, but its version number is unknown;"
9511   elif test "$with_gtk_req" = yes ; then
9512     warnL "Use of Gtk was requested, but it is version $v;"
9513   else
9514     warnL "Gtk was found on this system, but it is version $v;"
9515   fi
9516
9517   if test "$have_motif" = yes; then
9518     which="Motif"
9519   else
9520     which="Athena"
9521   fi
9522
9523   warn2 "Gtk $pref_gtk or newer is required.  $which will be used instead."
9524
9525 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
9526   warnL "Use of Gtk was requested, but it wasn't found;"
9527   if test "$have_motif" = yes; then
9528     warn2 "Motif will be used instead."
9529   else
9530     warn2 "Athena will be used instead."
9531   fi
9532
9533 elif test "$with_athena_req" = yes -a "$have_athena" = no ; then
9534   warnL "Use of Athena was requested, but it wasn't found;"
9535   if test "$have_gtk" = yes; then
9536     warn2 "Gtk will be used instead."
9537   else
9538     warn2 "Motif will be used instead."
9539   fi
9540 fi
9541
9542
9543 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
9544
9545   preferred_lesstif=0.86
9546
9547   if test "$lesstif_version" = unknown; then
9548     warnL "Unable to determine the LessTif version number!"
9549     warn2 "Make sure you are using version $preferred_lesstif or newer."
9550     warn2 "See <http://www.lesstif.org/>."
9551
9552   elif test \! $lesstif_version -gt 82; then
9553     warnL "LessTif version $lesstif_version_string is being used."
9554     warn2 "LessTif versions 0.82 and earlier are too buggy to"
9555     warn2 "use with XScreenSaver; it is strongly recommended"
9556     warn2 "that you upgrade to at least version $preferred_lesstif!"
9557     warn2 "See <http://www.lesstif.org/>."
9558   fi
9559 fi
9560
9561 if test "$have_athena" = yes -a "$have_motif" = no -a "$have_gtk" = no; then
9562     warnL "Athena widgets are being used instead of Motif or Gtk."
9563     warn2 "The \`xscreensaver-demo' program looks much better"
9564     warn2 "with Motif or Gtk.  Wouldn't you rather be using Motif?"
9565     warn2 "Motif is shipped by every commercial Unix vendor,"
9566     warn2 "and there is a free implementation available as"
9567     warn2 "well: see <http://www.lesstif.org/>.  Gtk is shipped"
9568     warn2 "with most Linux and BSD distributions."
9569 fi
9570
9571
9572 if test "$have_xpm" = no ; then
9573   if test "$with_xpm_req" = yes ; then
9574     warnL 'Use of XPM was requested, but it was not found.'
9575   elif test "$with_xpm_req" = no ; then
9576     noteL 'The XPM library is not being used.'
9577   else
9578     noteL 'The XPM library was not found.'
9579   fi
9580
9581   echo ''
9582   warn2 'Some of the demos will not be as colorful as they'
9583   warn2 'could be.  You might want to consider installing XPM'
9584   warn2 'and re-running configure.  (Remember to delete the'
9585   warn2 'config.cache file first.)  You can find XPM at most'
9586   warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
9587 fi
9588
9589
9590 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
9591   preferred_mesagl=3.0
9592
9593   if test "$ac_mesagl_version" = unknown; then
9594     warnL "Unable to determine the MesaGL version number!"
9595     warn2 "Make sure you are using version $preferred_mesagl or newer."
9596
9597   elif test \! "$ac_mesagl_version" -gt 2006; then
9598     warnL "MesaGL version $ac_mesagl_version_string is being used."
9599     warn2 "MesaGL versions 2.6 and earlier have a security bug."
9600     warn2 "It is strongly recommended that you upgrade to at"
9601     warn2 "least version $preferred_mesagl."
9602   fi
9603 fi
9604
9605 if test "$have_gl" = no ; then
9606   if test "$with_gl_req" = yes ; then
9607     warnL 'Use of GL was requested, but it was not found.'
9608   elif test "$with_gl_req" = no ; then
9609     noteL 'The OpenGL 3D library is not being used.'
9610   else
9611     noteL 'The OpenGL 3D library was not found.'
9612   fi
9613
9614   if test "$gl_halfassed" = yes ; then
9615     echo ''
9616     warn2 'More specifically, we found the headers, but not the'
9617     warn2 'libraries; so either GL is half-installed on this'
9618     warn2 "system, or something else went wrong.  The \`config.log'"
9619     warn2 'file might contain some clues.'
9620   fi
9621
9622   echo ''
9623   warn2 'Those demos which use 3D will not be built or installed.'
9624   warn2 'You might want to consider installing OpenGL and'
9625   warn2 're-running configure.  (Remember to delete the'
9626   warn2 "config.cache file first.)  If your vendor doesn't ship"
9627   warn2 'their own implementation of OpenGL, you can get a free'
9628   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
9629   warn2 'info, see <http://www.opengl.org/>.'
9630
9631 fi
9632
9633
9634 if test "$have_gl" = yes -a "$have_gle" = no ; then
9635   if test "$with_gle_req" = yes ; then
9636     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
9637     warn2 'it was not found (though the OpenGL library was found, and'
9638     warn2 'is being used.)'
9639   elif test "$with_gle_req" = no ; then
9640     noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
9641     warn2 'library is not.'
9642   else
9643     noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
9644     warn2 'was not.'
9645   fi
9646
9647   if test "$gle_halfassed" = yes ; then
9648     echo ''
9649     warn2 'More specifically, we found the headers, but not the'
9650     warn2 'libraries; so either GLE is half-installed on this'
9651     warn2 "system, or something else went wrong.  The \`config.log'"
9652     warn2 'file might contain some clues.'
9653   fi
9654
9655   echo ''
9656   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
9657   warn2 'will not be built or installed.  You might want to consider'
9658   warn2 'installing GLE and re-running configure.  (Remember to delete'
9659   warn2 'the config.cache file first.)  You can find the GLE library'
9660   warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
9661   warn2 'see <http://www.opengl.org/>.'
9662
9663 fi
9664
9665
9666 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
9667   warn 'Use of XReadDisplay was requested, but it was not found.'
9668 fi
9669
9670 if test "$with_sgivideo_req" = yes -a "$have_sgivideo" = no ; then
9671   warn 'Use of the Iris Video Library was requested, but it was not found.'
9672 fi
9673
9674 if test -n "$with_zippy_req"; then
9675   if test "$with_zippy_req" != "$ac_cv_zippy_program" ; then
9676     warnL "$with_zippy_req was requested as the Zippy program,"
9677     warn2 "but was not found.  The default will be used instead."
9678   fi
9679 fi
9680
9681 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
9682   warn 'Use of Kerberos was requested, but it was not found.'
9683 fi
9684
9685 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
9686   warn 'Use of PAM was requested, but it was not found.'
9687 fi
9688
9689 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
9690   warn 'Use of shadow passwords was requested, but they were not found.'
9691 fi
9692
9693
9694 # You are in a twisty maze of namespaces and syntaxes, all alike.
9695 # Fuck the skull of Unix.
9696 #
9697 eval bindir=${bindir}
9698 eval bindir=${bindir}
9699 eval bindir=${bindir}
9700 eval bindir=${bindir}
9701 eval bindir=${bindir}
9702 eval bindir=${bindir}
9703 eval HACKDIR=${HACKDIR}
9704 eval HACKDIR=${HACKDIR}
9705 eval HACKDIR=${HACKDIR}
9706 eval HACKDIR=${HACKDIR}
9707 eval HACKDIR=${HACKDIR}
9708 eval HACKDIR=${HACKDIR}
9709
9710 # canonicalize slashes.
9711 bindir=`echo  "${bindir}"  | sed 's@/$@@;s@//*@/@g'`
9712 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
9713
9714
9715 # Sanity check the subdir
9716 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
9717   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
9718     echo ""
9719     { echo "configure: error: \"--enable-subdir=${bindir}/${bad_choice}\" won't work.
9720                    There will be an executable installed with that name, so
9721                    that can't be the name of a directory as well.  Please
9722                    re-configure with a different directory name." 1>&2; exit 1; }
9723   fi
9724 done
9725
9726
9727 do_dir_warning=no
9728
9729 # Now let's see if there's a previous RPM version already installed.  Blargh!
9730
9731 # M4 sucks!!
9732
9733 rpmv=`(rpm -qv xscreensaver) 2>&- | \
9734       sed 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-[0-9][0-9]*$/\1/'`
9735
9736
9737 if test \! -z "$rpmv" ; then
9738   rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
9739   rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
9740
9741   warning=no
9742   warnL "There is already an installed RPM of xscreensaver $rpmv"
9743   warn2 "on this system.  You might want to remove it (with"
9744   warn2 '"rpm -ve xscreensaver") before running "make install"'
9745   warn2 "from this directory."
9746   echo ""
9747   warn2 "Alternately, you could build this version of xscreensaver"
9748   warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
9749   warn2 "file is included.  See the RPM documentation for more info."
9750   echo ""
9751
9752   if test "$rpmbdir" = "$rpmhdir" ; then
9753     warn2 "The RPM version was installed in $rpmbdir."
9754   else
9755     warn2 "The RPM version was installed in $rpmbdir,"
9756     warn2 "with demos in $rpmhdir."
9757   fi
9758
9759   do_dir_warning=yes
9760 fi
9761
9762
9763 # Warn about egregious GNOME bogosity.
9764 #
9765 if (rpm -qv control-center) >&- 2>&- ; then
9766   warning=no
9767   warnL "The Gnome Control Center seems to be installed."
9768   echo  ""
9769   warn2 "Note that simply installing this version of xscreensaver"
9770   warn2 "will not cause GNOME to know about the newly-added display"
9771   warn2 "modes -- GNOME is just lame that way.  Instead of using the"
9772   warn2 "Control Center, try using the \`xscreensaver-demo' command."
9773 fi
9774
9775
9776 if test "${bindir}" = "${HACKDIR}" ; then
9777   do_dir_warning=yes
9778 fi
9779
9780 if test "$do_dir_warning" = yes; then
9781   echo ""
9782   echo "$warnsep"
9783   echo ""
9784   echo '      When you run "make install", the "xscreensaver",'
9785   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
9786   echo "      will be installed in ${bindir}."
9787   echo ""
9788   echo "      The various graphics demos (100+ different executables) will"
9789   echo "      also be installed in ${HACKDIR}."
9790   echo ""
9791   echo "      If you would prefer the demos to be installed elsewhere"
9792   echo "      (for example, in a dedicated directory) you should re-run"
9793   echo "      configure with the --enable-subdir=DIR option.  For more"
9794   echo "      information, run $0 --help."
9795   warning=yes
9796 fi
9797
9798 if test "$warning" != no; then
9799   echo '' ; echo "$warnsep" ; echo ''
9800 fi