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