root/rat/trunk/configure @ 2988

Revision 2988, 114.8 KB (checked in by ucacoxh, 15 years ago)

XXX DO NOT UPDATE YET XXX
- Check pointing steps in configure changes.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
4# Generated automatically using autoconf version 2.13
5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
10# Defaults:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
15  --with-sun-audio=DIR    specify Sun audio support home"
16ac_help="$ac_help
17  --with-osprey=DIR       specify Osprey (Sunvideo Plus PCI) support home"
18ac_help="$ac_help
19  --with-x                use the X Window System"
20ac_help="$ac_help
21  --with-tcl=DIR          specify location of Tcl installation"
22ac_help="$ac_help
23  --with-tk=DIR           specify location of Tk installation"
24ac_help="$ac_help
25  --with-common=DIR       specify location of UCL's common library"
26ac_help="$ac_help
27  --enable-profile        enable profiling"
28ac_help="$ac_help
29  --enable-bounds         enable bounds checking"
30ac_help="$ac_help
31  --enable-debug          enable debug messages and code"
32ac_help="$ac_help
33  --enable-debug-mem      enable memory debugging code"
34
35# Initialize some variables set by options.
36# The variables have the same names as the options, with
37# dashes changed to underlines.
38build=NONE
39cache_file=./config.cache
40exec_prefix=NONE
41host=NONE
42no_create=
43nonopt=NONE
44no_recursion=
45prefix=NONE
46program_prefix=NONE
47program_suffix=NONE
48program_transform_name=s,x,x,
49silent=
50site=
51srcdir=
52target=NONE
53verbose=
54x_includes=NONE
55x_libraries=NONE
56bindir='${exec_prefix}/bin'
57sbindir='${exec_prefix}/sbin'
58libexecdir='${exec_prefix}/libexec'
59datadir='${prefix}/share'
60sysconfdir='${prefix}/etc'
61sharedstatedir='${prefix}/com'
62localstatedir='${prefix}/var'
63libdir='${exec_prefix}/lib'
64includedir='${prefix}/include'
65oldincludedir='/usr/include'
66infodir='${prefix}/info'
67mandir='${prefix}/man'
68
69# Initialize some other variables.
70subdirs=
71MFLAGS= MAKEFLAGS=
72SHELL=${CONFIG_SHELL-/bin/sh}
73# Maximum number of lines to put in a shell here document.
74ac_max_here_lines=12
75
76ac_prev=
77for ac_option
78do
79
80  # If the previous option needs an argument, assign it.
81  if test -n "$ac_prev"; then
82    eval "$ac_prev=\$ac_option"
83    ac_prev=
84    continue
85  fi
86
87  case "$ac_option" in
88  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
89  *) ac_optarg= ;;
90  esac
91
92  # Accept the important Cygnus configure options, so we can diagnose typos.
93
94  case "$ac_option" in
95
96  -bindir | --bindir | --bindi | --bind | --bin | --bi)
97    ac_prev=bindir ;;
98  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
99    bindir="$ac_optarg" ;;
100
101  -build | --build | --buil | --bui | --bu)
102    ac_prev=build ;;
103  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
104    build="$ac_optarg" ;;
105
106  -cache-file | --cache-file | --cache-fil | --cache-fi \
107  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
108    ac_prev=cache_file ;;
109  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
110  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
111    cache_file="$ac_optarg" ;;
112
113  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
114    ac_prev=datadir ;;
115  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
116  | --da=*)
117    datadir="$ac_optarg" ;;
118
119  -disable-* | --disable-*)
120    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
121    # Reject names that are not valid shell variable names.
122    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
123      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
124    fi
125    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
126    eval "enable_${ac_feature}=no" ;;
127
128  -enable-* | --enable-*)
129    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
130    # Reject names that are not valid shell variable names.
131    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
132      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
133    fi
134    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
135    case "$ac_option" in
136      *=*) ;;
137      *) ac_optarg=yes ;;
138    esac
139    eval "enable_${ac_feature}='$ac_optarg'" ;;
140
141  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
142  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
143  | --exec | --exe | --ex)
144    ac_prev=exec_prefix ;;
145  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
146  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
147  | --exec=* | --exe=* | --ex=*)
148    exec_prefix="$ac_optarg" ;;
149
150  -gas | --gas | --ga | --g)
151    # Obsolete; use --with-gas.
152    with_gas=yes ;;
153
154  -help | --help | --hel | --he)
155    # Omit some internal or obsolete options to make the list less imposing.
156    # This message is too long to be a string in the A/UX 3.1 sh.
157    cat << EOF
158Usage: configure [options] [host]
159Options: [defaults in brackets after descriptions]
160Configuration:
161  --cache-file=FILE       cache test results in FILE
162  --help                  print this message
163  --no-create             do not create output files
164  --quiet, --silent       do not print \`checking...' messages
165  --version               print the version of autoconf that created configure
166Directory and file names:
167  --prefix=PREFIX         install architecture-independent files in PREFIX
168                          [$ac_default_prefix]
169  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
170                          [same as prefix]
171  --bindir=DIR            user executables in DIR [EPREFIX/bin]
172  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
173  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
174  --datadir=DIR           read-only architecture-independent data in DIR
175                          [PREFIX/share]
176  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
177  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
178                          [PREFIX/com]
179  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
180  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
181  --includedir=DIR        C header files in DIR [PREFIX/include]
182  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
183  --infodir=DIR           info documentation in DIR [PREFIX/info]
184  --mandir=DIR            man documentation in DIR [PREFIX/man]
185  --srcdir=DIR            find the sources in DIR [configure dir or ..]
186  --program-prefix=PREFIX prepend PREFIX to installed program names
187  --program-suffix=SUFFIX append SUFFIX to installed program names
188  --program-transform-name=PROGRAM
189                          run sed PROGRAM on installed program names
190EOF
191    cat << EOF
192Host type:
193  --build=BUILD           configure for building on BUILD [BUILD=HOST]
194  --host=HOST             configure for HOST [guessed]
195  --target=TARGET         configure for TARGET [TARGET=HOST]
196Features and packages:
197  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
198  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
199  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
200  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
201  --x-includes=DIR        X include files are in DIR
202  --x-libraries=DIR       X library files are in DIR
203EOF
204    if test -n "$ac_help"; then
205      echo "--enable and --with options recognized:$ac_help"
206    fi
207    exit 0 ;;
208
209  -host | --host | --hos | --ho)
210    ac_prev=host ;;
211  -host=* | --host=* | --hos=* | --ho=*)
212    host="$ac_optarg" ;;
213
214  -includedir | --includedir | --includedi | --included | --include \
215  | --includ | --inclu | --incl | --inc)
216    ac_prev=includedir ;;
217  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
218  | --includ=* | --inclu=* | --incl=* | --inc=*)
219    includedir="$ac_optarg" ;;
220
221  -infodir | --infodir | --infodi | --infod | --info | --inf)
222    ac_prev=infodir ;;
223  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
224    infodir="$ac_optarg" ;;
225
226  -libdir | --libdir | --libdi | --libd)
227    ac_prev=libdir ;;
228  -libdir=* | --libdir=* | --libdi=* | --libd=*)
229    libdir="$ac_optarg" ;;
230
231  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
232  | --libexe | --libex | --libe)
233    ac_prev=libexecdir ;;
234  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
235  | --libexe=* | --libex=* | --libe=*)
236    libexecdir="$ac_optarg" ;;
237
238  -localstatedir | --localstatedir | --localstatedi | --localstated \
239  | --localstate | --localstat | --localsta | --localst \
240  | --locals | --local | --loca | --loc | --lo)
241    ac_prev=localstatedir ;;
242  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
243  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
244  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
245    localstatedir="$ac_optarg" ;;
246
247  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
248    ac_prev=mandir ;;
249  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
250    mandir="$ac_optarg" ;;
251
252  -nfp | --nfp | --nf)
253    # Obsolete; use --without-fp.
254    with_fp=no ;;
255
256  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
257  | --no-cr | --no-c)
258    no_create=yes ;;
259
260  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
261  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
262    no_recursion=yes ;;
263
264  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
265  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
266  | --oldin | --oldi | --old | --ol | --o)
267    ac_prev=oldincludedir ;;
268  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
269  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
270  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
271    oldincludedir="$ac_optarg" ;;
272
273  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
274    ac_prev=prefix ;;
275  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
276    prefix="$ac_optarg" ;;
277
278  -program-prefix | --program-prefix | --program-prefi | --program-pref \
279  | --program-pre | --program-pr | --program-p)
280    ac_prev=program_prefix ;;
281  -program-prefix=* | --program-prefix=* | --program-prefi=* \
282  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
283    program_prefix="$ac_optarg" ;;
284
285  -program-suffix | --program-suffix | --program-suffi | --program-suff \
286  | --program-suf | --program-su | --program-s)
287    ac_prev=program_suffix ;;
288  -program-suffix=* | --program-suffix=* | --program-suffi=* \
289  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
290    program_suffix="$ac_optarg" ;;
291
292  -program-transform-name | --program-transform-name \
293  | --program-transform-nam | --program-transform-na \
294  | --program-transform-n | --program-transform- \
295  | --program-transform | --program-transfor \
296  | --program-transfo | --program-transf \
297  | --program-trans | --program-tran \
298  | --progr-tra | --program-tr | --program-t)
299    ac_prev=program_transform_name ;;
300  -program-transform-name=* | --program-transform-name=* \
301  | --program-transform-nam=* | --program-transform-na=* \
302  | --program-transform-n=* | --program-transform-=* \
303  | --program-transform=* | --program-transfor=* \
304  | --program-transfo=* | --program-transf=* \
305  | --program-trans=* | --program-tran=* \
306  | --progr-tra=* | --program-tr=* | --program-t=*)
307    program_transform_name="$ac_optarg" ;;
308
309  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
310  | -silent | --silent | --silen | --sile | --sil)
311    silent=yes ;;
312
313  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
314    ac_prev=sbindir ;;
315  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
316  | --sbi=* | --sb=*)
317    sbindir="$ac_optarg" ;;
318
319  -sharedstatedir | --sharedstatedir | --sharedstatedi \
320  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
321  | --sharedst | --shareds | --shared | --share | --shar \
322  | --sha | --sh)
323    ac_prev=sharedstatedir ;;
324  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
325  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
326  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
327  | --sha=* | --sh=*)
328    sharedstatedir="$ac_optarg" ;;
329
330  -site | --site | --sit)
331    ac_prev=site ;;
332  -site=* | --site=* | --sit=*)
333    site="$ac_optarg" ;;
334
335  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
336    ac_prev=srcdir ;;
337  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
338    srcdir="$ac_optarg" ;;
339
340  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
341  | --syscon | --sysco | --sysc | --sys | --sy)
342    ac_prev=sysconfdir ;;
343  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
344  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
345    sysconfdir="$ac_optarg" ;;
346
347  -target | --target | --targe | --targ | --tar | --ta | --t)
348    ac_prev=target ;;
349  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
350    target="$ac_optarg" ;;
351
352  -v | -verbose | --verbose | --verbos | --verbo | --verb)
353    verbose=yes ;;
354
355  -version | --version | --versio | --versi | --vers)
356    echo "configure generated by autoconf version 2.13"
357    exit 0 ;;
358
359  -with-* | --with-*)
360    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
361    # Reject names that are not valid shell variable names.
362    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
363      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
364    fi
365    ac_package=`echo $ac_package| sed 's/-/_/g'`
366    case "$ac_option" in
367      *=*) ;;
368      *) ac_optarg=yes ;;
369    esac
370    eval "with_${ac_package}='$ac_optarg'" ;;
371
372  -without-* | --without-*)
373    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
374    # Reject names that are not valid shell variable names.
375    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
376      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
377    fi
378    ac_package=`echo $ac_package| sed 's/-/_/g'`
379    eval "with_${ac_package}=no" ;;
380
381  --x)
382    # Obsolete; use --with-x.
383    with_x=yes ;;
384
385  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
386  | --x-incl | --x-inc | --x-in | --x-i)
387    ac_prev=x_includes ;;
388  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
389  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
390    x_includes="$ac_optarg" ;;
391
392  -x-libraries | --x-libraries | --x-librarie | --x-librari \
393  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
394    ac_prev=x_libraries ;;
395  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
396  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
397    x_libraries="$ac_optarg" ;;
398
399  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
400    ;;
401
402  *)
403    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
404      echo "configure: warning: $ac_option: invalid host type" 1>&2
405    fi
406    if test "x$nonopt" != xNONE; then
407      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
408    fi
409    nonopt="$ac_option"
410    ;;
411
412  esac
413done
414
415if test -n "$ac_prev"; then
416  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
417fi
418
419trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
420
421# File descriptor usage:
422# 0 standard input
423# 1 file creation
424# 2 errors and warnings
425# 3 some systems may open it to /dev/tty
426# 4 used on the Kubota Titan
427# 6 checking for... messages and results
428# 5 compiler messages saved in config.log
429if test "$silent" = yes; then
430  exec 6>/dev/null
431else
432  exec 6>&1
433fi
434exec 5>./config.log
435
436echo "\
437This file contains any messages produced by compilers while
438running configure, to aid debugging if configure makes a mistake.
439" 1>&5
440
441# Strip out --no-create and --no-recursion so they do not pile up.
442# Also quote any args containing shell metacharacters.
443ac_configure_args=
444for ac_arg
445do
446  case "$ac_arg" in
447  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
448  | --no-cr | --no-c) ;;
449  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
450  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
451  *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
452  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
453  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
454  esac
455done
456
457# NLS nuisances.
458# Only set these to C if already set.  These must not be set unconditionally
459# because not all systems understand e.g. LANG=C (notably SCO).
460# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
461# Non-C LC_CTYPE values break the ctype check.
462if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
463if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
464if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
465if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
466
467# confdefs.h avoids OS command line length limits that DEFS can exceed.
468rm -rf conftest* confdefs.h
469# AIX cpp loses on an empty file, so make sure it contains at least a newline.
470echo > confdefs.h
471
472# A filename unique to this package, relative to the directory that
473# configure is in, which we can look for to find out if srcdir is correct.
474ac_unique_file=converter.c
475
476# Find the source files, if location was not specified.
477if test -z "$srcdir"; then
478  ac_srcdir_defaulted=yes
479  # Try the directory containing this script, then its parent.
480  ac_prog=$0
481  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
482  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
483  srcdir=$ac_confdir
484  if test ! -r $srcdir/$ac_unique_file; then
485    srcdir=..
486  fi
487else
488  ac_srcdir_defaulted=no
489fi
490if test ! -r $srcdir/$ac_unique_file; then
491  if test "$ac_srcdir_defaulted" = yes; then
492    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
493  else
494    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
495  fi
496fi
497srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
498
499# Prefer explicitly selected file to automatically selected ones.
500if test -z "$CONFIG_SITE"; then
501  if test "x$prefix" != xNONE; then
502    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
503  else
504    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
505  fi
506fi
507for ac_site_file in $CONFIG_SITE; do
508  if test -r "$ac_site_file"; then
509    echo "loading site script $ac_site_file"
510    . "$ac_site_file"
511  fi
512done
513
514if test -r "$cache_file"; then
515  echo "loading cache $cache_file"
516  . $cache_file
517else
518  echo "creating cache $cache_file"
519  > $cache_file
520fi
521
522ac_ext=c
523# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
524ac_cpp='$CPP $CPPFLAGS'
525ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
526ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
527cross_compiling=$ac_cv_prog_cc_cross
528
529ac_exeext=
530ac_objext=o
531if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
532  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
533  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
534    ac_n= ac_c='
535' ac_t='        '
536  else
537    ac_n=-n ac_c= ac_t=
538  fi
539else
540  ac_n= ac_c='\c' ac_t=
541fi
542
543
544
545ac_aux_dir=
546for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
547  if test -f $ac_dir/install-sh; then
548    ac_aux_dir=$ac_dir
549    ac_install_sh="$ac_aux_dir/install-sh -c"
550    break
551  elif test -f $ac_dir/install.sh; then
552    ac_aux_dir=$ac_dir
553    ac_install_sh="$ac_aux_dir/install.sh -c"
554    break
555  fi
556done
557if test -z "$ac_aux_dir"; then
558  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
559fi
560ac_config_guess=$ac_aux_dir/config.guess
561ac_config_sub=$ac_aux_dir/config.sub
562ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
563
564
565# Do some error checking and defaulting for the host and target type.
566# The inputs are:
567#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
568#
569# The rules are:
570# 1. You are not allowed to specify --host, --target, and nonopt at the
571#    same time.
572# 2. Host defaults to nonopt.
573# 3. If nonopt is not specified, then host defaults to the current host,
574#    as determined by config.guess.
575# 4. Target and build default to nonopt.
576# 5. If nonopt is not specified, then target and build default to host.
577
578# The aliases save the names the user supplied, while $host etc.
579# will get canonicalized.
580case $host---$target---$nonopt in
581NONE---*---* | *---NONE---* | *---*---NONE) ;;
582*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
583esac
584
585
586# Make sure we can run config.sub.
587if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
588else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
589fi
590
591echo $ac_n "checking host system type""... $ac_c" 1>&6
592echo "configure:593: checking host system type" >&5
593
594host_alias=$host
595case "$host_alias" in
596NONE)
597  case $nonopt in
598  NONE)
599    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
600    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
601    fi ;;
602  *) host_alias=$nonopt ;;
603  esac ;;
604esac
605
606host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
607host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
608host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
609host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
610echo "$ac_t""$host" 1>&6
611
612echo $ac_n "checking target system type""... $ac_c" 1>&6
613echo "configure:614: checking target system type" >&5
614
615target_alias=$target
616case "$target_alias" in
617NONE)
618  case $nonopt in
619  NONE) target_alias=$host_alias ;;
620  *) target_alias=$nonopt ;;
621  esac ;;
622esac
623
624target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
625target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
626target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
627target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
628echo "$ac_t""$target" 1>&6
629
630echo $ac_n "checking build system type""... $ac_c" 1>&6
631echo "configure:632: checking build system type" >&5
632
633build_alias=$build
634case "$build_alias" in
635NONE)
636  case $nonopt in
637  NONE) build_alias=$host_alias ;;
638  *) build_alias=$nonopt ;;
639  esac ;;
640esac
641
642build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
643build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
644build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
645build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
646echo "$ac_t""$build" 1>&6
647
648test "$host_alias" != "$target_alias" &&
649  test "$program_prefix$program_suffix$program_transform_name" = \
650    NONENONEs,x,x, &&
651  program_prefix=${target_alias}-
652
653
654# Extract the first word of "gcc", so it can be a program name with args.
655set dummy gcc; ac_word=$2
656echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
657echo "configure:658: checking for $ac_word" >&5
658if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
659  echo $ac_n "(cached) $ac_c" 1>&6
660else
661  if test -n "$CC"; then
662  ac_cv_prog_CC="$CC" # Let the user override the test.
663else
664  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
665  ac_dummy="$PATH"
666  for ac_dir in $ac_dummy; do
667    test -z "$ac_dir" && ac_dir=.
668    if test -f $ac_dir/$ac_word; then
669      ac_cv_prog_CC="gcc"
670      break
671    fi
672  done
673  IFS="$ac_save_ifs"
674fi
675fi
676CC="$ac_cv_prog_CC"
677if test -n "$CC"; then
678  echo "$ac_t""$CC" 1>&6
679else
680  echo "$ac_t""no" 1>&6
681fi
682
683if test -z "$CC"; then
684  # Extract the first word of "cc", so it can be a program name with args.
685set dummy cc; ac_word=$2
686echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
687echo "configure:688: checking for $ac_word" >&5
688if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
689  echo $ac_n "(cached) $ac_c" 1>&6
690else
691  if test -n "$CC"; then
692  ac_cv_prog_CC="$CC" # Let the user override the test.
693else
694  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
695  ac_prog_rejected=no
696  ac_dummy="$PATH"
697  for ac_dir in $ac_dummy; do
698    test -z "$ac_dir" && ac_dir=.
699    if test -f $ac_dir/$ac_word; then
700      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
701        ac_prog_rejected=yes
702        continue
703      fi
704      ac_cv_prog_CC="cc"
705      break
706    fi
707  done
708  IFS="$ac_save_ifs"
709if test $ac_prog_rejected = yes; then
710  # We found a bogon in the path, so make sure we never use it.
711  set dummy $ac_cv_prog_CC
712  shift
713  if test $# -gt 0; then
714    # We chose a different compiler from the bogus one.
715    # However, it has the same basename, so the bogon will be chosen
716    # first if we set CC to just the basename; use the full file name.
717    shift
718    set dummy "$ac_dir/$ac_word" "$@"
719    shift
720    ac_cv_prog_CC="$@"
721  fi
722fi
723fi
724fi
725CC="$ac_cv_prog_CC"
726if test -n "$CC"; then
727  echo "$ac_t""$CC" 1>&6
728else
729  echo "$ac_t""no" 1>&6
730fi
731
732  if test -z "$CC"; then
733    case "`uname -s`" in
734    *win32* | *WIN32*)
735      # Extract the first word of "cl", so it can be a program name with args.
736set dummy cl; ac_word=$2
737echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
738echo "configure:739: checking for $ac_word" >&5
739if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
740  echo $ac_n "(cached) $ac_c" 1>&6
741else
742  if test -n "$CC"; then
743  ac_cv_prog_CC="$CC" # Let the user override the test.
744else
745  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
746  ac_dummy="$PATH"
747  for ac_dir in $ac_dummy; do
748    test -z "$ac_dir" && ac_dir=.
749    if test -f $ac_dir/$ac_word; then
750      ac_cv_prog_CC="cl"
751      break
752    fi
753  done
754  IFS="$ac_save_ifs"
755fi
756fi
757CC="$ac_cv_prog_CC"
758if test -n "$CC"; then
759  echo "$ac_t""$CC" 1>&6
760else
761  echo "$ac_t""no" 1>&6
762fi
763 ;;
764    esac
765  fi
766  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
767fi
768
769echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
770echo "configure:771: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
771
772ac_ext=c
773# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
774ac_cpp='$CPP $CPPFLAGS'
775ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
776ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
777cross_compiling=$ac_cv_prog_cc_cross
778
779cat > conftest.$ac_ext << EOF
780
781#line 782 "configure"
782#include "confdefs.h"
783
784main(){return(0);}
785EOF
786if { (eval echo configure:787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
787  ac_cv_prog_cc_works=yes
788  # If we can't run a trivial program, we are probably using a cross compiler.
789  if (./conftest; exit) 2>/dev/null; then
790    ac_cv_prog_cc_cross=no
791  else
792    ac_cv_prog_cc_cross=yes
793  fi
794else
795  echo "configure: failed program was:" >&5
796  cat conftest.$ac_ext >&5
797  ac_cv_prog_cc_works=no
798fi
799rm -fr conftest*
800ac_ext=c
801# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
802ac_cpp='$CPP $CPPFLAGS'
803ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
804ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
805cross_compiling=$ac_cv_prog_cc_cross
806
807echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
808if test $ac_cv_prog_cc_works = no; then
809  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
810fi
811echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
812echo "configure:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
813echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
814cross_compiling=$ac_cv_prog_cc_cross
815
816echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
817echo "configure:818: checking whether we are using GNU C" >&5
818if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
819  echo $ac_n "(cached) $ac_c" 1>&6
820else
821  cat > conftest.c <<EOF
822#ifdef __GNUC__
823  yes;
824#endif
825EOF
826if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
827  ac_cv_prog_gcc=yes
828else
829  ac_cv_prog_gcc=no
830fi
831fi
832
833echo "$ac_t""$ac_cv_prog_gcc" 1>&6
834
835if test $ac_cv_prog_gcc = yes; then
836  GCC=yes
837else
838  GCC=
839fi
840
841ac_test_CFLAGS="${CFLAGS+set}"
842ac_save_CFLAGS="$CFLAGS"
843CFLAGS=
844echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
845echo "configure:846: checking whether ${CC-cc} accepts -g" >&5
846if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
847  echo $ac_n "(cached) $ac_c" 1>&6
848else
849  echo 'void f(){}' > conftest.c
850if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
851  ac_cv_prog_cc_g=yes
852else
853  ac_cv_prog_cc_g=no
854fi
855rm -f conftest*
856
857fi
858
859echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
860if test "$ac_test_CFLAGS" = set; then
861  CFLAGS="$ac_save_CFLAGS"
862elif test $ac_cv_prog_cc_g = yes; then
863  if test "$GCC" = yes; then
864    CFLAGS="-g -O2"
865  else
866    CFLAGS="-g"
867  fi
868else
869  if test "$GCC" = yes; then
870    CFLAGS="-O2"
871  else
872    CFLAGS=
873  fi
874fi
875
876echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
877echo "configure:878: checking how to run the C preprocessor" >&5
878# On Suns, sometimes $CPP names a directory.
879if test -n "$CPP" && test -d "$CPP"; then
880  CPP=
881fi
882if test -z "$CPP"; then
883if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
884  echo $ac_n "(cached) $ac_c" 1>&6
885else
886    # This must be in double quotes, not single quotes, because CPP may get
887  # substituted into the Makefile and "${CC-cc}" will confuse make.
888  CPP="${CC-cc} -E"
889  # On the NeXT, cc -E runs the code through the compiler's parser,
890  # not just through cpp.
891  cat > conftest.$ac_ext <<EOF
892#line 893 "configure"
893#include "confdefs.h"
894#include <assert.h>
895Syntax Error
896EOF
897ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
898{ (eval echo configure:899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
899ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
900if test -z "$ac_err"; then
901  :
902else
903  echo "$ac_err" >&5
904  echo "configure: failed program was:" >&5
905  cat conftest.$ac_ext >&5
906  rm -rf conftest*
907  CPP="${CC-cc} -E -traditional-cpp"
908  cat > conftest.$ac_ext <<EOF
909#line 910 "configure"
910#include "confdefs.h"
911#include <assert.h>
912Syntax Error
913EOF
914ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
915{ (eval echo configure:916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
916ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
917if test -z "$ac_err"; then
918  :
919else
920  echo "$ac_err" >&5
921  echo "configure: failed program was:" >&5
922  cat conftest.$ac_ext >&5
923  rm -rf conftest*
924  CPP="${CC-cc} -nologo -E"
925  cat > conftest.$ac_ext <<EOF
926#line 927 "configure"
927#include "confdefs.h"
928#include <assert.h>
929Syntax Error
930EOF
931ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
932{ (eval echo configure:933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
933ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
934if test -z "$ac_err"; then
935  :
936else
937  echo "$ac_err" >&5
938  echo "configure: failed program was:" >&5
939  cat conftest.$ac_ext >&5
940  rm -rf conftest*
941  CPP=/lib/cpp
942fi
943rm -f conftest*
944fi
945rm -f conftest*
946fi
947rm -f conftest*
948  ac_cv_prog_CPP="$CPP"
949fi
950  CPP="$ac_cv_prog_CPP"
951else
952  ac_cv_prog_CPP="$CPP"
953fi
954echo "$ac_t""$CPP" 1>&6
955
956# Extract the first word of "ranlib", so it can be a program name with args.
957set dummy ranlib; ac_word=$2
958echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
959echo "configure:960: checking for $ac_word" >&5
960if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
961  echo $ac_n "(cached) $ac_c" 1>&6
962else
963  if test -n "$RANLIB"; then
964  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
965else
966  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
967  ac_dummy="$PATH"
968  for ac_dir in $ac_dummy; do
969    test -z "$ac_dir" && ac_dir=.
970    if test -f $ac_dir/$ac_word; then
971      ac_cv_prog_RANLIB="ranlib"
972      break
973    fi
974  done
975  IFS="$ac_save_ifs"
976  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
977fi
978fi
979RANLIB="$ac_cv_prog_RANLIB"
980if test -n "$RANLIB"; then
981  echo "$ac_t""$RANLIB" 1>&6
982else
983  echo "$ac_t""no" 1>&6
984fi
985
986
987echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
988echo "configure:989: checking for ANSI C header files" >&5
989if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
990  echo $ac_n "(cached) $ac_c" 1>&6
991else
992  cat > conftest.$ac_ext <<EOF
993#line 994 "configure"
994#include "confdefs.h"
995#include <stdlib.h>
996#include <stdarg.h>
997#include <string.h>
998#include <float.h>
999EOF
1000ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1001{ (eval echo configure:1002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1002ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1003if test -z "$ac_err"; then
1004  rm -rf conftest*
1005  ac_cv_header_stdc=yes
1006else
1007  echo "$ac_err" >&5
1008  echo "configure: failed program was:" >&5
1009  cat conftest.$ac_ext >&5
1010  rm -rf conftest*
1011  ac_cv_header_stdc=no
1012fi
1013rm -f conftest*
1014
1015if test $ac_cv_header_stdc = yes; then
1016  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1017cat > conftest.$ac_ext <<EOF
1018#line 1019 "configure"
1019#include "confdefs.h"
1020#include <string.h>
1021EOF
1022if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1023  egrep "memchr" >/dev/null 2>&1; then
1024  :
1025else
1026  rm -rf conftest*
1027  ac_cv_header_stdc=no
1028fi
1029rm -f conftest*
1030
1031fi
1032
1033if test $ac_cv_header_stdc = yes; then
1034  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1035cat > conftest.$ac_ext <<EOF
1036#line 1037 "configure"
1037#include "confdefs.h"
1038#include <stdlib.h>
1039EOF
1040if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1041  egrep "free" >/dev/null 2>&1; then
1042  :
1043else
1044  rm -rf conftest*
1045  ac_cv_header_stdc=no
1046fi
1047rm -f conftest*
1048
1049fi
1050
1051if test $ac_cv_header_stdc = yes; then
1052  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1053if test "$cross_compiling" = yes; then
1054  :
1055else
1056  cat > conftest.$ac_ext <<EOF
1057#line 1058 "configure"
1058#include "confdefs.h"
1059#include <ctype.h>
1060#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1061#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1062#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1063int main () { int i; for (i = 0; i < 256; i++)
1064if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1065exit (0); }
1066
1067EOF
1068if { (eval echo configure:1069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1069then
1070  :
1071else
1072  echo "configure: failed program was:" >&5
1073  cat conftest.$ac_ext >&5
1074  rm -fr conftest*
1075  ac_cv_header_stdc=no
1076fi
1077rm -fr conftest*
1078fi
1079
1080fi
1081fi
1082
1083echo "$ac_t""$ac_cv_header_stdc" 1>&6
1084if test $ac_cv_header_stdc = yes; then
1085  cat >> confdefs.h <<\EOF
1086#define STDC_HEADERS 1
1087EOF
1088
1089fi
1090
1091echo $ac_n "checking for working const""... $ac_c" 1>&6
1092echo "configure:1093: checking for working const" >&5
1093if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1094  echo $ac_n "(cached) $ac_c" 1>&6
1095else
1096  cat > conftest.$ac_ext <<EOF
1097#line 1098 "configure"
1098#include "confdefs.h"
1099
1100int main() {
1101
1102/* Ultrix mips cc rejects this.  */
1103typedef int charset[2]; const charset x;
1104/* SunOS 4.1.1 cc rejects this.  */
1105char const *const *ccp;
1106char **p;
1107/* NEC SVR4.0.2 mips cc rejects this.  */
1108struct point {int x, y;};
1109static struct point const zero = {0,0};
1110/* AIX XL C 1.02.0.0 rejects this.
1111   It does not let you subtract one const X* pointer from another in an arm
1112   of an if-expression whose if-part is not a constant expression */
1113const char *g = "string";
1114ccp = &g + (g ? g-g : 0);
1115/* HPUX 7.0 cc rejects these. */
1116++ccp;
1117p = (char**) ccp;
1118ccp = (char const *const *) p;
1119{ /* SCO 3.2v4 cc rejects this.  */
1120  char *t;
1121  char const *s = 0 ? (char *) 0 : (char const *) 0;
1122
1123  *t++ = 0;
1124}
1125{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1126  int x[] = {25, 17};
1127  const int *foo = &x[0];
1128  ++foo;
1129}
1130{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1131  typedef const int *iptr;
1132  iptr p = 0;
1133  ++p;
1134}
1135{ /* AIX XL C 1.02.0.0 rejects this saying
1136     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1137  struct s { int j; const int *ap[3]; };
1138  struct s *b; b->j = 5;
1139}
1140{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1141  const int foo = 10;
1142}
1143
1144; return 0; }
1145EOF
1146if { (eval echo configure:1147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1147  rm -rf conftest*
1148  ac_cv_c_const=yes
1149else
1150  echo "configure: failed program was:" >&5
1151  cat conftest.$ac_ext >&5
1152  rm -rf conftest*
1153  ac_cv_c_const=no
1154fi
1155rm -f conftest*
1156fi
1157
1158echo "$ac_t""$ac_cv_c_const" 1>&6
1159if test $ac_cv_c_const = no; then
1160  cat >> confdefs.h <<\EOF
1161#define const
1162EOF
1163
1164fi
1165
1166echo $ac_n "checking for size_t""... $ac_c" 1>&6
1167echo "configure:1168: checking for size_t" >&5
1168if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1169  echo $ac_n "(cached) $ac_c" 1>&6
1170else
1171  cat > conftest.$ac_ext <<EOF
1172#line 1173 "configure"
1173#include "confdefs.h"
1174#include <sys/types.h>
1175#if STDC_HEADERS
1176#include <stdlib.h>
1177#include <stddef.h>
1178#endif
1179EOF
1180if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1181  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1182  rm -rf conftest*
1183  ac_cv_type_size_t=yes
1184else
1185  rm -rf conftest*
1186  ac_cv_type_size_t=no
1187fi
1188rm -f conftest*
1189
1190fi
1191echo "$ac_t""$ac_cv_type_size_t" 1>&6
1192if test $ac_cv_type_size_t = no; then
1193  cat >> confdefs.h <<\EOF
1194#define size_t unsigned
1195EOF
1196
1197fi
1198
1199
1200# Check for various headers                                                 
1201for ac_hdr in stdint.h inttypes.h stropts.h sys/filio.h malloc.h
1202do
1203ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1204echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1205echo "configure:1206: checking for $ac_hdr" >&5
1206if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1207  echo $ac_n "(cached) $ac_c" 1>&6
1208else
1209  cat > conftest.$ac_ext <<EOF
1210#line 1211 "configure"
1211#include "confdefs.h"
1212#include <$ac_hdr>
1213EOF
1214ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1215{ (eval echo configure:1216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1216ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1217if test -z "$ac_err"; then
1218  rm -rf conftest*
1219  eval "ac_cv_header_$ac_safe=yes"
1220else
1221  echo "$ac_err" >&5
1222  echo "configure: failed program was:" >&5
1223  cat conftest.$ac_ext >&5
1224  rm -rf conftest*
1225  eval "ac_cv_header_$ac_safe=no"
1226fi
1227rm -f conftest*
1228fi
1229if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1230  echo "$ac_t""yes" 1>&6
1231    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1232  cat >> confdefs.h <<EOF
1233#define $ac_tr_hdr 1
1234EOF
1235 
1236else
1237  echo "$ac_t""no" 1>&6
1238fi
1239done
1240
1241for ac_hdr in sys/sockio.h
1242do
1243ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1244echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1245echo "configure:1246: checking for $ac_hdr" >&5
1246if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1247  echo $ac_n "(cached) $ac_c" 1>&6
1248else
1249  cat > conftest.$ac_ext <<EOF
1250#line 1251 "configure"
1251#include "confdefs.h"
1252#include <$ac_hdr>
1253EOF
1254ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1255{ (eval echo configure:1256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1256ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1257if test -z "$ac_err"; then
1258  rm -rf conftest*
1259  eval "ac_cv_header_$ac_safe=yes"
1260else
1261  echo "$ac_err" >&5
1262  echo "configure: failed program was:" >&5
1263  cat conftest.$ac_ext >&5
1264  rm -rf conftest*
1265  eval "ac_cv_header_$ac_safe=no"
1266fi
1267rm -f conftest*
1268fi
1269if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1270  echo "$ac_t""yes" 1>&6
1271    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1272  cat >> confdefs.h <<EOF
1273#define $ac_tr_hdr 1
1274EOF
1275 
1276else
1277  echo "$ac_t""no" 1>&6
1278fi
1279done
1280
1281
1282echo $ac_n "checking kill in signal.h""... $ac_c" 1>&6
1283echo "configure:1284: checking kill in signal.h" >&5
1284cat > conftest.$ac_ext <<EOF
1285#line 1286 "configure"
1286#include "confdefs.h"
1287#include <signal.h>
1288EOF
1289if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1290  egrep "kill" >/dev/null 2>&1; then
1291  rm -rf conftest*
1292  echo "$ac_t""yes" 1>&6
1293else
1294  rm -rf conftest*
1295  echo "$ac_t""no" 1>&6
1296
1297fi
1298rm -f conftest*
1299
1300
1301# Check for libraries                                                       
1302
1303echo $ac_n "checking for library containing socket""... $ac_c" 1>&6
1304echo "configure:1305: checking for library containing socket" >&5
1305if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then
1306  echo $ac_n "(cached) $ac_c" 1>&6
1307else
1308  ac_func_search_save_LIBS="$LIBS"
1309ac_cv_search_socket="no"
1310cat > conftest.$ac_ext <<EOF
1311#line 1312 "configure"
1312#include "confdefs.h"
1313/* Override any gcc2 internal prototype to avoid an error.  */
1314/* We use char because int might match the return type of a gcc2
1315    builtin and then its argument prototype would still apply.  */
1316char socket();
1317
1318int main() {
1319socket()
1320; return 0; }
1321EOF
1322if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1323  rm -rf conftest*
1324  ac_cv_search_socket="none required"
1325else
1326  echo "configure: failed program was:" >&5
1327  cat conftest.$ac_ext >&5
1328fi
1329rm -f conftest*
1330test "$ac_cv_search_socket" = "no" && for i in socket; do
1331LIBS="-l$i  $ac_func_search_save_LIBS"
1332cat > conftest.$ac_ext <<EOF
1333#line 1334 "configure"
1334#include "confdefs.h"
1335/* Override any gcc2 internal prototype to avoid an error.  */
1336/* We use char because int might match the return type of a gcc2
1337    builtin and then its argument prototype would still apply.  */
1338char socket();
1339
1340int main() {
1341socket()
1342; return 0; }
1343EOF
1344if { (eval echo configure:1345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1345  rm -rf conftest*
1346  ac_cv_search_socket="-l$i"
1347break
1348else
1349  echo "configure: failed program was:" >&5
1350  cat conftest.$ac_ext >&5
1351fi
1352rm -f conftest*
1353done
1354LIBS="$ac_func_search_save_LIBS"
1355fi
1356
1357echo "$ac_t""$ac_cv_search_socket" 1>&6
1358if test "$ac_cv_search_socket" != "no"; then
1359  test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
1360 
1361else :
1362 
1363fi
1364
1365echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
1366echo "configure:1367: checking for library containing inet_addr" >&5
1367if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
1368  echo $ac_n "(cached) $ac_c" 1>&6
1369else
1370  ac_func_search_save_LIBS="$LIBS"
1371ac_cv_search_inet_addr="no"
1372cat > conftest.$ac_ext <<EOF
1373#line 1374 "configure"
1374#include "confdefs.h"
1375/* Override any gcc2 internal prototype to avoid an error.  */
1376/* We use char because int might match the return type of a gcc2
1377    builtin and then its argument prototype would still apply.  */
1378char inet_addr();
1379
1380int main() {
1381inet_addr()
1382; return 0; }
1383EOF
1384if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1385  rm -rf conftest*
1386  ac_cv_search_inet_addr="none required"
1387else
1388  echo "configure: failed program was:" >&5
1389  cat conftest.$ac_ext >&5
1390fi
1391rm -f conftest*
1392test "$ac_cv_search_inet_addr" = "no" && for i in nsl; do
1393LIBS="-l$i  $ac_func_search_save_LIBS"
1394cat > conftest.$ac_ext <<EOF
1395#line 1396 "configure"
1396#include "confdefs.h"
1397/* Override any gcc2 internal prototype to avoid an error.  */
1398/* We use char because int might match the return type of a gcc2
1399    builtin and then its argument prototype would still apply.  */
1400char inet_addr();
1401
1402int main() {
1403inet_addr()
1404; return 0; }
1405EOF
1406if { (eval echo configure:1407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1407  rm -rf conftest*
1408  ac_cv_search_inet_addr="-l$i"
1409break
1410else
1411  echo "configure: failed program was:" >&5
1412  cat conftest.$ac_ext >&5
1413fi
1414rm -f conftest*
1415done
1416LIBS="$ac_func_search_save_LIBS"
1417fi
1418
1419echo "$ac_t""$ac_cv_search_inet_addr" 1>&6
1420if test "$ac_cv_search_inet_addr" != "no"; then
1421  test "$ac_cv_search_inet_addr" = "none required" || LIBS="$ac_cv_search_inet_addr $LIBS"
1422 
1423else :
1424 
1425fi
1426
1427echo $ac_n "checking for sin""... $ac_c" 1>&6
1428echo "configure:1429: checking for sin" >&5
1429if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
1430  echo $ac_n "(cached) $ac_c" 1>&6
1431else
1432  cat > conftest.$ac_ext <<EOF
1433#line 1434 "configure"
1434#include "confdefs.h"
1435/* System header to define __stub macros and hopefully few prototypes,
1436    which can conflict with char sin(); below.  */
1437#include <assert.h>
1438/* Override any gcc2 internal prototype to avoid an error.  */
1439/* We use char because int might match the return type of a gcc2
1440    builtin and then its argument prototype would still apply.  */
1441char sin();
1442
1443int main() {
1444
1445/* The GNU C library defines this for functions which it implements
1446    to always fail with ENOSYS.  Some functions are actually named
1447    something starting with __ and the normal name is an alias.  */
1448#if defined (__stub_sin) || defined (__stub___sin)
1449choke me
1450#else
1451sin();
1452#endif
1453
1454; return 0; }
1455EOF
1456if { (eval echo configure:1457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1457  rm -rf conftest*
1458  eval "ac_cv_func_sin=yes"
1459else
1460  echo "configure: failed program was:" >&5
1461  cat conftest.$ac_ext >&5
1462  rm -rf conftest*
1463  eval "ac_cv_func_sin=no"
1464fi
1465rm -f conftest*
1466fi
1467
1468if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
1469  echo "$ac_t""yes" 1>&6
1470  MATHLIBS=""
1471else
1472  echo "$ac_t""no" 1>&6
1473MATHLIBS="-lm"
1474fi
1475
1476echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
1477echo "configure:1478: checking for main in -lieee" >&5
1478ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
1479if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1480  echo $ac_n "(cached) $ac_c" 1>&6
1481else
1482  ac_save_LIBS="$LIBS"
1483LIBS="-lieee  $LIBS"
1484cat > conftest.$ac_ext <<EOF
1485#line 1486 "configure"
1486#include "confdefs.h"
1487
1488int main() {
1489main()
1490; return 0; }
1491EOF
1492if { (eval echo configure:1493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1493  rm -rf conftest*
1494  eval "ac_cv_lib_$ac_lib_var=yes"
1495else
1496  echo "configure: failed program was:" >&5
1497  cat conftest.$ac_ext >&5
1498  rm -rf conftest*
1499  eval "ac_cv_lib_$ac_lib_var=no"
1500fi
1501rm -f conftest*
1502LIBS="$ac_save_LIBS"
1503
1504fi
1505if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1506  echo "$ac_t""yes" 1>&6
1507  MATHLIBS="-lieee $MATHLIBS"
1508else
1509  echo "$ac_t""no" 1>&6
1510fi
1511
1512
1513
1514# Check for standard size types.  The defaults are only valid on some systems
1515# so we hope that <inttypes.h> exists when they're wrong.                   
1516
1517echo $ac_n "checking for int8_t""... $ac_c" 1>&6
1518echo "configure:1519: checking for int8_t" >&5
1519if eval "test \"`echo '$''{'ac_cv_type_int8_t'+set}'`\" = set"; then
1520  echo $ac_n "(cached) $ac_c" 1>&6
1521else
1522  cat > conftest.$ac_ext <<EOF
1523#line 1524 "configure"
1524#include "confdefs.h"
1525#include <sys/types.h>
1526#if STDC_HEADERS
1527#include <stdlib.h>
1528#include <stddef.h>
1529#endif
1530EOF
1531if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1532  egrep "(^|[^a-zA-Z_0-9])int8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1533  rm -rf conftest*
1534  ac_cv_type_int8_t=yes
1535else
1536  rm -rf conftest*
1537  ac_cv_type_int8_t=no
1538fi
1539rm -f conftest*
1540
1541fi
1542echo "$ac_t""$ac_cv_type_int8_t" 1>&6
1543if test $ac_cv_type_int8_t = no; then
1544  cat >> confdefs.h <<\EOF
1545#define int8_t signed char
1546EOF
1547
1548fi
1549
1550echo $ac_n "checking for int16_t""... $ac_c" 1>&6
1551echo "configure:1552: checking for int16_t" >&5
1552if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then
1553  echo $ac_n "(cached) $ac_c" 1>&6
1554else
1555  cat > conftest.$ac_ext <<EOF
1556#line 1557 "configure"
1557#include "confdefs.h"
1558#include <sys/types.h>
1559#if STDC_HEADERS
1560#include <stdlib.h>
1561#include <stddef.h>
1562#endif
1563EOF
1564if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1565  egrep "(^|[^a-zA-Z_0-9])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1566  rm -rf conftest*
1567  ac_cv_type_int16_t=yes
1568else
1569  rm -rf conftest*
1570  ac_cv_type_int16_t=no
1571fi
1572rm -f conftest*
1573
1574fi
1575echo "$ac_t""$ac_cv_type_int16_t" 1>&6
1576if test $ac_cv_type_int16_t = no; then
1577  cat >> confdefs.h <<\EOF
1578#define int16_t short
1579EOF
1580
1581fi
1582
1583echo $ac_n "checking for int32_t""... $ac_c" 1>&6
1584echo "configure:1585: checking for int32_t" >&5
1585if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
1586  echo $ac_n "(cached) $ac_c" 1>&6
1587else
1588  cat > conftest.$ac_ext <<EOF
1589#line 1590 "configure"
1590#include "confdefs.h"
1591#include <sys/types.h>
1592#if STDC_HEADERS
1593#include <stdlib.h>
1594#include <stddef.h>
1595#endif
1596EOF
1597if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1598  egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1599  rm -rf conftest*
1600  ac_cv_type_int32_t=yes
1601else
1602  rm -rf conftest*
1603  ac_cv_type_int32_t=no
1604fi
1605rm -f conftest*
1606
1607fi
1608echo "$ac_t""$ac_cv_type_int32_t" 1>&6
1609if test $ac_cv_type_int32_t = no; then
1610  cat >> confdefs.h <<\EOF
1611#define int32_t long
1612EOF
1613
1614fi
1615
1616echo $ac_n "checking for int64_t""... $ac_c" 1>&6
1617echo "configure:1618: checking for int64_t" >&5
1618if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then
1619  echo $ac_n "(cached) $ac_c" 1>&6
1620else
1621  cat > conftest.$ac_ext <<EOF
1622#line 1623 "configure"
1623#include "confdefs.h"
1624#include <sys/types.h>
1625#if STDC_HEADERS
1626#include <stdlib.h>
1627#include <stddef.h>
1628#endif
1629EOF
1630if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1631  egrep "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1632  rm -rf conftest*
1633  ac_cv_type_int64_t=yes
1634else
1635  rm -rf conftest*
1636  ac_cv_type_int64_t=no
1637fi
1638rm -f conftest*
1639
1640fi
1641echo "$ac_t""$ac_cv_type_int64_t" 1>&6
1642if test $ac_cv_type_int64_t = no; then
1643  cat >> confdefs.h <<\EOF
1644#define int64_t long long
1645EOF
1646
1647fi
1648
1649
1650# Some systems have these in <stdint.h>, just to be difficult...
1651echo $ac_n "checking for uint8_t in <stdint.h>""... $ac_c" 1>&6
1652echo "configure:1653: checking for uint8_t in <stdint.h>" >&5
1653if eval "test \"`echo '$''{'ucl_cv_uint8_t_in_stdint_h'+set}'`\" = set"; then
1654  echo $ac_n "(cached) $ac_c" 1>&6
1655else
1656  cat > conftest.$ac_ext <<EOF
1657#line 1658 "configure"
1658#include "confdefs.h"
1659#include <stdint.h>
1660EOF
1661if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1662  egrep "uint8_t" >/dev/null 2>&1; then
1663  rm -rf conftest*
1664  ucl_cv_uint8_t_in_stdint_h=yes
1665else
1666  rm -rf conftest*
1667  ucl_cv_uint8_t_in_stdint_h=no
1668fi
1669rm -f conftest*
1670
1671fi
1672
1673echo "$ac_t""$ucl_cv_uint8_t_in_stdint_h" 1>&6
1674if test $ucl_cv_uint8_t_in_stdint_h = "no"
1675then
1676         echo $ac_n "checking for uint8_t""... $ac_c" 1>&6
1677echo "configure:1678: checking for uint8_t" >&5
1678if eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then
1679  echo $ac_n "(cached) $ac_c" 1>&6
1680else
1681  cat > conftest.$ac_ext <<EOF
1682#line 1683 "configure"
1683#include "confdefs.h"
1684#include <sys/types.h>
1685#if STDC_HEADERS
1686#include <stdlib.h>
1687#include <stddef.h>
1688#endif
1689EOF
1690if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1691  egrep "(^|[^a-zA-Z_0-9])uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1692  rm -rf conftest*
1693  ac_cv_type_uint8_t=yes
1694else
1695  rm -rf conftest*
1696  ac_cv_type_uint8_t=no
1697fi
1698rm -f conftest*
1699
1700fi
1701echo "$ac_t""$ac_cv_type_uint8_t" 1>&6
1702if test $ac_cv_type_uint8_t = no; then
1703  cat >> confdefs.h <<\EOF
1704#define uint8_t unsigned char
1705EOF
1706
1707fi
1708
1709fi
1710
1711echo $ac_n "checking for uint16_t in <stdint.h>""... $ac_c" 1>&6
1712echo "configure:1713: checking for uint16_t in <stdint.h>" >&5
1713if eval "test \"`echo '$''{'ucl_cv_uint16_t_in_stdint_h'+set}'`\" = set"; then
1714  echo $ac_n "(cached) $ac_c" 1>&6
1715else
1716  cat > conftest.$ac_ext <<EOF
1717#line 1718 "configure"
1718#include "confdefs.h"
1719#include <stdint.h>
1720EOF
1721if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1722  egrep "uint16_t" >/dev/null 2>&1; then
1723  rm -rf conftest*
1724  ucl_cv_uint16_t_in_stdint_h=yes
1725else
1726  rm -rf conftest*
1727  ucl_cv_uint16_t_in_stdint_h=no
1728fi
1729rm -f conftest*
1730
1731fi
1732
1733echo "$ac_t""$ucl_cv_uint16_t_in_stdint_h" 1>&6
1734if test $ucl_cv_uint16_t_in_stdint_h = "no"
1735then
1736         echo $ac_n "checking for uint16_t""... $ac_c" 1>&6
1737echo "configure:1738: checking for uint16_t" >&5
1738if eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then
1739  echo $ac_n "(cached) $ac_c" 1>&6
1740else
1741  cat > conftest.$ac_ext <<EOF
1742#line 1743 "configure"
1743#include "confdefs.h"
1744#include <sys/types.h>
1745#if STDC_HEADERS
1746#include <stdlib.h>
1747#include <stddef.h>
1748#endif
1749EOF
1750if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1751  egrep "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1752  rm -rf conftest*
1753  ac_cv_type_uint16_t=yes
1754else
1755  rm -rf conftest*
1756  ac_cv_type_uint16_t=no
1757fi
1758rm -f conftest*
1759
1760fi
1761echo "$ac_t""$ac_cv_type_uint16_t" 1>&6
1762if test $ac_cv_type_uint16_t = no; then
1763  cat >> confdefs.h <<\EOF
1764#define uint16_t unsigned short
1765EOF
1766
1767fi
1768
1769fi
1770
1771echo $ac_n "checking for uint32_t in <stdint.h>""... $ac_c" 1>&6
1772echo "configure:1773: checking for uint32_t in <stdint.h>" >&5
1773if eval "test \"`echo '$''{'ucl_cv_uint32_t_in_stdint_h'+set}'`\" = set"; then
1774  echo $ac_n "(cached) $ac_c" 1>&6
1775else
1776  cat > conftest.$ac_ext <<EOF
1777#line 1778 "configure"
1778#include "confdefs.h"
1779#include <stdint.h>
1780EOF
1781if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1782  egrep "uint32_t" >/dev/null 2>&1; then
1783  rm -rf conftest*
1784  ucl_cv_uint32_t_in_stdint_h=yes
1785else
1786  rm -rf conftest*
1787  ucl_cv_uint32_t_in_stdint_h=no
1788fi
1789rm -f conftest*
1790
1791fi
1792
1793echo "$ac_t""$ucl_cv_uint32_t_in_stdint_h" 1>&6
1794if test $ucl_cv_uint32_t_in_stdint_h = "no"
1795then
1796         echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
1797echo "configure:1798: checking for uint32_t" >&5
1798if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then
1799  echo $ac_n "(cached) $ac_c" 1>&6
1800else
1801  cat > conftest.$ac_ext <<EOF
1802#line 1803 "configure"
1803#include "confdefs.h"
1804#include <sys/types.h>
1805#if STDC_HEADERS
1806#include <stdlib.h>
1807#include <stddef.h>
1808#endif
1809EOF
1810if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1811  egrep "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1812  rm -rf conftest*
1813  ac_cv_type_uint32_t=yes
1814else
1815  rm -rf conftest*
1816  ac_cv_type_uint32_t=no
1817fi
1818rm -f conftest*
1819
1820fi
1821echo "$ac_t""$ac_cv_type_uint32_t" 1>&6
1822if test $ac_cv_type_uint32_t = no; then
1823  cat >> confdefs.h <<\EOF
1824#define uint32_t unsigned int
1825EOF
1826
1827fi
1828
1829fi
1830
1831# The following two macros cause autoconf to complain.
1832echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
1833echo "configure:1834: checking whether byte ordering is bigendian" >&5
1834if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
1835  echo $ac_n "(cached) $ac_c" 1>&6
1836else
1837  ac_cv_c_bigendian=unknown
1838# See if sys/param.h defines the BYTE_ORDER macro.
1839cat > conftest.$ac_ext <<EOF
1840#line 1841 "configure"
1841#include "confdefs.h"
1842#include <sys/types.h>
1843#include <sys/param.h>
1844int main() {
1845
1846#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
1847 bogus endian macros
1848#endif
1849; return 0; }
1850EOF
1851if { (eval echo configure:1852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1852  rm -rf conftest*
1853  # It does; now see whether it defined to BIG_ENDIAN or not.
1854cat > conftest.$ac_ext <<EOF
1855#line 1856 "configure"
1856#include "confdefs.h"
1857#include <sys/types.h>
1858#include <sys/param.h>
1859int main() {
1860
1861#if BYTE_ORDER != BIG_ENDIAN
1862 not big endian
1863#endif
1864; return 0; }
1865EOF
1866if { (eval echo configure:1867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1867  rm -rf conftest*
1868  ac_cv_c_bigendian=yes
1869else
1870  echo "configure: failed program was:" >&5
1871  cat conftest.$ac_ext >&5
1872  rm -rf conftest*
1873  ac_cv_c_bigendian=no
1874fi
1875rm -f conftest*
1876else
1877  echo "configure: failed program was:" >&5
1878  cat conftest.$ac_ext >&5
1879fi
1880rm -f conftest*
1881if test $ac_cv_c_bigendian = unknown; then
1882if test "$cross_compiling" = yes; then
1883    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
1884else
1885  cat > conftest.$ac_ext <<EOF
1886#line 1887 "configure"
1887#include "confdefs.h"
1888main () {
1889  /* Are we little or big endian?  From Harbison&Steele.  */
1890  union
1891  {
1892    long l;
1893    char c[sizeof (long)];
1894  } u;
1895  u.l = 1;
1896  exit (u.c[sizeof (long) - 1] == 1);
1897}
1898EOF
1899if { (eval echo configure:1900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1900then
1901  ac_cv_c_bigendian=no
1902else
1903  echo "configure: failed program was:" >&5
1904  cat conftest.$ac_ext >&5
1905  rm -fr conftest*
1906  ac_cv_c_bigendian=yes
1907fi
1908rm -fr conftest*
1909fi
1910
1911fi
1912fi
1913
1914echo "$ac_t""$ac_cv_c_bigendian" 1>&6
1915if test $ac_cv_c_bigendian = yes; then
1916  cat >> confdefs.h <<\EOF
1917#define WORDS_BIGENDIAN 1
1918EOF
1919
1920fi
1921
1922echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
1923echo "configure:1924: checking whether char is unsigned" >&5
1924if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
1925  echo $ac_n "(cached) $ac_c" 1>&6
1926else
1927  if test "$GCC" = yes; then
1928  # GCC predefines this symbol on systems where it applies.
1929cat > conftest.$ac_ext <<EOF
1930#line 1931 "configure"
1931#include "confdefs.h"
1932#ifdef __CHAR_UNSIGNED__
1933  yes
1934#endif
1935
1936EOF
1937if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1938  egrep "yes" >/dev/null 2>&1; then
1939  rm -rf conftest*
1940  ac_cv_c_char_unsigned=yes
1941else
1942  rm -rf conftest*
1943  ac_cv_c_char_unsigned=no
1944fi
1945rm -f conftest*
1946
1947else
1948if test "$cross_compiling" = yes; then
1949    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
1950else
1951  cat > conftest.$ac_ext <<EOF
1952#line 1953 "configure"
1953#include "confdefs.h"
1954/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
1955#if !defined(__STDC__) || __STDC__ != 1
1956#define volatile
1957#endif
1958main() {
1959  volatile char c = 255; exit(c < 0);
1960}
1961EOF
1962if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1963then
1964  ac_cv_c_char_unsigned=yes
1965else
1966  echo "configure: failed program was:" >&5
1967  cat conftest.$ac_ext >&5
1968  rm -fr conftest*
1969  ac_cv_c_char_unsigned=no
1970fi
1971rm -fr conftest*
1972fi
1973
1974fi
1975fi
1976
1977echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
1978if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
1979  cat >> confdefs.h <<\EOF
1980#define __CHAR_UNSIGNED__ 1
1981EOF
1982
1983fi
1984
1985#
1986# The (?which?) library does not work with unsigned characters.
1987# Force the compiler to use signed chars.
1988if test $ac_cv_c_char_unsigned = yes
1989then
1990        if test "$GCC" = yes
1991        then
1992                CFLAGS="$CFLAGS -fsigned-char"
1993        else
1994                case "$host_os" in
1995                # I don't know when "-signed" was added to IRIX CC
1996                # so err on the side of using it.
1997                irix*)  CFLAGS="$CFLAGS -signed"
1998                        ;;
1999                # need e.g. --force-signed-chars=-signed
2000                *)      { echo "configure: error: I don't know how to force signed chars" 1>&2; exit 1; }
2001                        ;;
2002                esac
2003        fi
2004fi
2005#  __CHAR_UNSIGNED__ will be defined; hope this is OK.
2006
2007# Check for missing functions                                               
2008EXTRA_OBJ=
2009echo $ac_n "checking for usleep""... $ac_c" 1>&6
2010echo "configure:2011: checking for usleep" >&5
2011if eval "test \"`echo '$''{'ac_cv_func_usleep'+set}'`\" = set"; then
2012  echo $ac_n "(cached) $ac_c" 1>&6
2013else
2014  cat > conftest.$ac_ext <<EOF
2015#line 2016 "configure"
2016#include "confdefs.h"
2017/* System header to define __stub macros and hopefully few prototypes,
2018    which can conflict with char usleep(); below.  */
2019#include <assert.h>
2020/* Override any gcc2 internal prototype to avoid an error.  */
2021/* We use char because int might match the return type of a gcc2
2022    builtin and then its argument prototype would still apply.  */
2023char usleep();
2024
2025int main() {
2026
2027/* The GNU C library defines this for functions which it implements
2028    to always fail with ENOSYS.  Some functions are actually named
2029    something starting with __ and the normal name is an alias.  */
2030#if defined (__stub_usleep) || defined (__stub___usleep)
2031choke me
2032#else
2033usleep();
2034#endif
2035
2036; return 0; }
2037EOF
2038if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2039  rm -rf conftest*
2040  eval "ac_cv_func_usleep=yes"
2041else
2042  echo "configure: failed program was:" >&5
2043  cat conftest.$ac_ext >&5
2044  rm -rf conftest*
2045  eval "ac_cv_func_usleep=no"
2046fi
2047rm -f conftest*
2048fi
2049
2050if eval "test \"`echo '$ac_cv_func_'usleep`\" = yes"; then
2051  echo "$ac_t""yes" 1>&6
2052  :
2053else
2054  echo "$ac_t""no" 1>&6
2055EXTRAOBJ="$EXTRA_OBJ usleep.o"
2056         cat >> confdefs.h <<\EOF
2057#define NEED_USLEEP 1
2058EOF
2059
2060fi
2061
2062
2063
2064
2065# Audio device selection,  derived from host type.  Could be smart and probe
2066# what's there...                                                           
2067
2068AU_INC=
2069AU_LIB=
2070AU_OBJ=
2071
2072case "$target" in
2073*solaris*)
2074        SUNAUDIOHOME="/usr/demo/SOUND"
2075        O1KHOME="/opt/SUNWo1kp"
2076        # Check whether --with-sun-audio or --without-sun-audio was given.
2077if test "${with_sun_audio+set}" = set; then
2078  withval="$with_sun_audio"
2079  SUNAUDIOHOME=$withval
2080fi
2081
2082        AU_INC="$AU_INC -I$SUNAUDIOHOME/include"
2083        AU_LIB="$AU_LIB -L$SUNAUDIOHOME/lib -lsound"
2084        AU_OBJ="$AU_OBJ auddev_sparc.o"
2085        cat >> confdefs.h <<\EOF
2086#define HAVE_SPARC_AUDIO 1
2087EOF
2088
2089        # Check whether --with-osprey-audio or --without-osprey-audio was given.
2090if test "${with_osprey_audio+set}" = set; then
2091  withval="$with_osprey_audio"
2092  O1KHOME=$withval
2093fi
2094
2095        ac_safe=`echo "$O1KHOME/include/oti_audio_device.h" | sed 'y%./+-%__p_%'`
2096echo $ac_n "checking for $O1KHOME/include/oti_audio_device.h""... $ac_c" 1>&6
2097echo "configure:2098: checking for $O1KHOME/include/oti_audio_device.h" >&5
2098if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2099  echo $ac_n "(cached) $ac_c" 1>&6
2100else
2101  cat > conftest.$ac_ext <<EOF
2102#line 2103 "configure"
2103#include "confdefs.h"
2104#include <$O1KHOME/include/oti_audio_device.h>
2105EOF
2106ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2107{ (eval echo configure:2108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2108ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2109if test -z "$ac_err"; then
2110  rm -rf conftest*
2111  eval "ac_cv_header_$ac_safe=yes"
2112else
2113  echo "$ac_err" >&5
2114  echo "configure: failed program was:" >&5
2115  cat conftest.$ac_ext >&5
2116  rm -rf conftest*
2117  eval "ac_cv_header_$ac_safe=no"
2118fi
2119rm -f conftest*
2120fi
2121if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2122  echo "$ac_t""yes" 1>&6
2123  AU_INC="$AU_INC -I$O1KHOME/include"
2124                 AU_OBJ="$AU_OBJ auddev_osprey.o"
2125                 cat >> confdefs.h <<\EOF
2126#define HAVE_OSPREY_AUDIO 1
2127EOF
2128
2129else
2130  echo "$ac_t""no" 1>&6
2131fi
2132
2133        ;;
2134*linux*)
2135        AU_OBJ="$AU_OBJ auddev_oss.o"
2136        cat >> confdefs.h <<\EOF
2137#define HAVE_OSS_AUDIO 1
2138EOF
2139
2140        ;;
2141*freebsd*)
2142        # PC Speaker device on FreeBSD
2143        for ac_hdr in machine/pcaudioio.h
2144do
2145ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2146echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2147echo "configure:2148: checking for $ac_hdr" >&5
2148if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2149  echo $ac_n "(cached) $ac_c" 1>&6
2150else
2151  cat > conftest.$ac_ext <<EOF
2152#line 2153 "configure"
2153#include "confdefs.h"
2154#include <$ac_hdr>
2155EOF
2156ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2157{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2158ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2159if test -z "$ac_err"; then
2160  rm -rf conftest*
2161  eval "ac_cv_header_$ac_safe=yes"
2162else
2163  echo "$ac_err" >&5
2164  echo "configure: failed program was:" >&5
2165  cat conftest.$ac_ext >&5
2166  rm -rf conftest*
2167  eval "ac_cv_header_$ac_safe=no"
2168fi
2169rm -f conftest*
2170fi
2171if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2172  echo "$ac_t""yes" 1>&6
2173    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2174  cat >> confdefs.h <<EOF
2175#define $ac_tr_hdr 1
2176EOF
2177 
2178else
2179  echo "$ac_t""no" 1>&6
2180fi
2181done
2182
2183        # Luigi's driver
2184        AU_OBJ="$AU_OBJ auddev_luigi.o"
2185        cat >> confdefs.h <<\EOF
2186#define HAVE_LUIGI_AUDIO 1
2187EOF
2188
2189        ;;
2190*netbsd*)
2191        AU_OBJ="$AUDIOBJ auddev_netbsd.o"
2192        cat >> confdefs.h <<\EOF
2193#define HAVE_NETBSD_AUDIO 1
2194EOF
2195
2196        ;;
2197*irix*)
2198        AU_LIB="$AU_LIB -laudio"
2199        AU_OBJ="$AU_OBJ auddev_sgi.o"
2200        cat >> confdefs.h <<\EOF
2201#define HAVE_SGI_AUDIO 1
2202EOF
2203
2204        ;;
2205*hpux*)
2206        AU_LIB="$AU_LIB -lAlib"
2207        AU_OBJ="$AU_OBJ auddev_hpux_raw.o"
2208        cat >> confdefs.h <<\EOF
2209#define HAVE_HP_AUDIO 1
2210EOF
2211
2212        ;;
2213esac
2214
2215
2216
2217
2218
2219# X
2220# If we find X, set shell vars x_includes and x_libraries to the
2221# paths, otherwise set no_x=yes.
2222# Uses ac_ vars as temps to allow command line to override cache and checks.
2223# --without-x overrides everything else, but does not touch the cache.
2224echo $ac_n "checking for X""... $ac_c" 1>&6
2225echo "configure:2226: checking for X" >&5
2226
2227# Check whether --with-x or --without-x was given.
2228if test "${with_x+set}" = set; then
2229  withval="$with_x"
2230  :
2231fi
2232
2233# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
2234if test "x$with_x" = xno; then
2235  # The user explicitly disabled X.
2236  have_x=disabled
2237else
2238  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
2239    # Both variables are already set.
2240    have_x=yes
2241  else
2242if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
2243  echo $ac_n "(cached) $ac_c" 1>&6
2244else
2245  # One or both of the vars are not set, and there is no cached value.
2246ac_x_includes=NO ac_x_libraries=NO
2247rm -fr conftestdir
2248if mkdir conftestdir; then
2249  cd conftestdir
2250  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
2251  cat > Imakefile <<'EOF'
2252acfindx:
2253        @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
2254EOF
2255  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
2256    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2257    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
2258    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
2259    for ac_extension in a so sl; do
2260      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
2261        test -f $ac_im_libdir/libX11.$ac_extension; then
2262        ac_im_usrlibdir=$ac_im_libdir; break
2263      fi
2264    done
2265    # Screen out bogus values from the imake configuration.  They are
2266    # bogus both because they are the default anyway, and because
2267    # using them would break gcc on systems where it needs fixed includes.
2268    case "$ac_im_incroot" in
2269        /usr/include) ;;
2270        *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
2271    esac
2272    case "$ac_im_usrlibdir" in
2273        /usr/lib | /lib) ;;
2274        *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
2275    esac
2276  fi
2277  cd ..
2278  rm -fr conftestdir
2279fi
2280
2281if test "$ac_x_includes" = NO; then
2282  # Guess where to find include files, by looking for this one X11 .h file.
2283  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
2284
2285  # First, try using that file with no special directory specified.
2286cat > conftest.$ac_ext <<EOF
2287#line 2288 "configure"
2288#include "confdefs.h"
2289#include <$x_direct_test_include>
2290EOF
2291ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2292{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2293ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2294if test -z "$ac_err"; then
2295  rm -rf conftest*
2296  # We can compile using X headers with no special include directory.
2297ac_x_includes=
2298else
2299  echo "$ac_err" >&5
2300  echo "configure: failed program was:" >&5
2301  cat conftest.$ac_ext >&5
2302  rm -rf conftest*
2303  # Look for the header file in a standard set of common directories.
2304# Check X11 before X11Rn because it is often a symlink to the current release.
2305  for ac_dir in               \
2306    /usr/X11/include          \
2307    /usr/X11R6/include        \
2308    /usr/X11R5/include        \
2309    /usr/X11R4/include        \
2310                              \
2311    /usr/include/X11          \
2312    /usr/include/X11R6        \
2313    /usr/include/X11R5        \
2314    /usr/include/X11R4        \
2315                              \
2316    /usr/local/X11/include    \
2317    /usr/local/X11R6/include  \
2318    /usr/local/X11R5/include  \
2319    /usr/local/X11R4/include  \
2320                              \
2321    /usr/local/include/X11    \
2322    /usr/local/include/X11R6  \
2323    /usr/local/include/X11R5  \
2324    /usr/local/include/X11R4  \
2325                              \
2326    /usr/X386/include         \
2327    /usr/x386/include         \
2328    /usr/XFree86/include/X11  \
2329                              \
2330    /usr/include              \
2331    /usr/local/include        \
2332    /usr/unsupported/include  \
2333    /usr/athena/include       \
2334    /usr/local/x11r5/include  \
2335    /usr/lpp/Xamples/include  \
2336                              \
2337    /usr/openwin/include      \
2338    /usr/openwin/share/include \
2339    ; \
2340  do
2341    if test -r "$ac_dir/$x_direct_test_include"; then
2342      ac_x_includes=$ac_dir
2343      break
2344    fi
2345  done
2346fi
2347rm -f conftest*
2348fi # $ac_x_includes = NO
2349
2350if test "$ac_x_libraries" = NO; then
2351  # Check for the libraries.
2352
2353  test -z "$x_direct_test_library" && x_direct_test_library=Xt
2354  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
2355
2356  # See if we find them without any special options.
2357  # Don't add to $LIBS permanently.
2358  ac_save_LIBS="$LIBS"
2359  LIBS="-l$x_direct_test_library $LIBS"
2360cat > conftest.$ac_ext <<EOF
2361#line 2362 "configure"
2362#include "confdefs.h"
2363
2364int main() {
2365${x_direct_test_function}()
2366; return 0; }
2367EOF
2368if { (eval echo configure:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2369  rm -rf conftest*
2370  LIBS="$ac_save_LIBS"
2371# We can link X programs with no special library path.
2372ac_x_libraries=
2373else
2374  echo "configure: failed program was:" >&5
2375  cat conftest.$ac_ext >&5
2376  rm -rf conftest*
2377  LIBS="$ac_save_LIBS"
2378# First see if replacing the include by lib works.
2379# Check X11 before X11Rn because it is often a symlink to the current release.
2380for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
2381    /usr/X11/lib          \
2382    /usr/X11R6/lib        \
2383    /usr/X11R5/lib        \
2384    /usr/X11R4/lib        \
2385                          \
2386    /usr/lib/X11          \
2387    /usr/lib/X11R6        \
2388    /usr/lib/X11R5        \
2389    /usr/lib/X11R4        \
2390                          \
2391    /usr/local/X11/lib    \
2392    /usr/local/X11R6/lib  \
2393    /usr/local/X11R5/lib  \
2394    /usr/local/X11R4/lib  \
2395                          \
2396    /usr/local/lib/X11    \
2397    /usr/local/lib/X11R6  \
2398    /usr/local/lib/X11R5  \
2399    /usr/local/lib/X11R4  \
2400                          \
2401    /usr/X386/lib         \
2402    /usr/x386/lib         \
2403    /usr/XFree86/lib/X11  \
2404                          \
2405    /usr/lib              \
2406    /usr/local/lib        \
2407    /usr/unsupported/lib  \
2408    /usr/athena/lib       \
2409    /usr/local/x11r5/lib  \
2410    /usr/lpp/Xamples/lib  \
2411    /lib/usr/lib/X11      \
2412                          \
2413    /usr/openwin/lib      \
2414    /usr/openwin/share/lib \
2415    ; \
2416do
2417  for ac_extension in a so sl; do
2418    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
2419      ac_x_libraries=$ac_dir
2420      break 2
2421    fi
2422  done
2423done
2424fi
2425rm -f conftest*
2426fi # $ac_x_libraries = NO
2427
2428if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
2429  # Didn't find X anywhere.  Cache the known absence of X.
2430  ac_cv_have_x="have_x=no"
2431else
2432  # Record where we found X for the cache.
2433  ac_cv_have_x="have_x=yes \
2434                ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
2435fi
2436fi
2437  fi
2438  eval "$ac_cv_have_x"
2439fi # $with_x != no
2440
2441if test "$have_x" != yes; then
2442  echo "$ac_t""$have_x" 1>&6
2443  no_x=yes
2444else
2445  # If each of the values was on the command line, it overrides each guess.
2446  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
2447  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
2448  # Update the cache value to reflect the command line values.
2449  ac_cv_have_x="have_x=yes \
2450                ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
2451  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
2452fi
2453
2454if test "$no_x" = yes; then
2455  # Not all programs may use this symbol, but it does not hurt to define it.
2456  cat >> confdefs.h <<\EOF
2457#define X_DISPLAY_MISSING 1
2458EOF
2459
2460  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
2461else
2462  if test -n "$x_includes"; then
2463    X_CFLAGS="$X_CFLAGS -I$x_includes"
2464  fi
2465
2466  # It would also be nice to do this for all -L options, not just this one.
2467  if test -n "$x_libraries"; then
2468    X_LIBS="$X_LIBS -L$x_libraries"
2469    # For Solaris; some versions of Sun CC require a space after -R and
2470    # others require no space.  Words are not sufficient . . . .
2471    case "`(uname -sr) 2>/dev/null`" in
2472    "SunOS 5"*)
2473      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
2474echo "configure:2475: checking whether -R must be followed by a space" >&5
2475      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
2476      cat > conftest.$ac_ext <<EOF
2477#line 2478 "configure"
2478#include "confdefs.h"
2479
2480int main() {
2481
2482; return 0; }
2483EOF
2484if { (eval echo configure:2485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2485  rm -rf conftest*
2486  ac_R_nospace=yes
2487else
2488  echo "configure: failed program was:" >&5
2489  cat conftest.$ac_ext >&5
2490  rm -rf conftest*
2491  ac_R_nospace=no
2492fi
2493rm -f conftest*
2494      if test $ac_R_nospace = yes; then
2495        echo "$ac_t""no" 1>&6
2496        X_LIBS="$X_LIBS -R$x_libraries"
2497      else
2498        LIBS="$ac_xsave_LIBS -R $x_libraries"
2499        cat > conftest.$ac_ext <<EOF
2500#line 2501 "configure"
2501#include "confdefs.h"
2502
2503int main() {
2504
2505; return 0; }
2506EOF
2507if { (eval echo configure:2508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2508  rm -rf conftest*
2509  ac_R_space=yes
2510else
2511  echo "configure: failed program was:" >&5
2512  cat conftest.$ac_ext >&5
2513  rm -rf conftest*
2514  ac_R_space=no
2515fi
2516rm -f conftest*
2517        if test $ac_R_space = yes; then
2518          echo "$ac_t""yes" 1>&6
2519          X_LIBS="$X_LIBS -R $x_libraries"
2520        else
2521          echo "$ac_t""neither works" 1>&6
2522        fi
2523      fi
2524      LIBS="$ac_xsave_LIBS"
2525    esac
2526  fi
2527
2528  # Check for system-dependent libraries X programs must link with.
2529  # Do this before checking for the system-independent R6 libraries
2530  # (-lICE), since we may need -lsocket or whatever for X linking.
2531
2532  if test "$ISC" = yes; then
2533    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
2534  else
2535    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
2536    # libraries were built with DECnet support.  And karl@cs.umb.edu says
2537    # the Alpha needs dnet_stub (dnet does not exist).
2538    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
2539echo "configure:2540: checking for dnet_ntoa in -ldnet" >&5
2540ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2541if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2542  echo $ac_n "(cached) $ac_c" 1>&6
2543else
2544  ac_save_LIBS="$LIBS"
2545LIBS="-ldnet  $LIBS"
2546cat > conftest.$ac_ext <<EOF
2547#line 2548 "configure"
2548#include "confdefs.h"
2549/* Override any gcc2 internal prototype to avoid an error.  */
2550/* We use char because int might match the return type of a gcc2
2551    builtin and then its argument prototype would still apply.  */
2552char dnet_ntoa();
2553
2554int main() {
2555dnet_ntoa()
2556; return 0; }
2557EOF
2558if { (eval echo configure:2559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2559  rm -rf conftest*
2560  eval "ac_cv_lib_$ac_lib_var=yes"
2561else
2562  echo "configure: failed program was:" >&5
2563  cat conftest.$ac_ext >&5
2564  rm -rf conftest*
2565  eval "ac_cv_lib_$ac_lib_var=no"
2566fi
2567rm -f conftest*
2568LIBS="$ac_save_LIBS"
2569
2570fi
2571if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2572  echo "$ac_t""yes" 1>&6
2573  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
2574else
2575  echo "$ac_t""no" 1>&6
2576fi
2577
2578    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
2579      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
2580echo "configure:2581: checking for dnet_ntoa in -ldnet_stub" >&5
2581ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
2582if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2583  echo $ac_n "(cached) $ac_c" 1>&6
2584else
2585  ac_save_LIBS="$LIBS"
2586LIBS="-ldnet_stub  $LIBS"
2587cat > conftest.$ac_ext <<EOF
2588#line 2589 "configure"
2589#include "confdefs.h"
2590/* Override any gcc2 internal prototype to avoid an error.  */
2591/* We use char because int might match the return type of a gcc2
2592    builtin and then its argument prototype would still apply.  */
2593char dnet_ntoa();
2594
2595int main() {
2596dnet_ntoa()
2597; return 0; }
2598EOF
2599if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2600  rm -rf conftest*
2601  eval "ac_cv_lib_$ac_lib_var=yes"
2602else
2603  echo "configure: failed program was:" >&5
2604  cat conftest.$ac_ext >&5
2605  rm -rf conftest*
2606  eval "ac_cv_lib_$ac_lib_var=no"
2607fi
2608rm -f conftest*
2609LIBS="$ac_save_LIBS"
2610
2611fi
2612if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2613  echo "$ac_t""yes" 1>&6
2614  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
2615else
2616  echo "$ac_t""no" 1>&6
2617fi
2618
2619    fi
2620
2621    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
2622    # to get the SysV transport functions.
2623    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
2624    # needs -lnsl.
2625    # The nsl library prevents programs from opening the X display
2626    # on Irix 5.2, according to dickey@clark.net.
2627    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
2628echo "configure:2629: checking for gethostbyname" >&5
2629if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
2630  echo $ac_n "(cached) $ac_c" 1>&6
2631else
2632  cat > conftest.$ac_ext <<EOF
2633#line 2634 "configure"
2634#include "confdefs.h"
2635/* System header to define __stub macros and hopefully few prototypes,
2636    which can conflict with char gethostbyname(); below.  */
2637#include <assert.h>
2638/* Override any gcc2 internal prototype to avoid an error.  */
2639/* We use char because int might match the return type of a gcc2
2640    builtin and then its argument prototype would still apply.  */
2641char gethostbyname();
2642
2643int main() {
2644
2645/* The GNU C library defines this for functions which it implements
2646    to always fail with ENOSYS.  Some functions are actually named
2647    something starting with __ and the normal name is an alias.  */
2648#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
2649choke me
2650#else
2651gethostbyname();
2652#endif
2653
2654; return 0; }
2655EOF
2656if { (eval echo configure:2657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2657  rm -rf conftest*
2658  eval "ac_cv_func_gethostbyname=yes"
2659else
2660  echo "configure: failed program was:" >&5
2661  cat conftest.$ac_ext >&5
2662  rm -rf conftest*
2663  eval "ac_cv_func_gethostbyname=no"
2664fi
2665rm -f conftest*
2666fi
2667
2668if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
2669  echo "$ac_t""yes" 1>&6
2670  :
2671else
2672  echo "$ac_t""no" 1>&6
2673fi
2674
2675    if test $ac_cv_func_gethostbyname = no; then
2676      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
2677echo "configure:2678: checking for gethostbyname in -lnsl" >&5
2678ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
2679if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2680  echo $ac_n "(cached) $ac_c" 1>&6
2681else
2682  ac_save_LIBS="$LIBS"
2683LIBS="-lnsl  $LIBS"
2684cat > conftest.$ac_ext <<EOF
2685#line 2686 "configure"
2686#include "confdefs.h"
2687/* Override any gcc2 internal prototype to avoid an error.  */
2688/* We use char because int might match the return type of a gcc2
2689    builtin and then its argument prototype would still apply.  */
2690char gethostbyname();
2691
2692int main() {
2693gethostbyname()
2694; return 0; }
2695EOF
2696if { (eval echo configure:2697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2697  rm -rf conftest*
2698  eval "ac_cv_lib_$ac_lib_var=yes"
2699else
2700  echo "configure: failed program was:" >&5
2701  cat conftest.$ac_ext >&5
2702  rm -rf conftest*
2703  eval "ac_cv_lib_$ac_lib_var=no"
2704fi
2705rm -f conftest*
2706LIBS="$ac_save_LIBS"
2707
2708fi
2709if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2710  echo "$ac_t""yes" 1>&6
2711  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2712else
2713  echo "$ac_t""no" 1>&6
2714fi
2715
2716    fi
2717
2718    # lieder@skyler.mavd.honeywell.com says without -lsocket,
2719    # socket/setsockopt and other routines are undefined under SCO ODT
2720    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
2721    # on later versions), says simon@lia.di.epfl.ch: it contains
2722    # gethostby* variants that don't use the nameserver (or something).
2723    # -lsocket must be given before -lnsl if both are needed.
2724    # We assume that if connect needs -lnsl, so does gethostbyname.
2725    echo $ac_n "checking for connect""... $ac_c" 1>&6
2726echo "configure:2727: checking for connect" >&5
2727if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
2728  echo $ac_n "(cached) $ac_c" 1>&6
2729else
2730  cat > conftest.$ac_ext <<EOF
2731#line 2732 "configure"
2732#include "confdefs.h"
2733/* System header to define __stub macros and hopefully few prototypes,
2734    which can conflict with char connect(); below.  */
2735#include <assert.h>
2736/* Override any gcc2 internal prototype to avoid an error.  */
2737/* We use char because int might match the return type of a gcc2
2738    builtin and then its argument prototype would still apply.  */
2739char connect();
2740
2741int main() {
2742
2743/* The GNU C library defines this for functions which it implements
2744    to always fail with ENOSYS.  Some functions are actually named
2745    something starting with __ and the normal name is an alias.  */
2746#if defined (__stub_connect) || defined (__stub___connect)
2747choke me
2748#else
2749connect();
2750#endif
2751
2752; return 0; }
2753EOF
2754if { (eval echo configure:2755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2755  rm -rf conftest*
2756  eval "ac_cv_func_connect=yes"
2757else
2758  echo "configure: failed program was:" >&5
2759  cat conftest.$ac_ext >&5
2760  rm -rf conftest*
2761  eval "ac_cv_func_connect=no"
2762fi
2763rm -f conftest*
2764fi
2765
2766if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
2767  echo "$ac_t""yes" 1>&6
2768  :
2769else
2770  echo "$ac_t""no" 1>&6
2771fi
2772
2773    if test $ac_cv_func_connect = no; then
2774      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
2775echo "configure:2776: checking for connect in -lsocket" >&5
2776ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
2777if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2778  echo $ac_n "(cached) $ac_c" 1>&6
2779else
2780  ac_save_LIBS="$LIBS"
2781LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
2782cat > conftest.$ac_ext <<EOF
2783#line 2784 "configure"
2784#include "confdefs.h"
2785/* Override any gcc2 internal prototype to avoid an error.  */
2786/* We use char because int might match the return type of a gcc2
2787    builtin and then its argument prototype would still apply.  */
2788char connect();
2789
2790int main() {
2791connect()
2792; return 0; }
2793EOF
2794if { (eval echo configure:2795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2795  rm -rf conftest*
2796  eval "ac_cv_lib_$ac_lib_var=yes"
2797else
2798  echo "configure: failed program was:" >&5
2799  cat conftest.$ac_ext >&5
2800  rm -rf conftest*
2801  eval "ac_cv_lib_$ac_lib_var=no"
2802fi
2803rm -f conftest*
2804LIBS="$ac_save_LIBS"
2805
2806fi
2807if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2808  echo "$ac_t""yes" 1>&6
2809  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
2810else
2811  echo "$ac_t""no" 1>&6
2812fi
2813
2814    fi
2815
2816    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
2817    echo $ac_n "checking for remove""... $ac_c" 1>&6
2818echo "configure:2819: checking for remove" >&5
2819if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
2820  echo $ac_n "(cached) $ac_c" 1>&6
2821else
2822  cat > conftest.$ac_ext <<EOF
2823#line 2824 "configure"
2824#include "confdefs.h"
2825/* System header to define __stub macros and hopefully few prototypes,
2826    which can conflict with char remove(); below.  */
2827#include <assert.h>
2828/* Override any gcc2 internal prototype to avoid an error.  */
2829/* We use char because int might match the return type of a gcc2
2830    builtin and then its argument prototype would still apply.  */
2831char remove();
2832
2833int main() {
2834
2835/* The GNU C library defines this for functions which it implements
2836    to always fail with ENOSYS.  Some functions are actually named
2837    something starting with __ and the normal name is an alias.  */
2838#if defined (__stub_remove) || defined (__stub___remove)
2839choke me
2840#else
2841remove();
2842#endif
2843
2844; return 0; }
2845EOF
2846if { (eval echo configure:2847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2847  rm -rf conftest*
2848  eval "ac_cv_func_remove=yes"
2849else
2850  echo "configure: failed program was:" >&5
2851  cat conftest.$ac_ext >&5
2852  rm -rf conftest*
2853  eval "ac_cv_func_remove=no"
2854fi
2855rm -f conftest*
2856fi
2857
2858if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
2859  echo "$ac_t""yes" 1>&6
2860  :
2861else
2862  echo "$ac_t""no" 1>&6
2863fi
2864
2865    if test $ac_cv_func_remove = no; then
2866      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
2867echo "configure:2868: checking for remove in -lposix" >&5
2868ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
2869if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2870  echo $ac_n "(cached) $ac_c" 1>&6
2871else
2872  ac_save_LIBS="$LIBS"
2873LIBS="-lposix  $LIBS"
2874cat > conftest.$ac_ext <<EOF
2875#line 2876 "configure"
2876#include "confdefs.h"
2877/* Override any gcc2 internal prototype to avoid an error.  */
2878/* We use char because int might match the return type of a gcc2
2879    builtin and then its argument prototype would still apply.  */
2880char remove();
2881
2882int main() {
2883remove()
2884; return 0; }
2885EOF
2886if { (eval echo configure:2887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2887  rm -rf conftest*
2888  eval "ac_cv_lib_$ac_lib_var=yes"
2889else
2890  echo "configure: failed program was:" >&5
2891  cat conftest.$ac_ext >&5
2892  rm -rf conftest*
2893  eval "ac_cv_lib_$ac_lib_var=no"
2894fi
2895rm -f conftest*
2896LIBS="$ac_save_LIBS"
2897
2898fi
2899if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2900  echo "$ac_t""yes" 1>&6
2901  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
2902else
2903  echo "$ac_t""no" 1>&6
2904fi
2905
2906    fi
2907
2908    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
2909    echo $ac_n "checking for shmat""... $ac_c" 1>&6
2910echo "configure:2911: checking for shmat" >&5
2911if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
2912  echo $ac_n "(cached) $ac_c" 1>&6
2913else
2914  cat > conftest.$ac_ext <<EOF
2915#line 2916 "configure"
2916#include "confdefs.h"
2917/* System header to define __stub macros and hopefully few prototypes,
2918    which can conflict with char shmat(); below.  */
2919#include <assert.h>
2920/* Override any gcc2 internal prototype to avoid an error.  */
2921/* We use char because int might match the return type of a gcc2
2922    builtin and then its argument prototype would still apply.  */
2923char shmat();
2924
2925int main() {
2926
2927/* The GNU C library defines this for functions which it implements
2928    to always fail with ENOSYS.  Some functions are actually named
2929    something starting with __ and the normal name is an alias.  */
2930#if defined (__stub_shmat) || defined (__stub___shmat)
2931choke me
2932#else
2933shmat();
2934#endif
2935
2936; return 0; }
2937EOF
2938if { (eval echo configure:2939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2939  rm -rf conftest*
2940  eval "ac_cv_func_shmat=yes"
2941else
2942  echo "configure: failed program was:" >&5
2943  cat conftest.$ac_ext >&5
2944  rm -rf conftest*
2945  eval "ac_cv_func_shmat=no"
2946fi
2947rm -f conftest*
2948fi
2949
2950if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
2951  echo "$ac_t""yes" 1>&6
2952  :
2953else
2954  echo "$ac_t""no" 1>&6
2955fi
2956
2957    if test $ac_cv_func_shmat = no; then
2958      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
2959echo "configure:2960: checking for shmat in -lipc" >&5
2960ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
2961if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2962  echo $ac_n "(cached) $ac_c" 1>&6
2963else
2964  ac_save_LIBS="$LIBS"
2965LIBS="-lipc  $LIBS"
2966cat > conftest.$ac_ext <<EOF
2967#line 2968 "configure"
2968#include "confdefs.h"
2969/* Override any gcc2 internal prototype to avoid an error.  */
2970/* We use char because int might match the return type of a gcc2
2971    builtin and then its argument prototype would still apply.  */
2972char shmat();
2973
2974int main() {
2975shmat()
2976; return 0; }
2977EOF
2978if { (eval echo configure:2979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2979  rm -rf conftest*
2980  eval "ac_cv_lib_$ac_lib_var=yes"
2981else
2982  echo "configure: failed program was:" >&5
2983  cat conftest.$ac_ext >&5
2984  rm -rf conftest*
2985  eval "ac_cv_lib_$ac_lib_var=no"
2986fi
2987rm -f conftest*
2988LIBS="$ac_save_LIBS"
2989
2990fi
2991if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2992  echo "$ac_t""yes" 1>&6
2993  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
2994else
2995  echo "$ac_t""no" 1>&6
2996fi
2997
2998    fi
2999  fi
3000
3001  # Check for libraries that X11R6 Xt/Xaw programs need.
3002  ac_save_LDFLAGS="$LDFLAGS"
3003  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
3004  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
3005  # check for ICE first), but we must link in the order -lSM -lICE or
3006  # we get undefined symbols.  So assume we have SM if we have ICE.
3007  # These have to be linked with before -lX11, unlike the other
3008  # libraries we check for below, so use a different variable.
3009  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
3010  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
3011echo "configure:3012: checking for IceConnectionNumber in -lICE" >&5
3012ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
3013if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3014  echo $ac_n "(cached) $ac_c" 1>&6
3015else
3016  ac_save_LIBS="$LIBS"
3017LIBS="-lICE $X_EXTRA_LIBS $LIBS"
3018cat > conftest.$ac_ext <<EOF
3019#line 3020 "configure"
3020#include "confdefs.h"
3021/* Override any gcc2 internal prototype to avoid an error.  */
3022/* We use char because int might match the return type of a gcc2
3023    builtin and then its argument prototype would still apply.  */
3024char IceConnectionNumber();
3025
3026int main() {
3027IceConnectionNumber()
3028; return 0; }
3029EOF
3030if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3031  rm -rf conftest*
3032  eval "ac_cv_lib_$ac_lib_var=yes"
3033else
3034  echo "configure: failed program was:" >&5
3035  cat conftest.$ac_ext >&5
3036  rm -rf conftest*
3037  eval "ac_cv_lib_$ac_lib_var=no"
3038fi
3039rm -f conftest*
3040LIBS="$ac_save_LIBS"
3041
3042fi
3043if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3044  echo "$ac_t""yes" 1>&6
3045  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
3046else
3047  echo "$ac_t""no" 1>&6
3048fi
3049
3050  LDFLAGS="$ac_save_LDFLAGS"
3051
3052fi
3053
3054
3055
3056
3057
3058
3059# TCL/TK
3060# Hopefully using UCL modified Tcl/Tk.
3061PARENT=`echo $PWD | sed -e 's%/[^/]*$%%'`
3062TCL_INC=${PARENT}/tcl-8.0/generic
3063TCL_LIB=${PARENT}/tcl-8.0/unix
3064
3065# Check whether --with-tcl or --without-tcl was given.
3066if test "${with_tcl+set}" = set; then
3067  withval="$with_tcl"
3068   TCL_INC=$withval/include
3069          TCL_LIB=$withval/lib
3070fi
3071
3072
3073ac_safe=`echo "${TCL_INC}/tcl.h" | sed 'y%./+-%__p_%'`
3074echo $ac_n "checking for ${TCL_INC}/tcl.h""... $ac_c" 1>&6
3075echo "configure:3076: checking for ${TCL_INC}/tcl.h" >&5
3076if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3077  echo $ac_n "(cached) $ac_c" 1>&6
3078else
3079  cat > conftest.$ac_ext <<EOF
3080#line 3081 "configure"
3081#include "confdefs.h"
3082#include <${TCL_INC}/tcl.h>
3083EOF
3084ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3085{ (eval echo configure:3086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3086ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3087if test -z "$ac_err"; then
3088  rm -rf conftest*
3089  eval "ac_cv_header_$ac_safe=yes"
3090else
3091  echo "$ac_err" >&5
3092  echo "configure: failed program was:" >&5
3093  cat conftest.$ac_ext >&5
3094  rm -rf conftest*
3095  eval "ac_cv_header_$ac_safe=no"
3096fi
3097rm -f conftest*
3098fi
3099if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3100  echo "$ac_t""yes" 1>&6
3101  TCL_INC=-I${TCL_INC}/tcl8.0
3102else
3103  echo "$ac_t""no" 1>&6
3104ac_safe=`echo "${TCL_INC}/tcl8.0/tcl.h" | sed 'y%./+-%__p_%'`
3105echo $ac_n "checking for ${TCL_INC}/tcl8.0/tcl.h""... $ac_c" 1>&6
3106echo "configure:3107: checking for ${TCL_INC}/tcl8.0/tcl.h" >&5
3107if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3108  echo $ac_n "(cached) $ac_c" 1>&6
3109else
3110  cat > conftest.$ac_ext <<EOF
3111#line 3112 "configure"
3112#include "confdefs.h"
3113#include <${TCL_INC}/tcl8.0/tcl.h>
3114EOF
3115ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3116{ (eval echo configure:3117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3117ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3118if test -z "$ac_err"; then
3119  rm -rf conftest*
3120  eval "ac_cv_header_$ac_safe=yes"
3121else
3122  echo "$ac_err" >&5
3123  echo "configure: failed program was:" >&5
3124  cat conftest.$ac_ext >&5
3125  rm -rf conftest*
3126  eval "ac_cv_header_$ac_safe=no"
3127fi
3128rm -f conftest*
3129fi
3130if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3131  echo "$ac_t""yes" 1>&6
3132  TCL_INC=-I${TCL_INC}/tcl8.0
3133else
3134  echo "$ac_t""no" 1>&6
3135 
3136                        echo "Could not find tcl.h.  One of the following halted progress:"
3137                        echo "   (a) Tcl is not installed."
3138                        echo "   (b) Tcl's location was mis-specified, or not specified (--with-tcl=DIR)."
3139                        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3140                        exit
3141               
3142fi
3143
3144       
3145fi
3146
3147
3148echo $ac_n "checking for Tcl_Init in -ltcl8.0""... $ac_c" 1>&6
3149echo "configure:3150: checking for Tcl_Init in -ltcl8.0" >&5
3150ac_lib_var=`echo tcl8.0'_'Tcl_Init | sed 'y%./+-%__p_%'`
3151if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3152  echo $ac_n "(cached) $ac_c" 1>&6
3153else
3154  ac_save_LIBS="$LIBS"
3155LIBS="-ltcl8.0 -L${TCL_LIB} -lm $LIBS"
3156cat > conftest.$ac_ext <<EOF
3157#line 3158 "configure"
3158#include "confdefs.h"
3159/* Override any gcc2 internal prototype to avoid an error.  */
3160/* We use char because int might match the return type of a gcc2
3161    builtin and then its argument prototype would still apply.  */
3162char Tcl_Init();
3163
3164int main() {
3165Tcl_Init()
3166; return 0; }
3167EOF
3168if { (eval echo configure:3169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3169  rm -rf conftest*
3170  eval "ac_cv_lib_$ac_lib_var=yes"
3171else
3172  echo "configure: failed program was:" >&5
3173  cat conftest.$ac_ext >&5
3174  rm -rf conftest*
3175  eval "ac_cv_lib_$ac_lib_var=no"
3176fi
3177rm -f conftest*
3178LIBS="$ac_save_LIBS"
3179
3180fi
3181if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3182  echo "$ac_t""yes" 1>&6
3183  TCL_LIB="-L$TCL_LIB -ltcl8.0"
3184else
3185  echo "$ac_t""no" 1>&6
3186echo $ac_n "checking for Tcl_Init in -ltcl80""... $ac_c" 1>&6
3187echo "configure:3188: checking for Tcl_Init in -ltcl80" >&5
3188ac_lib_var=`echo tcl80'_'Tcl_Init | sed 'y%./+-%__p_%'`
3189if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3190  echo $ac_n "(cached) $ac_c" 1>&6
3191else
3192  ac_save_LIBS="$LIBS"
3193LIBS="-ltcl80 -L${TCL_LIB} -lm $LIBS"
3194cat > conftest.$ac_ext <<EOF
3195#line 3196 "configure"
3196#include "confdefs.h"
3197/* Override any gcc2 internal prototype to avoid an error.  */
3198/* We use char because int might match the return type of a gcc2
3199    builtin and then its argument prototype would still apply.  */
3200char Tcl_Init();
3201
3202int main() {
3203Tcl_Init()
3204; return 0; }
3205EOF
3206if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3207  rm -rf conftest*
3208  eval "ac_cv_lib_$ac_lib_var=yes"
3209else
3210  echo "configure: failed program was:" >&5
3211  cat conftest.$ac_ext >&5
3212  rm -rf conftest*
3213  eval "ac_cv_lib_$ac_lib_var=no"
3214fi
3215rm -f conftest*
3216LIBS="$ac_save_LIBS"
3217
3218fi
3219if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3220  echo "$ac_t""yes" 1>&6
3221  TCL_LIB="-L$TCL_LIB -ltcl80"
3222else
3223  echo "$ac_t""no" 1>&6
3224
3225                        echo "Could not find Tcl library.  One of the following halted progess:"
3226                        echo "   (a) Tcl is not installed."
3227                        echo "   (b) Library is not built or not in expected location (--with-tcl=DIR)."
3228                        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3229                        exit
3230               
3231fi
3232
3233fi
3234
3235
3236TK_INC=${PARENT}/tk-8.0/generic
3237TK_LIB=${PARENT}/tk-8.0/unix
3238
3239# Check whether --with-tk or --without-tk was given.
3240if test "${with_tk+set}" = set; then
3241  withval="$with_tk"
3242   TK_INC=$withval/include
3243          TK_LIB=$withval/lib
3244fi
3245
3246
3247# NB for tk.h we don't want to compile anything, AC_CHECK_HEADER(S) compiles
3248# a file with specified header, but does not include X and tcl headers.
3249# Could use AC_TRY_CPP with $ac_x_include/Xlib.h, etc... for time being just
3250# check for existence...autoconf generates a warning here.
3251
3252ac_safe=`echo "$TK_INC/tk.h" | sed 'y%./+-%__p_%'`
3253echo $ac_n "checking for $TK_INC/tk.h""... $ac_c" 1>&6
3254echo "configure:3255: checking for $TK_INC/tk.h" >&5
3255if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
3256  echo $ac_n "(cached) $ac_c" 1>&6
3257else
3258  if test "$cross_compiling" = yes; then
3259    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
3260else
3261  if test -r $TK_INC/tk.h; then
3262    eval "ac_cv_file_$ac_safe=yes"
3263  else
3264    eval "ac_cv_file_$ac_safe=no"
3265  fi
3266fi
3267fi
3268if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
3269  echo "$ac_t""yes" 1>&6
3270  TK_INC=-I${TK_INC}/tk8.0
3271else
3272  echo "$ac_t""no" 1>&6
3273
3274               
3275ac_safe=`echo "$TK_INC/tk8.0/tk.h" | sed 'y%./+-%__p_%'`
3276echo $ac_n "checking for $TK_INC/tk8.0/tk.h""... $ac_c" 1>&6
3277echo "configure:3278: checking for $TK_INC/tk8.0/tk.h" >&5
3278if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
3279  echo $ac_n "(cached) $ac_c" 1>&6
3280else
3281  if test "$cross_compiling" = yes; then
3282    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
3283else
3284  if test -r $TK_INC/tk8.0/tk.h; then
3285    eval "ac_cv_file_$ac_safe=yes"
3286  else
3287    eval "ac_cv_file_$ac_safe=no"
3288  fi
3289fi
3290fi
3291if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
3292  echo "$ac_t""yes" 1>&6
3293  TK_INC=-I${TK_INC}/tk8.0
3294else
3295  echo "$ac_t""no" 1>&6
3296 
3297                        echo "Could not find tk.h.  One of the following halted progress:"
3298                        echo "   (a) Tk is not installed."
3299                        echo "   (b) Tk's location was mis-specified, or not specified (--with-tk=DIR)."
3300                        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3301                        exit
3302               
3303fi
3304
3305       
3306fi
3307
3308
3309echo $ac_n "checking for Tk_Init in -ltk8.0""... $ac_c" 1>&6
3310echo "configure:3311: checking for Tk_Init in -ltk8.0" >&5
3311ac_lib_var=`echo tk8.0'_'Tk_Init | sed 'y%./+-%__p_%'`
3312if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3313  echo $ac_n "(cached) $ac_c" 1>&6
3314else
3315  ac_save_LIBS="$LIBS"
3316LIBS="-ltk8.0 -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS  -lXext -lX11 $X_EXTRA_LIBS -lm $LIBS"
3317cat > conftest.$ac_ext <<EOF
3318#line 3319 "configure"
3319#include "confdefs.h"
3320/* Override any gcc2 internal prototype to avoid an error.  */
3321/* We use char because int might match the return type of a gcc2
3322    builtin and then its argument prototype would still apply.  */
3323char Tk_Init();
3324
3325int main() {
3326Tk_Init()
3327; return 0; }
3328EOF
3329if { (eval echo configure:3330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3330  rm -rf conftest*
3331  eval "ac_cv_lib_$ac_lib_var=yes"
3332else
3333  echo "configure: failed program was:" >&5
3334  cat conftest.$ac_ext >&5
3335  rm -rf conftest*
3336  eval "ac_cv_lib_$ac_lib_var=no"
3337fi
3338rm -f conftest*
3339LIBS="$ac_save_LIBS"
3340
3341fi
3342if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3343  echo "$ac_t""yes" 1>&6
3344  TK_LIB="-L$TK_LIB -ltk8.0"
3345else
3346  echo "$ac_t""no" 1>&6
3347echo $ac_n "checking for Tk_Init in -ltk80""... $ac_c" 1>&6
3348echo "configure:3349: checking for Tk_Init in -ltk80" >&5
3349ac_lib_var=`echo tk80'_'Tk_Init | sed 'y%./+-%__p_%'`
3350if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3351  echo $ac_n "(cached) $ac_c" 1>&6
3352else
3353  ac_save_LIBS="$LIBS"
3354LIBS="-ltk80 -L${TK_LIB} ${TCL_LIB} $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS -lm $LIBS"
3355cat > conftest.$ac_ext <<EOF
3356#line 3357 "configure"
3357#include "confdefs.h"
3358/* Override any gcc2 internal prototype to avoid an error.  */
3359/* We use char because int might match the return type of a gcc2
3360    builtin and then its argument prototype would still apply.  */
3361char Tk_Init();
3362
3363int main() {
3364Tk_Init()
3365; return 0; }
3366EOF
3367if { (eval echo configure:3368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3368  rm -rf conftest*
3369  eval "ac_cv_lib_$ac_lib_var=yes"
3370else
3371  echo "configure: failed program was:" >&5
3372  cat conftest.$ac_ext >&5
3373  rm -rf conftest*
3374  eval "ac_cv_lib_$ac_lib_var=no"
3375fi
3376rm -f conftest*
3377LIBS="$ac_save_LIBS"
3378
3379fi
3380if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3381  echo "$ac_t""yes" 1>&6
3382  TK_LIB="-L$TK_LIB -ltk80"
3383else
3384  echo "$ac_t""no" 1>&6
3385
3386                        echo "Could not find Tk library.  One of the following halted progess:"
3387                        echo "   (a) Tk is not installed."
3388                        echo "   (b) Library is not built or not in expected location (--with-tk=DIR)."
3389                        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3390                        exit
3391               
3392fi
3393
3394fi
3395
3396
3397
3398
3399
3400
3401
3402# XXX Add check for common
3403
3404COMMON_INC=${PARENT}/common
3405COMMON_LIB=${PARENT}/common
3406
3407# Check whether --with-common or --without-common was given.
3408if test "${with_common+set}" = set; then
3409  withval="$with_common"
3410   COMMON_INC=$withval
3411          COMMON_LIB=$withval
3412fi
3413
3414
3415ac_safe=`echo "${COMMON_INC}/mbus.h" | sed 'y%./+-%__p_%'`
3416echo $ac_n "checking for ${COMMON_INC}/mbus.h""... $ac_c" 1>&6
3417echo "configure:3418: checking for ${COMMON_INC}/mbus.h" >&5
3418if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3419  echo $ac_n "(cached) $ac_c" 1>&6
3420else
3421  cat > conftest.$ac_ext <<EOF
3422#line 3423 "configure"
3423#include "confdefs.h"
3424#include <${COMMON_INC}/mbus.h>
3425EOF
3426ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3427{ (eval echo configure:3428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3428ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3429if test -z "$ac_err"; then
3430  rm -rf conftest*
3431  eval "ac_cv_header_$ac_safe=yes"
3432else
3433  echo "$ac_err" >&5
3434  echo "configure: failed program was:" >&5
3435  cat conftest.$ac_ext >&5
3436  rm -rf conftest*
3437  eval "ac_cv_header_$ac_safe=no"
3438fi
3439rm -f conftest*
3440fi
3441if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3442  echo "$ac_t""yes" 1>&6
3443  COMMON_INC=-I$COMMON_INC
3444else
3445  echo "$ac_t""no" 1>&6
3446ac_safe=`echo "${COMMON_INC}/include/mbus.h" | sed 'y%./+-%__p_%'`
3447echo $ac_n "checking for ${COMMON_INC}/include/mbus.h""... $ac_c" 1>&6
3448echo "configure:3449: checking for ${COMMON_INC}/include/mbus.h" >&5
3449if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3450  echo $ac_n "(cached) $ac_c" 1>&6
3451else
3452  cat > conftest.$ac_ext <<EOF
3453#line 3454 "configure"
3454#include "confdefs.h"
3455#include <${COMMON_INC}/include/mbus.h>
3456EOF
3457ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3458{ (eval echo configure:3459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3459ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3460if test -z "$ac_err"; then
3461  rm -rf conftest*
3462  eval "ac_cv_header_$ac_safe=yes"
3463else
3464  echo "$ac_err" >&5
3465  echo "configure: failed program was:" >&5
3466  cat conftest.$ac_ext >&5
3467  rm -rf conftest*
3468  eval "ac_cv_header_$ac_safe=no"
3469fi
3470rm -f conftest*
3471fi
3472if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3473  echo "$ac_t""yes" 1>&6
3474  COMMON_INC=-I${COMMON_INC}/include
3475                 COMMON_LIB=${COMMON_LIB}/lib
3476else
3477  echo "$ac_t""no" 1>&6
3478
3479                        echo "Could not find mbus.h from UCL's common library.  Maybe:"
3480                        echo "   (a) common library is not installed."
3481                        echo "   (b) common library's locations was mis/not specified (--with-common=DIR)."
3482                        echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3483                        exit
3484               
3485fi
3486
3487       
3488fi
3489
3490
3491echo $ac_n "checking for mbus_init in -lcommon""... $ac_c" 1>&6
3492echo "configure:3493: checking for mbus_init in -lcommon" >&5
3493ac_lib_var=`echo common'_'mbus_init | sed 'y%./+-%__p_%'`
3494if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3495  echo $ac_n "(cached) $ac_c" 1>&6
3496else
3497  ac_save_LIBS="$LIBS"
3498LIBS="-lcommon -L${COMMON_LIB} $LIBS"
3499cat > conftest.$ac_ext <<EOF
3500#line 3501 "configure"
3501#include "confdefs.h"
3502/* Override any gcc2 internal prototype to avoid an error.  */
3503/* We use char because int might match the return type of a gcc2
3504    builtin and then its argument prototype would still apply.  */
3505char mbus_init();
3506
3507int main() {
3508mbus_init()
3509; return 0; }
3510EOF
3511if { (eval echo configure:3512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3512  rm -rf conftest*
3513  eval "ac_cv_lib_$ac_lib_var=yes"
3514else
3515  echo "configure: failed program was:" >&5
3516  cat conftest.$ac_ext >&5
3517  rm -rf conftest*
3518  eval "ac_cv_lib_$ac_lib_var=no"
3519fi
3520rm -f conftest*
3521LIBS="$ac_save_LIBS"
3522
3523fi
3524if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3525  echo "$ac_t""yes" 1>&6
3526  COMMON_LIB="-L${COMMON_LIB} -lcommon"
3527else
3528  echo "$ac_t""no" 1>&6
3529
3530                echo "Could not find UCL Common library.  One of the following halted progess:"
3531                echo "   (a) Common Library is not installed."
3532                echo "   (b) Library is not built or not in expected location (--with-common=DIR)."
3533                echo "   (c) this script failed to see it (please inform rat-trap@cs.ucl.ac.uk)."
3534                exit
3535       
3536fi
3537
3538
3539
3540
3541
3542# Enable options
3543# Check whether --enable-profile or --disable-profile was given.
3544if test "${enable_profile+set}" = set; then
3545  enableval="$enable_profile"
3546  if test $enableval = yes
3547        then
3548                if test "$GCC" = yes
3549                then
3550                        CFLAGS="$CFLAGS -pg"
3551                else
3552                        { echo "configure: error: Don't know how to enable profiling for $CC" 1>&2; exit 1; }
3553                fi
3554        fi
3555fi
3556
3557# Check whether --enable-bounds or --disable-bounds was given.
3558if test "${enable_bounds+set}" = set; then
3559  enableval="$enable_bounds"
3560  if test $enableval = yes
3561        then
3562                if test "$GCC" = yes
3563                then
3564                        CFLAGS="$CFLAGS -fbounds-checking"
3565                        LIBS="$LIBS -lcheck"
3566                else
3567                        { echo "configure: error: Don't know how to enable profiling for $CC" 1>&2; exit 1; }
3568                fi
3569        fi
3570fi
3571
3572# Check whether --enable-debug or --disable-debug was given.
3573if test "${enable_debug+set}" = set; then
3574  enableval="$enable_debug"
3575  if test $enableval = yes
3576        then
3577                cat >> confdefs.h <<\EOF
3578#define DEBUG 1
3579EOF
3580
3581        fi
3582fi
3583
3584# Check whether --enable-debug-mem or --disable-debug-mem was given.
3585if test "${enable_debug_mem+set}" = set; then
3586  enableval="$enable_debug_mem"
3587  if test $enableval = yes
3588        then
3589                cat >> confdefs.h <<\EOF
3590#define DEBUG_MEM 1
3591EOF
3592
3593        fi
3594fi
3595
3596
3597# GCC-specific warning flags
3598if test "$GCC" = yes
3599then
3600        CFLAGS="$CFLAGS -W -Wall -Wbad-function-cast -Wmissing-prototypes -Werror"
3601        if test -f .devel
3602        then
3603                CFLAGS="$CFLAGS -Werror"
3604        fi
3605fi
3606
3607
3608
3609trap '' 1 2 15
3610cat > confcache <<\EOF
3611# This file is a shell script that caches the results of configure
3612# tests run on this system so they can be shared between configure
3613# scripts and configure runs.  It is not useful on other systems.
3614# If it contains results you don't want to keep, you may remove or edit it.
3615#
3616# By default, configure uses ./config.cache as the cache file,
3617# creating it if it does not exist already.  You can give configure
3618# the --cache-file=FILE option to use a different cache file; that is
3619# what configure does when it calls configure scripts in
3620# subdirectories, so they share the cache.
3621# Giving --cache-file=/dev/null disables caching, for debugging configure.
3622# config.status only pays attention to the cache file if you give it the
3623# --recheck option to rerun configure.
3624#
3625EOF
3626# The following way of writing the cache mishandles newlines in values,
3627# but we know of no workaround that is simple, portable, and efficient.
3628# So, don't put newlines in cache variables' values.
3629# Ultrix sh set writes to stderr and can't be redirected directly,
3630# and sets the high bit in the cache file unless we assign to the vars.
3631(set) 2>&1 |
3632  case `(ac_space=' '; set | grep ac_space) 2>&1` in
3633  *ac_space=\ *)
3634    # `set' does not quote correctly, so add quotes (double-quote substitution
3635    # turns \\\\ into \\, and sed turns \\ into \).
3636    sed -n \
3637      -e "s/'/'\\\\''/g" \
3638      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3639    ;;
3640  *)
3641    # `set' quotes correctly as required by POSIX, so do not add quotes.
3642    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3643    ;;
3644  esac >> confcache
3645if cmp -s $cache_file confcache; then
3646  :
3647else
3648  if test -w $cache_file; then
3649    echo "updating cache $cache_file"
3650    cat confcache > $cache_file
3651  else
3652    echo "not updating unwritable cache $cache_file"
3653  fi
3654fi
3655rm -f confcache
3656
3657trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3658
3659test "x$prefix" = xNONE && prefix=$ac_default_prefix
3660# Let make expand exec_prefix.
3661test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3662
3663# Any assignment to VPATH causes Sun make to only execute
3664# the first set of double-colon rules, so remove it if not needed.
3665# If there is a colon in the path, we need to keep it.
3666if test "x$srcdir" = x.; then
3667  ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3668fi
3669
3670trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3671
3672DEFS=-DHAVE_CONFIG_H
3673
3674# Without the "./", some shells look in PATH for config.status.
3675: ${CONFIG_STATUS=./config.status}
3676
3677echo creating $CONFIG_STATUS
3678rm -f $CONFIG_STATUS
3679cat > $CONFIG_STATUS <<EOF
3680#! /bin/sh
3681# Generated automatically by configure.
3682# Run this file to recreate the current configuration.
3683# This directory was configured as follows,
3684# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3685#
3686# $0 $ac_configure_args
3687#
3688# Compiler output produced by configure, useful for debugging
3689# configure, is in ./config.log if it exists.
3690
3691ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3692for ac_option
3693do
3694  case "\$ac_option" in
3695  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3696    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3697    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3698  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3699    echo "$CONFIG_STATUS generated by autoconf version 2.13"
3700    exit 0 ;;
3701  -help | --help | --hel | --he | --h)
3702    echo "\$ac_cs_usage"; exit 0 ;;
3703  *) echo "\$ac_cs_usage"; exit 1 ;;
3704  esac
3705done
3706
3707ac_given_srcdir=$srcdir
3708
3709trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3710EOF
3711cat >> $CONFIG_STATUS <<EOF
3712
3713# Protect against being on the right side of a sed subst in config.status.
3714sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3715 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3716$ac_vpsub
3717$extrasub
3718s%@SHELL@%$SHELL%g
3719s%@CFLAGS@%$CFLAGS%g
3720s%@CPPFLAGS@%$CPPFLAGS%g
3721s%@CXXFLAGS@%$CXXFLAGS%g
3722s%@FFLAGS@%$FFLAGS%g
3723s%@DEFS@%$DEFS%g
3724s%@LDFLAGS@%$LDFLAGS%g
3725s%@LIBS@%$LIBS%g
3726s%@exec_prefix@%$exec_prefix%g
3727s%@prefix@%$prefix%g
3728s%@program_transform_name@%$program_transform_name%g
3729s%@bindir@%$bindir%g
3730s%@sbindir@%$sbindir%g
3731s%@libexecdir@%$libexecdir%g
3732s%@datadir@%$datadir%g
3733s%@sysconfdir@%$sysconfdir%g
3734s%@sharedstatedir@%$sharedstatedir%g
3735s%@localstatedir@%$localstatedir%g
3736s%@libdir@%$libdir%g
3737s%@includedir@%$includedir%g
3738s%@oldincludedir@%$oldincludedir%g
3739s%@infodir@%$infodir%g
3740s%@mandir@%$mandir%g
3741s%@host@%$host%g
3742s%@host_alias@%$host_alias%g
3743s%@host_cpu@%$host_cpu%g
3744s%@host_vendor@%$host_vendor%g
3745s%@host_os@%$host_os%g
3746s%@target@%$target%g
3747s%@target_alias@%$target_alias%g
3748s%@target_cpu@%$target_cpu%g
3749s%@target_vendor@%$target_vendor%g
3750s%@target_os@%$target_os%g
3751s%@build@%$build%g
3752s%@build_alias@%$build_alias%g
3753s%@build_cpu@%$build_cpu%g
3754s%@build_vendor@%$build_vendor%g
3755s%@build_os@%$build_os%g
3756s%@CC@%$CC%g
3757s%@CPP@%$CPP%g
3758s%@RANLIB@%$RANLIB%g
3759s%@MATHLIBS@%$MATHLIBS%g
3760s%@EXTRA_OBJ@%$EXTRA_OBJ%g
3761s%@AU_OBJ@%$AU_OBJ%g
3762s%@AU_INC@%$AU_INC%g
3763s%@AU_LIB@%$AU_LIB%g
3764s%@X_CFLAGS@%$X_CFLAGS%g
3765s%@X_PRE_LIBS@%$X_PRE_LIBS%g
3766s%@X_LIBS@%$X_LIBS%g
3767s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
3768s%@TCL_INC@%$TCL_INC%g
3769s%@TCL_LIB@%$TCL_LIB%g
3770s%@TK_INC@%$TK_INC%g
3771s%@TK_LIB@%$TK_LIB%g
3772s%@COMMON_INC@%$COMMON_INC%g
3773s%@COMMON_LIB@%$COMMON_LIB%g
3774
3775CEOF
3776EOF
3777
3778cat >> $CONFIG_STATUS <<\EOF
3779
3780# Split the substitutions into bite-sized pieces for seds with
3781# small command number limits, like on Digital OSF/1 and HP-UX.
3782ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3783ac_file=1 # Number of current file.
3784ac_beg=1 # First line for current file.
3785ac_end=$ac_max_sed_cmds # Line after last line for current file.
3786ac_more_lines=:
3787ac_sed_cmds=""
3788while $ac_more_lines; do
3789  if test $ac_beg -gt 1; then
3790    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3791  else
3792    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3793  fi
3794  if test ! -s conftest.s$ac_file; then
3795    ac_more_lines=false
3796    rm -f conftest.s$ac_file
3797  else
3798    if test -z "$ac_sed_cmds"; then
3799      ac_sed_cmds="sed -f conftest.s$ac_file"
3800    else
3801      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3802    fi
3803    ac_file=`expr $ac_file + 1`
3804    ac_beg=$ac_end
3805    ac_end=`expr $ac_end + $ac_max_sed_cmds`
3806  fi
3807done
3808if test -z "$ac_sed_cmds"; then
3809  ac_sed_cmds=cat
3810fi
3811EOF
3812
3813cat >> $CONFIG_STATUS <<EOF
3814
3815CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
3816EOF
3817cat >> $CONFIG_STATUS <<\EOF
3818for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3819  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3820  case "$ac_file" in
3821  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3822       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3823  *) ac_file_in="${ac_file}.in" ;;
3824  esac
3825
3826  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3827
3828  # Remove last slash and all that follows it.  Not all systems have dirname.
3829  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3830  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3831    # The file is in a subdirectory.
3832    test ! -d "$ac_dir" && mkdir "$ac_dir"
3833    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3834    # A "../" for each directory in $ac_dir_suffix.
3835    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3836  else
3837    ac_dir_suffix= ac_dots=
3838  fi
3839
3840  case "$ac_given_srcdir" in
3841  .)  srcdir=.
3842      if test -z "$ac_dots"; then top_srcdir=.
3843      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3844  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3845  *) # Relative path.
3846    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3847    top_srcdir="$ac_dots$ac_given_srcdir" ;;
3848  esac
3849
3850
3851  echo creating "$ac_file"
3852  rm -f "$ac_file"
3853  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3854  case "$ac_file" in
3855  *Makefile*) ac_comsub="1i\\
3856# $configure_input" ;;
3857  *) ac_comsub= ;;
3858  esac
3859
3860  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3861  sed -e "$ac_comsub
3862s%@configure_input@%$configure_input%g
3863s%@srcdir@%$srcdir%g
3864s%@top_srcdir@%$top_srcdir%g
3865" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3866fi; done
3867rm -f conftest.s*
3868
3869# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3870# NAME is the cpp macro being defined and VALUE is the value it is being given.
3871#
3872# ac_d sets the value in "#define NAME VALUE" lines.
3873ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3874ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3875ac_dC='\3'
3876ac_dD='%g'
3877# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3878ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3879ac_uB='\([      ]\)%\1#\2define\3'
3880ac_uC=' '
3881ac_uD='\4%g'
3882# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3883ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3884ac_eB='$%\1#\2define\3'
3885ac_eC=' '
3886ac_eD='%g'
3887
3888if test "${CONFIG_HEADERS+set}" != set; then
3889EOF
3890cat >> $CONFIG_STATUS <<EOF
3891  CONFIG_HEADERS="config.h"
3892EOF
3893cat >> $CONFIG_STATUS <<\EOF
3894fi
3895for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3896  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3897  case "$ac_file" in
3898  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3899       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3900  *) ac_file_in="${ac_file}.in" ;;
3901  esac
3902
3903  echo creating $ac_file
3904
3905  rm -f conftest.frag conftest.in conftest.out
3906  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3907  cat $ac_file_inputs > conftest.in
3908
3909EOF
3910
3911# Transform confdefs.h into a sed script conftest.vals that substitutes
3912# the proper values into config.h.in to produce config.h.  And first:
3913# Protect against being on the right side of a sed subst in config.status.
3914# Protect against being in an unquoted here document in config.status.
3915rm -f conftest.vals
3916cat > conftest.hdr <<\EOF
3917s/[\\&%]/\\&/g
3918s%[\\$`]%\\&%g
3919s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3920s%ac_d%ac_u%gp
3921s%ac_u%ac_e%gp
3922EOF
3923sed -n -f conftest.hdr confdefs.h > conftest.vals
3924rm -f conftest.hdr
3925
3926# This sed command replaces #undef with comments.  This is necessary, for
3927# example, in the case of _POSIX_SOURCE, which is predefined and required
3928# on some systems where configure will not decide to define it.
3929cat >> conftest.vals <<\EOF
3930s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3931EOF
3932
3933# Break up conftest.vals because some shells have a limit on
3934# the size of here documents, and old seds have small limits too.
3935
3936rm -f conftest.tail
3937while :
3938do
3939  ac_lines=`grep -c . conftest.vals`
3940  # grep -c gives empty output for an empty file on some AIX systems.
3941  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3942  # Write a limited-size here document to conftest.frag.
3943  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3944  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3945  echo 'CEOF
3946  sed -f conftest.frag conftest.in > conftest.out
3947  rm -f conftest.in
3948  mv conftest.out conftest.in
3949' >> $CONFIG_STATUS
3950  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3951  rm -f conftest.vals
3952  mv conftest.tail conftest.vals
3953done
3954rm -f conftest.vals
3955
3956cat >> $CONFIG_STATUS <<\EOF
3957  rm -f conftest.frag conftest.h
3958  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3959  cat conftest.in >> conftest.h
3960  rm -f conftest.in
3961  if cmp -s $ac_file conftest.h 2>/dev/null; then
3962    echo "$ac_file is unchanged"
3963    rm -f conftest.h
3964  else
3965    # Remove last slash and all that follows it.  Not all systems have dirname.
3966      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3967      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3968      # The file is in a subdirectory.
3969      test ! -d "$ac_dir" && mkdir "$ac_dir"
3970    fi
3971    rm -f $ac_file
3972    mv conftest.h $ac_file
3973  fi
3974fi; done
3975
3976EOF
3977cat >> $CONFIG_STATUS <<EOF
3978
3979EOF
3980cat >> $CONFIG_STATUS <<\EOF
3981
3982exit 0
3983EOF
3984chmod +x $CONFIG_STATUS
3985rm -fr confdefs* $ac_clean_files
3986test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3987
3988
Note: See TracBrowser for help on using the browser.