source: git/Singular/configure @ dabfee

spielwiese
Last change on this file since dabfee was dabfee, checked in by Hans Schönemann <hannes@…>, 24 years ago
*hannes: term-stuff git-svn-id: file:///usr/local/Singular/svn/trunk@3850 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100755
File size: 150.1 KB
Line 
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
4# Generated automatically using autoconf version 2.12
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_default_prefix=`pwd`/..
15ac_help="$ac_help
16  --with-rootdir=DIR      use DIR ass compiled-in root directory
17                             (default is PREFIX)"
18ac_help="$ac_help
19  --with-lex=[LEX,no]     uses LEX as lex program, default is flex"
20ac_help="$ac_help
21  --with-perl5=[PERL5,no] uses PERL5 as perl5 program, default is perl5"
22ac_help="$ac_help
23  --without-readline      do not use readline for fancy display"
24ac_help="$ac_help
25  --without-MP            do not use MP (no MP links)"
26ac_help="$ac_help
27  --without-dbm           do not use dbm (no DBM links)"
28ac_help="$ac_help
29  --without-factory       do not use factory (no poly factorization)"
30ac_help="$ac_help
31  --without-libfac        do not use libfac (no primary decompositions)"
32ac_help="$ac_help
33  --with-namespaces       do compile namespace support"
34ac_help="$ac_help
35  --with-dl               do use dl (dynamic linking)"
36ac_help="$ac_help
37  --with-apint=PACKAGE    use PACKAGE for arbitary integer arithmetic"
38ac_help="$ac_help
39  --with-exp_type=TYPE    uses TYPE as type of exponents in polynomials
40                             -- default type is short
41                             -- possible other types are char and int"
42ac_help="$ac_help
43  --with-gmalloc          use our own gmalloc routines, instead of the ones
44                             provided by the system"
45ac_help="$ac_help
46  --with-mtrack           use mpr routines for extended memory tracking
47                             -- works only under ix86-Linux"
48
49# Initialize some variables set by options.
50# The variables have the same names as the options, with
51# dashes changed to underlines.
52build=NONE
53cache_file=./config.cache
54exec_prefix=NONE
55host=NONE
56no_create=
57nonopt=NONE
58no_recursion=
59prefix=NONE
60program_prefix=NONE
61program_suffix=NONE
62program_transform_name=s,x,x,
63silent=
64site=
65srcdir=
66target=NONE
67verbose=
68x_includes=NONE
69x_libraries=NONE
70bindir='${exec_prefix}/bin'
71sbindir='${exec_prefix}/sbin'
72libexecdir='${exec_prefix}/libexec'
73datadir='${prefix}/share'
74sysconfdir='${prefix}/etc'
75sharedstatedir='${prefix}/com'
76localstatedir='${prefix}/var'
77libdir='${exec_prefix}/lib'
78includedir='${prefix}/include'
79oldincludedir='/usr/include'
80infodir='${prefix}/info'
81mandir='${prefix}/man'
82
83# Initialize some other variables.
84subdirs=
85MFLAGS= MAKEFLAGS=
86# Maximum number of lines to put in a shell here document.
87ac_max_here_lines=12
88
89ac_prev=
90for ac_option
91do
92
93  # If the previous option needs an argument, assign it.
94  if test -n "$ac_prev"; then
95    eval "$ac_prev=\$ac_option"
96    ac_prev=
97    continue
98  fi
99
100  case "$ac_option" in
101  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
102  *) ac_optarg= ;;
103  esac
104
105  # Accept the important Cygnus configure options, so we can diagnose typos.
106
107  case "$ac_option" in
108
109  -bindir | --bindir | --bindi | --bind | --bin | --bi)
110    ac_prev=bindir ;;
111  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
112    bindir="$ac_optarg" ;;
113
114  -build | --build | --buil | --bui | --bu)
115    ac_prev=build ;;
116  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
117    build="$ac_optarg" ;;
118
119  -cache-file | --cache-file | --cache-fil | --cache-fi \
120  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
121    ac_prev=cache_file ;;
122  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
123  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
124    cache_file="$ac_optarg" ;;
125
126  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
127    ac_prev=datadir ;;
128  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
129  | --da=*)
130    datadir="$ac_optarg" ;;
131
132  -disable-* | --disable-*)
133    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
134    # Reject names that are not valid shell variable names.
135    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
136      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
137    fi
138    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
139    eval "enable_${ac_feature}=no" ;;
140
141  -enable-* | --enable-*)
142    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
143    # Reject names that are not valid shell variable names.
144    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
145      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
146    fi
147    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
148    case "$ac_option" in
149      *=*) ;;
150      *) ac_optarg=yes ;;
151    esac
152    eval "enable_${ac_feature}='$ac_optarg'" ;;
153
154  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
155  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
156  | --exec | --exe | --ex)
157    ac_prev=exec_prefix ;;
158  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
159  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
160  | --exec=* | --exe=* | --ex=*)
161    exec_prefix="$ac_optarg" ;;
162
163  -gas | --gas | --ga | --g)
164    # Obsolete; use --with-gas.
165    with_gas=yes ;;
166
167  -help | --help | --hel | --he)
168    # Omit some internal or obsolete options to make the list less imposing.
169    # This message is too long to be a string in the A/UX 3.1 sh.
170    cat << EOF
171Usage: configure [options] [host]
172Options: [defaults in brackets after descriptions]
173Configuration:
174  --cache-file=FILE       cache test results in FILE
175  --help                  print this message
176  --no-create             do not create output files
177  --quiet, --silent       do not print \`checking...' messages
178  --version               print the version of autoconf that created configure
179Directory and file names:
180  --prefix=PREFIX         install architecture-independent files in PREFIX
181                          [$ac_default_prefix]
182  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
183                          [same as prefix]
184  --bindir=DIR            user executables in DIR [EPREFIX/bin]
185  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
186  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
187  --datadir=DIR           read-only architecture-independent data in DIR
188                          [PREFIX/share]
189  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
190  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
191                          [PREFIX/com]
192  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
193  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
194  --includedir=DIR        C header files in DIR [PREFIX/include]
195  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
196  --infodir=DIR           info documentation in DIR [PREFIX/info]
197  --mandir=DIR            man documentation in DIR [PREFIX/man]
198  --srcdir=DIR            find the sources in DIR [configure dir or ..]
199  --program-prefix=PREFIX prepend PREFIX to installed program names
200  --program-suffix=SUFFIX append SUFFIX to installed program names
201  --program-transform-name=PROGRAM
202                          run sed PROGRAM on installed program names
203EOF
204    cat << EOF
205Host type:
206  --build=BUILD           configure for building on BUILD [BUILD=HOST]
207  --host=HOST             configure for HOST [guessed]
208  --target=TARGET         configure for TARGET [TARGET=HOST]
209Features and packages:
210  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
211  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
212  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
213  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
214  --x-includes=DIR        X include files are in DIR
215  --x-libraries=DIR       X library files are in DIR
216EOF
217    if test -n "$ac_help"; then
218      echo "--enable and --with options recognized:$ac_help"
219    fi
220    exit 0 ;;
221
222  -host | --host | --hos | --ho)
223    ac_prev=host ;;
224  -host=* | --host=* | --hos=* | --ho=*)
225    host="$ac_optarg" ;;
226
227  -includedir | --includedir | --includedi | --included | --include \
228  | --includ | --inclu | --incl | --inc)
229    ac_prev=includedir ;;
230  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
231  | --includ=* | --inclu=* | --incl=* | --inc=*)
232    includedir="$ac_optarg" ;;
233
234  -infodir | --infodir | --infodi | --infod | --info | --inf)
235    ac_prev=infodir ;;
236  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
237    infodir="$ac_optarg" ;;
238
239  -libdir | --libdir | --libdi | --libd)
240    ac_prev=libdir ;;
241  -libdir=* | --libdir=* | --libdi=* | --libd=*)
242    libdir="$ac_optarg" ;;
243
244  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
245  | --libexe | --libex | --libe)
246    ac_prev=libexecdir ;;
247  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
248  | --libexe=* | --libex=* | --libe=*)
249    libexecdir="$ac_optarg" ;;
250
251  -localstatedir | --localstatedir | --localstatedi | --localstated \
252  | --localstate | --localstat | --localsta | --localst \
253  | --locals | --local | --loca | --loc | --lo)
254    ac_prev=localstatedir ;;
255  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
256  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
257  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
258    localstatedir="$ac_optarg" ;;
259
260  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
261    ac_prev=mandir ;;
262  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
263    mandir="$ac_optarg" ;;
264
265  -nfp | --nfp | --nf)
266    # Obsolete; use --without-fp.
267    with_fp=no ;;
268
269  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
270  | --no-cr | --no-c)
271    no_create=yes ;;
272
273  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
274  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
275    no_recursion=yes ;;
276
277  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
278  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
279  | --oldin | --oldi | --old | --ol | --o)
280    ac_prev=oldincludedir ;;
281  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
282  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
283  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
284    oldincludedir="$ac_optarg" ;;
285
286  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
287    ac_prev=prefix ;;
288  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
289    prefix="$ac_optarg" ;;
290
291  -program-prefix | --program-prefix | --program-prefi | --program-pref \
292  | --program-pre | --program-pr | --program-p)
293    ac_prev=program_prefix ;;
294  -program-prefix=* | --program-prefix=* | --program-prefi=* \
295  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
296    program_prefix="$ac_optarg" ;;
297
298  -program-suffix | --program-suffix | --program-suffi | --program-suff \
299  | --program-suf | --program-su | --program-s)
300    ac_prev=program_suffix ;;
301  -program-suffix=* | --program-suffix=* | --program-suffi=* \
302  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
303    program_suffix="$ac_optarg" ;;
304
305  -program-transform-name | --program-transform-name \
306  | --program-transform-nam | --program-transform-na \
307  | --program-transform-n | --program-transform- \
308  | --program-transform | --program-transfor \
309  | --program-transfo | --program-transf \
310  | --program-trans | --program-tran \
311  | --progr-tra | --program-tr | --program-t)
312    ac_prev=program_transform_name ;;
313  -program-transform-name=* | --program-transform-name=* \
314  | --program-transform-nam=* | --program-transform-na=* \
315  | --program-transform-n=* | --program-transform-=* \
316  | --program-transform=* | --program-transfor=* \
317  | --program-transfo=* | --program-transf=* \
318  | --program-trans=* | --program-tran=* \
319  | --progr-tra=* | --program-tr=* | --program-t=*)
320    program_transform_name="$ac_optarg" ;;
321
322  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
323  | -silent | --silent | --silen | --sile | --sil)
324    silent=yes ;;
325
326  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
327    ac_prev=sbindir ;;
328  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
329  | --sbi=* | --sb=*)
330    sbindir="$ac_optarg" ;;
331
332  -sharedstatedir | --sharedstatedir | --sharedstatedi \
333  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
334  | --sharedst | --shareds | --shared | --share | --shar \
335  | --sha | --sh)
336    ac_prev=sharedstatedir ;;
337  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
338  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
339  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
340  | --sha=* | --sh=*)
341    sharedstatedir="$ac_optarg" ;;
342
343  -site | --site | --sit)
344    ac_prev=site ;;
345  -site=* | --site=* | --sit=*)
346    site="$ac_optarg" ;;
347
348  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
349    ac_prev=srcdir ;;
350  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
351    srcdir="$ac_optarg" ;;
352
353  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
354  | --syscon | --sysco | --sysc | --sys | --sy)
355    ac_prev=sysconfdir ;;
356  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
357  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
358    sysconfdir="$ac_optarg" ;;
359
360  -target | --target | --targe | --targ | --tar | --ta | --t)
361    ac_prev=target ;;
362  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
363    target="$ac_optarg" ;;
364
365  -v | -verbose | --verbose | --verbos | --verbo | --verb)
366    verbose=yes ;;
367
368  -version | --version | --versio | --versi | --vers)
369    echo "configure generated by autoconf version 2.12"
370    exit 0 ;;
371
372  -with-* | --with-*)
373    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
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    case "$ac_option" in
380      *=*) ;;
381      *) ac_optarg=yes ;;
382    esac
383    eval "with_${ac_package}='$ac_optarg'" ;;
384
385  -without-* | --without-*)
386    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
387    # Reject names that are not valid shell variable names.
388    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
389      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
390    fi
391    ac_package=`echo $ac_package| sed 's/-/_/g'`
392    eval "with_${ac_package}=no" ;;
393
394  --x)
395    # Obsolete; use --with-x.
396    with_x=yes ;;
397
398  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
399  | --x-incl | --x-inc | --x-in | --x-i)
400    ac_prev=x_includes ;;
401  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
402  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
403    x_includes="$ac_optarg" ;;
404
405  -x-libraries | --x-libraries | --x-librarie | --x-librari \
406  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
407    ac_prev=x_libraries ;;
408  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
409  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
410    x_libraries="$ac_optarg" ;;
411
412  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
413    ;;
414
415  *)
416    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
417      echo "configure: warning: $ac_option: invalid host type" 1>&2
418    fi
419    if test "x$nonopt" != xNONE; then
420      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
421    fi
422    nonopt="$ac_option"
423    ;;
424
425  esac
426done
427
428if test -n "$ac_prev"; then
429  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
430fi
431
432trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
433
434# File descriptor usage:
435# 0 standard input
436# 1 file creation
437# 2 errors and warnings
438# 3 some systems may open it to /dev/tty
439# 4 used on the Kubota Titan
440# 6 checking for... messages and results
441# 5 compiler messages saved in config.log
442if test "$silent" = yes; then
443  exec 6>/dev/null
444else
445  exec 6>&1
446fi
447exec 5>./config.log
448
449echo "\
450This file contains any messages produced by compilers while
451running configure, to aid debugging if configure makes a mistake.
452" 1>&5
453
454# Strip out --no-create and --no-recursion so they do not pile up.
455# Also quote any args containing shell metacharacters.
456ac_configure_args=
457for ac_arg
458do
459  case "$ac_arg" in
460  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
461  | --no-cr | --no-c) ;;
462  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
463  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
464  *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
465  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
466  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
467  esac
468done
469
470# NLS nuisances.
471# Only set these to C if already set.  These must not be set unconditionally
472# because not all systems understand e.g. LANG=C (notably SCO).
473# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
474# Non-C LC_CTYPE values break the ctype check.
475if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
476if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
477if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
478if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
479
480# confdefs.h avoids OS command line length limits that DEFS can exceed.
481rm -rf conftest* confdefs.h
482# AIX cpp loses on an empty file, so make sure it contains at least a newline.
483echo > confdefs.h
484
485# A filename unique to this package, relative to the directory that
486# configure is in, which we can look for to find out if srcdir is correct.
487ac_unique_file=gmalloc.c
488
489# Find the source files, if location was not specified.
490if test -z "$srcdir"; then
491  ac_srcdir_defaulted=yes
492  # Try the directory containing this script, then its parent.
493  ac_prog=$0
494  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
495  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
496  srcdir=$ac_confdir
497  if test ! -r $srcdir/$ac_unique_file; then
498    srcdir=..
499  fi
500else
501  ac_srcdir_defaulted=no
502fi
503if test ! -r $srcdir/$ac_unique_file; then
504  if test "$ac_srcdir_defaulted" = yes; then
505    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
506  else
507    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
508  fi
509fi
510srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
511
512# Prefer explicitly selected file to automatically selected ones.
513if test -z "$CONFIG_SITE"; then
514  if test "x$prefix" != xNONE; then
515    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
516  else
517    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
518  fi
519fi
520for ac_site_file in $CONFIG_SITE; do
521  if test -r "$ac_site_file"; then
522    echo "loading site script $ac_site_file"
523    . "$ac_site_file"
524  fi
525done
526
527if test -r "$cache_file"; then
528  echo "loading cache $cache_file"
529  . $cache_file
530else
531  echo "creating cache $cache_file"
532  > $cache_file
533fi
534
535ac_ext=c
536# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
537ac_cpp='$CPP $CPPFLAGS'
538ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
539ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
540cross_compiling=$ac_cv_prog_cc_cross
541
542if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
543  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
544  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
545    ac_n= ac_c='
546' ac_t='        '
547  else
548    ac_n=-n ac_c= ac_t=
549  fi
550else
551  ac_n= ac_c='\c' ac_t=
552fi
553
554
555
556
557
558echo $ac_n "checking uname for singular""... $ac_c" 1>&6
559echo "configure:560: checking uname for singular" >&5
560if eval "test \"`echo '$''{'ac_cv_singuname'+set}'`\" = set"; then
561  echo $ac_n "(cached) $ac_c" 1>&6
562else
563  ac_cv_singuname="unknown"
564if test -r "singuname.sh"; then
565  if (/bin/sh singuname.sh >/dev/null 2>&1) then
566    ac_cv_singuname=`/bin/sh singuname.sh`
567  fi
568fi
569if test "$ac_cv_singuname" = unknown && test -r "../singuname.sh"; then
570  if (/bin/sh ../singuname.sh >/dev/null 2>&1) then
571    ac_cv_singuname=`/bin/sh ../singuname.sh`
572  fi
573fi
574
575fi
576
577echo "$ac_t""$ac_cv_singuname" 1>&6
578if test "$ac_cv_singuname" = unknown; then
579  echo "configure: warning: Unknown architecture: Check singuname.sh" 1>&2
580  ac_cv_singuname="unknown"
581fi
582cat >> confdefs.h <<EOF
583#define S_UNAME "$ac_cv_singuname"
584EOF
585
586SINGUNAME=$ac_cv_singuname
587
588
589SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
590
591
592# stupid Win programs do not like dots in their pathnames
593VERSION_SEP="-"
594
595
596SINGULAR_MAJOR_VERSION=${SINGULAR_MAJOR_VERSION:-1}
597SINGULAR_MINOR_VERSION=${SINGULAR_MINOR_VERSION:-3}
598SINGULAR_SUB_VERSION=${SINGULAR_SUB_VERSION:-6}
599SINGULAR_VERSION="${SINGULAR_VERSION:-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}"
600VERSION_DATE=${VERSION_DATE:-"October 1999"}
601
602
603cat >> confdefs.h <<EOF
604#define SINGULAR_MAJOR_VERSION ${SINGULAR_MAJOR_VERSION}
605EOF
606
607cat >> confdefs.h <<EOF
608#define SINGULAR_MINOR_VERSION ${SINGULAR_MINOR_VERSION}
609EOF
610
611cat >> confdefs.h <<EOF
612#define SINGULAR_SUB_VERSION ${SINGULAR_SUB_VERSION}
613EOF
614
615cat >> confdefs.h <<EOF
616#define S_VERSION1 "${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
617EOF
618
619cat >> confdefs.h <<EOF
620#define S_VERSION2 "${VERSION_DATE}"
621EOF
622
623cat >> confdefs.h <<EOF
624#define SINGULAR_SUB_VERSION ${SINGULAR_SUB_VERSION}
625EOF
626
627
628
629if test "${CXXFLAGS+set}" != set; then
630  ac_cxxflags_set=no
631  CXXFLAGS="-O"
632fi
633if test "${CFLAGS+set}" != set; then
634  CFLAGS="-O"
635  ac_cflags_set=no
636fi
637
638# check whether CXX was set by user as env variable
639if test "${CXX+set}" != set; then
640  ac_cxx_set=no
641else
642  ac_cxx_set=yes
643fi
644# Extract the first word of "gcc", so it can be a program name with args.
645set dummy gcc; ac_word=$2
646echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
647echo "configure:648: checking for $ac_word" >&5
648if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
649  echo $ac_n "(cached) $ac_c" 1>&6
650else
651  if test -n "$CC"; then
652  ac_cv_prog_CC="$CC" # Let the user override the test.
653else
654  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
655  for ac_dir in $PATH; do
656    test -z "$ac_dir" && ac_dir=.
657    if test -f $ac_dir/$ac_word; then
658      ac_cv_prog_CC="gcc"
659      break
660    fi
661  done
662  IFS="$ac_save_ifs"
663fi
664fi
665CC="$ac_cv_prog_CC"
666if test -n "$CC"; then
667  echo "$ac_t""$CC" 1>&6
668else
669  echo "$ac_t""no" 1>&6
670fi
671
672if test -z "$CC"; then
673  # Extract the first word of "cc", so it can be a program name with args.
674set dummy cc; ac_word=$2
675echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
676echo "configure:677: checking for $ac_word" >&5
677if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
678  echo $ac_n "(cached) $ac_c" 1>&6
679else
680  if test -n "$CC"; then
681  ac_cv_prog_CC="$CC" # Let the user override the test.
682else
683  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
684  ac_prog_rejected=no
685  for ac_dir in $PATH; do
686    test -z "$ac_dir" && ac_dir=.
687    if test -f $ac_dir/$ac_word; then
688      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
689        ac_prog_rejected=yes
690        continue
691      fi
692      ac_cv_prog_CC="cc"
693      break
694    fi
695  done
696  IFS="$ac_save_ifs"
697if test $ac_prog_rejected = yes; then
698  # We found a bogon in the path, so make sure we never use it.
699  set dummy $ac_cv_prog_CC
700  shift
701  if test $# -gt 0; then
702    # We chose a different compiler from the bogus one.
703    # However, it has the same basename, so the bogon will be chosen
704    # first if we set CC to just the basename; use the full file name.
705    shift
706    set dummy "$ac_dir/$ac_word" "$@"
707    shift
708    ac_cv_prog_CC="$@"
709  fi
710fi
711fi
712fi
713CC="$ac_cv_prog_CC"
714if test -n "$CC"; then
715  echo "$ac_t""$CC" 1>&6
716else
717  echo "$ac_t""no" 1>&6
718fi
719
720  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
721fi
722
723echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
724echo "configure:725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
725
726ac_ext=c
727# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
728ac_cpp='$CPP $CPPFLAGS'
729ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
730ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
731cross_compiling=$ac_cv_prog_cc_cross
732
733cat > conftest.$ac_ext <<EOF
734#line 735 "configure"
735#include "confdefs.h"
736main(){return(0);}
737EOF
738if { (eval echo configure:739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
739  ac_cv_prog_cc_works=yes
740  # If we can't run a trivial program, we are probably using a cross compiler.
741  if (./conftest; exit) 2>/dev/null; then
742    ac_cv_prog_cc_cross=no
743  else
744    ac_cv_prog_cc_cross=yes
745  fi
746else
747  echo "configure: failed program was:" >&5
748  cat conftest.$ac_ext >&5
749  ac_cv_prog_cc_works=no
750fi
751rm -fr conftest*
752
753echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
754if test $ac_cv_prog_cc_works = no; then
755  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
756fi
757echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
758echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
759echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
760cross_compiling=$ac_cv_prog_cc_cross
761
762echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
763echo "configure:764: checking whether we are using GNU C" >&5
764if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
765  echo $ac_n "(cached) $ac_c" 1>&6
766else
767  cat > conftest.c <<EOF
768#ifdef __GNUC__
769  yes;
770#endif
771EOF
772if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
773  ac_cv_prog_gcc=yes
774else
775  ac_cv_prog_gcc=no
776fi
777fi
778
779echo "$ac_t""$ac_cv_prog_gcc" 1>&6
780
781if test $ac_cv_prog_gcc = yes; then
782  GCC=yes
783  ac_test_CFLAGS="${CFLAGS+set}"
784  ac_save_CFLAGS="$CFLAGS"
785  CFLAGS=
786  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
787echo "configure:788: checking whether ${CC-cc} accepts -g" >&5
788if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
789  echo $ac_n "(cached) $ac_c" 1>&6
790else
791  echo 'void f(){}' > conftest.c
792if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
793  ac_cv_prog_cc_g=yes
794else
795  ac_cv_prog_cc_g=no
796fi
797rm -f conftest*
798
799fi
800
801echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
802  if test "$ac_test_CFLAGS" = set; then
803    CFLAGS="$ac_save_CFLAGS"
804  elif test $ac_cv_prog_cc_g = yes; then
805    CFLAGS="-g -O2"
806  else
807    CFLAGS="-O2"
808  fi
809else
810  GCC=
811  test "${CFLAGS+set}" = set || CFLAGS="-g"
812fi
813
814echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
815echo "configure:816: checking how to run the C preprocessor" >&5
816# On Suns, sometimes $CPP names a directory.
817if test -n "$CPP" && test -d "$CPP"; then
818  CPP=
819fi
820if test -z "$CPP"; then
821if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
822  echo $ac_n "(cached) $ac_c" 1>&6
823else
824    # This must be in double quotes, not single quotes, because CPP may get
825  # substituted into the Makefile and "${CC-cc}" will confuse make.
826  CPP="${CC-cc} -E"
827  # On the NeXT, cc -E runs the code through the compiler's parser,
828  # not just through cpp.
829  cat > conftest.$ac_ext <<EOF
830#line 831 "configure"
831#include "confdefs.h"
832#include <assert.h>
833Syntax Error
834EOF
835ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
836{ (eval echo configure:837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
837ac_err=`grep -v '^ *+' conftest.out`
838if test -z "$ac_err"; then
839  :
840else
841  echo "$ac_err" >&5
842  echo "configure: failed program was:" >&5
843  cat conftest.$ac_ext >&5
844  rm -rf conftest*
845  CPP="${CC-cc} -E -traditional-cpp"
846  cat > conftest.$ac_ext <<EOF
847#line 848 "configure"
848#include "confdefs.h"
849#include <assert.h>
850Syntax Error
851EOF
852ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
853{ (eval echo configure:854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
854ac_err=`grep -v '^ *+' conftest.out`
855if test -z "$ac_err"; then
856  :
857else
858  echo "$ac_err" >&5
859  echo "configure: failed program was:" >&5
860  cat conftest.$ac_ext >&5
861  rm -rf conftest*
862  CPP=/lib/cpp
863fi
864rm -f conftest*
865fi
866rm -f conftest*
867  ac_cv_prog_CPP="$CPP"
868fi
869  CPP="$ac_cv_prog_CPP"
870else
871  ac_cv_prog_CPP="$CPP"
872fi
873echo "$ac_t""$CPP" 1>&6
874
875for ac_prog in $CCC c++ g++ gcc CC cxx cc++
876do
877# Extract the first word of "$ac_prog", so it can be a program name with args.
878set dummy $ac_prog; ac_word=$2
879echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
880echo "configure:881: checking for $ac_word" >&5
881if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
882  echo $ac_n "(cached) $ac_c" 1>&6
883else
884  if test -n "$CXX"; then
885  ac_cv_prog_CXX="$CXX" # Let the user override the test.
886else
887  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
888  for ac_dir in $PATH; do
889    test -z "$ac_dir" && ac_dir=.
890    if test -f $ac_dir/$ac_word; then
891      ac_cv_prog_CXX="$ac_prog"
892      break
893    fi
894  done
895  IFS="$ac_save_ifs"
896fi
897fi
898CXX="$ac_cv_prog_CXX"
899if test -n "$CXX"; then
900  echo "$ac_t""$CXX" 1>&6
901else
902  echo "$ac_t""no" 1>&6
903fi
904
905test -n "$CXX" && break
906done
907test -n "$CXX" || CXX="gcc"
908
909
910echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
911echo "configure:912: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
912
913ac_ext=C
914# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
915ac_cpp='$CXXCPP $CPPFLAGS'
916ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
917ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
918cross_compiling=$ac_cv_prog_cxx_cross
919
920cat > conftest.$ac_ext <<EOF
921#line 922 "configure"
922#include "confdefs.h"
923main(){return(0);}
924EOF
925if { (eval echo configure:926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
926  ac_cv_prog_cxx_works=yes
927  # If we can't run a trivial program, we are probably using a cross compiler.
928  if (./conftest; exit) 2>/dev/null; then
929    ac_cv_prog_cxx_cross=no
930  else
931    ac_cv_prog_cxx_cross=yes
932  fi
933else
934  echo "configure: failed program was:" >&5
935  cat conftest.$ac_ext >&5
936  ac_cv_prog_cxx_works=no
937fi
938rm -fr conftest*
939ac_ext=c
940# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
941ac_cpp='$CPP $CPPFLAGS'
942ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
943ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
944cross_compiling=$ac_cv_prog_cc_cross
945
946echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
947if test $ac_cv_prog_cxx_works = no; then
948  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
949fi
950echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
951echo "configure:952: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
952echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
953cross_compiling=$ac_cv_prog_cxx_cross
954
955echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
956echo "configure:957: checking whether we are using GNU C++" >&5
957if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
958  echo $ac_n "(cached) $ac_c" 1>&6
959else
960  cat > conftest.C <<EOF
961#ifdef __GNUC__
962  yes;
963#endif
964EOF
965if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
966  ac_cv_prog_gxx=yes
967else
968  ac_cv_prog_gxx=no
969fi
970fi
971
972echo "$ac_t""$ac_cv_prog_gxx" 1>&6
973
974if test $ac_cv_prog_gxx = yes; then
975  GXX=yes
976  ac_test_CXXFLAGS="${CXXFLAGS+set}"
977  ac_save_CXXFLAGS="$CXXFLAGS"
978  CXXFLAGS=
979  echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
980echo "configure:981: checking whether ${CXX-g++} accepts -g" >&5
981if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
982  echo $ac_n "(cached) $ac_c" 1>&6
983else
984  echo 'void f(){}' > conftest.cc
985if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
986  ac_cv_prog_cxx_g=yes
987else
988  ac_cv_prog_cxx_g=no
989fi
990rm -f conftest*
991
992fi
993
994echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
995  if test "$ac_test_CXXFLAGS" = set; then
996    CXXFLAGS="$ac_save_CXXFLAGS"
997  elif test $ac_cv_prog_cxx_g = yes; then
998    CXXFLAGS="-g -O2"
999  else
1000    CXXFLAGS="-O2"
1001  fi
1002else
1003  GXX=
1004  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
1005fi
1006
1007echo $ac_n "checking for AIX""... $ac_c" 1>&6
1008echo "configure:1009: checking for AIX" >&5
1009cat > conftest.$ac_ext <<EOF
1010#line 1011 "configure"
1011#include "confdefs.h"
1012#ifdef _AIX
1013  yes
1014#endif
1015
1016EOF
1017if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1018  egrep "yes" >/dev/null 2>&1; then
1019  rm -rf conftest*
1020  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
1021#define _ALL_SOURCE 1
1022EOF
1023
1024else
1025  rm -rf conftest*
1026  echo "$ac_t""no" 1>&6
1027fi
1028rm -f conftest*
1029
1030
1031
1032# we prefer using gcc for compiling C++ files, provided the user did
1033# not overwrite it explicitely
1034if test "${GXX}" = yes && test "${ac_cxx_set}" = no; then
1035  CXX=gcc
1036fi
1037
1038# check whether the compiler accepts -pipe
1039echo $ac_n "checking whether compiler accepts -pipe""... $ac_c" 1>&6
1040echo "configure:1041: checking whether compiler accepts -pipe" >&5
1041temp_cflags=${CFLAGS}
1042CFLAGS="${CFLAGS} -pipe"
1043if eval "test \"`echo '$''{'ac_cv_cxx_have_pipe'+set}'`\" = set"; then
1044  echo $ac_n "(cached) $ac_c" 1>&6
1045else
1046  cat > conftest.$ac_ext <<EOF
1047#line 1048 "configure"
1048#include "confdefs.h"
1049
1050int main() {
1051
1052; return 0; }
1053EOF
1054if { (eval echo configure:1055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1055  rm -rf conftest*
1056  ac_cv_cxx_have_pipe=yes
1057else
1058  echo "configure: failed program was:" >&5
1059  cat conftest.$ac_ext >&5
1060  rm -rf conftest*
1061  ac_cv_cxx_have_pipe=no
1062fi
1063rm -f conftest*
1064
1065fi
1066
1067echo "$ac_t""${ac_cv_cxx_have_pipe}" 1>&6
1068CFLAGS=${temp_cflags}
1069if test "${ac_cv_cxx_have_pipe}" != yes; then
1070  PIPE=
1071else
1072  PIPE="-pipe"
1073fi
1074
1075
1076# Customize CFLAGS
1077echo $ac_n "checking whether _AIX is defined""... $ac_c" 1>&6
1078echo "configure:1079: checking whether _AIX is defined" >&5
1079if eval "test \"`echo '$''{'ac_cv_is_aix'+set}'`\" = set"; then
1080  echo $ac_n "(cached) $ac_c" 1>&6
1081else
1082  cat > conftest.$ac_ext <<EOF
1083#line 1084 "configure"
1084#include "confdefs.h"
1085#ifdef _AIX
1086    yes
1087#endif
1088
1089EOF
1090if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1091  egrep "yes" >/dev/null 2>&1; then
1092  rm -rf conftest*
1093  ac_cv_is_aix=yes
1094else
1095  rm -rf conftest*
1096  ac_cv_is_aix=no
1097fi
1098rm -f conftest*
1099
1100fi
1101
1102if test "$ac_cv_is_aix" = yes; then
1103  echo "$ac_t""yes" 1>&6
1104else
1105  echo "$ac_t""no" 1>&6
1106fi
1107
1108# we know best when compiling with gcc
1109if test "${GXX}" = yes; then
1110  if test "$ac_cxxflags_set" = no; then
1111    CXXFLAGS="-O3 -w -fomit-frame-pointer"
1112  fi
1113  CXXTEMPLFLAGS="-fno-implicit-templates"
1114  if test "$ac_cv_is_aix" = yes; then
1115    CXXNOOPTFLAGS="-w"
1116  else
1117    CXXNOOPTFLAGS=$CXXFLAGS
1118  fi
1119  STATIC_LDFLAGS="-static"
1120else
1121  CXXTEMPFLAGS=""
1122  CXXNOOPTFLAGS=$CXXFLAGS
1123  STATIC_LDFLAGS=""
1124fi
1125
1126
1127
1128
1129if test "${GCC}" = yes && test "$ac_cflags_set" = no ; then
1130  CFLAGS="-O3 -w -fomit-frame-pointer"
1131fi
1132
1133echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1134echo "configure:1135: checking whether ${MAKE-make} sets \${MAKE}" >&5
1135set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1136if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1137  echo $ac_n "(cached) $ac_c" 1>&6
1138else
1139  cat > conftestmake <<\EOF
1140all:
1141        @echo 'ac_maketemp="${MAKE}"'
1142EOF
1143# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1144eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1145if test -n "$ac_maketemp"; then
1146  eval ac_cv_prog_make_${ac_make}_set=yes
1147else
1148  eval ac_cv_prog_make_${ac_make}_set=no
1149fi
1150rm -f conftestmake
1151fi
1152if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1153  echo "$ac_t""yes" 1>&6
1154  SET_MAKE=
1155else
1156  echo "$ac_t""no" 1>&6
1157  SET_MAKE="MAKE=${MAKE-make}"
1158fi
1159
1160
1161
1162
1163
1164# expand prefix
1165test "x$prefix" = xNONE && prefix=$ac_default_prefix
1166if test "${with_rootdir+set}" != set; then
1167  cat >> confdefs.h <<EOF
1168#define S_ROOT_DIR "${prefix}"
1169EOF
1170
1171else
1172  cat >> confdefs.h <<EOF
1173#define S_ROOT_DIR "${with_rootdir}"
1174EOF
1175
1176fi
1177
1178# expand exec_prefixad
1179if test "x$exec_prefix" = xNONE; then
1180 exec_prefix=${prefix}/${ac_cv_singuname}
1181fi
1182
1183# expand bindir
1184test "x$bindir" = 'x${exec_prefix}/bin' && bindir="${exec_prefix}/bin"
1185SINGULAR=${SINGULAR:-$bindir/Singular-$SINGULAR_MAJOR_VERSION${VERSION_SEP}$SINGULAR_MINOR_VERSION${VERSION_SEP}$SINGULAR_SUB_VERSION}
1186
1187cat >> confdefs.h <<EOF
1188#define S_BIN_DIR "${bindir}"
1189EOF
1190
1191
1192# expand libdir
1193test "x$libdir" = 'x${exec_prefix}/lib'&& libdir="${exec_prefix}/lib/${SINGULAR_VERSION}"
1194
1195# expand includedir
1196test "x$includedir" = 'x${prefix}/include' && includedir="${exec_prefix}/include/${SINGULAR_VERSION}"
1197
1198# add to -I to CPPFLAGS and and -L to LDFLAGS, just to be sure
1199LDFLAGS="-L${libdir} ${LDFLAGS}"
1200CPPFLAGS="-I${includedir} ${CPPFLAGS}"
1201
1202
1203
1204# lex
1205if test "${with_lex+set}" != set; then
1206  echo $ac_n "checking for flex""... $ac_c" 1>&6
1207echo "configure:1208: checking for flex" >&5
1208    if eval "test \"`echo '$''{'ac_cv_prog_flex'+set}'`\" = set"; then
1209  echo $ac_n "(cached) $ac_c" 1>&6
1210else
1211  if (flex --version >/dev/null 2>&1)
1212  then
1213    if (flex --version | egrep "[2-9]\.[5-9]" >/dev/null 2>&1)
1214    then
1215      ac_cv_prog_flex=flex
1216    fi
1217  fi
1218 
1219fi
1220
1221    if test "${ac_cv_prog_flex+set}" = set; then
1222    echo "$ac_t""flex" 1>&6
1223    LEX=flex
1224   
1225  else
1226    { echo "configure: error: can not find flex with version greater 2.4" 1>&2; exit 1; }
1227  fi
1228elif test "${with_lex}" = no; then
1229  echo "configure: warning: building without lex -- make might fail" 1>&2
1230else
1231  unset LEX
1232  unset ac_cv_prog_LEX
1233  for ac_prog in ${with_lex}
1234do
1235# Extract the first word of "$ac_prog", so it can be a program name with args.
1236set dummy $ac_prog; ac_word=$2
1237echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1238echo "configure:1239: checking for $ac_word" >&5
1239if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
1240  echo $ac_n "(cached) $ac_c" 1>&6
1241else
1242  if test -n "$LEX"; then
1243  ac_cv_prog_LEX="$LEX" # Let the user override the test.
1244else
1245  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1246  for ac_dir in $PATH; do
1247    test -z "$ac_dir" && ac_dir=.
1248    if test -f $ac_dir/$ac_word; then
1249      ac_cv_prog_LEX="$ac_prog"
1250      break
1251    fi
1252  done
1253  IFS="$ac_save_ifs"
1254fi
1255fi
1256LEX="$ac_cv_prog_LEX"
1257if test -n "$LEX"; then
1258  echo "$ac_t""$LEX" 1>&6
1259else
1260  echo "$ac_t""no" 1>&6
1261fi
1262
1263test -n "$LEX" && break
1264done
1265
1266  if test "x${LEX}" = x; then
1267    echo "configure: warning: building without lex -- make might fail" 1>&2
1268  fi
1269fi
1270
1271# bison
1272for ac_prog in bison
1273do
1274# Extract the first word of "$ac_prog", so it can be a program name with args.
1275set dummy $ac_prog; ac_word=$2
1276echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1277echo "configure:1278: checking for $ac_word" >&5
1278if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
1279  echo $ac_n "(cached) $ac_c" 1>&6
1280else
1281  if test -n "$BISON"; then
1282  ac_cv_prog_BISON="$BISON" # Let the user override the test.
1283else
1284  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1285  for ac_dir in $PATH; do
1286    test -z "$ac_dir" && ac_dir=.
1287    if test -f $ac_dir/$ac_word; then
1288      ac_cv_prog_BISON="$ac_prog"
1289      break
1290    fi
1291  done
1292  IFS="$ac_save_ifs"
1293fi
1294fi
1295BISON="$ac_cv_prog_BISON"
1296if test -n "$BISON"; then
1297  echo "$ac_t""$BISON" 1>&6
1298else
1299  echo "$ac_t""no" 1>&6
1300fi
1301
1302test -n "$BISON" && break
1303done
1304
1305if test "${BISON+set}" != set; then
1306  echo "configure: warning: did not find bison -- make might fail" 1>&2
1307fi
1308
1309# ln -s
1310echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1311echo "configure:1312: checking whether ln -s works" >&5
1312if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
1313  echo $ac_n "(cached) $ac_c" 1>&6
1314else
1315  rm -f conftestdata
1316if ln -s X conftestdata 2>/dev/null
1317then
1318  rm -f conftestdata
1319  ac_cv_prog_LN_S="ln -s"
1320else
1321  ac_cv_prog_LN_S=ln
1322fi
1323fi
1324LN_S="$ac_cv_prog_LN_S"
1325if test "$ac_cv_prog_LN_S" = "ln -s"; then
1326  echo "$ac_t""yes" 1>&6
1327else
1328  echo "$ac_t""no" 1>&6
1329fi
1330
1331
1332# lib checks
1333echo $ac_n "checking for atof in -lm""... $ac_c" 1>&6
1334echo "configure:1335: checking for atof in -lm" >&5
1335ac_lib_var=`echo m'_'atof | sed 'y%./+-%__p_%'`
1336if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1337  echo $ac_n "(cached) $ac_c" 1>&6
1338else
1339  ac_save_LIBS="$LIBS"
1340LIBS="-lm  $LIBS"
1341cat > conftest.$ac_ext <<EOF
1342#line 1343 "configure"
1343#include "confdefs.h"
1344/* Override any gcc2 internal prototype to avoid an error.  */
1345/* We use char because int might match the return type of a gcc2
1346    builtin and then its argument prototype would still apply.  */
1347char atof();
1348
1349int main() {
1350atof()
1351; return 0; }
1352EOF
1353if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1354  rm -rf conftest*
1355  eval "ac_cv_lib_$ac_lib_var=yes"
1356else
1357  echo "configure: failed program was:" >&5
1358  cat conftest.$ac_ext >&5
1359  rm -rf conftest*
1360  eval "ac_cv_lib_$ac_lib_var=no"
1361fi
1362rm -f conftest*
1363LIBS="$ac_save_LIBS"
1364
1365fi
1366if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1367  echo "$ac_t""yes" 1>&6
1368    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1369    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1370  cat >> confdefs.h <<EOF
1371#define $ac_tr_lib 1
1372EOF
1373
1374  LIBS="-lm $LIBS"
1375
1376else
1377  echo "$ac_t""no" 1>&6
1378fi
1379
1380echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
1381echo "configure:1382: checking for socket in -lbsd" >&5
1382ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
1383if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1384  echo $ac_n "(cached) $ac_c" 1>&6
1385else
1386  ac_save_LIBS="$LIBS"
1387LIBS="-lbsd  $LIBS"
1388cat > conftest.$ac_ext <<EOF
1389#line 1390 "configure"
1390#include "confdefs.h"
1391/* Override any gcc2 internal prototype to avoid an error.  */
1392/* We use char because int might match the return type of a gcc2
1393    builtin and then its argument prototype would still apply.  */
1394char socket();
1395
1396int main() {
1397socket()
1398; return 0; }
1399EOF
1400if { (eval echo configure:1401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1401  rm -rf conftest*
1402  eval "ac_cv_lib_$ac_lib_var=yes"
1403else
1404  echo "configure: failed program was:" >&5
1405  cat conftest.$ac_ext >&5
1406  rm -rf conftest*
1407  eval "ac_cv_lib_$ac_lib_var=no"
1408fi
1409rm -f conftest*
1410LIBS="$ac_save_LIBS"
1411
1412fi
1413if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1414  echo "$ac_t""yes" 1>&6
1415    ac_tr_lib=HAVE_LIB`echo bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1416    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1417  cat >> confdefs.h <<EOF
1418#define $ac_tr_lib 1
1419EOF
1420
1421  LIBS="-lbsd $LIBS"
1422
1423else
1424  echo "$ac_t""no" 1>&6
1425fi
1426
1427echo $ac_n "checking for listen in -lsocket""... $ac_c" 1>&6
1428echo "configure:1429: checking for listen in -lsocket" >&5
1429ac_lib_var=`echo socket'_'listen | sed 'y%./+-%__p_%'`
1430if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1431  echo $ac_n "(cached) $ac_c" 1>&6
1432else
1433  ac_save_LIBS="$LIBS"
1434LIBS="-lsocket  $LIBS"
1435cat > conftest.$ac_ext <<EOF
1436#line 1437 "configure"
1437#include "confdefs.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 listen();
1442
1443int main() {
1444listen()
1445; return 0; }
1446EOF
1447if { (eval echo configure:1448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1448  rm -rf conftest*
1449  eval "ac_cv_lib_$ac_lib_var=yes"
1450else
1451  echo "configure: failed program was:" >&5
1452  cat conftest.$ac_ext >&5
1453  rm -rf conftest*
1454  eval "ac_cv_lib_$ac_lib_var=no"
1455fi
1456rm -f conftest*
1457LIBS="$ac_save_LIBS"
1458
1459fi
1460if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1461  echo "$ac_t""yes" 1>&6
1462    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1463    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1464  cat >> confdefs.h <<EOF
1465#define $ac_tr_lib 1
1466EOF
1467
1468  LIBS="-lsocket $LIBS"
1469
1470else
1471  echo "$ac_t""no" 1>&6
1472fi
1473
1474echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
1475echo "configure:1476: checking for gethostbyname in -lnsl" >&5
1476ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
1477if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1478  echo $ac_n "(cached) $ac_c" 1>&6
1479else
1480  ac_save_LIBS="$LIBS"
1481LIBS="-lnsl  $LIBS"
1482cat > conftest.$ac_ext <<EOF
1483#line 1484 "configure"
1484#include "confdefs.h"
1485/* Override any gcc2 internal prototype to avoid an error.  */
1486/* We use char because int might match the return type of a gcc2
1487    builtin and then its argument prototype would still apply.  */
1488char gethostbyname();
1489
1490int main() {
1491gethostbyname()
1492; return 0; }
1493EOF
1494if { (eval echo configure:1495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1495  rm -rf conftest*
1496  eval "ac_cv_lib_$ac_lib_var=yes"
1497else
1498  echo "configure: failed program was:" >&5
1499  cat conftest.$ac_ext >&5
1500  rm -rf conftest*
1501  eval "ac_cv_lib_$ac_lib_var=no"
1502fi
1503rm -f conftest*
1504LIBS="$ac_save_LIBS"
1505
1506fi
1507if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1508  echo "$ac_t""yes" 1>&6
1509    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1510    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1511  cat >> confdefs.h <<EOF
1512#define $ac_tr_lib 1
1513EOF
1514
1515  LIBS="-lnsl $LIBS"
1516
1517else
1518  echo "$ac_t""no" 1>&6
1519fi
1520
1521echo $ac_n "checking for index in -lucb""... $ac_c" 1>&6
1522echo "configure:1523: checking for index in -lucb" >&5
1523ac_lib_var=`echo ucb'_'index | sed 'y%./+-%__p_%'`
1524if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1525  echo $ac_n "(cached) $ac_c" 1>&6
1526else
1527  ac_save_LIBS="$LIBS"
1528LIBS="-lucb  $LIBS"
1529cat > conftest.$ac_ext <<EOF
1530#line 1531 "configure"
1531#include "confdefs.h"
1532/* Override any gcc2 internal prototype to avoid an error.  */
1533/* We use char because int might match the return type of a gcc2
1534    builtin and then its argument prototype would still apply.  */
1535char ;
1536
1537int main() {
1538index()
1539; return 0; }
1540EOF
1541if { (eval echo configure:1542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1542  rm -rf conftest*
1543  eval "ac_cv_lib_$ac_lib_var=yes"
1544else
1545  echo "configure: failed program was:" >&5
1546  cat conftest.$ac_ext >&5
1547  rm -rf conftest*
1548  eval "ac_cv_lib_$ac_lib_var=no"
1549fi
1550rm -f conftest*
1551LIBS="$ac_save_LIBS"
1552
1553fi
1554if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1555  echo "$ac_t""yes" 1>&6
1556    ac_tr_lib=HAVE_LIB`echo ucb | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1557    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1558  cat >> confdefs.h <<EOF
1559#define $ac_tr_lib 1
1560EOF
1561
1562  LIBS="-lucb $LIBS"
1563
1564else
1565  echo "$ac_t""no" 1>&6
1566fi
1567
1568
1569# heder file checks
1570echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1571echo "configure:1572: checking for ANSI C header files" >&5
1572if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1573  echo $ac_n "(cached) $ac_c" 1>&6
1574else
1575  cat > conftest.$ac_ext <<EOF
1576#line 1577 "configure"
1577#include "confdefs.h"
1578#include <stdlib.h>
1579#include <stdarg.h>
1580#include <string.h>
1581#include <float.h>
1582EOF
1583ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1584{ (eval echo configure:1585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1585ac_err=`grep -v '^ *+' conftest.out`
1586if test -z "$ac_err"; then
1587  rm -rf conftest*
1588  ac_cv_header_stdc=yes
1589else
1590  echo "$ac_err" >&5
1591  echo "configure: failed program was:" >&5
1592  cat conftest.$ac_ext >&5
1593  rm -rf conftest*
1594  ac_cv_header_stdc=no
1595fi
1596rm -f conftest*
1597
1598if test $ac_cv_header_stdc = yes; then
1599  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1600cat > conftest.$ac_ext <<EOF
1601#line 1602 "configure"
1602#include "confdefs.h"
1603#include <string.h>
1604EOF
1605if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1606  egrep "memchr" >/dev/null 2>&1; then
1607  :
1608else
1609  rm -rf conftest*
1610  ac_cv_header_stdc=no
1611fi
1612rm -f conftest*
1613
1614fi
1615
1616if test $ac_cv_header_stdc = yes; then
1617  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1618cat > conftest.$ac_ext <<EOF
1619#line 1620 "configure"
1620#include "confdefs.h"
1621#include <stdlib.h>
1622EOF
1623if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1624  egrep "free" >/dev/null 2>&1; then
1625  :
1626else
1627  rm -rf conftest*
1628  ac_cv_header_stdc=no
1629fi
1630rm -f conftest*
1631
1632fi
1633
1634if test $ac_cv_header_stdc = yes; then
1635  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1636if test "$cross_compiling" = yes; then
1637  :
1638else
1639  cat > conftest.$ac_ext <<EOF
1640#line 1641 "configure"
1641#include "confdefs.h"
1642#include <ctype.h>
1643#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1644#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1645#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1646int main () { int i; for (i = 0; i < 256; i++)
1647if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1648exit (0); }
1649
1650EOF
1651if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1652then
1653  :
1654else
1655  echo "configure: failed program was:" >&5
1656  cat conftest.$ac_ext >&5
1657  rm -fr conftest*
1658  ac_cv_header_stdc=no
1659fi
1660rm -fr conftest*
1661fi
1662
1663fi
1664fi
1665
1666echo "$ac_t""$ac_cv_header_stdc" 1>&6
1667if test $ac_cv_header_stdc = yes; then
1668  cat >> confdefs.h <<\EOF
1669#define STDC_HEADERS 1
1670EOF
1671
1672fi
1673
1674for ac_hdr in limits.h unistd.h
1675do
1676ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1677echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1678echo "configure:1679: checking for $ac_hdr" >&5
1679if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1680  echo $ac_n "(cached) $ac_c" 1>&6
1681else
1682  cat > conftest.$ac_ext <<EOF
1683#line 1684 "configure"
1684#include "confdefs.h"
1685#include <$ac_hdr>
1686EOF
1687ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1688{ (eval echo configure:1689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1689ac_err=`grep -v '^ *+' conftest.out`
1690if test -z "$ac_err"; then
1691  rm -rf conftest*
1692  eval "ac_cv_header_$ac_safe=yes"
1693else
1694  echo "$ac_err" >&5
1695  echo "configure: failed program was:" >&5
1696  cat conftest.$ac_ext >&5
1697  rm -rf conftest*
1698  eval "ac_cv_header_$ac_safe=no"
1699fi
1700rm -f conftest*
1701fi
1702if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1703  echo "$ac_t""yes" 1>&6
1704    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1705  cat >> confdefs.h <<EOF
1706#define $ac_tr_hdr 1
1707EOF
1708 
1709else
1710  echo "$ac_t""no" 1>&6
1711{ echo "configure: error: Can not compile without limits.h unistd.h" 1>&2; exit 1; }
1712fi
1713done
1714
1715
1716for ac_hdr in malloc.h sys/file.h sys/ioctl.h sys/time.h sys/times.h sys/types.h sys/stat.h fcntl.h sys/param.h pwd.h asm/sigcontext.h pwd.h
1717do
1718ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1719echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1720echo "configure:1721: checking for $ac_hdr" >&5
1721if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1722  echo $ac_n "(cached) $ac_c" 1>&6
1723else
1724  cat > conftest.$ac_ext <<EOF
1725#line 1726 "configure"
1726#include "confdefs.h"
1727#include <$ac_hdr>
1728EOF
1729ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1730{ (eval echo configure:1731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1731ac_err=`grep -v '^ *+' conftest.out`
1732if test -z "$ac_err"; then
1733  rm -rf conftest*
1734  eval "ac_cv_header_$ac_safe=yes"
1735else
1736  echo "$ac_err" >&5
1737  echo "configure: failed program was:" >&5
1738  cat conftest.$ac_ext >&5
1739  rm -rf conftest*
1740  eval "ac_cv_header_$ac_safe=no"
1741fi
1742rm -f conftest*
1743fi
1744if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1745  echo "$ac_t""yes" 1>&6
1746    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1747  cat >> confdefs.h <<EOF
1748#define $ac_tr_hdr 1
1749EOF
1750 
1751else
1752  echo "$ac_t""no" 1>&6
1753fi
1754done
1755
1756
1757# typedefs, structures
1758echo $ac_n "checking for working const""... $ac_c" 1>&6
1759echo "configure:1760: checking for working const" >&5
1760if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1761  echo $ac_n "(cached) $ac_c" 1>&6
1762else
1763  cat > conftest.$ac_ext <<EOF
1764#line 1765 "configure"
1765#include "confdefs.h"
1766
1767int main() {
1768
1769/* Ultrix mips cc rejects this.  */
1770typedef int charset[2]; const charset x;
1771/* SunOS 4.1.1 cc rejects this.  */
1772char const *const *ccp;
1773char **p;
1774/* NEC SVR4.0.2 mips cc rejects this.  */
1775struct point {int x, y;};
1776static struct point const zero = {0,0};
1777/* AIX XL C 1.02.0.0 rejects this.
1778   It does not let you subtract one const X* pointer from another in an arm
1779   of an if-expression whose if-part is not a constant expression */
1780const char *g = "string";
1781ccp = &g + (g ? g-g : 0);
1782/* HPUX 7.0 cc rejects these. */
1783++ccp;
1784p = (char**) ccp;
1785ccp = (char const *const *) p;
1786{ /* SCO 3.2v4 cc rejects this.  */
1787  char *t;
1788  char const *s = 0 ? (char *) 0 : (char const *) 0;
1789
1790  *t++ = 0;
1791}
1792{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1793  int x[] = {25, 17};
1794  const int *foo = &x[0];
1795  ++foo;
1796}
1797{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1798  typedef const int *iptr;
1799  iptr p = 0;
1800  ++p;
1801}
1802{ /* AIX XL C 1.02.0.0 rejects this saying
1803     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1804  struct s { int j; const int *ap[3]; };
1805  struct s *b; b->j = 5;
1806}
1807{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1808  const int foo = 10;
1809}
1810
1811; return 0; }
1812EOF
1813if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1814  rm -rf conftest*
1815  ac_cv_c_const=yes
1816else
1817  echo "configure: failed program was:" >&5
1818  cat conftest.$ac_ext >&5
1819  rm -rf conftest*
1820  ac_cv_c_const=no
1821fi
1822rm -f conftest*
1823fi
1824
1825echo "$ac_t""$ac_cv_c_const" 1>&6
1826if test $ac_cv_c_const = no; then
1827  cat >> confdefs.h <<\EOF
1828#define const
1829EOF
1830
1831fi
1832
1833echo $ac_n "checking for inline""... $ac_c" 1>&6
1834echo "configure:1835: checking for inline" >&5
1835if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1836  echo $ac_n "(cached) $ac_c" 1>&6
1837else
1838  ac_cv_c_inline=no
1839for ac_kw in inline __inline__ __inline; do
1840  cat > conftest.$ac_ext <<EOF
1841#line 1842 "configure"
1842#include "confdefs.h"
1843
1844int main() {
1845} $ac_kw foo() {
1846; return 0; }
1847EOF
1848if { (eval echo configure:1849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1849  rm -rf conftest*
1850  ac_cv_c_inline=$ac_kw; break
1851else
1852  echo "configure: failed program was:" >&5
1853  cat conftest.$ac_ext >&5
1854fi
1855rm -f conftest*
1856done
1857
1858fi
1859
1860echo "$ac_t""$ac_cv_c_inline" 1>&6
1861case "$ac_cv_c_inline" in
1862  inline | yes) ;;
1863  no) cat >> confdefs.h <<\EOF
1864#define inline
1865EOF
1866 ;;
1867  *)  cat >> confdefs.h <<EOF
1868#define inline $ac_cv_c_inline
1869EOF
1870 ;;
1871esac
1872
1873echo $ac_n "checking for size_t""... $ac_c" 1>&6
1874echo "configure:1875: checking for size_t" >&5
1875if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1876  echo $ac_n "(cached) $ac_c" 1>&6
1877else
1878  cat > conftest.$ac_ext <<EOF
1879#line 1880 "configure"
1880#include "confdefs.h"
1881#include <sys/types.h>
1882#if STDC_HEADERS
1883#include <stdlib.h>
1884#include <stddef.h>
1885#endif
1886EOF
1887if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1888  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1889  rm -rf conftest*
1890  ac_cv_type_size_t=yes
1891else
1892  rm -rf conftest*
1893  ac_cv_type_size_t=no
1894fi
1895rm -f conftest*
1896
1897fi
1898echo "$ac_t""$ac_cv_type_size_t" 1>&6
1899if test $ac_cv_type_size_t = no; then
1900  cat >> confdefs.h <<\EOF
1901#define size_t unsigned
1902EOF
1903
1904fi
1905
1906echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1907echo "configure:1908: checking whether time.h and sys/time.h may both be included" >&5
1908if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1909  echo $ac_n "(cached) $ac_c" 1>&6
1910else
1911  cat > conftest.$ac_ext <<EOF
1912#line 1913 "configure"
1913#include "confdefs.h"
1914#include <sys/types.h>
1915#include <sys/time.h>
1916#include <time.h>
1917int main() {
1918struct tm *tp;
1919; return 0; }
1920EOF
1921if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1922  rm -rf conftest*
1923  ac_cv_header_time=yes
1924else
1925  echo "configure: failed program was:" >&5
1926  cat conftest.$ac_ext >&5
1927  rm -rf conftest*
1928  ac_cv_header_time=no
1929fi
1930rm -f conftest*
1931fi
1932
1933echo "$ac_t""$ac_cv_header_time" 1>&6
1934if test $ac_cv_header_time = yes; then
1935  cat >> confdefs.h <<\EOF
1936#define TIME_WITH_SYS_TIME 1
1937EOF
1938
1939fi
1940
1941echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
1942echo "configure:1943: checking whether struct tm is in sys/time.h or time.h" >&5
1943if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
1944  echo $ac_n "(cached) $ac_c" 1>&6
1945else
1946  cat > conftest.$ac_ext <<EOF
1947#line 1948 "configure"
1948#include "confdefs.h"
1949#include <sys/types.h>
1950#include <time.h>
1951int main() {
1952struct tm *tp; tp->tm_sec;
1953; return 0; }
1954EOF
1955if { (eval echo configure:1956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1956  rm -rf conftest*
1957  ac_cv_struct_tm=time.h
1958else
1959  echo "configure: failed program was:" >&5
1960  cat conftest.$ac_ext >&5
1961  rm -rf conftest*
1962  ac_cv_struct_tm=sys/time.h
1963fi
1964rm -f conftest*
1965fi
1966
1967echo "$ac_t""$ac_cv_struct_tm" 1>&6
1968if test $ac_cv_struct_tm = sys/time.h; then
1969  cat >> confdefs.h <<\EOF
1970#define TM_IN_SYS_TIME 1
1971EOF
1972
1973fi
1974
1975
1976# library functions.
1977# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1978# for constant arguments.  Useless!
1979echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1980echo "configure:1981: checking for working alloca.h" >&5
1981if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1982  echo $ac_n "(cached) $ac_c" 1>&6
1983else
1984  cat > conftest.$ac_ext <<EOF
1985#line 1986 "configure"
1986#include "confdefs.h"
1987#include <alloca.h>
1988int main() {
1989char *p = alloca(2 * sizeof(int));
1990; return 0; }
1991EOF
1992if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1993  rm -rf conftest*
1994  ac_cv_header_alloca_h=yes
1995else
1996  echo "configure: failed program was:" >&5
1997  cat conftest.$ac_ext >&5
1998  rm -rf conftest*
1999  ac_cv_header_alloca_h=no
2000fi
2001rm -f conftest*
2002fi
2003
2004echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
2005if test $ac_cv_header_alloca_h = yes; then
2006  cat >> confdefs.h <<\EOF
2007#define HAVE_ALLOCA_H 1
2008EOF
2009
2010fi
2011
2012echo $ac_n "checking for alloca""... $ac_c" 1>&6
2013echo "configure:2014: checking for alloca" >&5
2014if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
2015  echo $ac_n "(cached) $ac_c" 1>&6
2016else
2017  cat > conftest.$ac_ext <<EOF
2018#line 2019 "configure"
2019#include "confdefs.h"
2020
2021#ifdef __GNUC__
2022# define alloca __builtin_alloca
2023#else
2024# if HAVE_ALLOCA_H
2025#  include <alloca.h>
2026# else
2027#  ifdef _AIX
2028 #pragma alloca
2029#  else
2030#   ifndef alloca /* predefined by HP cc +Olibcalls */
2031char *alloca ();
2032#   endif
2033#  endif
2034# endif
2035#endif
2036
2037int main() {
2038char *p = (char *) alloca(1);
2039; return 0; }
2040EOF
2041if { (eval echo configure:2042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2042  rm -rf conftest*
2043  ac_cv_func_alloca_works=yes
2044else
2045  echo "configure: failed program was:" >&5
2046  cat conftest.$ac_ext >&5
2047  rm -rf conftest*
2048  ac_cv_func_alloca_works=no
2049fi
2050rm -f conftest*
2051fi
2052
2053echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
2054if test $ac_cv_func_alloca_works = yes; then
2055  cat >> confdefs.h <<\EOF
2056#define HAVE_ALLOCA 1
2057EOF
2058
2059fi
2060
2061if test $ac_cv_func_alloca_works = no; then
2062  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
2063  # that cause trouble.  Some versions do not even contain alloca or
2064  # contain a buggy version.  If you still want to use their alloca,
2065  # use ar to extract alloca.o from them instead of compiling alloca.c.
2066  ALLOCA=alloca.o
2067  cat >> confdefs.h <<\EOF
2068#define C_ALLOCA 1
2069EOF
2070
2071
2072echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
2073echo "configure:2074: checking whether alloca needs Cray hooks" >&5
2074if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
2075  echo $ac_n "(cached) $ac_c" 1>&6
2076else
2077  cat > conftest.$ac_ext <<EOF
2078#line 2079 "configure"
2079#include "confdefs.h"
2080#if defined(CRAY) && ! defined(CRAY2)
2081webecray
2082#else
2083wenotbecray
2084#endif
2085
2086EOF
2087if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2088  egrep "webecray" >/dev/null 2>&1; then
2089  rm -rf conftest*
2090  ac_cv_os_cray=yes
2091else
2092  rm -rf conftest*
2093  ac_cv_os_cray=no
2094fi
2095rm -f conftest*
2096
2097fi
2098
2099echo "$ac_t""$ac_cv_os_cray" 1>&6
2100if test $ac_cv_os_cray = yes; then
2101for ac_func in _getb67 GETB67 getb67; do
2102  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2103echo "configure:2104: checking for $ac_func" >&5
2104if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2105  echo $ac_n "(cached) $ac_c" 1>&6
2106else
2107  cat > conftest.$ac_ext <<EOF
2108#line 2109 "configure"
2109#include "confdefs.h"
2110/* System header to define __stub macros and hopefully few prototypes,
2111    which can conflict with char $ac_func(); below.  */
2112#include <assert.h>
2113/* Override any gcc2 internal prototype to avoid an error.  */
2114/* We use char because int might match the return type of a gcc2
2115    builtin and then its argument prototype would still apply.  */
2116char $ac_func();
2117
2118int main() {
2119
2120/* The GNU C library defines this for functions which it implements
2121    to always fail with ENOSYS.  Some functions are actually named
2122    something starting with __ and the normal name is an alias.  */
2123#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2124choke me
2125#else
2126$ac_func();
2127#endif
2128
2129; return 0; }
2130EOF
2131if { (eval echo configure:2132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2132  rm -rf conftest*
2133  eval "ac_cv_func_$ac_func=yes"
2134else
2135  echo "configure: failed program was:" >&5
2136  cat conftest.$ac_ext >&5
2137  rm -rf conftest*
2138  eval "ac_cv_func_$ac_func=no"
2139fi
2140rm -f conftest*
2141fi
2142
2143if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2144  echo "$ac_t""yes" 1>&6
2145  cat >> confdefs.h <<EOF
2146#define CRAY_STACKSEG_END $ac_func
2147EOF
2148
2149  break
2150else
2151  echo "$ac_t""no" 1>&6
2152fi
2153
2154done
2155fi
2156
2157echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
2158echo "configure:2159: checking stack direction for C alloca" >&5
2159if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
2160  echo $ac_n "(cached) $ac_c" 1>&6
2161else
2162  if test "$cross_compiling" = yes; then
2163  ac_cv_c_stack_direction=0
2164else
2165  cat > conftest.$ac_ext <<EOF
2166#line 2167 "configure"
2167#include "confdefs.h"
2168find_stack_direction ()
2169{
2170  static char *addr = 0;
2171  auto char dummy;
2172  if (addr == 0)
2173    {
2174      addr = &dummy;
2175      return find_stack_direction ();
2176    }
2177  else
2178    return (&dummy > addr) ? 1 : -1;
2179}
2180main ()
2181{
2182  exit (find_stack_direction() < 0);
2183}
2184EOF
2185if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2186then
2187  ac_cv_c_stack_direction=1
2188else
2189  echo "configure: failed program was:" >&5
2190  cat conftest.$ac_ext >&5
2191  rm -fr conftest*
2192  ac_cv_c_stack_direction=-1
2193fi
2194rm -fr conftest*
2195fi
2196
2197fi
2198
2199echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
2200cat >> confdefs.h <<EOF
2201#define STACK_DIRECTION $ac_cv_c_stack_direction
2202EOF
2203
2204fi
2205
2206if test $ac_cv_prog_gcc = yes; then
2207    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
2208echo "configure:2209: checking whether ${CC-cc} needs -traditional" >&5
2209if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
2210  echo $ac_n "(cached) $ac_c" 1>&6
2211else
2212    ac_pattern="Autoconf.*'x'"
2213  cat > conftest.$ac_ext <<EOF
2214#line 2215 "configure"
2215#include "confdefs.h"
2216#include <sgtty.h>
2217Autoconf TIOCGETP
2218EOF
2219if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2220  egrep "$ac_pattern" >/dev/null 2>&1; then
2221  rm -rf conftest*
2222  ac_cv_prog_gcc_traditional=yes
2223else
2224  rm -rf conftest*
2225  ac_cv_prog_gcc_traditional=no
2226fi
2227rm -f conftest*
2228
2229
2230  if test $ac_cv_prog_gcc_traditional = no; then
2231    cat > conftest.$ac_ext <<EOF
2232#line 2233 "configure"
2233#include "confdefs.h"
2234#include <termio.h>
2235Autoconf TCGETA
2236EOF
2237if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2238  egrep "$ac_pattern" >/dev/null 2>&1; then
2239  rm -rf conftest*
2240  ac_cv_prog_gcc_traditional=yes
2241fi
2242rm -f conftest*
2243
2244  fi
2245fi
2246
2247echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
2248  if test $ac_cv_prog_gcc_traditional = yes; then
2249    CC="$CC -traditional"
2250  fi
2251fi
2252
2253for ac_hdr in unistd.h
2254do
2255ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2256echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2257echo "configure:2258: checking for $ac_hdr" >&5
2258if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2259  echo $ac_n "(cached) $ac_c" 1>&6
2260else
2261  cat > conftest.$ac_ext <<EOF
2262#line 2263 "configure"
2263#include "confdefs.h"
2264#include <$ac_hdr>
2265EOF
2266ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2267{ (eval echo configure:2268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2268ac_err=`grep -v '^ *+' conftest.out`
2269if test -z "$ac_err"; then
2270  rm -rf conftest*
2271  eval "ac_cv_header_$ac_safe=yes"
2272else
2273  echo "$ac_err" >&5
2274  echo "configure: failed program was:" >&5
2275  cat conftest.$ac_ext >&5
2276  rm -rf conftest*
2277  eval "ac_cv_header_$ac_safe=no"
2278fi
2279rm -f conftest*
2280fi
2281if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2282  echo "$ac_t""yes" 1>&6
2283    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2284  cat >> confdefs.h <<EOF
2285#define $ac_tr_hdr 1
2286EOF
2287 
2288else
2289  echo "$ac_t""no" 1>&6
2290fi
2291done
2292
2293for ac_func in getpagesize
2294do
2295echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2296echo "configure:2297: checking for $ac_func" >&5
2297if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2298  echo $ac_n "(cached) $ac_c" 1>&6
2299else
2300  cat > conftest.$ac_ext <<EOF
2301#line 2302 "configure"
2302#include "confdefs.h"
2303/* System header to define __stub macros and hopefully few prototypes,
2304    which can conflict with char $ac_func(); below.  */
2305#include <assert.h>
2306/* Override any gcc2 internal prototype to avoid an error.  */
2307/* We use char because int might match the return type of a gcc2
2308    builtin and then its argument prototype would still apply.  */
2309char $ac_func();
2310
2311int main() {
2312
2313/* The GNU C library defines this for functions which it implements
2314    to always fail with ENOSYS.  Some functions are actually named
2315    something starting with __ and the normal name is an alias.  */
2316#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2317choke me
2318#else
2319$ac_func();
2320#endif
2321
2322; return 0; }
2323EOF
2324if { (eval echo configure:2325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2325  rm -rf conftest*
2326  eval "ac_cv_func_$ac_func=yes"
2327else
2328  echo "configure: failed program was:" >&5
2329  cat conftest.$ac_ext >&5
2330  rm -rf conftest*
2331  eval "ac_cv_func_$ac_func=no"
2332fi
2333rm -f conftest*
2334fi
2335
2336if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2337  echo "$ac_t""yes" 1>&6
2338    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2339  cat >> confdefs.h <<EOF
2340#define $ac_tr_func 1
2341EOF
2342 
2343else
2344  echo "$ac_t""no" 1>&6
2345fi
2346done
2347
2348echo $ac_n "checking for working mmap""... $ac_c" 1>&6
2349echo "configure:2350: checking for working mmap" >&5
2350if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
2351  echo $ac_n "(cached) $ac_c" 1>&6
2352else
2353  if test "$cross_compiling" = yes; then
2354  ac_cv_func_mmap_fixed_mapped=no
2355else
2356  cat > conftest.$ac_ext <<EOF
2357#line 2358 "configure"
2358#include "confdefs.h"
2359
2360/* Thanks to Mike Haertel and Jim Avera for this test.
2361   Here is a matrix of mmap possibilities:
2362        mmap private not fixed
2363        mmap private fixed at somewhere currently unmapped
2364        mmap private fixed at somewhere already mapped
2365        mmap shared not fixed
2366        mmap shared fixed at somewhere currently unmapped
2367        mmap shared fixed at somewhere already mapped
2368   For private mappings, we should verify that changes cannot be read()
2369   back from the file, nor mmap's back from the file at a different
2370   address.  (There have been systems where private was not correctly
2371   implemented like the infamous i386 svr4.0, and systems where the
2372   VM page cache was not coherent with the filesystem buffer cache
2373   like early versions of FreeBSD and possibly contemporary NetBSD.)
2374   For shared mappings, we should conversely verify that changes get
2375   propogated back to all the places they're supposed to be.
2376
2377   Grep wants private fixed already mapped.
2378   The main things grep needs to know about mmap are:
2379   * does it exist and is it safe to write into the mmap'd area
2380   * how to use it (BSD variants)  */
2381#include <sys/types.h>
2382#include <fcntl.h>
2383#include <sys/mman.h>
2384
2385/* This mess was copied from the GNU getpagesize.h.  */
2386#ifndef HAVE_GETPAGESIZE
2387# ifdef HAVE_UNISTD_H
2388#  include <unistd.h>
2389# endif
2390
2391/* Assume that all systems that can run configure have sys/param.h.  */
2392# ifndef HAVE_SYS_PARAM_H
2393#  define HAVE_SYS_PARAM_H 1
2394# endif
2395
2396# ifdef _SC_PAGESIZE
2397#  define getpagesize() sysconf(_SC_PAGESIZE)
2398# else /* no _SC_PAGESIZE */
2399#  ifdef HAVE_SYS_PARAM_H
2400#   include <sys/param.h>
2401#   ifdef EXEC_PAGESIZE
2402#    define getpagesize() EXEC_PAGESIZE
2403#   else /* no EXEC_PAGESIZE */
2404#    ifdef NBPG
2405#     define getpagesize() NBPG * CLSIZE
2406#     ifndef CLSIZE
2407#      define CLSIZE 1
2408#     endif /* no CLSIZE */
2409#    else /* no NBPG */
2410#     ifdef NBPC
2411#      define getpagesize() NBPC
2412#     else /* no NBPC */
2413#      ifdef PAGESIZE
2414#       define getpagesize() PAGESIZE
2415#      endif /* PAGESIZE */
2416#     endif /* no NBPC */
2417#    endif /* no NBPG */
2418#   endif /* no EXEC_PAGESIZE */
2419#  else /* no HAVE_SYS_PARAM_H */
2420#   define getpagesize() 8192   /* punt totally */
2421#  endif /* no HAVE_SYS_PARAM_H */
2422# endif /* no _SC_PAGESIZE */
2423
2424#endif /* no HAVE_GETPAGESIZE */
2425
2426#ifdef __cplusplus
2427extern "C" { void *malloc(unsigned); }
2428#else
2429char *malloc();
2430#endif
2431
2432int
2433main()
2434{
2435        char *data, *data2, *data3;
2436        int i, pagesize;
2437        int fd;
2438
2439        pagesize = getpagesize();
2440
2441        /*
2442         * First, make a file with some known garbage in it.
2443         */
2444        data = malloc(pagesize);
2445        if (!data)
2446                exit(1);
2447        for (i = 0; i < pagesize; ++i)
2448                *(data + i) = rand();
2449        umask(0);
2450        fd = creat("conftestmmap", 0600);
2451        if (fd < 0)
2452                exit(1);
2453        if (write(fd, data, pagesize) != pagesize)
2454                exit(1);
2455        close(fd);
2456
2457        /*
2458         * Next, try to mmap the file at a fixed address which
2459         * already has something else allocated at it.  If we can,
2460         * also make sure that we see the same garbage.
2461         */
2462        fd = open("conftestmmap", O_RDWR);
2463        if (fd < 0)
2464                exit(1);
2465        data2 = malloc(2 * pagesize);
2466        if (!data2)
2467                exit(1);
2468        data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
2469        if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
2470            MAP_PRIVATE | MAP_FIXED, fd, 0L))
2471                exit(1);
2472        for (i = 0; i < pagesize; ++i)
2473                if (*(data + i) != *(data2 + i))
2474                        exit(1);
2475
2476        /*
2477         * Finally, make sure that changes to the mapped area
2478         * do not percolate back to the file as seen by read().
2479         * (This is a bug on some variants of i386 svr4.0.)
2480         */
2481        for (i = 0; i < pagesize; ++i)
2482                *(data2 + i) = *(data2 + i) + 1;
2483        data3 = malloc(pagesize);
2484        if (!data3)
2485                exit(1);
2486        if (read(fd, data3, pagesize) != pagesize)
2487                exit(1);
2488        for (i = 0; i < pagesize; ++i)
2489                if (*(data + i) != *(data3 + i))
2490                        exit(1);
2491        close(fd);
2492        unlink("conftestmmap");
2493        exit(0);
2494}
2495
2496EOF
2497if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2498then
2499  ac_cv_func_mmap_fixed_mapped=yes
2500else
2501  echo "configure: failed program was:" >&5
2502  cat conftest.$ac_ext >&5
2503  rm -fr conftest*
2504  ac_cv_func_mmap_fixed_mapped=no
2505fi
2506rm -fr conftest*
2507fi
2508
2509fi
2510
2511echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
2512if test $ac_cv_func_mmap_fixed_mapped = yes; then
2513  cat >> confdefs.h <<\EOF
2514#define HAVE_MMAP 1
2515EOF
2516
2517fi
2518
2519echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2520echo "configure:2521: checking return type of signal handlers" >&5
2521if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2522  echo $ac_n "(cached) $ac_c" 1>&6
2523else
2524  cat > conftest.$ac_ext <<EOF
2525#line 2526 "configure"
2526#include "confdefs.h"
2527#include <sys/types.h>
2528#include <signal.h>
2529#ifdef signal
2530#undef signal
2531#endif
2532#ifdef __cplusplus
2533extern "C" void (*signal (int, void (*)(int)))(int);
2534#else
2535void (*signal ()) ();
2536#endif
2537
2538int main() {
2539int i;
2540; return 0; }
2541EOF
2542if { (eval echo configure:2543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2543  rm -rf conftest*
2544  ac_cv_type_signal=void
2545else
2546  echo "configure: failed program was:" >&5
2547  cat conftest.$ac_ext >&5
2548  rm -rf conftest*
2549  ac_cv_type_signal=int
2550fi
2551rm -f conftest*
2552fi
2553
2554echo "$ac_t""$ac_cv_type_signal" 1>&6
2555cat >> confdefs.h <<EOF
2556#define RETSIGTYPE $ac_cv_type_signal
2557EOF
2558
2559
2560echo $ac_n "checking for vprintf""... $ac_c" 1>&6
2561echo "configure:2562: checking for vprintf" >&5
2562if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
2563  echo $ac_n "(cached) $ac_c" 1>&6
2564else
2565  cat > conftest.$ac_ext <<EOF
2566#line 2567 "configure"
2567#include "confdefs.h"
2568/* System header to define __stub macros and hopefully few prototypes,
2569    which can conflict with char vprintf(); below.  */
2570#include <assert.h>
2571/* Override any gcc2 internal prototype to avoid an error.  */
2572/* We use char because int might match the return type of a gcc2
2573    builtin and then its argument prototype would still apply.  */
2574char vprintf();
2575
2576int main() {
2577
2578/* The GNU C library defines this for functions which it implements
2579    to always fail with ENOSYS.  Some functions are actually named
2580    something starting with __ and the normal name is an alias.  */
2581#if defined (__stub_vprintf) || defined (__stub___vprintf)
2582choke me
2583#else
2584vprintf();
2585#endif
2586
2587; return 0; }
2588EOF
2589if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2590  rm -rf conftest*
2591  eval "ac_cv_func_vprintf=yes"
2592else
2593  echo "configure: failed program was:" >&5
2594  cat conftest.$ac_ext >&5
2595  rm -rf conftest*
2596  eval "ac_cv_func_vprintf=no"
2597fi
2598rm -f conftest*
2599fi
2600
2601if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
2602  echo "$ac_t""yes" 1>&6
2603  cat >> confdefs.h <<\EOF
2604#define HAVE_VPRINTF 1
2605EOF
2606
2607else
2608  echo "$ac_t""no" 1>&6
2609fi
2610
2611if test "$ac_cv_func_vprintf" != yes; then
2612echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
2613echo "configure:2614: checking for _doprnt" >&5
2614if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
2615  echo $ac_n "(cached) $ac_c" 1>&6
2616else
2617  cat > conftest.$ac_ext <<EOF
2618#line 2619 "configure"
2619#include "confdefs.h"
2620/* System header to define __stub macros and hopefully few prototypes,
2621    which can conflict with char _doprnt(); below.  */
2622#include <assert.h>
2623/* Override any gcc2 internal prototype to avoid an error.  */
2624/* We use char because int might match the return type of a gcc2
2625    builtin and then its argument prototype would still apply.  */
2626char _doprnt();
2627
2628int main() {
2629
2630/* The GNU C library defines this for functions which it implements
2631    to always fail with ENOSYS.  Some functions are actually named
2632    something starting with __ and the normal name is an alias.  */
2633#if defined (__stub__doprnt) || defined (__stub____doprnt)
2634choke me
2635#else
2636_doprnt();
2637#endif
2638
2639; return 0; }
2640EOF
2641if { (eval echo configure:2642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2642  rm -rf conftest*
2643  eval "ac_cv_func__doprnt=yes"
2644else
2645  echo "configure: failed program was:" >&5
2646  cat conftest.$ac_ext >&5
2647  rm -rf conftest*
2648  eval "ac_cv_func__doprnt=no"
2649fi
2650rm -f conftest*
2651fi
2652
2653if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
2654  echo "$ac_t""yes" 1>&6
2655  cat >> confdefs.h <<\EOF
2656#define HAVE_DOPRNT 1
2657EOF
2658
2659else
2660  echo "$ac_t""no" 1>&6
2661fi
2662
2663fi
2664
2665for ac_func in gettimeofday atexit bcopy getcwd getwd vsnprintf sbrk readlink sleep usleep valloc getpagesize setenv getpwnam
2666do
2667echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2668echo "configure:2669: checking for $ac_func" >&5
2669if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2670  echo $ac_n "(cached) $ac_c" 1>&6
2671else
2672  cat > conftest.$ac_ext <<EOF
2673#line 2674 "configure"
2674#include "confdefs.h"
2675/* System header to define __stub macros and hopefully few prototypes,
2676    which can conflict with char $ac_func(); below.  */
2677#include <assert.h>
2678/* Override any gcc2 internal prototype to avoid an error.  */
2679/* We use char because int might match the return type of a gcc2
2680    builtin and then its argument prototype would still apply.  */
2681char $ac_func();
2682
2683int main() {
2684
2685/* The GNU C library defines this for functions which it implements
2686    to always fail with ENOSYS.  Some functions are actually named
2687    something starting with __ and the normal name is an alias.  */
2688#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2689choke me
2690#else
2691$ac_func();
2692#endif
2693
2694; return 0; }
2695EOF
2696if { (eval echo configure:2697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
2697  rm -rf conftest*
2698  eval "ac_cv_func_$ac_func=yes"
2699else
2700  echo "configure: failed program was:" >&5
2701  cat conftest.$ac_ext >&5
2702  rm -rf conftest*
2703  eval "ac_cv_func_$ac_func=no"
2704fi
2705rm -f conftest*
2706fi
2707
2708if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2709  echo "$ac_t""yes" 1>&6
2710    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2711  cat >> confdefs.h <<EOF
2712#define $ac_tr_func 1
2713EOF
2714 
2715else
2716  echo "$ac_t""no" 1>&6
2717fi
2718done
2719
2720
2721
2722# arithmetic shifts
2723echo $ac_n "checking whether your machine has correct arithmetic shifts""... $ac_c" 1>&6
2724echo "configure:2725: checking whether your machine has correct arithmetic shifts" >&5
2725if eval "test \"`echo '$''{'ac_cv_shift'+set}'`\" = set"; then
2726  echo $ac_n "(cached) $ac_c" 1>&6
2727else
2728  if test "$cross_compiling" = yes; then
2729  if test "$ac_c_cross_dos" = yes; then
2730     ac_cv_shift=yes;
2731   else
2732     echo "$ac_t""no" 1>&6
2733     { echo "configure: error: cross compilation without default value" 1>&2; exit 1; }
2734   fi
2735else
2736  cat > conftest.$ac_ext <<EOF
2737#line 2738 "configure"
2738#include "confdefs.h"
2739 int main() { if (-2 >> 1 == -1) exit(0); else exit(1); }
2740EOF
2741if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2742then
2743  ac_cv_shift=yes
2744else
2745  echo "configure: failed program was:" >&5
2746  cat conftest.$ac_ext >&5
2747  rm -fr conftest*
2748  ac_cv_shift=no
2749fi
2750rm -fr conftest*
2751fi
2752
2753fi
2754
2755
2756if test "$ac_cv_shift" = yes; then
2757  echo "$ac_t""yes" 1>&6
2758else
2759  echo "$ac_t""no" 1>&6
2760  { echo "configure: error: need  -2 >> 1 == -1" 1>&2; exit 1; }
2761fi
2762
2763
2764# check for a peculiar constructor initialization
2765echo $ac_n "checking whether explicit C++ constructor calls are allowed""... $ac_c" 1>&6
2766echo "configure:2767: checking whether explicit C++ constructor calls are allowed" >&5
2767
2768ac_ext=C
2769# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2770ac_cpp='$CXXCPP $CPPFLAGS'
2771ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2772ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2773cross_compiling=$ac_cv_prog_cxx_cross
2774
2775if eval "test \"`echo '$''{'ac_cv_explicit_const'+set}'`\" = set"; then
2776  echo $ac_n "(cached) $ac_c" 1>&6
2777else
2778  cat > conftest.$ac_ext <<EOF
2779#line 2780 "configure"
2780#include "confdefs.h"
2781
2782int main() {
2783class testclass
2784  {
2785  public:
2786    int value;
2787    testclass() : value(0) {}
2788    testclass( int i ) : value(i) {}
2789    ~testclass() { value = 0; }
2790  };
2791
2792  testclass ptr;
2793  ptr.testclass(1);
2794
2795; return 0; }
2796EOF
2797if { (eval echo configure:2798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2798  rm -rf conftest*
2799  ac_cv_explicit_const=yes
2800else
2801  echo "configure: failed program was:" >&5
2802  cat conftest.$ac_ext >&5
2803  rm -rf conftest*
2804  ac_cv_explicit_const=no
2805fi
2806rm -f conftest*
2807fi
2808
2809ac_ext=c
2810# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2811ac_cpp='$CPP $CPPFLAGS'
2812ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2813ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2814cross_compiling=$ac_cv_prog_cc_cross
2815
2816echo "$ac_t""$ac_cv_explicit_const" 1>&6
2817if test "$ac_cv_explicit_const" = yes; then
2818  cat >> confdefs.h <<\EOF
2819#define HAVE_EXPLICIT_CONSTR 1
2820EOF
2821
2822fi
2823
2824# sprintf returns number of printed chars
2825echo $ac_n "checking whether vsprintf returns number of printed chars""... $ac_c" 1>&6
2826echo "configure:2827: checking whether vsprintf returns number of printed chars" >&5
2827if eval "test \"`echo '$''{'ac_cv_returns_n_of_chars'+set}'`\" = set"; then
2828  echo $ac_n "(cached) $ac_c" 1>&6
2829else
2830  if test "$cross_compiling" = yes; then
2831  ac_cv_returns_n_of_chars=no
2832else
2833  cat > conftest.$ac_ext <<EOF
2834#line 2835 "configure"
2835#include "confdefs.h"
2836#include <stdio.h>
2837 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }
2838EOF
2839if { (eval echo configure:2840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2840then
2841  ac_cv_returns_n_of_chars=yes
2842else
2843  echo "configure: failed program was:" >&5
2844  cat conftest.$ac_ext >&5
2845  rm -fr conftest*
2846  ac_cv_returns_n_of_chars=no
2847fi
2848rm -fr conftest*
2849fi
2850
2851fi
2852
2853if test "$ac_cv_returns_n_of_chars" = yes; then
2854  echo "$ac_t""yes" 1>&6
2855else
2856  echo "$ac_t""no" 1>&6
2857  cat >> confdefs.h <<\EOF
2858#define BSD_SPRINTF 1
2859EOF
2860
2861fi
2862
2863# determine ALIGN_8
2864echo $ac_n "checking size of char""... $ac_c" 1>&6
2865echo "configure:2866: checking size of char" >&5
2866if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
2867  echo $ac_n "(cached) $ac_c" 1>&6
2868else
2869  if test "$cross_compiling" = yes; then
2870  ac_cv_sizeof_char=1
2871else
2872  cat > conftest.$ac_ext <<EOF
2873#line 2874 "configure"
2874#include "confdefs.h"
2875#include <stdio.h>
2876main()
2877{
2878  FILE *f=fopen("conftestval", "w");
2879  if (!f) exit(1);
2880  fprintf(f, "%d\n", sizeof(char));
2881  exit(0);
2882}
2883EOF
2884if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2885then
2886  ac_cv_sizeof_char=`cat conftestval`
2887else
2888  echo "configure: failed program was:" >&5
2889  cat conftest.$ac_ext >&5
2890  rm -fr conftest*
2891  ac_cv_sizeof_char=0
2892fi
2893rm -fr conftest*
2894fi
2895
2896fi
2897echo "$ac_t""$ac_cv_sizeof_char" 1>&6
2898cat >> confdefs.h <<EOF
2899#define SIZEOF_CHAR $ac_cv_sizeof_char
2900EOF
2901
2902
2903echo $ac_n "checking size of short""... $ac_c" 1>&6
2904echo "configure:2905: checking size of short" >&5
2905if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
2906  echo $ac_n "(cached) $ac_c" 1>&6
2907else
2908  if test "$cross_compiling" = yes; then
2909  ac_cv_sizeof_short=2
2910else
2911  cat > conftest.$ac_ext <<EOF
2912#line 2913 "configure"
2913#include "confdefs.h"
2914#include <stdio.h>
2915main()
2916{
2917  FILE *f=fopen("conftestval", "w");
2918  if (!f) exit(1);
2919  fprintf(f, "%d\n", sizeof(short));
2920  exit(0);
2921}
2922EOF
2923if { (eval echo configure:2924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2924then
2925  ac_cv_sizeof_short=`cat conftestval`
2926else
2927  echo "configure: failed program was:" >&5
2928  cat conftest.$ac_ext >&5
2929  rm -fr conftest*
2930  ac_cv_sizeof_short=0
2931fi
2932rm -fr conftest*
2933fi
2934
2935fi
2936echo "$ac_t""$ac_cv_sizeof_short" 1>&6
2937cat >> confdefs.h <<EOF
2938#define SIZEOF_SHORT $ac_cv_sizeof_short
2939EOF
2940
2941
2942echo $ac_n "checking size of int""... $ac_c" 1>&6
2943echo "configure:2944: checking size of int" >&5
2944if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
2945  echo $ac_n "(cached) $ac_c" 1>&6
2946else
2947  if test "$cross_compiling" = yes; then
2948  ac_cv_sizeof_int=4
2949else
2950  cat > conftest.$ac_ext <<EOF
2951#line 2952 "configure"
2952#include "confdefs.h"
2953#include <stdio.h>
2954main()
2955{
2956  FILE *f=fopen("conftestval", "w");
2957  if (!f) exit(1);
2958  fprintf(f, "%d\n", sizeof(int));
2959  exit(0);
2960}
2961EOF
2962if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
2963then
2964  ac_cv_sizeof_int=`cat conftestval`
2965else
2966  echo "configure: failed program was:" >&5
2967  cat conftest.$ac_ext >&5
2968  rm -fr conftest*
2969  ac_cv_sizeof_int=0
2970fi
2971rm -fr conftest*
2972fi
2973
2974fi
2975echo "$ac_t""$ac_cv_sizeof_int" 1>&6
2976cat >> confdefs.h <<EOF
2977#define SIZEOF_INT $ac_cv_sizeof_int
2978EOF
2979
2980
2981echo $ac_n "checking size of long""... $ac_c" 1>&6
2982echo "configure:2983: checking size of long" >&5
2983if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
2984  echo $ac_n "(cached) $ac_c" 1>&6
2985else
2986  if test "$cross_compiling" = yes; then
2987  ac_cv_sizeof_long=4
2988else
2989  cat > conftest.$ac_ext <<EOF
2990#line 2991 "configure"
2991#include "confdefs.h"
2992#include <stdio.h>
2993main()
2994{
2995  FILE *f=fopen("conftestval", "w");
2996  if (!f) exit(1);
2997  fprintf(f, "%d\n", sizeof(long));
2998  exit(0);
2999}
3000EOF
3001if { (eval echo configure:3002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3002then
3003  ac_cv_sizeof_long=`cat conftestval`
3004else
3005  echo "configure: failed program was:" >&5
3006  cat conftest.$ac_ext >&5
3007  rm -fr conftest*
3008  ac_cv_sizeof_long=0
3009fi
3010rm -fr conftest*
3011fi
3012
3013fi
3014echo "$ac_t""$ac_cv_sizeof_long" 1>&6
3015cat >> confdefs.h <<EOF
3016#define SIZEOF_LONG $ac_cv_sizeof_long
3017EOF
3018
3019
3020echo $ac_n "checking size of void*""... $ac_c" 1>&6
3021echo "configure:3022: checking size of void*" >&5
3022if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
3023  echo $ac_n "(cached) $ac_c" 1>&6
3024else
3025  if test "$cross_compiling" = yes; then
3026  ac_cv_sizeof_voidp=4
3027else
3028  cat > conftest.$ac_ext <<EOF
3029#line 3030 "configure"
3030#include "confdefs.h"
3031#include <stdio.h>
3032main()
3033{
3034  FILE *f=fopen("conftestval", "w");
3035  if (!f) exit(1);
3036  fprintf(f, "%d\n", sizeof(void*));
3037  exit(0);
3038}
3039EOF
3040if { (eval echo configure:3041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3041then
3042  ac_cv_sizeof_voidp=`cat conftestval`
3043else
3044  echo "configure: failed program was:" >&5
3045  cat conftest.$ac_ext >&5
3046  rm -fr conftest*
3047  ac_cv_sizeof_voidp=0
3048fi
3049rm -fr conftest*
3050fi
3051
3052fi
3053echo "$ac_t""$ac_cv_sizeof_voidp" 1>&6
3054cat >> confdefs.h <<EOF
3055#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
3056EOF
3057
3058
3059echo $ac_n "checking size of double""... $ac_c" 1>&6
3060echo "configure:3061: checking size of double" >&5
3061if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
3062  echo $ac_n "(cached) $ac_c" 1>&6
3063else
3064  if test "$cross_compiling" = yes; then
3065  ac_cv_sizeof_double=8
3066else
3067  cat > conftest.$ac_ext <<EOF
3068#line 3069 "configure"
3069#include "confdefs.h"
3070#include <stdio.h>
3071main()
3072{
3073  FILE *f=fopen("conftestval", "w");
3074  if (!f) exit(1);
3075  fprintf(f, "%d\n", sizeof(double));
3076  exit(0);
3077}
3078EOF
3079if { (eval echo configure:3080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3080then
3081  ac_cv_sizeof_double=`cat conftestval`
3082else
3083  echo "configure: failed program was:" >&5
3084  cat conftest.$ac_ext >&5
3085  rm -fr conftest*
3086  ac_cv_sizeof_double=0
3087fi
3088rm -fr conftest*
3089fi
3090
3091fi
3092echo "$ac_t""$ac_cv_sizeof_double" 1>&6
3093cat >> confdefs.h <<EOF
3094#define SIZEOF_DOUBLE $ac_cv_sizeof_double
3095EOF
3096
3097
3098echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
3099echo "configure:3100: checking whether byte ordering is bigendian" >&5
3100if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
3101  echo $ac_n "(cached) $ac_c" 1>&6
3102else
3103  ac_cv_c_bigendian=unknown
3104# See if sys/param.h defines the BYTE_ORDER macro.
3105cat > conftest.$ac_ext <<EOF
3106#line 3107 "configure"
3107#include "confdefs.h"
3108#include <sys/types.h>
3109#include <sys/param.h>
3110int main() {
3111
3112#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
3113 bogus endian macros
3114#endif
3115; return 0; }
3116EOF
3117if { (eval echo configure:3118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3118  rm -rf conftest*
3119  # It does; now see whether it defined to BIG_ENDIAN or not.
3120cat > conftest.$ac_ext <<EOF
3121#line 3122 "configure"
3122#include "confdefs.h"
3123#include <sys/types.h>
3124#include <sys/param.h>
3125int main() {
3126
3127#if BYTE_ORDER != BIG_ENDIAN
3128 not big endian
3129#endif
3130; return 0; }
3131EOF
3132if { (eval echo configure:3133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3133  rm -rf conftest*
3134  ac_cv_c_bigendian=yes
3135else
3136  echo "configure: failed program was:" >&5
3137  cat conftest.$ac_ext >&5
3138  rm -rf conftest*
3139  ac_cv_c_bigendian=no
3140fi
3141rm -f conftest*
3142else
3143  echo "configure: failed program was:" >&5
3144  cat conftest.$ac_ext >&5
3145fi
3146rm -f conftest*
3147if test $ac_cv_c_bigendian = unknown; then
3148if test "$cross_compiling" = yes; then
3149    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
3150else
3151  cat > conftest.$ac_ext <<EOF
3152#line 3153 "configure"
3153#include "confdefs.h"
3154main () {
3155  /* Are we little or big endian?  From Harbison&Steele.  */
3156  union
3157  {
3158    long l;
3159    char c[sizeof (long)];
3160  } u;
3161  u.l = 1;
3162  exit (u.c[sizeof (long) - 1] == 1);
3163}
3164EOF
3165if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3166then
3167  ac_cv_c_bigendian=no
3168else
3169  echo "configure: failed program was:" >&5
3170  cat conftest.$ac_ext >&5
3171  rm -fr conftest*
3172  ac_cv_c_bigendian=yes
3173fi
3174rm -fr conftest*
3175fi
3176
3177fi
3178fi
3179
3180echo "$ac_t""$ac_cv_c_bigendian" 1>&6
3181if test $ac_cv_c_bigendian = yes; then
3182  cat >> confdefs.h <<\EOF
3183#define WORDS_BIGENDIAN 1
3184EOF
3185
3186fi
3187
3188if test "$ac_cv_sizeof_int" != 4; then
3189  { echo "configure: error: need int to be four bytes long" 1>&2; exit 1; }
3190fi
3191if test "$ac_cv_sizeof_long" != "$ac_cv_sizeof_voidp"; then
3192  { echo "configure: error: need equal sizes for long and void*" 1>&2; exit 1; }
3193fi
3194if test "$ac_cv_sizeof_double" != 8; then
3195  { echo "configure: error: need double to b 8 bytes long" 1>&2; exit 1; }
3196fi
3197if test "$ac_cv_sizeof_voidp" != 4 && "$ac_cv_sizeof_voidp" != 8; then
3198  { echo "configure: error: need void* to be 4 or 8 bytes long" 1>&2; exit 1; }
3199fi
3200
3201echo $ac_n "checking size of system page""... $ac_c" 1>&6
3202echo "configure:3203: checking size of system page" >&5
3203if eval "test \"`echo '$''{'ac_cv_pagesize'+set}'`\" = set"; then
3204  echo $ac_n "(cached) $ac_c" 1>&6
3205else
3206  if test "$cross_compiling" = yes; then
3207  ac_cv_pagesize=0
3208else
3209  cat > conftest.$ac_ext <<EOF
3210#line 3211 "configure"
3211#include "confdefs.h"
3212#include <stdio.h>
3213#define HAVE_GMALLOC
3214#include "gmalloc.c"
3215
3216main()
3217{
3218  FILE *f=fopen("conftestval", "w");
3219  if (!f) exit(1);
3220  fprintf(f, "%d\n", getpagesize());
3221  exit(0);
3222}
3223EOF
3224if { (eval echo configure:3225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3225then
3226  ac_cv_pagesize=`cat conftestval`
3227else
3228  echo "configure: failed program was:" >&5
3229  cat conftest.$ac_ext >&5
3230  rm -fr conftest*
3231  ac_cv_pagesize=0
3232fi
3233rm -fr conftest*
3234fi
3235
3236fi
3237
3238echo "$ac_t""$ac_cv_pagesize" 1>&6
3239if test "$ac_cv_pagesize" != 0; then
3240  cat >> confdefs.h <<EOF
3241#define SIZE_OF_SYSTEM_PAGE $ac_cv_pagesize
3242EOF
3243
3244fi
3245
3246
3247echo $ac_n "checking for page aligned valloc""... $ac_c" 1>&6
3248echo "configure:3249: checking for page aligned valloc" >&5
3249if eval "test \"`echo '$''{'ac_cv_have_page_alignment'+set}'`\" = set"; then
3250  echo $ac_n "(cached) $ac_c" 1>&6
3251else
3252  cat > _pagetest.c << EOF
3253#include <stdio.h>
3254#ifndef ADJUSTMENT
3255#define ADJUSTMENT 0
3256#endif
3257#define REPEAT 1000
3258main()
3259{
3260  long i;
3261  unsigned long p1 = (unsigned long) valloc(SIZE_OF_SYSTEM_PAGE - ADJUSTMENT);
3262  unsigned long p2;
3263  unsigned long diffs = 0;
3264
3265  if ((p1 == 0) || (p1 & (SIZE_OF_SYSTEM_PAGE - 1))) exit(1);
3266
3267  for (i = 0; i<REPEAT; i++)
3268  {
3269    p2 = (unsigned long) valloc(SIZE_OF_SYSTEM_PAGE - ADJUSTMENT);
3270    if ((p2 == 0) || (p2 & (SIZE_OF_SYSTEM_PAGE - 1))) exit(1);
3271    diffs += (p2 - p1);
3272    p1 = p2;
3273  }
3274
3275  if ( ((double) diffs)/((double)REPEAT) < ((double) SIZE_OF_SYSTEM_PAGE)*1.05 )
3276  {
3277    FILE *f=fopen("conftestval", "w");
3278    if (!f) exit(1);
3279    fprintf(f, "%d\n", SIZE_OF_SYSTEM_PAGE - ADJUSTMENT);
3280    exit(0);
3281  }
3282  exit(1);
3283}
3284EOF
3285
3286ac_cv_have_page_alignment=no
3287if test "$with_gmalloc" != yes && \
3288   test "$ac_cv_func_valloc" = yes && \
3289   test "$ac_cv_pagesize" != 0; then
3290if test "$cross_compiling" = yes; then
3291  ac_cv_have_page_alignment=no
3292else
3293  cat > conftest.$ac_ext <<EOF
3294#line 3295 "configure"
3295#include "confdefs.h"
3296
3297#define ADJUSTMENT 0
3298#include "_pagetest.c"
3299
3300EOF
3301if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3302then
3303  ac_cv_have_page_alignment="ac_cv_usable_pagesize="`cat  conftestval`
3304else
3305  echo "configure: failed program was:" >&5
3306  cat conftest.$ac_ext >&5
3307  rm -fr conftest*
3308  ac_cv_have_page_alignment=no
3309fi
3310rm -fr conftest*
3311fi
3312
3313  if test "$ac_cv_have_page_alignment" = no; then
3314if test "$cross_compiling" = yes; then
3315  ac_cv_have_page_alignment=no
3316else
3317  cat > conftest.$ac_ext <<EOF
3318#line 3319 "configure"
3319#include "confdefs.h"
3320
3321#define ADJUSTMENT SIZEOF_VOIDP
3322#include "_pagetest.c"
3323
3324EOF
3325if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3326then
3327  ac_cv_have_page_alignment="ac_cv_usable_pagesize="`cat  conftestval`
3328else
3329  echo "configure: failed program was:" >&5
3330  cat conftest.$ac_ext >&5
3331  rm -fr conftest*
3332  ac_cv_have_page_alignment=no
3333fi
3334rm -fr conftest*
3335fi
3336
3337  fi
3338fi
3339
3340if test "$ac_cv_have_page_alignment" = no && test "$ac_cv_pagesize" != 0; then
3341if test "$cross_compiling" = yes; then
3342  ac_cv_have_page_alignment=no
3343else
3344  cat > conftest.$ac_ext <<EOF
3345#line 3346 "configure"
3346#include "confdefs.h"
3347
3348#define ADJUSTMENT 0
3349#define HAVE_GMALLOC
3350#include "gmalloc.c"
3351#include "_pagetest.c"
3352
3353EOF
3354if { (eval echo configure:3355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3355then
3356  ac_cv_have_page_alignment="ac_cv_have_gmalloc=yes; ac_cv_usable_pagesize="`cat  conftestval`
3357else
3358  echo "configure: failed program was:" >&5
3359  cat conftest.$ac_ext >&5
3360  rm -fr conftest*
3361  ac_cv_have_page_alignment=no
3362fi
3363rm -fr conftest*
3364fi
3365
3366  if test "$ac_cv_have_page_alignment" = no; then
3367if test "$cross_compiling" = yes; then
3368  ac_cv_have_page_alignment=no
3369else
3370  cat > conftest.$ac_ext <<EOF
3371#line 3372 "configure"
3372#include "confdefs.h"
3373
3374#define ADJUSTMENT SIZEOF_VOIDP
3375#define HAVE_GMALLOC
3376#include "gmalloc.c"
3377#include "_pagetest.c"
3378
3379EOF
3380if { (eval echo configure:3381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
3381then
3382  ac_cv_have_page_alignment="ac_cv_have_gmalloc=yes; ac_cv_usable_pagesize="`cat  conftestval`
3383else
3384  echo "configure: failed program was:" >&5
3385  cat conftest.$ac_ext >&5
3386  rm -fr conftest*
3387  ac_cv_have_page_alignment=no
3388fi
3389rm -fr conftest*
3390fi
3391
3392  fi
3393fi
3394rm -rf conftesteval _pagetest.c
3395
3396
3397fi
3398
3399
3400if test "$ac_cv_have_page_alignment" != no && test "$ac_cv_with_gmalloc" != no; then
3401  eval $ac_cv_have_page_alignment
3402  cat >> confdefs.h <<EOF
3403#define PALLOC valloc
3404EOF
3405
3406  cat >> confdefs.h <<EOF
3407#define PFREE free
3408EOF
3409
3410  if test "$ac_cv_have_gmalloc" = yes; then
3411    cat >> confdefs.h <<\EOF
3412#define HAVE_GMALLOC 1
3413EOF
3414
3415    echo "$ac_t""from gmalloc" 1>&6
3416  else
3417    echo "$ac_t""from system" 1>&6
3418  fi
3419  cat >> confdefs.h <<EOF
3420#define SIZE_OF_PAGE $ac_cv_usable_pagesize
3421EOF
3422
3423else
3424  echo "$ac_t""no" 1>&6
3425  echo "configure: warning: Advanced memory management disabled" 1>&2
3426fi
3427
3428# Check whether --with-rootdir or --without-rootdir was given.
3429if test "${with_rootdir+set}" = set; then
3430  withval="$with_rootdir"
3431  :
3432fi
3433
3434# Check whether --with-lex or --without-lex was given.
3435if test "${with_lex+set}" = set; then
3436  withval="$with_lex"
3437  :
3438fi
3439
3440# Check whether --with-perl5 or --without-perl5 was given.
3441if test "${with_perl5+set}" = set; then
3442  withval="$with_perl5"
3443  :
3444fi
3445
3446# Check whether --with-readline or --without-readline was given.
3447if test "${with_readline+set}" = set; then
3448  withval="$with_readline"
3449  :
3450fi
3451
3452# Check whether --with-MP or --without-MP was given.
3453if test "${with_MP+set}" = set; then
3454  withval="$with_MP"
3455  :
3456fi
3457
3458# Check whether --with-dbm or --without-dbm was given.
3459if test "${with_dbm+set}" = set; then
3460  withval="$with_dbm"
3461  :
3462fi
3463
3464# Check whether --with-factory or --without-factory was given.
3465if test "${with_factory+set}" = set; then
3466  withval="$with_factory"
3467  :
3468fi
3469
3470# Check whether --with-libfac or --without-libfac was given.
3471if test "${with_libfac+set}" = set; then
3472  withval="$with_libfac"
3473  :
3474fi
3475
3476# Check whether --with-namespaces or --without-namespaces was given.
3477if test "${with_namespaces+set}" = set; then
3478  withval="$with_namespaces"
3479  :
3480fi
3481
3482# Check whether --with-dl or --without-dl was given.
3483if test "${with_dl+set}" = set; then
3484  withval="$with_dl"
3485  :
3486fi
3487
3488# Check whether --with-apint or --without-apint was given.
3489if test "${with_apint+set}" = set; then
3490  withval="$with_apint"
3491  :
3492fi
3493
3494# Check whether --with-exp_type or --without-exp_type was given.
3495if test "${with_exp_type+set}" = set; then
3496  withval="$with_exp_type"
3497  :
3498fi
3499
3500# Check whether --with-gmalloc or --without-gmalloc was given.
3501if test "${with_gmalloc+set}" = set; then
3502  withval="$with_gmalloc"
3503  :
3504fi
3505
3506# Check whether --with-mtrack or --without-mtrack was given.
3507if test "${with_mtrack+set}" = set; then
3508  withval="$with_mtrack"
3509  :
3510fi
3511
3512# perl version 5
3513if test "${with_perl5+set}" != set; then
3514  echo $ac_n "checking for perl5""... $ac_c" 1>&6
3515echo "configure:3516: checking for perl5" >&5
3516    if eval "test \"`echo '$''{'ac_cv_prog_perl5'+set}'`\" = set"; then
3517  echo $ac_n "(cached) $ac_c" 1>&6
3518else
3519  if (perl5 -v >/dev/null 2>&1)
3520  then
3521   if (perl5 -v | egrep "version 5\.[0-9]" >/dev/null 2>&1 )
3522    then
3523    ac_cv_prog_perl5=perl5
3524   fi
3525  elif (perl -v >/dev/null 2>&1)
3526  then
3527    if (perl -v | egrep "version 5\.[0-9]" >/dev/null 2>&1 )
3528    then
3529      ac_cv_prog_perl5=perl
3530    fi
3531  fi
3532 
3533fi
3534
3535    if test "${ac_cv_prog_perl5+set}" = set; then
3536    echo "$ac_t""${ac_cv_prog_perl5}" 1>&6
3537    PERL5=${ac_cv_prog_perl5}
3538   
3539  else
3540    { echo "configure: error: can not find perl version 5" 1>&2; exit 1; }
3541  fi
3542elif test "${with_perl5}" = no; then
3543  echo "configure: warning: building without perl5 --  make might fail" 1>&2
3544else
3545  unset PERL5
3546  unset ac_cv_prog_PERL5
3547  for ac_prog in ${with_perl5}
3548do
3549# Extract the first word of "$ac_prog", so it can be a program name with args.
3550set dummy $ac_prog; ac_word=$2
3551echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3552echo "configure:3553: checking for $ac_word" >&5
3553if eval "test \"`echo '$''{'ac_cv_prog_PERL5'+set}'`\" = set"; then
3554  echo $ac_n "(cached) $ac_c" 1>&6
3555else
3556  if test -n "$PERL5"; then
3557  ac_cv_prog_PERL5="$PERL5" # Let the user override the test.
3558else
3559  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
3560  for ac_dir in $PATH; do
3561    test -z "$ac_dir" && ac_dir=.
3562    if test -f $ac_dir/$ac_word; then
3563      ac_cv_prog_PERL5="$ac_prog"
3564      break
3565    fi
3566  done
3567  IFS="$ac_save_ifs"
3568fi
3569fi
3570PERL5="$ac_cv_prog_PERL5"
3571if test -n "$PERL5"; then
3572  echo "$ac_t""$PERL5" 1>&6
3573else
3574  echo "$ac_t""no" 1>&6
3575fi
3576
3577test -n "$PERL5" && break
3578done
3579
3580  if test "x${PERL5}" = x; then
3581    echo "configure: warning: building without perl5 -- make might fail" 1>&2
3582  fi
3583fi
3584
3585
3586# fereadl - io routines
3587for ac_hdr in termcap.h
3588do
3589ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3590echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3591echo "configure:3592: checking for $ac_hdr" >&5
3592if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3593  echo $ac_n "(cached) $ac_c" 1>&6
3594else
3595  cat > conftest.$ac_ext <<EOF
3596#line 3597 "configure"
3597#include "confdefs.h"
3598#include <$ac_hdr>
3599EOF
3600ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3601{ (eval echo configure:3602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3602ac_err=`grep -v '^ *+' conftest.out`
3603if test -z "$ac_err"; then
3604  rm -rf conftest*
3605  eval "ac_cv_header_$ac_safe=yes"
3606else
3607  echo "$ac_err" >&5
3608  echo "configure: failed program was:" >&5
3609  cat conftest.$ac_ext >&5
3610  rm -rf conftest*
3611  eval "ac_cv_header_$ac_safe=no"
3612fi
3613rm -f conftest*
3614fi
3615if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3616  echo "$ac_t""yes" 1>&6
3617    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3618  cat >> confdefs.h <<EOF
3619#define $ac_tr_hdr 1
3620EOF
3621 
3622else
3623  echo "$ac_t""no" 1>&6
3624fi
3625done
3626
3627for ac_hdr in termios.h
3628do
3629ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3630echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3631echo "configure:3632: checking for $ac_hdr" >&5
3632if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3633  echo $ac_n "(cached) $ac_c" 1>&6
3634else
3635  cat > conftest.$ac_ext <<EOF
3636#line 3637 "configure"
3637#include "confdefs.h"
3638#include <$ac_hdr>
3639EOF
3640ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3641{ (eval echo configure:3642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3642ac_err=`grep -v '^ *+' conftest.out`
3643if test -z "$ac_err"; then
3644  rm -rf conftest*
3645  eval "ac_cv_header_$ac_safe=yes"
3646else
3647  echo "$ac_err" >&5
3648  echo "configure: failed program was:" >&5
3649  cat conftest.$ac_ext >&5
3650  rm -rf conftest*
3651  eval "ac_cv_header_$ac_safe=no"
3652fi
3653rm -f conftest*
3654fi
3655if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3656  echo "$ac_t""yes" 1>&6
3657    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3658  cat >> confdefs.h <<EOF
3659#define $ac_tr_hdr 1
3660EOF
3661 
3662else
3663  echo "$ac_t""no" 1>&6
3664fi
3665done
3666
3667for ac_hdr in term.h
3668do
3669ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3670echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3671echo "configure:3672: checking for $ac_hdr" >&5
3672if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3673  echo $ac_n "(cached) $ac_c" 1>&6
3674else
3675  cat > conftest.$ac_ext <<EOF
3676#line 3677 "configure"
3677#include "confdefs.h"
3678#include <$ac_hdr>
3679EOF
3680ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3681{ (eval echo configure:3682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3682ac_err=`grep -v '^ *+' conftest.out`
3683if test -z "$ac_err"; then
3684  rm -rf conftest*
3685  eval "ac_cv_header_$ac_safe=yes"
3686else
3687  echo "$ac_err" >&5
3688  echo "configure: failed program was:" >&5
3689  cat conftest.$ac_ext >&5
3690  rm -rf conftest*
3691  eval "ac_cv_header_$ac_safe=no"
3692fi
3693rm -f conftest*
3694fi
3695if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3696  echo "$ac_t""yes" 1>&6
3697    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3698  cat >> confdefs.h <<EOF
3699#define $ac_tr_hdr 1
3700EOF
3701 
3702else
3703  echo "$ac_t""no" 1>&6
3704fi
3705done
3706
3707for ac_hdr in sys/termbits.h
3708do
3709ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3710echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3711echo "configure:3712: checking for $ac_hdr" >&5
3712if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3713  echo $ac_n "(cached) $ac_c" 1>&6
3714else
3715  cat > conftest.$ac_ext <<EOF
3716#line 3717 "configure"
3717#include "confdefs.h"
3718#include <$ac_hdr>
3719EOF
3720ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3721{ (eval echo configure:3722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3722ac_err=`grep -v '^ *+' conftest.out`
3723if test -z "$ac_err"; then
3724  rm -rf conftest*
3725  eval "ac_cv_header_$ac_safe=yes"
3726else
3727  echo "$ac_err" >&5
3728  echo "configure: failed program was:" >&5
3729  cat conftest.$ac_ext >&5
3730  rm -rf conftest*
3731  eval "ac_cv_header_$ac_safe=no"
3732fi
3733rm -f conftest*
3734fi
3735if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3736  echo "$ac_t""yes" 1>&6
3737    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3738  cat >> confdefs.h <<EOF
3739#define $ac_tr_hdr 1
3740EOF
3741 
3742else
3743  echo "$ac_t""no" 1>&6
3744fi
3745done
3746
3747
3748# readline
3749if test "$with_readline" != no; then
3750  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
3751echo "configure:3752: checking for tgetent in -lncurses" >&5
3752ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
3753if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3754  echo $ac_n "(cached) $ac_c" 1>&6
3755else
3756  ac_save_LIBS="$LIBS"
3757LIBS="-lncurses  $LIBS"
3758cat > conftest.$ac_ext <<EOF
3759#line 3760 "configure"
3760#include "confdefs.h"
3761/* Override any gcc2 internal prototype to avoid an error.  */
3762/* We use char because int might match the return type of a gcc2
3763    builtin and then its argument prototype would still apply.  */
3764char tgetent();
3765
3766int main() {
3767tgetent()
3768; return 0; }
3769EOF
3770if { (eval echo configure:3771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3771  rm -rf conftest*
3772  eval "ac_cv_lib_$ac_lib_var=yes"
3773else
3774  echo "configure: failed program was:" >&5
3775  cat conftest.$ac_ext >&5
3776  rm -rf conftest*
3777  eval "ac_cv_lib_$ac_lib_var=no"
3778fi
3779rm -f conftest*
3780LIBS="$ac_save_LIBS"
3781
3782fi
3783if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3784  echo "$ac_t""yes" 1>&6
3785    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3786    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3787  cat >> confdefs.h <<EOF
3788#define $ac_tr_lib 1
3789EOF
3790
3791  LIBS="-lncurses $LIBS"
3792
3793else
3794  echo "$ac_t""no" 1>&6
3795\
3796   echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
3797echo "configure:3798: checking for tgetent in -lcurses" >&5
3798ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
3799if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3800  echo $ac_n "(cached) $ac_c" 1>&6
3801else
3802  ac_save_LIBS="$LIBS"
3803LIBS="-lcurses  $LIBS"
3804cat > conftest.$ac_ext <<EOF
3805#line 3806 "configure"
3806#include "confdefs.h"
3807/* Override any gcc2 internal prototype to avoid an error.  */
3808/* We use char because int might match the return type of a gcc2
3809    builtin and then its argument prototype would still apply.  */
3810char tgetent();
3811
3812int main() {
3813tgetent()
3814; return 0; }
3815EOF
3816if { (eval echo configure:3817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3817  rm -rf conftest*
3818  eval "ac_cv_lib_$ac_lib_var=yes"
3819else
3820  echo "configure: failed program was:" >&5
3821  cat conftest.$ac_ext >&5
3822  rm -rf conftest*
3823  eval "ac_cv_lib_$ac_lib_var=no"
3824fi
3825rm -f conftest*
3826LIBS="$ac_save_LIBS"
3827
3828fi
3829if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3830  echo "$ac_t""yes" 1>&6
3831    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
3832    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3833  cat >> confdefs.h <<EOF
3834#define $ac_tr_lib 1
3835EOF
3836
3837  LIBS="-lcurses $LIBS"
3838
3839else
3840  echo "$ac_t""no" 1>&6
3841\
3842   echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
3843echo "configure:3844: checking for tgetent in -ltermcap" >&5
3844ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
3845if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3846  echo $ac_n "(cached) $ac_c" 1>&6
3847else
3848  ac_save_LIBS="$LIBS"
3849LIBS="-ltermcap  $LIBS"
3850cat > conftest.$ac_ext <<EOF
3851#line 3852 "configure"
3852#include "confdefs.h"
3853/* Override any gcc2 internal prototype to avoid an error.  */
3854/* We use char because int might match the return type of a gcc2
3855    builtin and then its argument prototype would still apply.  */
3856char tgetent();
3857
3858int main() {
3859tgetent()
3860; return 0; }
3861EOF
3862if { (eval echo configure:3863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3863  rm -rf conftest*
3864  eval "ac_cv_lib_$ac_lib_var=yes"
3865else
3866  echo "configure: failed program was:" >&5
3867  cat conftest.$ac_ext >&5
3868  rm -rf conftest*
3869  eval "ac_cv_lib_$ac_lib_var=no"
3870fi
3871rm -f conftest*
3872LIBS="$ac_save_LIBS"
3873
3874fi
3875if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3876  echo "$ac_t""yes" 1>&6
3877    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
3878    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3879  cat >> confdefs.h <<EOF
3880#define $ac_tr_lib 1
3881EOF
3882
3883  LIBS="-ltermcap $LIBS"
3884
3885else
3886  echo "$ac_t""no" 1>&6
3887fi
3888
3889fi
3890
3891fi
3892
3893   echo $ac_n "checking for rl_abort in -lreadline""... $ac_c" 1>&6
3894echo "configure:3895: checking for rl_abort in -lreadline" >&5
3895ac_lib_var=`echo readline'_'rl_abort | sed 'y%./+-%__p_%'`
3896if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3897  echo $ac_n "(cached) $ac_c" 1>&6
3898else
3899  ac_save_LIBS="$LIBS"
3900LIBS="-lreadline  $LIBS"
3901cat > conftest.$ac_ext <<EOF
3902#line 3903 "configure"
3903#include "confdefs.h"
3904/* Override any gcc2 internal prototype to avoid an error.  */
3905/* We use char because int might match the return type of a gcc2
3906    builtin and then its argument prototype would still apply.  */
3907char rl_abort();
3908
3909int main() {
3910rl_abort()
3911; return 0; }
3912EOF
3913if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3914  rm -rf conftest*
3915  eval "ac_cv_lib_$ac_lib_var=yes"
3916else
3917  echo "configure: failed program was:" >&5
3918  cat conftest.$ac_ext >&5
3919  rm -rf conftest*
3920  eval "ac_cv_lib_$ac_lib_var=no"
3921fi
3922rm -f conftest*
3923LIBS="$ac_save_LIBS"
3924
3925fi
3926if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3927  echo "$ac_t""yes" 1>&6
3928    ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3929    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3930  cat >> confdefs.h <<EOF
3931#define $ac_tr_lib 1
3932EOF
3933
3934  LIBS="-lreadline $LIBS"
3935
3936else
3937  echo "$ac_t""no" 1>&6
3938fi
3939
3940   for ac_hdr in readline/readline.h readline/history.h
3941do
3942ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3943echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3944echo "configure:3945: checking for $ac_hdr" >&5
3945if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3946  echo $ac_n "(cached) $ac_c" 1>&6
3947else
3948  cat > conftest.$ac_ext <<EOF
3949#line 3950 "configure"
3950#include "confdefs.h"
3951#include <$ac_hdr>
3952EOF
3953ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3954{ (eval echo configure:3955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3955ac_err=`grep -v '^ *+' conftest.out`
3956if test -z "$ac_err"; then
3957  rm -rf conftest*
3958  eval "ac_cv_header_$ac_safe=yes"
3959else
3960  echo "$ac_err" >&5
3961  echo "configure: failed program was:" >&5
3962  cat conftest.$ac_ext >&5
3963  rm -rf conftest*
3964  eval "ac_cv_header_$ac_safe=no"
3965fi
3966rm -f conftest*
3967fi
3968if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3969  echo "$ac_t""yes" 1>&6
3970    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3971  cat >> confdefs.h <<EOF
3972#define $ac_tr_hdr 1
3973EOF
3974 
3975else
3976  echo "$ac_t""no" 1>&6
3977fi
3978done
3979
3980   if test "$ac_cv_lib_readline_rl_abort" = yes && \
3981      test "$ac_cv_header_readline_readline_h" = yes; then
3982     echo $ac_n "checking whether readline.h is ok""... $ac_c" 1>&6
3983echo "configure:3984: checking whether readline.h is ok" >&5
3984     if eval "test \"`echo '$''{'ac_cv_header_readline_readline_h_ok'+set}'`\" = set"; then
3985  echo $ac_n "(cached) $ac_c" 1>&6
3986else
3987  cat > conftest.$ac_ext <<EOF
3988#line 3989 "configure"
3989#include "confdefs.h"
3990#include<unistd.h>
3991#include<stdio.h>
3992#include<readline/readline.h>
3993#ifdef HAVE_READLINE_HISTORY_H
3994#include<readline/history.h>
3995#endif
3996
3997int main() {
3998#ifndef NULL
3999#define NULL 0
4000#endif
4001rl_readline_name=NULL;
4002*rl_line_buffer=1;
4003completion_matches(NULL, filename_completion_function);
4004rl_attempted_completion_function = (CPPFunction *) NULL;
4005rl_outstream=NULL;
4006readline(NULL);
4007add_history(NULL);
4008read_history(NULL);
4009write_history(NULL);
4010
4011; return 0; }
4012EOF
4013if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4014  rm -rf conftest*
4015  ac_cv_header_readline_readline_h_ok="yes"
4016else
4017  echo "configure: failed program was:" >&5
4018  cat conftest.$ac_ext >&5
4019  rm -rf conftest*
4020  ac_cv_header_readline_readline_h_ok="no"
4021fi
4022rm -f conftest*
4023fi
4024
4025    echo "$ac_t""$ac_cv_header_readline_readline_h_ok" 1>&6
4026    if test "$ac_cv_header_readline_readline_h_ok" != yes; then
4027#not ok -- try once more with explicitly declaring everything
4028      echo $ac_n "checking whether or not we nevertheless can use readline""... $ac_c" 1>&6
4029echo "configure:4030: checking whether or not we nevertheless can use readline" >&5
4030      if eval "test \"`echo '$''{'ac_cv_have_readline'+set}'`\" = set"; then
4031  echo $ac_n "(cached) $ac_c" 1>&6
4032else
4033  cat > conftest.$ac_ext <<EOF
4034#line 4035 "configure"
4035#include "confdefs.h"
4036#include <stdio.h>
4037
4038int main() {
4039extern char * rl_readline_name;
4040extern char *rl_line_buffer;
4041char *filename_completion_function();
4042typedef char **CPPFunction ();
4043extern char ** completion_matches ();
4044extern CPPFunction * rl_attempted_completion_function;
4045extern FILE * rl_outstream;
4046char * readline ();
4047void add_history ();
4048int write_history ();
4049#ifndef NULL
4050#define NULL 0
4051#endif
4052 rl_readline_name=NULL;
4053*rl_line_buffer=1;
4054completion_matches(NULL, filename_completion_function);
4055rl_attempted_completion_function = (CPPFunction *) NULL;
4056rl_outstream=NULL;
4057readline(NULL);
4058add_history(NULL);
4059read_history(NULL);
4060write_history(NULL);
4061
4062; return 0; }
4063EOF
4064if { (eval echo configure:4065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4065  rm -rf conftest*
4066  ac_cv_have_readline="yes"
4067
4068else
4069  echo "configure: failed program was:" >&5
4070  cat conftest.$ac_ext >&5
4071  rm -rf conftest*
4072  ac_cv_have_readline="no"
4073
4074fi
4075rm -f conftest*
4076fi
4077
4078      echo "$ac_t""$ac_cv_have_readline" 1>&6
4079    else
4080      cat >> confdefs.h <<\EOF
4081#define READLINE_READLINE_H_OK 1
4082EOF
4083
4084      ac_cv_have_readline="yes"
4085    fi
4086  fi
4087  if test "$ac_cv_have_readline" = yes; then
4088    cat >> confdefs.h <<\EOF
4089#define HAVE_READLINE 1
4090EOF
4091
4092  else
4093    echo "configure: warning: building without readline: disabling fancy display" 1>&2
4094    echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4095echo "configure:4096: checking for tgetent in -lncurses" >&5
4096ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4097if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4098  echo $ac_n "(cached) $ac_c" 1>&6
4099else
4100  ac_save_LIBS="$LIBS"
4101LIBS="-lncurses  $LIBS"
4102cat > conftest.$ac_ext <<EOF
4103#line 4104 "configure"
4104#include "confdefs.h"
4105/* Override any gcc2 internal prototype to avoid an error.  */
4106/* We use char because int might match the return type of a gcc2
4107    builtin and then its argument prototype would still apply.  */
4108char tgetent();
4109
4110int main() {
4111tgetent()
4112; return 0; }
4113EOF
4114if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4115  rm -rf conftest*
4116  eval "ac_cv_lib_$ac_lib_var=yes"
4117else
4118  echo "configure: failed program was:" >&5
4119  cat conftest.$ac_ext >&5
4120  rm -rf conftest*
4121  eval "ac_cv_lib_$ac_lib_var=no"
4122fi
4123rm -f conftest*
4124LIBS="$ac_save_LIBS"
4125
4126fi
4127if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4128  echo "$ac_t""yes" 1>&6
4129    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4130    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4131  cat >> confdefs.h <<EOF
4132#define $ac_tr_lib 1
4133EOF
4134
4135  LIBS="-lncurses $LIBS"
4136
4137else
4138  echo "$ac_t""no" 1>&6
4139\
4140    echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
4141echo "configure:4142: checking for tgetent in -lcurses" >&5
4142ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
4143if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4144  echo $ac_n "(cached) $ac_c" 1>&6
4145else
4146  ac_save_LIBS="$LIBS"
4147LIBS="-lcurses  $LIBS"
4148cat > conftest.$ac_ext <<EOF
4149#line 4150 "configure"
4150#include "confdefs.h"
4151/* Override any gcc2 internal prototype to avoid an error.  */
4152/* We use char because int might match the return type of a gcc2
4153    builtin and then its argument prototype would still apply.  */
4154char tgetent();
4155
4156int main() {
4157tgetent()
4158; return 0; }
4159EOF
4160if { (eval echo configure:4161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4161  rm -rf conftest*
4162  eval "ac_cv_lib_$ac_lib_var=yes"
4163else
4164  echo "configure: failed program was:" >&5
4165  cat conftest.$ac_ext >&5
4166  rm -rf conftest*
4167  eval "ac_cv_lib_$ac_lib_var=no"
4168fi
4169rm -f conftest*
4170LIBS="$ac_save_LIBS"
4171
4172fi
4173if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4174  echo "$ac_t""yes" 1>&6
4175    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
4176    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4177  cat >> confdefs.h <<EOF
4178#define $ac_tr_lib 1
4179EOF
4180
4181  LIBS="-lcurses $LIBS"
4182
4183else
4184  echo "$ac_t""no" 1>&6
4185\
4186    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
4187echo "configure:4188: checking for tgetent in -ltermcap" >&5
4188ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
4189if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4190  echo $ac_n "(cached) $ac_c" 1>&6
4191else
4192  ac_save_LIBS="$LIBS"
4193LIBS="-ltermcap  $LIBS"
4194cat > conftest.$ac_ext <<EOF
4195#line 4196 "configure"
4196#include "confdefs.h"
4197/* Override any gcc2 internal prototype to avoid an error.  */
4198/* We use char because int might match the return type of a gcc2
4199    builtin and then its argument prototype would still apply.  */
4200char tgetent();
4201
4202int main() {
4203tgetent()
4204; return 0; }
4205EOF
4206if { (eval echo configure:4207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4207  rm -rf conftest*
4208  eval "ac_cv_lib_$ac_lib_var=yes"
4209else
4210  echo "configure: failed program was:" >&5
4211  cat conftest.$ac_ext >&5
4212  rm -rf conftest*
4213  eval "ac_cv_lib_$ac_lib_var=no"
4214fi
4215rm -f conftest*
4216LIBS="$ac_save_LIBS"
4217
4218fi
4219if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4220  echo "$ac_t""yes" 1>&6
4221    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
4222    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4223  cat >> confdefs.h <<EOF
4224#define $ac_tr_lib 1
4225EOF
4226
4227  LIBS="-ltermcap $LIBS"
4228
4229else
4230  echo "$ac_t""no" 1>&6
4231\
4232    cat >> confdefs.h <<\EOF
4233#define HAVE_FEREAD 1
4234EOF
4235
4236fi
4237
4238fi
4239
4240fi
4241
4242  fi
4243else
4244    echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4245echo "configure:4246: checking for tgetent in -lncurses" >&5
4246ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4247if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4248  echo $ac_n "(cached) $ac_c" 1>&6
4249else
4250  ac_save_LIBS="$LIBS"
4251LIBS="-lncurses  $LIBS"
4252cat > conftest.$ac_ext <<EOF
4253#line 4254 "configure"
4254#include "confdefs.h"
4255/* Override any gcc2 internal prototype to avoid an error.  */
4256/* We use char because int might match the return type of a gcc2
4257    builtin and then its argument prototype would still apply.  */
4258char tgetent();
4259
4260int main() {
4261tgetent()
4262; return 0; }
4263EOF
4264if { (eval echo configure:4265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4265  rm -rf conftest*
4266  eval "ac_cv_lib_$ac_lib_var=yes"
4267else
4268  echo "configure: failed program was:" >&5
4269  cat conftest.$ac_ext >&5
4270  rm -rf conftest*
4271  eval "ac_cv_lib_$ac_lib_var=no"
4272fi
4273rm -f conftest*
4274LIBS="$ac_save_LIBS"
4275
4276fi
4277if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4278  echo "$ac_t""yes" 1>&6
4279    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4280    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4281  cat >> confdefs.h <<EOF
4282#define $ac_tr_lib 1
4283EOF
4284
4285  LIBS="-lncurses $LIBS"
4286
4287else
4288  echo "$ac_t""no" 1>&6
4289\
4290    echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
4291echo "configure:4292: checking for tgetent in -lcurses" >&5
4292ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
4293if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4294  echo $ac_n "(cached) $ac_c" 1>&6
4295else
4296  ac_save_LIBS="$LIBS"
4297LIBS="-lcurses  $LIBS"
4298cat > conftest.$ac_ext <<EOF
4299#line 4300 "configure"
4300#include "confdefs.h"
4301/* Override any gcc2 internal prototype to avoid an error.  */
4302/* We use char because int might match the return type of a gcc2
4303    builtin and then its argument prototype would still apply.  */
4304char tgetent();
4305
4306int main() {
4307tgetent()
4308; return 0; }
4309EOF
4310if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4311  rm -rf conftest*
4312  eval "ac_cv_lib_$ac_lib_var=yes"
4313else
4314  echo "configure: failed program was:" >&5
4315  cat conftest.$ac_ext >&5
4316  rm -rf conftest*
4317  eval "ac_cv_lib_$ac_lib_var=no"
4318fi
4319rm -f conftest*
4320LIBS="$ac_save_LIBS"
4321
4322fi
4323if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4324  echo "$ac_t""yes" 1>&6
4325    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
4326    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4327  cat >> confdefs.h <<EOF
4328#define $ac_tr_lib 1
4329EOF
4330
4331  LIBS="-lcurses $LIBS"
4332
4333else
4334  echo "$ac_t""no" 1>&6
4335\
4336    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
4337echo "configure:4338: checking for tgetent in -ltermcap" >&5
4338ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
4339if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4340  echo $ac_n "(cached) $ac_c" 1>&6
4341else
4342  ac_save_LIBS="$LIBS"
4343LIBS="-ltermcap  $LIBS"
4344cat > conftest.$ac_ext <<EOF
4345#line 4346 "configure"
4346#include "confdefs.h"
4347/* Override any gcc2 internal prototype to avoid an error.  */
4348/* We use char because int might match the return type of a gcc2
4349    builtin and then its argument prototype would still apply.  */
4350char tgetent();
4351
4352int main() {
4353tgetent()
4354; return 0; }
4355EOF
4356if { (eval echo configure:4357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4357  rm -rf conftest*
4358  eval "ac_cv_lib_$ac_lib_var=yes"
4359else
4360  echo "configure: failed program was:" >&5
4361  cat conftest.$ac_ext >&5
4362  rm -rf conftest*
4363  eval "ac_cv_lib_$ac_lib_var=no"
4364fi
4365rm -f conftest*
4366LIBS="$ac_save_LIBS"
4367
4368fi
4369if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4370  echo "$ac_t""yes" 1>&6
4371    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
4372    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4373  cat >> confdefs.h <<EOF
4374#define $ac_tr_lib 1
4375EOF
4376
4377  LIBS="-ltermcap $LIBS"
4378
4379else
4380  echo "$ac_t""no" 1>&6
4381\
4382  cat >> confdefs.h <<\EOF
4383#define HAVE_FEREAD 1
4384EOF
4385
4386fi
4387
4388fi
4389
4390fi
4391
4392fi
4393
4394NEED_LIBS=$LIBS
4395
4396# gmp, smallgmp, MP, MPT, factory, libfac
4397echo $ac_n "checking for mpq_init in -lgmp""... $ac_c" 1>&6
4398echo "configure:4399: checking for mpq_init in -lgmp" >&5
4399ac_lib_var=`echo gmp'_'mpq_init | sed 'y%./+-%__p_%'`
4400if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4401  echo $ac_n "(cached) $ac_c" 1>&6
4402else
4403  ac_save_LIBS="$LIBS"
4404LIBS="-lgmp  $LIBS"
4405cat > conftest.$ac_ext <<EOF
4406#line 4407 "configure"
4407#include "confdefs.h"
4408/* Override any gcc2 internal prototype to avoid an error.  */
4409/* We use char because int might match the return type of a gcc2
4410    builtin and then its argument prototype would still apply.  */
4411char mpq_init();
4412
4413int main() {
4414mpq_init()
4415; return 0; }
4416EOF
4417if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4418  rm -rf conftest*
4419  eval "ac_cv_lib_$ac_lib_var=yes"
4420else
4421  echo "configure: failed program was:" >&5
4422  cat conftest.$ac_ext >&5
4423  rm -rf conftest*
4424  eval "ac_cv_lib_$ac_lib_var=no"
4425fi
4426rm -f conftest*
4427LIBS="$ac_save_LIBS"
4428
4429fi
4430if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4431  echo "$ac_t""yes" 1>&6
4432    ac_tr_lib=HAVE_LIB`echo gmp | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4433    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4434  cat >> confdefs.h <<EOF
4435#define $ac_tr_lib 1
4436EOF
4437
4438  LIBS="-lgmp $LIBS"
4439
4440else
4441  echo "$ac_t""no" 1>&6
4442fi
4443
4444if test "ac_cv_lib_gmp_mpq_init" = yes && test "$with-apint" = smallgmp; then
4445  LIBS=NEED_LIBS
4446fi
4447echo $ac_n "checking for mpz_init in -lsmallgmp""... $ac_c" 1>&6
4448echo "configure:4449: checking for mpz_init in -lsmallgmp" >&5
4449ac_lib_var=`echo smallgmp'_'mpz_init | sed 'y%./+-%__p_%'`
4450if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4451  echo $ac_n "(cached) $ac_c" 1>&6
4452else
4453  ac_save_LIBS="$LIBS"
4454LIBS="-lsmallgmp  $LIBS"
4455cat > conftest.$ac_ext <<EOF
4456#line 4457 "configure"
4457#include "confdefs.h"
4458/* Override any gcc2 internal prototype to avoid an error.  */
4459/* We use char because int might match the return type of a gcc2
4460    builtin and then its argument prototype would still apply.  */
4461char mpz_init();
4462
4463int main() {
4464mpz_init()
4465; return 0; }
4466EOF
4467if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4468  rm -rf conftest*
4469  eval "ac_cv_lib_$ac_lib_var=yes"
4470else
4471  echo "configure: failed program was:" >&5
4472  cat conftest.$ac_ext >&5
4473  rm -rf conftest*
4474  eval "ac_cv_lib_$ac_lib_var=no"
4475fi
4476rm -f conftest*
4477LIBS="$ac_save_LIBS"
4478
4479fi
4480if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4481  echo "$ac_t""yes" 1>&6
4482    ac_tr_lib=HAVE_LIB`echo smallgmp | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4483    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4484  cat >> confdefs.h <<EOF
4485#define $ac_tr_lib 1
4486EOF
4487
4488  LIBS="-lsmallgmp $LIBS"
4489
4490else
4491  echo "$ac_t""no" 1>&6
4492fi
4493
4494echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6
4495echo "configure:4496: checking for IMP_PutGmpInt in -lMP" >&5
4496ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'`
4497if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4498  echo $ac_n "(cached) $ac_c" 1>&6
4499else
4500  ac_save_LIBS="$LIBS"
4501LIBS="-lMP  $LIBS"
4502cat > conftest.$ac_ext <<EOF
4503#line 4504 "configure"
4504#include "confdefs.h"
4505/* Override any gcc2 internal prototype to avoid an error.  */
4506/* We use char because int might match the return type of a gcc2
4507    builtin and then its argument prototype would still apply.  */
4508char IMP_PutGmpInt();
4509
4510int main() {
4511IMP_PutGmpInt()
4512; return 0; }
4513EOF
4514if { (eval echo configure:4515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4515  rm -rf conftest*
4516  eval "ac_cv_lib_$ac_lib_var=yes"
4517else
4518  echo "configure: failed program was:" >&5
4519  cat conftest.$ac_ext >&5
4520  rm -rf conftest*
4521  eval "ac_cv_lib_$ac_lib_var=no"
4522fi
4523rm -f conftest*
4524LIBS="$ac_save_LIBS"
4525
4526fi
4527if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4528  echo "$ac_t""yes" 1>&6
4529    ac_tr_lib=HAVE_LIB`echo MP | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4530    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4531  cat >> confdefs.h <<EOF
4532#define $ac_tr_lib 1
4533EOF
4534
4535  LIBS="-lMP $LIBS"
4536
4537else
4538  echo "$ac_t""no" 1>&6
4539fi
4540
4541echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6
4542echo "configure:4543: checking for MPT_GetTree in -lMPT" >&5
4543ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'`
4544if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4545  echo $ac_n "(cached) $ac_c" 1>&6
4546else
4547  ac_save_LIBS="$LIBS"
4548LIBS="-lMPT  $LIBS"
4549cat > conftest.$ac_ext <<EOF
4550#line 4551 "configure"
4551#include "confdefs.h"
4552/* Override any gcc2 internal prototype to avoid an error.  */
4553/* We use char because int might match the return type of a gcc2
4554    builtin and then its argument prototype would still apply.  */
4555char MPT_GetTree();
4556
4557int main() {
4558MPT_GetTree()
4559; return 0; }
4560EOF
4561if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4562  rm -rf conftest*
4563  eval "ac_cv_lib_$ac_lib_var=yes"
4564else
4565  echo "configure: failed program was:" >&5
4566  cat conftest.$ac_ext >&5
4567  rm -rf conftest*
4568  eval "ac_cv_lib_$ac_lib_var=no"
4569fi
4570rm -f conftest*
4571LIBS="$ac_save_LIBS"
4572
4573fi
4574if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4575  echo "$ac_t""yes" 1>&6
4576    ac_tr_lib=HAVE_LIB`echo MPT | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4577    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4578  cat >> confdefs.h <<EOF
4579#define $ac_tr_lib 1
4580EOF
4581
4582  LIBS="-lMPT $LIBS"
4583
4584else
4585  echo "$ac_t""no" 1>&6
4586fi
4587
4588echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6
4589echo "configure:4590: checking for atof in -lsingcf" >&5
4590ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'`
4591if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4592  echo $ac_n "(cached) $ac_c" 1>&6
4593else
4594  ac_save_LIBS="$LIBS"
4595LIBS="-lsingcf  $LIBS"
4596cat > conftest.$ac_ext <<EOF
4597#line 4598 "configure"
4598#include "confdefs.h"
4599/* Override any gcc2 internal prototype to avoid an error.  */
4600/* We use char because int might match the return type of a gcc2
4601    builtin and then its argument prototype would still apply.  */
4602char atof();
4603
4604int main() {
4605atof()
4606; return 0; }
4607EOF
4608if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4609  rm -rf conftest*
4610  eval "ac_cv_lib_$ac_lib_var=yes"
4611else
4612  echo "configure: failed program was:" >&5
4613  cat conftest.$ac_ext >&5
4614  rm -rf conftest*
4615  eval "ac_cv_lib_$ac_lib_var=no"
4616fi
4617rm -f conftest*
4618LIBS="$ac_save_LIBS"
4619
4620fi
4621if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4622  echo "$ac_t""yes" 1>&6
4623    ac_tr_lib=HAVE_LIB`echo singcf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4624    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4625  cat >> confdefs.h <<EOF
4626#define $ac_tr_lib 1
4627EOF
4628
4629  LIBS="-lsingcf $LIBS"
4630
4631else
4632  echo "$ac_t""no" 1>&6
4633fi
4634
4635echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6
4636echo "configure:4637: checking for atof in -lsingfac" >&5
4637ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'`
4638if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4639  echo $ac_n "(cached) $ac_c" 1>&6
4640else
4641  ac_save_LIBS="$LIBS"
4642LIBS="-lsingfac  $LIBS"
4643cat > conftest.$ac_ext <<EOF
4644#line 4645 "configure"
4645#include "confdefs.h"
4646/* Override any gcc2 internal prototype to avoid an error.  */
4647/* We use char because int might match the return type of a gcc2
4648    builtin and then its argument prototype would still apply.  */
4649char atof();
4650
4651int main() {
4652atof()
4653; return 0; }
4654EOF
4655if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4656  rm -rf conftest*
4657  eval "ac_cv_lib_$ac_lib_var=yes"
4658else
4659  echo "configure: failed program was:" >&5
4660  cat conftest.$ac_ext >&5
4661  rm -rf conftest*
4662  eval "ac_cv_lib_$ac_lib_var=no"
4663fi
4664rm -f conftest*
4665LIBS="$ac_save_LIBS"
4666
4667fi
4668if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4669  echo "$ac_t""yes" 1>&6
4670    ac_tr_lib=HAVE_LIB`echo singfac | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4671    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4672  cat >> confdefs.h <<EOF
4673#define $ac_tr_lib 1
4674EOF
4675
4676  LIBS="-lsingfac $LIBS"
4677
4678else
4679  echo "$ac_t""no" 1>&6
4680fi
4681
4682
4683for ac_hdr in gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h
4684do
4685ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4686echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4687echo "configure:4688: checking for $ac_hdr" >&5
4688if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4689  echo $ac_n "(cached) $ac_c" 1>&6
4690else
4691  cat > conftest.$ac_ext <<EOF
4692#line 4693 "configure"
4693#include "confdefs.h"
4694#include <$ac_hdr>
4695EOF
4696ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4697{ (eval echo configure:4698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4698ac_err=`grep -v '^ *+' conftest.out`
4699if test -z "$ac_err"; then
4700  rm -rf conftest*
4701  eval "ac_cv_header_$ac_safe=yes"
4702else
4703  echo "$ac_err" >&5
4704  echo "configure: failed program was:" >&5
4705  cat conftest.$ac_ext >&5
4706  rm -rf conftest*
4707  eval "ac_cv_header_$ac_safe=no"
4708fi
4709rm -f conftest*
4710fi
4711if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4712  echo "$ac_t""yes" 1>&6
4713    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4714  cat >> confdefs.h <<EOF
4715#define $ac_tr_hdr 1
4716EOF
4717 
4718else
4719  echo "$ac_t""no" 1>&6
4720fi
4721done
4722
4723
4724if test "$ac_cv_lib_gmp_mpq_init" = yes && \
4725 test "$ac_cv_header_gmp_h" = yes; then
4726    ac_gmp_ok=yes
4727fi
4728
4729if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
4730 test "$ac_cv_header_smallgmp_h" = yes && \
4731 test "$ac_cv_header_gmp_h" = yes; then
4732    ac_smallgmp_ok=yes
4733fi
4734
4735if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
4736 test "$ac_cv_lib_MPT_MPT_GetTree" && \
4737 test "$ac_cv_header_MP_h" = yes && \
4738 test "$ac_cv_header_MPT_h" = yes; then
4739  ac_MP_ok=yes
4740fi
4741
4742if test "$ac_cv_lib_singcf_atof" = yes && \
4743 test "$ac_cv_header_factory_h" = yes; then
4744  ac_factory_ok=yes
4745fi
4746
4747if test "$ac_cv_lib_singfac_atof" = yes && \
4748 test "$ac_cv_header_factor_h" = yes; then
4749  ac_libfac_ok=yes
4750fi
4751
4752# evaluate results
4753echo $ac_n "checking which apint package to use""... $ac_c" 1>&6
4754echo "configure:4755: checking which apint package to use" >&5
4755if test "${with_apint}" != gmp && test "${with_apint}" != smallgmp; then
4756  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
4757    echo "$ac_t""gmp" 1>&6
4758    will_have_gmp=yes
4759    NEED_LIBS="-lgmp ${NEED_LIBS}"
4760  elif test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
4761    echo "$ac_t""smallgmp" 1>&6
4762    cat >> confdefs.h <<\EOF
4763#define HAVE_SMALLGMP 1
4764EOF
4765
4766    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
4767  else
4768    echo "$ac_t""none" 1>&6
4769    { echo "configure: error: can not build without gmp or smallgmp" 1>&2; exit 1; }
4770  fi
4771elif test "${with_apint}" = gmp; then
4772  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
4773    echo "$ac_t""gmp" 1>&6
4774    will_have_gmp=yes
4775    NEED_LIBS="-lgmp ${NEED_LIBS}"
4776  else
4777    echo "$ac_t""none" 1>&6
4778    { echo "configure: error: can not build with gmp" 1>&2; exit 1; }
4779  fi
4780else
4781  if test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
4782    echo "$ac_t""smallgmp" 1>&6
4783    cat >> confdefs.h <<\EOF
4784#define HAVE_SMALLGMP 1
4785EOF
4786
4787    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
4788  else
4789    echo "$ac_t""none" 1>&6
4790    { echo "configure: error: can not build with smallgmp" 1>&2; exit 1; }
4791  fi
4792fi
4793
4794#
4795# dl
4796if test "$with_dl" != no; then
4797  echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4798echo "configure:4799: checking for dlopen in -ldl" >&5
4799ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
4800if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4801  echo $ac_n "(cached) $ac_c" 1>&6
4802else
4803  ac_save_LIBS="$LIBS"
4804LIBS="-ldl  $LIBS"
4805cat > conftest.$ac_ext <<EOF
4806#line 4807 "configure"
4807#include "confdefs.h"
4808/* Override any gcc2 internal prototype to avoid an error.  */
4809/* We use char because int might match the return type of a gcc2
4810    builtin and then its argument prototype would still apply.  */
4811char dlopen();
4812
4813int main() {
4814dlopen()
4815; return 0; }
4816EOF
4817if { (eval echo configure:4818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4818  rm -rf conftest*
4819  eval "ac_cv_lib_$ac_lib_var=yes"
4820else
4821  echo "configure: failed program was:" >&5
4822  cat conftest.$ac_ext >&5
4823  rm -rf conftest*
4824  eval "ac_cv_lib_$ac_lib_var=no"
4825fi
4826rm -f conftest*
4827LIBS="$ac_save_LIBS"
4828
4829fi
4830if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4831  echo "$ac_t""yes" 1>&6
4832    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4833    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4834  cat >> confdefs.h <<EOF
4835#define $ac_tr_lib 1
4836EOF
4837
4838  LIBS="-ldl $LIBS"
4839
4840else
4841  echo "$ac_t""no" 1>&6
4842fi
4843
4844  if test "$ac_cv_lib_dl_dlopen" = yes; then
4845    NEED_LIBS="-ldl ${NEED_LIBS}"
4846    LD_DYN_FLAGS="-Xlinker -E"
4847    LD_LIBC="-lc"
4848   
4849    cat >> confdefs.h <<\EOF
4850#define HAVE_DL 1
4851EOF
4852
4853  fi
4854  echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
4855echo "configure:4856: checking for shl_load in -ldld" >&5
4856ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
4857if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4858  echo $ac_n "(cached) $ac_c" 1>&6
4859else
4860  ac_save_LIBS="$LIBS"
4861LIBS="-ldld  $LIBS"
4862cat > conftest.$ac_ext <<EOF
4863#line 4864 "configure"
4864#include "confdefs.h"
4865/* Override any gcc2 internal prototype to avoid an error.  */
4866/* We use char because int might match the return type of a gcc2
4867    builtin and then its argument prototype would still apply.  */
4868char shl_load();
4869
4870int main() {
4871shl_load()
4872; return 0; }
4873EOF
4874if { (eval echo configure:4875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4875  rm -rf conftest*
4876  eval "ac_cv_lib_$ac_lib_var=yes"
4877else
4878  echo "configure: failed program was:" >&5
4879  cat conftest.$ac_ext >&5
4880  rm -rf conftest*
4881  eval "ac_cv_lib_$ac_lib_var=no"
4882fi
4883rm -f conftest*
4884LIBS="$ac_save_LIBS"
4885
4886fi
4887if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4888  echo "$ac_t""yes" 1>&6
4889    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4890    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4891  cat >> confdefs.h <<EOF
4892#define $ac_tr_lib 1
4893EOF
4894
4895  LIBS="-ldld $LIBS"
4896
4897else
4898  echo "$ac_t""no" 1>&6
4899fi
4900
4901  if test "$ac_cv_lib_dld_shl_load" = yes; then
4902    NEED_LIBS="-ldld ${NEED_LIBS}"
4903    LD_DYN_FLAGS="-Xlinker -E"
4904    LD_LIBC="-lc"
4905   
4906    cat >> confdefs.h <<\EOF
4907#define HAVE_DL 1
4908EOF
4909
4910  fi
4911fi
4912
4913echo $ac_n "checking whether to have MP""... $ac_c" 1>&6
4914echo "configure:4915: checking whether to have MP" >&5
4915if test "${with_MP}" != yes && test "${with_MP}" != no; then
4916  if (test "${will_have_gmp}" = yes) && \
4917     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
4918    echo "$ac_t""yes" 1>&6
4919    cat >> confdefs.h <<\EOF
4920#define HAVE_MPSR 1
4921EOF
4922
4923    NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
4924  else
4925    echo "$ac_t""no" 1>&6
4926  fi
4927elif  test "${with_MP}" = yes; then
4928  if (test "${will_have_gmp}" = yes) && \
4929     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
4930    echo "$ac_t""yes" 1>&6
4931    cat >> confdefs.h <<\EOF
4932#define HAVE_MPSR 1
4933EOF
4934
4935    NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
4936  else
4937    echo "$ac_t""no" 1>&6
4938    { echo "configure: error: can not build with MP" 1>&2; exit 1; }
4939  fi
4940else
4941  echo "$ac_t""no" 1>&6
4942fi
4943
4944echo $ac_n "checking whether to have factory""... $ac_c" 1>&6
4945echo "configure:4946: checking whether to have factory" >&5
4946if test "${with_factory}" != yes && test "${with_factory}" != no; then
4947  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
4948    echo "$ac_t""yes" 1>&6
4949    cat >> confdefs.h <<\EOF
4950#define HAVE_FACTORY 1
4951EOF
4952
4953    will_have_factory=yes
4954    NEED_LIBS="-lsingcf ${NEED_LIBS}"
4955  else
4956    echo "$ac_t""no" 1>&6
4957  fi
4958elif  test "${with_factory}" = yes; then
4959  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
4960    echo "$ac_t""yes" 1>&6
4961    cat >> confdefs.h <<\EOF
4962#define HAVE_FACTORY 1
4963EOF
4964
4965    will_have_factory=yes
4966    NEED_LIBS="-lsingcf ${NEED_LIBS}"
4967  else
4968    echo "$ac_t""no" 1>&6
4969    { echo "configure: error: can not build with factory" 1>&2; exit 1; }
4970  fi
4971else
4972  echo "$ac_t""no" 1>&6
4973fi
4974
4975echo $ac_n "checking whether to have libfac""... $ac_c" 1>&6
4976echo "configure:4977: checking whether to have libfac" >&5
4977if test "${with_libfac}" != yes && test "${with_libfac}" != no; then
4978  if (test "${will_have_factory}" = yes) && \
4979     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
4980    echo "$ac_t""yes" 1>&6
4981    cat >> confdefs.h <<\EOF
4982#define HAVE_LIBFAC_P 1
4983EOF
4984
4985    NEED_LIBS="-lsingfac ${NEED_LIBS}"
4986  else
4987    echo "$ac_t""no" 1>&6
4988  fi
4989elif  test "${with_libfac}" = yes; then
4990  if (test "${will_have_factory}" = yes) && \
4991     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
4992    echo "$ac_t""yes" 1>&6
4993    cat >> confdefs.h <<\EOF
4994#define HAVE_LIBFAC_P 1
4995EOF
4996
4997    NEED_LIBS="-lsingfac ${NEED_LIBS}"
4998  else
4999    echo "$ac_t""no" 1>&6
5000    { echo "configure: error: can not build with libfac" 1>&2; exit 1; }
5001  fi
5002else
5003  echo "$ac_t""no" 1>&6
5004fi
5005
5006
5007echo $ac_n "checking whether to have dbm links""... $ac_c" 1>&6
5008echo "configure:5009: checking whether to have dbm links" >&5
5009if test "$with_dbm" != no; then
5010  cat >> confdefs.h <<\EOF
5011#define HAVE_DBM 1
5012EOF
5013
5014  echo "$ac_t""yes" 1>&6
5015else
5016  echo "$ac_t""no" 1>&6
5017fi
5018
5019echo $ac_n "checking whether to have namespaces""... $ac_c" 1>&6
5020echo "configure:5021: checking whether to have namespaces" >&5
5021if test "$with_namespaces" != yes; then
5022  echo "$ac_t""no" 1>&6
5023else
5024  cat >> confdefs.h <<\EOF
5025#define HAVE_NAMESPACES 1
5026EOF
5027
5028  echo "$ac_t""yes" 1>&6
5029fi
5030
5031echo $ac_n "checking whether to have dynamic loading""... $ac_c" 1>&6
5032echo "configure:5033: checking whether to have dynamic loading" >&5
5033if test "$with_dl" != yes; then
5034  echo "$ac_t""no" 1>&6
5035else
5036  cat >> confdefs.h <<\EOF
5037#define HAVE_DYNAMIC_LOADING 1
5038EOF
5039
5040  echo "$ac_t""yes" 1>&6
5041  case "$ac_cv_singuname" in
5042        unknown) ;;
5043        HPUX-9)
5044          echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
5045echo "configure:5046: checking for shl_load in -ldld" >&5
5046ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
5047if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5048  echo $ac_n "(cached) $ac_c" 1>&6
5049else
5050  ac_save_LIBS="$LIBS"
5051LIBS="-ldld  $LIBS"
5052cat > conftest.$ac_ext <<EOF
5053#line 5054 "configure"
5054#include "confdefs.h"
5055/* Override any gcc2 internal prototype to avoid an error.  */
5056/* We use char because int might match the return type of a gcc2
5057    builtin and then its argument prototype would still apply.  */
5058char shl_load();
5059
5060int main() {
5061shl_load()
5062; return 0; }
5063EOF
5064if { (eval echo configure:5065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5065  rm -rf conftest*
5066  eval "ac_cv_lib_$ac_lib_var=yes"
5067else
5068  echo "configure: failed program was:" >&5
5069  cat conftest.$ac_ext >&5
5070  rm -rf conftest*
5071  eval "ac_cv_lib_$ac_lib_var=no"
5072fi
5073rm -f conftest*
5074LIBS="$ac_save_LIBS"
5075
5076fi
5077if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5078  echo "$ac_t""yes" 1>&6
5079    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5080    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5081  cat >> confdefs.h <<EOF
5082#define $ac_tr_lib 1
5083EOF
5084
5085  LIBS="-ldld $LIBS"
5086
5087else
5088  echo "$ac_t""no" 1>&6
5089fi
5090
5091          NEED_LIBS="-ldld ${NEED_LIBS}"
5092          LD_DYN_FLAGS="-Xlinker -E"
5093        ;;
5094        HPUX-10)
5095          echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
5096echo "configure:5097: checking for shl_load in -ldld" >&5
5097ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
5098if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5099  echo $ac_n "(cached) $ac_c" 1>&6
5100else
5101  ac_save_LIBS="$LIBS"
5102LIBS="-ldld  $LIBS"
5103cat > conftest.$ac_ext <<EOF
5104#line 5105 "configure"
5105#include "confdefs.h"
5106/* Override any gcc2 internal prototype to avoid an error.  */
5107/* We use char because int might match the return type of a gcc2
5108    builtin and then its argument prototype would still apply.  */
5109char shl_load();
5110
5111int main() {
5112shl_load()
5113; return 0; }
5114EOF
5115if { (eval echo configure:5116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5116  rm -rf conftest*
5117  eval "ac_cv_lib_$ac_lib_var=yes"
5118else
5119  echo "configure: failed program was:" >&5
5120  cat conftest.$ac_ext >&5
5121  rm -rf conftest*
5122  eval "ac_cv_lib_$ac_lib_var=no"
5123fi
5124rm -f conftest*
5125LIBS="$ac_save_LIBS"
5126
5127fi
5128if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5129  echo "$ac_t""yes" 1>&6
5130    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5131    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5132  cat >> confdefs.h <<EOF
5133#define $ac_tr_lib 1
5134EOF
5135
5136  LIBS="-ldld $LIBS"
5137
5138else
5139  echo "$ac_t""no" 1>&6
5140fi
5141
5142          NEED_LIBS="-ldld ${NEED_LIBS}"
5143          LD_DYN_FLAGS="-Xlinker -E"
5144        ;;
5145        ix86-Linux)
5146          NEED_LIBS="-ldl ${NEED_LIBS}"
5147          LD_DYN_FLAGS="-rdynamic"
5148        ;;
5149  esac
5150 
5151fi
5152
5153echo $ac_n "checking whether to use mtrack""... $ac_c" 1>&6
5154echo "configure:5155: checking whether to use mtrack" >&5
5155if test "$with_mtrack" = yes && test "$ac_cv_singuname" = ix86-Linux; then
5156  echo "$ac_t""yes" 1>&6
5157  cat >> confdefs.h <<\EOF
5158#define HAVE_MTRACK 1
5159EOF
5160
5161else
5162  echo "$ac_t""no" 1>&6
5163fi
5164
5165
5166
5167echo $ac_n "checking which exponent type to use""... $ac_c" 1>&6
5168echo "configure:5169: checking which exponent type to use" >&5
5169if test "$with_exp_type" = "char"; then
5170  echo "$ac_t""char" 1>&6
5171  cat >> confdefs.h <<\EOF
5172#define EXPONENT_TYPE char
5173EOF
5174
5175  cat >> confdefs.h <<\EOF
5176#define SIZEOF_EXPONENT SIZEOF_CHAR
5177EOF
5178
5179elif test "with_exp_type" = "int"; then
5180  echo "$ac_t""int" 1>&6
5181  cat >> confdefs.h <<\EOF
5182#define EXPONENT_TYPE int
5183EOF
5184
5185  cat >> confdefs.h <<\EOF
5186#define SIZEOF_EXPONENT SIZEOF_INT
5187EOF
5188
5189else
5190  echo "$ac_t""short" 1>&6
5191  cat >> confdefs.h <<\EOF
5192#define EXPONENT_TYPE short
5193EOF
5194
5195  cat >> confdefs.h <<\EOF
5196#define SIZEOF_TYPE SIZEOF_SHORT
5197EOF
5198
5199fi
5200
5201trap '' 1 2 15
5202cat > confcache <<\EOF
5203# This file is a shell script that caches the results of configure
5204# tests run on this system so they can be shared between configure
5205# scripts and configure runs.  It is not useful on other systems.
5206# If it contains results you don't want to keep, you may remove or edit it.
5207#
5208# By default, configure uses ./config.cache as the cache file,
5209# creating it if it does not exist already.  You can give configure
5210# the --cache-file=FILE option to use a different cache file; that is
5211# what configure does when it calls configure scripts in
5212# subdirectories, so they share the cache.
5213# Giving --cache-file=/dev/null disables caching, for debugging configure.
5214# config.status only pays attention to the cache file if you give it the
5215# --recheck option to rerun configure.
5216#
5217EOF
5218# The following way of writing the cache mishandles newlines in values,
5219# but we know of no workaround that is simple, portable, and efficient.
5220# So, don't put newlines in cache variables' values.
5221# Ultrix sh set writes to stderr and can't be redirected directly,
5222# and sets the high bit in the cache file unless we assign to the vars.
5223(set) 2>&1 |
5224  case `(ac_space=' '; set) 2>&1` in
5225  *ac_space=\ *)
5226    # `set' does not quote correctly, so add quotes (double-quote substitution
5227    # turns \\\\ into \\, and sed turns \\ into \).
5228    sed -n \
5229      -e "s/'/'\\\\''/g" \
5230      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5231    ;;
5232  *)
5233    # `set' quotes correctly as required by POSIX, so do not add quotes.
5234    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5235    ;;
5236  esac >> confcache
5237if cmp -s $cache_file confcache; then
5238  :
5239else
5240  if test -w $cache_file; then
5241    echo "updating cache $cache_file"
5242    cat confcache > $cache_file
5243  else
5244    echo "not updating unwritable cache $cache_file"
5245  fi
5246fi
5247rm -f confcache
5248
5249trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5250
5251test "x$prefix" = xNONE && prefix=$ac_default_prefix
5252# Let make expand exec_prefix.
5253test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5254
5255# Any assignment to VPATH causes Sun make to only execute
5256# the first set of double-colon rules, so remove it if not needed.
5257# If there is a colon in the path, we need to keep it.
5258if test "x$srcdir" = x.; then
5259  ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5260fi
5261
5262trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5263
5264DEFS=-DHAVE_CONFIG_H
5265
5266# Without the "./", some shells look in PATH for config.status.
5267: ${CONFIG_STATUS=./config.status}
5268
5269echo creating $CONFIG_STATUS
5270rm -f $CONFIG_STATUS
5271cat > $CONFIG_STATUS <<EOF
5272#! /bin/sh
5273# Generated automatically by configure.
5274# Run this file to recreate the current configuration.
5275# This directory was configured as follows,
5276# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5277#
5278# $0 $ac_configure_args
5279#
5280# Compiler output produced by configure, useful for debugging
5281# configure, is in ./config.log if it exists.
5282
5283ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5284for ac_option
5285do
5286  case "\$ac_option" in
5287  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5288    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5289    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5290  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5291    echo "$CONFIG_STATUS generated by autoconf version 2.12"
5292    exit 0 ;;
5293  -help | --help | --hel | --he | --h)
5294    echo "\$ac_cs_usage"; exit 0 ;;
5295  *) echo "\$ac_cs_usage"; exit 1 ;;
5296  esac
5297done
5298
5299ac_given_srcdir=$srcdir
5300
5301trap 'rm -fr `echo "Makefile mod2.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5302EOF
5303cat >> $CONFIG_STATUS <<EOF
5304
5305# Protect against being on the right side of a sed subst in config.status.
5306sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5307 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5308$ac_vpsub
5309$extrasub
5310s%@CFLAGS@%$CFLAGS%g
5311s%@CPPFLAGS@%$CPPFLAGS%g
5312s%@CXXFLAGS@%$CXXFLAGS%g
5313s%@DEFS@%$DEFS%g
5314s%@LDFLAGS@%$LDFLAGS%g
5315s%@LIBS@%$LIBS%g
5316s%@exec_prefix@%$exec_prefix%g
5317s%@prefix@%$prefix%g
5318s%@program_transform_name@%$program_transform_name%g
5319s%@bindir@%$bindir%g
5320s%@sbindir@%$sbindir%g
5321s%@libexecdir@%$libexecdir%g
5322s%@datadir@%$datadir%g
5323s%@sysconfdir@%$sysconfdir%g
5324s%@sharedstatedir@%$sharedstatedir%g
5325s%@localstatedir@%$localstatedir%g
5326s%@libdir@%$libdir%g
5327s%@includedir@%$includedir%g
5328s%@oldincludedir@%$oldincludedir%g
5329s%@infodir@%$infodir%g
5330s%@mandir@%$mandir%g
5331s%@SINGUNAME@%$SINGUNAME%g
5332s%@SING_UNAME@%$SING_UNAME%g
5333s%@SINGULAR_VERSION@%$SINGULAR_VERSION%g
5334s%@CC@%$CC%g
5335s%@CPP@%$CPP%g
5336s%@CXX@%$CXX%g
5337s%@PIPE@%$PIPE%g
5338s%@CXXTEMPLFLAGS@%$CXXTEMPLFLAGS%g
5339s%@CXXNOOPTFLAGS@%$CXXNOOPTFLAGS%g
5340s%@STATIC_LDFLAGS@%$STATIC_LDFLAGS%g
5341s%@SET_MAKE@%$SET_MAKE%g
5342s%@SINGULAR@%$SINGULAR%g
5343s%@LEX@%$LEX%g
5344s%@BISON@%$BISON%g
5345s%@LN_S@%$LN_S%g
5346s%@ALLOCA@%$ALLOCA%g
5347s%@PERL5@%$PERL5%g
5348s%@LD_LIBC@%$LD_LIBC%g
5349s%@NEED_LIBS@%$NEED_LIBS%g
5350s%@LD_DYN_FLAGS@%$LD_DYN_FLAGS%g
5351
5352CEOF
5353EOF
5354
5355cat >> $CONFIG_STATUS <<\EOF
5356
5357# Split the substitutions into bite-sized pieces for seds with
5358# small command number limits, like on Digital OSF/1 and HP-UX.
5359ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5360ac_file=1 # Number of current file.
5361ac_beg=1 # First line for current file.
5362ac_end=$ac_max_sed_cmds # Line after last line for current file.
5363ac_more_lines=:
5364ac_sed_cmds=""
5365while $ac_more_lines; do
5366  if test $ac_beg -gt 1; then
5367    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5368  else
5369    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5370  fi
5371  if test ! -s conftest.s$ac_file; then
5372    ac_more_lines=false
5373    rm -f conftest.s$ac_file
5374  else
5375    if test -z "$ac_sed_cmds"; then
5376      ac_sed_cmds="sed -f conftest.s$ac_file"
5377    else
5378      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5379    fi
5380    ac_file=`expr $ac_file + 1`
5381    ac_beg=$ac_end
5382    ac_end=`expr $ac_end + $ac_max_sed_cmds`
5383  fi
5384done
5385if test -z "$ac_sed_cmds"; then
5386  ac_sed_cmds=cat
5387fi
5388EOF
5389
5390cat >> $CONFIG_STATUS <<EOF
5391
5392CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
5393EOF
5394cat >> $CONFIG_STATUS <<\EOF
5395for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5396  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5397  case "$ac_file" in
5398  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5399       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5400  *) ac_file_in="${ac_file}.in" ;;
5401  esac
5402
5403  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5404
5405  # Remove last slash and all that follows it.  Not all systems have dirname.
5406  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5407  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5408    # The file is in a subdirectory.
5409    test ! -d "$ac_dir" && mkdir "$ac_dir"
5410    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5411    # A "../" for each directory in $ac_dir_suffix.
5412    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5413  else
5414    ac_dir_suffix= ac_dots=
5415  fi
5416
5417  case "$ac_given_srcdir" in
5418  .)  srcdir=.
5419      if test -z "$ac_dots"; then top_srcdir=.
5420      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5421  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5422  *) # Relative path.
5423    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5424    top_srcdir="$ac_dots$ac_given_srcdir" ;;
5425  esac
5426
5427
5428  echo creating "$ac_file"
5429  rm -f "$ac_file"
5430  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5431  case "$ac_file" in
5432  *Makefile*) ac_comsub="1i\\
5433# $configure_input" ;;
5434  *) ac_comsub= ;;
5435  esac
5436
5437  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5438  sed -e "$ac_comsub
5439s%@configure_input@%$configure_input%g
5440s%@srcdir@%$srcdir%g
5441s%@top_srcdir@%$top_srcdir%g
5442" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5443fi; done
5444rm -f conftest.s*
5445
5446# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5447# NAME is the cpp macro being defined and VALUE is the value it is being given.
5448#
5449# ac_d sets the value in "#define NAME VALUE" lines.
5450ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5451ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5452ac_dC='\3'
5453ac_dD='%g'
5454# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5455ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5456ac_uB='\([      ]\)%\1#\2define\3'
5457ac_uC=' '
5458ac_uD='\4%g'
5459# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5460ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5461ac_eB='$%\1#\2define\3'
5462ac_eC=' '
5463ac_eD='%g'
5464
5465if test "${CONFIG_HEADERS+set}" != set; then
5466EOF
5467cat >> $CONFIG_STATUS <<EOF
5468  CONFIG_HEADERS="mod2.h"
5469EOF
5470cat >> $CONFIG_STATUS <<\EOF
5471fi
5472for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5473  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5474  case "$ac_file" in
5475  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5476       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5477  *) ac_file_in="${ac_file}.in" ;;
5478  esac
5479
5480  echo creating $ac_file
5481
5482  rm -f conftest.frag conftest.in conftest.out
5483  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5484  cat $ac_file_inputs > conftest.in
5485
5486EOF
5487
5488# Transform confdefs.h into a sed script conftest.vals that substitutes
5489# the proper values into config.h.in to produce config.h.  And first:
5490# Protect against being on the right side of a sed subst in config.status.
5491# Protect against being in an unquoted here document in config.status.
5492rm -f conftest.vals
5493cat > conftest.hdr <<\EOF
5494s/[\\&%]/\\&/g
5495s%[\\$`]%\\&%g
5496s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5497s%ac_d%ac_u%gp
5498s%ac_u%ac_e%gp
5499EOF
5500sed -n -f conftest.hdr confdefs.h > conftest.vals
5501rm -f conftest.hdr
5502
5503# This sed command replaces #undef with comments.  This is necessary, for
5504# example, in the case of _POSIX_SOURCE, which is predefined and required
5505# on some systems where configure will not decide to define it.
5506cat >> conftest.vals <<\EOF
5507s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5508EOF
5509
5510# Break up conftest.vals because some shells have a limit on
5511# the size of here documents, and old seds have small limits too.
5512
5513rm -f conftest.tail
5514while :
5515do
5516  ac_lines=`grep -c . conftest.vals`
5517  # grep -c gives empty output for an empty file on some AIX systems.
5518  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5519  # Write a limited-size here document to conftest.frag.
5520  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
5521  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5522  echo 'CEOF
5523  sed -f conftest.frag conftest.in > conftest.out
5524  rm -f conftest.in
5525  mv conftest.out conftest.in
5526' >> $CONFIG_STATUS
5527  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5528  rm -f conftest.vals
5529  mv conftest.tail conftest.vals
5530done
5531rm -f conftest.vals
5532
5533cat >> $CONFIG_STATUS <<\EOF
5534  rm -f conftest.frag conftest.h
5535  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5536  cat conftest.in >> conftest.h
5537  rm -f conftest.in
5538  if cmp -s $ac_file conftest.h 2>/dev/null; then
5539    echo "$ac_file is unchanged"
5540    rm -f conftest.h
5541  else
5542    # Remove last slash and all that follows it.  Not all systems have dirname.
5543      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5544      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5545      # The file is in a subdirectory.
5546      test ! -d "$ac_dir" && mkdir "$ac_dir"
5547    fi
5548    rm -f $ac_file
5549    mv conftest.h $ac_file
5550  fi
5551fi; done
5552
5553EOF
5554cat >> $CONFIG_STATUS <<EOF
5555
5556EOF
5557cat >> $CONFIG_STATUS <<\EOF
5558\
5559 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi
5560exit 0
5561EOF
5562chmod +x $CONFIG_STATUS
5563rm -fr confdefs* $ac_clean_files
5564test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5565
5566
5567
5568
5569
Note: See TracBrowser for help on using the repository browser.