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