297ce8af2676373dfae7684fe196248aa232a0c3
[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   --with-hackdir=DIR      Where to install the hundreds of demo executables.
19                           Default: \`PREFIX/lib/xscreensaver/'
20 "
21 ac_help="$ac_help
22 "
23 ac_help="$ac_help
24   --with-configdir=DIR    Where to install the data files that describe each
25                           of the display modes to the GUI.
26                           Default: \`GNOMEPREFIX/control-center/screensavers/'
27                           or \`PREFIX/lib/xscreensaver/config/', depending on
28                           whether GNOME is available.
29 "
30 ac_help="$ac_help
31 Except where noted, all of the --with options below can also take a
32 directory argument: for example, \`--with-motif=/opt/Motif'.  That would
33 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
34 to be added to the -L list, assuming those directories exist.  
35
36 By default, support for each of these options will be built in, if the
37 relevant library routines exist.  At run time, they will then be used
38 only if the X server being used supports them.  Each --with option has
39 a corresponding --without option, to override building support for them
40 at all.
41
42 Screen blanking and idle-detection options:
43
44   --with-sgi-ext          Include support for the SGI SCREEN_SAVER extension."
45 ac_help="$ac_help
46   --with-mit-ext          Include support for the MIT-SCREEN-SAVER extension."
47 ac_help="$ac_help
48   --with-xidle-ext        Include support for the XIDLE extension."
49 ac_help="$ac_help
50   --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension."
51 ac_help="$ac_help
52   --with-dpms-ext         Include support for the DPMS extension."
53 ac_help="$ac_help
54   --with-xinerama-ext     Include support for the XINERAMA extension."
55 ac_help="$ac_help
56   --with-xf86vmode-ext    Include support for XFree86 virtual screens."
57 ac_help="$ac_help
58   --with-xf86gamma-ext    Include support for XFree86 gamma fading."
59 ac_help="$ac_help
60   --with-proc-interrupts  Include support for consulting the /proc/interrupts
61                           file to notice keyboard activity."
62 ac_help="$ac_help
63
64 Screen locking options:
65
66   --enable-locking        Compile in support for locking the display.
67   --disable-locking       Do not allow locking at all.
68 "
69 ac_help="$ac_help
70   --with-pam              Include support for PAM (Pluggable Auth Modules.)"
71 ac_help="$ac_help
72   --with-kerberos         Include support for Kerberos authentication."
73 ac_help="$ac_help
74   --with-shadow           Include support for shadow password authentication."
75 ac_help="$ac_help
76
77 User interface options:
78
79   --with-motif            Use the Motif toolkit for the user interface."
80 ac_help="$ac_help
81   --with-gtk              Use the Gtk toolkit for the user interface."
82 ac_help="$ac_help
83   --with-gnome            Include support for the Gnome Control Center."
84 ac_help="$ac_help
85   --with-xml              The XML toolkit is needed for some parts of
86                           the Gtk interface."
87 ac_help="$ac_help
88
89 Graphics options:
90
91   --with-gl               Build those demos which depend on OpenGL."
92 ac_help="$ac_help
93   --with-gle              Build those demos which depend on GLE
94                           (the OpenGL "extrusion" library.)"
95 ac_help="$ac_help
96   --with-xpm              Include support for XPM files in some demos."
97 ac_help="$ac_help
98   --with-xshm-ext         Include support for the XSHM extension."
99 ac_help="$ac_help
100   --with-xdbe-ext         Include support for the DOUBLE-BUFFER extension."
101 ac_help="$ac_help
102   --with-readdisplay      Include support for the XReadDisplay extension."
103 ac_help="$ac_help
104
105   --with-fortune=PROGRAM  Some demos are able to run an external program and
106                           display its text; this names the program to use by
107                           default (though it can be overridden with X
108                           resources.)  Default is \"/usr/games/fortune\"."
109 ac_help="$ac_help
110   --with-setuid-hacks     Allow some demos to be installed \`setuid root'
111                           (which is needed in order to ping other hosts.)
112 "
113
114 # Initialize some variables set by options.
115 # The variables have the same names as the options, with
116 # dashes changed to underlines.
117 build=NONE
118 cache_file=./config.cache
119 exec_prefix=NONE
120 host=NONE
121 no_create=
122 nonopt=NONE
123 no_recursion=
124 prefix=NONE
125 program_prefix=NONE
126 program_suffix=NONE
127 program_transform_name=s,x,x,
128 silent=
129 site=
130 srcdir=
131 target=NONE
132 verbose=
133 x_includes=NONE
134 x_libraries=NONE
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datadir='${prefix}/share'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${prefix}/info'
146 mandir='${prefix}/man'
147
148 # Initialize some other variables.
149 subdirs=
150 MFLAGS= MAKEFLAGS=
151 SHELL=${CONFIG_SHELL-/bin/sh}
152 # Maximum number of lines to put in a shell here document.
153 ac_max_here_lines=12
154
155 ac_prev=
156 for ac_option
157 do
158
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   case "$ac_option" in
167   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
168   *) ac_optarg= ;;
169   esac
170
171   # Accept the important Cygnus configure options, so we can diagnose typos.
172
173   case "$ac_option" in
174
175   -bindir | --bindir | --bindi | --bind | --bin | --bi)
176     ac_prev=bindir ;;
177   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
178     bindir="$ac_optarg" ;;
179
180   -build | --build | --buil | --bui | --bu)
181     ac_prev=build ;;
182   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
183     build="$ac_optarg" ;;
184
185   -cache-file | --cache-file | --cache-fil | --cache-fi \
186   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
187     ac_prev=cache_file ;;
188   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
189   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
190     cache_file="$ac_optarg" ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir="$ac_optarg" ;;
197
198   -disable-* | --disable-*)
199     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
200     # Reject names that are not valid shell variable names.
201     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
202       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
203     fi
204     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
205     eval "enable_${ac_feature}=no" ;;
206
207   -enable-* | --enable-*)
208     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
209     # Reject names that are not valid shell variable names.
210     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
211       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
212     fi
213     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
214     case "$ac_option" in
215       *=*) ;;
216       *) ac_optarg=yes ;;
217     esac
218     eval "enable_${ac_feature}='$ac_optarg'" ;;
219
220   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
221   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
222   | --exec | --exe | --ex)
223     ac_prev=exec_prefix ;;
224   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
225   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
226   | --exec=* | --exe=* | --ex=*)
227     exec_prefix="$ac_optarg" ;;
228
229   -gas | --gas | --ga | --g)
230     # Obsolete; use --with-gas.
231     with_gas=yes ;;
232
233   -help | --help | --hel | --he)
234     # Omit some internal or obsolete options to make the list less imposing.
235     # This message is too long to be a string in the A/UX 3.1 sh.
236     cat << EOF
237 Usage: configure [options] [host]
238 Options: [defaults in brackets after descriptions]
239
240 Configuration:
241
242   --cache-file=FILE       cache test results in FILE
243   --help                  print this message
244   --no-create             do not create output files
245   --quiet, --silent       do not print \`checking...' messages
246   --version               print the version of autoconf that created configure
247
248 Directory and file names:
249
250   --prefix=PREFIX         install architecture-independent files in PREFIX
251                           [$ac_default_prefix]
252   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
253                           [same as prefix]
254   --bindir=DIR            user executables in DIR [EPREFIX/bin]
255   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
256   --includedir=DIR        C header files in DIR [PREFIX/include]
257   --x-includes=DIR        X include files are in DIR
258   --x-libraries=DIR       X library files are in DIR
259   --mandir=DIR            man documentation in DIR [PREFIX/man]
260   --srcdir=DIR            find the sources in DIR [configure dir or ..]
261   --program-prefix=PREFIX prepend PREFIX to installed program names
262   --program-suffix=SUFFIX append SUFFIX to installed program names
263   --program-transform-name=PROGRAM
264                           run sed PROGRAM on installed program names
265 EOF
266     cat << EOF
267
268 Host type:
269
270   --build=BUILD           configure for building on BUILD [BUILD=HOST]
271   --host=HOST             configure for HOST [guessed]
272   --target=TARGET         configure for TARGET [TARGET=HOST]
273 EOF
274     if test -n "$ac_help"; then
275       echo "$ac_help"
276     fi
277     exit 0 ;;
278
279   -host | --host | --hos | --ho)
280     ac_prev=host ;;
281   -host=* | --host=* | --hos=* | --ho=*)
282     host="$ac_optarg" ;;
283
284   -includedir | --includedir | --includedi | --included | --include \
285   | --includ | --inclu | --incl | --inc)
286     ac_prev=includedir ;;
287   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
288   | --includ=* | --inclu=* | --incl=* | --inc=*)
289     includedir="$ac_optarg" ;;
290
291   -infodir | --infodir | --infodi | --infod | --info | --inf)
292     ac_prev=infodir ;;
293   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
294     infodir="$ac_optarg" ;;
295
296   -libdir | --libdir | --libdi | --libd)
297     ac_prev=libdir ;;
298   -libdir=* | --libdir=* | --libdi=* | --libd=*)
299     libdir="$ac_optarg" ;;
300
301   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
302   | --libexe | --libex | --libe)
303     ac_prev=libexecdir ;;
304   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
305   | --libexe=* | --libex=* | --libe=*)
306     libexecdir="$ac_optarg" ;;
307
308   -localstatedir | --localstatedir | --localstatedi | --localstated \
309   | --localstate | --localstat | --localsta | --localst \
310   | --locals | --local | --loca | --loc | --lo)
311     ac_prev=localstatedir ;;
312   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
313   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
314   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
315     localstatedir="$ac_optarg" ;;
316
317   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
318     ac_prev=mandir ;;
319   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
320     mandir="$ac_optarg" ;;
321
322   -nfp | --nfp | --nf)
323     # Obsolete; use --without-fp.
324     with_fp=no ;;
325
326   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
327   | --no-cr | --no-c)
328     no_create=yes ;;
329
330   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
331   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
332     no_recursion=yes ;;
333
334   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
335   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
336   | --oldin | --oldi | --old | --ol | --o)
337     ac_prev=oldincludedir ;;
338   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
339   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
340   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
341     oldincludedir="$ac_optarg" ;;
342
343   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
344     ac_prev=prefix ;;
345   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
346     prefix="$ac_optarg" ;;
347
348   -program-prefix | --program-prefix | --program-prefi | --program-pref \
349   | --program-pre | --program-pr | --program-p)
350     ac_prev=program_prefix ;;
351   -program-prefix=* | --program-prefix=* | --program-prefi=* \
352   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
353     program_prefix="$ac_optarg" ;;
354
355   -program-suffix | --program-suffix | --program-suffi | --program-suff \
356   | --program-suf | --program-su | --program-s)
357     ac_prev=program_suffix ;;
358   -program-suffix=* | --program-suffix=* | --program-suffi=* \
359   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
360     program_suffix="$ac_optarg" ;;
361
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     ac_prev=program_transform_name ;;
370   -program-transform-name=* | --program-transform-name=* \
371   | --program-transform-nam=* | --program-transform-na=* \
372   | --program-transform-n=* | --program-transform-=* \
373   | --program-transform=* | --program-transfor=* \
374   | --program-transfo=* | --program-transf=* \
375   | --program-trans=* | --program-tran=* \
376   | --progr-tra=* | --program-tr=* | --program-t=*)
377     program_transform_name="$ac_optarg" ;;
378
379   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
380   | -silent | --silent | --silen | --sile | --sil)
381     silent=yes ;;
382
383   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
384     ac_prev=sbindir ;;
385   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
386   | --sbi=* | --sb=*)
387     sbindir="$ac_optarg" ;;
388
389   -sharedstatedir | --sharedstatedir | --sharedstatedi \
390   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
391   | --sharedst | --shareds | --shared | --share | --shar \
392   | --sha | --sh)
393     ac_prev=sharedstatedir ;;
394   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
395   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
396   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
397   | --sha=* | --sh=*)
398     sharedstatedir="$ac_optarg" ;;
399
400   -site | --site | --sit)
401     ac_prev=site ;;
402   -site=* | --site=* | --sit=*)
403     site="$ac_optarg" ;;
404
405   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
406     ac_prev=srcdir ;;
407   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
408     srcdir="$ac_optarg" ;;
409
410   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
411   | --syscon | --sysco | --sysc | --sys | --sy)
412     ac_prev=sysconfdir ;;
413   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
414   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
415     sysconfdir="$ac_optarg" ;;
416
417   -target | --target | --targe | --targ | --tar | --ta | --t)
418     ac_prev=target ;;
419   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
420     target="$ac_optarg" ;;
421
422   -v | -verbose | --verbose | --verbos | --verbo | --verb)
423     verbose=yes ;;
424
425   -version | --version | --versio | --versi | --vers)
426     echo "configure generated by autoconf version 2.13"
427     exit 0 ;;
428
429   -with-* | --with-*)
430     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
431     # Reject names that are not valid shell variable names.
432     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
433       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
434     fi
435     ac_package=`echo $ac_package| sed 's/-/_/g'`
436     case "$ac_option" in
437       *=*) ;;
438       *) ac_optarg=yes ;;
439     esac
440     eval "with_${ac_package}='$ac_optarg'" ;;
441
442   -without-* | --without-*)
443     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
444     # Reject names that are not valid shell variable names.
445     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
446       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
447     fi
448     ac_package=`echo $ac_package| sed 's/-/_/g'`
449     eval "with_${ac_package}=no" ;;
450
451   --x)
452     # Obsolete; use --with-x.
453     with_x=yes ;;
454
455   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
456   | --x-incl | --x-inc | --x-in | --x-i)
457     ac_prev=x_includes ;;
458   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
459   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
460     x_includes="$ac_optarg" ;;
461
462   -x-libraries | --x-libraries | --x-librarie | --x-librari \
463   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
464     ac_prev=x_libraries ;;
465   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
466   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
467     x_libraries="$ac_optarg" ;;
468
469   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
470     ;;
471
472   *)
473     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
474       echo "configure: warning: $ac_option: invalid host type" 1>&2
475     fi
476     if test "x$nonopt" != xNONE; then
477       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
478     fi
479     nonopt="$ac_option"
480     ;;
481
482   esac
483 done
484
485 if test -n "$ac_prev"; then
486   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
487 fi
488
489 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
490
491 # File descriptor usage:
492 # 0 standard input
493 # 1 file creation
494 # 2 errors and warnings
495 # 3 some systems may open it to /dev/tty
496 # 4 used on the Kubota Titan
497 # 6 checking for... messages and results
498 # 5 compiler messages saved in config.log
499 if test "$silent" = yes; then
500   exec 6>/dev/null
501 else
502   exec 6>&1
503 fi
504 exec 5>./config.log
505
506 echo "\
507 This file contains any messages produced by compilers while
508 running configure, to aid debugging if configure makes a mistake.
509 " 1>&5
510
511 # Strip out --no-create and --no-recursion so they do not pile up.
512 # Also quote any args containing shell metacharacters.
513 ac_configure_args=
514 for ac_arg
515 do
516   case "$ac_arg" in
517   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
518   | --no-cr | --no-c) ;;
519   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
520   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
521   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
522   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
523   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
524   esac
525 done
526
527 # NLS nuisances.
528 # Only set these to C if already set.  These must not be set unconditionally
529 # because not all systems understand e.g. LANG=C (notably SCO).
530 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
531 # Non-C LC_CTYPE values break the ctype check.
532 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
533 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
534 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
535 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
536
537 # confdefs.h avoids OS command line length limits that DEFS can exceed.
538 rm -rf conftest* confdefs.h
539 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
540 echo > confdefs.h
541
542 # A filename unique to this package, relative to the directory that
543 # configure is in, which we can look for to find out if srcdir is correct.
544 ac_unique_file=driver/subprocs.c
545
546 # Find the source files, if location was not specified.
547 if test -z "$srcdir"; then
548   ac_srcdir_defaulted=yes
549   # Try the directory containing this script, then its parent.
550   ac_prog=$0
551   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
552   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
553   srcdir=$ac_confdir
554   if test ! -r $srcdir/$ac_unique_file; then
555     srcdir=..
556   fi
557 else
558   ac_srcdir_defaulted=no
559 fi
560 if test ! -r $srcdir/$ac_unique_file; then
561   if test "$ac_srcdir_defaulted" = yes; then
562     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
563   else
564     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
565   fi
566 fi
567 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
568
569 # Prefer explicitly selected file to automatically selected ones.
570 if test -z "$CONFIG_SITE"; then
571   if test "x$prefix" != xNONE; then
572     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
573   else
574     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
575   fi
576 fi
577 for ac_site_file in $CONFIG_SITE; do
578   if test -r "$ac_site_file"; then
579     echo "loading site script $ac_site_file"
580     . "$ac_site_file"
581   fi
582 done
583
584 if test -r "$cache_file"; then
585   echo "loading cache $cache_file"
586   . $cache_file
587 else
588   echo "creating cache $cache_file"
589   > $cache_file
590 fi
591
592 ac_ext=c
593 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
594 ac_cpp='$CPP $CPPFLAGS'
595 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
596 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
597 cross_compiling=$ac_cv_prog_cc_cross
598
599 ac_exeext=
600 ac_objext=o
601 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
602   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
603   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
604     ac_n= ac_c='
605 ' ac_t='        '
606   else
607     ac_n=-n ac_c= ac_t=
608   fi
609 else
610   ac_n= ac_c='\c' ac_t=
611 fi
612
613
614
615
616 echo "current directory: `pwd`"
617 echo "command line was: $0 $@"
618
619
620 # After checking to see that --srcdir is correct (which AC_INIT does)
621 # check for some random other files that come later in the tar file,
622 # to make sure everything is here.
623 #
624 for d in driver utils hacks hacks/glx ; do
625   f=$srcdir/$d/Makefile.in
626   if test \! -r $f ; then
627     echo ""
628     echo "ERROR: The package is incomplete: $f does not exist."
629     echo "       This probably means that your download was truncated."
630     echo ""
631     exit 1
632   fi
633 done
634
635
636 ###############################################################################
637 #
638 #       Function to figure out how to run the compiler.
639 #
640 ###############################################################################
641
642
643
644
645 ###############################################################################
646 #
647 #       Functions to figure out how to disable // comments in ANSI C code.
648 #
649 #       (With recent gcc, this is done with "-std=c89".  With older gcc, this
650 #       is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
651 #       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
652 #       so much for compatibility!)
653 #
654 ###############################################################################
655
656
657
658
659
660
661 ###############################################################################
662 #
663 #       Function to figure out how to create directory trees.
664 #
665 ###############################################################################
666
667
668
669
670 ###############################################################################
671 #
672 #       Function to check whether gettimeofday() exists, and how to call it.
673 #       This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
674 #
675 ###############################################################################
676
677
678
679
680 ###############################################################################
681 #
682 #       Function to find perl5 (defines PERL and PERL_VERSION.)
683 #
684 ###############################################################################
685
686 # M4 sucks!!  perl sucks too!!
687
688 perl_version_cmd='print $]'
689
690
691
692
693
694 ###############################################################################
695 #
696 #       Function to demand "bc".  Losers.
697 #
698 ###############################################################################
699
700
701
702 ###############################################################################
703 #
704 #       Functions to check how to do ICMP PING requests.
705 #
706 ###############################################################################
707
708
709
710
711
712
713 ###############################################################################
714 #
715 #       Functions to check for various X11 crap.
716 #
717 ###############################################################################
718
719 # Try and find the app-defaults directory.
720 # It sucks that autoconf doesn't do this already...
721 #
722
723
724
725
726
727
728
729
730
731
732 # Random special-cases for X on certain pathological OSes.
733 # You know who you are.
734 #
735
736
737
738
739 ###############################################################################
740 #
741 #       Some utility functions to make checking for X things easier.
742 #
743 ###############################################################################
744
745 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
746 #
747
748
749 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
750 #
751
752
753 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
754 #
755
756
757
758 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
759 # Use this sparingly; it probably doesn't work very well on X programs.
760 #
761
762
763 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
764 # (But not the -L directories!)
765 #
766
767
768
769
770 # Usage: HANDLE_X_PATH_ARG([variable_name],
771 #                          [--command-line-option],
772 #                          [descriptive string])
773 #
774 # All of the --with options take three forms:
775 #
776 #   --with-foo (or --with-foo=yes)
777 #   --without-foo (or --with-foo=no)
778 #   --with-foo=/DIR
779 #
780 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
781 # a directory (string beginning with a slash) it checks to see whether
782 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
783 # as appropriate.
784 #
785
786
787
788
789 ###############################################################################
790 ###############################################################################
791 #
792 #       End of function definitions.  Now start actually executing stuff.
793 #
794 ###############################################################################
795 ###############################################################################
796
797 # random compiler setup
798 ac_aux_dir=
799 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
800   if test -f $ac_dir/install-sh; then
801     ac_aux_dir=$ac_dir
802     ac_install_sh="$ac_aux_dir/install-sh -c"
803     break
804   elif test -f $ac_dir/install.sh; then
805     ac_aux_dir=$ac_dir
806     ac_install_sh="$ac_aux_dir/install.sh -c"
807     break
808   fi
809 done
810 if test -z "$ac_aux_dir"; then
811   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
812 fi
813 ac_config_guess=$ac_aux_dir/config.guess
814 ac_config_sub=$ac_aux_dir/config.sub
815 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
816
817
818 # Make sure we can run config.sub.
819 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
820 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
821 fi
822
823 echo $ac_n "checking host system type""... $ac_c" 1>&6
824 echo "configure:836: checking host system type" >&5
825
826 host_alias=$host
827 case "$host_alias" in
828 NONE)
829   case $nonopt in
830   NONE)
831     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
832     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
833     fi ;;
834   *) host_alias=$nonopt ;;
835   esac ;;
836 esac
837
838 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
839 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
840 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
841 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
842 echo "$ac_t""$host" 1>&6
843
844 # Extract the first word of "gcc", so it can be a program name with args.
845 set dummy gcc; ac_word=$2
846 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
847 echo "configure:859: checking for $ac_word" >&5
848 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
849   echo $ac_n "(cached) $ac_c" 1>&6
850 else
851   if test -n "$CC"; then
852   ac_cv_prog_CC="$CC" # Let the user override the test.
853 else
854   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
855   ac_dummy="$PATH"
856   for ac_dir in $ac_dummy; do
857     test -z "$ac_dir" && ac_dir=.
858     if test -f $ac_dir/$ac_word; then
859       ac_cv_prog_CC="gcc"
860       break
861     fi
862   done
863   IFS="$ac_save_ifs"
864 fi
865 fi
866 CC="$ac_cv_prog_CC"
867 if test -n "$CC"; then
868   echo "$ac_t""$CC" 1>&6
869 else
870   echo "$ac_t""no" 1>&6
871 fi
872
873 if test -z "$CC"; then
874   # Extract the first word of "cc", so it can be a program name with args.
875 set dummy cc; ac_word=$2
876 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
877 echo "configure:889: checking for $ac_word" >&5
878 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
879   echo $ac_n "(cached) $ac_c" 1>&6
880 else
881   if test -n "$CC"; then
882   ac_cv_prog_CC="$CC" # Let the user override the test.
883 else
884   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
885   ac_prog_rejected=no
886   ac_dummy="$PATH"
887   for ac_dir in $ac_dummy; do
888     test -z "$ac_dir" && ac_dir=.
889     if test -f $ac_dir/$ac_word; then
890       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
891         ac_prog_rejected=yes
892         continue
893       fi
894       ac_cv_prog_CC="cc"
895       break
896     fi
897   done
898   IFS="$ac_save_ifs"
899 if test $ac_prog_rejected = yes; then
900   # We found a bogon in the path, so make sure we never use it.
901   set dummy $ac_cv_prog_CC
902   shift
903   if test $# -gt 0; then
904     # We chose a different compiler from the bogus one.
905     # However, it has the same basename, so the bogon will be chosen
906     # first if we set CC to just the basename; use the full file name.
907     shift
908     set dummy "$ac_dir/$ac_word" "$@"
909     shift
910     ac_cv_prog_CC="$@"
911   fi
912 fi
913 fi
914 fi
915 CC="$ac_cv_prog_CC"
916 if test -n "$CC"; then
917   echo "$ac_t""$CC" 1>&6
918 else
919   echo "$ac_t""no" 1>&6
920 fi
921
922   if test -z "$CC"; then
923     case "`uname -s`" in
924     *win32* | *WIN32*)
925       # Extract the first word of "cl", so it can be a program name with args.
926 set dummy cl; ac_word=$2
927 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
928 echo "configure:940: checking for $ac_word" >&5
929 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
930   echo $ac_n "(cached) $ac_c" 1>&6
931 else
932   if test -n "$CC"; then
933   ac_cv_prog_CC="$CC" # Let the user override the test.
934 else
935   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
936   ac_dummy="$PATH"
937   for ac_dir in $ac_dummy; do
938     test -z "$ac_dir" && ac_dir=.
939     if test -f $ac_dir/$ac_word; then
940       ac_cv_prog_CC="cl"
941       break
942     fi
943   done
944   IFS="$ac_save_ifs"
945 fi
946 fi
947 CC="$ac_cv_prog_CC"
948 if test -n "$CC"; then
949   echo "$ac_t""$CC" 1>&6
950 else
951   echo "$ac_t""no" 1>&6
952 fi
953  ;;
954     esac
955   fi
956   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
957 fi
958
959 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
960 echo "configure:972: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
961
962 ac_ext=c
963 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
964 ac_cpp='$CPP $CPPFLAGS'
965 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
966 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
967 cross_compiling=$ac_cv_prog_cc_cross
968
969 cat > conftest.$ac_ext << EOF
970
971 #line 983 "configure"
972 #include "confdefs.h"
973
974 main(){return(0);}
975 EOF
976 if { (eval echo configure:988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
977   ac_cv_prog_cc_works=yes
978   # If we can't run a trivial program, we are probably using a cross compiler.
979   if (./conftest; exit) 2>/dev/null; then
980     ac_cv_prog_cc_cross=no
981   else
982     ac_cv_prog_cc_cross=yes
983   fi
984 else
985   echo "configure: failed program was:" >&5
986   cat conftest.$ac_ext >&5
987   ac_cv_prog_cc_works=no
988 fi
989 rm -fr conftest*
990 ac_ext=c
991 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
992 ac_cpp='$CPP $CPPFLAGS'
993 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
994 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
995 cross_compiling=$ac_cv_prog_cc_cross
996
997 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
998 if test $ac_cv_prog_cc_works = no; then
999   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1000 fi
1001 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1002 echo "configure:1014: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1003 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1004 cross_compiling=$ac_cv_prog_cc_cross
1005
1006 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1007 echo "configure:1019: checking whether we are using GNU C" >&5
1008 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1009   echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011   cat > conftest.c <<EOF
1012 #ifdef __GNUC__
1013   yes;
1014 #endif
1015 EOF
1016 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1017   ac_cv_prog_gcc=yes
1018 else
1019   ac_cv_prog_gcc=no
1020 fi
1021 fi
1022
1023 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1024
1025 if test $ac_cv_prog_gcc = yes; then
1026   GCC=yes
1027 else
1028   GCC=
1029 fi
1030
1031 ac_test_CFLAGS="${CFLAGS+set}"
1032 ac_save_CFLAGS="$CFLAGS"
1033 CFLAGS=
1034 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1035 echo "configure:1047: checking whether ${CC-cc} accepts -g" >&5
1036 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1037   echo $ac_n "(cached) $ac_c" 1>&6
1038 else
1039   echo 'void f(){}' > conftest.c
1040 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1041   ac_cv_prog_cc_g=yes
1042 else
1043   ac_cv_prog_cc_g=no
1044 fi
1045 rm -f conftest*
1046
1047 fi
1048
1049 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1050 if test "$ac_test_CFLAGS" = set; then
1051   CFLAGS="$ac_save_CFLAGS"
1052 elif test $ac_cv_prog_cc_g = yes; then
1053   if test "$GCC" = yes; then
1054     CFLAGS="-g -O2"
1055   else
1056     CFLAGS="-g"
1057   fi
1058 else
1059   if test "$GCC" = yes; then
1060     CFLAGS="-O2"
1061   else
1062     CFLAGS=
1063   fi
1064 fi
1065
1066
1067   if test -z "$GCC"; then
1068     echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
1069 echo "configure:1081: checking how to request ANSI compilation" >&5
1070     case "$host" in
1071       *-hpux* )
1072         echo "$ac_t""HPUX: adding -Ae" 1>&6
1073         CC="$CC -Ae"
1074       ;;
1075       *-aix* )
1076         echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
1077         CC="$CC -qlanglvl=ansi -qhalt=e"
1078       ;;
1079
1080       *-dec-* )
1081         echo "$ac_t""DEC: adding -std1 -ieee" 1>&6
1082         CC="$CC -std1"
1083       ;;
1084
1085       *)
1086         echo "$ac_t""no idea" 1>&6
1087       ;;
1088     esac
1089   fi
1090
1091   echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
1092 echo "configure:1104: checking whether the compiler works on ANSI C" >&5
1093   if test "$cross_compiling" = yes; then
1094   { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1095 else
1096   cat > conftest.$ac_ext <<EOF
1097 #line 1109 "configure"
1098 #include "confdefs.h"
1099  main(int ac, char **av) { return 0; } 
1100 EOF
1101 if { (eval echo configure:1113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1102 then
1103   echo "$ac_t""yes" 1>&6
1104 else
1105   echo "configure: failed program was:" >&5
1106   cat conftest.$ac_ext >&5
1107   rm -fr conftest*
1108   echo "$ac_t""no" 1>&6
1109      { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1110 fi
1111 rm -fr conftest*
1112 fi
1113
1114
1115   if test -n "$GCC"; then
1116     echo "$ac_t""Turning on gcc compiler warnings." 1>&6
1117     CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
1118   else
1119     case "$host" in
1120       *-irix5* |*-irix6.0-3* )
1121         echo "$ac_t""Turning on SGI compiler warnings." 1>&6
1122         CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
1123       ;;
1124 #     *-dec-osf* )
1125 #       if test -z "$GCC"; then
1126 #         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
1127 #         CC="$CC -migrate -w0 -verbose -warnprotos"
1128 #       fi
1129 #     ;;
1130     esac
1131   fi
1132
1133 if test -n "$GCC"; then
1134    if test -n "$GCC"; then
1135    echo $ac_n "checking whether gcc accepts -std""... $ac_c" 1>&6
1136 echo "configure:1148: checking whether gcc accepts -std" >&5
1137 if eval "test \"`echo '$''{'ac_cv_gcc_accepts_std'+set}'`\" = set"; then
1138   echo $ac_n "(cached) $ac_c" 1>&6
1139 else
1140   if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
1141           grep unrecognized >/dev/null ); then
1142        ac_cv_gcc_accepts_std=no
1143      else
1144        ac_cv_gcc_accepts_std=yes
1145      fi
1146 fi
1147
1148 echo "$ac_t""$ac_cv_gcc_accepts_std" 1>&6
1149    ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
1150   fi
1151
1152    echo "$ac_t""Disabling C++ comments in ANSI C code." 1>&6
1153    #
1154    # The reason that // comments are banned from xscreensaver is that gcc is
1155    # basically the only compiler in the world that supports them in C code.
1156    # All other vendors support them only in their C++ compilers, not in their
1157    # ANSI C compilers.  This means that it's a portability problem: every time
1158    # these comments have snuck into the xscreensaver source code, I've gotten
1159    # complaints about it the next day.  So we turn off support for them in gcc
1160    # as well to prevent them from accidentially slipping in.
1161    #
1162    if test "$ac_gcc_accepts_std" = yes ; then
1163      #
1164      # -std=c89 defines __STRICT_ANSI__, which we don't want.
1165      # (That appears to be the only additional preprocessor symbol
1166      # it defines, in addition to the syntax changes it makes.)
1167      #
1168      # -std=gnu89 is no good, because // comments were a GNU extension
1169      # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
1170      # with -std=gnu89 but not with -std=c89.)
1171      #
1172      CC="$CC -std=c89 -U__STRICT_ANSI__"
1173    else
1174      # The old way:
1175      CC="$CC -Wp,-lang-c89"
1176    fi
1177   fi
1178
1179 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1180 echo "configure:1192: checking how to run the C preprocessor" >&5
1181 # On Suns, sometimes $CPP names a directory.
1182 if test -n "$CPP" && test -d "$CPP"; then
1183   CPP=
1184 fi
1185 if test -z "$CPP"; then
1186 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1187   echo $ac_n "(cached) $ac_c" 1>&6
1188 else
1189     # This must be in double quotes, not single quotes, because CPP may get
1190   # substituted into the Makefile and "${CC-cc}" will confuse make.
1191   CPP="${CC-cc} -E"
1192   # On the NeXT, cc -E runs the code through the compiler's parser,
1193   # not just through cpp.
1194   cat > conftest.$ac_ext <<EOF
1195 #line 1207 "configure"
1196 #include "confdefs.h"
1197 #include <assert.h>
1198 Syntax Error
1199 EOF
1200 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1201 { (eval echo configure:1213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1202 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1203 if test -z "$ac_err"; then
1204   :
1205 else
1206   echo "$ac_err" >&5
1207   echo "configure: failed program was:" >&5
1208   cat conftest.$ac_ext >&5
1209   rm -rf conftest*
1210   CPP="${CC-cc} -E -traditional-cpp"
1211   cat > conftest.$ac_ext <<EOF
1212 #line 1224 "configure"
1213 #include "confdefs.h"
1214 #include <assert.h>
1215 Syntax Error
1216 EOF
1217 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1218 { (eval echo configure:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1219 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1220 if test -z "$ac_err"; then
1221   :
1222 else
1223   echo "$ac_err" >&5
1224   echo "configure: failed program was:" >&5
1225   cat conftest.$ac_ext >&5
1226   rm -rf conftest*
1227   CPP="${CC-cc} -nologo -E"
1228   cat > conftest.$ac_ext <<EOF
1229 #line 1241 "configure"
1230 #include "confdefs.h"
1231 #include <assert.h>
1232 Syntax Error
1233 EOF
1234 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1235 { (eval echo configure:1247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1236 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1237 if test -z "$ac_err"; then
1238   :
1239 else
1240   echo "$ac_err" >&5
1241   echo "configure: failed program was:" >&5
1242   cat conftest.$ac_ext >&5
1243   rm -rf conftest*
1244   CPP=/lib/cpp
1245 fi
1246 rm -f conftest*
1247 fi
1248 rm -f conftest*
1249 fi
1250 rm -f conftest*
1251   ac_cv_prog_CPP="$CPP"
1252 fi
1253   CPP="$ac_cv_prog_CPP"
1254 else
1255   ac_cv_prog_CPP="$CPP"
1256 fi
1257 echo "$ac_t""$CPP" 1>&6
1258
1259 echo $ac_n "checking for working const""... $ac_c" 1>&6
1260 echo "configure:1272: checking for working const" >&5
1261 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1262   echo $ac_n "(cached) $ac_c" 1>&6
1263 else
1264   cat > conftest.$ac_ext <<EOF
1265 #line 1277 "configure"
1266 #include "confdefs.h"
1267
1268 int main() {
1269
1270 /* Ultrix mips cc rejects this.  */
1271 typedef int charset[2]; const charset x;
1272 /* SunOS 4.1.1 cc rejects this.  */
1273 char const *const *ccp;
1274 char **p;
1275 /* NEC SVR4.0.2 mips cc rejects this.  */
1276 struct point {int x, y;};
1277 static struct point const zero = {0,0};
1278 /* AIX XL C 1.02.0.0 rejects this.
1279    It does not let you subtract one const X* pointer from another in an arm
1280    of an if-expression whose if-part is not a constant expression */
1281 const char *g = "string";
1282 ccp = &g + (g ? g-g : 0);
1283 /* HPUX 7.0 cc rejects these. */
1284 ++ccp;
1285 p = (char**) ccp;
1286 ccp = (char const *const *) p;
1287 { /* SCO 3.2v4 cc rejects this.  */
1288   char *t;
1289   char const *s = 0 ? (char *) 0 : (char const *) 0;
1290
1291   *t++ = 0;
1292 }
1293 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1294   int x[] = {25, 17};
1295   const int *foo = &x[0];
1296   ++foo;
1297 }
1298 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1299   typedef const int *iptr;
1300   iptr p = 0;
1301   ++p;
1302 }
1303 { /* AIX XL C 1.02.0.0 rejects this saying
1304      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1305   struct s { int j; const int *ap[3]; };
1306   struct s *b; b->j = 5;
1307 }
1308 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1309   const int foo = 10;
1310 }
1311
1312 ; return 0; }
1313 EOF
1314 if { (eval echo configure:1326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1315   rm -rf conftest*
1316   ac_cv_c_const=yes
1317 else
1318   echo "configure: failed program was:" >&5
1319   cat conftest.$ac_ext >&5
1320   rm -rf conftest*
1321   ac_cv_c_const=no
1322 fi
1323 rm -f conftest*
1324 fi
1325
1326 echo "$ac_t""$ac_cv_c_const" 1>&6
1327 if test $ac_cv_c_const = no; then
1328   cat >> confdefs.h <<\EOF
1329 #define const 
1330 EOF
1331
1332 fi
1333
1334 echo $ac_n "checking for inline""... $ac_c" 1>&6
1335 echo "configure:1347: checking for inline" >&5
1336 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1337   echo $ac_n "(cached) $ac_c" 1>&6
1338 else
1339   ac_cv_c_inline=no
1340 for ac_kw in inline __inline__ __inline; do
1341   cat > conftest.$ac_ext <<EOF
1342 #line 1354 "configure"
1343 #include "confdefs.h"
1344
1345 int main() {
1346 } $ac_kw foo() {
1347 ; return 0; }
1348 EOF
1349 if { (eval echo configure:1361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1350   rm -rf conftest*
1351   ac_cv_c_inline=$ac_kw; break
1352 else
1353   echo "configure: failed program was:" >&5
1354   cat conftest.$ac_ext >&5
1355 fi
1356 rm -f conftest*
1357 done
1358
1359 fi
1360
1361 echo "$ac_t""$ac_cv_c_inline" 1>&6
1362 case "$ac_cv_c_inline" in
1363   inline | yes) ;;
1364   no) cat >> confdefs.h <<\EOF
1365 #define inline 
1366 EOF
1367  ;;
1368   *)  cat >> confdefs.h <<EOF
1369 #define inline $ac_cv_c_inline
1370 EOF
1371  ;;
1372 esac
1373
1374 ac_bc_result=`echo 6+9 | bc 2>/dev/null`
1375   echo $ac_n "checking for bc""... $ac_c" 1>&6
1376 echo "configure:1388: checking for bc" >&5
1377   if test "$ac_bc_result" = "15" ; then
1378     echo "$ac_t""yes" 1>&6
1379   else
1380     echo "$ac_t""no" 1>&6
1381     echo ''
1382     { echo "configure: error: Your system doesn't have \"bc\", which has been a standard
1383                   part of Unix since the 1970s.  Come back when your vendor
1384                   has grown a clue." 1>&2; exit 1; }
1385   fi
1386  
1387
1388 # stuff for Makefiles
1389 # Find a good install program.  We prefer a C program (faster),
1390 # so one script is as good as another.  But avoid the broken or
1391 # incompatible versions:
1392 # SysV /etc/install, /usr/sbin/install
1393 # SunOS /usr/etc/install
1394 # IRIX /sbin/install
1395 # AIX /bin/install
1396 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1397 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1398 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1399 # ./install, which can be erroneously created by make from ./install.sh.
1400 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1401 echo "configure:1413: checking for a BSD compatible install" >&5
1402 if test -z "$INSTALL"; then
1403 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1404   echo $ac_n "(cached) $ac_c" 1>&6
1405 else
1406     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1407   for ac_dir in $PATH; do
1408     # Account for people who put trailing slashes in PATH elements.
1409     case "$ac_dir/" in
1410     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1411     *)
1412       # OSF1 and SCO ODT 3.0 have their own names for install.
1413       # Don't use installbsd from OSF since it installs stuff as root
1414       # by default.
1415       for ac_prog in ginstall scoinst install; do
1416         if test -f $ac_dir/$ac_prog; then
1417           if test $ac_prog = install &&
1418             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1419             # AIX install.  It has an incompatible calling convention.
1420             :
1421           else
1422             ac_cv_path_install="$ac_dir/$ac_prog -c"
1423             break 2
1424           fi
1425         fi
1426       done
1427       ;;
1428     esac
1429   done
1430   IFS="$ac_save_IFS"
1431
1432 fi
1433   if test "${ac_cv_path_install+set}" = set; then
1434     INSTALL="$ac_cv_path_install"
1435   else
1436     # As a last resort, use the slow shell script.  We don't cache a
1437     # path for INSTALL within a source directory, because that will
1438     # break other packages using the cache if that directory is
1439     # removed, or if the path is relative.
1440     INSTALL="$ac_install_sh"
1441   fi
1442 fi
1443 echo "$ac_t""$INSTALL" 1>&6
1444
1445 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1446 # It thinks the first close brace ends the variable substitution.
1447 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1448
1449 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1450
1451 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1452
1453 echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
1454 echo "configure:1466: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
1455 if eval "test \"`echo '$''{'ac_cv_install_d_creates_dirs'+set}'`\" = set"; then
1456   echo $ac_n "(cached) $ac_c" 1>&6
1457 else
1458   ac_cv_install_d_creates_dirs=no
1459      rm -rf conftestdir
1460      if mkdir conftestdir; then
1461        cd conftestdir >&-
1462        ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
1463        if test -d dir1/dir2/. ; then
1464          ac_cv_install_d_creates_dirs=yes
1465        fi
1466        cd .. >&-
1467        rm -rf conftestdir
1468      fi
1469     
1470 fi
1471
1472 echo "$ac_t""$ac_cv_install_d_creates_dirs" 1>&6
1473
1474   if test "$ac_cv_install_d_creates_dirs" = no ; then
1475     echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
1476 echo "configure:1488: checking whether \"mkdir -p\" creates intermediate directories" >&5
1477 if eval "test \"`echo '$''{'ac_cv_mkdir_p_creates_dirs'+set}'`\" = set"; then
1478   echo $ac_n "(cached) $ac_c" 1>&6
1479 else
1480   ac_cv_mkdir_p_creates_dirs=no
1481        rm -rf conftestdir
1482        if mkdir conftestdir; then
1483          cd conftestdir >&-
1484          mkdir -p dir1/dir2 >&- 2>&-
1485          if test -d dir1/dir2/. ; then
1486            ac_cv_mkdir_p_creates_dirs=yes
1487          fi
1488          cd .. >&-
1489          rm -rf conftestdir
1490        fi
1491       
1492 fi
1493
1494 echo "$ac_t""$ac_cv_mkdir_p_creates_dirs" 1>&6
1495   fi
1496
1497   if test "$ac_cv_install_d_creates_dirs" = yes ; then
1498     INSTALL_DIRS='${INSTALL} -d'
1499   elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
1500     INSTALL_DIRS='mkdir -p'
1501   else
1502     # any other ideas?
1503     INSTALL_DIRS='${INSTALL} -d'
1504   fi
1505
1506 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1507 echo "configure:1519: checking whether ${MAKE-make} sets \${MAKE}" >&5
1508 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1509 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1510   echo $ac_n "(cached) $ac_c" 1>&6
1511 else
1512   cat > conftestmake <<\EOF
1513 all:
1514         @echo 'ac_maketemp="${MAKE}"'
1515 EOF
1516 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1517 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1518 if test -n "$ac_maketemp"; then
1519   eval ac_cv_prog_make_${ac_make}_set=yes
1520 else
1521   eval ac_cv_prog_make_${ac_make}_set=no
1522 fi
1523 rm -f conftestmake
1524 fi
1525 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1526   echo "$ac_t""yes" 1>&6
1527   SET_MAKE=
1528 else
1529   echo "$ac_t""no" 1>&6
1530   SET_MAKE="MAKE=${MAKE-make}"
1531 fi
1532
1533
1534 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1535 # That's wrong: it should be set to '${INSTALL}', so that one can
1536 # implement the "install-strip" target properly (strip executables,
1537 # but do not try to strip scripts.)
1538 #
1539 INSTALL_SCRIPT='${INSTALL}'
1540
1541 # random libc stuff
1542 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1543 echo "configure:1555: checking for ANSI C header files" >&5
1544 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1545   echo $ac_n "(cached) $ac_c" 1>&6
1546 else
1547   cat > conftest.$ac_ext <<EOF
1548 #line 1560 "configure"
1549 #include "confdefs.h"
1550 #include <stdlib.h>
1551 #include <stdarg.h>
1552 #include <string.h>
1553 #include <float.h>
1554 EOF
1555 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1556 { (eval echo configure:1568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1557 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1558 if test -z "$ac_err"; then
1559   rm -rf conftest*
1560   ac_cv_header_stdc=yes
1561 else
1562   echo "$ac_err" >&5
1563   echo "configure: failed program was:" >&5
1564   cat conftest.$ac_ext >&5
1565   rm -rf conftest*
1566   ac_cv_header_stdc=no
1567 fi
1568 rm -f conftest*
1569
1570 if test $ac_cv_header_stdc = yes; then
1571   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1572 cat > conftest.$ac_ext <<EOF
1573 #line 1585 "configure"
1574 #include "confdefs.h"
1575 #include <string.h>
1576 EOF
1577 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1578   egrep "memchr" >/dev/null 2>&1; then
1579   :
1580 else
1581   rm -rf conftest*
1582   ac_cv_header_stdc=no
1583 fi
1584 rm -f conftest*
1585
1586 fi
1587
1588 if test $ac_cv_header_stdc = yes; then
1589   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1590 cat > conftest.$ac_ext <<EOF
1591 #line 1603 "configure"
1592 #include "confdefs.h"
1593 #include <stdlib.h>
1594 EOF
1595 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1596   egrep "free" >/dev/null 2>&1; then
1597   :
1598 else
1599   rm -rf conftest*
1600   ac_cv_header_stdc=no
1601 fi
1602 rm -f conftest*
1603
1604 fi
1605
1606 if test $ac_cv_header_stdc = yes; then
1607   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1608 if test "$cross_compiling" = yes; then
1609   :
1610 else
1611   cat > conftest.$ac_ext <<EOF
1612 #line 1624 "configure"
1613 #include "confdefs.h"
1614 #include <ctype.h>
1615 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1616 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1617 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1618 int main () { int i; for (i = 0; i < 256; i++)
1619 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1620 exit (0); }
1621
1622 EOF
1623 if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1624 then
1625   :
1626 else
1627   echo "configure: failed program was:" >&5
1628   cat conftest.$ac_ext >&5
1629   rm -fr conftest*
1630   ac_cv_header_stdc=no
1631 fi
1632 rm -fr conftest*
1633 fi
1634
1635 fi
1636 fi
1637
1638 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1639 if test $ac_cv_header_stdc = yes; then
1640   cat >> confdefs.h <<\EOF
1641 #define STDC_HEADERS 1
1642 EOF
1643
1644 fi
1645
1646 for ac_hdr in unistd.h
1647 do
1648 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1649 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1650 echo "configure:1662: checking for $ac_hdr" >&5
1651 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1652   echo $ac_n "(cached) $ac_c" 1>&6
1653 else
1654   cat > conftest.$ac_ext <<EOF
1655 #line 1667 "configure"
1656 #include "confdefs.h"
1657 #include <$ac_hdr>
1658 EOF
1659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1660 { (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1661 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1662 if test -z "$ac_err"; then
1663   rm -rf conftest*
1664   eval "ac_cv_header_$ac_safe=yes"
1665 else
1666   echo "$ac_err" >&5
1667   echo "configure: failed program was:" >&5
1668   cat conftest.$ac_ext >&5
1669   rm -rf conftest*
1670   eval "ac_cv_header_$ac_safe=no"
1671 fi
1672 rm -f conftest*
1673 fi
1674 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1675   echo "$ac_t""yes" 1>&6
1676     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1677   cat >> confdefs.h <<EOF
1678 #define $ac_tr_hdr 1
1679 EOF
1680  
1681 else
1682   echo "$ac_t""no" 1>&6
1683 fi
1684 done
1685
1686 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
1687 echo "configure:1699: checking for mode_t" >&5
1688 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
1689   echo $ac_n "(cached) $ac_c" 1>&6
1690 else
1691   cat > conftest.$ac_ext <<EOF
1692 #line 1704 "configure"
1693 #include "confdefs.h"
1694 #include <sys/types.h>
1695 #if STDC_HEADERS
1696 #include <stdlib.h>
1697 #include <stddef.h>
1698 #endif
1699 EOF
1700 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1701   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1702   rm -rf conftest*
1703   ac_cv_type_mode_t=yes
1704 else
1705   rm -rf conftest*
1706   ac_cv_type_mode_t=no
1707 fi
1708 rm -f conftest*
1709
1710 fi
1711 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
1712 if test $ac_cv_type_mode_t = no; then
1713   cat >> confdefs.h <<\EOF
1714 #define mode_t int
1715 EOF
1716
1717 fi
1718
1719 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1720 echo "configure:1732: checking for pid_t" >&5
1721 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1722   echo $ac_n "(cached) $ac_c" 1>&6
1723 else
1724   cat > conftest.$ac_ext <<EOF
1725 #line 1737 "configure"
1726 #include "confdefs.h"
1727 #include <sys/types.h>
1728 #if STDC_HEADERS
1729 #include <stdlib.h>
1730 #include <stddef.h>
1731 #endif
1732 EOF
1733 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1734   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1735   rm -rf conftest*
1736   ac_cv_type_pid_t=yes
1737 else
1738   rm -rf conftest*
1739   ac_cv_type_pid_t=no
1740 fi
1741 rm -f conftest*
1742
1743 fi
1744 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1745 if test $ac_cv_type_pid_t = no; then
1746   cat >> confdefs.h <<\EOF
1747 #define pid_t int
1748 EOF
1749
1750 fi
1751
1752 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1753 echo "configure:1765: checking for size_t" >&5
1754 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1755   echo $ac_n "(cached) $ac_c" 1>&6
1756 else
1757   cat > conftest.$ac_ext <<EOF
1758 #line 1770 "configure"
1759 #include "confdefs.h"
1760 #include <sys/types.h>
1761 #if STDC_HEADERS
1762 #include <stdlib.h>
1763 #include <stddef.h>
1764 #endif
1765 EOF
1766 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1767   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1768   rm -rf conftest*
1769   ac_cv_type_size_t=yes
1770 else
1771   rm -rf conftest*
1772   ac_cv_type_size_t=no
1773 fi
1774 rm -f conftest*
1775
1776 fi
1777 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1778 if test $ac_cv_type_size_t = no; then
1779   cat >> confdefs.h <<\EOF
1780 #define size_t unsigned
1781 EOF
1782
1783 fi
1784
1785 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1786 echo "configure:1798: checking return type of signal handlers" >&5
1787 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1788   echo $ac_n "(cached) $ac_c" 1>&6
1789 else
1790   cat > conftest.$ac_ext <<EOF
1791 #line 1803 "configure"
1792 #include "confdefs.h"
1793 #include <sys/types.h>
1794 #include <signal.h>
1795 #ifdef signal
1796 #undef signal
1797 #endif
1798 #ifdef __cplusplus
1799 extern "C" void (*signal (int, void (*)(int)))(int);
1800 #else
1801 void (*signal ()) ();
1802 #endif
1803
1804 int main() {
1805 int i;
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_type_signal=void
1811 else
1812   echo "configure: failed program was:" >&5
1813   cat conftest.$ac_ext >&5
1814   rm -rf conftest*
1815   ac_cv_type_signal=int
1816 fi
1817 rm -f conftest*
1818 fi
1819
1820 echo "$ac_t""$ac_cv_type_signal" 1>&6
1821 cat >> confdefs.h <<EOF
1822 #define RETSIGTYPE $ac_cv_type_signal
1823 EOF
1824
1825
1826 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1827 echo "configure:1839: checking whether time.h and sys/time.h may both be included" >&5
1828 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1829   echo $ac_n "(cached) $ac_c" 1>&6
1830 else
1831   cat > conftest.$ac_ext <<EOF
1832 #line 1844 "configure"
1833 #include "confdefs.h"
1834 #include <sys/types.h>
1835 #include <sys/time.h>
1836 #include <time.h>
1837 int main() {
1838 struct tm *tp;
1839 ; return 0; }
1840 EOF
1841 if { (eval echo configure:1853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1842   rm -rf conftest*
1843   ac_cv_header_time=yes
1844 else
1845   echo "configure: failed program was:" >&5
1846   cat conftest.$ac_ext >&5
1847   rm -rf conftest*
1848   ac_cv_header_time=no
1849 fi
1850 rm -f conftest*
1851 fi
1852
1853 echo "$ac_t""$ac_cv_header_time" 1>&6
1854 if test $ac_cv_header_time = yes; then
1855   cat >> confdefs.h <<\EOF
1856 #define TIME_WITH_SYS_TIME 1
1857 EOF
1858
1859 fi
1860
1861 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1862 echo "configure:1874: checking for sys/wait.h that is POSIX.1 compatible" >&5
1863 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1864   echo $ac_n "(cached) $ac_c" 1>&6
1865 else
1866   cat > conftest.$ac_ext <<EOF
1867 #line 1879 "configure"
1868 #include "confdefs.h"
1869 #include <sys/types.h>
1870 #include <sys/wait.h>
1871 #ifndef WEXITSTATUS
1872 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1873 #endif
1874 #ifndef WIFEXITED
1875 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1876 #endif
1877 int main() {
1878 int s;
1879 wait (&s);
1880 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1881 ; return 0; }
1882 EOF
1883 if { (eval echo configure:1895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1884   rm -rf conftest*
1885   ac_cv_header_sys_wait_h=yes
1886 else
1887   echo "configure: failed program was:" >&5
1888   cat conftest.$ac_ext >&5
1889   rm -rf conftest*
1890   ac_cv_header_sys_wait_h=no
1891 fi
1892 rm -f conftest*
1893 fi
1894
1895 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1896 if test $ac_cv_header_sys_wait_h = yes; then
1897   cat >> confdefs.h <<\EOF
1898 #define HAVE_SYS_WAIT_H 1
1899 EOF
1900
1901 fi
1902
1903 ac_header_dirent=no
1904 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1905 do
1906 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1907 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1908 echo "configure:1920: checking for $ac_hdr that defines DIR" >&5
1909 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1910   echo $ac_n "(cached) $ac_c" 1>&6
1911 else
1912   cat > conftest.$ac_ext <<EOF
1913 #line 1925 "configure"
1914 #include "confdefs.h"
1915 #include <sys/types.h>
1916 #include <$ac_hdr>
1917 int main() {
1918 DIR *dirp = 0;
1919 ; return 0; }
1920 EOF
1921 if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1922   rm -rf conftest*
1923   eval "ac_cv_header_dirent_$ac_safe=yes"
1924 else
1925   echo "configure: failed program was:" >&5
1926   cat conftest.$ac_ext >&5
1927   rm -rf conftest*
1928   eval "ac_cv_header_dirent_$ac_safe=no"
1929 fi
1930 rm -f conftest*
1931 fi
1932 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1933   echo "$ac_t""yes" 1>&6
1934     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1935   cat >> confdefs.h <<EOF
1936 #define $ac_tr_hdr 1
1937 EOF
1938  ac_header_dirent=$ac_hdr; break
1939 else
1940   echo "$ac_t""no" 1>&6
1941 fi
1942 done
1943 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1944 if test $ac_header_dirent = dirent.h; then
1945 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1946 echo "configure:1958: checking for opendir in -ldir" >&5
1947 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1948 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1949   echo $ac_n "(cached) $ac_c" 1>&6
1950 else
1951   ac_save_LIBS="$LIBS"
1952 LIBS="-ldir  $LIBS"
1953 cat > conftest.$ac_ext <<EOF
1954 #line 1966 "configure"
1955 #include "confdefs.h"
1956 /* Override any gcc2 internal prototype to avoid an error.  */
1957 /* We use char because int might match the return type of a gcc2
1958     builtin and then its argument prototype would still apply.  */
1959 char opendir();
1960
1961 int main() {
1962 opendir()
1963 ; return 0; }
1964 EOF
1965 if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1966   rm -rf conftest*
1967   eval "ac_cv_lib_$ac_lib_var=yes"
1968 else
1969   echo "configure: failed program was:" >&5
1970   cat conftest.$ac_ext >&5
1971   rm -rf conftest*
1972   eval "ac_cv_lib_$ac_lib_var=no"
1973 fi
1974 rm -f conftest*
1975 LIBS="$ac_save_LIBS"
1976
1977 fi
1978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1979   echo "$ac_t""yes" 1>&6
1980   LIBS="$LIBS -ldir"
1981 else
1982   echo "$ac_t""no" 1>&6
1983 fi
1984
1985 else
1986 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1987 echo "configure:1999: checking for opendir in -lx" >&5
1988 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1989 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1990   echo $ac_n "(cached) $ac_c" 1>&6
1991 else
1992   ac_save_LIBS="$LIBS"
1993 LIBS="-lx  $LIBS"
1994 cat > conftest.$ac_ext <<EOF
1995 #line 2007 "configure"
1996 #include "confdefs.h"
1997 /* Override any gcc2 internal prototype to avoid an error.  */
1998 /* We use char because int might match the return type of a gcc2
1999     builtin and then its argument prototype would still apply.  */
2000 char opendir();
2001
2002 int main() {
2003 opendir()
2004 ; return 0; }
2005 EOF
2006 if { (eval echo configure:2018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2007   rm -rf conftest*
2008   eval "ac_cv_lib_$ac_lib_var=yes"
2009 else
2010   echo "configure: failed program was:" >&5
2011   cat conftest.$ac_ext >&5
2012   rm -rf conftest*
2013   eval "ac_cv_lib_$ac_lib_var=no"
2014 fi
2015 rm -f conftest*
2016 LIBS="$ac_save_LIBS"
2017
2018 fi
2019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2020   echo "$ac_t""yes" 1>&6
2021   LIBS="$LIBS -lx"
2022 else
2023   echo "$ac_t""no" 1>&6
2024 fi
2025
2026 fi
2027
2028 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
2029 echo "configure:2041: checking how to call gettimeofday" >&5
2030   if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
2031   echo $ac_n "(cached) $ac_c" 1>&6
2032 else
2033   cat > conftest.$ac_ext <<EOF
2034 #line 2046 "configure"
2035 #include "confdefs.h"
2036 #include <stdlib.h>
2037                     #include <sys/time.h>
2038 int main() {
2039 struct timeval tv; struct timezone tzp;
2040                     gettimeofday(&tv, &tzp);
2041 ; return 0; }
2042 EOF
2043 if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2044   rm -rf conftest*
2045   ac_gettimeofday_args=2
2046 else
2047   echo "configure: failed program was:" >&5
2048   cat conftest.$ac_ext >&5
2049   rm -rf conftest*
2050   cat > conftest.$ac_ext <<EOF
2051 #line 2063 "configure"
2052 #include "confdefs.h"
2053 #include <stdlib.h>
2054                                     #include <sys/time.h>
2055 int main() {
2056 struct timeval tv; gettimeofday(&tv);
2057 ; return 0; }
2058 EOF
2059 if { (eval echo configure:2071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2060   rm -rf conftest*
2061   ac_gettimeofday_args=1
2062 else
2063   echo "configure: failed program was:" >&5
2064   cat conftest.$ac_ext >&5
2065   rm -rf conftest*
2066   ac_gettimeofday_args=0
2067 fi
2068 rm -f conftest*
2069 fi
2070 rm -f conftest*
2071     ac_cv_gettimeofday_args=$ac_gettimeofday_args
2072 fi
2073
2074   ac_gettimeofday_args=$ac_cv_gettimeofday_args
2075   if test "$ac_gettimeofday_args" = 1 ; then
2076     cat >> confdefs.h <<\EOF
2077 #define HAVE_GETTIMEOFDAY 1
2078 EOF
2079
2080     echo "$ac_t""one argument" 1>&6
2081   elif test "$ac_gettimeofday_args" = 2 ; then
2082     cat >> confdefs.h <<\EOF
2083 #define HAVE_GETTIMEOFDAY 1
2084 EOF
2085
2086     cat >> confdefs.h <<\EOF
2087 #define GETTIMEOFDAY_TWO_ARGS 1
2088 EOF
2089
2090     echo "$ac_t""two arguments" 1>&6
2091   else
2092     echo "$ac_t""unknown" 1>&6
2093   fi
2094
2095 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
2096 do
2097 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2098 echo "configure:2110: checking for $ac_func" >&5
2099 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2100   echo $ac_n "(cached) $ac_c" 1>&6
2101 else
2102   cat > conftest.$ac_ext <<EOF
2103 #line 2115 "configure"
2104 #include "confdefs.h"
2105 /* System header to define __stub macros and hopefully few prototypes,
2106     which can conflict with char $ac_func(); below.  */
2107 #include <assert.h>
2108 /* Override any gcc2 internal prototype to avoid an error.  */
2109 /* We use char because int might match the return type of a gcc2
2110     builtin and then its argument prototype would still apply.  */
2111 char $ac_func();
2112
2113 int main() {
2114
2115 /* The GNU C library defines this for functions which it implements
2116     to always fail with ENOSYS.  Some functions are actually named
2117     something starting with __ and the normal name is an alias.  */
2118 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2119 choke me
2120 #else
2121 $ac_func();
2122 #endif
2123
2124 ; return 0; }
2125 EOF
2126 if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2127   rm -rf conftest*
2128   eval "ac_cv_func_$ac_func=yes"
2129 else
2130   echo "configure: failed program was:" >&5
2131   cat conftest.$ac_ext >&5
2132   rm -rf conftest*
2133   eval "ac_cv_func_$ac_func=no"
2134 fi
2135 rm -f conftest*
2136 fi
2137
2138 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2139   echo "$ac_t""yes" 1>&6
2140     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2141   cat >> confdefs.h <<EOF
2142 #define $ac_tr_func 1
2143 EOF
2144  
2145 else
2146   echo "$ac_t""no" 1>&6
2147 fi
2148 done
2149
2150
2151 for ac_func in sigaction syslog realpath setrlimit
2152 do
2153 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2154 echo "configure:2166: checking for $ac_func" >&5
2155 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2156   echo $ac_n "(cached) $ac_c" 1>&6
2157 else
2158   cat > conftest.$ac_ext <<EOF
2159 #line 2171 "configure"
2160 #include "confdefs.h"
2161 /* System header to define __stub macros and hopefully few prototypes,
2162     which can conflict with char $ac_func(); below.  */
2163 #include <assert.h>
2164 /* Override any gcc2 internal prototype to avoid an error.  */
2165 /* We use char because int might match the return type of a gcc2
2166     builtin and then its argument prototype would still apply.  */
2167 char $ac_func();
2168
2169 int main() {
2170
2171 /* The GNU C library defines this for functions which it implements
2172     to always fail with ENOSYS.  Some functions are actually named
2173     something starting with __ and the normal name is an alias.  */
2174 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2175 choke me
2176 #else
2177 $ac_func();
2178 #endif
2179
2180 ; return 0; }
2181 EOF
2182 if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2183   rm -rf conftest*
2184   eval "ac_cv_func_$ac_func=yes"
2185 else
2186   echo "configure: failed program was:" >&5
2187   cat conftest.$ac_ext >&5
2188   rm -rf conftest*
2189   eval "ac_cv_func_$ac_func=no"
2190 fi
2191 rm -f conftest*
2192 fi
2193
2194 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2195   echo "$ac_t""yes" 1>&6
2196     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2197   cat >> confdefs.h <<EOF
2198 #define $ac_tr_func 1
2199 EOF
2200  
2201 else
2202   echo "$ac_t""no" 1>&6
2203 fi
2204 done
2205
2206 echo $ac_n "checking for struct icmp""... $ac_c" 1>&6
2207 echo "configure:2219: checking for struct icmp" >&5
2208 if eval "test \"`echo '$''{'ac_cv_have_icmp'+set}'`\" = set"; then
2209   echo $ac_n "(cached) $ac_c" 1>&6
2210 else
2211   cat > conftest.$ac_ext <<EOF
2212 #line 2224 "configure"
2213 #include "confdefs.h"
2214 #include <stdlib.h>
2215                    #include <stdio.h>
2216                    #include <math.h>
2217                    #include <unistd.h>
2218                    #include <limits.h>
2219                    #include <signal.h>
2220                    #include <fcntl.h>
2221                    #include <sys/types.h>
2222                    #include <sys/time.h>
2223                    #include <sys/ipc.h>
2224                    #include <sys/shm.h>
2225                    #include <sys/socket.h>
2226                    #include <netinet/in_systm.h>
2227                    #include <netinet/in.h>
2228                    #include <netinet/ip.h>
2229                    #include <netinet/ip_icmp.h>
2230                    #include <netinet/udp.h>
2231                    #include <arpa/inet.h>
2232                    #include <netdb.h>
2233 int main() {
2234 struct icmp i;
2235                    struct sockaddr s;
2236                    struct sockaddr_in si;
2237                    struct ip ip;
2238                    i.icmp_type = ICMP_ECHO;
2239                    i.icmp_code = 0;
2240                    i.icmp_cksum = 0;
2241                    i.icmp_id = 0;
2242                    i.icmp_seq = 0;
2243                    si.sin_family = AF_INET;
2244                    #if defined(__DECC) || defined(_IP_VHL)
2245                    ip.ip_vhl = 0;
2246                    #else
2247                    ip.ip_hl = 0;
2248                    #endif
2249                    
2250 ; return 0; }
2251 EOF
2252 if { (eval echo configure:2264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2253   rm -rf conftest*
2254   ac_cv_have_icmp=yes
2255 else
2256   echo "configure: failed program was:" >&5
2257   cat conftest.$ac_ext >&5
2258   rm -rf conftest*
2259   ac_cv_have_icmp=no
2260 fi
2261 rm -f conftest*
2262 fi
2263
2264 echo "$ac_t""$ac_cv_have_icmp" 1>&6
2265  if test "$ac_cv_have_icmp" = yes ; then
2266    cat >> confdefs.h <<\EOF
2267 #define HAVE_ICMP 1
2268 EOF
2269
2270  fi
2271 echo $ac_n "checking for struct icmphdr""... $ac_c" 1>&6
2272 echo "configure:2284: checking for struct icmphdr" >&5
2273 if eval "test \"`echo '$''{'ac_cv_have_icmphdr'+set}'`\" = set"; then
2274   echo $ac_n "(cached) $ac_c" 1>&6
2275 else
2276   cat > conftest.$ac_ext <<EOF
2277 #line 2289 "configure"
2278 #include "confdefs.h"
2279 #include <stdlib.h>
2280                    #include <stdio.h>
2281                    #include <math.h>
2282                    #include <unistd.h>
2283                    #include <limits.h>
2284                    #include <signal.h>
2285                    #include <fcntl.h>
2286                    #include <sys/types.h>
2287                    #include <sys/time.h>
2288                    #include <sys/ipc.h>
2289                    #include <sys/shm.h>
2290                    #include <sys/socket.h>
2291                    #include <netinet/in_systm.h>
2292                    #include <netinet/in.h>
2293                    #include <netinet/ip.h>
2294                    #include <netinet/ip_icmp.h>
2295                    #include <netinet/udp.h>
2296                    #include <arpa/inet.h>
2297                    #include <netdb.h>
2298 int main() {
2299 struct icmphdr i;
2300                    struct sockaddr s;
2301                    struct sockaddr_in si;
2302                    struct ip ip;
2303                    i.type = ICMP_ECHO;
2304                    i.code = 0;
2305                    i.checksum = 0;
2306                    i.un.echo.id = 0;
2307                    i.un.echo.sequence = 0;
2308                    si.sin_family = AF_INET;
2309                    ip.ip_hl = 0;
2310 ; return 0; }
2311 EOF
2312 if { (eval echo configure:2324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2313   rm -rf conftest*
2314   ac_cv_have_icmphdr=yes
2315 else
2316   echo "configure: failed program was:" >&5
2317   cat conftest.$ac_ext >&5
2318   rm -rf conftest*
2319   ac_cv_have_icmphdr=no
2320 fi
2321 rm -f conftest*
2322 fi
2323
2324 echo "$ac_t""$ac_cv_have_icmphdr" 1>&6
2325  if test "$ac_cv_have_icmphdr" = yes ; then
2326    cat >> confdefs.h <<\EOF
2327 #define HAVE_ICMPHDR 1
2328 EOF
2329
2330  fi
2331 for ac_hdr in crypt.h sys/select.h
2332 do
2333 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2334 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2335 echo "configure:2347: checking for $ac_hdr" >&5
2336 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2337   echo $ac_n "(cached) $ac_c" 1>&6
2338 else
2339   cat > conftest.$ac_ext <<EOF
2340 #line 2352 "configure"
2341 #include "confdefs.h"
2342 #include <$ac_hdr>
2343 EOF
2344 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2345 { (eval echo configure:2357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2346 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2347 if test -z "$ac_err"; then
2348   rm -rf conftest*
2349   eval "ac_cv_header_$ac_safe=yes"
2350 else
2351   echo "$ac_err" >&5
2352   echo "configure: failed program was:" >&5
2353   cat conftest.$ac_ext >&5
2354   rm -rf conftest*
2355   eval "ac_cv_header_$ac_safe=no"
2356 fi
2357 rm -f conftest*
2358 fi
2359 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2360   echo "$ac_t""yes" 1>&6
2361     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2362   cat >> confdefs.h <<EOF
2363 #define $ac_tr_hdr 1
2364 EOF
2365  
2366 else
2367   echo "$ac_t""no" 1>&6
2368 fi
2369 done
2370
2371 for ac_prog in perl5 perl
2372 do
2373 # Extract the first word of "$ac_prog", so it can be a program name with args.
2374 set dummy $ac_prog; ac_word=$2
2375 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2376 echo "configure:2388: checking for $ac_word" >&5
2377 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
2378   echo $ac_n "(cached) $ac_c" 1>&6
2379 else
2380   case "$PERL" in
2381   /*)
2382   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
2383   ;;
2384   ?:/*)                  
2385   ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
2386   ;;
2387   *)
2388   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2389   ac_dummy="$PATH"
2390   for ac_dir in $ac_dummy; do 
2391     test -z "$ac_dir" && ac_dir=.
2392     if test -f $ac_dir/$ac_word; then
2393       ac_cv_path_PERL="$ac_dir/$ac_word"
2394       break
2395     fi
2396   done
2397   IFS="$ac_save_ifs"
2398   ;;
2399 esac
2400 fi
2401 PERL="$ac_cv_path_PERL"
2402 if test -n "$PERL"; then
2403   echo "$ac_t""$PERL" 1>&6
2404 else
2405   echo "$ac_t""no" 1>&6
2406 fi
2407
2408 test -n "$PERL" && break
2409 done
2410
2411   if test -z "$PERL" ; then
2412     PERL_VERSION=0
2413   else
2414     echo $ac_n "checking perl version""... $ac_c" 1>&6
2415 echo "configure:2427: checking perl version" >&5
2416 if eval "test \"`echo '$''{'ac_cv_perl_version'+set}'`\" = set"; then
2417   echo $ac_n "(cached) $ac_c" 1>&6
2418 else
2419   ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`
2420 fi
2421
2422 echo "$ac_t""$ac_cv_perl_version" 1>&6
2423     PERL_VERSION=$ac_cv_perl_version
2424   fi
2425  
2426
2427 if test -z "$PERL" ; then
2428   # don't let it be blank...
2429   PERL=/usr/bin/perl
2430 fi
2431
2432 # If we find X, set shell vars x_includes and x_libraries to the
2433 # paths, otherwise set no_x=yes.
2434 # Uses ac_ vars as temps to allow command line to override cache and checks.
2435 # --without-x overrides everything else, but does not touch the cache.
2436 echo $ac_n "checking for X""... $ac_c" 1>&6
2437 echo "configure:2449: checking for X" >&5
2438
2439 # Check whether --with-x or --without-x was given.
2440 if test "${with_x+set}" = set; then
2441   withval="$with_x"
2442   :
2443 fi
2444
2445 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
2446 if test "x$with_x" = xno; then
2447   # The user explicitly disabled X.
2448   have_x=disabled
2449 else
2450   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
2451     # Both variables are already set.
2452     have_x=yes
2453   else
2454 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
2455   echo $ac_n "(cached) $ac_c" 1>&6
2456 else
2457   # One or both of the vars are not set, and there is no cached value.
2458 ac_x_includes=NO ac_x_libraries=NO
2459 rm -fr conftestdir
2460 if mkdir conftestdir; then
2461   cd conftestdir
2462   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2463   cat > Imakefile <<'EOF'
2464 acfindx:
2465         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
2466 EOF
2467   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2468     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2469     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2470     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
2471     for ac_extension in a so sl; do
2472       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
2473         test -f $ac_im_libdir/libX11.$ac_extension; then
2474         ac_im_usrlibdir=$ac_im_libdir; break
2475       fi
2476     done
2477     # Screen out bogus values from the imake configuration.  They are
2478     # bogus both because they are the default anyway, and because
2479     # using them would break gcc on systems where it needs fixed includes.
2480     case "$ac_im_incroot" in
2481         /usr/include) ;;
2482         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
2483     esac
2484     case "$ac_im_usrlibdir" in
2485         /usr/lib | /lib) ;;
2486         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
2487     esac
2488   fi
2489   cd ..
2490   rm -fr conftestdir
2491 fi
2492
2493 if test "$ac_x_includes" = NO; then
2494   # Guess where to find include files, by looking for this one X11 .h file.
2495   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
2496
2497   # First, try using that file with no special directory specified.
2498 cat > conftest.$ac_ext <<EOF
2499 #line 2511 "configure"
2500 #include "confdefs.h"
2501 #include <$x_direct_test_include>
2502 EOF
2503 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2504 { (eval echo configure:2516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2505 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2506 if test -z "$ac_err"; then
2507   rm -rf conftest*
2508   # We can compile using X headers with no special include directory.
2509 ac_x_includes=
2510 else
2511   echo "$ac_err" >&5
2512   echo "configure: failed program was:" >&5
2513   cat conftest.$ac_ext >&5
2514   rm -rf conftest*
2515   # Look for the header file in a standard set of common directories.
2516 # Check X11 before X11Rn because it is often a symlink to the current release.
2517   for ac_dir in               \
2518     /usr/X11/include          \
2519     /usr/X11R6/include        \
2520     /usr/X11R5/include        \
2521     /usr/X11R4/include        \
2522                               \
2523     /usr/include/X11          \
2524     /usr/include/X11R6        \
2525     /usr/include/X11R5        \
2526     /usr/include/X11R4        \
2527                               \
2528     /usr/local/X11/include    \
2529     /usr/local/X11R6/include  \
2530     /usr/local/X11R5/include  \
2531     /usr/local/X11R4/include  \
2532                               \
2533     /usr/local/include/X11    \
2534     /usr/local/include/X11R6  \
2535     /usr/local/include/X11R5  \
2536     /usr/local/include/X11R4  \
2537                               \
2538     /usr/X386/include         \
2539     /usr/x386/include         \
2540     /usr/XFree86/include/X11  \
2541                               \
2542     /usr/include              \
2543     /usr/local/include        \
2544     /usr/unsupported/include  \
2545     /usr/athena/include       \
2546     /usr/local/x11r5/include  \
2547     /usr/lpp/Xamples/include  \
2548                               \
2549     /usr/openwin/include      \
2550     /usr/openwin/share/include \
2551     ; \
2552   do
2553     if test -r "$ac_dir/$x_direct_test_include"; then
2554       ac_x_includes=$ac_dir
2555       break
2556     fi
2557   done
2558 fi
2559 rm -f conftest*
2560 fi # $ac_x_includes = NO
2561
2562 if test "$ac_x_libraries" = NO; then
2563   # Check for the libraries.
2564
2565   test -z "$x_direct_test_library" && x_direct_test_library=Xt
2566   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2567
2568   # See if we find them without any special options.
2569   # Don't add to $LIBS permanently.
2570   ac_save_LIBS="$LIBS"
2571   LIBS="-l$x_direct_test_library $LIBS"
2572 cat > conftest.$ac_ext <<EOF
2573 #line 2585 "configure"
2574 #include "confdefs.h"
2575
2576 int main() {
2577 ${x_direct_test_function}()
2578 ; return 0; }
2579 EOF
2580 if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2581   rm -rf conftest*
2582   LIBS="$ac_save_LIBS"
2583 # We can link X programs with no special library path.
2584 ac_x_libraries=
2585 else
2586   echo "configure: failed program was:" >&5
2587   cat conftest.$ac_ext >&5
2588   rm -rf conftest*
2589   LIBS="$ac_save_LIBS"
2590 # First see if replacing the include by lib works.
2591 # Check X11 before X11Rn because it is often a symlink to the current release.
2592 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2593     /usr/X11/lib          \
2594     /usr/X11R6/lib        \
2595     /usr/X11R5/lib        \
2596     /usr/X11R4/lib        \
2597                           \
2598     /usr/lib/X11          \
2599     /usr/lib/X11R6        \
2600     /usr/lib/X11R5        \
2601     /usr/lib/X11R4        \
2602                           \
2603     /usr/local/X11/lib    \
2604     /usr/local/X11R6/lib  \
2605     /usr/local/X11R5/lib  \
2606     /usr/local/X11R4/lib  \
2607                           \
2608     /usr/local/lib/X11    \
2609     /usr/local/lib/X11R6  \
2610     /usr/local/lib/X11R5  \
2611     /usr/local/lib/X11R4  \
2612                           \
2613     /usr/X386/lib         \
2614     /usr/x386/lib         \
2615     /usr/XFree86/lib/X11  \
2616                           \
2617     /usr/lib              \
2618     /usr/local/lib        \
2619     /usr/unsupported/lib  \
2620     /usr/athena/lib       \
2621     /usr/local/x11r5/lib  \
2622     /usr/lpp/Xamples/lib  \
2623     /lib/usr/lib/X11      \
2624                           \
2625     /usr/openwin/lib      \
2626     /usr/openwin/share/lib \
2627     ; \
2628 do
2629   for ac_extension in a so sl; do
2630     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2631       ac_x_libraries=$ac_dir
2632       break 2
2633     fi
2634   done
2635 done
2636 fi
2637 rm -f conftest*
2638 fi # $ac_x_libraries = NO
2639
2640 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2641   # Didn't find X anywhere.  Cache the known absence of X.
2642   ac_cv_have_x="have_x=no"
2643 else
2644   # Record where we found X for the cache.
2645   ac_cv_have_x="have_x=yes \
2646                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2647 fi
2648 fi
2649   fi
2650   eval "$ac_cv_have_x"
2651 fi # $with_x != no
2652
2653 if test "$have_x" != yes; then
2654   echo "$ac_t""$have_x" 1>&6
2655   no_x=yes
2656 else
2657   # If each of the values was on the command line, it overrides each guess.
2658   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2659   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2660   # Update the cache value to reflect the command line values.
2661   ac_cv_have_x="have_x=yes \
2662                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2663   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2664 fi
2665
2666 if test "$no_x" = yes; then
2667   # Not all programs may use this symbol, but it does not hurt to define it.
2668   cat >> confdefs.h <<\EOF
2669 #define X_DISPLAY_MISSING 1
2670 EOF
2671
2672   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2673 else
2674   if test -n "$x_includes"; then
2675     X_CFLAGS="$X_CFLAGS -I$x_includes"
2676   fi
2677
2678   # It would also be nice to do this for all -L options, not just this one.
2679   if test -n "$x_libraries"; then
2680     X_LIBS="$X_LIBS -L$x_libraries"
2681     # For Solaris; some versions of Sun CC require a space after -R and
2682     # others require no space.  Words are not sufficient . . . .
2683     case "`(uname -sr) 2>/dev/null`" in
2684     "SunOS 5"*)
2685       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2686 echo "configure:2698: checking whether -R must be followed by a space" >&5
2687       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2688       cat > conftest.$ac_ext <<EOF
2689 #line 2701 "configure"
2690 #include "confdefs.h"
2691
2692 int main() {
2693
2694 ; return 0; }
2695 EOF
2696 if { (eval echo configure:2708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2697   rm -rf conftest*
2698   ac_R_nospace=yes
2699 else
2700   echo "configure: failed program was:" >&5
2701   cat conftest.$ac_ext >&5
2702   rm -rf conftest*
2703   ac_R_nospace=no
2704 fi
2705 rm -f conftest*
2706       if test $ac_R_nospace = yes; then
2707         echo "$ac_t""no" 1>&6
2708         X_LIBS="$X_LIBS -R$x_libraries"
2709       else
2710         LIBS="$ac_xsave_LIBS -R $x_libraries"
2711         cat > conftest.$ac_ext <<EOF
2712 #line 2724 "configure"
2713 #include "confdefs.h"
2714
2715 int main() {
2716
2717 ; return 0; }
2718 EOF
2719 if { (eval echo configure:2731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2720   rm -rf conftest*
2721   ac_R_space=yes
2722 else
2723   echo "configure: failed program was:" >&5
2724   cat conftest.$ac_ext >&5
2725   rm -rf conftest*
2726   ac_R_space=no
2727 fi
2728 rm -f conftest*
2729         if test $ac_R_space = yes; then
2730           echo "$ac_t""yes" 1>&6
2731           X_LIBS="$X_LIBS -R $x_libraries"
2732         else
2733           echo "$ac_t""neither works" 1>&6
2734         fi
2735       fi
2736       LIBS="$ac_xsave_LIBS"
2737     esac
2738   fi
2739
2740   # Check for system-dependent libraries X programs must link with.
2741   # Do this before checking for the system-independent R6 libraries
2742   # (-lICE), since we may need -lsocket or whatever for X linking.
2743
2744   if test "$ISC" = yes; then
2745     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2746   else
2747     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2748     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2749     # the Alpha needs dnet_stub (dnet does not exist).
2750     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2751 echo "configure:2763: checking for dnet_ntoa in -ldnet" >&5
2752 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2753 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2754   echo $ac_n "(cached) $ac_c" 1>&6
2755 else
2756   ac_save_LIBS="$LIBS"
2757 LIBS="-ldnet  $LIBS"
2758 cat > conftest.$ac_ext <<EOF
2759 #line 2771 "configure"
2760 #include "confdefs.h"
2761 /* Override any gcc2 internal prototype to avoid an error.  */
2762 /* We use char because int might match the return type of a gcc2
2763     builtin and then its argument prototype would still apply.  */
2764 char dnet_ntoa();
2765
2766 int main() {
2767 dnet_ntoa()
2768 ; return 0; }
2769 EOF
2770 if { (eval echo configure:2782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2771   rm -rf conftest*
2772   eval "ac_cv_lib_$ac_lib_var=yes"
2773 else
2774   echo "configure: failed program was:" >&5
2775   cat conftest.$ac_ext >&5
2776   rm -rf conftest*
2777   eval "ac_cv_lib_$ac_lib_var=no"
2778 fi
2779 rm -f conftest*
2780 LIBS="$ac_save_LIBS"
2781
2782 fi
2783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2784   echo "$ac_t""yes" 1>&6
2785   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2786 else
2787   echo "$ac_t""no" 1>&6
2788 fi
2789
2790     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2791       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2792 echo "configure:2804: checking for dnet_ntoa in -ldnet_stub" >&5
2793 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2794 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   ac_save_LIBS="$LIBS"
2798 LIBS="-ldnet_stub  $LIBS"
2799 cat > conftest.$ac_ext <<EOF
2800 #line 2812 "configure"
2801 #include "confdefs.h"
2802 /* Override any gcc2 internal prototype to avoid an error.  */
2803 /* We use char because int might match the return type of a gcc2
2804     builtin and then its argument prototype would still apply.  */
2805 char dnet_ntoa();
2806
2807 int main() {
2808 dnet_ntoa()
2809 ; return 0; }
2810 EOF
2811 if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2812   rm -rf conftest*
2813   eval "ac_cv_lib_$ac_lib_var=yes"
2814 else
2815   echo "configure: failed program was:" >&5
2816   cat conftest.$ac_ext >&5
2817   rm -rf conftest*
2818   eval "ac_cv_lib_$ac_lib_var=no"
2819 fi
2820 rm -f conftest*
2821 LIBS="$ac_save_LIBS"
2822
2823 fi
2824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2825   echo "$ac_t""yes" 1>&6
2826   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2827 else
2828   echo "$ac_t""no" 1>&6
2829 fi
2830
2831     fi
2832
2833     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2834     # to get the SysV transport functions.
2835     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2836     # needs -lnsl.
2837     # The nsl library prevents programs from opening the X display
2838     # on Irix 5.2, according to dickey@clark.net.
2839     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2840 echo "configure:2852: checking for gethostbyname" >&5
2841 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2842   echo $ac_n "(cached) $ac_c" 1>&6
2843 else
2844   cat > conftest.$ac_ext <<EOF
2845 #line 2857 "configure"
2846 #include "confdefs.h"
2847 /* System header to define __stub macros and hopefully few prototypes,
2848     which can conflict with char gethostbyname(); below.  */
2849 #include <assert.h>
2850 /* Override any gcc2 internal prototype to avoid an error.  */
2851 /* We use char because int might match the return type of a gcc2
2852     builtin and then its argument prototype would still apply.  */
2853 char gethostbyname();
2854
2855 int main() {
2856
2857 /* The GNU C library defines this for functions which it implements
2858     to always fail with ENOSYS.  Some functions are actually named
2859     something starting with __ and the normal name is an alias.  */
2860 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2861 choke me
2862 #else
2863 gethostbyname();
2864 #endif
2865
2866 ; return 0; }
2867 EOF
2868 if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2869   rm -rf conftest*
2870   eval "ac_cv_func_gethostbyname=yes"
2871 else
2872   echo "configure: failed program was:" >&5
2873   cat conftest.$ac_ext >&5
2874   rm -rf conftest*
2875   eval "ac_cv_func_gethostbyname=no"
2876 fi
2877 rm -f conftest*
2878 fi
2879
2880 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2881   echo "$ac_t""yes" 1>&6
2882   :
2883 else
2884   echo "$ac_t""no" 1>&6
2885 fi
2886
2887     if test $ac_cv_func_gethostbyname = no; then
2888       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2889 echo "configure:2901: checking for gethostbyname in -lnsl" >&5
2890 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2891 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2892   echo $ac_n "(cached) $ac_c" 1>&6
2893 else
2894   ac_save_LIBS="$LIBS"
2895 LIBS="-lnsl  $LIBS"
2896 cat > conftest.$ac_ext <<EOF
2897 #line 2909 "configure"
2898 #include "confdefs.h"
2899 /* Override any gcc2 internal prototype to avoid an error.  */
2900 /* We use char because int might match the return type of a gcc2
2901     builtin and then its argument prototype would still apply.  */
2902 char gethostbyname();
2903
2904 int main() {
2905 gethostbyname()
2906 ; return 0; }
2907 EOF
2908 if { (eval echo configure:2920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2909   rm -rf conftest*
2910   eval "ac_cv_lib_$ac_lib_var=yes"
2911 else
2912   echo "configure: failed program was:" >&5
2913   cat conftest.$ac_ext >&5
2914   rm -rf conftest*
2915   eval "ac_cv_lib_$ac_lib_var=no"
2916 fi
2917 rm -f conftest*
2918 LIBS="$ac_save_LIBS"
2919
2920 fi
2921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2922   echo "$ac_t""yes" 1>&6
2923   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2924 else
2925   echo "$ac_t""no" 1>&6
2926 fi
2927
2928     fi
2929
2930     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2931     # socket/setsockopt and other routines are undefined under SCO ODT
2932     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2933     # on later versions), says simon@lia.di.epfl.ch: it contains
2934     # gethostby* variants that don't use the nameserver (or something).
2935     # -lsocket must be given before -lnsl if both are needed.
2936     # We assume that if connect needs -lnsl, so does gethostbyname.
2937     echo $ac_n "checking for connect""... $ac_c" 1>&6
2938 echo "configure:2950: checking for connect" >&5
2939 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2940   echo $ac_n "(cached) $ac_c" 1>&6
2941 else
2942   cat > conftest.$ac_ext <<EOF
2943 #line 2955 "configure"
2944 #include "confdefs.h"
2945 /* System header to define __stub macros and hopefully few prototypes,
2946     which can conflict with char connect(); below.  */
2947 #include <assert.h>
2948 /* Override any gcc2 internal prototype to avoid an error.  */
2949 /* We use char because int might match the return type of a gcc2
2950     builtin and then its argument prototype would still apply.  */
2951 char connect();
2952
2953 int main() {
2954
2955 /* The GNU C library defines this for functions which it implements
2956     to always fail with ENOSYS.  Some functions are actually named
2957     something starting with __ and the normal name is an alias.  */
2958 #if defined (__stub_connect) || defined (__stub___connect)
2959 choke me
2960 #else
2961 connect();
2962 #endif
2963
2964 ; return 0; }
2965 EOF
2966 if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2967   rm -rf conftest*
2968   eval "ac_cv_func_connect=yes"
2969 else
2970   echo "configure: failed program was:" >&5
2971   cat conftest.$ac_ext >&5
2972   rm -rf conftest*
2973   eval "ac_cv_func_connect=no"
2974 fi
2975 rm -f conftest*
2976 fi
2977
2978 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2979   echo "$ac_t""yes" 1>&6
2980   :
2981 else
2982   echo "$ac_t""no" 1>&6
2983 fi
2984
2985     if test $ac_cv_func_connect = no; then
2986       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2987 echo "configure:2999: checking for connect in -lsocket" >&5
2988 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2989 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2990   echo $ac_n "(cached) $ac_c" 1>&6
2991 else
2992   ac_save_LIBS="$LIBS"
2993 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2994 cat > conftest.$ac_ext <<EOF
2995 #line 3007 "configure"
2996 #include "confdefs.h"
2997 /* Override any gcc2 internal prototype to avoid an error.  */
2998 /* We use char because int might match the return type of a gcc2
2999     builtin and then its argument prototype would still apply.  */
3000 char connect();
3001
3002 int main() {
3003 connect()
3004 ; return 0; }
3005 EOF
3006 if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3007   rm -rf conftest*
3008   eval "ac_cv_lib_$ac_lib_var=yes"
3009 else
3010   echo "configure: failed program was:" >&5
3011   cat conftest.$ac_ext >&5
3012   rm -rf conftest*
3013   eval "ac_cv_lib_$ac_lib_var=no"
3014 fi
3015 rm -f conftest*
3016 LIBS="$ac_save_LIBS"
3017
3018 fi
3019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3020   echo "$ac_t""yes" 1>&6
3021   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025
3026     fi
3027
3028     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
3029     echo $ac_n "checking for remove""... $ac_c" 1>&6
3030 echo "configure:3042: checking for remove" >&5
3031 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
3032   echo $ac_n "(cached) $ac_c" 1>&6
3033 else
3034   cat > conftest.$ac_ext <<EOF
3035 #line 3047 "configure"
3036 #include "confdefs.h"
3037 /* System header to define __stub macros and hopefully few prototypes,
3038     which can conflict with char remove(); below.  */
3039 #include <assert.h>
3040 /* Override any gcc2 internal prototype to avoid an error.  */
3041 /* We use char because int might match the return type of a gcc2
3042     builtin and then its argument prototype would still apply.  */
3043 char remove();
3044
3045 int main() {
3046
3047 /* The GNU C library defines this for functions which it implements
3048     to always fail with ENOSYS.  Some functions are actually named
3049     something starting with __ and the normal name is an alias.  */
3050 #if defined (__stub_remove) || defined (__stub___remove)
3051 choke me
3052 #else
3053 remove();
3054 #endif
3055
3056 ; return 0; }
3057 EOF
3058 if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3059   rm -rf conftest*
3060   eval "ac_cv_func_remove=yes"
3061 else
3062   echo "configure: failed program was:" >&5
3063   cat conftest.$ac_ext >&5
3064   rm -rf conftest*
3065   eval "ac_cv_func_remove=no"
3066 fi
3067 rm -f conftest*
3068 fi
3069
3070 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
3071   echo "$ac_t""yes" 1>&6
3072   :
3073 else
3074   echo "$ac_t""no" 1>&6
3075 fi
3076
3077     if test $ac_cv_func_remove = no; then
3078       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
3079 echo "configure:3091: checking for remove in -lposix" >&5
3080 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
3081 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3082   echo $ac_n "(cached) $ac_c" 1>&6
3083 else
3084   ac_save_LIBS="$LIBS"
3085 LIBS="-lposix  $LIBS"
3086 cat > conftest.$ac_ext <<EOF
3087 #line 3099 "configure"
3088 #include "confdefs.h"
3089 /* Override any gcc2 internal prototype to avoid an error.  */
3090 /* We use char because int might match the return type of a gcc2
3091     builtin and then its argument prototype would still apply.  */
3092 char remove();
3093
3094 int main() {
3095 remove()
3096 ; return 0; }
3097 EOF
3098 if { (eval echo configure:3110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3099   rm -rf conftest*
3100   eval "ac_cv_lib_$ac_lib_var=yes"
3101 else
3102   echo "configure: failed program was:" >&5
3103   cat conftest.$ac_ext >&5
3104   rm -rf conftest*
3105   eval "ac_cv_lib_$ac_lib_var=no"
3106 fi
3107 rm -f conftest*
3108 LIBS="$ac_save_LIBS"
3109
3110 fi
3111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3112   echo "$ac_t""yes" 1>&6
3113   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
3114 else
3115   echo "$ac_t""no" 1>&6
3116 fi
3117
3118     fi
3119
3120     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
3121     echo $ac_n "checking for shmat""... $ac_c" 1>&6
3122 echo "configure:3134: checking for shmat" >&5
3123 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
3124   echo $ac_n "(cached) $ac_c" 1>&6
3125 else
3126   cat > conftest.$ac_ext <<EOF
3127 #line 3139 "configure"
3128 #include "confdefs.h"
3129 /* System header to define __stub macros and hopefully few prototypes,
3130     which can conflict with char shmat(); below.  */
3131 #include <assert.h>
3132 /* Override any gcc2 internal prototype to avoid an error.  */
3133 /* We use char because int might match the return type of a gcc2
3134     builtin and then its argument prototype would still apply.  */
3135 char shmat();
3136
3137 int main() {
3138
3139 /* The GNU C library defines this for functions which it implements
3140     to always fail with ENOSYS.  Some functions are actually named
3141     something starting with __ and the normal name is an alias.  */
3142 #if defined (__stub_shmat) || defined (__stub___shmat)
3143 choke me
3144 #else
3145 shmat();
3146 #endif
3147
3148 ; return 0; }
3149 EOF
3150 if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3151   rm -rf conftest*
3152   eval "ac_cv_func_shmat=yes"
3153 else
3154   echo "configure: failed program was:" >&5
3155   cat conftest.$ac_ext >&5
3156   rm -rf conftest*
3157   eval "ac_cv_func_shmat=no"
3158 fi
3159 rm -f conftest*
3160 fi
3161
3162 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
3163   echo "$ac_t""yes" 1>&6
3164   :
3165 else
3166   echo "$ac_t""no" 1>&6
3167 fi
3168
3169     if test $ac_cv_func_shmat = no; then
3170       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
3171 echo "configure:3183: checking for shmat in -lipc" >&5
3172 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
3173 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3174   echo $ac_n "(cached) $ac_c" 1>&6
3175 else
3176   ac_save_LIBS="$LIBS"
3177 LIBS="-lipc  $LIBS"
3178 cat > conftest.$ac_ext <<EOF
3179 #line 3191 "configure"
3180 #include "confdefs.h"
3181 /* Override any gcc2 internal prototype to avoid an error.  */
3182 /* We use char because int might match the return type of a gcc2
3183     builtin and then its argument prototype would still apply.  */
3184 char shmat();
3185
3186 int main() {
3187 shmat()
3188 ; return 0; }
3189 EOF
3190 if { (eval echo configure:3202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3191   rm -rf conftest*
3192   eval "ac_cv_lib_$ac_lib_var=yes"
3193 else
3194   echo "configure: failed program was:" >&5
3195   cat conftest.$ac_ext >&5
3196   rm -rf conftest*
3197   eval "ac_cv_lib_$ac_lib_var=no"
3198 fi
3199 rm -f conftest*
3200 LIBS="$ac_save_LIBS"
3201
3202 fi
3203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3204   echo "$ac_t""yes" 1>&6
3205   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
3206 else
3207   echo "$ac_t""no" 1>&6
3208 fi
3209
3210     fi
3211   fi
3212
3213   # Check for libraries that X11R6 Xt/Xaw programs need.
3214   ac_save_LDFLAGS="$LDFLAGS"
3215   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
3216   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
3217   # check for ICE first), but we must link in the order -lSM -lICE or
3218   # we get undefined symbols.  So assume we have SM if we have ICE.
3219   # These have to be linked with before -lX11, unlike the other
3220   # libraries we check for below, so use a different variable.
3221   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
3222   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
3223 echo "configure:3235: checking for IceConnectionNumber in -lICE" >&5
3224 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
3225 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3226   echo $ac_n "(cached) $ac_c" 1>&6
3227 else
3228   ac_save_LIBS="$LIBS"
3229 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
3230 cat > conftest.$ac_ext <<EOF
3231 #line 3243 "configure"
3232 #include "confdefs.h"
3233 /* Override any gcc2 internal prototype to avoid an error.  */
3234 /* We use char because int might match the return type of a gcc2
3235     builtin and then its argument prototype would still apply.  */
3236 char IceConnectionNumber();
3237
3238 int main() {
3239 IceConnectionNumber()
3240 ; return 0; }
3241 EOF
3242 if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3243   rm -rf conftest*
3244   eval "ac_cv_lib_$ac_lib_var=yes"
3245 else
3246   echo "configure: failed program was:" >&5
3247   cat conftest.$ac_ext >&5
3248   rm -rf conftest*
3249   eval "ac_cv_lib_$ac_lib_var=no"
3250 fi
3251 rm -f conftest*
3252 LIBS="$ac_save_LIBS"
3253
3254 fi
3255 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3256   echo "$ac_t""yes" 1>&6
3257   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
3258 else
3259   echo "$ac_t""no" 1>&6
3260 fi
3261
3262   LDFLAGS="$ac_save_LDFLAGS"
3263
3264 fi
3265
3266
3267 if test "$have_x" != yes; then
3268   { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
3269 fi
3270
3271
3272     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
3273 echo "configure:3285: checking for X app-defaults directory" >&5
3274 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
3275   echo $ac_n "(cached) $ac_c" 1>&6
3276 else
3277   
3278   rm -fr conftestdir
3279   if mkdir conftestdir; then
3280     cd conftestdir >&-
3281     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
3282     cat > Imakefile <<'EOF'
3283 acfindx:
3284         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
3285 EOF
3286     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
3287       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
3288       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
3289     fi
3290     cd .. >&-
3291     rm -fr conftestdir
3292   fi
3293       if test x"$ac_x_app_defaults" = x; then
3294         
3295   # Look for the directory under a standard set of common directories.
3296   # Check X11 before X11Rn because it's often a symlink to the current release.
3297   for ac_dir in                                 \
3298     /usr/X11/lib/app-defaults                   \
3299     /usr/X11R6/lib/app-defaults                 \
3300     /usr/X11R6/lib/X11/app-defaults             \
3301     /usr/X11R5/lib/app-defaults                 \
3302     /usr/X11R5/lib/X11/app-defaults             \
3303     /usr/X11R4/lib/app-defaults                 \
3304     /usr/X11R4/lib/X11/app-defaults             \
3305                                                 \
3306     /usr/lib/X11/app-defaults                   \
3307     /usr/lib/X11R6/app-defaults                 \
3308     /usr/lib/X11R5/app-defaults                 \
3309     /usr/lib/X11R4/app-defaults                 \
3310                                                 \
3311     /usr/local/X11/lib/app-defaults             \
3312     /usr/local/X11R6/lib/app-defaults           \
3313     /usr/local/X11R5/lib/app-defaults           \
3314     /usr/local/X11R4/lib/app-defaults           \
3315                                                 \
3316     /usr/local/lib/X11/app-defaults             \
3317     /usr/local/lib/X11R6/app-defaults           \
3318     /usr/local/lib/X11R6/X11/app-defaults       \
3319     /usr/local/lib/X11R5/app-defaults           \
3320     /usr/local/lib/X11R5/X11/app-defaults       \
3321     /usr/local/lib/X11R4/app-defaults           \
3322     /usr/local/lib/X11R4/X11/app-defaults       \
3323                                                 \
3324     /usr/X386/lib/X11/app-defaults              \
3325     /usr/x386/lib/X11/app-defaults              \
3326     /usr/XFree86/lib/X11/app-defaults           \
3327                                                 \
3328     /usr/lib/X11/app-defaults                   \
3329     /usr/local/lib/X11/app-defaults             \
3330     /usr/unsupported/lib/X11/app-defaults       \
3331     /usr/athena/lib/X11/app-defaults            \
3332     /usr/local/x11r5/lib/X11/app-defaults       \
3333     /usr/lpp/Xamples/lib/X11/app-defaults       \
3334     /lib/usr/lib/X11/app-defaults               \
3335                                                 \
3336     /usr/openwin/lib/app-defaults               \
3337     /usr/openwin/lib/X11/app-defaults           \
3338     /usr/openwin/share/lib/app-defaults         \
3339     /usr/openwin/share/lib/X11/app-defaults     \
3340                                                 \
3341     /X11R6/lib/app-defaults                     \
3342     /X11R5/lib/app-defaults                     \
3343     /X11R4/lib/app-defaults                     \
3344     ; \
3345   do
3346     if test -d "$ac_dir"; then
3347       ac_x_app_defaults=$ac_dir
3348       break
3349     fi
3350   done
3351
3352       fi
3353       if test x"$ac_x_app_defaults" = x; then
3354         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
3355       else
3356         # Record where we found app-defaults for the cache.
3357         ac_cv_x_app_defaults="$ac_x_app_defaults"
3358       fi
3359 fi
3360
3361 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
3362     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
3363 case "$host" in
3364     *-hpux*)
3365
3366       # The following arcana was gleaned from conversations with
3367       # Eric Schwartz <erics@col.hp.com>:
3368       #
3369       # On HPUX 10.x, the parts of X that HP considers "standard" live in
3370       # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
3371       # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
3372       # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
3373       # Also, there are symlinks from /usr/include/ and /usr/lib/ into
3374       # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
3375       # you don't need any -I or -L arguments.
3376       #
3377       # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
3378       # are the same division as 10.x.  However, there are no symlinks to
3379       # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
3380       # arguments are always necessary.
3381       #
3382       # However, X11R6 was available on HPUX 9.x as a patch: if that
3383       # patch was installed, then all of X11R6 went in to
3384       # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
3385       #
3386       # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
3387       # whether R5 was available as a patch; R6 undoubtedly was not.)
3388       #
3389       # So.  We try and use the highest numbered pair of
3390       # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
3391       # that are available.  We do not mix and match different versions
3392       # of X.
3393       #
3394       # Question I still don't know the answer to: (do you?)
3395       #
3396       #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
3397       #     /usr/contrib/X11R6/ could be installed as a patch, what was in
3398       #     that contrib directory?  Did it contain so-called "standard"
3399       #     X11R6, or did it include Xaw and Xmu as well?  If the former,
3400       #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
3401       #     be a situation where one had to reach into the R5 headers and
3402       #     libs to find Xmu?  That is, must both R6 and R5 directories
3403       #     be on the -I and -L lists in that case?
3404       #
3405       for version in X11R6 X11R5 X11R4 ; do
3406         # if either pair of directories exists...
3407         if test -d /usr/include/$version || test -d /usr/contrib/$version/include
3408         then
3409            # if contrib exists, use it...
3410            if test -d /usr/contrib/$version/include ; then
3411              X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
3412              X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
3413            fi
3414            # if the "standard" one exists, use it.
3415            if test -d /usr/include/$version ; then
3416              X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
3417              X_LIBS="$X_LIBS -L/usr/lib/$version"
3418            fi
3419            # since at least one of the pair exists, go no farther.
3420            break
3421         fi
3422       done
3423
3424       # Now find Motif.  Thanks for not making xmkmf find this by
3425       # default, you losers.
3426       #
3427       if test -d /usr/include/Motif2.1 ; then
3428         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
3429         X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
3430       elif test -d /usr/include/Motif1.2 ; then
3431         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
3432         X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
3433       elif test -d /usr/include/Motif1.1 ; then
3434         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
3435         X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
3436       fi
3437
3438       # Now let's check for the pseudo-standard locations for OpenGL and XPM.
3439       #
3440       if test -d /opt/graphics/OpenGL/include ; then
3441         # HP-UX 10.20 puts it here
3442         X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
3443         X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
3444       elif test -d /opt/Mesa/lib ; then
3445         X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
3446         X_LIBS="-L/opt/Mesa/lib $X_LIBS"
3447       fi
3448
3449
3450       if test -d /opt/xpm/lib/X11 ; then
3451         X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
3452         X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
3453       fi
3454
3455       # On HPUX, default to installing in /opt/xscreensaver/ instead of
3456       # in /usr/local/, unless there is already an xscreensaver in
3457       # /usr/local/bin/.  This can be overridden with the --prefix arg
3458       # to configure.  I'm not sure this is the right thing to do, but
3459       # Richard Lloyd says so...
3460       #
3461       if test \! -x /usr/local/bin/xscreensaver ; then
3462         ac_default_prefix=/opt/xscreensaver
3463       fi
3464
3465     ;;
3466     *-solaris*)
3467
3468       # Thanks for not making xmkmf find this by default, pinheads.
3469       # And thanks for moving things around again, too.  Is this
3470       # really the standard location now?  What happened to the
3471       # joke that this kind of thing went in /opt?
3472       # cthomp says "answer: CDE (Common Disorganized Environment)"
3473       #
3474       if test -f /usr/dt/include/Xm/Xm.h ; then
3475         X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
3476         X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
3477
3478         # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
3479         echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
3480 echo "configure:3492: checking for regcmp in -lgen" >&5
3481 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
3482 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3483   echo $ac_n "(cached) $ac_c" 1>&6
3484 else
3485   ac_save_LIBS="$LIBS"
3486 LIBS="-lgen  $LIBS"
3487 cat > conftest.$ac_ext <<EOF
3488 #line 3500 "configure"
3489 #include "confdefs.h"
3490 /* Override any gcc2 internal prototype to avoid an error.  */
3491 /* We use char because int might match the return type of a gcc2
3492     builtin and then its argument prototype would still apply.  */
3493 char regcmp();
3494
3495 int main() {
3496 regcmp()
3497 ; return 0; }
3498 EOF
3499 if { (eval echo configure:3511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3500   rm -rf conftest*
3501   eval "ac_cv_lib_$ac_lib_var=yes"
3502 else
3503   echo "configure: failed program was:" >&5
3504   cat conftest.$ac_ext >&5
3505   rm -rf conftest*
3506   eval "ac_cv_lib_$ac_lib_var=no"
3507 fi
3508 rm -f conftest*
3509 LIBS="$ac_save_LIBS"
3510
3511 fi
3512 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3513   echo "$ac_t""yes" 1>&6
3514   X_LIBS="$X_LIBS -lgen"
3515 else
3516   echo "$ac_t""no" 1>&6
3517 fi
3518
3519       fi
3520     ;;
3521   esac
3522 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
3523 echo "configure:3535: checking for XPointer" >&5
3524 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
3525   echo $ac_n "(cached) $ac_c" 1>&6
3526 else
3527   
3528   ac_save_CPPFLAGS="$CPPFLAGS"
3529   if test \! -z "$includedir" ; then 
3530     CPPFLAGS="$CPPFLAGS -I$includedir"
3531   fi
3532   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3533   cat > conftest.$ac_ext <<EOF
3534 #line 3546 "configure"
3535 #include "confdefs.h"
3536 #include <X11/Xlib.h>
3537 int main() {
3538 XPointer foo = (XPointer) 0;
3539 ; return 0; }
3540 EOF
3541 if { (eval echo configure:3553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3542   rm -rf conftest*
3543   ac_cv_xpointer=yes
3544 else
3545   echo "configure: failed program was:" >&5
3546   cat conftest.$ac_ext >&5
3547   rm -rf conftest*
3548   ac_cv_xpointer=no
3549 fi
3550 rm -f conftest*
3551   CPPFLAGS="$ac_save_CPPFLAGS"
3552 fi
3553
3554 echo "$ac_t""$ac_cv_xpointer" 1>&6
3555   if test "$ac_cv_xpointer" != yes; then
3556    cat >> confdefs.h <<\EOF
3557 #define XPointer char*
3558 EOF
3559
3560   fi
3561
3562
3563
3564 ###############################################################################
3565 #
3566 #       Check for -lXmu (some fucked up vendors don't ship it...)
3567 #
3568 ###############################################################################
3569
3570 have_xmu=no
3571
3572   ac_save_CPPFLAGS="$CPPFLAGS"
3573   if test \! -z "$includedir" ; then 
3574     CPPFLAGS="$CPPFLAGS -I$includedir"
3575   fi
3576   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3577   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
3578 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
3579 echo "configure:3591: checking for X11/Xmu/Error.h" >&5
3580 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3581   echo $ac_n "(cached) $ac_c" 1>&6
3582 else
3583   cat > conftest.$ac_ext <<EOF
3584 #line 3596 "configure"
3585 #include "confdefs.h"
3586 #include <X11/Xmu/Error.h>
3587 EOF
3588 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3589 { (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3590 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3591 if test -z "$ac_err"; then
3592   rm -rf conftest*
3593   eval "ac_cv_header_$ac_safe=yes"
3594 else
3595   echo "$ac_err" >&5
3596   echo "configure: failed program was:" >&5
3597   cat conftest.$ac_ext >&5
3598   rm -rf conftest*
3599   eval "ac_cv_header_$ac_safe=no"
3600 fi
3601 rm -f conftest*
3602 fi
3603 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3604   echo "$ac_t""yes" 1>&6
3605   have_xmu=yes
3606 else
3607   echo "$ac_t""no" 1>&6
3608 fi
3609
3610   CPPFLAGS="$ac_save_CPPFLAGS"
3611 if test "$have_xmu" = no ; then
3612   XMU_SRCS='$(UTILS_SRC)/xmu.c'
3613   XMU_OBJS='$(UTILS_BIN)/xmu.o'
3614   XMU_LIBS=''
3615 else
3616   XMU_SRCS=''
3617   XMU_OBJS=''
3618   XMU_LIBS='-lXmu'
3619   cat >> confdefs.h <<\EOF
3620 #define HAVE_XMU 1
3621 EOF
3622
3623 fi
3624
3625
3626 ###############################################################################
3627 #
3628 #       Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
3629 #       See comp.windows.x FAQ question 124.  The right fix is to
3630 #       get OpenWindows 3.0 patches 100512-02 and 100573-03.
3631 #
3632 ###############################################################################
3633
3634 if test "$have_xmu" = yes ; then
3635   case "$host" in
3636     *-sunos4*)
3637     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
3638 echo "configure:3650: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
3639 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
3640   echo $ac_n "(cached) $ac_c" 1>&6
3641 else
3642   ac_save_LDFLAGS="$LDFLAGS"
3643                     if test \! -z "$x_libraries" ; then
3644                       LDFLAGS="$LDFLAGS -L$x_libraries"
3645                     fi
3646                     # Note: this trick never works!  (Generally.)
3647                     # We're only getting away with using AC_TRY_LINK
3648                     # with X libraries because we know it's SunOS.
3649                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
3650                     cat > conftest.$ac_ext <<EOF
3651 #line 3663 "configure"
3652 #include "confdefs.h"
3653
3654 int main() {
3655
3656 ; return 0; }
3657 EOF
3658 if { (eval echo configure:3670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3659   rm -rf conftest*
3660   ac_cv_sunos_xmu_bug=no
3661 else
3662   echo "configure: failed program was:" >&5
3663   cat conftest.$ac_ext >&5
3664   rm -rf conftest*
3665   ac_cv_sunos_xmu_bug=yes
3666 fi
3667 rm -f conftest*
3668                     LDFLAGS="$ac_save_LDFLAGS"
3669 fi
3670
3671 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3672     if test "$ac_cv_sunos_xmu_bug" = yes ; then
3673       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3674 echo "configure:3686: checking whether the compiler understands -static" >&5
3675 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3676   echo $ac_n "(cached) $ac_c" 1>&6
3677 else
3678   ac_save_LDFLAGS="$LDFLAGS"
3679                       LDFLAGS="$LDFLAGS -static"
3680                       cat > conftest.$ac_ext <<EOF
3681 #line 3693 "configure"
3682 #include "confdefs.h"
3683
3684 int main() {
3685
3686 ; return 0; }
3687 EOF
3688 if { (eval echo configure:3700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3689   rm -rf conftest*
3690   ac_cv_ld_static=yes
3691 else
3692   echo "configure: failed program was:" >&5
3693   cat conftest.$ac_ext >&5
3694   rm -rf conftest*
3695   ac_cv_ld_static=no
3696 fi
3697 rm -f conftest*
3698                     LDFLAGS="$ac_save_LDFLAGS"
3699 fi
3700
3701 echo "$ac_t""$ac_cv_ld_static" 1>&6
3702       if test "$ac_cv_ld_static" = yes ; then
3703         LDFLAGS="$LDFLAGS -static"
3704       else
3705         LDFLAGS="$LDFLAGS -Bstatic"
3706       fi
3707     fi
3708     ;;
3709   esac
3710 fi
3711
3712
3713 ###############################################################################
3714 #
3715 #       Handle the --with-hackdir option
3716 #
3717 ###############################################################################
3718
3719 have_hackdir=yes
3720 with_hackdir_req=unspecified
3721 # Check whether --with-hackdir or --without-hackdir was given.
3722 if test "${with_hackdir+set}" = set; then
3723   withval="$with_hackdir"
3724   with_hackdir="$withval"; with_hackdir_req="$withval"
3725 else
3726   with_hackdir=yes
3727 fi
3728
3729
3730 if test x"$with_hackdir" = xyes; then
3731   HACKDIR='${exec_prefix}/lib/xscreensaver'
3732 elif test x"$with_hackdir" = xno; then
3733   HACKDIR='${bindir}'
3734 else
3735   # there must be a better way than this...
3736   if test -z "`echo $with_hackdir | sed 's@^/.*@@'`" ; then
3737     # absolute path
3738     HACKDIR=$with_hackdir
3739   else
3740     # relative path
3741     HACKDIR="\${exec_prefix}$with_hackdir"
3742   fi
3743 fi
3744
3745 # canonicalize slashes.
3746 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
3747
3748 # This option used to be called --enable-subdir; make sure that is no longer
3749 # used, since configure brain-damagedly ignores unknown --enable options.
3750
3751 obsolete_enable=
3752 # Check whether --enable-subdir or --disable-subdir was given.
3753 if test "${enable_subdir+set}" = set; then
3754   enableval="$enable_subdir"
3755   obsolete_enable=yes
3756 fi
3757
3758 if test -n "$obsolete_enable"; then
3759   echo "error: the --enable-subdir option has been replaced with"
3760   echo "       the new --with-hackdir option; see \`configure --help'"
3761   echo "       for more information."
3762   exit 1
3763 fi
3764
3765
3766 ###############################################################################
3767 #
3768 #       Handle the --with-configdir option
3769 #
3770 ###############################################################################
3771
3772 have_configdir=yes
3773 with_configdir_req=unspecified
3774 # Check whether --with-configdir or --without-configdir was given.
3775 if test "${with_configdir+set}" = set; then
3776   withval="$with_configdir"
3777   with_configdir="$withval"; with_configdir_req="$withval"
3778 else
3779   with_configdir=yes
3780 fi
3781
3782
3783 if test x"$with_configdir" = xyes; then
3784   # filled in later...
3785   HACK_CONF_DIR=''
3786 elif test x"$with_configdir" = xno; then
3787   echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
3788   exit 1
3789 else
3790   # there must be a better way than this...
3791   if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
3792     # absolute path
3793     CONFIGDIR=$with_configdir
3794   else
3795     # relative path
3796     CONFIGDIR="\${exec_prefix}$with_configdir"
3797   fi
3798 fi
3799
3800 # canonicalize slashes.
3801 CONFIGDIR=`echo "${CONFIGDIR}" | sed 's@/$@@;s@//*@/@g'`
3802
3803
3804
3805
3806 ###############################################################################
3807 #
3808 #       Check for the SGI SCREEN_SAVER server extension.
3809 #
3810 ###############################################################################
3811
3812 have_sgi=no
3813 with_sgi_req=unspecified
3814 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3815 if test "${with_sgi_ext+set}" = set; then
3816   withval="$with_sgi_ext"
3817   with_sgi="$withval"; with_sgi_req="$withval"
3818 else
3819   with_sgi=yes
3820 fi
3821
3822
3823
3824    case "$with_sgi" in
3825     yes) ;;
3826     no)  ;;
3827
3828     /*)
3829      echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
3830 echo "configure:3842: checking for SGI SCREEN_SAVER headers" >&5
3831      d=$with_sgi/include
3832      if test -d $d; then
3833        X_CFLAGS="-I$d $X_CFLAGS"
3834        echo "$ac_t""$d" 1>&6
3835      else
3836        echo "$ac_t""not found ($d: no such directory)" 1>&6
3837      fi
3838
3839      echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
3840 echo "configure:3852: checking for SGI SCREEN_SAVER libs" >&5
3841      d=$with_sgi/lib
3842      if test -d $d; then
3843        X_LIBS="-L$d $X_LIBS"
3844        echo "$ac_t""$d" 1>&6
3845      else
3846        echo "$ac_t""not found ($d: no such directory)" 1>&6
3847      fi
3848
3849      # replace the directory string with "yes".
3850      with_sgi_req="yes"
3851      with_sgi=$with_sgi_req
3852      ;;
3853
3854     *)
3855      echo ""
3856      echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
3857      echo "       If it is a directory, then \`DIR/include' will be added to"
3858      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3859      exit 1
3860      ;;
3861    esac
3862   
3863
3864 if test "$with_sgi" = yes; then
3865   
3866   ac_save_CPPFLAGS="$CPPFLAGS"
3867   if test \! -z "$includedir" ; then 
3868     CPPFLAGS="$CPPFLAGS -I$includedir"
3869   fi
3870   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3871   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3872 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3873 echo "configure:3885: checking for X11/extensions/XScreenSaver.h" >&5
3874 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3875   echo $ac_n "(cached) $ac_c" 1>&6
3876 else
3877   cat > conftest.$ac_ext <<EOF
3878 #line 3890 "configure"
3879 #include "confdefs.h"
3880 #include <X11/extensions/XScreenSaver.h>
3881 EOF
3882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3883 { (eval echo configure:3895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3884 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3885 if test -z "$ac_err"; then
3886   rm -rf conftest*
3887   eval "ac_cv_header_$ac_safe=yes"
3888 else
3889   echo "$ac_err" >&5
3890   echo "configure: failed program was:" >&5
3891   cat conftest.$ac_ext >&5
3892   rm -rf conftest*
3893   eval "ac_cv_header_$ac_safe=no"
3894 fi
3895 rm -f conftest*
3896 fi
3897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3898   echo "$ac_t""yes" 1>&6
3899   have_sgi=yes
3900                      cat >> confdefs.h <<\EOF
3901 #define HAVE_SGI_SAVER_EXTENSION 1
3902 EOF
3903
3904 else
3905   echo "$ac_t""no" 1>&6
3906 fi
3907
3908   CPPFLAGS="$ac_save_CPPFLAGS"
3909
3910 elif test "$with_sgi" != no; then
3911   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3912   exit 1
3913 fi
3914
3915
3916 ###############################################################################
3917 #
3918 #       Check for the MIT-SCREEN-SAVER server extension.
3919 #
3920 ###############################################################################
3921
3922 have_mit=no
3923 with_mit_req=unspecified
3924 # Check whether --with-mit-ext or --without-mit-ext was given.
3925 if test "${with_mit_ext+set}" = set; then
3926   withval="$with_mit_ext"
3927   with_mit="$withval"; with_mit_req="$withval"
3928 else
3929   with_mit=yes
3930 fi
3931
3932
3933
3934    case "$with_mit" in
3935     yes) ;;
3936     no)  ;;
3937
3938     /*)
3939      echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
3940 echo "configure:3952: checking for MIT-SCREEN-SAVER headers" >&5
3941      d=$with_mit/include
3942      if test -d $d; then
3943        X_CFLAGS="-I$d $X_CFLAGS"
3944        echo "$ac_t""$d" 1>&6
3945      else
3946        echo "$ac_t""not found ($d: no such directory)" 1>&6
3947      fi
3948
3949      echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
3950 echo "configure:3962: checking for MIT-SCREEN-SAVER libs" >&5
3951      d=$with_mit/lib
3952      if test -d $d; then
3953        X_LIBS="-L$d $X_LIBS"
3954        echo "$ac_t""$d" 1>&6
3955      else
3956        echo "$ac_t""not found ($d: no such directory)" 1>&6
3957      fi
3958
3959      # replace the directory string with "yes".
3960      with_mit_req="yes"
3961      with_mit=$with_mit_req
3962      ;;
3963
3964     *)
3965      echo ""
3966      echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory."
3967      echo "       If it is a directory, then \`DIR/include' will be added to"
3968      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3969      exit 1
3970      ;;
3971    esac
3972   
3973
3974 if test "$with_mit" = yes; then
3975   
3976   ac_save_CPPFLAGS="$CPPFLAGS"
3977   if test \! -z "$includedir" ; then 
3978     CPPFLAGS="$CPPFLAGS -I$includedir"
3979   fi
3980   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3981   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3982 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3983 echo "configure:3995: checking for X11/extensions/scrnsaver.h" >&5
3984 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3985   echo $ac_n "(cached) $ac_c" 1>&6
3986 else
3987   cat > conftest.$ac_ext <<EOF
3988 #line 4000 "configure"
3989 #include "confdefs.h"
3990 #include <X11/extensions/scrnsaver.h>
3991 EOF
3992 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3993 { (eval echo configure:4005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3994 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3995 if test -z "$ac_err"; then
3996   rm -rf conftest*
3997   eval "ac_cv_header_$ac_safe=yes"
3998 else
3999   echo "$ac_err" >&5
4000   echo "configure: failed program was:" >&5
4001   cat conftest.$ac_ext >&5
4002   rm -rf conftest*
4003   eval "ac_cv_header_$ac_safe=no"
4004 fi
4005 rm -f conftest*
4006 fi
4007 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4008   echo "$ac_t""yes" 1>&6
4009   have_mit=yes
4010 else
4011   echo "$ac_t""no" 1>&6
4012 fi
4013
4014   CPPFLAGS="$ac_save_CPPFLAGS"
4015
4016   # Now check to see if it's really in the library; XF86Free-3.3 ships
4017   # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
4018   #
4019   if test "$have_mit" = yes; then
4020     
4021   ac_save_CPPFLAGS="$CPPFLAGS"
4022   ac_save_LDFLAGS="$LDFLAGS"
4023 #  ac_save_LIBS="$LIBS"
4024
4025   if test \! -z "$includedir" ; then 
4026     CPPFLAGS="$CPPFLAGS -I$includedir"
4027   fi
4028   # note: $X_CFLAGS includes $x_includes
4029   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4030
4031   if test \! -z "$libdir" ; then
4032     LDFLAGS="$LDFLAGS -L$libdir"
4033   fi
4034   # note: $X_LIBS includes $x_libraries
4035   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4036
4037   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
4038 echo "configure:4050: checking for XScreenSaverRegister in -lXext" >&5
4039 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4040 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4041   echo $ac_n "(cached) $ac_c" 1>&6
4042 else
4043   ac_save_LIBS="$LIBS"
4044 LIBS="-lXext -lm $LIBS"
4045 cat > conftest.$ac_ext <<EOF
4046 #line 4058 "configure"
4047 #include "confdefs.h"
4048 /* Override any gcc2 internal prototype to avoid an error.  */
4049 /* We use char because int might match the return type of a gcc2
4050     builtin and then its argument prototype would still apply.  */
4051 char XScreenSaverRegister();
4052
4053 int main() {
4054 XScreenSaverRegister()
4055 ; return 0; }
4056 EOF
4057 if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4058   rm -rf conftest*
4059   eval "ac_cv_lib_$ac_lib_var=yes"
4060 else
4061   echo "configure: failed program was:" >&5
4062   cat conftest.$ac_ext >&5
4063   rm -rf conftest*
4064   eval "ac_cv_lib_$ac_lib_var=no"
4065 fi
4066 rm -f conftest*
4067 LIBS="$ac_save_LIBS"
4068
4069 fi
4070 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4071   echo "$ac_t""yes" 1>&6
4072   true
4073 else
4074   echo "$ac_t""no" 1>&6
4075 have_mit=no
4076 fi
4077
4078   CPPFLAGS="$ac_save_CPPFLAGS"
4079   LDFLAGS="$ac_save_LDFLAGS"
4080 #  LIBS="$ac_save_LIBS"
4081   
4082
4083     if test "$have_mit" = no; then
4084       # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
4085       # of in Xext.  Thank you master, may I have another.
4086       
4087   ac_save_CPPFLAGS="$CPPFLAGS"
4088   ac_save_LDFLAGS="$LDFLAGS"
4089 #  ac_save_LIBS="$LIBS"
4090
4091   if test \! -z "$includedir" ; then 
4092     CPPFLAGS="$CPPFLAGS -I$includedir"
4093   fi
4094   # note: $X_CFLAGS includes $x_includes
4095   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4096
4097   if test \! -z "$libdir" ; then
4098     LDFLAGS="$LDFLAGS -L$libdir"
4099   fi
4100   # note: $X_LIBS includes $x_libraries
4101   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4102
4103   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
4104 echo "configure:4116: checking for XScreenSaverRegister in -lXExExt" >&5
4105 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4106 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4107   echo $ac_n "(cached) $ac_c" 1>&6
4108 else
4109   ac_save_LIBS="$LIBS"
4110 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
4111 cat > conftest.$ac_ext <<EOF
4112 #line 4124 "configure"
4113 #include "confdefs.h"
4114 /* Override any gcc2 internal prototype to avoid an error.  */
4115 /* We use char because int might match the return type of a gcc2
4116     builtin and then its argument prototype would still apply.  */
4117 char XScreenSaverRegister();
4118
4119 int main() {
4120 XScreenSaverRegister()
4121 ; return 0; }
4122 EOF
4123 if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4124   rm -rf conftest*
4125   eval "ac_cv_lib_$ac_lib_var=yes"
4126 else
4127   echo "configure: failed program was:" >&5
4128   cat conftest.$ac_ext >&5
4129   rm -rf conftest*
4130   eval "ac_cv_lib_$ac_lib_var=no"
4131 fi
4132 rm -f conftest*
4133 LIBS="$ac_save_LIBS"
4134
4135 fi
4136 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4137   echo "$ac_t""yes" 1>&6
4138   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
4139 else
4140   echo "$ac_t""no" 1>&6
4141 true
4142 fi
4143
4144   CPPFLAGS="$ac_save_CPPFLAGS"
4145   LDFLAGS="$ac_save_LDFLAGS"
4146 #  LIBS="$ac_save_LIBS"
4147   
4148     fi
4149
4150     if test "$have_mit" = no; then
4151       # Double fuck!  Looks like some versions of XFree86 (whichever version
4152       # it is that comes with RedHat Linux 2.0 -- I can't find a version 
4153       # number) put this garbage in Xss instead of Xext.  Thank you master,
4154       #  may I have another.
4155       
4156   ac_save_CPPFLAGS="$CPPFLAGS"
4157   ac_save_LDFLAGS="$LDFLAGS"
4158 #  ac_save_LIBS="$LIBS"
4159
4160   if test \! -z "$includedir" ; then 
4161     CPPFLAGS="$CPPFLAGS -I$includedir"
4162   fi
4163   # note: $X_CFLAGS includes $x_includes
4164   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4165
4166   if test \! -z "$libdir" ; then
4167     LDFLAGS="$LDFLAGS -L$libdir"
4168   fi
4169   # note: $X_LIBS includes $x_libraries
4170   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4171
4172   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
4173 echo "configure:4185: checking for XScreenSaverRegister in -lXss" >&5
4174 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4175 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4176   echo $ac_n "(cached) $ac_c" 1>&6
4177 else
4178   ac_save_LIBS="$LIBS"
4179 LIBS="-lXss -lX11 -lXext -lm $LIBS"
4180 cat > conftest.$ac_ext <<EOF
4181 #line 4193 "configure"
4182 #include "confdefs.h"
4183 /* Override any gcc2 internal prototype to avoid an error.  */
4184 /* We use char because int might match the return type of a gcc2
4185     builtin and then its argument prototype would still apply.  */
4186 char XScreenSaverRegister();
4187
4188 int main() {
4189 XScreenSaverRegister()
4190 ; return 0; }
4191 EOF
4192 if { (eval echo configure:4204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4193   rm -rf conftest*
4194   eval "ac_cv_lib_$ac_lib_var=yes"
4195 else
4196   echo "configure: failed program was:" >&5
4197   cat conftest.$ac_ext >&5
4198   rm -rf conftest*
4199   eval "ac_cv_lib_$ac_lib_var=no"
4200 fi
4201 rm -f conftest*
4202 LIBS="$ac_save_LIBS"
4203
4204 fi
4205 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4206   echo "$ac_t""yes" 1>&6
4207   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
4208 else
4209   echo "$ac_t""no" 1>&6
4210 true
4211 fi
4212
4213   CPPFLAGS="$ac_save_CPPFLAGS"
4214   LDFLAGS="$ac_save_LDFLAGS"
4215 #  LIBS="$ac_save_LIBS"
4216   
4217     fi
4218
4219   if test "$have_mit" = yes; then
4220     cat >> confdefs.h <<\EOF
4221 #define HAVE_MIT_SAVER_EXTENSION 1
4222 EOF
4223
4224   fi
4225
4226   fi
4227
4228 elif test "$with_mit" != no; then
4229   echo "error: must be yes or no: --with-mit-ext=$with_mit"
4230   exit 1
4231 fi
4232
4233
4234 ###############################################################################
4235 #
4236 #       Check for the XIDLE server extension.
4237 #
4238 ###############################################################################
4239
4240 have_xidle=no
4241 with_xidle_req=unspecified
4242 # Check whether --with-xidle-ext or --without-xidle-ext was given.
4243 if test "${with_xidle_ext+set}" = set; then
4244   withval="$with_xidle_ext"
4245   with_xidle="$withval"; with_xidle_req="$withval"
4246 else
4247   with_xidle=yes
4248 fi
4249
4250
4251
4252    case "$with_xidle" in
4253     yes) ;;
4254     no)  ;;
4255
4256     /*)
4257      echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
4258 echo "configure:4270: checking for XIDLE headers" >&5
4259      d=$with_xidle/include
4260      if test -d $d; then
4261        X_CFLAGS="-I$d $X_CFLAGS"
4262        echo "$ac_t""$d" 1>&6
4263      else
4264        echo "$ac_t""not found ($d: no such directory)" 1>&6
4265      fi
4266
4267      echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
4268 echo "configure:4280: checking for XIDLE libs" >&5
4269      d=$with_xidle/lib
4270      if test -d $d; then
4271        X_LIBS="-L$d $X_LIBS"
4272        echo "$ac_t""$d" 1>&6
4273      else
4274        echo "$ac_t""not found ($d: no such directory)" 1>&6
4275      fi
4276
4277      # replace the directory string with "yes".
4278      with_xidle_req="yes"
4279      with_xidle=$with_xidle_req
4280      ;;
4281
4282     *)
4283      echo ""
4284      echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
4285      echo "       If it is a directory, then \`DIR/include' will be added to"
4286      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4287      exit 1
4288      ;;
4289    esac
4290   
4291
4292 if test "$with_xidle" = yes; then
4293   
4294   ac_save_CPPFLAGS="$CPPFLAGS"
4295   if test \! -z "$includedir" ; then 
4296     CPPFLAGS="$CPPFLAGS -I$includedir"
4297   fi
4298   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4299   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
4300 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
4301 echo "configure:4313: checking for X11/extensions/xidle.h" >&5
4302 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4303   echo $ac_n "(cached) $ac_c" 1>&6
4304 else
4305   cat > conftest.$ac_ext <<EOF
4306 #line 4318 "configure"
4307 #include "confdefs.h"
4308 #include <X11/extensions/xidle.h>
4309 EOF
4310 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4311 { (eval echo configure:4323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4312 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4313 if test -z "$ac_err"; then
4314   rm -rf conftest*
4315   eval "ac_cv_header_$ac_safe=yes"
4316 else
4317   echo "$ac_err" >&5
4318   echo "configure: failed program was:" >&5
4319   cat conftest.$ac_ext >&5
4320   rm -rf conftest*
4321   eval "ac_cv_header_$ac_safe=no"
4322 fi
4323 rm -f conftest*
4324 fi
4325 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4326   echo "$ac_t""yes" 1>&6
4327   have_xidle=yes
4328                      cat >> confdefs.h <<\EOF
4329 #define HAVE_XIDLE_EXTENSION 1
4330 EOF
4331
4332 else
4333   echo "$ac_t""no" 1>&6
4334 fi
4335
4336   CPPFLAGS="$ac_save_CPPFLAGS"
4337 elif test "$with_xidle" != no; then
4338   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
4339   exit 1
4340 fi
4341
4342
4343 ###############################################################################
4344 #
4345 #       Check for the SGI-VIDEO-CONTROL server extension.
4346 #
4347 ###############################################################################
4348
4349 have_sgivc=no
4350 with_sgivc_req=unspecified
4351 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
4352 if test "${with_sgivc_ext+set}" = set; then
4353   withval="$with_sgivc_ext"
4354   with_sgivc="$withval"; with_sgivc_req="$withval"
4355 else
4356   with_sgivc=yes
4357 fi
4358
4359
4360
4361    case "$with_sgivc" in
4362     yes) ;;
4363     no)  ;;
4364
4365     /*)
4366      echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
4367 echo "configure:4379: checking for SGI-VIDEO-CONTROL headers" >&5
4368      d=$with_sgivc/include
4369      if test -d $d; then
4370        X_CFLAGS="-I$d $X_CFLAGS"
4371        echo "$ac_t""$d" 1>&6
4372      else
4373        echo "$ac_t""not found ($d: no such directory)" 1>&6
4374      fi
4375
4376      echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
4377 echo "configure:4389: checking for SGI-VIDEO-CONTROL libs" >&5
4378      d=$with_sgivc/lib
4379      if test -d $d; then
4380        X_LIBS="-L$d $X_LIBS"
4381        echo "$ac_t""$d" 1>&6
4382      else
4383        echo "$ac_t""not found ($d: no such directory)" 1>&6
4384      fi
4385
4386      # replace the directory string with "yes".
4387      with_sgivc_req="yes"
4388      with_sgivc=$with_sgivc_req
4389      ;;
4390
4391     *)
4392      echo ""
4393      echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
4394      echo "       If it is a directory, then \`DIR/include' will be added to"
4395      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4396      exit 1
4397      ;;
4398    esac
4399   
4400
4401 if test "$with_sgivc" = yes; then
4402
4403   # first check for XSGIvc.h
4404   
4405   ac_save_CPPFLAGS="$CPPFLAGS"
4406   if test \! -z "$includedir" ; then 
4407     CPPFLAGS="$CPPFLAGS -I$includedir"
4408   fi
4409   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4410   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
4411 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
4412 echo "configure:4424: checking for X11/extensions/XSGIvc.h" >&5
4413 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4414   echo $ac_n "(cached) $ac_c" 1>&6
4415 else
4416   cat > conftest.$ac_ext <<EOF
4417 #line 4429 "configure"
4418 #include "confdefs.h"
4419 #include <X11/extensions/XSGIvc.h>
4420 EOF
4421 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4422 { (eval echo configure:4434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4423 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4424 if test -z "$ac_err"; then
4425   rm -rf conftest*
4426   eval "ac_cv_header_$ac_safe=yes"
4427 else
4428   echo "$ac_err" >&5
4429   echo "configure: failed program was:" >&5
4430   cat conftest.$ac_ext >&5
4431   rm -rf conftest*
4432   eval "ac_cv_header_$ac_safe=no"
4433 fi
4434 rm -f conftest*
4435 fi
4436 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4437   echo "$ac_t""yes" 1>&6
4438   have_sgivc=yes
4439 else
4440   echo "$ac_t""no" 1>&6
4441 fi
4442
4443   CPPFLAGS="$ac_save_CPPFLAGS"
4444
4445   # if that succeeded, then check for the -lXsgivc
4446   if test "$have_sgivc" = yes; then
4447     have_sgivc=no
4448     
4449   ac_save_CPPFLAGS="$CPPFLAGS"
4450   ac_save_LDFLAGS="$LDFLAGS"
4451 #  ac_save_LIBS="$LIBS"
4452
4453   if test \! -z "$includedir" ; then 
4454     CPPFLAGS="$CPPFLAGS -I$includedir"
4455   fi
4456   # note: $X_CFLAGS includes $x_includes
4457   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4458
4459   if test \! -z "$libdir" ; then
4460     LDFLAGS="$LDFLAGS -L$libdir"
4461   fi
4462   # note: $X_LIBS includes $x_libraries
4463   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4464
4465   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
4466 echo "configure:4478: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
4467 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
4468 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4469   echo $ac_n "(cached) $ac_c" 1>&6
4470 else
4471   ac_save_LIBS="$LIBS"
4472 LIBS="-lXsgivc -lXext -lX11 $LIBS"
4473 cat > conftest.$ac_ext <<EOF
4474 #line 4486 "configure"
4475 #include "confdefs.h"
4476 /* Override any gcc2 internal prototype to avoid an error.  */
4477 /* We use char because int might match the return type of a gcc2
4478     builtin and then its argument prototype would still apply.  */
4479 char XSGIvcQueryGammaMap();
4480
4481 int main() {
4482 XSGIvcQueryGammaMap()
4483 ; return 0; }
4484 EOF
4485 if { (eval echo configure:4497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4486   rm -rf conftest*
4487   eval "ac_cv_lib_$ac_lib_var=yes"
4488 else
4489   echo "configure: failed program was:" >&5
4490   cat conftest.$ac_ext >&5
4491   rm -rf conftest*
4492   eval "ac_cv_lib_$ac_lib_var=no"
4493 fi
4494 rm -f conftest*
4495 LIBS="$ac_save_LIBS"
4496
4497 fi
4498 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4499   echo "$ac_t""yes" 1>&6
4500   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
4501 else
4502   echo "$ac_t""no" 1>&6
4503 true
4504 fi
4505
4506   CPPFLAGS="$ac_save_CPPFLAGS"
4507   LDFLAGS="$ac_save_LDFLAGS"
4508 #  LIBS="$ac_save_LIBS"
4509   
4510   fi
4511
4512   # if that succeeded, then we've really got it.
4513   if test "$have_sgivc" = yes; then
4514     cat >> confdefs.h <<\EOF
4515 #define HAVE_SGI_VC_EXTENSION 1
4516 EOF
4517
4518   fi
4519
4520 elif test "$with_sgivc" != no; then
4521   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
4522   exit 1
4523 fi
4524
4525
4526 ###############################################################################
4527 #
4528 #       Check for the DPMS server extension.
4529 #
4530 ###############################################################################
4531
4532 have_dpms=no
4533 with_dpms_req=unspecified
4534 # Check whether --with-dpms-ext or --without-dpms-ext was given.
4535 if test "${with_dpms_ext+set}" = set; then
4536   withval="$with_dpms_ext"
4537   with_dpms="$withval"; with_dpms_req="$withval"
4538 else
4539   with_dpms=yes
4540 fi
4541
4542
4543
4544    case "$with_dpms" in
4545     yes) ;;
4546     no)  ;;
4547
4548     /*)
4549      echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
4550 echo "configure:4562: checking for DPMS headers" >&5
4551      d=$with_dpms/include
4552      if test -d $d; then
4553        X_CFLAGS="-I$d $X_CFLAGS"
4554        echo "$ac_t""$d" 1>&6
4555      else
4556        echo "$ac_t""not found ($d: no such directory)" 1>&6
4557      fi
4558
4559      echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
4560 echo "configure:4572: checking for DPMS libs" >&5
4561      d=$with_dpms/lib
4562      if test -d $d; then
4563        X_LIBS="-L$d $X_LIBS"
4564        echo "$ac_t""$d" 1>&6
4565      else
4566        echo "$ac_t""not found ($d: no such directory)" 1>&6
4567      fi
4568
4569      # replace the directory string with "yes".
4570      with_dpms_req="yes"
4571      with_dpms=$with_dpms_req
4572      ;;
4573
4574     *)
4575      echo ""
4576      echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
4577      echo "       If it is a directory, then \`DIR/include' will be added to"
4578      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4579      exit 1
4580      ;;
4581    esac
4582   
4583
4584 if test "$with_dpms" = yes; then
4585
4586   # first check for dpms.h
4587   
4588   ac_save_CPPFLAGS="$CPPFLAGS"
4589   if test \! -z "$includedir" ; then 
4590     CPPFLAGS="$CPPFLAGS -I$includedir"
4591   fi
4592   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4593   ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
4594 echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
4595 echo "configure:4607: checking for X11/extensions/dpms.h" >&5
4596 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4597   echo $ac_n "(cached) $ac_c" 1>&6
4598 else
4599   cat > conftest.$ac_ext <<EOF
4600 #line 4612 "configure"
4601 #include "confdefs.h"
4602 #include <X11/extensions/dpms.h>
4603 EOF
4604 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4605 { (eval echo configure:4617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4606 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4607 if test -z "$ac_err"; then
4608   rm -rf conftest*
4609   eval "ac_cv_header_$ac_safe=yes"
4610 else
4611   echo "$ac_err" >&5
4612   echo "configure: failed program was:" >&5
4613   cat conftest.$ac_ext >&5
4614   rm -rf conftest*
4615   eval "ac_cv_header_$ac_safe=no"
4616 fi
4617 rm -f conftest*
4618 fi
4619 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4620   echo "$ac_t""yes" 1>&6
4621   have_dpms=yes
4622 else
4623   echo "$ac_t""no" 1>&6
4624 fi
4625
4626   CPPFLAGS="$ac_save_CPPFLAGS"
4627
4628   # if that succeeded, then check for the DPMS code in the libraries
4629   if test "$have_dpms" = yes; then
4630
4631     # first look in -lXext (this is where it is with XFree86 4.0)
4632     have_dpms=no
4633     
4634   ac_save_CPPFLAGS="$CPPFLAGS"
4635   ac_save_LDFLAGS="$LDFLAGS"
4636 #  ac_save_LIBS="$LIBS"
4637
4638   if test \! -z "$includedir" ; then 
4639     CPPFLAGS="$CPPFLAGS -I$includedir"
4640   fi
4641   # note: $X_CFLAGS includes $x_includes
4642   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4643
4644   if test \! -z "$libdir" ; then
4645     LDFLAGS="$LDFLAGS -L$libdir"
4646   fi
4647   # note: $X_LIBS includes $x_libraries
4648   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4649
4650   echo $ac_n "checking for DPMSInfo in -lXext""... $ac_c" 1>&6
4651 echo "configure:4663: checking for DPMSInfo in -lXext" >&5
4652 ac_lib_var=`echo Xext'_'DPMSInfo | sed 'y%./+-%__p_%'`
4653 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4654   echo $ac_n "(cached) $ac_c" 1>&6
4655 else
4656   ac_save_LIBS="$LIBS"
4657 LIBS="-lXext -lXext -lX11 $LIBS"
4658 cat > conftest.$ac_ext <<EOF
4659 #line 4671 "configure"
4660 #include "confdefs.h"
4661 /* Override any gcc2 internal prototype to avoid an error.  */
4662 /* We use char because int might match the return type of a gcc2
4663     builtin and then its argument prototype would still apply.  */
4664 char DPMSInfo();
4665
4666 int main() {
4667 DPMSInfo()
4668 ; return 0; }
4669 EOF
4670 if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4671   rm -rf conftest*
4672   eval "ac_cv_lib_$ac_lib_var=yes"
4673 else
4674   echo "configure: failed program was:" >&5
4675   cat conftest.$ac_ext >&5
4676   rm -rf conftest*
4677   eval "ac_cv_lib_$ac_lib_var=no"
4678 fi
4679 rm -f conftest*
4680 LIBS="$ac_save_LIBS"
4681
4682 fi
4683 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4684   echo "$ac_t""yes" 1>&6
4685   have_dpms=yes
4686 else
4687   echo "$ac_t""no" 1>&6
4688 true
4689 fi
4690
4691   CPPFLAGS="$ac_save_CPPFLAGS"
4692   LDFLAGS="$ac_save_LDFLAGS"
4693 #  LIBS="$ac_save_LIBS"
4694   
4695
4696     # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
4697     if test "$have_dpms" = no; then
4698       
4699   ac_save_CPPFLAGS="$CPPFLAGS"
4700   ac_save_LDFLAGS="$LDFLAGS"
4701 #  ac_save_LIBS="$LIBS"
4702
4703   if test \! -z "$includedir" ; then 
4704     CPPFLAGS="$CPPFLAGS -I$includedir"
4705   fi
4706   # note: $X_CFLAGS includes $x_includes
4707   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4708
4709   if test \! -z "$libdir" ; then
4710     LDFLAGS="$LDFLAGS -L$libdir"
4711   fi
4712   # note: $X_LIBS includes $x_libraries
4713   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4714
4715   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
4716 echo "configure:4728: checking for DPMSInfo in -lXdpms" >&5
4717 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
4718 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4719   echo $ac_n "(cached) $ac_c" 1>&6
4720 else
4721   ac_save_LIBS="$LIBS"
4722 LIBS="-lXdpms -lXext -lX11 $LIBS"
4723 cat > conftest.$ac_ext <<EOF
4724 #line 4736 "configure"
4725 #include "confdefs.h"
4726 /* Override any gcc2 internal prototype to avoid an error.  */
4727 /* We use char because int might match the return type of a gcc2
4728     builtin and then its argument prototype would still apply.  */
4729 char DPMSInfo();
4730
4731 int main() {
4732 DPMSInfo()
4733 ; return 0; }
4734 EOF
4735 if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4736   rm -rf conftest*
4737   eval "ac_cv_lib_$ac_lib_var=yes"
4738 else
4739   echo "configure: failed program was:" >&5
4740   cat conftest.$ac_ext >&5
4741   rm -rf conftest*
4742   eval "ac_cv_lib_$ac_lib_var=no"
4743 fi
4744 rm -f conftest*
4745 LIBS="$ac_save_LIBS"
4746
4747 fi
4748 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4749   echo "$ac_t""yes" 1>&6
4750   have_dpms=yes; XDPMS_LIBS="-lXdpms"
4751 else
4752   echo "$ac_t""no" 1>&6
4753 true
4754 fi
4755
4756   CPPFLAGS="$ac_save_CPPFLAGS"
4757   LDFLAGS="$ac_save_LDFLAGS"
4758 #  LIBS="$ac_save_LIBS"
4759   
4760     fi
4761   fi
4762
4763
4764   # if that succeeded, then we've really got it.
4765   if test "$have_dpms" = yes; then
4766     cat >> confdefs.h <<\EOF
4767 #define HAVE_DPMS_EXTENSION 1
4768 EOF
4769
4770   fi
4771
4772 elif test "$with_dpms" != no; then
4773   echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
4774   exit 1
4775 fi
4776
4777
4778 ###############################################################################
4779 #
4780 #       Check for the XINERAMA server extension.
4781 #
4782 ###############################################################################
4783
4784 have_xinerama=no
4785 with_xinerama_req=unspecified
4786 # Check whether --with-xinerama-ext or --without-xinerama-ext was given.
4787 if test "${with_xinerama_ext+set}" = set; then
4788   withval="$with_xinerama_ext"
4789   with_xinerama="$withval"; with_xinerama_req="$withval"
4790 else
4791   with_xinerama=yes
4792 fi
4793
4794
4795
4796    case "$with_xinerama" in
4797     yes) ;;
4798     no)  ;;
4799
4800     /*)
4801      echo $ac_n "checking for XINERAMA headers""... $ac_c" 1>&6
4802 echo "configure:4814: checking for XINERAMA headers" >&5
4803      d=$with_xinerama/include
4804      if test -d $d; then
4805        X_CFLAGS="-I$d $X_CFLAGS"
4806        echo "$ac_t""$d" 1>&6
4807      else
4808        echo "$ac_t""not found ($d: no such directory)" 1>&6
4809      fi
4810
4811      echo $ac_n "checking for XINERAMA libs""... $ac_c" 1>&6
4812 echo "configure:4824: checking for XINERAMA libs" >&5
4813      d=$with_xinerama/lib
4814      if test -d $d; then
4815        X_LIBS="-L$d $X_LIBS"
4816        echo "$ac_t""$d" 1>&6
4817      else
4818        echo "$ac_t""not found ($d: no such directory)" 1>&6
4819      fi
4820
4821      # replace the directory string with "yes".
4822      with_xinerama_req="yes"
4823      with_xinerama=$with_xinerama_req
4824      ;;
4825
4826     *)
4827      echo ""
4828      echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory."
4829      echo "       If it is a directory, then \`DIR/include' will be added to"
4830      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4831      exit 1
4832      ;;
4833    esac
4834   
4835
4836 if test "$with_xinerama" = yes; then
4837
4838   # first check for Xinerama.h
4839   
4840   ac_save_CPPFLAGS="$CPPFLAGS"
4841   if test \! -z "$includedir" ; then 
4842     CPPFLAGS="$CPPFLAGS -I$includedir"
4843   fi
4844   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4845   ac_safe=`echo "X11/extensions/Xinerama.h" | sed 'y%./+-%__p_%'`
4846 echo $ac_n "checking for X11/extensions/Xinerama.h""... $ac_c" 1>&6
4847 echo "configure:4859: checking for X11/extensions/Xinerama.h" >&5
4848 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4849   echo $ac_n "(cached) $ac_c" 1>&6
4850 else
4851   cat > conftest.$ac_ext <<EOF
4852 #line 4864 "configure"
4853 #include "confdefs.h"
4854 #include <X11/extensions/Xinerama.h>
4855 EOF
4856 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4857 { (eval echo configure:4869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4858 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4859 if test -z "$ac_err"; then
4860   rm -rf conftest*
4861   eval "ac_cv_header_$ac_safe=yes"
4862 else
4863   echo "$ac_err" >&5
4864   echo "configure: failed program was:" >&5
4865   cat conftest.$ac_ext >&5
4866   rm -rf conftest*
4867   eval "ac_cv_header_$ac_safe=no"
4868 fi
4869 rm -f conftest*
4870 fi
4871 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4872   echo "$ac_t""yes" 1>&6
4873   have_xinerama=yes
4874 else
4875   echo "$ac_t""no" 1>&6
4876 fi
4877
4878   CPPFLAGS="$ac_save_CPPFLAGS"
4879
4880   # if that succeeded, then check for the XINERAMA code in the libraries
4881   if test "$have_xinerama" = yes; then
4882
4883     # first look in -lXext
4884     have_xinerama=no
4885     
4886   ac_save_CPPFLAGS="$CPPFLAGS"
4887   ac_save_LDFLAGS="$LDFLAGS"
4888 #  ac_save_LIBS="$LIBS"
4889
4890   if test \! -z "$includedir" ; then 
4891     CPPFLAGS="$CPPFLAGS -I$includedir"
4892   fi
4893   # note: $X_CFLAGS includes $x_includes
4894   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4895
4896   if test \! -z "$libdir" ; then
4897     LDFLAGS="$LDFLAGS -L$libdir"
4898   fi
4899   # note: $X_LIBS includes $x_libraries
4900   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4901
4902   echo $ac_n "checking for XineramaQueryExtension in -lXext""... $ac_c" 1>&6
4903 echo "configure:4915: checking for XineramaQueryExtension in -lXext" >&5
4904 ac_lib_var=`echo Xext'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
4905 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4906   echo $ac_n "(cached) $ac_c" 1>&6
4907 else
4908   ac_save_LIBS="$LIBS"
4909 LIBS="-lXext -lXext -lX11 $LIBS"
4910 cat > conftest.$ac_ext <<EOF
4911 #line 4923 "configure"
4912 #include "confdefs.h"
4913 /* Override any gcc2 internal prototype to avoid an error.  */
4914 /* We use char because int might match the return type of a gcc2
4915     builtin and then its argument prototype would still apply.  */
4916 char XineramaQueryExtension();
4917
4918 int main() {
4919 XineramaQueryExtension()
4920 ; return 0; }
4921 EOF
4922 if { (eval echo configure:4934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4923   rm -rf conftest*
4924   eval "ac_cv_lib_$ac_lib_var=yes"
4925 else
4926   echo "configure: failed program was:" >&5
4927   cat conftest.$ac_ext >&5
4928   rm -rf conftest*
4929   eval "ac_cv_lib_$ac_lib_var=no"
4930 fi
4931 rm -f conftest*
4932 LIBS="$ac_save_LIBS"
4933
4934 fi
4935 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4936   echo "$ac_t""yes" 1>&6
4937   have_xinerama=yes
4938 else
4939   echo "$ac_t""no" 1>&6
4940 true
4941 fi
4942
4943   CPPFLAGS="$ac_save_CPPFLAGS"
4944   LDFLAGS="$ac_save_LDFLAGS"
4945 #  LIBS="$ac_save_LIBS"
4946   
4947
4948     # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
4949     if test "$have_xinerama" = no; then
4950       
4951   ac_save_CPPFLAGS="$CPPFLAGS"
4952   ac_save_LDFLAGS="$LDFLAGS"
4953 #  ac_save_LIBS="$LIBS"
4954
4955   if test \! -z "$includedir" ; then 
4956     CPPFLAGS="$CPPFLAGS -I$includedir"
4957   fi
4958   # note: $X_CFLAGS includes $x_includes
4959   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4960
4961   if test \! -z "$libdir" ; then
4962     LDFLAGS="$LDFLAGS -L$libdir"
4963   fi
4964   # note: $X_LIBS includes $x_libraries
4965   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4966
4967   echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
4968 echo "configure:4980: checking for XineramaQueryExtension in -lXinerama" >&5
4969 ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
4970 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4971   echo $ac_n "(cached) $ac_c" 1>&6
4972 else
4973   ac_save_LIBS="$LIBS"
4974 LIBS="-lXinerama -lXext -lX11 $LIBS"
4975 cat > conftest.$ac_ext <<EOF
4976 #line 4988 "configure"
4977 #include "confdefs.h"
4978 /* Override any gcc2 internal prototype to avoid an error.  */
4979 /* We use char because int might match the return type of a gcc2
4980     builtin and then its argument prototype would still apply.  */
4981 char XineramaQueryExtension();
4982
4983 int main() {
4984 XineramaQueryExtension()
4985 ; return 0; }
4986 EOF
4987 if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4988   rm -rf conftest*
4989   eval "ac_cv_lib_$ac_lib_var=yes"
4990 else
4991   echo "configure: failed program was:" >&5
4992   cat conftest.$ac_ext >&5
4993   rm -rf conftest*
4994   eval "ac_cv_lib_$ac_lib_var=no"
4995 fi
4996 rm -f conftest*
4997 LIBS="$ac_save_LIBS"
4998
4999 fi
5000 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5001   echo "$ac_t""yes" 1>&6
5002   have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"
5003 else
5004   echo "$ac_t""no" 1>&6
5005 true
5006 fi
5007
5008   CPPFLAGS="$ac_save_CPPFLAGS"
5009   LDFLAGS="$ac_save_LDFLAGS"
5010 #  LIBS="$ac_save_LIBS"
5011   
5012     fi
5013   fi
5014
5015   # if that succeeded, then we've really got it.
5016   if test "$have_xinerama" = yes; then
5017     cat >> confdefs.h <<\EOF
5018 #define HAVE_XINERAMA 1
5019 EOF
5020
5021   fi
5022
5023 elif test "$with_xinerama" != no; then
5024   echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
5025   exit 1
5026 fi
5027
5028
5029 ###############################################################################
5030 #
5031 #       Check for the XF86VMODE server extension (for virtual screens.)
5032 #
5033 ###############################################################################
5034
5035 have_xf86vmode=no
5036 with_xf86vmode_req=unspecified
5037 # Check whether --with-xf86vmode-ext or --without-xf86vmode-ext was given.
5038 if test "${with_xf86vmode_ext+set}" = set; then
5039   withval="$with_xf86vmode_ext"
5040   with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
5041 else
5042   with_xf86vmode=yes
5043 fi
5044
5045
5046
5047    case "$with_xf86vmode" in
5048     yes) ;;
5049     no)  ;;
5050
5051     /*)
5052      echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
5053 echo "configure:5065: checking for xf86vmode headers" >&5
5054      d=$with_xf86vmode/include
5055      if test -d $d; then
5056        X_CFLAGS="-I$d $X_CFLAGS"
5057        echo "$ac_t""$d" 1>&6
5058      else
5059        echo "$ac_t""not found ($d: no such directory)" 1>&6
5060      fi
5061
5062      echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
5063 echo "configure:5075: checking for xf86vmode libs" >&5
5064      d=$with_xf86vmode/lib
5065      if test -d $d; then
5066        X_LIBS="-L$d $X_LIBS"
5067        echo "$ac_t""$d" 1>&6
5068      else
5069        echo "$ac_t""not found ($d: no such directory)" 1>&6
5070      fi
5071
5072      # replace the directory string with "yes".
5073      with_xf86vmode_req="yes"
5074      with_xf86vmode=$with_xf86vmode_req
5075      ;;
5076
5077     *)
5078      echo ""
5079      echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory."
5080      echo "       If it is a directory, then \`DIR/include' will be added to"
5081      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5082      exit 1
5083      ;;
5084    esac
5085   
5086
5087 if test "$with_xf86vmode" = yes; then
5088
5089   # first check for xf86vmode.h
5090   
5091   ac_save_CPPFLAGS="$CPPFLAGS"
5092   if test \! -z "$includedir" ; then 
5093     CPPFLAGS="$CPPFLAGS -I$includedir"
5094   fi
5095   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5096   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5097 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5098 echo "configure:5110: checking for X11/extensions/xf86vmode.h" >&5
5099 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5100   echo $ac_n "(cached) $ac_c" 1>&6
5101 else
5102   cat > conftest.$ac_ext <<EOF
5103 #line 5115 "configure"
5104 #include "confdefs.h"
5105 #include <X11/extensions/xf86vmode.h>
5106 EOF
5107 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5108 { (eval echo configure:5120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5109 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5110 if test -z "$ac_err"; then
5111   rm -rf conftest*
5112   eval "ac_cv_header_$ac_safe=yes"
5113 else
5114   echo "$ac_err" >&5
5115   echo "configure: failed program was:" >&5
5116   cat conftest.$ac_ext >&5
5117   rm -rf conftest*
5118   eval "ac_cv_header_$ac_safe=no"
5119 fi
5120 rm -f conftest*
5121 fi
5122 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5123   echo "$ac_t""yes" 1>&6
5124   have_xf86vmode=yes
5125 else
5126   echo "$ac_t""no" 1>&6
5127 fi
5128
5129   CPPFLAGS="$ac_save_CPPFLAGS"
5130
5131   # if that succeeded, then check for the -lXxf86vm
5132   if test "$have_xf86vmode" = yes; then
5133     have_xf86vmode=no
5134     
5135   ac_save_CPPFLAGS="$CPPFLAGS"
5136   ac_save_LDFLAGS="$LDFLAGS"
5137 #  ac_save_LIBS="$LIBS"
5138
5139   if test \! -z "$includedir" ; then 
5140     CPPFLAGS="$CPPFLAGS -I$includedir"
5141   fi
5142   # note: $X_CFLAGS includes $x_includes
5143   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5144
5145   if test \! -z "$libdir" ; then
5146     LDFLAGS="$LDFLAGS -L$libdir"
5147   fi
5148   # note: $X_LIBS includes $x_libraries
5149   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5150
5151   echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
5152 echo "configure:5164: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
5153 ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
5154 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5155   echo $ac_n "(cached) $ac_c" 1>&6
5156 else
5157   ac_save_LIBS="$LIBS"
5158 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5159 cat > conftest.$ac_ext <<EOF
5160 #line 5172 "configure"
5161 #include "confdefs.h"
5162 /* Override any gcc2 internal prototype to avoid an error.  */
5163 /* We use char because int might match the return type of a gcc2
5164     builtin and then its argument prototype would still apply.  */
5165 char XF86VidModeGetViewPort();
5166
5167 int main() {
5168 XF86VidModeGetViewPort()
5169 ; return 0; }
5170 EOF
5171 if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5172   rm -rf conftest*
5173   eval "ac_cv_lib_$ac_lib_var=yes"
5174 else
5175   echo "configure: failed program was:" >&5
5176   cat conftest.$ac_ext >&5
5177   rm -rf conftest*
5178   eval "ac_cv_lib_$ac_lib_var=no"
5179 fi
5180 rm -f conftest*
5181 LIBS="$ac_save_LIBS"
5182
5183 fi
5184 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5185   echo "$ac_t""yes" 1>&6
5186   have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5187 else
5188   echo "$ac_t""no" 1>&6
5189 true
5190 fi
5191
5192   CPPFLAGS="$ac_save_CPPFLAGS"
5193   LDFLAGS="$ac_save_LDFLAGS"
5194 #  LIBS="$ac_save_LIBS"
5195   
5196   fi
5197
5198   # if that succeeded, then we've really got it.
5199   if test "$have_xf86vmode" = yes; then
5200     cat >> confdefs.h <<\EOF
5201 #define HAVE_XF86VMODE 1
5202 EOF
5203
5204   fi
5205
5206 elif test "$with_xf86vmode" != no; then
5207   echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
5208   exit 1
5209 fi
5210
5211
5212 ###############################################################################
5213 #
5214 #       Check for the XF86VMODE server extension (for gamma fading.)
5215 #
5216 ###############################################################################
5217
5218 have_xf86gamma=no
5219 have_xf86gamma_ramp=no
5220 with_xf86gamma_req=unspecified
5221 # Check whether --with-xf86gamma-ext or --without-xf86gamma-ext was given.
5222 if test "${with_xf86gamma_ext+set}" = set; then
5223   withval="$with_xf86gamma_ext"
5224   with_xf86gamma="$withval"; with_xf86gamma_req="$withval"
5225 else
5226   with_xf86gamma=yes
5227 fi
5228
5229
5230
5231    case "$with_xf86gamma" in
5232     yes) ;;
5233     no)  ;;
5234
5235     /*)
5236      echo $ac_n "checking for xf86gamma headers""... $ac_c" 1>&6
5237 echo "configure:5249: checking for xf86gamma headers" >&5
5238      d=$with_xf86gamma/include
5239      if test -d $d; then
5240        X_CFLAGS="-I$d $X_CFLAGS"
5241        echo "$ac_t""$d" 1>&6
5242      else
5243        echo "$ac_t""not found ($d: no such directory)" 1>&6
5244      fi
5245
5246      echo $ac_n "checking for xf86gamma libs""... $ac_c" 1>&6
5247 echo "configure:5259: checking for xf86gamma libs" >&5
5248      d=$with_xf86gamma/lib
5249      if test -d $d; then
5250        X_LIBS="-L$d $X_LIBS"
5251        echo "$ac_t""$d" 1>&6
5252      else
5253        echo "$ac_t""not found ($d: no such directory)" 1>&6
5254      fi
5255
5256      # replace the directory string with "yes".
5257      with_xf86gamma_req="yes"
5258      with_xf86gamma=$with_xf86gamma_req
5259      ;;
5260
5261     *)
5262      echo ""
5263      echo "error: argument to --with-xf86gamma-ext must be \"yes\", \"no\", or a directory."
5264      echo "       If it is a directory, then \`DIR/include' will be added to"
5265      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5266      exit 1
5267      ;;
5268    esac
5269   
5270
5271 if test "$with_xf86gamma" = yes; then
5272
5273   # first check for xf86vmode.h, if we haven't already
5274   if test "$have_xf86vmode" = yes; then
5275     have_xf86gamma=yes
5276   else
5277     
5278   ac_save_CPPFLAGS="$CPPFLAGS"
5279   if test \! -z "$includedir" ; then 
5280     CPPFLAGS="$CPPFLAGS -I$includedir"
5281   fi
5282   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5283   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5284 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5285 echo "configure:5297: checking for X11/extensions/xf86vmode.h" >&5
5286 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5287   echo $ac_n "(cached) $ac_c" 1>&6
5288 else
5289   cat > conftest.$ac_ext <<EOF
5290 #line 5302 "configure"
5291 #include "confdefs.h"
5292 #include <X11/extensions/xf86vmode.h>
5293 EOF
5294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5295 { (eval echo configure:5307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5296 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5297 if test -z "$ac_err"; then
5298   rm -rf conftest*
5299   eval "ac_cv_header_$ac_safe=yes"
5300 else
5301   echo "$ac_err" >&5
5302   echo "configure: failed program was:" >&5
5303   cat conftest.$ac_ext >&5
5304   rm -rf conftest*
5305   eval "ac_cv_header_$ac_safe=no"
5306 fi
5307 rm -f conftest*
5308 fi
5309 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5310   echo "$ac_t""yes" 1>&6
5311   have_xf86gamma=yes
5312 else
5313   echo "$ac_t""no" 1>&6
5314 fi
5315
5316   CPPFLAGS="$ac_save_CPPFLAGS"
5317   fi
5318
5319   # if that succeeded, then check for the -lXxf86vm
5320   if test "$have_xf86gamma" = yes; then
5321     have_xf86gamma=no
5322     
5323   ac_save_CPPFLAGS="$CPPFLAGS"
5324   ac_save_LDFLAGS="$LDFLAGS"
5325 #  ac_save_LIBS="$LIBS"
5326
5327   if test \! -z "$includedir" ; then 
5328     CPPFLAGS="$CPPFLAGS -I$includedir"
5329   fi
5330   # note: $X_CFLAGS includes $x_includes
5331   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5332
5333   if test \! -z "$libdir" ; then
5334     LDFLAGS="$LDFLAGS -L$libdir"
5335   fi
5336   # note: $X_LIBS includes $x_libraries
5337   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5338
5339   echo $ac_n "checking for XF86VidModeSetGamma in -lXxf86vm""... $ac_c" 1>&6
5340 echo "configure:5352: checking for XF86VidModeSetGamma in -lXxf86vm" >&5
5341 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGamma | sed 'y%./+-%__p_%'`
5342 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5343   echo $ac_n "(cached) $ac_c" 1>&6
5344 else
5345   ac_save_LIBS="$LIBS"
5346 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5347 cat > conftest.$ac_ext <<EOF
5348 #line 5360 "configure"
5349 #include "confdefs.h"
5350 /* Override any gcc2 internal prototype to avoid an error.  */
5351 /* We use char because int might match the return type of a gcc2
5352     builtin and then its argument prototype would still apply.  */
5353 char XF86VidModeSetGamma();
5354
5355 int main() {
5356 XF86VidModeSetGamma()
5357 ; return 0; }
5358 EOF
5359 if { (eval echo configure:5371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5360   rm -rf conftest*
5361   eval "ac_cv_lib_$ac_lib_var=yes"
5362 else
5363   echo "configure: failed program was:" >&5
5364   cat conftest.$ac_ext >&5
5365   rm -rf conftest*
5366   eval "ac_cv_lib_$ac_lib_var=no"
5367 fi
5368 rm -f conftest*
5369 LIBS="$ac_save_LIBS"
5370
5371 fi
5372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5373   echo "$ac_t""yes" 1>&6
5374   have_xf86gamma=yes
5375 else
5376   echo "$ac_t""no" 1>&6
5377 true
5378 fi
5379
5380   CPPFLAGS="$ac_save_CPPFLAGS"
5381   LDFLAGS="$ac_save_LDFLAGS"
5382 #  LIBS="$ac_save_LIBS"
5383   
5384   fi
5385
5386   # check for the Ramp versions of the functions too.
5387   if test "$have_xf86gamma" = yes; then
5388     have_xf86gamma_ramp=no
5389     
5390   ac_save_CPPFLAGS="$CPPFLAGS"
5391   ac_save_LDFLAGS="$LDFLAGS"
5392 #  ac_save_LIBS="$LIBS"
5393
5394   if test \! -z "$includedir" ; then 
5395     CPPFLAGS="$CPPFLAGS -I$includedir"
5396   fi
5397   # note: $X_CFLAGS includes $x_includes
5398   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5399
5400   if test \! -z "$libdir" ; then
5401     LDFLAGS="$LDFLAGS -L$libdir"
5402   fi
5403   # note: $X_LIBS includes $x_libraries
5404   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5405
5406   echo $ac_n "checking for XF86VidModeSetGammaRamp in -lXxf86vm""... $ac_c" 1>&6
5407 echo "configure:5419: checking for XF86VidModeSetGammaRamp in -lXxf86vm" >&5
5408 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGammaRamp | sed 'y%./+-%__p_%'`
5409 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5410   echo $ac_n "(cached) $ac_c" 1>&6
5411 else
5412   ac_save_LIBS="$LIBS"
5413 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5414 cat > conftest.$ac_ext <<EOF
5415 #line 5427 "configure"
5416 #include "confdefs.h"
5417 /* Override any gcc2 internal prototype to avoid an error.  */
5418 /* We use char because int might match the return type of a gcc2
5419     builtin and then its argument prototype would still apply.  */
5420 char XF86VidModeSetGammaRamp();
5421
5422 int main() {
5423 XF86VidModeSetGammaRamp()
5424 ; return 0; }
5425 EOF
5426 if { (eval echo configure:5438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5427   rm -rf conftest*
5428   eval "ac_cv_lib_$ac_lib_var=yes"
5429 else
5430   echo "configure: failed program was:" >&5
5431   cat conftest.$ac_ext >&5
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=no"
5434 fi
5435 rm -f conftest*
5436 LIBS="$ac_save_LIBS"
5437
5438 fi
5439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5440   echo "$ac_t""yes" 1>&6
5441   have_xf86gamma_ramp=yes
5442 else
5443   echo "$ac_t""no" 1>&6
5444 true
5445 fi
5446
5447   CPPFLAGS="$ac_save_CPPFLAGS"
5448   LDFLAGS="$ac_save_LDFLAGS"
5449 #  LIBS="$ac_save_LIBS"
5450   
5451   fi
5452
5453   # if those tests succeeded, then we've really got the functions.
5454   if test "$have_xf86gamma" = yes; then
5455     cat >> confdefs.h <<\EOF
5456 #define HAVE_XF86VMODE_GAMMA 1
5457 EOF
5458
5459   fi
5460
5461   if test "$have_xf86gamma_ramp" = yes; then
5462     cat >> confdefs.h <<\EOF
5463 #define HAVE_XF86VMODE_GAMMA_RAMP 1
5464 EOF
5465
5466   fi
5467
5468   # pull in the lib, if we haven't already
5469   if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
5470     SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5471   fi
5472
5473 elif test "$with_xf86gamma" != no; then
5474   echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
5475   exit 1
5476 fi
5477
5478
5479 ###############################################################################
5480 #
5481 #       Check for HP XHPDisableReset and XHPEnableReset.
5482 #
5483 ###############################################################################
5484
5485
5486   ac_save_CPPFLAGS="$CPPFLAGS"
5487   if test \! -z "$includedir" ; then 
5488     CPPFLAGS="$CPPFLAGS -I$includedir"
5489   fi
5490   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5491   cat > conftest.$ac_ext <<EOF
5492 #line 5504 "configure"
5493 #include "confdefs.h"
5494 #include <X11/XHPlib.h>
5495 EOF
5496 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5497   egrep "XHPDisableReset" >/dev/null 2>&1; then
5498   rm -rf conftest*
5499   cat >> confdefs.h <<\EOF
5500 #define HAVE_XHPDISABLERESET 1
5501 EOF
5502
5503                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
5504 fi
5505 rm -f conftest*
5506
5507   CPPFLAGS="$ac_save_CPPFLAGS"
5508
5509
5510 ###############################################################################
5511 #
5512 #       Check for /proc/interrupts.
5513 #
5514 ###############################################################################
5515
5516 have_proc_interrupts=no
5517 with_proc_interrupts_req=unspecified
5518 # Check whether --with-proc-interrupts or --without-proc-interrupts was given.
5519 if test "${with_proc_interrupts+set}" = set; then
5520   withval="$with_proc_interrupts"
5521   with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
5522 else
5523   with_proc_interrupts=yes
5524 fi
5525
5526
5527 if test "$with_proc_interrupts" = yes; then
5528
5529    echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
5530 echo "configure:5542: checking whether /proc/interrupts contains keyboard data" >&5
5531 if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
5532   echo $ac_n "(cached) $ac_c" 1>&6
5533 else
5534   ac_cv_have_proc_interrupts=no
5535      if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
5536        ac_cv_have_proc_interrupts=yes
5537      fi
5538     
5539 fi
5540
5541 echo "$ac_t""$ac_cv_have_proc_interrupts" 1>&6
5542    have_proc_interrupts=$ac_cv_have_proc_interrupts
5543
5544   if test "$have_proc_interrupts" = yes; then
5545     cat >> confdefs.h <<\EOF
5546 #define HAVE_PROC_INTERRUPTS 1
5547 EOF
5548
5549   fi
5550
5551 elif test "$with_proc_interrupts" != no; then
5552   echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
5553   exit 1
5554 fi
5555
5556
5557 ###############################################################################
5558 #
5559 #       The --enable-locking option
5560 #
5561 ###############################################################################
5562
5563 # Check whether --enable-locking or --disable-locking was given.
5564 if test "${enable_locking+set}" = set; then
5565   enableval="$enable_locking"
5566   enable_locking="$enableval"
5567 else
5568   enable_locking=yes
5569 fi
5570
5571 if test "$enable_locking" = yes; then
5572   true
5573 elif test "$enable_locking" = no; then
5574   cat >> confdefs.h <<\EOF
5575 #define NO_LOCKING 1
5576 EOF
5577
5578 else
5579   echo "error: must be yes or no: --enable-locking=$enable_locking"
5580   exit 1
5581 fi
5582
5583
5584
5585 ###############################################################################
5586 #
5587 #       The --enable-vt-locking option
5588 #
5589 ###############################################################################
5590
5591 #ac_vt_lockswitch=no
5592 #AC_ARG_ENABLE(vt-locking,[
5593 #  --enable-vt-locking     Compile in support for locking Virtual Terminals.
5594 #                          This is the default if the system supports it, and
5595 #                          if locking support is included (--enable-locking.)
5596 #  --disable-vt-locking    Do not allow locking of VTs, even if locking is
5597 #                          enabled.],
5598 #  [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
5599 #if test "$enable_vt_locking" = yes; then
5600 #
5601 #  AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
5602 #   [AC_TRY_COMPILE([#include <fcntl.h>
5603 #                   #include <sys/ioctl.h>
5604 #                   #include <sys/vt.h>],
5605 #                  [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
5606 #                  [ac_cv_vt_lockswitch=yes],
5607 #                  [ac_cv_vt_lockswitch=no])])
5608 #  ac_vt_lockswitch=$ac_cv_vt_lockswitch
5609 #
5610 #elif test "$enable_vt_locking" = no; then
5611 #  true
5612 #else
5613 #  echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
5614 #  exit 1
5615 #fi
5616 #
5617 #if test "$ac_vt_lockswitch" = yes; then
5618 #  AC_DEFINE(HAVE_VT_LOCKSWITCH)
5619 #  # the VT_LOCKSWITCH ioctl can only be used when running as root.
5620 #  # #### but it doesn't work yet, so don't worry about that for now.
5621 ##  need_setuid=yes
5622 #fi
5623
5624
5625
5626 ###############################################################################
5627 #
5628 #       Check for PAM.
5629 #
5630 ###############################################################################
5631
5632 case "$host" in
5633   *-solaris*)
5634    # Solaris systems tend to come with PAM misconfigured.
5635    #  Don't build it by default, even if the headers exist.
5636    with_pam_default=no
5637    ;;
5638   *)
5639    # Default to building PAM support on all other systems, if it exists.
5640    with_pam_default=yes
5641   ;;
5642 esac
5643
5644 have_pam=no
5645 with_pam_req=unspecified
5646
5647 # Check whether --with-pam or --without-pam was given.
5648 if test "${with_pam+set}" = set; then
5649   withval="$with_pam"
5650   with_pam="$withval"; with_pam_req="$withval"
5651 else
5652   with_pam=$with_pam_default
5653 fi
5654
5655
5656
5657    case "$with_pam" in
5658     yes) ;;
5659     no)  ;;
5660
5661     /*)
5662      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
5663 echo "configure:5675: checking for PAM headers" >&5
5664      d=$with_pam/include
5665      if test -d $d; then
5666        X_CFLAGS="-I$d $X_CFLAGS"
5667        echo "$ac_t""$d" 1>&6
5668      else
5669        echo "$ac_t""not found ($d: no such directory)" 1>&6
5670      fi
5671
5672      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
5673 echo "configure:5685: checking for PAM libs" >&5
5674      d=$with_pam/lib
5675      if test -d $d; then
5676        X_LIBS="-L$d $X_LIBS"
5677        echo "$ac_t""$d" 1>&6
5678      else
5679        echo "$ac_t""not found ($d: no such directory)" 1>&6
5680      fi
5681
5682      # replace the directory string with "yes".
5683      with_pam_req="yes"
5684      with_pam=$with_pam_req
5685      ;;
5686
5687     *)
5688      echo ""
5689      echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
5690      echo "       If it is a directory, then \`DIR/include' will be added to"
5691      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5692      exit 1
5693      ;;
5694    esac
5695   
5696
5697 if test "$enable_locking" = yes -a "$with_pam" = yes; then
5698   echo $ac_n "checking for PAM""... $ac_c" 1>&6
5699 echo "configure:5711: checking for PAM" >&5
5700 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
5701   echo $ac_n "(cached) $ac_c" 1>&6
5702 else
5703   
5704   ac_save_CPPFLAGS="$CPPFLAGS"
5705   if test \! -z "$includedir" ; then 
5706     CPPFLAGS="$CPPFLAGS -I$includedir"
5707   fi
5708   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5709   cat > conftest.$ac_ext <<EOF
5710 #line 5722 "configure"
5711 #include "confdefs.h"
5712 #include <security/pam_appl.h>
5713 int main() {
5714
5715 ; return 0; }
5716 EOF
5717 if { (eval echo configure:5729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5718   rm -rf conftest*
5719   ac_cv_pam=yes
5720 else
5721   echo "configure: failed program was:" >&5
5722   cat conftest.$ac_ext >&5
5723   rm -rf conftest*
5724   ac_cv_pam=no
5725 fi
5726 rm -f conftest*
5727   CPPFLAGS="$ac_save_CPPFLAGS"
5728 fi
5729
5730 echo "$ac_t""$ac_cv_pam" 1>&6
5731   if test "$ac_cv_pam" = yes ; then
5732     have_pam=yes
5733     cat >> confdefs.h <<\EOF
5734 #define HAVE_PAM 1
5735 EOF
5736
5737     PASSWD_LIBS="${PASSWD_LIBS} -lpam"
5738
5739     # libpam typically requires dlopen and dlsym.  On FreeBSD,
5740     # those are in libc.  On Linux and Solaris, they're in libdl.
5741     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5742 echo "configure:5754: checking for dlopen in -ldl" >&5
5743 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
5744 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5745   echo $ac_n "(cached) $ac_c" 1>&6
5746 else
5747   ac_save_LIBS="$LIBS"
5748 LIBS="-ldl  $LIBS"
5749 cat > conftest.$ac_ext <<EOF
5750 #line 5762 "configure"
5751 #include "confdefs.h"
5752 /* Override any gcc2 internal prototype to avoid an error.  */
5753 /* We use char because int might match the return type of a gcc2
5754     builtin and then its argument prototype would still apply.  */
5755 char dlopen();
5756
5757 int main() {
5758 dlopen()
5759 ; return 0; }
5760 EOF
5761 if { (eval echo configure:5773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5762   rm -rf conftest*
5763   eval "ac_cv_lib_$ac_lib_var=yes"
5764 else
5765   echo "configure: failed program was:" >&5
5766   cat conftest.$ac_ext >&5
5767   rm -rf conftest*
5768   eval "ac_cv_lib_$ac_lib_var=no"
5769 fi
5770 rm -f conftest*
5771 LIBS="$ac_save_LIBS"
5772
5773 fi
5774 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5775   echo "$ac_t""yes" 1>&6
5776   PASSWD_LIBS="${PASSWD_LIBS} -ldl"
5777 else
5778   echo "$ac_t""no" 1>&6
5779 fi
5780
5781
5782     echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
5783 echo "configure:5795: checking how to call pam_strerror" >&5
5784     if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
5785   echo $ac_n "(cached) $ac_c" 1>&6
5786 else
5787   cat > conftest.$ac_ext <<EOF
5788 #line 5800 "configure"
5789 #include "confdefs.h"
5790 #include <stdio.h>
5791                       #include <stdlib.h>
5792                       #include <security/pam_appl.h>
5793 int main() {
5794 pam_handle_t *pamh = 0;
5795                       char *s = pam_strerror(pamh, PAM_SUCCESS);
5796 ; return 0; }
5797 EOF
5798 if { (eval echo configure:5810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5799   rm -rf conftest*
5800   ac_pam_strerror_args=2
5801 else
5802   echo "configure: failed program was:" >&5
5803   cat conftest.$ac_ext >&5
5804   rm -rf conftest*
5805   cat > conftest.$ac_ext <<EOF
5806 #line 5818 "configure"
5807 #include "confdefs.h"
5808 #include <stdio.h>
5809                                       #include <stdlib.h>
5810                                       #include <security/pam_appl.h>
5811 int main() {
5812 char *s =
5813                                        pam_strerror(PAM_SUCCESS);
5814 ; return 0; }
5815 EOF
5816 if { (eval echo configure:5828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5817   rm -rf conftest*
5818   ac_pam_strerror_args=1
5819 else
5820   echo "configure: failed program was:" >&5
5821   cat conftest.$ac_ext >&5
5822   rm -rf conftest*
5823   ac_pam_strerror_args=0
5824 fi
5825 rm -f conftest*
5826 fi
5827 rm -f conftest*
5828       ac_cv_pam_strerror_args=$ac_pam_strerror_args
5829 fi
5830
5831     ac_pam_strerror_args=$ac_cv_pam_strerror_args
5832     if test "$ac_pam_strerror_args" = 1 ; then
5833       echo "$ac_t""one argument" 1>&6
5834     elif test "$ac_pam_strerror_args" = 2 ; then
5835       cat >> confdefs.h <<\EOF
5836 #define PAM_STRERROR_TWO_ARGS 1
5837 EOF
5838
5839       echo "$ac_t""two arguments" 1>&6
5840     else
5841       echo "$ac_t""unknown" 1>&6
5842     fi
5843   fi
5844 fi
5845
5846
5847 ###############################################################################
5848 #
5849 #       Check for Kerberos.
5850 #
5851 ###############################################################################
5852
5853 have_kerberos=no
5854 have_kerberos5=no
5855 with_kerberos_req=unspecified
5856
5857 # Check whether --with-kerberos or --without-kerberos was given.
5858 if test "${with_kerberos+set}" = set; then
5859   withval="$with_kerberos"
5860   with_kerberos="$withval"; with_kerberos_req="$withval"
5861 else
5862   with_kerberos=yes
5863 fi
5864
5865
5866
5867    case "$with_kerberos" in
5868     yes) ;;
5869     no)  ;;
5870
5871     /*)
5872      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
5873 echo "configure:5885: checking for Kerberos headers" >&5
5874      d=$with_kerberos/include
5875      if test -d $d; then
5876        X_CFLAGS="-I$d $X_CFLAGS"
5877        echo "$ac_t""$d" 1>&6
5878      else
5879        echo "$ac_t""not found ($d: no such directory)" 1>&6
5880      fi
5881
5882      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
5883 echo "configure:5895: checking for Kerberos libs" >&5
5884      d=$with_kerberos/lib
5885      if test -d $d; then
5886        X_LIBS="-L$d $X_LIBS"
5887        echo "$ac_t""$d" 1>&6
5888      else
5889        echo "$ac_t""not found ($d: no such directory)" 1>&6
5890      fi
5891
5892      # replace the directory string with "yes".
5893      with_kerberos_req="yes"
5894      with_kerberos=$with_kerberos_req
5895      ;;
5896
5897     *)
5898      echo ""
5899      echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory."
5900      echo "       If it is a directory, then \`DIR/include' will be added to"
5901      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5902      exit 1
5903      ;;
5904    esac
5905   
5906
5907 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
5908   echo $ac_n "checking for Kerberos 4""... $ac_c" 1>&6
5909 echo "configure:5921: checking for Kerberos 4" >&5
5910 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
5911   echo $ac_n "(cached) $ac_c" 1>&6
5912 else
5913   
5914   ac_save_CPPFLAGS="$CPPFLAGS"
5915   if test \! -z "$includedir" ; then 
5916     CPPFLAGS="$CPPFLAGS -I$includedir"
5917   fi
5918   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5919   cat > conftest.$ac_ext <<EOF
5920 #line 5932 "configure"
5921 #include "confdefs.h"
5922 #include <krb.h>
5923 int main() {
5924
5925 ; return 0; }
5926 EOF
5927 if { (eval echo configure:5939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5928   rm -rf conftest*
5929   ac_cv_kerberos=yes
5930 else
5931   echo "configure: failed program was:" >&5
5932   cat conftest.$ac_ext >&5
5933   rm -rf conftest*
5934   ac_cv_kerberos=no
5935 fi
5936 rm -f conftest*
5937   CPPFLAGS="$ac_save_CPPFLAGS"
5938 fi
5939
5940 echo "$ac_t""$ac_cv_kerberos" 1>&6
5941   echo $ac_n "checking for Kerberos 5""... $ac_c" 1>&6
5942 echo "configure:5954: checking for Kerberos 5" >&5
5943 if eval "test \"`echo '$''{'ac_cv_kerberos5'+set}'`\" = set"; then
5944   echo $ac_n "(cached) $ac_c" 1>&6
5945 else
5946   
5947   ac_save_CPPFLAGS="$CPPFLAGS"
5948   if test \! -z "$includedir" ; then 
5949     CPPFLAGS="$CPPFLAGS -I$includedir"
5950   fi
5951   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5952   cat > conftest.$ac_ext <<EOF
5953 #line 5965 "configure"
5954 #include "confdefs.h"
5955 #include <kerberosIV/krb.h>
5956 int main() {
5957
5958 ; return 0; }
5959 EOF
5960 if { (eval echo configure:5972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5961   rm -rf conftest*
5962   ac_cv_kerberos5=yes
5963 else
5964   echo "configure: failed program was:" >&5
5965   cat conftest.$ac_ext >&5
5966   rm -rf conftest*
5967   ac_cv_kerberos5=no
5968 fi
5969 rm -f conftest*
5970   CPPFLAGS="$ac_save_CPPFLAGS"
5971 fi
5972
5973 echo "$ac_t""$ac_cv_kerberos5" 1>&6
5974
5975   if test "$ac_cv_kerberos" = yes ; then
5976     have_kerberos=yes
5977     cat >> confdefs.h <<\EOF
5978 #define HAVE_KERBEROS 1
5979 EOF
5980
5981   fi
5982
5983   if test "$ac_cv_kerberos5" = yes ; then
5984     have_kerberos=yes
5985     have_kerberos5=yes
5986     cat >> confdefs.h <<\EOF
5987 #define HAVE_KERBEROS 1
5988 EOF
5989
5990     cat >> confdefs.h <<\EOF
5991 #define HAVE_KERBEROS5 1
5992 EOF
5993
5994   fi
5995
5996   if test "$have_kerberos5" = yes ; then
5997     # from Matt Knopp <mhat@infocalypse.netlag.com>
5998     # (who got it from amu@mit.edu)
5999     PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
6000   elif test "$have_kerberos" = yes ; then
6001     # from Tim Showalter <tjs+@andrew.cmu.edu>
6002     PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
6003   fi
6004
6005   if test "$have_kerberos" = yes ; then
6006     echo $ac_n "checking for res_search""... $ac_c" 1>&6
6007 echo "configure:6019: checking for res_search" >&5
6008 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
6009   echo $ac_n "(cached) $ac_c" 1>&6
6010 else
6011   cat > conftest.$ac_ext <<EOF
6012 #line 6024 "configure"
6013 #include "confdefs.h"
6014 /* System header to define __stub macros and hopefully few prototypes,
6015     which can conflict with char res_search(); below.  */
6016 #include <assert.h>
6017 /* Override any gcc2 internal prototype to avoid an error.  */
6018 /* We use char because int might match the return type of a gcc2
6019     builtin and then its argument prototype would still apply.  */
6020 char res_search();
6021
6022 int main() {
6023
6024 /* The GNU C library defines this for functions which it implements
6025     to always fail with ENOSYS.  Some functions are actually named
6026     something starting with __ and the normal name is an alias.  */
6027 #if defined (__stub_res_search) || defined (__stub___res_search)
6028 choke me
6029 #else
6030 res_search();
6031 #endif
6032
6033 ; return 0; }
6034 EOF
6035 if { (eval echo configure:6047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6036   rm -rf conftest*
6037   eval "ac_cv_func_res_search=yes"
6038 else
6039   echo "configure: failed program was:" >&5
6040   cat conftest.$ac_ext >&5
6041   rm -rf conftest*
6042   eval "ac_cv_func_res_search=no"
6043 fi
6044 rm -f conftest*
6045 fi
6046
6047 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
6048   echo "$ac_t""yes" 1>&6
6049   :
6050 else
6051   echo "$ac_t""no" 1>&6
6052 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
6053 echo "configure:6065: checking for res_search in -lresolv" >&5
6054 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
6055 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6056   echo $ac_n "(cached) $ac_c" 1>&6
6057 else
6058   ac_save_LIBS="$LIBS"
6059 LIBS="-lresolv  $LIBS"
6060 cat > conftest.$ac_ext <<EOF
6061 #line 6073 "configure"
6062 #include "confdefs.h"
6063 /* Override any gcc2 internal prototype to avoid an error.  */
6064 /* We use char because int might match the return type of a gcc2
6065     builtin and then its argument prototype would still apply.  */
6066 char res_search();
6067
6068 int main() {
6069 res_search()
6070 ; return 0; }
6071 EOF
6072 if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6073   rm -rf conftest*
6074   eval "ac_cv_lib_$ac_lib_var=yes"
6075 else
6076   echo "configure: failed program was:" >&5
6077   cat conftest.$ac_ext >&5
6078   rm -rf conftest*
6079   eval "ac_cv_lib_$ac_lib_var=no"
6080 fi
6081 rm -f conftest*
6082 LIBS="$ac_save_LIBS"
6083
6084 fi
6085 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6086   echo "$ac_t""yes" 1>&6
6087   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
6088 else
6089   echo "$ac_t""no" 1>&6
6090 echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
6091       
6092 fi
6093
6094 fi
6095
6096   fi
6097 fi
6098
6099
6100 ###############################################################################
6101 #
6102 #       Check for the nine billion variants of shadow passwords...
6103 #
6104 ###############################################################################
6105
6106 need_setuid=no
6107
6108 have_shadow=no
6109 with_shadow_req=unspecified
6110
6111 # Check whether --with-shadow or --without-shadow was given.
6112 if test "${with_shadow+set}" = set; then
6113   withval="$with_shadow"
6114   with_shadow="$withval"; with_shadow_req="$withval"
6115 else
6116   with_shadow=yes
6117 fi
6118
6119
6120
6121    case "$with_shadow" in
6122     yes) ;;
6123     no)  ;;
6124
6125     /*)
6126      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
6127 echo "configure:6139: checking for shadow password headers" >&5
6128      d=$with_shadow/include
6129      if test -d $d; then
6130        X_CFLAGS="-I$d $X_CFLAGS"
6131        echo "$ac_t""$d" 1>&6
6132      else
6133        echo "$ac_t""not found ($d: no such directory)" 1>&6
6134      fi
6135
6136      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
6137 echo "configure:6149: checking for shadow password libs" >&5
6138      d=$with_shadow/lib
6139      if test -d $d; then
6140        X_LIBS="-L$d $X_LIBS"
6141        echo "$ac_t""$d" 1>&6
6142      else
6143        echo "$ac_t""not found ($d: no such directory)" 1>&6
6144      fi
6145
6146      # replace the directory string with "yes".
6147      with_shadow_req="yes"
6148      with_shadow=$with_shadow_req
6149      ;;
6150
6151     *)
6152      echo ""
6153      echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory."
6154      echo "       If it is a directory, then \`DIR/include' will be added to"
6155      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6156      exit 1
6157      ;;
6158    esac
6159   
6160
6161 if test "$enable_locking" = no ; then
6162   with_shadow_req=no
6163   with_shadow=no
6164 fi
6165
6166
6167 ###############################################################################
6168 #
6169 #       Check for Sun "adjunct" passwords.
6170 #
6171 ###############################################################################
6172
6173 if test "$with_shadow" = yes ; then
6174   echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
6175 echo "configure:6187: checking for Sun-style shadow passwords" >&5
6176 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
6177   echo $ac_n "(cached) $ac_c" 1>&6
6178 else
6179   
6180   ac_save_CPPFLAGS="$CPPFLAGS"
6181   if test \! -z "$includedir" ; then 
6182     CPPFLAGS="$CPPFLAGS -I$includedir"
6183   fi
6184   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6185   cat > conftest.$ac_ext <<EOF
6186 #line 6198 "configure"
6187 #include "confdefs.h"
6188 #include <stdlib.h>
6189                                     #include <unistd.h>
6190                                     #include <sys/types.h>
6191                                     #include <sys/label.h>
6192                                     #include <sys/audit.h>
6193                                     #include <pwdadj.h>
6194 int main() {
6195 struct passwd_adjunct *p = getpwanam("nobody");
6196                        const char *pw = p->pwa_passwd;
6197 ; return 0; }
6198 EOF
6199 if { (eval echo configure:6211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6200   rm -rf conftest*
6201   ac_cv_sun_adjunct=yes
6202 else
6203   echo "configure: failed program was:" >&5
6204   cat conftest.$ac_ext >&5
6205   rm -rf conftest*
6206   ac_cv_sun_adjunct=no
6207 fi
6208 rm -f conftest*
6209   CPPFLAGS="$ac_save_CPPFLAGS"
6210 fi
6211
6212 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
6213   if test "$ac_cv_sun_adjunct" = yes; then
6214     have_shadow_adjunct=yes
6215     have_shadow=yes
6216     need_setuid=yes
6217   fi
6218 fi
6219
6220
6221 ###############################################################################
6222 #
6223 #       Check for DEC and SCO so-called "enhanced" security.
6224 #
6225 ###############################################################################
6226
6227 if test "$with_shadow" = yes ; then
6228   echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
6229 echo "configure:6241: checking for DEC-style shadow passwords" >&5
6230 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
6231   echo $ac_n "(cached) $ac_c" 1>&6
6232 else
6233   
6234   ac_save_CPPFLAGS="$CPPFLAGS"
6235   if test \! -z "$includedir" ; then 
6236     CPPFLAGS="$CPPFLAGS -I$includedir"
6237   fi
6238   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6239   cat > conftest.$ac_ext <<EOF
6240 #line 6252 "configure"
6241 #include "confdefs.h"
6242 #include <stdlib.h>
6243                                     #include <unistd.h>
6244                                     #include <sys/types.h>
6245                                     #include <pwd.h>
6246                                     #include <sys/security.h>
6247                                     #include <prot.h>
6248 int main() {
6249 struct pr_passwd *p;
6250                        const char *pw;
6251                        set_auth_parameters(0, 0);
6252                        check_auth_parameters();
6253                        p = getprpwnam("nobody");
6254                        pw = p->ufld.fd_encrypt;
6255 ; return 0; }
6256 EOF
6257 if { (eval echo configure:6269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6258   rm -rf conftest*
6259   ac_cv_enhanced_passwd=yes
6260 else
6261   echo "configure: failed program was:" >&5
6262   cat conftest.$ac_ext >&5
6263   rm -rf conftest*
6264   ac_cv_enhanced_passwd=no
6265 fi
6266 rm -f conftest*
6267   CPPFLAGS="$ac_save_CPPFLAGS"
6268 fi
6269
6270 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
6271   if test $ac_cv_enhanced_passwd = yes; then
6272     have_shadow_enhanced=yes
6273     have_shadow=yes
6274     need_setuid=yes
6275
6276     # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
6277     # (I'm told it needs -lcurses too, but I don't understand why.)
6278     # But on DEC, it's in -lsecurity.
6279     #
6280     echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
6281 echo "configure:6293: checking for getprpwnam in -lprot" >&5
6282 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
6283 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6284   echo $ac_n "(cached) $ac_c" 1>&6
6285 else
6286   ac_save_LIBS="$LIBS"
6287 LIBS="-lprot -lx $LIBS"
6288 cat > conftest.$ac_ext <<EOF
6289 #line 6301 "configure"
6290 #include "confdefs.h"
6291 /* Override any gcc2 internal prototype to avoid an error.  */
6292 /* We use char because int might match the return type of a gcc2
6293     builtin and then its argument prototype would still apply.  */
6294 char getprpwnam();
6295
6296 int main() {
6297 getprpwnam()
6298 ; return 0; }
6299 EOF
6300 if { (eval echo configure:6312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6301   rm -rf conftest*
6302   eval "ac_cv_lib_$ac_lib_var=yes"
6303 else
6304   echo "configure: failed program was:" >&5
6305   cat conftest.$ac_ext >&5
6306   rm -rf conftest*
6307   eval "ac_cv_lib_$ac_lib_var=no"
6308 fi
6309 rm -f conftest*
6310 LIBS="$ac_save_LIBS"
6311
6312 fi
6313 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6314   echo "$ac_t""yes" 1>&6
6315   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
6316 else
6317   echo "$ac_t""no" 1>&6
6318 echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
6319 echo "configure:6331: checking for getprpwnam in -lsecurity" >&5
6320 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
6321 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6322   echo $ac_n "(cached) $ac_c" 1>&6
6323 else
6324   ac_save_LIBS="$LIBS"
6325 LIBS="-lsecurity  $LIBS"
6326 cat > conftest.$ac_ext <<EOF
6327 #line 6339 "configure"
6328 #include "confdefs.h"
6329 /* Override any gcc2 internal prototype to avoid an error.  */
6330 /* We use char because int might match the return type of a gcc2
6331     builtin and then its argument prototype would still apply.  */
6332 char getprpwnam();
6333
6334 int main() {
6335 getprpwnam()
6336 ; return 0; }
6337 EOF
6338 if { (eval echo configure:6350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6339   rm -rf conftest*
6340   eval "ac_cv_lib_$ac_lib_var=yes"
6341 else
6342   echo "configure: failed program was:" >&5
6343   cat conftest.$ac_ext >&5
6344   rm -rf conftest*
6345   eval "ac_cv_lib_$ac_lib_var=no"
6346 fi
6347 rm -f conftest*
6348 LIBS="$ac_save_LIBS"
6349
6350 fi
6351 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6352   echo "$ac_t""yes" 1>&6
6353   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
6354 else
6355   echo "$ac_t""no" 1>&6
6356 fi
6357
6358 fi
6359
6360   fi
6361 fi
6362
6363 ###############################################################################
6364 #
6365 #       Check for HP's entry in the "Not Invented Here" Sweepstakes.
6366 #
6367 ###############################################################################
6368
6369 if test "$with_shadow" = yes ; then
6370   echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
6371 echo "configure:6383: checking for HP-style shadow passwords" >&5
6372 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
6373   echo $ac_n "(cached) $ac_c" 1>&6
6374 else
6375   
6376   ac_save_CPPFLAGS="$CPPFLAGS"
6377   if test \! -z "$includedir" ; then 
6378     CPPFLAGS="$CPPFLAGS -I$includedir"
6379   fi
6380   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6381   cat > conftest.$ac_ext <<EOF
6382 #line 6394 "configure"
6383 #include "confdefs.h"
6384 #include <stdlib.h>
6385                                     #include <unistd.h>
6386                                     #include <sys/types.h>
6387                                     #include <pwd.h>
6388                                     #include <hpsecurity.h>
6389                                     #include <prot.h>
6390 int main() {
6391 struct s_passwd *p = getspwnam("nobody");
6392                        const char *pw = p->pw_passwd;
6393 ; return 0; }
6394 EOF
6395 if { (eval echo configure:6407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6396   rm -rf conftest*
6397   ac_cv_hpux_passwd=yes
6398 else
6399   echo "configure: failed program was:" >&5
6400   cat conftest.$ac_ext >&5
6401   rm -rf conftest*
6402   ac_cv_hpux_passwd=no
6403 fi
6404 rm -f conftest*
6405   CPPFLAGS="$ac_save_CPPFLAGS"
6406 fi
6407
6408 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
6409   if test "$ac_cv_hpux_passwd" = yes; then
6410     have_shadow_hpux=yes
6411     have_shadow=yes
6412     need_setuid=yes
6413
6414     # on HPUX, bigcrypt is in -lsec
6415     echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
6416 echo "configure:6428: checking for bigcrypt in -lsec" >&5
6417 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
6418 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6419   echo $ac_n "(cached) $ac_c" 1>&6
6420 else
6421   ac_save_LIBS="$LIBS"
6422 LIBS="-lsec  $LIBS"
6423 cat > conftest.$ac_ext <<EOF
6424 #line 6436 "configure"
6425 #include "confdefs.h"
6426 /* Override any gcc2 internal prototype to avoid an error.  */
6427 /* We use char because int might match the return type of a gcc2
6428     builtin and then its argument prototype would still apply.  */
6429 char bigcrypt();
6430
6431 int main() {
6432 bigcrypt()
6433 ; return 0; }
6434 EOF
6435 if { (eval echo configure:6447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6436   rm -rf conftest*
6437   eval "ac_cv_lib_$ac_lib_var=yes"
6438 else
6439   echo "configure: failed program was:" >&5
6440   cat conftest.$ac_ext >&5
6441   rm -rf conftest*
6442   eval "ac_cv_lib_$ac_lib_var=no"
6443 fi
6444 rm -f conftest*
6445 LIBS="$ac_save_LIBS"
6446
6447 fi
6448 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6449   echo "$ac_t""yes" 1>&6
6450   PASSWD_LIBS="$PASSWD_LIBS -lsec"
6451 else
6452   echo "$ac_t""no" 1>&6
6453 fi
6454
6455   fi
6456 fi
6457
6458
6459 ###############################################################################
6460 #
6461 #       Check for FreeBSD-style shadow passwords.
6462 #
6463 #       On FreeBSD, getpwnam() and friends work just like on non-shadow-
6464 #       password systems -- except you only get stuff in the pw_passwd field
6465 #       if the running program is setuid.  So, guess that we've got this
6466 #       lossage to contend with if /etc/master.passwd exists, and default to
6467 #       a setuid installation.
6468 #
6469 ###############################################################################
6470
6471 if test "$with_shadow" = yes ; then
6472   echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
6473 echo "configure:6485: checking for FreeBSD-style shadow passwords" >&5
6474 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
6475   echo $ac_n "(cached) $ac_c" 1>&6
6476 else
6477   if test -f /etc/master.passwd ; then
6478                     ac_cv_master_passwd=yes
6479                   else
6480                     ac_cv_master_passwd=no
6481                   fi
6482 fi
6483
6484 echo "$ac_t""$ac_cv_master_passwd" 1>&6
6485   if test "$ac_cv_master_passwd" = yes; then
6486     need_setuid=yes
6487   fi
6488 fi
6489
6490
6491 ###############################################################################
6492 #
6493 #       Check for traditional (ha!) shadow passwords.
6494 #
6495 ###############################################################################
6496
6497 if test "$with_shadow" = yes ; then
6498   echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
6499 echo "configure:6511: checking for generic shadow passwords" >&5
6500 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
6501   echo $ac_n "(cached) $ac_c" 1>&6
6502 else
6503   
6504   ac_save_CPPFLAGS="$CPPFLAGS"
6505   if test \! -z "$includedir" ; then 
6506     CPPFLAGS="$CPPFLAGS -I$includedir"
6507   fi
6508   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6509   cat > conftest.$ac_ext <<EOF
6510 #line 6522 "configure"
6511 #include "confdefs.h"
6512 #include <stdlib.h>
6513                                     #include <unistd.h>
6514                                     #include <sys/types.h>
6515                                     #include <pwd.h>
6516                                     #include <shadow.h>
6517 int main() {
6518 struct spwd *p = getspnam("nobody");
6519                        const char *pw = p->sp_pwdp;
6520 ; return 0; }
6521 EOF
6522 if { (eval echo configure:6534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6523   rm -rf conftest*
6524   ac_cv_shadow=yes
6525 else
6526   echo "configure: failed program was:" >&5
6527   cat conftest.$ac_ext >&5
6528   rm -rf conftest*
6529   ac_cv_shadow=no
6530 fi
6531 rm -f conftest*
6532   CPPFLAGS="$ac_save_CPPFLAGS"
6533 fi
6534
6535 echo "$ac_t""$ac_cv_shadow" 1>&6
6536   if test "$ac_cv_shadow" = yes; then
6537     have_shadow=yes
6538     need_setuid=yes
6539
6540     # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
6541     have_getspnam=no
6542     echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
6543 echo "configure:6555: checking for getspnam in -lc" >&5
6544 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
6545 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6546   echo $ac_n "(cached) $ac_c" 1>&6
6547 else
6548   ac_save_LIBS="$LIBS"
6549 LIBS="-lc  $LIBS"
6550 cat > conftest.$ac_ext <<EOF
6551 #line 6563 "configure"
6552 #include "confdefs.h"
6553 /* Override any gcc2 internal prototype to avoid an error.  */
6554 /* We use char because int might match the return type of a gcc2
6555     builtin and then its argument prototype would still apply.  */
6556 char getspnam();
6557
6558 int main() {
6559 getspnam()
6560 ; return 0; }
6561 EOF
6562 if { (eval echo configure:6574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6563   rm -rf conftest*
6564   eval "ac_cv_lib_$ac_lib_var=yes"
6565 else
6566   echo "configure: failed program was:" >&5
6567   cat conftest.$ac_ext >&5
6568   rm -rf conftest*
6569   eval "ac_cv_lib_$ac_lib_var=no"
6570 fi
6571 rm -f conftest*
6572 LIBS="$ac_save_LIBS"
6573
6574 fi
6575 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6576   echo "$ac_t""yes" 1>&6
6577   have_getspnam=yes
6578 else
6579   echo "$ac_t""no" 1>&6
6580 fi
6581
6582     if test "$have_getspnam" = no ; then
6583       echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
6584 echo "configure:6596: checking for getspnam in -lgen" >&5
6585 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
6586 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6587   echo $ac_n "(cached) $ac_c" 1>&6
6588 else
6589   ac_save_LIBS="$LIBS"
6590 LIBS="-lgen  $LIBS"
6591 cat > conftest.$ac_ext <<EOF
6592 #line 6604 "configure"
6593 #include "confdefs.h"
6594 /* Override any gcc2 internal prototype to avoid an error.  */
6595 /* We use char because int might match the return type of a gcc2
6596     builtin and then its argument prototype would still apply.  */
6597 char getspnam();
6598
6599 int main() {
6600 getspnam()
6601 ; return 0; }
6602 EOF
6603 if { (eval echo configure:6615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6604   rm -rf conftest*
6605   eval "ac_cv_lib_$ac_lib_var=yes"
6606 else
6607   echo "configure: failed program was:" >&5
6608   cat conftest.$ac_ext >&5
6609   rm -rf conftest*
6610   eval "ac_cv_lib_$ac_lib_var=no"
6611 fi
6612 rm -f conftest*
6613 LIBS="$ac_save_LIBS"
6614
6615 fi
6616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6617   echo "$ac_t""yes" 1>&6
6618   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
6619 else
6620   echo "$ac_t""no" 1>&6
6621 fi
6622
6623     fi
6624   fi
6625 fi
6626
6627
6628 ###############################################################################
6629 #
6630 #       Check for other libraries needed for non-shadow passwords.
6631 #
6632 ###############################################################################
6633
6634 if test "$enable_locking" = yes ; then
6635
6636   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
6637   have_crypt=no
6638   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
6639 echo "configure:6651: checking for crypt in -lc" >&5
6640 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
6641 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6642   echo $ac_n "(cached) $ac_c" 1>&6
6643 else
6644   ac_save_LIBS="$LIBS"
6645 LIBS="-lc  $LIBS"
6646 cat > conftest.$ac_ext <<EOF
6647 #line 6659 "configure"
6648 #include "confdefs.h"
6649 /* Override any gcc2 internal prototype to avoid an error.  */
6650 /* We use char because int might match the return type of a gcc2
6651     builtin and then its argument prototype would still apply.  */
6652 char crypt();
6653
6654 int main() {
6655 crypt()
6656 ; return 0; }
6657 EOF
6658 if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6659   rm -rf conftest*
6660   eval "ac_cv_lib_$ac_lib_var=yes"
6661 else
6662   echo "configure: failed program was:" >&5
6663   cat conftest.$ac_ext >&5
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=no"
6666 fi
6667 rm -f conftest*
6668 LIBS="$ac_save_LIBS"
6669
6670 fi
6671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6672   echo "$ac_t""yes" 1>&6
6673   have_crypt=yes
6674 else
6675   echo "$ac_t""no" 1>&6
6676 fi
6677
6678   if test "$have_crypt" = no ; then
6679     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6680 echo "configure:6692: checking for crypt in -lcrypt" >&5
6681 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6682 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6683   echo $ac_n "(cached) $ac_c" 1>&6
6684 else
6685   ac_save_LIBS="$LIBS"
6686 LIBS="-lcrypt  $LIBS"
6687 cat > conftest.$ac_ext <<EOF
6688 #line 6700 "configure"
6689 #include "confdefs.h"
6690 /* Override any gcc2 internal prototype to avoid an error.  */
6691 /* We use char because int might match the return type of a gcc2
6692     builtin and then its argument prototype would still apply.  */
6693 char crypt();
6694
6695 int main() {
6696 crypt()
6697 ; return 0; }
6698 EOF
6699 if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6700   rm -rf conftest*
6701   eval "ac_cv_lib_$ac_lib_var=yes"
6702 else
6703   echo "configure: failed program was:" >&5
6704   cat conftest.$ac_ext >&5
6705   rm -rf conftest*
6706   eval "ac_cv_lib_$ac_lib_var=no"
6707 fi
6708 rm -f conftest*
6709 LIBS="$ac_save_LIBS"
6710
6711 fi
6712 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6713   echo "$ac_t""yes" 1>&6
6714   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
6715 else
6716   echo "$ac_t""no" 1>&6
6717 fi
6718
6719   fi
6720 fi
6721
6722
6723 # Most of the above shadow mechanisms will have set need_setuid to yes,
6724 # if they were found.  But, on some systems, we need setuid even when
6725 # using plain old vanilla passwords.
6726 #
6727 if test "$enable_locking" = yes ; then
6728   case "$host" in
6729     *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
6730       need_setuid=yes
6731     ;;
6732   esac
6733 fi
6734
6735
6736 if test "$have_shadow_adjunct" = yes ; then
6737   cat >> confdefs.h <<\EOF
6738 #define HAVE_ADJUNCT_PASSWD 1
6739 EOF
6740
6741 elif test "$have_shadow_enhanced" = yes ; then
6742   cat >> confdefs.h <<\EOF
6743 #define HAVE_ENHANCED_PASSWD 1
6744 EOF
6745
6746 elif test "$have_shadow_hpux" = yes ; then
6747   cat >> confdefs.h <<\EOF
6748 #define HAVE_HPUX_PASSWD 1
6749 EOF
6750
6751 elif test "$have_shadow" = yes ; then
6752   cat >> confdefs.h <<\EOF
6753 #define HAVE_SHADOW_PASSWD 1
6754 EOF
6755
6756 fi
6757
6758
6759 ###############################################################################
6760 #
6761 #       Check for -lXm.
6762 #
6763 ###############################################################################
6764
6765 have_motif=no
6766 with_motif_req=unspecified
6767 # Check whether --with-motif or --without-motif was given.
6768 if test "${with_motif+set}" = set; then
6769   withval="$with_motif"
6770   with_motif="$withval"; with_motif_req="$withval"
6771 else
6772   with_motif=yes
6773 fi
6774
6775
6776
6777    case "$with_motif" in
6778     yes) ;;
6779     no)  ;;
6780
6781     /*)
6782      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
6783 echo "configure:6795: checking for Motif headers" >&5
6784      d=$with_motif/include
6785      if test -d $d; then
6786        X_CFLAGS="-I$d $X_CFLAGS"
6787        echo "$ac_t""$d" 1>&6
6788      else
6789        echo "$ac_t""not found ($d: no such directory)" 1>&6
6790      fi
6791
6792      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
6793 echo "configure:6805: checking for Motif libs" >&5
6794      d=$with_motif/lib
6795      if test -d $d; then
6796        X_LIBS="-L$d $X_LIBS"
6797        echo "$ac_t""$d" 1>&6
6798      else
6799        echo "$ac_t""not found ($d: no such directory)" 1>&6
6800      fi
6801
6802      # replace the directory string with "yes".
6803      with_motif_req="yes"
6804      with_motif=$with_motif_req
6805      ;;
6806
6807     *)
6808      echo ""
6809      echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory."
6810      echo "       If it is a directory, then \`DIR/include' will be added to"
6811      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6812      exit 1
6813      ;;
6814    esac
6815   
6816
6817 if test "$with_motif" != yes -a "$with_motif" != no ; then
6818   echo "error: must be yes or no: --with-motif=$with_motif"
6819   exit 1
6820 fi
6821
6822 if test "$with_motif" = yes; then
6823   have_motif=no
6824   
6825   ac_save_CPPFLAGS="$CPPFLAGS"
6826   if test \! -z "$includedir" ; then 
6827     CPPFLAGS="$CPPFLAGS -I$includedir"
6828   fi
6829   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6830   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
6831 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
6832 echo "configure:6844: checking for Xm/Xm.h" >&5
6833 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6834   echo $ac_n "(cached) $ac_c" 1>&6
6835 else
6836   cat > conftest.$ac_ext <<EOF
6837 #line 6849 "configure"
6838 #include "confdefs.h"
6839 #include <Xm/Xm.h>
6840 EOF
6841 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6842 { (eval echo configure:6854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6843 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6844 if test -z "$ac_err"; then
6845   rm -rf conftest*
6846   eval "ac_cv_header_$ac_safe=yes"
6847 else
6848   echo "$ac_err" >&5
6849   echo "configure: failed program was:" >&5
6850   cat conftest.$ac_ext >&5
6851   rm -rf conftest*
6852   eval "ac_cv_header_$ac_safe=no"
6853 fi
6854 rm -f conftest*
6855 fi
6856 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6857   echo "$ac_t""yes" 1>&6
6858   have_motif=yes
6859                      cat >> confdefs.h <<\EOF
6860 #define HAVE_MOTIF 1
6861 EOF
6862
6863                      MOTIF_LIBS="$MOTIF_LIBS -lXm"
6864 else
6865   echo "$ac_t""no" 1>&6
6866 fi
6867
6868   CPPFLAGS="$ac_save_CPPFLAGS"
6869 fi
6870
6871
6872 if test "$have_motif" = yes; then
6873   
6874   ac_save_CPPFLAGS="$CPPFLAGS"
6875   if test \! -z "$includedir" ; then 
6876     CPPFLAGS="$CPPFLAGS -I$includedir"
6877   fi
6878   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6879   ac_safe=`echo "Xm/ComboBox.h" | sed 'y%./+-%__p_%'`
6880 echo $ac_n "checking for Xm/ComboBox.h""... $ac_c" 1>&6
6881 echo "configure:6893: checking for Xm/ComboBox.h" >&5
6882 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6883   echo $ac_n "(cached) $ac_c" 1>&6
6884 else
6885   cat > conftest.$ac_ext <<EOF
6886 #line 6898 "configure"
6887 #include "confdefs.h"
6888 #include <Xm/ComboBox.h>
6889 EOF
6890 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6891 { (eval echo configure:6903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6892 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6893 if test -z "$ac_err"; then
6894   rm -rf conftest*
6895   eval "ac_cv_header_$ac_safe=yes"
6896 else
6897   echo "$ac_err" >&5
6898   echo "configure: failed program was:" >&5
6899   cat conftest.$ac_ext >&5
6900   rm -rf conftest*
6901   eval "ac_cv_header_$ac_safe=no"
6902 fi
6903 rm -f conftest*
6904 fi
6905 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6906   echo "$ac_t""yes" 1>&6
6907   cat >> confdefs.h <<\EOF
6908 #define HAVE_XMCOMBOBOX 1
6909 EOF
6910
6911 else
6912   echo "$ac_t""no" 1>&6
6913 fi
6914
6915   CPPFLAGS="$ac_save_CPPFLAGS"
6916 fi
6917
6918
6919 ###############################################################################
6920 #
6921 #       Check for -lgtk (and Gnome stuff)
6922 #
6923 ###############################################################################
6924
6925 have_gtk=no
6926 with_gtk_req=unspecified
6927 # Check whether --with-gtk or --without-gtk was given.
6928 if test "${with_gtk+set}" = set; then
6929   withval="$with_gtk"
6930   with_gtk="$withval"; with_gtk_req="$withval"
6931 else
6932   with_gtk=yes
6933 fi
6934
6935
6936 # if --with-gtk=/directory/ was specified, remember that directory so that
6937 # we can also look for the `gtk-config' program in that directory.
6938 case "$with_gtk" in
6939   /*)
6940     gtk_dir="$with_gtk"
6941     ;;
6942   *)
6943     gtk_dir=""
6944     ;;
6945 esac
6946
6947
6948    case "$with_gtk" in
6949     yes) ;;
6950     no)  ;;
6951
6952     /*)
6953      echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
6954 echo "configure:6966: checking for Gtk headers" >&5
6955      d=$with_gtk/include
6956      if test -d $d; then
6957        X_CFLAGS="-I$d $X_CFLAGS"
6958        echo "$ac_t""$d" 1>&6
6959      else
6960        echo "$ac_t""not found ($d: no such directory)" 1>&6
6961      fi
6962
6963      echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
6964 echo "configure:6976: checking for Gtk libs" >&5
6965      d=$with_gtk/lib
6966      if test -d $d; then
6967        X_LIBS="-L$d $X_LIBS"
6968        echo "$ac_t""$d" 1>&6
6969      else
6970        echo "$ac_t""not found ($d: no such directory)" 1>&6
6971      fi
6972
6973      # replace the directory string with "yes".
6974      with_gtk_req="yes"
6975      with_gtk=$with_gtk_req
6976      ;;
6977
6978     *)
6979      echo ""
6980      echo "error: argument to --with-gtk must be \"yes\", \"no\", or a directory."
6981      echo "       If it is a directory, then \`DIR/include' will be added to"
6982      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6983      exit 1
6984      ;;
6985    esac
6986   
6987
6988 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
6989   echo "error: must be yes or no: --with-gtk=$with_gtk"
6990   exit 1
6991 fi
6992
6993 have_gnome=no
6994 with_gnome_req=unspecified
6995 # Check whether --with-gnome or --without-gnome was given.
6996 if test "${with_gnome+set}" = set; then
6997   withval="$with_gnome"
6998   with_gnome="$withval"; with_gnome_req="$withval"
6999 else
7000   with_gnome=yes
7001 fi
7002
7003
7004 # if --with-gnome=/directory/ was specified, remember that directory so that
7005 # we can also look for the `gnome-config' program in that directory.
7006 case "$with_gnome" in
7007   /*)
7008     gnome_dir="$with_gnome"
7009     ;;
7010   *)
7011     gnome_dir=""
7012     ;;
7013 esac
7014
7015
7016    case "$with_gnome" in
7017     yes) ;;
7018     no)  ;;
7019
7020     /*)
7021      echo $ac_n "checking for Gnome headers""... $ac_c" 1>&6
7022 echo "configure:7034: checking for Gnome headers" >&5
7023      d=$with_gnome/include
7024      if test -d $d; then
7025        X_CFLAGS="-I$d $X_CFLAGS"
7026        echo "$ac_t""$d" 1>&6
7027      else
7028        echo "$ac_t""not found ($d: no such directory)" 1>&6
7029      fi
7030
7031      echo $ac_n "checking for Gnome libs""... $ac_c" 1>&6
7032 echo "configure:7044: checking for Gnome libs" >&5
7033      d=$with_gnome/lib
7034      if test -d $d; then
7035        X_LIBS="-L$d $X_LIBS"
7036        echo "$ac_t""$d" 1>&6
7037      else
7038        echo "$ac_t""not found ($d: no such directory)" 1>&6
7039      fi
7040
7041      # replace the directory string with "yes".
7042      with_gnome_req="yes"
7043      with_gnome=$with_gnome_req
7044      ;;
7045
7046     *)
7047      echo ""
7048      echo "error: argument to --with-gnome must be \"yes\", \"no\", or a directory."
7049      echo "       If it is a directory, then \`DIR/include' will be added to"
7050      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7051      exit 1
7052      ;;
7053    esac
7054   
7055
7056 if test "$with_gnome" != yes -a "$with_gnome" != no ; then
7057   echo "error: must be yes or no: --with-gnome=$with_gnome"
7058   exit 1
7059 fi
7060
7061
7062 jurassic_gtk=no
7063 if test "$with_gtk" = yes; then
7064   have_gtk=no
7065   
7066   # if the user specified --with-gtk=/foo/ then look in /foo/bin/
7067   # for glib-config and gtk-config.
7068   #
7069   gtk_path="$PATH"
7070
7071   if test ! -z "$gtk_dir"; then
7072     # canonicalize slashes.
7073     gtk_dir=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
7074     gtk_path="$gtk_dir:$gtk_path"
7075   fi
7076
7077   if test ! -z "gnome_dir"; then
7078     # canonicalize slashes.
7079     gnome_dir=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
7080     gtk_path="$gnome_dir:$gtk_path"
7081   fi
7082
7083   for ac_prog in glib12-config glib-config
7084 do
7085 # Extract the first word of "$ac_prog", so it can be a program name with args.
7086 set dummy $ac_prog; ac_word=$2
7087 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7088 echo "configure:7100: checking for $ac_word" >&5
7089 if eval "test \"`echo '$''{'ac_cv_path_glib_config'+set}'`\" = set"; then
7090   echo $ac_n "(cached) $ac_c" 1>&6
7091 else
7092   case "$glib_config" in
7093   /*)
7094   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a path.
7095   ;;
7096   ?:/*)                  
7097   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a dos path.
7098   ;;
7099   *)
7100   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7101   ac_dummy="$gtk_path"
7102   for ac_dir in $ac_dummy; do 
7103     test -z "$ac_dir" && ac_dir=.
7104     if test -f $ac_dir/$ac_word; then
7105       ac_cv_path_glib_config="$ac_dir/$ac_word"
7106       break
7107     fi
7108   done
7109   IFS="$ac_save_ifs"
7110   ;;
7111 esac
7112 fi
7113 glib_config="$ac_cv_path_glib_config"
7114 if test -n "$glib_config"; then
7115   echo "$ac_t""$glib_config" 1>&6
7116 else
7117   echo "$ac_t""no" 1>&6
7118 fi
7119
7120 test -n "$glib_config" && break
7121 done
7122
7123   for ac_prog in gtk12-config  gtk-config
7124 do
7125 # Extract the first word of "$ac_prog", so it can be a program name with args.
7126 set dummy $ac_prog; ac_word=$2
7127 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7128 echo "configure:7140: checking for $ac_word" >&5
7129 if eval "test \"`echo '$''{'ac_cv_path_gtk_config'+set}'`\" = set"; then
7130   echo $ac_n "(cached) $ac_c" 1>&6
7131 else
7132   case "$gtk_config" in
7133   /*)
7134   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a path.
7135   ;;
7136   ?:/*)                  
7137   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a dos path.
7138   ;;
7139   *)
7140   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7141   ac_dummy="$gtk_path"
7142   for ac_dir in $ac_dummy; do 
7143     test -z "$ac_dir" && ac_dir=.
7144     if test -f $ac_dir/$ac_word; then
7145       ac_cv_path_gtk_config="$ac_dir/$ac_word"
7146       break
7147     fi
7148   done
7149   IFS="$ac_save_ifs"
7150   ;;
7151 esac
7152 fi
7153 gtk_config="$ac_cv_path_gtk_config"
7154 if test -n "$gtk_config"; then
7155   echo "$ac_t""$gtk_config" 1>&6
7156 else
7157   echo "$ac_t""no" 1>&6
7158 fi
7159
7160 test -n "$gtk_config" && break
7161 done
7162
7163
7164   if test "$with_gnome" = yes; then
7165     for ac_prog in gnome-config
7166 do
7167 # Extract the first word of "$ac_prog", so it can be a program name with args.
7168 set dummy $ac_prog; ac_word=$2
7169 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7170 echo "configure:7182: checking for $ac_word" >&5
7171 if eval "test \"`echo '$''{'ac_cv_path_gnome_config'+set}'`\" = set"; then
7172   echo $ac_n "(cached) $ac_c" 1>&6
7173 else
7174   case "$gnome_config" in
7175   /*)
7176   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a path.
7177   ;;
7178   ?:/*)                  
7179   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a dos path.
7180   ;;
7181   *)
7182   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7183   ac_dummy="$gtk_path"
7184   for ac_dir in $ac_dummy; do 
7185     test -z "$ac_dir" && ac_dir=.
7186     if test -f $ac_dir/$ac_word; then
7187       ac_cv_path_gnome_config="$ac_dir/$ac_word"
7188       break
7189     fi
7190   done
7191   IFS="$ac_save_ifs"
7192   ;;
7193 esac
7194 fi
7195 gnome_config="$ac_cv_path_gnome_config"
7196 if test -n "$gnome_config"; then
7197   echo "$ac_t""$gnome_config" 1>&6
7198 else
7199   echo "$ac_t""no" 1>&6
7200 fi
7201
7202 test -n "$gnome_config" && break
7203 done
7204
7205   fi
7206
7207   if test -n "$glib_config" -a  -n "gtk_config" ; then
7208     have_gtk=yes
7209     if test "$with_gnome" = yes -a -n "$gnome_config" ; then
7210       have_gnome=yes
7211     fi
7212   fi
7213
7214   if test "$have_gtk" = yes; then
7215     echo $ac_n "checking Gtk version number""... $ac_c" 1>&6
7216 echo "configure:7228: checking Gtk version number" >&5
7217 if eval "test \"`echo '$''{'ac_cv_gtk_version_string'+set}'`\" = set"; then
7218   echo $ac_n "(cached) $ac_c" 1>&6
7219 else
7220   ac_cv_gtk_version_string=`$gtk_config --version`
7221 fi
7222
7223 echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
7224     ac_gtk_version_string=$ac_cv_gtk_version_string
7225     # M4 sucks!!
7226     
7227     maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
7228     min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
7229     
7230     ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
7231     if test -z "$ac_gtk_version"; then
7232       ac_gtk_version=unknown
7233       ac_gtk_version_string=unknown
7234     fi
7235     if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
7236     then
7237       have_gtk=no
7238       have_gnome=no
7239       jurassic_gtk=yes
7240     fi
7241   fi
7242
7243   if test "$have_gtk" = yes; then
7244     echo $ac_n "checking for Gtk includes""... $ac_c" 1>&6
7245 echo "configure:7257: checking for Gtk includes" >&5
7246 if eval "test \"`echo '$''{'ac_cv_gtk_config_cflags'+set}'`\" = set"; then
7247   echo $ac_n "(cached) $ac_c" 1>&6
7248 else
7249   ac_cv_gtk_config_cflags=`$gtk_config --cflags`
7250 fi
7251
7252 echo "$ac_t""$ac_cv_gtk_config_cflags" 1>&6
7253     echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
7254 echo "configure:7266: checking for Gtk libs" >&5
7255 if eval "test \"`echo '$''{'ac_cv_gtk_config_libs'+set}'`\" = set"; then
7256   echo $ac_n "(cached) $ac_c" 1>&6
7257 else
7258   ac_cv_gtk_config_libs=`$gtk_config --libs`
7259 fi
7260
7261 echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
7262   fi
7263   ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
7264   ac_gtk_config_libs=$ac_cv_gtk_config_libs
7265
7266   # Check for Gnome Capplet support.
7267   #
7268   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7269     gnome_config_libs="gtk capplet gnomeui xml"
7270     echo $ac_n "checking for Gnome capplet includes""... $ac_c" 1>&6
7271 echo "configure:7283: checking for Gnome capplet includes" >&5
7272     if eval "test \"`echo '$''{'ac_cv_gnome_config_cflags'+set}'`\" = set"; then
7273   echo $ac_n "(cached) $ac_c" 1>&6
7274 else
7275   if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
7276             grep Unknown >/dev/null ) ; then
7277          ac_cv_gnome_config_cflags=''
7278        else
7279          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
7280        fi
7281 fi
7282
7283     ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
7284     if test "$ac_gnome_config_cflags" = "" ; then
7285       have_gnome=no
7286       echo "$ac_t""no" 1>&6
7287     else
7288       echo "$ac_t""$ac_gnome_config_cflags" 1>&6
7289     fi
7290   fi
7291
7292   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7293     echo $ac_n "checking for Gnome capplet libs""... $ac_c" 1>&6
7294 echo "configure:7306: checking for Gnome capplet libs" >&5
7295     if eval "test \"`echo '$''{'ac_cv_gnome_config_libs'+set}'`\" = set"; then
7296   echo $ac_n "(cached) $ac_c" 1>&6
7297 else
7298   if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
7299             grep Unknown >/dev/null ) ; then
7300          ac_cv_gnome_config_libs=''
7301        else
7302          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
7303        fi
7304 fi
7305
7306     ac_gnome_config_libs=$ac_cv_gnome_config_libs
7307     if test "$ac_gnome_config_libs" = "" ; then
7308       have_gnome=no
7309       echo "$ac_t""no" 1>&6
7310     else
7311       echo "$ac_t""$ac_gnome_config_libs" 1>&6
7312     fi
7313   fi
7314
7315   GNOME_DATADIR=""
7316   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7317     GNOME_DATADIR=`$gnome_config --datadir`
7318   fi
7319
7320
7321   # If we have Gnome, then override the gtk-config values with 
7322   # the gnome-config values.
7323   #
7324   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7325     ac_gtk_config_cflags=$ac_gnome_config_cflags
7326     ac_gtk_config_libs=$ac_gnome_config_libs
7327     cat >> confdefs.h <<\EOF
7328 #define HAVE_CRAPPLET 1
7329 EOF
7330
7331   fi
7332
7333
7334   if test "$have_gtk" = yes; then
7335     INCLUDES="$INCLUDES $ac_gtk_config_cflags"
7336     GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
7337     cat >> confdefs.h <<\EOF
7338 #define HAVE_GTK 1
7339 EOF
7340
7341   fi
7342
7343 fi
7344
7345
7346 # Check for the Gnome Help Browser.
7347 #
7348 if test "$have_gnome" = yes; then
7349   # Extract the first word of "gnome-help-browser", so it can be a program name with args.
7350 set dummy gnome-help-browser; ac_word=$2
7351 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7352 echo "configure:7364: checking for $ac_word" >&5
7353 if eval "test \"`echo '$''{'ac_cv_prog_have_gnome_help'+set}'`\" = set"; then
7354   echo $ac_n "(cached) $ac_c" 1>&6
7355 else
7356   if test -n "$have_gnome_help"; then
7357   ac_cv_prog_have_gnome_help="$have_gnome_help" # Let the user override the test.
7358 else
7359   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7360   ac_dummy="$PATH"
7361   for ac_dir in $ac_dummy; do
7362     test -z "$ac_dir" && ac_dir=.
7363     if test -f $ac_dir/$ac_word; then
7364       ac_cv_prog_have_gnome_help="yes"
7365       break
7366     fi
7367   done
7368   IFS="$ac_save_ifs"
7369   test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no"
7370 fi
7371 fi
7372 have_gnome_help="$ac_cv_prog_have_gnome_help"
7373 if test -n "$have_gnome_help"; then
7374   echo "$ac_t""$have_gnome_help" 1>&6
7375 else
7376   echo "$ac_t""no" 1>&6
7377 fi
7378
7379 else
7380   have_gnome_help=no
7381 fi
7382
7383
7384 ###############################################################################
7385 #
7386 #       Check for -lxml (if we have Gtk)
7387 #
7388 ###############################################################################
7389
7390 have_xml=no
7391 with_xml_req=unspecified
7392 # Check whether --with-xml or --without-xml was given.
7393 if test "${with_xml+set}" = set; then
7394   withval="$with_xml"
7395   with_xml="$withval"; with_xml_req="$withval"
7396 else
7397   with_xml=yes
7398 fi
7399
7400
7401
7402    case "$with_xml" in
7403     yes) ;;
7404     no)  ;;
7405
7406     /*)
7407      echo $ac_n "checking for XML headers""... $ac_c" 1>&6
7408 echo "configure:7420: checking for XML headers" >&5
7409      d=$with_xml/include
7410      if test -d $d; then
7411        X_CFLAGS="-I$d $X_CFLAGS"
7412        echo "$ac_t""$d" 1>&6
7413      else
7414        echo "$ac_t""not found ($d: no such directory)" 1>&6
7415      fi
7416
7417      echo $ac_n "checking for XML libs""... $ac_c" 1>&6
7418 echo "configure:7430: checking for XML libs" >&5
7419      d=$with_xml/lib
7420      if test -d $d; then
7421        X_LIBS="-L$d $X_LIBS"
7422        echo "$ac_t""$d" 1>&6
7423      else
7424        echo "$ac_t""not found ($d: no such directory)" 1>&6
7425      fi
7426
7427      # replace the directory string with "yes".
7428      with_xml_req="yes"
7429      with_xml=$with_xml_req
7430      ;;
7431
7432     *)
7433      echo ""
7434      echo "error: argument to --with-xml must be \"yes\", \"no\", or a directory."
7435      echo "       If it is a directory, then \`DIR/include' will be added to"
7436      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7437      exit 1
7438      ;;
7439    esac
7440   
7441
7442 if test "$with_xml" != yes -a "$with_xml" != no ; then
7443   echo "error: must be yes or no: --with-xml=$with_xml"
7444   exit 1
7445 fi
7446
7447 if test "$have_gtk" != yes; then
7448   # don't bother if no GTK
7449   with_xml=no
7450 fi
7451
7452 if test "$with_xml" = yes; then
7453   have_xml=no
7454
7455   # the XML stuff is likely to be in GTK paths.
7456   ac_save_X_CFLAGS="$X_CFLAGS"
7457   ac_save_X_LIBS="$X_LIBS"
7458   X_CFLAGS="$X_CFLAGS $ac_gtk_config_cflags"
7459   X_LIBS="$X_LIBS $ac_gtk_config_libs"
7460
7461   
7462   ac_save_CPPFLAGS="$CPPFLAGS"
7463   if test \! -z "$includedir" ; then 
7464     CPPFLAGS="$CPPFLAGS -I$includedir"
7465   fi
7466   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7467   ac_safe=`echo "xmlIO.h" | sed 'y%./+-%__p_%'`
7468 echo $ac_n "checking for xmlIO.h""... $ac_c" 1>&6
7469 echo "configure:7481: checking for xmlIO.h" >&5
7470 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7471   echo $ac_n "(cached) $ac_c" 1>&6
7472 else
7473   cat > conftest.$ac_ext <<EOF
7474 #line 7486 "configure"
7475 #include "confdefs.h"
7476 #include <xmlIO.h>
7477 EOF
7478 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7479 { (eval echo configure:7491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7480 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7481 if test -z "$ac_err"; then
7482   rm -rf conftest*
7483   eval "ac_cv_header_$ac_safe=yes"
7484 else
7485   echo "$ac_err" >&5
7486   echo "configure: failed program was:" >&5
7487   cat conftest.$ac_ext >&5
7488   rm -rf conftest*
7489   eval "ac_cv_header_$ac_safe=no"
7490 fi
7491 rm -f conftest*
7492 fi
7493 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7494   echo "$ac_t""yes" 1>&6
7495   have_xml=yes
7496 else
7497   echo "$ac_t""no" 1>&6
7498 fi
7499
7500   CPPFLAGS="$ac_save_CPPFLAGS"
7501
7502   if test "$have_xml" = yes; then
7503     # we have the header, now check for the library
7504     have_xml=no
7505     
7506   ac_save_CPPFLAGS="$CPPFLAGS"
7507   ac_save_LDFLAGS="$LDFLAGS"
7508 #  ac_save_LIBS="$LIBS"
7509
7510   if test \! -z "$includedir" ; then 
7511     CPPFLAGS="$CPPFLAGS -I$includedir"
7512   fi
7513   # note: $X_CFLAGS includes $x_includes
7514   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7515
7516   if test \! -z "$libdir" ; then
7517     LDFLAGS="$LDFLAGS -L$libdir"
7518   fi
7519   # note: $X_LIBS includes $x_libraries
7520   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7521
7522   echo $ac_n "checking for xmlParseChunk in -lxml""... $ac_c" 1>&6
7523 echo "configure:7535: checking for xmlParseChunk in -lxml" >&5
7524 ac_lib_var=`echo xml'_'xmlParseChunk | sed 'y%./+-%__p_%'`
7525 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7526   echo $ac_n "(cached) $ac_c" 1>&6
7527 else
7528   ac_save_LIBS="$LIBS"
7529 LIBS="-lxml  $LIBS"
7530 cat > conftest.$ac_ext <<EOF
7531 #line 7543 "configure"
7532 #include "confdefs.h"
7533 /* Override any gcc2 internal prototype to avoid an error.  */
7534 /* We use char because int might match the return type of a gcc2
7535     builtin and then its argument prototype would still apply.  */
7536 char xmlParseChunk();
7537
7538 int main() {
7539 xmlParseChunk()
7540 ; return 0; }
7541 EOF
7542 if { (eval echo configure:7554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7543   rm -rf conftest*
7544   eval "ac_cv_lib_$ac_lib_var=yes"
7545 else
7546   echo "configure: failed program was:" >&5
7547   cat conftest.$ac_ext >&5
7548   rm -rf conftest*
7549   eval "ac_cv_lib_$ac_lib_var=no"
7550 fi
7551 rm -f conftest*
7552 LIBS="$ac_save_LIBS"
7553
7554 fi
7555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7556   echo "$ac_t""yes" 1>&6
7557   have_xml=yes
7558                     XML_LIBS="-lxml"
7559                     cat >> confdefs.h <<\EOF
7560 #define HAVE_XML 1
7561 EOF
7562
7563 else
7564   echo "$ac_t""no" 1>&6
7565 fi
7566
7567   CPPFLAGS="$ac_save_CPPFLAGS"
7568   LDFLAGS="$ac_save_LDFLAGS"
7569 #  LIBS="$ac_save_LIBS"
7570   
7571   fi
7572
7573   X_CFLAGS="$ac_save_X_CFLAGS"
7574   X_LIBS="$ac_save_X_LIBS"
7575
7576 fi
7577
7578
7579 ###############################################################################
7580 #
7581 #       Checking whether Motif is really Lesstif.
7582 #
7583 ###############################################################################
7584
7585 have_lesstif=no
7586 if test "$have_motif" = yes ; then
7587   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
7588 echo "configure:7600: checking whether Motif is really LessTif" >&5
7589 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
7590   echo $ac_n "(cached) $ac_c" 1>&6
7591 else
7592   
7593   ac_save_CPPFLAGS="$CPPFLAGS"
7594   if test \! -z "$includedir" ; then 
7595     CPPFLAGS="$CPPFLAGS -I$includedir"
7596   fi
7597   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7598   cat > conftest.$ac_ext <<EOF
7599 #line 7611 "configure"
7600 #include "confdefs.h"
7601 #include <Xm/Xm.h>
7602 int main() {
7603 long vers = LesstifVersion;
7604 ; return 0; }
7605 EOF
7606 if { (eval echo configure:7618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7607   rm -rf conftest*
7608   ac_cv_have_lesstif=yes
7609 else
7610   echo "configure: failed program was:" >&5
7611   cat conftest.$ac_ext >&5
7612   rm -rf conftest*
7613   ac_cv_have_lesstif=no
7614 fi
7615 rm -f conftest*
7616   CPPFLAGS="$ac_save_CPPFLAGS"
7617 fi
7618
7619 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
7620   have_lesstif=$ac_cv_have_lesstif
7621 fi
7622
7623
7624 lesstif_version=unknown
7625 lesstif_version_string=unknown
7626
7627 if test "$have_lesstif" = yes ; then
7628   ltv=unknown
7629   echo unknown > conftest-lt
7630   echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
7631 echo "configure:7643: checking LessTif version number" >&5
7632 if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
7633   echo $ac_n "(cached) $ac_c" 1>&6
7634 else
7635   
7636   ac_save_CPPFLAGS="$CPPFLAGS"
7637   if test \! -z "$includedir" ; then 
7638     CPPFLAGS="$CPPFLAGS -I$includedir"
7639   fi
7640   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7641   if test "$cross_compiling" = yes; then
7642   ac_cv_lesstif_version=unknown
7643                      ac_cv_lesstif_version_string=unknown
7644 else
7645   cat > conftest.$ac_ext <<EOF
7646 #line 7658 "configure"
7647 #include "confdefs.h"
7648 #include <stdio.h>
7649                      #include <Xm/Xm.h>
7650                      int main() {
7651                        FILE *f = fopen("conftest-lt", "w");
7652                        if (!f) exit(1);
7653                        fprintf(f, "%d %d.%d\n", LesstifVersion,
7654                           LESSTIF_VERSION, LESSTIF_REVISION);
7655                        fclose(f);
7656                        exit(0);
7657                      }
7658 EOF
7659 if { (eval echo configure:7671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7660 then
7661   ltv=`cat conftest-lt`
7662                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
7663                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
7664 else
7665   echo "configure: failed program was:" >&5
7666   cat conftest.$ac_ext >&5
7667   rm -fr conftest*
7668   ac_cv_lesstif_version=unknown
7669                      ac_cv_lesstif_version_string=unknown
7670 fi
7671 rm -fr conftest*
7672 fi
7673
7674   CPPFLAGS="$ac_save_CPPFLAGS"
7675 fi
7676
7677 echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
7678   rm -f conftest-lt
7679   lesstif_version=$ac_cv_lesstif_version
7680   lesstif_version_string=$ac_cv_lesstif_version_string
7681
7682 fi
7683
7684
7685 if test "$have_motif" = yes ; then
7686   mtv=unknown
7687   echo unknown > conftest-mt
7688   echo $ac_n "checking Motif version number""... $ac_c" 1>&6
7689 echo "configure:7701: checking Motif version number" >&5
7690 if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
7691   echo $ac_n "(cached) $ac_c" 1>&6
7692 else
7693   
7694   ac_save_CPPFLAGS="$CPPFLAGS"
7695   if test \! -z "$includedir" ; then 
7696     CPPFLAGS="$CPPFLAGS -I$includedir"
7697   fi
7698   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7699   if test "$cross_compiling" = yes; then
7700   ac_cv_motif_version=unknown
7701                      ac_cv_motif_version_string=unknown
7702 else
7703   cat > conftest.$ac_ext <<EOF
7704 #line 7716 "configure"
7705 #include "confdefs.h"
7706 #include <stdio.h>
7707                      #include <Xm/Xm.h>
7708                      int main() {
7709                        FILE *f = fopen("conftest-mt", "w");
7710                        if (!f) exit(1);
7711                        fprintf(f, "%d %d.%d\n", XmVersion,
7712                           XmVERSION, XmREVISION);
7713                        fclose(f);
7714                        exit(0);
7715                      }
7716 EOF
7717 if { (eval echo configure:7729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7718 then
7719   mtv=`cat conftest-mt`
7720                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
7721                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
7722 else
7723   echo "configure: failed program was:" >&5
7724   cat conftest.$ac_ext >&5
7725   rm -fr conftest*
7726   ac_cv_motif_version=unknown
7727                      ac_cv_motif_version_string=unknown
7728 fi
7729 rm -fr conftest*
7730 fi
7731
7732   CPPFLAGS="$ac_save_CPPFLAGS"
7733 fi
7734
7735 echo "$ac_t""$ac_cv_motif_version_string" 1>&6
7736   rm -f conftest-mt
7737   motif_version=$ac_cv_motif_version
7738   motif_version_string=$ac_cv_motif_version_string
7739
7740 fi
7741
7742
7743 ###############################################################################
7744 #
7745 #       Checking whether Motif requires -lXpm.
7746 #
7747 #       If this is Motif 2.x, and we have XPM, then link against XPM as well.
7748 #       The deal is, Motif 2.x requires XPM -- but it's a compilation option
7749 #       of the library whether to build the XPM code into libXm, or whether
7750 #       to rely on an external libXm.  So the only way to tell whether XPM is
7751 #       a link-time requirement is to examine libXm.a, which is very
7752 #       difficult to do in an autoconf script.  So... if it's Motif 2.x, we
7753 #       always link against XPM if the XPM lib exists (and this will be a
7754 #       no-op if libXm happens to already have the XPM code in it.)
7755 #
7756 ###############################################################################
7757
7758 motif_requires_xpm=no
7759 if test "$have_motif" = yes ; then
7760    echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
7761 echo "configure:7773: checking whether Motif requires XPM" >&5
7762    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
7763    then
7764      motif_requires_xpm=yes
7765      echo "$ac_t""maybe" 1>&6
7766    else
7767      echo "$ac_t""no" 1>&6
7768    fi
7769 fi
7770
7771
7772 ###############################################################################
7773 #
7774 #       Checking whether Motif requires -lXp.
7775 #
7776 #       Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
7777 #       Extension".   Why this extension isn't in -lXext with all the others,
7778 #       I have no idea.
7779 #
7780 ###############################################################################
7781
7782 have_xp_ext=no
7783 if test "$have_motif" = yes ; then
7784    have_xp_ext=no
7785    
7786   ac_save_CPPFLAGS="$CPPFLAGS"
7787   ac_save_LDFLAGS="$LDFLAGS"
7788 #  ac_save_LIBS="$LIBS"
7789
7790   if test \! -z "$includedir" ; then 
7791     CPPFLAGS="$CPPFLAGS -I$includedir"
7792   fi
7793   # note: $X_CFLAGS includes $x_includes
7794   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7795
7796   if test \! -z "$libdir" ; then
7797     LDFLAGS="$LDFLAGS -L$libdir"
7798   fi
7799   # note: $X_LIBS includes $x_libraries
7800   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7801
7802   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
7803 echo "configure:7815: checking for XpQueryExtension in -lXp" >&5
7804 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
7805 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7806   echo $ac_n "(cached) $ac_c" 1>&6
7807 else
7808   ac_save_LIBS="$LIBS"
7809 LIBS="-lXp -lX11 -lXext -lm $LIBS"
7810 cat > conftest.$ac_ext <<EOF
7811 #line 7823 "configure"
7812 #include "confdefs.h"
7813 /* Override any gcc2 internal prototype to avoid an error.  */
7814 /* We use char because int might match the return type of a gcc2
7815     builtin and then its argument prototype would still apply.  */
7816 char XpQueryExtension();
7817
7818 int main() {
7819 XpQueryExtension()
7820 ; return 0; }
7821 EOF
7822 if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7823   rm -rf conftest*
7824   eval "ac_cv_lib_$ac_lib_var=yes"
7825 else
7826   echo "configure: failed program was:" >&5
7827   cat conftest.$ac_ext >&5
7828   rm -rf conftest*
7829   eval "ac_cv_lib_$ac_lib_var=no"
7830 fi
7831 rm -f conftest*
7832 LIBS="$ac_save_LIBS"
7833
7834 fi
7835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7836   echo "$ac_t""yes" 1>&6
7837   have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
7838 else
7839   echo "$ac_t""no" 1>&6
7840 true
7841 fi
7842
7843   CPPFLAGS="$ac_save_CPPFLAGS"
7844   LDFLAGS="$ac_save_LDFLAGS"
7845 #  LIBS="$ac_save_LIBS"
7846   
7847 fi
7848
7849
7850 ###############################################################################
7851 #
7852 #       Checking whether Motif requires -lXintl (for _Xsetlocale.)
7853 #
7854 ###############################################################################
7855
7856 have_xintl=no
7857 if test "$have_motif" = yes ; then
7858   
7859   ac_save_CPPFLAGS="$CPPFLAGS"
7860   ac_save_LDFLAGS="$LDFLAGS"
7861 #  ac_save_LIBS="$LIBS"
7862
7863   if test \! -z "$includedir" ; then 
7864     CPPFLAGS="$CPPFLAGS -I$includedir"
7865   fi
7866   # note: $X_CFLAGS includes $x_includes
7867   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7868
7869   if test \! -z "$libdir" ; then
7870     LDFLAGS="$LDFLAGS -L$libdir"
7871   fi
7872   # note: $X_LIBS includes $x_libraries
7873   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7874
7875   echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
7876 echo "configure:7888: checking for _Xsetlocale in -lXintl" >&5
7877 ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
7878 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7879   echo $ac_n "(cached) $ac_c" 1>&6
7880 else
7881   ac_save_LIBS="$LIBS"
7882 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
7883 cat > conftest.$ac_ext <<EOF
7884 #line 7896 "configure"
7885 #include "confdefs.h"
7886 /* Override any gcc2 internal prototype to avoid an error.  */
7887 /* We use char because int might match the return type of a gcc2
7888     builtin and then its argument prototype would still apply.  */
7889 char _Xsetlocale();
7890
7891 int main() {
7892 _Xsetlocale()
7893 ; return 0; }
7894 EOF
7895 if { (eval echo configure:7907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7896   rm -rf conftest*
7897   eval "ac_cv_lib_$ac_lib_var=yes"
7898 else
7899   echo "configure: failed program was:" >&5
7900   cat conftest.$ac_ext >&5
7901   rm -rf conftest*
7902   eval "ac_cv_lib_$ac_lib_var=no"
7903 fi
7904 rm -f conftest*
7905 LIBS="$ac_save_LIBS"
7906
7907 fi
7908 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7909   echo "$ac_t""yes" 1>&6
7910   have_xintl=yes
7911 else
7912   echo "$ac_t""no" 1>&6
7913 have_xintl=no
7914 fi
7915
7916   CPPFLAGS="$ac_save_CPPFLAGS"
7917   LDFLAGS="$ac_save_LDFLAGS"
7918 #  LIBS="$ac_save_LIBS"
7919   
7920   if test "$have_xintl" = yes; then
7921     MOTIF_LIBS="$MOTIF_LIBS -lXintl"
7922   fi
7923 fi
7924
7925
7926 ###############################################################################
7927 #
7928 #       Check for -lGL or -lMesaGL.
7929 #
7930 ###############################################################################
7931
7932 have_gl=no
7933 ac_have_mesa_gl=no
7934 with_gl_req=unspecified
7935 gl_halfassed=no
7936 # Check whether --with-gl or --without-gl was given.
7937 if test "${with_gl+set}" = set; then
7938   withval="$with_gl"
7939   with_gl="$withval"; with_gl_req="$withval"
7940 else
7941   with_gl=yes
7942 fi
7943
7944
7945
7946    case "$with_gl" in
7947     yes) ;;
7948     no)  ;;
7949
7950     /*)
7951      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
7952 echo "configure:7964: checking for GL headers" >&5
7953      d=$with_gl/include
7954      if test -d $d; then
7955        X_CFLAGS="-I$d $X_CFLAGS"
7956        echo "$ac_t""$d" 1>&6
7957      else
7958        echo "$ac_t""not found ($d: no such directory)" 1>&6
7959      fi
7960
7961      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
7962 echo "configure:7974: checking for GL libs" >&5
7963      d=$with_gl/lib
7964      if test -d $d; then
7965        X_LIBS="-L$d $X_LIBS"
7966        echo "$ac_t""$d" 1>&6
7967      else
7968        echo "$ac_t""not found ($d: no such directory)" 1>&6
7969      fi
7970
7971      # replace the directory string with "yes".
7972      with_gl_req="yes"
7973      with_gl=$with_gl_req
7974      ;;
7975
7976     *)
7977      echo ""
7978      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
7979      echo "       If it is a directory, then \`DIR/include' will be added to"
7980      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7981      exit 1
7982      ;;
7983    esac
7984   
7985
7986 ac_mesagl_version=unknown
7987 ac_mesagl_version_string=unknown
7988
7989 if test "$with_gl" = yes; then
7990   
7991   ac_save_CPPFLAGS="$CPPFLAGS"
7992   if test \! -z "$includedir" ; then 
7993     CPPFLAGS="$CPPFLAGS -I$includedir"
7994   fi
7995   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7996   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
7997 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
7998 echo "configure:8010: checking for GL/gl.h" >&5
7999 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8000   echo $ac_n "(cached) $ac_c" 1>&6
8001 else
8002   cat > conftest.$ac_ext <<EOF
8003 #line 8015 "configure"
8004 #include "confdefs.h"
8005 #include <GL/gl.h>
8006 EOF
8007 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8008 { (eval echo configure:8020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8009 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8010 if test -z "$ac_err"; then
8011   rm -rf conftest*
8012   eval "ac_cv_header_$ac_safe=yes"
8013 else
8014   echo "$ac_err" >&5
8015   echo "configure: failed program was:" >&5
8016   cat conftest.$ac_ext >&5
8017   rm -rf conftest*
8018   eval "ac_cv_header_$ac_safe=no"
8019 fi
8020 rm -f conftest*
8021 fi
8022 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8023   echo "$ac_t""yes" 1>&6
8024   have_gl=yes
8025 else
8026   echo "$ac_t""no" 1>&6
8027 fi
8028
8029   CPPFLAGS="$ac_save_CPPFLAGS"
8030   if test "$have_gl" = yes ; then
8031     
8032   ac_save_CPPFLAGS="$CPPFLAGS"
8033   if test \! -z "$includedir" ; then 
8034     CPPFLAGS="$CPPFLAGS -I$includedir"
8035   fi
8036   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8037   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
8038 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
8039 echo "configure:8051: checking for GL/glx.h" >&5
8040 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8041   echo $ac_n "(cached) $ac_c" 1>&6
8042 else
8043   cat > conftest.$ac_ext <<EOF
8044 #line 8056 "configure"
8045 #include "confdefs.h"
8046 #include <GL/glx.h>
8047 EOF
8048 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8049 { (eval echo configure:8061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8050 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8051 if test -z "$ac_err"; then
8052   rm -rf conftest*
8053   eval "ac_cv_header_$ac_safe=yes"
8054 else
8055   echo "$ac_err" >&5
8056   echo "configure: failed program was:" >&5
8057   cat conftest.$ac_ext >&5
8058   rm -rf conftest*
8059   eval "ac_cv_header_$ac_safe=no"
8060 fi
8061 rm -f conftest*
8062 fi
8063 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8064   echo "$ac_t""yes" 1>&6
8065   have_gl=yes
8066 else
8067   echo "$ac_t""no" 1>&6
8068 fi
8069
8070   CPPFLAGS="$ac_save_CPPFLAGS"
8071   fi
8072
8073   # If we have the headers, try and figure out which vendor it's from.
8074   #
8075   if test "$have_gl" = yes ; then
8076
8077     # We need to know whether it's MesaGL so that we know which libraries
8078     # to link against.
8079     #
8080     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
8081 echo "configure:8093: checking whether GL is really MesaGL" >&5
8082 if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
8083   echo $ac_n "(cached) $ac_c" 1>&6
8084 else
8085   ac_cv_have_mesa_gl=no
8086        
8087   ac_save_CPPFLAGS="$CPPFLAGS"
8088   if test \! -z "$includedir" ; then 
8089     CPPFLAGS="$CPPFLAGS -I$includedir"
8090   fi
8091   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8092   cat > conftest.$ac_ext <<EOF
8093 #line 8105 "configure"
8094 #include "confdefs.h"
8095 #include <GL/glx.h>
8096 EOF
8097 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8098   egrep "Mesa|MESA" >/dev/null 2>&1; then
8099   rm -rf conftest*
8100   ac_cv_have_mesa_gl=yes
8101 fi
8102 rm -f conftest*
8103
8104   CPPFLAGS="$ac_save_CPPFLAGS"
8105       
8106 fi
8107
8108 echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
8109     ac_have_mesa_gl=$ac_cv_have_mesa_gl
8110  
8111
8112     gl_lib_1=""
8113     GL_LIBS=""
8114
8115
8116     # Some versions of MesaGL are compiled to require -lpthread.
8117     # So if the Mesa headers exist, and -lpthread exists, then always
8118     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
8119     #
8120     if test "$ac_have_mesa_gl" = yes; then
8121       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
8122 echo "configure:8134: checking for pthread_create in -lpthread" >&5
8123 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
8124 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8125   echo $ac_n "(cached) $ac_c" 1>&6
8126 else
8127   ac_save_LIBS="$LIBS"
8128 LIBS="-lpthread  $LIBS"
8129 cat > conftest.$ac_ext <<EOF
8130 #line 8142 "configure"
8131 #include "confdefs.h"
8132 /* Override any gcc2 internal prototype to avoid an error.  */
8133 /* We use char because int might match the return type of a gcc2
8134     builtin and then its argument prototype would still apply.  */
8135 char pthread_create();
8136
8137 int main() {
8138 pthread_create()
8139 ; return 0; }
8140 EOF
8141 if { (eval echo configure:8153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8142   rm -rf conftest*
8143   eval "ac_cv_lib_$ac_lib_var=yes"
8144 else
8145   echo "configure: failed program was:" >&5
8146   cat conftest.$ac_ext >&5
8147   rm -rf conftest*
8148   eval "ac_cv_lib_$ac_lib_var=no"
8149 fi
8150 rm -f conftest*
8151 LIBS="$ac_save_LIBS"
8152
8153 fi
8154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8155   echo "$ac_t""yes" 1>&6
8156   GL_LIBS="-lpthread"
8157 else
8158   echo "$ac_t""no" 1>&6
8159 fi
8160
8161     fi
8162
8163
8164     # If we have Mesa headers, check to see if we can link against -lMesaGL.
8165     # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
8166     # Else, warn that GL is busted.  (We have the headers, but no libs.)
8167     #
8168
8169     if test "$ac_have_mesa_gl" = yes ; then
8170       
8171   ac_save_CPPFLAGS="$CPPFLAGS"
8172   ac_save_LDFLAGS="$LDFLAGS"
8173 #  ac_save_LIBS="$LIBS"
8174
8175   if test \! -z "$includedir" ; then 
8176     CPPFLAGS="$CPPFLAGS -I$includedir"
8177   fi
8178   # note: $X_CFLAGS includes $x_includes
8179   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8180
8181   if test \! -z "$libdir" ; then
8182     LDFLAGS="$LDFLAGS -L$libdir"
8183   fi
8184   # note: $X_LIBS includes $x_libraries
8185   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8186
8187   echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
8188 echo "configure:8200: checking for glXCreateContext in -lMesaGL" >&5
8189 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8190 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8191   echo $ac_n "(cached) $ac_c" 1>&6
8192 else
8193   ac_save_LIBS="$LIBS"
8194 LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8195 cat > conftest.$ac_ext <<EOF
8196 #line 8208 "configure"
8197 #include "confdefs.h"
8198 /* Override any gcc2 internal prototype to avoid an error.  */
8199 /* We use char because int might match the return type of a gcc2
8200     builtin and then its argument prototype would still apply.  */
8201 char glXCreateContext();
8202
8203 int main() {
8204 glXCreateContext()
8205 ; return 0; }
8206 EOF
8207 if { (eval echo configure:8219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8208   rm -rf conftest*
8209   eval "ac_cv_lib_$ac_lib_var=yes"
8210 else
8211   echo "configure: failed program was:" >&5
8212   cat conftest.$ac_ext >&5
8213   rm -rf conftest*
8214   eval "ac_cv_lib_$ac_lib_var=no"
8215 fi
8216 rm -f conftest*
8217 LIBS="$ac_save_LIBS"
8218
8219 fi
8220 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8221   echo "$ac_t""yes" 1>&6
8222   gl_lib_1="MesaGL"
8223                       GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
8224 else
8225   echo "$ac_t""no" 1>&6
8226 fi
8227
8228   CPPFLAGS="$ac_save_CPPFLAGS"
8229   LDFLAGS="$ac_save_LDFLAGS"
8230 #  LIBS="$ac_save_LIBS"
8231   
8232     fi
8233
8234     if test "$gl_lib_1" = "" ; then
8235       
8236   ac_save_CPPFLAGS="$CPPFLAGS"
8237   ac_save_LDFLAGS="$LDFLAGS"
8238 #  ac_save_LIBS="$LIBS"
8239
8240   if test \! -z "$includedir" ; then 
8241     CPPFLAGS="$CPPFLAGS -I$includedir"
8242   fi
8243   # note: $X_CFLAGS includes $x_includes
8244   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8245
8246   if test \! -z "$libdir" ; then
8247     LDFLAGS="$LDFLAGS -L$libdir"
8248   fi
8249   # note: $X_LIBS includes $x_libraries
8250   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8251
8252   echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
8253 echo "configure:8265: checking for glXCreateContext in -lGL" >&5
8254 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8255 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8256   echo $ac_n "(cached) $ac_c" 1>&6
8257 else
8258   ac_save_LIBS="$LIBS"
8259 LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8260 cat > conftest.$ac_ext <<EOF
8261 #line 8273 "configure"
8262 #include "confdefs.h"
8263 /* Override any gcc2 internal prototype to avoid an error.  */
8264 /* We use char because int might match the return type of a gcc2
8265     builtin and then its argument prototype would still apply.  */
8266 char glXCreateContext();
8267
8268 int main() {
8269 glXCreateContext()
8270 ; return 0; }
8271 EOF
8272 if { (eval echo configure:8284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8273   rm -rf conftest*
8274   eval "ac_cv_lib_$ac_lib_var=yes"
8275 else
8276   echo "configure: failed program was:" >&5
8277   cat conftest.$ac_ext >&5
8278   rm -rf conftest*
8279   eval "ac_cv_lib_$ac_lib_var=no"
8280 fi
8281 rm -f conftest*
8282 LIBS="$ac_save_LIBS"
8283
8284 fi
8285 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8286   echo "$ac_t""yes" 1>&6
8287   gl_lib_1="GL"
8288                       GL_LIBS="-lGL -lGLU $GL_LIBS"
8289 else
8290   echo "$ac_t""no" 1>&6
8291 fi
8292
8293   CPPFLAGS="$ac_save_CPPFLAGS"
8294   LDFLAGS="$ac_save_LDFLAGS"
8295 #  LIBS="$ac_save_LIBS"
8296   
8297     fi
8298
8299     if test "$gl_lib_1" = "" ; then
8300       # we have headers, but no libs -- bail.
8301       have_gl=no
8302       ac_have_mesa_gl=no
8303       gl_halfassed=yes
8304     else
8305       # linking works -- we can build the GL hacks.
8306       cat >> confdefs.h <<\EOF
8307 #define HAVE_GL 1
8308 EOF
8309
8310       if test "$ac_have_mesa_gl" = yes ; then
8311         cat >> confdefs.h <<\EOF
8312 #define HAVE_MESA_GL 1
8313 EOF
8314
8315       fi
8316     fi
8317   fi
8318
8319
8320   # Now that we know we have GL headers and libs, do some more GL testing.
8321   #
8322
8323   if test "$have_gl" = yes ; then
8324     # If it's MesaGL, we'd like to issue a warning if the version number
8325     # is less than or equal to 2.6, because that version had a security bug.
8326     #
8327     if test "$ac_have_mesa_gl" = yes; then
8328
8329       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
8330 echo "configure:8342: checking MesaGL version number" >&5
8331 if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
8332   echo $ac_n "(cached) $ac_c" 1>&6
8333 else
8334   cat > conftest.$ac_ext <<EOF
8335 #line 8347 "configure"
8336 #include "confdefs.h"
8337 #include <GL/gl.h>
8338 #ifndef MESA_MAJOR_VERSION
8339 # include <GL/xmesa.h>
8340 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
8341 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
8342 #endif
8343 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
8344 EOF
8345
8346          ac_save_CPPFLAGS="$CPPFLAGS"
8347          if test \! -z "$includedir" ; then 
8348            CPPFLAGS="$CPPFLAGS -I$includedir"
8349          fi
8350          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8351
8352           # M4 sucks!!
8353          
8354          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
8355               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
8356          
8357
8358          rm -f conftest.$ac_ext
8359
8360          CPPFLAGS="$ac_save_CPPFLAGS"
8361
8362          if test "$mglv" = ""; then
8363            ac_mesagl_version=unknown
8364            ac_mesagl_version_string=unknown
8365          else
8366            ac_mesagl_version_string=$mglv
8367            maj=`echo $mglv | sed -n 's/\..*//p'`
8368            min=`echo $mglv | sed -n 's/.*\.//p'`
8369            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
8370            if test -z "$ac_mesagl_version"; then
8371              ac_mesagl_version=unknown
8372              ac_mesagl_version_string=unknown
8373            fi
8374          fi
8375          ac_cv_mesagl_version=$ac_mesagl_version
8376          ac_cv_mesagl_version_string=$ac_mesagl_version_string
8377       
8378 fi
8379
8380 echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
8381       ac_mesagl_version=$ac_cv_mesagl_version
8382       ac_mesagl_version_string=$ac_cv_mesagl_version_string
8383     fi
8384
8385
8386     # Check for OpenGL 1.1 features.
8387     #
8388     
8389   ac_save_CPPFLAGS="$CPPFLAGS"
8390   ac_save_LDFLAGS="$LDFLAGS"
8391 #  ac_save_LIBS="$LIBS"
8392
8393   if test \! -z "$includedir" ; then 
8394     CPPFLAGS="$CPPFLAGS -I$includedir"
8395   fi
8396   # note: $X_CFLAGS includes $x_includes
8397   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8398
8399   if test \! -z "$libdir" ; then
8400     LDFLAGS="$LDFLAGS -L$libdir"
8401   fi
8402   # note: $X_LIBS includes $x_libraries
8403   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8404
8405   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
8406 echo "configure:8418: checking for glBindTexture in -l$gl_lib_1" >&5
8407 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
8408 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8409   echo $ac_n "(cached) $ac_c" 1>&6
8410 else
8411   ac_save_LIBS="$LIBS"
8412 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
8413 cat > conftest.$ac_ext <<EOF
8414 #line 8426 "configure"
8415 #include "confdefs.h"
8416 /* Override any gcc2 internal prototype to avoid an error.  */
8417 /* We use char because int might match the return type of a gcc2
8418     builtin and then its argument prototype would still apply.  */
8419 char glBindTexture();
8420
8421 int main() {
8422 glBindTexture()
8423 ; return 0; }
8424 EOF
8425 if { (eval echo configure:8437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8426   rm -rf conftest*
8427   eval "ac_cv_lib_$ac_lib_var=yes"
8428 else
8429   echo "configure: failed program was:" >&5
8430   cat conftest.$ac_ext >&5
8431   rm -rf conftest*
8432   eval "ac_cv_lib_$ac_lib_var=no"
8433 fi
8434 rm -f conftest*
8435 LIBS="$ac_save_LIBS"
8436
8437 fi
8438 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8439   echo "$ac_t""yes" 1>&6
8440   cat >> confdefs.h <<\EOF
8441 #define HAVE_GLBINDTEXTURE 1
8442 EOF
8443
8444 else
8445   echo "$ac_t""no" 1>&6
8446 true
8447 fi
8448
8449   CPPFLAGS="$ac_save_CPPFLAGS"
8450   LDFLAGS="$ac_save_LDFLAGS"
8451 #  LIBS="$ac_save_LIBS"
8452   
8453   fi
8454
8455 elif test "$with_gl" != no; then
8456   echo "error: must be yes or no: --with-gl=$with_gl"
8457   exit 1
8458 fi
8459
8460
8461 ###############################################################################
8462 #
8463 #       Check for -lgle.
8464 #
8465 ###############################################################################
8466
8467 have_gle=no
8468 with_gle_req=unspecified
8469 gle_halfassed=no
8470 # Check whether --with-gle or --without-gle was given.
8471 if test "${with_gle+set}" = set; then
8472   withval="$with_gle"
8473   with_gle="$withval"; with_gle_req="$withval"
8474 else
8475   with_gle=yes
8476 fi
8477
8478
8479
8480    case "$with_gle" in
8481     yes) ;;
8482     no)  ;;
8483
8484     /*)
8485      echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
8486 echo "configure:8498: checking for GLE headers" >&5
8487      d=$with_gle/include
8488      if test -d $d; then
8489        X_CFLAGS="-I$d $X_CFLAGS"
8490        echo "$ac_t""$d" 1>&6
8491      else
8492        echo "$ac_t""not found ($d: no such directory)" 1>&6
8493      fi
8494
8495      echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
8496 echo "configure:8508: checking for GLE libs" >&5
8497      d=$with_gle/lib
8498      if test -d $d; then
8499        X_LIBS="-L$d $X_LIBS"
8500        echo "$ac_t""$d" 1>&6
8501      else
8502        echo "$ac_t""not found ($d: no such directory)" 1>&6
8503      fi
8504
8505      # replace the directory string with "yes".
8506      with_gle_req="yes"
8507      with_gle=$with_gle_req
8508      ;;
8509
8510     *)
8511      echo ""
8512      echo "error: argument to --with-gle must be \"yes\", \"no\", or a directory."
8513      echo "       If it is a directory, then \`DIR/include' will be added to"
8514      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8515      exit 1
8516      ;;
8517    esac
8518   
8519
8520 GLE_LIBS=""
8521
8522 if test "$with_gle" = yes; then
8523
8524   
8525   ac_save_CPPFLAGS="$CPPFLAGS"
8526   if test \! -z "$includedir" ; then 
8527     CPPFLAGS="$CPPFLAGS -I$includedir"
8528   fi
8529   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8530   ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
8531 echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
8532 echo "configure:8544: checking for GL/gle.h" >&5
8533 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8534   echo $ac_n "(cached) $ac_c" 1>&6
8535 else
8536   cat > conftest.$ac_ext <<EOF
8537 #line 8549 "configure"
8538 #include "confdefs.h"
8539 #include <GL/gle.h>
8540 EOF
8541 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8542 { (eval echo configure:8554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8543 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8544 if test -z "$ac_err"; then
8545   rm -rf conftest*
8546   eval "ac_cv_header_$ac_safe=yes"
8547 else
8548   echo "$ac_err" >&5
8549   echo "configure: failed program was:" >&5
8550   cat conftest.$ac_ext >&5
8551   rm -rf conftest*
8552   eval "ac_cv_header_$ac_safe=no"
8553 fi
8554 rm -f conftest*
8555 fi
8556 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8557   echo "$ac_t""yes" 1>&6
8558   have_gle3=yes
8559 else
8560   echo "$ac_t""no" 1>&6
8561 fi
8562
8563   CPPFLAGS="$ac_save_CPPFLAGS"
8564   if test "$have_gle3" = yes ; then
8565     have_gle=yes;
8566   else
8567     
8568   ac_save_CPPFLAGS="$CPPFLAGS"
8569   if test \! -z "$includedir" ; then 
8570     CPPFLAGS="$CPPFLAGS -I$includedir"
8571   fi
8572   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8573   ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
8574 echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
8575 echo "configure:8587: checking for GL/gutil.h" >&5
8576 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8577   echo $ac_n "(cached) $ac_c" 1>&6
8578 else
8579   cat > conftest.$ac_ext <<EOF
8580 #line 8592 "configure"
8581 #include "confdefs.h"
8582 #include <GL/gutil.h>
8583 EOF
8584 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8585 { (eval echo configure:8597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8586 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8587 if test -z "$ac_err"; then
8588   rm -rf conftest*
8589   eval "ac_cv_header_$ac_safe=yes"
8590 else
8591   echo "$ac_err" >&5
8592   echo "configure: failed program was:" >&5
8593   cat conftest.$ac_ext >&5
8594   rm -rf conftest*
8595   eval "ac_cv_header_$ac_safe=no"
8596 fi
8597 rm -f conftest*
8598 fi
8599 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8600   echo "$ac_t""yes" 1>&6
8601   have_gle=yes
8602 else
8603   echo "$ac_t""no" 1>&6
8604 fi
8605
8606   CPPFLAGS="$ac_save_CPPFLAGS"
8607     if test "$have_gle" = yes ; then
8608       
8609   ac_save_CPPFLAGS="$CPPFLAGS"
8610   if test \! -z "$includedir" ; then 
8611     CPPFLAGS="$CPPFLAGS -I$includedir"
8612   fi
8613   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8614   ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
8615 echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
8616 echo "configure:8628: checking for GL/tube.h" >&5
8617 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8618   echo $ac_n "(cached) $ac_c" 1>&6
8619 else
8620   cat > conftest.$ac_ext <<EOF
8621 #line 8633 "configure"
8622 #include "confdefs.h"
8623 #include <GL/tube.h>
8624 EOF
8625 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8626 { (eval echo configure:8638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8627 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8628 if test -z "$ac_err"; then
8629   rm -rf conftest*
8630   eval "ac_cv_header_$ac_safe=yes"
8631 else
8632   echo "$ac_err" >&5
8633   echo "configure: failed program was:" >&5
8634   cat conftest.$ac_ext >&5
8635   rm -rf conftest*
8636   eval "ac_cv_header_$ac_safe=no"
8637 fi
8638 rm -f conftest*
8639 fi
8640 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8641   echo "$ac_t""yes" 1>&6
8642   have_gle=yes
8643 else
8644   echo "$ac_t""no" 1>&6
8645 fi
8646
8647   CPPFLAGS="$ac_save_CPPFLAGS"
8648     fi
8649   fi
8650
8651   if test "$have_gle" = yes ; then
8652     have_gle=no
8653     gle_halfassed=yes
8654     
8655   ac_save_CPPFLAGS="$CPPFLAGS"
8656   ac_save_LDFLAGS="$LDFLAGS"
8657 #  ac_save_LIBS="$LIBS"
8658
8659   if test \! -z "$includedir" ; then 
8660     CPPFLAGS="$CPPFLAGS -I$includedir"
8661   fi
8662   # note: $X_CFLAGS includes $x_includes
8663   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8664
8665   if test \! -z "$libdir" ; then
8666     LDFLAGS="$LDFLAGS -L$libdir"
8667   fi
8668   # note: $X_LIBS includes $x_libraries
8669   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8670
8671   echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
8672 echo "configure:8684: checking for gleCreateGC in -lgle" >&5
8673 ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
8674 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8675   echo $ac_n "(cached) $ac_c" 1>&6
8676 else
8677   ac_save_LIBS="$LIBS"
8678 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
8679 cat > conftest.$ac_ext <<EOF
8680 #line 8692 "configure"
8681 #include "confdefs.h"
8682 /* Override any gcc2 internal prototype to avoid an error.  */
8683 /* We use char because int might match the return type of a gcc2
8684     builtin and then its argument prototype would still apply.  */
8685 char gleCreateGC();
8686
8687 int main() {
8688 gleCreateGC()
8689 ; return 0; }
8690 EOF
8691 if { (eval echo configure:8703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8692   rm -rf conftest*
8693   eval "ac_cv_lib_$ac_lib_var=yes"
8694 else
8695   echo "configure: failed program was:" >&5
8696   cat conftest.$ac_ext >&5
8697   rm -rf conftest*
8698   eval "ac_cv_lib_$ac_lib_var=no"
8699 fi
8700 rm -f conftest*
8701 LIBS="$ac_save_LIBS"
8702
8703 fi
8704 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8705   echo "$ac_t""yes" 1>&6
8706   have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
8707 else
8708   echo "$ac_t""no" 1>&6
8709 fi
8710
8711   CPPFLAGS="$ac_save_CPPFLAGS"
8712   LDFLAGS="$ac_save_LDFLAGS"
8713 #  LIBS="$ac_save_LIBS"
8714   
8715   fi
8716   if test "$have_gle" = yes ; then
8717     have_gle=no
8718     gle_halfassed=yes
8719
8720     # sometimes the libmatrix stuff is included in libgle.  look there first.
8721 #
8722 # I don't get it.  For some reason, this test passes on SGI, as if
8723 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
8724 # Yet the link is succeeding.  Why???
8725 #
8726 #    AC_CHECK_X_LIB(gle, uview_direction_d, 
8727 #                   [have_gle=yes; gle_halfassed=no],
8728 #                   [], $GL_LIBS -lX11 -lXext -lm)
8729
8730     # As of GLE 3 this is in libgle, and has changed name to uview_direction!
8731     # *sigh*
8732     if test "$have_gle3" = yes ; then
8733       
8734   ac_save_CPPFLAGS="$CPPFLAGS"
8735   ac_save_LDFLAGS="$LDFLAGS"
8736 #  ac_save_LIBS="$LIBS"
8737
8738   if test \! -z "$includedir" ; then 
8739     CPPFLAGS="$CPPFLAGS -I$includedir"
8740   fi
8741   # note: $X_CFLAGS includes $x_includes
8742   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8743
8744   if test \! -z "$libdir" ; then
8745     LDFLAGS="$LDFLAGS -L$libdir"
8746   fi
8747   # note: $X_LIBS includes $x_libraries
8748   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8749
8750   echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
8751 echo "configure:8763: checking for uview_direction in -lgle" >&5
8752 ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
8753 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8754   echo $ac_n "(cached) $ac_c" 1>&6
8755 else
8756   ac_save_LIBS="$LIBS"
8757 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
8758 cat > conftest.$ac_ext <<EOF
8759 #line 8771 "configure"
8760 #include "confdefs.h"
8761 /* Override any gcc2 internal prototype to avoid an error.  */
8762 /* We use char because int might match the return type of a gcc2
8763     builtin and then its argument prototype would still apply.  */
8764 char uview_direction();
8765
8766 int main() {
8767 uview_direction()
8768 ; return 0; }
8769 EOF
8770 if { (eval echo configure:8782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8771   rm -rf conftest*
8772   eval "ac_cv_lib_$ac_lib_var=yes"
8773 else
8774   echo "configure: failed program was:" >&5
8775   cat conftest.$ac_ext >&5
8776   rm -rf conftest*
8777   eval "ac_cv_lib_$ac_lib_var=no"
8778 fi
8779 rm -f conftest*
8780 LIBS="$ac_save_LIBS"
8781
8782 fi
8783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8784   echo "$ac_t""yes" 1>&6
8785   have_gle=yes; gle_halfassed=no
8786 else
8787   echo "$ac_t""no" 1>&6
8788 fi
8789
8790   CPPFLAGS="$ac_save_CPPFLAGS"
8791   LDFLAGS="$ac_save_LDFLAGS"
8792 #  LIBS="$ac_save_LIBS"
8793   
8794     fi
8795     # if it wasn't in libgle, then look in libmatrix.
8796     if test "$have_gle" = no ; then
8797       
8798   ac_save_CPPFLAGS="$CPPFLAGS"
8799   ac_save_LDFLAGS="$LDFLAGS"
8800 #  ac_save_LIBS="$LIBS"
8801
8802   if test \! -z "$includedir" ; then 
8803     CPPFLAGS="$CPPFLAGS -I$includedir"
8804   fi
8805   # note: $X_CFLAGS includes $x_includes
8806   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8807
8808   if test \! -z "$libdir" ; then
8809     LDFLAGS="$LDFLAGS -L$libdir"
8810   fi
8811   # note: $X_LIBS includes $x_libraries
8812   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8813
8814   echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
8815 echo "configure:8827: checking for uview_direction_d in -lmatrix" >&5
8816 ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
8817 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8818   echo $ac_n "(cached) $ac_c" 1>&6
8819 else
8820   ac_save_LIBS="$LIBS"
8821 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
8822 cat > conftest.$ac_ext <<EOF
8823 #line 8835 "configure"
8824 #include "confdefs.h"
8825 /* Override any gcc2 internal prototype to avoid an error.  */
8826 /* We use char because int might match the return type of a gcc2
8827     builtin and then its argument prototype would still apply.  */
8828 char uview_direction_d();
8829
8830 int main() {
8831 uview_direction_d()
8832 ; return 0; }
8833 EOF
8834 if { (eval echo configure:8846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8835   rm -rf conftest*
8836   eval "ac_cv_lib_$ac_lib_var=yes"
8837 else
8838   echo "configure: failed program was:" >&5
8839   cat conftest.$ac_ext >&5
8840   rm -rf conftest*
8841   eval "ac_cv_lib_$ac_lib_var=no"
8842 fi
8843 rm -f conftest*
8844 LIBS="$ac_save_LIBS"
8845
8846 fi
8847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8848   echo "$ac_t""yes" 1>&6
8849   have_gle=yes; gle_halfassed=no;
8850                       GLE_LIBS="$GLE_LIBS -lmatrix"
8851 else
8852   echo "$ac_t""no" 1>&6
8853 fi
8854
8855   CPPFLAGS="$ac_save_CPPFLAGS"
8856   LDFLAGS="$ac_save_LDFLAGS"
8857 #  LIBS="$ac_save_LIBS"
8858   
8859     fi
8860   fi
8861
8862   if test "$have_gle" = yes ; then
8863     cat >> confdefs.h <<\EOF
8864 #define HAVE_GLE 1
8865 EOF
8866
8867     if test "$have_gle3" = yes ; then
8868       cat >> confdefs.h <<\EOF
8869 #define HAVE_GLE3 1
8870 EOF
8871
8872     fi
8873   fi
8874
8875 elif test "$with_gle" != no; then
8876   echo "error: must be yes or no: --with-gle=$with_gle"
8877   exit 1
8878
8879 fi
8880
8881
8882
8883 ###############################################################################
8884 #
8885 #       Check for -lXpm.
8886 #
8887 ###############################################################################
8888
8889 have_xpm=no
8890 with_xpm_req=unspecified
8891 # Check whether --with-xpm or --without-xpm was given.
8892 if test "${with_xpm+set}" = set; then
8893   withval="$with_xpm"
8894   with_xpm="$withval"; with_xpm_req="$withval"
8895 else
8896   with_xpm=yes
8897 fi
8898
8899
8900
8901    case "$with_xpm" in
8902     yes) ;;
8903     no)  ;;
8904
8905     /*)
8906      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
8907 echo "configure:8919: checking for XPM headers" >&5
8908      d=$with_xpm/include
8909      if test -d $d; then
8910        X_CFLAGS="-I$d $X_CFLAGS"
8911        echo "$ac_t""$d" 1>&6
8912      else
8913        echo "$ac_t""not found ($d: no such directory)" 1>&6
8914      fi
8915
8916      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
8917 echo "configure:8929: checking for XPM libs" >&5
8918      d=$with_xpm/lib
8919      if test -d $d; then
8920        X_LIBS="-L$d $X_LIBS"
8921        echo "$ac_t""$d" 1>&6
8922      else
8923        echo "$ac_t""not found ($d: no such directory)" 1>&6
8924      fi
8925
8926      # replace the directory string with "yes".
8927      with_xpm_req="yes"
8928      with_xpm=$with_xpm_req
8929      ;;
8930
8931     *)
8932      echo ""
8933      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
8934      echo "       If it is a directory, then \`DIR/include' will be added to"
8935      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8936      exit 1
8937      ;;
8938    esac
8939   
8940
8941 if test "$with_xpm" = yes; then
8942   
8943   ac_save_CPPFLAGS="$CPPFLAGS"
8944   if test \! -z "$includedir" ; then 
8945     CPPFLAGS="$CPPFLAGS -I$includedir"
8946   fi
8947   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8948   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
8949 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
8950 echo "configure:8962: checking for X11/xpm.h" >&5
8951 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8952   echo $ac_n "(cached) $ac_c" 1>&6
8953 else
8954   cat > conftest.$ac_ext <<EOF
8955 #line 8967 "configure"
8956 #include "confdefs.h"
8957 #include <X11/xpm.h>
8958 EOF
8959 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8960 { (eval echo configure:8972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8961 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8962 if test -z "$ac_err"; then
8963   rm -rf conftest*
8964   eval "ac_cv_header_$ac_safe=yes"
8965 else
8966   echo "$ac_err" >&5
8967   echo "configure: failed program was:" >&5
8968   cat conftest.$ac_ext >&5
8969   rm -rf conftest*
8970   eval "ac_cv_header_$ac_safe=no"
8971 fi
8972 rm -f conftest*
8973 fi
8974 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8975   echo "$ac_t""yes" 1>&6
8976   have_xpm=yes
8977                     cat >> confdefs.h <<\EOF
8978 #define HAVE_XPM 1
8979 EOF
8980
8981                     XPM_LIBS="-lXpm"
8982 else
8983   echo "$ac_t""no" 1>&6
8984 fi
8985
8986   CPPFLAGS="$ac_save_CPPFLAGS"
8987 elif test "$with_xpm" != no; then
8988   echo "error: must be yes or no: --with-xpm=$with_xpm"
8989   exit 1
8990 fi
8991
8992 # See comment near $motif_requires_xpm, above.
8993 # Need to do this here, after both Motif and XPM have been checked for.
8994 #
8995 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
8996   if test "$motif_requires_xpm" = yes ; then
8997     MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
8998   fi
8999 fi
9000
9001
9002 ###############################################################################
9003 #
9004 #       Check for the XSHM server extension.
9005 #
9006 ###############################################################################
9007
9008 have_xshm=no
9009 with_xshm_req=unspecified
9010 # Check whether --with-xshm-ext or --without-xshm-ext was given.
9011 if test "${with_xshm_ext+set}" = set; then
9012   withval="$with_xshm_ext"
9013   with_xshm="$withval"; with_xshm_req="$withval"
9014 else
9015   with_xshm=yes
9016 fi
9017
9018
9019
9020    case "$with_xshm" in
9021     yes) ;;
9022     no)  ;;
9023
9024     /*)
9025      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
9026 echo "configure:9038: checking for XSHM headers" >&5
9027      d=$with_xshm/include
9028      if test -d $d; then
9029        X_CFLAGS="-I$d $X_CFLAGS"
9030        echo "$ac_t""$d" 1>&6
9031      else
9032        echo "$ac_t""not found ($d: no such directory)" 1>&6
9033      fi
9034
9035      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
9036 echo "configure:9048: checking for XSHM libs" >&5
9037      d=$with_xshm/lib
9038      if test -d $d; then
9039        X_LIBS="-L$d $X_LIBS"
9040        echo "$ac_t""$d" 1>&6
9041      else
9042        echo "$ac_t""not found ($d: no such directory)" 1>&6
9043      fi
9044
9045      # replace the directory string with "yes".
9046      with_xshm_req="yes"
9047      with_xshm=$with_xshm_req
9048      ;;
9049
9050     *)
9051      echo ""
9052      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
9053      echo "       If it is a directory, then \`DIR/include' will be added to"
9054      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9055      exit 1
9056      ;;
9057    esac
9058   
9059
9060 if test "$with_xshm" = yes; then
9061
9062   # first check for Xshm.h.
9063   
9064   ac_save_CPPFLAGS="$CPPFLAGS"
9065   if test \! -z "$includedir" ; then 
9066     CPPFLAGS="$CPPFLAGS -I$includedir"
9067   fi
9068   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9069   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
9070 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
9071 echo "configure:9083: checking for X11/extensions/XShm.h" >&5
9072 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9073   echo $ac_n "(cached) $ac_c" 1>&6
9074 else
9075   cat > conftest.$ac_ext <<EOF
9076 #line 9088 "configure"
9077 #include "confdefs.h"
9078 #include <X11/extensions/XShm.h>
9079 EOF
9080 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9081 { (eval echo configure:9093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9082 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9083 if test -z "$ac_err"; then
9084   rm -rf conftest*
9085   eval "ac_cv_header_$ac_safe=yes"
9086 else
9087   echo "$ac_err" >&5
9088   echo "configure: failed program was:" >&5
9089   cat conftest.$ac_ext >&5
9090   rm -rf conftest*
9091   eval "ac_cv_header_$ac_safe=no"
9092 fi
9093 rm -f conftest*
9094 fi
9095 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9096   echo "$ac_t""yes" 1>&6
9097   have_xshm=yes
9098 else
9099   echo "$ac_t""no" 1>&6
9100 fi
9101
9102   CPPFLAGS="$ac_save_CPPFLAGS"
9103
9104   # if that succeeded, then check for sys/ipc.h.
9105   if test "$have_xshm" = yes; then
9106     have_xshm=no
9107     
9108   ac_save_CPPFLAGS="$CPPFLAGS"
9109   if test \! -z "$includedir" ; then 
9110     CPPFLAGS="$CPPFLAGS -I$includedir"
9111   fi
9112   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9113   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
9114 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
9115 echo "configure:9127: checking for sys/ipc.h" >&5
9116 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9117   echo $ac_n "(cached) $ac_c" 1>&6
9118 else
9119   cat > conftest.$ac_ext <<EOF
9120 #line 9132 "configure"
9121 #include "confdefs.h"
9122 #include <sys/ipc.h>
9123 EOF
9124 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9125 { (eval echo configure:9137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9126 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9127 if test -z "$ac_err"; then
9128   rm -rf conftest*
9129   eval "ac_cv_header_$ac_safe=yes"
9130 else
9131   echo "$ac_err" >&5
9132   echo "configure: failed program was:" >&5
9133   cat conftest.$ac_ext >&5
9134   rm -rf conftest*
9135   eval "ac_cv_header_$ac_safe=no"
9136 fi
9137 rm -f conftest*
9138 fi
9139 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9140   echo "$ac_t""yes" 1>&6
9141   have_xshm=yes
9142 else
9143   echo "$ac_t""no" 1>&6
9144 fi
9145
9146   CPPFLAGS="$ac_save_CPPFLAGS"
9147   fi
9148
9149   # if that succeeded, then check for sys/shm.h.
9150   if test "$have_xshm" = yes; then
9151     have_xshm=no
9152     
9153   ac_save_CPPFLAGS="$CPPFLAGS"
9154   if test \! -z "$includedir" ; then 
9155     CPPFLAGS="$CPPFLAGS -I$includedir"
9156   fi
9157   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9158   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
9159 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
9160 echo "configure:9172: checking for sys/shm.h" >&5
9161 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9162   echo $ac_n "(cached) $ac_c" 1>&6
9163 else
9164   cat > conftest.$ac_ext <<EOF
9165 #line 9177 "configure"
9166 #include "confdefs.h"
9167 #include <sys/shm.h>
9168 EOF
9169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9170 { (eval echo configure:9182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9172 if test -z "$ac_err"; then
9173   rm -rf conftest*
9174   eval "ac_cv_header_$ac_safe=yes"
9175 else
9176   echo "$ac_err" >&5
9177   echo "configure: failed program was:" >&5
9178   cat conftest.$ac_ext >&5
9179   rm -rf conftest*
9180   eval "ac_cv_header_$ac_safe=no"
9181 fi
9182 rm -f conftest*
9183 fi
9184 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9185   echo "$ac_t""yes" 1>&6
9186   have_xshm=yes
9187 else
9188   echo "$ac_t""no" 1>&6
9189 fi
9190
9191   CPPFLAGS="$ac_save_CPPFLAGS"
9192   fi
9193
9194   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
9195   # to exist, but the library code to not exist.  And even better, the library
9196   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
9197   # lib doesn't exist, give up.  (This lib gets added to X_EXTRA_LIBS, and
9198   # that's not quite right, but close enough.)
9199   #
9200   case "$host" in
9201     *-aix*)
9202       if  `uname -v` -eq 3 ; then
9203         have_xshm=no
9204         
9205   ac_save_CPPFLAGS="$CPPFLAGS"
9206   ac_save_LDFLAGS="$LDFLAGS"
9207 #  ac_save_LIBS="$LIBS"
9208
9209   if test \! -z "$includedir" ; then 
9210     CPPFLAGS="$CPPFLAGS -I$includedir"
9211   fi
9212   # note: $X_CFLAGS includes $x_includes
9213   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9214
9215   if test \! -z "$libdir" ; then
9216     LDFLAGS="$LDFLAGS -L$libdir"
9217   fi
9218   # note: $X_LIBS includes $x_libraries
9219   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9220
9221   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
9222 echo "configure:9234: checking for XShmQueryExtension in -lXextSam" >&5
9223 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
9224 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9225   echo $ac_n "(cached) $ac_c" 1>&6
9226 else
9227   ac_save_LIBS="$LIBS"
9228 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
9229 cat > conftest.$ac_ext <<EOF
9230 #line 9242 "configure"
9231 #include "confdefs.h"
9232 /* Override any gcc2 internal prototype to avoid an error.  */
9233 /* We use char because int might match the return type of a gcc2
9234     builtin and then its argument prototype would still apply.  */
9235 char XShmQueryExtension();
9236
9237 int main() {
9238 XShmQueryExtension()
9239 ; return 0; }
9240 EOF
9241 if { (eval echo configure:9253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9242   rm -rf conftest*
9243   eval "ac_cv_lib_$ac_lib_var=yes"
9244 else
9245   echo "configure: failed program was:" >&5
9246   cat conftest.$ac_ext >&5
9247   rm -rf conftest*
9248   eval "ac_cv_lib_$ac_lib_var=no"
9249 fi
9250 rm -f conftest*
9251 LIBS="$ac_save_LIBS"
9252
9253 fi
9254 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9255   echo "$ac_t""yes" 1>&6
9256   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
9257 else
9258   echo "$ac_t""no" 1>&6
9259 true
9260 fi
9261
9262   CPPFLAGS="$ac_save_CPPFLAGS"
9263   LDFLAGS="$ac_save_LDFLAGS"
9264 #  LIBS="$ac_save_LIBS"
9265   
9266       fi
9267     ;;
9268   esac
9269
9270   # if that succeeded, then we've really got it.
9271   if test "$have_xshm" = yes; then
9272     cat >> confdefs.h <<\EOF
9273 #define HAVE_XSHM_EXTENSION 1
9274 EOF
9275
9276   fi
9277
9278 elif test "$with_xshm" != no; then
9279   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
9280   exit 1
9281 fi
9282
9283
9284 ###############################################################################
9285 #
9286 #       Check for the DOUBLE-BUFFER server extension.
9287 #
9288 ###############################################################################
9289
9290 have_xdbe=no
9291 with_xdbe_req=unspecified
9292 # Check whether --with-xdbe-ext or --without-xdbe-ext was given.
9293 if test "${with_xdbe_ext+set}" = set; then
9294   withval="$with_xdbe_ext"
9295   with_xdbe="$withval"; with_xdbe_req="$withval"
9296 else
9297   with_xdbe=yes
9298 fi
9299
9300
9301
9302    case "$with_xdbe" in
9303     yes) ;;
9304     no)  ;;
9305
9306     /*)
9307      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
9308 echo "configure:9320: checking for DOUBLE-BUFFER headers" >&5
9309      d=$with_xdbe/include
9310      if test -d $d; then
9311        X_CFLAGS="-I$d $X_CFLAGS"
9312        echo "$ac_t""$d" 1>&6
9313      else
9314        echo "$ac_t""not found ($d: no such directory)" 1>&6
9315      fi
9316
9317      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
9318 echo "configure:9330: checking for DOUBLE-BUFFER libs" >&5
9319      d=$with_xdbe/lib
9320      if test -d $d; then
9321        X_LIBS="-L$d $X_LIBS"
9322        echo "$ac_t""$d" 1>&6
9323      else
9324        echo "$ac_t""not found ($d: no such directory)" 1>&6
9325      fi
9326
9327      # replace the directory string with "yes".
9328      with_xdbe_req="yes"
9329      with_xdbe=$with_xdbe_req
9330      ;;
9331
9332     *)
9333      echo ""
9334      echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
9335      echo "       If it is a directory, then \`DIR/include' will be added to"
9336      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9337      exit 1
9338      ;;
9339    esac
9340   
9341
9342 if test "$with_xdbe" = yes; then
9343
9344   
9345   ac_save_CPPFLAGS="$CPPFLAGS"
9346   if test \! -z "$includedir" ; then 
9347     CPPFLAGS="$CPPFLAGS -I$includedir"
9348   fi
9349   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9350   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
9351 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
9352 echo "configure:9364: checking for X11/extensions/Xdbe.h" >&5
9353 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9354   echo $ac_n "(cached) $ac_c" 1>&6
9355 else
9356   cat > conftest.$ac_ext <<EOF
9357 #line 9369 "configure"
9358 #include "confdefs.h"
9359 #include <X11/extensions/Xdbe.h>
9360 EOF
9361 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9362 { (eval echo configure:9374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9363 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9364 if test -z "$ac_err"; then
9365   rm -rf conftest*
9366   eval "ac_cv_header_$ac_safe=yes"
9367 else
9368   echo "$ac_err" >&5
9369   echo "configure: failed program was:" >&5
9370   cat conftest.$ac_ext >&5
9371   rm -rf conftest*
9372   eval "ac_cv_header_$ac_safe=no"
9373 fi
9374 rm -f conftest*
9375 fi
9376 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9377   echo "$ac_t""yes" 1>&6
9378   have_xdbe=yes
9379 else
9380   echo "$ac_t""no" 1>&6
9381 fi
9382
9383   CPPFLAGS="$ac_save_CPPFLAGS"
9384   if test "$have_xdbe" = yes; then
9385     cat >> confdefs.h <<\EOF
9386 #define HAVE_DOUBLE_BUFFER_EXTENSION 1
9387 EOF
9388     
9389   fi
9390
9391 elif test "$with_xdbe" != no; then
9392   echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
9393   exit 1
9394 fi
9395
9396
9397 ###############################################################################
9398 #
9399 #       Check for the SGI XReadDisplay server extension.
9400 #
9401 #       Note: this has to be down here, rather than up with the other server
9402 #       extension tests, so that the output of `configure --help' is in the
9403 #       right order.  Arrgh!
9404 #
9405 ###############################################################################
9406
9407 have_readdisplay=no
9408 with_readdisplay_req=unspecified
9409 # Check whether --with-readdisplay or --without-readdisplay was given.
9410 if test "${with_readdisplay+set}" = set; then
9411   withval="$with_readdisplay"
9412   with_readdisplay="$withval"; with_readdisplay_req="$withval"
9413 else
9414   with_readdisplay=yes
9415 fi
9416
9417
9418
9419    case "$with_readdisplay" in
9420     yes) ;;
9421     no)  ;;
9422
9423     /*)
9424      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
9425 echo "configure:9437: checking for XReadDisplay headers" >&5
9426      d=$with_readdisplay/include
9427      if test -d $d; then
9428        X_CFLAGS="-I$d $X_CFLAGS"
9429        echo "$ac_t""$d" 1>&6
9430      else
9431        echo "$ac_t""not found ($d: no such directory)" 1>&6
9432      fi
9433
9434      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
9435 echo "configure:9447: checking for XReadDisplay libs" >&5
9436      d=$with_readdisplay/lib
9437      if test -d $d; then
9438        X_LIBS="-L$d $X_LIBS"
9439        echo "$ac_t""$d" 1>&6
9440      else
9441        echo "$ac_t""not found ($d: no such directory)" 1>&6
9442      fi
9443
9444      # replace the directory string with "yes".
9445      with_readdisplay_req="yes"
9446      with_readdisplay=$with_readdisplay_req
9447      ;;
9448
9449     *)
9450      echo ""
9451      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
9452      echo "       If it is a directory, then \`DIR/include' will be added to"
9453      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9454      exit 1
9455      ;;
9456    esac
9457   
9458
9459 if test "$with_readdisplay" = yes; then
9460   
9461   ac_save_CPPFLAGS="$CPPFLAGS"
9462   if test \! -z "$includedir" ; then 
9463     CPPFLAGS="$CPPFLAGS -I$includedir"
9464   fi
9465   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9466   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
9467 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
9468 echo "configure:9480: checking for X11/extensions/readdisplay.h" >&5
9469 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9470   echo $ac_n "(cached) $ac_c" 1>&6
9471 else
9472   cat > conftest.$ac_ext <<EOF
9473 #line 9485 "configure"
9474 #include "confdefs.h"
9475 #include <X11/extensions/readdisplay.h>
9476 EOF
9477 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9478 { (eval echo configure:9490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9479 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9480 if test -z "$ac_err"; then
9481   rm -rf conftest*
9482   eval "ac_cv_header_$ac_safe=yes"
9483 else
9484   echo "$ac_err" >&5
9485   echo "configure: failed program was:" >&5
9486   cat conftest.$ac_ext >&5
9487   rm -rf conftest*
9488   eval "ac_cv_header_$ac_safe=no"
9489 fi
9490 rm -f conftest*
9491 fi
9492 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9493   echo "$ac_t""yes" 1>&6
9494   cat >> confdefs.h <<\EOF
9495 #define HAVE_READ_DISPLAY_EXTENSION 1
9496 EOF
9497
9498 else
9499   echo "$ac_t""no" 1>&6
9500 fi
9501
9502   CPPFLAGS="$ac_save_CPPFLAGS"
9503 elif test "$with_readdisplay" != no; then
9504   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
9505   exit 1
9506 fi
9507
9508
9509 ###############################################################################
9510 #
9511 #       Check for a program to generate random text.
9512 #
9513 #       Zippy is funnier than the idiocy generally spat out by `fortune',
9514 #       so first see if "fortune zippy" works.  Else, use plain "fortune".
9515 #
9516 #       We used to dig around in Emacs to look for the "yow" program, but
9517 #       most people who have Emacs also have "fortune zippy", so nevermind.
9518 #
9519 ###############################################################################
9520
9521 with_fortune_req=""
9522 # Check whether --with-fortune or --without-fortune was given.
9523 if test "${with_fortune+set}" = set; then
9524   withval="$with_fortune"
9525   with_fortune_req="$withval"; with_fortune="$withval"
9526 else
9527   with_fortune=yes
9528 fi
9529
9530
9531 if test "$with_fortune" = no || test "$with_fortune" = yes ; then
9532   with_fortune=""
9533   with_fortune_req=""
9534 fi
9535
9536 if test -n "$with_fortune_req" ; then
9537   ac_cv_fortune_program=""
9538   case "$with_fortune_req" in
9539     /*)
9540
9541       set dummy $with_fortune_req ; fortune_tmp=$2
9542       echo $ac_n "checking for $fortune_tmp""... $ac_c" 1>&6
9543 echo "configure:9555: checking for $fortune_tmp" >&5
9544       if test -x "$fortune_tmp" ; then
9545         echo "$ac_t""yes" 1>&6
9546       else
9547         echo "$ac_t""no" 1>&6
9548         with_fortune=""
9549       fi
9550     ;;
9551     *)
9552       set dummy $with_fortune_req ; fortune_tmp=$2
9553       # don't cache
9554       unset ac_cv_path_fortune_tmp
9555       # Extract the first word of "$fortune_tmp", so it can be a program name with args.
9556 set dummy $fortune_tmp; ac_word=$2
9557 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9558 echo "configure:9570: checking for $ac_word" >&5
9559 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
9560   echo $ac_n "(cached) $ac_c" 1>&6
9561 else
9562   case "$fortune_tmp" in
9563   /*)
9564   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
9565   ;;
9566   ?:/*)                  
9567   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
9568   ;;
9569   *)
9570   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
9571   ac_dummy="$PATH"
9572   for ac_dir in $ac_dummy; do 
9573     test -z "$ac_dir" && ac_dir=.
9574     if test -f $ac_dir/$ac_word; then
9575       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
9576       break
9577     fi
9578   done
9579   IFS="$ac_save_ifs"
9580   ;;
9581 esac
9582 fi
9583 fortune_tmp="$ac_cv_path_fortune_tmp"
9584 if test -n "$fortune_tmp"; then
9585   echo "$ac_t""$fortune_tmp" 1>&6
9586 else
9587   echo "$ac_t""no" 1>&6
9588 fi
9589
9590       if test -z "$fortune_tmp" ; then
9591         with_fortune=""
9592       fi
9593     ;;
9594   esac
9595   ac_cv_fortune_program="$with_fortune"
9596
9597 elif test -n "$ac_cv_fortune_program"; then
9598   echo "$ac_t""checking for fortune... (cached) $ac_cv_fortune_program" 1>&6
9599 fi
9600
9601 unset ac_cv_path_fortune_tmp
9602 unset fortune_tmp
9603
9604 if test -z "$ac_cv_fortune_program" ; then
9605
9606   # first look for fortune in /usr/games/ (and use absolute path)
9607   for ac_prog in fortune
9608 do
9609 # Extract the first word of "$ac_prog", so it can be a program name with args.
9610 set dummy $ac_prog; ac_word=$2
9611 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9612 echo "configure:9624: checking for $ac_word" >&5
9613 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
9614   echo $ac_n "(cached) $ac_c" 1>&6
9615 else
9616   case "$fortune_tmp" in
9617   /*)
9618   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
9619   ;;
9620   ?:/*)                  
9621   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
9622   ;;
9623   *)
9624   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
9625   ac_dummy=""/usr/games""
9626   for ac_dir in $ac_dummy; do 
9627     test -z "$ac_dir" && ac_dir=.
9628     if test -f $ac_dir/$ac_word; then
9629       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
9630       break
9631     fi
9632   done
9633   IFS="$ac_save_ifs"
9634   ;;
9635 esac
9636 fi
9637 fortune_tmp="$ac_cv_path_fortune_tmp"
9638 if test -n "$fortune_tmp"; then
9639   echo "$ac_t""$fortune_tmp" 1>&6
9640 else
9641   echo "$ac_t""no" 1>&6
9642 fi
9643
9644 test -n "$fortune_tmp" && break
9645 done
9646
9647
9648   # if it's not there, look on $PATH (and don't use absolute path)
9649   if test -z "$fortune_tmp" ; then
9650      for ac_prog in fortune
9651 do
9652 # Extract the first word of "$ac_prog", so it can be a program name with args.
9653 set dummy $ac_prog; ac_word=$2
9654 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9655 echo "configure:9667: checking for $ac_word" >&5
9656 if eval "test \"`echo '$''{'ac_cv_prog_fortune_tmp'+set}'`\" = set"; then
9657   echo $ac_n "(cached) $ac_c" 1>&6
9658 else
9659   if test -n "$fortune_tmp"; then
9660   ac_cv_prog_fortune_tmp="$fortune_tmp" # Let the user override the test.
9661 else
9662   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
9663   ac_dummy="$PATH"
9664   for ac_dir in $ac_dummy; do
9665     test -z "$ac_dir" && ac_dir=.
9666     if test -f $ac_dir/$ac_word; then
9667       ac_cv_prog_fortune_tmp="$ac_prog"
9668       break
9669     fi
9670   done
9671   IFS="$ac_save_ifs"
9672 fi
9673 fi
9674 fortune_tmp="$ac_cv_prog_fortune_tmp"
9675 if test -n "$fortune_tmp"; then
9676   echo "$ac_t""$fortune_tmp" 1>&6
9677 else
9678   echo "$ac_t""no" 1>&6
9679 fi
9680
9681 test -n "$fortune_tmp" && break
9682 done
9683
9684   fi
9685
9686   # if we didn't find anything, then just assume /usr/games/
9687   if test -z "$fortune_tmp" ; then
9688      fortune_tmp="/usr/games/fortune"
9689   fi
9690
9691   ac_cv_fortune_program="$fortune_tmp"
9692
9693   # now check to see whether "fortune zippy" works.
9694   #
9695   fortune_tmp="$fortune_tmp zippy"
9696   echo $ac_n "checking for zippy quotes""... $ac_c" 1>&6
9697 echo "configure:9709: checking for zippy quotes" >&5
9698   if ( $fortune_tmp >/dev/null 2>&1 ); then
9699     ac_cv_fortune_program="$fortune_tmp"
9700     echo "$ac_t""$fortune_tmp" 1>&6
9701   else
9702     echo "$ac_t""no" 1>&6
9703   fi
9704
9705 fi
9706
9707 unset ac_cv_path_fortune_tmp
9708 unset fortune_tmp
9709
9710 cat >> confdefs.h <<EOF
9711 #define FORTUNE_PROGRAM "$ac_cv_fortune_program"
9712 EOF
9713
9714
9715
9716 ###############################################################################
9717 #
9718 #       Check whether it's ok to install some hacks as setuid (e.g., "sonar")
9719 #       This should be safe, but let's give people the option.
9720 #
9721 ###############################################################################
9722
9723 setuid_hacks_default=no
9724 setuid_hacks="$setuid_hacks_default"
9725 # Check whether --with-setuid-hacks or --without-setuid-hacks was given.
9726 if test "${with_setuid_hacks+set}" = set; then
9727   withval="$with_setuid_hacks"
9728   setuid_hacks="$withval"
9729 else
9730   setuid_hacks="$setuid_hacks_default"
9731 fi
9732
9733
9734
9735    case "$setuid_hacks" in
9736     yes) ;;
9737     no)  ;;
9738
9739     /*)
9740      echo $ac_n "checking for setuid hacks headers""... $ac_c" 1>&6
9741 echo "configure:9753: checking for setuid hacks headers" >&5
9742      d=$setuid_hacks/include
9743      if test -d $d; then
9744        X_CFLAGS="-I$d $X_CFLAGS"
9745        echo "$ac_t""$d" 1>&6
9746      else
9747        echo "$ac_t""not found ($d: no such directory)" 1>&6
9748      fi
9749
9750      echo $ac_n "checking for setuid hacks libs""... $ac_c" 1>&6
9751 echo "configure:9763: checking for setuid hacks libs" >&5
9752      d=$setuid_hacks/lib
9753      if test -d $d; then
9754        X_LIBS="-L$d $X_LIBS"
9755        echo "$ac_t""$d" 1>&6
9756      else
9757        echo "$ac_t""not found ($d: no such directory)" 1>&6
9758      fi
9759
9760      # replace the directory string with "yes".
9761      setuid_hacks_req="yes"
9762      setuid_hacks=$setuid_hacks_req
9763      ;;
9764
9765     *)
9766      echo ""
9767      echo "error: argument to --with-setuid-hacks must be \"yes\", \"no\", or a directory."
9768      echo "       If it is a directory, then \`DIR/include' will be added to"
9769      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9770      exit 1
9771      ;;
9772    esac
9773   
9774
9775 if test "$setuid_hacks" = yes; then
9776   true
9777 elif test "$setuid_hacks" != no; then
9778   echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
9779   exit 1
9780 fi
9781
9782
9783 ###############################################################################
9784 #
9785 #       Done testing.  Now, set up the various -I and -L variables,
9786 #       and decide which GUI program to build by default.
9787 #
9788 ###############################################################################
9789
9790 DEPEND=makedepend
9791 DEPEND_FLAGS=
9792 DEPEND_DEFINES=
9793
9794
9795 if test \! -z "$includedir" ; then 
9796   INCLUDES="$INCLUDES -I$includedir"
9797 fi
9798
9799 if test \! -z "$libdir" ; then
9800   LDFLAGS="$LDFLAGS -L$libdir"
9801 fi
9802
9803
9804 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
9805 ALL_DEMO_PROGRAMS=
9806 if test "$have_motif" = yes; then
9807   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
9808   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
9809 fi
9810 if test "$have_gtk" = yes; then
9811   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
9812   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
9813 fi
9814
9815
9816 if test "$have_kerberos" = yes; then
9817   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
9818   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
9819 fi
9820 if test "$have_pam" = yes; then
9821   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
9822   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
9823   INSTALL_PAM="install-pam"
9824 fi
9825   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
9826   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
9827
9828
9829 if test "$enable_locking" = yes; then
9830   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
9831   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
9832 else
9833   LOCK_SRCS='$(NOLOCK_SRCS_1)'
9834   LOCK_OBJS='$(NOLOCK_OBJS_1)'
9835 fi
9836
9837 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
9838
9839 if test "$need_setuid" = yes; then
9840   NEED_SETUID=yes
9841 else
9842   NEED_SETUID=no
9843 fi
9844
9845 if test "$setuid_hacks" = yes; then
9846   SETUID_HACKS=yes
9847 else
9848   SETUID_HACKS=no
9849 fi
9850
9851 tab='   '
9852 if test "$have_gl" = yes; then
9853   GL_EXES='$(GL_EXES)'
9854   GL_UTIL_EXES='$(GL_UTIL_EXES)'
9855   GL_MEN='$(GL_MEN)'
9856   GL_KLUDGE="${tab}  "
9857 else
9858   GL_KLUDGE="-${tab}  "
9859 fi
9860
9861 if test "$have_gle" = yes; then
9862   GLE_EXES='$(GLE_EXES)'
9863   GLE_MEN='$(GLE_MEN)'
9864   GLE_KLUDGE="${tab}   "
9865 else
9866   GLE_KLUDGE="-${tab}   "
9867 fi
9868
9869
9870 # Another substitution in the XScreenSaver.ad.in file:
9871 #
9872 if test "$have_gnome_help" = yes; then
9873   GNOMEHELP_Y=''
9874   GNOMEHELP_N='!    '
9875 else
9876   GNOMEHELP_Y='!    '
9877   GNOMEHELP_N=''
9878 fi
9879
9880
9881 # Now that we know whether we have Gnome, we can decide where the XML
9882 # config files get installed.
9883 if test -z "$HACK_CONF_DIR" ; then
9884   if test -n "$GNOME_DATADIR" ; then
9885     HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
9886   else
9887     HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
9888   fi
9889 fi
9890
9891
9892 ###############################################################################
9893 #
9894 #       Perform substitutions and write Makefiles.
9895 #
9896 ###############################################################################
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941 APPDEFAULTS=$ac_x_app_defaults
9942
9943
9944
9945
9946
9947
9948
9949 trap '' 1 2 15
9950 cat > confcache <<\EOF
9951 # This file is a shell script that caches the results of configure
9952 # tests run on this system so they can be shared between configure
9953 # scripts and configure runs.  It is not useful on other systems.
9954 # If it contains results you don't want to keep, you may remove or edit it.
9955 #
9956 # By default, configure uses ./config.cache as the cache file,
9957 # creating it if it does not exist already.  You can give configure
9958 # the --cache-file=FILE option to use a different cache file; that is
9959 # what configure does when it calls configure scripts in
9960 # subdirectories, so they share the cache.
9961 # Giving --cache-file=/dev/null disables caching, for debugging configure.
9962 # config.status only pays attention to the cache file if you give it the
9963 # --recheck option to rerun configure.
9964 #
9965 EOF
9966 # The following way of writing the cache mishandles newlines in values,
9967 # but we know of no workaround that is simple, portable, and efficient.
9968 # So, don't put newlines in cache variables' values.
9969 # Ultrix sh set writes to stderr and can't be redirected directly,
9970 # and sets the high bit in the cache file unless we assign to the vars.
9971 (set) 2>&1 |
9972   case `(ac_space=' '; set | grep ac_space) 2>&1` in
9973   *ac_space=\ *)
9974     # `set' does not quote correctly, so add quotes (double-quote substitution
9975     # turns \\\\ into \\, and sed turns \\ into \).
9976     sed -n \
9977       -e "s/'/'\\\\''/g" \
9978       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
9979     ;;
9980   *)
9981     # `set' quotes correctly as required by POSIX, so do not add quotes.
9982     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
9983     ;;
9984   esac >> confcache
9985 if cmp -s $cache_file confcache; then
9986   :
9987 else
9988   if test -w $cache_file; then
9989     echo "updating cache $cache_file"
9990     cat confcache > $cache_file
9991   else
9992     echo "not updating unwritable cache $cache_file"
9993   fi
9994 fi
9995 rm -f confcache
9996
9997 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
9998
9999 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10000 # Let make expand exec_prefix.
10001 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10002
10003 # Any assignment to VPATH causes Sun make to only execute
10004 # the first set of double-colon rules, so remove it if not needed.
10005 # If there is a colon in the path, we need to keep it.
10006 if test "x$srcdir" = x.; then
10007   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10008 fi
10009
10010 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10011
10012 DEFS=-DHAVE_CONFIG_H
10013
10014 # Without the "./", some shells look in PATH for config.status.
10015 : ${CONFIG_STATUS=./config.status}
10016
10017 echo creating $CONFIG_STATUS
10018 rm -f $CONFIG_STATUS
10019 cat > $CONFIG_STATUS <<EOF
10020 #! /bin/sh
10021 # Generated automatically by configure.
10022 # Run this file to recreate the current configuration.
10023 # This directory was configured as follows,
10024 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10025 #
10026 # $0 $ac_configure_args
10027 #
10028 # Compiler output produced by configure, useful for debugging
10029 # configure, is in ./config.log if it exists.
10030
10031 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10032 for ac_option
10033 do
10034   case "\$ac_option" in
10035   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10036     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10037     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10038   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10039     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10040     exit 0 ;;
10041   -help | --help | --hel | --he | --h)
10042     echo "\$ac_cs_usage"; exit 0 ;;
10043   *) echo "\$ac_cs_usage"; exit 1 ;;
10044   esac
10045 done
10046
10047 ac_given_srcdir=$srcdir
10048 ac_given_INSTALL="$INSTALL"
10049
10050 trap 'rm -fr `echo "Makefile
10051           utils/Makefile
10052           driver/Makefile
10053           hacks/Makefile
10054           hacks/glx/Makefile
10055           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10056 EOF
10057 cat >> $CONFIG_STATUS <<EOF
10058
10059 # Protect against being on the right side of a sed subst in config.status.
10060 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10061  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10062 $ac_vpsub
10063 $extrasub
10064 s%@SHELL@%$SHELL%g
10065 s%@CFLAGS@%$CFLAGS%g
10066 s%@CPPFLAGS@%$CPPFLAGS%g
10067 s%@CXXFLAGS@%$CXXFLAGS%g
10068 s%@FFLAGS@%$FFLAGS%g
10069 s%@DEFS@%$DEFS%g
10070 s%@LDFLAGS@%$LDFLAGS%g
10071 s%@LIBS@%$LIBS%g
10072 s%@exec_prefix@%$exec_prefix%g
10073 s%@prefix@%$prefix%g
10074 s%@program_transform_name@%$program_transform_name%g
10075 s%@bindir@%$bindir%g
10076 s%@sbindir@%$sbindir%g
10077 s%@libexecdir@%$libexecdir%g
10078 s%@datadir@%$datadir%g
10079 s%@sysconfdir@%$sysconfdir%g
10080 s%@sharedstatedir@%$sharedstatedir%g
10081 s%@localstatedir@%$localstatedir%g
10082 s%@libdir@%$libdir%g
10083 s%@includedir@%$includedir%g
10084 s%@oldincludedir@%$oldincludedir%g
10085 s%@infodir@%$infodir%g
10086 s%@mandir@%$mandir%g
10087 s%@host@%$host%g
10088 s%@host_alias@%$host_alias%g
10089 s%@host_cpu@%$host_cpu%g
10090 s%@host_vendor@%$host_vendor%g
10091 s%@host_os@%$host_os%g
10092 s%@CC@%$CC%g
10093 s%@CPP@%$CPP%g
10094 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10095 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10096 s%@INSTALL_DATA@%$INSTALL_DATA%g
10097 s%@SET_MAKE@%$SET_MAKE%g
10098 s%@PERL@%$PERL%g
10099 s%@X_CFLAGS@%$X_CFLAGS%g
10100 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
10101 s%@X_LIBS@%$X_LIBS%g
10102 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
10103 s%@glib_config@%$glib_config%g
10104 s%@gtk_config@%$gtk_config%g
10105 s%@gnome_config@%$gnome_config%g
10106 s%@have_gnome_help@%$have_gnome_help%g
10107 s%@fortune_tmp@%$fortune_tmp%g
10108 s%@INCLUDES@%$INCLUDES%g
10109 s%@PREFERRED_DEMO_PROGRAM@%$PREFERRED_DEMO_PROGRAM%g
10110 s%@ALL_DEMO_PROGRAMS@%$ALL_DEMO_PROGRAMS%g
10111 s%@SAVER_LIBS@%$SAVER_LIBS%g
10112 s%@MOTIF_LIBS@%$MOTIF_LIBS%g
10113 s%@GTK_LIBS@%$GTK_LIBS%g
10114 s%@XML_LIBS@%$XML_LIBS%g
10115 s%@HACK_LIBS@%$HACK_LIBS%g
10116 s%@XPM_LIBS@%$XPM_LIBS%g
10117 s%@GL_LIBS@%$GL_LIBS%g
10118 s%@GLE_LIBS@%$GLE_LIBS%g
10119 s%@XDPMS_LIBS@%$XDPMS_LIBS%g
10120 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
10121 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
10122 s%@SETUID_HACKS@%$SETUID_HACKS%g
10123 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
10124 s%@NEED_SETUID@%$NEED_SETUID%g
10125 s%@INSTALL_PAM@%$INSTALL_PAM%g
10126 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
10127 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
10128 s%@XMU_SRCS@%$XMU_SRCS%g
10129 s%@XMU_OBJS@%$XMU_OBJS%g
10130 s%@XMU_LIBS@%$XMU_LIBS%g
10131 s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
10132 s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
10133 s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
10134 s%@LOCK_SRCS@%$LOCK_SRCS%g
10135 s%@LOCK_OBJS@%$LOCK_OBJS%g
10136 s%@GL_EXES@%$GL_EXES%g
10137 s%@GL_UTIL_EXES@%$GL_UTIL_EXES%g
10138 s%@GL_MEN@%$GL_MEN%g
10139 s%@GL_KLUDGE@%$GL_KLUDGE%g
10140 s%@GLE_EXES@%$GLE_EXES%g
10141 s%@GLE_MEN@%$GLE_MEN%g
10142 s%@GLE_KLUDGE@%$GLE_KLUDGE%g
10143 s%@GNOMEHELP_Y@%$GNOMEHELP_Y%g
10144 s%@GNOMEHELP_N@%$GNOMEHELP_N%g
10145 s%@HACKDIR@%$HACKDIR%g
10146 s%@GNOME_DATADIR@%$GNOME_DATADIR%g
10147 s%@HACK_CONF_DIR@%$HACK_CONF_DIR%g
10148 s%@APPDEFAULTS@%$APPDEFAULTS%g
10149 s%@DEPEND@%$DEPEND%g
10150 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
10151 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
10152
10153 CEOF
10154 EOF
10155
10156 cat >> $CONFIG_STATUS <<\EOF
10157
10158 # Split the substitutions into bite-sized pieces for seds with
10159 # small command number limits, like on Digital OSF/1 and HP-UX.
10160 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10161 ac_file=1 # Number of current file.
10162 ac_beg=1 # First line for current file.
10163 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10164 ac_more_lines=:
10165 ac_sed_cmds=""
10166 while $ac_more_lines; do
10167   if test $ac_beg -gt 1; then
10168     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10169   else
10170     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10171   fi
10172   if test ! -s conftest.s$ac_file; then
10173     ac_more_lines=false
10174     rm -f conftest.s$ac_file
10175   else
10176     if test -z "$ac_sed_cmds"; then
10177       ac_sed_cmds="sed -f conftest.s$ac_file"
10178     else
10179       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10180     fi
10181     ac_file=`expr $ac_file + 1`
10182     ac_beg=$ac_end
10183     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10184   fi
10185 done
10186 if test -z "$ac_sed_cmds"; then
10187   ac_sed_cmds=cat
10188 fi
10189 EOF
10190
10191 cat >> $CONFIG_STATUS <<EOF
10192
10193 CONFIG_FILES=\${CONFIG_FILES-"Makefile
10194           utils/Makefile
10195           driver/Makefile
10196           hacks/Makefile
10197           hacks/glx/Makefile
10198           driver/XScreenSaver.ad"}
10199 EOF
10200 cat >> $CONFIG_STATUS <<\EOF
10201 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10202   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10203   case "$ac_file" in
10204   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10205        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10206   *) ac_file_in="${ac_file}.in" ;;
10207   esac
10208
10209   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10210
10211   # Remove last slash and all that follows it.  Not all systems have dirname.
10212   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10213   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10214     # The file is in a subdirectory.
10215     test ! -d "$ac_dir" && mkdir "$ac_dir"
10216     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10217     # A "../" for each directory in $ac_dir_suffix.
10218     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10219   else
10220     ac_dir_suffix= ac_dots=
10221   fi
10222
10223   case "$ac_given_srcdir" in
10224   .)  srcdir=.
10225       if test -z "$ac_dots"; then top_srcdir=.
10226       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10227   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10228   *) # Relative path.
10229     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10230     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10231   esac
10232
10233   case "$ac_given_INSTALL" in
10234   [/$]*) INSTALL="$ac_given_INSTALL" ;;
10235   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10236   esac
10237
10238   echo creating "$ac_file"
10239   rm -f "$ac_file"
10240   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10241   case "$ac_file" in
10242   *Makefile*) ac_comsub="1i\\
10243 # $configure_input" ;;
10244   *) ac_comsub= ;;
10245   esac
10246
10247   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10248   sed -e "$ac_comsub
10249 s%@configure_input@%$configure_input%g
10250 s%@srcdir@%$srcdir%g
10251 s%@top_srcdir@%$top_srcdir%g
10252 s%@INSTALL@%$INSTALL%g
10253 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10254 fi; done
10255 rm -f conftest.s*
10256
10257 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10258 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10259 #
10260 # ac_d sets the value in "#define NAME VALUE" lines.
10261 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10262 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10263 ac_dC='\3'
10264 ac_dD='%g'
10265 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10266 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10267 ac_uB='\([      ]\)%\1#\2define\3'
10268 ac_uC=' '
10269 ac_uD='\4%g'
10270 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10271 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10272 ac_eB='$%\1#\2define\3'
10273 ac_eC=' '
10274 ac_eD='%g'
10275
10276 if test "${CONFIG_HEADERS+set}" != set; then
10277 EOF
10278 cat >> $CONFIG_STATUS <<EOF
10279   CONFIG_HEADERS="config.h"
10280 EOF
10281 cat >> $CONFIG_STATUS <<\EOF
10282 fi
10283 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10284   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10285   case "$ac_file" in
10286   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10287        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10288   *) ac_file_in="${ac_file}.in" ;;
10289   esac
10290
10291   echo creating $ac_file
10292
10293   rm -f conftest.frag conftest.in conftest.out
10294   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10295   cat $ac_file_inputs > conftest.in
10296
10297 EOF
10298
10299 # Transform confdefs.h into a sed script conftest.vals that substitutes
10300 # the proper values into config.h.in to produce config.h.  And first:
10301 # Protect against being on the right side of a sed subst in config.status.
10302 # Protect against being in an unquoted here document in config.status.
10303 rm -f conftest.vals
10304 cat > conftest.hdr <<\EOF
10305 s/[\\&%]/\\&/g
10306 s%[\\$`]%\\&%g
10307 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10308 s%ac_d%ac_u%gp
10309 s%ac_u%ac_e%gp
10310 EOF
10311 sed -n -f conftest.hdr confdefs.h > conftest.vals
10312 rm -f conftest.hdr
10313
10314 # This sed command replaces #undef with comments.  This is necessary, for
10315 # example, in the case of _POSIX_SOURCE, which is predefined and required
10316 # on some systems where configure will not decide to define it.
10317 cat >> conftest.vals <<\EOF
10318 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10319 EOF
10320
10321 # Break up conftest.vals because some shells have a limit on
10322 # the size of here documents, and old seds have small limits too.
10323
10324 rm -f conftest.tail
10325 while :
10326 do
10327   ac_lines=`grep -c . conftest.vals`
10328   # grep -c gives empty output for an empty file on some AIX systems.
10329   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10330   # Write a limited-size here document to conftest.frag.
10331   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10332   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10333   echo 'CEOF
10334   sed -f conftest.frag conftest.in > conftest.out
10335   rm -f conftest.in
10336   mv conftest.out conftest.in
10337 ' >> $CONFIG_STATUS
10338   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10339   rm -f conftest.vals
10340   mv conftest.tail conftest.vals
10341 done
10342 rm -f conftest.vals
10343
10344 cat >> $CONFIG_STATUS <<\EOF
10345   rm -f conftest.frag conftest.h
10346   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10347   cat conftest.in >> conftest.h
10348   rm -f conftest.in
10349   if cmp -s $ac_file conftest.h 2>/dev/null; then
10350     echo "$ac_file is unchanged"
10351     rm -f conftest.h
10352   else
10353     # Remove last slash and all that follows it.  Not all systems have dirname.
10354       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10355       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10356       # The file is in a subdirectory.
10357       test ! -d "$ac_dir" && mkdir "$ac_dir"
10358     fi
10359     rm -f $ac_file
10360     mv conftest.h $ac_file
10361   fi
10362 fi; done
10363
10364 EOF
10365 cat >> $CONFIG_STATUS <<EOF
10366
10367 EOF
10368 cat >> $CONFIG_STATUS <<\EOF
10369
10370 exit 0
10371 EOF
10372 chmod +x $CONFIG_STATUS
10373 rm -fr confdefs* $ac_clean_files
10374 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10375
10376
10377 ###############################################################################
10378 #
10379 #       Print some warnings at the end.
10380 #
10381 ###############################################################################
10382
10383 warn_prefix_1="    Warning:"
10384 warn_prefix_2="       Note:"
10385 warn_prefix="$warn_prefix_1"
10386
10387 warning=no
10388 warnsep='    #################################################################'
10389
10390 warnpre() {
10391   if test "$warning" = no ; then
10392     echo '' ; echo "$warnsep" ; echo ''
10393     warning=yes
10394   fi
10395 }
10396
10397 warn() {
10398   warnpre
10399   if test "$warning" = long ; then echo '' ; fi
10400   warning=yes
10401   rest="$@"
10402   echo "$warn_prefix $rest"
10403 }
10404
10405 warnL() {
10406   was=$warning
10407   warnpre
10408   warning=yes
10409   if test "$was" != no ; then echo '' ; fi
10410   rest="$@"
10411   echo "$warn_prefix $rest"
10412 }
10413
10414 warn2() {
10415   rest="$@"
10416   echo "             $rest"
10417   warning=long
10418 }
10419
10420 note() {
10421   warn_prefix="$warn_prefix_2"
10422   warn $@
10423   warn_prefix="$warn_prefix_1"
10424 }
10425
10426 noteL() {
10427   warn_prefix="$warn_prefix_2"
10428   warnL $@
10429   warn_prefix="$warn_prefix_1"
10430 }
10431
10432
10433 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
10434   warn 'The SGI saver extension was requested, but was not found.'
10435 fi
10436
10437 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
10438   warn 'The MIT saver extension was requested, but was not found.'
10439 fi
10440
10441 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
10442   warn 'The XIdle extension was requested, but was not found.'
10443 fi
10444
10445 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
10446   warn 'The XSHM extension was requested, but was not found.'
10447 fi
10448
10449 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
10450   warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
10451 fi
10452
10453 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
10454   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
10455 fi
10456
10457 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
10458   warn 'The DPMS extension was requested, but was not found.'
10459 fi
10460
10461 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
10462   warn 'The Xinerama extension was requested, but was not found.'
10463 fi
10464
10465 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
10466   warn 'The XF86VMODE extension was requested, but was not found.'
10467 fi
10468
10469 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
10470   warn "Checking of /proc/interrupts was requested, but it's bogus."
10471 fi
10472
10473
10474 if test "$have_motif" = no -a "$have_gtk" = no; then
10475   warnL "Neither Motif nor Gtk seem to be available;"
10476   warn2 "the \`xscreensaver-demo' program requires one of these."
10477
10478 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
10479   warnL "Use of Motif was requested, but it wasn't found;"
10480   warn2 "Gtk will be used instead."
10481
10482 elif test "$jurassic_gtk" = yes ; then
10483
10484   pref_gtk=1.2
10485
10486   v="$ac_gtk_version_string"
10487   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
10488     warnL "Use of Gtk was requested, but its version number is unknown;"
10489   elif test "$with_gtk_req" = yes ; then
10490     warnL "Use of Gtk was requested, but it is version $v;"
10491   else
10492     warnL "Gtk was found on this system, but it is version $v;"
10493   fi
10494
10495   warn2 "Gtk $pref_gtk or newer is required.  Motif will be used instead."
10496
10497 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
10498   warnL "Use of Gtk was requested, but it wasn't found;"
10499   warn2 "Motif will be used instead."
10500
10501 fi
10502
10503
10504 if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
10505   warn  'Use of the Gnome Control Panel was requested, but the necessary'
10506   warn2 'headers and/or libraries were not found.'
10507 fi
10508
10509 if test "$with_xml_req" = yes -a "$have_xml" = no ; then
10510   warn  'Use of the XML library was requested, but the necessary'
10511   warn2 'headers and/or libraries were not found.'
10512 elif test "$have_gtk" = yes -a "$have_xml" = no ; then
10513   warn  'GTK is being used, but the XML library was not found.'
10514   warn2 'Some functionality will be disabled.'
10515 fi
10516
10517 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
10518
10519   preferred_lesstif=0.86
10520
10521   if test "$lesstif_version" = unknown; then
10522     warnL "Unable to determine the LessTif version number!"
10523     warn2 "Make sure you are using version $preferred_lesstif or newer."
10524     warn2 "See <http://www.lesstif.org/>."
10525
10526   elif test \! $lesstif_version -gt 82; then
10527     warnL "LessTif version $lesstif_version_string is being used."
10528     warn2 "LessTif versions 0.82 and earlier are too buggy to"
10529     warn2 "use with XScreenSaver; it is strongly recommended"
10530     warn2 "that you upgrade to at least version $preferred_lesstif!"
10531     warn2 "See <http://www.lesstif.org/>."
10532   fi
10533 fi
10534
10535
10536
10537 if test "$have_xpm" = no ; then
10538   if test "$with_xpm_req" = yes ; then
10539     warnL 'Use of XPM was requested, but it was not found.'
10540   elif test "$with_xpm_req" = no ; then
10541     noteL 'The XPM library is not being used.'
10542   else
10543     noteL 'The XPM library was not found.'
10544   fi
10545
10546   echo ''
10547   warn2 'Some of the demos will not be as colorful as they'
10548   warn2 'could be.  You might want to consider installing XPM'
10549   warn2 'and re-running configure.  (Remember to delete the'
10550   warn2 'config.cache file first.)  You can find XPM at most'
10551   warn2 'X11 archive sites, such as <http://sunsite.unc.edu/>.'
10552 fi
10553
10554
10555 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
10556   preferred_mesagl=3.4
10557   mgv="$ac_mesagl_version_string"
10558   pgl="$preferred_mesagl"
10559
10560   if test "$ac_mesagl_version" = unknown; then
10561     warnL "Unable to determine the MesaGL version number!"
10562     warn2 "Make sure you are using version $preferred_mesagl or newer."
10563
10564   elif test \! "$ac_mesagl_version" -gt 2006; then
10565     warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
10566     warn2 "have a security bug.  It is strongly recommended that you"
10567     warn2 "upgrade to at least version $preferred_mesagl."
10568
10569   elif test \! "$ac_mesagl_version" -gt 3003; then
10570     warnL "MesaGL version $mgv is being used.  That version has some"
10571     warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
10572   fi
10573 fi
10574
10575 if test "$have_gl" = no ; then
10576   if test "$with_gl_req" = yes ; then
10577     warnL 'Use of GL was requested, but it was not found.'
10578   elif test "$with_gl_req" = no ; then
10579     noteL 'The OpenGL 3D library is not being used.'
10580   else
10581     noteL 'The OpenGL 3D library was not found.'
10582   fi
10583
10584   if test "$gl_halfassed" = yes ; then
10585     echo ''
10586     warn2 'More specifically, we found the headers, but not the'
10587     warn2 'libraries; so either GL is half-installed on this'
10588     warn2 "system, or something else went wrong.  The \`config.log'"
10589     warn2 'file might contain some clues.'
10590   fi
10591
10592   echo ''
10593   warn2 'Those demos which use 3D will not be built or installed.'
10594   warn2 'You might want to consider installing OpenGL and'
10595   warn2 're-running configure.  (Remember to delete the'
10596   warn2 "config.cache file first.)  If your vendor doesn't ship"
10597   warn2 'their own implementation of OpenGL, you can get a free'
10598   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
10599   warn2 'info, see <http://www.opengl.org/>.'
10600
10601 fi
10602
10603
10604 if test "$have_gl" = yes -a "$have_gle" = no ; then
10605   if test "$with_gle_req" = yes ; then
10606     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
10607     warn2 'it was not found (though the OpenGL library was found, and'
10608     warn2 'is being used.)'
10609   elif test "$with_gle_req" = no ; then
10610     noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
10611     warn2 'library is not.'
10612   else
10613     noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
10614     warn2 'was not.'
10615   fi
10616
10617   if test "$gle_halfassed" = yes ; then
10618     echo ''
10619     warn2 'More specifically, we found the headers, but not the'
10620     warn2 'libraries; so either GLE is half-installed on this'
10621     warn2 "system, or something else went wrong.  The \`config.log'"
10622     warn2 'file might contain some clues.'
10623   fi
10624
10625   echo ''
10626   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
10627   warn2 'will not be built or installed.  You might want to consider'
10628   warn2 'installing GLE and re-running configure.  (Remember to delete'
10629   warn2 'the config.cache file first.)  You can find the GLE library'
10630   warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
10631   warn2 'see <http://www.opengl.org/>.'
10632
10633 fi
10634
10635
10636 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
10637   warn 'Use of XReadDisplay was requested, but it was not found.'
10638 fi
10639
10640 if test -n "$with_fortune_req"; then
10641   if test "$with_fortune_req" != "$ac_cv_fortune_program" ; then
10642     warnL "$with_fortune_req was requested as the Fortune program,"
10643     warn2 "but was not found.  The default will be used instead."
10644   fi
10645 fi
10646
10647 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
10648   warn 'Use of Kerberos was requested, but it was not found.'
10649 fi
10650
10651 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
10652   warn 'Use of PAM was requested, but it was not found.'
10653 fi
10654
10655 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
10656   warn 'Use of shadow passwords was requested, but they were not found.'
10657 fi
10658
10659
10660 # You are in a twisty maze of namespaces and syntaxes, all alike.
10661 # Fuck the skull of Unix.
10662 #
10663 eval bindir=${bindir}
10664 eval bindir=${bindir}
10665 eval bindir=${bindir}
10666 eval bindir=${bindir}
10667 eval bindir=${bindir}
10668 eval bindir=${bindir}
10669 eval HACKDIR=${HACKDIR}
10670 eval HACKDIR=${HACKDIR}
10671 eval HACKDIR=${HACKDIR}
10672 eval HACKDIR=${HACKDIR}
10673 eval HACKDIR=${HACKDIR}
10674 eval HACKDIR=${HACKDIR}
10675 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10676 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10677 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10678 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10679 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10680 eval HACK_CONF_DIR=${HACK_CONF_DIR}
10681
10682 # canonicalize slashes.
10683 bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
10684 HACKDIR=`echo "${HACKDIR}"             | sed 's@/$@@;s@//*@/@g'`
10685 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
10686
10687
10688 # Sanity check the hackdir
10689 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
10690   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
10691     echo ""
10692     { echo "configure: error: \"--with-hackdir=${bindir}/${bad_choice}\" won't work.
10693                    There will be an executable installed with that name, so
10694                    that can't be the name of a directory as well.  Please
10695                    re-configure with a different directory name." 1>&2; exit 1; }
10696   fi
10697 done
10698
10699
10700 do_dir_warning=no
10701
10702 # Now let's see if there's a previous RPM version already installed.  Blargh!
10703
10704 # M4 sucks!!
10705
10706 rpmv=`(rpm -qv xscreensaver) 2>&- | \
10707       sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
10708
10709
10710 if test \! -z "$rpmv" ; then
10711   rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
10712   rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
10713
10714   warning=no
10715   warnL "There is already an installed RPM of xscreensaver $rpmv"
10716   warn2 "on this system.  You might want to remove it (with"
10717   warn2 '"rpm -ve xscreensaver") before running "make install"'
10718   warn2 "from this directory."
10719   echo ""
10720   warn2 "Alternately, you could build this version of xscreensaver"
10721   warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
10722   warn2 "file is included.  See the RPM documentation for more info."
10723   echo ""
10724
10725   if test "$rpmbdir" = "$rpmhdir" ; then
10726     warn2 "The RPM version was installed in $rpmbdir."
10727   else
10728     warn2 "The RPM version was installed in $rpmbdir,"
10729     warn2 "with demos in $rpmhdir."
10730   fi
10731
10732   do_dir_warning=yes
10733 fi
10734
10735
10736 if test "${bindir}" = "${HACKDIR}" ; then
10737   do_dir_warning=yes
10738 fi
10739
10740 if test "$do_dir_warning" = yes; then
10741   echo ""
10742   echo "$warnsep"
10743   echo ""
10744   echo '      When you run "make install", the "xscreensaver",'
10745   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
10746   echo "      will be installed in ${bindir}."
10747   echo ""
10748   echo "      The various graphics demos (120+ different executables) will"
10749   echo "      also be installed in ${HACKDIR}."
10750   echo ""
10751   echo "      If you would prefer the demos to be installed elsewhere"
10752   echo "      (for example, in a dedicated directory) you should re-run"
10753   echo "      configure with the --with-hackdir=DIR option.  For more"
10754   echo "      information, run $0 --help."
10755   warning=yes
10756 fi
10757
10758 if test "$warning" != no; then
10759   echo '' ; echo "$warnsep" ; echo ''
10760 fi
10761
10762 if test "$do_dir_warning" = no; then
10763   if test "$warning" = no; then
10764     echo ''
10765   fi
10766   echo "User programs will be installed in ${bindir}/"
10767   echo "Screen savers will be installed in ${HACKDIR}/"
10768   echo "Configuration will be installed in ${HACK_CONF_DIR}/"
10769   echo ''
10770 fi