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