http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.02.tar.gz
[xscreensaver] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help"
15 ac_help="$ac_help
16 Installation options:
17
18   --with-hackdir=DIR      Where to install the hundreds of demo executables.
19                           Default: \`PREFIX/lib/xscreensaver/'"
20 ac_help="$ac_help
21 "
22 ac_help="$ac_help
23   --with-configdir=DIR    Where to install the data files that describe each
24                           of the display modes to the GUI.
25                           Default: \`GNOMEPREFIX/control-center/screensavers/'
26                           or \`PREFIX/lib/xscreensaver/config/', depending on
27                           whether GNOME is available.
28 "
29 ac_help="$ac_help
30 Except where noted, all of the --with options below can also take a
31 directory argument: for example, \`--with-motif=/opt/Motif'.  That would
32 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
33 to be added to the -L list, assuming those directories exist.  
34
35 By default, support for each of these options will be built in, if the
36 relevant library routines exist.  At run time, they will then be used
37 only if the X server being used supports them.  Each --with option has
38 a corresponding --without option, to override building support for them
39 at all.
40
41 Screen blanking and idle-detection options:
42
43   --with-sgi-ext          Include support for the SGI SCREEN_SAVER extension."
44 ac_help="$ac_help
45   --with-mit-ext          Include support for the MIT-SCREEN-SAVER extension."
46 ac_help="$ac_help
47   --with-xidle-ext        Include support for the XIDLE extension."
48 ac_help="$ac_help
49   --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension."
50 ac_help="$ac_help
51   --with-dpms-ext         Include support for the DPMS extension."
52 ac_help="$ac_help
53   --with-xinerama-ext     Include support for the XINERAMA extension."
54 ac_help="$ac_help
55   --with-xf86vmode-ext    Include support for XFree86 virtual screens."
56 ac_help="$ac_help
57   --with-xf86gamma-ext    Include support for XFree86 gamma fading."
58 ac_help="$ac_help
59   --with-proc-interrupts  Include support for consulting the /proc/interrupts
60                           file to notice keyboard activity."
61 ac_help="$ac_help
62
63 Screen locking options:
64
65   --enable-locking        Compile in support for locking the display.
66   --disable-locking       Do not allow locking at all.
67 "
68 ac_help="$ac_help
69   --with-pam              Include support for PAM (Pluggable Auth Modules.)"
70 ac_help="$ac_help
71   --with-kerberos         Include support for Kerberos authentication."
72 ac_help="$ac_help
73   --with-shadow           Include support for shadow password authentication."
74 ac_help="$ac_help
75
76 User interface options:
77
78   --with-motif            Use the Motif toolkit for the user interface."
79 ac_help="$ac_help
80   --with-gtk              Use the Gtk toolkit for the user interface."
81 ac_help="$ac_help
82   --with-gnome            Include support for the Gnome Control Center."
83 ac_help="$ac_help
84   --with-xml              The XML toolkit is needed for some parts of
85                           the Gtk interface."
86 ac_help="$ac_help
87
88 Graphics options:
89
90   --with-gl               Build those demos which depend on OpenGL."
91 ac_help="$ac_help
92   --with-gle              Build those demos which depend on GLE
93                           (the OpenGL "extrusion" library.)"
94 ac_help="$ac_help
95   --with-xpm              Include support for XPM files in some demos."
96 ac_help="$ac_help
97   --with-pixbuf           Include support for the GDK-Pixbuf library in some
98                           demos, which will make it possible for them to read
99                           GIF, JPEG, and PNG files as well."
100 ac_help="$ac_help
101   --with-jpeg             Include support for the JPEG library in some demos,
102                           which will make it possible for them to read JPEG
103                           files as well."
104 ac_help="$ac_help
105   --with-xshm-ext         Include support for the Shared Memory extension."
106 ac_help="$ac_help
107   --with-xdbe-ext         Include support for the DOUBLE-BUFFER extension."
108 ac_help="$ac_help
109   --with-readdisplay      Include support for the XReadDisplay extension."
110 ac_help="$ac_help
111
112   --with-fortune=PROGRAM  Some demos are able to run an external program and
113                           display its text; this names the program to use by
114                           default (though it can be overridden with X
115                           resources.)  Default is \"/usr/games/fortune\"."
116 ac_help="$ac_help
117   --with-setuid-hacks     Allow some demos to be installed \`setuid root'
118                           (which is needed in order to ping other hosts.)
119 "
120
121 # Initialize some variables set by options.
122 # The variables have the same names as the options, with
123 # dashes changed to underlines.
124 build=NONE
125 cache_file=./config.cache
126 exec_prefix=NONE
127 host=NONE
128 no_create=
129 nonopt=NONE
130 no_recursion=
131 prefix=NONE
132 program_prefix=NONE
133 program_suffix=NONE
134 program_transform_name=s,x,x,
135 silent=
136 site=
137 srcdir=
138 target=NONE
139 verbose=
140 x_includes=NONE
141 x_libraries=NONE
142 bindir='${exec_prefix}/bin'
143 sbindir='${exec_prefix}/sbin'
144 libexecdir='${exec_prefix}/libexec'
145 datadir='${prefix}/share'
146 sysconfdir='${prefix}/etc'
147 sharedstatedir='${prefix}/com'
148 localstatedir='${prefix}/var'
149 libdir='${exec_prefix}/lib'
150 includedir='${prefix}/include'
151 oldincludedir='/usr/include'
152 infodir='${prefix}/info'
153 mandir='${prefix}/man'
154
155 # Initialize some other variables.
156 subdirs=
157 MFLAGS= MAKEFLAGS=
158 SHELL=${CONFIG_SHELL-/bin/sh}
159 # Maximum number of lines to put in a shell here document.
160 ac_max_here_lines=12
161
162 ac_prev=
163 for ac_option
164 do
165
166   # If the previous option needs an argument, assign it.
167   if test -n "$ac_prev"; then
168     eval "$ac_prev=\$ac_option"
169     ac_prev=
170     continue
171   fi
172
173   case "$ac_option" in
174   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
175   *) ac_optarg= ;;
176   esac
177
178   # Accept the important Cygnus configure options, so we can diagnose typos.
179
180   case "$ac_option" in
181
182   -bindir | --bindir | --bindi | --bind | --bin | --bi)
183     ac_prev=bindir ;;
184   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
185     bindir="$ac_optarg" ;;
186
187   -build | --build | --buil | --bui | --bu)
188     ac_prev=build ;;
189   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
190     build="$ac_optarg" ;;
191
192   -cache-file | --cache-file | --cache-fil | --cache-fi \
193   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
194     ac_prev=cache_file ;;
195   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
196   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
197     cache_file="$ac_optarg" ;;
198
199   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
200     ac_prev=datadir ;;
201   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
202   | --da=*)
203     datadir="$ac_optarg" ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
207     # Reject names that are not valid shell variable names.
208     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
209       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
210     fi
211     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
212     eval "enable_${ac_feature}=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
216     # Reject names that are not valid shell variable names.
217     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
218       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
219     fi
220     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
221     case "$ac_option" in
222       *=*) ;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_${ac_feature}='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix="$ac_optarg" ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he)
241     # Omit some internal or obsolete options to make the list less imposing.
242     # This message is too long to be a string in the A/UX 3.1 sh.
243     cat << EOF
244 Usage: configure [options] [host]
245 Options: [defaults in brackets after descriptions]
246
247 Configuration:
248
249   --cache-file=FILE       cache test results in FILE
250   --help                  print this message
251   --no-create             do not create output files
252   --quiet, --silent       do not print \`checking...' messages
253   --version               print the version of autoconf that created configure
254
255 Directory and file names:
256
257   --prefix=PREFIX         install architecture-independent files in PREFIX
258                           [$ac_default_prefix]
259   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
260                           [same as prefix]
261   --bindir=DIR            user executables in DIR [EPREFIX/bin]
262   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
263   --includedir=DIR        C header files in DIR [PREFIX/include]
264   --x-includes=DIR        X include files are in DIR
265   --x-libraries=DIR       X library files are in DIR
266   --mandir=DIR            man documentation in DIR [PREFIX/man]
267   --srcdir=DIR            find the sources in DIR [configure dir or ..]
268   --program-prefix=PREFIX prepend PREFIX to installed program names
269   --program-suffix=SUFFIX append SUFFIX to installed program names
270   --program-transform-name=PROGRAM
271                           run sed PROGRAM on installed program names
272 EOF
273     cat << EOF
274
275 Host type:
276
277   --build=BUILD           configure for building on BUILD [BUILD=HOST]
278   --host=HOST             configure for HOST [guessed]
279   --target=TARGET         configure for TARGET [TARGET=HOST]
280 EOF
281     if test -n "$ac_help"; then
282       echo "$ac_help"
283     fi
284     exit 0 ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host="$ac_optarg" ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir="$ac_optarg" ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir="$ac_optarg" ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir="$ac_optarg" ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir="$ac_optarg" ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir="$ac_optarg" ;;
323
324   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
325     ac_prev=mandir ;;
326   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
327     mandir="$ac_optarg" ;;
328
329   -nfp | --nfp | --nf)
330     # Obsolete; use --without-fp.
331     with_fp=no ;;
332
333   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
334   | --no-cr | --no-c)
335     no_create=yes ;;
336
337   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
338   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
339     no_recursion=yes ;;
340
341   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
342   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
343   | --oldin | --oldi | --old | --ol | --o)
344     ac_prev=oldincludedir ;;
345   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
346   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
347   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
348     oldincludedir="$ac_optarg" ;;
349
350   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
351     ac_prev=prefix ;;
352   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
353     prefix="$ac_optarg" ;;
354
355   -program-prefix | --program-prefix | --program-prefi | --program-pref \
356   | --program-pre | --program-pr | --program-p)
357     ac_prev=program_prefix ;;
358   -program-prefix=* | --program-prefix=* | --program-prefi=* \
359   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
360     program_prefix="$ac_optarg" ;;
361
362   -program-suffix | --program-suffix | --program-suffi | --program-suff \
363   | --program-suf | --program-su | --program-s)
364     ac_prev=program_suffix ;;
365   -program-suffix=* | --program-suffix=* | --program-suffi=* \
366   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
367     program_suffix="$ac_optarg" ;;
368
369   -program-transform-name | --program-transform-name \
370   | --program-transform-nam | --program-transform-na \
371   | --program-transform-n | --program-transform- \
372   | --program-transform | --program-transfor \
373   | --program-transfo | --program-transf \
374   | --program-trans | --program-tran \
375   | --progr-tra | --program-tr | --program-t)
376     ac_prev=program_transform_name ;;
377   -program-transform-name=* | --program-transform-name=* \
378   | --program-transform-nam=* | --program-transform-na=* \
379   | --program-transform-n=* | --program-transform-=* \
380   | --program-transform=* | --program-transfor=* \
381   | --program-transfo=* | --program-transf=* \
382   | --program-trans=* | --program-tran=* \
383   | --progr-tra=* | --program-tr=* | --program-t=*)
384     program_transform_name="$ac_optarg" ;;
385
386   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
387   | -silent | --silent | --silen | --sile | --sil)
388     silent=yes ;;
389
390   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
391     ac_prev=sbindir ;;
392   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
393   | --sbi=* | --sb=*)
394     sbindir="$ac_optarg" ;;
395
396   -sharedstatedir | --sharedstatedir | --sharedstatedi \
397   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
398   | --sharedst | --shareds | --shared | --share | --shar \
399   | --sha | --sh)
400     ac_prev=sharedstatedir ;;
401   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
402   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
403   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
404   | --sha=* | --sh=*)
405     sharedstatedir="$ac_optarg" ;;
406
407   -site | --site | --sit)
408     ac_prev=site ;;
409   -site=* | --site=* | --sit=*)
410     site="$ac_optarg" ;;
411
412   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
413     ac_prev=srcdir ;;
414   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
415     srcdir="$ac_optarg" ;;
416
417   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
418   | --syscon | --sysco | --sysc | --sys | --sy)
419     ac_prev=sysconfdir ;;
420   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
421   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
422     sysconfdir="$ac_optarg" ;;
423
424   -target | --target | --targe | --targ | --tar | --ta | --t)
425     ac_prev=target ;;
426   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
427     target="$ac_optarg" ;;
428
429   -v | -verbose | --verbose | --verbos | --verbo | --verb)
430     verbose=yes ;;
431
432   -version | --version | --versio | --versi | --vers)
433     echo "configure generated by autoconf version 2.13"
434     exit 0 ;;
435
436   -with-* | --with-*)
437     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
438     # Reject names that are not valid shell variable names.
439     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
440       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
441     fi
442     ac_package=`echo $ac_package| sed 's/-/_/g'`
443     case "$ac_option" in
444       *=*) ;;
445       *) ac_optarg=yes ;;
446     esac
447     eval "with_${ac_package}='$ac_optarg'" ;;
448
449   -without-* | --without-*)
450     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
451     # Reject names that are not valid shell variable names.
452     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
453       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
454     fi
455     ac_package=`echo $ac_package| sed 's/-/_/g'`
456     eval "with_${ac_package}=no" ;;
457
458   --x)
459     # Obsolete; use --with-x.
460     with_x=yes ;;
461
462   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
463   | --x-incl | --x-inc | --x-in | --x-i)
464     ac_prev=x_includes ;;
465   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
466   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
467     x_includes="$ac_optarg" ;;
468
469   -x-libraries | --x-libraries | --x-librarie | --x-librari \
470   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
471     ac_prev=x_libraries ;;
472   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
473   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
474     x_libraries="$ac_optarg" ;;
475
476   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
477     ;;
478
479   *)
480     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
481       echo "configure: warning: $ac_option: invalid host type" 1>&2
482     fi
483     if test "x$nonopt" != xNONE; then
484       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
485     fi
486     nonopt="$ac_option"
487     ;;
488
489   esac
490 done
491
492 if test -n "$ac_prev"; then
493   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
494 fi
495
496 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
497
498 # File descriptor usage:
499 # 0 standard input
500 # 1 file creation
501 # 2 errors and warnings
502 # 3 some systems may open it to /dev/tty
503 # 4 used on the Kubota Titan
504 # 6 checking for... messages and results
505 # 5 compiler messages saved in config.log
506 if test "$silent" = yes; then
507   exec 6>/dev/null
508 else
509   exec 6>&1
510 fi
511 exec 5>./config.log
512
513 echo "\
514 This file contains any messages produced by compilers while
515 running configure, to aid debugging if configure makes a mistake.
516 " 1>&5
517
518 # Strip out --no-create and --no-recursion so they do not pile up.
519 # Also quote any args containing shell metacharacters.
520 ac_configure_args=
521 for ac_arg
522 do
523   case "$ac_arg" in
524   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
525   | --no-cr | --no-c) ;;
526   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
527   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
528   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
529   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
530   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
531   esac
532 done
533
534 # NLS nuisances.
535 # Only set these to C if already set.  These must not be set unconditionally
536 # because not all systems understand e.g. LANG=C (notably SCO).
537 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
538 # Non-C LC_CTYPE values break the ctype check.
539 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
540 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
541 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
542 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
543
544 # confdefs.h avoids OS command line length limits that DEFS can exceed.
545 rm -rf conftest* confdefs.h
546 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
547 echo > confdefs.h
548
549 # A filename unique to this package, relative to the directory that
550 # configure is in, which we can look for to find out if srcdir is correct.
551 ac_unique_file=driver/subprocs.c
552
553 # Find the source files, if location was not specified.
554 if test -z "$srcdir"; then
555   ac_srcdir_defaulted=yes
556   # Try the directory containing this script, then its parent.
557   ac_prog=$0
558   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
559   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
560   srcdir=$ac_confdir
561   if test ! -r $srcdir/$ac_unique_file; then
562     srcdir=..
563   fi
564 else
565   ac_srcdir_defaulted=no
566 fi
567 if test ! -r $srcdir/$ac_unique_file; then
568   if test "$ac_srcdir_defaulted" = yes; then
569     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
570   else
571     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
572   fi
573 fi
574 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
575
576 # Prefer explicitly selected file to automatically selected ones.
577 if test -z "$CONFIG_SITE"; then
578   if test "x$prefix" != xNONE; then
579     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
580   else
581     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
582   fi
583 fi
584 for ac_site_file in $CONFIG_SITE; do
585   if test -r "$ac_site_file"; then
586     echo "loading site script $ac_site_file"
587     . "$ac_site_file"
588   fi
589 done
590
591 if test -r "$cache_file"; then
592   echo "loading cache $cache_file"
593   . $cache_file
594 else
595   echo "creating cache $cache_file"
596   > $cache_file
597 fi
598
599 ac_ext=c
600 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
601 ac_cpp='$CPP $CPPFLAGS'
602 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
603 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
604 cross_compiling=$ac_cv_prog_cc_cross
605
606 ac_exeext=
607 ac_objext=o
608 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
609   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
610   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
611     ac_n= ac_c='
612 ' ac_t='        '
613   else
614     ac_n=-n ac_c= ac_t=
615   fi
616 else
617   ac_n= ac_c='\c' ac_t=
618 fi
619
620
621
622
623 echo "current directory: `pwd`"
624 echo "command line was: $0 $@"
625
626
627 # After checking to see that --srcdir is correct (which AC_INIT does)
628 # check for some random other files that come later in the tar file,
629 # to make sure everything is here.
630 #
631 for d in driver utils hacks hacks/glx ; do
632   f=$srcdir/$d/Makefile.in
633   if test \! -r $f ; then
634     echo ""
635     echo "ERROR: The package is incomplete: $f does not exist."
636     echo "       This probably means that your download was truncated."
637     echo ""
638     exit 1
639   fi
640 done
641
642
643 ###############################################################################
644 #
645 #       Function to figure out how to run the compiler.
646 #
647 ###############################################################################
648
649
650
651
652 ###############################################################################
653 #
654 #       Functions to figure out how to disable // comments in ANSI C code.
655 #
656 #       (With recent gcc, this is done with "-std=c89".  With older gcc, this
657 #       is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
658 #       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
659 #       so much for compatibility!)
660 #
661 ###############################################################################
662
663
664
665
666
667
668 ###############################################################################
669 #
670 #       Function to figure out how to create directory trees.
671 #
672 ###############################################################################
673
674
675
676
677 ###############################################################################
678 #
679 #       Function to check whether gettimeofday() exists, and how to call it.
680 #       This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
681 #
682 ###############################################################################
683
684
685
686
687 ###############################################################################
688 #
689 #       Function to find perl5 (defines PERL and PERL_VERSION.)
690 #
691 ###############################################################################
692
693 # M4 sucks!!  perl sucks too!!
694
695 perl_version_cmd='print $]'
696
697
698
699
700
701 ###############################################################################
702 #
703 #       Function to demand "bc".  Losers.
704 #
705 ###############################################################################
706
707
708
709 ###############################################################################
710 #
711 #       Functions to check how to do ICMP PING requests.
712 #
713 ###############################################################################
714
715
716
717
718
719
720 ###############################################################################
721 #
722 #       Functions to check for various X11 crap.
723 #
724 ###############################################################################
725
726 # Try and find the app-defaults directory.
727 # It sucks that autoconf doesn't do this already...
728 #
729
730
731
732
733
734
735
736
737
738
739 # Random special-cases for X on certain pathological OSes.
740 # You know who you are.
741 #
742
743
744
745
746 ###############################################################################
747 #
748 #       Some utility functions to make checking for X things easier.
749 #
750 ###############################################################################
751
752 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
753 #
754
755
756 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
757 #
758
759
760 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
761 #
762
763
764
765 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
766 # Use this sparingly; it probably doesn't work very well on X programs.
767 #
768
769
770 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
771 # (But not the -L directories!)
772 #
773
774
775
776
777 # Usage: HANDLE_X_PATH_ARG([variable_name],
778 #                          [--command-line-option],
779 #                          [descriptive string])
780 #
781 # All of the --with options take three forms:
782 #
783 #   --with-foo (or --with-foo=yes)
784 #   --without-foo (or --with-foo=no)
785 #   --with-foo=/DIR
786 #
787 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
788 # a directory (string beginning with a slash) it checks to see whether
789 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
790 # as appropriate.
791 #
792
793
794
795
796 ###############################################################################
797 ###############################################################################
798 #
799 #       End of function definitions.  Now start actually executing stuff.
800 #
801 ###############################################################################
802 ###############################################################################
803
804 # random compiler setup
805 ac_aux_dir=
806 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
807   if test -f $ac_dir/install-sh; then
808     ac_aux_dir=$ac_dir
809     ac_install_sh="$ac_aux_dir/install-sh -c"
810     break
811   elif test -f $ac_dir/install.sh; then
812     ac_aux_dir=$ac_dir
813     ac_install_sh="$ac_aux_dir/install.sh -c"
814     break
815   fi
816 done
817 if test -z "$ac_aux_dir"; then
818   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
819 fi
820 ac_config_guess=$ac_aux_dir/config.guess
821 ac_config_sub=$ac_aux_dir/config.sub
822 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
823
824
825 # Make sure we can run config.sub.
826 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
827 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
828 fi
829
830 echo $ac_n "checking host system type""... $ac_c" 1>&6
831 echo "configure:843: checking host system type" >&5
832
833 host_alias=$host
834 case "$host_alias" in
835 NONE)
836   case $nonopt in
837   NONE)
838     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
839     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
840     fi ;;
841   *) host_alias=$nonopt ;;
842   esac ;;
843 esac
844
845 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
846 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
847 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
848 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
849 echo "$ac_t""$host" 1>&6
850
851 # Extract the first word of "gcc", so it can be a program name with args.
852 set dummy gcc; ac_word=$2
853 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
854 echo "configure:866: checking for $ac_word" >&5
855 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
856   echo $ac_n "(cached) $ac_c" 1>&6
857 else
858   if test -n "$CC"; then
859   ac_cv_prog_CC="$CC" # Let the user override the test.
860 else
861   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
862   ac_dummy="$PATH"
863   for ac_dir in $ac_dummy; do
864     test -z "$ac_dir" && ac_dir=.
865     if test -f $ac_dir/$ac_word; then
866       ac_cv_prog_CC="gcc"
867       break
868     fi
869   done
870   IFS="$ac_save_ifs"
871 fi
872 fi
873 CC="$ac_cv_prog_CC"
874 if test -n "$CC"; then
875   echo "$ac_t""$CC" 1>&6
876 else
877   echo "$ac_t""no" 1>&6
878 fi
879
880 if test -z "$CC"; then
881   # Extract the first word of "cc", so it can be a program name with args.
882 set dummy cc; ac_word=$2
883 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
884 echo "configure:896: checking for $ac_word" >&5
885 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
886   echo $ac_n "(cached) $ac_c" 1>&6
887 else
888   if test -n "$CC"; then
889   ac_cv_prog_CC="$CC" # Let the user override the test.
890 else
891   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
892   ac_prog_rejected=no
893   ac_dummy="$PATH"
894   for ac_dir in $ac_dummy; do
895     test -z "$ac_dir" && ac_dir=.
896     if test -f $ac_dir/$ac_word; then
897       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
898         ac_prog_rejected=yes
899         continue
900       fi
901       ac_cv_prog_CC="cc"
902       break
903     fi
904   done
905   IFS="$ac_save_ifs"
906 if test $ac_prog_rejected = yes; then
907   # We found a bogon in the path, so make sure we never use it.
908   set dummy $ac_cv_prog_CC
909   shift
910   if test $# -gt 0; then
911     # We chose a different compiler from the bogus one.
912     # However, it has the same basename, so the bogon will be chosen
913     # first if we set CC to just the basename; use the full file name.
914     shift
915     set dummy "$ac_dir/$ac_word" "$@"
916     shift
917     ac_cv_prog_CC="$@"
918   fi
919 fi
920 fi
921 fi
922 CC="$ac_cv_prog_CC"
923 if test -n "$CC"; then
924   echo "$ac_t""$CC" 1>&6
925 else
926   echo "$ac_t""no" 1>&6
927 fi
928
929   if test -z "$CC"; then
930     case "`uname -s`" in
931     *win32* | *WIN32*)
932       # Extract the first word of "cl", so it can be a program name with args.
933 set dummy cl; ac_word=$2
934 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
935 echo "configure:947: checking for $ac_word" >&5
936 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
937   echo $ac_n "(cached) $ac_c" 1>&6
938 else
939   if test -n "$CC"; then
940   ac_cv_prog_CC="$CC" # Let the user override the test.
941 else
942   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
943   ac_dummy="$PATH"
944   for ac_dir in $ac_dummy; do
945     test -z "$ac_dir" && ac_dir=.
946     if test -f $ac_dir/$ac_word; then
947       ac_cv_prog_CC="cl"
948       break
949     fi
950   done
951   IFS="$ac_save_ifs"
952 fi
953 fi
954 CC="$ac_cv_prog_CC"
955 if test -n "$CC"; then
956   echo "$ac_t""$CC" 1>&6
957 else
958   echo "$ac_t""no" 1>&6
959 fi
960  ;;
961     esac
962   fi
963   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
964 fi
965
966 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
967 echo "configure:979: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
968
969 ac_ext=c
970 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
971 ac_cpp='$CPP $CPPFLAGS'
972 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
973 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
974 cross_compiling=$ac_cv_prog_cc_cross
975
976 cat > conftest.$ac_ext << EOF
977
978 #line 990 "configure"
979 #include "confdefs.h"
980
981 main(){return(0);}
982 EOF
983 if { (eval echo configure:995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
984   ac_cv_prog_cc_works=yes
985   # If we can't run a trivial program, we are probably using a cross compiler.
986   if (./conftest; exit) 2>/dev/null; then
987     ac_cv_prog_cc_cross=no
988   else
989     ac_cv_prog_cc_cross=yes
990   fi
991 else
992   echo "configure: failed program was:" >&5
993   cat conftest.$ac_ext >&5
994   ac_cv_prog_cc_works=no
995 fi
996 rm -fr conftest*
997 ac_ext=c
998 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
999 ac_cpp='$CPP $CPPFLAGS'
1000 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1001 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1002 cross_compiling=$ac_cv_prog_cc_cross
1003
1004 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1005 if test $ac_cv_prog_cc_works = no; then
1006   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1007 fi
1008 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1009 echo "configure:1021: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1010 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1011 cross_compiling=$ac_cv_prog_cc_cross
1012
1013 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1014 echo "configure:1026: checking whether we are using GNU C" >&5
1015 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1016   echo $ac_n "(cached) $ac_c" 1>&6
1017 else
1018   cat > conftest.c <<EOF
1019 #ifdef __GNUC__
1020   yes;
1021 #endif
1022 EOF
1023 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1024   ac_cv_prog_gcc=yes
1025 else
1026   ac_cv_prog_gcc=no
1027 fi
1028 fi
1029
1030 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1031
1032 if test $ac_cv_prog_gcc = yes; then
1033   GCC=yes
1034 else
1035   GCC=
1036 fi
1037
1038 ac_test_CFLAGS="${CFLAGS+set}"
1039 ac_save_CFLAGS="$CFLAGS"
1040 CFLAGS=
1041 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1042 echo "configure:1054: checking whether ${CC-cc} accepts -g" >&5
1043 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1044   echo $ac_n "(cached) $ac_c" 1>&6
1045 else
1046   echo 'void f(){}' > conftest.c
1047 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1048   ac_cv_prog_cc_g=yes
1049 else
1050   ac_cv_prog_cc_g=no
1051 fi
1052 rm -f conftest*
1053
1054 fi
1055
1056 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1057 if test "$ac_test_CFLAGS" = set; then
1058   CFLAGS="$ac_save_CFLAGS"
1059 elif test $ac_cv_prog_cc_g = yes; then
1060   if test "$GCC" = yes; then
1061     CFLAGS="-g -O2"
1062   else
1063     CFLAGS="-g"
1064   fi
1065 else
1066   if test "$GCC" = yes; then
1067     CFLAGS="-O2"
1068   else
1069     CFLAGS=
1070   fi
1071 fi
1072
1073
1074   if test -z "$GCC"; then
1075     echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
1076 echo "configure:1088: checking how to request ANSI compilation" >&5
1077     case "$host" in
1078       *-hpux* )
1079         echo "$ac_t""HPUX: adding -Ae" 1>&6
1080         CC="$CC -Ae"
1081       ;;
1082       *-aix* )
1083         echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
1084         CC="$CC -qlanglvl=ansi -qhalt=e"
1085       ;;
1086
1087       *-dec-* )
1088         echo "$ac_t""DEC: adding -std1 -ieee" 1>&6
1089         CC="$CC -std1"
1090       ;;
1091
1092       *)
1093         echo "$ac_t""no idea" 1>&6
1094       ;;
1095     esac
1096   fi
1097
1098   echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
1099 echo "configure:1111: checking whether the compiler works on ANSI C" >&5
1100   if test "$cross_compiling" = yes; then
1101   { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1102 else
1103   cat > conftest.$ac_ext <<EOF
1104 #line 1116 "configure"
1105 #include "confdefs.h"
1106  main(int ac, char **av) { return 0; } 
1107 EOF
1108 if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1109 then
1110   echo "$ac_t""yes" 1>&6
1111 else
1112   echo "configure: failed program was:" >&5
1113   cat conftest.$ac_ext >&5
1114   rm -fr conftest*
1115   echo "$ac_t""no" 1>&6
1116      { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1117 fi
1118 rm -fr conftest*
1119 fi
1120
1121
1122   if test -n "$GCC"; then
1123     echo "$ac_t""Turning on gcc compiler warnings." 1>&6
1124     CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
1125   else
1126     case "$host" in
1127       *-irix5* |*-irix6.0-3* )
1128         echo "$ac_t""Turning on SGI compiler warnings." 1>&6
1129         CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
1130       ;;
1131 #     *-dec-osf* )
1132 #       if test -z "$GCC"; then
1133 #         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
1134 #         CC="$CC -migrate -w0 -verbose -warnprotos"
1135 #       fi
1136 #     ;;
1137     esac
1138   fi
1139
1140 if test -n "$GCC"; then
1141    if test -n "$GCC"; then
1142    echo $ac_n "checking whether gcc accepts -std""... $ac_c" 1>&6
1143 echo "configure:1155: checking whether gcc accepts -std" >&5
1144 if eval "test \"`echo '$''{'ac_cv_gcc_accepts_std'+set}'`\" = set"; then
1145   echo $ac_n "(cached) $ac_c" 1>&6
1146 else
1147   if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
1148           grep unrecognized >/dev/null ); then
1149        ac_cv_gcc_accepts_std=no
1150      else
1151        ac_cv_gcc_accepts_std=yes
1152      fi
1153 fi
1154
1155 echo "$ac_t""$ac_cv_gcc_accepts_std" 1>&6
1156    ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
1157   fi
1158
1159    echo "$ac_t""Disabling C++ comments in ANSI C code." 1>&6
1160    #
1161    # The reason that // comments are banned from xscreensaver is that gcc is
1162    # basically the only compiler in the world that supports them in C code.
1163    # All other vendors support them only in their C++ compilers, not in their
1164    # ANSI C compilers.  This means that it's a portability problem: every time
1165    # these comments have snuck into the xscreensaver source code, I've gotten
1166    # complaints about it the next day.  So we turn off support for them in gcc
1167    # as well to prevent them from accidentially slipping in.
1168    #
1169    if test "$ac_gcc_accepts_std" = yes ; then
1170      #
1171      # -std=c89 defines __STRICT_ANSI__, which we don't want.
1172      # (That appears to be the only additional preprocessor symbol
1173      # it defines, in addition to the syntax changes it makes.)
1174      #
1175      # -std=gnu89 is no good, because // comments were a GNU extension
1176      # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
1177      # with -std=gnu89 but not with -std=c89.)
1178      #
1179      CC="$CC -std=c89 -U__STRICT_ANSI__"
1180    else
1181      # The old way:
1182      CC="$CC -Wp,-lang-c89"
1183    fi
1184   fi
1185
1186 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1187 echo "configure:1199: checking how to run the C preprocessor" >&5
1188 # On Suns, sometimes $CPP names a directory.
1189 if test -n "$CPP" && test -d "$CPP"; then
1190   CPP=
1191 fi
1192 if test -z "$CPP"; then
1193 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1194   echo $ac_n "(cached) $ac_c" 1>&6
1195 else
1196     # This must be in double quotes, not single quotes, because CPP may get
1197   # substituted into the Makefile and "${CC-cc}" will confuse make.
1198   CPP="${CC-cc} -E"
1199   # On the NeXT, cc -E runs the code through the compiler's parser,
1200   # not just through cpp.
1201   cat > conftest.$ac_ext <<EOF
1202 #line 1214 "configure"
1203 #include "confdefs.h"
1204 #include <assert.h>
1205 Syntax Error
1206 EOF
1207 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1208 { (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1209 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1210 if test -z "$ac_err"; then
1211   :
1212 else
1213   echo "$ac_err" >&5
1214   echo "configure: failed program was:" >&5
1215   cat conftest.$ac_ext >&5
1216   rm -rf conftest*
1217   CPP="${CC-cc} -E -traditional-cpp"
1218   cat > conftest.$ac_ext <<EOF
1219 #line 1231 "configure"
1220 #include "confdefs.h"
1221 #include <assert.h>
1222 Syntax Error
1223 EOF
1224 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1225 { (eval echo configure:1237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1226 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1227 if test -z "$ac_err"; then
1228   :
1229 else
1230   echo "$ac_err" >&5
1231   echo "configure: failed program was:" >&5
1232   cat conftest.$ac_ext >&5
1233   rm -rf conftest*
1234   CPP="${CC-cc} -nologo -E"
1235   cat > conftest.$ac_ext <<EOF
1236 #line 1248 "configure"
1237 #include "confdefs.h"
1238 #include <assert.h>
1239 Syntax Error
1240 EOF
1241 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1242 { (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1243 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1244 if test -z "$ac_err"; then
1245   :
1246 else
1247   echo "$ac_err" >&5
1248   echo "configure: failed program was:" >&5
1249   cat conftest.$ac_ext >&5
1250   rm -rf conftest*
1251   CPP=/lib/cpp
1252 fi
1253 rm -f conftest*
1254 fi
1255 rm -f conftest*
1256 fi
1257 rm -f conftest*
1258   ac_cv_prog_CPP="$CPP"
1259 fi
1260   CPP="$ac_cv_prog_CPP"
1261 else
1262   ac_cv_prog_CPP="$CPP"
1263 fi
1264 echo "$ac_t""$CPP" 1>&6
1265
1266 echo $ac_n "checking for working const""... $ac_c" 1>&6
1267 echo "configure:1279: checking for working const" >&5
1268 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1269   echo $ac_n "(cached) $ac_c" 1>&6
1270 else
1271   cat > conftest.$ac_ext <<EOF
1272 #line 1284 "configure"
1273 #include "confdefs.h"
1274
1275 int main() {
1276
1277 /* Ultrix mips cc rejects this.  */
1278 typedef int charset[2]; const charset x;
1279 /* SunOS 4.1.1 cc rejects this.  */
1280 char const *const *ccp;
1281 char **p;
1282 /* NEC SVR4.0.2 mips cc rejects this.  */
1283 struct point {int x, y;};
1284 static struct point const zero = {0,0};
1285 /* AIX XL C 1.02.0.0 rejects this.
1286    It does not let you subtract one const X* pointer from another in an arm
1287    of an if-expression whose if-part is not a constant expression */
1288 const char *g = "string";
1289 ccp = &g + (g ? g-g : 0);
1290 /* HPUX 7.0 cc rejects these. */
1291 ++ccp;
1292 p = (char**) ccp;
1293 ccp = (char const *const *) p;
1294 { /* SCO 3.2v4 cc rejects this.  */
1295   char *t;
1296   char const *s = 0 ? (char *) 0 : (char const *) 0;
1297
1298   *t++ = 0;
1299 }
1300 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1301   int x[] = {25, 17};
1302   const int *foo = &x[0];
1303   ++foo;
1304 }
1305 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1306   typedef const int *iptr;
1307   iptr p = 0;
1308   ++p;
1309 }
1310 { /* AIX XL C 1.02.0.0 rejects this saying
1311      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1312   struct s { int j; const int *ap[3]; };
1313   struct s *b; b->j = 5;
1314 }
1315 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1316   const int foo = 10;
1317 }
1318
1319 ; return 0; }
1320 EOF
1321 if { (eval echo configure:1333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1322   rm -rf conftest*
1323   ac_cv_c_const=yes
1324 else
1325   echo "configure: failed program was:" >&5
1326   cat conftest.$ac_ext >&5
1327   rm -rf conftest*
1328   ac_cv_c_const=no
1329 fi
1330 rm -f conftest*
1331 fi
1332
1333 echo "$ac_t""$ac_cv_c_const" 1>&6
1334 if test $ac_cv_c_const = no; then
1335   cat >> confdefs.h <<\EOF
1336 #define const 
1337 EOF
1338
1339 fi
1340
1341 echo $ac_n "checking for inline""... $ac_c" 1>&6
1342 echo "configure:1354: checking for inline" >&5
1343 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1344   echo $ac_n "(cached) $ac_c" 1>&6
1345 else
1346   ac_cv_c_inline=no
1347 for ac_kw in inline __inline__ __inline; do
1348   cat > conftest.$ac_ext <<EOF
1349 #line 1361 "configure"
1350 #include "confdefs.h"
1351
1352 int main() {
1353 } $ac_kw foo() {
1354 ; return 0; }
1355 EOF
1356 if { (eval echo configure:1368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1357   rm -rf conftest*
1358   ac_cv_c_inline=$ac_kw; break
1359 else
1360   echo "configure: failed program was:" >&5
1361   cat conftest.$ac_ext >&5
1362 fi
1363 rm -f conftest*
1364 done
1365
1366 fi
1367
1368 echo "$ac_t""$ac_cv_c_inline" 1>&6
1369 case "$ac_cv_c_inline" in
1370   inline | yes) ;;
1371   no) cat >> confdefs.h <<\EOF
1372 #define inline 
1373 EOF
1374  ;;
1375   *)  cat >> confdefs.h <<EOF
1376 #define inline $ac_cv_c_inline
1377 EOF
1378  ;;
1379 esac
1380
1381 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
1382 echo "configure:1394: checking for Cygwin environment" >&5
1383 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
1384   echo $ac_n "(cached) $ac_c" 1>&6
1385 else
1386   cat > conftest.$ac_ext <<EOF
1387 #line 1399 "configure"
1388 #include "confdefs.h"
1389
1390 int main() {
1391
1392 #ifndef __CYGWIN__
1393 #define __CYGWIN__ __CYGWIN32__
1394 #endif
1395 return __CYGWIN__;
1396 ; return 0; }
1397 EOF
1398 if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1399   rm -rf conftest*
1400   ac_cv_cygwin=yes
1401 else
1402   echo "configure: failed program was:" >&5
1403   cat conftest.$ac_ext >&5
1404   rm -rf conftest*
1405   ac_cv_cygwin=no
1406 fi
1407 rm -f conftest*
1408 rm -f conftest*
1409 fi
1410
1411 echo "$ac_t""$ac_cv_cygwin" 1>&6
1412 CYGWIN=
1413 test "$ac_cv_cygwin" = yes && CYGWIN=yes
1414 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
1415 echo "configure:1427: checking for mingw32 environment" >&5
1416 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
1417   echo $ac_n "(cached) $ac_c" 1>&6
1418 else
1419   cat > conftest.$ac_ext <<EOF
1420 #line 1432 "configure"
1421 #include "confdefs.h"
1422
1423 int main() {
1424 return __MINGW32__;
1425 ; return 0; }
1426 EOF
1427 if { (eval echo configure:1439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1428   rm -rf conftest*
1429   ac_cv_mingw32=yes
1430 else
1431   echo "configure: failed program was:" >&5
1432   cat conftest.$ac_ext >&5
1433   rm -rf conftest*
1434   ac_cv_mingw32=no
1435 fi
1436 rm -f conftest*
1437 rm -f conftest*
1438 fi
1439
1440 echo "$ac_t""$ac_cv_mingw32" 1>&6
1441 MINGW32=
1442 test "$ac_cv_mingw32" = yes && MINGW32=yes
1443
1444
1445 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
1446 echo "configure:1458: checking for executable suffix" >&5
1447 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
1448   echo $ac_n "(cached) $ac_c" 1>&6
1449 else
1450   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
1451   ac_cv_exeext=.exe
1452 else
1453   rm -f conftest*
1454   echo 'int main () { return 0; }' > conftest.$ac_ext
1455   ac_cv_exeext=
1456   if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1457     for file in conftest.*; do
1458       case $file in
1459       *.c | *.o | *.obj) ;;
1460       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
1461       esac
1462     done
1463   else
1464     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
1465   fi
1466   rm -f conftest*
1467   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
1468 fi
1469 fi
1470
1471 EXEEXT=""
1472 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
1473 echo "$ac_t""${ac_cv_exeext}" 1>&6
1474 ac_exeext=$EXEEXT
1475
1476 ac_bc_result=`echo 6+9 | bc 2>/dev/null`
1477   echo $ac_n "checking for bc""... $ac_c" 1>&6
1478 echo "configure:1490: checking for bc" >&5
1479   if test "$ac_bc_result" = "15" ; then
1480     echo "$ac_t""yes" 1>&6
1481   else
1482     echo "$ac_t""no" 1>&6
1483     echo ''
1484     { echo "configure: error: Your system doesn't have \"bc\", which has been a standard
1485                   part of Unix since the 1970s.  Come back when your vendor
1486                   has grown a clue." 1>&2; exit 1; }
1487   fi
1488  
1489
1490 # stuff for Makefiles
1491 # Find a good install program.  We prefer a C program (faster),
1492 # so one script is as good as another.  But avoid the broken or
1493 # incompatible versions:
1494 # SysV /etc/install, /usr/sbin/install
1495 # SunOS /usr/etc/install
1496 # IRIX /sbin/install
1497 # AIX /bin/install
1498 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1499 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1500 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1501 # ./install, which can be erroneously created by make from ./install.sh.
1502 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1503 echo "configure:1515: checking for a BSD compatible install" >&5
1504 if test -z "$INSTALL"; then
1505 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1506   echo $ac_n "(cached) $ac_c" 1>&6
1507 else
1508     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1509   for ac_dir in $PATH; do
1510     # Account for people who put trailing slashes in PATH elements.
1511     case "$ac_dir/" in
1512     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1513     *)
1514       # OSF1 and SCO ODT 3.0 have their own names for install.
1515       # Don't use installbsd from OSF since it installs stuff as root
1516       # by default.
1517       for ac_prog in ginstall scoinst install; do
1518         if test -f $ac_dir/$ac_prog; then
1519           if test $ac_prog = install &&
1520             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1521             # AIX install.  It has an incompatible calling convention.
1522             :
1523           else
1524             ac_cv_path_install="$ac_dir/$ac_prog -c"
1525             break 2
1526           fi
1527         fi
1528       done
1529       ;;
1530     esac
1531   done
1532   IFS="$ac_save_IFS"
1533
1534 fi
1535   if test "${ac_cv_path_install+set}" = set; then
1536     INSTALL="$ac_cv_path_install"
1537   else
1538     # As a last resort, use the slow shell script.  We don't cache a
1539     # path for INSTALL within a source directory, because that will
1540     # break other packages using the cache if that directory is
1541     # removed, or if the path is relative.
1542     INSTALL="$ac_install_sh"
1543   fi
1544 fi
1545 echo "$ac_t""$INSTALL" 1>&6
1546
1547 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1548 # It thinks the first close brace ends the variable substitution.
1549 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1550
1551 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1552
1553 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1554
1555 echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
1556 echo "configure:1568: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
1557 if eval "test \"`echo '$''{'ac_cv_install_d_creates_dirs'+set}'`\" = set"; then
1558   echo $ac_n "(cached) $ac_c" 1>&6
1559 else
1560   ac_cv_install_d_creates_dirs=no
1561      rm -rf conftestdir
1562      if mkdir conftestdir; then
1563        cd conftestdir >&-
1564        ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
1565        if test -d dir1/dir2/. ; then
1566          ac_cv_install_d_creates_dirs=yes
1567        fi
1568        cd .. >&-
1569        rm -rf conftestdir
1570      fi
1571     
1572 fi
1573
1574 echo "$ac_t""$ac_cv_install_d_creates_dirs" 1>&6
1575
1576   if test "$ac_cv_install_d_creates_dirs" = no ; then
1577     echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
1578 echo "configure:1590: checking whether \"mkdir -p\" creates intermediate directories" >&5
1579 if eval "test \"`echo '$''{'ac_cv_mkdir_p_creates_dirs'+set}'`\" = set"; then
1580   echo $ac_n "(cached) $ac_c" 1>&6
1581 else
1582   ac_cv_mkdir_p_creates_dirs=no
1583        rm -rf conftestdir
1584        if mkdir conftestdir; then
1585          cd conftestdir >&-
1586          mkdir -p dir1/dir2 >&- 2>&-
1587          if test -d dir1/dir2/. ; then
1588            ac_cv_mkdir_p_creates_dirs=yes
1589          fi
1590          cd .. >&-
1591          rm -rf conftestdir
1592        fi
1593       
1594 fi
1595
1596 echo "$ac_t""$ac_cv_mkdir_p_creates_dirs" 1>&6
1597   fi
1598
1599   if test "$ac_cv_install_d_creates_dirs" = yes ; then
1600     INSTALL_DIRS='${INSTALL} -d'
1601   elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
1602     INSTALL_DIRS='mkdir -p'
1603   else
1604     # any other ideas?
1605     INSTALL_DIRS='${INSTALL} -d'
1606   fi
1607
1608 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1609 echo "configure:1621: checking whether ${MAKE-make} sets \${MAKE}" >&5
1610 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1611 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1612   echo $ac_n "(cached) $ac_c" 1>&6
1613 else
1614   cat > conftestmake <<\EOF
1615 all:
1616         @echo 'ac_maketemp="${MAKE}"'
1617 EOF
1618 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1619 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1620 if test -n "$ac_maketemp"; then
1621   eval ac_cv_prog_make_${ac_make}_set=yes
1622 else
1623   eval ac_cv_prog_make_${ac_make}_set=no
1624 fi
1625 rm -f conftestmake
1626 fi
1627 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1628   echo "$ac_t""yes" 1>&6
1629   SET_MAKE=
1630 else
1631   echo "$ac_t""no" 1>&6
1632   SET_MAKE="MAKE=${MAKE-make}"
1633 fi
1634
1635
1636 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1637 # That's wrong: it should be set to '${INSTALL}', so that one can
1638 # implement the "install-strip" target properly (strip executables,
1639 # but do not try to strip scripts.)
1640 #
1641 INSTALL_SCRIPT='${INSTALL}'
1642
1643 # random libc stuff
1644 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1645 echo "configure:1657: checking for ANSI C header files" >&5
1646 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1647   echo $ac_n "(cached) $ac_c" 1>&6
1648 else
1649   cat > conftest.$ac_ext <<EOF
1650 #line 1662 "configure"
1651 #include "confdefs.h"
1652 #include <stdlib.h>
1653 #include <stdarg.h>
1654 #include <string.h>
1655 #include <float.h>
1656 EOF
1657 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1658 { (eval echo configure:1670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1659 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1660 if test -z "$ac_err"; then
1661   rm -rf conftest*
1662   ac_cv_header_stdc=yes
1663 else
1664   echo "$ac_err" >&5
1665   echo "configure: failed program was:" >&5
1666   cat conftest.$ac_ext >&5
1667   rm -rf conftest*
1668   ac_cv_header_stdc=no
1669 fi
1670 rm -f conftest*
1671
1672 if test $ac_cv_header_stdc = yes; then
1673   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1674 cat > conftest.$ac_ext <<EOF
1675 #line 1687 "configure"
1676 #include "confdefs.h"
1677 #include <string.h>
1678 EOF
1679 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1680   egrep "memchr" >/dev/null 2>&1; then
1681   :
1682 else
1683   rm -rf conftest*
1684   ac_cv_header_stdc=no
1685 fi
1686 rm -f conftest*
1687
1688 fi
1689
1690 if test $ac_cv_header_stdc = yes; then
1691   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1692 cat > conftest.$ac_ext <<EOF
1693 #line 1705 "configure"
1694 #include "confdefs.h"
1695 #include <stdlib.h>
1696 EOF
1697 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1698   egrep "free" >/dev/null 2>&1; then
1699   :
1700 else
1701   rm -rf conftest*
1702   ac_cv_header_stdc=no
1703 fi
1704 rm -f conftest*
1705
1706 fi
1707
1708 if test $ac_cv_header_stdc = yes; then
1709   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1710 if test "$cross_compiling" = yes; then
1711   :
1712 else
1713   cat > conftest.$ac_ext <<EOF
1714 #line 1726 "configure"
1715 #include "confdefs.h"
1716 #include <ctype.h>
1717 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1718 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1719 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1720 int main () { int i; for (i = 0; i < 256; i++)
1721 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1722 exit (0); }
1723
1724 EOF
1725 if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1726 then
1727   :
1728 else
1729   echo "configure: failed program was:" >&5
1730   cat conftest.$ac_ext >&5
1731   rm -fr conftest*
1732   ac_cv_header_stdc=no
1733 fi
1734 rm -fr conftest*
1735 fi
1736
1737 fi
1738 fi
1739
1740 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1741 if test $ac_cv_header_stdc = yes; then
1742   cat >> confdefs.h <<\EOF
1743 #define STDC_HEADERS 1
1744 EOF
1745
1746 fi
1747
1748 for ac_hdr in unistd.h
1749 do
1750 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1751 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1752 echo "configure:1764: checking for $ac_hdr" >&5
1753 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1754   echo $ac_n "(cached) $ac_c" 1>&6
1755 else
1756   cat > conftest.$ac_ext <<EOF
1757 #line 1769 "configure"
1758 #include "confdefs.h"
1759 #include <$ac_hdr>
1760 EOF
1761 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1762 { (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1763 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1764 if test -z "$ac_err"; then
1765   rm -rf conftest*
1766   eval "ac_cv_header_$ac_safe=yes"
1767 else
1768   echo "$ac_err" >&5
1769   echo "configure: failed program was:" >&5
1770   cat conftest.$ac_ext >&5
1771   rm -rf conftest*
1772   eval "ac_cv_header_$ac_safe=no"
1773 fi
1774 rm -f conftest*
1775 fi
1776 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1777   echo "$ac_t""yes" 1>&6
1778     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1779   cat >> confdefs.h <<EOF
1780 #define $ac_tr_hdr 1
1781 EOF
1782  
1783 else
1784   echo "$ac_t""no" 1>&6
1785 fi
1786 done
1787
1788 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
1789 echo "configure:1801: checking for mode_t" >&5
1790 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
1791   echo $ac_n "(cached) $ac_c" 1>&6
1792 else
1793   cat > conftest.$ac_ext <<EOF
1794 #line 1806 "configure"
1795 #include "confdefs.h"
1796 #include <sys/types.h>
1797 #if STDC_HEADERS
1798 #include <stdlib.h>
1799 #include <stddef.h>
1800 #endif
1801 EOF
1802 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1803   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1804   rm -rf conftest*
1805   ac_cv_type_mode_t=yes
1806 else
1807   rm -rf conftest*
1808   ac_cv_type_mode_t=no
1809 fi
1810 rm -f conftest*
1811
1812 fi
1813 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
1814 if test $ac_cv_type_mode_t = no; then
1815   cat >> confdefs.h <<\EOF
1816 #define mode_t int
1817 EOF
1818
1819 fi
1820
1821 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1822 echo "configure:1834: checking for pid_t" >&5
1823 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1824   echo $ac_n "(cached) $ac_c" 1>&6
1825 else
1826   cat > conftest.$ac_ext <<EOF
1827 #line 1839 "configure"
1828 #include "confdefs.h"
1829 #include <sys/types.h>
1830 #if STDC_HEADERS
1831 #include <stdlib.h>
1832 #include <stddef.h>
1833 #endif
1834 EOF
1835 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1836   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1837   rm -rf conftest*
1838   ac_cv_type_pid_t=yes
1839 else
1840   rm -rf conftest*
1841   ac_cv_type_pid_t=no
1842 fi
1843 rm -f conftest*
1844
1845 fi
1846 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1847 if test $ac_cv_type_pid_t = no; then
1848   cat >> confdefs.h <<\EOF
1849 #define pid_t int
1850 EOF
1851
1852 fi
1853
1854 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1855 echo "configure:1867: checking for size_t" >&5
1856 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1857   echo $ac_n "(cached) $ac_c" 1>&6
1858 else
1859   cat > conftest.$ac_ext <<EOF
1860 #line 1872 "configure"
1861 #include "confdefs.h"
1862 #include <sys/types.h>
1863 #if STDC_HEADERS
1864 #include <stdlib.h>
1865 #include <stddef.h>
1866 #endif
1867 EOF
1868 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1869   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1870   rm -rf conftest*
1871   ac_cv_type_size_t=yes
1872 else
1873   rm -rf conftest*
1874   ac_cv_type_size_t=no
1875 fi
1876 rm -f conftest*
1877
1878 fi
1879 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1880 if test $ac_cv_type_size_t = no; then
1881   cat >> confdefs.h <<\EOF
1882 #define size_t unsigned
1883 EOF
1884
1885 fi
1886
1887 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1888 echo "configure:1900: checking return type of signal handlers" >&5
1889 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1890   echo $ac_n "(cached) $ac_c" 1>&6
1891 else
1892   cat > conftest.$ac_ext <<EOF
1893 #line 1905 "configure"
1894 #include "confdefs.h"
1895 #include <sys/types.h>
1896 #include <signal.h>
1897 #ifdef signal
1898 #undef signal
1899 #endif
1900 #ifdef __cplusplus
1901 extern "C" void (*signal (int, void (*)(int)))(int);
1902 #else
1903 void (*signal ()) ();
1904 #endif
1905
1906 int main() {
1907 int i;
1908 ; return 0; }
1909 EOF
1910 if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1911   rm -rf conftest*
1912   ac_cv_type_signal=void
1913 else
1914   echo "configure: failed program was:" >&5
1915   cat conftest.$ac_ext >&5
1916   rm -rf conftest*
1917   ac_cv_type_signal=int
1918 fi
1919 rm -f conftest*
1920 fi
1921
1922 echo "$ac_t""$ac_cv_type_signal" 1>&6
1923 cat >> confdefs.h <<EOF
1924 #define RETSIGTYPE $ac_cv_type_signal
1925 EOF
1926
1927
1928 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1929 echo "configure:1941: checking whether time.h and sys/time.h may both be included" >&5
1930 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1931   echo $ac_n "(cached) $ac_c" 1>&6
1932 else
1933   cat > conftest.$ac_ext <<EOF
1934 #line 1946 "configure"
1935 #include "confdefs.h"
1936 #include <sys/types.h>
1937 #include <sys/time.h>
1938 #include <time.h>
1939 int main() {
1940 struct tm *tp;
1941 ; return 0; }
1942 EOF
1943 if { (eval echo configure:1955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1944   rm -rf conftest*
1945   ac_cv_header_time=yes
1946 else
1947   echo "configure: failed program was:" >&5
1948   cat conftest.$ac_ext >&5
1949   rm -rf conftest*
1950   ac_cv_header_time=no
1951 fi
1952 rm -f conftest*
1953 fi
1954
1955 echo "$ac_t""$ac_cv_header_time" 1>&6
1956 if test $ac_cv_header_time = yes; then
1957   cat >> confdefs.h <<\EOF
1958 #define TIME_WITH_SYS_TIME 1
1959 EOF
1960
1961 fi
1962
1963 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1964 echo "configure:1976: checking for sys/wait.h that is POSIX.1 compatible" >&5
1965 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1966   echo $ac_n "(cached) $ac_c" 1>&6
1967 else
1968   cat > conftest.$ac_ext <<EOF
1969 #line 1981 "configure"
1970 #include "confdefs.h"
1971 #include <sys/types.h>
1972 #include <sys/wait.h>
1973 #ifndef WEXITSTATUS
1974 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1975 #endif
1976 #ifndef WIFEXITED
1977 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1978 #endif
1979 int main() {
1980 int s;
1981 wait (&s);
1982 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1983 ; return 0; }
1984 EOF
1985 if { (eval echo configure:1997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1986   rm -rf conftest*
1987   ac_cv_header_sys_wait_h=yes
1988 else
1989   echo "configure: failed program was:" >&5
1990   cat conftest.$ac_ext >&5
1991   rm -rf conftest*
1992   ac_cv_header_sys_wait_h=no
1993 fi
1994 rm -f conftest*
1995 fi
1996
1997 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1998 if test $ac_cv_header_sys_wait_h = yes; then
1999   cat >> confdefs.h <<\EOF
2000 #define HAVE_SYS_WAIT_H 1
2001 EOF
2002
2003 fi
2004
2005 ac_header_dirent=no
2006 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
2007 do
2008 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2009 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
2010 echo "configure:2022: checking for $ac_hdr that defines DIR" >&5
2011 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
2012   echo $ac_n "(cached) $ac_c" 1>&6
2013 else
2014   cat > conftest.$ac_ext <<EOF
2015 #line 2027 "configure"
2016 #include "confdefs.h"
2017 #include <sys/types.h>
2018 #include <$ac_hdr>
2019 int main() {
2020 DIR *dirp = 0;
2021 ; return 0; }
2022 EOF
2023 if { (eval echo configure:2035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2024   rm -rf conftest*
2025   eval "ac_cv_header_dirent_$ac_safe=yes"
2026 else
2027   echo "configure: failed program was:" >&5
2028   cat conftest.$ac_ext >&5
2029   rm -rf conftest*
2030   eval "ac_cv_header_dirent_$ac_safe=no"
2031 fi
2032 rm -f conftest*
2033 fi
2034 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
2035   echo "$ac_t""yes" 1>&6
2036     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2037   cat >> confdefs.h <<EOF
2038 #define $ac_tr_hdr 1
2039 EOF
2040  ac_header_dirent=$ac_hdr; break
2041 else
2042   echo "$ac_t""no" 1>&6
2043 fi
2044 done
2045 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
2046 if test $ac_header_dirent = dirent.h; then
2047 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
2048 echo "configure:2060: checking for opendir in -ldir" >&5
2049 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
2050 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2051   echo $ac_n "(cached) $ac_c" 1>&6
2052 else
2053   ac_save_LIBS="$LIBS"
2054 LIBS="-ldir  $LIBS"
2055 cat > conftest.$ac_ext <<EOF
2056 #line 2068 "configure"
2057 #include "confdefs.h"
2058 /* Override any gcc2 internal prototype to avoid an error.  */
2059 /* We use char because int might match the return type of a gcc2
2060     builtin and then its argument prototype would still apply.  */
2061 char opendir();
2062
2063 int main() {
2064 opendir()
2065 ; return 0; }
2066 EOF
2067 if { (eval echo configure:2079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2068   rm -rf conftest*
2069   eval "ac_cv_lib_$ac_lib_var=yes"
2070 else
2071   echo "configure: failed program was:" >&5
2072   cat conftest.$ac_ext >&5
2073   rm -rf conftest*
2074   eval "ac_cv_lib_$ac_lib_var=no"
2075 fi
2076 rm -f conftest*
2077 LIBS="$ac_save_LIBS"
2078
2079 fi
2080 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2081   echo "$ac_t""yes" 1>&6
2082   LIBS="$LIBS -ldir"
2083 else
2084   echo "$ac_t""no" 1>&6
2085 fi
2086
2087 else
2088 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
2089 echo "configure:2101: checking for opendir in -lx" >&5
2090 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
2091 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2092   echo $ac_n "(cached) $ac_c" 1>&6
2093 else
2094   ac_save_LIBS="$LIBS"
2095 LIBS="-lx  $LIBS"
2096 cat > conftest.$ac_ext <<EOF
2097 #line 2109 "configure"
2098 #include "confdefs.h"
2099 /* Override any gcc2 internal prototype to avoid an error.  */
2100 /* We use char because int might match the return type of a gcc2
2101     builtin and then its argument prototype would still apply.  */
2102 char opendir();
2103
2104 int main() {
2105 opendir()
2106 ; return 0; }
2107 EOF
2108 if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2109   rm -rf conftest*
2110   eval "ac_cv_lib_$ac_lib_var=yes"
2111 else
2112   echo "configure: failed program was:" >&5
2113   cat conftest.$ac_ext >&5
2114   rm -rf conftest*
2115   eval "ac_cv_lib_$ac_lib_var=no"
2116 fi
2117 rm -f conftest*
2118 LIBS="$ac_save_LIBS"
2119
2120 fi
2121 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2122   echo "$ac_t""yes" 1>&6
2123   LIBS="$LIBS -lx"
2124 else
2125   echo "$ac_t""no" 1>&6
2126 fi
2127
2128 fi
2129
2130 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
2131 echo "configure:2143: checking how to call gettimeofday" >&5
2132   if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
2133   echo $ac_n "(cached) $ac_c" 1>&6
2134 else
2135   cat > conftest.$ac_ext <<EOF
2136 #line 2148 "configure"
2137 #include "confdefs.h"
2138 #include <stdlib.h>
2139                     #include <sys/time.h>
2140 int main() {
2141 struct timeval tv; struct timezone tzp;
2142                     gettimeofday(&tv, &tzp);
2143 ; return 0; }
2144 EOF
2145 if { (eval echo configure:2157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2146   rm -rf conftest*
2147   ac_gettimeofday_args=2
2148 else
2149   echo "configure: failed program was:" >&5
2150   cat conftest.$ac_ext >&5
2151   rm -rf conftest*
2152   cat > conftest.$ac_ext <<EOF
2153 #line 2165 "configure"
2154 #include "confdefs.h"
2155 #include <stdlib.h>
2156                                     #include <sys/time.h>
2157 int main() {
2158 struct timeval tv; gettimeofday(&tv);
2159 ; return 0; }
2160 EOF
2161 if { (eval echo configure:2173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2162   rm -rf conftest*
2163   ac_gettimeofday_args=1
2164 else
2165   echo "configure: failed program was:" >&5
2166   cat conftest.$ac_ext >&5
2167   rm -rf conftest*
2168   ac_gettimeofday_args=0
2169 fi
2170 rm -f conftest*
2171 fi
2172 rm -f conftest*
2173     ac_cv_gettimeofday_args=$ac_gettimeofday_args
2174 fi
2175
2176   ac_gettimeofday_args=$ac_cv_gettimeofday_args
2177   if test "$ac_gettimeofday_args" = 1 ; then
2178     cat >> confdefs.h <<\EOF
2179 #define HAVE_GETTIMEOFDAY 1
2180 EOF
2181
2182     echo "$ac_t""one argument" 1>&6
2183   elif test "$ac_gettimeofday_args" = 2 ; then
2184     cat >> confdefs.h <<\EOF
2185 #define HAVE_GETTIMEOFDAY 1
2186 EOF
2187
2188     cat >> confdefs.h <<\EOF
2189 #define GETTIMEOFDAY_TWO_ARGS 1
2190 EOF
2191
2192     echo "$ac_t""two arguments" 1>&6
2193   else
2194     echo "$ac_t""unknown" 1>&6
2195   fi
2196
2197 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv sbrk
2198 do
2199 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2200 echo "configure:2212: checking for $ac_func" >&5
2201 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2202   echo $ac_n "(cached) $ac_c" 1>&6
2203 else
2204   cat > conftest.$ac_ext <<EOF
2205 #line 2217 "configure"
2206 #include "confdefs.h"
2207 /* System header to define __stub macros and hopefully few prototypes,
2208     which can conflict with char $ac_func(); below.  */
2209 #include <assert.h>
2210 /* Override any gcc2 internal prototype to avoid an error.  */
2211 /* We use char because int might match the return type of a gcc2
2212     builtin and then its argument prototype would still apply.  */
2213 char $ac_func();
2214
2215 int main() {
2216
2217 /* The GNU C library defines this for functions which it implements
2218     to always fail with ENOSYS.  Some functions are actually named
2219     something starting with __ and the normal name is an alias.  */
2220 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2221 choke me
2222 #else
2223 $ac_func();
2224 #endif
2225
2226 ; return 0; }
2227 EOF
2228 if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2229   rm -rf conftest*
2230   eval "ac_cv_func_$ac_func=yes"
2231 else
2232   echo "configure: failed program was:" >&5
2233   cat conftest.$ac_ext >&5
2234   rm -rf conftest*
2235   eval "ac_cv_func_$ac_func=no"
2236 fi
2237 rm -f conftest*
2238 fi
2239
2240 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2241   echo "$ac_t""yes" 1>&6
2242     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2243   cat >> confdefs.h <<EOF
2244 #define $ac_tr_func 1
2245 EOF
2246  
2247 else
2248   echo "$ac_t""no" 1>&6
2249 fi
2250 done
2251
2252
2253 for ac_func in sigaction syslog realpath setrlimit
2254 do
2255 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2256 echo "configure:2268: checking for $ac_func" >&5
2257 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2258   echo $ac_n "(cached) $ac_c" 1>&6
2259 else
2260   cat > conftest.$ac_ext <<EOF
2261 #line 2273 "configure"
2262 #include "confdefs.h"
2263 /* System header to define __stub macros and hopefully few prototypes,
2264     which can conflict with char $ac_func(); below.  */
2265 #include <assert.h>
2266 /* Override any gcc2 internal prototype to avoid an error.  */
2267 /* We use char because int might match the return type of a gcc2
2268     builtin and then its argument prototype would still apply.  */
2269 char $ac_func();
2270
2271 int main() {
2272
2273 /* The GNU C library defines this for functions which it implements
2274     to always fail with ENOSYS.  Some functions are actually named
2275     something starting with __ and the normal name is an alias.  */
2276 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2277 choke me
2278 #else
2279 $ac_func();
2280 #endif
2281
2282 ; return 0; }
2283 EOF
2284 if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2285   rm -rf conftest*
2286   eval "ac_cv_func_$ac_func=yes"
2287 else
2288   echo "configure: failed program was:" >&5
2289   cat conftest.$ac_ext >&5
2290   rm -rf conftest*
2291   eval "ac_cv_func_$ac_func=no"
2292 fi
2293 rm -f conftest*
2294 fi
2295
2296 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2297   echo "$ac_t""yes" 1>&6
2298     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2299   cat >> confdefs.h <<EOF
2300 #define $ac_tr_func 1
2301 EOF
2302  
2303 else
2304   echo "$ac_t""no" 1>&6
2305 fi
2306 done
2307
2308 echo $ac_n "checking for struct icmp""... $ac_c" 1>&6
2309 echo "configure:2321: checking for struct icmp" >&5
2310 if eval "test \"`echo '$''{'ac_cv_have_icmp'+set}'`\" = set"; then
2311   echo $ac_n "(cached) $ac_c" 1>&6
2312 else
2313   cat > conftest.$ac_ext <<EOF
2314 #line 2326 "configure"
2315 #include "confdefs.h"
2316 #include <stdlib.h>
2317                    #include <stdio.h>
2318                    #include <math.h>
2319                    #include <unistd.h>
2320                    #include <limits.h>
2321                    #include <signal.h>
2322                    #include <fcntl.h>
2323                    #include <sys/types.h>
2324                    #include <sys/time.h>
2325                    #include <sys/ipc.h>
2326                    #include <sys/shm.h>
2327                    #include <sys/socket.h>
2328                    #include <netinet/in_systm.h>
2329                    #include <netinet/in.h>
2330                    #include <netinet/ip.h>
2331                    #include <netinet/ip_icmp.h>
2332                    #include <netinet/udp.h>
2333                    #include <arpa/inet.h>
2334                    #include <netdb.h>
2335 int main() {
2336 struct icmp i;
2337                    struct sockaddr s;
2338                    struct sockaddr_in si;
2339                    struct ip ip;
2340                    i.icmp_type = ICMP_ECHO;
2341                    i.icmp_code = 0;
2342                    i.icmp_cksum = 0;
2343                    i.icmp_id = 0;
2344                    i.icmp_seq = 0;
2345                    si.sin_family = AF_INET;
2346                    #if defined(__DECC) || defined(_IP_VHL)
2347                    ip.ip_vhl = 0;
2348                    #else
2349                    ip.ip_hl = 0;
2350                    #endif
2351                    
2352 ; return 0; }
2353 EOF
2354 if { (eval echo configure:2366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2355   rm -rf conftest*
2356   ac_cv_have_icmp=yes
2357 else
2358   echo "configure: failed program was:" >&5
2359   cat conftest.$ac_ext >&5
2360   rm -rf conftest*
2361   ac_cv_have_icmp=no
2362 fi
2363 rm -f conftest*
2364 fi
2365
2366 echo "$ac_t""$ac_cv_have_icmp" 1>&6
2367  if test "$ac_cv_have_icmp" = yes ; then
2368    cat >> confdefs.h <<\EOF
2369 #define HAVE_ICMP 1
2370 EOF
2371
2372  fi
2373 echo $ac_n "checking for struct icmphdr""... $ac_c" 1>&6
2374 echo "configure:2386: checking for struct icmphdr" >&5
2375 if eval "test \"`echo '$''{'ac_cv_have_icmphdr'+set}'`\" = set"; then
2376   echo $ac_n "(cached) $ac_c" 1>&6
2377 else
2378   cat > conftest.$ac_ext <<EOF
2379 #line 2391 "configure"
2380 #include "confdefs.h"
2381 #include <stdlib.h>
2382                    #include <stdio.h>
2383                    #include <math.h>
2384                    #include <unistd.h>
2385                    #include <limits.h>
2386                    #include <signal.h>
2387                    #include <fcntl.h>
2388                    #include <sys/types.h>
2389                    #include <sys/time.h>
2390                    #include <sys/ipc.h>
2391                    #include <sys/shm.h>
2392                    #include <sys/socket.h>
2393                    #include <netinet/in_systm.h>
2394                    #include <netinet/in.h>
2395                    #include <netinet/ip.h>
2396                    #include <netinet/ip_icmp.h>
2397                    #include <netinet/udp.h>
2398                    #include <arpa/inet.h>
2399                    #include <netdb.h>
2400 int main() {
2401 struct icmphdr i;
2402                    struct sockaddr s;
2403                    struct sockaddr_in si;
2404                    struct ip ip;
2405                    i.type = ICMP_ECHO;
2406                    i.code = 0;
2407                    i.checksum = 0;
2408                    i.un.echo.id = 0;
2409                    i.un.echo.sequence = 0;
2410                    si.sin_family = AF_INET;
2411                    ip.ip_hl = 0;
2412 ; return 0; }
2413 EOF
2414 if { (eval echo configure:2426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2415   rm -rf conftest*
2416   ac_cv_have_icmphdr=yes
2417 else
2418   echo "configure: failed program was:" >&5
2419   cat conftest.$ac_ext >&5
2420   rm -rf conftest*
2421   ac_cv_have_icmphdr=no
2422 fi
2423 rm -f conftest*
2424 fi
2425
2426 echo "$ac_t""$ac_cv_have_icmphdr" 1>&6
2427  if test "$ac_cv_have_icmphdr" = yes ; then
2428    cat >> confdefs.h <<\EOF
2429 #define HAVE_ICMPHDR 1
2430 EOF
2431
2432  fi
2433 for ac_hdr in crypt.h sys/select.h
2434 do
2435 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2436 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2437 echo "configure:2449: checking for $ac_hdr" >&5
2438 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2439   echo $ac_n "(cached) $ac_c" 1>&6
2440 else
2441   cat > conftest.$ac_ext <<EOF
2442 #line 2454 "configure"
2443 #include "confdefs.h"
2444 #include <$ac_hdr>
2445 EOF
2446 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2447 { (eval echo configure:2459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2448 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2449 if test -z "$ac_err"; then
2450   rm -rf conftest*
2451   eval "ac_cv_header_$ac_safe=yes"
2452 else
2453   echo "$ac_err" >&5
2454   echo "configure: failed program was:" >&5
2455   cat conftest.$ac_ext >&5
2456   rm -rf conftest*
2457   eval "ac_cv_header_$ac_safe=no"
2458 fi
2459 rm -f conftest*
2460 fi
2461 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2462   echo "$ac_t""yes" 1>&6
2463     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2464   cat >> confdefs.h <<EOF
2465 #define $ac_tr_hdr 1
2466 EOF
2467  
2468 else
2469   echo "$ac_t""no" 1>&6
2470 fi
2471 done
2472
2473 for ac_prog in perl5 perl
2474 do
2475 # Extract the first word of "$ac_prog", so it can be a program name with args.
2476 set dummy $ac_prog; ac_word=$2
2477 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2478 echo "configure:2490: checking for $ac_word" >&5
2479 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
2480   echo $ac_n "(cached) $ac_c" 1>&6
2481 else
2482   case "$PERL" in
2483   /*)
2484   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
2485   ;;
2486   ?:/*)                  
2487   ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
2488   ;;
2489   *)
2490   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2491   ac_dummy="$PATH"
2492   for ac_dir in $ac_dummy; do 
2493     test -z "$ac_dir" && ac_dir=.
2494     if test -f $ac_dir/$ac_word; then
2495       ac_cv_path_PERL="$ac_dir/$ac_word"
2496       break
2497     fi
2498   done
2499   IFS="$ac_save_ifs"
2500   ;;
2501 esac
2502 fi
2503 PERL="$ac_cv_path_PERL"
2504 if test -n "$PERL"; then
2505   echo "$ac_t""$PERL" 1>&6
2506 else
2507   echo "$ac_t""no" 1>&6
2508 fi
2509
2510 test -n "$PERL" && break
2511 done
2512
2513   if test -z "$PERL" ; then
2514     PERL_VERSION=0
2515   else
2516     echo $ac_n "checking perl version""... $ac_c" 1>&6
2517 echo "configure:2529: checking perl version" >&5
2518 if eval "test \"`echo '$''{'ac_cv_perl_version'+set}'`\" = set"; then
2519   echo $ac_n "(cached) $ac_c" 1>&6
2520 else
2521   ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`
2522 fi
2523
2524 echo "$ac_t""$ac_cv_perl_version" 1>&6
2525     PERL_VERSION=$ac_cv_perl_version
2526   fi
2527  
2528
2529 if test -z "$PERL" ; then
2530   # don't let it be blank...
2531   PERL=/usr/bin/perl
2532 fi
2533
2534 # If we find X, set shell vars x_includes and x_libraries to the
2535 # paths, otherwise set no_x=yes.
2536 # Uses ac_ vars as temps to allow command line to override cache and checks.
2537 # --without-x overrides everything else, but does not touch the cache.
2538 echo $ac_n "checking for X""... $ac_c" 1>&6
2539 echo "configure:2551: checking for X" >&5
2540
2541 # Check whether --with-x or --without-x was given.
2542 if test "${with_x+set}" = set; then
2543   withval="$with_x"
2544   :
2545 fi
2546
2547 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
2548 if test "x$with_x" = xno; then
2549   # The user explicitly disabled X.
2550   have_x=disabled
2551 else
2552   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
2553     # Both variables are already set.
2554     have_x=yes
2555   else
2556 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
2557   echo $ac_n "(cached) $ac_c" 1>&6
2558 else
2559   # One or both of the vars are not set, and there is no cached value.
2560 ac_x_includes=NO ac_x_libraries=NO
2561 rm -fr conftestdir
2562 if mkdir conftestdir; then
2563   cd conftestdir
2564   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2565   cat > Imakefile <<'EOF'
2566 acfindx:
2567         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
2568 EOF
2569   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2570     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2571     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2572     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
2573     for ac_extension in a so sl; do
2574       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
2575         test -f $ac_im_libdir/libX11.$ac_extension; then
2576         ac_im_usrlibdir=$ac_im_libdir; break
2577       fi
2578     done
2579     # Screen out bogus values from the imake configuration.  They are
2580     # bogus both because they are the default anyway, and because
2581     # using them would break gcc on systems where it needs fixed includes.
2582     case "$ac_im_incroot" in
2583         /usr/include) ;;
2584         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
2585     esac
2586     case "$ac_im_usrlibdir" in
2587         /usr/lib | /lib) ;;
2588         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
2589     esac
2590   fi
2591   cd ..
2592   rm -fr conftestdir
2593 fi
2594
2595 if test "$ac_x_includes" = NO; then
2596   # Guess where to find include files, by looking for this one X11 .h file.
2597   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
2598
2599   # First, try using that file with no special directory specified.
2600 cat > conftest.$ac_ext <<EOF
2601 #line 2613 "configure"
2602 #include "confdefs.h"
2603 #include <$x_direct_test_include>
2604 EOF
2605 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2606 { (eval echo configure:2618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2607 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2608 if test -z "$ac_err"; then
2609   rm -rf conftest*
2610   # We can compile using X headers with no special include directory.
2611 ac_x_includes=
2612 else
2613   echo "$ac_err" >&5
2614   echo "configure: failed program was:" >&5
2615   cat conftest.$ac_ext >&5
2616   rm -rf conftest*
2617   # Look for the header file in a standard set of common directories.
2618 # Check X11 before X11Rn because it is often a symlink to the current release.
2619   for ac_dir in               \
2620     /usr/X11/include          \
2621     /usr/X11R6/include        \
2622     /usr/X11R5/include        \
2623     /usr/X11R4/include        \
2624                               \
2625     /usr/include/X11          \
2626     /usr/include/X11R6        \
2627     /usr/include/X11R5        \
2628     /usr/include/X11R4        \
2629                               \
2630     /usr/local/X11/include    \
2631     /usr/local/X11R6/include  \
2632     /usr/local/X11R5/include  \
2633     /usr/local/X11R4/include  \
2634                               \
2635     /usr/local/include/X11    \
2636     /usr/local/include/X11R6  \
2637     /usr/local/include/X11R5  \
2638     /usr/local/include/X11R4  \
2639                               \
2640     /usr/X386/include         \
2641     /usr/x386/include         \
2642     /usr/XFree86/include/X11  \
2643                               \
2644     /usr/include              \
2645     /usr/local/include        \
2646     /usr/unsupported/include  \
2647     /usr/athena/include       \
2648     /usr/local/x11r5/include  \
2649     /usr/lpp/Xamples/include  \
2650                               \
2651     /usr/openwin/include      \
2652     /usr/openwin/share/include \
2653     ; \
2654   do
2655     if test -r "$ac_dir/$x_direct_test_include"; then
2656       ac_x_includes=$ac_dir
2657       break
2658     fi
2659   done
2660 fi
2661 rm -f conftest*
2662 fi # $ac_x_includes = NO
2663
2664 if test "$ac_x_libraries" = NO; then
2665   # Check for the libraries.
2666
2667   test -z "$x_direct_test_library" && x_direct_test_library=Xt
2668   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2669
2670   # See if we find them without any special options.
2671   # Don't add to $LIBS permanently.
2672   ac_save_LIBS="$LIBS"
2673   LIBS="-l$x_direct_test_library $LIBS"
2674 cat > conftest.$ac_ext <<EOF
2675 #line 2687 "configure"
2676 #include "confdefs.h"
2677
2678 int main() {
2679 ${x_direct_test_function}()
2680 ; return 0; }
2681 EOF
2682 if { (eval echo configure:2694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2683   rm -rf conftest*
2684   LIBS="$ac_save_LIBS"
2685 # We can link X programs with no special library path.
2686 ac_x_libraries=
2687 else
2688   echo "configure: failed program was:" >&5
2689   cat conftest.$ac_ext >&5
2690   rm -rf conftest*
2691   LIBS="$ac_save_LIBS"
2692 # First see if replacing the include by lib works.
2693 # Check X11 before X11Rn because it is often a symlink to the current release.
2694 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2695     /usr/X11/lib          \
2696     /usr/X11R6/lib        \
2697     /usr/X11R5/lib        \
2698     /usr/X11R4/lib        \
2699                           \
2700     /usr/lib/X11          \
2701     /usr/lib/X11R6        \
2702     /usr/lib/X11R5        \
2703     /usr/lib/X11R4        \
2704                           \
2705     /usr/local/X11/lib    \
2706     /usr/local/X11R6/lib  \
2707     /usr/local/X11R5/lib  \
2708     /usr/local/X11R4/lib  \
2709                           \
2710     /usr/local/lib/X11    \
2711     /usr/local/lib/X11R6  \
2712     /usr/local/lib/X11R5  \
2713     /usr/local/lib/X11R4  \
2714                           \
2715     /usr/X386/lib         \
2716     /usr/x386/lib         \
2717     /usr/XFree86/lib/X11  \
2718                           \
2719     /usr/lib              \
2720     /usr/local/lib        \
2721     /usr/unsupported/lib  \
2722     /usr/athena/lib       \
2723     /usr/local/x11r5/lib  \
2724     /usr/lpp/Xamples/lib  \
2725     /lib/usr/lib/X11      \
2726                           \
2727     /usr/openwin/lib      \
2728     /usr/openwin/share/lib \
2729     ; \
2730 do
2731   for ac_extension in a so sl; do
2732     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2733       ac_x_libraries=$ac_dir
2734       break 2
2735     fi
2736   done
2737 done
2738 fi
2739 rm -f conftest*
2740 fi # $ac_x_libraries = NO
2741
2742 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2743   # Didn't find X anywhere.  Cache the known absence of X.
2744   ac_cv_have_x="have_x=no"
2745 else
2746   # Record where we found X for the cache.
2747   ac_cv_have_x="have_x=yes \
2748                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2749 fi
2750 fi
2751   fi
2752   eval "$ac_cv_have_x"
2753 fi # $with_x != no
2754
2755 if test "$have_x" != yes; then
2756   echo "$ac_t""$have_x" 1>&6
2757   no_x=yes
2758 else
2759   # If each of the values was on the command line, it overrides each guess.
2760   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2761   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2762   # Update the cache value to reflect the command line values.
2763   ac_cv_have_x="have_x=yes \
2764                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2765   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2766 fi
2767
2768 if test "$no_x" = yes; then
2769   # Not all programs may use this symbol, but it does not hurt to define it.
2770   cat >> confdefs.h <<\EOF
2771 #define X_DISPLAY_MISSING 1
2772 EOF
2773
2774   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2775 else
2776   if test -n "$x_includes"; then
2777     X_CFLAGS="$X_CFLAGS -I$x_includes"
2778   fi
2779
2780   # It would also be nice to do this for all -L options, not just this one.
2781   if test -n "$x_libraries"; then
2782     X_LIBS="$X_LIBS -L$x_libraries"
2783     # For Solaris; some versions of Sun CC require a space after -R and
2784     # others require no space.  Words are not sufficient . . . .
2785     case "`(uname -sr) 2>/dev/null`" in
2786     "SunOS 5"*)
2787       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2788 echo "configure:2800: checking whether -R must be followed by a space" >&5
2789       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2790       cat > conftest.$ac_ext <<EOF
2791 #line 2803 "configure"
2792 #include "confdefs.h"
2793
2794 int main() {
2795
2796 ; return 0; }
2797 EOF
2798 if { (eval echo configure:2810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2799   rm -rf conftest*
2800   ac_R_nospace=yes
2801 else
2802   echo "configure: failed program was:" >&5
2803   cat conftest.$ac_ext >&5
2804   rm -rf conftest*
2805   ac_R_nospace=no
2806 fi
2807 rm -f conftest*
2808       if test $ac_R_nospace = yes; then
2809         echo "$ac_t""no" 1>&6
2810         X_LIBS="$X_LIBS -R$x_libraries"
2811       else
2812         LIBS="$ac_xsave_LIBS -R $x_libraries"
2813         cat > conftest.$ac_ext <<EOF
2814 #line 2826 "configure"
2815 #include "confdefs.h"
2816
2817 int main() {
2818
2819 ; return 0; }
2820 EOF
2821 if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2822   rm -rf conftest*
2823   ac_R_space=yes
2824 else
2825   echo "configure: failed program was:" >&5
2826   cat conftest.$ac_ext >&5
2827   rm -rf conftest*
2828   ac_R_space=no
2829 fi
2830 rm -f conftest*
2831         if test $ac_R_space = yes; then
2832           echo "$ac_t""yes" 1>&6
2833           X_LIBS="$X_LIBS -R $x_libraries"
2834         else
2835           echo "$ac_t""neither works" 1>&6
2836         fi
2837       fi
2838       LIBS="$ac_xsave_LIBS"
2839     esac
2840   fi
2841
2842   # Check for system-dependent libraries X programs must link with.
2843   # Do this before checking for the system-independent R6 libraries
2844   # (-lICE), since we may need -lsocket or whatever for X linking.
2845
2846   if test "$ISC" = yes; then
2847     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2848   else
2849     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2850     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2851     # the Alpha needs dnet_stub (dnet does not exist).
2852     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2853 echo "configure:2865: checking for dnet_ntoa in -ldnet" >&5
2854 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2855 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2856   echo $ac_n "(cached) $ac_c" 1>&6
2857 else
2858   ac_save_LIBS="$LIBS"
2859 LIBS="-ldnet  $LIBS"
2860 cat > conftest.$ac_ext <<EOF
2861 #line 2873 "configure"
2862 #include "confdefs.h"
2863 /* Override any gcc2 internal prototype to avoid an error.  */
2864 /* We use char because int might match the return type of a gcc2
2865     builtin and then its argument prototype would still apply.  */
2866 char dnet_ntoa();
2867
2868 int main() {
2869 dnet_ntoa()
2870 ; return 0; }
2871 EOF
2872 if { (eval echo configure:2884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2873   rm -rf conftest*
2874   eval "ac_cv_lib_$ac_lib_var=yes"
2875 else
2876   echo "configure: failed program was:" >&5
2877   cat conftest.$ac_ext >&5
2878   rm -rf conftest*
2879   eval "ac_cv_lib_$ac_lib_var=no"
2880 fi
2881 rm -f conftest*
2882 LIBS="$ac_save_LIBS"
2883
2884 fi
2885 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2886   echo "$ac_t""yes" 1>&6
2887   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2888 else
2889   echo "$ac_t""no" 1>&6
2890 fi
2891
2892     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2893       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2894 echo "configure:2906: checking for dnet_ntoa in -ldnet_stub" >&5
2895 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2896 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2897   echo $ac_n "(cached) $ac_c" 1>&6
2898 else
2899   ac_save_LIBS="$LIBS"
2900 LIBS="-ldnet_stub  $LIBS"
2901 cat > conftest.$ac_ext <<EOF
2902 #line 2914 "configure"
2903 #include "confdefs.h"
2904 /* Override any gcc2 internal prototype to avoid an error.  */
2905 /* We use char because int might match the return type of a gcc2
2906     builtin and then its argument prototype would still apply.  */
2907 char dnet_ntoa();
2908
2909 int main() {
2910 dnet_ntoa()
2911 ; return 0; }
2912 EOF
2913 if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2914   rm -rf conftest*
2915   eval "ac_cv_lib_$ac_lib_var=yes"
2916 else
2917   echo "configure: failed program was:" >&5
2918   cat conftest.$ac_ext >&5
2919   rm -rf conftest*
2920   eval "ac_cv_lib_$ac_lib_var=no"
2921 fi
2922 rm -f conftest*
2923 LIBS="$ac_save_LIBS"
2924
2925 fi
2926 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2927   echo "$ac_t""yes" 1>&6
2928   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2929 else
2930   echo "$ac_t""no" 1>&6
2931 fi
2932
2933     fi
2934
2935     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2936     # to get the SysV transport functions.
2937     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2938     # needs -lnsl.
2939     # The nsl library prevents programs from opening the X display
2940     # on Irix 5.2, according to dickey@clark.net.
2941     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2942 echo "configure:2954: checking for gethostbyname" >&5
2943 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2944   echo $ac_n "(cached) $ac_c" 1>&6
2945 else
2946   cat > conftest.$ac_ext <<EOF
2947 #line 2959 "configure"
2948 #include "confdefs.h"
2949 /* System header to define __stub macros and hopefully few prototypes,
2950     which can conflict with char gethostbyname(); below.  */
2951 #include <assert.h>
2952 /* Override any gcc2 internal prototype to avoid an error.  */
2953 /* We use char because int might match the return type of a gcc2
2954     builtin and then its argument prototype would still apply.  */
2955 char gethostbyname();
2956
2957 int main() {
2958
2959 /* The GNU C library defines this for functions which it implements
2960     to always fail with ENOSYS.  Some functions are actually named
2961     something starting with __ and the normal name is an alias.  */
2962 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2963 choke me
2964 #else
2965 gethostbyname();
2966 #endif
2967
2968 ; return 0; }
2969 EOF
2970 if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2971   rm -rf conftest*
2972   eval "ac_cv_func_gethostbyname=yes"
2973 else
2974   echo "configure: failed program was:" >&5
2975   cat conftest.$ac_ext >&5
2976   rm -rf conftest*
2977   eval "ac_cv_func_gethostbyname=no"
2978 fi
2979 rm -f conftest*
2980 fi
2981
2982 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2983   echo "$ac_t""yes" 1>&6
2984   :
2985 else
2986   echo "$ac_t""no" 1>&6
2987 fi
2988
2989     if test $ac_cv_func_gethostbyname = no; then
2990       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2991 echo "configure:3003: checking for gethostbyname in -lnsl" >&5
2992 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2993 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2994   echo $ac_n "(cached) $ac_c" 1>&6
2995 else
2996   ac_save_LIBS="$LIBS"
2997 LIBS="-lnsl  $LIBS"
2998 cat > conftest.$ac_ext <<EOF
2999 #line 3011 "configure"
3000 #include "confdefs.h"
3001 /* Override any gcc2 internal prototype to avoid an error.  */
3002 /* We use char because int might match the return type of a gcc2
3003     builtin and then its argument prototype would still apply.  */
3004 char gethostbyname();
3005
3006 int main() {
3007 gethostbyname()
3008 ; return 0; }
3009 EOF
3010 if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3011   rm -rf conftest*
3012   eval "ac_cv_lib_$ac_lib_var=yes"
3013 else
3014   echo "configure: failed program was:" >&5
3015   cat conftest.$ac_ext >&5
3016   rm -rf conftest*
3017   eval "ac_cv_lib_$ac_lib_var=no"
3018 fi
3019 rm -f conftest*
3020 LIBS="$ac_save_LIBS"
3021
3022 fi
3023 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3024   echo "$ac_t""yes" 1>&6
3025   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
3026 else
3027   echo "$ac_t""no" 1>&6
3028 fi
3029
3030     fi
3031
3032     # lieder@skyler.mavd.honeywell.com says without -lsocket,
3033     # socket/setsockopt and other routines are undefined under SCO ODT
3034     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
3035     # on later versions), says simon@lia.di.epfl.ch: it contains
3036     # gethostby* variants that don't use the nameserver (or something).
3037     # -lsocket must be given before -lnsl if both are needed.
3038     # We assume that if connect needs -lnsl, so does gethostbyname.
3039     echo $ac_n "checking for connect""... $ac_c" 1>&6
3040 echo "configure:3052: checking for connect" >&5
3041 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
3042   echo $ac_n "(cached) $ac_c" 1>&6
3043 else
3044   cat > conftest.$ac_ext <<EOF
3045 #line 3057 "configure"
3046 #include "confdefs.h"
3047 /* System header to define __stub macros and hopefully few prototypes,
3048     which can conflict with char connect(); below.  */
3049 #include <assert.h>
3050 /* Override any gcc2 internal prototype to avoid an error.  */
3051 /* We use char because int might match the return type of a gcc2
3052     builtin and then its argument prototype would still apply.  */
3053 char connect();
3054
3055 int main() {
3056
3057 /* The GNU C library defines this for functions which it implements
3058     to always fail with ENOSYS.  Some functions are actually named
3059     something starting with __ and the normal name is an alias.  */
3060 #if defined (__stub_connect) || defined (__stub___connect)
3061 choke me
3062 #else
3063 connect();
3064 #endif
3065
3066 ; return 0; }
3067 EOF
3068 if { (eval echo configure:3080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3069   rm -rf conftest*
3070   eval "ac_cv_func_connect=yes"
3071 else
3072   echo "configure: failed program was:" >&5
3073   cat conftest.$ac_ext >&5
3074   rm -rf conftest*
3075   eval "ac_cv_func_connect=no"
3076 fi
3077 rm -f conftest*
3078 fi
3079
3080 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
3081   echo "$ac_t""yes" 1>&6
3082   :
3083 else
3084   echo "$ac_t""no" 1>&6
3085 fi
3086
3087     if test $ac_cv_func_connect = no; then
3088       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
3089 echo "configure:3101: checking for connect in -lsocket" >&5
3090 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
3091 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3092   echo $ac_n "(cached) $ac_c" 1>&6
3093 else
3094   ac_save_LIBS="$LIBS"
3095 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
3096 cat > conftest.$ac_ext <<EOF
3097 #line 3109 "configure"
3098 #include "confdefs.h"
3099 /* Override any gcc2 internal prototype to avoid an error.  */
3100 /* We use char because int might match the return type of a gcc2
3101     builtin and then its argument prototype would still apply.  */
3102 char connect();
3103
3104 int main() {
3105 connect()
3106 ; return 0; }
3107 EOF
3108 if { (eval echo configure:3120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3109   rm -rf conftest*
3110   eval "ac_cv_lib_$ac_lib_var=yes"
3111 else
3112   echo "configure: failed program was:" >&5
3113   cat conftest.$ac_ext >&5
3114   rm -rf conftest*
3115   eval "ac_cv_lib_$ac_lib_var=no"
3116 fi
3117 rm -f conftest*
3118 LIBS="$ac_save_LIBS"
3119
3120 fi
3121 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3122   echo "$ac_t""yes" 1>&6
3123   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
3124 else
3125   echo "$ac_t""no" 1>&6
3126 fi
3127
3128     fi
3129
3130     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
3131     echo $ac_n "checking for remove""... $ac_c" 1>&6
3132 echo "configure:3144: checking for remove" >&5
3133 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
3134   echo $ac_n "(cached) $ac_c" 1>&6
3135 else
3136   cat > conftest.$ac_ext <<EOF
3137 #line 3149 "configure"
3138 #include "confdefs.h"
3139 /* System header to define __stub macros and hopefully few prototypes,
3140     which can conflict with char remove(); below.  */
3141 #include <assert.h>
3142 /* Override any gcc2 internal prototype to avoid an error.  */
3143 /* We use char because int might match the return type of a gcc2
3144     builtin and then its argument prototype would still apply.  */
3145 char remove();
3146
3147 int main() {
3148
3149 /* The GNU C library defines this for functions which it implements
3150     to always fail with ENOSYS.  Some functions are actually named
3151     something starting with __ and the normal name is an alias.  */
3152 #if defined (__stub_remove) || defined (__stub___remove)
3153 choke me
3154 #else
3155 remove();
3156 #endif
3157
3158 ; return 0; }
3159 EOF
3160 if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3161   rm -rf conftest*
3162   eval "ac_cv_func_remove=yes"
3163 else
3164   echo "configure: failed program was:" >&5
3165   cat conftest.$ac_ext >&5
3166   rm -rf conftest*
3167   eval "ac_cv_func_remove=no"
3168 fi
3169 rm -f conftest*
3170 fi
3171
3172 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
3173   echo "$ac_t""yes" 1>&6
3174   :
3175 else
3176   echo "$ac_t""no" 1>&6
3177 fi
3178
3179     if test $ac_cv_func_remove = no; then
3180       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
3181 echo "configure:3193: checking for remove in -lposix" >&5
3182 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
3183 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3184   echo $ac_n "(cached) $ac_c" 1>&6
3185 else
3186   ac_save_LIBS="$LIBS"
3187 LIBS="-lposix  $LIBS"
3188 cat > conftest.$ac_ext <<EOF
3189 #line 3201 "configure"
3190 #include "confdefs.h"
3191 /* Override any gcc2 internal prototype to avoid an error.  */
3192 /* We use char because int might match the return type of a gcc2
3193     builtin and then its argument prototype would still apply.  */
3194 char remove();
3195
3196 int main() {
3197 remove()
3198 ; return 0; }
3199 EOF
3200 if { (eval echo configure:3212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3201   rm -rf conftest*
3202   eval "ac_cv_lib_$ac_lib_var=yes"
3203 else
3204   echo "configure: failed program was:" >&5
3205   cat conftest.$ac_ext >&5
3206   rm -rf conftest*
3207   eval "ac_cv_lib_$ac_lib_var=no"
3208 fi
3209 rm -f conftest*
3210 LIBS="$ac_save_LIBS"
3211
3212 fi
3213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3214   echo "$ac_t""yes" 1>&6
3215   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
3216 else
3217   echo "$ac_t""no" 1>&6
3218 fi
3219
3220     fi
3221
3222     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
3223     echo $ac_n "checking for shmat""... $ac_c" 1>&6
3224 echo "configure:3236: checking for shmat" >&5
3225 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
3226   echo $ac_n "(cached) $ac_c" 1>&6
3227 else
3228   cat > conftest.$ac_ext <<EOF
3229 #line 3241 "configure"
3230 #include "confdefs.h"
3231 /* System header to define __stub macros and hopefully few prototypes,
3232     which can conflict with char shmat(); below.  */
3233 #include <assert.h>
3234 /* Override any gcc2 internal prototype to avoid an error.  */
3235 /* We use char because int might match the return type of a gcc2
3236     builtin and then its argument prototype would still apply.  */
3237 char shmat();
3238
3239 int main() {
3240
3241 /* The GNU C library defines this for functions which it implements
3242     to always fail with ENOSYS.  Some functions are actually named
3243     something starting with __ and the normal name is an alias.  */
3244 #if defined (__stub_shmat) || defined (__stub___shmat)
3245 choke me
3246 #else
3247 shmat();
3248 #endif
3249
3250 ; return 0; }
3251 EOF
3252 if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3253   rm -rf conftest*
3254   eval "ac_cv_func_shmat=yes"
3255 else
3256   echo "configure: failed program was:" >&5
3257   cat conftest.$ac_ext >&5
3258   rm -rf conftest*
3259   eval "ac_cv_func_shmat=no"
3260 fi
3261 rm -f conftest*
3262 fi
3263
3264 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
3265   echo "$ac_t""yes" 1>&6
3266   :
3267 else
3268   echo "$ac_t""no" 1>&6
3269 fi
3270
3271     if test $ac_cv_func_shmat = no; then
3272       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
3273 echo "configure:3285: checking for shmat in -lipc" >&5
3274 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
3275 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3276   echo $ac_n "(cached) $ac_c" 1>&6
3277 else
3278   ac_save_LIBS="$LIBS"
3279 LIBS="-lipc  $LIBS"
3280 cat > conftest.$ac_ext <<EOF
3281 #line 3293 "configure"
3282 #include "confdefs.h"
3283 /* Override any gcc2 internal prototype to avoid an error.  */
3284 /* We use char because int might match the return type of a gcc2
3285     builtin and then its argument prototype would still apply.  */
3286 char shmat();
3287
3288 int main() {
3289 shmat()
3290 ; return 0; }
3291 EOF
3292 if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3293   rm -rf conftest*
3294   eval "ac_cv_lib_$ac_lib_var=yes"
3295 else
3296   echo "configure: failed program was:" >&5
3297   cat conftest.$ac_ext >&5
3298   rm -rf conftest*
3299   eval "ac_cv_lib_$ac_lib_var=no"
3300 fi
3301 rm -f conftest*
3302 LIBS="$ac_save_LIBS"
3303
3304 fi
3305 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3306   echo "$ac_t""yes" 1>&6
3307   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
3308 else
3309   echo "$ac_t""no" 1>&6
3310 fi
3311
3312     fi
3313   fi
3314
3315   # Check for libraries that X11R6 Xt/Xaw programs need.
3316   ac_save_LDFLAGS="$LDFLAGS"
3317   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
3318   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
3319   # check for ICE first), but we must link in the order -lSM -lICE or
3320   # we get undefined symbols.  So assume we have SM if we have ICE.
3321   # These have to be linked with before -lX11, unlike the other
3322   # libraries we check for below, so use a different variable.
3323   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
3324   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
3325 echo "configure:3337: checking for IceConnectionNumber in -lICE" >&5
3326 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
3327 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3328   echo $ac_n "(cached) $ac_c" 1>&6
3329 else
3330   ac_save_LIBS="$LIBS"
3331 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
3332 cat > conftest.$ac_ext <<EOF
3333 #line 3345 "configure"
3334 #include "confdefs.h"
3335 /* Override any gcc2 internal prototype to avoid an error.  */
3336 /* We use char because int might match the return type of a gcc2
3337     builtin and then its argument prototype would still apply.  */
3338 char IceConnectionNumber();
3339
3340 int main() {
3341 IceConnectionNumber()
3342 ; return 0; }
3343 EOF
3344 if { (eval echo configure:3356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3345   rm -rf conftest*
3346   eval "ac_cv_lib_$ac_lib_var=yes"
3347 else
3348   echo "configure: failed program was:" >&5
3349   cat conftest.$ac_ext >&5
3350   rm -rf conftest*
3351   eval "ac_cv_lib_$ac_lib_var=no"
3352 fi
3353 rm -f conftest*
3354 LIBS="$ac_save_LIBS"
3355
3356 fi
3357 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3358   echo "$ac_t""yes" 1>&6
3359   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
3360 else
3361   echo "$ac_t""no" 1>&6
3362 fi
3363
3364   LDFLAGS="$ac_save_LDFLAGS"
3365
3366 fi
3367
3368
3369 if test "$have_x" != yes; then
3370   { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
3371 fi
3372
3373
3374     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
3375 echo "configure:3387: checking for X app-defaults directory" >&5
3376 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
3377   echo $ac_n "(cached) $ac_c" 1>&6
3378 else
3379   
3380   rm -fr conftestdir
3381   if mkdir conftestdir; then
3382     cd conftestdir >&-
3383     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
3384     cat > Imakefile <<'EOF'
3385 acfindx:
3386         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
3387 EOF
3388     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
3389       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
3390       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
3391     fi
3392     cd .. >&-
3393     rm -fr conftestdir
3394   fi
3395       if test x"$ac_x_app_defaults" = x; then
3396         
3397   # Look for the directory under a standard set of common directories.
3398   # Check X11 before X11Rn because it's often a symlink to the current release.
3399   for ac_dir in                                 \
3400     /usr/X11/lib/app-defaults                   \
3401     /usr/X11R6/lib/app-defaults                 \
3402     /usr/X11R6/lib/X11/app-defaults             \
3403     /usr/X11R5/lib/app-defaults                 \
3404     /usr/X11R5/lib/X11/app-defaults             \
3405     /usr/X11R4/lib/app-defaults                 \
3406     /usr/X11R4/lib/X11/app-defaults             \
3407                                                 \
3408     /usr/lib/X11/app-defaults                   \
3409     /usr/lib/X11R6/app-defaults                 \
3410     /usr/lib/X11R5/app-defaults                 \
3411     /usr/lib/X11R4/app-defaults                 \
3412                                                 \
3413     /usr/local/X11/lib/app-defaults             \
3414     /usr/local/X11R6/lib/app-defaults           \
3415     /usr/local/X11R5/lib/app-defaults           \
3416     /usr/local/X11R4/lib/app-defaults           \
3417                                                 \
3418     /usr/local/lib/X11/app-defaults             \
3419     /usr/local/lib/X11R6/app-defaults           \
3420     /usr/local/lib/X11R6/X11/app-defaults       \
3421     /usr/local/lib/X11R5/app-defaults           \
3422     /usr/local/lib/X11R5/X11/app-defaults       \
3423     /usr/local/lib/X11R4/app-defaults           \
3424     /usr/local/lib/X11R4/X11/app-defaults       \
3425                                                 \
3426     /usr/X386/lib/X11/app-defaults              \
3427     /usr/x386/lib/X11/app-defaults              \
3428     /usr/XFree86/lib/X11/app-defaults           \
3429                                                 \
3430     /usr/lib/X11/app-defaults                   \
3431     /usr/local/lib/X11/app-defaults             \
3432     /usr/unsupported/lib/X11/app-defaults       \
3433     /usr/athena/lib/X11/app-defaults            \
3434     /usr/local/x11r5/lib/X11/app-defaults       \
3435     /usr/lpp/Xamples/lib/X11/app-defaults       \
3436     /lib/usr/lib/X11/app-defaults               \
3437                                                 \
3438     /usr/openwin/lib/app-defaults               \
3439     /usr/openwin/lib/X11/app-defaults           \
3440     /usr/openwin/share/lib/app-defaults         \
3441     /usr/openwin/share/lib/X11/app-defaults     \
3442                                                 \
3443     /X11R6/lib/app-defaults                     \
3444     /X11R5/lib/app-defaults                     \
3445     /X11R4/lib/app-defaults                     \
3446     ; \
3447   do
3448     if test -d "$ac_dir"; then
3449       ac_x_app_defaults=$ac_dir
3450       break
3451     fi
3452   done
3453
3454       fi
3455       if test x"$ac_x_app_defaults" = x; then
3456         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
3457       else
3458         # Record where we found app-defaults for the cache.
3459         ac_cv_x_app_defaults="$ac_x_app_defaults"
3460       fi
3461 fi
3462
3463 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
3464     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
3465 case "$host" in
3466     *-hpux*)
3467
3468       # The following arcana was gleaned from conversations with
3469       # Eric Schwartz <erics@col.hp.com>:
3470       #
3471       # On HPUX 10.x, the parts of X that HP considers "standard" live in
3472       # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
3473       # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
3474       # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
3475       # Also, there are symlinks from /usr/include/ and /usr/lib/ into
3476       # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
3477       # you don't need any -I or -L arguments.
3478       #
3479       # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
3480       # are the same division as 10.x.  However, there are no symlinks to
3481       # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
3482       # arguments are always necessary.
3483       #
3484       # However, X11R6 was available on HPUX 9.x as a patch: if that
3485       # patch was installed, then all of X11R6 went in to
3486       # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
3487       #
3488       # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
3489       # whether R5 was available as a patch; R6 undoubtedly was not.)
3490       #
3491       # So.  We try and use the highest numbered pair of
3492       # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
3493       # that are available.  We do not mix and match different versions
3494       # of X.
3495       #
3496       # Question I still don't know the answer to: (do you?)
3497       #
3498       #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
3499       #     /usr/contrib/X11R6/ could be installed as a patch, what was in
3500       #     that contrib directory?  Did it contain so-called "standard"
3501       #     X11R6, or did it include Xaw and Xmu as well?  If the former,
3502       #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
3503       #     be a situation where one had to reach into the R5 headers and
3504       #     libs to find Xmu?  That is, must both R6 and R5 directories
3505       #     be on the -I and -L lists in that case?
3506       #
3507       for version in X11R6 X11R5 X11R4 ; do
3508         # if either pair of directories exists...
3509         if test -d /usr/include/$version || test -d /usr/contrib/$version/include
3510         then
3511            # if contrib exists, use it...
3512            if test -d /usr/contrib/$version/include ; then
3513              X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
3514              X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
3515            fi
3516            # if the "standard" one exists, use it.
3517            if test -d /usr/include/$version ; then
3518              X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
3519              X_LIBS="$X_LIBS -L/usr/lib/$version"
3520            fi
3521            # since at least one of the pair exists, go no farther.
3522            break
3523         fi
3524       done
3525
3526       # Now find Motif.  Thanks for not making xmkmf find this by
3527       # default, you losers.
3528       #
3529       if test -d /usr/include/Motif2.1 ; then
3530         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
3531         X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
3532       elif test -d /usr/include/Motif1.2 ; then
3533         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
3534         X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
3535       elif test -d /usr/include/Motif1.1 ; then
3536         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
3537         X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
3538       fi
3539
3540       # Now let's check for the pseudo-standard locations for OpenGL and XPM.
3541       #
3542       if test -d /opt/graphics/OpenGL/include ; then
3543         # HP-UX 10.20 puts it here
3544         X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
3545         X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
3546       elif test -d /opt/Mesa/lib ; then
3547         X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
3548         X_LIBS="-L/opt/Mesa/lib $X_LIBS"
3549       fi
3550
3551
3552       if test -d /opt/xpm/lib/X11 ; then
3553         X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
3554         X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
3555       fi
3556
3557       # On HPUX, default to installing in /opt/xscreensaver/ instead of
3558       # in /usr/local/, unless there is already an xscreensaver in
3559       # /usr/local/bin/.  This can be overridden with the --prefix arg
3560       # to configure.  I'm not sure this is the right thing to do, but
3561       # Richard Lloyd says so...
3562       #
3563       if test \! -x /usr/local/bin/xscreensaver ; then
3564         ac_default_prefix=/opt/xscreensaver
3565       fi
3566
3567     ;;
3568     *-solaris*)
3569
3570       # Thanks for not making xmkmf find this by default, pinheads.
3571       # And thanks for moving things around again, too.  Is this
3572       # really the standard location now?  What happened to the
3573       # joke that this kind of thing went in /opt?
3574       # cthomp says "answer: CDE (Common Disorganized Environment)"
3575       #
3576       if test -f /usr/dt/include/Xm/Xm.h ; then
3577         X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
3578         X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
3579
3580         # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
3581         echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
3582 echo "configure:3594: checking for regcmp in -lgen" >&5
3583 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
3584 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3585   echo $ac_n "(cached) $ac_c" 1>&6
3586 else
3587   ac_save_LIBS="$LIBS"
3588 LIBS="-lgen  $LIBS"
3589 cat > conftest.$ac_ext <<EOF
3590 #line 3602 "configure"
3591 #include "confdefs.h"
3592 /* Override any gcc2 internal prototype to avoid an error.  */
3593 /* We use char because int might match the return type of a gcc2
3594     builtin and then its argument prototype would still apply.  */
3595 char regcmp();
3596
3597 int main() {
3598 regcmp()
3599 ; return 0; }
3600 EOF
3601 if { (eval echo configure:3613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3602   rm -rf conftest*
3603   eval "ac_cv_lib_$ac_lib_var=yes"
3604 else
3605   echo "configure: failed program was:" >&5
3606   cat conftest.$ac_ext >&5
3607   rm -rf conftest*
3608   eval "ac_cv_lib_$ac_lib_var=no"
3609 fi
3610 rm -f conftest*
3611 LIBS="$ac_save_LIBS"
3612
3613 fi
3614 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3615   echo "$ac_t""yes" 1>&6
3616   X_LIBS="$X_LIBS -lgen"
3617 else
3618   echo "$ac_t""no" 1>&6
3619 fi
3620
3621       fi
3622     ;;
3623   esac
3624 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
3625 echo "configure:3637: checking for XPointer" >&5
3626 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
3627   echo $ac_n "(cached) $ac_c" 1>&6
3628 else
3629   
3630   ac_save_CPPFLAGS="$CPPFLAGS"
3631   if test \! -z "$includedir" ; then 
3632     CPPFLAGS="$CPPFLAGS -I$includedir"
3633   fi
3634   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3635   cat > conftest.$ac_ext <<EOF
3636 #line 3648 "configure"
3637 #include "confdefs.h"
3638 #include <X11/Xlib.h>
3639 int main() {
3640 XPointer foo = (XPointer) 0;
3641 ; return 0; }
3642 EOF
3643 if { (eval echo configure:3655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3644   rm -rf conftest*
3645   ac_cv_xpointer=yes
3646 else
3647   echo "configure: failed program was:" >&5
3648   cat conftest.$ac_ext >&5
3649   rm -rf conftest*
3650   ac_cv_xpointer=no
3651 fi
3652 rm -f conftest*
3653   CPPFLAGS="$ac_save_CPPFLAGS"
3654 fi
3655
3656 echo "$ac_t""$ac_cv_xpointer" 1>&6
3657   if test "$ac_cv_xpointer" != yes; then
3658    cat >> confdefs.h <<\EOF
3659 #define XPointer char*
3660 EOF
3661
3662   fi
3663
3664
3665
3666 ###############################################################################
3667 #
3668 #       Check for -lXmu (some fucked up vendors don't ship it...)
3669 #
3670 ###############################################################################
3671
3672 have_xmu=no
3673
3674   ac_save_CPPFLAGS="$CPPFLAGS"
3675   if test \! -z "$includedir" ; then 
3676     CPPFLAGS="$CPPFLAGS -I$includedir"
3677   fi
3678   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3679   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
3680 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
3681 echo "configure:3693: checking for X11/Xmu/Error.h" >&5
3682 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3683   echo $ac_n "(cached) $ac_c" 1>&6
3684 else
3685   cat > conftest.$ac_ext <<EOF
3686 #line 3698 "configure"
3687 #include "confdefs.h"
3688 #include <X11/Xmu/Error.h>
3689 EOF
3690 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3691 { (eval echo configure:3703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3692 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3693 if test -z "$ac_err"; then
3694   rm -rf conftest*
3695   eval "ac_cv_header_$ac_safe=yes"
3696 else
3697   echo "$ac_err" >&5
3698   echo "configure: failed program was:" >&5
3699   cat conftest.$ac_ext >&5
3700   rm -rf conftest*
3701   eval "ac_cv_header_$ac_safe=no"
3702 fi
3703 rm -f conftest*
3704 fi
3705 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3706   echo "$ac_t""yes" 1>&6
3707   have_xmu=yes
3708 else
3709   echo "$ac_t""no" 1>&6
3710 fi
3711
3712   CPPFLAGS="$ac_save_CPPFLAGS"
3713 if test "$have_xmu" = no ; then
3714   XMU_SRCS='$(UTILS_SRC)/xmu.c'
3715   XMU_OBJS='$(UTILS_BIN)/xmu.o'
3716   XMU_LIBS=''
3717 else
3718   XMU_SRCS=''
3719   XMU_OBJS=''
3720   XMU_LIBS='-lXmu'
3721   cat >> confdefs.h <<\EOF
3722 #define HAVE_XMU 1
3723 EOF
3724
3725 fi
3726
3727
3728 ###############################################################################
3729 #
3730 #       Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
3731 #       See comp.windows.x FAQ question 124.  The right fix is to
3732 #       get OpenWindows 3.0 patches 100512-02 and 100573-03.
3733 #
3734 ###############################################################################
3735
3736 if test "$have_xmu" = yes ; then
3737   case "$host" in
3738     *-sunos4*)
3739     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
3740 echo "configure:3752: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
3741 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
3742   echo $ac_n "(cached) $ac_c" 1>&6
3743 else
3744   ac_save_LDFLAGS="$LDFLAGS"
3745                     if test \! -z "$x_libraries" ; then
3746                       LDFLAGS="$LDFLAGS -L$x_libraries"
3747                     fi
3748                     # Note: this trick never works!  (Generally.)
3749                     # We're only getting away with using AC_TRY_LINK
3750                     # with X libraries because we know it's SunOS.
3751                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
3752                     cat > conftest.$ac_ext <<EOF
3753 #line 3765 "configure"
3754 #include "confdefs.h"
3755
3756 int main() {
3757
3758 ; return 0; }
3759 EOF
3760 if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3761   rm -rf conftest*
3762   ac_cv_sunos_xmu_bug=no
3763 else
3764   echo "configure: failed program was:" >&5
3765   cat conftest.$ac_ext >&5
3766   rm -rf conftest*
3767   ac_cv_sunos_xmu_bug=yes
3768 fi
3769 rm -f conftest*
3770                     LDFLAGS="$ac_save_LDFLAGS"
3771 fi
3772
3773 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3774     if test "$ac_cv_sunos_xmu_bug" = yes ; then
3775       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3776 echo "configure:3788: checking whether the compiler understands -static" >&5
3777 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3778   echo $ac_n "(cached) $ac_c" 1>&6
3779 else
3780   ac_save_LDFLAGS="$LDFLAGS"
3781                       LDFLAGS="$LDFLAGS -static"
3782                       cat > conftest.$ac_ext <<EOF
3783 #line 3795 "configure"
3784 #include "confdefs.h"
3785
3786 int main() {
3787
3788 ; return 0; }
3789 EOF
3790 if { (eval echo configure:3802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3791   rm -rf conftest*
3792   ac_cv_ld_static=yes
3793 else
3794   echo "configure: failed program was:" >&5
3795   cat conftest.$ac_ext >&5
3796   rm -rf conftest*
3797   ac_cv_ld_static=no
3798 fi
3799 rm -f conftest*
3800                     LDFLAGS="$ac_save_LDFLAGS"
3801 fi
3802
3803 echo "$ac_t""$ac_cv_ld_static" 1>&6
3804       if test "$ac_cv_ld_static" = yes ; then
3805         LDFLAGS="$LDFLAGS -static"
3806       else
3807         LDFLAGS="$LDFLAGS -Bstatic"
3808       fi
3809     fi
3810     ;;
3811   esac
3812 fi
3813
3814
3815 ###############################################################################
3816 #
3817 #       Handle the --with-hackdir option
3818 #
3819 ###############################################################################
3820
3821 have_hackdir=yes
3822 with_hackdir_req=unspecified
3823 # Check whether --with-hackdir or --without-hackdir was given.
3824 if test "${with_hackdir+set}" = set; then
3825   withval="$with_hackdir"
3826   with_hackdir="$withval"; with_hackdir_req="$withval"
3827 else
3828   with_hackdir=yes
3829 fi
3830
3831
3832 if test x"$with_hackdir" = xyes; then
3833   HACKDIR='${exec_prefix}/lib/xscreensaver'
3834 elif test x"$with_hackdir" = xno; then
3835   HACKDIR='${bindir}'
3836 else
3837   # there must be a better way than this...
3838   if test -z "`echo $with_hackdir | sed 's@^/.*@@'`" ; then
3839     # absolute path
3840     HACKDIR=$with_hackdir
3841   else
3842     # relative path
3843     HACKDIR="\${exec_prefix}$with_hackdir"
3844   fi
3845 fi
3846
3847 # canonicalize slashes.
3848 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
3849
3850 # This option used to be called --enable-subdir; make sure that is no longer
3851 # used, since configure brain-damagedly ignores unknown --enable options.
3852
3853 obsolete_enable=
3854 # Check whether --enable-subdir or --disable-subdir was given.
3855 if test "${enable_subdir+set}" = set; then
3856   enableval="$enable_subdir"
3857   obsolete_enable=yes
3858 fi
3859
3860 if test -n "$obsolete_enable"; then
3861   echo "error: the --enable-subdir option has been replaced with"
3862   echo "       the new --with-hackdir option; see \`configure --help'"
3863   echo "       for more information."
3864   exit 1
3865 fi
3866
3867
3868 ###############################################################################
3869 #
3870 #       Handle the --with-configdir option
3871 #
3872 ###############################################################################
3873
3874 have_configdir=yes
3875 with_configdir_req=unspecified
3876 # Check whether --with-configdir or --without-configdir was given.
3877 if test "${with_configdir+set}" = set; then
3878   withval="$with_configdir"
3879   with_configdir="$withval"; with_configdir_req="$withval"
3880 else
3881   with_configdir=yes
3882 fi
3883
3884
3885 if test x"$with_configdir" = xyes; then
3886   # filled in later...
3887   HACK_CONF_DIR=''
3888 elif test x"$with_configdir" = xno; then
3889   echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
3890   exit 1
3891 else
3892   # there must be a better way than this...
3893   if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
3894     # absolute path
3895     HACK_CONF_DIR=$with_configdir
3896   else
3897     # relative path
3898     HACK_CONF_DIR="\${exec_prefix}$with_configdir"
3899   fi
3900 fi
3901
3902
3903
3904
3905 ###############################################################################
3906 #
3907 #       Check for the SGI SCREEN_SAVER server extension.
3908 #
3909 ###############################################################################
3910
3911 have_sgi=no
3912 with_sgi_req=unspecified
3913 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3914 if test "${with_sgi_ext+set}" = set; then
3915   withval="$with_sgi_ext"
3916   with_sgi="$withval"; with_sgi_req="$withval"
3917 else
3918   with_sgi=yes
3919 fi
3920
3921
3922
3923    case "$with_sgi" in
3924     yes) ;;
3925     no)  ;;
3926
3927     /*)
3928      echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
3929 echo "configure:3941: checking for SGI SCREEN_SAVER headers" >&5
3930      d=$with_sgi/include
3931      if test -d $d; then
3932        X_CFLAGS="-I$d $X_CFLAGS"
3933        echo "$ac_t""$d" 1>&6
3934      else
3935        echo "$ac_t""not found ($d: no such directory)" 1>&6
3936      fi
3937
3938      echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
3939 echo "configure:3951: checking for SGI SCREEN_SAVER libs" >&5
3940      d=$with_sgi/lib
3941      if test -d $d; then
3942        X_LIBS="-L$d $X_LIBS"
3943        echo "$ac_t""$d" 1>&6
3944      else
3945        echo "$ac_t""not found ($d: no such directory)" 1>&6
3946      fi
3947
3948      # replace the directory string with "yes".
3949      with_sgi_req="yes"
3950      with_sgi=$with_sgi_req
3951      ;;
3952
3953     *)
3954      echo ""
3955      echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
3956      echo "       If it is a directory, then \`DIR/include' will be added to"
3957      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3958      exit 1
3959      ;;
3960    esac
3961   
3962
3963 if test "$with_sgi" = yes; then
3964   
3965   ac_save_CPPFLAGS="$CPPFLAGS"
3966   if test \! -z "$includedir" ; then 
3967     CPPFLAGS="$CPPFLAGS -I$includedir"
3968   fi
3969   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3970   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3971 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3972 echo "configure:3984: checking for X11/extensions/XScreenSaver.h" >&5
3973 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3974   echo $ac_n "(cached) $ac_c" 1>&6
3975 else
3976   cat > conftest.$ac_ext <<EOF
3977 #line 3989 "configure"
3978 #include "confdefs.h"
3979 #include <X11/extensions/XScreenSaver.h>
3980 EOF
3981 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3982 { (eval echo configure:3994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3983 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3984 if test -z "$ac_err"; then
3985   rm -rf conftest*
3986   eval "ac_cv_header_$ac_safe=yes"
3987 else
3988   echo "$ac_err" >&5
3989   echo "configure: failed program was:" >&5
3990   cat conftest.$ac_ext >&5
3991   rm -rf conftest*
3992   eval "ac_cv_header_$ac_safe=no"
3993 fi
3994 rm -f conftest*
3995 fi
3996 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3997   echo "$ac_t""yes" 1>&6
3998   have_sgi=yes
3999                      cat >> confdefs.h <<\EOF
4000 #define HAVE_SGI_SAVER_EXTENSION 1
4001 EOF
4002
4003 else
4004   echo "$ac_t""no" 1>&6
4005 fi
4006
4007   CPPFLAGS="$ac_save_CPPFLAGS"
4008
4009 elif test "$with_sgi" != no; then
4010   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
4011   exit 1
4012 fi
4013
4014
4015 ###############################################################################
4016 #
4017 #       Check for the MIT-SCREEN-SAVER server extension.
4018 #
4019 ###############################################################################
4020
4021 have_mit=no
4022 with_mit_req=unspecified
4023 # Check whether --with-mit-ext or --without-mit-ext was given.
4024 if test "${with_mit_ext+set}" = set; then
4025   withval="$with_mit_ext"
4026   with_mit="$withval"; with_mit_req="$withval"
4027 else
4028   with_mit=yes
4029 fi
4030
4031
4032
4033    case "$with_mit" in
4034     yes) ;;
4035     no)  ;;
4036
4037     /*)
4038      echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
4039 echo "configure:4051: checking for MIT-SCREEN-SAVER headers" >&5
4040      d=$with_mit/include
4041      if test -d $d; then
4042        X_CFLAGS="-I$d $X_CFLAGS"
4043        echo "$ac_t""$d" 1>&6
4044      else
4045        echo "$ac_t""not found ($d: no such directory)" 1>&6
4046      fi
4047
4048      echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
4049 echo "configure:4061: checking for MIT-SCREEN-SAVER libs" >&5
4050      d=$with_mit/lib
4051      if test -d $d; then
4052        X_LIBS="-L$d $X_LIBS"
4053        echo "$ac_t""$d" 1>&6
4054      else
4055        echo "$ac_t""not found ($d: no such directory)" 1>&6
4056      fi
4057
4058      # replace the directory string with "yes".
4059      with_mit_req="yes"
4060      with_mit=$with_mit_req
4061      ;;
4062
4063     *)
4064      echo ""
4065      echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory."
4066      echo "       If it is a directory, then \`DIR/include' will be added to"
4067      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4068      exit 1
4069      ;;
4070    esac
4071   
4072
4073 if test "$with_mit" = yes; then
4074   
4075   ac_save_CPPFLAGS="$CPPFLAGS"
4076   if test \! -z "$includedir" ; then 
4077     CPPFLAGS="$CPPFLAGS -I$includedir"
4078   fi
4079   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4080   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
4081 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
4082 echo "configure:4094: checking for X11/extensions/scrnsaver.h" >&5
4083 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4084   echo $ac_n "(cached) $ac_c" 1>&6
4085 else
4086   cat > conftest.$ac_ext <<EOF
4087 #line 4099 "configure"
4088 #include "confdefs.h"
4089 #include <X11/extensions/scrnsaver.h>
4090 EOF
4091 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4092 { (eval echo configure:4104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4093 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4094 if test -z "$ac_err"; then
4095   rm -rf conftest*
4096   eval "ac_cv_header_$ac_safe=yes"
4097 else
4098   echo "$ac_err" >&5
4099   echo "configure: failed program was:" >&5
4100   cat conftest.$ac_ext >&5
4101   rm -rf conftest*
4102   eval "ac_cv_header_$ac_safe=no"
4103 fi
4104 rm -f conftest*
4105 fi
4106 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4107   echo "$ac_t""yes" 1>&6
4108   have_mit=yes
4109 else
4110   echo "$ac_t""no" 1>&6
4111 fi
4112
4113   CPPFLAGS="$ac_save_CPPFLAGS"
4114
4115   # Now check to see if it's really in the library; XF86Free-3.3 ships
4116   # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
4117   #
4118   if test "$have_mit" = yes; then
4119     
4120   ac_save_CPPFLAGS="$CPPFLAGS"
4121   ac_save_LDFLAGS="$LDFLAGS"
4122 #  ac_save_LIBS="$LIBS"
4123
4124   if test \! -z "$includedir" ; then 
4125     CPPFLAGS="$CPPFLAGS -I$includedir"
4126   fi
4127   # note: $X_CFLAGS includes $x_includes
4128   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4129
4130   if test \! -z "$libdir" ; then
4131     LDFLAGS="$LDFLAGS -L$libdir"
4132   fi
4133   # note: $X_LIBS includes $x_libraries
4134   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4135
4136   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
4137 echo "configure:4149: checking for XScreenSaverRegister in -lXext" >&5
4138 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4139 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4140   echo $ac_n "(cached) $ac_c" 1>&6
4141 else
4142   ac_save_LIBS="$LIBS"
4143 LIBS="-lXext -lm $LIBS"
4144 cat > conftest.$ac_ext <<EOF
4145 #line 4157 "configure"
4146 #include "confdefs.h"
4147 /* Override any gcc2 internal prototype to avoid an error.  */
4148 /* We use char because int might match the return type of a gcc2
4149     builtin and then its argument prototype would still apply.  */
4150 char XScreenSaverRegister();
4151
4152 int main() {
4153 XScreenSaverRegister()
4154 ; return 0; }
4155 EOF
4156 if { (eval echo configure:4168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4157   rm -rf conftest*
4158   eval "ac_cv_lib_$ac_lib_var=yes"
4159 else
4160   echo "configure: failed program was:" >&5
4161   cat conftest.$ac_ext >&5
4162   rm -rf conftest*
4163   eval "ac_cv_lib_$ac_lib_var=no"
4164 fi
4165 rm -f conftest*
4166 LIBS="$ac_save_LIBS"
4167
4168 fi
4169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4170   echo "$ac_t""yes" 1>&6
4171   true
4172 else
4173   echo "$ac_t""no" 1>&6
4174 have_mit=no
4175 fi
4176
4177   CPPFLAGS="$ac_save_CPPFLAGS"
4178   LDFLAGS="$ac_save_LDFLAGS"
4179 #  LIBS="$ac_save_LIBS"
4180   
4181
4182     if test "$have_mit" = no; then
4183       # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
4184       # of in Xext.  Thank you master, may I have another.
4185       
4186   ac_save_CPPFLAGS="$CPPFLAGS"
4187   ac_save_LDFLAGS="$LDFLAGS"
4188 #  ac_save_LIBS="$LIBS"
4189
4190   if test \! -z "$includedir" ; then 
4191     CPPFLAGS="$CPPFLAGS -I$includedir"
4192   fi
4193   # note: $X_CFLAGS includes $x_includes
4194   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4195
4196   if test \! -z "$libdir" ; then
4197     LDFLAGS="$LDFLAGS -L$libdir"
4198   fi
4199   # note: $X_LIBS includes $x_libraries
4200   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4201
4202   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
4203 echo "configure:4215: checking for XScreenSaverRegister in -lXExExt" >&5
4204 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4205 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4206   echo $ac_n "(cached) $ac_c" 1>&6
4207 else
4208   ac_save_LIBS="$LIBS"
4209 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
4210 cat > conftest.$ac_ext <<EOF
4211 #line 4223 "configure"
4212 #include "confdefs.h"
4213 /* Override any gcc2 internal prototype to avoid an error.  */
4214 /* We use char because int might match the return type of a gcc2
4215     builtin and then its argument prototype would still apply.  */
4216 char XScreenSaverRegister();
4217
4218 int main() {
4219 XScreenSaverRegister()
4220 ; return 0; }
4221 EOF
4222 if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4223   rm -rf conftest*
4224   eval "ac_cv_lib_$ac_lib_var=yes"
4225 else
4226   echo "configure: failed program was:" >&5
4227   cat conftest.$ac_ext >&5
4228   rm -rf conftest*
4229   eval "ac_cv_lib_$ac_lib_var=no"
4230 fi
4231 rm -f conftest*
4232 LIBS="$ac_save_LIBS"
4233
4234 fi
4235 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4236   echo "$ac_t""yes" 1>&6
4237   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
4238 else
4239   echo "$ac_t""no" 1>&6
4240 true
4241 fi
4242
4243   CPPFLAGS="$ac_save_CPPFLAGS"
4244   LDFLAGS="$ac_save_LDFLAGS"
4245 #  LIBS="$ac_save_LIBS"
4246   
4247     fi
4248
4249     if test "$have_mit" = no; then
4250       # Double fuck!  Looks like some versions of XFree86 (whichever version
4251       # it is that comes with RedHat Linux 2.0 -- I can't find a version 
4252       # number) put this garbage in Xss instead of Xext.  Thank you master,
4253       #  may I have another.
4254       
4255   ac_save_CPPFLAGS="$CPPFLAGS"
4256   ac_save_LDFLAGS="$LDFLAGS"
4257 #  ac_save_LIBS="$LIBS"
4258
4259   if test \! -z "$includedir" ; then 
4260     CPPFLAGS="$CPPFLAGS -I$includedir"
4261   fi
4262   # note: $X_CFLAGS includes $x_includes
4263   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4264
4265   if test \! -z "$libdir" ; then
4266     LDFLAGS="$LDFLAGS -L$libdir"
4267   fi
4268   # note: $X_LIBS includes $x_libraries
4269   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4270
4271   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
4272 echo "configure:4284: checking for XScreenSaverRegister in -lXss" >&5
4273 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4274 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4275   echo $ac_n "(cached) $ac_c" 1>&6
4276 else
4277   ac_save_LIBS="$LIBS"
4278 LIBS="-lXss -lX11 -lXext -lm $LIBS"
4279 cat > conftest.$ac_ext <<EOF
4280 #line 4292 "configure"
4281 #include "confdefs.h"
4282 /* Override any gcc2 internal prototype to avoid an error.  */
4283 /* We use char because int might match the return type of a gcc2
4284     builtin and then its argument prototype would still apply.  */
4285 char XScreenSaverRegister();
4286
4287 int main() {
4288 XScreenSaverRegister()
4289 ; return 0; }
4290 EOF
4291 if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4292   rm -rf conftest*
4293   eval "ac_cv_lib_$ac_lib_var=yes"
4294 else
4295   echo "configure: failed program was:" >&5
4296   cat conftest.$ac_ext >&5
4297   rm -rf conftest*
4298   eval "ac_cv_lib_$ac_lib_var=no"
4299 fi
4300 rm -f conftest*
4301 LIBS="$ac_save_LIBS"
4302
4303 fi
4304 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4305   echo "$ac_t""yes" 1>&6
4306   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
4307 else
4308   echo "$ac_t""no" 1>&6
4309 true
4310 fi
4311
4312   CPPFLAGS="$ac_save_CPPFLAGS"
4313   LDFLAGS="$ac_save_LDFLAGS"
4314 #  LIBS="$ac_save_LIBS"
4315   
4316     fi
4317
4318   if test "$have_mit" = yes; then
4319     cat >> confdefs.h <<\EOF
4320 #define HAVE_MIT_SAVER_EXTENSION 1
4321 EOF
4322
4323   fi
4324
4325   fi
4326
4327 elif test "$with_mit" != no; then
4328   echo "error: must be yes or no: --with-mit-ext=$with_mit"
4329   exit 1
4330 fi
4331
4332
4333 ###############################################################################
4334 #
4335 #       Check for the XIDLE server extension.
4336 #
4337 ###############################################################################
4338
4339 have_xidle=no
4340 with_xidle_req=unspecified
4341 # Check whether --with-xidle-ext or --without-xidle-ext was given.
4342 if test "${with_xidle_ext+set}" = set; then
4343   withval="$with_xidle_ext"
4344   with_xidle="$withval"; with_xidle_req="$withval"
4345 else
4346   with_xidle=yes
4347 fi
4348
4349
4350
4351    case "$with_xidle" in
4352     yes) ;;
4353     no)  ;;
4354
4355     /*)
4356      echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
4357 echo "configure:4369: checking for XIDLE headers" >&5
4358      d=$with_xidle/include
4359      if test -d $d; then
4360        X_CFLAGS="-I$d $X_CFLAGS"
4361        echo "$ac_t""$d" 1>&6
4362      else
4363        echo "$ac_t""not found ($d: no such directory)" 1>&6
4364      fi
4365
4366      echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
4367 echo "configure:4379: checking for XIDLE libs" >&5
4368      d=$with_xidle/lib
4369      if test -d $d; then
4370        X_LIBS="-L$d $X_LIBS"
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      # replace the directory string with "yes".
4377      with_xidle_req="yes"
4378      with_xidle=$with_xidle_req
4379      ;;
4380
4381     *)
4382      echo ""
4383      echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
4384      echo "       If it is a directory, then \`DIR/include' will be added to"
4385      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4386      exit 1
4387      ;;
4388    esac
4389   
4390
4391 if test "$with_xidle" = yes; then
4392   
4393   ac_save_CPPFLAGS="$CPPFLAGS"
4394   if test \! -z "$includedir" ; then 
4395     CPPFLAGS="$CPPFLAGS -I$includedir"
4396   fi
4397   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4398   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
4399 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
4400 echo "configure:4412: checking for X11/extensions/xidle.h" >&5
4401 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4402   echo $ac_n "(cached) $ac_c" 1>&6
4403 else
4404   cat > conftest.$ac_ext <<EOF
4405 #line 4417 "configure"
4406 #include "confdefs.h"
4407 #include <X11/extensions/xidle.h>
4408 EOF
4409 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4410 { (eval echo configure:4422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4411 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4412 if test -z "$ac_err"; then
4413   rm -rf conftest*
4414   eval "ac_cv_header_$ac_safe=yes"
4415 else
4416   echo "$ac_err" >&5
4417   echo "configure: failed program was:" >&5
4418   cat conftest.$ac_ext >&5
4419   rm -rf conftest*
4420   eval "ac_cv_header_$ac_safe=no"
4421 fi
4422 rm -f conftest*
4423 fi
4424 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4425   echo "$ac_t""yes" 1>&6
4426   have_xidle=yes
4427                      cat >> confdefs.h <<\EOF
4428 #define HAVE_XIDLE_EXTENSION 1
4429 EOF
4430
4431 else
4432   echo "$ac_t""no" 1>&6
4433 fi
4434
4435   CPPFLAGS="$ac_save_CPPFLAGS"
4436 elif test "$with_xidle" != no; then
4437   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
4438   exit 1
4439 fi
4440
4441
4442 ###############################################################################
4443 #
4444 #       Check for the SGI-VIDEO-CONTROL server extension.
4445 #
4446 ###############################################################################
4447
4448 have_sgivc=no
4449 with_sgivc_req=unspecified
4450 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
4451 if test "${with_sgivc_ext+set}" = set; then
4452   withval="$with_sgivc_ext"
4453   with_sgivc="$withval"; with_sgivc_req="$withval"
4454 else
4455   with_sgivc=yes
4456 fi
4457
4458
4459
4460    case "$with_sgivc" in
4461     yes) ;;
4462     no)  ;;
4463
4464     /*)
4465      echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
4466 echo "configure:4478: checking for SGI-VIDEO-CONTROL headers" >&5
4467      d=$with_sgivc/include
4468      if test -d $d; then
4469        X_CFLAGS="-I$d $X_CFLAGS"
4470        echo "$ac_t""$d" 1>&6
4471      else
4472        echo "$ac_t""not found ($d: no such directory)" 1>&6
4473      fi
4474
4475      echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
4476 echo "configure:4488: checking for SGI-VIDEO-CONTROL libs" >&5
4477      d=$with_sgivc/lib
4478      if test -d $d; then
4479        X_LIBS="-L$d $X_LIBS"
4480        echo "$ac_t""$d" 1>&6
4481      else
4482        echo "$ac_t""not found ($d: no such directory)" 1>&6
4483      fi
4484
4485      # replace the directory string with "yes".
4486      with_sgivc_req="yes"
4487      with_sgivc=$with_sgivc_req
4488      ;;
4489
4490     *)
4491      echo ""
4492      echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
4493      echo "       If it is a directory, then \`DIR/include' will be added to"
4494      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4495      exit 1
4496      ;;
4497    esac
4498   
4499
4500 if test "$with_sgivc" = yes; then
4501
4502   # first check for XSGIvc.h
4503   
4504   ac_save_CPPFLAGS="$CPPFLAGS"
4505   if test \! -z "$includedir" ; then 
4506     CPPFLAGS="$CPPFLAGS -I$includedir"
4507   fi
4508   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4509   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
4510 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
4511 echo "configure:4523: checking for X11/extensions/XSGIvc.h" >&5
4512 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4513   echo $ac_n "(cached) $ac_c" 1>&6
4514 else
4515   cat > conftest.$ac_ext <<EOF
4516 #line 4528 "configure"
4517 #include "confdefs.h"
4518 #include <X11/extensions/XSGIvc.h>
4519 EOF
4520 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4521 { (eval echo configure:4533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4522 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4523 if test -z "$ac_err"; then
4524   rm -rf conftest*
4525   eval "ac_cv_header_$ac_safe=yes"
4526 else
4527   echo "$ac_err" >&5
4528   echo "configure: failed program was:" >&5
4529   cat conftest.$ac_ext >&5
4530   rm -rf conftest*
4531   eval "ac_cv_header_$ac_safe=no"
4532 fi
4533 rm -f conftest*
4534 fi
4535 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4536   echo "$ac_t""yes" 1>&6
4537   have_sgivc=yes
4538 else
4539   echo "$ac_t""no" 1>&6
4540 fi
4541
4542   CPPFLAGS="$ac_save_CPPFLAGS"
4543
4544   # if that succeeded, then check for the -lXsgivc
4545   if test "$have_sgivc" = yes; then
4546     have_sgivc=no
4547     
4548   ac_save_CPPFLAGS="$CPPFLAGS"
4549   ac_save_LDFLAGS="$LDFLAGS"
4550 #  ac_save_LIBS="$LIBS"
4551
4552   if test \! -z "$includedir" ; then 
4553     CPPFLAGS="$CPPFLAGS -I$includedir"
4554   fi
4555   # note: $X_CFLAGS includes $x_includes
4556   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4557
4558   if test \! -z "$libdir" ; then
4559     LDFLAGS="$LDFLAGS -L$libdir"
4560   fi
4561   # note: $X_LIBS includes $x_libraries
4562   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4563
4564   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
4565 echo "configure:4577: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
4566 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
4567 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4568   echo $ac_n "(cached) $ac_c" 1>&6
4569 else
4570   ac_save_LIBS="$LIBS"
4571 LIBS="-lXsgivc -lXext -lX11 $LIBS"
4572 cat > conftest.$ac_ext <<EOF
4573 #line 4585 "configure"
4574 #include "confdefs.h"
4575 /* Override any gcc2 internal prototype to avoid an error.  */
4576 /* We use char because int might match the return type of a gcc2
4577     builtin and then its argument prototype would still apply.  */
4578 char XSGIvcQueryGammaMap();
4579
4580 int main() {
4581 XSGIvcQueryGammaMap()
4582 ; return 0; }
4583 EOF
4584 if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4585   rm -rf conftest*
4586   eval "ac_cv_lib_$ac_lib_var=yes"
4587 else
4588   echo "configure: failed program was:" >&5
4589   cat conftest.$ac_ext >&5
4590   rm -rf conftest*
4591   eval "ac_cv_lib_$ac_lib_var=no"
4592 fi
4593 rm -f conftest*
4594 LIBS="$ac_save_LIBS"
4595
4596 fi
4597 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4598   echo "$ac_t""yes" 1>&6
4599   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
4600 else
4601   echo "$ac_t""no" 1>&6
4602 true
4603 fi
4604
4605   CPPFLAGS="$ac_save_CPPFLAGS"
4606   LDFLAGS="$ac_save_LDFLAGS"
4607 #  LIBS="$ac_save_LIBS"
4608   
4609   fi
4610
4611   # if that succeeded, then we've really got it.
4612   if test "$have_sgivc" = yes; then
4613     cat >> confdefs.h <<\EOF
4614 #define HAVE_SGI_VC_EXTENSION 1
4615 EOF
4616
4617   fi
4618
4619 elif test "$with_sgivc" != no; then
4620   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
4621   exit 1
4622 fi
4623
4624
4625 ###############################################################################
4626 #
4627 #       Check for the DPMS server extension.
4628 #
4629 ###############################################################################
4630
4631 have_dpms=no
4632 with_dpms_req=unspecified
4633 # Check whether --with-dpms-ext or --without-dpms-ext was given.
4634 if test "${with_dpms_ext+set}" = set; then
4635   withval="$with_dpms_ext"
4636   with_dpms="$withval"; with_dpms_req="$withval"
4637 else
4638   with_dpms=yes
4639 fi
4640
4641
4642
4643    case "$with_dpms" in
4644     yes) ;;
4645     no)  ;;
4646
4647     /*)
4648      echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
4649 echo "configure:4661: checking for DPMS headers" >&5
4650      d=$with_dpms/include
4651      if test -d $d; then
4652        X_CFLAGS="-I$d $X_CFLAGS"
4653        echo "$ac_t""$d" 1>&6
4654      else
4655        echo "$ac_t""not found ($d: no such directory)" 1>&6
4656      fi
4657
4658      echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
4659 echo "configure:4671: checking for DPMS libs" >&5
4660      d=$with_dpms/lib
4661      if test -d $d; then
4662        X_LIBS="-L$d $X_LIBS"
4663        echo "$ac_t""$d" 1>&6
4664      else
4665        echo "$ac_t""not found ($d: no such directory)" 1>&6
4666      fi
4667
4668      # replace the directory string with "yes".
4669      with_dpms_req="yes"
4670      with_dpms=$with_dpms_req
4671      ;;
4672
4673     *)
4674      echo ""
4675      echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
4676      echo "       If it is a directory, then \`DIR/include' will be added to"
4677      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4678      exit 1
4679      ;;
4680    esac
4681   
4682
4683 if test "$with_dpms" = yes; then
4684
4685   # first check for dpms.h
4686   
4687   ac_save_CPPFLAGS="$CPPFLAGS"
4688   if test \! -z "$includedir" ; then 
4689     CPPFLAGS="$CPPFLAGS -I$includedir"
4690   fi
4691   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4692   ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
4693 echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
4694 echo "configure:4706: checking for X11/extensions/dpms.h" >&5
4695 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4696   echo $ac_n "(cached) $ac_c" 1>&6
4697 else
4698   cat > conftest.$ac_ext <<EOF
4699 #line 4711 "configure"
4700 #include "confdefs.h"
4701 #include <X11/extensions/dpms.h>
4702 EOF
4703 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4704 { (eval echo configure:4716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4705 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4706 if test -z "$ac_err"; then
4707   rm -rf conftest*
4708   eval "ac_cv_header_$ac_safe=yes"
4709 else
4710   echo "$ac_err" >&5
4711   echo "configure: failed program was:" >&5
4712   cat conftest.$ac_ext >&5
4713   rm -rf conftest*
4714   eval "ac_cv_header_$ac_safe=no"
4715 fi
4716 rm -f conftest*
4717 fi
4718 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4719   echo "$ac_t""yes" 1>&6
4720   have_dpms=yes
4721 else
4722   echo "$ac_t""no" 1>&6
4723 fi
4724
4725   CPPFLAGS="$ac_save_CPPFLAGS"
4726
4727   # if that succeeded, then check for the DPMS code in the libraries
4728   if test "$have_dpms" = yes; then
4729
4730     # first look in -lXext (this is where it is with XFree86 4.0)
4731     have_dpms=no
4732     
4733   ac_save_CPPFLAGS="$CPPFLAGS"
4734   ac_save_LDFLAGS="$LDFLAGS"
4735 #  ac_save_LIBS="$LIBS"
4736
4737   if test \! -z "$includedir" ; then 
4738     CPPFLAGS="$CPPFLAGS -I$includedir"
4739   fi
4740   # note: $X_CFLAGS includes $x_includes
4741   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4742
4743   if test \! -z "$libdir" ; then
4744     LDFLAGS="$LDFLAGS -L$libdir"
4745   fi
4746   # note: $X_LIBS includes $x_libraries
4747   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4748
4749   echo $ac_n "checking for DPMSInfo in -lXext""... $ac_c" 1>&6
4750 echo "configure:4762: checking for DPMSInfo in -lXext" >&5
4751 ac_lib_var=`echo Xext'_'DPMSInfo | sed 'y%./+-%__p_%'`
4752 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4753   echo $ac_n "(cached) $ac_c" 1>&6
4754 else
4755   ac_save_LIBS="$LIBS"
4756 LIBS="-lXext -lXext -lX11 $LIBS"
4757 cat > conftest.$ac_ext <<EOF
4758 #line 4770 "configure"
4759 #include "confdefs.h"
4760 /* Override any gcc2 internal prototype to avoid an error.  */
4761 /* We use char because int might match the return type of a gcc2
4762     builtin and then its argument prototype would still apply.  */
4763 char DPMSInfo();
4764
4765 int main() {
4766 DPMSInfo()
4767 ; return 0; }
4768 EOF
4769 if { (eval echo configure:4781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4770   rm -rf conftest*
4771   eval "ac_cv_lib_$ac_lib_var=yes"
4772 else
4773   echo "configure: failed program was:" >&5
4774   cat conftest.$ac_ext >&5
4775   rm -rf conftest*
4776   eval "ac_cv_lib_$ac_lib_var=no"
4777 fi
4778 rm -f conftest*
4779 LIBS="$ac_save_LIBS"
4780
4781 fi
4782 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4783   echo "$ac_t""yes" 1>&6
4784   have_dpms=yes
4785 else
4786   echo "$ac_t""no" 1>&6
4787 true
4788 fi
4789
4790   CPPFLAGS="$ac_save_CPPFLAGS"
4791   LDFLAGS="$ac_save_LDFLAGS"
4792 #  LIBS="$ac_save_LIBS"
4793   
4794
4795     # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
4796     if test "$have_dpms" = no; then
4797       
4798   ac_save_CPPFLAGS="$CPPFLAGS"
4799   ac_save_LDFLAGS="$LDFLAGS"
4800 #  ac_save_LIBS="$LIBS"
4801
4802   if test \! -z "$includedir" ; then 
4803     CPPFLAGS="$CPPFLAGS -I$includedir"
4804   fi
4805   # note: $X_CFLAGS includes $x_includes
4806   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4807
4808   if test \! -z "$libdir" ; then
4809     LDFLAGS="$LDFLAGS -L$libdir"
4810   fi
4811   # note: $X_LIBS includes $x_libraries
4812   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4813
4814   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
4815 echo "configure:4827: checking for DPMSInfo in -lXdpms" >&5
4816 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
4817 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4818   echo $ac_n "(cached) $ac_c" 1>&6
4819 else
4820   ac_save_LIBS="$LIBS"
4821 LIBS="-lXdpms -lXext -lX11 $LIBS"
4822 cat > conftest.$ac_ext <<EOF
4823 #line 4835 "configure"
4824 #include "confdefs.h"
4825 /* Override any gcc2 internal prototype to avoid an error.  */
4826 /* We use char because int might match the return type of a gcc2
4827     builtin and then its argument prototype would still apply.  */
4828 char DPMSInfo();
4829
4830 int main() {
4831 DPMSInfo()
4832 ; return 0; }
4833 EOF
4834 if { (eval echo configure:4846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4835   rm -rf conftest*
4836   eval "ac_cv_lib_$ac_lib_var=yes"
4837 else
4838   echo "configure: failed program was:" >&5
4839   cat conftest.$ac_ext >&5
4840   rm -rf conftest*
4841   eval "ac_cv_lib_$ac_lib_var=no"
4842 fi
4843 rm -f conftest*
4844 LIBS="$ac_save_LIBS"
4845
4846 fi
4847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4848   echo "$ac_t""yes" 1>&6
4849   have_dpms=yes; XDPMS_LIBS="-lXdpms"
4850 else
4851   echo "$ac_t""no" 1>&6
4852 true
4853 fi
4854
4855   CPPFLAGS="$ac_save_CPPFLAGS"
4856   LDFLAGS="$ac_save_LDFLAGS"
4857 #  LIBS="$ac_save_LIBS"
4858   
4859     fi
4860   fi
4861
4862
4863   # if that succeeded, then we've really got it.
4864   if test "$have_dpms" = yes; then
4865     cat >> confdefs.h <<\EOF
4866 #define HAVE_DPMS_EXTENSION 1
4867 EOF
4868
4869   fi
4870
4871 elif test "$with_dpms" != no; then
4872   echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
4873   exit 1
4874 fi
4875
4876
4877 ###############################################################################
4878 #
4879 #       Check for the XINERAMA server extension.
4880 #
4881 ###############################################################################
4882
4883 have_xinerama=no
4884 with_xinerama_req=unspecified
4885 # Check whether --with-xinerama-ext or --without-xinerama-ext was given.
4886 if test "${with_xinerama_ext+set}" = set; then
4887   withval="$with_xinerama_ext"
4888   with_xinerama="$withval"; with_xinerama_req="$withval"
4889 else
4890   with_xinerama=yes
4891 fi
4892
4893
4894
4895    case "$with_xinerama" in
4896     yes) ;;
4897     no)  ;;
4898
4899     /*)
4900      echo $ac_n "checking for XINERAMA headers""... $ac_c" 1>&6
4901 echo "configure:4913: checking for XINERAMA headers" >&5
4902      d=$with_xinerama/include
4903      if test -d $d; then
4904        X_CFLAGS="-I$d $X_CFLAGS"
4905        echo "$ac_t""$d" 1>&6
4906      else
4907        echo "$ac_t""not found ($d: no such directory)" 1>&6
4908      fi
4909
4910      echo $ac_n "checking for XINERAMA libs""... $ac_c" 1>&6
4911 echo "configure:4923: checking for XINERAMA libs" >&5
4912      d=$with_xinerama/lib
4913      if test -d $d; then
4914        X_LIBS="-L$d $X_LIBS"
4915        echo "$ac_t""$d" 1>&6
4916      else
4917        echo "$ac_t""not found ($d: no such directory)" 1>&6
4918      fi
4919
4920      # replace the directory string with "yes".
4921      with_xinerama_req="yes"
4922      with_xinerama=$with_xinerama_req
4923      ;;
4924
4925     *)
4926      echo ""
4927      echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory."
4928      echo "       If it is a directory, then \`DIR/include' will be added to"
4929      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4930      exit 1
4931      ;;
4932    esac
4933   
4934
4935 if test "$with_xinerama" = yes; then
4936
4937   # first check for Xinerama.h
4938   
4939   ac_save_CPPFLAGS="$CPPFLAGS"
4940   if test \! -z "$includedir" ; then 
4941     CPPFLAGS="$CPPFLAGS -I$includedir"
4942   fi
4943   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4944   ac_safe=`echo "X11/extensions/Xinerama.h" | sed 'y%./+-%__p_%'`
4945 echo $ac_n "checking for X11/extensions/Xinerama.h""... $ac_c" 1>&6
4946 echo "configure:4958: checking for X11/extensions/Xinerama.h" >&5
4947 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4948   echo $ac_n "(cached) $ac_c" 1>&6
4949 else
4950   cat > conftest.$ac_ext <<EOF
4951 #line 4963 "configure"
4952 #include "confdefs.h"
4953 #include <X11/extensions/Xinerama.h>
4954 EOF
4955 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4956 { (eval echo configure:4968: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4957 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4958 if test -z "$ac_err"; then
4959   rm -rf conftest*
4960   eval "ac_cv_header_$ac_safe=yes"
4961 else
4962   echo "$ac_err" >&5
4963   echo "configure: failed program was:" >&5
4964   cat conftest.$ac_ext >&5
4965   rm -rf conftest*
4966   eval "ac_cv_header_$ac_safe=no"
4967 fi
4968 rm -f conftest*
4969 fi
4970 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4971   echo "$ac_t""yes" 1>&6
4972   have_xinerama=yes
4973 else
4974   echo "$ac_t""no" 1>&6
4975 fi
4976
4977   CPPFLAGS="$ac_save_CPPFLAGS"
4978
4979   # if that succeeded, then check for the XINERAMA code in the libraries
4980   if test "$have_xinerama" = yes; then
4981
4982     # first look in -lXext
4983     have_xinerama=no
4984     
4985   ac_save_CPPFLAGS="$CPPFLAGS"
4986   ac_save_LDFLAGS="$LDFLAGS"
4987 #  ac_save_LIBS="$LIBS"
4988
4989   if test \! -z "$includedir" ; then 
4990     CPPFLAGS="$CPPFLAGS -I$includedir"
4991   fi
4992   # note: $X_CFLAGS includes $x_includes
4993   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4994
4995   if test \! -z "$libdir" ; then
4996     LDFLAGS="$LDFLAGS -L$libdir"
4997   fi
4998   # note: $X_LIBS includes $x_libraries
4999   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5000
5001   echo $ac_n "checking for XineramaQueryExtension in -lXext""... $ac_c" 1>&6
5002 echo "configure:5014: checking for XineramaQueryExtension in -lXext" >&5
5003 ac_lib_var=`echo Xext'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
5004 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5005   echo $ac_n "(cached) $ac_c" 1>&6
5006 else
5007   ac_save_LIBS="$LIBS"
5008 LIBS="-lXext -lXext -lX11 $LIBS"
5009 cat > conftest.$ac_ext <<EOF
5010 #line 5022 "configure"
5011 #include "confdefs.h"
5012 /* Override any gcc2 internal prototype to avoid an error.  */
5013 /* We use char because int might match the return type of a gcc2
5014     builtin and then its argument prototype would still apply.  */
5015 char XineramaQueryExtension();
5016
5017 int main() {
5018 XineramaQueryExtension()
5019 ; return 0; }
5020 EOF
5021 if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5022   rm -rf conftest*
5023   eval "ac_cv_lib_$ac_lib_var=yes"
5024 else
5025   echo "configure: failed program was:" >&5
5026   cat conftest.$ac_ext >&5
5027   rm -rf conftest*
5028   eval "ac_cv_lib_$ac_lib_var=no"
5029 fi
5030 rm -f conftest*
5031 LIBS="$ac_save_LIBS"
5032
5033 fi
5034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5035   echo "$ac_t""yes" 1>&6
5036   have_xinerama=yes
5037 else
5038   echo "$ac_t""no" 1>&6
5039 true
5040 fi
5041
5042   CPPFLAGS="$ac_save_CPPFLAGS"
5043   LDFLAGS="$ac_save_LDFLAGS"
5044 #  LIBS="$ac_save_LIBS"
5045   
5046
5047     # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
5048     if test "$have_xinerama" = no; then
5049       
5050   ac_save_CPPFLAGS="$CPPFLAGS"
5051   ac_save_LDFLAGS="$LDFLAGS"
5052 #  ac_save_LIBS="$LIBS"
5053
5054   if test \! -z "$includedir" ; then 
5055     CPPFLAGS="$CPPFLAGS -I$includedir"
5056   fi
5057   # note: $X_CFLAGS includes $x_includes
5058   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5059
5060   if test \! -z "$libdir" ; then
5061     LDFLAGS="$LDFLAGS -L$libdir"
5062   fi
5063   # note: $X_LIBS includes $x_libraries
5064   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5065
5066   echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
5067 echo "configure:5079: checking for XineramaQueryExtension in -lXinerama" >&5
5068 ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
5069 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5070   echo $ac_n "(cached) $ac_c" 1>&6
5071 else
5072   ac_save_LIBS="$LIBS"
5073 LIBS="-lXinerama -lXext -lX11 $LIBS"
5074 cat > conftest.$ac_ext <<EOF
5075 #line 5087 "configure"
5076 #include "confdefs.h"
5077 /* Override any gcc2 internal prototype to avoid an error.  */
5078 /* We use char because int might match the return type of a gcc2
5079     builtin and then its argument prototype would still apply.  */
5080 char XineramaQueryExtension();
5081
5082 int main() {
5083 XineramaQueryExtension()
5084 ; return 0; }
5085 EOF
5086 if { (eval echo configure:5098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5087   rm -rf conftest*
5088   eval "ac_cv_lib_$ac_lib_var=yes"
5089 else
5090   echo "configure: failed program was:" >&5
5091   cat conftest.$ac_ext >&5
5092   rm -rf conftest*
5093   eval "ac_cv_lib_$ac_lib_var=no"
5094 fi
5095 rm -f conftest*
5096 LIBS="$ac_save_LIBS"
5097
5098 fi
5099 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5100   echo "$ac_t""yes" 1>&6
5101   have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"
5102 else
5103   echo "$ac_t""no" 1>&6
5104 true
5105 fi
5106
5107   CPPFLAGS="$ac_save_CPPFLAGS"
5108   LDFLAGS="$ac_save_LDFLAGS"
5109 #  LIBS="$ac_save_LIBS"
5110   
5111     fi
5112   fi
5113
5114   # if that succeeded, then we've really got it.
5115   if test "$have_xinerama" = yes; then
5116     cat >> confdefs.h <<\EOF
5117 #define HAVE_XINERAMA 1
5118 EOF
5119
5120   fi
5121
5122 elif test "$with_xinerama" != no; then
5123   echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
5124   exit 1
5125 fi
5126
5127
5128 ###############################################################################
5129 #
5130 #       Check for the XF86VMODE server extension (for virtual screens.)
5131 #
5132 ###############################################################################
5133
5134 have_xf86vmode=no
5135 with_xf86vmode_req=unspecified
5136 # Check whether --with-xf86vmode-ext or --without-xf86vmode-ext was given.
5137 if test "${with_xf86vmode_ext+set}" = set; then
5138   withval="$with_xf86vmode_ext"
5139   with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
5140 else
5141   with_xf86vmode=yes
5142 fi
5143
5144
5145
5146    case "$with_xf86vmode" in
5147     yes) ;;
5148     no)  ;;
5149
5150     /*)
5151      echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
5152 echo "configure:5164: checking for xf86vmode headers" >&5
5153      d=$with_xf86vmode/include
5154      if test -d $d; then
5155        X_CFLAGS="-I$d $X_CFLAGS"
5156        echo "$ac_t""$d" 1>&6
5157      else
5158        echo "$ac_t""not found ($d: no such directory)" 1>&6
5159      fi
5160
5161      echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
5162 echo "configure:5174: checking for xf86vmode libs" >&5
5163      d=$with_xf86vmode/lib
5164      if test -d $d; then
5165        X_LIBS="-L$d $X_LIBS"
5166        echo "$ac_t""$d" 1>&6
5167      else
5168        echo "$ac_t""not found ($d: no such directory)" 1>&6
5169      fi
5170
5171      # replace the directory string with "yes".
5172      with_xf86vmode_req="yes"
5173      with_xf86vmode=$with_xf86vmode_req
5174      ;;
5175
5176     *)
5177      echo ""
5178      echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory."
5179      echo "       If it is a directory, then \`DIR/include' will be added to"
5180      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5181      exit 1
5182      ;;
5183    esac
5184   
5185
5186 if test "$with_xf86vmode" = yes; then
5187
5188   # first check for xf86vmode.h
5189   
5190   ac_save_CPPFLAGS="$CPPFLAGS"
5191   if test \! -z "$includedir" ; then 
5192     CPPFLAGS="$CPPFLAGS -I$includedir"
5193   fi
5194   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5195   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5196 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5197 echo "configure:5209: checking for X11/extensions/xf86vmode.h" >&5
5198 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5199   echo $ac_n "(cached) $ac_c" 1>&6
5200 else
5201   cat > conftest.$ac_ext <<EOF
5202 #line 5214 "configure"
5203 #include "confdefs.h"
5204 #include <X11/extensions/xf86vmode.h>
5205 EOF
5206 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5207 { (eval echo configure:5219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5208 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5209 if test -z "$ac_err"; then
5210   rm -rf conftest*
5211   eval "ac_cv_header_$ac_safe=yes"
5212 else
5213   echo "$ac_err" >&5
5214   echo "configure: failed program was:" >&5
5215   cat conftest.$ac_ext >&5
5216   rm -rf conftest*
5217   eval "ac_cv_header_$ac_safe=no"
5218 fi
5219 rm -f conftest*
5220 fi
5221 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5222   echo "$ac_t""yes" 1>&6
5223   have_xf86vmode=yes
5224 else
5225   echo "$ac_t""no" 1>&6
5226 fi
5227
5228   CPPFLAGS="$ac_save_CPPFLAGS"
5229
5230   # if that succeeded, then check for the -lXxf86vm
5231   if test "$have_xf86vmode" = yes; then
5232     have_xf86vmode=no
5233     
5234   ac_save_CPPFLAGS="$CPPFLAGS"
5235   ac_save_LDFLAGS="$LDFLAGS"
5236 #  ac_save_LIBS="$LIBS"
5237
5238   if test \! -z "$includedir" ; then 
5239     CPPFLAGS="$CPPFLAGS -I$includedir"
5240   fi
5241   # note: $X_CFLAGS includes $x_includes
5242   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5243
5244   if test \! -z "$libdir" ; then
5245     LDFLAGS="$LDFLAGS -L$libdir"
5246   fi
5247   # note: $X_LIBS includes $x_libraries
5248   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5249
5250   echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
5251 echo "configure:5263: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
5252 ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
5253 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5254   echo $ac_n "(cached) $ac_c" 1>&6
5255 else
5256   ac_save_LIBS="$LIBS"
5257 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5258 cat > conftest.$ac_ext <<EOF
5259 #line 5271 "configure"
5260 #include "confdefs.h"
5261 /* Override any gcc2 internal prototype to avoid an error.  */
5262 /* We use char because int might match the return type of a gcc2
5263     builtin and then its argument prototype would still apply.  */
5264 char XF86VidModeGetViewPort();
5265
5266 int main() {
5267 XF86VidModeGetViewPort()
5268 ; return 0; }
5269 EOF
5270 if { (eval echo configure:5282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5271   rm -rf conftest*
5272   eval "ac_cv_lib_$ac_lib_var=yes"
5273 else
5274   echo "configure: failed program was:" >&5
5275   cat conftest.$ac_ext >&5
5276   rm -rf conftest*
5277   eval "ac_cv_lib_$ac_lib_var=no"
5278 fi
5279 rm -f conftest*
5280 LIBS="$ac_save_LIBS"
5281
5282 fi
5283 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5284   echo "$ac_t""yes" 1>&6
5285   have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5286 else
5287   echo "$ac_t""no" 1>&6
5288 true
5289 fi
5290
5291   CPPFLAGS="$ac_save_CPPFLAGS"
5292   LDFLAGS="$ac_save_LDFLAGS"
5293 #  LIBS="$ac_save_LIBS"
5294   
5295   fi
5296
5297   # if that succeeded, then we've really got it.
5298   if test "$have_xf86vmode" = yes; then
5299     cat >> confdefs.h <<\EOF
5300 #define HAVE_XF86VMODE 1
5301 EOF
5302
5303   fi
5304
5305 elif test "$with_xf86vmode" != no; then
5306   echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
5307   exit 1
5308 fi
5309
5310
5311 ###############################################################################
5312 #
5313 #       Check for the XF86VMODE server extension (for gamma fading.)
5314 #
5315 ###############################################################################
5316
5317 have_xf86gamma=no
5318 have_xf86gamma_ramp=no
5319 with_xf86gamma_req=unspecified
5320 # Check whether --with-xf86gamma-ext or --without-xf86gamma-ext was given.
5321 if test "${with_xf86gamma_ext+set}" = set; then
5322   withval="$with_xf86gamma_ext"
5323   with_xf86gamma="$withval"; with_xf86gamma_req="$withval"
5324 else
5325   with_xf86gamma=yes
5326 fi
5327
5328
5329
5330    case "$with_xf86gamma" in
5331     yes) ;;
5332     no)  ;;
5333
5334     /*)
5335      echo $ac_n "checking for xf86gamma headers""... $ac_c" 1>&6
5336 echo "configure:5348: checking for xf86gamma headers" >&5
5337      d=$with_xf86gamma/include
5338      if test -d $d; then
5339        X_CFLAGS="-I$d $X_CFLAGS"
5340        echo "$ac_t""$d" 1>&6
5341      else
5342        echo "$ac_t""not found ($d: no such directory)" 1>&6
5343      fi
5344
5345      echo $ac_n "checking for xf86gamma libs""... $ac_c" 1>&6
5346 echo "configure:5358: checking for xf86gamma libs" >&5
5347      d=$with_xf86gamma/lib
5348      if test -d $d; then
5349        X_LIBS="-L$d $X_LIBS"
5350        echo "$ac_t""$d" 1>&6
5351      else
5352        echo "$ac_t""not found ($d: no such directory)" 1>&6
5353      fi
5354
5355      # replace the directory string with "yes".
5356      with_xf86gamma_req="yes"
5357      with_xf86gamma=$with_xf86gamma_req
5358      ;;
5359
5360     *)
5361      echo ""
5362      echo "error: argument to --with-xf86gamma-ext must be \"yes\", \"no\", or a directory."
5363      echo "       If it is a directory, then \`DIR/include' will be added to"
5364      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5365      exit 1
5366      ;;
5367    esac
5368   
5369
5370 if test "$with_xf86gamma" = yes; then
5371
5372   # first check for xf86vmode.h, if we haven't already
5373   if test "$have_xf86vmode" = yes; then
5374     have_xf86gamma=yes
5375   else
5376     
5377   ac_save_CPPFLAGS="$CPPFLAGS"
5378   if test \! -z "$includedir" ; then 
5379     CPPFLAGS="$CPPFLAGS -I$includedir"
5380   fi
5381   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5382   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5383 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5384 echo "configure:5396: checking for X11/extensions/xf86vmode.h" >&5
5385 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5386   echo $ac_n "(cached) $ac_c" 1>&6
5387 else
5388   cat > conftest.$ac_ext <<EOF
5389 #line 5401 "configure"
5390 #include "confdefs.h"
5391 #include <X11/extensions/xf86vmode.h>
5392 EOF
5393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5394 { (eval echo configure:5406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5396 if test -z "$ac_err"; then
5397   rm -rf conftest*
5398   eval "ac_cv_header_$ac_safe=yes"
5399 else
5400   echo "$ac_err" >&5
5401   echo "configure: failed program was:" >&5
5402   cat conftest.$ac_ext >&5
5403   rm -rf conftest*
5404   eval "ac_cv_header_$ac_safe=no"
5405 fi
5406 rm -f conftest*
5407 fi
5408 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5409   echo "$ac_t""yes" 1>&6
5410   have_xf86gamma=yes
5411 else
5412   echo "$ac_t""no" 1>&6
5413 fi
5414
5415   CPPFLAGS="$ac_save_CPPFLAGS"
5416   fi
5417
5418   # if that succeeded, then check for the -lXxf86vm
5419   if test "$have_xf86gamma" = yes; then
5420     have_xf86gamma=no
5421     
5422   ac_save_CPPFLAGS="$CPPFLAGS"
5423   ac_save_LDFLAGS="$LDFLAGS"
5424 #  ac_save_LIBS="$LIBS"
5425
5426   if test \! -z "$includedir" ; then 
5427     CPPFLAGS="$CPPFLAGS -I$includedir"
5428   fi
5429   # note: $X_CFLAGS includes $x_includes
5430   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5431
5432   if test \! -z "$libdir" ; then
5433     LDFLAGS="$LDFLAGS -L$libdir"
5434   fi
5435   # note: $X_LIBS includes $x_libraries
5436   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5437
5438   echo $ac_n "checking for XF86VidModeSetGamma in -lXxf86vm""... $ac_c" 1>&6
5439 echo "configure:5451: checking for XF86VidModeSetGamma in -lXxf86vm" >&5
5440 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGamma | sed 'y%./+-%__p_%'`
5441 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5442   echo $ac_n "(cached) $ac_c" 1>&6
5443 else
5444   ac_save_LIBS="$LIBS"
5445 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5446 cat > conftest.$ac_ext <<EOF
5447 #line 5459 "configure"
5448 #include "confdefs.h"
5449 /* Override any gcc2 internal prototype to avoid an error.  */
5450 /* We use char because int might match the return type of a gcc2
5451     builtin and then its argument prototype would still apply.  */
5452 char XF86VidModeSetGamma();
5453
5454 int main() {
5455 XF86VidModeSetGamma()
5456 ; return 0; }
5457 EOF
5458 if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5459   rm -rf conftest*
5460   eval "ac_cv_lib_$ac_lib_var=yes"
5461 else
5462   echo "configure: failed program was:" >&5
5463   cat conftest.$ac_ext >&5
5464   rm -rf conftest*
5465   eval "ac_cv_lib_$ac_lib_var=no"
5466 fi
5467 rm -f conftest*
5468 LIBS="$ac_save_LIBS"
5469
5470 fi
5471 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5472   echo "$ac_t""yes" 1>&6
5473   have_xf86gamma=yes
5474 else
5475   echo "$ac_t""no" 1>&6
5476 true
5477 fi
5478
5479   CPPFLAGS="$ac_save_CPPFLAGS"
5480   LDFLAGS="$ac_save_LDFLAGS"
5481 #  LIBS="$ac_save_LIBS"
5482   
5483   fi
5484
5485   # check for the Ramp versions of the functions too.
5486   if test "$have_xf86gamma" = yes; then
5487     have_xf86gamma_ramp=no
5488     
5489   ac_save_CPPFLAGS="$CPPFLAGS"
5490   ac_save_LDFLAGS="$LDFLAGS"
5491 #  ac_save_LIBS="$LIBS"
5492
5493   if test \! -z "$includedir" ; then 
5494     CPPFLAGS="$CPPFLAGS -I$includedir"
5495   fi
5496   # note: $X_CFLAGS includes $x_includes
5497   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5498
5499   if test \! -z "$libdir" ; then
5500     LDFLAGS="$LDFLAGS -L$libdir"
5501   fi
5502   # note: $X_LIBS includes $x_libraries
5503   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5504
5505   echo $ac_n "checking for XF86VidModeSetGammaRamp in -lXxf86vm""... $ac_c" 1>&6
5506 echo "configure:5518: checking for XF86VidModeSetGammaRamp in -lXxf86vm" >&5
5507 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGammaRamp | sed 'y%./+-%__p_%'`
5508 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5509   echo $ac_n "(cached) $ac_c" 1>&6
5510 else
5511   ac_save_LIBS="$LIBS"
5512 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5513 cat > conftest.$ac_ext <<EOF
5514 #line 5526 "configure"
5515 #include "confdefs.h"
5516 /* Override any gcc2 internal prototype to avoid an error.  */
5517 /* We use char because int might match the return type of a gcc2
5518     builtin and then its argument prototype would still apply.  */
5519 char XF86VidModeSetGammaRamp();
5520
5521 int main() {
5522 XF86VidModeSetGammaRamp()
5523 ; return 0; }
5524 EOF
5525 if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5526   rm -rf conftest*
5527   eval "ac_cv_lib_$ac_lib_var=yes"
5528 else
5529   echo "configure: failed program was:" >&5
5530   cat conftest.$ac_ext >&5
5531   rm -rf conftest*
5532   eval "ac_cv_lib_$ac_lib_var=no"
5533 fi
5534 rm -f conftest*
5535 LIBS="$ac_save_LIBS"
5536
5537 fi
5538 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5539   echo "$ac_t""yes" 1>&6
5540   have_xf86gamma_ramp=yes
5541 else
5542   echo "$ac_t""no" 1>&6
5543 true
5544 fi
5545
5546   CPPFLAGS="$ac_save_CPPFLAGS"
5547   LDFLAGS="$ac_save_LDFLAGS"
5548 #  LIBS="$ac_save_LIBS"
5549   
5550   fi
5551
5552   # if those tests succeeded, then we've really got the functions.
5553   if test "$have_xf86gamma" = yes; then
5554     cat >> confdefs.h <<\EOF
5555 #define HAVE_XF86VMODE_GAMMA 1
5556 EOF
5557
5558   fi
5559
5560   if test "$have_xf86gamma_ramp" = yes; then
5561     cat >> confdefs.h <<\EOF
5562 #define HAVE_XF86VMODE_GAMMA_RAMP 1
5563 EOF
5564
5565   fi
5566
5567   # pull in the lib, if we haven't already
5568   if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
5569     SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5570   fi
5571
5572 elif test "$with_xf86gamma" != no; then
5573   echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
5574   exit 1
5575 fi
5576
5577
5578 ###############################################################################
5579 #
5580 #       Check for HP XHPDisableReset and XHPEnableReset.
5581 #
5582 ###############################################################################
5583
5584
5585   ac_save_CPPFLAGS="$CPPFLAGS"
5586   if test \! -z "$includedir" ; then 
5587     CPPFLAGS="$CPPFLAGS -I$includedir"
5588   fi
5589   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5590   cat > conftest.$ac_ext <<EOF
5591 #line 5603 "configure"
5592 #include "confdefs.h"
5593 #include <X11/XHPlib.h>
5594 EOF
5595 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5596   egrep "XHPDisableReset" >/dev/null 2>&1; then
5597   rm -rf conftest*
5598   cat >> confdefs.h <<\EOF
5599 #define HAVE_XHPDISABLERESET 1
5600 EOF
5601
5602                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
5603 fi
5604 rm -f conftest*
5605
5606   CPPFLAGS="$ac_save_CPPFLAGS"
5607
5608
5609 ###############################################################################
5610 #
5611 #       Check for /proc/interrupts.
5612 #
5613 ###############################################################################
5614
5615 have_proc_interrupts=no
5616 with_proc_interrupts_req=unspecified
5617 # Check whether --with-proc-interrupts or --without-proc-interrupts was given.
5618 if test "${with_proc_interrupts+set}" = set; then
5619   withval="$with_proc_interrupts"
5620   with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
5621 else
5622   with_proc_interrupts=yes
5623 fi
5624
5625
5626 if test "$with_proc_interrupts" = yes; then
5627
5628    echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
5629 echo "configure:5641: checking whether /proc/interrupts contains keyboard data" >&5
5630 if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
5631   echo $ac_n "(cached) $ac_c" 1>&6
5632 else
5633   ac_cv_have_proc_interrupts=no
5634      if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
5635        ac_cv_have_proc_interrupts=yes
5636      fi
5637     
5638 fi
5639
5640 echo "$ac_t""$ac_cv_have_proc_interrupts" 1>&6
5641    have_proc_interrupts=$ac_cv_have_proc_interrupts
5642
5643   if test "$have_proc_interrupts" = yes; then
5644     cat >> confdefs.h <<\EOF
5645 #define HAVE_PROC_INTERRUPTS 1
5646 EOF
5647
5648   fi
5649
5650 elif test "$with_proc_interrupts" != no; then
5651   echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
5652   exit 1
5653 fi
5654
5655
5656 ###############################################################################
5657 #
5658 #       The --enable-locking option
5659 #
5660 ###############################################################################
5661
5662 # Check whether --enable-locking or --disable-locking was given.
5663 if test "${enable_locking+set}" = set; then
5664   enableval="$enable_locking"
5665   enable_locking="$enableval"
5666 else
5667   enable_locking=yes
5668 fi
5669
5670 if test "$enable_locking" = yes; then
5671   true
5672 elif test "$enable_locking" = no; then
5673   cat >> confdefs.h <<\EOF
5674 #define NO_LOCKING 1
5675 EOF
5676
5677 else
5678   echo "error: must be yes or no: --enable-locking=$enable_locking"
5679   exit 1
5680 fi
5681
5682
5683
5684 ###############################################################################
5685 #
5686 #       The --enable-vt-locking option
5687 #
5688 ###############################################################################
5689
5690 #ac_vt_lockswitch=no
5691 #AC_ARG_ENABLE(vt-locking,[
5692 #  --enable-vt-locking     Compile in support for locking Virtual Terminals.
5693 #                          This is the default if the system supports it, and
5694 #                          if locking support is included (--enable-locking.)
5695 #  --disable-vt-locking    Do not allow locking of VTs, even if locking is
5696 #                          enabled.],
5697 #  [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
5698 #if test "$enable_vt_locking" = yes; then
5699 #
5700 #  AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
5701 #   [AC_TRY_COMPILE([#include <fcntl.h>
5702 #                   #include <sys/ioctl.h>
5703 #                   #include <sys/vt.h>],
5704 #                  [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
5705 #                  [ac_cv_vt_lockswitch=yes],
5706 #                  [ac_cv_vt_lockswitch=no])])
5707 #  ac_vt_lockswitch=$ac_cv_vt_lockswitch
5708 #
5709 #elif test "$enable_vt_locking" = no; then
5710 #  true
5711 #else
5712 #  echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
5713 #  exit 1
5714 #fi
5715 #
5716 #if test "$ac_vt_lockswitch" = yes; then
5717 #  AC_DEFINE(HAVE_VT_LOCKSWITCH)
5718 #  # the VT_LOCKSWITCH ioctl can only be used when running as root.
5719 #  # #### but it doesn't work yet, so don't worry about that for now.
5720 ##  need_setuid=yes
5721 #fi
5722
5723
5724
5725 ###############################################################################
5726 #
5727 #       Check for PAM.
5728 #
5729 ###############################################################################
5730
5731 case "$host" in
5732   *-solaris*)
5733    # Solaris systems tend to come with PAM misconfigured.
5734    #  Don't build it by default, even if the headers exist.
5735    with_pam_default=no
5736    ;;
5737   *)
5738    # Default to building PAM support on all other systems, if it exists.
5739    with_pam_default=yes
5740   ;;
5741 esac
5742
5743 have_pam=no
5744 with_pam_req=unspecified
5745
5746 # Check whether --with-pam or --without-pam was given.
5747 if test "${with_pam+set}" = set; then
5748   withval="$with_pam"
5749   with_pam="$withval"; with_pam_req="$withval"
5750 else
5751   with_pam=$with_pam_default
5752 fi
5753
5754
5755
5756    case "$with_pam" in
5757     yes) ;;
5758     no)  ;;
5759
5760     /*)
5761      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
5762 echo "configure:5774: checking for PAM headers" >&5
5763      d=$with_pam/include
5764      if test -d $d; then
5765        X_CFLAGS="-I$d $X_CFLAGS"
5766        echo "$ac_t""$d" 1>&6
5767      else
5768        echo "$ac_t""not found ($d: no such directory)" 1>&6
5769      fi
5770
5771      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
5772 echo "configure:5784: checking for PAM libs" >&5
5773      d=$with_pam/lib
5774      if test -d $d; then
5775        X_LIBS="-L$d $X_LIBS"
5776        echo "$ac_t""$d" 1>&6
5777      else
5778        echo "$ac_t""not found ($d: no such directory)" 1>&6
5779      fi
5780
5781      # replace the directory string with "yes".
5782      with_pam_req="yes"
5783      with_pam=$with_pam_req
5784      ;;
5785
5786     *)
5787      echo ""
5788      echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
5789      echo "       If it is a directory, then \`DIR/include' will be added to"
5790      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5791      exit 1
5792      ;;
5793    esac
5794   
5795
5796 if test "$enable_locking" = yes -a "$with_pam" = yes; then
5797   echo $ac_n "checking for PAM""... $ac_c" 1>&6
5798 echo "configure:5810: checking for PAM" >&5
5799 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
5800   echo $ac_n "(cached) $ac_c" 1>&6
5801 else
5802   
5803   ac_save_CPPFLAGS="$CPPFLAGS"
5804   if test \! -z "$includedir" ; then 
5805     CPPFLAGS="$CPPFLAGS -I$includedir"
5806   fi
5807   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5808   cat > conftest.$ac_ext <<EOF
5809 #line 5821 "configure"
5810 #include "confdefs.h"
5811 #include <security/pam_appl.h>
5812 int main() {
5813
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_cv_pam=yes
5819 else
5820   echo "configure: failed program was:" >&5
5821   cat conftest.$ac_ext >&5
5822   rm -rf conftest*
5823   ac_cv_pam=no
5824 fi
5825 rm -f conftest*
5826   CPPFLAGS="$ac_save_CPPFLAGS"
5827 fi
5828
5829 echo "$ac_t""$ac_cv_pam" 1>&6
5830   if test "$ac_cv_pam" = yes ; then
5831     have_pam=yes
5832     cat >> confdefs.h <<\EOF
5833 #define HAVE_PAM 1
5834 EOF
5835
5836     PASSWD_LIBS="${PASSWD_LIBS} -lpam"
5837
5838     # libpam typically requires dlopen and dlsym.  On FreeBSD,
5839     # those are in libc.  On Linux and Solaris, they're in libdl.
5840     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5841 echo "configure:5853: checking for dlopen in -ldl" >&5
5842 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
5843 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5844   echo $ac_n "(cached) $ac_c" 1>&6
5845 else
5846   ac_save_LIBS="$LIBS"
5847 LIBS="-ldl  $LIBS"
5848 cat > conftest.$ac_ext <<EOF
5849 #line 5861 "configure"
5850 #include "confdefs.h"
5851 /* Override any gcc2 internal prototype to avoid an error.  */
5852 /* We use char because int might match the return type of a gcc2
5853     builtin and then its argument prototype would still apply.  */
5854 char dlopen();
5855
5856 int main() {
5857 dlopen()
5858 ; return 0; }
5859 EOF
5860 if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5861   rm -rf conftest*
5862   eval "ac_cv_lib_$ac_lib_var=yes"
5863 else
5864   echo "configure: failed program was:" >&5
5865   cat conftest.$ac_ext >&5
5866   rm -rf conftest*
5867   eval "ac_cv_lib_$ac_lib_var=no"
5868 fi
5869 rm -f conftest*
5870 LIBS="$ac_save_LIBS"
5871
5872 fi
5873 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5874   echo "$ac_t""yes" 1>&6
5875   PASSWD_LIBS="${PASSWD_LIBS} -ldl"
5876 else
5877   echo "$ac_t""no" 1>&6
5878 fi
5879
5880
5881     echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
5882 echo "configure:5894: checking how to call pam_strerror" >&5
5883     if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
5884   echo $ac_n "(cached) $ac_c" 1>&6
5885 else
5886   cat > conftest.$ac_ext <<EOF
5887 #line 5899 "configure"
5888 #include "confdefs.h"
5889 #include <stdio.h>
5890                       #include <stdlib.h>
5891                       #include <security/pam_appl.h>
5892 int main() {
5893 pam_handle_t *pamh = 0;
5894                       char *s = pam_strerror(pamh, PAM_SUCCESS);
5895 ; return 0; }
5896 EOF
5897 if { (eval echo configure:5909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5898   rm -rf conftest*
5899   ac_pam_strerror_args=2
5900 else
5901   echo "configure: failed program was:" >&5
5902   cat conftest.$ac_ext >&5
5903   rm -rf conftest*
5904   cat > conftest.$ac_ext <<EOF
5905 #line 5917 "configure"
5906 #include "confdefs.h"
5907 #include <stdio.h>
5908                                       #include <stdlib.h>
5909                                       #include <security/pam_appl.h>
5910 int main() {
5911 char *s =
5912                                        pam_strerror(PAM_SUCCESS);
5913 ; return 0; }
5914 EOF
5915 if { (eval echo configure:5927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5916   rm -rf conftest*
5917   ac_pam_strerror_args=1
5918 else
5919   echo "configure: failed program was:" >&5
5920   cat conftest.$ac_ext >&5
5921   rm -rf conftest*
5922   ac_pam_strerror_args=0
5923 fi
5924 rm -f conftest*
5925 fi
5926 rm -f conftest*
5927       ac_cv_pam_strerror_args=$ac_pam_strerror_args
5928 fi
5929
5930     ac_pam_strerror_args=$ac_cv_pam_strerror_args
5931     if test "$ac_pam_strerror_args" = 1 ; then
5932       echo "$ac_t""one argument" 1>&6
5933     elif test "$ac_pam_strerror_args" = 2 ; then
5934       cat >> confdefs.h <<\EOF
5935 #define PAM_STRERROR_TWO_ARGS 1
5936 EOF
5937
5938       echo "$ac_t""two arguments" 1>&6
5939     else
5940       echo "$ac_t""unknown" 1>&6
5941     fi
5942   fi
5943 fi
5944
5945
5946 ###############################################################################
5947 #
5948 #       Check for Kerberos.
5949 #
5950 ###############################################################################
5951
5952 have_kerberos=no
5953 have_kerberos5=no
5954 with_kerberos_req=unspecified
5955
5956 # Check whether --with-kerberos or --without-kerberos was given.
5957 if test "${with_kerberos+set}" = set; then
5958   withval="$with_kerberos"
5959   with_kerberos="$withval"; with_kerberos_req="$withval"
5960 else
5961   with_kerberos=yes
5962 fi
5963
5964
5965
5966    case "$with_kerberos" in
5967     yes) ;;
5968     no)  ;;
5969
5970     /*)
5971      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
5972 echo "configure:5984: checking for Kerberos headers" >&5
5973      d=$with_kerberos/include
5974      if test -d $d; then
5975        X_CFLAGS="-I$d $X_CFLAGS"
5976        echo "$ac_t""$d" 1>&6
5977      else
5978        echo "$ac_t""not found ($d: no such directory)" 1>&6
5979      fi
5980
5981      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
5982 echo "configure:5994: checking for Kerberos libs" >&5
5983      d=$with_kerberos/lib
5984      if test -d $d; then
5985        X_LIBS="-L$d $X_LIBS"
5986        echo "$ac_t""$d" 1>&6
5987      else
5988        echo "$ac_t""not found ($d: no such directory)" 1>&6
5989      fi
5990
5991      # replace the directory string with "yes".
5992      with_kerberos_req="yes"
5993      with_kerberos=$with_kerberos_req
5994      ;;
5995
5996     *)
5997      echo ""
5998      echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory."
5999      echo "       If it is a directory, then \`DIR/include' will be added to"
6000      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6001      exit 1
6002      ;;
6003    esac
6004   
6005
6006 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
6007   echo $ac_n "checking for Kerberos 4""... $ac_c" 1>&6
6008 echo "configure:6020: checking for Kerberos 4" >&5
6009 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
6010   echo $ac_n "(cached) $ac_c" 1>&6
6011 else
6012   
6013   ac_save_CPPFLAGS="$CPPFLAGS"
6014   if test \! -z "$includedir" ; then 
6015     CPPFLAGS="$CPPFLAGS -I$includedir"
6016   fi
6017   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6018   cat > conftest.$ac_ext <<EOF
6019 #line 6031 "configure"
6020 #include "confdefs.h"
6021 #include <krb.h>
6022 int main() {
6023
6024 ; return 0; }
6025 EOF
6026 if { (eval echo configure:6038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6027   rm -rf conftest*
6028   ac_cv_kerberos=yes
6029 else
6030   echo "configure: failed program was:" >&5
6031   cat conftest.$ac_ext >&5
6032   rm -rf conftest*
6033   ac_cv_kerberos=no
6034 fi
6035 rm -f conftest*
6036   CPPFLAGS="$ac_save_CPPFLAGS"
6037 fi
6038
6039 echo "$ac_t""$ac_cv_kerberos" 1>&6
6040   echo $ac_n "checking for Kerberos 5""... $ac_c" 1>&6
6041 echo "configure:6053: checking for Kerberos 5" >&5
6042 if eval "test \"`echo '$''{'ac_cv_kerberos5'+set}'`\" = set"; then
6043   echo $ac_n "(cached) $ac_c" 1>&6
6044 else
6045   
6046   ac_save_CPPFLAGS="$CPPFLAGS"
6047   if test \! -z "$includedir" ; then 
6048     CPPFLAGS="$CPPFLAGS -I$includedir"
6049   fi
6050   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6051   cat > conftest.$ac_ext <<EOF
6052 #line 6064 "configure"
6053 #include "confdefs.h"
6054 #include <kerberosIV/krb.h>
6055 int main() {
6056
6057 ; return 0; }
6058 EOF
6059 if { (eval echo configure:6071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6060   rm -rf conftest*
6061   ac_cv_kerberos5=yes
6062 else
6063   echo "configure: failed program was:" >&5
6064   cat conftest.$ac_ext >&5
6065   rm -rf conftest*
6066   ac_cv_kerberos5=no
6067 fi
6068 rm -f conftest*
6069   CPPFLAGS="$ac_save_CPPFLAGS"
6070 fi
6071
6072 echo "$ac_t""$ac_cv_kerberos5" 1>&6
6073
6074   if test "$ac_cv_kerberos" = yes ; then
6075     have_kerberos=yes
6076     cat >> confdefs.h <<\EOF
6077 #define HAVE_KERBEROS 1
6078 EOF
6079
6080   fi
6081
6082   if test "$ac_cv_kerberos5" = yes ; then
6083     have_kerberos=yes
6084     have_kerberos5=yes
6085     cat >> confdefs.h <<\EOF
6086 #define HAVE_KERBEROS 1
6087 EOF
6088
6089     cat >> confdefs.h <<\EOF
6090 #define HAVE_KERBEROS5 1
6091 EOF
6092
6093   fi
6094
6095   if test "$have_kerberos5" = yes ; then
6096     # from Matt Knopp <mhat@infocalypse.netlag.com>
6097     # (who got it from amu@mit.edu)
6098     PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
6099   elif test "$have_kerberos" = yes ; then
6100     # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
6101     PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
6102   fi
6103
6104   if test "$have_kerberos" = yes ; then
6105     echo $ac_n "checking for res_search""... $ac_c" 1>&6
6106 echo "configure:6118: checking for res_search" >&5
6107 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
6108   echo $ac_n "(cached) $ac_c" 1>&6
6109 else
6110   cat > conftest.$ac_ext <<EOF
6111 #line 6123 "configure"
6112 #include "confdefs.h"
6113 /* System header to define __stub macros and hopefully few prototypes,
6114     which can conflict with char res_search(); below.  */
6115 #include <assert.h>
6116 /* Override any gcc2 internal prototype to avoid an error.  */
6117 /* We use char because int might match the return type of a gcc2
6118     builtin and then its argument prototype would still apply.  */
6119 char res_search();
6120
6121 int main() {
6122
6123 /* The GNU C library defines this for functions which it implements
6124     to always fail with ENOSYS.  Some functions are actually named
6125     something starting with __ and the normal name is an alias.  */
6126 #if defined (__stub_res_search) || defined (__stub___res_search)
6127 choke me
6128 #else
6129 res_search();
6130 #endif
6131
6132 ; return 0; }
6133 EOF
6134 if { (eval echo configure:6146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6135   rm -rf conftest*
6136   eval "ac_cv_func_res_search=yes"
6137 else
6138   echo "configure: failed program was:" >&5
6139   cat conftest.$ac_ext >&5
6140   rm -rf conftest*
6141   eval "ac_cv_func_res_search=no"
6142 fi
6143 rm -f conftest*
6144 fi
6145
6146 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
6147   echo "$ac_t""yes" 1>&6
6148   :
6149 else
6150   echo "$ac_t""no" 1>&6
6151 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
6152 echo "configure:6164: checking for res_search in -lresolv" >&5
6153 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
6154 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6155   echo $ac_n "(cached) $ac_c" 1>&6
6156 else
6157   ac_save_LIBS="$LIBS"
6158 LIBS="-lresolv  $LIBS"
6159 cat > conftest.$ac_ext <<EOF
6160 #line 6172 "configure"
6161 #include "confdefs.h"
6162 /* Override any gcc2 internal prototype to avoid an error.  */
6163 /* We use char because int might match the return type of a gcc2
6164     builtin and then its argument prototype would still apply.  */
6165 char res_search();
6166
6167 int main() {
6168 res_search()
6169 ; return 0; }
6170 EOF
6171 if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6172   rm -rf conftest*
6173   eval "ac_cv_lib_$ac_lib_var=yes"
6174 else
6175   echo "configure: failed program was:" >&5
6176   cat conftest.$ac_ext >&5
6177   rm -rf conftest*
6178   eval "ac_cv_lib_$ac_lib_var=no"
6179 fi
6180 rm -f conftest*
6181 LIBS="$ac_save_LIBS"
6182
6183 fi
6184 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6185   echo "$ac_t""yes" 1>&6
6186   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
6187 else
6188   echo "$ac_t""no" 1>&6
6189 echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
6190       
6191 fi
6192
6193 fi
6194
6195   fi
6196 fi
6197
6198
6199 ###############################################################################
6200 #
6201 #       Check for the nine billion variants of shadow passwords...
6202 #
6203 ###############################################################################
6204
6205 need_setuid=no
6206
6207 have_shadow=no
6208 with_shadow_req=unspecified
6209
6210 # Check whether --with-shadow or --without-shadow was given.
6211 if test "${with_shadow+set}" = set; then
6212   withval="$with_shadow"
6213   with_shadow="$withval"; with_shadow_req="$withval"
6214 else
6215   with_shadow=yes
6216 fi
6217
6218
6219
6220    case "$with_shadow" in
6221     yes) ;;
6222     no)  ;;
6223
6224     /*)
6225      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
6226 echo "configure:6238: checking for shadow password headers" >&5
6227      d=$with_shadow/include
6228      if test -d $d; then
6229        X_CFLAGS="-I$d $X_CFLAGS"
6230        echo "$ac_t""$d" 1>&6
6231      else
6232        echo "$ac_t""not found ($d: no such directory)" 1>&6
6233      fi
6234
6235      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
6236 echo "configure:6248: checking for shadow password libs" >&5
6237      d=$with_shadow/lib
6238      if test -d $d; then
6239        X_LIBS="-L$d $X_LIBS"
6240        echo "$ac_t""$d" 1>&6
6241      else
6242        echo "$ac_t""not found ($d: no such directory)" 1>&6
6243      fi
6244
6245      # replace the directory string with "yes".
6246      with_shadow_req="yes"
6247      with_shadow=$with_shadow_req
6248      ;;
6249
6250     *)
6251      echo ""
6252      echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory."
6253      echo "       If it is a directory, then \`DIR/include' will be added to"
6254      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6255      exit 1
6256      ;;
6257    esac
6258   
6259
6260 if test "$enable_locking" = no ; then
6261   with_shadow_req=no
6262   with_shadow=no
6263 fi
6264
6265
6266 ###############################################################################
6267 #
6268 #       Check for Sun "adjunct" passwords.
6269 #
6270 ###############################################################################
6271
6272 if test "$with_shadow" = yes ; then
6273   echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
6274 echo "configure:6286: checking for Sun-style shadow passwords" >&5
6275 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
6276   echo $ac_n "(cached) $ac_c" 1>&6
6277 else
6278   
6279   ac_save_CPPFLAGS="$CPPFLAGS"
6280   if test \! -z "$includedir" ; then 
6281     CPPFLAGS="$CPPFLAGS -I$includedir"
6282   fi
6283   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6284   cat > conftest.$ac_ext <<EOF
6285 #line 6297 "configure"
6286 #include "confdefs.h"
6287 #include <stdlib.h>
6288                                     #include <unistd.h>
6289                                     #include <sys/types.h>
6290                                     #include <sys/label.h>
6291                                     #include <sys/audit.h>
6292                                     #include <pwdadj.h>
6293 int main() {
6294 struct passwd_adjunct *p = getpwanam("nobody");
6295                        const char *pw = p->pwa_passwd;
6296 ; return 0; }
6297 EOF
6298 if { (eval echo configure:6310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6299   rm -rf conftest*
6300   ac_cv_sun_adjunct=yes
6301 else
6302   echo "configure: failed program was:" >&5
6303   cat conftest.$ac_ext >&5
6304   rm -rf conftest*
6305   ac_cv_sun_adjunct=no
6306 fi
6307 rm -f conftest*
6308   CPPFLAGS="$ac_save_CPPFLAGS"
6309 fi
6310
6311 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
6312   if test "$ac_cv_sun_adjunct" = yes; then
6313     have_shadow_adjunct=yes
6314     have_shadow=yes
6315     need_setuid=yes
6316   fi
6317 fi
6318
6319
6320 ###############################################################################
6321 #
6322 #       Check for DEC and SCO so-called "enhanced" security.
6323 #
6324 ###############################################################################
6325
6326 if test "$with_shadow" = yes ; then
6327   echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
6328 echo "configure:6340: checking for DEC-style shadow passwords" >&5
6329 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
6330   echo $ac_n "(cached) $ac_c" 1>&6
6331 else
6332   
6333   ac_save_CPPFLAGS="$CPPFLAGS"
6334   if test \! -z "$includedir" ; then 
6335     CPPFLAGS="$CPPFLAGS -I$includedir"
6336   fi
6337   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6338   cat > conftest.$ac_ext <<EOF
6339 #line 6351 "configure"
6340 #include "confdefs.h"
6341 #include <stdlib.h>
6342                                     #include <unistd.h>
6343                                     #include <sys/types.h>
6344                                     #include <pwd.h>
6345                                     #include <sys/security.h>
6346                                     #include <prot.h>
6347 int main() {
6348 struct pr_passwd *p;
6349                        const char *pw;
6350                        set_auth_parameters(0, 0);
6351                        check_auth_parameters();
6352                        p = getprpwnam("nobody");
6353                        pw = p->ufld.fd_encrypt;
6354 ; return 0; }
6355 EOF
6356 if { (eval echo configure:6368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6357   rm -rf conftest*
6358   ac_cv_enhanced_passwd=yes
6359 else
6360   echo "configure: failed program was:" >&5
6361   cat conftest.$ac_ext >&5
6362   rm -rf conftest*
6363   ac_cv_enhanced_passwd=no
6364 fi
6365 rm -f conftest*
6366   CPPFLAGS="$ac_save_CPPFLAGS"
6367 fi
6368
6369 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
6370   if test $ac_cv_enhanced_passwd = yes; then
6371     have_shadow_enhanced=yes
6372     have_shadow=yes
6373     need_setuid=yes
6374
6375     # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
6376     # (I'm told it needs -lcurses too, but I don't understand why.)
6377     # But on DEC, it's in -lsecurity.
6378     #
6379     echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
6380 echo "configure:6392: checking for getprpwnam in -lprot" >&5
6381 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
6382 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6383   echo $ac_n "(cached) $ac_c" 1>&6
6384 else
6385   ac_save_LIBS="$LIBS"
6386 LIBS="-lprot -lx $LIBS"
6387 cat > conftest.$ac_ext <<EOF
6388 #line 6400 "configure"
6389 #include "confdefs.h"
6390 /* Override any gcc2 internal prototype to avoid an error.  */
6391 /* We use char because int might match the return type of a gcc2
6392     builtin and then its argument prototype would still apply.  */
6393 char getprpwnam();
6394
6395 int main() {
6396 getprpwnam()
6397 ; return 0; }
6398 EOF
6399 if { (eval echo configure:6411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6400   rm -rf conftest*
6401   eval "ac_cv_lib_$ac_lib_var=yes"
6402 else
6403   echo "configure: failed program was:" >&5
6404   cat conftest.$ac_ext >&5
6405   rm -rf conftest*
6406   eval "ac_cv_lib_$ac_lib_var=no"
6407 fi
6408 rm -f conftest*
6409 LIBS="$ac_save_LIBS"
6410
6411 fi
6412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6413   echo "$ac_t""yes" 1>&6
6414   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
6415 else
6416   echo "$ac_t""no" 1>&6
6417 echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
6418 echo "configure:6430: checking for getprpwnam in -lsecurity" >&5
6419 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
6420 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6421   echo $ac_n "(cached) $ac_c" 1>&6
6422 else
6423   ac_save_LIBS="$LIBS"
6424 LIBS="-lsecurity  $LIBS"
6425 cat > conftest.$ac_ext <<EOF
6426 #line 6438 "configure"
6427 #include "confdefs.h"
6428 /* Override any gcc2 internal prototype to avoid an error.  */
6429 /* We use char because int might match the return type of a gcc2
6430     builtin and then its argument prototype would still apply.  */
6431 char getprpwnam();
6432
6433 int main() {
6434 getprpwnam()
6435 ; return 0; }
6436 EOF
6437 if { (eval echo configure:6449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6438   rm -rf conftest*
6439   eval "ac_cv_lib_$ac_lib_var=yes"
6440 else
6441   echo "configure: failed program was:" >&5
6442   cat conftest.$ac_ext >&5
6443   rm -rf conftest*
6444   eval "ac_cv_lib_$ac_lib_var=no"
6445 fi
6446 rm -f conftest*
6447 LIBS="$ac_save_LIBS"
6448
6449 fi
6450 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6451   echo "$ac_t""yes" 1>&6
6452   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
6453 else
6454   echo "$ac_t""no" 1>&6
6455 fi
6456
6457 fi
6458
6459   fi
6460 fi
6461
6462 ###############################################################################
6463 #
6464 #       Check for HP's entry in the "Not Invented Here" Sweepstakes.
6465 #
6466 ###############################################################################
6467
6468 if test "$with_shadow" = yes ; then
6469   echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
6470 echo "configure:6482: checking for HP-style shadow passwords" >&5
6471 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
6472   echo $ac_n "(cached) $ac_c" 1>&6
6473 else
6474   
6475   ac_save_CPPFLAGS="$CPPFLAGS"
6476   if test \! -z "$includedir" ; then 
6477     CPPFLAGS="$CPPFLAGS -I$includedir"
6478   fi
6479   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6480   cat > conftest.$ac_ext <<EOF
6481 #line 6493 "configure"
6482 #include "confdefs.h"
6483 #include <stdlib.h>
6484                                     #include <unistd.h>
6485                                     #include <sys/types.h>
6486                                     #include <pwd.h>
6487                                     #include <hpsecurity.h>
6488                                     #include <prot.h>
6489 int main() {
6490 struct s_passwd *p = getspwnam("nobody");
6491                        const char *pw = p->pw_passwd;
6492 ; return 0; }
6493 EOF
6494 if { (eval echo configure:6506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6495   rm -rf conftest*
6496   ac_cv_hpux_passwd=yes
6497 else
6498   echo "configure: failed program was:" >&5
6499   cat conftest.$ac_ext >&5
6500   rm -rf conftest*
6501   ac_cv_hpux_passwd=no
6502 fi
6503 rm -f conftest*
6504   CPPFLAGS="$ac_save_CPPFLAGS"
6505 fi
6506
6507 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
6508   if test "$ac_cv_hpux_passwd" = yes; then
6509     have_shadow_hpux=yes
6510     have_shadow=yes
6511     need_setuid=yes
6512
6513     # on HPUX, bigcrypt is in -lsec
6514     echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
6515 echo "configure:6527: checking for bigcrypt in -lsec" >&5
6516 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
6517 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6518   echo $ac_n "(cached) $ac_c" 1>&6
6519 else
6520   ac_save_LIBS="$LIBS"
6521 LIBS="-lsec  $LIBS"
6522 cat > conftest.$ac_ext <<EOF
6523 #line 6535 "configure"
6524 #include "confdefs.h"
6525 /* Override any gcc2 internal prototype to avoid an error.  */
6526 /* We use char because int might match the return type of a gcc2
6527     builtin and then its argument prototype would still apply.  */
6528 char bigcrypt();
6529
6530 int main() {
6531 bigcrypt()
6532 ; return 0; }
6533 EOF
6534 if { (eval echo configure:6546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6535   rm -rf conftest*
6536   eval "ac_cv_lib_$ac_lib_var=yes"
6537 else
6538   echo "configure: failed program was:" >&5
6539   cat conftest.$ac_ext >&5
6540   rm -rf conftest*
6541   eval "ac_cv_lib_$ac_lib_var=no"
6542 fi
6543 rm -f conftest*
6544 LIBS="$ac_save_LIBS"
6545
6546 fi
6547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6548   echo "$ac_t""yes" 1>&6
6549   PASSWD_LIBS="$PASSWD_LIBS -lsec"
6550 else
6551   echo "$ac_t""no" 1>&6
6552 fi
6553
6554   fi
6555 fi
6556
6557
6558 ###############################################################################
6559 #
6560 #       Check for FreeBSD-style shadow passwords.
6561 #
6562 #       On FreeBSD, getpwnam() and friends work just like on non-shadow-
6563 #       password systems -- except you only get stuff in the pw_passwd field
6564 #       if the running program is setuid.  So, guess that we've got this
6565 #       lossage to contend with if /etc/master.passwd exists, and default to
6566 #       a setuid installation.
6567 #
6568 ###############################################################################
6569
6570 if test "$with_shadow" = yes ; then
6571   echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
6572 echo "configure:6584: checking for FreeBSD-style shadow passwords" >&5
6573 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
6574   echo $ac_n "(cached) $ac_c" 1>&6
6575 else
6576   if test -f /etc/master.passwd ; then
6577                     ac_cv_master_passwd=yes
6578                   else
6579                     ac_cv_master_passwd=no
6580                   fi
6581 fi
6582
6583 echo "$ac_t""$ac_cv_master_passwd" 1>&6
6584   if test "$ac_cv_master_passwd" = yes; then
6585     need_setuid=yes
6586   fi
6587 fi
6588
6589
6590 ###############################################################################
6591 #
6592 #       Check for traditional (ha!) shadow passwords.
6593 #
6594 ###############################################################################
6595
6596 if test "$with_shadow" = yes ; then
6597   echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
6598 echo "configure:6610: checking for generic shadow passwords" >&5
6599 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
6600   echo $ac_n "(cached) $ac_c" 1>&6
6601 else
6602   
6603   ac_save_CPPFLAGS="$CPPFLAGS"
6604   if test \! -z "$includedir" ; then 
6605     CPPFLAGS="$CPPFLAGS -I$includedir"
6606   fi
6607   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6608   cat > conftest.$ac_ext <<EOF
6609 #line 6621 "configure"
6610 #include "confdefs.h"
6611 #include <stdlib.h>
6612                                     #include <unistd.h>
6613                                     #include <sys/types.h>
6614                                     #include <pwd.h>
6615                                     #include <shadow.h>
6616 int main() {
6617 struct spwd *p = getspnam("nobody");
6618                        const char *pw = p->sp_pwdp;
6619 ; return 0; }
6620 EOF
6621 if { (eval echo configure:6633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6622   rm -rf conftest*
6623   ac_cv_shadow=yes
6624 else
6625   echo "configure: failed program was:" >&5
6626   cat conftest.$ac_ext >&5
6627   rm -rf conftest*
6628   ac_cv_shadow=no
6629 fi
6630 rm -f conftest*
6631   CPPFLAGS="$ac_save_CPPFLAGS"
6632 fi
6633
6634 echo "$ac_t""$ac_cv_shadow" 1>&6
6635   if test "$ac_cv_shadow" = yes; then
6636     have_shadow=yes
6637     need_setuid=yes
6638
6639     # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
6640     have_getspnam=no
6641     echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
6642 echo "configure:6654: checking for getspnam in -lc" >&5
6643 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
6644 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6645   echo $ac_n "(cached) $ac_c" 1>&6
6646 else
6647   ac_save_LIBS="$LIBS"
6648 LIBS="-lc  $LIBS"
6649 cat > conftest.$ac_ext <<EOF
6650 #line 6662 "configure"
6651 #include "confdefs.h"
6652 /* Override any gcc2 internal prototype to avoid an error.  */
6653 /* We use char because int might match the return type of a gcc2
6654     builtin and then its argument prototype would still apply.  */
6655 char getspnam();
6656
6657 int main() {
6658 getspnam()
6659 ; return 0; }
6660 EOF
6661 if { (eval echo configure:6673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6662   rm -rf conftest*
6663   eval "ac_cv_lib_$ac_lib_var=yes"
6664 else
6665   echo "configure: failed program was:" >&5
6666   cat conftest.$ac_ext >&5
6667   rm -rf conftest*
6668   eval "ac_cv_lib_$ac_lib_var=no"
6669 fi
6670 rm -f conftest*
6671 LIBS="$ac_save_LIBS"
6672
6673 fi
6674 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6675   echo "$ac_t""yes" 1>&6
6676   have_getspnam=yes
6677 else
6678   echo "$ac_t""no" 1>&6
6679 fi
6680
6681     if test "$have_getspnam" = no ; then
6682       echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
6683 echo "configure:6695: checking for getspnam in -lgen" >&5
6684 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
6685 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6686   echo $ac_n "(cached) $ac_c" 1>&6
6687 else
6688   ac_save_LIBS="$LIBS"
6689 LIBS="-lgen  $LIBS"
6690 cat > conftest.$ac_ext <<EOF
6691 #line 6703 "configure"
6692 #include "confdefs.h"
6693 /* Override any gcc2 internal prototype to avoid an error.  */
6694 /* We use char because int might match the return type of a gcc2
6695     builtin and then its argument prototype would still apply.  */
6696 char getspnam();
6697
6698 int main() {
6699 getspnam()
6700 ; return 0; }
6701 EOF
6702 if { (eval echo configure:6714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6703   rm -rf conftest*
6704   eval "ac_cv_lib_$ac_lib_var=yes"
6705 else
6706   echo "configure: failed program was:" >&5
6707   cat conftest.$ac_ext >&5
6708   rm -rf conftest*
6709   eval "ac_cv_lib_$ac_lib_var=no"
6710 fi
6711 rm -f conftest*
6712 LIBS="$ac_save_LIBS"
6713
6714 fi
6715 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6716   echo "$ac_t""yes" 1>&6
6717   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
6718 else
6719   echo "$ac_t""no" 1>&6
6720 fi
6721
6722     fi
6723   fi
6724 fi
6725
6726
6727 ###############################################################################
6728 #
6729 #       Check for other libraries needed for non-shadow passwords.
6730 #
6731 ###############################################################################
6732
6733 if test "$enable_locking" = yes ; then
6734
6735   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
6736   have_crypt=no
6737   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
6738 echo "configure:6750: checking for crypt in -lc" >&5
6739 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
6740 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6741   echo $ac_n "(cached) $ac_c" 1>&6
6742 else
6743   ac_save_LIBS="$LIBS"
6744 LIBS="-lc  $LIBS"
6745 cat > conftest.$ac_ext <<EOF
6746 #line 6758 "configure"
6747 #include "confdefs.h"
6748 /* Override any gcc2 internal prototype to avoid an error.  */
6749 /* We use char because int might match the return type of a gcc2
6750     builtin and then its argument prototype would still apply.  */
6751 char crypt();
6752
6753 int main() {
6754 crypt()
6755 ; return 0; }
6756 EOF
6757 if { (eval echo configure:6769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6758   rm -rf conftest*
6759   eval "ac_cv_lib_$ac_lib_var=yes"
6760 else
6761   echo "configure: failed program was:" >&5
6762   cat conftest.$ac_ext >&5
6763   rm -rf conftest*
6764   eval "ac_cv_lib_$ac_lib_var=no"
6765 fi
6766 rm -f conftest*
6767 LIBS="$ac_save_LIBS"
6768
6769 fi
6770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6771   echo "$ac_t""yes" 1>&6
6772   have_crypt=yes
6773 else
6774   echo "$ac_t""no" 1>&6
6775 fi
6776
6777   if test "$have_crypt" = no ; then
6778     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6779 echo "configure:6791: checking for crypt in -lcrypt" >&5
6780 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6781 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6782   echo $ac_n "(cached) $ac_c" 1>&6
6783 else
6784   ac_save_LIBS="$LIBS"
6785 LIBS="-lcrypt  $LIBS"
6786 cat > conftest.$ac_ext <<EOF
6787 #line 6799 "configure"
6788 #include "confdefs.h"
6789 /* Override any gcc2 internal prototype to avoid an error.  */
6790 /* We use char because int might match the return type of a gcc2
6791     builtin and then its argument prototype would still apply.  */
6792 char crypt();
6793
6794 int main() {
6795 crypt()
6796 ; return 0; }
6797 EOF
6798 if { (eval echo configure:6810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6799   rm -rf conftest*
6800   eval "ac_cv_lib_$ac_lib_var=yes"
6801 else
6802   echo "configure: failed program was:" >&5
6803   cat conftest.$ac_ext >&5
6804   rm -rf conftest*
6805   eval "ac_cv_lib_$ac_lib_var=no"
6806 fi
6807 rm -f conftest*
6808 LIBS="$ac_save_LIBS"
6809
6810 fi
6811 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6812   echo "$ac_t""yes" 1>&6
6813   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
6814 else
6815   echo "$ac_t""no" 1>&6
6816 fi
6817
6818   fi
6819 fi
6820
6821
6822 # Most of the above shadow mechanisms will have set need_setuid to yes,
6823 # if they were found.  But, on some systems, we need setuid even when
6824 # using plain old vanilla passwords.
6825 #
6826 if test "$enable_locking" = yes ; then
6827   case "$host" in
6828     *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
6829       need_setuid=yes
6830     ;;
6831   esac
6832 fi
6833
6834
6835 if test "$have_shadow_adjunct" = yes ; then
6836   cat >> confdefs.h <<\EOF
6837 #define HAVE_ADJUNCT_PASSWD 1
6838 EOF
6839
6840 elif test "$have_shadow_enhanced" = yes ; then
6841   cat >> confdefs.h <<\EOF
6842 #define HAVE_ENHANCED_PASSWD 1
6843 EOF
6844
6845 elif test "$have_shadow_hpux" = yes ; then
6846   cat >> confdefs.h <<\EOF
6847 #define HAVE_HPUX_PASSWD 1
6848 EOF
6849
6850 elif test "$have_shadow" = yes ; then
6851   cat >> confdefs.h <<\EOF
6852 #define HAVE_SHADOW_PASSWD 1
6853 EOF
6854
6855 fi
6856
6857
6858 ###############################################################################
6859 #
6860 #       Check for -lXm.
6861 #
6862 ###############################################################################
6863
6864 have_motif=no
6865 with_motif_req=unspecified
6866 # Check whether --with-motif or --without-motif was given.
6867 if test "${with_motif+set}" = set; then
6868   withval="$with_motif"
6869   with_motif="$withval"; with_motif_req="$withval"
6870 else
6871   with_motif=yes
6872 fi
6873
6874
6875
6876    case "$with_motif" in
6877     yes) ;;
6878     no)  ;;
6879
6880     /*)
6881      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
6882 echo "configure:6894: checking for Motif headers" >&5
6883      d=$with_motif/include
6884      if test -d $d; then
6885        X_CFLAGS="-I$d $X_CFLAGS"
6886        echo "$ac_t""$d" 1>&6
6887      else
6888        echo "$ac_t""not found ($d: no such directory)" 1>&6
6889      fi
6890
6891      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
6892 echo "configure:6904: checking for Motif libs" >&5
6893      d=$with_motif/lib
6894      if test -d $d; then
6895        X_LIBS="-L$d $X_LIBS"
6896        echo "$ac_t""$d" 1>&6
6897      else
6898        echo "$ac_t""not found ($d: no such directory)" 1>&6
6899      fi
6900
6901      # replace the directory string with "yes".
6902      with_motif_req="yes"
6903      with_motif=$with_motif_req
6904      ;;
6905
6906     *)
6907      echo ""
6908      echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory."
6909      echo "       If it is a directory, then \`DIR/include' will be added to"
6910      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6911      exit 1
6912      ;;
6913    esac
6914   
6915
6916 if test "$with_motif" != yes -a "$with_motif" != no ; then
6917   echo "error: must be yes or no: --with-motif=$with_motif"
6918   exit 1
6919 fi
6920
6921 if test "$with_motif" = yes; then
6922   have_motif=no
6923   
6924   ac_save_CPPFLAGS="$CPPFLAGS"
6925   if test \! -z "$includedir" ; then 
6926     CPPFLAGS="$CPPFLAGS -I$includedir"
6927   fi
6928   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6929   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
6930 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
6931 echo "configure:6943: checking for Xm/Xm.h" >&5
6932 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6933   echo $ac_n "(cached) $ac_c" 1>&6
6934 else
6935   cat > conftest.$ac_ext <<EOF
6936 #line 6948 "configure"
6937 #include "confdefs.h"
6938 #include <Xm/Xm.h>
6939 EOF
6940 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6941 { (eval echo configure:6953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6942 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6943 if test -z "$ac_err"; then
6944   rm -rf conftest*
6945   eval "ac_cv_header_$ac_safe=yes"
6946 else
6947   echo "$ac_err" >&5
6948   echo "configure: failed program was:" >&5
6949   cat conftest.$ac_ext >&5
6950   rm -rf conftest*
6951   eval "ac_cv_header_$ac_safe=no"
6952 fi
6953 rm -f conftest*
6954 fi
6955 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6956   echo "$ac_t""yes" 1>&6
6957   have_motif=yes
6958                      cat >> confdefs.h <<\EOF
6959 #define HAVE_MOTIF 1
6960 EOF
6961
6962                      MOTIF_LIBS="$MOTIF_LIBS -lXm"
6963 else
6964   echo "$ac_t""no" 1>&6
6965 fi
6966
6967   CPPFLAGS="$ac_save_CPPFLAGS"
6968 fi
6969
6970
6971 if test "$have_motif" = yes; then
6972   
6973   ac_save_CPPFLAGS="$CPPFLAGS"
6974   if test \! -z "$includedir" ; then 
6975     CPPFLAGS="$CPPFLAGS -I$includedir"
6976   fi
6977   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6978   ac_safe=`echo "Xm/ComboBox.h" | sed 'y%./+-%__p_%'`
6979 echo $ac_n "checking for Xm/ComboBox.h""... $ac_c" 1>&6
6980 echo "configure:6992: checking for Xm/ComboBox.h" >&5
6981 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6982   echo $ac_n "(cached) $ac_c" 1>&6
6983 else
6984   cat > conftest.$ac_ext <<EOF
6985 #line 6997 "configure"
6986 #include "confdefs.h"
6987 #include <Xm/ComboBox.h>
6988 EOF
6989 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6990 { (eval echo configure:7002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6991 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6992 if test -z "$ac_err"; then
6993   rm -rf conftest*
6994   eval "ac_cv_header_$ac_safe=yes"
6995 else
6996   echo "$ac_err" >&5
6997   echo "configure: failed program was:" >&5
6998   cat conftest.$ac_ext >&5
6999   rm -rf conftest*
7000   eval "ac_cv_header_$ac_safe=no"
7001 fi
7002 rm -f conftest*
7003 fi
7004 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7005   echo "$ac_t""yes" 1>&6
7006   cat >> confdefs.h <<\EOF
7007 #define HAVE_XMCOMBOBOX 1
7008 EOF
7009
7010 else
7011   echo "$ac_t""no" 1>&6
7012 fi
7013
7014   CPPFLAGS="$ac_save_CPPFLAGS"
7015 fi
7016
7017
7018 ###############################################################################
7019 #
7020 #       Check for -lgtk (and Gnome stuff)
7021 #
7022 ###############################################################################
7023
7024 have_gtk=no
7025 with_gtk_req=unspecified
7026 # Check whether --with-gtk or --without-gtk was given.
7027 if test "${with_gtk+set}" = set; then
7028   withval="$with_gtk"
7029   with_gtk="$withval"; with_gtk_req="$withval"
7030 else
7031   with_gtk=yes
7032 fi
7033
7034
7035 # if --with-gtk=/directory/ was specified, remember that directory so that
7036 # we can also look for the `gtk-config' program in that directory.
7037 case "$with_gtk" in
7038   /*)
7039     gtk_dir="$with_gtk"
7040     ;;
7041   *)
7042     gtk_dir=""
7043     ;;
7044 esac
7045
7046
7047    case "$with_gtk" in
7048     yes) ;;
7049     no)  ;;
7050
7051     /*)
7052      echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
7053 echo "configure:7065: checking for Gtk headers" >&5
7054      d=$with_gtk/include
7055      if test -d $d; then
7056        X_CFLAGS="-I$d $X_CFLAGS"
7057        echo "$ac_t""$d" 1>&6
7058      else
7059        echo "$ac_t""not found ($d: no such directory)" 1>&6
7060      fi
7061
7062      echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
7063 echo "configure:7075: checking for Gtk libs" >&5
7064      d=$with_gtk/lib
7065      if test -d $d; then
7066        X_LIBS="-L$d $X_LIBS"
7067        echo "$ac_t""$d" 1>&6
7068      else
7069        echo "$ac_t""not found ($d: no such directory)" 1>&6
7070      fi
7071
7072      # replace the directory string with "yes".
7073      with_gtk_req="yes"
7074      with_gtk=$with_gtk_req
7075      ;;
7076
7077     *)
7078      echo ""
7079      echo "error: argument to --with-gtk must be \"yes\", \"no\", or a directory."
7080      echo "       If it is a directory, then \`DIR/include' will be added to"
7081      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7082      exit 1
7083      ;;
7084    esac
7085   
7086
7087 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
7088   echo "error: must be yes or no: --with-gtk=$with_gtk"
7089   exit 1
7090 fi
7091
7092 have_gnome=no
7093 with_gnome_req=unspecified
7094 # Check whether --with-gnome or --without-gnome was given.
7095 if test "${with_gnome+set}" = set; then
7096   withval="$with_gnome"
7097   with_gnome="$withval"; with_gnome_req="$withval"
7098 else
7099   with_gnome=yes
7100 fi
7101
7102
7103 # if --with-gnome=/directory/ was specified, remember that directory so that
7104 # we can also look for the `gnome-config' program in that directory.
7105 case "$with_gnome" in
7106   /*)
7107     gnome_dir="$with_gnome"
7108     ;;
7109   *)
7110     gnome_dir=""
7111     ;;
7112 esac
7113
7114
7115    case "$with_gnome" in
7116     yes) ;;
7117     no)  ;;
7118
7119     /*)
7120      echo $ac_n "checking for Gnome headers""... $ac_c" 1>&6
7121 echo "configure:7133: checking for Gnome headers" >&5
7122      d=$with_gnome/include
7123      if test -d $d; then
7124        X_CFLAGS="-I$d $X_CFLAGS"
7125        echo "$ac_t""$d" 1>&6
7126      else
7127        echo "$ac_t""not found ($d: no such directory)" 1>&6
7128      fi
7129
7130      echo $ac_n "checking for Gnome libs""... $ac_c" 1>&6
7131 echo "configure:7143: checking for Gnome libs" >&5
7132      d=$with_gnome/lib
7133      if test -d $d; then
7134        X_LIBS="-L$d $X_LIBS"
7135        echo "$ac_t""$d" 1>&6
7136      else
7137        echo "$ac_t""not found ($d: no such directory)" 1>&6
7138      fi
7139
7140      # replace the directory string with "yes".
7141      with_gnome_req="yes"
7142      with_gnome=$with_gnome_req
7143      ;;
7144
7145     *)
7146      echo ""
7147      echo "error: argument to --with-gnome must be \"yes\", \"no\", or a directory."
7148      echo "       If it is a directory, then \`DIR/include' will be added to"
7149      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7150      exit 1
7151      ;;
7152    esac
7153   
7154
7155 if test "$with_gnome" != yes -a "$with_gnome" != no ; then
7156   echo "error: must be yes or no: --with-gnome=$with_gnome"
7157   exit 1
7158 fi
7159
7160
7161 jurassic_gtk=no
7162 if test "$with_gtk" = yes; then
7163   have_gtk=no
7164   
7165   # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
7166   # look in /foo/bin/ for glib-config, gtk-config, and gnome-config.
7167   #
7168   gtk_path="$PATH"
7169
7170   if test ! -z "$gtk_dir"; then
7171     # canonicalize slashes.
7172     foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
7173     gtk_path="$foo:$gtk_path"
7174   fi
7175
7176   if test ! -z "$gnome_dir"; then
7177     # canonicalize slashes.
7178     foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
7179     gtk_path="$foo:$gtk_path"
7180   fi
7181
7182   for ac_prog in glib12-config glib-config
7183 do
7184 # Extract the first word of "$ac_prog", so it can be a program name with args.
7185 set dummy $ac_prog; ac_word=$2
7186 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7187 echo "configure:7199: checking for $ac_word" >&5
7188 if eval "test \"`echo '$''{'ac_cv_path_glib_config'+set}'`\" = set"; then
7189   echo $ac_n "(cached) $ac_c" 1>&6
7190 else
7191   case "$glib_config" in
7192   /*)
7193   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a path.
7194   ;;
7195   ?:/*)                  
7196   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a dos path.
7197   ;;
7198   *)
7199   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7200   ac_dummy="$gtk_path"
7201   for ac_dir in $ac_dummy; do 
7202     test -z "$ac_dir" && ac_dir=.
7203     if test -f $ac_dir/$ac_word; then
7204       ac_cv_path_glib_config="$ac_dir/$ac_word"
7205       break
7206     fi
7207   done
7208   IFS="$ac_save_ifs"
7209   ;;
7210 esac
7211 fi
7212 glib_config="$ac_cv_path_glib_config"
7213 if test -n "$glib_config"; then
7214   echo "$ac_t""$glib_config" 1>&6
7215 else
7216   echo "$ac_t""no" 1>&6
7217 fi
7218
7219 test -n "$glib_config" && break
7220 done
7221
7222   for ac_prog in gtk12-config  gtk-config
7223 do
7224 # Extract the first word of "$ac_prog", so it can be a program name with args.
7225 set dummy $ac_prog; ac_word=$2
7226 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7227 echo "configure:7239: checking for $ac_word" >&5
7228 if eval "test \"`echo '$''{'ac_cv_path_gtk_config'+set}'`\" = set"; then
7229   echo $ac_n "(cached) $ac_c" 1>&6
7230 else
7231   case "$gtk_config" in
7232   /*)
7233   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a path.
7234   ;;
7235   ?:/*)                  
7236   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a dos path.
7237   ;;
7238   *)
7239   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7240   ac_dummy="$gtk_path"
7241   for ac_dir in $ac_dummy; do 
7242     test -z "$ac_dir" && ac_dir=.
7243     if test -f $ac_dir/$ac_word; then
7244       ac_cv_path_gtk_config="$ac_dir/$ac_word"
7245       break
7246     fi
7247   done
7248   IFS="$ac_save_ifs"
7249   ;;
7250 esac
7251 fi
7252 gtk_config="$ac_cv_path_gtk_config"
7253 if test -n "$gtk_config"; then
7254   echo "$ac_t""$gtk_config" 1>&6
7255 else
7256   echo "$ac_t""no" 1>&6
7257 fi
7258
7259 test -n "$gtk_config" && break
7260 done
7261
7262
7263   if test "$with_gnome" = yes; then
7264     for ac_prog in gnome-config
7265 do
7266 # Extract the first word of "$ac_prog", so it can be a program name with args.
7267 set dummy $ac_prog; ac_word=$2
7268 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7269 echo "configure:7281: checking for $ac_word" >&5
7270 if eval "test \"`echo '$''{'ac_cv_path_gnome_config'+set}'`\" = set"; then
7271   echo $ac_n "(cached) $ac_c" 1>&6
7272 else
7273   case "$gnome_config" in
7274   /*)
7275   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a path.
7276   ;;
7277   ?:/*)                  
7278   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a dos path.
7279   ;;
7280   *)
7281   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7282   ac_dummy="$gtk_path"
7283   for ac_dir in $ac_dummy; do 
7284     test -z "$ac_dir" && ac_dir=.
7285     if test -f $ac_dir/$ac_word; then
7286       ac_cv_path_gnome_config="$ac_dir/$ac_word"
7287       break
7288     fi
7289   done
7290   IFS="$ac_save_ifs"
7291   ;;
7292 esac
7293 fi
7294 gnome_config="$ac_cv_path_gnome_config"
7295 if test -n "$gnome_config"; then
7296   echo "$ac_t""$gnome_config" 1>&6
7297 else
7298   echo "$ac_t""no" 1>&6
7299 fi
7300
7301 test -n "$gnome_config" && break
7302 done
7303
7304   fi
7305
7306   if test -n "$glib_config" -a  -n "$gtk_config" ; then
7307     have_gtk=yes
7308     if test "$with_gnome" = yes -a -n "$gnome_config" ; then
7309       have_gnome=yes
7310     fi
7311   fi
7312
7313   if test "$have_gtk" = yes; then
7314     echo $ac_n "checking Gtk version number""... $ac_c" 1>&6
7315 echo "configure:7327: checking Gtk version number" >&5
7316 if eval "test \"`echo '$''{'ac_cv_gtk_version_string'+set}'`\" = set"; then
7317   echo $ac_n "(cached) $ac_c" 1>&6
7318 else
7319   ac_cv_gtk_version_string=`$gtk_config --version`
7320 fi
7321
7322 echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
7323     ac_gtk_version_string=$ac_cv_gtk_version_string
7324     # M4 sucks!!
7325     
7326     maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
7327     min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
7328     
7329     ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
7330     if test -z "$ac_gtk_version"; then
7331       ac_gtk_version=unknown
7332       ac_gtk_version_string=unknown
7333     fi
7334     if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
7335     then
7336       have_gtk=no
7337       have_gnome=no
7338       jurassic_gtk=yes
7339     fi
7340   fi
7341
7342   if test "$have_gtk" = yes; then
7343     echo $ac_n "checking for Gtk includes""... $ac_c" 1>&6
7344 echo "configure:7356: checking for Gtk includes" >&5
7345 if eval "test \"`echo '$''{'ac_cv_gtk_config_cflags'+set}'`\" = set"; then
7346   echo $ac_n "(cached) $ac_c" 1>&6
7347 else
7348   ac_cv_gtk_config_cflags=`$gtk_config --cflags`
7349 fi
7350
7351 echo "$ac_t""$ac_cv_gtk_config_cflags" 1>&6
7352     echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
7353 echo "configure:7365: checking for Gtk libs" >&5
7354 if eval "test \"`echo '$''{'ac_cv_gtk_config_libs'+set}'`\" = set"; then
7355   echo $ac_n "(cached) $ac_c" 1>&6
7356 else
7357   ac_cv_gtk_config_libs=`$gtk_config --libs`
7358 fi
7359
7360 echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
7361   fi
7362   ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
7363   ac_gtk_config_libs=$ac_cv_gtk_config_libs
7364
7365   # Check for Gnome Capplet support.
7366   #
7367   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7368     gnome_config_libs="gtk capplet gnomeui gdk_pixbuf"
7369     echo $ac_n "checking for Gnome capplet includes""... $ac_c" 1>&6
7370 echo "configure:7382: checking for Gnome capplet includes" >&5
7371     if eval "test \"`echo '$''{'ac_cv_gnome_config_cflags'+set}'`\" = set"; then
7372   echo $ac_n "(cached) $ac_c" 1>&6
7373 else
7374   if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
7375             grep Unknown >/dev/null ) ; then
7376          ac_cv_gnome_config_cflags=''
7377        else
7378          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
7379        fi
7380 fi
7381
7382     ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
7383     if test "$ac_gnome_config_cflags" = "" ; then
7384       have_gnome=no
7385       echo "$ac_t""no" 1>&6
7386     else
7387       echo "$ac_t""$ac_gnome_config_cflags" 1>&6
7388     fi
7389   fi
7390
7391   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7392     echo $ac_n "checking for Gnome capplet libs""... $ac_c" 1>&6
7393 echo "configure:7405: checking for Gnome capplet libs" >&5
7394     if eval "test \"`echo '$''{'ac_cv_gnome_config_libs'+set}'`\" = set"; then
7395   echo $ac_n "(cached) $ac_c" 1>&6
7396 else
7397   if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
7398             grep Unknown >/dev/null ) ; then
7399          ac_cv_gnome_config_libs=''
7400        else
7401          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
7402        fi
7403 fi
7404
7405     ac_gnome_config_libs=$ac_cv_gnome_config_libs
7406     if test "$ac_gnome_config_libs" = "" ; then
7407       have_gnome=no
7408       echo "$ac_t""no" 1>&6
7409     else
7410       echo "$ac_t""$ac_gnome_config_libs" 1>&6
7411     fi
7412   fi
7413
7414   GNOME_DATADIR=""
7415   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7416     GNOME_DATADIR=`$gnome_config --datadir`
7417   fi
7418
7419
7420   # If we have Gnome, then override the gtk-config values with 
7421   # the gnome-config values.
7422   #
7423   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7424     ac_gtk_config_cflags=$ac_gnome_config_cflags
7425     ac_gtk_config_libs=$ac_gnome_config_libs
7426     cat >> confdefs.h <<\EOF
7427 #define HAVE_CRAPPLET 1
7428 EOF
7429
7430
7431     # check for this function that was not in libcapplet 1.2.
7432     
7433   ac_save_CPPFLAGS="$CPPFLAGS"
7434   ac_save_LDFLAGS="$LDFLAGS"
7435 #  ac_save_LIBS="$LIBS"
7436
7437   if test \! -z "$includedir" ; then 
7438     CPPFLAGS="$CPPFLAGS -I$includedir"
7439   fi
7440   # note: $X_CFLAGS includes $x_includes
7441   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7442
7443   if test \! -z "$libdir" ; then
7444     LDFLAGS="$LDFLAGS -L$libdir"
7445   fi
7446   # note: $X_LIBS includes $x_libraries
7447   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7448
7449   echo $ac_n "checking for capplet_widget_changes_are_immediate in -lcapplet""... $ac_c" 1>&6
7450 echo "configure:7462: checking for capplet_widget_changes_are_immediate in -lcapplet" >&5
7451 ac_lib_var=`echo capplet'_'capplet_widget_changes_are_immediate | sed 'y%./+-%__p_%'`
7452 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7453   echo $ac_n "(cached) $ac_c" 1>&6
7454 else
7455   ac_save_LIBS="$LIBS"
7456 LIBS="-lcapplet $ac_gnome_config_libs $LIBS"
7457 cat > conftest.$ac_ext <<EOF
7458 #line 7470 "configure"
7459 #include "confdefs.h"
7460 /* Override any gcc2 internal prototype to avoid an error.  */
7461 /* We use char because int might match the return type of a gcc2
7462     builtin and then its argument prototype would still apply.  */
7463 char capplet_widget_changes_are_immediate();
7464
7465 int main() {
7466 capplet_widget_changes_are_immediate()
7467 ; return 0; }
7468 EOF
7469 if { (eval echo configure:7481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7470   rm -rf conftest*
7471   eval "ac_cv_lib_$ac_lib_var=yes"
7472 else
7473   echo "configure: failed program was:" >&5
7474   cat conftest.$ac_ext >&5
7475   rm -rf conftest*
7476   eval "ac_cv_lib_$ac_lib_var=no"
7477 fi
7478 rm -f conftest*
7479 LIBS="$ac_save_LIBS"
7480
7481 fi
7482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7483   echo "$ac_t""yes" 1>&6
7484   cat >> confdefs.h <<\EOF
7485 #define HAVE_CRAPPLET_IMMEDIATE 1
7486 EOF
7487
7488 else
7489   echo "$ac_t""no" 1>&6
7490 true
7491 fi
7492
7493   CPPFLAGS="$ac_save_CPPFLAGS"
7494   LDFLAGS="$ac_save_LDFLAGS"
7495 #  LIBS="$ac_save_LIBS"
7496   
7497   fi
7498
7499
7500   if test "$have_gtk" = yes; then
7501     INCLUDES="$INCLUDES $ac_gtk_config_cflags"
7502     GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
7503     cat >> confdefs.h <<\EOF
7504 #define HAVE_GTK 1
7505 EOF
7506
7507   fi
7508
7509 fi
7510
7511
7512 # Check for the Gnome Help Browser.
7513 #
7514 if test "$have_gnome" = yes; then
7515   # Extract the first word of "gnome-help-browser", so it can be a program name with args.
7516 set dummy gnome-help-browser; ac_word=$2
7517 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7518 echo "configure:7530: checking for $ac_word" >&5
7519 if eval "test \"`echo '$''{'ac_cv_prog_have_gnome_help'+set}'`\" = set"; then
7520   echo $ac_n "(cached) $ac_c" 1>&6
7521 else
7522   if test -n "$have_gnome_help"; then
7523   ac_cv_prog_have_gnome_help="$have_gnome_help" # Let the user override the test.
7524 else
7525   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7526   ac_dummy="$PATH"
7527   for ac_dir in $ac_dummy; do
7528     test -z "$ac_dir" && ac_dir=.
7529     if test -f $ac_dir/$ac_word; then
7530       ac_cv_prog_have_gnome_help="yes"
7531       break
7532     fi
7533   done
7534   IFS="$ac_save_ifs"
7535   test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no"
7536 fi
7537 fi
7538 have_gnome_help="$ac_cv_prog_have_gnome_help"
7539 if test -n "$have_gnome_help"; then
7540   echo "$ac_t""$have_gnome_help" 1>&6
7541 else
7542   echo "$ac_t""no" 1>&6
7543 fi
7544
7545 else
7546   have_gnome_help=no
7547 fi
7548
7549
7550 ###############################################################################
7551 #
7552 #       Check for -lxml
7553 #
7554 ###############################################################################
7555
7556 have_xml=no
7557 with_xml_req=unspecified
7558 xml_halfassed=no
7559 # Check whether --with-xml or --without-xml was given.
7560 if test "${with_xml+set}" = set; then
7561   withval="$with_xml"
7562   with_xml="$withval"; with_xml_req="$withval"
7563 else
7564   with_xml=yes
7565 fi
7566
7567
7568 # if --with-xml=/directory/ was specified, remember that directory so that
7569 # we can also look for the `xml-config' program in that directory.
7570 case "$with_xml" in
7571   /*)
7572     xml_dir="$with_xml"
7573     ;;
7574   *)
7575     xml_dir=""
7576     ;;
7577 esac
7578
7579
7580    case "$with_xml" in
7581     yes) ;;
7582     no)  ;;
7583
7584     /*)
7585      echo $ac_n "checking for XML headers""... $ac_c" 1>&6
7586 echo "configure:7598: checking for XML headers" >&5
7587      d=$with_xml/include
7588      if test -d $d; then
7589        X_CFLAGS="-I$d $X_CFLAGS"
7590        echo "$ac_t""$d" 1>&6
7591      else
7592        echo "$ac_t""not found ($d: no such directory)" 1>&6
7593      fi
7594
7595      echo $ac_n "checking for XML libs""... $ac_c" 1>&6
7596 echo "configure:7608: checking for XML libs" >&5
7597      d=$with_xml/lib
7598      if test -d $d; then
7599        X_LIBS="-L$d $X_LIBS"
7600        echo "$ac_t""$d" 1>&6
7601      else
7602        echo "$ac_t""not found ($d: no such directory)" 1>&6
7603      fi
7604
7605      # replace the directory string with "yes".
7606      with_xml_req="yes"
7607      with_xml=$with_xml_req
7608      ;;
7609
7610     *)
7611      echo ""
7612      echo "error: argument to --with-xml must be \"yes\", \"no\", or a directory."
7613      echo "       If it is a directory, then \`DIR/include' will be added to"
7614      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7615      exit 1
7616      ;;
7617    esac
7618   
7619
7620 if test "$with_xml" != yes -a "$with_xml" != no ; then
7621   echo "error: must be yes or no: --with-xml=$with_xml"
7622   exit 1
7623 fi
7624
7625 if test "$with_xml" = yes; then
7626   have_xml=no
7627
7628   # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
7629   # look in /foo/bin/ for for xml-config.
7630   #
7631   xml_path="$PATH"
7632
7633   if test ! -z "$gtk_dir"; then
7634     # canonicalize slashes.
7635     foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
7636     xml_path="$foo:$xml_path"
7637   fi
7638
7639   if test ! -z "$gnome_dir"; then
7640     # canonicalize slashes.
7641     foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
7642     xml_path="$foo:$xml_path"
7643   fi
7644
7645   for ac_prog in xml2-config xml-config
7646 do
7647 # Extract the first word of "$ac_prog", so it can be a program name with args.
7648 set dummy $ac_prog; ac_word=$2
7649 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7650 echo "configure:7662: checking for $ac_word" >&5
7651 if eval "test \"`echo '$''{'ac_cv_path_xml_config'+set}'`\" = set"; then
7652   echo $ac_n "(cached) $ac_c" 1>&6
7653 else
7654   case "$xml_config" in
7655   /*)
7656   ac_cv_path_xml_config="$xml_config" # Let the user override the test with a path.
7657   ;;
7658   ?:/*)                  
7659   ac_cv_path_xml_config="$xml_config" # Let the user override the test with a dos path.
7660   ;;
7661   *)
7662   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7663   ac_dummy="$xml_path"
7664   for ac_dir in $ac_dummy; do 
7665     test -z "$ac_dir" && ac_dir=.
7666     if test -f $ac_dir/$ac_word; then
7667       ac_cv_path_xml_config="$ac_dir/$ac_word"
7668       break
7669     fi
7670   done
7671   IFS="$ac_save_ifs"
7672   ;;
7673 esac
7674 fi
7675 xml_config="$ac_cv_path_xml_config"
7676 if test -n "$xml_config"; then
7677   echo "$ac_t""$xml_config" 1>&6
7678 else
7679   echo "$ac_t""no" 1>&6
7680 fi
7681
7682 test -n "$xml_config" && break
7683 done
7684
7685
7686   # If we found the xml-config program, run it to get flags.
7687   #
7688   if test -n "$xml_config" ; then
7689     echo $ac_n "checking for XML includes""... $ac_c" 1>&6
7690 echo "configure:7702: checking for XML includes" >&5
7691 if eval "test \"`echo '$''{'ac_cv_xml_config_cflags'+set}'`\" = set"; then
7692   echo $ac_n "(cached) $ac_c" 1>&6
7693 else
7694   ac_cv_xml_config_cflags=`$xml_config --cflags`
7695 fi
7696
7697 echo "$ac_t""$ac_cv_xml_config_cflags" 1>&6
7698     echo $ac_n "checking for XML libs""... $ac_c" 1>&6
7699 echo "configure:7711: checking for XML libs" >&5
7700 if eval "test \"`echo '$''{'ac_cv_xml_config_libs'+set}'`\" = set"; then
7701   echo $ac_n "(cached) $ac_c" 1>&6
7702 else
7703   ac_cv_xml_config_libs=`$xml_config --libs`
7704 fi
7705
7706 echo "$ac_t""$ac_cv_xml_config_libs" 1>&6
7707     ac_xml_config_cflags=$ac_cv_xml_config_cflags
7708     ac_xml_config_libs=$ac_cv_xml_config_libs
7709   fi
7710
7711   ac_save_xml_CPPFLAGS="$CPPFLAGS"
7712   CPPFLAGS="$CPPFLAGS $ac_xml_config_cflags"
7713   
7714   ac_save_CPPFLAGS="$CPPFLAGS"
7715   if test \! -z "$includedir" ; then 
7716     CPPFLAGS="$CPPFLAGS -I$includedir"
7717   fi
7718   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7719   ac_safe=`echo "xmlIO.h" | sed 'y%./+-%__p_%'`
7720 echo $ac_n "checking for xmlIO.h""... $ac_c" 1>&6
7721 echo "configure:7733: checking for xmlIO.h" >&5
7722 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7723   echo $ac_n "(cached) $ac_c" 1>&6
7724 else
7725   cat > conftest.$ac_ext <<EOF
7726 #line 7738 "configure"
7727 #include "confdefs.h"
7728 #include <xmlIO.h>
7729 EOF
7730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7731 { (eval echo configure:7743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7733 if test -z "$ac_err"; then
7734   rm -rf conftest*
7735   eval "ac_cv_header_$ac_safe=yes"
7736 else
7737   echo "$ac_err" >&5
7738   echo "configure: failed program was:" >&5
7739   cat conftest.$ac_ext >&5
7740   rm -rf conftest*
7741   eval "ac_cv_header_$ac_safe=no"
7742 fi
7743 rm -f conftest*
7744 fi
7745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7746   echo "$ac_t""yes" 1>&6
7747   have_xml=yes
7748 else
7749   echo "$ac_t""no" 1>&6
7750 fi
7751
7752   CPPFLAGS="$ac_save_CPPFLAGS"
7753   CPPFLAGS="$ac_save_xml_CPPFLAGS"
7754
7755   if test "$have_xml" = yes; then
7756     # we have the header, now check for the library
7757     have_xml=no
7758     xml_halfassed=yes
7759     
7760   ac_save_CPPFLAGS="$CPPFLAGS"
7761   ac_save_LDFLAGS="$LDFLAGS"
7762 #  ac_save_LIBS="$LIBS"
7763
7764   if test \! -z "$includedir" ; then 
7765     CPPFLAGS="$CPPFLAGS -I$includedir"
7766   fi
7767   # note: $X_CFLAGS includes $x_includes
7768   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7769
7770   if test \! -z "$libdir" ; then
7771     LDFLAGS="$LDFLAGS -L$libdir"
7772   fi
7773   # note: $X_LIBS includes $x_libraries
7774   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7775
7776   echo $ac_n "checking for xmlParseChunk in -lxml""... $ac_c" 1>&6
7777 echo "configure:7789: checking for xmlParseChunk in -lxml" >&5
7778 ac_lib_var=`echo xml'_'xmlParseChunk | sed 'y%./+-%__p_%'`
7779 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7780   echo $ac_n "(cached) $ac_c" 1>&6
7781 else
7782   ac_save_LIBS="$LIBS"
7783 LIBS="-lxml $ac_xml_config_libs $LIBS"
7784 cat > conftest.$ac_ext <<EOF
7785 #line 7797 "configure"
7786 #include "confdefs.h"
7787 /* Override any gcc2 internal prototype to avoid an error.  */
7788 /* We use char because int might match the return type of a gcc2
7789     builtin and then its argument prototype would still apply.  */
7790 char xmlParseChunk();
7791
7792 int main() {
7793 xmlParseChunk()
7794 ; return 0; }
7795 EOF
7796 if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7797   rm -rf conftest*
7798   eval "ac_cv_lib_$ac_lib_var=yes"
7799 else
7800   echo "configure: failed program was:" >&5
7801   cat conftest.$ac_ext >&5
7802   rm -rf conftest*
7803   eval "ac_cv_lib_$ac_lib_var=no"
7804 fi
7805 rm -f conftest*
7806 LIBS="$ac_save_LIBS"
7807
7808 fi
7809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7810   echo "$ac_t""yes" 1>&6
7811   have_xml=yes
7812                     xml_halfassed=no
7813                     XML_LIBS="-lxml"
7814                     cat >> confdefs.h <<\EOF
7815 #define HAVE_XML 1
7816 EOF
7817
7818 else
7819   echo "$ac_t""no" 1>&6
7820 true
7821 fi
7822
7823   CPPFLAGS="$ac_save_CPPFLAGS"
7824   LDFLAGS="$ac_save_LDFLAGS"
7825 #  LIBS="$ac_save_LIBS"
7826   
7827   fi
7828
7829   if test "$have_xml" = yes; then
7830     INCLUDES="$INCLUDES $ac_xml_config_cflags"
7831     GTK_LIBS="$GTK_LIBS $ac_xml_config_libs"
7832     cat >> confdefs.h <<\EOF
7833 #define HAVE_XML 1
7834 EOF
7835
7836   fi
7837
7838 fi
7839
7840
7841 ###############################################################################
7842 #
7843 #       Checking whether Motif is really Lesstif.
7844 #
7845 ###############################################################################
7846
7847 have_lesstif=no
7848 if test "$have_motif" = yes ; then
7849   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
7850 echo "configure:7862: checking whether Motif is really LessTif" >&5
7851 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
7852   echo $ac_n "(cached) $ac_c" 1>&6
7853 else
7854   
7855   ac_save_CPPFLAGS="$CPPFLAGS"
7856   if test \! -z "$includedir" ; then 
7857     CPPFLAGS="$CPPFLAGS -I$includedir"
7858   fi
7859   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7860   cat > conftest.$ac_ext <<EOF
7861 #line 7873 "configure"
7862 #include "confdefs.h"
7863 #include <Xm/Xm.h>
7864 int main() {
7865 long vers = LesstifVersion;
7866 ; return 0; }
7867 EOF
7868 if { (eval echo configure:7880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7869   rm -rf conftest*
7870   ac_cv_have_lesstif=yes
7871 else
7872   echo "configure: failed program was:" >&5
7873   cat conftest.$ac_ext >&5
7874   rm -rf conftest*
7875   ac_cv_have_lesstif=no
7876 fi
7877 rm -f conftest*
7878   CPPFLAGS="$ac_save_CPPFLAGS"
7879 fi
7880
7881 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
7882   have_lesstif=$ac_cv_have_lesstif
7883 fi
7884
7885
7886 lesstif_version=unknown
7887 lesstif_version_string=unknown
7888
7889 if test "$have_lesstif" = yes ; then
7890   ltv=unknown
7891   echo unknown > conftest-lt
7892   echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
7893 echo "configure:7905: checking LessTif version number" >&5
7894 if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
7895   echo $ac_n "(cached) $ac_c" 1>&6
7896 else
7897   
7898   ac_save_CPPFLAGS="$CPPFLAGS"
7899   if test \! -z "$includedir" ; then 
7900     CPPFLAGS="$CPPFLAGS -I$includedir"
7901   fi
7902   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7903   if test "$cross_compiling" = yes; then
7904   ac_cv_lesstif_version=unknown
7905                      ac_cv_lesstif_version_string=unknown
7906 else
7907   cat > conftest.$ac_ext <<EOF
7908 #line 7920 "configure"
7909 #include "confdefs.h"
7910 #include <stdio.h>
7911                      #include <Xm/Xm.h>
7912                      int main() {
7913                        FILE *f = fopen("conftest-lt", "w");
7914                        if (!f) exit(1);
7915                        fprintf(f, "%d %d.%d\n", LesstifVersion,
7916                           LESSTIF_VERSION, LESSTIF_REVISION);
7917                        fclose(f);
7918                        exit(0);
7919                      }
7920 EOF
7921 if { (eval echo configure:7933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7922 then
7923   ltv=`cat conftest-lt`
7924                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
7925                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
7926 else
7927   echo "configure: failed program was:" >&5
7928   cat conftest.$ac_ext >&5
7929   rm -fr conftest*
7930   ac_cv_lesstif_version=unknown
7931                      ac_cv_lesstif_version_string=unknown
7932 fi
7933 rm -fr conftest*
7934 fi
7935
7936   CPPFLAGS="$ac_save_CPPFLAGS"
7937 fi
7938
7939 echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
7940   rm -f conftest-lt
7941   lesstif_version=$ac_cv_lesstif_version
7942   lesstif_version_string=$ac_cv_lesstif_version_string
7943
7944 fi
7945
7946
7947 if test "$have_motif" = yes ; then
7948   mtv=unknown
7949   echo unknown > conftest-mt
7950   echo $ac_n "checking Motif version number""... $ac_c" 1>&6
7951 echo "configure:7963: checking Motif version number" >&5
7952 if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
7953   echo $ac_n "(cached) $ac_c" 1>&6
7954 else
7955   
7956   ac_save_CPPFLAGS="$CPPFLAGS"
7957   if test \! -z "$includedir" ; then 
7958     CPPFLAGS="$CPPFLAGS -I$includedir"
7959   fi
7960   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7961   if test "$cross_compiling" = yes; then
7962   ac_cv_motif_version=unknown
7963                      ac_cv_motif_version_string=unknown
7964 else
7965   cat > conftest.$ac_ext <<EOF
7966 #line 7978 "configure"
7967 #include "confdefs.h"
7968 #include <stdio.h>
7969                      #include <Xm/Xm.h>
7970                      int main() {
7971                        FILE *f = fopen("conftest-mt", "w");
7972                        if (!f) exit(1);
7973                        fprintf(f, "%d %d.%d\n", XmVersion,
7974                           XmVERSION, XmREVISION);
7975                        fclose(f);
7976                        exit(0);
7977                      }
7978 EOF
7979 if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7980 then
7981   mtv=`cat conftest-mt`
7982                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
7983                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
7984 else
7985   echo "configure: failed program was:" >&5
7986   cat conftest.$ac_ext >&5
7987   rm -fr conftest*
7988   ac_cv_motif_version=unknown
7989                      ac_cv_motif_version_string=unknown
7990 fi
7991 rm -fr conftest*
7992 fi
7993
7994   CPPFLAGS="$ac_save_CPPFLAGS"
7995 fi
7996
7997 echo "$ac_t""$ac_cv_motif_version_string" 1>&6
7998   rm -f conftest-mt
7999   motif_version=$ac_cv_motif_version
8000   motif_version_string=$ac_cv_motif_version_string
8001
8002 fi
8003
8004
8005 ###############################################################################
8006 #
8007 #       Checking whether Motif requires -lXpm.
8008 #
8009 #       If this is Motif 2.x, and we have XPM, then link against XPM as well.
8010 #       The deal is, Motif 2.x requires XPM -- but it's a compilation option
8011 #       of the library whether to build the XPM code into libXm, or whether
8012 #       to rely on an external libXm.  So the only way to tell whether XPM is
8013 #       a link-time requirement is to examine libXm.a, which is very
8014 #       difficult to do in an autoconf script.  So... if it's Motif 2.x, we
8015 #       always link against XPM if the XPM lib exists (and this will be a
8016 #       no-op if libXm happens to already have the XPM code in it.)
8017 #
8018 ###############################################################################
8019
8020 motif_requires_xpm=no
8021 if test "$have_motif" = yes ; then
8022    echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
8023 echo "configure:8035: checking whether Motif requires XPM" >&5
8024    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
8025    then
8026      motif_requires_xpm=yes
8027      echo "$ac_t""maybe" 1>&6
8028    else
8029      echo "$ac_t""no" 1>&6
8030    fi
8031 fi
8032
8033
8034 ###############################################################################
8035 #
8036 #       Checking whether Motif requires -lXp.
8037 #
8038 #       Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
8039 #       Extension".   Why this extension isn't in -lXext with all the others,
8040 #       I have no idea.
8041 #
8042 ###############################################################################
8043
8044 have_xp_ext=no
8045 if test "$have_motif" = yes ; then
8046    have_xp_ext=no
8047    
8048   ac_save_CPPFLAGS="$CPPFLAGS"
8049   ac_save_LDFLAGS="$LDFLAGS"
8050 #  ac_save_LIBS="$LIBS"
8051
8052   if test \! -z "$includedir" ; then 
8053     CPPFLAGS="$CPPFLAGS -I$includedir"
8054   fi
8055   # note: $X_CFLAGS includes $x_includes
8056   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8057
8058   if test \! -z "$libdir" ; then
8059     LDFLAGS="$LDFLAGS -L$libdir"
8060   fi
8061   # note: $X_LIBS includes $x_libraries
8062   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8063
8064   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
8065 echo "configure:8077: checking for XpQueryExtension in -lXp" >&5
8066 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
8067 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8068   echo $ac_n "(cached) $ac_c" 1>&6
8069 else
8070   ac_save_LIBS="$LIBS"
8071 LIBS="-lXp -lX11 -lXext -lm $LIBS"
8072 cat > conftest.$ac_ext <<EOF
8073 #line 8085 "configure"
8074 #include "confdefs.h"
8075 /* Override any gcc2 internal prototype to avoid an error.  */
8076 /* We use char because int might match the return type of a gcc2
8077     builtin and then its argument prototype would still apply.  */
8078 char XpQueryExtension();
8079
8080 int main() {
8081 XpQueryExtension()
8082 ; return 0; }
8083 EOF
8084 if { (eval echo configure:8096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8085   rm -rf conftest*
8086   eval "ac_cv_lib_$ac_lib_var=yes"
8087 else
8088   echo "configure: failed program was:" >&5
8089   cat conftest.$ac_ext >&5
8090   rm -rf conftest*
8091   eval "ac_cv_lib_$ac_lib_var=no"
8092 fi
8093 rm -f conftest*
8094 LIBS="$ac_save_LIBS"
8095
8096 fi
8097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8098   echo "$ac_t""yes" 1>&6
8099   have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
8100 else
8101   echo "$ac_t""no" 1>&6
8102 true
8103 fi
8104
8105   CPPFLAGS="$ac_save_CPPFLAGS"
8106   LDFLAGS="$ac_save_LDFLAGS"
8107 #  LIBS="$ac_save_LIBS"
8108   
8109 fi
8110
8111
8112 ###############################################################################
8113 #
8114 #       Checking whether Motif requires -lXintl (for _Xsetlocale.)
8115 #
8116 ###############################################################################
8117
8118 have_xintl=no
8119 if test "$have_motif" = yes ; then
8120   
8121   ac_save_CPPFLAGS="$CPPFLAGS"
8122   ac_save_LDFLAGS="$LDFLAGS"
8123 #  ac_save_LIBS="$LIBS"
8124
8125   if test \! -z "$includedir" ; then 
8126     CPPFLAGS="$CPPFLAGS -I$includedir"
8127   fi
8128   # note: $X_CFLAGS includes $x_includes
8129   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8130
8131   if test \! -z "$libdir" ; then
8132     LDFLAGS="$LDFLAGS -L$libdir"
8133   fi
8134   # note: $X_LIBS includes $x_libraries
8135   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8136
8137   echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
8138 echo "configure:8150: checking for _Xsetlocale in -lXintl" >&5
8139 ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
8140 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8141   echo $ac_n "(cached) $ac_c" 1>&6
8142 else
8143   ac_save_LIBS="$LIBS"
8144 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
8145 cat > conftest.$ac_ext <<EOF
8146 #line 8158 "configure"
8147 #include "confdefs.h"
8148 /* Override any gcc2 internal prototype to avoid an error.  */
8149 /* We use char because int might match the return type of a gcc2
8150     builtin and then its argument prototype would still apply.  */
8151 char _Xsetlocale();
8152
8153 int main() {
8154 _Xsetlocale()
8155 ; return 0; }
8156 EOF
8157 if { (eval echo configure:8169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8158   rm -rf conftest*
8159   eval "ac_cv_lib_$ac_lib_var=yes"
8160 else
8161   echo "configure: failed program was:" >&5
8162   cat conftest.$ac_ext >&5
8163   rm -rf conftest*
8164   eval "ac_cv_lib_$ac_lib_var=no"
8165 fi
8166 rm -f conftest*
8167 LIBS="$ac_save_LIBS"
8168
8169 fi
8170 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8171   echo "$ac_t""yes" 1>&6
8172   have_xintl=yes
8173 else
8174   echo "$ac_t""no" 1>&6
8175 have_xintl=no
8176 fi
8177
8178   CPPFLAGS="$ac_save_CPPFLAGS"
8179   LDFLAGS="$ac_save_LDFLAGS"
8180 #  LIBS="$ac_save_LIBS"
8181   
8182   if test "$have_xintl" = yes; then
8183     MOTIF_LIBS="$MOTIF_LIBS -lXintl"
8184   fi
8185 fi
8186
8187
8188 ###############################################################################
8189 #
8190 #       Check for -lGL or -lMesaGL.
8191 #
8192 ###############################################################################
8193
8194 have_gl=no
8195 ac_have_mesa_gl=no
8196 with_gl_req=unspecified
8197 gl_halfassed=no
8198 # Check whether --with-gl or --without-gl was given.
8199 if test "${with_gl+set}" = set; then
8200   withval="$with_gl"
8201   with_gl="$withval"; with_gl_req="$withval"
8202 else
8203   with_gl=yes
8204 fi
8205
8206
8207
8208    case "$with_gl" in
8209     yes) ;;
8210     no)  ;;
8211
8212     /*)
8213      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
8214 echo "configure:8226: checking for GL headers" >&5
8215      d=$with_gl/include
8216      if test -d $d; then
8217        X_CFLAGS="-I$d $X_CFLAGS"
8218        echo "$ac_t""$d" 1>&6
8219      else
8220        echo "$ac_t""not found ($d: no such directory)" 1>&6
8221      fi
8222
8223      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
8224 echo "configure:8236: checking for GL libs" >&5
8225      d=$with_gl/lib
8226      if test -d $d; then
8227        X_LIBS="-L$d $X_LIBS"
8228        echo "$ac_t""$d" 1>&6
8229      else
8230        echo "$ac_t""not found ($d: no such directory)" 1>&6
8231      fi
8232
8233      # replace the directory string with "yes".
8234      with_gl_req="yes"
8235      with_gl=$with_gl_req
8236      ;;
8237
8238     *)
8239      echo ""
8240      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
8241      echo "       If it is a directory, then \`DIR/include' will be added to"
8242      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8243      exit 1
8244      ;;
8245    esac
8246   
8247
8248 ac_mesagl_version=unknown
8249 ac_mesagl_version_string=unknown
8250
8251 if test "$with_gl" = yes; then
8252   
8253   ac_save_CPPFLAGS="$CPPFLAGS"
8254   if test \! -z "$includedir" ; then 
8255     CPPFLAGS="$CPPFLAGS -I$includedir"
8256   fi
8257   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8258   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
8259 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
8260 echo "configure:8272: checking for GL/gl.h" >&5
8261 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8262   echo $ac_n "(cached) $ac_c" 1>&6
8263 else
8264   cat > conftest.$ac_ext <<EOF
8265 #line 8277 "configure"
8266 #include "confdefs.h"
8267 #include <GL/gl.h>
8268 EOF
8269 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8270 { (eval echo configure:8282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8271 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8272 if test -z "$ac_err"; then
8273   rm -rf conftest*
8274   eval "ac_cv_header_$ac_safe=yes"
8275 else
8276   echo "$ac_err" >&5
8277   echo "configure: failed program was:" >&5
8278   cat conftest.$ac_ext >&5
8279   rm -rf conftest*
8280   eval "ac_cv_header_$ac_safe=no"
8281 fi
8282 rm -f conftest*
8283 fi
8284 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8285   echo "$ac_t""yes" 1>&6
8286   have_gl=yes
8287 else
8288   echo "$ac_t""no" 1>&6
8289 fi
8290
8291   CPPFLAGS="$ac_save_CPPFLAGS"
8292   if test "$have_gl" = yes ; then
8293     
8294   ac_save_CPPFLAGS="$CPPFLAGS"
8295   if test \! -z "$includedir" ; then 
8296     CPPFLAGS="$CPPFLAGS -I$includedir"
8297   fi
8298   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8299   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
8300 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
8301 echo "configure:8313: checking for GL/glx.h" >&5
8302 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8303   echo $ac_n "(cached) $ac_c" 1>&6
8304 else
8305   cat > conftest.$ac_ext <<EOF
8306 #line 8318 "configure"
8307 #include "confdefs.h"
8308 #include <GL/glx.h>
8309 EOF
8310 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8311 { (eval echo configure:8323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8312 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8313 if test -z "$ac_err"; then
8314   rm -rf conftest*
8315   eval "ac_cv_header_$ac_safe=yes"
8316 else
8317   echo "$ac_err" >&5
8318   echo "configure: failed program was:" >&5
8319   cat conftest.$ac_ext >&5
8320   rm -rf conftest*
8321   eval "ac_cv_header_$ac_safe=no"
8322 fi
8323 rm -f conftest*
8324 fi
8325 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8326   echo "$ac_t""yes" 1>&6
8327   have_gl=yes
8328 else
8329   echo "$ac_t""no" 1>&6
8330 fi
8331
8332   CPPFLAGS="$ac_save_CPPFLAGS"
8333   fi
8334
8335   # If we have the headers, try and figure out which vendor it's from.
8336   #
8337   if test "$have_gl" = yes ; then
8338
8339     # We need to know whether it's MesaGL so that we know which libraries
8340     # to link against.
8341     #
8342     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
8343 echo "configure:8355: checking whether GL is really MesaGL" >&5
8344 if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
8345   echo $ac_n "(cached) $ac_c" 1>&6
8346 else
8347   ac_cv_have_mesa_gl=no
8348        
8349   ac_save_CPPFLAGS="$CPPFLAGS"
8350   if test \! -z "$includedir" ; then 
8351     CPPFLAGS="$CPPFLAGS -I$includedir"
8352   fi
8353   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8354   cat > conftest.$ac_ext <<EOF
8355 #line 8367 "configure"
8356 #include "confdefs.h"
8357 #include <GL/glx.h>
8358 EOF
8359 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8360   egrep "Mesa|MESA" >/dev/null 2>&1; then
8361   rm -rf conftest*
8362   ac_cv_have_mesa_gl=yes
8363 fi
8364 rm -f conftest*
8365
8366   CPPFLAGS="$ac_save_CPPFLAGS"
8367       
8368 fi
8369
8370 echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
8371     ac_have_mesa_gl=$ac_cv_have_mesa_gl
8372  
8373
8374     gl_lib_1=""
8375     GL_LIBS=""
8376
8377
8378     # Some versions of MesaGL are compiled to require -lpthread.
8379     # So if the Mesa headers exist, and -lpthread exists, then always
8380     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
8381     #
8382     if test "$ac_have_mesa_gl" = yes; then
8383       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
8384 echo "configure:8396: checking for pthread_create in -lpthread" >&5
8385 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
8386 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8387   echo $ac_n "(cached) $ac_c" 1>&6
8388 else
8389   ac_save_LIBS="$LIBS"
8390 LIBS="-lpthread  $LIBS"
8391 cat > conftest.$ac_ext <<EOF
8392 #line 8404 "configure"
8393 #include "confdefs.h"
8394 /* Override any gcc2 internal prototype to avoid an error.  */
8395 /* We use char because int might match the return type of a gcc2
8396     builtin and then its argument prototype would still apply.  */
8397 char pthread_create();
8398
8399 int main() {
8400 pthread_create()
8401 ; return 0; }
8402 EOF
8403 if { (eval echo configure:8415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8404   rm -rf conftest*
8405   eval "ac_cv_lib_$ac_lib_var=yes"
8406 else
8407   echo "configure: failed program was:" >&5
8408   cat conftest.$ac_ext >&5
8409   rm -rf conftest*
8410   eval "ac_cv_lib_$ac_lib_var=no"
8411 fi
8412 rm -f conftest*
8413 LIBS="$ac_save_LIBS"
8414
8415 fi
8416 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8417   echo "$ac_t""yes" 1>&6
8418   GL_LIBS="-lpthread"
8419 else
8420   echo "$ac_t""no" 1>&6
8421 fi
8422
8423     fi
8424
8425
8426     # If we have Mesa headers, check to see if we can link against -lMesaGL.
8427     # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
8428     # Else, warn that GL is busted.  (We have the headers, but no libs.)
8429     #
8430
8431     if test "$ac_have_mesa_gl" = yes ; then
8432       
8433   ac_save_CPPFLAGS="$CPPFLAGS"
8434   ac_save_LDFLAGS="$LDFLAGS"
8435 #  ac_save_LIBS="$LIBS"
8436
8437   if test \! -z "$includedir" ; then 
8438     CPPFLAGS="$CPPFLAGS -I$includedir"
8439   fi
8440   # note: $X_CFLAGS includes $x_includes
8441   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8442
8443   if test \! -z "$libdir" ; then
8444     LDFLAGS="$LDFLAGS -L$libdir"
8445   fi
8446   # note: $X_LIBS includes $x_libraries
8447   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8448
8449   echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
8450 echo "configure:8462: checking for glXCreateContext in -lMesaGL" >&5
8451 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8452 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8453   echo $ac_n "(cached) $ac_c" 1>&6
8454 else
8455   ac_save_LIBS="$LIBS"
8456 LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8457 cat > conftest.$ac_ext <<EOF
8458 #line 8470 "configure"
8459 #include "confdefs.h"
8460 /* Override any gcc2 internal prototype to avoid an error.  */
8461 /* We use char because int might match the return type of a gcc2
8462     builtin and then its argument prototype would still apply.  */
8463 char glXCreateContext();
8464
8465 int main() {
8466 glXCreateContext()
8467 ; return 0; }
8468 EOF
8469 if { (eval echo configure:8481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8470   rm -rf conftest*
8471   eval "ac_cv_lib_$ac_lib_var=yes"
8472 else
8473   echo "configure: failed program was:" >&5
8474   cat conftest.$ac_ext >&5
8475   rm -rf conftest*
8476   eval "ac_cv_lib_$ac_lib_var=no"
8477 fi
8478 rm -f conftest*
8479 LIBS="$ac_save_LIBS"
8480
8481 fi
8482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8483   echo "$ac_t""yes" 1>&6
8484   gl_lib_1="MesaGL"
8485                       GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
8486 else
8487   echo "$ac_t""no" 1>&6
8488 fi
8489
8490   CPPFLAGS="$ac_save_CPPFLAGS"
8491   LDFLAGS="$ac_save_LDFLAGS"
8492 #  LIBS="$ac_save_LIBS"
8493   
8494     fi
8495
8496     if test "$gl_lib_1" = "" ; then
8497       
8498   ac_save_CPPFLAGS="$CPPFLAGS"
8499   ac_save_LDFLAGS="$LDFLAGS"
8500 #  ac_save_LIBS="$LIBS"
8501
8502   if test \! -z "$includedir" ; then 
8503     CPPFLAGS="$CPPFLAGS -I$includedir"
8504   fi
8505   # note: $X_CFLAGS includes $x_includes
8506   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8507
8508   if test \! -z "$libdir" ; then
8509     LDFLAGS="$LDFLAGS -L$libdir"
8510   fi
8511   # note: $X_LIBS includes $x_libraries
8512   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8513
8514   echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
8515 echo "configure:8527: checking for glXCreateContext in -lGL" >&5
8516 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8517 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8518   echo $ac_n "(cached) $ac_c" 1>&6
8519 else
8520   ac_save_LIBS="$LIBS"
8521 LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8522 cat > conftest.$ac_ext <<EOF
8523 #line 8535 "configure"
8524 #include "confdefs.h"
8525 /* Override any gcc2 internal prototype to avoid an error.  */
8526 /* We use char because int might match the return type of a gcc2
8527     builtin and then its argument prototype would still apply.  */
8528 char glXCreateContext();
8529
8530 int main() {
8531 glXCreateContext()
8532 ; return 0; }
8533 EOF
8534 if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8535   rm -rf conftest*
8536   eval "ac_cv_lib_$ac_lib_var=yes"
8537 else
8538   echo "configure: failed program was:" >&5
8539   cat conftest.$ac_ext >&5
8540   rm -rf conftest*
8541   eval "ac_cv_lib_$ac_lib_var=no"
8542 fi
8543 rm -f conftest*
8544 LIBS="$ac_save_LIBS"
8545
8546 fi
8547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8548   echo "$ac_t""yes" 1>&6
8549   gl_lib_1="GL"
8550                       GL_LIBS="-lGL -lGLU $GL_LIBS"
8551 else
8552   echo "$ac_t""no" 1>&6
8553 fi
8554
8555   CPPFLAGS="$ac_save_CPPFLAGS"
8556   LDFLAGS="$ac_save_LDFLAGS"
8557 #  LIBS="$ac_save_LIBS"
8558   
8559     fi
8560
8561     if test "$gl_lib_1" = "" ; then
8562       # we have headers, but no libs -- bail.
8563       have_gl=no
8564       ac_have_mesa_gl=no
8565       gl_halfassed=yes
8566     else
8567       # linking works -- we can build the GL hacks.
8568       cat >> confdefs.h <<\EOF
8569 #define HAVE_GL 1
8570 EOF
8571
8572       if test "$ac_have_mesa_gl" = yes ; then
8573         cat >> confdefs.h <<\EOF
8574 #define HAVE_MESA_GL 1
8575 EOF
8576
8577       fi
8578     fi
8579   fi
8580
8581
8582   # Now that we know we have GL headers and libs, do some more GL testing.
8583   #
8584
8585   if test "$have_gl" = yes ; then
8586     # If it's MesaGL, we'd like to issue a warning if the version number
8587     # is less than or equal to 2.6, because that version had a security bug.
8588     #
8589     if test "$ac_have_mesa_gl" = yes; then
8590
8591       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
8592 echo "configure:8604: checking MesaGL version number" >&5
8593 if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
8594   echo $ac_n "(cached) $ac_c" 1>&6
8595 else
8596   cat > conftest.$ac_ext <<EOF
8597 #line 8609 "configure"
8598 #include "confdefs.h"
8599 #include <GL/gl.h>
8600 #ifndef MESA_MAJOR_VERSION
8601 # include <GL/xmesa.h>
8602 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
8603 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
8604 #endif
8605 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
8606 EOF
8607
8608          ac_save_CPPFLAGS="$CPPFLAGS"
8609          if test \! -z "$includedir" ; then 
8610            CPPFLAGS="$CPPFLAGS -I$includedir"
8611          fi
8612          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8613
8614           # M4 sucks!!
8615          
8616          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
8617               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
8618          
8619
8620          rm -f conftest.$ac_ext
8621
8622          CPPFLAGS="$ac_save_CPPFLAGS"
8623
8624          if test "$mglv" = ""; then
8625            ac_mesagl_version=unknown
8626            ac_mesagl_version_string=unknown
8627          else
8628            ac_mesagl_version_string=$mglv
8629            maj=`echo $mglv | sed -n 's/\..*//p'`
8630            min=`echo $mglv | sed -n 's/.*\.//p'`
8631            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
8632            if test -z "$ac_mesagl_version"; then
8633              ac_mesagl_version=unknown
8634              ac_mesagl_version_string=unknown
8635            fi
8636          fi
8637          ac_cv_mesagl_version=$ac_mesagl_version
8638          ac_cv_mesagl_version_string=$ac_mesagl_version_string
8639       
8640 fi
8641
8642 echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
8643       ac_mesagl_version=$ac_cv_mesagl_version
8644       ac_mesagl_version_string=$ac_cv_mesagl_version_string
8645     fi
8646
8647
8648     # Check for OpenGL 1.1 features.
8649     #
8650     
8651   ac_save_CPPFLAGS="$CPPFLAGS"
8652   ac_save_LDFLAGS="$LDFLAGS"
8653 #  ac_save_LIBS="$LIBS"
8654
8655   if test \! -z "$includedir" ; then 
8656     CPPFLAGS="$CPPFLAGS -I$includedir"
8657   fi
8658   # note: $X_CFLAGS includes $x_includes
8659   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8660
8661   if test \! -z "$libdir" ; then
8662     LDFLAGS="$LDFLAGS -L$libdir"
8663   fi
8664   # note: $X_LIBS includes $x_libraries
8665   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8666
8667   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
8668 echo "configure:8680: checking for glBindTexture in -l$gl_lib_1" >&5
8669 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
8670 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8671   echo $ac_n "(cached) $ac_c" 1>&6
8672 else
8673   ac_save_LIBS="$LIBS"
8674 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
8675 cat > conftest.$ac_ext <<EOF
8676 #line 8688 "configure"
8677 #include "confdefs.h"
8678 /* Override any gcc2 internal prototype to avoid an error.  */
8679 /* We use char because int might match the return type of a gcc2
8680     builtin and then its argument prototype would still apply.  */
8681 char glBindTexture();
8682
8683 int main() {
8684 glBindTexture()
8685 ; return 0; }
8686 EOF
8687 if { (eval echo configure:8699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8688   rm -rf conftest*
8689   eval "ac_cv_lib_$ac_lib_var=yes"
8690 else
8691   echo "configure: failed program was:" >&5
8692   cat conftest.$ac_ext >&5
8693   rm -rf conftest*
8694   eval "ac_cv_lib_$ac_lib_var=no"
8695 fi
8696 rm -f conftest*
8697 LIBS="$ac_save_LIBS"
8698
8699 fi
8700 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8701   echo "$ac_t""yes" 1>&6
8702   cat >> confdefs.h <<\EOF
8703 #define HAVE_GLBINDTEXTURE 1
8704 EOF
8705
8706 else
8707   echo "$ac_t""no" 1>&6
8708 true
8709 fi
8710
8711   CPPFLAGS="$ac_save_CPPFLAGS"
8712   LDFLAGS="$ac_save_LDFLAGS"
8713 #  LIBS="$ac_save_LIBS"
8714   
8715   fi
8716
8717 elif test "$with_gl" != no; then
8718   echo "error: must be yes or no: --with-gl=$with_gl"
8719   exit 1
8720 fi
8721
8722
8723 ###############################################################################
8724 #
8725 #       Check for -lgle.
8726 #
8727 ###############################################################################
8728
8729 have_gle=no
8730 with_gle_req=unspecified
8731 gle_halfassed=no
8732 # Check whether --with-gle or --without-gle was given.
8733 if test "${with_gle+set}" = set; then
8734   withval="$with_gle"
8735   with_gle="$withval"; with_gle_req="$withval"
8736 else
8737   with_gle=yes
8738 fi
8739
8740
8741
8742    case "$with_gle" in
8743     yes) ;;
8744     no)  ;;
8745
8746     /*)
8747      echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
8748 echo "configure:8760: checking for GLE headers" >&5
8749      d=$with_gle/include
8750      if test -d $d; then
8751        X_CFLAGS="-I$d $X_CFLAGS"
8752        echo "$ac_t""$d" 1>&6
8753      else
8754        echo "$ac_t""not found ($d: no such directory)" 1>&6
8755      fi
8756
8757      echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
8758 echo "configure:8770: checking for GLE libs" >&5
8759      d=$with_gle/lib
8760      if test -d $d; then
8761        X_LIBS="-L$d $X_LIBS"
8762        echo "$ac_t""$d" 1>&6
8763      else
8764        echo "$ac_t""not found ($d: no such directory)" 1>&6
8765      fi
8766
8767      # replace the directory string with "yes".
8768      with_gle_req="yes"
8769      with_gle=$with_gle_req
8770      ;;
8771
8772     *)
8773      echo ""
8774      echo "error: argument to --with-gle must be \"yes\", \"no\", or a directory."
8775      echo "       If it is a directory, then \`DIR/include' will be added to"
8776      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8777      exit 1
8778      ;;
8779    esac
8780   
8781
8782 GLE_LIBS=""
8783
8784 if test "$with_gle" = yes; then
8785
8786   
8787   ac_save_CPPFLAGS="$CPPFLAGS"
8788   if test \! -z "$includedir" ; then 
8789     CPPFLAGS="$CPPFLAGS -I$includedir"
8790   fi
8791   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8792   ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
8793 echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
8794 echo "configure:8806: checking for GL/gle.h" >&5
8795 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8796   echo $ac_n "(cached) $ac_c" 1>&6
8797 else
8798   cat > conftest.$ac_ext <<EOF
8799 #line 8811 "configure"
8800 #include "confdefs.h"
8801 #include <GL/gle.h>
8802 EOF
8803 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8804 { (eval echo configure:8816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8805 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8806 if test -z "$ac_err"; then
8807   rm -rf conftest*
8808   eval "ac_cv_header_$ac_safe=yes"
8809 else
8810   echo "$ac_err" >&5
8811   echo "configure: failed program was:" >&5
8812   cat conftest.$ac_ext >&5
8813   rm -rf conftest*
8814   eval "ac_cv_header_$ac_safe=no"
8815 fi
8816 rm -f conftest*
8817 fi
8818 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8819   echo "$ac_t""yes" 1>&6
8820   have_gle3=yes
8821 else
8822   echo "$ac_t""no" 1>&6
8823 fi
8824
8825   CPPFLAGS="$ac_save_CPPFLAGS"
8826   if test "$have_gle3" = yes ; then
8827     have_gle=yes;
8828   else
8829     
8830   ac_save_CPPFLAGS="$CPPFLAGS"
8831   if test \! -z "$includedir" ; then 
8832     CPPFLAGS="$CPPFLAGS -I$includedir"
8833   fi
8834   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8835   ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
8836 echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
8837 echo "configure:8849: checking for GL/gutil.h" >&5
8838 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8839   echo $ac_n "(cached) $ac_c" 1>&6
8840 else
8841   cat > conftest.$ac_ext <<EOF
8842 #line 8854 "configure"
8843 #include "confdefs.h"
8844 #include <GL/gutil.h>
8845 EOF
8846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8847 { (eval echo configure:8859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8848 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8849 if test -z "$ac_err"; then
8850   rm -rf conftest*
8851   eval "ac_cv_header_$ac_safe=yes"
8852 else
8853   echo "$ac_err" >&5
8854   echo "configure: failed program was:" >&5
8855   cat conftest.$ac_ext >&5
8856   rm -rf conftest*
8857   eval "ac_cv_header_$ac_safe=no"
8858 fi
8859 rm -f conftest*
8860 fi
8861 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8862   echo "$ac_t""yes" 1>&6
8863   have_gle=yes
8864 else
8865   echo "$ac_t""no" 1>&6
8866 fi
8867
8868   CPPFLAGS="$ac_save_CPPFLAGS"
8869     if test "$have_gle" = yes ; then
8870       
8871   ac_save_CPPFLAGS="$CPPFLAGS"
8872   if test \! -z "$includedir" ; then 
8873     CPPFLAGS="$CPPFLAGS -I$includedir"
8874   fi
8875   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8876   ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
8877 echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
8878 echo "configure:8890: checking for GL/tube.h" >&5
8879 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8880   echo $ac_n "(cached) $ac_c" 1>&6
8881 else
8882   cat > conftest.$ac_ext <<EOF
8883 #line 8895 "configure"
8884 #include "confdefs.h"
8885 #include <GL/tube.h>
8886 EOF
8887 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8888 { (eval echo configure:8900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8889 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8890 if test -z "$ac_err"; then
8891   rm -rf conftest*
8892   eval "ac_cv_header_$ac_safe=yes"
8893 else
8894   echo "$ac_err" >&5
8895   echo "configure: failed program was:" >&5
8896   cat conftest.$ac_ext >&5
8897   rm -rf conftest*
8898   eval "ac_cv_header_$ac_safe=no"
8899 fi
8900 rm -f conftest*
8901 fi
8902 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8903   echo "$ac_t""yes" 1>&6
8904   have_gle=yes
8905 else
8906   echo "$ac_t""no" 1>&6
8907 fi
8908
8909   CPPFLAGS="$ac_save_CPPFLAGS"
8910     fi
8911   fi
8912
8913   if test "$have_gle" = yes ; then
8914     have_gle=no
8915     gle_halfassed=yes
8916     
8917   ac_save_CPPFLAGS="$CPPFLAGS"
8918   ac_save_LDFLAGS="$LDFLAGS"
8919 #  ac_save_LIBS="$LIBS"
8920
8921   if test \! -z "$includedir" ; then 
8922     CPPFLAGS="$CPPFLAGS -I$includedir"
8923   fi
8924   # note: $X_CFLAGS includes $x_includes
8925   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8926
8927   if test \! -z "$libdir" ; then
8928     LDFLAGS="$LDFLAGS -L$libdir"
8929   fi
8930   # note: $X_LIBS includes $x_libraries
8931   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8932
8933   echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
8934 echo "configure:8946: checking for gleCreateGC in -lgle" >&5
8935 ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
8936 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8937   echo $ac_n "(cached) $ac_c" 1>&6
8938 else
8939   ac_save_LIBS="$LIBS"
8940 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
8941 cat > conftest.$ac_ext <<EOF
8942 #line 8954 "configure"
8943 #include "confdefs.h"
8944 /* Override any gcc2 internal prototype to avoid an error.  */
8945 /* We use char because int might match the return type of a gcc2
8946     builtin and then its argument prototype would still apply.  */
8947 char gleCreateGC();
8948
8949 int main() {
8950 gleCreateGC()
8951 ; return 0; }
8952 EOF
8953 if { (eval echo configure:8965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8954   rm -rf conftest*
8955   eval "ac_cv_lib_$ac_lib_var=yes"
8956 else
8957   echo "configure: failed program was:" >&5
8958   cat conftest.$ac_ext >&5
8959   rm -rf conftest*
8960   eval "ac_cv_lib_$ac_lib_var=no"
8961 fi
8962 rm -f conftest*
8963 LIBS="$ac_save_LIBS"
8964
8965 fi
8966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8967   echo "$ac_t""yes" 1>&6
8968   have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
8969 else
8970   echo "$ac_t""no" 1>&6
8971 fi
8972
8973   CPPFLAGS="$ac_save_CPPFLAGS"
8974   LDFLAGS="$ac_save_LDFLAGS"
8975 #  LIBS="$ac_save_LIBS"
8976   
8977   fi
8978   if test "$have_gle" = yes ; then
8979     have_gle=no
8980     gle_halfassed=yes
8981
8982     # sometimes the libmatrix stuff is included in libgle.  look there first.
8983 #
8984 # I don't get it.  For some reason, this test passes on SGI, as if
8985 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
8986 # Yet the link is succeeding.  Why???
8987 #
8988 #    AC_CHECK_X_LIB(gle, uview_direction_d, 
8989 #                   [have_gle=yes; gle_halfassed=no],
8990 #                   [], $GL_LIBS -lX11 -lXext -lm)
8991
8992     # As of GLE 3 this is in libgle, and has changed name to uview_direction!
8993     # *sigh*
8994     if test "$have_gle3" = yes ; then
8995       
8996   ac_save_CPPFLAGS="$CPPFLAGS"
8997   ac_save_LDFLAGS="$LDFLAGS"
8998 #  ac_save_LIBS="$LIBS"
8999
9000   if test \! -z "$includedir" ; then 
9001     CPPFLAGS="$CPPFLAGS -I$includedir"
9002   fi
9003   # note: $X_CFLAGS includes $x_includes
9004   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9005
9006   if test \! -z "$libdir" ; then
9007     LDFLAGS="$LDFLAGS -L$libdir"
9008   fi
9009   # note: $X_LIBS includes $x_libraries
9010   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9011
9012   echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
9013 echo "configure:9025: checking for uview_direction in -lgle" >&5
9014 ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
9015 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9016   echo $ac_n "(cached) $ac_c" 1>&6
9017 else
9018   ac_save_LIBS="$LIBS"
9019 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
9020 cat > conftest.$ac_ext <<EOF
9021 #line 9033 "configure"
9022 #include "confdefs.h"
9023 /* Override any gcc2 internal prototype to avoid an error.  */
9024 /* We use char because int might match the return type of a gcc2
9025     builtin and then its argument prototype would still apply.  */
9026 char uview_direction();
9027
9028 int main() {
9029 uview_direction()
9030 ; return 0; }
9031 EOF
9032 if { (eval echo configure:9044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9033   rm -rf conftest*
9034   eval "ac_cv_lib_$ac_lib_var=yes"
9035 else
9036   echo "configure: failed program was:" >&5
9037   cat conftest.$ac_ext >&5
9038   rm -rf conftest*
9039   eval "ac_cv_lib_$ac_lib_var=no"
9040 fi
9041 rm -f conftest*
9042 LIBS="$ac_save_LIBS"
9043
9044 fi
9045 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9046   echo "$ac_t""yes" 1>&6
9047   have_gle=yes; gle_halfassed=no
9048 else
9049   echo "$ac_t""no" 1>&6
9050 fi
9051
9052   CPPFLAGS="$ac_save_CPPFLAGS"
9053   LDFLAGS="$ac_save_LDFLAGS"
9054 #  LIBS="$ac_save_LIBS"
9055   
9056     fi
9057     # if it wasn't in libgle, then look in libmatrix.
9058     if test "$have_gle" = no ; then
9059       
9060   ac_save_CPPFLAGS="$CPPFLAGS"
9061   ac_save_LDFLAGS="$LDFLAGS"
9062 #  ac_save_LIBS="$LIBS"
9063
9064   if test \! -z "$includedir" ; then 
9065     CPPFLAGS="$CPPFLAGS -I$includedir"
9066   fi
9067   # note: $X_CFLAGS includes $x_includes
9068   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9069
9070   if test \! -z "$libdir" ; then
9071     LDFLAGS="$LDFLAGS -L$libdir"
9072   fi
9073   # note: $X_LIBS includes $x_libraries
9074   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9075
9076   echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
9077 echo "configure:9089: checking for uview_direction_d in -lmatrix" >&5
9078 ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
9079 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9080   echo $ac_n "(cached) $ac_c" 1>&6
9081 else
9082   ac_save_LIBS="$LIBS"
9083 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
9084 cat > conftest.$ac_ext <<EOF
9085 #line 9097 "configure"
9086 #include "confdefs.h"
9087 /* Override any gcc2 internal prototype to avoid an error.  */
9088 /* We use char because int might match the return type of a gcc2
9089     builtin and then its argument prototype would still apply.  */
9090 char uview_direction_d();
9091
9092 int main() {
9093 uview_direction_d()
9094 ; return 0; }
9095 EOF
9096 if { (eval echo configure:9108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9097   rm -rf conftest*
9098   eval "ac_cv_lib_$ac_lib_var=yes"
9099 else
9100   echo "configure: failed program was:" >&5
9101   cat conftest.$ac_ext >&5
9102   rm -rf conftest*
9103   eval "ac_cv_lib_$ac_lib_var=no"
9104 fi
9105 rm -f conftest*
9106 LIBS="$ac_save_LIBS"
9107
9108 fi
9109 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9110   echo "$ac_t""yes" 1>&6
9111   have_gle=yes; gle_halfassed=no;
9112                       GLE_LIBS="$GLE_LIBS -lmatrix"
9113 else
9114   echo "$ac_t""no" 1>&6
9115 fi
9116
9117   CPPFLAGS="$ac_save_CPPFLAGS"
9118   LDFLAGS="$ac_save_LDFLAGS"
9119 #  LIBS="$ac_save_LIBS"
9120   
9121     fi
9122   fi
9123
9124   if test "$have_gle" = yes ; then
9125     cat >> confdefs.h <<\EOF
9126 #define HAVE_GLE 1
9127 EOF
9128
9129     if test "$have_gle3" = yes ; then
9130       cat >> confdefs.h <<\EOF
9131 #define HAVE_GLE3 1
9132 EOF
9133
9134     fi
9135   fi
9136
9137 elif test "$with_gle" != no; then
9138   echo "error: must be yes or no: --with-gle=$with_gle"
9139   exit 1
9140
9141 fi
9142
9143
9144
9145 ###############################################################################
9146 #
9147 #       Check for -lXpm.
9148 #
9149 ###############################################################################
9150
9151 have_xpm=no
9152 with_xpm_req=unspecified
9153 # Check whether --with-xpm or --without-xpm was given.
9154 if test "${with_xpm+set}" = set; then
9155   withval="$with_xpm"
9156   with_xpm="$withval"; with_xpm_req="$withval"
9157 else
9158   with_xpm=yes
9159 fi
9160
9161
9162
9163    case "$with_xpm" in
9164     yes) ;;
9165     no)  ;;
9166
9167     /*)
9168      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
9169 echo "configure:9181: checking for XPM headers" >&5
9170      d=$with_xpm/include
9171      if test -d $d; then
9172        X_CFLAGS="-I$d $X_CFLAGS"
9173        echo "$ac_t""$d" 1>&6
9174      else
9175        echo "$ac_t""not found ($d: no such directory)" 1>&6
9176      fi
9177
9178      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
9179 echo "configure:9191: checking for XPM libs" >&5
9180      d=$with_xpm/lib
9181      if test -d $d; then
9182        X_LIBS="-L$d $X_LIBS"
9183        echo "$ac_t""$d" 1>&6
9184      else
9185        echo "$ac_t""not found ($d: no such directory)" 1>&6
9186      fi
9187
9188      # replace the directory string with "yes".
9189      with_xpm_req="yes"
9190      with_xpm=$with_xpm_req
9191      ;;
9192
9193     *)
9194      echo ""
9195      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
9196      echo "       If it is a directory, then \`DIR/include' will be added to"
9197      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9198      exit 1
9199      ;;
9200    esac
9201   
9202
9203 if test "$with_xpm" = yes; then
9204   
9205   ac_save_CPPFLAGS="$CPPFLAGS"
9206   if test \! -z "$includedir" ; then 
9207     CPPFLAGS="$CPPFLAGS -I$includedir"
9208   fi
9209   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9210   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
9211 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
9212 echo "configure:9224: checking for X11/xpm.h" >&5
9213 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9214   echo $ac_n "(cached) $ac_c" 1>&6
9215 else
9216   cat > conftest.$ac_ext <<EOF
9217 #line 9229 "configure"
9218 #include "confdefs.h"
9219 #include <X11/xpm.h>
9220 EOF
9221 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9222 { (eval echo configure:9234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9223 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9224 if test -z "$ac_err"; then
9225   rm -rf conftest*
9226   eval "ac_cv_header_$ac_safe=yes"
9227 else
9228   echo "$ac_err" >&5
9229   echo "configure: failed program was:" >&5
9230   cat conftest.$ac_ext >&5
9231   rm -rf conftest*
9232   eval "ac_cv_header_$ac_safe=no"
9233 fi
9234 rm -f conftest*
9235 fi
9236 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9237   echo "$ac_t""yes" 1>&6
9238   have_xpm=yes
9239                     cat >> confdefs.h <<\EOF
9240 #define HAVE_XPM 1
9241 EOF
9242
9243                     XPM_LIBS="-lXpm"
9244 else
9245   echo "$ac_t""no" 1>&6
9246 fi
9247
9248   CPPFLAGS="$ac_save_CPPFLAGS"
9249 elif test "$with_xpm" != no; then
9250   echo "error: must be yes or no: --with-xpm=$with_xpm"
9251   exit 1
9252 fi
9253
9254 # See comment near $motif_requires_xpm, above.
9255 # Need to do this here, after both Motif and XPM have been checked for.
9256 #
9257 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
9258   if test "$motif_requires_xpm" = yes ; then
9259     MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
9260   fi
9261 fi
9262
9263
9264 ###############################################################################
9265 #
9266 #       Check for -lgdk_pixbuf.
9267 #
9268 ###############################################################################
9269
9270 have_gdk_pixbuf=no
9271 with_gdk_pixbuf_req=unspecified
9272 # Check whether --with-pixbuf or --without-pixbuf was given.
9273 if test "${with_pixbuf+set}" = set; then
9274   withval="$with_pixbuf"
9275   with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"
9276 else
9277   with_gdk_pixbuf=yes
9278 fi
9279
9280
9281 # if --with-pixbuf=/directory/ was specified, remember that directory so that
9282 # we can also look for the `gdk-pixbuf-config' program in that directory.
9283 case "$with_gdk_pixbuf" in
9284   /*)
9285     gdk_pixbuf_dir="$with_gdk_pixbuf"
9286     ;;
9287   *)
9288     gdk_pixbuf_dir=""
9289     ;;
9290 esac
9291
9292
9293    case "$with_gdk_pixbuf" in
9294     yes) ;;
9295     no)  ;;
9296
9297     /*)
9298      echo $ac_n "checking for GDK_PIXBUF headers""... $ac_c" 1>&6
9299 echo "configure:9311: checking for GDK_PIXBUF headers" >&5
9300      d=$with_gdk_pixbuf/include
9301      if test -d $d; then
9302        X_CFLAGS="-I$d $X_CFLAGS"
9303        echo "$ac_t""$d" 1>&6
9304      else
9305        echo "$ac_t""not found ($d: no such directory)" 1>&6
9306      fi
9307
9308      echo $ac_n "checking for GDK_PIXBUF libs""... $ac_c" 1>&6
9309 echo "configure:9321: checking for GDK_PIXBUF libs" >&5
9310      d=$with_gdk_pixbuf/lib
9311      if test -d $d; then
9312        X_LIBS="-L$d $X_LIBS"
9313        echo "$ac_t""$d" 1>&6
9314      else
9315        echo "$ac_t""not found ($d: no such directory)" 1>&6
9316      fi
9317
9318      # replace the directory string with "yes".
9319      with_gdk_pixbuf_req="yes"
9320      with_gdk_pixbuf=$with_gdk_pixbuf_req
9321      ;;
9322
9323     *)
9324      echo ""
9325      echo "error: argument to --with-pixbuf must be \"yes\", \"no\", or a directory."
9326      echo "       If it is a directory, then \`DIR/include' will be added to"
9327      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9328      exit 1
9329      ;;
9330    esac
9331   
9332
9333 if test "$with_gdk_pixbuf" != yes -a "$with_gdk_pixbuf" != no ; then
9334   echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
9335   exit 1
9336 fi
9337
9338 if test "$with_gdk_pixbuf" = yes; then
9339   have_gdk_pixbuf=no
9340
9341   # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
9342   # look in /foo/bin/ for for gdk-pixbuf-config.
9343   #
9344   gdk_pixbuf_path="$PATH"
9345
9346   if test ! -z "$gtk_dir"; then
9347     # canonicalize slashes.
9348     foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
9349     gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
9350   fi
9351
9352   if test ! -z "$gnome_dir"; then
9353     # canonicalize slashes.
9354     foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
9355     gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
9356   fi
9357
9358   for ac_prog in gdk-pixbuf-config
9359 do
9360 # Extract the first word of "$ac_prog", so it can be a program name with args.
9361 set dummy $ac_prog; ac_word=$2
9362 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9363 echo "configure:9375: checking for $ac_word" >&5
9364 if eval "test \"`echo '$''{'ac_cv_path_gdk_pixbuf_config'+set}'`\" = set"; then
9365   echo $ac_n "(cached) $ac_c" 1>&6
9366 else
9367   case "$gdk_pixbuf_config" in
9368   /*)
9369   ac_cv_path_gdk_pixbuf_config="$gdk_pixbuf_config" # Let the user override the test with a path.
9370   ;;
9371   ?:/*)                  
9372   ac_cv_path_gdk_pixbuf_config="$gdk_pixbuf_config" # Let the user override the test with a dos path.
9373   ;;
9374   *)
9375   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
9376   ac_dummy="$gdk_pixbuf_path"
9377   for ac_dir in $ac_dummy; do 
9378     test -z "$ac_dir" && ac_dir=.
9379     if test -f $ac_dir/$ac_word; then
9380       ac_cv_path_gdk_pixbuf_config="$ac_dir/$ac_word"
9381       break
9382     fi
9383   done
9384   IFS="$ac_save_ifs"
9385   ;;
9386 esac
9387 fi
9388 gdk_pixbuf_config="$ac_cv_path_gdk_pixbuf_config"
9389 if test -n "$gdk_pixbuf_config"; then
9390   echo "$ac_t""$gdk_pixbuf_config" 1>&6
9391 else
9392   echo "$ac_t""no" 1>&6
9393 fi
9394
9395 test -n "$gdk_pixbuf_config" && break
9396 done
9397
9398
9399   # If we found the gdk-pixbuf-config program, run it to get flags.
9400   #
9401   if test -n "$gdk_pixbuf_config" ; then
9402     echo $ac_n "checking for gdk-pixbuf includes""... $ac_c" 1>&6
9403 echo "configure:9415: checking for gdk-pixbuf includes" >&5
9404 if eval "test \"`echo '$''{'ac_cv_gdk_pixbuf_config_cflags'+set}'`\" = set"; then
9405   echo $ac_n "(cached) $ac_c" 1>&6
9406 else
9407   ac_cv_gdk_pixbuf_config_cflags=`$gdk_pixbuf_config --cflags`
9408 fi
9409
9410 echo "$ac_t""$ac_cv_gdk_pixbuf_config_cflags" 1>&6
9411     echo $ac_n "checking for gdk-pixbuf libs""... $ac_c" 1>&6
9412 echo "configure:9424: checking for gdk-pixbuf libs" >&5
9413 if eval "test \"`echo '$''{'ac_cv_gdk_pixbuf_config_libs'+set}'`\" = set"; then
9414   echo $ac_n "(cached) $ac_c" 1>&6
9415 else
9416   ac_cv_gdk_pixbuf_config_libs=`$gdk_pixbuf_config --libs`
9417 fi
9418
9419 echo "$ac_t""$ac_cv_gdk_pixbuf_config_libs" 1>&6
9420     ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
9421     ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
9422   fi
9423
9424   ac_save_gdk_pixbuf_CPPFLAGS="$CPPFLAGS"
9425   CPPFLAGS="$CPPFLAGS $ac_gdk_pixbuf_config_cflags"
9426
9427   # check for header 1...
9428   
9429   ac_save_CPPFLAGS="$CPPFLAGS"
9430   if test \! -z "$includedir" ; then 
9431     CPPFLAGS="$CPPFLAGS -I$includedir"
9432   fi
9433   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9434   ac_safe=`echo "gdk-pixbuf/gdk-pixbuf.h" | sed 'y%./+-%__p_%'`
9435 echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf.h""... $ac_c" 1>&6
9436 echo "configure:9448: checking for gdk-pixbuf/gdk-pixbuf.h" >&5
9437 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9438   echo $ac_n "(cached) $ac_c" 1>&6
9439 else
9440   cat > conftest.$ac_ext <<EOF
9441 #line 9453 "configure"
9442 #include "confdefs.h"
9443 #include <gdk-pixbuf/gdk-pixbuf.h>
9444 EOF
9445 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9446 { (eval echo configure:9458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9447 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9448 if test -z "$ac_err"; then
9449   rm -rf conftest*
9450   eval "ac_cv_header_$ac_safe=yes"
9451 else
9452   echo "$ac_err" >&5
9453   echo "configure: failed program was:" >&5
9454   cat conftest.$ac_ext >&5
9455   rm -rf conftest*
9456   eval "ac_cv_header_$ac_safe=no"
9457 fi
9458 rm -f conftest*
9459 fi
9460 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9461   echo "$ac_t""yes" 1>&6
9462   have_gdk_pixbuf=yes
9463 else
9464   echo "$ac_t""no" 1>&6
9465 fi
9466
9467   CPPFLAGS="$ac_save_CPPFLAGS"
9468
9469   # if that worked, check for header 2...
9470   if test "$have_gdk_pixbuf" = yes; then
9471     have_gdk_pixbuf=no
9472     
9473   ac_save_CPPFLAGS="$CPPFLAGS"
9474   if test \! -z "$includedir" ; then 
9475     CPPFLAGS="$CPPFLAGS -I$includedir"
9476   fi
9477   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9478   ac_safe=`echo "gdk-pixbuf/gdk-pixbuf-xlib.h" | sed 'y%./+-%__p_%'`
9479 echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf-xlib.h""... $ac_c" 1>&6
9480 echo "configure:9492: checking for gdk-pixbuf/gdk-pixbuf-xlib.h" >&5
9481 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9482   echo $ac_n "(cached) $ac_c" 1>&6
9483 else
9484   cat > conftest.$ac_ext <<EOF
9485 #line 9497 "configure"
9486 #include "confdefs.h"
9487 #include <gdk-pixbuf/gdk-pixbuf-xlib.h>
9488 EOF
9489 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9490 { (eval echo configure:9502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9491 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9492 if test -z "$ac_err"; then
9493   rm -rf conftest*
9494   eval "ac_cv_header_$ac_safe=yes"
9495 else
9496   echo "$ac_err" >&5
9497   echo "configure: failed program was:" >&5
9498   cat conftest.$ac_ext >&5
9499   rm -rf conftest*
9500   eval "ac_cv_header_$ac_safe=no"
9501 fi
9502 rm -f conftest*
9503 fi
9504 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9505   echo "$ac_t""yes" 1>&6
9506   have_gdk_pixbuf=yes
9507 else
9508   echo "$ac_t""no" 1>&6
9509 fi
9510
9511   CPPFLAGS="$ac_save_CPPFLAGS"
9512   fi
9513
9514   CPPFLAGS="$ac_save_gdk_pixbuf_CPPFLAGS"
9515
9516   if test "$have_gdk_pixbuf" = yes; then
9517     # we have the headers, now check for the libraries
9518     have_gdk_pixbuf=no
9519     gdk_pixbuf_halfassed=yes
9520     # library 1...
9521     
9522   ac_save_CPPFLAGS="$CPPFLAGS"
9523   ac_save_LDFLAGS="$LDFLAGS"
9524 #  ac_save_LIBS="$LIBS"
9525
9526   if test \! -z "$includedir" ; then 
9527     CPPFLAGS="$CPPFLAGS -I$includedir"
9528   fi
9529   # note: $X_CFLAGS includes $x_includes
9530   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9531
9532   if test \! -z "$libdir" ; then
9533     LDFLAGS="$LDFLAGS -L$libdir"
9534   fi
9535   # note: $X_LIBS includes $x_libraries
9536   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9537
9538   echo $ac_n "checking for gdk_pixbuf_new_from_file in -lgdk_pixbuf""... $ac_c" 1>&6
9539 echo "configure:9551: checking for gdk_pixbuf_new_from_file in -lgdk_pixbuf" >&5
9540 ac_lib_var=`echo gdk_pixbuf'_'gdk_pixbuf_new_from_file | sed 'y%./+-%__p_%'`
9541 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9542   echo $ac_n "(cached) $ac_c" 1>&6
9543 else
9544   ac_save_LIBS="$LIBS"
9545 LIBS="-lgdk_pixbuf $ac_gdk_pixbuf_config_libs $LIBS"
9546 cat > conftest.$ac_ext <<EOF
9547 #line 9559 "configure"
9548 #include "confdefs.h"
9549 /* Override any gcc2 internal prototype to avoid an error.  */
9550 /* We use char because int might match the return type of a gcc2
9551     builtin and then its argument prototype would still apply.  */
9552 char gdk_pixbuf_new_from_file();
9553
9554 int main() {
9555 gdk_pixbuf_new_from_file()
9556 ; return 0; }
9557 EOF
9558 if { (eval echo configure:9570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9559   rm -rf conftest*
9560   eval "ac_cv_lib_$ac_lib_var=yes"
9561 else
9562   echo "configure: failed program was:" >&5
9563   cat conftest.$ac_ext >&5
9564   rm -rf conftest*
9565   eval "ac_cv_lib_$ac_lib_var=no"
9566 fi
9567 rm -f conftest*
9568 LIBS="$ac_save_LIBS"
9569
9570 fi
9571 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9572   echo "$ac_t""yes" 1>&6
9573   have_gdk_pixbuf=yes
9574 else
9575   echo "$ac_t""no" 1>&6
9576 true
9577 fi
9578
9579   CPPFLAGS="$ac_save_CPPFLAGS"
9580   LDFLAGS="$ac_save_LDFLAGS"
9581 #  LIBS="$ac_save_LIBS"
9582   
9583     # library 2...
9584     if test "$have_gdk_pixbuf" = yes; then
9585       
9586   ac_save_CPPFLAGS="$CPPFLAGS"
9587   ac_save_LDFLAGS="$LDFLAGS"
9588 #  ac_save_LIBS="$LIBS"
9589
9590   if test \! -z "$includedir" ; then 
9591     CPPFLAGS="$CPPFLAGS -I$includedir"
9592   fi
9593   # note: $X_CFLAGS includes $x_includes
9594   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9595
9596   if test \! -z "$libdir" ; then
9597     LDFLAGS="$LDFLAGS -L$libdir"
9598   fi
9599   # note: $X_LIBS includes $x_libraries
9600   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9601
9602   echo $ac_n "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib""... $ac_c" 1>&6
9603 echo "configure:9615: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib" >&5
9604 ac_lib_var=`echo gdk_pixbuf_xlib'_'gdk_pixbuf_xlib_init | sed 'y%./+-%__p_%'`
9605 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9606   echo $ac_n "(cached) $ac_c" 1>&6
9607 else
9608   ac_save_LIBS="$LIBS"
9609 LIBS="-lgdk_pixbuf_xlib $ac_gdk_pixbuf_config_libs $LIBS"
9610 cat > conftest.$ac_ext <<EOF
9611 #line 9623 "configure"
9612 #include "confdefs.h"
9613 /* Override any gcc2 internal prototype to avoid an error.  */
9614 /* We use char because int might match the return type of a gcc2
9615     builtin and then its argument prototype would still apply.  */
9616 char gdk_pixbuf_xlib_init();
9617
9618 int main() {
9619 gdk_pixbuf_xlib_init()
9620 ; return 0; }
9621 EOF
9622 if { (eval echo configure:9634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9623   rm -rf conftest*
9624   eval "ac_cv_lib_$ac_lib_var=yes"
9625 else
9626   echo "configure: failed program was:" >&5
9627   cat conftest.$ac_ext >&5
9628   rm -rf conftest*
9629   eval "ac_cv_lib_$ac_lib_var=no"
9630 fi
9631 rm -f conftest*
9632 LIBS="$ac_save_LIBS"
9633
9634 fi
9635 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9636   echo "$ac_t""yes" 1>&6
9637   have_gdk_pixbuf=yes
9638                       gdk_pixbuf_halfassed=no
9639 else
9640   echo "$ac_t""no" 1>&6
9641 true
9642 fi
9643
9644   CPPFLAGS="$ac_save_CPPFLAGS"
9645   LDFLAGS="$ac_save_LDFLAGS"
9646 #  LIBS="$ac_save_LIBS"
9647   
9648     fi
9649   fi
9650
9651   if test "$have_gdk_pixbuf" = yes; then
9652     INCLUDES="$INCLUDES $ac_gdk_pixbuf_config_cflags"
9653     XPM_LIBS="$ac_gdk_pixbuf_config_libs -lgdk_pixbuf -lgdk_pixbuf_xlib"
9654     cat >> confdefs.h <<\EOF
9655 #define HAVE_GDK_PIXBUF 1
9656 EOF
9657
9658   fi
9659 fi
9660
9661
9662 ###############################################################################
9663 #
9664 #       Check for -ljpeg
9665 #
9666 ###############################################################################
9667
9668 have_jpeg=no
9669 with_jpeg_req=unspecified
9670 jpeg_halfassed=no
9671 # Check whether --with-jpeg or --without-jpeg was given.
9672 if test "${with_jpeg+set}" = set; then
9673   withval="$with_jpeg"
9674   with_jpeg="$withval"; with_jpeg_req="$withval"
9675 else
9676   with_jpeg=yes
9677 fi
9678
9679
9680
9681    case "$with_jpeg" in
9682     yes) ;;
9683     no)  ;;
9684
9685     /*)
9686      echo $ac_n "checking for JPEG headers""... $ac_c" 1>&6
9687 echo "configure:9699: checking for JPEG headers" >&5
9688      d=$with_jpeg/include
9689      if test -d $d; then
9690        X_CFLAGS="-I$d $X_CFLAGS"
9691        echo "$ac_t""$d" 1>&6
9692      else
9693        echo "$ac_t""not found ($d: no such directory)" 1>&6
9694      fi
9695
9696      echo $ac_n "checking for JPEG libs""... $ac_c" 1>&6
9697 echo "configure:9709: checking for JPEG libs" >&5
9698      d=$with_jpeg/lib
9699      if test -d $d; then
9700        X_LIBS="-L$d $X_LIBS"
9701        echo "$ac_t""$d" 1>&6
9702      else
9703        echo "$ac_t""not found ($d: no such directory)" 1>&6
9704      fi
9705
9706      # replace the directory string with "yes".
9707      with_jpeg_req="yes"
9708      with_jpeg=$with_jpeg_req
9709      ;;
9710
9711     *)
9712      echo ""
9713      echo "error: argument to --with-jpeg must be \"yes\", \"no\", or a directory."
9714      echo "       If it is a directory, then \`DIR/include' will be added to"
9715      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9716      exit 1
9717      ;;
9718    esac
9719   
9720
9721 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
9722   echo "error: must be yes or no: --with-jpeg=$with_jpeg"
9723   exit 1
9724 fi
9725
9726 if test "$with_jpeg" = yes; then
9727
9728   have_jpeg=no
9729   
9730   ac_save_CPPFLAGS="$CPPFLAGS"
9731   if test \! -z "$includedir" ; then 
9732     CPPFLAGS="$CPPFLAGS -I$includedir"
9733   fi
9734   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9735   ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
9736 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
9737 echo "configure:9749: checking for jpeglib.h" >&5
9738 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9739   echo $ac_n "(cached) $ac_c" 1>&6
9740 else
9741   cat > conftest.$ac_ext <<EOF
9742 #line 9754 "configure"
9743 #include "confdefs.h"
9744 #include <jpeglib.h>
9745 EOF
9746 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9747 { (eval echo configure:9759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9748 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9749 if test -z "$ac_err"; then
9750   rm -rf conftest*
9751   eval "ac_cv_header_$ac_safe=yes"
9752 else
9753   echo "$ac_err" >&5
9754   echo "configure: failed program was:" >&5
9755   cat conftest.$ac_ext >&5
9756   rm -rf conftest*
9757   eval "ac_cv_header_$ac_safe=no"
9758 fi
9759 rm -f conftest*
9760 fi
9761 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9762   echo "$ac_t""yes" 1>&6
9763   have_jpeg=yes
9764 else
9765   echo "$ac_t""no" 1>&6
9766 fi
9767
9768   CPPFLAGS="$ac_save_CPPFLAGS"
9769
9770   if test "$have_jpeg" = yes; then
9771     # we have the header, now check for the library
9772     have_jpeg=no
9773     jpeg_halfassed=yes
9774     
9775   ac_save_CPPFLAGS="$CPPFLAGS"
9776   ac_save_LDFLAGS="$LDFLAGS"
9777 #  ac_save_LIBS="$LIBS"
9778
9779   if test \! -z "$includedir" ; then 
9780     CPPFLAGS="$CPPFLAGS -I$includedir"
9781   fi
9782   # note: $X_CFLAGS includes $x_includes
9783   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9784
9785   if test \! -z "$libdir" ; then
9786     LDFLAGS="$LDFLAGS -L$libdir"
9787   fi
9788   # note: $X_LIBS includes $x_libraries
9789   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9790
9791   echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
9792 echo "configure:9804: checking for jpeg_start_compress in -ljpeg" >&5
9793 ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
9794 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9795   echo $ac_n "(cached) $ac_c" 1>&6
9796 else
9797   ac_save_LIBS="$LIBS"
9798 LIBS="-ljpeg  $LIBS"
9799 cat > conftest.$ac_ext <<EOF
9800 #line 9812 "configure"
9801 #include "confdefs.h"
9802 /* Override any gcc2 internal prototype to avoid an error.  */
9803 /* We use char because int might match the return type of a gcc2
9804     builtin and then its argument prototype would still apply.  */
9805 char jpeg_start_compress();
9806
9807 int main() {
9808 jpeg_start_compress()
9809 ; return 0; }
9810 EOF
9811 if { (eval echo configure:9823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9812   rm -rf conftest*
9813   eval "ac_cv_lib_$ac_lib_var=yes"
9814 else
9815   echo "configure: failed program was:" >&5
9816   cat conftest.$ac_ext >&5
9817   rm -rf conftest*
9818   eval "ac_cv_lib_$ac_lib_var=no"
9819 fi
9820 rm -f conftest*
9821 LIBS="$ac_save_LIBS"
9822
9823 fi
9824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9825   echo "$ac_t""yes" 1>&6
9826   have_jpeg=yes
9827                     jpeg_halfassed=no
9828                     JPEG_LIBS="-ljpeg"
9829                     cat >> confdefs.h <<\EOF
9830 #define HAVE_JPEGLIB 1
9831 EOF
9832
9833 else
9834   echo "$ac_t""no" 1>&6
9835 fi
9836
9837   CPPFLAGS="$ac_save_CPPFLAGS"
9838   LDFLAGS="$ac_save_LDFLAGS"
9839 #  LIBS="$ac_save_LIBS"
9840   
9841   fi
9842 fi
9843
9844
9845 ###############################################################################
9846 #
9847 #       Check for the XSHM server extension.
9848 #
9849 ###############################################################################
9850
9851 have_xshm=no
9852 with_xshm_req=unspecified
9853 # Check whether --with-xshm-ext or --without-xshm-ext was given.
9854 if test "${with_xshm_ext+set}" = set; then
9855   withval="$with_xshm_ext"
9856   with_xshm="$withval"; with_xshm_req="$withval"
9857 else
9858   with_xshm=yes
9859 fi
9860
9861
9862
9863    case "$with_xshm" in
9864     yes) ;;
9865     no)  ;;
9866
9867     /*)
9868      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
9869 echo "configure:9881: checking for XSHM headers" >&5
9870      d=$with_xshm/include
9871      if test -d $d; then
9872        X_CFLAGS="-I$d $X_CFLAGS"
9873        echo "$ac_t""$d" 1>&6
9874      else
9875        echo "$ac_t""not found ($d: no such directory)" 1>&6
9876      fi
9877
9878      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
9879 echo "configure:9891: checking for XSHM libs" >&5
9880      d=$with_xshm/lib
9881      if test -d $d; then
9882        X_LIBS="-L$d $X_LIBS"
9883        echo "$ac_t""$d" 1>&6
9884      else
9885        echo "$ac_t""not found ($d: no such directory)" 1>&6
9886      fi
9887
9888      # replace the directory string with "yes".
9889      with_xshm_req="yes"
9890      with_xshm=$with_xshm_req
9891      ;;
9892
9893     *)
9894      echo ""
9895      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
9896      echo "       If it is a directory, then \`DIR/include' will be added to"
9897      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9898      exit 1
9899      ;;
9900    esac
9901   
9902
9903 if test "$with_xshm" = yes; then
9904
9905   # first check for Xshm.h.
9906   
9907   ac_save_CPPFLAGS="$CPPFLAGS"
9908   if test \! -z "$includedir" ; then 
9909     CPPFLAGS="$CPPFLAGS -I$includedir"
9910   fi
9911   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9912   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
9913 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
9914 echo "configure:9926: checking for X11/extensions/XShm.h" >&5
9915 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9916   echo $ac_n "(cached) $ac_c" 1>&6
9917 else
9918   cat > conftest.$ac_ext <<EOF
9919 #line 9931 "configure"
9920 #include "confdefs.h"
9921 #include <X11/extensions/XShm.h>
9922 EOF
9923 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9924 { (eval echo configure:9936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9925 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9926 if test -z "$ac_err"; then
9927   rm -rf conftest*
9928   eval "ac_cv_header_$ac_safe=yes"
9929 else
9930   echo "$ac_err" >&5
9931   echo "configure: failed program was:" >&5
9932   cat conftest.$ac_ext >&5
9933   rm -rf conftest*
9934   eval "ac_cv_header_$ac_safe=no"
9935 fi
9936 rm -f conftest*
9937 fi
9938 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9939   echo "$ac_t""yes" 1>&6
9940   have_xshm=yes
9941 else
9942   echo "$ac_t""no" 1>&6
9943 fi
9944
9945   CPPFLAGS="$ac_save_CPPFLAGS"
9946
9947   # if that succeeded, then check for sys/ipc.h.
9948   if test "$have_xshm" = yes; then
9949     have_xshm=no
9950     
9951   ac_save_CPPFLAGS="$CPPFLAGS"
9952   if test \! -z "$includedir" ; then 
9953     CPPFLAGS="$CPPFLAGS -I$includedir"
9954   fi
9955   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9956   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
9957 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
9958 echo "configure:9970: checking for sys/ipc.h" >&5
9959 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9960   echo $ac_n "(cached) $ac_c" 1>&6
9961 else
9962   cat > conftest.$ac_ext <<EOF
9963 #line 9975 "configure"
9964 #include "confdefs.h"
9965 #include <sys/ipc.h>
9966 EOF
9967 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9968 { (eval echo configure:9980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9969 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9970 if test -z "$ac_err"; then
9971   rm -rf conftest*
9972   eval "ac_cv_header_$ac_safe=yes"
9973 else
9974   echo "$ac_err" >&5
9975   echo "configure: failed program was:" >&5
9976   cat conftest.$ac_ext >&5
9977   rm -rf conftest*
9978   eval "ac_cv_header_$ac_safe=no"
9979 fi
9980 rm -f conftest*
9981 fi
9982 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9983   echo "$ac_t""yes" 1>&6
9984   have_xshm=yes
9985 else
9986   echo "$ac_t""no" 1>&6
9987 fi
9988
9989   CPPFLAGS="$ac_save_CPPFLAGS"
9990   fi
9991
9992   # if that succeeded, then check for sys/shm.h.
9993   if test "$have_xshm" = yes; then
9994     have_xshm=no
9995     
9996   ac_save_CPPFLAGS="$CPPFLAGS"
9997   if test \! -z "$includedir" ; then 
9998     CPPFLAGS="$CPPFLAGS -I$includedir"
9999   fi
10000   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10001   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
10002 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
10003 echo "configure:10015: checking for sys/shm.h" >&5
10004 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10005   echo $ac_n "(cached) $ac_c" 1>&6
10006 else
10007   cat > conftest.$ac_ext <<EOF
10008 #line 10020 "configure"
10009 #include "confdefs.h"
10010 #include <sys/shm.h>
10011 EOF
10012 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10013 { (eval echo configure:10025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10014 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10015 if test -z "$ac_err"; then
10016   rm -rf conftest*
10017   eval "ac_cv_header_$ac_safe=yes"
10018 else
10019   echo "$ac_err" >&5
10020   echo "configure: failed program was:" >&5
10021   cat conftest.$ac_ext >&5
10022   rm -rf conftest*
10023   eval "ac_cv_header_$ac_safe=no"
10024 fi
10025 rm -f conftest*
10026 fi
10027 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10028   echo "$ac_t""yes" 1>&6
10029   have_xshm=yes
10030 else
10031   echo "$ac_t""no" 1>&6
10032 fi
10033
10034   CPPFLAGS="$ac_save_CPPFLAGS"
10035   fi
10036
10037   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
10038   # to exist, but the library code to not exist.  And even better, the library
10039   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
10040   # lib doesn't exist, give up.  (This lib gets added to X_EXTRA_LIBS, and
10041   # that's not quite right, but close enough.)
10042   #
10043   case "$host" in
10044     *-aix*)
10045       if  `uname -v` -eq 3 ; then
10046         have_xshm=no
10047         
10048   ac_save_CPPFLAGS="$CPPFLAGS"
10049   ac_save_LDFLAGS="$LDFLAGS"
10050 #  ac_save_LIBS="$LIBS"
10051
10052   if test \! -z "$includedir" ; then 
10053     CPPFLAGS="$CPPFLAGS -I$includedir"
10054   fi
10055   # note: $X_CFLAGS includes $x_includes
10056   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10057
10058   if test \! -z "$libdir" ; then
10059     LDFLAGS="$LDFLAGS -L$libdir"
10060   fi
10061   # note: $X_LIBS includes $x_libraries
10062   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
10063
10064   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
10065 echo "configure:10077: checking for XShmQueryExtension in -lXextSam" >&5
10066 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
10067 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10068   echo $ac_n "(cached) $ac_c" 1>&6
10069 else
10070   ac_save_LIBS="$LIBS"
10071 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
10072 cat > conftest.$ac_ext <<EOF
10073 #line 10085 "configure"
10074 #include "confdefs.h"
10075 /* Override any gcc2 internal prototype to avoid an error.  */
10076 /* We use char because int might match the return type of a gcc2
10077     builtin and then its argument prototype would still apply.  */
10078 char XShmQueryExtension();
10079
10080 int main() {
10081 XShmQueryExtension()
10082 ; return 0; }
10083 EOF
10084 if { (eval echo configure:10096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10085   rm -rf conftest*
10086   eval "ac_cv_lib_$ac_lib_var=yes"
10087 else
10088   echo "configure: failed program was:" >&5
10089   cat conftest.$ac_ext >&5
10090   rm -rf conftest*
10091   eval "ac_cv_lib_$ac_lib_var=no"
10092 fi
10093 rm -f conftest*
10094 LIBS="$ac_save_LIBS"
10095
10096 fi
10097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10098   echo "$ac_t""yes" 1>&6
10099   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
10100 else
10101   echo "$ac_t""no" 1>&6
10102 true
10103 fi
10104
10105   CPPFLAGS="$ac_save_CPPFLAGS"
10106   LDFLAGS="$ac_save_LDFLAGS"
10107 #  LIBS="$ac_save_LIBS"
10108   
10109       fi
10110     ;;
10111   esac
10112
10113   # if that succeeded, then we've really got it.
10114   if test "$have_xshm" = yes; then
10115     cat >> confdefs.h <<\EOF
10116 #define HAVE_XSHM_EXTENSION 1
10117 EOF
10118
10119   fi
10120
10121 elif test "$with_xshm" != no; then
10122   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
10123   exit 1
10124 fi
10125
10126
10127 ###############################################################################
10128 #
10129 #       Check for the DOUBLE-BUFFER server extension.
10130 #
10131 ###############################################################################
10132
10133 have_xdbe=no
10134 with_xdbe_req=unspecified
10135 # Check whether --with-xdbe-ext or --without-xdbe-ext was given.
10136 if test "${with_xdbe_ext+set}" = set; then
10137   withval="$with_xdbe_ext"
10138   with_xdbe="$withval"; with_xdbe_req="$withval"
10139 else
10140   with_xdbe=yes
10141 fi
10142
10143
10144
10145    case "$with_xdbe" in
10146     yes) ;;
10147     no)  ;;
10148
10149     /*)
10150      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
10151 echo "configure:10163: checking for DOUBLE-BUFFER headers" >&5
10152      d=$with_xdbe/include
10153      if test -d $d; then
10154        X_CFLAGS="-I$d $X_CFLAGS"
10155        echo "$ac_t""$d" 1>&6
10156      else
10157        echo "$ac_t""not found ($d: no such directory)" 1>&6
10158      fi
10159
10160      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
10161 echo "configure:10173: checking for DOUBLE-BUFFER libs" >&5
10162      d=$with_xdbe/lib
10163      if test -d $d; then
10164        X_LIBS="-L$d $X_LIBS"
10165        echo "$ac_t""$d" 1>&6
10166      else
10167        echo "$ac_t""not found ($d: no such directory)" 1>&6
10168      fi
10169
10170      # replace the directory string with "yes".
10171      with_xdbe_req="yes"
10172      with_xdbe=$with_xdbe_req
10173      ;;
10174
10175     *)
10176      echo ""
10177      echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
10178      echo "       If it is a directory, then \`DIR/include' will be added to"
10179      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
10180      exit 1
10181      ;;
10182    esac
10183   
10184
10185 if test "$with_xdbe" = yes; then
10186
10187   
10188   ac_save_CPPFLAGS="$CPPFLAGS"
10189   if test \! -z "$includedir" ; then 
10190     CPPFLAGS="$CPPFLAGS -I$includedir"
10191   fi
10192   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10193   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
10194 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
10195 echo "configure:10207: checking for X11/extensions/Xdbe.h" >&5
10196 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10197   echo $ac_n "(cached) $ac_c" 1>&6
10198 else
10199   cat > conftest.$ac_ext <<EOF
10200 #line 10212 "configure"
10201 #include "confdefs.h"
10202 #include <X11/extensions/Xdbe.h>
10203 EOF
10204 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10205 { (eval echo configure:10217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10206 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10207 if test -z "$ac_err"; then
10208   rm -rf conftest*
10209   eval "ac_cv_header_$ac_safe=yes"
10210 else
10211   echo "$ac_err" >&5
10212   echo "configure: failed program was:" >&5
10213   cat conftest.$ac_ext >&5
10214   rm -rf conftest*
10215   eval "ac_cv_header_$ac_safe=no"
10216 fi
10217 rm -f conftest*
10218 fi
10219 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10220   echo "$ac_t""yes" 1>&6
10221   have_xdbe=yes
10222 else
10223   echo "$ac_t""no" 1>&6
10224 fi
10225
10226   CPPFLAGS="$ac_save_CPPFLAGS"
10227   if test "$have_xdbe" = yes; then
10228     cat >> confdefs.h <<\EOF
10229 #define HAVE_DOUBLE_BUFFER_EXTENSION 1
10230 EOF
10231     
10232   fi
10233
10234 elif test "$with_xdbe" != no; then
10235   echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
10236   exit 1
10237 fi
10238
10239
10240 ###############################################################################
10241 #
10242 #       Check for the SGI XReadDisplay server extension.
10243 #
10244 #       Note: this has to be down here, rather than up with the other server
10245 #       extension tests, so that the output of `configure --help' is in the
10246 #       right order.  Arrgh!
10247 #
10248 ###############################################################################
10249
10250 have_readdisplay=no
10251 with_readdisplay_req=unspecified
10252 # Check whether --with-readdisplay or --without-readdisplay was given.
10253 if test "${with_readdisplay+set}" = set; then
10254   withval="$with_readdisplay"
10255   with_readdisplay="$withval"; with_readdisplay_req="$withval"
10256 else
10257   with_readdisplay=yes
10258 fi
10259
10260
10261
10262    case "$with_readdisplay" in
10263     yes) ;;
10264     no)  ;;
10265
10266     /*)
10267      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
10268 echo "configure:10280: checking for XReadDisplay headers" >&5
10269      d=$with_readdisplay/include
10270      if test -d $d; then
10271        X_CFLAGS="-I$d $X_CFLAGS"
10272        echo "$ac_t""$d" 1>&6
10273      else
10274        echo "$ac_t""not found ($d: no such directory)" 1>&6
10275      fi
10276
10277      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
10278 echo "configure:10290: checking for XReadDisplay libs" >&5
10279      d=$with_readdisplay/lib
10280      if test -d $d; then
10281        X_LIBS="-L$d $X_LIBS"
10282        echo "$ac_t""$d" 1>&6
10283      else
10284        echo "$ac_t""not found ($d: no such directory)" 1>&6
10285      fi
10286
10287      # replace the directory string with "yes".
10288      with_readdisplay_req="yes"
10289      with_readdisplay=$with_readdisplay_req
10290      ;;
10291
10292     *)
10293      echo ""
10294      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
10295      echo "       If it is a directory, then \`DIR/include' will be added to"
10296      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
10297      exit 1
10298      ;;
10299    esac
10300   
10301
10302 if test "$with_readdisplay" = yes; then
10303   
10304   ac_save_CPPFLAGS="$CPPFLAGS"
10305   if test \! -z "$includedir" ; then 
10306     CPPFLAGS="$CPPFLAGS -I$includedir"
10307   fi
10308   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10309   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
10310 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
10311 echo "configure:10323: checking for X11/extensions/readdisplay.h" >&5
10312 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10313   echo $ac_n "(cached) $ac_c" 1>&6
10314 else
10315   cat > conftest.$ac_ext <<EOF
10316 #line 10328 "configure"
10317 #include "confdefs.h"
10318 #include <X11/extensions/readdisplay.h>
10319 EOF
10320 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10321 { (eval echo configure:10333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10322 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10323 if test -z "$ac_err"; then
10324   rm -rf conftest*
10325   eval "ac_cv_header_$ac_safe=yes"
10326 else
10327   echo "$ac_err" >&5
10328   echo "configure: failed program was:" >&5
10329   cat conftest.$ac_ext >&5
10330   rm -rf conftest*
10331   eval "ac_cv_header_$ac_safe=no"
10332 fi
10333 rm -f conftest*
10334 fi
10335 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10336   echo "$ac_t""yes" 1>&6
10337   cat >> confdefs.h <<\EOF
10338 #define HAVE_READ_DISPLAY_EXTENSION 1
10339 EOF
10340
10341 else
10342   echo "$ac_t""no" 1>&6
10343 fi
10344
10345   CPPFLAGS="$ac_save_CPPFLAGS"
10346 elif test "$with_readdisplay" != no; then
10347   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
10348   exit 1
10349 fi
10350
10351
10352 ###############################################################################
10353 #
10354 #       Check for a program to generate random text.
10355 #
10356 #       Zippy is funnier than the idiocy generally spat out by `fortune',
10357 #       so first see if "fortune zippy" works.  Else, use plain "fortune".
10358 #
10359 #       We used to dig around in Emacs to look for the "yow" program, but
10360 #       most people who have Emacs also have "fortune zippy", so nevermind.
10361 #
10362 ###############################################################################
10363
10364 with_fortune_req=""
10365 # Check whether --with-fortune or --without-fortune was given.
10366 if test "${with_fortune+set}" = set; then
10367   withval="$with_fortune"
10368   with_fortune_req="$withval"; with_fortune="$withval"
10369 else
10370   with_fortune=yes
10371 fi
10372
10373
10374 if test "$with_fortune" = no || test "$with_fortune" = yes ; then
10375   with_fortune=""
10376   with_fortune_req=""
10377 fi
10378
10379 if test -n "$with_fortune_req" ; then
10380   ac_cv_fortune_program=""
10381   case "$with_fortune_req" in
10382     /*)
10383
10384       set dummy $with_fortune_req ; fortune_tmp=$2
10385       echo $ac_n "checking for $fortune_tmp""... $ac_c" 1>&6
10386 echo "configure:10398: checking for $fortune_tmp" >&5
10387       if test -x "$fortune_tmp" ; then
10388         echo "$ac_t""yes" 1>&6
10389       else
10390         echo "$ac_t""no" 1>&6
10391         with_fortune=""
10392       fi
10393     ;;
10394     *)
10395       set dummy $with_fortune_req ; fortune_tmp=$2
10396       # don't cache
10397       unset ac_cv_path_fortune_tmp
10398       # Extract the first word of "$fortune_tmp", so it can be a program name with args.
10399 set dummy $fortune_tmp; ac_word=$2
10400 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
10401 echo "configure:10413: checking for $ac_word" >&5
10402 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
10403   echo $ac_n "(cached) $ac_c" 1>&6
10404 else
10405   case "$fortune_tmp" in
10406   /*)
10407   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
10408   ;;
10409   ?:/*)                  
10410   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
10411   ;;
10412   *)
10413   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
10414   ac_dummy="$PATH"
10415   for ac_dir in $ac_dummy; do 
10416     test -z "$ac_dir" && ac_dir=.
10417     if test -f $ac_dir/$ac_word; then
10418       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
10419       break
10420     fi
10421   done
10422   IFS="$ac_save_ifs"
10423   ;;
10424 esac
10425 fi
10426 fortune_tmp="$ac_cv_path_fortune_tmp"
10427 if test -n "$fortune_tmp"; then
10428   echo "$ac_t""$fortune_tmp" 1>&6
10429 else
10430   echo "$ac_t""no" 1>&6
10431 fi
10432
10433       if test -z "$fortune_tmp" ; then
10434         with_fortune=""
10435       fi
10436     ;;
10437   esac
10438   ac_cv_fortune_program="$with_fortune"
10439
10440 elif test -n "$ac_cv_fortune_program"; then
10441   echo "$ac_t""checking for fortune... (cached) $ac_cv_fortune_program" 1>&6
10442 fi
10443
10444 unset ac_cv_path_fortune_tmp
10445 unset fortune_tmp
10446
10447 if test -z "$ac_cv_fortune_program" ; then
10448
10449   # first look for fortune in /usr/games/ (and use absolute path)
10450   for ac_prog in fortune
10451 do
10452 # Extract the first word of "$ac_prog", so it can be a program name with args.
10453 set dummy $ac_prog; ac_word=$2
10454 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
10455 echo "configure:10467: checking for $ac_word" >&5
10456 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
10457   echo $ac_n "(cached) $ac_c" 1>&6
10458 else
10459   case "$fortune_tmp" in
10460   /*)
10461   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
10462   ;;
10463   ?:/*)                  
10464   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
10465   ;;
10466   *)
10467   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
10468   ac_dummy=""/usr/games""
10469   for ac_dir in $ac_dummy; do 
10470     test -z "$ac_dir" && ac_dir=.
10471     if test -f $ac_dir/$ac_word; then
10472       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
10473       break
10474     fi
10475   done
10476   IFS="$ac_save_ifs"
10477   ;;
10478 esac
10479 fi
10480 fortune_tmp="$ac_cv_path_fortune_tmp"
10481 if test -n "$fortune_tmp"; then
10482   echo "$ac_t""$fortune_tmp" 1>&6
10483 else
10484   echo "$ac_t""no" 1>&6
10485 fi
10486
10487 test -n "$fortune_tmp" && break
10488 done
10489
10490
10491   # if it's not there, look on $PATH (and don't use absolute path)
10492   if test -z "$fortune_tmp" ; then
10493      for ac_prog in fortune
10494 do
10495 # Extract the first word of "$ac_prog", so it can be a program name with args.
10496 set dummy $ac_prog; ac_word=$2
10497 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
10498 echo "configure:10510: checking for $ac_word" >&5
10499 if eval "test \"`echo '$''{'ac_cv_prog_fortune_tmp'+set}'`\" = set"; then
10500   echo $ac_n "(cached) $ac_c" 1>&6
10501 else
10502   if test -n "$fortune_tmp"; then
10503   ac_cv_prog_fortune_tmp="$fortune_tmp" # Let the user override the test.
10504 else
10505   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
10506   ac_dummy="$PATH"
10507   for ac_dir in $ac_dummy; do
10508     test -z "$ac_dir" && ac_dir=.
10509     if test -f $ac_dir/$ac_word; then
10510       ac_cv_prog_fortune_tmp="$ac_prog"
10511       break
10512     fi
10513   done
10514   IFS="$ac_save_ifs"
10515 fi
10516 fi
10517 fortune_tmp="$ac_cv_prog_fortune_tmp"
10518 if test -n "$fortune_tmp"; then
10519   echo "$ac_t""$fortune_tmp" 1>&6
10520 else
10521   echo "$ac_t""no" 1>&6
10522 fi
10523
10524 test -n "$fortune_tmp" && break
10525 done
10526
10527   fi
10528
10529   # if we didn't find anything, then just assume /usr/games/
10530   if test -z "$fortune_tmp" ; then
10531      fortune_tmp="/usr/games/fortune"
10532   fi
10533
10534   ac_cv_fortune_program="$fortune_tmp"
10535
10536   # now check to see whether "fortune zippy" works.
10537   #
10538   fortune_tmp="$fortune_tmp zippy"
10539   echo $ac_n "checking for zippy quotes""... $ac_c" 1>&6
10540 echo "configure:10552: checking for zippy quotes" >&5
10541   if ( $fortune_tmp >/dev/null 2>&1 ); then
10542     ac_cv_fortune_program="$fortune_tmp"
10543     echo "$ac_t""$fortune_tmp" 1>&6
10544   else
10545     echo "$ac_t""no" 1>&6
10546   fi
10547
10548 fi
10549
10550 unset ac_cv_path_fortune_tmp
10551 unset fortune_tmp
10552
10553 cat >> confdefs.h <<EOF
10554 #define FORTUNE_PROGRAM "$ac_cv_fortune_program"
10555 EOF
10556
10557
10558
10559 ###############################################################################
10560 #
10561 #       Check whether it's ok to install some hacks as setuid (e.g., "sonar")
10562 #       This should be safe, but let's give people the option.
10563 #
10564 ###############################################################################
10565
10566 setuid_hacks_default=no
10567 setuid_hacks="$setuid_hacks_default"
10568 # Check whether --with-setuid-hacks or --without-setuid-hacks was given.
10569 if test "${with_setuid_hacks+set}" = set; then
10570   withval="$with_setuid_hacks"
10571   setuid_hacks="$withval"
10572 else
10573   setuid_hacks="$setuid_hacks_default"
10574 fi
10575
10576
10577
10578    case "$setuid_hacks" in
10579     yes) ;;
10580     no)  ;;
10581
10582     /*)
10583      echo $ac_n "checking for setuid hacks headers""... $ac_c" 1>&6
10584 echo "configure:10596: checking for setuid hacks headers" >&5
10585      d=$setuid_hacks/include
10586      if test -d $d; then
10587        X_CFLAGS="-I$d $X_CFLAGS"
10588        echo "$ac_t""$d" 1>&6
10589      else
10590        echo "$ac_t""not found ($d: no such directory)" 1>&6
10591      fi
10592
10593      echo $ac_n "checking for setuid hacks libs""... $ac_c" 1>&6
10594 echo "configure:10606: checking for setuid hacks libs" >&5
10595      d=$setuid_hacks/lib
10596      if test -d $d; then
10597        X_LIBS="-L$d $X_LIBS"
10598        echo "$ac_t""$d" 1>&6
10599      else
10600        echo "$ac_t""not found ($d: no such directory)" 1>&6
10601      fi
10602
10603      # replace the directory string with "yes".
10604      setuid_hacks_req="yes"
10605      setuid_hacks=$setuid_hacks_req
10606      ;;
10607
10608     *)
10609      echo ""
10610      echo "error: argument to --with-setuid-hacks must be \"yes\", \"no\", or a directory."
10611      echo "       If it is a directory, then \`DIR/include' will be added to"
10612      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
10613      exit 1
10614      ;;
10615    esac
10616   
10617
10618 if test "$setuid_hacks" = yes; then
10619   true
10620 elif test "$setuid_hacks" != no; then
10621   echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
10622   exit 1
10623 fi
10624
10625
10626 ###############################################################################
10627 #
10628 #       Done testing.  Now, set up the various -I and -L variables,
10629 #       and decide which GUI program to build by default.
10630 #
10631 ###############################################################################
10632
10633 DEPEND=makedepend
10634 DEPEND_FLAGS=
10635 DEPEND_DEFINES=
10636
10637
10638 if test \! -z "$includedir" ; then 
10639   INCLUDES="$INCLUDES -I$includedir"
10640 fi
10641
10642 if test \! -z "$libdir" ; then
10643   LDFLAGS="$LDFLAGS -L$libdir"
10644 fi
10645
10646
10647 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
10648 ALL_DEMO_PROGRAMS=
10649 if test "$have_motif" = yes; then
10650   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
10651   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
10652 fi
10653 if test "$have_gtk" = yes; then
10654   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
10655   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
10656 fi
10657
10658
10659 if test "$have_kerberos" = yes; then
10660   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
10661   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
10662 fi
10663 if test "$have_pam" = yes; then
10664   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
10665   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
10666   INSTALL_PAM="install-pam"
10667 fi
10668   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
10669   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
10670
10671
10672 if test "$enable_locking" = yes; then
10673   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
10674   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
10675 else
10676   LOCK_SRCS='$(NOLOCK_SRCS_1)'
10677   LOCK_OBJS='$(NOLOCK_OBJS_1)'
10678 fi
10679
10680 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
10681
10682 if test "$need_setuid" = yes; then
10683   NEED_SETUID=yes
10684 else
10685   NEED_SETUID=no
10686 fi
10687
10688 if test "$setuid_hacks" = yes; then
10689   SETUID_HACKS=yes
10690 else
10691   SETUID_HACKS=no
10692 fi
10693
10694 tab='   '
10695 if test "$have_gl" = yes; then
10696   GL_EXES='$(GL_EXES)'
10697   GL_UTIL_EXES='$(GL_UTIL_EXES)'
10698   GL_MEN='$(GL_MEN)'
10699   GL_KLUDGE="${tab}  "
10700 else
10701   GL_KLUDGE="-${tab}  "
10702 fi
10703
10704 if test "$have_gle" = yes; then
10705   GLE_EXES='$(GLE_EXES)'
10706   GLE_MEN='$(GLE_MEN)'
10707   GLE_KLUDGE="${tab}   "
10708 else
10709   GLE_KLUDGE="-${tab}   "
10710 fi
10711
10712 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
10713  JPEG_EXES='$(JPEG_EXES)'
10714 fi
10715
10716
10717 # Another substitution in the XScreenSaver.ad.in file:
10718 #
10719 if test "$have_gnome_help" = yes; then
10720   GNOMEHELP_Y=''
10721   GNOMEHELP_N='!    '
10722 else
10723   GNOMEHELP_Y='!    '
10724   GNOMEHELP_N=''
10725 fi
10726
10727
10728 # Now that we know whether we have Gnome, we can decide where the XML
10729 # config files get installed.
10730 #
10731 if test -z "$HACK_CONF_DIR" ; then
10732   if test -n "$GNOME_DATADIR" ; then
10733     HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
10734   else
10735     HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
10736   fi
10737 fi
10738
10739
10740
10741 # After computing $HACK_CONF_DIR, make sure $GTK_ICONDIR has a value
10742 # so that we know where to install the Gtk pixmaps.
10743 #
10744 if test -n "$GNOME_DATADIR" ; then
10745   GTK_ICONDIR='$(GNOME_DATADIR)/pixmaps'
10746 elif test "$have_gtk" = yes; then
10747   # should this be "$(prefix)/share/pixmaps"? But /usr/X11R6/share/ is wrong...
10748   GTK_ICONDIR='/usr/share/pixmaps'
10749 else
10750   GTK_ICONDIR=''
10751 fi
10752
10753
10754 # canonicalize slashes.
10755 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
10756
10757
10758
10759 ###############################################################################
10760 #
10761 #       Perform substitutions and write Makefiles.
10762 #
10763 ###############################################################################
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811 APPDEFAULTS=$ac_x_app_defaults
10812
10813
10814
10815
10816
10817
10818
10819 trap '' 1 2 15
10820 cat > confcache <<\EOF
10821 # This file is a shell script that caches the results of configure
10822 # tests run on this system so they can be shared between configure
10823 # scripts and configure runs.  It is not useful on other systems.
10824 # If it contains results you don't want to keep, you may remove or edit it.
10825 #
10826 # By default, configure uses ./config.cache as the cache file,
10827 # creating it if it does not exist already.  You can give configure
10828 # the --cache-file=FILE option to use a different cache file; that is
10829 # what configure does when it calls configure scripts in
10830 # subdirectories, so they share the cache.
10831 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10832 # config.status only pays attention to the cache file if you give it the
10833 # --recheck option to rerun configure.
10834 #
10835 EOF
10836 # The following way of writing the cache mishandles newlines in values,
10837 # but we know of no workaround that is simple, portable, and efficient.
10838 # So, don't put newlines in cache variables' values.
10839 # Ultrix sh set writes to stderr and can't be redirected directly,
10840 # and sets the high bit in the cache file unless we assign to the vars.
10841 (set) 2>&1 |
10842   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10843   *ac_space=\ *)
10844     # `set' does not quote correctly, so add quotes (double-quote substitution
10845     # turns \\\\ into \\, and sed turns \\ into \).
10846     sed -n \
10847       -e "s/'/'\\\\''/g" \
10848       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10849     ;;
10850   *)
10851     # `set' quotes correctly as required by POSIX, so do not add quotes.
10852     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10853     ;;
10854   esac >> confcache
10855 if cmp -s $cache_file confcache; then
10856   :
10857 else
10858   if test -w $cache_file; then
10859     echo "updating cache $cache_file"
10860     cat confcache > $cache_file
10861   else
10862     echo "not updating unwritable cache $cache_file"
10863   fi
10864 fi
10865 rm -f confcache
10866
10867 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10868
10869 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10870 # Let make expand exec_prefix.
10871 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10872
10873 # Any assignment to VPATH causes Sun make to only execute
10874 # the first set of double-colon rules, so remove it if not needed.
10875 # If there is a colon in the path, we need to keep it.
10876 if test "x$srcdir" = x.; then
10877   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10878 fi
10879
10880 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10881
10882 DEFS=-DHAVE_CONFIG_H
10883
10884 # Without the "./", some shells look in PATH for config.status.
10885 : ${CONFIG_STATUS=./config.status}
10886
10887 echo creating $CONFIG_STATUS
10888 rm -f $CONFIG_STATUS
10889 cat > $CONFIG_STATUS <<EOF
10890 #! /bin/sh
10891 # Generated automatically by configure.
10892 # Run this file to recreate the current configuration.
10893 # This directory was configured as follows,
10894 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10895 #
10896 # $0 $ac_configure_args
10897 #
10898 # Compiler output produced by configure, useful for debugging
10899 # configure, is in ./config.log if it exists.
10900
10901 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10902 for ac_option
10903 do
10904   case "\$ac_option" in
10905   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10906     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10907     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10908   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10909     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10910     exit 0 ;;
10911   -help | --help | --hel | --he | --h)
10912     echo "\$ac_cs_usage"; exit 0 ;;
10913   *) echo "\$ac_cs_usage"; exit 1 ;;
10914   esac
10915 done
10916
10917 ac_given_srcdir=$srcdir
10918 ac_given_INSTALL="$INSTALL"
10919
10920 trap 'rm -fr `echo "Makefile
10921           utils/Makefile
10922           driver/Makefile
10923           hacks/Makefile
10924           hacks/glx/Makefile
10925           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10926 EOF
10927 cat >> $CONFIG_STATUS <<EOF
10928
10929 # Protect against being on the right side of a sed subst in config.status.
10930 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10931  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10932 $ac_vpsub
10933 $extrasub
10934 s%@SHELL@%$SHELL%g
10935 s%@CFLAGS@%$CFLAGS%g
10936 s%@CPPFLAGS@%$CPPFLAGS%g
10937 s%@CXXFLAGS@%$CXXFLAGS%g
10938 s%@FFLAGS@%$FFLAGS%g
10939 s%@DEFS@%$DEFS%g
10940 s%@LDFLAGS@%$LDFLAGS%g
10941 s%@LIBS@%$LIBS%g
10942 s%@exec_prefix@%$exec_prefix%g
10943 s%@prefix@%$prefix%g
10944 s%@program_transform_name@%$program_transform_name%g
10945 s%@bindir@%$bindir%g
10946 s%@sbindir@%$sbindir%g
10947 s%@libexecdir@%$libexecdir%g
10948 s%@datadir@%$datadir%g
10949 s%@sysconfdir@%$sysconfdir%g
10950 s%@sharedstatedir@%$sharedstatedir%g
10951 s%@localstatedir@%$localstatedir%g
10952 s%@libdir@%$libdir%g
10953 s%@includedir@%$includedir%g
10954 s%@oldincludedir@%$oldincludedir%g
10955 s%@infodir@%$infodir%g
10956 s%@mandir@%$mandir%g
10957 s%@host@%$host%g
10958 s%@host_alias@%$host_alias%g
10959 s%@host_cpu@%$host_cpu%g
10960 s%@host_vendor@%$host_vendor%g
10961 s%@host_os@%$host_os%g
10962 s%@CC@%$CC%g
10963 s%@CPP@%$CPP%g
10964 s%@EXEEXT@%$EXEEXT%g
10965 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10966 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10967 s%@INSTALL_DATA@%$INSTALL_DATA%g
10968 s%@SET_MAKE@%$SET_MAKE%g
10969 s%@PERL@%$PERL%g
10970 s%@X_CFLAGS@%$X_CFLAGS%g
10971 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
10972 s%@X_LIBS@%$X_LIBS%g
10973 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
10974 s%@glib_config@%$glib_config%g
10975 s%@gtk_config@%$gtk_config%g
10976 s%@gnome_config@%$gnome_config%g
10977 s%@have_gnome_help@%$have_gnome_help%g
10978 s%@xml_config@%$xml_config%g
10979 s%@gdk_pixbuf_config@%$gdk_pixbuf_config%g
10980 s%@fortune_tmp@%$fortune_tmp%g
10981 s%@INCLUDES@%$INCLUDES%g
10982 s%@PREFERRED_DEMO_PROGRAM@%$PREFERRED_DEMO_PROGRAM%g
10983 s%@ALL_DEMO_PROGRAMS@%$ALL_DEMO_PROGRAMS%g
10984 s%@SAVER_LIBS@%$SAVER_LIBS%g
10985 s%@MOTIF_LIBS@%$MOTIF_LIBS%g
10986 s%@GTK_LIBS@%$GTK_LIBS%g
10987 s%@XML_LIBS@%$XML_LIBS%g
10988 s%@JPEG_LIBS@%$JPEG_LIBS%g
10989 s%@HACK_LIBS@%$HACK_LIBS%g
10990 s%@XPM_LIBS@%$XPM_LIBS%g
10991 s%@GL_LIBS@%$GL_LIBS%g
10992 s%@GLE_LIBS@%$GLE_LIBS%g
10993 s%@XDPMS_LIBS@%$XDPMS_LIBS%g
10994 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
10995 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
10996 s%@SETUID_HACKS@%$SETUID_HACKS%g
10997 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
10998 s%@NEED_SETUID@%$NEED_SETUID%g
10999 s%@INSTALL_PAM@%$INSTALL_PAM%g
11000 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
11001 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
11002 s%@XMU_SRCS@%$XMU_SRCS%g
11003 s%@XMU_OBJS@%$XMU_OBJS%g
11004 s%@XMU_LIBS@%$XMU_LIBS%g
11005 s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
11006 s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
11007 s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
11008 s%@LOCK_SRCS@%$LOCK_SRCS%g
11009 s%@LOCK_OBJS@%$LOCK_OBJS%g
11010 s%@JPEG_EXES@%$JPEG_EXES%g
11011 s%@GL_EXES@%$GL_EXES%g
11012 s%@GL_UTIL_EXES@%$GL_UTIL_EXES%g
11013 s%@GL_MEN@%$GL_MEN%g
11014 s%@GL_KLUDGE@%$GL_KLUDGE%g
11015 s%@GLE_EXES@%$GLE_EXES%g
11016 s%@GLE_MEN@%$GLE_MEN%g
11017 s%@GLE_KLUDGE@%$GLE_KLUDGE%g
11018 s%@GNOMEHELP_Y@%$GNOMEHELP_Y%g
11019 s%@GNOMEHELP_N@%$GNOMEHELP_N%g
11020 s%@HACKDIR@%$HACKDIR%g
11021 s%@GNOME_DATADIR@%$GNOME_DATADIR%g
11022 s%@GTK_ICONDIR@%$GTK_ICONDIR%g
11023 s%@HACK_CONF_DIR@%$HACK_CONF_DIR%g
11024 s%@APPDEFAULTS@%$APPDEFAULTS%g
11025 s%@DEPEND@%$DEPEND%g
11026 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
11027 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
11028
11029 CEOF
11030 EOF
11031
11032 cat >> $CONFIG_STATUS <<\EOF
11033
11034 # Split the substitutions into bite-sized pieces for seds with
11035 # small command number limits, like on Digital OSF/1 and HP-UX.
11036 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11037 ac_file=1 # Number of current file.
11038 ac_beg=1 # First line for current file.
11039 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11040 ac_more_lines=:
11041 ac_sed_cmds=""
11042 while $ac_more_lines; do
11043   if test $ac_beg -gt 1; then
11044     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11045   else
11046     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11047   fi
11048   if test ! -s conftest.s$ac_file; then
11049     ac_more_lines=false
11050     rm -f conftest.s$ac_file
11051   else
11052     if test -z "$ac_sed_cmds"; then
11053       ac_sed_cmds="sed -f conftest.s$ac_file"
11054     else
11055       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11056     fi
11057     ac_file=`expr $ac_file + 1`
11058     ac_beg=$ac_end
11059     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11060   fi
11061 done
11062 if test -z "$ac_sed_cmds"; then
11063   ac_sed_cmds=cat
11064 fi
11065 EOF
11066
11067 cat >> $CONFIG_STATUS <<EOF
11068
11069 CONFIG_FILES=\${CONFIG_FILES-"Makefile
11070           utils/Makefile
11071           driver/Makefile
11072           hacks/Makefile
11073           hacks/glx/Makefile
11074           driver/XScreenSaver.ad"}
11075 EOF
11076 cat >> $CONFIG_STATUS <<\EOF
11077 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11078   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11079   case "$ac_file" in
11080   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11081        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11082   *) ac_file_in="${ac_file}.in" ;;
11083   esac
11084
11085   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11086
11087   # Remove last slash and all that follows it.  Not all systems have dirname.
11088   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11089   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11090     # The file is in a subdirectory.
11091     test ! -d "$ac_dir" && mkdir "$ac_dir"
11092     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11093     # A "../" for each directory in $ac_dir_suffix.
11094     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11095   else
11096     ac_dir_suffix= ac_dots=
11097   fi
11098
11099   case "$ac_given_srcdir" in
11100   .)  srcdir=.
11101       if test -z "$ac_dots"; then top_srcdir=.
11102       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11103   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11104   *) # Relative path.
11105     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11106     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11107   esac
11108
11109   case "$ac_given_INSTALL" in
11110   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11111   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11112   esac
11113
11114   echo creating "$ac_file"
11115   rm -f "$ac_file"
11116   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11117   case "$ac_file" in
11118   *Makefile*) ac_comsub="1i\\
11119 # $configure_input" ;;
11120   *) ac_comsub= ;;
11121   esac
11122
11123   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11124   sed -e "$ac_comsub
11125 s%@configure_input@%$configure_input%g
11126 s%@srcdir@%$srcdir%g
11127 s%@top_srcdir@%$top_srcdir%g
11128 s%@INSTALL@%$INSTALL%g
11129 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11130 fi; done
11131 rm -f conftest.s*
11132
11133 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11134 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11135 #
11136 # ac_d sets the value in "#define NAME VALUE" lines.
11137 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11138 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
11139 ac_dC='\3'
11140 ac_dD='%g'
11141 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11142 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11143 ac_uB='\([      ]\)%\1#\2define\3'
11144 ac_uC=' '
11145 ac_uD='\4%g'
11146 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11147 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11148 ac_eB='$%\1#\2define\3'
11149 ac_eC=' '
11150 ac_eD='%g'
11151
11152 if test "${CONFIG_HEADERS+set}" != set; then
11153 EOF
11154 cat >> $CONFIG_STATUS <<EOF
11155   CONFIG_HEADERS="config.h"
11156 EOF
11157 cat >> $CONFIG_STATUS <<\EOF
11158 fi
11159 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
11160   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11161   case "$ac_file" in
11162   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11163        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11164   *) ac_file_in="${ac_file}.in" ;;
11165   esac
11166
11167   echo creating $ac_file
11168
11169   rm -f conftest.frag conftest.in conftest.out
11170   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11171   cat $ac_file_inputs > conftest.in
11172
11173 EOF
11174
11175 # Transform confdefs.h into a sed script conftest.vals that substitutes
11176 # the proper values into config.h.in to produce config.h.  And first:
11177 # Protect against being on the right side of a sed subst in config.status.
11178 # Protect against being in an unquoted here document in config.status.
11179 rm -f conftest.vals
11180 cat > conftest.hdr <<\EOF
11181 s/[\\&%]/\\&/g
11182 s%[\\$`]%\\&%g
11183 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
11184 s%ac_d%ac_u%gp
11185 s%ac_u%ac_e%gp
11186 EOF
11187 sed -n -f conftest.hdr confdefs.h > conftest.vals
11188 rm -f conftest.hdr
11189
11190 # This sed command replaces #undef with comments.  This is necessary, for
11191 # example, in the case of _POSIX_SOURCE, which is predefined and required
11192 # on some systems where configure will not decide to define it.
11193 cat >> conftest.vals <<\EOF
11194 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
11195 EOF
11196
11197 # Break up conftest.vals because some shells have a limit on
11198 # the size of here documents, and old seds have small limits too.
11199
11200 rm -f conftest.tail
11201 while :
11202 do
11203   ac_lines=`grep -c . conftest.vals`
11204   # grep -c gives empty output for an empty file on some AIX systems.
11205   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
11206   # Write a limited-size here document to conftest.frag.
11207   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
11208   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
11209   echo 'CEOF
11210   sed -f conftest.frag conftest.in > conftest.out
11211   rm -f conftest.in
11212   mv conftest.out conftest.in
11213 ' >> $CONFIG_STATUS
11214   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11215   rm -f conftest.vals
11216   mv conftest.tail conftest.vals
11217 done
11218 rm -f conftest.vals
11219
11220 cat >> $CONFIG_STATUS <<\EOF
11221   rm -f conftest.frag conftest.h
11222   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
11223   cat conftest.in >> conftest.h
11224   rm -f conftest.in
11225   if cmp -s $ac_file conftest.h 2>/dev/null; then
11226     echo "$ac_file is unchanged"
11227     rm -f conftest.h
11228   else
11229     # Remove last slash and all that follows it.  Not all systems have dirname.
11230       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11231       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11232       # The file is in a subdirectory.
11233       test ! -d "$ac_dir" && mkdir "$ac_dir"
11234     fi
11235     rm -f $ac_file
11236     mv conftest.h $ac_file
11237   fi
11238 fi; done
11239
11240 EOF
11241 cat >> $CONFIG_STATUS <<EOF
11242
11243 EOF
11244 cat >> $CONFIG_STATUS <<\EOF
11245
11246 exit 0
11247 EOF
11248 chmod +x $CONFIG_STATUS
11249 rm -fr confdefs* $ac_clean_files
11250 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
11251
11252
11253 ###############################################################################
11254 #
11255 #       Print some warnings at the end.
11256 #
11257 ###############################################################################
11258
11259 warn_prefix_1="    Warning:"
11260 warn_prefix_2="       Note:"
11261 warn_prefix="$warn_prefix_1"
11262
11263 warning=no
11264 warnsep='    #################################################################'
11265
11266 warnpre() {
11267   if test "$warning" = no ; then
11268     echo '' ; echo "$warnsep" ; echo ''
11269     warning=yes
11270   fi
11271 }
11272
11273 warn() {
11274   warnpre
11275   if test "$warning" = long ; then echo '' ; fi
11276   warning=yes
11277   rest="$@"
11278   echo "$warn_prefix $rest"
11279 }
11280
11281 warnL() {
11282   was=$warning
11283   warnpre
11284   warning=yes
11285   if test "$was" != no ; then echo '' ; fi
11286   rest="$@"
11287   echo "$warn_prefix $rest"
11288 }
11289
11290 warn2() {
11291   rest="$@"
11292   echo "             $rest"
11293   warning=long
11294 }
11295
11296 note() {
11297   warn_prefix="$warn_prefix_2"
11298   warn $@
11299   warn_prefix="$warn_prefix_1"
11300 }
11301
11302 noteL() {
11303   warn_prefix="$warn_prefix_2"
11304   warnL $@
11305   warn_prefix="$warn_prefix_1"
11306 }
11307
11308
11309 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
11310   warn 'The SGI saver extension was requested, but was not found.'
11311 fi
11312
11313 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
11314   warn 'The MIT saver extension was requested, but was not found.'
11315 fi
11316
11317 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
11318   warn 'The XIdle extension was requested, but was not found.'
11319 fi
11320
11321 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
11322   warn 'The XSHM extension was requested, but was not found.'
11323 fi
11324
11325 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
11326   warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
11327 fi
11328
11329 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
11330   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
11331 fi
11332
11333 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
11334   warn 'The DPMS extension was requested, but was not found.'
11335 fi
11336
11337 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
11338   warn 'The Xinerama extension was requested, but was not found.'
11339 fi
11340
11341 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
11342   warn 'The XF86VMODE extension was requested, but was not found.'
11343 fi
11344
11345 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
11346   warn "Checking of /proc/interrupts was requested, but it's bogus."
11347 fi
11348
11349
11350 if test "$have_motif" = no -a "$have_gtk" = no; then
11351   warnL "Neither Motif nor Gtk seem to be available;"
11352   warn2 "the \`xscreensaver-demo' program requires one of these."
11353
11354 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
11355   warnL "Use of Motif was requested, but it wasn't found;"
11356   warn2 "Gtk will be used instead."
11357
11358 elif test "$jurassic_gtk" = yes ; then
11359
11360   pref_gtk=1.2
11361
11362   v="$ac_gtk_version_string"
11363   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
11364     warnL "Use of Gtk was requested, but its version number is unknown;"
11365   elif test "$with_gtk_req" = yes ; then
11366     warnL "Use of Gtk was requested, but it is version $v;"
11367   else
11368     warnL "Gtk was found on this system, but it is version $v;"
11369   fi
11370
11371   warn2 "Gtk $pref_gtk or newer is required.  Motif will be used instead."
11372
11373 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
11374   warnL "Use of Gtk was requested, but it wasn't found;"
11375   warn2 "Motif will be used instead."
11376
11377 fi
11378
11379
11380 if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
11381   warn  'Use of the Gnome Control Panel was requested, but the necessary'
11382   warn2 'headers and/or libraries were not found.'
11383 fi
11384
11385 if test "$have_gtk" = yes ; then
11386   if test "$have_xml" = no ; then
11387     if test "$with_xml_req" = yes ; then
11388       warn  'Use of the XML library was requested, but the necessary'
11389       warn2 'headers and/or libraries were not found.'
11390     else
11391       warn  'GTK is being used, but the XML library was not found.'
11392     fi
11393
11394     if test "$xml_halfassed" = yes ; then
11395       echo ''
11396       warn2 'More specifically, we found the headers, but not the'
11397       warn2 'libraries; so either XML is half-installed on this'
11398       warn2 "system, or something else went wrong.  The \`config.log'"
11399       warn2 'file might contain some clues.'
11400     fi
11401
11402     echo ''
11403     warn2 "Without XML, the per-display-mode \`Settings' dialogs"
11404     warn2 'will not be available.  Specify the location of the XML'
11405     warn2 'library through the --with-xml option to configure.'
11406   fi
11407 fi
11408
11409 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
11410
11411   preferred_lesstif=0.92
11412
11413   if test "$lesstif_version" = unknown; then
11414     warnL "Unable to determine the LessTif version number!"
11415     warn2 "Make sure you are using version $preferred_lesstif or newer."
11416     warn2 "See <http://www.lesstif.org/>."
11417
11418   elif test \! $lesstif_version -gt 82; then
11419     warnL "LessTif version $lesstif_version_string is being used."
11420     warn2 "LessTif versions 0.82 and earlier are too buggy to"
11421     warn2 "use with XScreenSaver; it is strongly recommended"
11422     warn2 "that you upgrade to at least version $preferred_lesstif!"
11423     warn2 "See <http://www.lesstif.org/>."
11424   fi
11425 fi
11426
11427
11428 if test "$have_motif" = yes -a "$have_gtk" = no ; then
11429   warn  'Motif is being used, and GTK is not.'
11430   echo  ''
11431   warn2 'Though the Motif front-end to xscreensaver is still'
11432   warn2 'maintained, it is no longer being updated with new'
11433   warn2 'features: all new development on the xscreensaver-demo'
11434   warn2 'program is happening in the GTK version, and not in the'
11435   warn2 'Motif version.  It is recommended that you build against'
11436   warn2 'GTK instead of Motif.  See <http://www.gtk.org/>.'
11437 fi
11438
11439
11440 if test "$with_xpm_req" = yes -a "$have_xpm" = no; then
11441   warnL 'Use of XPM was requested, but it was not found.'
11442 fi
11443
11444 if test "$with_gdk_pixbuf_req" = yes  -a "$have_gdk_pixbuf" = no; then
11445   warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
11446 fi
11447
11448 if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
11449
11450   if test "$with_xpm_req" = yes ; then
11451     true
11452   elif test "$with_xpm_req" = no ; then
11453     warnL 'The XPM library is not being used.'
11454   else
11455     warnL 'The XPM library was not found.'
11456   fi
11457
11458   if test "$with_gdk_pixbuf_req" = yes ; then
11459     true
11460   elif test "$with_gdk_pixbuf_req" = no ; then
11461     warnL 'The GDK-Pixbuf library is not being used.'
11462   else
11463     warnL 'The GDK-Pixbuf library was not found.'
11464   fi
11465
11466   if test "$gdk_pixbuf_halfassed" = yes ; then
11467     echo ''
11468     warn2 'More specifically, we found the headers, but not the'
11469     warn2 'libraries; so either GDK-Pixbuf is half-installed on this'
11470     warn2 "system, or something else went wrong.  The \`config.log'"
11471     warn2 'file might contain some clues.'
11472   fi
11473
11474   echo ''
11475   warn2 'Some of the demos will not be as colorful as they'
11476   warn2 'could be.  You should consider installing Pixbuf or'
11477   warn2 'XPM and re-running configure.  (Remember to delete'
11478   warn2 'the config.cache file first.)  The Pixbuf library is'
11479   warn2 'a part of GNOME.  The XPM library comes with most'
11480   warn2 'X11 installations; you can also find it at the X11'
11481   warn2 'archive sites, such as <http://sunsite.unc.edu/>.'
11482   echo  ''
11483   warn2 'GDK-Pixbuf is recommended over XPM, as it provides'
11484   warn2 'support for more image formats.'
11485 fi
11486
11487
11488 if test "$have_jpeg" = no ; then
11489   if test "$with_jpeg_req" = yes ; then
11490     warnL 'Use of libjpeg was requested, but it was not found.'
11491   elif test "$with_jpeg_req" = no ; then
11492     noteL 'The JPEG library is not being used.'
11493   else
11494     noteL 'The JPEG library was not found.'
11495   fi
11496
11497   if test "$jpeg_halfassed" = yes ; then
11498     echo ''
11499     warn2 'More specifically, we found the headers, but not the'
11500     warn2 'library; so either JPEG is half-installed on this'
11501     warn2 "system, or something else went wrong.  The \`config.log'"
11502     warn2 'file might contain some clues.'
11503     echo ''
11504   fi
11505
11506   warn2 "This means the \`webcollage' program will be much slower."
11507 fi
11508
11509
11510 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
11511   preferred_mesagl=3.4
11512   mgv="$ac_mesagl_version_string"
11513   pgl="$preferred_mesagl"
11514
11515   if test "$ac_mesagl_version" = unknown; then
11516     warnL "Unable to determine the MesaGL version number!"
11517     warn2 "Make sure you are using version $preferred_mesagl or newer."
11518
11519   elif test \! "$ac_mesagl_version" -gt 2006; then
11520     warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
11521     warn2 "have a security bug.  It is strongly recommended that you"
11522     warn2 "upgrade to at least version $preferred_mesagl."
11523
11524   elif test \! "$ac_mesagl_version" -gt 3003; then
11525     warnL "MesaGL version $mgv is being used.  That version has some"
11526     warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
11527   fi
11528 fi
11529
11530 if test "$have_gl" = no ; then
11531   if test "$with_gl_req" = yes ; then
11532     warnL 'Use of GL was requested, but it was not found.'
11533   elif test "$with_gl_req" = no ; then
11534     noteL 'The OpenGL 3D library is not being used.'
11535   else
11536     noteL 'The OpenGL 3D library was not found.'
11537   fi
11538
11539   if test "$gl_halfassed" = yes ; then
11540     echo ''
11541     warn2 'More specifically, we found the headers, but not the'
11542     warn2 'libraries; so either GL is half-installed on this'
11543     warn2 "system, or something else went wrong.  The \`config.log'"
11544     warn2 'file might contain some clues.'
11545   fi
11546
11547   echo ''
11548   warn2 'Those demos which use 3D will not be built or installed.'
11549   warn2 'You might want to consider installing OpenGL and'
11550   warn2 're-running configure.  (Remember to delete the'
11551   warn2 "config.cache file first.)  If your vendor doesn't ship"
11552   warn2 'their own implementation of OpenGL, you can get a free'
11553   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
11554   warn2 'info, see <http://www.opengl.org/>.'
11555
11556 fi
11557
11558
11559 if test "$have_gl" = yes -a "$have_gle" = no ; then
11560   if test "$with_gle_req" = yes ; then
11561     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
11562     warn2 'it was not found (though the OpenGL library was found, and'
11563     warn2 'is being used.)'
11564   elif test "$with_gle_req" = no ; then
11565     noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
11566     warn2 'library is not.'
11567   else
11568     noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
11569     warn2 'was not.'
11570   fi
11571
11572   if test "$gle_halfassed" = yes ; then
11573     echo ''
11574     warn2 'More specifically, we found the headers, but not the'
11575     warn2 'libraries; so either GLE is half-installed on this'
11576     warn2 "system, or something else went wrong.  The \`config.log'"
11577     warn2 'file might contain some clues.'
11578   fi
11579
11580   echo ''
11581   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
11582   warn2 'will not be built or installed.  You might want to consider'
11583   warn2 'installing GLE and re-running configure.  (Remember to delete'
11584   warn2 'the config.cache file first.)  You can find the GLE library'
11585   warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
11586   warn2 'see <http://www.opengl.org/>.'
11587
11588 fi
11589
11590
11591 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
11592   warn 'Use of XReadDisplay was requested, but it was not found.'
11593 fi
11594
11595 if test -n "$with_fortune_req"; then
11596   if test "$with_fortune_req" != "$ac_cv_fortune_program" ; then
11597     warnL "$with_fortune_req was requested as the Fortune program,"
11598     warn2 "but was not found.  The default will be used instead."
11599   fi
11600 fi
11601
11602 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
11603   warn 'Use of Kerberos was requested, but it was not found.'
11604 fi
11605
11606 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
11607   warn 'Use of PAM was requested, but it was not found.'
11608 fi
11609
11610 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
11611   warn 'Use of shadow passwords was requested, but they were not found.'
11612 fi
11613
11614
11615 # You are in a twisty maze of namespaces and syntaxes, all alike.
11616 # Fuck the skull of Unix.
11617 #
11618 eval bindir=${bindir}
11619 eval bindir=${bindir}
11620 eval bindir=${bindir}
11621 eval bindir=${bindir}
11622 eval bindir=${bindir}
11623 eval bindir=${bindir}
11624 eval HACKDIR=${HACKDIR}
11625 eval HACKDIR=${HACKDIR}
11626 eval HACKDIR=${HACKDIR}
11627 eval HACKDIR=${HACKDIR}
11628 eval HACKDIR=${HACKDIR}
11629 eval HACKDIR=${HACKDIR}
11630 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11631 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11632 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11633 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11634 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11635 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11636
11637 # canonicalize slashes.
11638 bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
11639 HACKDIR=`echo "${HACKDIR}"             | sed 's@/$@@;s@//*@/@g'`
11640 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
11641
11642
11643 # Sanity check the hackdir
11644 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
11645   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
11646     echo ""
11647     { echo "configure: error: \"--with-hackdir=${bindir}/${bad_choice}\" won't work.
11648                    There will be an executable installed with that name, so
11649                    that can't be the name of a directory as well.  Please
11650                    re-configure with a different directory name." 1>&2; exit 1; }
11651   fi
11652 done
11653
11654
11655 do_dir_warning=no
11656
11657 # Now let's see if there's a previous RPM version already installed.  Blargh!
11658
11659 # M4 sucks!!
11660
11661 rpmv=`(rpm -qv xscreensaver) 2>&- | \
11662       sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
11663
11664
11665 if test \! -z "$rpmv" ; then
11666   rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
11667   rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
11668
11669   warning=no
11670   warnL "There is already an installed RPM of xscreensaver $rpmv"
11671   warn2 "on this system.  You might want to remove it (with"
11672   warn2 '"rpm -ve xscreensaver") before running "make install"'
11673   warn2 "from this directory."
11674   echo ""
11675   warn2 "Alternately, you could build this version of xscreensaver"
11676   warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
11677   warn2 "file is included.  See the RPM documentation for more info."
11678   echo ""
11679
11680   if test "$rpmbdir" = "$rpmhdir" ; then
11681     warn2 "The RPM version was installed in $rpmbdir/."
11682   else
11683     warn2 "The RPM version was installed in $rpmbdir/,"
11684     warn2 "with demos in $rpmhdir/."
11685   fi
11686
11687   do_dir_warning=yes
11688 fi
11689
11690
11691 if test "${bindir}" = "${HACKDIR}" ; then
11692   do_dir_warning=yes
11693 fi
11694
11695 if test "$do_dir_warning" = yes; then
11696   echo ""
11697   echo "$warnsep"
11698   echo ""
11699   echo '      When you run "make install", the "xscreensaver",'
11700   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
11701   echo "      will be installed in ${bindir}/."
11702   echo ""
11703   echo "      The various graphics demos (140+ different executables) will"
11704   echo "      be installed in ${HACKDIR}/."
11705   echo ""
11706   echo "      If you would prefer the demos to be installed elsewhere,"
11707   echo "      you should re-run configure with the --with-hackdir=DIR"
11708   echo "      option.  For more information, run \`./configure --help'."
11709   warning=yes
11710 fi
11711
11712 if test "$warning" != no; then
11713   echo '' ; echo "$warnsep" ; echo ''
11714 fi
11715
11716 if test "$do_dir_warning" = no; then
11717   if test "$warning" = no; then
11718     echo ''
11719   fi
11720   echo "User programs will be installed in ${bindir}/"
11721   echo "Screen savers will be installed in ${HACKDIR}/"
11722   echo "Configuration will be installed in ${HACK_CONF_DIR}/"
11723   echo ''
11724 fi