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