source: trunk/third/xscreensaver/configure @ 12810

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