http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.01.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 "
21 ac_help="$ac_help
22 "
23 ac_help="$ac_help
24   --with-configdir=DIR    Where to install the data files that describe each
25                           of the display modes to the GUI.
26                           Default: \`GNOMEPREFIX/control-center/screensavers/'
27                           or \`PREFIX/lib/xscreensaver/config/', depending on
28                           whether GNOME is available.
29 "
30 ac_help="$ac_help
31 Except where noted, all of the --with options below can also take a
32 directory argument: for example, \`--with-motif=/opt/Motif'.  That would
33 cause /opt/Motif/include/ to be added to the -I list, and /opt/Motif/lib/
34 to be added to the -L list, assuming those directories exist.  
35
36 By default, support for each of these options will be built in, if the
37 relevant library routines exist.  At run time, they will then be used
38 only if the X server being used supports them.  Each --with option has
39 a corresponding --without option, to override building support for them
40 at all.
41
42 Screen blanking and idle-detection options:
43
44   --with-sgi-ext          Include support for the SGI SCREEN_SAVER extension."
45 ac_help="$ac_help
46   --with-mit-ext          Include support for the MIT-SCREEN-SAVER extension."
47 ac_help="$ac_help
48   --with-xidle-ext        Include support for the XIDLE extension."
49 ac_help="$ac_help
50   --with-sgivc-ext        Include support for the SGI-VIDEO-CONTROL extension."
51 ac_help="$ac_help
52   --with-dpms-ext         Include support for the DPMS extension."
53 ac_help="$ac_help
54   --with-xinerama-ext     Include support for the XINERAMA extension."
55 ac_help="$ac_help
56   --with-xf86vmode-ext    Include support for XFree86 virtual screens."
57 ac_help="$ac_help
58   --with-xf86gamma-ext    Include support for XFree86 gamma fading."
59 ac_help="$ac_help
60   --with-proc-interrupts  Include support for consulting the /proc/interrupts
61                           file to notice keyboard activity."
62 ac_help="$ac_help
63
64 Screen locking options:
65
66   --enable-locking        Compile in support for locking the display.
67   --disable-locking       Do not allow locking at all.
68 "
69 ac_help="$ac_help
70   --with-pam              Include support for PAM (Pluggable Auth Modules.)"
71 ac_help="$ac_help
72   --with-kerberos         Include support for Kerberos authentication."
73 ac_help="$ac_help
74   --with-shadow           Include support for shadow password authentication."
75 ac_help="$ac_help
76
77 User interface options:
78
79   --with-motif            Use the Motif toolkit for the user interface."
80 ac_help="$ac_help
81   --with-gtk              Use the Gtk toolkit for the user interface."
82 ac_help="$ac_help
83   --with-gnome            Include support for the Gnome Control Center."
84 ac_help="$ac_help
85   --with-xml              The XML toolkit is needed for some parts of
86                           the Gtk interface."
87 ac_help="$ac_help
88
89 Graphics options:
90
91   --with-gl               Build those demos which depend on OpenGL."
92 ac_help="$ac_help
93   --with-gle              Build those demos which depend on GLE
94                           (the OpenGL "extrusion" library.)"
95 ac_help="$ac_help
96   --with-xpm              Include support for XPM files in some demos."
97 ac_help="$ac_help
98   --with-pixbuf           Include support for the GDK-Pixbuf library in some
99                           demos, which will make it possible for them to read
100                           GIF, JPEG, and PNG files as well."
101 ac_help="$ac_help
102   --with-jpeg             Include support for the JPEG library in some demos,
103                           which will make it possible for them to read JPEG
104                           files as well."
105 ac_help="$ac_help
106   --with-xshm-ext         Include support for the Shared Memory extension."
107 ac_help="$ac_help
108   --with-xdbe-ext         Include support for the DOUBLE-BUFFER extension."
109 ac_help="$ac_help
110   --with-readdisplay      Include support for the XReadDisplay extension."
111 ac_help="$ac_help
112
113   --with-fortune=PROGRAM  Some demos are able to run an external program and
114                           display its text; this names the program to use by
115                           default (though it can be overridden with X
116                           resources.)  Default is \"/usr/games/fortune\"."
117 ac_help="$ac_help
118   --with-setuid-hacks     Allow some demos to be installed \`setuid root'
119                           (which is needed in order to ping other hosts.)
120 "
121
122 # Initialize some variables set by options.
123 # The variables have the same names as the options, with
124 # dashes changed to underlines.
125 build=NONE
126 cache_file=./config.cache
127 exec_prefix=NONE
128 host=NONE
129 no_create=
130 nonopt=NONE
131 no_recursion=
132 prefix=NONE
133 program_prefix=NONE
134 program_suffix=NONE
135 program_transform_name=s,x,x,
136 silent=
137 site=
138 srcdir=
139 target=NONE
140 verbose=
141 x_includes=NONE
142 x_libraries=NONE
143 bindir='${exec_prefix}/bin'
144 sbindir='${exec_prefix}/sbin'
145 libexecdir='${exec_prefix}/libexec'
146 datadir='${prefix}/share'
147 sysconfdir='${prefix}/etc'
148 sharedstatedir='${prefix}/com'
149 localstatedir='${prefix}/var'
150 libdir='${exec_prefix}/lib'
151 includedir='${prefix}/include'
152 oldincludedir='/usr/include'
153 infodir='${prefix}/info'
154 mandir='${prefix}/man'
155
156 # Initialize some other variables.
157 subdirs=
158 MFLAGS= MAKEFLAGS=
159 SHELL=${CONFIG_SHELL-/bin/sh}
160 # Maximum number of lines to put in a shell here document.
161 ac_max_here_lines=12
162
163 ac_prev=
164 for ac_option
165 do
166
167   # If the previous option needs an argument, assign it.
168   if test -n "$ac_prev"; then
169     eval "$ac_prev=\$ac_option"
170     ac_prev=
171     continue
172   fi
173
174   case "$ac_option" in
175   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
176   *) ac_optarg= ;;
177   esac
178
179   # Accept the important Cygnus configure options, so we can diagnose typos.
180
181   case "$ac_option" in
182
183   -bindir | --bindir | --bindi | --bind | --bin | --bi)
184     ac_prev=bindir ;;
185   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
186     bindir="$ac_optarg" ;;
187
188   -build | --build | --buil | --bui | --bu)
189     ac_prev=build ;;
190   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
191     build="$ac_optarg" ;;
192
193   -cache-file | --cache-file | --cache-fil | --cache-fi \
194   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
195     ac_prev=cache_file ;;
196   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
197   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
198     cache_file="$ac_optarg" ;;
199
200   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
201     ac_prev=datadir ;;
202   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
203   | --da=*)
204     datadir="$ac_optarg" ;;
205
206   -disable-* | --disable-*)
207     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
208     # Reject names that are not valid shell variable names.
209     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
210       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
211     fi
212     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
213     eval "enable_${ac_feature}=no" ;;
214
215   -enable-* | --enable-*)
216     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
217     # Reject names that are not valid shell variable names.
218     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
219       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
220     fi
221     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
222     case "$ac_option" in
223       *=*) ;;
224       *) ac_optarg=yes ;;
225     esac
226     eval "enable_${ac_feature}='$ac_optarg'" ;;
227
228   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
229   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
230   | --exec | --exe | --ex)
231     ac_prev=exec_prefix ;;
232   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
233   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
234   | --exec=* | --exe=* | --ex=*)
235     exec_prefix="$ac_optarg" ;;
236
237   -gas | --gas | --ga | --g)
238     # Obsolete; use --with-gas.
239     with_gas=yes ;;
240
241   -help | --help | --hel | --he)
242     # Omit some internal or obsolete options to make the list less imposing.
243     # This message is too long to be a string in the A/UX 3.1 sh.
244     cat << EOF
245 Usage: configure [options] [host]
246 Options: [defaults in brackets after descriptions]
247
248 Configuration:
249
250   --cache-file=FILE       cache test results in FILE
251   --help                  print this message
252   --no-create             do not create output files
253   --quiet, --silent       do not print \`checking...' messages
254   --version               print the version of autoconf that created configure
255
256 Directory and file names:
257
258   --prefix=PREFIX         install architecture-independent files in PREFIX
259                           [$ac_default_prefix]
260   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
261                           [same as prefix]
262   --bindir=DIR            user executables in DIR [EPREFIX/bin]
263   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
264   --includedir=DIR        C header files in DIR [PREFIX/include]
265   --x-includes=DIR        X include files are in DIR
266   --x-libraries=DIR       X library files are in DIR
267   --mandir=DIR            man documentation in DIR [PREFIX/man]
268   --srcdir=DIR            find the sources in DIR [configure dir or ..]
269   --program-prefix=PREFIX prepend PREFIX to installed program names
270   --program-suffix=SUFFIX append SUFFIX to installed program names
271   --program-transform-name=PROGRAM
272                           run sed PROGRAM on installed program names
273 EOF
274     cat << EOF
275
276 Host type:
277
278   --build=BUILD           configure for building on BUILD [BUILD=HOST]
279   --host=HOST             configure for HOST [guessed]
280   --target=TARGET         configure for TARGET [TARGET=HOST]
281 EOF
282     if test -n "$ac_help"; then
283       echo "$ac_help"
284     fi
285     exit 0 ;;
286
287   -host | --host | --hos | --ho)
288     ac_prev=host ;;
289   -host=* | --host=* | --hos=* | --ho=*)
290     host="$ac_optarg" ;;
291
292   -includedir | --includedir | --includedi | --included | --include \
293   | --includ | --inclu | --incl | --inc)
294     ac_prev=includedir ;;
295   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
296   | --includ=* | --inclu=* | --incl=* | --inc=*)
297     includedir="$ac_optarg" ;;
298
299   -infodir | --infodir | --infodi | --infod | --info | --inf)
300     ac_prev=infodir ;;
301   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
302     infodir="$ac_optarg" ;;
303
304   -libdir | --libdir | --libdi | --libd)
305     ac_prev=libdir ;;
306   -libdir=* | --libdir=* | --libdi=* | --libd=*)
307     libdir="$ac_optarg" ;;
308
309   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
310   | --libexe | --libex | --libe)
311     ac_prev=libexecdir ;;
312   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
313   | --libexe=* | --libex=* | --libe=*)
314     libexecdir="$ac_optarg" ;;
315
316   -localstatedir | --localstatedir | --localstatedi | --localstated \
317   | --localstate | --localstat | --localsta | --localst \
318   | --locals | --local | --loca | --loc | --lo)
319     ac_prev=localstatedir ;;
320   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
321   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
322   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
323     localstatedir="$ac_optarg" ;;
324
325   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
326     ac_prev=mandir ;;
327   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
328     mandir="$ac_optarg" ;;
329
330   -nfp | --nfp | --nf)
331     # Obsolete; use --without-fp.
332     with_fp=no ;;
333
334   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
335   | --no-cr | --no-c)
336     no_create=yes ;;
337
338   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
339   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
340     no_recursion=yes ;;
341
342   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
343   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
344   | --oldin | --oldi | --old | --ol | --o)
345     ac_prev=oldincludedir ;;
346   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
347   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
348   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
349     oldincludedir="$ac_optarg" ;;
350
351   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
352     ac_prev=prefix ;;
353   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
354     prefix="$ac_optarg" ;;
355
356   -program-prefix | --program-prefix | --program-prefi | --program-pref \
357   | --program-pre | --program-pr | --program-p)
358     ac_prev=program_prefix ;;
359   -program-prefix=* | --program-prefix=* | --program-prefi=* \
360   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
361     program_prefix="$ac_optarg" ;;
362
363   -program-suffix | --program-suffix | --program-suffi | --program-suff \
364   | --program-suf | --program-su | --program-s)
365     ac_prev=program_suffix ;;
366   -program-suffix=* | --program-suffix=* | --program-suffi=* \
367   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
368     program_suffix="$ac_optarg" ;;
369
370   -program-transform-name | --program-transform-name \
371   | --program-transform-nam | --program-transform-na \
372   | --program-transform-n | --program-transform- \
373   | --program-transform | --program-transfor \
374   | --program-transfo | --program-transf \
375   | --program-trans | --program-tran \
376   | --progr-tra | --program-tr | --program-t)
377     ac_prev=program_transform_name ;;
378   -program-transform-name=* | --program-transform-name=* \
379   | --program-transform-nam=* | --program-transform-na=* \
380   | --program-transform-n=* | --program-transform-=* \
381   | --program-transform=* | --program-transfor=* \
382   | --program-transfo=* | --program-transf=* \
383   | --program-trans=* | --program-tran=* \
384   | --progr-tra=* | --program-tr=* | --program-t=*)
385     program_transform_name="$ac_optarg" ;;
386
387   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
388   | -silent | --silent | --silen | --sile | --sil)
389     silent=yes ;;
390
391   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
392     ac_prev=sbindir ;;
393   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
394   | --sbi=* | --sb=*)
395     sbindir="$ac_optarg" ;;
396
397   -sharedstatedir | --sharedstatedir | --sharedstatedi \
398   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
399   | --sharedst | --shareds | --shared | --share | --shar \
400   | --sha | --sh)
401     ac_prev=sharedstatedir ;;
402   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
403   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
404   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
405   | --sha=* | --sh=*)
406     sharedstatedir="$ac_optarg" ;;
407
408   -site | --site | --sit)
409     ac_prev=site ;;
410   -site=* | --site=* | --sit=*)
411     site="$ac_optarg" ;;
412
413   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
414     ac_prev=srcdir ;;
415   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
416     srcdir="$ac_optarg" ;;
417
418   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
419   | --syscon | --sysco | --sysc | --sys | --sy)
420     ac_prev=sysconfdir ;;
421   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
422   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
423     sysconfdir="$ac_optarg" ;;
424
425   -target | --target | --targe | --targ | --tar | --ta | --t)
426     ac_prev=target ;;
427   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
428     target="$ac_optarg" ;;
429
430   -v | -verbose | --verbose | --verbos | --verbo | --verb)
431     verbose=yes ;;
432
433   -version | --version | --versio | --versi | --vers)
434     echo "configure generated by autoconf version 2.13"
435     exit 0 ;;
436
437   -with-* | --with-*)
438     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
439     # Reject names that are not valid shell variable names.
440     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
441       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
442     fi
443     ac_package=`echo $ac_package| sed 's/-/_/g'`
444     case "$ac_option" in
445       *=*) ;;
446       *) ac_optarg=yes ;;
447     esac
448     eval "with_${ac_package}='$ac_optarg'" ;;
449
450   -without-* | --without-*)
451     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
452     # Reject names that are not valid shell variable names.
453     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
454       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
455     fi
456     ac_package=`echo $ac_package| sed 's/-/_/g'`
457     eval "with_${ac_package}=no" ;;
458
459   --x)
460     # Obsolete; use --with-x.
461     with_x=yes ;;
462
463   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
464   | --x-incl | --x-inc | --x-in | --x-i)
465     ac_prev=x_includes ;;
466   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
467   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
468     x_includes="$ac_optarg" ;;
469
470   -x-libraries | --x-libraries | --x-librarie | --x-librari \
471   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
472     ac_prev=x_libraries ;;
473   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
474   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
475     x_libraries="$ac_optarg" ;;
476
477   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
478     ;;
479
480   *)
481     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
482       echo "configure: warning: $ac_option: invalid host type" 1>&2
483     fi
484     if test "x$nonopt" != xNONE; then
485       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
486     fi
487     nonopt="$ac_option"
488     ;;
489
490   esac
491 done
492
493 if test -n "$ac_prev"; then
494   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
495 fi
496
497 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
498
499 # File descriptor usage:
500 # 0 standard input
501 # 1 file creation
502 # 2 errors and warnings
503 # 3 some systems may open it to /dev/tty
504 # 4 used on the Kubota Titan
505 # 6 checking for... messages and results
506 # 5 compiler messages saved in config.log
507 if test "$silent" = yes; then
508   exec 6>/dev/null
509 else
510   exec 6>&1
511 fi
512 exec 5>./config.log
513
514 echo "\
515 This file contains any messages produced by compilers while
516 running configure, to aid debugging if configure makes a mistake.
517 " 1>&5
518
519 # Strip out --no-create and --no-recursion so they do not pile up.
520 # Also quote any args containing shell metacharacters.
521 ac_configure_args=
522 for ac_arg
523 do
524   case "$ac_arg" in
525   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
526   | --no-cr | --no-c) ;;
527   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
528   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
529   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
530   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
531   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
532   esac
533 done
534
535 # NLS nuisances.
536 # Only set these to C if already set.  These must not be set unconditionally
537 # because not all systems understand e.g. LANG=C (notably SCO).
538 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
539 # Non-C LC_CTYPE values break the ctype check.
540 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
541 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
542 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
543 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
544
545 # confdefs.h avoids OS command line length limits that DEFS can exceed.
546 rm -rf conftest* confdefs.h
547 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
548 echo > confdefs.h
549
550 # A filename unique to this package, relative to the directory that
551 # configure is in, which we can look for to find out if srcdir is correct.
552 ac_unique_file=driver/subprocs.c
553
554 # Find the source files, if location was not specified.
555 if test -z "$srcdir"; then
556   ac_srcdir_defaulted=yes
557   # Try the directory containing this script, then its parent.
558   ac_prog=$0
559   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
560   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
561   srcdir=$ac_confdir
562   if test ! -r $srcdir/$ac_unique_file; then
563     srcdir=..
564   fi
565 else
566   ac_srcdir_defaulted=no
567 fi
568 if test ! -r $srcdir/$ac_unique_file; then
569   if test "$ac_srcdir_defaulted" = yes; then
570     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
571   else
572     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
573   fi
574 fi
575 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
576
577 # Prefer explicitly selected file to automatically selected ones.
578 if test -z "$CONFIG_SITE"; then
579   if test "x$prefix" != xNONE; then
580     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
581   else
582     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
583   fi
584 fi
585 for ac_site_file in $CONFIG_SITE; do
586   if test -r "$ac_site_file"; then
587     echo "loading site script $ac_site_file"
588     . "$ac_site_file"
589   fi
590 done
591
592 if test -r "$cache_file"; then
593   echo "loading cache $cache_file"
594   . $cache_file
595 else
596   echo "creating cache $cache_file"
597   > $cache_file
598 fi
599
600 ac_ext=c
601 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
602 ac_cpp='$CPP $CPPFLAGS'
603 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
604 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
605 cross_compiling=$ac_cv_prog_cc_cross
606
607 ac_exeext=
608 ac_objext=o
609 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
610   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
611   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
612     ac_n= ac_c='
613 ' ac_t='        '
614   else
615     ac_n=-n ac_c= ac_t=
616   fi
617 else
618   ac_n= ac_c='\c' ac_t=
619 fi
620
621
622
623
624 echo "current directory: `pwd`"
625 echo "command line was: $0 $@"
626
627
628 # After checking to see that --srcdir is correct (which AC_INIT does)
629 # check for some random other files that come later in the tar file,
630 # to make sure everything is here.
631 #
632 for d in driver utils hacks hacks/glx ; do
633   f=$srcdir/$d/Makefile.in
634   if test \! -r $f ; then
635     echo ""
636     echo "ERROR: The package is incomplete: $f does not exist."
637     echo "       This probably means that your download was truncated."
638     echo ""
639     exit 1
640   fi
641 done
642
643
644 ###############################################################################
645 #
646 #       Function to figure out how to run the compiler.
647 #
648 ###############################################################################
649
650
651
652
653 ###############################################################################
654 #
655 #       Functions to figure out how to disable // comments in ANSI C code.
656 #
657 #       (With recent gcc, this is done with "-std=c89".  With older gcc, this
658 #       is done by passing "-lang-c89" to cpp, by passing "-Wp,-lang-c89" to
659 #       gcc.  Old gcc doesn't support -std, and new gcc doesn't support -lang.
660 #       so much for compatibility!)
661 #
662 ###############################################################################
663
664
665
666
667
668
669 ###############################################################################
670 #
671 #       Function to figure out how to create directory trees.
672 #
673 ###############################################################################
674
675
676
677
678 ###############################################################################
679 #
680 #       Function to check whether gettimeofday() exists, and how to call it.
681 #       This may define HAVE_GETTIMEOFDAY and GETTIMEOFDAY_TWO_ARGS.
682 #
683 ###############################################################################
684
685
686
687
688 ###############################################################################
689 #
690 #       Function to find perl5 (defines PERL and PERL_VERSION.)
691 #
692 ###############################################################################
693
694 # M4 sucks!!  perl sucks too!!
695
696 perl_version_cmd='print $]'
697
698
699
700
701
702 ###############################################################################
703 #
704 #       Function to demand "bc".  Losers.
705 #
706 ###############################################################################
707
708
709
710 ###############################################################################
711 #
712 #       Functions to check how to do ICMP PING requests.
713 #
714 ###############################################################################
715
716
717
718
719
720
721 ###############################################################################
722 #
723 #       Functions to check for various X11 crap.
724 #
725 ###############################################################################
726
727 # Try and find the app-defaults directory.
728 # It sucks that autoconf doesn't do this already...
729 #
730
731
732
733
734
735
736
737
738
739
740 # Random special-cases for X on certain pathological OSes.
741 # You know who you are.
742 #
743
744
745
746
747 ###############################################################################
748 #
749 #       Some utility functions to make checking for X things easier.
750 #
751 ###############################################################################
752
753 # Like AC_CHECK_HEADER, but it uses the already-computed -I directories.
754 #
755
756
757 # Like AC_EGREP_HEADER, but it uses the already-computed -I directories.
758 #
759
760
761 # Like AC_TRY_COMPILE, but it uses the already-computed -I directories.
762 #
763
764
765
766 # Like AC_CHECK_LIB, but it uses the already-computed -I and -L directories.
767 # Use this sparingly; it probably doesn't work very well on X programs.
768 #
769
770
771 # Like AC_TRY_RUN, but it uses the already-computed -I directories.
772 # (But not the -L directories!)
773 #
774
775
776
777
778 # Usage: HANDLE_X_PATH_ARG([variable_name],
779 #                          [--command-line-option],
780 #                          [descriptive string])
781 #
782 # All of the --with options take three forms:
783 #
784 #   --with-foo (or --with-foo=yes)
785 #   --without-foo (or --with-foo=no)
786 #   --with-foo=/DIR
787 #
788 # This function, HANDLE_X_PATH_ARG, deals with the /DIR case.  When it sees
789 # a directory (string beginning with a slash) it checks to see whether
790 # /DIR/include and /DIR/lib exist, and adds them to $X_CFLAGS and $X_LIBS
791 # as appropriate.
792 #
793
794
795
796
797 ###############################################################################
798 ###############################################################################
799 #
800 #       End of function definitions.  Now start actually executing stuff.
801 #
802 ###############################################################################
803 ###############################################################################
804
805 # random compiler setup
806 ac_aux_dir=
807 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
808   if test -f $ac_dir/install-sh; then
809     ac_aux_dir=$ac_dir
810     ac_install_sh="$ac_aux_dir/install-sh -c"
811     break
812   elif test -f $ac_dir/install.sh; then
813     ac_aux_dir=$ac_dir
814     ac_install_sh="$ac_aux_dir/install.sh -c"
815     break
816   fi
817 done
818 if test -z "$ac_aux_dir"; then
819   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
820 fi
821 ac_config_guess=$ac_aux_dir/config.guess
822 ac_config_sub=$ac_aux_dir/config.sub
823 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
824
825
826 # Make sure we can run config.sub.
827 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
828 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
829 fi
830
831 echo $ac_n "checking host system type""... $ac_c" 1>&6
832 echo "configure:844: checking host system type" >&5
833
834 host_alias=$host
835 case "$host_alias" in
836 NONE)
837   case $nonopt in
838   NONE)
839     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
840     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
841     fi ;;
842   *) host_alias=$nonopt ;;
843   esac ;;
844 esac
845
846 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
847 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
848 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
849 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
850 echo "$ac_t""$host" 1>&6
851
852 # Extract the first word of "gcc", so it can be a program name with args.
853 set dummy gcc; ac_word=$2
854 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
855 echo "configure:867: checking for $ac_word" >&5
856 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
857   echo $ac_n "(cached) $ac_c" 1>&6
858 else
859   if test -n "$CC"; then
860   ac_cv_prog_CC="$CC" # Let the user override the test.
861 else
862   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
863   ac_dummy="$PATH"
864   for ac_dir in $ac_dummy; do
865     test -z "$ac_dir" && ac_dir=.
866     if test -f $ac_dir/$ac_word; then
867       ac_cv_prog_CC="gcc"
868       break
869     fi
870   done
871   IFS="$ac_save_ifs"
872 fi
873 fi
874 CC="$ac_cv_prog_CC"
875 if test -n "$CC"; then
876   echo "$ac_t""$CC" 1>&6
877 else
878   echo "$ac_t""no" 1>&6
879 fi
880
881 if test -z "$CC"; then
882   # Extract the first word of "cc", so it can be a program name with args.
883 set dummy cc; ac_word=$2
884 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
885 echo "configure:897: checking for $ac_word" >&5
886 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
887   echo $ac_n "(cached) $ac_c" 1>&6
888 else
889   if test -n "$CC"; then
890   ac_cv_prog_CC="$CC" # Let the user override the test.
891 else
892   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
893   ac_prog_rejected=no
894   ac_dummy="$PATH"
895   for ac_dir in $ac_dummy; do
896     test -z "$ac_dir" && ac_dir=.
897     if test -f $ac_dir/$ac_word; then
898       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
899         ac_prog_rejected=yes
900         continue
901       fi
902       ac_cv_prog_CC="cc"
903       break
904     fi
905   done
906   IFS="$ac_save_ifs"
907 if test $ac_prog_rejected = yes; then
908   # We found a bogon in the path, so make sure we never use it.
909   set dummy $ac_cv_prog_CC
910   shift
911   if test $# -gt 0; then
912     # We chose a different compiler from the bogus one.
913     # However, it has the same basename, so the bogon will be chosen
914     # first if we set CC to just the basename; use the full file name.
915     shift
916     set dummy "$ac_dir/$ac_word" "$@"
917     shift
918     ac_cv_prog_CC="$@"
919   fi
920 fi
921 fi
922 fi
923 CC="$ac_cv_prog_CC"
924 if test -n "$CC"; then
925   echo "$ac_t""$CC" 1>&6
926 else
927   echo "$ac_t""no" 1>&6
928 fi
929
930   if test -z "$CC"; then
931     case "`uname -s`" in
932     *win32* | *WIN32*)
933       # Extract the first word of "cl", so it can be a program name with args.
934 set dummy cl; ac_word=$2
935 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
936 echo "configure:948: checking for $ac_word" >&5
937 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
938   echo $ac_n "(cached) $ac_c" 1>&6
939 else
940   if test -n "$CC"; then
941   ac_cv_prog_CC="$CC" # Let the user override the test.
942 else
943   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
944   ac_dummy="$PATH"
945   for ac_dir in $ac_dummy; do
946     test -z "$ac_dir" && ac_dir=.
947     if test -f $ac_dir/$ac_word; then
948       ac_cv_prog_CC="cl"
949       break
950     fi
951   done
952   IFS="$ac_save_ifs"
953 fi
954 fi
955 CC="$ac_cv_prog_CC"
956 if test -n "$CC"; then
957   echo "$ac_t""$CC" 1>&6
958 else
959   echo "$ac_t""no" 1>&6
960 fi
961  ;;
962     esac
963   fi
964   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
965 fi
966
967 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
968 echo "configure:980: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
969
970 ac_ext=c
971 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
972 ac_cpp='$CPP $CPPFLAGS'
973 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
974 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
975 cross_compiling=$ac_cv_prog_cc_cross
976
977 cat > conftest.$ac_ext << EOF
978
979 #line 991 "configure"
980 #include "confdefs.h"
981
982 main(){return(0);}
983 EOF
984 if { (eval echo configure:996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
985   ac_cv_prog_cc_works=yes
986   # If we can't run a trivial program, we are probably using a cross compiler.
987   if (./conftest; exit) 2>/dev/null; then
988     ac_cv_prog_cc_cross=no
989   else
990     ac_cv_prog_cc_cross=yes
991   fi
992 else
993   echo "configure: failed program was:" >&5
994   cat conftest.$ac_ext >&5
995   ac_cv_prog_cc_works=no
996 fi
997 rm -fr conftest*
998 ac_ext=c
999 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1000 ac_cpp='$CPP $CPPFLAGS'
1001 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1002 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1003 cross_compiling=$ac_cv_prog_cc_cross
1004
1005 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1006 if test $ac_cv_prog_cc_works = no; then
1007   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1008 fi
1009 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1010 echo "configure:1022: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1011 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1012 cross_compiling=$ac_cv_prog_cc_cross
1013
1014 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1015 echo "configure:1027: checking whether we are using GNU C" >&5
1016 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1017   echo $ac_n "(cached) $ac_c" 1>&6
1018 else
1019   cat > conftest.c <<EOF
1020 #ifdef __GNUC__
1021   yes;
1022 #endif
1023 EOF
1024 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1025   ac_cv_prog_gcc=yes
1026 else
1027   ac_cv_prog_gcc=no
1028 fi
1029 fi
1030
1031 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1032
1033 if test $ac_cv_prog_gcc = yes; then
1034   GCC=yes
1035 else
1036   GCC=
1037 fi
1038
1039 ac_test_CFLAGS="${CFLAGS+set}"
1040 ac_save_CFLAGS="$CFLAGS"
1041 CFLAGS=
1042 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1043 echo "configure:1055: checking whether ${CC-cc} accepts -g" >&5
1044 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1045   echo $ac_n "(cached) $ac_c" 1>&6
1046 else
1047   echo 'void f(){}' > conftest.c
1048 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1049   ac_cv_prog_cc_g=yes
1050 else
1051   ac_cv_prog_cc_g=no
1052 fi
1053 rm -f conftest*
1054
1055 fi
1056
1057 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1058 if test "$ac_test_CFLAGS" = set; then
1059   CFLAGS="$ac_save_CFLAGS"
1060 elif test $ac_cv_prog_cc_g = yes; then
1061   if test "$GCC" = yes; then
1062     CFLAGS="-g -O2"
1063   else
1064     CFLAGS="-g"
1065   fi
1066 else
1067   if test "$GCC" = yes; then
1068     CFLAGS="-O2"
1069   else
1070     CFLAGS=
1071   fi
1072 fi
1073
1074
1075   if test -z "$GCC"; then
1076     echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
1077 echo "configure:1089: checking how to request ANSI compilation" >&5
1078     case "$host" in
1079       *-hpux* )
1080         echo "$ac_t""HPUX: adding -Ae" 1>&6
1081         CC="$CC -Ae"
1082       ;;
1083       *-aix* )
1084         echo "$ac_t""AIX: adding -qlanglvl=ansi -qhalt=e" 1>&6
1085         CC="$CC -qlanglvl=ansi -qhalt=e"
1086       ;;
1087
1088       *-dec-* )
1089         echo "$ac_t""DEC: adding -std1 -ieee" 1>&6
1090         CC="$CC -std1"
1091       ;;
1092
1093       *)
1094         echo "$ac_t""no idea" 1>&6
1095       ;;
1096     esac
1097   fi
1098
1099   echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
1100 echo "configure:1112: checking whether the compiler works on ANSI C" >&5
1101   if test "$cross_compiling" = yes; then
1102   { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1103 else
1104   cat > conftest.$ac_ext <<EOF
1105 #line 1117 "configure"
1106 #include "confdefs.h"
1107  main(int ac, char **av) { return 0; } 
1108 EOF
1109 if { (eval echo configure:1121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1110 then
1111   echo "$ac_t""yes" 1>&6
1112 else
1113   echo "configure: failed program was:" >&5
1114   cat conftest.$ac_ext >&5
1115   rm -fr conftest*
1116   echo "$ac_t""no" 1>&6
1117      { echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
1118 fi
1119 rm -fr conftest*
1120 fi
1121
1122
1123   if test -n "$GCC"; then
1124     echo "$ac_t""Turning on gcc compiler warnings." 1>&6
1125     CC="$CC -Wall -Wstrict-prototypes -Wnested-externs -Wno-format"
1126   else
1127     case "$host" in
1128       *-irix5* |*-irix6.0-3* )
1129         echo "$ac_t""Turning on SGI compiler warnings." 1>&6
1130         CC="$CC -fullwarn -use_readonly_const -rdata_shared -g3"
1131       ;;
1132 #     *-dec-osf* )
1133 #       if test -z "$GCC"; then
1134 #         AC_MSG_RESULT(Turning on DEC C compiler warnings.)
1135 #         CC="$CC -migrate -w0 -verbose -warnprotos"
1136 #       fi
1137 #     ;;
1138     esac
1139   fi
1140
1141 if test -n "$GCC"; then
1142    if test -n "$GCC"; then
1143    echo $ac_n "checking whether gcc accepts -std""... $ac_c" 1>&6
1144 echo "configure:1156: checking whether gcc accepts -std" >&5
1145 if eval "test \"`echo '$''{'ac_cv_gcc_accepts_std'+set}'`\" = set"; then
1146   echo $ac_n "(cached) $ac_c" 1>&6
1147 else
1148   if ( gcc -E -std=c89 - </dev/null 2>&1 >/dev/null | \
1149           grep unrecognized >/dev/null ); then
1150        ac_cv_gcc_accepts_std=no
1151      else
1152        ac_cv_gcc_accepts_std=yes
1153      fi
1154 fi
1155
1156 echo "$ac_t""$ac_cv_gcc_accepts_std" 1>&6
1157    ac_gcc_accepts_std="$ac_cv_gcc_accepts_std"
1158   fi
1159
1160    echo "$ac_t""Disabling C++ comments in ANSI C code." 1>&6
1161    #
1162    # The reason that // comments are banned from xscreensaver is that gcc is
1163    # basically the only compiler in the world that supports them in C code.
1164    # All other vendors support them only in their C++ compilers, not in their
1165    # ANSI C compilers.  This means that it's a portability problem: every time
1166    # these comments have snuck into the xscreensaver source code, I've gotten
1167    # complaints about it the next day.  So we turn off support for them in gcc
1168    # as well to prevent them from accidentially slipping in.
1169    #
1170    if test "$ac_gcc_accepts_std" = yes ; then
1171      #
1172      # -std=c89 defines __STRICT_ANSI__, which we don't want.
1173      # (That appears to be the only additional preprocessor symbol
1174      # it defines, in addition to the syntax changes it makes.)
1175      #
1176      # -std=gnu89 is no good, because // comments were a GNU extension
1177      # before they were in the ANSI C 99 spec...  (gcc 2.96 permits //
1178      # with -std=gnu89 but not with -std=c89.)
1179      #
1180      CC="$CC -std=c89 -U__STRICT_ANSI__"
1181    else
1182      # The old way:
1183      CC="$CC -Wp,-lang-c89"
1184    fi
1185   fi
1186
1187 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1188 echo "configure:1200: checking how to run the C preprocessor" >&5
1189 # On Suns, sometimes $CPP names a directory.
1190 if test -n "$CPP" && test -d "$CPP"; then
1191   CPP=
1192 fi
1193 if test -z "$CPP"; then
1194 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1195   echo $ac_n "(cached) $ac_c" 1>&6
1196 else
1197     # This must be in double quotes, not single quotes, because CPP may get
1198   # substituted into the Makefile and "${CC-cc}" will confuse make.
1199   CPP="${CC-cc} -E"
1200   # On the NeXT, cc -E runs the code through the compiler's parser,
1201   # not just through cpp.
1202   cat > conftest.$ac_ext <<EOF
1203 #line 1215 "configure"
1204 #include "confdefs.h"
1205 #include <assert.h>
1206 Syntax Error
1207 EOF
1208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1209 { (eval echo configure:1221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1211 if test -z "$ac_err"; then
1212   :
1213 else
1214   echo "$ac_err" >&5
1215   echo "configure: failed program was:" >&5
1216   cat conftest.$ac_ext >&5
1217   rm -rf conftest*
1218   CPP="${CC-cc} -E -traditional-cpp"
1219   cat > conftest.$ac_ext <<EOF
1220 #line 1232 "configure"
1221 #include "confdefs.h"
1222 #include <assert.h>
1223 Syntax Error
1224 EOF
1225 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1226 { (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1227 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1228 if test -z "$ac_err"; then
1229   :
1230 else
1231   echo "$ac_err" >&5
1232   echo "configure: failed program was:" >&5
1233   cat conftest.$ac_ext >&5
1234   rm -rf conftest*
1235   CPP="${CC-cc} -nologo -E"
1236   cat > conftest.$ac_ext <<EOF
1237 #line 1249 "configure"
1238 #include "confdefs.h"
1239 #include <assert.h>
1240 Syntax Error
1241 EOF
1242 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1243 { (eval echo configure:1255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1244 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1245 if test -z "$ac_err"; then
1246   :
1247 else
1248   echo "$ac_err" >&5
1249   echo "configure: failed program was:" >&5
1250   cat conftest.$ac_ext >&5
1251   rm -rf conftest*
1252   CPP=/lib/cpp
1253 fi
1254 rm -f conftest*
1255 fi
1256 rm -f conftest*
1257 fi
1258 rm -f conftest*
1259   ac_cv_prog_CPP="$CPP"
1260 fi
1261   CPP="$ac_cv_prog_CPP"
1262 else
1263   ac_cv_prog_CPP="$CPP"
1264 fi
1265 echo "$ac_t""$CPP" 1>&6
1266
1267 echo $ac_n "checking for working const""... $ac_c" 1>&6
1268 echo "configure:1280: checking for working const" >&5
1269 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1270   echo $ac_n "(cached) $ac_c" 1>&6
1271 else
1272   cat > conftest.$ac_ext <<EOF
1273 #line 1285 "configure"
1274 #include "confdefs.h"
1275
1276 int main() {
1277
1278 /* Ultrix mips cc rejects this.  */
1279 typedef int charset[2]; const charset x;
1280 /* SunOS 4.1.1 cc rejects this.  */
1281 char const *const *ccp;
1282 char **p;
1283 /* NEC SVR4.0.2 mips cc rejects this.  */
1284 struct point {int x, y;};
1285 static struct point const zero = {0,0};
1286 /* AIX XL C 1.02.0.0 rejects this.
1287    It does not let you subtract one const X* pointer from another in an arm
1288    of an if-expression whose if-part is not a constant expression */
1289 const char *g = "string";
1290 ccp = &g + (g ? g-g : 0);
1291 /* HPUX 7.0 cc rejects these. */
1292 ++ccp;
1293 p = (char**) ccp;
1294 ccp = (char const *const *) p;
1295 { /* SCO 3.2v4 cc rejects this.  */
1296   char *t;
1297   char const *s = 0 ? (char *) 0 : (char const *) 0;
1298
1299   *t++ = 0;
1300 }
1301 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1302   int x[] = {25, 17};
1303   const int *foo = &x[0];
1304   ++foo;
1305 }
1306 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1307   typedef const int *iptr;
1308   iptr p = 0;
1309   ++p;
1310 }
1311 { /* AIX XL C 1.02.0.0 rejects this saying
1312      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1313   struct s { int j; const int *ap[3]; };
1314   struct s *b; b->j = 5;
1315 }
1316 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1317   const int foo = 10;
1318 }
1319
1320 ; return 0; }
1321 EOF
1322 if { (eval echo configure:1334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1323   rm -rf conftest*
1324   ac_cv_c_const=yes
1325 else
1326   echo "configure: failed program was:" >&5
1327   cat conftest.$ac_ext >&5
1328   rm -rf conftest*
1329   ac_cv_c_const=no
1330 fi
1331 rm -f conftest*
1332 fi
1333
1334 echo "$ac_t""$ac_cv_c_const" 1>&6
1335 if test $ac_cv_c_const = no; then
1336   cat >> confdefs.h <<\EOF
1337 #define const 
1338 EOF
1339
1340 fi
1341
1342 echo $ac_n "checking for inline""... $ac_c" 1>&6
1343 echo "configure:1355: checking for inline" >&5
1344 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1345   echo $ac_n "(cached) $ac_c" 1>&6
1346 else
1347   ac_cv_c_inline=no
1348 for ac_kw in inline __inline__ __inline; do
1349   cat > conftest.$ac_ext <<EOF
1350 #line 1362 "configure"
1351 #include "confdefs.h"
1352
1353 int main() {
1354 } $ac_kw foo() {
1355 ; return 0; }
1356 EOF
1357 if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1358   rm -rf conftest*
1359   ac_cv_c_inline=$ac_kw; break
1360 else
1361   echo "configure: failed program was:" >&5
1362   cat conftest.$ac_ext >&5
1363 fi
1364 rm -f conftest*
1365 done
1366
1367 fi
1368
1369 echo "$ac_t""$ac_cv_c_inline" 1>&6
1370 case "$ac_cv_c_inline" in
1371   inline | yes) ;;
1372   no) cat >> confdefs.h <<\EOF
1373 #define inline 
1374 EOF
1375  ;;
1376   *)  cat >> confdefs.h <<EOF
1377 #define inline $ac_cv_c_inline
1378 EOF
1379  ;;
1380 esac
1381
1382 ac_bc_result=`echo 6+9 | bc 2>/dev/null`
1383   echo $ac_n "checking for bc""... $ac_c" 1>&6
1384 echo "configure:1396: checking for bc" >&5
1385   if test "$ac_bc_result" = "15" ; then
1386     echo "$ac_t""yes" 1>&6
1387   else
1388     echo "$ac_t""no" 1>&6
1389     echo ''
1390     { echo "configure: error: Your system doesn't have \"bc\", which has been a standard
1391                   part of Unix since the 1970s.  Come back when your vendor
1392                   has grown a clue." 1>&2; exit 1; }
1393   fi
1394  
1395
1396 # stuff for Makefiles
1397 # Find a good install program.  We prefer a C program (faster),
1398 # so one script is as good as another.  But avoid the broken or
1399 # incompatible versions:
1400 # SysV /etc/install, /usr/sbin/install
1401 # SunOS /usr/etc/install
1402 # IRIX /sbin/install
1403 # AIX /bin/install
1404 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1405 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1406 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1407 # ./install, which can be erroneously created by make from ./install.sh.
1408 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1409 echo "configure:1421: checking for a BSD compatible install" >&5
1410 if test -z "$INSTALL"; then
1411 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1412   echo $ac_n "(cached) $ac_c" 1>&6
1413 else
1414     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1415   for ac_dir in $PATH; do
1416     # Account for people who put trailing slashes in PATH elements.
1417     case "$ac_dir/" in
1418     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1419     *)
1420       # OSF1 and SCO ODT 3.0 have their own names for install.
1421       # Don't use installbsd from OSF since it installs stuff as root
1422       # by default.
1423       for ac_prog in ginstall scoinst install; do
1424         if test -f $ac_dir/$ac_prog; then
1425           if test $ac_prog = install &&
1426             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1427             # AIX install.  It has an incompatible calling convention.
1428             :
1429           else
1430             ac_cv_path_install="$ac_dir/$ac_prog -c"
1431             break 2
1432           fi
1433         fi
1434       done
1435       ;;
1436     esac
1437   done
1438   IFS="$ac_save_IFS"
1439
1440 fi
1441   if test "${ac_cv_path_install+set}" = set; then
1442     INSTALL="$ac_cv_path_install"
1443   else
1444     # As a last resort, use the slow shell script.  We don't cache a
1445     # path for INSTALL within a source directory, because that will
1446     # break other packages using the cache if that directory is
1447     # removed, or if the path is relative.
1448     INSTALL="$ac_install_sh"
1449   fi
1450 fi
1451 echo "$ac_t""$INSTALL" 1>&6
1452
1453 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1454 # It thinks the first close brace ends the variable substitution.
1455 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1456
1457 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1458
1459 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1460
1461 echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
1462 echo "configure:1474: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
1463 if eval "test \"`echo '$''{'ac_cv_install_d_creates_dirs'+set}'`\" = set"; then
1464   echo $ac_n "(cached) $ac_c" 1>&6
1465 else
1466   ac_cv_install_d_creates_dirs=no
1467      rm -rf conftestdir
1468      if mkdir conftestdir; then
1469        cd conftestdir >&-
1470        ${INSTALL} -d `pwd`/dir1/dir2 >&- 2>&-
1471        if test -d dir1/dir2/. ; then
1472          ac_cv_install_d_creates_dirs=yes
1473        fi
1474        cd .. >&-
1475        rm -rf conftestdir
1476      fi
1477     
1478 fi
1479
1480 echo "$ac_t""$ac_cv_install_d_creates_dirs" 1>&6
1481
1482   if test "$ac_cv_install_d_creates_dirs" = no ; then
1483     echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
1484 echo "configure:1496: checking whether \"mkdir -p\" creates intermediate directories" >&5
1485 if eval "test \"`echo '$''{'ac_cv_mkdir_p_creates_dirs'+set}'`\" = set"; then
1486   echo $ac_n "(cached) $ac_c" 1>&6
1487 else
1488   ac_cv_mkdir_p_creates_dirs=no
1489        rm -rf conftestdir
1490        if mkdir conftestdir; then
1491          cd conftestdir >&-
1492          mkdir -p dir1/dir2 >&- 2>&-
1493          if test -d dir1/dir2/. ; then
1494            ac_cv_mkdir_p_creates_dirs=yes
1495          fi
1496          cd .. >&-
1497          rm -rf conftestdir
1498        fi
1499       
1500 fi
1501
1502 echo "$ac_t""$ac_cv_mkdir_p_creates_dirs" 1>&6
1503   fi
1504
1505   if test "$ac_cv_install_d_creates_dirs" = yes ; then
1506     INSTALL_DIRS='${INSTALL} -d'
1507   elif test "$ac_cv_mkdir_p_creates_dirs" = yes ; then
1508     INSTALL_DIRS='mkdir -p'
1509   else
1510     # any other ideas?
1511     INSTALL_DIRS='${INSTALL} -d'
1512   fi
1513
1514 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1515 echo "configure:1527: checking whether ${MAKE-make} sets \${MAKE}" >&5
1516 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1517 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1518   echo $ac_n "(cached) $ac_c" 1>&6
1519 else
1520   cat > conftestmake <<\EOF
1521 all:
1522         @echo 'ac_maketemp="${MAKE}"'
1523 EOF
1524 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1525 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1526 if test -n "$ac_maketemp"; then
1527   eval ac_cv_prog_make_${ac_make}_set=yes
1528 else
1529   eval ac_cv_prog_make_${ac_make}_set=no
1530 fi
1531 rm -f conftestmake
1532 fi
1533 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1534   echo "$ac_t""yes" 1>&6
1535   SET_MAKE=
1536 else
1537   echo "$ac_t""no" 1>&6
1538   SET_MAKE="MAKE=${MAKE-make}"
1539 fi
1540
1541
1542 # By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
1543 # That's wrong: it should be set to '${INSTALL}', so that one can
1544 # implement the "install-strip" target properly (strip executables,
1545 # but do not try to strip scripts.)
1546 #
1547 INSTALL_SCRIPT='${INSTALL}'
1548
1549 # random libc stuff
1550 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1551 echo "configure:1563: checking for ANSI C header files" >&5
1552 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1553   echo $ac_n "(cached) $ac_c" 1>&6
1554 else
1555   cat > conftest.$ac_ext <<EOF
1556 #line 1568 "configure"
1557 #include "confdefs.h"
1558 #include <stdlib.h>
1559 #include <stdarg.h>
1560 #include <string.h>
1561 #include <float.h>
1562 EOF
1563 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1564 { (eval echo configure:1576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1565 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1566 if test -z "$ac_err"; then
1567   rm -rf conftest*
1568   ac_cv_header_stdc=yes
1569 else
1570   echo "$ac_err" >&5
1571   echo "configure: failed program was:" >&5
1572   cat conftest.$ac_ext >&5
1573   rm -rf conftest*
1574   ac_cv_header_stdc=no
1575 fi
1576 rm -f conftest*
1577
1578 if test $ac_cv_header_stdc = yes; then
1579   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1580 cat > conftest.$ac_ext <<EOF
1581 #line 1593 "configure"
1582 #include "confdefs.h"
1583 #include <string.h>
1584 EOF
1585 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1586   egrep "memchr" >/dev/null 2>&1; then
1587   :
1588 else
1589   rm -rf conftest*
1590   ac_cv_header_stdc=no
1591 fi
1592 rm -f conftest*
1593
1594 fi
1595
1596 if test $ac_cv_header_stdc = yes; then
1597   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1598 cat > conftest.$ac_ext <<EOF
1599 #line 1611 "configure"
1600 #include "confdefs.h"
1601 #include <stdlib.h>
1602 EOF
1603 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1604   egrep "free" >/dev/null 2>&1; then
1605   :
1606 else
1607   rm -rf conftest*
1608   ac_cv_header_stdc=no
1609 fi
1610 rm -f conftest*
1611
1612 fi
1613
1614 if test $ac_cv_header_stdc = yes; then
1615   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1616 if test "$cross_compiling" = yes; then
1617   :
1618 else
1619   cat > conftest.$ac_ext <<EOF
1620 #line 1632 "configure"
1621 #include "confdefs.h"
1622 #include <ctype.h>
1623 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1624 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1625 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1626 int main () { int i; for (i = 0; i < 256; i++)
1627 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1628 exit (0); }
1629
1630 EOF
1631 if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1632 then
1633   :
1634 else
1635   echo "configure: failed program was:" >&5
1636   cat conftest.$ac_ext >&5
1637   rm -fr conftest*
1638   ac_cv_header_stdc=no
1639 fi
1640 rm -fr conftest*
1641 fi
1642
1643 fi
1644 fi
1645
1646 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1647 if test $ac_cv_header_stdc = yes; then
1648   cat >> confdefs.h <<\EOF
1649 #define STDC_HEADERS 1
1650 EOF
1651
1652 fi
1653
1654 for ac_hdr in unistd.h
1655 do
1656 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1657 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1658 echo "configure:1670: checking for $ac_hdr" >&5
1659 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1660   echo $ac_n "(cached) $ac_c" 1>&6
1661 else
1662   cat > conftest.$ac_ext <<EOF
1663 #line 1675 "configure"
1664 #include "confdefs.h"
1665 #include <$ac_hdr>
1666 EOF
1667 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1668 { (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1669 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1670 if test -z "$ac_err"; then
1671   rm -rf conftest*
1672   eval "ac_cv_header_$ac_safe=yes"
1673 else
1674   echo "$ac_err" >&5
1675   echo "configure: failed program was:" >&5
1676   cat conftest.$ac_ext >&5
1677   rm -rf conftest*
1678   eval "ac_cv_header_$ac_safe=no"
1679 fi
1680 rm -f conftest*
1681 fi
1682 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1683   echo "$ac_t""yes" 1>&6
1684     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1685   cat >> confdefs.h <<EOF
1686 #define $ac_tr_hdr 1
1687 EOF
1688  
1689 else
1690   echo "$ac_t""no" 1>&6
1691 fi
1692 done
1693
1694 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
1695 echo "configure:1707: checking for mode_t" >&5
1696 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
1697   echo $ac_n "(cached) $ac_c" 1>&6
1698 else
1699   cat > conftest.$ac_ext <<EOF
1700 #line 1712 "configure"
1701 #include "confdefs.h"
1702 #include <sys/types.h>
1703 #if STDC_HEADERS
1704 #include <stdlib.h>
1705 #include <stddef.h>
1706 #endif
1707 EOF
1708 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1709   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1710   rm -rf conftest*
1711   ac_cv_type_mode_t=yes
1712 else
1713   rm -rf conftest*
1714   ac_cv_type_mode_t=no
1715 fi
1716 rm -f conftest*
1717
1718 fi
1719 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
1720 if test $ac_cv_type_mode_t = no; then
1721   cat >> confdefs.h <<\EOF
1722 #define mode_t int
1723 EOF
1724
1725 fi
1726
1727 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1728 echo "configure:1740: checking for pid_t" >&5
1729 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1730   echo $ac_n "(cached) $ac_c" 1>&6
1731 else
1732   cat > conftest.$ac_ext <<EOF
1733 #line 1745 "configure"
1734 #include "confdefs.h"
1735 #include <sys/types.h>
1736 #if STDC_HEADERS
1737 #include <stdlib.h>
1738 #include <stddef.h>
1739 #endif
1740 EOF
1741 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1742   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1743   rm -rf conftest*
1744   ac_cv_type_pid_t=yes
1745 else
1746   rm -rf conftest*
1747   ac_cv_type_pid_t=no
1748 fi
1749 rm -f conftest*
1750
1751 fi
1752 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1753 if test $ac_cv_type_pid_t = no; then
1754   cat >> confdefs.h <<\EOF
1755 #define pid_t int
1756 EOF
1757
1758 fi
1759
1760 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1761 echo "configure:1773: checking for size_t" >&5
1762 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1763   echo $ac_n "(cached) $ac_c" 1>&6
1764 else
1765   cat > conftest.$ac_ext <<EOF
1766 #line 1778 "configure"
1767 #include "confdefs.h"
1768 #include <sys/types.h>
1769 #if STDC_HEADERS
1770 #include <stdlib.h>
1771 #include <stddef.h>
1772 #endif
1773 EOF
1774 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1775   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1776   rm -rf conftest*
1777   ac_cv_type_size_t=yes
1778 else
1779   rm -rf conftest*
1780   ac_cv_type_size_t=no
1781 fi
1782 rm -f conftest*
1783
1784 fi
1785 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1786 if test $ac_cv_type_size_t = no; then
1787   cat >> confdefs.h <<\EOF
1788 #define size_t unsigned
1789 EOF
1790
1791 fi
1792
1793 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
1794 echo "configure:1806: checking return type of signal handlers" >&5
1795 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
1796   echo $ac_n "(cached) $ac_c" 1>&6
1797 else
1798   cat > conftest.$ac_ext <<EOF
1799 #line 1811 "configure"
1800 #include "confdefs.h"
1801 #include <sys/types.h>
1802 #include <signal.h>
1803 #ifdef signal
1804 #undef signal
1805 #endif
1806 #ifdef __cplusplus
1807 extern "C" void (*signal (int, void (*)(int)))(int);
1808 #else
1809 void (*signal ()) ();
1810 #endif
1811
1812 int main() {
1813 int i;
1814 ; return 0; }
1815 EOF
1816 if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1817   rm -rf conftest*
1818   ac_cv_type_signal=void
1819 else
1820   echo "configure: failed program was:" >&5
1821   cat conftest.$ac_ext >&5
1822   rm -rf conftest*
1823   ac_cv_type_signal=int
1824 fi
1825 rm -f conftest*
1826 fi
1827
1828 echo "$ac_t""$ac_cv_type_signal" 1>&6
1829 cat >> confdefs.h <<EOF
1830 #define RETSIGTYPE $ac_cv_type_signal
1831 EOF
1832
1833
1834 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1835 echo "configure:1847: checking whether time.h and sys/time.h may both be included" >&5
1836 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1837   echo $ac_n "(cached) $ac_c" 1>&6
1838 else
1839   cat > conftest.$ac_ext <<EOF
1840 #line 1852 "configure"
1841 #include "confdefs.h"
1842 #include <sys/types.h>
1843 #include <sys/time.h>
1844 #include <time.h>
1845 int main() {
1846 struct tm *tp;
1847 ; return 0; }
1848 EOF
1849 if { (eval echo configure:1861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1850   rm -rf conftest*
1851   ac_cv_header_time=yes
1852 else
1853   echo "configure: failed program was:" >&5
1854   cat conftest.$ac_ext >&5
1855   rm -rf conftest*
1856   ac_cv_header_time=no
1857 fi
1858 rm -f conftest*
1859 fi
1860
1861 echo "$ac_t""$ac_cv_header_time" 1>&6
1862 if test $ac_cv_header_time = yes; then
1863   cat >> confdefs.h <<\EOF
1864 #define TIME_WITH_SYS_TIME 1
1865 EOF
1866
1867 fi
1868
1869 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1870 echo "configure:1882: checking for sys/wait.h that is POSIX.1 compatible" >&5
1871 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1872   echo $ac_n "(cached) $ac_c" 1>&6
1873 else
1874   cat > conftest.$ac_ext <<EOF
1875 #line 1887 "configure"
1876 #include "confdefs.h"
1877 #include <sys/types.h>
1878 #include <sys/wait.h>
1879 #ifndef WEXITSTATUS
1880 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1881 #endif
1882 #ifndef WIFEXITED
1883 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1884 #endif
1885 int main() {
1886 int s;
1887 wait (&s);
1888 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1889 ; return 0; }
1890 EOF
1891 if { (eval echo configure:1903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1892   rm -rf conftest*
1893   ac_cv_header_sys_wait_h=yes
1894 else
1895   echo "configure: failed program was:" >&5
1896   cat conftest.$ac_ext >&5
1897   rm -rf conftest*
1898   ac_cv_header_sys_wait_h=no
1899 fi
1900 rm -f conftest*
1901 fi
1902
1903 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1904 if test $ac_cv_header_sys_wait_h = yes; then
1905   cat >> confdefs.h <<\EOF
1906 #define HAVE_SYS_WAIT_H 1
1907 EOF
1908
1909 fi
1910
1911 ac_header_dirent=no
1912 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
1913 do
1914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1915 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
1916 echo "configure:1928: checking for $ac_hdr that defines DIR" >&5
1917 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
1918   echo $ac_n "(cached) $ac_c" 1>&6
1919 else
1920   cat > conftest.$ac_ext <<EOF
1921 #line 1933 "configure"
1922 #include "confdefs.h"
1923 #include <sys/types.h>
1924 #include <$ac_hdr>
1925 int main() {
1926 DIR *dirp = 0;
1927 ; return 0; }
1928 EOF
1929 if { (eval echo configure:1941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1930   rm -rf conftest*
1931   eval "ac_cv_header_dirent_$ac_safe=yes"
1932 else
1933   echo "configure: failed program was:" >&5
1934   cat conftest.$ac_ext >&5
1935   rm -rf conftest*
1936   eval "ac_cv_header_dirent_$ac_safe=no"
1937 fi
1938 rm -f conftest*
1939 fi
1940 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
1941   echo "$ac_t""yes" 1>&6
1942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1943   cat >> confdefs.h <<EOF
1944 #define $ac_tr_hdr 1
1945 EOF
1946  ac_header_dirent=$ac_hdr; break
1947 else
1948   echo "$ac_t""no" 1>&6
1949 fi
1950 done
1951 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
1952 if test $ac_header_dirent = dirent.h; then
1953 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
1954 echo "configure:1966: checking for opendir in -ldir" >&5
1955 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
1956 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1957   echo $ac_n "(cached) $ac_c" 1>&6
1958 else
1959   ac_save_LIBS="$LIBS"
1960 LIBS="-ldir  $LIBS"
1961 cat > conftest.$ac_ext <<EOF
1962 #line 1974 "configure"
1963 #include "confdefs.h"
1964 /* Override any gcc2 internal prototype to avoid an error.  */
1965 /* We use char because int might match the return type of a gcc2
1966     builtin and then its argument prototype would still apply.  */
1967 char opendir();
1968
1969 int main() {
1970 opendir()
1971 ; return 0; }
1972 EOF
1973 if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1974   rm -rf conftest*
1975   eval "ac_cv_lib_$ac_lib_var=yes"
1976 else
1977   echo "configure: failed program was:" >&5
1978   cat conftest.$ac_ext >&5
1979   rm -rf conftest*
1980   eval "ac_cv_lib_$ac_lib_var=no"
1981 fi
1982 rm -f conftest*
1983 LIBS="$ac_save_LIBS"
1984
1985 fi
1986 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1987   echo "$ac_t""yes" 1>&6
1988   LIBS="$LIBS -ldir"
1989 else
1990   echo "$ac_t""no" 1>&6
1991 fi
1992
1993 else
1994 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
1995 echo "configure:2007: checking for opendir in -lx" >&5
1996 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
1997 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1998   echo $ac_n "(cached) $ac_c" 1>&6
1999 else
2000   ac_save_LIBS="$LIBS"
2001 LIBS="-lx  $LIBS"
2002 cat > conftest.$ac_ext <<EOF
2003 #line 2015 "configure"
2004 #include "confdefs.h"
2005 /* Override any gcc2 internal prototype to avoid an error.  */
2006 /* We use char because int might match the return type of a gcc2
2007     builtin and then its argument prototype would still apply.  */
2008 char opendir();
2009
2010 int main() {
2011 opendir()
2012 ; return 0; }
2013 EOF
2014 if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2015   rm -rf conftest*
2016   eval "ac_cv_lib_$ac_lib_var=yes"
2017 else
2018   echo "configure: failed program was:" >&5
2019   cat conftest.$ac_ext >&5
2020   rm -rf conftest*
2021   eval "ac_cv_lib_$ac_lib_var=no"
2022 fi
2023 rm -f conftest*
2024 LIBS="$ac_save_LIBS"
2025
2026 fi
2027 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2028   echo "$ac_t""yes" 1>&6
2029   LIBS="$LIBS -lx"
2030 else
2031   echo "$ac_t""no" 1>&6
2032 fi
2033
2034 fi
2035
2036 echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
2037 echo "configure:2049: checking how to call gettimeofday" >&5
2038   if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
2039   echo $ac_n "(cached) $ac_c" 1>&6
2040 else
2041   cat > conftest.$ac_ext <<EOF
2042 #line 2054 "configure"
2043 #include "confdefs.h"
2044 #include <stdlib.h>
2045                     #include <sys/time.h>
2046 int main() {
2047 struct timeval tv; struct timezone tzp;
2048                     gettimeofday(&tv, &tzp);
2049 ; return 0; }
2050 EOF
2051 if { (eval echo configure:2063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2052   rm -rf conftest*
2053   ac_gettimeofday_args=2
2054 else
2055   echo "configure: failed program was:" >&5
2056   cat conftest.$ac_ext >&5
2057   rm -rf conftest*
2058   cat > conftest.$ac_ext <<EOF
2059 #line 2071 "configure"
2060 #include "confdefs.h"
2061 #include <stdlib.h>
2062                                     #include <sys/time.h>
2063 int main() {
2064 struct timeval tv; gettimeofday(&tv);
2065 ; return 0; }
2066 EOF
2067 if { (eval echo configure:2079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2068   rm -rf conftest*
2069   ac_gettimeofday_args=1
2070 else
2071   echo "configure: failed program was:" >&5
2072   cat conftest.$ac_ext >&5
2073   rm -rf conftest*
2074   ac_gettimeofday_args=0
2075 fi
2076 rm -f conftest*
2077 fi
2078 rm -f conftest*
2079     ac_cv_gettimeofday_args=$ac_gettimeofday_args
2080 fi
2081
2082   ac_gettimeofday_args=$ac_cv_gettimeofday_args
2083   if test "$ac_gettimeofday_args" = 1 ; then
2084     cat >> confdefs.h <<\EOF
2085 #define HAVE_GETTIMEOFDAY 1
2086 EOF
2087
2088     echo "$ac_t""one argument" 1>&6
2089   elif test "$ac_gettimeofday_args" = 2 ; then
2090     cat >> confdefs.h <<\EOF
2091 #define HAVE_GETTIMEOFDAY 1
2092 EOF
2093
2094     cat >> confdefs.h <<\EOF
2095 #define GETTIMEOFDAY_TWO_ARGS 1
2096 EOF
2097
2098     echo "$ac_t""two arguments" 1>&6
2099   else
2100     echo "$ac_t""unknown" 1>&6
2101   fi
2102
2103 for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
2104 do
2105 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2106 echo "configure:2118: checking for $ac_func" >&5
2107 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2108   echo $ac_n "(cached) $ac_c" 1>&6
2109 else
2110   cat > conftest.$ac_ext <<EOF
2111 #line 2123 "configure"
2112 #include "confdefs.h"
2113 /* System header to define __stub macros and hopefully few prototypes,
2114     which can conflict with char $ac_func(); below.  */
2115 #include <assert.h>
2116 /* Override any gcc2 internal prototype to avoid an error.  */
2117 /* We use char because int might match the return type of a gcc2
2118     builtin and then its argument prototype would still apply.  */
2119 char $ac_func();
2120
2121 int main() {
2122
2123 /* The GNU C library defines this for functions which it implements
2124     to always fail with ENOSYS.  Some functions are actually named
2125     something starting with __ and the normal name is an alias.  */
2126 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2127 choke me
2128 #else
2129 $ac_func();
2130 #endif
2131
2132 ; return 0; }
2133 EOF
2134 if { (eval echo configure:2146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2135   rm -rf conftest*
2136   eval "ac_cv_func_$ac_func=yes"
2137 else
2138   echo "configure: failed program was:" >&5
2139   cat conftest.$ac_ext >&5
2140   rm -rf conftest*
2141   eval "ac_cv_func_$ac_func=no"
2142 fi
2143 rm -f conftest*
2144 fi
2145
2146 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2147   echo "$ac_t""yes" 1>&6
2148     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2149   cat >> confdefs.h <<EOF
2150 #define $ac_tr_func 1
2151 EOF
2152  
2153 else
2154   echo "$ac_t""no" 1>&6
2155 fi
2156 done
2157
2158
2159 for ac_func in sigaction syslog realpath setrlimit
2160 do
2161 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2162 echo "configure:2174: checking for $ac_func" >&5
2163 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2164   echo $ac_n "(cached) $ac_c" 1>&6
2165 else
2166   cat > conftest.$ac_ext <<EOF
2167 #line 2179 "configure"
2168 #include "confdefs.h"
2169 /* System header to define __stub macros and hopefully few prototypes,
2170     which can conflict with char $ac_func(); below.  */
2171 #include <assert.h>
2172 /* Override any gcc2 internal prototype to avoid an error.  */
2173 /* We use char because int might match the return type of a gcc2
2174     builtin and then its argument prototype would still apply.  */
2175 char $ac_func();
2176
2177 int main() {
2178
2179 /* The GNU C library defines this for functions which it implements
2180     to always fail with ENOSYS.  Some functions are actually named
2181     something starting with __ and the normal name is an alias.  */
2182 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2183 choke me
2184 #else
2185 $ac_func();
2186 #endif
2187
2188 ; return 0; }
2189 EOF
2190 if { (eval echo configure:2202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2191   rm -rf conftest*
2192   eval "ac_cv_func_$ac_func=yes"
2193 else
2194   echo "configure: failed program was:" >&5
2195   cat conftest.$ac_ext >&5
2196   rm -rf conftest*
2197   eval "ac_cv_func_$ac_func=no"
2198 fi
2199 rm -f conftest*
2200 fi
2201
2202 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2203   echo "$ac_t""yes" 1>&6
2204     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2205   cat >> confdefs.h <<EOF
2206 #define $ac_tr_func 1
2207 EOF
2208  
2209 else
2210   echo "$ac_t""no" 1>&6
2211 fi
2212 done
2213
2214 echo $ac_n "checking for struct icmp""... $ac_c" 1>&6
2215 echo "configure:2227: checking for struct icmp" >&5
2216 if eval "test \"`echo '$''{'ac_cv_have_icmp'+set}'`\" = set"; then
2217   echo $ac_n "(cached) $ac_c" 1>&6
2218 else
2219   cat > conftest.$ac_ext <<EOF
2220 #line 2232 "configure"
2221 #include "confdefs.h"
2222 #include <stdlib.h>
2223                    #include <stdio.h>
2224                    #include <math.h>
2225                    #include <unistd.h>
2226                    #include <limits.h>
2227                    #include <signal.h>
2228                    #include <fcntl.h>
2229                    #include <sys/types.h>
2230                    #include <sys/time.h>
2231                    #include <sys/ipc.h>
2232                    #include <sys/shm.h>
2233                    #include <sys/socket.h>
2234                    #include <netinet/in_systm.h>
2235                    #include <netinet/in.h>
2236                    #include <netinet/ip.h>
2237                    #include <netinet/ip_icmp.h>
2238                    #include <netinet/udp.h>
2239                    #include <arpa/inet.h>
2240                    #include <netdb.h>
2241 int main() {
2242 struct icmp i;
2243                    struct sockaddr s;
2244                    struct sockaddr_in si;
2245                    struct ip ip;
2246                    i.icmp_type = ICMP_ECHO;
2247                    i.icmp_code = 0;
2248                    i.icmp_cksum = 0;
2249                    i.icmp_id = 0;
2250                    i.icmp_seq = 0;
2251                    si.sin_family = AF_INET;
2252                    #if defined(__DECC) || defined(_IP_VHL)
2253                    ip.ip_vhl = 0;
2254                    #else
2255                    ip.ip_hl = 0;
2256                    #endif
2257                    
2258 ; return 0; }
2259 EOF
2260 if { (eval echo configure:2272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2261   rm -rf conftest*
2262   ac_cv_have_icmp=yes
2263 else
2264   echo "configure: failed program was:" >&5
2265   cat conftest.$ac_ext >&5
2266   rm -rf conftest*
2267   ac_cv_have_icmp=no
2268 fi
2269 rm -f conftest*
2270 fi
2271
2272 echo "$ac_t""$ac_cv_have_icmp" 1>&6
2273  if test "$ac_cv_have_icmp" = yes ; then
2274    cat >> confdefs.h <<\EOF
2275 #define HAVE_ICMP 1
2276 EOF
2277
2278  fi
2279 echo $ac_n "checking for struct icmphdr""... $ac_c" 1>&6
2280 echo "configure:2292: checking for struct icmphdr" >&5
2281 if eval "test \"`echo '$''{'ac_cv_have_icmphdr'+set}'`\" = set"; then
2282   echo $ac_n "(cached) $ac_c" 1>&6
2283 else
2284   cat > conftest.$ac_ext <<EOF
2285 #line 2297 "configure"
2286 #include "confdefs.h"
2287 #include <stdlib.h>
2288                    #include <stdio.h>
2289                    #include <math.h>
2290                    #include <unistd.h>
2291                    #include <limits.h>
2292                    #include <signal.h>
2293                    #include <fcntl.h>
2294                    #include <sys/types.h>
2295                    #include <sys/time.h>
2296                    #include <sys/ipc.h>
2297                    #include <sys/shm.h>
2298                    #include <sys/socket.h>
2299                    #include <netinet/in_systm.h>
2300                    #include <netinet/in.h>
2301                    #include <netinet/ip.h>
2302                    #include <netinet/ip_icmp.h>
2303                    #include <netinet/udp.h>
2304                    #include <arpa/inet.h>
2305                    #include <netdb.h>
2306 int main() {
2307 struct icmphdr i;
2308                    struct sockaddr s;
2309                    struct sockaddr_in si;
2310                    struct ip ip;
2311                    i.type = ICMP_ECHO;
2312                    i.code = 0;
2313                    i.checksum = 0;
2314                    i.un.echo.id = 0;
2315                    i.un.echo.sequence = 0;
2316                    si.sin_family = AF_INET;
2317                    ip.ip_hl = 0;
2318 ; return 0; }
2319 EOF
2320 if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2321   rm -rf conftest*
2322   ac_cv_have_icmphdr=yes
2323 else
2324   echo "configure: failed program was:" >&5
2325   cat conftest.$ac_ext >&5
2326   rm -rf conftest*
2327   ac_cv_have_icmphdr=no
2328 fi
2329 rm -f conftest*
2330 fi
2331
2332 echo "$ac_t""$ac_cv_have_icmphdr" 1>&6
2333  if test "$ac_cv_have_icmphdr" = yes ; then
2334    cat >> confdefs.h <<\EOF
2335 #define HAVE_ICMPHDR 1
2336 EOF
2337
2338  fi
2339 for ac_hdr in crypt.h sys/select.h
2340 do
2341 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2342 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2343 echo "configure:2355: checking for $ac_hdr" >&5
2344 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2345   echo $ac_n "(cached) $ac_c" 1>&6
2346 else
2347   cat > conftest.$ac_ext <<EOF
2348 #line 2360 "configure"
2349 #include "confdefs.h"
2350 #include <$ac_hdr>
2351 EOF
2352 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2353 { (eval echo configure:2365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2354 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2355 if test -z "$ac_err"; then
2356   rm -rf conftest*
2357   eval "ac_cv_header_$ac_safe=yes"
2358 else
2359   echo "$ac_err" >&5
2360   echo "configure: failed program was:" >&5
2361   cat conftest.$ac_ext >&5
2362   rm -rf conftest*
2363   eval "ac_cv_header_$ac_safe=no"
2364 fi
2365 rm -f conftest*
2366 fi
2367 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2368   echo "$ac_t""yes" 1>&6
2369     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2370   cat >> confdefs.h <<EOF
2371 #define $ac_tr_hdr 1
2372 EOF
2373  
2374 else
2375   echo "$ac_t""no" 1>&6
2376 fi
2377 done
2378
2379 for ac_prog in perl5 perl
2380 do
2381 # Extract the first word of "$ac_prog", so it can be a program name with args.
2382 set dummy $ac_prog; ac_word=$2
2383 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2384 echo "configure:2396: checking for $ac_word" >&5
2385 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
2386   echo $ac_n "(cached) $ac_c" 1>&6
2387 else
2388   case "$PERL" in
2389   /*)
2390   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
2391   ;;
2392   ?:/*)                  
2393   ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
2394   ;;
2395   *)
2396   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2397   ac_dummy="$PATH"
2398   for ac_dir in $ac_dummy; do 
2399     test -z "$ac_dir" && ac_dir=.
2400     if test -f $ac_dir/$ac_word; then
2401       ac_cv_path_PERL="$ac_dir/$ac_word"
2402       break
2403     fi
2404   done
2405   IFS="$ac_save_ifs"
2406   ;;
2407 esac
2408 fi
2409 PERL="$ac_cv_path_PERL"
2410 if test -n "$PERL"; then
2411   echo "$ac_t""$PERL" 1>&6
2412 else
2413   echo "$ac_t""no" 1>&6
2414 fi
2415
2416 test -n "$PERL" && break
2417 done
2418
2419   if test -z "$PERL" ; then
2420     PERL_VERSION=0
2421   else
2422     echo $ac_n "checking perl version""... $ac_c" 1>&6
2423 echo "configure:2435: checking perl version" >&5
2424 if eval "test \"`echo '$''{'ac_cv_perl_version'+set}'`\" = set"; then
2425   echo $ac_n "(cached) $ac_c" 1>&6
2426 else
2427   ac_cv_perl_version=`$PERL -e "$perl_version_cmd"`
2428 fi
2429
2430 echo "$ac_t""$ac_cv_perl_version" 1>&6
2431     PERL_VERSION=$ac_cv_perl_version
2432   fi
2433  
2434
2435 if test -z "$PERL" ; then
2436   # don't let it be blank...
2437   PERL=/usr/bin/perl
2438 fi
2439
2440 # If we find X, set shell vars x_includes and x_libraries to the
2441 # paths, otherwise set no_x=yes.
2442 # Uses ac_ vars as temps to allow command line to override cache and checks.
2443 # --without-x overrides everything else, but does not touch the cache.
2444 echo $ac_n "checking for X""... $ac_c" 1>&6
2445 echo "configure:2457: checking for X" >&5
2446
2447 # Check whether --with-x or --without-x was given.
2448 if test "${with_x+set}" = set; then
2449   withval="$with_x"
2450   :
2451 fi
2452
2453 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
2454 if test "x$with_x" = xno; then
2455   # The user explicitly disabled X.
2456   have_x=disabled
2457 else
2458   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
2459     # Both variables are already set.
2460     have_x=yes
2461   else
2462 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
2463   echo $ac_n "(cached) $ac_c" 1>&6
2464 else
2465   # One or both of the vars are not set, and there is no cached value.
2466 ac_x_includes=NO ac_x_libraries=NO
2467 rm -fr conftestdir
2468 if mkdir conftestdir; then
2469   cd conftestdir
2470   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2471   cat > Imakefile <<'EOF'
2472 acfindx:
2473         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
2474 EOF
2475   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2476     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2477     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2478     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
2479     for ac_extension in a so sl; do
2480       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
2481         test -f $ac_im_libdir/libX11.$ac_extension; then
2482         ac_im_usrlibdir=$ac_im_libdir; break
2483       fi
2484     done
2485     # Screen out bogus values from the imake configuration.  They are
2486     # bogus both because they are the default anyway, and because
2487     # using them would break gcc on systems where it needs fixed includes.
2488     case "$ac_im_incroot" in
2489         /usr/include) ;;
2490         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
2491     esac
2492     case "$ac_im_usrlibdir" in
2493         /usr/lib | /lib) ;;
2494         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
2495     esac
2496   fi
2497   cd ..
2498   rm -fr conftestdir
2499 fi
2500
2501 if test "$ac_x_includes" = NO; then
2502   # Guess where to find include files, by looking for this one X11 .h file.
2503   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
2504
2505   # First, try using that file with no special directory specified.
2506 cat > conftest.$ac_ext <<EOF
2507 #line 2519 "configure"
2508 #include "confdefs.h"
2509 #include <$x_direct_test_include>
2510 EOF
2511 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2512 { (eval echo configure:2524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2513 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2514 if test -z "$ac_err"; then
2515   rm -rf conftest*
2516   # We can compile using X headers with no special include directory.
2517 ac_x_includes=
2518 else
2519   echo "$ac_err" >&5
2520   echo "configure: failed program was:" >&5
2521   cat conftest.$ac_ext >&5
2522   rm -rf conftest*
2523   # Look for the header file in a standard set of common directories.
2524 # Check X11 before X11Rn because it is often a symlink to the current release.
2525   for ac_dir in               \
2526     /usr/X11/include          \
2527     /usr/X11R6/include        \
2528     /usr/X11R5/include        \
2529     /usr/X11R4/include        \
2530                               \
2531     /usr/include/X11          \
2532     /usr/include/X11R6        \
2533     /usr/include/X11R5        \
2534     /usr/include/X11R4        \
2535                               \
2536     /usr/local/X11/include    \
2537     /usr/local/X11R6/include  \
2538     /usr/local/X11R5/include  \
2539     /usr/local/X11R4/include  \
2540                               \
2541     /usr/local/include/X11    \
2542     /usr/local/include/X11R6  \
2543     /usr/local/include/X11R5  \
2544     /usr/local/include/X11R4  \
2545                               \
2546     /usr/X386/include         \
2547     /usr/x386/include         \
2548     /usr/XFree86/include/X11  \
2549                               \
2550     /usr/include              \
2551     /usr/local/include        \
2552     /usr/unsupported/include  \
2553     /usr/athena/include       \
2554     /usr/local/x11r5/include  \
2555     /usr/lpp/Xamples/include  \
2556                               \
2557     /usr/openwin/include      \
2558     /usr/openwin/share/include \
2559     ; \
2560   do
2561     if test -r "$ac_dir/$x_direct_test_include"; then
2562       ac_x_includes=$ac_dir
2563       break
2564     fi
2565   done
2566 fi
2567 rm -f conftest*
2568 fi # $ac_x_includes = NO
2569
2570 if test "$ac_x_libraries" = NO; then
2571   # Check for the libraries.
2572
2573   test -z "$x_direct_test_library" && x_direct_test_library=Xt
2574   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2575
2576   # See if we find them without any special options.
2577   # Don't add to $LIBS permanently.
2578   ac_save_LIBS="$LIBS"
2579   LIBS="-l$x_direct_test_library $LIBS"
2580 cat > conftest.$ac_ext <<EOF
2581 #line 2593 "configure"
2582 #include "confdefs.h"
2583
2584 int main() {
2585 ${x_direct_test_function}()
2586 ; return 0; }
2587 EOF
2588 if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2589   rm -rf conftest*
2590   LIBS="$ac_save_LIBS"
2591 # We can link X programs with no special library path.
2592 ac_x_libraries=
2593 else
2594   echo "configure: failed program was:" >&5
2595   cat conftest.$ac_ext >&5
2596   rm -rf conftest*
2597   LIBS="$ac_save_LIBS"
2598 # First see if replacing the include by lib works.
2599 # Check X11 before X11Rn because it is often a symlink to the current release.
2600 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2601     /usr/X11/lib          \
2602     /usr/X11R6/lib        \
2603     /usr/X11R5/lib        \
2604     /usr/X11R4/lib        \
2605                           \
2606     /usr/lib/X11          \
2607     /usr/lib/X11R6        \
2608     /usr/lib/X11R5        \
2609     /usr/lib/X11R4        \
2610                           \
2611     /usr/local/X11/lib    \
2612     /usr/local/X11R6/lib  \
2613     /usr/local/X11R5/lib  \
2614     /usr/local/X11R4/lib  \
2615                           \
2616     /usr/local/lib/X11    \
2617     /usr/local/lib/X11R6  \
2618     /usr/local/lib/X11R5  \
2619     /usr/local/lib/X11R4  \
2620                           \
2621     /usr/X386/lib         \
2622     /usr/x386/lib         \
2623     /usr/XFree86/lib/X11  \
2624                           \
2625     /usr/lib              \
2626     /usr/local/lib        \
2627     /usr/unsupported/lib  \
2628     /usr/athena/lib       \
2629     /usr/local/x11r5/lib  \
2630     /usr/lpp/Xamples/lib  \
2631     /lib/usr/lib/X11      \
2632                           \
2633     /usr/openwin/lib      \
2634     /usr/openwin/share/lib \
2635     ; \
2636 do
2637   for ac_extension in a so sl; do
2638     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2639       ac_x_libraries=$ac_dir
2640       break 2
2641     fi
2642   done
2643 done
2644 fi
2645 rm -f conftest*
2646 fi # $ac_x_libraries = NO
2647
2648 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2649   # Didn't find X anywhere.  Cache the known absence of X.
2650   ac_cv_have_x="have_x=no"
2651 else
2652   # Record where we found X for the cache.
2653   ac_cv_have_x="have_x=yes \
2654                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2655 fi
2656 fi
2657   fi
2658   eval "$ac_cv_have_x"
2659 fi # $with_x != no
2660
2661 if test "$have_x" != yes; then
2662   echo "$ac_t""$have_x" 1>&6
2663   no_x=yes
2664 else
2665   # If each of the values was on the command line, it overrides each guess.
2666   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2667   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2668   # Update the cache value to reflect the command line values.
2669   ac_cv_have_x="have_x=yes \
2670                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2671   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2672 fi
2673
2674 if test "$no_x" = yes; then
2675   # Not all programs may use this symbol, but it does not hurt to define it.
2676   cat >> confdefs.h <<\EOF
2677 #define X_DISPLAY_MISSING 1
2678 EOF
2679
2680   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2681 else
2682   if test -n "$x_includes"; then
2683     X_CFLAGS="$X_CFLAGS -I$x_includes"
2684   fi
2685
2686   # It would also be nice to do this for all -L options, not just this one.
2687   if test -n "$x_libraries"; then
2688     X_LIBS="$X_LIBS -L$x_libraries"
2689     # For Solaris; some versions of Sun CC require a space after -R and
2690     # others require no space.  Words are not sufficient . . . .
2691     case "`(uname -sr) 2>/dev/null`" in
2692     "SunOS 5"*)
2693       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2694 echo "configure:2706: checking whether -R must be followed by a space" >&5
2695       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2696       cat > conftest.$ac_ext <<EOF
2697 #line 2709 "configure"
2698 #include "confdefs.h"
2699
2700 int main() {
2701
2702 ; return 0; }
2703 EOF
2704 if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2705   rm -rf conftest*
2706   ac_R_nospace=yes
2707 else
2708   echo "configure: failed program was:" >&5
2709   cat conftest.$ac_ext >&5
2710   rm -rf conftest*
2711   ac_R_nospace=no
2712 fi
2713 rm -f conftest*
2714       if test $ac_R_nospace = yes; then
2715         echo "$ac_t""no" 1>&6
2716         X_LIBS="$X_LIBS -R$x_libraries"
2717       else
2718         LIBS="$ac_xsave_LIBS -R $x_libraries"
2719         cat > conftest.$ac_ext <<EOF
2720 #line 2732 "configure"
2721 #include "confdefs.h"
2722
2723 int main() {
2724
2725 ; return 0; }
2726 EOF
2727 if { (eval echo configure:2739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2728   rm -rf conftest*
2729   ac_R_space=yes
2730 else
2731   echo "configure: failed program was:" >&5
2732   cat conftest.$ac_ext >&5
2733   rm -rf conftest*
2734   ac_R_space=no
2735 fi
2736 rm -f conftest*
2737         if test $ac_R_space = yes; then
2738           echo "$ac_t""yes" 1>&6
2739           X_LIBS="$X_LIBS -R $x_libraries"
2740         else
2741           echo "$ac_t""neither works" 1>&6
2742         fi
2743       fi
2744       LIBS="$ac_xsave_LIBS"
2745     esac
2746   fi
2747
2748   # Check for system-dependent libraries X programs must link with.
2749   # Do this before checking for the system-independent R6 libraries
2750   # (-lICE), since we may need -lsocket or whatever for X linking.
2751
2752   if test "$ISC" = yes; then
2753     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2754   else
2755     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2756     # libraries were built with DECnet support.  And karl@cs.umb.edu says
2757     # the Alpha needs dnet_stub (dnet does not exist).
2758     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2759 echo "configure:2771: checking for dnet_ntoa in -ldnet" >&5
2760 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2761 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2762   echo $ac_n "(cached) $ac_c" 1>&6
2763 else
2764   ac_save_LIBS="$LIBS"
2765 LIBS="-ldnet  $LIBS"
2766 cat > conftest.$ac_ext <<EOF
2767 #line 2779 "configure"
2768 #include "confdefs.h"
2769 /* Override any gcc2 internal prototype to avoid an error.  */
2770 /* We use char because int might match the return type of a gcc2
2771     builtin and then its argument prototype would still apply.  */
2772 char dnet_ntoa();
2773
2774 int main() {
2775 dnet_ntoa()
2776 ; return 0; }
2777 EOF
2778 if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2779   rm -rf conftest*
2780   eval "ac_cv_lib_$ac_lib_var=yes"
2781 else
2782   echo "configure: failed program was:" >&5
2783   cat conftest.$ac_ext >&5
2784   rm -rf conftest*
2785   eval "ac_cv_lib_$ac_lib_var=no"
2786 fi
2787 rm -f conftest*
2788 LIBS="$ac_save_LIBS"
2789
2790 fi
2791 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2792   echo "$ac_t""yes" 1>&6
2793   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2794 else
2795   echo "$ac_t""no" 1>&6
2796 fi
2797
2798     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2799       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2800 echo "configure:2812: checking for dnet_ntoa in -ldnet_stub" >&5
2801 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2802 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2803   echo $ac_n "(cached) $ac_c" 1>&6
2804 else
2805   ac_save_LIBS="$LIBS"
2806 LIBS="-ldnet_stub  $LIBS"
2807 cat > conftest.$ac_ext <<EOF
2808 #line 2820 "configure"
2809 #include "confdefs.h"
2810 /* Override any gcc2 internal prototype to avoid an error.  */
2811 /* We use char because int might match the return type of a gcc2
2812     builtin and then its argument prototype would still apply.  */
2813 char dnet_ntoa();
2814
2815 int main() {
2816 dnet_ntoa()
2817 ; return 0; }
2818 EOF
2819 if { (eval echo configure:2831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2820   rm -rf conftest*
2821   eval "ac_cv_lib_$ac_lib_var=yes"
2822 else
2823   echo "configure: failed program was:" >&5
2824   cat conftest.$ac_ext >&5
2825   rm -rf conftest*
2826   eval "ac_cv_lib_$ac_lib_var=no"
2827 fi
2828 rm -f conftest*
2829 LIBS="$ac_save_LIBS"
2830
2831 fi
2832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2833   echo "$ac_t""yes" 1>&6
2834   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2835 else
2836   echo "$ac_t""no" 1>&6
2837 fi
2838
2839     fi
2840
2841     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2842     # to get the SysV transport functions.
2843     # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2844     # needs -lnsl.
2845     # The nsl library prevents programs from opening the X display
2846     # on Irix 5.2, according to dickey@clark.net.
2847     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2848 echo "configure:2860: checking for gethostbyname" >&5
2849 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2850   echo $ac_n "(cached) $ac_c" 1>&6
2851 else
2852   cat > conftest.$ac_ext <<EOF
2853 #line 2865 "configure"
2854 #include "confdefs.h"
2855 /* System header to define __stub macros and hopefully few prototypes,
2856     which can conflict with char gethostbyname(); below.  */
2857 #include <assert.h>
2858 /* Override any gcc2 internal prototype to avoid an error.  */
2859 /* We use char because int might match the return type of a gcc2
2860     builtin and then its argument prototype would still apply.  */
2861 char gethostbyname();
2862
2863 int main() {
2864
2865 /* The GNU C library defines this for functions which it implements
2866     to always fail with ENOSYS.  Some functions are actually named
2867     something starting with __ and the normal name is an alias.  */
2868 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2869 choke me
2870 #else
2871 gethostbyname();
2872 #endif
2873
2874 ; return 0; }
2875 EOF
2876 if { (eval echo configure:2888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2877   rm -rf conftest*
2878   eval "ac_cv_func_gethostbyname=yes"
2879 else
2880   echo "configure: failed program was:" >&5
2881   cat conftest.$ac_ext >&5
2882   rm -rf conftest*
2883   eval "ac_cv_func_gethostbyname=no"
2884 fi
2885 rm -f conftest*
2886 fi
2887
2888 if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2889   echo "$ac_t""yes" 1>&6
2890   :
2891 else
2892   echo "$ac_t""no" 1>&6
2893 fi
2894
2895     if test $ac_cv_func_gethostbyname = no; then
2896       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2897 echo "configure:2909: checking for gethostbyname in -lnsl" >&5
2898 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2899 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2900   echo $ac_n "(cached) $ac_c" 1>&6
2901 else
2902   ac_save_LIBS="$LIBS"
2903 LIBS="-lnsl  $LIBS"
2904 cat > conftest.$ac_ext <<EOF
2905 #line 2917 "configure"
2906 #include "confdefs.h"
2907 /* Override any gcc2 internal prototype to avoid an error.  */
2908 /* We use char because int might match the return type of a gcc2
2909     builtin and then its argument prototype would still apply.  */
2910 char gethostbyname();
2911
2912 int main() {
2913 gethostbyname()
2914 ; return 0; }
2915 EOF
2916 if { (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2917   rm -rf conftest*
2918   eval "ac_cv_lib_$ac_lib_var=yes"
2919 else
2920   echo "configure: failed program was:" >&5
2921   cat conftest.$ac_ext >&5
2922   rm -rf conftest*
2923   eval "ac_cv_lib_$ac_lib_var=no"
2924 fi
2925 rm -f conftest*
2926 LIBS="$ac_save_LIBS"
2927
2928 fi
2929 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2930   echo "$ac_t""yes" 1>&6
2931   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2932 else
2933   echo "$ac_t""no" 1>&6
2934 fi
2935
2936     fi
2937
2938     # lieder@skyler.mavd.honeywell.com says without -lsocket,
2939     # socket/setsockopt and other routines are undefined under SCO ODT
2940     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2941     # on later versions), says simon@lia.di.epfl.ch: it contains
2942     # gethostby* variants that don't use the nameserver (or something).
2943     # -lsocket must be given before -lnsl if both are needed.
2944     # We assume that if connect needs -lnsl, so does gethostbyname.
2945     echo $ac_n "checking for connect""... $ac_c" 1>&6
2946 echo "configure:2958: checking for connect" >&5
2947 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2948   echo $ac_n "(cached) $ac_c" 1>&6
2949 else
2950   cat > conftest.$ac_ext <<EOF
2951 #line 2963 "configure"
2952 #include "confdefs.h"
2953 /* System header to define __stub macros and hopefully few prototypes,
2954     which can conflict with char connect(); below.  */
2955 #include <assert.h>
2956 /* Override any gcc2 internal prototype to avoid an error.  */
2957 /* We use char because int might match the return type of a gcc2
2958     builtin and then its argument prototype would still apply.  */
2959 char connect();
2960
2961 int main() {
2962
2963 /* The GNU C library defines this for functions which it implements
2964     to always fail with ENOSYS.  Some functions are actually named
2965     something starting with __ and the normal name is an alias.  */
2966 #if defined (__stub_connect) || defined (__stub___connect)
2967 choke me
2968 #else
2969 connect();
2970 #endif
2971
2972 ; return 0; }
2973 EOF
2974 if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2975   rm -rf conftest*
2976   eval "ac_cv_func_connect=yes"
2977 else
2978   echo "configure: failed program was:" >&5
2979   cat conftest.$ac_ext >&5
2980   rm -rf conftest*
2981   eval "ac_cv_func_connect=no"
2982 fi
2983 rm -f conftest*
2984 fi
2985
2986 if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2987   echo "$ac_t""yes" 1>&6
2988   :
2989 else
2990   echo "$ac_t""no" 1>&6
2991 fi
2992
2993     if test $ac_cv_func_connect = no; then
2994       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2995 echo "configure:3007: checking for connect in -lsocket" >&5
2996 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2997 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2998   echo $ac_n "(cached) $ac_c" 1>&6
2999 else
3000   ac_save_LIBS="$LIBS"
3001 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
3002 cat > conftest.$ac_ext <<EOF
3003 #line 3015 "configure"
3004 #include "confdefs.h"
3005 /* Override any gcc2 internal prototype to avoid an error.  */
3006 /* We use char because int might match the return type of a gcc2
3007     builtin and then its argument prototype would still apply.  */
3008 char connect();
3009
3010 int main() {
3011 connect()
3012 ; return 0; }
3013 EOF
3014 if { (eval echo configure:3026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3015   rm -rf conftest*
3016   eval "ac_cv_lib_$ac_lib_var=yes"
3017 else
3018   echo "configure: failed program was:" >&5
3019   cat conftest.$ac_ext >&5
3020   rm -rf conftest*
3021   eval "ac_cv_lib_$ac_lib_var=no"
3022 fi
3023 rm -f conftest*
3024 LIBS="$ac_save_LIBS"
3025
3026 fi
3027 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3028   echo "$ac_t""yes" 1>&6
3029   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
3030 else
3031   echo "$ac_t""no" 1>&6
3032 fi
3033
3034     fi
3035
3036     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
3037     echo $ac_n "checking for remove""... $ac_c" 1>&6
3038 echo "configure:3050: checking for remove" >&5
3039 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
3040   echo $ac_n "(cached) $ac_c" 1>&6
3041 else
3042   cat > conftest.$ac_ext <<EOF
3043 #line 3055 "configure"
3044 #include "confdefs.h"
3045 /* System header to define __stub macros and hopefully few prototypes,
3046     which can conflict with char remove(); below.  */
3047 #include <assert.h>
3048 /* Override any gcc2 internal prototype to avoid an error.  */
3049 /* We use char because int might match the return type of a gcc2
3050     builtin and then its argument prototype would still apply.  */
3051 char remove();
3052
3053 int main() {
3054
3055 /* The GNU C library defines this for functions which it implements
3056     to always fail with ENOSYS.  Some functions are actually named
3057     something starting with __ and the normal name is an alias.  */
3058 #if defined (__stub_remove) || defined (__stub___remove)
3059 choke me
3060 #else
3061 remove();
3062 #endif
3063
3064 ; return 0; }
3065 EOF
3066 if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3067   rm -rf conftest*
3068   eval "ac_cv_func_remove=yes"
3069 else
3070   echo "configure: failed program was:" >&5
3071   cat conftest.$ac_ext >&5
3072   rm -rf conftest*
3073   eval "ac_cv_func_remove=no"
3074 fi
3075 rm -f conftest*
3076 fi
3077
3078 if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
3079   echo "$ac_t""yes" 1>&6
3080   :
3081 else
3082   echo "$ac_t""no" 1>&6
3083 fi
3084
3085     if test $ac_cv_func_remove = no; then
3086       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
3087 echo "configure:3099: checking for remove in -lposix" >&5
3088 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
3089 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3090   echo $ac_n "(cached) $ac_c" 1>&6
3091 else
3092   ac_save_LIBS="$LIBS"
3093 LIBS="-lposix  $LIBS"
3094 cat > conftest.$ac_ext <<EOF
3095 #line 3107 "configure"
3096 #include "confdefs.h"
3097 /* Override any gcc2 internal prototype to avoid an error.  */
3098 /* We use char because int might match the return type of a gcc2
3099     builtin and then its argument prototype would still apply.  */
3100 char remove();
3101
3102 int main() {
3103 remove()
3104 ; return 0; }
3105 EOF
3106 if { (eval echo configure:3118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3107   rm -rf conftest*
3108   eval "ac_cv_lib_$ac_lib_var=yes"
3109 else
3110   echo "configure: failed program was:" >&5
3111   cat conftest.$ac_ext >&5
3112   rm -rf conftest*
3113   eval "ac_cv_lib_$ac_lib_var=no"
3114 fi
3115 rm -f conftest*
3116 LIBS="$ac_save_LIBS"
3117
3118 fi
3119 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3120   echo "$ac_t""yes" 1>&6
3121   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
3122 else
3123   echo "$ac_t""no" 1>&6
3124 fi
3125
3126     fi
3127
3128     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
3129     echo $ac_n "checking for shmat""... $ac_c" 1>&6
3130 echo "configure:3142: checking for shmat" >&5
3131 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
3132   echo $ac_n "(cached) $ac_c" 1>&6
3133 else
3134   cat > conftest.$ac_ext <<EOF
3135 #line 3147 "configure"
3136 #include "confdefs.h"
3137 /* System header to define __stub macros and hopefully few prototypes,
3138     which can conflict with char shmat(); below.  */
3139 #include <assert.h>
3140 /* Override any gcc2 internal prototype to avoid an error.  */
3141 /* We use char because int might match the return type of a gcc2
3142     builtin and then its argument prototype would still apply.  */
3143 char shmat();
3144
3145 int main() {
3146
3147 /* The GNU C library defines this for functions which it implements
3148     to always fail with ENOSYS.  Some functions are actually named
3149     something starting with __ and the normal name is an alias.  */
3150 #if defined (__stub_shmat) || defined (__stub___shmat)
3151 choke me
3152 #else
3153 shmat();
3154 #endif
3155
3156 ; return 0; }
3157 EOF
3158 if { (eval echo configure:3170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3159   rm -rf conftest*
3160   eval "ac_cv_func_shmat=yes"
3161 else
3162   echo "configure: failed program was:" >&5
3163   cat conftest.$ac_ext >&5
3164   rm -rf conftest*
3165   eval "ac_cv_func_shmat=no"
3166 fi
3167 rm -f conftest*
3168 fi
3169
3170 if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
3171   echo "$ac_t""yes" 1>&6
3172   :
3173 else
3174   echo "$ac_t""no" 1>&6
3175 fi
3176
3177     if test $ac_cv_func_shmat = no; then
3178       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
3179 echo "configure:3191: checking for shmat in -lipc" >&5
3180 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
3181 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3182   echo $ac_n "(cached) $ac_c" 1>&6
3183 else
3184   ac_save_LIBS="$LIBS"
3185 LIBS="-lipc  $LIBS"
3186 cat > conftest.$ac_ext <<EOF
3187 #line 3199 "configure"
3188 #include "confdefs.h"
3189 /* Override any gcc2 internal prototype to avoid an error.  */
3190 /* We use char because int might match the return type of a gcc2
3191     builtin and then its argument prototype would still apply.  */
3192 char shmat();
3193
3194 int main() {
3195 shmat()
3196 ; return 0; }
3197 EOF
3198 if { (eval echo configure:3210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3199   rm -rf conftest*
3200   eval "ac_cv_lib_$ac_lib_var=yes"
3201 else
3202   echo "configure: failed program was:" >&5
3203   cat conftest.$ac_ext >&5
3204   rm -rf conftest*
3205   eval "ac_cv_lib_$ac_lib_var=no"
3206 fi
3207 rm -f conftest*
3208 LIBS="$ac_save_LIBS"
3209
3210 fi
3211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3212   echo "$ac_t""yes" 1>&6
3213   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
3214 else
3215   echo "$ac_t""no" 1>&6
3216 fi
3217
3218     fi
3219   fi
3220
3221   # Check for libraries that X11R6 Xt/Xaw programs need.
3222   ac_save_LDFLAGS="$LDFLAGS"
3223   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
3224   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
3225   # check for ICE first), but we must link in the order -lSM -lICE or
3226   # we get undefined symbols.  So assume we have SM if we have ICE.
3227   # These have to be linked with before -lX11, unlike the other
3228   # libraries we check for below, so use a different variable.
3229   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
3230   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
3231 echo "configure:3243: checking for IceConnectionNumber in -lICE" >&5
3232 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
3233 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3234   echo $ac_n "(cached) $ac_c" 1>&6
3235 else
3236   ac_save_LIBS="$LIBS"
3237 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
3238 cat > conftest.$ac_ext <<EOF
3239 #line 3251 "configure"
3240 #include "confdefs.h"
3241 /* Override any gcc2 internal prototype to avoid an error.  */
3242 /* We use char because int might match the return type of a gcc2
3243     builtin and then its argument prototype would still apply.  */
3244 char IceConnectionNumber();
3245
3246 int main() {
3247 IceConnectionNumber()
3248 ; return 0; }
3249 EOF
3250 if { (eval echo configure:3262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3251   rm -rf conftest*
3252   eval "ac_cv_lib_$ac_lib_var=yes"
3253 else
3254   echo "configure: failed program was:" >&5
3255   cat conftest.$ac_ext >&5
3256   rm -rf conftest*
3257   eval "ac_cv_lib_$ac_lib_var=no"
3258 fi
3259 rm -f conftest*
3260 LIBS="$ac_save_LIBS"
3261
3262 fi
3263 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3264   echo "$ac_t""yes" 1>&6
3265   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
3266 else
3267   echo "$ac_t""no" 1>&6
3268 fi
3269
3270   LDFLAGS="$ac_save_LDFLAGS"
3271
3272 fi
3273
3274
3275 if test "$have_x" != yes; then
3276   { echo "configure: error: Couldn't find X11 headers/libs.  Try \`$0 --help'." 1>&2; exit 1; }
3277 fi
3278
3279
3280     echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
3281 echo "configure:3293: checking for X app-defaults directory" >&5
3282 if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
3283   echo $ac_n "(cached) $ac_c" 1>&6
3284 else
3285   
3286   rm -fr conftestdir
3287   if mkdir conftestdir; then
3288     cd conftestdir >&-
3289     # Make sure to not put "make" in the Imakefile rules, since we grep it out.
3290     cat > Imakefile <<'EOF'
3291 acfindx:
3292         @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
3293 EOF
3294     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
3295       # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
3296       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
3297     fi
3298     cd .. >&-
3299     rm -fr conftestdir
3300   fi
3301       if test x"$ac_x_app_defaults" = x; then
3302         
3303   # Look for the directory under a standard set of common directories.
3304   # Check X11 before X11Rn because it's often a symlink to the current release.
3305   for ac_dir in                                 \
3306     /usr/X11/lib/app-defaults                   \
3307     /usr/X11R6/lib/app-defaults                 \
3308     /usr/X11R6/lib/X11/app-defaults             \
3309     /usr/X11R5/lib/app-defaults                 \
3310     /usr/X11R5/lib/X11/app-defaults             \
3311     /usr/X11R4/lib/app-defaults                 \
3312     /usr/X11R4/lib/X11/app-defaults             \
3313                                                 \
3314     /usr/lib/X11/app-defaults                   \
3315     /usr/lib/X11R6/app-defaults                 \
3316     /usr/lib/X11R5/app-defaults                 \
3317     /usr/lib/X11R4/app-defaults                 \
3318                                                 \
3319     /usr/local/X11/lib/app-defaults             \
3320     /usr/local/X11R6/lib/app-defaults           \
3321     /usr/local/X11R5/lib/app-defaults           \
3322     /usr/local/X11R4/lib/app-defaults           \
3323                                                 \
3324     /usr/local/lib/X11/app-defaults             \
3325     /usr/local/lib/X11R6/app-defaults           \
3326     /usr/local/lib/X11R6/X11/app-defaults       \
3327     /usr/local/lib/X11R5/app-defaults           \
3328     /usr/local/lib/X11R5/X11/app-defaults       \
3329     /usr/local/lib/X11R4/app-defaults           \
3330     /usr/local/lib/X11R4/X11/app-defaults       \
3331                                                 \
3332     /usr/X386/lib/X11/app-defaults              \
3333     /usr/x386/lib/X11/app-defaults              \
3334     /usr/XFree86/lib/X11/app-defaults           \
3335                                                 \
3336     /usr/lib/X11/app-defaults                   \
3337     /usr/local/lib/X11/app-defaults             \
3338     /usr/unsupported/lib/X11/app-defaults       \
3339     /usr/athena/lib/X11/app-defaults            \
3340     /usr/local/x11r5/lib/X11/app-defaults       \
3341     /usr/lpp/Xamples/lib/X11/app-defaults       \
3342     /lib/usr/lib/X11/app-defaults               \
3343                                                 \
3344     /usr/openwin/lib/app-defaults               \
3345     /usr/openwin/lib/X11/app-defaults           \
3346     /usr/openwin/share/lib/app-defaults         \
3347     /usr/openwin/share/lib/X11/app-defaults     \
3348                                                 \
3349     /X11R6/lib/app-defaults                     \
3350     /X11R5/lib/app-defaults                     \
3351     /X11R4/lib/app-defaults                     \
3352     ; \
3353   do
3354     if test -d "$ac_dir"; then
3355       ac_x_app_defaults=$ac_dir
3356       break
3357     fi
3358   done
3359
3360       fi
3361       if test x"$ac_x_app_defaults" = x; then
3362         ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
3363       else
3364         # Record where we found app-defaults for the cache.
3365         ac_cv_x_app_defaults="$ac_x_app_defaults"
3366       fi
3367 fi
3368
3369 echo "$ac_t""$ac_cv_x_app_defaults" 1>&6
3370     eval ac_x_app_defaults="$ac_cv_x_app_defaults"
3371 case "$host" in
3372     *-hpux*)
3373
3374       # The following arcana was gleaned from conversations with
3375       # Eric Schwartz <erics@col.hp.com>:
3376       #
3377       # On HPUX 10.x, the parts of X that HP considers "standard" live in
3378       # /usr/{include,lib}/X11R6/.  The parts that HP doesn't consider
3379       # "standard", notably, Xaw and Xmu, live in /usr/contrib/X11R6/.
3380       # Yet /usr/contrib/X11R6/ comes preinstalled on all HPUX systems.
3381       # Also, there are symlinks from /usr/include/ and /usr/lib/ into
3382       # /usr/{include,lib}/X11R6/, so that (if you don't use Xmu at all)
3383       # you don't need any -I or -L arguments.
3384       #
3385       # On HPUX 9.x, /usr/{include,lib}/X11R5/ and /usr/contrib/X11R5/
3386       # are the same division as 10.x.  However, there are no symlinks to
3387       # the X stuff from /usr/include/ and /usr/lib/, so -I and -L
3388       # arguments are always necessary.
3389       #
3390       # However, X11R6 was available on HPUX 9.x as a patch: if that
3391       # patch was installed, then all of X11R6 went in to
3392       # /usr/contrib/X11R6/ (there was no /usr/{include,lib}/X11R6/.)
3393       #
3394       # HPUX 8.x was the same as 9.x, but was X11R4 instead (I don't know
3395       # whether R5 was available as a patch; R6 undoubtedly was not.)
3396       #
3397       # So.  We try and use the highest numbered pair of
3398       # /usr/{include,lib}/X11R?/ and /usr/contrib/X11R?/{include,lib}/
3399       # that are available.  We do not mix and match different versions
3400       # of X.
3401       #
3402       # Question I still don't know the answer to: (do you?)
3403       #
3404       #   * On HPUX 9.x, where /usr/include/X11R5/ was standard, and
3405       #     /usr/contrib/X11R6/ could be installed as a patch, what was in
3406       #     that contrib directory?  Did it contain so-called "standard"
3407       #     X11R6, or did it include Xaw and Xmu as well?  If the former,
3408       #     where did one find Xaw and Xmu on 9.x R6 systems?  Would this
3409       #     be a situation where one had to reach into the R5 headers and
3410       #     libs to find Xmu?  That is, must both R6 and R5 directories
3411       #     be on the -I and -L lists in that case?
3412       #
3413       for version in X11R6 X11R5 X11R4 ; do
3414         # if either pair of directories exists...
3415         if test -d /usr/include/$version || test -d /usr/contrib/$version/include
3416         then
3417            # if contrib exists, use it...
3418            if test -d /usr/contrib/$version/include ; then
3419              X_CFLAGS="$X_CFLAGS -I/usr/contrib/$version/include"
3420              X_LIBS="$X_LIBS -L/usr/contrib/$version/lib"
3421            fi
3422            # if the "standard" one exists, use it.
3423            if test -d /usr/include/$version ; then
3424              X_CFLAGS="$X_CFLAGS -I/usr/include/$version"
3425              X_LIBS="$X_LIBS -L/usr/lib/$version"
3426            fi
3427            # since at least one of the pair exists, go no farther.
3428            break
3429         fi
3430       done
3431
3432       # Now find Motif.  Thanks for not making xmkmf find this by
3433       # default, you losers.
3434       #
3435       if test -d /usr/include/Motif2.1 ; then
3436         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif2.1"
3437         X_LIBS="$X_LIBS -L/usr/lib/Motif2.1"
3438       elif test -d /usr/include/Motif1.2 ; then
3439         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.2"
3440         X_LIBS="$X_LIBS -L/usr/lib/Motif1.2"
3441       elif test -d /usr/include/Motif1.1 ; then
3442         X_CFLAGS="$X_CFLAGS -I/usr/include/Motif1.1"
3443         X_LIBS="$X_LIBS -L/usr/lib/Motif1.1"
3444       fi
3445
3446       # Now let's check for the pseudo-standard locations for OpenGL and XPM.
3447       #
3448       if test -d /opt/graphics/OpenGL/include ; then
3449         # HP-UX 10.20 puts it here
3450         X_CFLAGS="-I/opt/graphics/OpenGL/include $X_CFLAGS"
3451         X_LIBS="-L/opt/graphics/OpenGL/lib $X_LIBS"
3452       elif test -d /opt/Mesa/lib ; then
3453         X_CFLAGS="-I/opt/Mesa/include $X_CFLAGS"
3454         X_LIBS="-L/opt/Mesa/lib $X_LIBS"
3455       fi
3456
3457
3458       if test -d /opt/xpm/lib/X11 ; then
3459         X_CFLAGS="-I/opt/xpm/include $X_CFLAGS"
3460         X_LIBS="-L/opt/xpm/lib/X11 $X_LIBS"
3461       fi
3462
3463       # On HPUX, default to installing in /opt/xscreensaver/ instead of
3464       # in /usr/local/, unless there is already an xscreensaver in
3465       # /usr/local/bin/.  This can be overridden with the --prefix arg
3466       # to configure.  I'm not sure this is the right thing to do, but
3467       # Richard Lloyd says so...
3468       #
3469       if test \! -x /usr/local/bin/xscreensaver ; then
3470         ac_default_prefix=/opt/xscreensaver
3471       fi
3472
3473     ;;
3474     *-solaris*)
3475
3476       # Thanks for not making xmkmf find this by default, pinheads.
3477       # And thanks for moving things around again, too.  Is this
3478       # really the standard location now?  What happened to the
3479       # joke that this kind of thing went in /opt?
3480       # cthomp says "answer: CDE (Common Disorganized Environment)"
3481       #
3482       if test -f /usr/dt/include/Xm/Xm.h ; then
3483         X_CFLAGS="$X_CFLAGS -I/usr/dt/include"
3484         X_LIBS="$X_LIBS -L/usr/dt/lib -R:/usr/dt/lib"
3485
3486         # Some versions of Slowlaris Motif require -lgen.  But not all.  Why?
3487         echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
3488 echo "configure:3500: checking for regcmp in -lgen" >&5
3489 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
3490 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3491   echo $ac_n "(cached) $ac_c" 1>&6
3492 else
3493   ac_save_LIBS="$LIBS"
3494 LIBS="-lgen  $LIBS"
3495 cat > conftest.$ac_ext <<EOF
3496 #line 3508 "configure"
3497 #include "confdefs.h"
3498 /* Override any gcc2 internal prototype to avoid an error.  */
3499 /* We use char because int might match the return type of a gcc2
3500     builtin and then its argument prototype would still apply.  */
3501 char regcmp();
3502
3503 int main() {
3504 regcmp()
3505 ; return 0; }
3506 EOF
3507 if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3508   rm -rf conftest*
3509   eval "ac_cv_lib_$ac_lib_var=yes"
3510 else
3511   echo "configure: failed program was:" >&5
3512   cat conftest.$ac_ext >&5
3513   rm -rf conftest*
3514   eval "ac_cv_lib_$ac_lib_var=no"
3515 fi
3516 rm -f conftest*
3517 LIBS="$ac_save_LIBS"
3518
3519 fi
3520 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3521   echo "$ac_t""yes" 1>&6
3522   X_LIBS="$X_LIBS -lgen"
3523 else
3524   echo "$ac_t""no" 1>&6
3525 fi
3526
3527       fi
3528     ;;
3529   esac
3530 echo $ac_n "checking for XPointer""... $ac_c" 1>&6
3531 echo "configure:3543: checking for XPointer" >&5
3532 if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
3533   echo $ac_n "(cached) $ac_c" 1>&6
3534 else
3535   
3536   ac_save_CPPFLAGS="$CPPFLAGS"
3537   if test \! -z "$includedir" ; then 
3538     CPPFLAGS="$CPPFLAGS -I$includedir"
3539   fi
3540   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3541   cat > conftest.$ac_ext <<EOF
3542 #line 3554 "configure"
3543 #include "confdefs.h"
3544 #include <X11/Xlib.h>
3545 int main() {
3546 XPointer foo = (XPointer) 0;
3547 ; return 0; }
3548 EOF
3549 if { (eval echo configure:3561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3550   rm -rf conftest*
3551   ac_cv_xpointer=yes
3552 else
3553   echo "configure: failed program was:" >&5
3554   cat conftest.$ac_ext >&5
3555   rm -rf conftest*
3556   ac_cv_xpointer=no
3557 fi
3558 rm -f conftest*
3559   CPPFLAGS="$ac_save_CPPFLAGS"
3560 fi
3561
3562 echo "$ac_t""$ac_cv_xpointer" 1>&6
3563   if test "$ac_cv_xpointer" != yes; then
3564    cat >> confdefs.h <<\EOF
3565 #define XPointer char*
3566 EOF
3567
3568   fi
3569
3570
3571
3572 ###############################################################################
3573 #
3574 #       Check for -lXmu (some fucked up vendors don't ship it...)
3575 #
3576 ###############################################################################
3577
3578 have_xmu=no
3579
3580   ac_save_CPPFLAGS="$CPPFLAGS"
3581   if test \! -z "$includedir" ; then 
3582     CPPFLAGS="$CPPFLAGS -I$includedir"
3583   fi
3584   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3585   ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
3586 echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
3587 echo "configure:3599: checking for X11/Xmu/Error.h" >&5
3588 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3589   echo $ac_n "(cached) $ac_c" 1>&6
3590 else
3591   cat > conftest.$ac_ext <<EOF
3592 #line 3604 "configure"
3593 #include "confdefs.h"
3594 #include <X11/Xmu/Error.h>
3595 EOF
3596 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3597 { (eval echo configure:3609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3598 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3599 if test -z "$ac_err"; then
3600   rm -rf conftest*
3601   eval "ac_cv_header_$ac_safe=yes"
3602 else
3603   echo "$ac_err" >&5
3604   echo "configure: failed program was:" >&5
3605   cat conftest.$ac_ext >&5
3606   rm -rf conftest*
3607   eval "ac_cv_header_$ac_safe=no"
3608 fi
3609 rm -f conftest*
3610 fi
3611 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3612   echo "$ac_t""yes" 1>&6
3613   have_xmu=yes
3614 else
3615   echo "$ac_t""no" 1>&6
3616 fi
3617
3618   CPPFLAGS="$ac_save_CPPFLAGS"
3619 if test "$have_xmu" = no ; then
3620   XMU_SRCS='$(UTILS_SRC)/xmu.c'
3621   XMU_OBJS='$(UTILS_BIN)/xmu.o'
3622   XMU_LIBS=''
3623 else
3624   XMU_SRCS=''
3625   XMU_OBJS=''
3626   XMU_LIBS='-lXmu'
3627   cat >> confdefs.h <<\EOF
3628 #define HAVE_XMU 1
3629 EOF
3630
3631 fi
3632
3633
3634 ###############################################################################
3635 #
3636 #       Check for the SunOS 4.1.x _get_wmShellWidgetClass bug.
3637 #       See comp.windows.x FAQ question 124.  The right fix is to
3638 #       get OpenWindows 3.0 patches 100512-02 and 100573-03.
3639 #
3640 ###############################################################################
3641
3642 if test "$have_xmu" = yes ; then
3643   case "$host" in
3644     *-sunos4*)
3645     echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
3646 echo "configure:3658: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
3647 if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
3648   echo $ac_n "(cached) $ac_c" 1>&6
3649 else
3650   ac_save_LDFLAGS="$LDFLAGS"
3651                     if test \! -z "$x_libraries" ; then
3652                       LDFLAGS="$LDFLAGS -L$x_libraries"
3653                     fi
3654                     # Note: this trick never works!  (Generally.)
3655                     # We're only getting away with using AC_TRY_LINK
3656                     # with X libraries because we know it's SunOS.
3657                     LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
3658                     cat > conftest.$ac_ext <<EOF
3659 #line 3671 "configure"
3660 #include "confdefs.h"
3661
3662 int main() {
3663
3664 ; return 0; }
3665 EOF
3666 if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3667   rm -rf conftest*
3668   ac_cv_sunos_xmu_bug=no
3669 else
3670   echo "configure: failed program was:" >&5
3671   cat conftest.$ac_ext >&5
3672   rm -rf conftest*
3673   ac_cv_sunos_xmu_bug=yes
3674 fi
3675 rm -f conftest*
3676                     LDFLAGS="$ac_save_LDFLAGS"
3677 fi
3678
3679 echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
3680     if test "$ac_cv_sunos_xmu_bug" = yes ; then
3681       echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
3682 echo "configure:3694: checking whether the compiler understands -static" >&5
3683 if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
3684   echo $ac_n "(cached) $ac_c" 1>&6
3685 else
3686   ac_save_LDFLAGS="$LDFLAGS"
3687                       LDFLAGS="$LDFLAGS -static"
3688                       cat > conftest.$ac_ext <<EOF
3689 #line 3701 "configure"
3690 #include "confdefs.h"
3691
3692 int main() {
3693
3694 ; return 0; }
3695 EOF
3696 if { (eval echo configure:3708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3697   rm -rf conftest*
3698   ac_cv_ld_static=yes
3699 else
3700   echo "configure: failed program was:" >&5
3701   cat conftest.$ac_ext >&5
3702   rm -rf conftest*
3703   ac_cv_ld_static=no
3704 fi
3705 rm -f conftest*
3706                     LDFLAGS="$ac_save_LDFLAGS"
3707 fi
3708
3709 echo "$ac_t""$ac_cv_ld_static" 1>&6
3710       if test "$ac_cv_ld_static" = yes ; then
3711         LDFLAGS="$LDFLAGS -static"
3712       else
3713         LDFLAGS="$LDFLAGS -Bstatic"
3714       fi
3715     fi
3716     ;;
3717   esac
3718 fi
3719
3720
3721 ###############################################################################
3722 #
3723 #       Handle the --with-hackdir option
3724 #
3725 ###############################################################################
3726
3727 have_hackdir=yes
3728 with_hackdir_req=unspecified
3729 # Check whether --with-hackdir or --without-hackdir was given.
3730 if test "${with_hackdir+set}" = set; then
3731   withval="$with_hackdir"
3732   with_hackdir="$withval"; with_hackdir_req="$withval"
3733 else
3734   with_hackdir=yes
3735 fi
3736
3737
3738 if test x"$with_hackdir" = xyes; then
3739   HACKDIR='${exec_prefix}/lib/xscreensaver'
3740 elif test x"$with_hackdir" = xno; then
3741   HACKDIR='${bindir}'
3742 else
3743   # there must be a better way than this...
3744   if test -z "`echo $with_hackdir | sed 's@^/.*@@'`" ; then
3745     # absolute path
3746     HACKDIR=$with_hackdir
3747   else
3748     # relative path
3749     HACKDIR="\${exec_prefix}$with_hackdir"
3750   fi
3751 fi
3752
3753 # canonicalize slashes.
3754 HACKDIR=`echo "${HACKDIR}" | sed 's@/$@@;s@//*@/@g'`
3755
3756 # This option used to be called --enable-subdir; make sure that is no longer
3757 # used, since configure brain-damagedly ignores unknown --enable options.
3758
3759 obsolete_enable=
3760 # Check whether --enable-subdir or --disable-subdir was given.
3761 if test "${enable_subdir+set}" = set; then
3762   enableval="$enable_subdir"
3763   obsolete_enable=yes
3764 fi
3765
3766 if test -n "$obsolete_enable"; then
3767   echo "error: the --enable-subdir option has been replaced with"
3768   echo "       the new --with-hackdir option; see \`configure --help'"
3769   echo "       for more information."
3770   exit 1
3771 fi
3772
3773
3774 ###############################################################################
3775 #
3776 #       Handle the --with-configdir option
3777 #
3778 ###############################################################################
3779
3780 have_configdir=yes
3781 with_configdir_req=unspecified
3782 # Check whether --with-configdir or --without-configdir was given.
3783 if test "${with_configdir+set}" = set; then
3784   withval="$with_configdir"
3785   with_configdir="$withval"; with_configdir_req="$withval"
3786 else
3787   with_configdir=yes
3788 fi
3789
3790
3791 if test x"$with_configdir" = xyes; then
3792   # filled in later...
3793   HACK_CONF_DIR=''
3794 elif test x"$with_configdir" = xno; then
3795   echo "error: must be yes, or a pathname: --with-configdir=$with_configdir"
3796   exit 1
3797 else
3798   # there must be a better way than this...
3799   if test -z "`echo $with_configdir | sed 's@^/.*@@'`" ; then
3800     # absolute path
3801     HACK_CONF_DIR=$with_configdir
3802   else
3803     # relative path
3804     HACK_CONF_DIR="\${exec_prefix}$with_configdir"
3805   fi
3806 fi
3807
3808
3809
3810
3811 ###############################################################################
3812 #
3813 #       Check for the SGI SCREEN_SAVER server extension.
3814 #
3815 ###############################################################################
3816
3817 have_sgi=no
3818 with_sgi_req=unspecified
3819 # Check whether --with-sgi-ext or --without-sgi-ext was given.
3820 if test "${with_sgi_ext+set}" = set; then
3821   withval="$with_sgi_ext"
3822   with_sgi="$withval"; with_sgi_req="$withval"
3823 else
3824   with_sgi=yes
3825 fi
3826
3827
3828
3829    case "$with_sgi" in
3830     yes) ;;
3831     no)  ;;
3832
3833     /*)
3834      echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
3835 echo "configure:3847: checking for SGI SCREEN_SAVER headers" >&5
3836      d=$with_sgi/include
3837      if test -d $d; then
3838        X_CFLAGS="-I$d $X_CFLAGS"
3839        echo "$ac_t""$d" 1>&6
3840      else
3841        echo "$ac_t""not found ($d: no such directory)" 1>&6
3842      fi
3843
3844      echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
3845 echo "configure:3857: checking for SGI SCREEN_SAVER libs" >&5
3846      d=$with_sgi/lib
3847      if test -d $d; then
3848        X_LIBS="-L$d $X_LIBS"
3849        echo "$ac_t""$d" 1>&6
3850      else
3851        echo "$ac_t""not found ($d: no such directory)" 1>&6
3852      fi
3853
3854      # replace the directory string with "yes".
3855      with_sgi_req="yes"
3856      with_sgi=$with_sgi_req
3857      ;;
3858
3859     *)
3860      echo ""
3861      echo "error: argument to --with-sgi-ext must be \"yes\", \"no\", or a directory."
3862      echo "       If it is a directory, then \`DIR/include' will be added to"
3863      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3864      exit 1
3865      ;;
3866    esac
3867   
3868
3869 if test "$with_sgi" = yes; then
3870   
3871   ac_save_CPPFLAGS="$CPPFLAGS"
3872   if test \! -z "$includedir" ; then 
3873     CPPFLAGS="$CPPFLAGS -I$includedir"
3874   fi
3875   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3876   ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
3877 echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
3878 echo "configure:3890: checking for X11/extensions/XScreenSaver.h" >&5
3879 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3880   echo $ac_n "(cached) $ac_c" 1>&6
3881 else
3882   cat > conftest.$ac_ext <<EOF
3883 #line 3895 "configure"
3884 #include "confdefs.h"
3885 #include <X11/extensions/XScreenSaver.h>
3886 EOF
3887 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3888 { (eval echo configure:3900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3889 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3890 if test -z "$ac_err"; then
3891   rm -rf conftest*
3892   eval "ac_cv_header_$ac_safe=yes"
3893 else
3894   echo "$ac_err" >&5
3895   echo "configure: failed program was:" >&5
3896   cat conftest.$ac_ext >&5
3897   rm -rf conftest*
3898   eval "ac_cv_header_$ac_safe=no"
3899 fi
3900 rm -f conftest*
3901 fi
3902 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3903   echo "$ac_t""yes" 1>&6
3904   have_sgi=yes
3905                      cat >> confdefs.h <<\EOF
3906 #define HAVE_SGI_SAVER_EXTENSION 1
3907 EOF
3908
3909 else
3910   echo "$ac_t""no" 1>&6
3911 fi
3912
3913   CPPFLAGS="$ac_save_CPPFLAGS"
3914
3915 elif test "$with_sgi" != no; then
3916   echo "error: must be yes or no: --with-sgi-ext=$with_sgi"
3917   exit 1
3918 fi
3919
3920
3921 ###############################################################################
3922 #
3923 #       Check for the MIT-SCREEN-SAVER server extension.
3924 #
3925 ###############################################################################
3926
3927 have_mit=no
3928 with_mit_req=unspecified
3929 # Check whether --with-mit-ext or --without-mit-ext was given.
3930 if test "${with_mit_ext+set}" = set; then
3931   withval="$with_mit_ext"
3932   with_mit="$withval"; with_mit_req="$withval"
3933 else
3934   with_mit=yes
3935 fi
3936
3937
3938
3939    case "$with_mit" in
3940     yes) ;;
3941     no)  ;;
3942
3943     /*)
3944      echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
3945 echo "configure:3957: checking for MIT-SCREEN-SAVER headers" >&5
3946      d=$with_mit/include
3947      if test -d $d; then
3948        X_CFLAGS="-I$d $X_CFLAGS"
3949        echo "$ac_t""$d" 1>&6
3950      else
3951        echo "$ac_t""not found ($d: no such directory)" 1>&6
3952      fi
3953
3954      echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
3955 echo "configure:3967: checking for MIT-SCREEN-SAVER libs" >&5
3956      d=$with_mit/lib
3957      if test -d $d; then
3958        X_LIBS="-L$d $X_LIBS"
3959        echo "$ac_t""$d" 1>&6
3960      else
3961        echo "$ac_t""not found ($d: no such directory)" 1>&6
3962      fi
3963
3964      # replace the directory string with "yes".
3965      with_mit_req="yes"
3966      with_mit=$with_mit_req
3967      ;;
3968
3969     *)
3970      echo ""
3971      echo "error: argument to --with-mit-ext must be \"yes\", \"no\", or a directory."
3972      echo "       If it is a directory, then \`DIR/include' will be added to"
3973      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
3974      exit 1
3975      ;;
3976    esac
3977   
3978
3979 if test "$with_mit" = yes; then
3980   
3981   ac_save_CPPFLAGS="$CPPFLAGS"
3982   if test \! -z "$includedir" ; then 
3983     CPPFLAGS="$CPPFLAGS -I$includedir"
3984   fi
3985   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
3986   ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
3987 echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
3988 echo "configure:4000: checking for X11/extensions/scrnsaver.h" >&5
3989 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3990   echo $ac_n "(cached) $ac_c" 1>&6
3991 else
3992   cat > conftest.$ac_ext <<EOF
3993 #line 4005 "configure"
3994 #include "confdefs.h"
3995 #include <X11/extensions/scrnsaver.h>
3996 EOF
3997 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3998 { (eval echo configure:4010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3999 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4000 if test -z "$ac_err"; then
4001   rm -rf conftest*
4002   eval "ac_cv_header_$ac_safe=yes"
4003 else
4004   echo "$ac_err" >&5
4005   echo "configure: failed program was:" >&5
4006   cat conftest.$ac_ext >&5
4007   rm -rf conftest*
4008   eval "ac_cv_header_$ac_safe=no"
4009 fi
4010 rm -f conftest*
4011 fi
4012 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4013   echo "$ac_t""yes" 1>&6
4014   have_mit=yes
4015 else
4016   echo "$ac_t""no" 1>&6
4017 fi
4018
4019   CPPFLAGS="$ac_save_CPPFLAGS"
4020
4021   # Now check to see if it's really in the library; XF86Free-3.3 ships
4022   # scrnsaver.h, but doesn't include the code in libXext.a, the idiots!
4023   #
4024   if test "$have_mit" = yes; then
4025     
4026   ac_save_CPPFLAGS="$CPPFLAGS"
4027   ac_save_LDFLAGS="$LDFLAGS"
4028 #  ac_save_LIBS="$LIBS"
4029
4030   if test \! -z "$includedir" ; then 
4031     CPPFLAGS="$CPPFLAGS -I$includedir"
4032   fi
4033   # note: $X_CFLAGS includes $x_includes
4034   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4035
4036   if test \! -z "$libdir" ; then
4037     LDFLAGS="$LDFLAGS -L$libdir"
4038   fi
4039   # note: $X_LIBS includes $x_libraries
4040   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4041
4042   echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
4043 echo "configure:4055: checking for XScreenSaverRegister in -lXext" >&5
4044 ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4045 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4046   echo $ac_n "(cached) $ac_c" 1>&6
4047 else
4048   ac_save_LIBS="$LIBS"
4049 LIBS="-lXext -lm $LIBS"
4050 cat > conftest.$ac_ext <<EOF
4051 #line 4063 "configure"
4052 #include "confdefs.h"
4053 /* Override any gcc2 internal prototype to avoid an error.  */
4054 /* We use char because int might match the return type of a gcc2
4055     builtin and then its argument prototype would still apply.  */
4056 char XScreenSaverRegister();
4057
4058 int main() {
4059 XScreenSaverRegister()
4060 ; return 0; }
4061 EOF
4062 if { (eval echo configure:4074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4063   rm -rf conftest*
4064   eval "ac_cv_lib_$ac_lib_var=yes"
4065 else
4066   echo "configure: failed program was:" >&5
4067   cat conftest.$ac_ext >&5
4068   rm -rf conftest*
4069   eval "ac_cv_lib_$ac_lib_var=no"
4070 fi
4071 rm -f conftest*
4072 LIBS="$ac_save_LIBS"
4073
4074 fi
4075 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4076   echo "$ac_t""yes" 1>&6
4077   true
4078 else
4079   echo "$ac_t""no" 1>&6
4080 have_mit=no
4081 fi
4082
4083   CPPFLAGS="$ac_save_CPPFLAGS"
4084   LDFLAGS="$ac_save_LDFLAGS"
4085 #  LIBS="$ac_save_LIBS"
4086   
4087
4088     if test "$have_mit" = no; then
4089       # Fuck!  Looks like XF86Free-3.3 actually puts it in XExExt instead
4090       # of in Xext.  Thank you master, may I have another.
4091       
4092   ac_save_CPPFLAGS="$CPPFLAGS"
4093   ac_save_LDFLAGS="$LDFLAGS"
4094 #  ac_save_LIBS="$LIBS"
4095
4096   if test \! -z "$includedir" ; then 
4097     CPPFLAGS="$CPPFLAGS -I$includedir"
4098   fi
4099   # note: $X_CFLAGS includes $x_includes
4100   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4101
4102   if test \! -z "$libdir" ; then
4103     LDFLAGS="$LDFLAGS -L$libdir"
4104   fi
4105   # note: $X_LIBS includes $x_libraries
4106   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4107
4108   echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
4109 echo "configure:4121: checking for XScreenSaverRegister in -lXExExt" >&5
4110 ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4111 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4112   echo $ac_n "(cached) $ac_c" 1>&6
4113 else
4114   ac_save_LIBS="$LIBS"
4115 LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
4116 cat > conftest.$ac_ext <<EOF
4117 #line 4129 "configure"
4118 #include "confdefs.h"
4119 /* Override any gcc2 internal prototype to avoid an error.  */
4120 /* We use char because int might match the return type of a gcc2
4121     builtin and then its argument prototype would still apply.  */
4122 char XScreenSaverRegister();
4123
4124 int main() {
4125 XScreenSaverRegister()
4126 ; return 0; }
4127 EOF
4128 if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4129   rm -rf conftest*
4130   eval "ac_cv_lib_$ac_lib_var=yes"
4131 else
4132   echo "configure: failed program was:" >&5
4133   cat conftest.$ac_ext >&5
4134   rm -rf conftest*
4135   eval "ac_cv_lib_$ac_lib_var=no"
4136 fi
4137 rm -f conftest*
4138 LIBS="$ac_save_LIBS"
4139
4140 fi
4141 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4142   echo "$ac_t""yes" 1>&6
4143   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXExExt"
4144 else
4145   echo "$ac_t""no" 1>&6
4146 true
4147 fi
4148
4149   CPPFLAGS="$ac_save_CPPFLAGS"
4150   LDFLAGS="$ac_save_LDFLAGS"
4151 #  LIBS="$ac_save_LIBS"
4152   
4153     fi
4154
4155     if test "$have_mit" = no; then
4156       # Double fuck!  Looks like some versions of XFree86 (whichever version
4157       # it is that comes with RedHat Linux 2.0 -- I can't find a version 
4158       # number) put this garbage in Xss instead of Xext.  Thank you master,
4159       #  may I have another.
4160       
4161   ac_save_CPPFLAGS="$CPPFLAGS"
4162   ac_save_LDFLAGS="$LDFLAGS"
4163 #  ac_save_LIBS="$LIBS"
4164
4165   if test \! -z "$includedir" ; then 
4166     CPPFLAGS="$CPPFLAGS -I$includedir"
4167   fi
4168   # note: $X_CFLAGS includes $x_includes
4169   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4170
4171   if test \! -z "$libdir" ; then
4172     LDFLAGS="$LDFLAGS -L$libdir"
4173   fi
4174   # note: $X_LIBS includes $x_libraries
4175   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4176
4177   echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
4178 echo "configure:4190: checking for XScreenSaverRegister in -lXss" >&5
4179 ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
4180 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4181   echo $ac_n "(cached) $ac_c" 1>&6
4182 else
4183   ac_save_LIBS="$LIBS"
4184 LIBS="-lXss -lX11 -lXext -lm $LIBS"
4185 cat > conftest.$ac_ext <<EOF
4186 #line 4198 "configure"
4187 #include "confdefs.h"
4188 /* Override any gcc2 internal prototype to avoid an error.  */
4189 /* We use char because int might match the return type of a gcc2
4190     builtin and then its argument prototype would still apply.  */
4191 char XScreenSaverRegister();
4192
4193 int main() {
4194 XScreenSaverRegister()
4195 ; return 0; }
4196 EOF
4197 if { (eval echo configure:4209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4198   rm -rf conftest*
4199   eval "ac_cv_lib_$ac_lib_var=yes"
4200 else
4201   echo "configure: failed program was:" >&5
4202   cat conftest.$ac_ext >&5
4203   rm -rf conftest*
4204   eval "ac_cv_lib_$ac_lib_var=no"
4205 fi
4206 rm -f conftest*
4207 LIBS="$ac_save_LIBS"
4208
4209 fi
4210 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4211   echo "$ac_t""yes" 1>&6
4212   have_mit=yes; SAVER_LIBS="$SAVER_LIBS -lXss"
4213 else
4214   echo "$ac_t""no" 1>&6
4215 true
4216 fi
4217
4218   CPPFLAGS="$ac_save_CPPFLAGS"
4219   LDFLAGS="$ac_save_LDFLAGS"
4220 #  LIBS="$ac_save_LIBS"
4221   
4222     fi
4223
4224   if test "$have_mit" = yes; then
4225     cat >> confdefs.h <<\EOF
4226 #define HAVE_MIT_SAVER_EXTENSION 1
4227 EOF
4228
4229   fi
4230
4231   fi
4232
4233 elif test "$with_mit" != no; then
4234   echo "error: must be yes or no: --with-mit-ext=$with_mit"
4235   exit 1
4236 fi
4237
4238
4239 ###############################################################################
4240 #
4241 #       Check for the XIDLE server extension.
4242 #
4243 ###############################################################################
4244
4245 have_xidle=no
4246 with_xidle_req=unspecified
4247 # Check whether --with-xidle-ext or --without-xidle-ext was given.
4248 if test "${with_xidle_ext+set}" = set; then
4249   withval="$with_xidle_ext"
4250   with_xidle="$withval"; with_xidle_req="$withval"
4251 else
4252   with_xidle=yes
4253 fi
4254
4255
4256
4257    case "$with_xidle" in
4258     yes) ;;
4259     no)  ;;
4260
4261     /*)
4262      echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
4263 echo "configure:4275: checking for XIDLE headers" >&5
4264      d=$with_xidle/include
4265      if test -d $d; then
4266        X_CFLAGS="-I$d $X_CFLAGS"
4267        echo "$ac_t""$d" 1>&6
4268      else
4269        echo "$ac_t""not found ($d: no such directory)" 1>&6
4270      fi
4271
4272      echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
4273 echo "configure:4285: checking for XIDLE libs" >&5
4274      d=$with_xidle/lib
4275      if test -d $d; then
4276        X_LIBS="-L$d $X_LIBS"
4277        echo "$ac_t""$d" 1>&6
4278      else
4279        echo "$ac_t""not found ($d: no such directory)" 1>&6
4280      fi
4281
4282      # replace the directory string with "yes".
4283      with_xidle_req="yes"
4284      with_xidle=$with_xidle_req
4285      ;;
4286
4287     *)
4288      echo ""
4289      echo "error: argument to --with-xidle-ext must be \"yes\", \"no\", or a directory."
4290      echo "       If it is a directory, then \`DIR/include' will be added to"
4291      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4292      exit 1
4293      ;;
4294    esac
4295   
4296
4297 if test "$with_xidle" = yes; then
4298   
4299   ac_save_CPPFLAGS="$CPPFLAGS"
4300   if test \! -z "$includedir" ; then 
4301     CPPFLAGS="$CPPFLAGS -I$includedir"
4302   fi
4303   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4304   ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
4305 echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
4306 echo "configure:4318: checking for X11/extensions/xidle.h" >&5
4307 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4308   echo $ac_n "(cached) $ac_c" 1>&6
4309 else
4310   cat > conftest.$ac_ext <<EOF
4311 #line 4323 "configure"
4312 #include "confdefs.h"
4313 #include <X11/extensions/xidle.h>
4314 EOF
4315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4316 { (eval echo configure:4328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4317 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4318 if test -z "$ac_err"; then
4319   rm -rf conftest*
4320   eval "ac_cv_header_$ac_safe=yes"
4321 else
4322   echo "$ac_err" >&5
4323   echo "configure: failed program was:" >&5
4324   cat conftest.$ac_ext >&5
4325   rm -rf conftest*
4326   eval "ac_cv_header_$ac_safe=no"
4327 fi
4328 rm -f conftest*
4329 fi
4330 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4331   echo "$ac_t""yes" 1>&6
4332   have_xidle=yes
4333                      cat >> confdefs.h <<\EOF
4334 #define HAVE_XIDLE_EXTENSION 1
4335 EOF
4336
4337 else
4338   echo "$ac_t""no" 1>&6
4339 fi
4340
4341   CPPFLAGS="$ac_save_CPPFLAGS"
4342 elif test "$with_xidle" != no; then
4343   echo "error: must be yes or no: --with-xidle-ext=$with_xidle"
4344   exit 1
4345 fi
4346
4347
4348 ###############################################################################
4349 #
4350 #       Check for the SGI-VIDEO-CONTROL server extension.
4351 #
4352 ###############################################################################
4353
4354 have_sgivc=no
4355 with_sgivc_req=unspecified
4356 # Check whether --with-sgivc-ext or --without-sgivc-ext was given.
4357 if test "${with_sgivc_ext+set}" = set; then
4358   withval="$with_sgivc_ext"
4359   with_sgivc="$withval"; with_sgivc_req="$withval"
4360 else
4361   with_sgivc=yes
4362 fi
4363
4364
4365
4366    case "$with_sgivc" in
4367     yes) ;;
4368     no)  ;;
4369
4370     /*)
4371      echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
4372 echo "configure:4384: checking for SGI-VIDEO-CONTROL headers" >&5
4373      d=$with_sgivc/include
4374      if test -d $d; then
4375        X_CFLAGS="-I$d $X_CFLAGS"
4376        echo "$ac_t""$d" 1>&6
4377      else
4378        echo "$ac_t""not found ($d: no such directory)" 1>&6
4379      fi
4380
4381      echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
4382 echo "configure:4394: checking for SGI-VIDEO-CONTROL libs" >&5
4383      d=$with_sgivc/lib
4384      if test -d $d; then
4385        X_LIBS="-L$d $X_LIBS"
4386        echo "$ac_t""$d" 1>&6
4387      else
4388        echo "$ac_t""not found ($d: no such directory)" 1>&6
4389      fi
4390
4391      # replace the directory string with "yes".
4392      with_sgivc_req="yes"
4393      with_sgivc=$with_sgivc_req
4394      ;;
4395
4396     *)
4397      echo ""
4398      echo "error: argument to --with-sgivc-ext must be \"yes\", \"no\", or a directory."
4399      echo "       If it is a directory, then \`DIR/include' will be added to"
4400      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4401      exit 1
4402      ;;
4403    esac
4404   
4405
4406 if test "$with_sgivc" = yes; then
4407
4408   # first check for XSGIvc.h
4409   
4410   ac_save_CPPFLAGS="$CPPFLAGS"
4411   if test \! -z "$includedir" ; then 
4412     CPPFLAGS="$CPPFLAGS -I$includedir"
4413   fi
4414   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4415   ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
4416 echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
4417 echo "configure:4429: checking for X11/extensions/XSGIvc.h" >&5
4418 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4419   echo $ac_n "(cached) $ac_c" 1>&6
4420 else
4421   cat > conftest.$ac_ext <<EOF
4422 #line 4434 "configure"
4423 #include "confdefs.h"
4424 #include <X11/extensions/XSGIvc.h>
4425 EOF
4426 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4427 { (eval echo configure:4439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4428 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4429 if test -z "$ac_err"; then
4430   rm -rf conftest*
4431   eval "ac_cv_header_$ac_safe=yes"
4432 else
4433   echo "$ac_err" >&5
4434   echo "configure: failed program was:" >&5
4435   cat conftest.$ac_ext >&5
4436   rm -rf conftest*
4437   eval "ac_cv_header_$ac_safe=no"
4438 fi
4439 rm -f conftest*
4440 fi
4441 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4442   echo "$ac_t""yes" 1>&6
4443   have_sgivc=yes
4444 else
4445   echo "$ac_t""no" 1>&6
4446 fi
4447
4448   CPPFLAGS="$ac_save_CPPFLAGS"
4449
4450   # if that succeeded, then check for the -lXsgivc
4451   if test "$have_sgivc" = yes; then
4452     have_sgivc=no
4453     
4454   ac_save_CPPFLAGS="$CPPFLAGS"
4455   ac_save_LDFLAGS="$LDFLAGS"
4456 #  ac_save_LIBS="$LIBS"
4457
4458   if test \! -z "$includedir" ; then 
4459     CPPFLAGS="$CPPFLAGS -I$includedir"
4460   fi
4461   # note: $X_CFLAGS includes $x_includes
4462   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4463
4464   if test \! -z "$libdir" ; then
4465     LDFLAGS="$LDFLAGS -L$libdir"
4466   fi
4467   # note: $X_LIBS includes $x_libraries
4468   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4469
4470   echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
4471 echo "configure:4483: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
4472 ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
4473 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4474   echo $ac_n "(cached) $ac_c" 1>&6
4475 else
4476   ac_save_LIBS="$LIBS"
4477 LIBS="-lXsgivc -lXext -lX11 $LIBS"
4478 cat > conftest.$ac_ext <<EOF
4479 #line 4491 "configure"
4480 #include "confdefs.h"
4481 /* Override any gcc2 internal prototype to avoid an error.  */
4482 /* We use char because int might match the return type of a gcc2
4483     builtin and then its argument prototype would still apply.  */
4484 char XSGIvcQueryGammaMap();
4485
4486 int main() {
4487 XSGIvcQueryGammaMap()
4488 ; return 0; }
4489 EOF
4490 if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4491   rm -rf conftest*
4492   eval "ac_cv_lib_$ac_lib_var=yes"
4493 else
4494   echo "configure: failed program was:" >&5
4495   cat conftest.$ac_ext >&5
4496   rm -rf conftest*
4497   eval "ac_cv_lib_$ac_lib_var=no"
4498 fi
4499 rm -f conftest*
4500 LIBS="$ac_save_LIBS"
4501
4502 fi
4503 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4504   echo "$ac_t""yes" 1>&6
4505   have_sgivc=yes; SAVER_LIBS="$SAVER_LIBS -lXsgivc"
4506 else
4507   echo "$ac_t""no" 1>&6
4508 true
4509 fi
4510
4511   CPPFLAGS="$ac_save_CPPFLAGS"
4512   LDFLAGS="$ac_save_LDFLAGS"
4513 #  LIBS="$ac_save_LIBS"
4514   
4515   fi
4516
4517   # if that succeeded, then we've really got it.
4518   if test "$have_sgivc" = yes; then
4519     cat >> confdefs.h <<\EOF
4520 #define HAVE_SGI_VC_EXTENSION 1
4521 EOF
4522
4523   fi
4524
4525 elif test "$with_sgivc" != no; then
4526   echo "error: must be yes or no: --with-sgivc-ext=$with_sgivc"
4527   exit 1
4528 fi
4529
4530
4531 ###############################################################################
4532 #
4533 #       Check for the DPMS server extension.
4534 #
4535 ###############################################################################
4536
4537 have_dpms=no
4538 with_dpms_req=unspecified
4539 # Check whether --with-dpms-ext or --without-dpms-ext was given.
4540 if test "${with_dpms_ext+set}" = set; then
4541   withval="$with_dpms_ext"
4542   with_dpms="$withval"; with_dpms_req="$withval"
4543 else
4544   with_dpms=yes
4545 fi
4546
4547
4548
4549    case "$with_dpms" in
4550     yes) ;;
4551     no)  ;;
4552
4553     /*)
4554      echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
4555 echo "configure:4567: checking for DPMS headers" >&5
4556      d=$with_dpms/include
4557      if test -d $d; then
4558        X_CFLAGS="-I$d $X_CFLAGS"
4559        echo "$ac_t""$d" 1>&6
4560      else
4561        echo "$ac_t""not found ($d: no such directory)" 1>&6
4562      fi
4563
4564      echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
4565 echo "configure:4577: checking for DPMS libs" >&5
4566      d=$with_dpms/lib
4567      if test -d $d; then
4568        X_LIBS="-L$d $X_LIBS"
4569        echo "$ac_t""$d" 1>&6
4570      else
4571        echo "$ac_t""not found ($d: no such directory)" 1>&6
4572      fi
4573
4574      # replace the directory string with "yes".
4575      with_dpms_req="yes"
4576      with_dpms=$with_dpms_req
4577      ;;
4578
4579     *)
4580      echo ""
4581      echo "error: argument to --with-dpms-ext must be \"yes\", \"no\", or a directory."
4582      echo "       If it is a directory, then \`DIR/include' will be added to"
4583      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4584      exit 1
4585      ;;
4586    esac
4587   
4588
4589 if test "$with_dpms" = yes; then
4590
4591   # first check for dpms.h
4592   
4593   ac_save_CPPFLAGS="$CPPFLAGS"
4594   if test \! -z "$includedir" ; then 
4595     CPPFLAGS="$CPPFLAGS -I$includedir"
4596   fi
4597   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4598   ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
4599 echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
4600 echo "configure:4612: checking for X11/extensions/dpms.h" >&5
4601 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4602   echo $ac_n "(cached) $ac_c" 1>&6
4603 else
4604   cat > conftest.$ac_ext <<EOF
4605 #line 4617 "configure"
4606 #include "confdefs.h"
4607 #include <X11/extensions/dpms.h>
4608 EOF
4609 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4610 { (eval echo configure:4622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4611 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4612 if test -z "$ac_err"; then
4613   rm -rf conftest*
4614   eval "ac_cv_header_$ac_safe=yes"
4615 else
4616   echo "$ac_err" >&5
4617   echo "configure: failed program was:" >&5
4618   cat conftest.$ac_ext >&5
4619   rm -rf conftest*
4620   eval "ac_cv_header_$ac_safe=no"
4621 fi
4622 rm -f conftest*
4623 fi
4624 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4625   echo "$ac_t""yes" 1>&6
4626   have_dpms=yes
4627 else
4628   echo "$ac_t""no" 1>&6
4629 fi
4630
4631   CPPFLAGS="$ac_save_CPPFLAGS"
4632
4633   # if that succeeded, then check for the DPMS code in the libraries
4634   if test "$have_dpms" = yes; then
4635
4636     # first look in -lXext (this is where it is with XFree86 4.0)
4637     have_dpms=no
4638     
4639   ac_save_CPPFLAGS="$CPPFLAGS"
4640   ac_save_LDFLAGS="$LDFLAGS"
4641 #  ac_save_LIBS="$LIBS"
4642
4643   if test \! -z "$includedir" ; then 
4644     CPPFLAGS="$CPPFLAGS -I$includedir"
4645   fi
4646   # note: $X_CFLAGS includes $x_includes
4647   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4648
4649   if test \! -z "$libdir" ; then
4650     LDFLAGS="$LDFLAGS -L$libdir"
4651   fi
4652   # note: $X_LIBS includes $x_libraries
4653   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4654
4655   echo $ac_n "checking for DPMSInfo in -lXext""... $ac_c" 1>&6
4656 echo "configure:4668: checking for DPMSInfo in -lXext" >&5
4657 ac_lib_var=`echo Xext'_'DPMSInfo | sed 'y%./+-%__p_%'`
4658 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4659   echo $ac_n "(cached) $ac_c" 1>&6
4660 else
4661   ac_save_LIBS="$LIBS"
4662 LIBS="-lXext -lXext -lX11 $LIBS"
4663 cat > conftest.$ac_ext <<EOF
4664 #line 4676 "configure"
4665 #include "confdefs.h"
4666 /* Override any gcc2 internal prototype to avoid an error.  */
4667 /* We use char because int might match the return type of a gcc2
4668     builtin and then its argument prototype would still apply.  */
4669 char DPMSInfo();
4670
4671 int main() {
4672 DPMSInfo()
4673 ; return 0; }
4674 EOF
4675 if { (eval echo configure:4687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4676   rm -rf conftest*
4677   eval "ac_cv_lib_$ac_lib_var=yes"
4678 else
4679   echo "configure: failed program was:" >&5
4680   cat conftest.$ac_ext >&5
4681   rm -rf conftest*
4682   eval "ac_cv_lib_$ac_lib_var=no"
4683 fi
4684 rm -f conftest*
4685 LIBS="$ac_save_LIBS"
4686
4687 fi
4688 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4689   echo "$ac_t""yes" 1>&6
4690   have_dpms=yes
4691 else
4692   echo "$ac_t""no" 1>&6
4693 true
4694 fi
4695
4696   CPPFLAGS="$ac_save_CPPFLAGS"
4697   LDFLAGS="$ac_save_LDFLAGS"
4698 #  LIBS="$ac_save_LIBS"
4699   
4700
4701     # if that failed, look in -lXdpms (this is where it was in XFree86 3.x)
4702     if test "$have_dpms" = no; then
4703       
4704   ac_save_CPPFLAGS="$CPPFLAGS"
4705   ac_save_LDFLAGS="$LDFLAGS"
4706 #  ac_save_LIBS="$LIBS"
4707
4708   if test \! -z "$includedir" ; then 
4709     CPPFLAGS="$CPPFLAGS -I$includedir"
4710   fi
4711   # note: $X_CFLAGS includes $x_includes
4712   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4713
4714   if test \! -z "$libdir" ; then
4715     LDFLAGS="$LDFLAGS -L$libdir"
4716   fi
4717   # note: $X_LIBS includes $x_libraries
4718   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4719
4720   echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
4721 echo "configure:4733: checking for DPMSInfo in -lXdpms" >&5
4722 ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
4723 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4724   echo $ac_n "(cached) $ac_c" 1>&6
4725 else
4726   ac_save_LIBS="$LIBS"
4727 LIBS="-lXdpms -lXext -lX11 $LIBS"
4728 cat > conftest.$ac_ext <<EOF
4729 #line 4741 "configure"
4730 #include "confdefs.h"
4731 /* Override any gcc2 internal prototype to avoid an error.  */
4732 /* We use char because int might match the return type of a gcc2
4733     builtin and then its argument prototype would still apply.  */
4734 char DPMSInfo();
4735
4736 int main() {
4737 DPMSInfo()
4738 ; return 0; }
4739 EOF
4740 if { (eval echo configure:4752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4741   rm -rf conftest*
4742   eval "ac_cv_lib_$ac_lib_var=yes"
4743 else
4744   echo "configure: failed program was:" >&5
4745   cat conftest.$ac_ext >&5
4746   rm -rf conftest*
4747   eval "ac_cv_lib_$ac_lib_var=no"
4748 fi
4749 rm -f conftest*
4750 LIBS="$ac_save_LIBS"
4751
4752 fi
4753 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4754   echo "$ac_t""yes" 1>&6
4755   have_dpms=yes; XDPMS_LIBS="-lXdpms"
4756 else
4757   echo "$ac_t""no" 1>&6
4758 true
4759 fi
4760
4761   CPPFLAGS="$ac_save_CPPFLAGS"
4762   LDFLAGS="$ac_save_LDFLAGS"
4763 #  LIBS="$ac_save_LIBS"
4764   
4765     fi
4766   fi
4767
4768
4769   # if that succeeded, then we've really got it.
4770   if test "$have_dpms" = yes; then
4771     cat >> confdefs.h <<\EOF
4772 #define HAVE_DPMS_EXTENSION 1
4773 EOF
4774
4775   fi
4776
4777 elif test "$with_dpms" != no; then
4778   echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
4779   exit 1
4780 fi
4781
4782
4783 ###############################################################################
4784 #
4785 #       Check for the XINERAMA server extension.
4786 #
4787 ###############################################################################
4788
4789 have_xinerama=no
4790 with_xinerama_req=unspecified
4791 # Check whether --with-xinerama-ext or --without-xinerama-ext was given.
4792 if test "${with_xinerama_ext+set}" = set; then
4793   withval="$with_xinerama_ext"
4794   with_xinerama="$withval"; with_xinerama_req="$withval"
4795 else
4796   with_xinerama=yes
4797 fi
4798
4799
4800
4801    case "$with_xinerama" in
4802     yes) ;;
4803     no)  ;;
4804
4805     /*)
4806      echo $ac_n "checking for XINERAMA headers""... $ac_c" 1>&6
4807 echo "configure:4819: checking for XINERAMA headers" >&5
4808      d=$with_xinerama/include
4809      if test -d $d; then
4810        X_CFLAGS="-I$d $X_CFLAGS"
4811        echo "$ac_t""$d" 1>&6
4812      else
4813        echo "$ac_t""not found ($d: no such directory)" 1>&6
4814      fi
4815
4816      echo $ac_n "checking for XINERAMA libs""... $ac_c" 1>&6
4817 echo "configure:4829: checking for XINERAMA libs" >&5
4818      d=$with_xinerama/lib
4819      if test -d $d; then
4820        X_LIBS="-L$d $X_LIBS"
4821        echo "$ac_t""$d" 1>&6
4822      else
4823        echo "$ac_t""not found ($d: no such directory)" 1>&6
4824      fi
4825
4826      # replace the directory string with "yes".
4827      with_xinerama_req="yes"
4828      with_xinerama=$with_xinerama_req
4829      ;;
4830
4831     *)
4832      echo ""
4833      echo "error: argument to --with-xinerama-ext must be \"yes\", \"no\", or a directory."
4834      echo "       If it is a directory, then \`DIR/include' will be added to"
4835      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
4836      exit 1
4837      ;;
4838    esac
4839   
4840
4841 if test "$with_xinerama" = yes; then
4842
4843   # first check for Xinerama.h
4844   
4845   ac_save_CPPFLAGS="$CPPFLAGS"
4846   if test \! -z "$includedir" ; then 
4847     CPPFLAGS="$CPPFLAGS -I$includedir"
4848   fi
4849   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4850   ac_safe=`echo "X11/extensions/Xinerama.h" | sed 'y%./+-%__p_%'`
4851 echo $ac_n "checking for X11/extensions/Xinerama.h""... $ac_c" 1>&6
4852 echo "configure:4864: checking for X11/extensions/Xinerama.h" >&5
4853 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4854   echo $ac_n "(cached) $ac_c" 1>&6
4855 else
4856   cat > conftest.$ac_ext <<EOF
4857 #line 4869 "configure"
4858 #include "confdefs.h"
4859 #include <X11/extensions/Xinerama.h>
4860 EOF
4861 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4862 { (eval echo configure:4874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4863 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4864 if test -z "$ac_err"; then
4865   rm -rf conftest*
4866   eval "ac_cv_header_$ac_safe=yes"
4867 else
4868   echo "$ac_err" >&5
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   eval "ac_cv_header_$ac_safe=no"
4873 fi
4874 rm -f conftest*
4875 fi
4876 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4877   echo "$ac_t""yes" 1>&6
4878   have_xinerama=yes
4879 else
4880   echo "$ac_t""no" 1>&6
4881 fi
4882
4883   CPPFLAGS="$ac_save_CPPFLAGS"
4884
4885   # if that succeeded, then check for the XINERAMA code in the libraries
4886   if test "$have_xinerama" = yes; then
4887
4888     # first look in -lXext
4889     have_xinerama=no
4890     
4891   ac_save_CPPFLAGS="$CPPFLAGS"
4892   ac_save_LDFLAGS="$LDFLAGS"
4893 #  ac_save_LIBS="$LIBS"
4894
4895   if test \! -z "$includedir" ; then 
4896     CPPFLAGS="$CPPFLAGS -I$includedir"
4897   fi
4898   # note: $X_CFLAGS includes $x_includes
4899   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4900
4901   if test \! -z "$libdir" ; then
4902     LDFLAGS="$LDFLAGS -L$libdir"
4903   fi
4904   # note: $X_LIBS includes $x_libraries
4905   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4906
4907   echo $ac_n "checking for XineramaQueryExtension in -lXext""... $ac_c" 1>&6
4908 echo "configure:4920: checking for XineramaQueryExtension in -lXext" >&5
4909 ac_lib_var=`echo Xext'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
4910 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4911   echo $ac_n "(cached) $ac_c" 1>&6
4912 else
4913   ac_save_LIBS="$LIBS"
4914 LIBS="-lXext -lXext -lX11 $LIBS"
4915 cat > conftest.$ac_ext <<EOF
4916 #line 4928 "configure"
4917 #include "confdefs.h"
4918 /* Override any gcc2 internal prototype to avoid an error.  */
4919 /* We use char because int might match the return type of a gcc2
4920     builtin and then its argument prototype would still apply.  */
4921 char XineramaQueryExtension();
4922
4923 int main() {
4924 XineramaQueryExtension()
4925 ; return 0; }
4926 EOF
4927 if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4928   rm -rf conftest*
4929   eval "ac_cv_lib_$ac_lib_var=yes"
4930 else
4931   echo "configure: failed program was:" >&5
4932   cat conftest.$ac_ext >&5
4933   rm -rf conftest*
4934   eval "ac_cv_lib_$ac_lib_var=no"
4935 fi
4936 rm -f conftest*
4937 LIBS="$ac_save_LIBS"
4938
4939 fi
4940 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4941   echo "$ac_t""yes" 1>&6
4942   have_xinerama=yes
4943 else
4944   echo "$ac_t""no" 1>&6
4945 true
4946 fi
4947
4948   CPPFLAGS="$ac_save_CPPFLAGS"
4949   LDFLAGS="$ac_save_LDFLAGS"
4950 #  LIBS="$ac_save_LIBS"
4951   
4952
4953     # if that failed, look in -lXinerama (this is where it is in XFree86 4.1.)
4954     if test "$have_xinerama" = no; then
4955       
4956   ac_save_CPPFLAGS="$CPPFLAGS"
4957   ac_save_LDFLAGS="$LDFLAGS"
4958 #  ac_save_LIBS="$LIBS"
4959
4960   if test \! -z "$includedir" ; then 
4961     CPPFLAGS="$CPPFLAGS -I$includedir"
4962   fi
4963   # note: $X_CFLAGS includes $x_includes
4964   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
4965
4966   if test \! -z "$libdir" ; then
4967     LDFLAGS="$LDFLAGS -L$libdir"
4968   fi
4969   # note: $X_LIBS includes $x_libraries
4970   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
4971
4972   echo $ac_n "checking for XineramaQueryExtension in -lXinerama""... $ac_c" 1>&6
4973 echo "configure:4985: checking for XineramaQueryExtension in -lXinerama" >&5
4974 ac_lib_var=`echo Xinerama'_'XineramaQueryExtension | sed 'y%./+-%__p_%'`
4975 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4976   echo $ac_n "(cached) $ac_c" 1>&6
4977 else
4978   ac_save_LIBS="$LIBS"
4979 LIBS="-lXinerama -lXext -lX11 $LIBS"
4980 cat > conftest.$ac_ext <<EOF
4981 #line 4993 "configure"
4982 #include "confdefs.h"
4983 /* Override any gcc2 internal prototype to avoid an error.  */
4984 /* We use char because int might match the return type of a gcc2
4985     builtin and then its argument prototype would still apply.  */
4986 char XineramaQueryExtension();
4987
4988 int main() {
4989 XineramaQueryExtension()
4990 ; return 0; }
4991 EOF
4992 if { (eval echo configure:5004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4993   rm -rf conftest*
4994   eval "ac_cv_lib_$ac_lib_var=yes"
4995 else
4996   echo "configure: failed program was:" >&5
4997   cat conftest.$ac_ext >&5
4998   rm -rf conftest*
4999   eval "ac_cv_lib_$ac_lib_var=no"
5000 fi
5001 rm -f conftest*
5002 LIBS="$ac_save_LIBS"
5003
5004 fi
5005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5006   echo "$ac_t""yes" 1>&6
5007   have_xinerama=yes; SAVER_LIBS="$SAVER_LIBS -lXinerama"
5008 else
5009   echo "$ac_t""no" 1>&6
5010 true
5011 fi
5012
5013   CPPFLAGS="$ac_save_CPPFLAGS"
5014   LDFLAGS="$ac_save_LDFLAGS"
5015 #  LIBS="$ac_save_LIBS"
5016   
5017     fi
5018   fi
5019
5020   # if that succeeded, then we've really got it.
5021   if test "$have_xinerama" = yes; then
5022     cat >> confdefs.h <<\EOF
5023 #define HAVE_XINERAMA 1
5024 EOF
5025
5026   fi
5027
5028 elif test "$with_xinerama" != no; then
5029   echo "error: must be yes or no: --with-xinerama-ext=$with_xinerama"
5030   exit 1
5031 fi
5032
5033
5034 ###############################################################################
5035 #
5036 #       Check for the XF86VMODE server extension (for virtual screens.)
5037 #
5038 ###############################################################################
5039
5040 have_xf86vmode=no
5041 with_xf86vmode_req=unspecified
5042 # Check whether --with-xf86vmode-ext or --without-xf86vmode-ext was given.
5043 if test "${with_xf86vmode_ext+set}" = set; then
5044   withval="$with_xf86vmode_ext"
5045   with_xf86vmode="$withval"; with_xf86vmode_req="$withval"
5046 else
5047   with_xf86vmode=yes
5048 fi
5049
5050
5051
5052    case "$with_xf86vmode" in
5053     yes) ;;
5054     no)  ;;
5055
5056     /*)
5057      echo $ac_n "checking for xf86vmode headers""... $ac_c" 1>&6
5058 echo "configure:5070: checking for xf86vmode headers" >&5
5059      d=$with_xf86vmode/include
5060      if test -d $d; then
5061        X_CFLAGS="-I$d $X_CFLAGS"
5062        echo "$ac_t""$d" 1>&6
5063      else
5064        echo "$ac_t""not found ($d: no such directory)" 1>&6
5065      fi
5066
5067      echo $ac_n "checking for xf86vmode libs""... $ac_c" 1>&6
5068 echo "configure:5080: checking for xf86vmode libs" >&5
5069      d=$with_xf86vmode/lib
5070      if test -d $d; then
5071        X_LIBS="-L$d $X_LIBS"
5072        echo "$ac_t""$d" 1>&6
5073      else
5074        echo "$ac_t""not found ($d: no such directory)" 1>&6
5075      fi
5076
5077      # replace the directory string with "yes".
5078      with_xf86vmode_req="yes"
5079      with_xf86vmode=$with_xf86vmode_req
5080      ;;
5081
5082     *)
5083      echo ""
5084      echo "error: argument to --with-xf86vmode-ext must be \"yes\", \"no\", or a directory."
5085      echo "       If it is a directory, then \`DIR/include' will be added to"
5086      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5087      exit 1
5088      ;;
5089    esac
5090   
5091
5092 if test "$with_xf86vmode" = yes; then
5093
5094   # first check for xf86vmode.h
5095   
5096   ac_save_CPPFLAGS="$CPPFLAGS"
5097   if test \! -z "$includedir" ; then 
5098     CPPFLAGS="$CPPFLAGS -I$includedir"
5099   fi
5100   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5101   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5102 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5103 echo "configure:5115: checking for X11/extensions/xf86vmode.h" >&5
5104 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5105   echo $ac_n "(cached) $ac_c" 1>&6
5106 else
5107   cat > conftest.$ac_ext <<EOF
5108 #line 5120 "configure"
5109 #include "confdefs.h"
5110 #include <X11/extensions/xf86vmode.h>
5111 EOF
5112 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5113 { (eval echo configure:5125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5114 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5115 if test -z "$ac_err"; then
5116   rm -rf conftest*
5117   eval "ac_cv_header_$ac_safe=yes"
5118 else
5119   echo "$ac_err" >&5
5120   echo "configure: failed program was:" >&5
5121   cat conftest.$ac_ext >&5
5122   rm -rf conftest*
5123   eval "ac_cv_header_$ac_safe=no"
5124 fi
5125 rm -f conftest*
5126 fi
5127 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5128   echo "$ac_t""yes" 1>&6
5129   have_xf86vmode=yes
5130 else
5131   echo "$ac_t""no" 1>&6
5132 fi
5133
5134   CPPFLAGS="$ac_save_CPPFLAGS"
5135
5136   # if that succeeded, then check for the -lXxf86vm
5137   if test "$have_xf86vmode" = yes; then
5138     have_xf86vmode=no
5139     
5140   ac_save_CPPFLAGS="$CPPFLAGS"
5141   ac_save_LDFLAGS="$LDFLAGS"
5142 #  ac_save_LIBS="$LIBS"
5143
5144   if test \! -z "$includedir" ; then 
5145     CPPFLAGS="$CPPFLAGS -I$includedir"
5146   fi
5147   # note: $X_CFLAGS includes $x_includes
5148   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5149
5150   if test \! -z "$libdir" ; then
5151     LDFLAGS="$LDFLAGS -L$libdir"
5152   fi
5153   # note: $X_LIBS includes $x_libraries
5154   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5155
5156   echo $ac_n "checking for XF86VidModeGetViewPort in -lXxf86vm""... $ac_c" 1>&6
5157 echo "configure:5169: checking for XF86VidModeGetViewPort in -lXxf86vm" >&5
5158 ac_lib_var=`echo Xxf86vm'_'XF86VidModeGetViewPort | sed 'y%./+-%__p_%'`
5159 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5160   echo $ac_n "(cached) $ac_c" 1>&6
5161 else
5162   ac_save_LIBS="$LIBS"
5163 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5164 cat > conftest.$ac_ext <<EOF
5165 #line 5177 "configure"
5166 #include "confdefs.h"
5167 /* Override any gcc2 internal prototype to avoid an error.  */
5168 /* We use char because int might match the return type of a gcc2
5169     builtin and then its argument prototype would still apply.  */
5170 char XF86VidModeGetViewPort();
5171
5172 int main() {
5173 XF86VidModeGetViewPort()
5174 ; return 0; }
5175 EOF
5176 if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5177   rm -rf conftest*
5178   eval "ac_cv_lib_$ac_lib_var=yes"
5179 else
5180   echo "configure: failed program was:" >&5
5181   cat conftest.$ac_ext >&5
5182   rm -rf conftest*
5183   eval "ac_cv_lib_$ac_lib_var=no"
5184 fi
5185 rm -f conftest*
5186 LIBS="$ac_save_LIBS"
5187
5188 fi
5189 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5190   echo "$ac_t""yes" 1>&6
5191   have_xf86vmode=yes; SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5192 else
5193   echo "$ac_t""no" 1>&6
5194 true
5195 fi
5196
5197   CPPFLAGS="$ac_save_CPPFLAGS"
5198   LDFLAGS="$ac_save_LDFLAGS"
5199 #  LIBS="$ac_save_LIBS"
5200   
5201   fi
5202
5203   # if that succeeded, then we've really got it.
5204   if test "$have_xf86vmode" = yes; then
5205     cat >> confdefs.h <<\EOF
5206 #define HAVE_XF86VMODE 1
5207 EOF
5208
5209   fi
5210
5211 elif test "$with_xf86vmode" != no; then
5212   echo "error: must be yes or no: --with-xf86vmode-ext=$with_xf86vmode"
5213   exit 1
5214 fi
5215
5216
5217 ###############################################################################
5218 #
5219 #       Check for the XF86VMODE server extension (for gamma fading.)
5220 #
5221 ###############################################################################
5222
5223 have_xf86gamma=no
5224 have_xf86gamma_ramp=no
5225 with_xf86gamma_req=unspecified
5226 # Check whether --with-xf86gamma-ext or --without-xf86gamma-ext was given.
5227 if test "${with_xf86gamma_ext+set}" = set; then
5228   withval="$with_xf86gamma_ext"
5229   with_xf86gamma="$withval"; with_xf86gamma_req="$withval"
5230 else
5231   with_xf86gamma=yes
5232 fi
5233
5234
5235
5236    case "$with_xf86gamma" in
5237     yes) ;;
5238     no)  ;;
5239
5240     /*)
5241      echo $ac_n "checking for xf86gamma headers""... $ac_c" 1>&6
5242 echo "configure:5254: checking for xf86gamma headers" >&5
5243      d=$with_xf86gamma/include
5244      if test -d $d; then
5245        X_CFLAGS="-I$d $X_CFLAGS"
5246        echo "$ac_t""$d" 1>&6
5247      else
5248        echo "$ac_t""not found ($d: no such directory)" 1>&6
5249      fi
5250
5251      echo $ac_n "checking for xf86gamma libs""... $ac_c" 1>&6
5252 echo "configure:5264: checking for xf86gamma libs" >&5
5253      d=$with_xf86gamma/lib
5254      if test -d $d; then
5255        X_LIBS="-L$d $X_LIBS"
5256        echo "$ac_t""$d" 1>&6
5257      else
5258        echo "$ac_t""not found ($d: no such directory)" 1>&6
5259      fi
5260
5261      # replace the directory string with "yes".
5262      with_xf86gamma_req="yes"
5263      with_xf86gamma=$with_xf86gamma_req
5264      ;;
5265
5266     *)
5267      echo ""
5268      echo "error: argument to --with-xf86gamma-ext must be \"yes\", \"no\", or a directory."
5269      echo "       If it is a directory, then \`DIR/include' will be added to"
5270      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5271      exit 1
5272      ;;
5273    esac
5274   
5275
5276 if test "$with_xf86gamma" = yes; then
5277
5278   # first check for xf86vmode.h, if we haven't already
5279   if test "$have_xf86vmode" = yes; then
5280     have_xf86gamma=yes
5281   else
5282     
5283   ac_save_CPPFLAGS="$CPPFLAGS"
5284   if test \! -z "$includedir" ; then 
5285     CPPFLAGS="$CPPFLAGS -I$includedir"
5286   fi
5287   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5288   ac_safe=`echo "X11/extensions/xf86vmode.h" | sed 'y%./+-%__p_%'`
5289 echo $ac_n "checking for X11/extensions/xf86vmode.h""... $ac_c" 1>&6
5290 echo "configure:5302: checking for X11/extensions/xf86vmode.h" >&5
5291 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5292   echo $ac_n "(cached) $ac_c" 1>&6
5293 else
5294   cat > conftest.$ac_ext <<EOF
5295 #line 5307 "configure"
5296 #include "confdefs.h"
5297 #include <X11/extensions/xf86vmode.h>
5298 EOF
5299 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5300 { (eval echo configure:5312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5301 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5302 if test -z "$ac_err"; then
5303   rm -rf conftest*
5304   eval "ac_cv_header_$ac_safe=yes"
5305 else
5306   echo "$ac_err" >&5
5307   echo "configure: failed program was:" >&5
5308   cat conftest.$ac_ext >&5
5309   rm -rf conftest*
5310   eval "ac_cv_header_$ac_safe=no"
5311 fi
5312 rm -f conftest*
5313 fi
5314 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5315   echo "$ac_t""yes" 1>&6
5316   have_xf86gamma=yes
5317 else
5318   echo "$ac_t""no" 1>&6
5319 fi
5320
5321   CPPFLAGS="$ac_save_CPPFLAGS"
5322   fi
5323
5324   # if that succeeded, then check for the -lXxf86vm
5325   if test "$have_xf86gamma" = yes; then
5326     have_xf86gamma=no
5327     
5328   ac_save_CPPFLAGS="$CPPFLAGS"
5329   ac_save_LDFLAGS="$LDFLAGS"
5330 #  ac_save_LIBS="$LIBS"
5331
5332   if test \! -z "$includedir" ; then 
5333     CPPFLAGS="$CPPFLAGS -I$includedir"
5334   fi
5335   # note: $X_CFLAGS includes $x_includes
5336   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5337
5338   if test \! -z "$libdir" ; then
5339     LDFLAGS="$LDFLAGS -L$libdir"
5340   fi
5341   # note: $X_LIBS includes $x_libraries
5342   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5343
5344   echo $ac_n "checking for XF86VidModeSetGamma in -lXxf86vm""... $ac_c" 1>&6
5345 echo "configure:5357: checking for XF86VidModeSetGamma in -lXxf86vm" >&5
5346 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGamma | sed 'y%./+-%__p_%'`
5347 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5348   echo $ac_n "(cached) $ac_c" 1>&6
5349 else
5350   ac_save_LIBS="$LIBS"
5351 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5352 cat > conftest.$ac_ext <<EOF
5353 #line 5365 "configure"
5354 #include "confdefs.h"
5355 /* Override any gcc2 internal prototype to avoid an error.  */
5356 /* We use char because int might match the return type of a gcc2
5357     builtin and then its argument prototype would still apply.  */
5358 char XF86VidModeSetGamma();
5359
5360 int main() {
5361 XF86VidModeSetGamma()
5362 ; return 0; }
5363 EOF
5364 if { (eval echo configure:5376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5365   rm -rf conftest*
5366   eval "ac_cv_lib_$ac_lib_var=yes"
5367 else
5368   echo "configure: failed program was:" >&5
5369   cat conftest.$ac_ext >&5
5370   rm -rf conftest*
5371   eval "ac_cv_lib_$ac_lib_var=no"
5372 fi
5373 rm -f conftest*
5374 LIBS="$ac_save_LIBS"
5375
5376 fi
5377 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5378   echo "$ac_t""yes" 1>&6
5379   have_xf86gamma=yes
5380 else
5381   echo "$ac_t""no" 1>&6
5382 true
5383 fi
5384
5385   CPPFLAGS="$ac_save_CPPFLAGS"
5386   LDFLAGS="$ac_save_LDFLAGS"
5387 #  LIBS="$ac_save_LIBS"
5388   
5389   fi
5390
5391   # check for the Ramp versions of the functions too.
5392   if test "$have_xf86gamma" = yes; then
5393     have_xf86gamma_ramp=no
5394     
5395   ac_save_CPPFLAGS="$CPPFLAGS"
5396   ac_save_LDFLAGS="$LDFLAGS"
5397 #  ac_save_LIBS="$LIBS"
5398
5399   if test \! -z "$includedir" ; then 
5400     CPPFLAGS="$CPPFLAGS -I$includedir"
5401   fi
5402   # note: $X_CFLAGS includes $x_includes
5403   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5404
5405   if test \! -z "$libdir" ; then
5406     LDFLAGS="$LDFLAGS -L$libdir"
5407   fi
5408   # note: $X_LIBS includes $x_libraries
5409   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
5410
5411   echo $ac_n "checking for XF86VidModeSetGammaRamp in -lXxf86vm""... $ac_c" 1>&6
5412 echo "configure:5424: checking for XF86VidModeSetGammaRamp in -lXxf86vm" >&5
5413 ac_lib_var=`echo Xxf86vm'_'XF86VidModeSetGammaRamp | sed 'y%./+-%__p_%'`
5414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5415   echo $ac_n "(cached) $ac_c" 1>&6
5416 else
5417   ac_save_LIBS="$LIBS"
5418 LIBS="-lXxf86vm -lXext -lX11 $LIBS"
5419 cat > conftest.$ac_ext <<EOF
5420 #line 5432 "configure"
5421 #include "confdefs.h"
5422 /* Override any gcc2 internal prototype to avoid an error.  */
5423 /* We use char because int might match the return type of a gcc2
5424     builtin and then its argument prototype would still apply.  */
5425 char XF86VidModeSetGammaRamp();
5426
5427 int main() {
5428 XF86VidModeSetGammaRamp()
5429 ; return 0; }
5430 EOF
5431 if { (eval echo configure:5443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=yes"
5434 else
5435   echo "configure: failed program was:" >&5
5436   cat conftest.$ac_ext >&5
5437   rm -rf conftest*
5438   eval "ac_cv_lib_$ac_lib_var=no"
5439 fi
5440 rm -f conftest*
5441 LIBS="$ac_save_LIBS"
5442
5443 fi
5444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5445   echo "$ac_t""yes" 1>&6
5446   have_xf86gamma_ramp=yes
5447 else
5448   echo "$ac_t""no" 1>&6
5449 true
5450 fi
5451
5452   CPPFLAGS="$ac_save_CPPFLAGS"
5453   LDFLAGS="$ac_save_LDFLAGS"
5454 #  LIBS="$ac_save_LIBS"
5455   
5456   fi
5457
5458   # if those tests succeeded, then we've really got the functions.
5459   if test "$have_xf86gamma" = yes; then
5460     cat >> confdefs.h <<\EOF
5461 #define HAVE_XF86VMODE_GAMMA 1
5462 EOF
5463
5464   fi
5465
5466   if test "$have_xf86gamma_ramp" = yes; then
5467     cat >> confdefs.h <<\EOF
5468 #define HAVE_XF86VMODE_GAMMA_RAMP 1
5469 EOF
5470
5471   fi
5472
5473   # pull in the lib, if we haven't already
5474   if test "$have_xf86gamma" = yes -a "$have_xf86vmode" = no; then
5475     SAVER_LIBS="$SAVER_LIBS -lXxf86vm"
5476   fi
5477
5478 elif test "$with_xf86gamma" != no; then
5479   echo "error: must be yes or no: --with-xf86gamma-ext=$with_xf86vmode"
5480   exit 1
5481 fi
5482
5483
5484 ###############################################################################
5485 #
5486 #       Check for HP XHPDisableReset and XHPEnableReset.
5487 #
5488 ###############################################################################
5489
5490
5491   ac_save_CPPFLAGS="$CPPFLAGS"
5492   if test \! -z "$includedir" ; then 
5493     CPPFLAGS="$CPPFLAGS -I$includedir"
5494   fi
5495   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5496   cat > conftest.$ac_ext <<EOF
5497 #line 5509 "configure"
5498 #include "confdefs.h"
5499 #include <X11/XHPlib.h>
5500 EOF
5501 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5502   egrep "XHPDisableReset" >/dev/null 2>&1; then
5503   rm -rf conftest*
5504   cat >> confdefs.h <<\EOF
5505 #define HAVE_XHPDISABLERESET 1
5506 EOF
5507
5508                    SAVER_LIBS="-lXhp11 $SAVER_LIBS"
5509 fi
5510 rm -f conftest*
5511
5512   CPPFLAGS="$ac_save_CPPFLAGS"
5513
5514
5515 ###############################################################################
5516 #
5517 #       Check for /proc/interrupts.
5518 #
5519 ###############################################################################
5520
5521 have_proc_interrupts=no
5522 with_proc_interrupts_req=unspecified
5523 # Check whether --with-proc-interrupts or --without-proc-interrupts was given.
5524 if test "${with_proc_interrupts+set}" = set; then
5525   withval="$with_proc_interrupts"
5526   with_proc_interrupts="$withval"; with_proc_interrupts_req="$withval"
5527 else
5528   with_proc_interrupts=yes
5529 fi
5530
5531
5532 if test "$with_proc_interrupts" = yes; then
5533
5534    echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
5535 echo "configure:5547: checking whether /proc/interrupts contains keyboard data" >&5
5536 if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
5537   echo $ac_n "(cached) $ac_c" 1>&6
5538 else
5539   ac_cv_have_proc_interrupts=no
5540      if grep keyboard /proc/interrupts >/dev/null 2>&1 ; then
5541        ac_cv_have_proc_interrupts=yes
5542      fi
5543     
5544 fi
5545
5546 echo "$ac_t""$ac_cv_have_proc_interrupts" 1>&6
5547    have_proc_interrupts=$ac_cv_have_proc_interrupts
5548
5549   if test "$have_proc_interrupts" = yes; then
5550     cat >> confdefs.h <<\EOF
5551 #define HAVE_PROC_INTERRUPTS 1
5552 EOF
5553
5554   fi
5555
5556 elif test "$with_proc_interrupts" != no; then
5557   echo "error: must be yes or no: --with-proc-interrupts=$with_proc_interrupts"
5558   exit 1
5559 fi
5560
5561
5562 ###############################################################################
5563 #
5564 #       The --enable-locking option
5565 #
5566 ###############################################################################
5567
5568 # Check whether --enable-locking or --disable-locking was given.
5569 if test "${enable_locking+set}" = set; then
5570   enableval="$enable_locking"
5571   enable_locking="$enableval"
5572 else
5573   enable_locking=yes
5574 fi
5575
5576 if test "$enable_locking" = yes; then
5577   true
5578 elif test "$enable_locking" = no; then
5579   cat >> confdefs.h <<\EOF
5580 #define NO_LOCKING 1
5581 EOF
5582
5583 else
5584   echo "error: must be yes or no: --enable-locking=$enable_locking"
5585   exit 1
5586 fi
5587
5588
5589
5590 ###############################################################################
5591 #
5592 #       The --enable-vt-locking option
5593 #
5594 ###############################################################################
5595
5596 #ac_vt_lockswitch=no
5597 #AC_ARG_ENABLE(vt-locking,[
5598 #  --enable-vt-locking     Compile in support for locking Virtual Terminals.
5599 #                          This is the default if the system supports it, and
5600 #                          if locking support is included (--enable-locking.)
5601 #  --disable-vt-locking    Do not allow locking of VTs, even if locking is
5602 #                          enabled.],
5603 #  [enable_vt_locking="$enableval"],[enable_vt_locking=yes])
5604 #if test "$enable_vt_locking" = yes; then
5605 #
5606 #  AC_CACHE_CHECK([for the VT_LOCKSWITCH ioctl], ac_cv_vt_lockswitch,
5607 #   [AC_TRY_COMPILE([#include <fcntl.h>
5608 #                   #include <sys/ioctl.h>
5609 #                   #include <sys/vt.h>],
5610 #                  [int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;],
5611 #                  [ac_cv_vt_lockswitch=yes],
5612 #                  [ac_cv_vt_lockswitch=no])])
5613 #  ac_vt_lockswitch=$ac_cv_vt_lockswitch
5614 #
5615 #elif test "$enable_vt_locking" = no; then
5616 #  true
5617 #else
5618 #  echo "error: must be yes or no: --enable-vt-locking=$enable_vt_locking"
5619 #  exit 1
5620 #fi
5621 #
5622 #if test "$ac_vt_lockswitch" = yes; then
5623 #  AC_DEFINE(HAVE_VT_LOCKSWITCH)
5624 #  # the VT_LOCKSWITCH ioctl can only be used when running as root.
5625 #  # #### but it doesn't work yet, so don't worry about that for now.
5626 ##  need_setuid=yes
5627 #fi
5628
5629
5630
5631 ###############################################################################
5632 #
5633 #       Check for PAM.
5634 #
5635 ###############################################################################
5636
5637 case "$host" in
5638   *-solaris*)
5639    # Solaris systems tend to come with PAM misconfigured.
5640    #  Don't build it by default, even if the headers exist.
5641    with_pam_default=no
5642    ;;
5643   *)
5644    # Default to building PAM support on all other systems, if it exists.
5645    with_pam_default=yes
5646   ;;
5647 esac
5648
5649 have_pam=no
5650 with_pam_req=unspecified
5651
5652 # Check whether --with-pam or --without-pam was given.
5653 if test "${with_pam+set}" = set; then
5654   withval="$with_pam"
5655   with_pam="$withval"; with_pam_req="$withval"
5656 else
5657   with_pam=$with_pam_default
5658 fi
5659
5660
5661
5662    case "$with_pam" in
5663     yes) ;;
5664     no)  ;;
5665
5666     /*)
5667      echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
5668 echo "configure:5680: checking for PAM headers" >&5
5669      d=$with_pam/include
5670      if test -d $d; then
5671        X_CFLAGS="-I$d $X_CFLAGS"
5672        echo "$ac_t""$d" 1>&6
5673      else
5674        echo "$ac_t""not found ($d: no such directory)" 1>&6
5675      fi
5676
5677      echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
5678 echo "configure:5690: checking for PAM libs" >&5
5679      d=$with_pam/lib
5680      if test -d $d; then
5681        X_LIBS="-L$d $X_LIBS"
5682        echo "$ac_t""$d" 1>&6
5683      else
5684        echo "$ac_t""not found ($d: no such directory)" 1>&6
5685      fi
5686
5687      # replace the directory string with "yes".
5688      with_pam_req="yes"
5689      with_pam=$with_pam_req
5690      ;;
5691
5692     *)
5693      echo ""
5694      echo "error: argument to --with-pam must be \"yes\", \"no\", or a directory."
5695      echo "       If it is a directory, then \`DIR/include' will be added to"
5696      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5697      exit 1
5698      ;;
5699    esac
5700   
5701
5702 if test "$enable_locking" = yes -a "$with_pam" = yes; then
5703   echo $ac_n "checking for PAM""... $ac_c" 1>&6
5704 echo "configure:5716: checking for PAM" >&5
5705 if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
5706   echo $ac_n "(cached) $ac_c" 1>&6
5707 else
5708   
5709   ac_save_CPPFLAGS="$CPPFLAGS"
5710   if test \! -z "$includedir" ; then 
5711     CPPFLAGS="$CPPFLAGS -I$includedir"
5712   fi
5713   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5714   cat > conftest.$ac_ext <<EOF
5715 #line 5727 "configure"
5716 #include "confdefs.h"
5717 #include <security/pam_appl.h>
5718 int main() {
5719
5720 ; return 0; }
5721 EOF
5722 if { (eval echo configure:5734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5723   rm -rf conftest*
5724   ac_cv_pam=yes
5725 else
5726   echo "configure: failed program was:" >&5
5727   cat conftest.$ac_ext >&5
5728   rm -rf conftest*
5729   ac_cv_pam=no
5730 fi
5731 rm -f conftest*
5732   CPPFLAGS="$ac_save_CPPFLAGS"
5733 fi
5734
5735 echo "$ac_t""$ac_cv_pam" 1>&6
5736   if test "$ac_cv_pam" = yes ; then
5737     have_pam=yes
5738     cat >> confdefs.h <<\EOF
5739 #define HAVE_PAM 1
5740 EOF
5741
5742     PASSWD_LIBS="${PASSWD_LIBS} -lpam"
5743
5744     # libpam typically requires dlopen and dlsym.  On FreeBSD,
5745     # those are in libc.  On Linux and Solaris, they're in libdl.
5746     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5747 echo "configure:5759: checking for dlopen in -ldl" >&5
5748 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
5749 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5750   echo $ac_n "(cached) $ac_c" 1>&6
5751 else
5752   ac_save_LIBS="$LIBS"
5753 LIBS="-ldl  $LIBS"
5754 cat > conftest.$ac_ext <<EOF
5755 #line 5767 "configure"
5756 #include "confdefs.h"
5757 /* Override any gcc2 internal prototype to avoid an error.  */
5758 /* We use char because int might match the return type of a gcc2
5759     builtin and then its argument prototype would still apply.  */
5760 char dlopen();
5761
5762 int main() {
5763 dlopen()
5764 ; return 0; }
5765 EOF
5766 if { (eval echo configure:5778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5767   rm -rf conftest*
5768   eval "ac_cv_lib_$ac_lib_var=yes"
5769 else
5770   echo "configure: failed program was:" >&5
5771   cat conftest.$ac_ext >&5
5772   rm -rf conftest*
5773   eval "ac_cv_lib_$ac_lib_var=no"
5774 fi
5775 rm -f conftest*
5776 LIBS="$ac_save_LIBS"
5777
5778 fi
5779 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5780   echo "$ac_t""yes" 1>&6
5781   PASSWD_LIBS="${PASSWD_LIBS} -ldl"
5782 else
5783   echo "$ac_t""no" 1>&6
5784 fi
5785
5786
5787     echo $ac_n "checking how to call pam_strerror""... $ac_c" 1>&6
5788 echo "configure:5800: checking how to call pam_strerror" >&5
5789     if eval "test \"`echo '$''{'ac_cv_pam_strerror_args'+set}'`\" = set"; then
5790   echo $ac_n "(cached) $ac_c" 1>&6
5791 else
5792   cat > conftest.$ac_ext <<EOF
5793 #line 5805 "configure"
5794 #include "confdefs.h"
5795 #include <stdio.h>
5796                       #include <stdlib.h>
5797                       #include <security/pam_appl.h>
5798 int main() {
5799 pam_handle_t *pamh = 0;
5800                       char *s = pam_strerror(pamh, PAM_SUCCESS);
5801 ; return 0; }
5802 EOF
5803 if { (eval echo configure:5815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5804   rm -rf conftest*
5805   ac_pam_strerror_args=2
5806 else
5807   echo "configure: failed program was:" >&5
5808   cat conftest.$ac_ext >&5
5809   rm -rf conftest*
5810   cat > conftest.$ac_ext <<EOF
5811 #line 5823 "configure"
5812 #include "confdefs.h"
5813 #include <stdio.h>
5814                                       #include <stdlib.h>
5815                                       #include <security/pam_appl.h>
5816 int main() {
5817 char *s =
5818                                        pam_strerror(PAM_SUCCESS);
5819 ; return 0; }
5820 EOF
5821 if { (eval echo configure:5833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5822   rm -rf conftest*
5823   ac_pam_strerror_args=1
5824 else
5825   echo "configure: failed program was:" >&5
5826   cat conftest.$ac_ext >&5
5827   rm -rf conftest*
5828   ac_pam_strerror_args=0
5829 fi
5830 rm -f conftest*
5831 fi
5832 rm -f conftest*
5833       ac_cv_pam_strerror_args=$ac_pam_strerror_args
5834 fi
5835
5836     ac_pam_strerror_args=$ac_cv_pam_strerror_args
5837     if test "$ac_pam_strerror_args" = 1 ; then
5838       echo "$ac_t""one argument" 1>&6
5839     elif test "$ac_pam_strerror_args" = 2 ; then
5840       cat >> confdefs.h <<\EOF
5841 #define PAM_STRERROR_TWO_ARGS 1
5842 EOF
5843
5844       echo "$ac_t""two arguments" 1>&6
5845     else
5846       echo "$ac_t""unknown" 1>&6
5847     fi
5848   fi
5849 fi
5850
5851
5852 ###############################################################################
5853 #
5854 #       Check for Kerberos.
5855 #
5856 ###############################################################################
5857
5858 have_kerberos=no
5859 have_kerberos5=no
5860 with_kerberos_req=unspecified
5861
5862 # Check whether --with-kerberos or --without-kerberos was given.
5863 if test "${with_kerberos+set}" = set; then
5864   withval="$with_kerberos"
5865   with_kerberos="$withval"; with_kerberos_req="$withval"
5866 else
5867   with_kerberos=yes
5868 fi
5869
5870
5871
5872    case "$with_kerberos" in
5873     yes) ;;
5874     no)  ;;
5875
5876     /*)
5877      echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
5878 echo "configure:5890: checking for Kerberos headers" >&5
5879      d=$with_kerberos/include
5880      if test -d $d; then
5881        X_CFLAGS="-I$d $X_CFLAGS"
5882        echo "$ac_t""$d" 1>&6
5883      else
5884        echo "$ac_t""not found ($d: no such directory)" 1>&6
5885      fi
5886
5887      echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
5888 echo "configure:5900: checking for Kerberos libs" >&5
5889      d=$with_kerberos/lib
5890      if test -d $d; then
5891        X_LIBS="-L$d $X_LIBS"
5892        echo "$ac_t""$d" 1>&6
5893      else
5894        echo "$ac_t""not found ($d: no such directory)" 1>&6
5895      fi
5896
5897      # replace the directory string with "yes".
5898      with_kerberos_req="yes"
5899      with_kerberos=$with_kerberos_req
5900      ;;
5901
5902     *)
5903      echo ""
5904      echo "error: argument to --with-kerberos must be \"yes\", \"no\", or a directory."
5905      echo "       If it is a directory, then \`DIR/include' will be added to"
5906      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
5907      exit 1
5908      ;;
5909    esac
5910   
5911
5912 if test "$enable_locking" = yes -a "$with_kerberos" = yes; then
5913   echo $ac_n "checking for Kerberos 4""... $ac_c" 1>&6
5914 echo "configure:5926: checking for Kerberos 4" >&5
5915 if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
5916   echo $ac_n "(cached) $ac_c" 1>&6
5917 else
5918   
5919   ac_save_CPPFLAGS="$CPPFLAGS"
5920   if test \! -z "$includedir" ; then 
5921     CPPFLAGS="$CPPFLAGS -I$includedir"
5922   fi
5923   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5924   cat > conftest.$ac_ext <<EOF
5925 #line 5937 "configure"
5926 #include "confdefs.h"
5927 #include <krb.h>
5928 int main() {
5929
5930 ; return 0; }
5931 EOF
5932 if { (eval echo configure:5944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5933   rm -rf conftest*
5934   ac_cv_kerberos=yes
5935 else
5936   echo "configure: failed program was:" >&5
5937   cat conftest.$ac_ext >&5
5938   rm -rf conftest*
5939   ac_cv_kerberos=no
5940 fi
5941 rm -f conftest*
5942   CPPFLAGS="$ac_save_CPPFLAGS"
5943 fi
5944
5945 echo "$ac_t""$ac_cv_kerberos" 1>&6
5946   echo $ac_n "checking for Kerberos 5""... $ac_c" 1>&6
5947 echo "configure:5959: checking for Kerberos 5" >&5
5948 if eval "test \"`echo '$''{'ac_cv_kerberos5'+set}'`\" = set"; then
5949   echo $ac_n "(cached) $ac_c" 1>&6
5950 else
5951   
5952   ac_save_CPPFLAGS="$CPPFLAGS"
5953   if test \! -z "$includedir" ; then 
5954     CPPFLAGS="$CPPFLAGS -I$includedir"
5955   fi
5956   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
5957   cat > conftest.$ac_ext <<EOF
5958 #line 5970 "configure"
5959 #include "confdefs.h"
5960 #include <kerberosIV/krb.h>
5961 int main() {
5962
5963 ; return 0; }
5964 EOF
5965 if { (eval echo configure:5977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5966   rm -rf conftest*
5967   ac_cv_kerberos5=yes
5968 else
5969   echo "configure: failed program was:" >&5
5970   cat conftest.$ac_ext >&5
5971   rm -rf conftest*
5972   ac_cv_kerberos5=no
5973 fi
5974 rm -f conftest*
5975   CPPFLAGS="$ac_save_CPPFLAGS"
5976 fi
5977
5978 echo "$ac_t""$ac_cv_kerberos5" 1>&6
5979
5980   if test "$ac_cv_kerberos" = yes ; then
5981     have_kerberos=yes
5982     cat >> confdefs.h <<\EOF
5983 #define HAVE_KERBEROS 1
5984 EOF
5985
5986   fi
5987
5988   if test "$ac_cv_kerberos5" = yes ; then
5989     have_kerberos=yes
5990     have_kerberos5=yes
5991     cat >> confdefs.h <<\EOF
5992 #define HAVE_KERBEROS 1
5993 EOF
5994
5995     cat >> confdefs.h <<\EOF
5996 #define HAVE_KERBEROS5 1
5997 EOF
5998
5999   fi
6000
6001   if test "$have_kerberos5" = yes ; then
6002     # from Matt Knopp <mhat@infocalypse.netlag.com>
6003     # (who got it from amu@mit.edu)
6004     PASSWD_LIBS="$PASSWD_LIBS -lkrb4 -ldes425 -lkrb5 -lk5crypto -lcrypt -lcom_err"
6005   elif test "$have_kerberos" = yes ; then
6006     # from Tim Showalter <tjs@psaux.com> for FreeBSD 4.2
6007     PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes -lcom_err"
6008   fi
6009
6010   if test "$have_kerberos" = yes ; then
6011     echo $ac_n "checking for res_search""... $ac_c" 1>&6
6012 echo "configure:6024: checking for res_search" >&5
6013 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
6014   echo $ac_n "(cached) $ac_c" 1>&6
6015 else
6016   cat > conftest.$ac_ext <<EOF
6017 #line 6029 "configure"
6018 #include "confdefs.h"
6019 /* System header to define __stub macros and hopefully few prototypes,
6020     which can conflict with char res_search(); below.  */
6021 #include <assert.h>
6022 /* Override any gcc2 internal prototype to avoid an error.  */
6023 /* We use char because int might match the return type of a gcc2
6024     builtin and then its argument prototype would still apply.  */
6025 char res_search();
6026
6027 int main() {
6028
6029 /* The GNU C library defines this for functions which it implements
6030     to always fail with ENOSYS.  Some functions are actually named
6031     something starting with __ and the normal name is an alias.  */
6032 #if defined (__stub_res_search) || defined (__stub___res_search)
6033 choke me
6034 #else
6035 res_search();
6036 #endif
6037
6038 ; return 0; }
6039 EOF
6040 if { (eval echo configure:6052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6041   rm -rf conftest*
6042   eval "ac_cv_func_res_search=yes"
6043 else
6044   echo "configure: failed program was:" >&5
6045   cat conftest.$ac_ext >&5
6046   rm -rf conftest*
6047   eval "ac_cv_func_res_search=no"
6048 fi
6049 rm -f conftest*
6050 fi
6051
6052 if eval "test \"`echo '$ac_cv_func_'res_search`\" = yes"; then
6053   echo "$ac_t""yes" 1>&6
6054   :
6055 else
6056   echo "$ac_t""no" 1>&6
6057 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
6058 echo "configure:6070: checking for res_search in -lresolv" >&5
6059 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
6060 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6061   echo $ac_n "(cached) $ac_c" 1>&6
6062 else
6063   ac_save_LIBS="$LIBS"
6064 LIBS="-lresolv  $LIBS"
6065 cat > conftest.$ac_ext <<EOF
6066 #line 6078 "configure"
6067 #include "confdefs.h"
6068 /* Override any gcc2 internal prototype to avoid an error.  */
6069 /* We use char because int might match the return type of a gcc2
6070     builtin and then its argument prototype would still apply.  */
6071 char res_search();
6072
6073 int main() {
6074 res_search()
6075 ; return 0; }
6076 EOF
6077 if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6078   rm -rf conftest*
6079   eval "ac_cv_lib_$ac_lib_var=yes"
6080 else
6081   echo "configure: failed program was:" >&5
6082   cat conftest.$ac_ext >&5
6083   rm -rf conftest*
6084   eval "ac_cv_lib_$ac_lib_var=no"
6085 fi
6086 rm -f conftest*
6087 LIBS="$ac_save_LIBS"
6088
6089 fi
6090 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6091   echo "$ac_t""yes" 1>&6
6092   PASSWD_LIBS="${PASSWD_LIBS} -lresolv"
6093 else
6094   echo "$ac_t""no" 1>&6
6095 echo "configure: warning: Can't find DNS resolver libraries needed for Kerberos" 1>&2
6096       
6097 fi
6098
6099 fi
6100
6101   fi
6102 fi
6103
6104
6105 ###############################################################################
6106 #
6107 #       Check for the nine billion variants of shadow passwords...
6108 #
6109 ###############################################################################
6110
6111 need_setuid=no
6112
6113 have_shadow=no
6114 with_shadow_req=unspecified
6115
6116 # Check whether --with-shadow or --without-shadow was given.
6117 if test "${with_shadow+set}" = set; then
6118   withval="$with_shadow"
6119   with_shadow="$withval"; with_shadow_req="$withval"
6120 else
6121   with_shadow=yes
6122 fi
6123
6124
6125
6126    case "$with_shadow" in
6127     yes) ;;
6128     no)  ;;
6129
6130     /*)
6131      echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
6132 echo "configure:6144: checking for shadow password headers" >&5
6133      d=$with_shadow/include
6134      if test -d $d; then
6135        X_CFLAGS="-I$d $X_CFLAGS"
6136        echo "$ac_t""$d" 1>&6
6137      else
6138        echo "$ac_t""not found ($d: no such directory)" 1>&6
6139      fi
6140
6141      echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
6142 echo "configure:6154: checking for shadow password libs" >&5
6143      d=$with_shadow/lib
6144      if test -d $d; then
6145        X_LIBS="-L$d $X_LIBS"
6146        echo "$ac_t""$d" 1>&6
6147      else
6148        echo "$ac_t""not found ($d: no such directory)" 1>&6
6149      fi
6150
6151      # replace the directory string with "yes".
6152      with_shadow_req="yes"
6153      with_shadow=$with_shadow_req
6154      ;;
6155
6156     *)
6157      echo ""
6158      echo "error: argument to --with-shadow must be \"yes\", \"no\", or a directory."
6159      echo "       If it is a directory, then \`DIR/include' will be added to"
6160      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6161      exit 1
6162      ;;
6163    esac
6164   
6165
6166 if test "$enable_locking" = no ; then
6167   with_shadow_req=no
6168   with_shadow=no
6169 fi
6170
6171
6172 ###############################################################################
6173 #
6174 #       Check for Sun "adjunct" passwords.
6175 #
6176 ###############################################################################
6177
6178 if test "$with_shadow" = yes ; then
6179   echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
6180 echo "configure:6192: checking for Sun-style shadow passwords" >&5
6181 if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
6182   echo $ac_n "(cached) $ac_c" 1>&6
6183 else
6184   
6185   ac_save_CPPFLAGS="$CPPFLAGS"
6186   if test \! -z "$includedir" ; then 
6187     CPPFLAGS="$CPPFLAGS -I$includedir"
6188   fi
6189   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6190   cat > conftest.$ac_ext <<EOF
6191 #line 6203 "configure"
6192 #include "confdefs.h"
6193 #include <stdlib.h>
6194                                     #include <unistd.h>
6195                                     #include <sys/types.h>
6196                                     #include <sys/label.h>
6197                                     #include <sys/audit.h>
6198                                     #include <pwdadj.h>
6199 int main() {
6200 struct passwd_adjunct *p = getpwanam("nobody");
6201                        const char *pw = p->pwa_passwd;
6202 ; return 0; }
6203 EOF
6204 if { (eval echo configure:6216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6205   rm -rf conftest*
6206   ac_cv_sun_adjunct=yes
6207 else
6208   echo "configure: failed program was:" >&5
6209   cat conftest.$ac_ext >&5
6210   rm -rf conftest*
6211   ac_cv_sun_adjunct=no
6212 fi
6213 rm -f conftest*
6214   CPPFLAGS="$ac_save_CPPFLAGS"
6215 fi
6216
6217 echo "$ac_t""$ac_cv_sun_adjunct" 1>&6
6218   if test "$ac_cv_sun_adjunct" = yes; then
6219     have_shadow_adjunct=yes
6220     have_shadow=yes
6221     need_setuid=yes
6222   fi
6223 fi
6224
6225
6226 ###############################################################################
6227 #
6228 #       Check for DEC and SCO so-called "enhanced" security.
6229 #
6230 ###############################################################################
6231
6232 if test "$with_shadow" = yes ; then
6233   echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
6234 echo "configure:6246: checking for DEC-style shadow passwords" >&5
6235 if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
6236   echo $ac_n "(cached) $ac_c" 1>&6
6237 else
6238   
6239   ac_save_CPPFLAGS="$CPPFLAGS"
6240   if test \! -z "$includedir" ; then 
6241     CPPFLAGS="$CPPFLAGS -I$includedir"
6242   fi
6243   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6244   cat > conftest.$ac_ext <<EOF
6245 #line 6257 "configure"
6246 #include "confdefs.h"
6247 #include <stdlib.h>
6248                                     #include <unistd.h>
6249                                     #include <sys/types.h>
6250                                     #include <pwd.h>
6251                                     #include <sys/security.h>
6252                                     #include <prot.h>
6253 int main() {
6254 struct pr_passwd *p;
6255                        const char *pw;
6256                        set_auth_parameters(0, 0);
6257                        check_auth_parameters();
6258                        p = getprpwnam("nobody");
6259                        pw = p->ufld.fd_encrypt;
6260 ; return 0; }
6261 EOF
6262 if { (eval echo configure:6274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6263   rm -rf conftest*
6264   ac_cv_enhanced_passwd=yes
6265 else
6266   echo "configure: failed program was:" >&5
6267   cat conftest.$ac_ext >&5
6268   rm -rf conftest*
6269   ac_cv_enhanced_passwd=no
6270 fi
6271 rm -f conftest*
6272   CPPFLAGS="$ac_save_CPPFLAGS"
6273 fi
6274
6275 echo "$ac_t""$ac_cv_enhanced_passwd" 1>&6
6276   if test $ac_cv_enhanced_passwd = yes; then
6277     have_shadow_enhanced=yes
6278     have_shadow=yes
6279     need_setuid=yes
6280
6281     # On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
6282     # (I'm told it needs -lcurses too, but I don't understand why.)
6283     # But on DEC, it's in -lsecurity.
6284     #
6285     echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
6286 echo "configure:6298: checking for getprpwnam in -lprot" >&5
6287 ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
6288 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6289   echo $ac_n "(cached) $ac_c" 1>&6
6290 else
6291   ac_save_LIBS="$LIBS"
6292 LIBS="-lprot -lx $LIBS"
6293 cat > conftest.$ac_ext <<EOF
6294 #line 6306 "configure"
6295 #include "confdefs.h"
6296 /* Override any gcc2 internal prototype to avoid an error.  */
6297 /* We use char because int might match the return type of a gcc2
6298     builtin and then its argument prototype would still apply.  */
6299 char getprpwnam();
6300
6301 int main() {
6302 getprpwnam()
6303 ; return 0; }
6304 EOF
6305 if { (eval echo configure:6317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6306   rm -rf conftest*
6307   eval "ac_cv_lib_$ac_lib_var=yes"
6308 else
6309   echo "configure: failed program was:" >&5
6310   cat conftest.$ac_ext >&5
6311   rm -rf conftest*
6312   eval "ac_cv_lib_$ac_lib_var=no"
6313 fi
6314 rm -f conftest*
6315 LIBS="$ac_save_LIBS"
6316
6317 fi
6318 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6319   echo "$ac_t""yes" 1>&6
6320   PASSWD_LIBS="$PASSWD_LIBS -lprot -lcurses -lx"
6321 else
6322   echo "$ac_t""no" 1>&6
6323 echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
6324 echo "configure:6336: checking for getprpwnam in -lsecurity" >&5
6325 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
6326 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6327   echo $ac_n "(cached) $ac_c" 1>&6
6328 else
6329   ac_save_LIBS="$LIBS"
6330 LIBS="-lsecurity  $LIBS"
6331 cat > conftest.$ac_ext <<EOF
6332 #line 6344 "configure"
6333 #include "confdefs.h"
6334 /* Override any gcc2 internal prototype to avoid an error.  */
6335 /* We use char because int might match the return type of a gcc2
6336     builtin and then its argument prototype would still apply.  */
6337 char getprpwnam();
6338
6339 int main() {
6340 getprpwnam()
6341 ; return 0; }
6342 EOF
6343 if { (eval echo configure:6355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6344   rm -rf conftest*
6345   eval "ac_cv_lib_$ac_lib_var=yes"
6346 else
6347   echo "configure: failed program was:" >&5
6348   cat conftest.$ac_ext >&5
6349   rm -rf conftest*
6350   eval "ac_cv_lib_$ac_lib_var=no"
6351 fi
6352 rm -f conftest*
6353 LIBS="$ac_save_LIBS"
6354
6355 fi
6356 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6357   echo "$ac_t""yes" 1>&6
6358   PASSWD_LIBS="$PASSWD_LIBS -lsecurity"
6359 else
6360   echo "$ac_t""no" 1>&6
6361 fi
6362
6363 fi
6364
6365   fi
6366 fi
6367
6368 ###############################################################################
6369 #
6370 #       Check for HP's entry in the "Not Invented Here" Sweepstakes.
6371 #
6372 ###############################################################################
6373
6374 if test "$with_shadow" = yes ; then
6375   echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
6376 echo "configure:6388: checking for HP-style shadow passwords" >&5
6377 if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
6378   echo $ac_n "(cached) $ac_c" 1>&6
6379 else
6380   
6381   ac_save_CPPFLAGS="$CPPFLAGS"
6382   if test \! -z "$includedir" ; then 
6383     CPPFLAGS="$CPPFLAGS -I$includedir"
6384   fi
6385   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6386   cat > conftest.$ac_ext <<EOF
6387 #line 6399 "configure"
6388 #include "confdefs.h"
6389 #include <stdlib.h>
6390                                     #include <unistd.h>
6391                                     #include <sys/types.h>
6392                                     #include <pwd.h>
6393                                     #include <hpsecurity.h>
6394                                     #include <prot.h>
6395 int main() {
6396 struct s_passwd *p = getspwnam("nobody");
6397                        const char *pw = p->pw_passwd;
6398 ; return 0; }
6399 EOF
6400 if { (eval echo configure:6412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6401   rm -rf conftest*
6402   ac_cv_hpux_passwd=yes
6403 else
6404   echo "configure: failed program was:" >&5
6405   cat conftest.$ac_ext >&5
6406   rm -rf conftest*
6407   ac_cv_hpux_passwd=no
6408 fi
6409 rm -f conftest*
6410   CPPFLAGS="$ac_save_CPPFLAGS"
6411 fi
6412
6413 echo "$ac_t""$ac_cv_hpux_passwd" 1>&6
6414   if test "$ac_cv_hpux_passwd" = yes; then
6415     have_shadow_hpux=yes
6416     have_shadow=yes
6417     need_setuid=yes
6418
6419     # on HPUX, bigcrypt is in -lsec
6420     echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
6421 echo "configure:6433: checking for bigcrypt in -lsec" >&5
6422 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
6423 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6424   echo $ac_n "(cached) $ac_c" 1>&6
6425 else
6426   ac_save_LIBS="$LIBS"
6427 LIBS="-lsec  $LIBS"
6428 cat > conftest.$ac_ext <<EOF
6429 #line 6441 "configure"
6430 #include "confdefs.h"
6431 /* Override any gcc2 internal prototype to avoid an error.  */
6432 /* We use char because int might match the return type of a gcc2
6433     builtin and then its argument prototype would still apply.  */
6434 char bigcrypt();
6435
6436 int main() {
6437 bigcrypt()
6438 ; return 0; }
6439 EOF
6440 if { (eval echo configure:6452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6441   rm -rf conftest*
6442   eval "ac_cv_lib_$ac_lib_var=yes"
6443 else
6444   echo "configure: failed program was:" >&5
6445   cat conftest.$ac_ext >&5
6446   rm -rf conftest*
6447   eval "ac_cv_lib_$ac_lib_var=no"
6448 fi
6449 rm -f conftest*
6450 LIBS="$ac_save_LIBS"
6451
6452 fi
6453 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6454   echo "$ac_t""yes" 1>&6
6455   PASSWD_LIBS="$PASSWD_LIBS -lsec"
6456 else
6457   echo "$ac_t""no" 1>&6
6458 fi
6459
6460   fi
6461 fi
6462
6463
6464 ###############################################################################
6465 #
6466 #       Check for FreeBSD-style shadow passwords.
6467 #
6468 #       On FreeBSD, getpwnam() and friends work just like on non-shadow-
6469 #       password systems -- except you only get stuff in the pw_passwd field
6470 #       if the running program is setuid.  So, guess that we've got this
6471 #       lossage to contend with if /etc/master.passwd exists, and default to
6472 #       a setuid installation.
6473 #
6474 ###############################################################################
6475
6476 if test "$with_shadow" = yes ; then
6477   echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
6478 echo "configure:6490: checking for FreeBSD-style shadow passwords" >&5
6479 if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
6480   echo $ac_n "(cached) $ac_c" 1>&6
6481 else
6482   if test -f /etc/master.passwd ; then
6483                     ac_cv_master_passwd=yes
6484                   else
6485                     ac_cv_master_passwd=no
6486                   fi
6487 fi
6488
6489 echo "$ac_t""$ac_cv_master_passwd" 1>&6
6490   if test "$ac_cv_master_passwd" = yes; then
6491     need_setuid=yes
6492   fi
6493 fi
6494
6495
6496 ###############################################################################
6497 #
6498 #       Check for traditional (ha!) shadow passwords.
6499 #
6500 ###############################################################################
6501
6502 if test "$with_shadow" = yes ; then
6503   echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
6504 echo "configure:6516: checking for generic shadow passwords" >&5
6505 if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
6506   echo $ac_n "(cached) $ac_c" 1>&6
6507 else
6508   
6509   ac_save_CPPFLAGS="$CPPFLAGS"
6510   if test \! -z "$includedir" ; then 
6511     CPPFLAGS="$CPPFLAGS -I$includedir"
6512   fi
6513   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6514   cat > conftest.$ac_ext <<EOF
6515 #line 6527 "configure"
6516 #include "confdefs.h"
6517 #include <stdlib.h>
6518                                     #include <unistd.h>
6519                                     #include <sys/types.h>
6520                                     #include <pwd.h>
6521                                     #include <shadow.h>
6522 int main() {
6523 struct spwd *p = getspnam("nobody");
6524                        const char *pw = p->sp_pwdp;
6525 ; return 0; }
6526 EOF
6527 if { (eval echo configure:6539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6528   rm -rf conftest*
6529   ac_cv_shadow=yes
6530 else
6531   echo "configure: failed program was:" >&5
6532   cat conftest.$ac_ext >&5
6533   rm -rf conftest*
6534   ac_cv_shadow=no
6535 fi
6536 rm -f conftest*
6537   CPPFLAGS="$ac_save_CPPFLAGS"
6538 fi
6539
6540 echo "$ac_t""$ac_cv_shadow" 1>&6
6541   if test "$ac_cv_shadow" = yes; then
6542     have_shadow=yes
6543     need_setuid=yes
6544
6545     # On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
6546     have_getspnam=no
6547     echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
6548 echo "configure:6560: checking for getspnam in -lc" >&5
6549 ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
6550 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6551   echo $ac_n "(cached) $ac_c" 1>&6
6552 else
6553   ac_save_LIBS="$LIBS"
6554 LIBS="-lc  $LIBS"
6555 cat > conftest.$ac_ext <<EOF
6556 #line 6568 "configure"
6557 #include "confdefs.h"
6558 /* Override any gcc2 internal prototype to avoid an error.  */
6559 /* We use char because int might match the return type of a gcc2
6560     builtin and then its argument prototype would still apply.  */
6561 char getspnam();
6562
6563 int main() {
6564 getspnam()
6565 ; return 0; }
6566 EOF
6567 if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6568   rm -rf conftest*
6569   eval "ac_cv_lib_$ac_lib_var=yes"
6570 else
6571   echo "configure: failed program was:" >&5
6572   cat conftest.$ac_ext >&5
6573   rm -rf conftest*
6574   eval "ac_cv_lib_$ac_lib_var=no"
6575 fi
6576 rm -f conftest*
6577 LIBS="$ac_save_LIBS"
6578
6579 fi
6580 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6581   echo "$ac_t""yes" 1>&6
6582   have_getspnam=yes
6583 else
6584   echo "$ac_t""no" 1>&6
6585 fi
6586
6587     if test "$have_getspnam" = no ; then
6588       echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
6589 echo "configure:6601: checking for getspnam in -lgen" >&5
6590 ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
6591 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6592   echo $ac_n "(cached) $ac_c" 1>&6
6593 else
6594   ac_save_LIBS="$LIBS"
6595 LIBS="-lgen  $LIBS"
6596 cat > conftest.$ac_ext <<EOF
6597 #line 6609 "configure"
6598 #include "confdefs.h"
6599 /* Override any gcc2 internal prototype to avoid an error.  */
6600 /* We use char because int might match the return type of a gcc2
6601     builtin and then its argument prototype would still apply.  */
6602 char getspnam();
6603
6604 int main() {
6605 getspnam()
6606 ; return 0; }
6607 EOF
6608 if { (eval echo configure:6620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6609   rm -rf conftest*
6610   eval "ac_cv_lib_$ac_lib_var=yes"
6611 else
6612   echo "configure: failed program was:" >&5
6613   cat conftest.$ac_ext >&5
6614   rm -rf conftest*
6615   eval "ac_cv_lib_$ac_lib_var=no"
6616 fi
6617 rm -f conftest*
6618 LIBS="$ac_save_LIBS"
6619
6620 fi
6621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6622   echo "$ac_t""yes" 1>&6
6623   have_getspnam=yes; PASSWD_LIBS="$PASSWD_LIBS -lgen"
6624 else
6625   echo "$ac_t""no" 1>&6
6626 fi
6627
6628     fi
6629   fi
6630 fi
6631
6632
6633 ###############################################################################
6634 #
6635 #       Check for other libraries needed for non-shadow passwords.
6636 #
6637 ###############################################################################
6638
6639 if test "$enable_locking" = yes ; then
6640
6641   # On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
6642   have_crypt=no
6643   echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
6644 echo "configure:6656: checking for crypt in -lc" >&5
6645 ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
6646 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6647   echo $ac_n "(cached) $ac_c" 1>&6
6648 else
6649   ac_save_LIBS="$LIBS"
6650 LIBS="-lc  $LIBS"
6651 cat > conftest.$ac_ext <<EOF
6652 #line 6664 "configure"
6653 #include "confdefs.h"
6654 /* Override any gcc2 internal prototype to avoid an error.  */
6655 /* We use char because int might match the return type of a gcc2
6656     builtin and then its argument prototype would still apply.  */
6657 char crypt();
6658
6659 int main() {
6660 crypt()
6661 ; return 0; }
6662 EOF
6663 if { (eval echo configure:6675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=yes"
6666 else
6667   echo "configure: failed program was:" >&5
6668   cat conftest.$ac_ext >&5
6669   rm -rf conftest*
6670   eval "ac_cv_lib_$ac_lib_var=no"
6671 fi
6672 rm -f conftest*
6673 LIBS="$ac_save_LIBS"
6674
6675 fi
6676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6677   echo "$ac_t""yes" 1>&6
6678   have_crypt=yes
6679 else
6680   echo "$ac_t""no" 1>&6
6681 fi
6682
6683   if test "$have_crypt" = no ; then
6684     echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
6685 echo "configure:6697: checking for crypt in -lcrypt" >&5
6686 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
6687 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6688   echo $ac_n "(cached) $ac_c" 1>&6
6689 else
6690   ac_save_LIBS="$LIBS"
6691 LIBS="-lcrypt  $LIBS"
6692 cat > conftest.$ac_ext <<EOF
6693 #line 6705 "configure"
6694 #include "confdefs.h"
6695 /* Override any gcc2 internal prototype to avoid an error.  */
6696 /* We use char because int might match the return type of a gcc2
6697     builtin and then its argument prototype would still apply.  */
6698 char crypt();
6699
6700 int main() {
6701 crypt()
6702 ; return 0; }
6703 EOF
6704 if { (eval echo configure:6716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6705   rm -rf conftest*
6706   eval "ac_cv_lib_$ac_lib_var=yes"
6707 else
6708   echo "configure: failed program was:" >&5
6709   cat conftest.$ac_ext >&5
6710   rm -rf conftest*
6711   eval "ac_cv_lib_$ac_lib_var=no"
6712 fi
6713 rm -f conftest*
6714 LIBS="$ac_save_LIBS"
6715
6716 fi
6717 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6718   echo "$ac_t""yes" 1>&6
6719   have_crypt=yes; PASSWD_LIBS="$PASSWD_LIBS -lcrypt"
6720 else
6721   echo "$ac_t""no" 1>&6
6722 fi
6723
6724   fi
6725 fi
6726
6727
6728 # Most of the above shadow mechanisms will have set need_setuid to yes,
6729 # if they were found.  But, on some systems, we need setuid even when
6730 # using plain old vanilla passwords.
6731 #
6732 if test "$enable_locking" = yes ; then
6733   case "$host" in
6734     *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
6735       need_setuid=yes
6736     ;;
6737   esac
6738 fi
6739
6740
6741 if test "$have_shadow_adjunct" = yes ; then
6742   cat >> confdefs.h <<\EOF
6743 #define HAVE_ADJUNCT_PASSWD 1
6744 EOF
6745
6746 elif test "$have_shadow_enhanced" = yes ; then
6747   cat >> confdefs.h <<\EOF
6748 #define HAVE_ENHANCED_PASSWD 1
6749 EOF
6750
6751 elif test "$have_shadow_hpux" = yes ; then
6752   cat >> confdefs.h <<\EOF
6753 #define HAVE_HPUX_PASSWD 1
6754 EOF
6755
6756 elif test "$have_shadow" = yes ; then
6757   cat >> confdefs.h <<\EOF
6758 #define HAVE_SHADOW_PASSWD 1
6759 EOF
6760
6761 fi
6762
6763
6764 ###############################################################################
6765 #
6766 #       Check for -lXm.
6767 #
6768 ###############################################################################
6769
6770 have_motif=no
6771 with_motif_req=unspecified
6772 # Check whether --with-motif or --without-motif was given.
6773 if test "${with_motif+set}" = set; then
6774   withval="$with_motif"
6775   with_motif="$withval"; with_motif_req="$withval"
6776 else
6777   with_motif=yes
6778 fi
6779
6780
6781
6782    case "$with_motif" in
6783     yes) ;;
6784     no)  ;;
6785
6786     /*)
6787      echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
6788 echo "configure:6800: checking for Motif headers" >&5
6789      d=$with_motif/include
6790      if test -d $d; then
6791        X_CFLAGS="-I$d $X_CFLAGS"
6792        echo "$ac_t""$d" 1>&6
6793      else
6794        echo "$ac_t""not found ($d: no such directory)" 1>&6
6795      fi
6796
6797      echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
6798 echo "configure:6810: checking for Motif libs" >&5
6799      d=$with_motif/lib
6800      if test -d $d; then
6801        X_LIBS="-L$d $X_LIBS"
6802        echo "$ac_t""$d" 1>&6
6803      else
6804        echo "$ac_t""not found ($d: no such directory)" 1>&6
6805      fi
6806
6807      # replace the directory string with "yes".
6808      with_motif_req="yes"
6809      with_motif=$with_motif_req
6810      ;;
6811
6812     *)
6813      echo ""
6814      echo "error: argument to --with-motif must be \"yes\", \"no\", or a directory."
6815      echo "       If it is a directory, then \`DIR/include' will be added to"
6816      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6817      exit 1
6818      ;;
6819    esac
6820   
6821
6822 if test "$with_motif" != yes -a "$with_motif" != no ; then
6823   echo "error: must be yes or no: --with-motif=$with_motif"
6824   exit 1
6825 fi
6826
6827 if test "$with_motif" = yes; then
6828   have_motif=no
6829   
6830   ac_save_CPPFLAGS="$CPPFLAGS"
6831   if test \! -z "$includedir" ; then 
6832     CPPFLAGS="$CPPFLAGS -I$includedir"
6833   fi
6834   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6835   ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
6836 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
6837 echo "configure:6849: checking for Xm/Xm.h" >&5
6838 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6839   echo $ac_n "(cached) $ac_c" 1>&6
6840 else
6841   cat > conftest.$ac_ext <<EOF
6842 #line 6854 "configure"
6843 #include "confdefs.h"
6844 #include <Xm/Xm.h>
6845 EOF
6846 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6847 { (eval echo configure:6859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6848 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6849 if test -z "$ac_err"; then
6850   rm -rf conftest*
6851   eval "ac_cv_header_$ac_safe=yes"
6852 else
6853   echo "$ac_err" >&5
6854   echo "configure: failed program was:" >&5
6855   cat conftest.$ac_ext >&5
6856   rm -rf conftest*
6857   eval "ac_cv_header_$ac_safe=no"
6858 fi
6859 rm -f conftest*
6860 fi
6861 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6862   echo "$ac_t""yes" 1>&6
6863   have_motif=yes
6864                      cat >> confdefs.h <<\EOF
6865 #define HAVE_MOTIF 1
6866 EOF
6867
6868                      MOTIF_LIBS="$MOTIF_LIBS -lXm"
6869 else
6870   echo "$ac_t""no" 1>&6
6871 fi
6872
6873   CPPFLAGS="$ac_save_CPPFLAGS"
6874 fi
6875
6876
6877 if test "$have_motif" = yes; then
6878   
6879   ac_save_CPPFLAGS="$CPPFLAGS"
6880   if test \! -z "$includedir" ; then 
6881     CPPFLAGS="$CPPFLAGS -I$includedir"
6882   fi
6883   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
6884   ac_safe=`echo "Xm/ComboBox.h" | sed 'y%./+-%__p_%'`
6885 echo $ac_n "checking for Xm/ComboBox.h""... $ac_c" 1>&6
6886 echo "configure:6898: checking for Xm/ComboBox.h" >&5
6887 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6888   echo $ac_n "(cached) $ac_c" 1>&6
6889 else
6890   cat > conftest.$ac_ext <<EOF
6891 #line 6903 "configure"
6892 #include "confdefs.h"
6893 #include <Xm/ComboBox.h>
6894 EOF
6895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6896 { (eval echo configure:6908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6897 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6898 if test -z "$ac_err"; then
6899   rm -rf conftest*
6900   eval "ac_cv_header_$ac_safe=yes"
6901 else
6902   echo "$ac_err" >&5
6903   echo "configure: failed program was:" >&5
6904   cat conftest.$ac_ext >&5
6905   rm -rf conftest*
6906   eval "ac_cv_header_$ac_safe=no"
6907 fi
6908 rm -f conftest*
6909 fi
6910 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6911   echo "$ac_t""yes" 1>&6
6912   cat >> confdefs.h <<\EOF
6913 #define HAVE_XMCOMBOBOX 1
6914 EOF
6915
6916 else
6917   echo "$ac_t""no" 1>&6
6918 fi
6919
6920   CPPFLAGS="$ac_save_CPPFLAGS"
6921 fi
6922
6923
6924 ###############################################################################
6925 #
6926 #       Check for -lgtk (and Gnome stuff)
6927 #
6928 ###############################################################################
6929
6930 have_gtk=no
6931 with_gtk_req=unspecified
6932 # Check whether --with-gtk or --without-gtk was given.
6933 if test "${with_gtk+set}" = set; then
6934   withval="$with_gtk"
6935   with_gtk="$withval"; with_gtk_req="$withval"
6936 else
6937   with_gtk=yes
6938 fi
6939
6940
6941 # if --with-gtk=/directory/ was specified, remember that directory so that
6942 # we can also look for the `gtk-config' program in that directory.
6943 case "$with_gtk" in
6944   /*)
6945     gtk_dir="$with_gtk"
6946     ;;
6947   *)
6948     gtk_dir=""
6949     ;;
6950 esac
6951
6952
6953    case "$with_gtk" in
6954     yes) ;;
6955     no)  ;;
6956
6957     /*)
6958      echo $ac_n "checking for Gtk headers""... $ac_c" 1>&6
6959 echo "configure:6971: checking for Gtk headers" >&5
6960      d=$with_gtk/include
6961      if test -d $d; then
6962        X_CFLAGS="-I$d $X_CFLAGS"
6963        echo "$ac_t""$d" 1>&6
6964      else
6965        echo "$ac_t""not found ($d: no such directory)" 1>&6
6966      fi
6967
6968      echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
6969 echo "configure:6981: checking for Gtk libs" >&5
6970      d=$with_gtk/lib
6971      if test -d $d; then
6972        X_LIBS="-L$d $X_LIBS"
6973        echo "$ac_t""$d" 1>&6
6974      else
6975        echo "$ac_t""not found ($d: no such directory)" 1>&6
6976      fi
6977
6978      # replace the directory string with "yes".
6979      with_gtk_req="yes"
6980      with_gtk=$with_gtk_req
6981      ;;
6982
6983     *)
6984      echo ""
6985      echo "error: argument to --with-gtk must be \"yes\", \"no\", or a directory."
6986      echo "       If it is a directory, then \`DIR/include' will be added to"
6987      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
6988      exit 1
6989      ;;
6990    esac
6991   
6992
6993 if test "$with_gtk" != yes -a "$with_gtk" != no ; then
6994   echo "error: must be yes or no: --with-gtk=$with_gtk"
6995   exit 1
6996 fi
6997
6998 have_gnome=no
6999 with_gnome_req=unspecified
7000 # Check whether --with-gnome or --without-gnome was given.
7001 if test "${with_gnome+set}" = set; then
7002   withval="$with_gnome"
7003   with_gnome="$withval"; with_gnome_req="$withval"
7004 else
7005   with_gnome=yes
7006 fi
7007
7008
7009 # if --with-gnome=/directory/ was specified, remember that directory so that
7010 # we can also look for the `gnome-config' program in that directory.
7011 case "$with_gnome" in
7012   /*)
7013     gnome_dir="$with_gnome"
7014     ;;
7015   *)
7016     gnome_dir=""
7017     ;;
7018 esac
7019
7020
7021    case "$with_gnome" in
7022     yes) ;;
7023     no)  ;;
7024
7025     /*)
7026      echo $ac_n "checking for Gnome headers""... $ac_c" 1>&6
7027 echo "configure:7039: checking for Gnome headers" >&5
7028      d=$with_gnome/include
7029      if test -d $d; then
7030        X_CFLAGS="-I$d $X_CFLAGS"
7031        echo "$ac_t""$d" 1>&6
7032      else
7033        echo "$ac_t""not found ($d: no such directory)" 1>&6
7034      fi
7035
7036      echo $ac_n "checking for Gnome libs""... $ac_c" 1>&6
7037 echo "configure:7049: checking for Gnome libs" >&5
7038      d=$with_gnome/lib
7039      if test -d $d; then
7040        X_LIBS="-L$d $X_LIBS"
7041        echo "$ac_t""$d" 1>&6
7042      else
7043        echo "$ac_t""not found ($d: no such directory)" 1>&6
7044      fi
7045
7046      # replace the directory string with "yes".
7047      with_gnome_req="yes"
7048      with_gnome=$with_gnome_req
7049      ;;
7050
7051     *)
7052      echo ""
7053      echo "error: argument to --with-gnome must be \"yes\", \"no\", or a directory."
7054      echo "       If it is a directory, then \`DIR/include' will be added to"
7055      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7056      exit 1
7057      ;;
7058    esac
7059   
7060
7061 if test "$with_gnome" != yes -a "$with_gnome" != no ; then
7062   echo "error: must be yes or no: --with-gnome=$with_gnome"
7063   exit 1
7064 fi
7065
7066
7067 jurassic_gtk=no
7068 if test "$with_gtk" = yes; then
7069   have_gtk=no
7070   
7071   # if the user specified --with-gtk=/foo/ then look in /foo/bin/
7072   # for glib-config and gtk-config.
7073   #
7074   gtk_path="$PATH"
7075
7076   if test ! -z "$gtk_dir"; then
7077     # canonicalize slashes.
7078     gtk_dir=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
7079     gtk_path="$gtk_dir:$gtk_path"
7080   fi
7081
7082   if test ! -z "gnome_dir"; then
7083     # canonicalize slashes.
7084     gnome_dir=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
7085     gtk_path="$gnome_dir:$gtk_path"
7086   fi
7087
7088   for ac_prog in glib12-config glib-config
7089 do
7090 # Extract the first word of "$ac_prog", so it can be a program name with args.
7091 set dummy $ac_prog; ac_word=$2
7092 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7093 echo "configure:7105: checking for $ac_word" >&5
7094 if eval "test \"`echo '$''{'ac_cv_path_glib_config'+set}'`\" = set"; then
7095   echo $ac_n "(cached) $ac_c" 1>&6
7096 else
7097   case "$glib_config" in
7098   /*)
7099   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a path.
7100   ;;
7101   ?:/*)                  
7102   ac_cv_path_glib_config="$glib_config" # Let the user override the test with a dos path.
7103   ;;
7104   *)
7105   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7106   ac_dummy="$gtk_path"
7107   for ac_dir in $ac_dummy; do 
7108     test -z "$ac_dir" && ac_dir=.
7109     if test -f $ac_dir/$ac_word; then
7110       ac_cv_path_glib_config="$ac_dir/$ac_word"
7111       break
7112     fi
7113   done
7114   IFS="$ac_save_ifs"
7115   ;;
7116 esac
7117 fi
7118 glib_config="$ac_cv_path_glib_config"
7119 if test -n "$glib_config"; then
7120   echo "$ac_t""$glib_config" 1>&6
7121 else
7122   echo "$ac_t""no" 1>&6
7123 fi
7124
7125 test -n "$glib_config" && break
7126 done
7127
7128   for ac_prog in gtk12-config  gtk-config
7129 do
7130 # Extract the first word of "$ac_prog", so it can be a program name with args.
7131 set dummy $ac_prog; ac_word=$2
7132 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7133 echo "configure:7145: checking for $ac_word" >&5
7134 if eval "test \"`echo '$''{'ac_cv_path_gtk_config'+set}'`\" = set"; then
7135   echo $ac_n "(cached) $ac_c" 1>&6
7136 else
7137   case "$gtk_config" in
7138   /*)
7139   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a path.
7140   ;;
7141   ?:/*)                  
7142   ac_cv_path_gtk_config="$gtk_config" # Let the user override the test with a dos path.
7143   ;;
7144   *)
7145   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7146   ac_dummy="$gtk_path"
7147   for ac_dir in $ac_dummy; do 
7148     test -z "$ac_dir" && ac_dir=.
7149     if test -f $ac_dir/$ac_word; then
7150       ac_cv_path_gtk_config="$ac_dir/$ac_word"
7151       break
7152     fi
7153   done
7154   IFS="$ac_save_ifs"
7155   ;;
7156 esac
7157 fi
7158 gtk_config="$ac_cv_path_gtk_config"
7159 if test -n "$gtk_config"; then
7160   echo "$ac_t""$gtk_config" 1>&6
7161 else
7162   echo "$ac_t""no" 1>&6
7163 fi
7164
7165 test -n "$gtk_config" && break
7166 done
7167
7168
7169   if test "$with_gnome" = yes; then
7170     for ac_prog in gnome-config
7171 do
7172 # Extract the first word of "$ac_prog", so it can be a program name with args.
7173 set dummy $ac_prog; ac_word=$2
7174 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7175 echo "configure:7187: checking for $ac_word" >&5
7176 if eval "test \"`echo '$''{'ac_cv_path_gnome_config'+set}'`\" = set"; then
7177   echo $ac_n "(cached) $ac_c" 1>&6
7178 else
7179   case "$gnome_config" in
7180   /*)
7181   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a path.
7182   ;;
7183   ?:/*)                  
7184   ac_cv_path_gnome_config="$gnome_config" # Let the user override the test with a dos path.
7185   ;;
7186   *)
7187   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7188   ac_dummy="$gtk_path"
7189   for ac_dir in $ac_dummy; do 
7190     test -z "$ac_dir" && ac_dir=.
7191     if test -f $ac_dir/$ac_word; then
7192       ac_cv_path_gnome_config="$ac_dir/$ac_word"
7193       break
7194     fi
7195   done
7196   IFS="$ac_save_ifs"
7197   ;;
7198 esac
7199 fi
7200 gnome_config="$ac_cv_path_gnome_config"
7201 if test -n "$gnome_config"; then
7202   echo "$ac_t""$gnome_config" 1>&6
7203 else
7204   echo "$ac_t""no" 1>&6
7205 fi
7206
7207 test -n "$gnome_config" && break
7208 done
7209
7210   fi
7211
7212   if test -n "$glib_config" -a  -n "gtk_config" ; then
7213     have_gtk=yes
7214     if test "$with_gnome" = yes -a -n "$gnome_config" ; then
7215       have_gnome=yes
7216     fi
7217   fi
7218
7219   if test "$have_gtk" = yes; then
7220     echo $ac_n "checking Gtk version number""... $ac_c" 1>&6
7221 echo "configure:7233: checking Gtk version number" >&5
7222 if eval "test \"`echo '$''{'ac_cv_gtk_version_string'+set}'`\" = set"; then
7223   echo $ac_n "(cached) $ac_c" 1>&6
7224 else
7225   ac_cv_gtk_version_string=`$gtk_config --version`
7226 fi
7227
7228 echo "$ac_t""$ac_cv_gtk_version_string" 1>&6
7229     ac_gtk_version_string=$ac_cv_gtk_version_string
7230     # M4 sucks!!
7231     
7232     maj=`echo $ac_gtk_version_string | sed -n 's/\..*//p'`
7233     min=`echo $ac_gtk_version_string | sed -n 's/[^.]*\.\([^.]*\).*/\1/p'`
7234     
7235     ac_gtk_version=`echo "$maj * 1000 + $min" | bc`
7236     if test -z "$ac_gtk_version"; then
7237       ac_gtk_version=unknown
7238       ac_gtk_version_string=unknown
7239     fi
7240     if test "$ac_gtk_version" = "unknown" || test "$ac_gtk_version" -lt 1002
7241     then
7242       have_gtk=no
7243       have_gnome=no
7244       jurassic_gtk=yes
7245     fi
7246   fi
7247
7248   if test "$have_gtk" = yes; then
7249     echo $ac_n "checking for Gtk includes""... $ac_c" 1>&6
7250 echo "configure:7262: checking for Gtk includes" >&5
7251 if eval "test \"`echo '$''{'ac_cv_gtk_config_cflags'+set}'`\" = set"; then
7252   echo $ac_n "(cached) $ac_c" 1>&6
7253 else
7254   ac_cv_gtk_config_cflags=`$gtk_config --cflags`
7255 fi
7256
7257 echo "$ac_t""$ac_cv_gtk_config_cflags" 1>&6
7258     echo $ac_n "checking for Gtk libs""... $ac_c" 1>&6
7259 echo "configure:7271: checking for Gtk libs" >&5
7260 if eval "test \"`echo '$''{'ac_cv_gtk_config_libs'+set}'`\" = set"; then
7261   echo $ac_n "(cached) $ac_c" 1>&6
7262 else
7263   ac_cv_gtk_config_libs=`$gtk_config --libs`
7264 fi
7265
7266 echo "$ac_t""$ac_cv_gtk_config_libs" 1>&6
7267   fi
7268   ac_gtk_config_cflags=$ac_cv_gtk_config_cflags
7269   ac_gtk_config_libs=$ac_cv_gtk_config_libs
7270
7271   # Check for Gnome Capplet support.
7272   #
7273   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7274     gnome_config_libs="gtk capplet gnomeui xml gdk_pixbuf"
7275     echo $ac_n "checking for Gnome capplet includes""... $ac_c" 1>&6
7276 echo "configure:7288: checking for Gnome capplet includes" >&5
7277     if eval "test \"`echo '$''{'ac_cv_gnome_config_cflags'+set}'`\" = set"; then
7278   echo $ac_n "(cached) $ac_c" 1>&6
7279 else
7280   if ( $gnome_config --cflags $gnome_config_libs 2>&1 >/dev/null | \
7281             grep Unknown >/dev/null ) ; then
7282          ac_cv_gnome_config_cflags=''
7283        else
7284          ac_cv_gnome_config_cflags=`$gnome_config --cflags $gnome_config_libs`
7285        fi
7286 fi
7287
7288     ac_gnome_config_cflags=$ac_cv_gnome_config_cflags
7289     if test "$ac_gnome_config_cflags" = "" ; then
7290       have_gnome=no
7291       echo "$ac_t""no" 1>&6
7292     else
7293       echo "$ac_t""$ac_gnome_config_cflags" 1>&6
7294     fi
7295   fi
7296
7297   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7298     echo $ac_n "checking for Gnome capplet libs""... $ac_c" 1>&6
7299 echo "configure:7311: checking for Gnome capplet libs" >&5
7300     if eval "test \"`echo '$''{'ac_cv_gnome_config_libs'+set}'`\" = set"; then
7301   echo $ac_n "(cached) $ac_c" 1>&6
7302 else
7303   if ( $gnome_config --libs $gnome_config_libs 2>&1 >/dev/null |
7304             grep Unknown >/dev/null ) ; then
7305          ac_cv_gnome_config_libs=''
7306        else
7307          ac_cv_gnome_config_libs=`$gnome_config --libs $gnome_config_libs`
7308        fi
7309 fi
7310
7311     ac_gnome_config_libs=$ac_cv_gnome_config_libs
7312     if test "$ac_gnome_config_libs" = "" ; then
7313       have_gnome=no
7314       echo "$ac_t""no" 1>&6
7315     else
7316       echo "$ac_t""$ac_gnome_config_libs" 1>&6
7317     fi
7318   fi
7319
7320   GNOME_DATADIR=""
7321   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7322     GNOME_DATADIR=`$gnome_config --datadir`
7323   fi
7324
7325
7326   # If we have Gnome, then override the gtk-config values with 
7327   # the gnome-config values.
7328   #
7329   if test "$have_gnome" = yes -a "$have_gtk" = yes; then
7330     ac_gtk_config_cflags=$ac_gnome_config_cflags
7331     ac_gtk_config_libs=$ac_gnome_config_libs
7332     cat >> confdefs.h <<\EOF
7333 #define HAVE_CRAPPLET 1
7334 EOF
7335
7336
7337     # check for this function that was not in libcapplet 1.2.
7338     
7339   ac_save_CPPFLAGS="$CPPFLAGS"
7340   ac_save_LDFLAGS="$LDFLAGS"
7341 #  ac_save_LIBS="$LIBS"
7342
7343   if test \! -z "$includedir" ; then 
7344     CPPFLAGS="$CPPFLAGS -I$includedir"
7345   fi
7346   # note: $X_CFLAGS includes $x_includes
7347   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7348
7349   if test \! -z "$libdir" ; then
7350     LDFLAGS="$LDFLAGS -L$libdir"
7351   fi
7352   # note: $X_LIBS includes $x_libraries
7353   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7354
7355   echo $ac_n "checking for capplet_widget_changes_are_immediate in -lcapplet""... $ac_c" 1>&6
7356 echo "configure:7368: checking for capplet_widget_changes_are_immediate in -lcapplet" >&5
7357 ac_lib_var=`echo capplet'_'capplet_widget_changes_are_immediate | sed 'y%./+-%__p_%'`
7358 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7359   echo $ac_n "(cached) $ac_c" 1>&6
7360 else
7361   ac_save_LIBS="$LIBS"
7362 LIBS="-lcapplet $ac_gnome_config_libs $LIBS"
7363 cat > conftest.$ac_ext <<EOF
7364 #line 7376 "configure"
7365 #include "confdefs.h"
7366 /* Override any gcc2 internal prototype to avoid an error.  */
7367 /* We use char because int might match the return type of a gcc2
7368     builtin and then its argument prototype would still apply.  */
7369 char capplet_widget_changes_are_immediate();
7370
7371 int main() {
7372 capplet_widget_changes_are_immediate()
7373 ; return 0; }
7374 EOF
7375 if { (eval echo configure:7387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7376   rm -rf conftest*
7377   eval "ac_cv_lib_$ac_lib_var=yes"
7378 else
7379   echo "configure: failed program was:" >&5
7380   cat conftest.$ac_ext >&5
7381   rm -rf conftest*
7382   eval "ac_cv_lib_$ac_lib_var=no"
7383 fi
7384 rm -f conftest*
7385 LIBS="$ac_save_LIBS"
7386
7387 fi
7388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7389   echo "$ac_t""yes" 1>&6
7390   cat >> confdefs.h <<\EOF
7391 #define HAVE_CRAPPLET_IMMEDIATE 1
7392 EOF
7393
7394 else
7395   echo "$ac_t""no" 1>&6
7396 true
7397 fi
7398
7399   CPPFLAGS="$ac_save_CPPFLAGS"
7400   LDFLAGS="$ac_save_LDFLAGS"
7401 #  LIBS="$ac_save_LIBS"
7402   
7403   fi
7404
7405
7406   if test "$have_gtk" = yes; then
7407     INCLUDES="$INCLUDES $ac_gtk_config_cflags"
7408     GTK_LIBS="$GTK_LIBS $ac_gtk_config_libs"
7409     cat >> confdefs.h <<\EOF
7410 #define HAVE_GTK 1
7411 EOF
7412
7413   fi
7414
7415 fi
7416
7417
7418 # Check for the Gnome Help Browser.
7419 #
7420 if test "$have_gnome" = yes; then
7421   # Extract the first word of "gnome-help-browser", so it can be a program name with args.
7422 set dummy gnome-help-browser; ac_word=$2
7423 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
7424 echo "configure:7436: checking for $ac_word" >&5
7425 if eval "test \"`echo '$''{'ac_cv_prog_have_gnome_help'+set}'`\" = set"; then
7426   echo $ac_n "(cached) $ac_c" 1>&6
7427 else
7428   if test -n "$have_gnome_help"; then
7429   ac_cv_prog_have_gnome_help="$have_gnome_help" # Let the user override the test.
7430 else
7431   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
7432   ac_dummy="$PATH"
7433   for ac_dir in $ac_dummy; do
7434     test -z "$ac_dir" && ac_dir=.
7435     if test -f $ac_dir/$ac_word; then
7436       ac_cv_prog_have_gnome_help="yes"
7437       break
7438     fi
7439   done
7440   IFS="$ac_save_ifs"
7441   test -z "$ac_cv_prog_have_gnome_help" && ac_cv_prog_have_gnome_help="no"
7442 fi
7443 fi
7444 have_gnome_help="$ac_cv_prog_have_gnome_help"
7445 if test -n "$have_gnome_help"; then
7446   echo "$ac_t""$have_gnome_help" 1>&6
7447 else
7448   echo "$ac_t""no" 1>&6
7449 fi
7450
7451 else
7452   have_gnome_help=no
7453 fi
7454
7455
7456 ###############################################################################
7457 #
7458 #       Check for -lxml (if we have Gtk)
7459 #
7460 ###############################################################################
7461
7462 have_xml=no
7463 with_xml_req=unspecified
7464 xml_halfassed=no
7465 # Check whether --with-xml or --without-xml was given.
7466 if test "${with_xml+set}" = set; then
7467   withval="$with_xml"
7468   with_xml="$withval"; with_xml_req="$withval"
7469 else
7470   with_xml=yes
7471 fi
7472
7473
7474
7475    case "$with_xml" in
7476     yes) ;;
7477     no)  ;;
7478
7479     /*)
7480      echo $ac_n "checking for XML headers""... $ac_c" 1>&6
7481 echo "configure:7493: checking for XML headers" >&5
7482      d=$with_xml/include
7483      if test -d $d; then
7484        X_CFLAGS="-I$d $X_CFLAGS"
7485        echo "$ac_t""$d" 1>&6
7486      else
7487        echo "$ac_t""not found ($d: no such directory)" 1>&6
7488      fi
7489
7490      echo $ac_n "checking for XML libs""... $ac_c" 1>&6
7491 echo "configure:7503: checking for XML libs" >&5
7492      d=$with_xml/lib
7493      if test -d $d; then
7494        X_LIBS="-L$d $X_LIBS"
7495        echo "$ac_t""$d" 1>&6
7496      else
7497        echo "$ac_t""not found ($d: no such directory)" 1>&6
7498      fi
7499
7500      # replace the directory string with "yes".
7501      with_xml_req="yes"
7502      with_xml=$with_xml_req
7503      ;;
7504
7505     *)
7506      echo ""
7507      echo "error: argument to --with-xml must be \"yes\", \"no\", or a directory."
7508      echo "       If it is a directory, then \`DIR/include' will be added to"
7509      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
7510      exit 1
7511      ;;
7512    esac
7513   
7514
7515 if test "$with_xml" != yes -a "$with_xml" != no ; then
7516   echo "error: must be yes or no: --with-xml=$with_xml"
7517   exit 1
7518 fi
7519
7520 if test "$have_gtk" != yes; then
7521   # don't bother if no GTK
7522   with_xml=no
7523 fi
7524
7525 if test "$with_xml" = yes; then
7526   have_xml=no
7527
7528   # the XML stuff is likely to be in GTK paths.
7529   ac_save_X_CFLAGS="$X_CFLAGS"
7530   ac_save_X_LIBS="$X_LIBS"
7531   X_CFLAGS="$X_CFLAGS $ac_gtk_config_cflags"
7532   X_LIBS="$X_LIBS $ac_gtk_config_libs"
7533
7534   
7535   ac_save_CPPFLAGS="$CPPFLAGS"
7536   if test \! -z "$includedir" ; then 
7537     CPPFLAGS="$CPPFLAGS -I$includedir"
7538   fi
7539   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7540   ac_safe=`echo "xmlIO.h" | sed 'y%./+-%__p_%'`
7541 echo $ac_n "checking for xmlIO.h""... $ac_c" 1>&6
7542 echo "configure:7554: checking for xmlIO.h" >&5
7543 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7544   echo $ac_n "(cached) $ac_c" 1>&6
7545 else
7546   cat > conftest.$ac_ext <<EOF
7547 #line 7559 "configure"
7548 #include "confdefs.h"
7549 #include <xmlIO.h>
7550 EOF
7551 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7552 { (eval echo configure:7564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7553 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7554 if test -z "$ac_err"; then
7555   rm -rf conftest*
7556   eval "ac_cv_header_$ac_safe=yes"
7557 else
7558   echo "$ac_err" >&5
7559   echo "configure: failed program was:" >&5
7560   cat conftest.$ac_ext >&5
7561   rm -rf conftest*
7562   eval "ac_cv_header_$ac_safe=no"
7563 fi
7564 rm -f conftest*
7565 fi
7566 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7567   echo "$ac_t""yes" 1>&6
7568   have_xml=yes
7569 else
7570   echo "$ac_t""no" 1>&6
7571 fi
7572
7573   CPPFLAGS="$ac_save_CPPFLAGS"
7574
7575   if test "$have_xml" = yes; then
7576     # we have the header, now check for the library
7577     have_xml=no
7578     xml_halfassed=yes
7579     
7580   ac_save_CPPFLAGS="$CPPFLAGS"
7581   ac_save_LDFLAGS="$LDFLAGS"
7582 #  ac_save_LIBS="$LIBS"
7583
7584   if test \! -z "$includedir" ; then 
7585     CPPFLAGS="$CPPFLAGS -I$includedir"
7586   fi
7587   # note: $X_CFLAGS includes $x_includes
7588   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7589
7590   if test \! -z "$libdir" ; then
7591     LDFLAGS="$LDFLAGS -L$libdir"
7592   fi
7593   # note: $X_LIBS includes $x_libraries
7594   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7595
7596   echo $ac_n "checking for xmlParseChunk in -lxml""... $ac_c" 1>&6
7597 echo "configure:7609: checking for xmlParseChunk in -lxml" >&5
7598 ac_lib_var=`echo xml'_'xmlParseChunk | sed 'y%./+-%__p_%'`
7599 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7600   echo $ac_n "(cached) $ac_c" 1>&6
7601 else
7602   ac_save_LIBS="$LIBS"
7603 LIBS="-lxml  $LIBS"
7604 cat > conftest.$ac_ext <<EOF
7605 #line 7617 "configure"
7606 #include "confdefs.h"
7607 /* Override any gcc2 internal prototype to avoid an error.  */
7608 /* We use char because int might match the return type of a gcc2
7609     builtin and then its argument prototype would still apply.  */
7610 char xmlParseChunk();
7611
7612 int main() {
7613 xmlParseChunk()
7614 ; return 0; }
7615 EOF
7616 if { (eval echo configure:7628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7617   rm -rf conftest*
7618   eval "ac_cv_lib_$ac_lib_var=yes"
7619 else
7620   echo "configure: failed program was:" >&5
7621   cat conftest.$ac_ext >&5
7622   rm -rf conftest*
7623   eval "ac_cv_lib_$ac_lib_var=no"
7624 fi
7625 rm -f conftest*
7626 LIBS="$ac_save_LIBS"
7627
7628 fi
7629 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7630   echo "$ac_t""yes" 1>&6
7631   have_xml=yes
7632                     xml_halfassed=no
7633                     XML_LIBS="-lxml"
7634                     cat >> confdefs.h <<\EOF
7635 #define HAVE_XML 1
7636 EOF
7637
7638 else
7639   echo "$ac_t""no" 1>&6
7640 fi
7641
7642   CPPFLAGS="$ac_save_CPPFLAGS"
7643   LDFLAGS="$ac_save_LDFLAGS"
7644 #  LIBS="$ac_save_LIBS"
7645   
7646   fi
7647
7648   X_CFLAGS="$ac_save_X_CFLAGS"
7649   X_LIBS="$ac_save_X_LIBS"
7650
7651 fi
7652
7653
7654 ###############################################################################
7655 #
7656 #       Checking whether Motif is really Lesstif.
7657 #
7658 ###############################################################################
7659
7660 have_lesstif=no
7661 if test "$have_motif" = yes ; then
7662   echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
7663 echo "configure:7675: checking whether Motif is really LessTif" >&5
7664 if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
7665   echo $ac_n "(cached) $ac_c" 1>&6
7666 else
7667   
7668   ac_save_CPPFLAGS="$CPPFLAGS"
7669   if test \! -z "$includedir" ; then 
7670     CPPFLAGS="$CPPFLAGS -I$includedir"
7671   fi
7672   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7673   cat > conftest.$ac_ext <<EOF
7674 #line 7686 "configure"
7675 #include "confdefs.h"
7676 #include <Xm/Xm.h>
7677 int main() {
7678 long vers = LesstifVersion;
7679 ; return 0; }
7680 EOF
7681 if { (eval echo configure:7693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7682   rm -rf conftest*
7683   ac_cv_have_lesstif=yes
7684 else
7685   echo "configure: failed program was:" >&5
7686   cat conftest.$ac_ext >&5
7687   rm -rf conftest*
7688   ac_cv_have_lesstif=no
7689 fi
7690 rm -f conftest*
7691   CPPFLAGS="$ac_save_CPPFLAGS"
7692 fi
7693
7694 echo "$ac_t""$ac_cv_have_lesstif" 1>&6
7695   have_lesstif=$ac_cv_have_lesstif
7696 fi
7697
7698
7699 lesstif_version=unknown
7700 lesstif_version_string=unknown
7701
7702 if test "$have_lesstif" = yes ; then
7703   ltv=unknown
7704   echo unknown > conftest-lt
7705   echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
7706 echo "configure:7718: checking LessTif version number" >&5
7707 if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
7708   echo $ac_n "(cached) $ac_c" 1>&6
7709 else
7710   
7711   ac_save_CPPFLAGS="$CPPFLAGS"
7712   if test \! -z "$includedir" ; then 
7713     CPPFLAGS="$CPPFLAGS -I$includedir"
7714   fi
7715   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7716   if test "$cross_compiling" = yes; then
7717   ac_cv_lesstif_version=unknown
7718                      ac_cv_lesstif_version_string=unknown
7719 else
7720   cat > conftest.$ac_ext <<EOF
7721 #line 7733 "configure"
7722 #include "confdefs.h"
7723 #include <stdio.h>
7724                      #include <Xm/Xm.h>
7725                      int main() {
7726                        FILE *f = fopen("conftest-lt", "w");
7727                        if (!f) exit(1);
7728                        fprintf(f, "%d %d.%d\n", LesstifVersion,
7729                           LESSTIF_VERSION, LESSTIF_REVISION);
7730                        fclose(f);
7731                        exit(0);
7732                      }
7733 EOF
7734 if { (eval echo configure:7746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7735 then
7736   ltv=`cat conftest-lt`
7737                      ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
7738                      ac_cv_lesstif_version_string=`echo $ltv | sed 's/.* //'`
7739 else
7740   echo "configure: failed program was:" >&5
7741   cat conftest.$ac_ext >&5
7742   rm -fr conftest*
7743   ac_cv_lesstif_version=unknown
7744                      ac_cv_lesstif_version_string=unknown
7745 fi
7746 rm -fr conftest*
7747 fi
7748
7749   CPPFLAGS="$ac_save_CPPFLAGS"
7750 fi
7751
7752 echo "$ac_t""$ac_cv_lesstif_version_string" 1>&6
7753   rm -f conftest-lt
7754   lesstif_version=$ac_cv_lesstif_version
7755   lesstif_version_string=$ac_cv_lesstif_version_string
7756
7757 fi
7758
7759
7760 if test "$have_motif" = yes ; then
7761   mtv=unknown
7762   echo unknown > conftest-mt
7763   echo $ac_n "checking Motif version number""... $ac_c" 1>&6
7764 echo "configure:7776: checking Motif version number" >&5
7765 if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
7766   echo $ac_n "(cached) $ac_c" 1>&6
7767 else
7768   
7769   ac_save_CPPFLAGS="$CPPFLAGS"
7770   if test \! -z "$includedir" ; then 
7771     CPPFLAGS="$CPPFLAGS -I$includedir"
7772   fi
7773   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7774   if test "$cross_compiling" = yes; then
7775   ac_cv_motif_version=unknown
7776                      ac_cv_motif_version_string=unknown
7777 else
7778   cat > conftest.$ac_ext <<EOF
7779 #line 7791 "configure"
7780 #include "confdefs.h"
7781 #include <stdio.h>
7782                      #include <Xm/Xm.h>
7783                      int main() {
7784                        FILE *f = fopen("conftest-mt", "w");
7785                        if (!f) exit(1);
7786                        fprintf(f, "%d %d.%d\n", XmVersion,
7787                           XmVERSION, XmREVISION);
7788                        fclose(f);
7789                        exit(0);
7790                      }
7791 EOF
7792 if { (eval echo configure:7804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7793 then
7794   mtv=`cat conftest-mt`
7795                      ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
7796                      ac_cv_motif_version_string=`echo $mtv | sed 's/.* //'`
7797 else
7798   echo "configure: failed program was:" >&5
7799   cat conftest.$ac_ext >&5
7800   rm -fr conftest*
7801   ac_cv_motif_version=unknown
7802                      ac_cv_motif_version_string=unknown
7803 fi
7804 rm -fr conftest*
7805 fi
7806
7807   CPPFLAGS="$ac_save_CPPFLAGS"
7808 fi
7809
7810 echo "$ac_t""$ac_cv_motif_version_string" 1>&6
7811   rm -f conftest-mt
7812   motif_version=$ac_cv_motif_version
7813   motif_version_string=$ac_cv_motif_version_string
7814
7815 fi
7816
7817
7818 ###############################################################################
7819 #
7820 #       Checking whether Motif requires -lXpm.
7821 #
7822 #       If this is Motif 2.x, and we have XPM, then link against XPM as well.
7823 #       The deal is, Motif 2.x requires XPM -- but it's a compilation option
7824 #       of the library whether to build the XPM code into libXm, or whether
7825 #       to rely on an external libXm.  So the only way to tell whether XPM is
7826 #       a link-time requirement is to examine libXm.a, which is very
7827 #       difficult to do in an autoconf script.  So... if it's Motif 2.x, we
7828 #       always link against XPM if the XPM lib exists (and this will be a
7829 #       no-op if libXm happens to already have the XPM code in it.)
7830 #
7831 ###############################################################################
7832
7833 motif_requires_xpm=no
7834 if test "$have_motif" = yes ; then
7835    echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
7836 echo "configure:7848: checking whether Motif requires XPM" >&5
7837    if test "$motif_version" = "unknown" || test "$motif_version" -ge 2000
7838    then
7839      motif_requires_xpm=yes
7840      echo "$ac_t""maybe" 1>&6
7841    else
7842      echo "$ac_t""no" 1>&6
7843    fi
7844 fi
7845
7846
7847 ###############################################################################
7848 #
7849 #       Checking whether Motif requires -lXp.
7850 #
7851 #       Some versions of Motif (2.1.0, at least) require -lXp, the "X Printing
7852 #       Extension".   Why this extension isn't in -lXext with all the others,
7853 #       I have no idea.
7854 #
7855 ###############################################################################
7856
7857 have_xp_ext=no
7858 if test "$have_motif" = yes ; then
7859    have_xp_ext=no
7860    
7861   ac_save_CPPFLAGS="$CPPFLAGS"
7862   ac_save_LDFLAGS="$LDFLAGS"
7863 #  ac_save_LIBS="$LIBS"
7864
7865   if test \! -z "$includedir" ; then 
7866     CPPFLAGS="$CPPFLAGS -I$includedir"
7867   fi
7868   # note: $X_CFLAGS includes $x_includes
7869   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7870
7871   if test \! -z "$libdir" ; then
7872     LDFLAGS="$LDFLAGS -L$libdir"
7873   fi
7874   # note: $X_LIBS includes $x_libraries
7875   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7876
7877   echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
7878 echo "configure:7890: checking for XpQueryExtension in -lXp" >&5
7879 ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
7880 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7881   echo $ac_n "(cached) $ac_c" 1>&6
7882 else
7883   ac_save_LIBS="$LIBS"
7884 LIBS="-lXp -lX11 -lXext -lm $LIBS"
7885 cat > conftest.$ac_ext <<EOF
7886 #line 7898 "configure"
7887 #include "confdefs.h"
7888 /* Override any gcc2 internal prototype to avoid an error.  */
7889 /* We use char because int might match the return type of a gcc2
7890     builtin and then its argument prototype would still apply.  */
7891 char XpQueryExtension();
7892
7893 int main() {
7894 XpQueryExtension()
7895 ; return 0; }
7896 EOF
7897 if { (eval echo configure:7909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7898   rm -rf conftest*
7899   eval "ac_cv_lib_$ac_lib_var=yes"
7900 else
7901   echo "configure: failed program was:" >&5
7902   cat conftest.$ac_ext >&5
7903   rm -rf conftest*
7904   eval "ac_cv_lib_$ac_lib_var=no"
7905 fi
7906 rm -f conftest*
7907 LIBS="$ac_save_LIBS"
7908
7909 fi
7910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7911   echo "$ac_t""yes" 1>&6
7912   have_xp_ext=yes; MOTIF_LIBS="$MOTIF_LIBS -lXp"
7913 else
7914   echo "$ac_t""no" 1>&6
7915 true
7916 fi
7917
7918   CPPFLAGS="$ac_save_CPPFLAGS"
7919   LDFLAGS="$ac_save_LDFLAGS"
7920 #  LIBS="$ac_save_LIBS"
7921   
7922 fi
7923
7924
7925 ###############################################################################
7926 #
7927 #       Checking whether Motif requires -lXintl (for _Xsetlocale.)
7928 #
7929 ###############################################################################
7930
7931 have_xintl=no
7932 if test "$have_motif" = yes ; then
7933   
7934   ac_save_CPPFLAGS="$CPPFLAGS"
7935   ac_save_LDFLAGS="$LDFLAGS"
7936 #  ac_save_LIBS="$LIBS"
7937
7938   if test \! -z "$includedir" ; then 
7939     CPPFLAGS="$CPPFLAGS -I$includedir"
7940   fi
7941   # note: $X_CFLAGS includes $x_includes
7942   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
7943
7944   if test \! -z "$libdir" ; then
7945     LDFLAGS="$LDFLAGS -L$libdir"
7946   fi
7947   # note: $X_LIBS includes $x_libraries
7948   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
7949
7950   echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
7951 echo "configure:7963: checking for _Xsetlocale in -lXintl" >&5
7952 ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
7953 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7954   echo $ac_n "(cached) $ac_c" 1>&6
7955 else
7956   ac_save_LIBS="$LIBS"
7957 LIBS="-lXintl -lX11 -lXext -lm $LIBS"
7958 cat > conftest.$ac_ext <<EOF
7959 #line 7971 "configure"
7960 #include "confdefs.h"
7961 /* Override any gcc2 internal prototype to avoid an error.  */
7962 /* We use char because int might match the return type of a gcc2
7963     builtin and then its argument prototype would still apply.  */
7964 char _Xsetlocale();
7965
7966 int main() {
7967 _Xsetlocale()
7968 ; return 0; }
7969 EOF
7970 if { (eval echo configure:7982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7971   rm -rf conftest*
7972   eval "ac_cv_lib_$ac_lib_var=yes"
7973 else
7974   echo "configure: failed program was:" >&5
7975   cat conftest.$ac_ext >&5
7976   rm -rf conftest*
7977   eval "ac_cv_lib_$ac_lib_var=no"
7978 fi
7979 rm -f conftest*
7980 LIBS="$ac_save_LIBS"
7981
7982 fi
7983 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7984   echo "$ac_t""yes" 1>&6
7985   have_xintl=yes
7986 else
7987   echo "$ac_t""no" 1>&6
7988 have_xintl=no
7989 fi
7990
7991   CPPFLAGS="$ac_save_CPPFLAGS"
7992   LDFLAGS="$ac_save_LDFLAGS"
7993 #  LIBS="$ac_save_LIBS"
7994   
7995   if test "$have_xintl" = yes; then
7996     MOTIF_LIBS="$MOTIF_LIBS -lXintl"
7997   fi
7998 fi
7999
8000
8001 ###############################################################################
8002 #
8003 #       Check for -lGL or -lMesaGL.
8004 #
8005 ###############################################################################
8006
8007 have_gl=no
8008 ac_have_mesa_gl=no
8009 with_gl_req=unspecified
8010 gl_halfassed=no
8011 # Check whether --with-gl or --without-gl was given.
8012 if test "${with_gl+set}" = set; then
8013   withval="$with_gl"
8014   with_gl="$withval"; with_gl_req="$withval"
8015 else
8016   with_gl=yes
8017 fi
8018
8019
8020
8021    case "$with_gl" in
8022     yes) ;;
8023     no)  ;;
8024
8025     /*)
8026      echo $ac_n "checking for GL headers""... $ac_c" 1>&6
8027 echo "configure:8039: checking for GL headers" >&5
8028      d=$with_gl/include
8029      if test -d $d; then
8030        X_CFLAGS="-I$d $X_CFLAGS"
8031        echo "$ac_t""$d" 1>&6
8032      else
8033        echo "$ac_t""not found ($d: no such directory)" 1>&6
8034      fi
8035
8036      echo $ac_n "checking for GL libs""... $ac_c" 1>&6
8037 echo "configure:8049: checking for GL libs" >&5
8038      d=$with_gl/lib
8039      if test -d $d; then
8040        X_LIBS="-L$d $X_LIBS"
8041        echo "$ac_t""$d" 1>&6
8042      else
8043        echo "$ac_t""not found ($d: no such directory)" 1>&6
8044      fi
8045
8046      # replace the directory string with "yes".
8047      with_gl_req="yes"
8048      with_gl=$with_gl_req
8049      ;;
8050
8051     *)
8052      echo ""
8053      echo "error: argument to --with-gl must be \"yes\", \"no\", or a directory."
8054      echo "       If it is a directory, then \`DIR/include' will be added to"
8055      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8056      exit 1
8057      ;;
8058    esac
8059   
8060
8061 ac_mesagl_version=unknown
8062 ac_mesagl_version_string=unknown
8063
8064 if test "$with_gl" = yes; then
8065   
8066   ac_save_CPPFLAGS="$CPPFLAGS"
8067   if test \! -z "$includedir" ; then 
8068     CPPFLAGS="$CPPFLAGS -I$includedir"
8069   fi
8070   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8071   ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
8072 echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
8073 echo "configure:8085: checking for GL/gl.h" >&5
8074 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8075   echo $ac_n "(cached) $ac_c" 1>&6
8076 else
8077   cat > conftest.$ac_ext <<EOF
8078 #line 8090 "configure"
8079 #include "confdefs.h"
8080 #include <GL/gl.h>
8081 EOF
8082 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8083 { (eval echo configure:8095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8084 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8085 if test -z "$ac_err"; then
8086   rm -rf conftest*
8087   eval "ac_cv_header_$ac_safe=yes"
8088 else
8089   echo "$ac_err" >&5
8090   echo "configure: failed program was:" >&5
8091   cat conftest.$ac_ext >&5
8092   rm -rf conftest*
8093   eval "ac_cv_header_$ac_safe=no"
8094 fi
8095 rm -f conftest*
8096 fi
8097 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8098   echo "$ac_t""yes" 1>&6
8099   have_gl=yes
8100 else
8101   echo "$ac_t""no" 1>&6
8102 fi
8103
8104   CPPFLAGS="$ac_save_CPPFLAGS"
8105   if test "$have_gl" = yes ; then
8106     
8107   ac_save_CPPFLAGS="$CPPFLAGS"
8108   if test \! -z "$includedir" ; then 
8109     CPPFLAGS="$CPPFLAGS -I$includedir"
8110   fi
8111   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8112   ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
8113 echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
8114 echo "configure:8126: checking for GL/glx.h" >&5
8115 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8116   echo $ac_n "(cached) $ac_c" 1>&6
8117 else
8118   cat > conftest.$ac_ext <<EOF
8119 #line 8131 "configure"
8120 #include "confdefs.h"
8121 #include <GL/glx.h>
8122 EOF
8123 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8124 { (eval echo configure:8136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8125 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8126 if test -z "$ac_err"; then
8127   rm -rf conftest*
8128   eval "ac_cv_header_$ac_safe=yes"
8129 else
8130   echo "$ac_err" >&5
8131   echo "configure: failed program was:" >&5
8132   cat conftest.$ac_ext >&5
8133   rm -rf conftest*
8134   eval "ac_cv_header_$ac_safe=no"
8135 fi
8136 rm -f conftest*
8137 fi
8138 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8139   echo "$ac_t""yes" 1>&6
8140   have_gl=yes
8141 else
8142   echo "$ac_t""no" 1>&6
8143 fi
8144
8145   CPPFLAGS="$ac_save_CPPFLAGS"
8146   fi
8147
8148   # If we have the headers, try and figure out which vendor it's from.
8149   #
8150   if test "$have_gl" = yes ; then
8151
8152     # We need to know whether it's MesaGL so that we know which libraries
8153     # to link against.
8154     #
8155     echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
8156 echo "configure:8168: checking whether GL is really MesaGL" >&5
8157 if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
8158   echo $ac_n "(cached) $ac_c" 1>&6
8159 else
8160   ac_cv_have_mesa_gl=no
8161        
8162   ac_save_CPPFLAGS="$CPPFLAGS"
8163   if test \! -z "$includedir" ; then 
8164     CPPFLAGS="$CPPFLAGS -I$includedir"
8165   fi
8166   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8167   cat > conftest.$ac_ext <<EOF
8168 #line 8180 "configure"
8169 #include "confdefs.h"
8170 #include <GL/glx.h>
8171 EOF
8172 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8173   egrep "Mesa|MESA" >/dev/null 2>&1; then
8174   rm -rf conftest*
8175   ac_cv_have_mesa_gl=yes
8176 fi
8177 rm -f conftest*
8178
8179   CPPFLAGS="$ac_save_CPPFLAGS"
8180       
8181 fi
8182
8183 echo "$ac_t""$ac_cv_have_mesa_gl" 1>&6
8184     ac_have_mesa_gl=$ac_cv_have_mesa_gl
8185  
8186
8187     gl_lib_1=""
8188     GL_LIBS=""
8189
8190
8191     # Some versions of MesaGL are compiled to require -lpthread.
8192     # So if the Mesa headers exist, and -lpthread exists, then always
8193     # link -lpthread after the Mesa libs (be they named -lGL or -lMesaGL.)
8194     #
8195     if test "$ac_have_mesa_gl" = yes; then
8196       echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
8197 echo "configure:8209: checking for pthread_create in -lpthread" >&5
8198 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
8199 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8200   echo $ac_n "(cached) $ac_c" 1>&6
8201 else
8202   ac_save_LIBS="$LIBS"
8203 LIBS="-lpthread  $LIBS"
8204 cat > conftest.$ac_ext <<EOF
8205 #line 8217 "configure"
8206 #include "confdefs.h"
8207 /* Override any gcc2 internal prototype to avoid an error.  */
8208 /* We use char because int might match the return type of a gcc2
8209     builtin and then its argument prototype would still apply.  */
8210 char pthread_create();
8211
8212 int main() {
8213 pthread_create()
8214 ; return 0; }
8215 EOF
8216 if { (eval echo configure:8228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8217   rm -rf conftest*
8218   eval "ac_cv_lib_$ac_lib_var=yes"
8219 else
8220   echo "configure: failed program was:" >&5
8221   cat conftest.$ac_ext >&5
8222   rm -rf conftest*
8223   eval "ac_cv_lib_$ac_lib_var=no"
8224 fi
8225 rm -f conftest*
8226 LIBS="$ac_save_LIBS"
8227
8228 fi
8229 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8230   echo "$ac_t""yes" 1>&6
8231   GL_LIBS="-lpthread"
8232 else
8233   echo "$ac_t""no" 1>&6
8234 fi
8235
8236     fi
8237
8238
8239     # If we have Mesa headers, check to see if we can link against -lMesaGL.
8240     # If we don't have Mesa headers, or we don't have -lMesaGL, try -lGL.
8241     # Else, warn that GL is busted.  (We have the headers, but no libs.)
8242     #
8243
8244     if test "$ac_have_mesa_gl" = yes ; then
8245       
8246   ac_save_CPPFLAGS="$CPPFLAGS"
8247   ac_save_LDFLAGS="$LDFLAGS"
8248 #  ac_save_LIBS="$LIBS"
8249
8250   if test \! -z "$includedir" ; then 
8251     CPPFLAGS="$CPPFLAGS -I$includedir"
8252   fi
8253   # note: $X_CFLAGS includes $x_includes
8254   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8255
8256   if test \! -z "$libdir" ; then
8257     LDFLAGS="$LDFLAGS -L$libdir"
8258   fi
8259   # note: $X_LIBS includes $x_libraries
8260   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8261
8262   echo $ac_n "checking for glXCreateContext in -lMesaGL""... $ac_c" 1>&6
8263 echo "configure:8275: checking for glXCreateContext in -lMesaGL" >&5
8264 ac_lib_var=`echo MesaGL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8265 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8266   echo $ac_n "(cached) $ac_c" 1>&6
8267 else
8268   ac_save_LIBS="$LIBS"
8269 LIBS="-lMesaGL -lMesaGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8270 cat > conftest.$ac_ext <<EOF
8271 #line 8283 "configure"
8272 #include "confdefs.h"
8273 /* Override any gcc2 internal prototype to avoid an error.  */
8274 /* We use char because int might match the return type of a gcc2
8275     builtin and then its argument prototype would still apply.  */
8276 char glXCreateContext();
8277
8278 int main() {
8279 glXCreateContext()
8280 ; return 0; }
8281 EOF
8282 if { (eval echo configure:8294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8283   rm -rf conftest*
8284   eval "ac_cv_lib_$ac_lib_var=yes"
8285 else
8286   echo "configure: failed program was:" >&5
8287   cat conftest.$ac_ext >&5
8288   rm -rf conftest*
8289   eval "ac_cv_lib_$ac_lib_var=no"
8290 fi
8291 rm -f conftest*
8292 LIBS="$ac_save_LIBS"
8293
8294 fi
8295 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8296   echo "$ac_t""yes" 1>&6
8297   gl_lib_1="MesaGL"
8298                       GL_LIBS="-lMesaGL -lMesaGLU $GL_LIBS"
8299 else
8300   echo "$ac_t""no" 1>&6
8301 fi
8302
8303   CPPFLAGS="$ac_save_CPPFLAGS"
8304   LDFLAGS="$ac_save_LDFLAGS"
8305 #  LIBS="$ac_save_LIBS"
8306   
8307     fi
8308
8309     if test "$gl_lib_1" = "" ; then
8310       
8311   ac_save_CPPFLAGS="$CPPFLAGS"
8312   ac_save_LDFLAGS="$LDFLAGS"
8313 #  ac_save_LIBS="$LIBS"
8314
8315   if test \! -z "$includedir" ; then 
8316     CPPFLAGS="$CPPFLAGS -I$includedir"
8317   fi
8318   # note: $X_CFLAGS includes $x_includes
8319   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8320
8321   if test \! -z "$libdir" ; then
8322     LDFLAGS="$LDFLAGS -L$libdir"
8323   fi
8324   # note: $X_LIBS includes $x_libraries
8325   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8326
8327   echo $ac_n "checking for glXCreateContext in -lGL""... $ac_c" 1>&6
8328 echo "configure:8340: checking for glXCreateContext in -lGL" >&5
8329 ac_lib_var=`echo GL'_'glXCreateContext | sed 'y%./+-%__p_%'`
8330 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8331   echo $ac_n "(cached) $ac_c" 1>&6
8332 else
8333   ac_save_LIBS="$LIBS"
8334 LIBS="-lGL -lGLU $GL_LIBS -lX11 -lXext -lm $LIBS"
8335 cat > conftest.$ac_ext <<EOF
8336 #line 8348 "configure"
8337 #include "confdefs.h"
8338 /* Override any gcc2 internal prototype to avoid an error.  */
8339 /* We use char because int might match the return type of a gcc2
8340     builtin and then its argument prototype would still apply.  */
8341 char glXCreateContext();
8342
8343 int main() {
8344 glXCreateContext()
8345 ; return 0; }
8346 EOF
8347 if { (eval echo configure:8359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8348   rm -rf conftest*
8349   eval "ac_cv_lib_$ac_lib_var=yes"
8350 else
8351   echo "configure: failed program was:" >&5
8352   cat conftest.$ac_ext >&5
8353   rm -rf conftest*
8354   eval "ac_cv_lib_$ac_lib_var=no"
8355 fi
8356 rm -f conftest*
8357 LIBS="$ac_save_LIBS"
8358
8359 fi
8360 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8361   echo "$ac_t""yes" 1>&6
8362   gl_lib_1="GL"
8363                       GL_LIBS="-lGL -lGLU $GL_LIBS"
8364 else
8365   echo "$ac_t""no" 1>&6
8366 fi
8367
8368   CPPFLAGS="$ac_save_CPPFLAGS"
8369   LDFLAGS="$ac_save_LDFLAGS"
8370 #  LIBS="$ac_save_LIBS"
8371   
8372     fi
8373
8374     if test "$gl_lib_1" = "" ; then
8375       # we have headers, but no libs -- bail.
8376       have_gl=no
8377       ac_have_mesa_gl=no
8378       gl_halfassed=yes
8379     else
8380       # linking works -- we can build the GL hacks.
8381       cat >> confdefs.h <<\EOF
8382 #define HAVE_GL 1
8383 EOF
8384
8385       if test "$ac_have_mesa_gl" = yes ; then
8386         cat >> confdefs.h <<\EOF
8387 #define HAVE_MESA_GL 1
8388 EOF
8389
8390       fi
8391     fi
8392   fi
8393
8394
8395   # Now that we know we have GL headers and libs, do some more GL testing.
8396   #
8397
8398   if test "$have_gl" = yes ; then
8399     # If it's MesaGL, we'd like to issue a warning if the version number
8400     # is less than or equal to 2.6, because that version had a security bug.
8401     #
8402     if test "$ac_have_mesa_gl" = yes; then
8403
8404       echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
8405 echo "configure:8417: checking MesaGL version number" >&5
8406 if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
8407   echo $ac_n "(cached) $ac_c" 1>&6
8408 else
8409   cat > conftest.$ac_ext <<EOF
8410 #line 8422 "configure"
8411 #include "confdefs.h"
8412 #include <GL/gl.h>
8413 #ifndef MESA_MAJOR_VERSION
8414 # include <GL/xmesa.h>
8415 # define MESA_MAJOR_VERSION XMESA_MAJOR_VERSION
8416 # define MESA_MINOR_VERSION XMESA_MINOR_VERSION
8417 #endif
8418 configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
8419 EOF
8420
8421          ac_save_CPPFLAGS="$CPPFLAGS"
8422          if test \! -z "$includedir" ; then 
8423            CPPFLAGS="$CPPFLAGS -I$includedir"
8424          fi
8425          CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8426
8427           # M4 sucks!!
8428          
8429          mglv=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | sed -n \
8430               's/^configure:.*\([0-9][0-9]*\).*\([0-9][0-9]*\).*$/\1.\2/p'`
8431          
8432
8433          rm -f conftest.$ac_ext
8434
8435          CPPFLAGS="$ac_save_CPPFLAGS"
8436
8437          if test "$mglv" = ""; then
8438            ac_mesagl_version=unknown
8439            ac_mesagl_version_string=unknown
8440          else
8441            ac_mesagl_version_string=$mglv
8442            maj=`echo $mglv | sed -n 's/\..*//p'`
8443            min=`echo $mglv | sed -n 's/.*\.//p'`
8444            ac_mesagl_version=`echo "$maj * 1000 + $min" | bc`
8445            if test -z "$ac_mesagl_version"; then
8446              ac_mesagl_version=unknown
8447              ac_mesagl_version_string=unknown
8448            fi
8449          fi
8450          ac_cv_mesagl_version=$ac_mesagl_version
8451          ac_cv_mesagl_version_string=$ac_mesagl_version_string
8452       
8453 fi
8454
8455 echo "$ac_t""$ac_cv_mesagl_version_string" 1>&6
8456       ac_mesagl_version=$ac_cv_mesagl_version
8457       ac_mesagl_version_string=$ac_cv_mesagl_version_string
8458     fi
8459
8460
8461     # Check for OpenGL 1.1 features.
8462     #
8463     
8464   ac_save_CPPFLAGS="$CPPFLAGS"
8465   ac_save_LDFLAGS="$LDFLAGS"
8466 #  ac_save_LIBS="$LIBS"
8467
8468   if test \! -z "$includedir" ; then 
8469     CPPFLAGS="$CPPFLAGS -I$includedir"
8470   fi
8471   # note: $X_CFLAGS includes $x_includes
8472   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8473
8474   if test \! -z "$libdir" ; then
8475     LDFLAGS="$LDFLAGS -L$libdir"
8476   fi
8477   # note: $X_LIBS includes $x_libraries
8478   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8479
8480   echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
8481 echo "configure:8493: checking for glBindTexture in -l$gl_lib_1" >&5
8482 ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
8483 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8484   echo $ac_n "(cached) $ac_c" 1>&6
8485 else
8486   ac_save_LIBS="$LIBS"
8487 LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
8488 cat > conftest.$ac_ext <<EOF
8489 #line 8501 "configure"
8490 #include "confdefs.h"
8491 /* Override any gcc2 internal prototype to avoid an error.  */
8492 /* We use char because int might match the return type of a gcc2
8493     builtin and then its argument prototype would still apply.  */
8494 char glBindTexture();
8495
8496 int main() {
8497 glBindTexture()
8498 ; return 0; }
8499 EOF
8500 if { (eval echo configure:8512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8501   rm -rf conftest*
8502   eval "ac_cv_lib_$ac_lib_var=yes"
8503 else
8504   echo "configure: failed program was:" >&5
8505   cat conftest.$ac_ext >&5
8506   rm -rf conftest*
8507   eval "ac_cv_lib_$ac_lib_var=no"
8508 fi
8509 rm -f conftest*
8510 LIBS="$ac_save_LIBS"
8511
8512 fi
8513 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8514   echo "$ac_t""yes" 1>&6
8515   cat >> confdefs.h <<\EOF
8516 #define HAVE_GLBINDTEXTURE 1
8517 EOF
8518
8519 else
8520   echo "$ac_t""no" 1>&6
8521 true
8522 fi
8523
8524   CPPFLAGS="$ac_save_CPPFLAGS"
8525   LDFLAGS="$ac_save_LDFLAGS"
8526 #  LIBS="$ac_save_LIBS"
8527   
8528   fi
8529
8530 elif test "$with_gl" != no; then
8531   echo "error: must be yes or no: --with-gl=$with_gl"
8532   exit 1
8533 fi
8534
8535
8536 ###############################################################################
8537 #
8538 #       Check for -lgle.
8539 #
8540 ###############################################################################
8541
8542 have_gle=no
8543 with_gle_req=unspecified
8544 gle_halfassed=no
8545 # Check whether --with-gle or --without-gle was given.
8546 if test "${with_gle+set}" = set; then
8547   withval="$with_gle"
8548   with_gle="$withval"; with_gle_req="$withval"
8549 else
8550   with_gle=yes
8551 fi
8552
8553
8554
8555    case "$with_gle" in
8556     yes) ;;
8557     no)  ;;
8558
8559     /*)
8560      echo $ac_n "checking for GLE headers""... $ac_c" 1>&6
8561 echo "configure:8573: checking for GLE headers" >&5
8562      d=$with_gle/include
8563      if test -d $d; then
8564        X_CFLAGS="-I$d $X_CFLAGS"
8565        echo "$ac_t""$d" 1>&6
8566      else
8567        echo "$ac_t""not found ($d: no such directory)" 1>&6
8568      fi
8569
8570      echo $ac_n "checking for GLE libs""... $ac_c" 1>&6
8571 echo "configure:8583: checking for GLE libs" >&5
8572      d=$with_gle/lib
8573      if test -d $d; then
8574        X_LIBS="-L$d $X_LIBS"
8575        echo "$ac_t""$d" 1>&6
8576      else
8577        echo "$ac_t""not found ($d: no such directory)" 1>&6
8578      fi
8579
8580      # replace the directory string with "yes".
8581      with_gle_req="yes"
8582      with_gle=$with_gle_req
8583      ;;
8584
8585     *)
8586      echo ""
8587      echo "error: argument to --with-gle must be \"yes\", \"no\", or a directory."
8588      echo "       If it is a directory, then \`DIR/include' will be added to"
8589      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
8590      exit 1
8591      ;;
8592    esac
8593   
8594
8595 GLE_LIBS=""
8596
8597 if test "$with_gle" = yes; then
8598
8599   
8600   ac_save_CPPFLAGS="$CPPFLAGS"
8601   if test \! -z "$includedir" ; then 
8602     CPPFLAGS="$CPPFLAGS -I$includedir"
8603   fi
8604   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8605   ac_safe=`echo "GL/gle.h" | sed 'y%./+-%__p_%'`
8606 echo $ac_n "checking for GL/gle.h""... $ac_c" 1>&6
8607 echo "configure:8619: checking for GL/gle.h" >&5
8608 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8609   echo $ac_n "(cached) $ac_c" 1>&6
8610 else
8611   cat > conftest.$ac_ext <<EOF
8612 #line 8624 "configure"
8613 #include "confdefs.h"
8614 #include <GL/gle.h>
8615 EOF
8616 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8617 { (eval echo configure:8629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8618 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8619 if test -z "$ac_err"; then
8620   rm -rf conftest*
8621   eval "ac_cv_header_$ac_safe=yes"
8622 else
8623   echo "$ac_err" >&5
8624   echo "configure: failed program was:" >&5
8625   cat conftest.$ac_ext >&5
8626   rm -rf conftest*
8627   eval "ac_cv_header_$ac_safe=no"
8628 fi
8629 rm -f conftest*
8630 fi
8631 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8632   echo "$ac_t""yes" 1>&6
8633   have_gle3=yes
8634 else
8635   echo "$ac_t""no" 1>&6
8636 fi
8637
8638   CPPFLAGS="$ac_save_CPPFLAGS"
8639   if test "$have_gle3" = yes ; then
8640     have_gle=yes;
8641   else
8642     
8643   ac_save_CPPFLAGS="$CPPFLAGS"
8644   if test \! -z "$includedir" ; then 
8645     CPPFLAGS="$CPPFLAGS -I$includedir"
8646   fi
8647   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8648   ac_safe=`echo "GL/gutil.h" | sed 'y%./+-%__p_%'`
8649 echo $ac_n "checking for GL/gutil.h""... $ac_c" 1>&6
8650 echo "configure:8662: checking for GL/gutil.h" >&5
8651 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8652   echo $ac_n "(cached) $ac_c" 1>&6
8653 else
8654   cat > conftest.$ac_ext <<EOF
8655 #line 8667 "configure"
8656 #include "confdefs.h"
8657 #include <GL/gutil.h>
8658 EOF
8659 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8660 { (eval echo configure:8672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8661 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8662 if test -z "$ac_err"; then
8663   rm -rf conftest*
8664   eval "ac_cv_header_$ac_safe=yes"
8665 else
8666   echo "$ac_err" >&5
8667   echo "configure: failed program was:" >&5
8668   cat conftest.$ac_ext >&5
8669   rm -rf conftest*
8670   eval "ac_cv_header_$ac_safe=no"
8671 fi
8672 rm -f conftest*
8673 fi
8674 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8675   echo "$ac_t""yes" 1>&6
8676   have_gle=yes
8677 else
8678   echo "$ac_t""no" 1>&6
8679 fi
8680
8681   CPPFLAGS="$ac_save_CPPFLAGS"
8682     if test "$have_gle" = yes ; then
8683       
8684   ac_save_CPPFLAGS="$CPPFLAGS"
8685   if test \! -z "$includedir" ; then 
8686     CPPFLAGS="$CPPFLAGS -I$includedir"
8687   fi
8688   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8689   ac_safe=`echo "GL/tube.h" | sed 'y%./+-%__p_%'`
8690 echo $ac_n "checking for GL/tube.h""... $ac_c" 1>&6
8691 echo "configure:8703: checking for GL/tube.h" >&5
8692 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8693   echo $ac_n "(cached) $ac_c" 1>&6
8694 else
8695   cat > conftest.$ac_ext <<EOF
8696 #line 8708 "configure"
8697 #include "confdefs.h"
8698 #include <GL/tube.h>
8699 EOF
8700 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8701 { (eval echo configure:8713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8702 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8703 if test -z "$ac_err"; then
8704   rm -rf conftest*
8705   eval "ac_cv_header_$ac_safe=yes"
8706 else
8707   echo "$ac_err" >&5
8708   echo "configure: failed program was:" >&5
8709   cat conftest.$ac_ext >&5
8710   rm -rf conftest*
8711   eval "ac_cv_header_$ac_safe=no"
8712 fi
8713 rm -f conftest*
8714 fi
8715 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8716   echo "$ac_t""yes" 1>&6
8717   have_gle=yes
8718 else
8719   echo "$ac_t""no" 1>&6
8720 fi
8721
8722   CPPFLAGS="$ac_save_CPPFLAGS"
8723     fi
8724   fi
8725
8726   if test "$have_gle" = yes ; then
8727     have_gle=no
8728     gle_halfassed=yes
8729     
8730   ac_save_CPPFLAGS="$CPPFLAGS"
8731   ac_save_LDFLAGS="$LDFLAGS"
8732 #  ac_save_LIBS="$LIBS"
8733
8734   if test \! -z "$includedir" ; then 
8735     CPPFLAGS="$CPPFLAGS -I$includedir"
8736   fi
8737   # note: $X_CFLAGS includes $x_includes
8738   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8739
8740   if test \! -z "$libdir" ; then
8741     LDFLAGS="$LDFLAGS -L$libdir"
8742   fi
8743   # note: $X_LIBS includes $x_libraries
8744   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8745
8746   echo $ac_n "checking for gleCreateGC in -lgle""... $ac_c" 1>&6
8747 echo "configure:8759: checking for gleCreateGC in -lgle" >&5
8748 ac_lib_var=`echo gle'_'gleCreateGC | sed 'y%./+-%__p_%'`
8749 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8750   echo $ac_n "(cached) $ac_c" 1>&6
8751 else
8752   ac_save_LIBS="$LIBS"
8753 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
8754 cat > conftest.$ac_ext <<EOF
8755 #line 8767 "configure"
8756 #include "confdefs.h"
8757 /* Override any gcc2 internal prototype to avoid an error.  */
8758 /* We use char because int might match the return type of a gcc2
8759     builtin and then its argument prototype would still apply.  */
8760 char gleCreateGC();
8761
8762 int main() {
8763 gleCreateGC()
8764 ; return 0; }
8765 EOF
8766 if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8767   rm -rf conftest*
8768   eval "ac_cv_lib_$ac_lib_var=yes"
8769 else
8770   echo "configure: failed program was:" >&5
8771   cat conftest.$ac_ext >&5
8772   rm -rf conftest*
8773   eval "ac_cv_lib_$ac_lib_var=no"
8774 fi
8775 rm -f conftest*
8776 LIBS="$ac_save_LIBS"
8777
8778 fi
8779 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8780   echo "$ac_t""yes" 1>&6
8781   have_gle=yes; gle_halfassed=no; GLE_LIBS="-lgle"
8782 else
8783   echo "$ac_t""no" 1>&6
8784 fi
8785
8786   CPPFLAGS="$ac_save_CPPFLAGS"
8787   LDFLAGS="$ac_save_LDFLAGS"
8788 #  LIBS="$ac_save_LIBS"
8789   
8790   fi
8791   if test "$have_gle" = yes ; then
8792     have_gle=no
8793     gle_halfassed=yes
8794
8795     # sometimes the libmatrix stuff is included in libgle.  look there first.
8796 #
8797 # I don't get it.  For some reason, this test passes on SGI, as if
8798 # uview_direction_d() was in libgle -- but it's not, it's in libmatrix.
8799 # Yet the link is succeeding.  Why???
8800 #
8801 #    AC_CHECK_X_LIB(gle, uview_direction_d, 
8802 #                   [have_gle=yes; gle_halfassed=no],
8803 #                   [], $GL_LIBS -lX11 -lXext -lm)
8804
8805     # As of GLE 3 this is in libgle, and has changed name to uview_direction!
8806     # *sigh*
8807     if test "$have_gle3" = yes ; then
8808       
8809   ac_save_CPPFLAGS="$CPPFLAGS"
8810   ac_save_LDFLAGS="$LDFLAGS"
8811 #  ac_save_LIBS="$LIBS"
8812
8813   if test \! -z "$includedir" ; then 
8814     CPPFLAGS="$CPPFLAGS -I$includedir"
8815   fi
8816   # note: $X_CFLAGS includes $x_includes
8817   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8818
8819   if test \! -z "$libdir" ; then
8820     LDFLAGS="$LDFLAGS -L$libdir"
8821   fi
8822   # note: $X_LIBS includes $x_libraries
8823   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8824
8825   echo $ac_n "checking for uview_direction in -lgle""... $ac_c" 1>&6
8826 echo "configure:8838: checking for uview_direction in -lgle" >&5
8827 ac_lib_var=`echo gle'_'uview_direction | sed 'y%./+-%__p_%'`
8828 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8829   echo $ac_n "(cached) $ac_c" 1>&6
8830 else
8831   ac_save_LIBS="$LIBS"
8832 LIBS="-lgle $GL_LIBS -lX11 -lXext -lm $LIBS"
8833 cat > conftest.$ac_ext <<EOF
8834 #line 8846 "configure"
8835 #include "confdefs.h"
8836 /* Override any gcc2 internal prototype to avoid an error.  */
8837 /* We use char because int might match the return type of a gcc2
8838     builtin and then its argument prototype would still apply.  */
8839 char uview_direction();
8840
8841 int main() {
8842 uview_direction()
8843 ; return 0; }
8844 EOF
8845 if { (eval echo configure:8857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8846   rm -rf conftest*
8847   eval "ac_cv_lib_$ac_lib_var=yes"
8848 else
8849   echo "configure: failed program was:" >&5
8850   cat conftest.$ac_ext >&5
8851   rm -rf conftest*
8852   eval "ac_cv_lib_$ac_lib_var=no"
8853 fi
8854 rm -f conftest*
8855 LIBS="$ac_save_LIBS"
8856
8857 fi
8858 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8859   echo "$ac_t""yes" 1>&6
8860   have_gle=yes; gle_halfassed=no
8861 else
8862   echo "$ac_t""no" 1>&6
8863 fi
8864
8865   CPPFLAGS="$ac_save_CPPFLAGS"
8866   LDFLAGS="$ac_save_LDFLAGS"
8867 #  LIBS="$ac_save_LIBS"
8868   
8869     fi
8870     # if it wasn't in libgle, then look in libmatrix.
8871     if test "$have_gle" = no ; then
8872       
8873   ac_save_CPPFLAGS="$CPPFLAGS"
8874   ac_save_LDFLAGS="$LDFLAGS"
8875 #  ac_save_LIBS="$LIBS"
8876
8877   if test \! -z "$includedir" ; then 
8878     CPPFLAGS="$CPPFLAGS -I$includedir"
8879   fi
8880   # note: $X_CFLAGS includes $x_includes
8881   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8882
8883   if test \! -z "$libdir" ; then
8884     LDFLAGS="$LDFLAGS -L$libdir"
8885   fi
8886   # note: $X_LIBS includes $x_libraries
8887   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
8888
8889   echo $ac_n "checking for uview_direction_d in -lmatrix""... $ac_c" 1>&6
8890 echo "configure:8902: checking for uview_direction_d in -lmatrix" >&5
8891 ac_lib_var=`echo matrix'_'uview_direction_d | sed 'y%./+-%__p_%'`
8892 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8893   echo $ac_n "(cached) $ac_c" 1>&6
8894 else
8895   ac_save_LIBS="$LIBS"
8896 LIBS="-lmatrix $GL_LIBS -lX11 -lXext -lm $LIBS"
8897 cat > conftest.$ac_ext <<EOF
8898 #line 8910 "configure"
8899 #include "confdefs.h"
8900 /* Override any gcc2 internal prototype to avoid an error.  */
8901 /* We use char because int might match the return type of a gcc2
8902     builtin and then its argument prototype would still apply.  */
8903 char uview_direction_d();
8904
8905 int main() {
8906 uview_direction_d()
8907 ; return 0; }
8908 EOF
8909 if { (eval echo configure:8921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8910   rm -rf conftest*
8911   eval "ac_cv_lib_$ac_lib_var=yes"
8912 else
8913   echo "configure: failed program was:" >&5
8914   cat conftest.$ac_ext >&5
8915   rm -rf conftest*
8916   eval "ac_cv_lib_$ac_lib_var=no"
8917 fi
8918 rm -f conftest*
8919 LIBS="$ac_save_LIBS"
8920
8921 fi
8922 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8923   echo "$ac_t""yes" 1>&6
8924   have_gle=yes; gle_halfassed=no;
8925                       GLE_LIBS="$GLE_LIBS -lmatrix"
8926 else
8927   echo "$ac_t""no" 1>&6
8928 fi
8929
8930   CPPFLAGS="$ac_save_CPPFLAGS"
8931   LDFLAGS="$ac_save_LDFLAGS"
8932 #  LIBS="$ac_save_LIBS"
8933   
8934     fi
8935   fi
8936
8937   if test "$have_gle" = yes ; then
8938     cat >> confdefs.h <<\EOF
8939 #define HAVE_GLE 1
8940 EOF
8941
8942     if test "$have_gle3" = yes ; then
8943       cat >> confdefs.h <<\EOF
8944 #define HAVE_GLE3 1
8945 EOF
8946
8947     fi
8948   fi
8949
8950 elif test "$with_gle" != no; then
8951   echo "error: must be yes or no: --with-gle=$with_gle"
8952   exit 1
8953
8954 fi
8955
8956
8957
8958 ###############################################################################
8959 #
8960 #       Check for -lXpm.
8961 #
8962 ###############################################################################
8963
8964 have_xpm=no
8965 with_xpm_req=unspecified
8966 # Check whether --with-xpm or --without-xpm was given.
8967 if test "${with_xpm+set}" = set; then
8968   withval="$with_xpm"
8969   with_xpm="$withval"; with_xpm_req="$withval"
8970 else
8971   with_xpm=yes
8972 fi
8973
8974
8975
8976    case "$with_xpm" in
8977     yes) ;;
8978     no)  ;;
8979
8980     /*)
8981      echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
8982 echo "configure:8994: checking for XPM headers" >&5
8983      d=$with_xpm/include
8984      if test -d $d; then
8985        X_CFLAGS="-I$d $X_CFLAGS"
8986        echo "$ac_t""$d" 1>&6
8987      else
8988        echo "$ac_t""not found ($d: no such directory)" 1>&6
8989      fi
8990
8991      echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
8992 echo "configure:9004: checking for XPM libs" >&5
8993      d=$with_xpm/lib
8994      if test -d $d; then
8995        X_LIBS="-L$d $X_LIBS"
8996        echo "$ac_t""$d" 1>&6
8997      else
8998        echo "$ac_t""not found ($d: no such directory)" 1>&6
8999      fi
9000
9001      # replace the directory string with "yes".
9002      with_xpm_req="yes"
9003      with_xpm=$with_xpm_req
9004      ;;
9005
9006     *)
9007      echo ""
9008      echo "error: argument to --with-xpm must be \"yes\", \"no\", or a directory."
9009      echo "       If it is a directory, then \`DIR/include' will be added to"
9010      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9011      exit 1
9012      ;;
9013    esac
9014   
9015
9016 if test "$with_xpm" = yes; then
9017   
9018   ac_save_CPPFLAGS="$CPPFLAGS"
9019   if test \! -z "$includedir" ; then 
9020     CPPFLAGS="$CPPFLAGS -I$includedir"
9021   fi
9022   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9023   ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
9024 echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
9025 echo "configure:9037: checking for X11/xpm.h" >&5
9026 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9027   echo $ac_n "(cached) $ac_c" 1>&6
9028 else
9029   cat > conftest.$ac_ext <<EOF
9030 #line 9042 "configure"
9031 #include "confdefs.h"
9032 #include <X11/xpm.h>
9033 EOF
9034 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9035 { (eval echo configure:9047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9036 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9037 if test -z "$ac_err"; then
9038   rm -rf conftest*
9039   eval "ac_cv_header_$ac_safe=yes"
9040 else
9041   echo "$ac_err" >&5
9042   echo "configure: failed program was:" >&5
9043   cat conftest.$ac_ext >&5
9044   rm -rf conftest*
9045   eval "ac_cv_header_$ac_safe=no"
9046 fi
9047 rm -f conftest*
9048 fi
9049 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9050   echo "$ac_t""yes" 1>&6
9051   have_xpm=yes
9052                     cat >> confdefs.h <<\EOF
9053 #define HAVE_XPM 1
9054 EOF
9055
9056                     XPM_LIBS="-lXpm"
9057 else
9058   echo "$ac_t""no" 1>&6
9059 fi
9060
9061   CPPFLAGS="$ac_save_CPPFLAGS"
9062 elif test "$with_xpm" != no; then
9063   echo "error: must be yes or no: --with-xpm=$with_xpm"
9064   exit 1
9065 fi
9066
9067 # See comment near $motif_requires_xpm, above.
9068 # Need to do this here, after both Motif and XPM have been checked for.
9069 #
9070 if test "$have_motif" = yes -a "$have_xpm" = yes ; then
9071   if test "$motif_requires_xpm" = yes ; then
9072     MOTIF_LIBS="$MOTIF_LIBS $XPM_LIBS"
9073   fi
9074 fi
9075
9076
9077 ###############################################################################
9078 #
9079 #       Check for -lgdk_pixbuf.
9080 #
9081 ###############################################################################
9082
9083 have_gdk_pixbuf=no
9084 with_gdk_pixbuf_req=unspecified
9085 # Check whether --with-pixbuf or --without-pixbuf was given.
9086 if test "${with_pixbuf+set}" = set; then
9087   withval="$with_pixbuf"
9088   with_gdk_pixbuf="$withval"; with_gdk_pixbuf_req="$withval"
9089 else
9090   with_gdk_pixbuf=yes
9091 fi
9092
9093
9094
9095    case "$with_gdk_pixbuf" in
9096     yes) ;;
9097     no)  ;;
9098
9099     /*)
9100      echo $ac_n "checking for GDK_PIXBUF headers""... $ac_c" 1>&6
9101 echo "configure:9113: checking for GDK_PIXBUF headers" >&5
9102      d=$with_gdk_pixbuf/include
9103      if test -d $d; then
9104        X_CFLAGS="-I$d $X_CFLAGS"
9105        echo "$ac_t""$d" 1>&6
9106      else
9107        echo "$ac_t""not found ($d: no such directory)" 1>&6
9108      fi
9109
9110      echo $ac_n "checking for GDK_PIXBUF libs""... $ac_c" 1>&6
9111 echo "configure:9123: checking for GDK_PIXBUF libs" >&5
9112      d=$with_gdk_pixbuf/lib
9113      if test -d $d; then
9114        X_LIBS="-L$d $X_LIBS"
9115        echo "$ac_t""$d" 1>&6
9116      else
9117        echo "$ac_t""not found ($d: no such directory)" 1>&6
9118      fi
9119
9120      # replace the directory string with "yes".
9121      with_gdk_pixbuf_req="yes"
9122      with_gdk_pixbuf=$with_gdk_pixbuf_req
9123      ;;
9124
9125     *)
9126      echo ""
9127      echo "error: argument to --with-pixbuf must be \"yes\", \"no\", or a directory."
9128      echo "       If it is a directory, then \`DIR/include' will be added to"
9129      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9130      exit 1
9131      ;;
9132    esac
9133   
9134
9135 if test "$with_gdk_pixbuf" = yes; then
9136
9137   if test "$have_gtk" = yes; then
9138
9139     ac_save_gdk_CPPFLAGS="$CPPFLAGS"
9140     CPPFLAGS="$CPPFLAGS $ac_gtk_config_cflags"
9141
9142     have_gdk_pixbuf=no
9143     
9144   ac_save_CPPFLAGS="$CPPFLAGS"
9145   if test \! -z "$includedir" ; then 
9146     CPPFLAGS="$CPPFLAGS -I$includedir"
9147   fi
9148   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9149   ac_safe=`echo "gdk-pixbuf/gdk-pixbuf.h" | sed 'y%./+-%__p_%'`
9150 echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf.h""... $ac_c" 1>&6
9151 echo "configure:9163: checking for gdk-pixbuf/gdk-pixbuf.h" >&5
9152 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9153   echo $ac_n "(cached) $ac_c" 1>&6
9154 else
9155   cat > conftest.$ac_ext <<EOF
9156 #line 9168 "configure"
9157 #include "confdefs.h"
9158 #include <gdk-pixbuf/gdk-pixbuf.h>
9159 EOF
9160 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9161 { (eval echo configure:9173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9162 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9163 if test -z "$ac_err"; then
9164   rm -rf conftest*
9165   eval "ac_cv_header_$ac_safe=yes"
9166 else
9167   echo "$ac_err" >&5
9168   echo "configure: failed program was:" >&5
9169   cat conftest.$ac_ext >&5
9170   rm -rf conftest*
9171   eval "ac_cv_header_$ac_safe=no"
9172 fi
9173 rm -f conftest*
9174 fi
9175 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9176   echo "$ac_t""yes" 1>&6
9177   have_gdk_pixbuf=yes
9178 else
9179   echo "$ac_t""no" 1>&6
9180 fi
9181
9182   CPPFLAGS="$ac_save_CPPFLAGS"
9183     if test "$have_gdk_pixbuf" = yes; then
9184       have_gdk_pixbuf=no
9185       
9186   ac_save_CPPFLAGS="$CPPFLAGS"
9187   if test \! -z "$includedir" ; then 
9188     CPPFLAGS="$CPPFLAGS -I$includedir"
9189   fi
9190   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9191   ac_safe=`echo "gdk-pixbuf/gdk-pixbuf-xlib.h" | sed 'y%./+-%__p_%'`
9192 echo $ac_n "checking for gdk-pixbuf/gdk-pixbuf-xlib.h""... $ac_c" 1>&6
9193 echo "configure:9205: checking for gdk-pixbuf/gdk-pixbuf-xlib.h" >&5
9194 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9195   echo $ac_n "(cached) $ac_c" 1>&6
9196 else
9197   cat > conftest.$ac_ext <<EOF
9198 #line 9210 "configure"
9199 #include "confdefs.h"
9200 #include <gdk-pixbuf/gdk-pixbuf-xlib.h>
9201 EOF
9202 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9203 { (eval echo configure:9215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9204 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9205 if test -z "$ac_err"; then
9206   rm -rf conftest*
9207   eval "ac_cv_header_$ac_safe=yes"
9208 else
9209   echo "$ac_err" >&5
9210   echo "configure: failed program was:" >&5
9211   cat conftest.$ac_ext >&5
9212   rm -rf conftest*
9213   eval "ac_cv_header_$ac_safe=no"
9214 fi
9215 rm -f conftest*
9216 fi
9217 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9218   echo "$ac_t""yes" 1>&6
9219   have_gdk_pixbuf=yes
9220 else
9221   echo "$ac_t""no" 1>&6
9222 fi
9223
9224   CPPFLAGS="$ac_save_CPPFLAGS"
9225     fi
9226
9227     CPPFLAGS="$ac_save_gdk_CPPFLAGS"
9228
9229     if test "$have_gdk_pixbuf" = yes; then
9230       cat >> confdefs.h <<\EOF
9231 #define HAVE_GDK_PIXBUF 1
9232 EOF
9233
9234       XPM_LIBS="-lgdk_pixbuf -lgdk_pixbuf_xlib"
9235     fi
9236   fi
9237
9238 elif test "$with_gdk_pixbuf" != no; then
9239   echo "error: must be yes or no: --with-pixbuf=$with_gdk_pixbuf"
9240   exit 1
9241 fi
9242
9243
9244 ###############################################################################
9245 #
9246 #       Check for -ljpeg
9247 #
9248 ###############################################################################
9249
9250 have_jpeg=no
9251 with_jpeg_req=unspecified
9252 jpeg_halfassed=no
9253 # Check whether --with-jpeg or --without-jpeg was given.
9254 if test "${with_jpeg+set}" = set; then
9255   withval="$with_jpeg"
9256   with_jpeg="$withval"; with_jpeg_req="$withval"
9257 else
9258   with_jpeg=yes
9259 fi
9260
9261
9262
9263    case "$with_jpeg" in
9264     yes) ;;
9265     no)  ;;
9266
9267     /*)
9268      echo $ac_n "checking for JPEG headers""... $ac_c" 1>&6
9269 echo "configure:9281: checking for JPEG headers" >&5
9270      d=$with_jpeg/include
9271      if test -d $d; then
9272        X_CFLAGS="-I$d $X_CFLAGS"
9273        echo "$ac_t""$d" 1>&6
9274      else
9275        echo "$ac_t""not found ($d: no such directory)" 1>&6
9276      fi
9277
9278      echo $ac_n "checking for JPEG libs""... $ac_c" 1>&6
9279 echo "configure:9291: checking for JPEG libs" >&5
9280      d=$with_jpeg/lib
9281      if test -d $d; then
9282        X_LIBS="-L$d $X_LIBS"
9283        echo "$ac_t""$d" 1>&6
9284      else
9285        echo "$ac_t""not found ($d: no such directory)" 1>&6
9286      fi
9287
9288      # replace the directory string with "yes".
9289      with_jpeg_req="yes"
9290      with_jpeg=$with_jpeg_req
9291      ;;
9292
9293     *)
9294      echo ""
9295      echo "error: argument to --with-jpeg must be \"yes\", \"no\", or a directory."
9296      echo "       If it is a directory, then \`DIR/include' will be added to"
9297      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9298      exit 1
9299      ;;
9300    esac
9301   
9302
9303 if test "$with_jpeg" != yes -a "$with_jpeg" != no ; then
9304   echo "error: must be yes or no: --with-jpeg=$with_jpeg"
9305   exit 1
9306 fi
9307
9308 if test "$with_jpeg" = yes; then
9309
9310   have_jpeg=no
9311   
9312   ac_save_CPPFLAGS="$CPPFLAGS"
9313   if test \! -z "$includedir" ; then 
9314     CPPFLAGS="$CPPFLAGS -I$includedir"
9315   fi
9316   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9317   ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
9318 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
9319 echo "configure:9331: checking for jpeglib.h" >&5
9320 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9321   echo $ac_n "(cached) $ac_c" 1>&6
9322 else
9323   cat > conftest.$ac_ext <<EOF
9324 #line 9336 "configure"
9325 #include "confdefs.h"
9326 #include <jpeglib.h>
9327 EOF
9328 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9329 { (eval echo configure:9341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9330 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9331 if test -z "$ac_err"; then
9332   rm -rf conftest*
9333   eval "ac_cv_header_$ac_safe=yes"
9334 else
9335   echo "$ac_err" >&5
9336   echo "configure: failed program was:" >&5
9337   cat conftest.$ac_ext >&5
9338   rm -rf conftest*
9339   eval "ac_cv_header_$ac_safe=no"
9340 fi
9341 rm -f conftest*
9342 fi
9343 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9344   echo "$ac_t""yes" 1>&6
9345   have_jpeg=yes
9346 else
9347   echo "$ac_t""no" 1>&6
9348 fi
9349
9350   CPPFLAGS="$ac_save_CPPFLAGS"
9351
9352   if test "$have_jpeg" = yes; then
9353     # we have the header, now check for the library
9354     have_jpeg=no
9355     jpeg_halfassed=yes
9356     
9357   ac_save_CPPFLAGS="$CPPFLAGS"
9358   ac_save_LDFLAGS="$LDFLAGS"
9359 #  ac_save_LIBS="$LIBS"
9360
9361   if test \! -z "$includedir" ; then 
9362     CPPFLAGS="$CPPFLAGS -I$includedir"
9363   fi
9364   # note: $X_CFLAGS includes $x_includes
9365   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9366
9367   if test \! -z "$libdir" ; then
9368     LDFLAGS="$LDFLAGS -L$libdir"
9369   fi
9370   # note: $X_LIBS includes $x_libraries
9371   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9372
9373   echo $ac_n "checking for jpeg_start_compress in -ljpeg""... $ac_c" 1>&6
9374 echo "configure:9386: checking for jpeg_start_compress in -ljpeg" >&5
9375 ac_lib_var=`echo jpeg'_'jpeg_start_compress | sed 'y%./+-%__p_%'`
9376 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9377   echo $ac_n "(cached) $ac_c" 1>&6
9378 else
9379   ac_save_LIBS="$LIBS"
9380 LIBS="-ljpeg  $LIBS"
9381 cat > conftest.$ac_ext <<EOF
9382 #line 9394 "configure"
9383 #include "confdefs.h"
9384 /* Override any gcc2 internal prototype to avoid an error.  */
9385 /* We use char because int might match the return type of a gcc2
9386     builtin and then its argument prototype would still apply.  */
9387 char jpeg_start_compress();
9388
9389 int main() {
9390 jpeg_start_compress()
9391 ; return 0; }
9392 EOF
9393 if { (eval echo configure:9405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9394   rm -rf conftest*
9395   eval "ac_cv_lib_$ac_lib_var=yes"
9396 else
9397   echo "configure: failed program was:" >&5
9398   cat conftest.$ac_ext >&5
9399   rm -rf conftest*
9400   eval "ac_cv_lib_$ac_lib_var=no"
9401 fi
9402 rm -f conftest*
9403 LIBS="$ac_save_LIBS"
9404
9405 fi
9406 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9407   echo "$ac_t""yes" 1>&6
9408   have_jpeg=yes
9409                     jpeg_halfassed=no
9410                     JPEG_LIBS="-ljpeg"
9411                     cat >> confdefs.h <<\EOF
9412 #define HAVE_JPEGLIB 1
9413 EOF
9414
9415 else
9416   echo "$ac_t""no" 1>&6
9417 fi
9418
9419   CPPFLAGS="$ac_save_CPPFLAGS"
9420   LDFLAGS="$ac_save_LDFLAGS"
9421 #  LIBS="$ac_save_LIBS"
9422   
9423   fi
9424 fi
9425
9426
9427 ###############################################################################
9428 #
9429 #       Check for the XSHM server extension.
9430 #
9431 ###############################################################################
9432
9433 have_xshm=no
9434 with_xshm_req=unspecified
9435 # Check whether --with-xshm-ext or --without-xshm-ext was given.
9436 if test "${with_xshm_ext+set}" = set; then
9437   withval="$with_xshm_ext"
9438   with_xshm="$withval"; with_xshm_req="$withval"
9439 else
9440   with_xshm=yes
9441 fi
9442
9443
9444
9445    case "$with_xshm" in
9446     yes) ;;
9447     no)  ;;
9448
9449     /*)
9450      echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
9451 echo "configure:9463: checking for XSHM headers" >&5
9452      d=$with_xshm/include
9453      if test -d $d; then
9454        X_CFLAGS="-I$d $X_CFLAGS"
9455        echo "$ac_t""$d" 1>&6
9456      else
9457        echo "$ac_t""not found ($d: no such directory)" 1>&6
9458      fi
9459
9460      echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
9461 echo "configure:9473: checking for XSHM libs" >&5
9462      d=$with_xshm/lib
9463      if test -d $d; then
9464        X_LIBS="-L$d $X_LIBS"
9465        echo "$ac_t""$d" 1>&6
9466      else
9467        echo "$ac_t""not found ($d: no such directory)" 1>&6
9468      fi
9469
9470      # replace the directory string with "yes".
9471      with_xshm_req="yes"
9472      with_xshm=$with_xshm_req
9473      ;;
9474
9475     *)
9476      echo ""
9477      echo "error: argument to --with-xshm-ext must be \"yes\", \"no\", or a directory."
9478      echo "       If it is a directory, then \`DIR/include' will be added to"
9479      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9480      exit 1
9481      ;;
9482    esac
9483   
9484
9485 if test "$with_xshm" = yes; then
9486
9487   # first check for Xshm.h.
9488   
9489   ac_save_CPPFLAGS="$CPPFLAGS"
9490   if test \! -z "$includedir" ; then 
9491     CPPFLAGS="$CPPFLAGS -I$includedir"
9492   fi
9493   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9494   ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
9495 echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
9496 echo "configure:9508: checking for X11/extensions/XShm.h" >&5
9497 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9498   echo $ac_n "(cached) $ac_c" 1>&6
9499 else
9500   cat > conftest.$ac_ext <<EOF
9501 #line 9513 "configure"
9502 #include "confdefs.h"
9503 #include <X11/extensions/XShm.h>
9504 EOF
9505 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9506 { (eval echo configure:9518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9507 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9508 if test -z "$ac_err"; then
9509   rm -rf conftest*
9510   eval "ac_cv_header_$ac_safe=yes"
9511 else
9512   echo "$ac_err" >&5
9513   echo "configure: failed program was:" >&5
9514   cat conftest.$ac_ext >&5
9515   rm -rf conftest*
9516   eval "ac_cv_header_$ac_safe=no"
9517 fi
9518 rm -f conftest*
9519 fi
9520 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9521   echo "$ac_t""yes" 1>&6
9522   have_xshm=yes
9523 else
9524   echo "$ac_t""no" 1>&6
9525 fi
9526
9527   CPPFLAGS="$ac_save_CPPFLAGS"
9528
9529   # if that succeeded, then check for sys/ipc.h.
9530   if test "$have_xshm" = yes; then
9531     have_xshm=no
9532     
9533   ac_save_CPPFLAGS="$CPPFLAGS"
9534   if test \! -z "$includedir" ; then 
9535     CPPFLAGS="$CPPFLAGS -I$includedir"
9536   fi
9537   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9538   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
9539 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
9540 echo "configure:9552: checking for sys/ipc.h" >&5
9541 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9542   echo $ac_n "(cached) $ac_c" 1>&6
9543 else
9544   cat > conftest.$ac_ext <<EOF
9545 #line 9557 "configure"
9546 #include "confdefs.h"
9547 #include <sys/ipc.h>
9548 EOF
9549 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9550 { (eval echo configure:9562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9551 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9552 if test -z "$ac_err"; then
9553   rm -rf conftest*
9554   eval "ac_cv_header_$ac_safe=yes"
9555 else
9556   echo "$ac_err" >&5
9557   echo "configure: failed program was:" >&5
9558   cat conftest.$ac_ext >&5
9559   rm -rf conftest*
9560   eval "ac_cv_header_$ac_safe=no"
9561 fi
9562 rm -f conftest*
9563 fi
9564 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9565   echo "$ac_t""yes" 1>&6
9566   have_xshm=yes
9567 else
9568   echo "$ac_t""no" 1>&6
9569 fi
9570
9571   CPPFLAGS="$ac_save_CPPFLAGS"
9572   fi
9573
9574   # if that succeeded, then check for sys/shm.h.
9575   if test "$have_xshm" = yes; then
9576     have_xshm=no
9577     
9578   ac_save_CPPFLAGS="$CPPFLAGS"
9579   if test \! -z "$includedir" ; then 
9580     CPPFLAGS="$CPPFLAGS -I$includedir"
9581   fi
9582   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9583   ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
9584 echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
9585 echo "configure:9597: checking for sys/shm.h" >&5
9586 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9587   echo $ac_n "(cached) $ac_c" 1>&6
9588 else
9589   cat > conftest.$ac_ext <<EOF
9590 #line 9602 "configure"
9591 #include "confdefs.h"
9592 #include <sys/shm.h>
9593 EOF
9594 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9595 { (eval echo configure:9607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9596 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9597 if test -z "$ac_err"; then
9598   rm -rf conftest*
9599   eval "ac_cv_header_$ac_safe=yes"
9600 else
9601   echo "$ac_err" >&5
9602   echo "configure: failed program was:" >&5
9603   cat conftest.$ac_ext >&5
9604   rm -rf conftest*
9605   eval "ac_cv_header_$ac_safe=no"
9606 fi
9607 rm -f conftest*
9608 fi
9609 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9610   echo "$ac_t""yes" 1>&6
9611   have_xshm=yes
9612 else
9613   echo "$ac_t""no" 1>&6
9614 fi
9615
9616   CPPFLAGS="$ac_save_CPPFLAGS"
9617   fi
9618
9619   # AIX is pathological, as usual: apparently it's normal for the Xshm headers
9620   # to exist, but the library code to not exist.  And even better, the library
9621   # code is in its own library: libXextSam.a.  So, if we're on AIX, and that
9622   # lib doesn't exist, give up.  (This lib gets added to X_EXTRA_LIBS, and
9623   # that's not quite right, but close enough.)
9624   #
9625   case "$host" in
9626     *-aix*)
9627       if  `uname -v` -eq 3 ; then
9628         have_xshm=no
9629         
9630   ac_save_CPPFLAGS="$CPPFLAGS"
9631   ac_save_LDFLAGS="$LDFLAGS"
9632 #  ac_save_LIBS="$LIBS"
9633
9634   if test \! -z "$includedir" ; then 
9635     CPPFLAGS="$CPPFLAGS -I$includedir"
9636   fi
9637   # note: $X_CFLAGS includes $x_includes
9638   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9639
9640   if test \! -z "$libdir" ; then
9641     LDFLAGS="$LDFLAGS -L$libdir"
9642   fi
9643   # note: $X_LIBS includes $x_libraries
9644   LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
9645
9646   echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
9647 echo "configure:9659: checking for XShmQueryExtension in -lXextSam" >&5
9648 ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
9649 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9650   echo $ac_n "(cached) $ac_c" 1>&6
9651 else
9652   ac_save_LIBS="$LIBS"
9653 LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
9654 cat > conftest.$ac_ext <<EOF
9655 #line 9667 "configure"
9656 #include "confdefs.h"
9657 /* Override any gcc2 internal prototype to avoid an error.  */
9658 /* We use char because int might match the return type of a gcc2
9659     builtin and then its argument prototype would still apply.  */
9660 char XShmQueryExtension();
9661
9662 int main() {
9663 XShmQueryExtension()
9664 ; return 0; }
9665 EOF
9666 if { (eval echo configure:9678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9667   rm -rf conftest*
9668   eval "ac_cv_lib_$ac_lib_var=yes"
9669 else
9670   echo "configure: failed program was:" >&5
9671   cat conftest.$ac_ext >&5
9672   rm -rf conftest*
9673   eval "ac_cv_lib_$ac_lib_var=no"
9674 fi
9675 rm -f conftest*
9676 LIBS="$ac_save_LIBS"
9677
9678 fi
9679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9680   echo "$ac_t""yes" 1>&6
9681   have_xshm=yes; X_EXTRA_LIBS="$X_EXTRA_LIBS -lXextSam"
9682 else
9683   echo "$ac_t""no" 1>&6
9684 true
9685 fi
9686
9687   CPPFLAGS="$ac_save_CPPFLAGS"
9688   LDFLAGS="$ac_save_LDFLAGS"
9689 #  LIBS="$ac_save_LIBS"
9690   
9691       fi
9692     ;;
9693   esac
9694
9695   # if that succeeded, then we've really got it.
9696   if test "$have_xshm" = yes; then
9697     cat >> confdefs.h <<\EOF
9698 #define HAVE_XSHM_EXTENSION 1
9699 EOF
9700
9701   fi
9702
9703 elif test "$with_xshm" != no; then
9704   echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
9705   exit 1
9706 fi
9707
9708
9709 ###############################################################################
9710 #
9711 #       Check for the DOUBLE-BUFFER server extension.
9712 #
9713 ###############################################################################
9714
9715 have_xdbe=no
9716 with_xdbe_req=unspecified
9717 # Check whether --with-xdbe-ext or --without-xdbe-ext was given.
9718 if test "${with_xdbe_ext+set}" = set; then
9719   withval="$with_xdbe_ext"
9720   with_xdbe="$withval"; with_xdbe_req="$withval"
9721 else
9722   with_xdbe=yes
9723 fi
9724
9725
9726
9727    case "$with_xdbe" in
9728     yes) ;;
9729     no)  ;;
9730
9731     /*)
9732      echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
9733 echo "configure:9745: checking for DOUBLE-BUFFER headers" >&5
9734      d=$with_xdbe/include
9735      if test -d $d; then
9736        X_CFLAGS="-I$d $X_CFLAGS"
9737        echo "$ac_t""$d" 1>&6
9738      else
9739        echo "$ac_t""not found ($d: no such directory)" 1>&6
9740      fi
9741
9742      echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
9743 echo "configure:9755: checking for DOUBLE-BUFFER libs" >&5
9744      d=$with_xdbe/lib
9745      if test -d $d; then
9746        X_LIBS="-L$d $X_LIBS"
9747        echo "$ac_t""$d" 1>&6
9748      else
9749        echo "$ac_t""not found ($d: no such directory)" 1>&6
9750      fi
9751
9752      # replace the directory string with "yes".
9753      with_xdbe_req="yes"
9754      with_xdbe=$with_xdbe_req
9755      ;;
9756
9757     *)
9758      echo ""
9759      echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
9760      echo "       If it is a directory, then \`DIR/include' will be added to"
9761      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9762      exit 1
9763      ;;
9764    esac
9765   
9766
9767 if test "$with_xdbe" = yes; then
9768
9769   
9770   ac_save_CPPFLAGS="$CPPFLAGS"
9771   if test \! -z "$includedir" ; then 
9772     CPPFLAGS="$CPPFLAGS -I$includedir"
9773   fi
9774   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9775   ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
9776 echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
9777 echo "configure:9789: checking for X11/extensions/Xdbe.h" >&5
9778 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9779   echo $ac_n "(cached) $ac_c" 1>&6
9780 else
9781   cat > conftest.$ac_ext <<EOF
9782 #line 9794 "configure"
9783 #include "confdefs.h"
9784 #include <X11/extensions/Xdbe.h>
9785 EOF
9786 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9787 { (eval echo configure:9799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9788 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9789 if test -z "$ac_err"; then
9790   rm -rf conftest*
9791   eval "ac_cv_header_$ac_safe=yes"
9792 else
9793   echo "$ac_err" >&5
9794   echo "configure: failed program was:" >&5
9795   cat conftest.$ac_ext >&5
9796   rm -rf conftest*
9797   eval "ac_cv_header_$ac_safe=no"
9798 fi
9799 rm -f conftest*
9800 fi
9801 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9802   echo "$ac_t""yes" 1>&6
9803   have_xdbe=yes
9804 else
9805   echo "$ac_t""no" 1>&6
9806 fi
9807
9808   CPPFLAGS="$ac_save_CPPFLAGS"
9809   if test "$have_xdbe" = yes; then
9810     cat >> confdefs.h <<\EOF
9811 #define HAVE_DOUBLE_BUFFER_EXTENSION 1
9812 EOF
9813     
9814   fi
9815
9816 elif test "$with_xdbe" != no; then
9817   echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
9818   exit 1
9819 fi
9820
9821
9822 ###############################################################################
9823 #
9824 #       Check for the SGI XReadDisplay server extension.
9825 #
9826 #       Note: this has to be down here, rather than up with the other server
9827 #       extension tests, so that the output of `configure --help' is in the
9828 #       right order.  Arrgh!
9829 #
9830 ###############################################################################
9831
9832 have_readdisplay=no
9833 with_readdisplay_req=unspecified
9834 # Check whether --with-readdisplay or --without-readdisplay was given.
9835 if test "${with_readdisplay+set}" = set; then
9836   withval="$with_readdisplay"
9837   with_readdisplay="$withval"; with_readdisplay_req="$withval"
9838 else
9839   with_readdisplay=yes
9840 fi
9841
9842
9843
9844    case "$with_readdisplay" in
9845     yes) ;;
9846     no)  ;;
9847
9848     /*)
9849      echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
9850 echo "configure:9862: checking for XReadDisplay headers" >&5
9851      d=$with_readdisplay/include
9852      if test -d $d; then
9853        X_CFLAGS="-I$d $X_CFLAGS"
9854        echo "$ac_t""$d" 1>&6
9855      else
9856        echo "$ac_t""not found ($d: no such directory)" 1>&6
9857      fi
9858
9859      echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
9860 echo "configure:9872: checking for XReadDisplay libs" >&5
9861      d=$with_readdisplay/lib
9862      if test -d $d; then
9863        X_LIBS="-L$d $X_LIBS"
9864        echo "$ac_t""$d" 1>&6
9865      else
9866        echo "$ac_t""not found ($d: no such directory)" 1>&6
9867      fi
9868
9869      # replace the directory string with "yes".
9870      with_readdisplay_req="yes"
9871      with_readdisplay=$with_readdisplay_req
9872      ;;
9873
9874     *)
9875      echo ""
9876      echo "error: argument to --with-readdisplay must be \"yes\", \"no\", or a directory."
9877      echo "       If it is a directory, then \`DIR/include' will be added to"
9878      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
9879      exit 1
9880      ;;
9881    esac
9882   
9883
9884 if test "$with_readdisplay" = yes; then
9885   
9886   ac_save_CPPFLAGS="$CPPFLAGS"
9887   if test \! -z "$includedir" ; then 
9888     CPPFLAGS="$CPPFLAGS -I$includedir"
9889   fi
9890   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9891   ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
9892 echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
9893 echo "configure:9905: checking for X11/extensions/readdisplay.h" >&5
9894 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9895   echo $ac_n "(cached) $ac_c" 1>&6
9896 else
9897   cat > conftest.$ac_ext <<EOF
9898 #line 9910 "configure"
9899 #include "confdefs.h"
9900 #include <X11/extensions/readdisplay.h>
9901 EOF
9902 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9903 { (eval echo configure:9915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9904 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9905 if test -z "$ac_err"; then
9906   rm -rf conftest*
9907   eval "ac_cv_header_$ac_safe=yes"
9908 else
9909   echo "$ac_err" >&5
9910   echo "configure: failed program was:" >&5
9911   cat conftest.$ac_ext >&5
9912   rm -rf conftest*
9913   eval "ac_cv_header_$ac_safe=no"
9914 fi
9915 rm -f conftest*
9916 fi
9917 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9918   echo "$ac_t""yes" 1>&6
9919   cat >> confdefs.h <<\EOF
9920 #define HAVE_READ_DISPLAY_EXTENSION 1
9921 EOF
9922
9923 else
9924   echo "$ac_t""no" 1>&6
9925 fi
9926
9927   CPPFLAGS="$ac_save_CPPFLAGS"
9928 elif test "$with_readdisplay" != no; then
9929   echo "error: must be yes or no: --with-readdisplay=$with_readdisplay"
9930   exit 1
9931 fi
9932
9933
9934 ###############################################################################
9935 #
9936 #       Check for a program to generate random text.
9937 #
9938 #       Zippy is funnier than the idiocy generally spat out by `fortune',
9939 #       so first see if "fortune zippy" works.  Else, use plain "fortune".
9940 #
9941 #       We used to dig around in Emacs to look for the "yow" program, but
9942 #       most people who have Emacs also have "fortune zippy", so nevermind.
9943 #
9944 ###############################################################################
9945
9946 with_fortune_req=""
9947 # Check whether --with-fortune or --without-fortune was given.
9948 if test "${with_fortune+set}" = set; then
9949   withval="$with_fortune"
9950   with_fortune_req="$withval"; with_fortune="$withval"
9951 else
9952   with_fortune=yes
9953 fi
9954
9955
9956 if test "$with_fortune" = no || test "$with_fortune" = yes ; then
9957   with_fortune=""
9958   with_fortune_req=""
9959 fi
9960
9961 if test -n "$with_fortune_req" ; then
9962   ac_cv_fortune_program=""
9963   case "$with_fortune_req" in
9964     /*)
9965
9966       set dummy $with_fortune_req ; fortune_tmp=$2
9967       echo $ac_n "checking for $fortune_tmp""... $ac_c" 1>&6
9968 echo "configure:9980: checking for $fortune_tmp" >&5
9969       if test -x "$fortune_tmp" ; then
9970         echo "$ac_t""yes" 1>&6
9971       else
9972         echo "$ac_t""no" 1>&6
9973         with_fortune=""
9974       fi
9975     ;;
9976     *)
9977       set dummy $with_fortune_req ; fortune_tmp=$2
9978       # don't cache
9979       unset ac_cv_path_fortune_tmp
9980       # Extract the first word of "$fortune_tmp", so it can be a program name with args.
9981 set dummy $fortune_tmp; ac_word=$2
9982 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
9983 echo "configure:9995: checking for $ac_word" >&5
9984 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
9985   echo $ac_n "(cached) $ac_c" 1>&6
9986 else
9987   case "$fortune_tmp" in
9988   /*)
9989   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
9990   ;;
9991   ?:/*)                  
9992   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
9993   ;;
9994   *)
9995   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
9996   ac_dummy="$PATH"
9997   for ac_dir in $ac_dummy; do 
9998     test -z "$ac_dir" && ac_dir=.
9999     if test -f $ac_dir/$ac_word; then
10000       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
10001       break
10002     fi
10003   done
10004   IFS="$ac_save_ifs"
10005   ;;
10006 esac
10007 fi
10008 fortune_tmp="$ac_cv_path_fortune_tmp"
10009 if test -n "$fortune_tmp"; then
10010   echo "$ac_t""$fortune_tmp" 1>&6
10011 else
10012   echo "$ac_t""no" 1>&6
10013 fi
10014
10015       if test -z "$fortune_tmp" ; then
10016         with_fortune=""
10017       fi
10018     ;;
10019   esac
10020   ac_cv_fortune_program="$with_fortune"
10021
10022 elif test -n "$ac_cv_fortune_program"; then
10023   echo "$ac_t""checking for fortune... (cached) $ac_cv_fortune_program" 1>&6
10024 fi
10025
10026 unset ac_cv_path_fortune_tmp
10027 unset fortune_tmp
10028
10029 if test -z "$ac_cv_fortune_program" ; then
10030
10031   # first look for fortune in /usr/games/ (and use absolute path)
10032   for ac_prog in fortune
10033 do
10034 # Extract the first word of "$ac_prog", so it can be a program name with args.
10035 set dummy $ac_prog; ac_word=$2
10036 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
10037 echo "configure:10049: checking for $ac_word" >&5
10038 if eval "test \"`echo '$''{'ac_cv_path_fortune_tmp'+set}'`\" = set"; then
10039   echo $ac_n "(cached) $ac_c" 1>&6
10040 else
10041   case "$fortune_tmp" in
10042   /*)
10043   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a path.
10044   ;;
10045   ?:/*)                  
10046   ac_cv_path_fortune_tmp="$fortune_tmp" # Let the user override the test with a dos path.
10047   ;;
10048   *)
10049   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
10050   ac_dummy=""/usr/games""
10051   for ac_dir in $ac_dummy; do 
10052     test -z "$ac_dir" && ac_dir=.
10053     if test -f $ac_dir/$ac_word; then
10054       ac_cv_path_fortune_tmp="$ac_dir/$ac_word"
10055       break
10056     fi
10057   done
10058   IFS="$ac_save_ifs"
10059   ;;
10060 esac
10061 fi
10062 fortune_tmp="$ac_cv_path_fortune_tmp"
10063 if test -n "$fortune_tmp"; then
10064   echo "$ac_t""$fortune_tmp" 1>&6
10065 else
10066   echo "$ac_t""no" 1>&6
10067 fi
10068
10069 test -n "$fortune_tmp" && break
10070 done
10071
10072
10073   # if it's not there, look on $PATH (and don't use absolute path)
10074   if test -z "$fortune_tmp" ; then
10075      for ac_prog in fortune
10076 do
10077 # Extract the first word of "$ac_prog", so it can be a program name with args.
10078 set dummy $ac_prog; ac_word=$2
10079 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
10080 echo "configure:10092: checking for $ac_word" >&5
10081 if eval "test \"`echo '$''{'ac_cv_prog_fortune_tmp'+set}'`\" = set"; then
10082   echo $ac_n "(cached) $ac_c" 1>&6
10083 else
10084   if test -n "$fortune_tmp"; then
10085   ac_cv_prog_fortune_tmp="$fortune_tmp" # Let the user override the test.
10086 else
10087   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
10088   ac_dummy="$PATH"
10089   for ac_dir in $ac_dummy; do
10090     test -z "$ac_dir" && ac_dir=.
10091     if test -f $ac_dir/$ac_word; then
10092       ac_cv_prog_fortune_tmp="$ac_prog"
10093       break
10094     fi
10095   done
10096   IFS="$ac_save_ifs"
10097 fi
10098 fi
10099 fortune_tmp="$ac_cv_prog_fortune_tmp"
10100 if test -n "$fortune_tmp"; then
10101   echo "$ac_t""$fortune_tmp" 1>&6
10102 else
10103   echo "$ac_t""no" 1>&6
10104 fi
10105
10106 test -n "$fortune_tmp" && break
10107 done
10108
10109   fi
10110
10111   # if we didn't find anything, then just assume /usr/games/
10112   if test -z "$fortune_tmp" ; then
10113      fortune_tmp="/usr/games/fortune"
10114   fi
10115
10116   ac_cv_fortune_program="$fortune_tmp"
10117
10118   # now check to see whether "fortune zippy" works.
10119   #
10120   fortune_tmp="$fortune_tmp zippy"
10121   echo $ac_n "checking for zippy quotes""... $ac_c" 1>&6
10122 echo "configure:10134: checking for zippy quotes" >&5
10123   if ( $fortune_tmp >/dev/null 2>&1 ); then
10124     ac_cv_fortune_program="$fortune_tmp"
10125     echo "$ac_t""$fortune_tmp" 1>&6
10126   else
10127     echo "$ac_t""no" 1>&6
10128   fi
10129
10130 fi
10131
10132 unset ac_cv_path_fortune_tmp
10133 unset fortune_tmp
10134
10135 cat >> confdefs.h <<EOF
10136 #define FORTUNE_PROGRAM "$ac_cv_fortune_program"
10137 EOF
10138
10139
10140
10141 ###############################################################################
10142 #
10143 #       Check whether it's ok to install some hacks as setuid (e.g., "sonar")
10144 #       This should be safe, but let's give people the option.
10145 #
10146 ###############################################################################
10147
10148 setuid_hacks_default=no
10149 setuid_hacks="$setuid_hacks_default"
10150 # Check whether --with-setuid-hacks or --without-setuid-hacks was given.
10151 if test "${with_setuid_hacks+set}" = set; then
10152   withval="$with_setuid_hacks"
10153   setuid_hacks="$withval"
10154 else
10155   setuid_hacks="$setuid_hacks_default"
10156 fi
10157
10158
10159
10160    case "$setuid_hacks" in
10161     yes) ;;
10162     no)  ;;
10163
10164     /*)
10165      echo $ac_n "checking for setuid hacks headers""... $ac_c" 1>&6
10166 echo "configure:10178: checking for setuid hacks headers" >&5
10167      d=$setuid_hacks/include
10168      if test -d $d; then
10169        X_CFLAGS="-I$d $X_CFLAGS"
10170        echo "$ac_t""$d" 1>&6
10171      else
10172        echo "$ac_t""not found ($d: no such directory)" 1>&6
10173      fi
10174
10175      echo $ac_n "checking for setuid hacks libs""... $ac_c" 1>&6
10176 echo "configure:10188: checking for setuid hacks libs" >&5
10177      d=$setuid_hacks/lib
10178      if test -d $d; then
10179        X_LIBS="-L$d $X_LIBS"
10180        echo "$ac_t""$d" 1>&6
10181      else
10182        echo "$ac_t""not found ($d: no such directory)" 1>&6
10183      fi
10184
10185      # replace the directory string with "yes".
10186      setuid_hacks_req="yes"
10187      setuid_hacks=$setuid_hacks_req
10188      ;;
10189
10190     *)
10191      echo ""
10192      echo "error: argument to --with-setuid-hacks must be \"yes\", \"no\", or a directory."
10193      echo "       If it is a directory, then \`DIR/include' will be added to"
10194      echo "       the -I list, and \`DIR/lib' will be added to the -L list."
10195      exit 1
10196      ;;
10197    esac
10198   
10199
10200 if test "$setuid_hacks" = yes; then
10201   true
10202 elif test "$setuid_hacks" != no; then
10203   echo "error: must be yes or no: --with-setuid-hacks=$setuid_hacks"
10204   exit 1
10205 fi
10206
10207
10208 ###############################################################################
10209 #
10210 #       Done testing.  Now, set up the various -I and -L variables,
10211 #       and decide which GUI program to build by default.
10212 #
10213 ###############################################################################
10214
10215 DEPEND=makedepend
10216 DEPEND_FLAGS=
10217 DEPEND_DEFINES=
10218
10219
10220 if test \! -z "$includedir" ; then 
10221   INCLUDES="$INCLUDES -I$includedir"
10222 fi
10223
10224 if test \! -z "$libdir" ; then
10225   LDFLAGS="$LDFLAGS -L$libdir"
10226 fi
10227
10228
10229 PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
10230 ALL_DEMO_PROGRAMS=
10231 if test "$have_motif" = yes; then
10232   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Xm
10233   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
10234 fi
10235 if test "$have_gtk" = yes; then
10236   PREFERRED_DEMO_PROGRAM=xscreensaver-demo-Gtk
10237   ALL_DEMO_PROGRAMS="$PREFERRED_DEMO_PROGRAM $ALL_DEMO_PROGRAMS"
10238 fi
10239
10240
10241 if test "$have_kerberos" = yes; then
10242   PASSWD_SRCS="$PASSWD_SRCS \$(KERBEROS_SRCS)"
10243   PASSWD_OBJS="$PASSWD_OBJS \$(KERBEROS_OBJS)"
10244 fi
10245 if test "$have_pam" = yes; then
10246   PASSWD_SRCS="$PASSWD_SRCS \$(PAM_SRCS)"
10247   PASSWD_OBJS="$PASSWD_OBJS \$(PAM_OBJS)"
10248   INSTALL_PAM="install-pam"
10249 fi
10250   PASSWD_SRCS="$PASSWD_SRCS \$(PWENT_SRCS)"
10251   PASSWD_OBJS="$PASSWD_OBJS \$(PWENT_OBJS)"
10252
10253
10254 if test "$enable_locking" = yes; then
10255   LOCK_SRCS='$(LOCK_SRCS_1) $(PASSWD_SRCS)'
10256   LOCK_OBJS='$(LOCK_OBJS_1) $(PASSWD_OBJS)'
10257 else
10258   LOCK_SRCS='$(NOLOCK_SRCS_1)'
10259   LOCK_OBJS='$(NOLOCK_OBJS_1)'
10260 fi
10261
10262 INSTALL_SETUID='$(INSTALL_PROGRAM) $(SUID_FLAGS)'
10263
10264 if test "$need_setuid" = yes; then
10265   NEED_SETUID=yes
10266 else
10267   NEED_SETUID=no
10268 fi
10269
10270 if test "$setuid_hacks" = yes; then
10271   SETUID_HACKS=yes
10272 else
10273   SETUID_HACKS=no
10274 fi
10275
10276 tab='   '
10277 if test "$have_gl" = yes; then
10278   GL_EXES='$(GL_EXES)'
10279   GL_UTIL_EXES='$(GL_UTIL_EXES)'
10280   GL_MEN='$(GL_MEN)'
10281   GL_KLUDGE="${tab}  "
10282 else
10283   GL_KLUDGE="-${tab}  "
10284 fi
10285
10286 if test "$have_gle" = yes; then
10287   GLE_EXES='$(GLE_EXES)'
10288   GLE_MEN='$(GLE_MEN)'
10289   GLE_KLUDGE="${tab}   "
10290 else
10291   GLE_KLUDGE="-${tab}   "
10292 fi
10293
10294 if test "$have_jpeg" = yes -a "$have_gdk_pixbuf" = yes; then
10295  JPEG_EXES='$(JPEG_EXES)'
10296 fi
10297
10298
10299 # Another substitution in the XScreenSaver.ad.in file:
10300 #
10301 if test "$have_gnome_help" = yes; then
10302   GNOMEHELP_Y=''
10303   GNOMEHELP_N='!    '
10304 else
10305   GNOMEHELP_Y='!    '
10306   GNOMEHELP_N=''
10307 fi
10308
10309
10310 # Now that we know whether we have Gnome, we can decide where the XML
10311 # config files get installed.
10312 if test -z "$HACK_CONF_DIR" ; then
10313   if test -n "$GNOME_DATADIR" ; then
10314     HACK_CONF_DIR='${GNOME_DATADIR}/control-center/screensavers'
10315   else
10316     HACK_CONF_DIR='${prefix}/lib/xscreensaver/config'
10317   fi
10318 fi
10319
10320 # canonicalize slashes.
10321 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
10322
10323
10324
10325 ###############################################################################
10326 #
10327 #       Perform substitutions and write Makefiles.
10328 #
10329 ###############################################################################
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376 APPDEFAULTS=$ac_x_app_defaults
10377
10378
10379
10380
10381
10382
10383
10384 trap '' 1 2 15
10385 cat > confcache <<\EOF
10386 # This file is a shell script that caches the results of configure
10387 # tests run on this system so they can be shared between configure
10388 # scripts and configure runs.  It is not useful on other systems.
10389 # If it contains results you don't want to keep, you may remove or edit it.
10390 #
10391 # By default, configure uses ./config.cache as the cache file,
10392 # creating it if it does not exist already.  You can give configure
10393 # the --cache-file=FILE option to use a different cache file; that is
10394 # what configure does when it calls configure scripts in
10395 # subdirectories, so they share the cache.
10396 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10397 # config.status only pays attention to the cache file if you give it the
10398 # --recheck option to rerun configure.
10399 #
10400 EOF
10401 # The following way of writing the cache mishandles newlines in values,
10402 # but we know of no workaround that is simple, portable, and efficient.
10403 # So, don't put newlines in cache variables' values.
10404 # Ultrix sh set writes to stderr and can't be redirected directly,
10405 # and sets the high bit in the cache file unless we assign to the vars.
10406 (set) 2>&1 |
10407   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10408   *ac_space=\ *)
10409     # `set' does not quote correctly, so add quotes (double-quote substitution
10410     # turns \\\\ into \\, and sed turns \\ into \).
10411     sed -n \
10412       -e "s/'/'\\\\''/g" \
10413       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10414     ;;
10415   *)
10416     # `set' quotes correctly as required by POSIX, so do not add quotes.
10417     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10418     ;;
10419   esac >> confcache
10420 if cmp -s $cache_file confcache; then
10421   :
10422 else
10423   if test -w $cache_file; then
10424     echo "updating cache $cache_file"
10425     cat confcache > $cache_file
10426   else
10427     echo "not updating unwritable cache $cache_file"
10428   fi
10429 fi
10430 rm -f confcache
10431
10432 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10433
10434 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10435 # Let make expand exec_prefix.
10436 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10437
10438 # Any assignment to VPATH causes Sun make to only execute
10439 # the first set of double-colon rules, so remove it if not needed.
10440 # If there is a colon in the path, we need to keep it.
10441 if test "x$srcdir" = x.; then
10442   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10443 fi
10444
10445 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10446
10447 DEFS=-DHAVE_CONFIG_H
10448
10449 # Without the "./", some shells look in PATH for config.status.
10450 : ${CONFIG_STATUS=./config.status}
10451
10452 echo creating $CONFIG_STATUS
10453 rm -f $CONFIG_STATUS
10454 cat > $CONFIG_STATUS <<EOF
10455 #! /bin/sh
10456 # Generated automatically by configure.
10457 # Run this file to recreate the current configuration.
10458 # This directory was configured as follows,
10459 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10460 #
10461 # $0 $ac_configure_args
10462 #
10463 # Compiler output produced by configure, useful for debugging
10464 # configure, is in ./config.log if it exists.
10465
10466 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10467 for ac_option
10468 do
10469   case "\$ac_option" in
10470   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10471     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10472     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10473   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10474     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10475     exit 0 ;;
10476   -help | --help | --hel | --he | --h)
10477     echo "\$ac_cs_usage"; exit 0 ;;
10478   *) echo "\$ac_cs_usage"; exit 1 ;;
10479   esac
10480 done
10481
10482 ac_given_srcdir=$srcdir
10483 ac_given_INSTALL="$INSTALL"
10484
10485 trap 'rm -fr `echo "Makefile
10486           utils/Makefile
10487           driver/Makefile
10488           hacks/Makefile
10489           hacks/glx/Makefile
10490           driver/XScreenSaver.ad config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10491 EOF
10492 cat >> $CONFIG_STATUS <<EOF
10493
10494 # Protect against being on the right side of a sed subst in config.status.
10495 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10496  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10497 $ac_vpsub
10498 $extrasub
10499 s%@SHELL@%$SHELL%g
10500 s%@CFLAGS@%$CFLAGS%g
10501 s%@CPPFLAGS@%$CPPFLAGS%g
10502 s%@CXXFLAGS@%$CXXFLAGS%g
10503 s%@FFLAGS@%$FFLAGS%g
10504 s%@DEFS@%$DEFS%g
10505 s%@LDFLAGS@%$LDFLAGS%g
10506 s%@LIBS@%$LIBS%g
10507 s%@exec_prefix@%$exec_prefix%g
10508 s%@prefix@%$prefix%g
10509 s%@program_transform_name@%$program_transform_name%g
10510 s%@bindir@%$bindir%g
10511 s%@sbindir@%$sbindir%g
10512 s%@libexecdir@%$libexecdir%g
10513 s%@datadir@%$datadir%g
10514 s%@sysconfdir@%$sysconfdir%g
10515 s%@sharedstatedir@%$sharedstatedir%g
10516 s%@localstatedir@%$localstatedir%g
10517 s%@libdir@%$libdir%g
10518 s%@includedir@%$includedir%g
10519 s%@oldincludedir@%$oldincludedir%g
10520 s%@infodir@%$infodir%g
10521 s%@mandir@%$mandir%g
10522 s%@host@%$host%g
10523 s%@host_alias@%$host_alias%g
10524 s%@host_cpu@%$host_cpu%g
10525 s%@host_vendor@%$host_vendor%g
10526 s%@host_os@%$host_os%g
10527 s%@CC@%$CC%g
10528 s%@CPP@%$CPP%g
10529 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10530 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10531 s%@INSTALL_DATA@%$INSTALL_DATA%g
10532 s%@SET_MAKE@%$SET_MAKE%g
10533 s%@PERL@%$PERL%g
10534 s%@X_CFLAGS@%$X_CFLAGS%g
10535 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
10536 s%@X_LIBS@%$X_LIBS%g
10537 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
10538 s%@glib_config@%$glib_config%g
10539 s%@gtk_config@%$gtk_config%g
10540 s%@gnome_config@%$gnome_config%g
10541 s%@have_gnome_help@%$have_gnome_help%g
10542 s%@fortune_tmp@%$fortune_tmp%g
10543 s%@INCLUDES@%$INCLUDES%g
10544 s%@PREFERRED_DEMO_PROGRAM@%$PREFERRED_DEMO_PROGRAM%g
10545 s%@ALL_DEMO_PROGRAMS@%$ALL_DEMO_PROGRAMS%g
10546 s%@SAVER_LIBS@%$SAVER_LIBS%g
10547 s%@MOTIF_LIBS@%$MOTIF_LIBS%g
10548 s%@GTK_LIBS@%$GTK_LIBS%g
10549 s%@XML_LIBS@%$XML_LIBS%g
10550 s%@JPEG_LIBS@%$JPEG_LIBS%g
10551 s%@HACK_LIBS@%$HACK_LIBS%g
10552 s%@XPM_LIBS@%$XPM_LIBS%g
10553 s%@GL_LIBS@%$GL_LIBS%g
10554 s%@GLE_LIBS@%$GLE_LIBS%g
10555 s%@XDPMS_LIBS@%$XDPMS_LIBS%g
10556 s%@PASSWD_LIBS@%$PASSWD_LIBS%g
10557 s%@INSTALL_SETUID@%$INSTALL_SETUID%g
10558 s%@SETUID_HACKS@%$SETUID_HACKS%g
10559 s%@INSTALL_DIRS@%$INSTALL_DIRS%g
10560 s%@NEED_SETUID@%$NEED_SETUID%g
10561 s%@INSTALL_PAM@%$INSTALL_PAM%g
10562 s%@PASSWD_SRCS@%$PASSWD_SRCS%g
10563 s%@PASSWD_OBJS@%$PASSWD_OBJS%g
10564 s%@XMU_SRCS@%$XMU_SRCS%g
10565 s%@XMU_OBJS@%$XMU_OBJS%g
10566 s%@XMU_LIBS@%$XMU_LIBS%g
10567 s%@SAVER_GL_SRCS@%$SAVER_GL_SRCS%g
10568 s%@SAVER_GL_OBJS@%$SAVER_GL_OBJS%g
10569 s%@SAVER_GL_LIBS@%$SAVER_GL_LIBS%g
10570 s%@LOCK_SRCS@%$LOCK_SRCS%g
10571 s%@LOCK_OBJS@%$LOCK_OBJS%g
10572 s%@JPEG_EXES@%$JPEG_EXES%g
10573 s%@GL_EXES@%$GL_EXES%g
10574 s%@GL_UTIL_EXES@%$GL_UTIL_EXES%g
10575 s%@GL_MEN@%$GL_MEN%g
10576 s%@GL_KLUDGE@%$GL_KLUDGE%g
10577 s%@GLE_EXES@%$GLE_EXES%g
10578 s%@GLE_MEN@%$GLE_MEN%g
10579 s%@GLE_KLUDGE@%$GLE_KLUDGE%g
10580 s%@GNOMEHELP_Y@%$GNOMEHELP_Y%g
10581 s%@GNOMEHELP_N@%$GNOMEHELP_N%g
10582 s%@HACKDIR@%$HACKDIR%g
10583 s%@GNOME_DATADIR@%$GNOME_DATADIR%g
10584 s%@HACK_CONF_DIR@%$HACK_CONF_DIR%g
10585 s%@APPDEFAULTS@%$APPDEFAULTS%g
10586 s%@DEPEND@%$DEPEND%g
10587 s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
10588 s%@DEPEND_DEFINES@%$DEPEND_DEFINES%g
10589
10590 CEOF
10591 EOF
10592
10593 cat >> $CONFIG_STATUS <<\EOF
10594
10595 # Split the substitutions into bite-sized pieces for seds with
10596 # small command number limits, like on Digital OSF/1 and HP-UX.
10597 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10598 ac_file=1 # Number of current file.
10599 ac_beg=1 # First line for current file.
10600 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10601 ac_more_lines=:
10602 ac_sed_cmds=""
10603 while $ac_more_lines; do
10604   if test $ac_beg -gt 1; then
10605     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10606   else
10607     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10608   fi
10609   if test ! -s conftest.s$ac_file; then
10610     ac_more_lines=false
10611     rm -f conftest.s$ac_file
10612   else
10613     if test -z "$ac_sed_cmds"; then
10614       ac_sed_cmds="sed -f conftest.s$ac_file"
10615     else
10616       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10617     fi
10618     ac_file=`expr $ac_file + 1`
10619     ac_beg=$ac_end
10620     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10621   fi
10622 done
10623 if test -z "$ac_sed_cmds"; then
10624   ac_sed_cmds=cat
10625 fi
10626 EOF
10627
10628 cat >> $CONFIG_STATUS <<EOF
10629
10630 CONFIG_FILES=\${CONFIG_FILES-"Makefile
10631           utils/Makefile
10632           driver/Makefile
10633           hacks/Makefile
10634           hacks/glx/Makefile
10635           driver/XScreenSaver.ad"}
10636 EOF
10637 cat >> $CONFIG_STATUS <<\EOF
10638 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10639   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10640   case "$ac_file" in
10641   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10642        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10643   *) ac_file_in="${ac_file}.in" ;;
10644   esac
10645
10646   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10647
10648   # Remove last slash and all that follows it.  Not all systems have dirname.
10649   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10650   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10651     # The file is in a subdirectory.
10652     test ! -d "$ac_dir" && mkdir "$ac_dir"
10653     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10654     # A "../" for each directory in $ac_dir_suffix.
10655     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10656   else
10657     ac_dir_suffix= ac_dots=
10658   fi
10659
10660   case "$ac_given_srcdir" in
10661   .)  srcdir=.
10662       if test -z "$ac_dots"; then top_srcdir=.
10663       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10664   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10665   *) # Relative path.
10666     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10667     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10668   esac
10669
10670   case "$ac_given_INSTALL" in
10671   [/$]*) INSTALL="$ac_given_INSTALL" ;;
10672   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10673   esac
10674
10675   echo creating "$ac_file"
10676   rm -f "$ac_file"
10677   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10678   case "$ac_file" in
10679   *Makefile*) ac_comsub="1i\\
10680 # $configure_input" ;;
10681   *) ac_comsub= ;;
10682   esac
10683
10684   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10685   sed -e "$ac_comsub
10686 s%@configure_input@%$configure_input%g
10687 s%@srcdir@%$srcdir%g
10688 s%@top_srcdir@%$top_srcdir%g
10689 s%@INSTALL@%$INSTALL%g
10690 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10691 fi; done
10692 rm -f conftest.s*
10693
10694 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10695 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10696 #
10697 # ac_d sets the value in "#define NAME VALUE" lines.
10698 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10699 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10700 ac_dC='\3'
10701 ac_dD='%g'
10702 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10703 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10704 ac_uB='\([      ]\)%\1#\2define\3'
10705 ac_uC=' '
10706 ac_uD='\4%g'
10707 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10708 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10709 ac_eB='$%\1#\2define\3'
10710 ac_eC=' '
10711 ac_eD='%g'
10712
10713 if test "${CONFIG_HEADERS+set}" != set; then
10714 EOF
10715 cat >> $CONFIG_STATUS <<EOF
10716   CONFIG_HEADERS="config.h"
10717 EOF
10718 cat >> $CONFIG_STATUS <<\EOF
10719 fi
10720 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10721   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10722   case "$ac_file" in
10723   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10724        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10725   *) ac_file_in="${ac_file}.in" ;;
10726   esac
10727
10728   echo creating $ac_file
10729
10730   rm -f conftest.frag conftest.in conftest.out
10731   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10732   cat $ac_file_inputs > conftest.in
10733
10734 EOF
10735
10736 # Transform confdefs.h into a sed script conftest.vals that substitutes
10737 # the proper values into config.h.in to produce config.h.  And first:
10738 # Protect against being on the right side of a sed subst in config.status.
10739 # Protect against being in an unquoted here document in config.status.
10740 rm -f conftest.vals
10741 cat > conftest.hdr <<\EOF
10742 s/[\\&%]/\\&/g
10743 s%[\\$`]%\\&%g
10744 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10745 s%ac_d%ac_u%gp
10746 s%ac_u%ac_e%gp
10747 EOF
10748 sed -n -f conftest.hdr confdefs.h > conftest.vals
10749 rm -f conftest.hdr
10750
10751 # This sed command replaces #undef with comments.  This is necessary, for
10752 # example, in the case of _POSIX_SOURCE, which is predefined and required
10753 # on some systems where configure will not decide to define it.
10754 cat >> conftest.vals <<\EOF
10755 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10756 EOF
10757
10758 # Break up conftest.vals because some shells have a limit on
10759 # the size of here documents, and old seds have small limits too.
10760
10761 rm -f conftest.tail
10762 while :
10763 do
10764   ac_lines=`grep -c . conftest.vals`
10765   # grep -c gives empty output for an empty file on some AIX systems.
10766   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10767   # Write a limited-size here document to conftest.frag.
10768   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10769   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10770   echo 'CEOF
10771   sed -f conftest.frag conftest.in > conftest.out
10772   rm -f conftest.in
10773   mv conftest.out conftest.in
10774 ' >> $CONFIG_STATUS
10775   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10776   rm -f conftest.vals
10777   mv conftest.tail conftest.vals
10778 done
10779 rm -f conftest.vals
10780
10781 cat >> $CONFIG_STATUS <<\EOF
10782   rm -f conftest.frag conftest.h
10783   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10784   cat conftest.in >> conftest.h
10785   rm -f conftest.in
10786   if cmp -s $ac_file conftest.h 2>/dev/null; then
10787     echo "$ac_file is unchanged"
10788     rm -f conftest.h
10789   else
10790     # Remove last slash and all that follows it.  Not all systems have dirname.
10791       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10792       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10793       # The file is in a subdirectory.
10794       test ! -d "$ac_dir" && mkdir "$ac_dir"
10795     fi
10796     rm -f $ac_file
10797     mv conftest.h $ac_file
10798   fi
10799 fi; done
10800
10801 EOF
10802 cat >> $CONFIG_STATUS <<EOF
10803
10804 EOF
10805 cat >> $CONFIG_STATUS <<\EOF
10806
10807 exit 0
10808 EOF
10809 chmod +x $CONFIG_STATUS
10810 rm -fr confdefs* $ac_clean_files
10811 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10812
10813
10814 ###############################################################################
10815 #
10816 #       Print some warnings at the end.
10817 #
10818 ###############################################################################
10819
10820 warn_prefix_1="    Warning:"
10821 warn_prefix_2="       Note:"
10822 warn_prefix="$warn_prefix_1"
10823
10824 warning=no
10825 warnsep='    #################################################################'
10826
10827 warnpre() {
10828   if test "$warning" = no ; then
10829     echo '' ; echo "$warnsep" ; echo ''
10830     warning=yes
10831   fi
10832 }
10833
10834 warn() {
10835   warnpre
10836   if test "$warning" = long ; then echo '' ; fi
10837   warning=yes
10838   rest="$@"
10839   echo "$warn_prefix $rest"
10840 }
10841
10842 warnL() {
10843   was=$warning
10844   warnpre
10845   warning=yes
10846   if test "$was" != no ; then echo '' ; fi
10847   rest="$@"
10848   echo "$warn_prefix $rest"
10849 }
10850
10851 warn2() {
10852   rest="$@"
10853   echo "             $rest"
10854   warning=long
10855 }
10856
10857 note() {
10858   warn_prefix="$warn_prefix_2"
10859   warn $@
10860   warn_prefix="$warn_prefix_1"
10861 }
10862
10863 noteL() {
10864   warn_prefix="$warn_prefix_2"
10865   warnL $@
10866   warn_prefix="$warn_prefix_1"
10867 }
10868
10869
10870 if test "$with_sgi_req" = yes -a "$have_sgi" = no ; then
10871   warn 'The SGI saver extension was requested, but was not found.'
10872 fi
10873
10874 if test "$with_mit_req" = yes -a "$have_mit" = no ; then
10875   warn 'The MIT saver extension was requested, but was not found.'
10876 fi
10877
10878 if test "$with_xidle_req" = yes -a "$have_xidle" = no ; then
10879   warn 'The XIdle extension was requested, but was not found.'
10880 fi
10881
10882 if test "$with_xshm_req" = yes -a "$have_xshm" = no ; then
10883   warn 'The XSHM extension was requested, but was not found.'
10884 fi
10885
10886 if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
10887   warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
10888 fi
10889
10890 if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
10891   warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
10892 fi
10893
10894 if test "$with_dpms_req" = yes -a "$have_dpms" = no ; then
10895   warn 'The DPMS extension was requested, but was not found.'
10896 fi
10897
10898 if test "$with_xinerama_req" = yes -a "$have_xinerama" = no ; then
10899   warn 'The Xinerama extension was requested, but was not found.'
10900 fi
10901
10902 if test "$with_xf86vmode_req" = yes -a "$have_xf86vmode" = no ; then
10903   warn 'The XF86VMODE extension was requested, but was not found.'
10904 fi
10905
10906 if test "$with_proc_interrupts_req" = yes -a "$have_proc_interrupts" = no; then
10907   warn "Checking of /proc/interrupts was requested, but it's bogus."
10908 fi
10909
10910
10911 if test "$have_motif" = no -a "$have_gtk" = no; then
10912   warnL "Neither Motif nor Gtk seem to be available;"
10913   warn2 "the \`xscreensaver-demo' program requires one of these."
10914
10915 elif test "$with_motif_req" = yes -a "$have_motif" = no ; then
10916   warnL "Use of Motif was requested, but it wasn't found;"
10917   warn2 "Gtk will be used instead."
10918
10919 elif test "$jurassic_gtk" = yes ; then
10920
10921   pref_gtk=1.2
10922
10923   v="$ac_gtk_version_string"
10924   if test "$with_gtk_req" = yes -a "$ac_gtk_version" = "unknown" ; then
10925     warnL "Use of Gtk was requested, but its version number is unknown;"
10926   elif test "$with_gtk_req" = yes ; then
10927     warnL "Use of Gtk was requested, but it is version $v;"
10928   else
10929     warnL "Gtk was found on this system, but it is version $v;"
10930   fi
10931
10932   warn2 "Gtk $pref_gtk or newer is required.  Motif will be used instead."
10933
10934 elif test "$with_gtk_req" = yes -a "$have_gtk" = no ; then
10935   warnL "Use of Gtk was requested, but it wasn't found;"
10936   warn2 "Motif will be used instead."
10937
10938 fi
10939
10940
10941 if test "$with_gnome_req" = yes -a "$have_gnome" = no ; then
10942   warn  'Use of the Gnome Control Panel was requested, but the necessary'
10943   warn2 'headers and/or libraries were not found.'
10944 fi
10945
10946 if test "$have_gtk" = yes ; then
10947   if test "$have_xml" = no ; then
10948     if test "$with_xml_req" = yes ; then
10949       warn  'Use of the XML library was requested, but the necessary'
10950       warn2 'headers and/or libraries were not found.'
10951     else
10952       warn  'GTK is being used, but the XML library was not found.'
10953     fi
10954
10955     if test "$xml_halfassed" = yes ; then
10956       echo ''
10957       warn2 'More specifically, we found the headers, but not the'
10958       warn2 'libraries; so either XML is half-installed on this'
10959       warn2 "system, or something else went wrong.  The \`config.log'"
10960       warn2 'file might contain some clues.'
10961     fi
10962
10963     echo ''
10964     warn2 "Without XML, the per-display-mode \`Settings' dialogs"
10965     warn2 'will not be available.  Specify the location of the XML'
10966     warn2 'library through the --with-xml option to configure.'
10967   fi
10968 fi
10969
10970 if test "$have_motif" = yes -a "$have_lesstif" = yes ; then
10971
10972   preferred_lesstif=0.92
10973
10974   if test "$lesstif_version" = unknown; then
10975     warnL "Unable to determine the LessTif version number!"
10976     warn2 "Make sure you are using version $preferred_lesstif or newer."
10977     warn2 "See <http://www.lesstif.org/>."
10978
10979   elif test \! $lesstif_version -gt 82; then
10980     warnL "LessTif version $lesstif_version_string is being used."
10981     warn2 "LessTif versions 0.82 and earlier are too buggy to"
10982     warn2 "use with XScreenSaver; it is strongly recommended"
10983     warn2 "that you upgrade to at least version $preferred_lesstif!"
10984     warn2 "See <http://www.lesstif.org/>."
10985   fi
10986 fi
10987
10988
10989 if test "$have_motif" = yes -a "$have_gtk" = no ; then
10990   warn  'Motif is being used, and GTK is not.'
10991   echo  ''
10992   warn2 'Though the Motif front-end to xscreensaver is still'
10993   warn2 'maintained, it is no longer being updated with new'
10994   warn2 'features: all new development on the xscreensaver-demo'
10995   warn2 'program is happening in the GTK version, and not in the'
10996   warn2 'Motif version.  It is recommended that you build against'
10997   warn2 'GTK instead of Motif.  See <http://www.gtk.org/>.'
10998 fi
10999
11000
11001 if test "$with_xpm_req" = yes ; then
11002   warnL 'Use of XPM was requested, but it was not found.'
11003 fi
11004
11005 if test "$with_gdk_pixbuf_req" = yes ; then
11006   warnL 'Use of GDK-Pixbuf was requested, but it was not found.'
11007 fi
11008
11009 if test "$have_xpm" = no -a "$have_gdk_pixbuf" = no; then
11010
11011   if test "$with_xpm_req" = yes ; then
11012     true
11013   elif test "$with_xpm_req" = no ; then
11014     warnL 'The XPM library is not being used.'
11015   else
11016     warnL 'The XPM library was not found.'
11017   fi
11018
11019   if test "$with_gdk_pixbuf_req" = yes ; then
11020     true
11021   elif test "$with_gdk_pixbuf_req" = no ; then
11022     warnL 'The GDK-Pixbuf library is not being used.'
11023   else
11024     warnL 'The GDK-Pixbuf library was not found.'
11025   fi
11026
11027   echo ''
11028   warn2 'Some of the demos will not be as colorful as they'
11029   warn2 'could be.  You should consider installing Pixbuf or'
11030   warn2 'XPM and re-running configure.  (Remember to delete'
11031   warn2 'the config.cache file first.)  The Pixbuf library is'
11032   warn2 'a part of GNOME.  The XPM library comes with most'
11033   warn2 'X11 installations; you can also find it at the X11'
11034   warn2 'archive sites, such as <http://sunsite.unc.edu/>.'
11035   echo  ''
11036   warn2 'GDK-Pixbuf is recommended over XPM, as it provides'
11037   warn2 'support for more image formats.'
11038 fi
11039
11040
11041 if test "$have_jpeg" = no ; then
11042   if test "$with_jpeg_req" = yes ; then
11043     warnL 'Use of libjpeg was requested, but it was not found.'
11044   elif test "$with_jpeg_req" = no ; then
11045     noteL 'The JPEG library is not being used.'
11046   else
11047     noteL 'The JPEG library was not found.'
11048   fi
11049
11050   if test "$jpeg_halfassed" = yes ; then
11051     echo ''
11052     warn2 'More specifically, we found the headers, but not the'
11053     warn2 'library; so either JPEG is half-installed on this'
11054     warn2 "system, or something else went wrong.  The \`config.log'"
11055     warn2 'file might contain some clues.'
11056     echo ''
11057   fi
11058
11059   warn2 "This means the \`webcollage' program will be much slower."
11060 fi
11061
11062
11063 if test "$have_gl" = yes -a "$ac_have_mesa_gl" = yes ; then
11064   preferred_mesagl=3.4
11065   mgv="$ac_mesagl_version_string"
11066   pgl="$preferred_mesagl"
11067
11068   if test "$ac_mesagl_version" = unknown; then
11069     warnL "Unable to determine the MesaGL version number!"
11070     warn2 "Make sure you are using version $preferred_mesagl or newer."
11071
11072   elif test \! "$ac_mesagl_version" -gt 2006; then
11073     warnL "MesaGL version $mgv is being used.  MesaGL 2.6 and earlier"
11074     warn2 "have a security bug.  It is strongly recommended that you"
11075     warn2 "upgrade to at least version $preferred_mesagl."
11076
11077   elif test \! "$ac_mesagl_version" -gt 3003; then
11078     warnL "MesaGL version $mgv is being used.  That version has some"
11079     warn2 "bugs; it is recommended that you upgrade to $pgl or newer."
11080   fi
11081 fi
11082
11083 if test "$have_gl" = no ; then
11084   if test "$with_gl_req" = yes ; then
11085     warnL 'Use of GL was requested, but it was not found.'
11086   elif test "$with_gl_req" = no ; then
11087     noteL 'The OpenGL 3D library is not being used.'
11088   else
11089     noteL 'The OpenGL 3D library was not found.'
11090   fi
11091
11092   if test "$gl_halfassed" = yes ; then
11093     echo ''
11094     warn2 'More specifically, we found the headers, but not the'
11095     warn2 'libraries; so either GL is half-installed on this'
11096     warn2 "system, or something else went wrong.  The \`config.log'"
11097     warn2 'file might contain some clues.'
11098   fi
11099
11100   echo ''
11101   warn2 'Those demos which use 3D will not be built or installed.'
11102   warn2 'You might want to consider installing OpenGL and'
11103   warn2 're-running configure.  (Remember to delete the'
11104   warn2 "config.cache file first.)  If your vendor doesn't ship"
11105   warn2 'their own implementation of OpenGL, you can get a free'
11106   warn2 'version at <http://www.mesa3d.org/>.  For general OpenGL'
11107   warn2 'info, see <http://www.opengl.org/>.'
11108
11109 fi
11110
11111
11112 if test "$have_gl" = yes -a "$have_gle" = no ; then
11113   if test "$with_gle_req" = yes ; then
11114     noteL 'Use of the GLE (GL Extrusion) library was requested, but'
11115     warn2 'it was not found (though the OpenGL library was found, and'
11116     warn2 'is being used.)'
11117   elif test "$with_gle_req" = no ; then
11118     noteL 'The OpenGL Library is being used, but the GLE (GL Extrusion)'
11119     warn2 'library is not.'
11120   else
11121     noteL 'The OpenGL Library was found, but the GLE (GL Extrusion)'
11122     warn2 'was not.'
11123   fi
11124
11125   if test "$gle_halfassed" = yes ; then
11126     echo ''
11127     warn2 'More specifically, we found the headers, but not the'
11128     warn2 'libraries; so either GLE is half-installed on this'
11129     warn2 "system, or something else went wrong.  The \`config.log'"
11130     warn2 'file might contain some clues.'
11131   fi
11132
11133   echo ''
11134   warn2 'Some of the OpenGL (3D) demos (those that depend on GLE)'
11135   warn2 'will not be built or installed.  You might want to consider'
11136   warn2 'installing GLE and re-running configure.  (Remember to delete'
11137   warn2 'the config.cache file first.)  You can find the GLE library'
11138   warn2 'at <http://www.linas.org/gle/>.  For general OpenGL info,'
11139   warn2 'see <http://www.opengl.org/>.'
11140
11141 fi
11142
11143
11144 if test "$with_readdisplay_req" = yes -a "$have_readdisplay" = no ; then
11145   warn 'Use of XReadDisplay was requested, but it was not found.'
11146 fi
11147
11148 if test -n "$with_fortune_req"; then
11149   if test "$with_fortune_req" != "$ac_cv_fortune_program" ; then
11150     warnL "$with_fortune_req was requested as the Fortune program,"
11151     warn2 "but was not found.  The default will be used instead."
11152   fi
11153 fi
11154
11155 if test "$with_kerberos_req" = yes -a "$have_kerberos" = no ; then
11156   warn 'Use of Kerberos was requested, but it was not found.'
11157 fi
11158
11159 if test "$with_pam_req" = yes -a "$have_pam" = no ; then
11160   warn 'Use of PAM was requested, but it was not found.'
11161 fi
11162
11163 if test "$with_shadow_req" = yes -a "$have_shadow" = no ; then
11164   warn 'Use of shadow passwords was requested, but they were not found.'
11165 fi
11166
11167
11168 # You are in a twisty maze of namespaces and syntaxes, all alike.
11169 # Fuck the skull of Unix.
11170 #
11171 eval bindir=${bindir}
11172 eval bindir=${bindir}
11173 eval bindir=${bindir}
11174 eval bindir=${bindir}
11175 eval bindir=${bindir}
11176 eval bindir=${bindir}
11177 eval HACKDIR=${HACKDIR}
11178 eval HACKDIR=${HACKDIR}
11179 eval HACKDIR=${HACKDIR}
11180 eval HACKDIR=${HACKDIR}
11181 eval HACKDIR=${HACKDIR}
11182 eval HACKDIR=${HACKDIR}
11183 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11184 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11185 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11186 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11187 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11188 eval HACK_CONF_DIR=${HACK_CONF_DIR}
11189
11190 # canonicalize slashes.
11191 bindir=`echo  "${bindir}"              | sed 's@/$@@;s@//*@/@g'`
11192 HACKDIR=`echo "${HACKDIR}"             | sed 's@/$@@;s@//*@/@g'`
11193 HACK_CONF_DIR=`echo "${HACK_CONF_DIR}" | sed 's@/$@@;s@//*@/@g'`
11194
11195
11196 # Sanity check the hackdir
11197 for bad_choice in xscreensaver xscreensaver-demo xscreensaver-command ; do
11198   if test "${HACKDIR}" = "${bindir}/${bad_choice}" ; then
11199     echo ""
11200     { echo "configure: error: \"--with-hackdir=${bindir}/${bad_choice}\" won't work.
11201                    There will be an executable installed with that name, so
11202                    that can't be the name of a directory as well.  Please
11203                    re-configure with a different directory name." 1>&2; exit 1; }
11204   fi
11205 done
11206
11207
11208 do_dir_warning=no
11209
11210 # Now let's see if there's a previous RPM version already installed.  Blargh!
11211
11212 # M4 sucks!!
11213
11214 rpmv=`(rpm -qv xscreensaver) 2>&- | \
11215       sed -n 's/^xscreensaver-\([0-9][0-9]*[.][0-9][0-9]*\)-.*$/\1/p'`
11216
11217
11218 if test \! -z "$rpmv" ; then
11219   rpmbdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/xscreensaver-demo$@\1@p'`
11220   rpmhdir=`rpm -ql xscreensaver | sed -n 's@^\(.*\)/attraction$@\1@p'`
11221
11222   warning=no
11223   warnL "There is already an installed RPM of xscreensaver $rpmv"
11224   warn2 "on this system.  You might want to remove it (with"
11225   warn2 '"rpm -ve xscreensaver") before running "make install"'
11226   warn2 "from this directory."
11227   echo ""
11228   warn2 "Alternately, you could build this version of xscreensaver"
11229   warn2 'as an RPM, and then install that.  An "xscreensaver.spec"'
11230   warn2 "file is included.  See the RPM documentation for more info."
11231   echo ""
11232
11233   if test "$rpmbdir" = "$rpmhdir" ; then
11234     warn2 "The RPM version was installed in $rpmbdir/."
11235   else
11236     warn2 "The RPM version was installed in $rpmbdir/,"
11237     warn2 "with demos in $rpmhdir/."
11238   fi
11239
11240   do_dir_warning=yes
11241 fi
11242
11243
11244 if test "${bindir}" = "${HACKDIR}" ; then
11245   do_dir_warning=yes
11246 fi
11247
11248 if test "$do_dir_warning" = yes; then
11249   echo ""
11250   echo "$warnsep"
11251   echo ""
11252   echo '      When you run "make install", the "xscreensaver",'
11253   echo '      "xscreensaver-demo", and "xscreensaver-command" executables'
11254   echo "      will be installed in ${bindir}/."
11255   echo ""
11256   echo "      The various graphics demos (140+ different executables) will"
11257   echo "      also be installed in ${HACKDIR}/."
11258   echo ""
11259   echo "      If you would prefer the demos to be installed elsewhere"
11260   echo "      (for example, in a dedicated directory) you should re-run"
11261   echo "      configure with the --with-hackdir=DIR option.  For more"
11262   echo "      information, run $0 --help."
11263   warning=yes
11264 fi
11265
11266 if test "$warning" != no; then
11267   echo '' ; echo "$warnsep" ; echo ''
11268 fi
11269
11270 if test "$do_dir_warning" = no; then
11271   if test "$warning" = no; then
11272     echo ''
11273   fi
11274   echo "User programs will be installed in ${bindir}/"
11275   echo "Screen savers will be installed in ${HACKDIR}/"
11276   echo "Configuration will be installed in ${HACK_CONF_DIR}/"
11277   echo ''
11278 fi