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