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