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