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