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