source: git/Singular/configure @ 84b09b6

spielwiese
Last change on this file since 84b09b6 was 84b09b6, checked in by Hans Schönemann <hannes@…>, 24 years ago
*hannes: term-stuff git-svn-id: file:///usr/local/Singular/svn/trunk@3852 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100755
File size: 149.0 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
3707
3708# readline
3709if test "$with_readline" != no; then
3710  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
3711echo "configure:3712: checking for tgetent in -lncurses" >&5
3712ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
3713if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3714  echo $ac_n "(cached) $ac_c" 1>&6
3715else
3716  ac_save_LIBS="$LIBS"
3717LIBS="-lncurses  $LIBS"
3718cat > conftest.$ac_ext <<EOF
3719#line 3720 "configure"
3720#include "confdefs.h"
3721/* Override any gcc2 internal prototype to avoid an error.  */
3722/* We use char because int might match the return type of a gcc2
3723    builtin and then its argument prototype would still apply.  */
3724char tgetent();
3725
3726int main() {
3727tgetent()
3728; return 0; }
3729EOF
3730if { (eval echo configure:3731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3731  rm -rf conftest*
3732  eval "ac_cv_lib_$ac_lib_var=yes"
3733else
3734  echo "configure: failed program was:" >&5
3735  cat conftest.$ac_ext >&5
3736  rm -rf conftest*
3737  eval "ac_cv_lib_$ac_lib_var=no"
3738fi
3739rm -f conftest*
3740LIBS="$ac_save_LIBS"
3741
3742fi
3743if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3744  echo "$ac_t""yes" 1>&6
3745    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3746    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3747  cat >> confdefs.h <<EOF
3748#define $ac_tr_lib 1
3749EOF
3750
3751  LIBS="-lncurses $LIBS"
3752
3753else
3754  echo "$ac_t""no" 1>&6
3755\
3756   echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
3757echo "configure:3758: checking for tgetent in -lcurses" >&5
3758ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
3759if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3760  echo $ac_n "(cached) $ac_c" 1>&6
3761else
3762  ac_save_LIBS="$LIBS"
3763LIBS="-lcurses  $LIBS"
3764cat > conftest.$ac_ext <<EOF
3765#line 3766 "configure"
3766#include "confdefs.h"
3767/* Override any gcc2 internal prototype to avoid an error.  */
3768/* We use char because int might match the return type of a gcc2
3769    builtin and then its argument prototype would still apply.  */
3770char tgetent();
3771
3772int main() {
3773tgetent()
3774; return 0; }
3775EOF
3776if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3777  rm -rf conftest*
3778  eval "ac_cv_lib_$ac_lib_var=yes"
3779else
3780  echo "configure: failed program was:" >&5
3781  cat conftest.$ac_ext >&5
3782  rm -rf conftest*
3783  eval "ac_cv_lib_$ac_lib_var=no"
3784fi
3785rm -f conftest*
3786LIBS="$ac_save_LIBS"
3787
3788fi
3789if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3790  echo "$ac_t""yes" 1>&6
3791    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
3792    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3793  cat >> confdefs.h <<EOF
3794#define $ac_tr_lib 1
3795EOF
3796
3797  LIBS="-lcurses $LIBS"
3798
3799else
3800  echo "$ac_t""no" 1>&6
3801\
3802   echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
3803echo "configure:3804: checking for tgetent in -ltermcap" >&5
3804ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
3805if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3806  echo $ac_n "(cached) $ac_c" 1>&6
3807else
3808  ac_save_LIBS="$LIBS"
3809LIBS="-ltermcap  $LIBS"
3810cat > conftest.$ac_ext <<EOF
3811#line 3812 "configure"
3812#include "confdefs.h"
3813/* Override any gcc2 internal prototype to avoid an error.  */
3814/* We use char because int might match the return type of a gcc2
3815    builtin and then its argument prototype would still apply.  */
3816char tgetent();
3817
3818int main() {
3819tgetent()
3820; return 0; }
3821EOF
3822if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3823  rm -rf conftest*
3824  eval "ac_cv_lib_$ac_lib_var=yes"
3825else
3826  echo "configure: failed program was:" >&5
3827  cat conftest.$ac_ext >&5
3828  rm -rf conftest*
3829  eval "ac_cv_lib_$ac_lib_var=no"
3830fi
3831rm -f conftest*
3832LIBS="$ac_save_LIBS"
3833
3834fi
3835if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3836  echo "$ac_t""yes" 1>&6
3837    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
3838    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3839  cat >> confdefs.h <<EOF
3840#define $ac_tr_lib 1
3841EOF
3842
3843  LIBS="-ltermcap $LIBS"
3844
3845else
3846  echo "$ac_t""no" 1>&6
3847fi
3848
3849fi
3850
3851fi
3852
3853   echo $ac_n "checking for rl_abort in -lreadline""... $ac_c" 1>&6
3854echo "configure:3855: checking for rl_abort in -lreadline" >&5
3855ac_lib_var=`echo readline'_'rl_abort | sed 'y%./+-%__p_%'`
3856if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3857  echo $ac_n "(cached) $ac_c" 1>&6
3858else
3859  ac_save_LIBS="$LIBS"
3860LIBS="-lreadline  $LIBS"
3861cat > conftest.$ac_ext <<EOF
3862#line 3863 "configure"
3863#include "confdefs.h"
3864/* Override any gcc2 internal prototype to avoid an error.  */
3865/* We use char because int might match the return type of a gcc2
3866    builtin and then its argument prototype would still apply.  */
3867char rl_abort();
3868
3869int main() {
3870rl_abort()
3871; return 0; }
3872EOF
3873if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3874  rm -rf conftest*
3875  eval "ac_cv_lib_$ac_lib_var=yes"
3876else
3877  echo "configure: failed program was:" >&5
3878  cat conftest.$ac_ext >&5
3879  rm -rf conftest*
3880  eval "ac_cv_lib_$ac_lib_var=no"
3881fi
3882rm -f conftest*
3883LIBS="$ac_save_LIBS"
3884
3885fi
3886if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3887  echo "$ac_t""yes" 1>&6
3888    ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3889    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3890  cat >> confdefs.h <<EOF
3891#define $ac_tr_lib 1
3892EOF
3893
3894  LIBS="-lreadline $LIBS"
3895
3896else
3897  echo "$ac_t""no" 1>&6
3898fi
3899
3900   for ac_hdr in readline/readline.h readline/history.h
3901do
3902ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3903echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3904echo "configure:3905: checking for $ac_hdr" >&5
3905if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3906  echo $ac_n "(cached) $ac_c" 1>&6
3907else
3908  cat > conftest.$ac_ext <<EOF
3909#line 3910 "configure"
3910#include "confdefs.h"
3911#include <$ac_hdr>
3912EOF
3913ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3914{ (eval echo configure:3915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3915ac_err=`grep -v '^ *+' conftest.out`
3916if test -z "$ac_err"; then
3917  rm -rf conftest*
3918  eval "ac_cv_header_$ac_safe=yes"
3919else
3920  echo "$ac_err" >&5
3921  echo "configure: failed program was:" >&5
3922  cat conftest.$ac_ext >&5
3923  rm -rf conftest*
3924  eval "ac_cv_header_$ac_safe=no"
3925fi
3926rm -f conftest*
3927fi
3928if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3929  echo "$ac_t""yes" 1>&6
3930    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3931  cat >> confdefs.h <<EOF
3932#define $ac_tr_hdr 1
3933EOF
3934 
3935else
3936  echo "$ac_t""no" 1>&6
3937fi
3938done
3939
3940   if test "$ac_cv_lib_readline_rl_abort" = yes && \
3941      test "$ac_cv_header_readline_readline_h" = yes; then
3942     echo $ac_n "checking whether readline.h is ok""... $ac_c" 1>&6
3943echo "configure:3944: checking whether readline.h is ok" >&5
3944     if eval "test \"`echo '$''{'ac_cv_header_readline_readline_h_ok'+set}'`\" = set"; then
3945  echo $ac_n "(cached) $ac_c" 1>&6
3946else
3947  cat > conftest.$ac_ext <<EOF
3948#line 3949 "configure"
3949#include "confdefs.h"
3950#include<unistd.h>
3951#include<stdio.h>
3952#include<readline/readline.h>
3953#ifdef HAVE_READLINE_HISTORY_H
3954#include<readline/history.h>
3955#endif
3956
3957int main() {
3958#ifndef NULL
3959#define NULL 0
3960#endif
3961rl_readline_name=NULL;
3962*rl_line_buffer=1;
3963completion_matches(NULL, filename_completion_function);
3964rl_attempted_completion_function = (CPPFunction *) NULL;
3965rl_outstream=NULL;
3966readline(NULL);
3967add_history(NULL);
3968read_history(NULL);
3969write_history(NULL);
3970
3971; return 0; }
3972EOF
3973if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
3974  rm -rf conftest*
3975  ac_cv_header_readline_readline_h_ok="yes"
3976else
3977  echo "configure: failed program was:" >&5
3978  cat conftest.$ac_ext >&5
3979  rm -rf conftest*
3980  ac_cv_header_readline_readline_h_ok="no"
3981fi
3982rm -f conftest*
3983fi
3984
3985    echo "$ac_t""$ac_cv_header_readline_readline_h_ok" 1>&6
3986    if test "$ac_cv_header_readline_readline_h_ok" != yes; then
3987#not ok -- try once more with explicitly declaring everything
3988      echo $ac_n "checking whether or not we nevertheless can use readline""... $ac_c" 1>&6
3989echo "configure:3990: checking whether or not we nevertheless can use readline" >&5
3990      if eval "test \"`echo '$''{'ac_cv_have_readline'+set}'`\" = set"; then
3991  echo $ac_n "(cached) $ac_c" 1>&6
3992else
3993  cat > conftest.$ac_ext <<EOF
3994#line 3995 "configure"
3995#include "confdefs.h"
3996#include <stdio.h>
3997
3998int main() {
3999extern char * rl_readline_name;
4000extern char *rl_line_buffer;
4001char *filename_completion_function();
4002typedef char **CPPFunction ();
4003extern char ** completion_matches ();
4004extern CPPFunction * rl_attempted_completion_function;
4005extern FILE * rl_outstream;
4006char * readline ();
4007void add_history ();
4008int write_history ();
4009#ifndef NULL
4010#define NULL 0
4011#endif
4012 rl_readline_name=NULL;
4013*rl_line_buffer=1;
4014completion_matches(NULL, filename_completion_function);
4015rl_attempted_completion_function = (CPPFunction *) NULL;
4016rl_outstream=NULL;
4017readline(NULL);
4018add_history(NULL);
4019read_history(NULL);
4020write_history(NULL);
4021
4022; return 0; }
4023EOF
4024if { (eval echo configure:4025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4025  rm -rf conftest*
4026  ac_cv_have_readline="yes"
4027
4028else
4029  echo "configure: failed program was:" >&5
4030  cat conftest.$ac_ext >&5
4031  rm -rf conftest*
4032  ac_cv_have_readline="no"
4033
4034fi
4035rm -f conftest*
4036fi
4037
4038      echo "$ac_t""$ac_cv_have_readline" 1>&6
4039    else
4040      cat >> confdefs.h <<\EOF
4041#define READLINE_READLINE_H_OK 1
4042EOF
4043
4044      ac_cv_have_readline="yes"
4045    fi
4046  fi
4047  if test "$ac_cv_have_readline" = yes; then
4048    cat >> confdefs.h <<\EOF
4049#define HAVE_READLINE 1
4050EOF
4051
4052  else
4053    echo "configure: warning: building without readline: disabling fancy display" 1>&2
4054    echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4055echo "configure:4056: checking for tgetent in -lncurses" >&5
4056ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4057if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4058  echo $ac_n "(cached) $ac_c" 1>&6
4059else
4060  ac_save_LIBS="$LIBS"
4061LIBS="-lncurses  $LIBS"
4062cat > conftest.$ac_ext <<EOF
4063#line 4064 "configure"
4064#include "confdefs.h"
4065/* Override any gcc2 internal prototype to avoid an error.  */
4066/* We use char because int might match the return type of a gcc2
4067    builtin and then its argument prototype would still apply.  */
4068char tgetent();
4069
4070int main() {
4071tgetent()
4072; return 0; }
4073EOF
4074if { (eval echo configure:4075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4075  rm -rf conftest*
4076  eval "ac_cv_lib_$ac_lib_var=yes"
4077else
4078  echo "configure: failed program was:" >&5
4079  cat conftest.$ac_ext >&5
4080  rm -rf conftest*
4081  eval "ac_cv_lib_$ac_lib_var=no"
4082fi
4083rm -f conftest*
4084LIBS="$ac_save_LIBS"
4085
4086fi
4087if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4088  echo "$ac_t""yes" 1>&6
4089    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4090    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4091  cat >> confdefs.h <<EOF
4092#define $ac_tr_lib 1
4093EOF
4094
4095  LIBS="-lncurses $LIBS"
4096
4097else
4098  echo "$ac_t""no" 1>&6
4099\
4100    echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
4101echo "configure:4102: checking for tgetent in -lcurses" >&5
4102ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
4103if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4104  echo $ac_n "(cached) $ac_c" 1>&6
4105else
4106  ac_save_LIBS="$LIBS"
4107LIBS="-lcurses  $LIBS"
4108cat > conftest.$ac_ext <<EOF
4109#line 4110 "configure"
4110#include "confdefs.h"
4111/* Override any gcc2 internal prototype to avoid an error.  */
4112/* We use char because int might match the return type of a gcc2
4113    builtin and then its argument prototype would still apply.  */
4114char tgetent();
4115
4116int main() {
4117tgetent()
4118; return 0; }
4119EOF
4120if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4121  rm -rf conftest*
4122  eval "ac_cv_lib_$ac_lib_var=yes"
4123else
4124  echo "configure: failed program was:" >&5
4125  cat conftest.$ac_ext >&5
4126  rm -rf conftest*
4127  eval "ac_cv_lib_$ac_lib_var=no"
4128fi
4129rm -f conftest*
4130LIBS="$ac_save_LIBS"
4131
4132fi
4133if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4134  echo "$ac_t""yes" 1>&6
4135    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
4136    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4137  cat >> confdefs.h <<EOF
4138#define $ac_tr_lib 1
4139EOF
4140
4141  LIBS="-lcurses $LIBS"
4142
4143else
4144  echo "$ac_t""no" 1>&6
4145\
4146    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
4147echo "configure:4148: checking for tgetent in -ltermcap" >&5
4148ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
4149if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4150  echo $ac_n "(cached) $ac_c" 1>&6
4151else
4152  ac_save_LIBS="$LIBS"
4153LIBS="-ltermcap  $LIBS"
4154cat > conftest.$ac_ext <<EOF
4155#line 4156 "configure"
4156#include "confdefs.h"
4157/* Override any gcc2 internal prototype to avoid an error.  */
4158/* We use char because int might match the return type of a gcc2
4159    builtin and then its argument prototype would still apply.  */
4160char tgetent();
4161
4162int main() {
4163tgetent()
4164; return 0; }
4165EOF
4166if { (eval echo configure:4167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4167  rm -rf conftest*
4168  eval "ac_cv_lib_$ac_lib_var=yes"
4169else
4170  echo "configure: failed program was:" >&5
4171  cat conftest.$ac_ext >&5
4172  rm -rf conftest*
4173  eval "ac_cv_lib_$ac_lib_var=no"
4174fi
4175rm -f conftest*
4176LIBS="$ac_save_LIBS"
4177
4178fi
4179if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4180  echo "$ac_t""yes" 1>&6
4181    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
4182    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4183  cat >> confdefs.h <<EOF
4184#define $ac_tr_lib 1
4185EOF
4186
4187  LIBS="-ltermcap $LIBS"
4188
4189else
4190  echo "$ac_t""no" 1>&6
4191\
4192    cat >> confdefs.h <<\EOF
4193#define HAVE_FEREAD 1
4194EOF
4195
4196fi
4197
4198fi
4199
4200fi
4201
4202  fi
4203else
4204    echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4205echo "configure:4206: checking for tgetent in -lncurses" >&5
4206ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4207if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4208  echo $ac_n "(cached) $ac_c" 1>&6
4209else
4210  ac_save_LIBS="$LIBS"
4211LIBS="-lncurses  $LIBS"
4212cat > conftest.$ac_ext <<EOF
4213#line 4214 "configure"
4214#include "confdefs.h"
4215/* Override any gcc2 internal prototype to avoid an error.  */
4216/* We use char because int might match the return type of a gcc2
4217    builtin and then its argument prototype would still apply.  */
4218char tgetent();
4219
4220int main() {
4221tgetent()
4222; return 0; }
4223EOF
4224if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4225  rm -rf conftest*
4226  eval "ac_cv_lib_$ac_lib_var=yes"
4227else
4228  echo "configure: failed program was:" >&5
4229  cat conftest.$ac_ext >&5
4230  rm -rf conftest*
4231  eval "ac_cv_lib_$ac_lib_var=no"
4232fi
4233rm -f conftest*
4234LIBS="$ac_save_LIBS"
4235
4236fi
4237if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4238  echo "$ac_t""yes" 1>&6
4239    ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4240    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4241  cat >> confdefs.h <<EOF
4242#define $ac_tr_lib 1
4243EOF
4244
4245  LIBS="-lncurses $LIBS"
4246
4247else
4248  echo "$ac_t""no" 1>&6
4249\
4250    echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
4251echo "configure:4252: checking for tgetent in -lcurses" >&5
4252ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
4253if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4254  echo $ac_n "(cached) $ac_c" 1>&6
4255else
4256  ac_save_LIBS="$LIBS"
4257LIBS="-lcurses  $LIBS"
4258cat > conftest.$ac_ext <<EOF
4259#line 4260 "configure"
4260#include "confdefs.h"
4261/* Override any gcc2 internal prototype to avoid an error.  */
4262/* We use char because int might match the return type of a gcc2
4263    builtin and then its argument prototype would still apply.  */
4264char tgetent();
4265
4266int main() {
4267tgetent()
4268; return 0; }
4269EOF
4270if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4271  rm -rf conftest*
4272  eval "ac_cv_lib_$ac_lib_var=yes"
4273else
4274  echo "configure: failed program was:" >&5
4275  cat conftest.$ac_ext >&5
4276  rm -rf conftest*
4277  eval "ac_cv_lib_$ac_lib_var=no"
4278fi
4279rm -f conftest*
4280LIBS="$ac_save_LIBS"
4281
4282fi
4283if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4284  echo "$ac_t""yes" 1>&6
4285    ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
4286    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4287  cat >> confdefs.h <<EOF
4288#define $ac_tr_lib 1
4289EOF
4290
4291  LIBS="-lcurses $LIBS"
4292
4293else
4294  echo "$ac_t""no" 1>&6
4295\
4296    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
4297echo "configure:4298: checking for tgetent in -ltermcap" >&5
4298ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
4299if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4300  echo $ac_n "(cached) $ac_c" 1>&6
4301else
4302  ac_save_LIBS="$LIBS"
4303LIBS="-ltermcap  $LIBS"
4304cat > conftest.$ac_ext <<EOF
4305#line 4306 "configure"
4306#include "confdefs.h"
4307/* Override any gcc2 internal prototype to avoid an error.  */
4308/* We use char because int might match the return type of a gcc2
4309    builtin and then its argument prototype would still apply.  */
4310char tgetent();
4311
4312int main() {
4313tgetent()
4314; return 0; }
4315EOF
4316if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4317  rm -rf conftest*
4318  eval "ac_cv_lib_$ac_lib_var=yes"
4319else
4320  echo "configure: failed program was:" >&5
4321  cat conftest.$ac_ext >&5
4322  rm -rf conftest*
4323  eval "ac_cv_lib_$ac_lib_var=no"
4324fi
4325rm -f conftest*
4326LIBS="$ac_save_LIBS"
4327
4328fi
4329if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4330  echo "$ac_t""yes" 1>&6
4331    ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
4332    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4333  cat >> confdefs.h <<EOF
4334#define $ac_tr_lib 1
4335EOF
4336
4337  LIBS="-ltermcap $LIBS"
4338
4339else
4340  echo "$ac_t""no" 1>&6
4341\
4342  cat >> confdefs.h <<\EOF
4343#define HAVE_FEREAD 1
4344EOF
4345
4346fi
4347
4348fi
4349
4350fi
4351
4352fi
4353
4354NEED_LIBS=$LIBS
4355
4356# gmp, smallgmp, MP, MPT, factory, libfac
4357echo $ac_n "checking for mpq_init in -lgmp""... $ac_c" 1>&6
4358echo "configure:4359: checking for mpq_init in -lgmp" >&5
4359ac_lib_var=`echo gmp'_'mpq_init | sed 'y%./+-%__p_%'`
4360if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4361  echo $ac_n "(cached) $ac_c" 1>&6
4362else
4363  ac_save_LIBS="$LIBS"
4364LIBS="-lgmp  $LIBS"
4365cat > conftest.$ac_ext <<EOF
4366#line 4367 "configure"
4367#include "confdefs.h"
4368/* Override any gcc2 internal prototype to avoid an error.  */
4369/* We use char because int might match the return type of a gcc2
4370    builtin and then its argument prototype would still apply.  */
4371char mpq_init();
4372
4373int main() {
4374mpq_init()
4375; return 0; }
4376EOF
4377if { (eval echo configure:4378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4378  rm -rf conftest*
4379  eval "ac_cv_lib_$ac_lib_var=yes"
4380else
4381  echo "configure: failed program was:" >&5
4382  cat conftest.$ac_ext >&5
4383  rm -rf conftest*
4384  eval "ac_cv_lib_$ac_lib_var=no"
4385fi
4386rm -f conftest*
4387LIBS="$ac_save_LIBS"
4388
4389fi
4390if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4391  echo "$ac_t""yes" 1>&6
4392    ac_tr_lib=HAVE_LIB`echo gmp | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4393    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4394  cat >> confdefs.h <<EOF
4395#define $ac_tr_lib 1
4396EOF
4397
4398  LIBS="-lgmp $LIBS"
4399
4400else
4401  echo "$ac_t""no" 1>&6
4402fi
4403
4404if test "ac_cv_lib_gmp_mpq_init" = yes && test "$with-apint" = smallgmp; then
4405  LIBS=NEED_LIBS
4406fi
4407echo $ac_n "checking for mpz_init in -lsmallgmp""... $ac_c" 1>&6
4408echo "configure:4409: checking for mpz_init in -lsmallgmp" >&5
4409ac_lib_var=`echo smallgmp'_'mpz_init | sed 'y%./+-%__p_%'`
4410if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4411  echo $ac_n "(cached) $ac_c" 1>&6
4412else
4413  ac_save_LIBS="$LIBS"
4414LIBS="-lsmallgmp  $LIBS"
4415cat > conftest.$ac_ext <<EOF
4416#line 4417 "configure"
4417#include "confdefs.h"
4418/* Override any gcc2 internal prototype to avoid an error.  */
4419/* We use char because int might match the return type of a gcc2
4420    builtin and then its argument prototype would still apply.  */
4421char mpz_init();
4422
4423int main() {
4424mpz_init()
4425; return 0; }
4426EOF
4427if { (eval echo configure:4428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4428  rm -rf conftest*
4429  eval "ac_cv_lib_$ac_lib_var=yes"
4430else
4431  echo "configure: failed program was:" >&5
4432  cat conftest.$ac_ext >&5
4433  rm -rf conftest*
4434  eval "ac_cv_lib_$ac_lib_var=no"
4435fi
4436rm -f conftest*
4437LIBS="$ac_save_LIBS"
4438
4439fi
4440if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4441  echo "$ac_t""yes" 1>&6
4442    ac_tr_lib=HAVE_LIB`echo smallgmp | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4443    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4444  cat >> confdefs.h <<EOF
4445#define $ac_tr_lib 1
4446EOF
4447
4448  LIBS="-lsmallgmp $LIBS"
4449
4450else
4451  echo "$ac_t""no" 1>&6
4452fi
4453
4454echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6
4455echo "configure:4456: checking for IMP_PutGmpInt in -lMP" >&5
4456ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'`
4457if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4458  echo $ac_n "(cached) $ac_c" 1>&6
4459else
4460  ac_save_LIBS="$LIBS"
4461LIBS="-lMP  $LIBS"
4462cat > conftest.$ac_ext <<EOF
4463#line 4464 "configure"
4464#include "confdefs.h"
4465/* Override any gcc2 internal prototype to avoid an error.  */
4466/* We use char because int might match the return type of a gcc2
4467    builtin and then its argument prototype would still apply.  */
4468char IMP_PutGmpInt();
4469
4470int main() {
4471IMP_PutGmpInt()
4472; return 0; }
4473EOF
4474if { (eval echo configure:4475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4475  rm -rf conftest*
4476  eval "ac_cv_lib_$ac_lib_var=yes"
4477else
4478  echo "configure: failed program was:" >&5
4479  cat conftest.$ac_ext >&5
4480  rm -rf conftest*
4481  eval "ac_cv_lib_$ac_lib_var=no"
4482fi
4483rm -f conftest*
4484LIBS="$ac_save_LIBS"
4485
4486fi
4487if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4488  echo "$ac_t""yes" 1>&6
4489    ac_tr_lib=HAVE_LIB`echo MP | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4490    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4491  cat >> confdefs.h <<EOF
4492#define $ac_tr_lib 1
4493EOF
4494
4495  LIBS="-lMP $LIBS"
4496
4497else
4498  echo "$ac_t""no" 1>&6
4499fi
4500
4501echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6
4502echo "configure:4503: checking for MPT_GetTree in -lMPT" >&5
4503ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'`
4504if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4505  echo $ac_n "(cached) $ac_c" 1>&6
4506else
4507  ac_save_LIBS="$LIBS"
4508LIBS="-lMPT  $LIBS"
4509cat > conftest.$ac_ext <<EOF
4510#line 4511 "configure"
4511#include "confdefs.h"
4512/* Override any gcc2 internal prototype to avoid an error.  */
4513/* We use char because int might match the return type of a gcc2
4514    builtin and then its argument prototype would still apply.  */
4515char MPT_GetTree();
4516
4517int main() {
4518MPT_GetTree()
4519; return 0; }
4520EOF
4521if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4522  rm -rf conftest*
4523  eval "ac_cv_lib_$ac_lib_var=yes"
4524else
4525  echo "configure: failed program was:" >&5
4526  cat conftest.$ac_ext >&5
4527  rm -rf conftest*
4528  eval "ac_cv_lib_$ac_lib_var=no"
4529fi
4530rm -f conftest*
4531LIBS="$ac_save_LIBS"
4532
4533fi
4534if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4535  echo "$ac_t""yes" 1>&6
4536    ac_tr_lib=HAVE_LIB`echo MPT | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4537    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4538  cat >> confdefs.h <<EOF
4539#define $ac_tr_lib 1
4540EOF
4541
4542  LIBS="-lMPT $LIBS"
4543
4544else
4545  echo "$ac_t""no" 1>&6
4546fi
4547
4548echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6
4549echo "configure:4550: checking for atof in -lsingcf" >&5
4550ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'`
4551if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4552  echo $ac_n "(cached) $ac_c" 1>&6
4553else
4554  ac_save_LIBS="$LIBS"
4555LIBS="-lsingcf  $LIBS"
4556cat > conftest.$ac_ext <<EOF
4557#line 4558 "configure"
4558#include "confdefs.h"
4559/* Override any gcc2 internal prototype to avoid an error.  */
4560/* We use char because int might match the return type of a gcc2
4561    builtin and then its argument prototype would still apply.  */
4562char atof();
4563
4564int main() {
4565atof()
4566; return 0; }
4567EOF
4568if { (eval echo configure:4569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4569  rm -rf conftest*
4570  eval "ac_cv_lib_$ac_lib_var=yes"
4571else
4572  echo "configure: failed program was:" >&5
4573  cat conftest.$ac_ext >&5
4574  rm -rf conftest*
4575  eval "ac_cv_lib_$ac_lib_var=no"
4576fi
4577rm -f conftest*
4578LIBS="$ac_save_LIBS"
4579
4580fi
4581if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4582  echo "$ac_t""yes" 1>&6
4583    ac_tr_lib=HAVE_LIB`echo singcf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4584    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4585  cat >> confdefs.h <<EOF
4586#define $ac_tr_lib 1
4587EOF
4588
4589  LIBS="-lsingcf $LIBS"
4590
4591else
4592  echo "$ac_t""no" 1>&6
4593fi
4594
4595echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6
4596echo "configure:4597: checking for atof in -lsingfac" >&5
4597ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'`
4598if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4599  echo $ac_n "(cached) $ac_c" 1>&6
4600else
4601  ac_save_LIBS="$LIBS"
4602LIBS="-lsingfac  $LIBS"
4603cat > conftest.$ac_ext <<EOF
4604#line 4605 "configure"
4605#include "confdefs.h"
4606/* Override any gcc2 internal prototype to avoid an error.  */
4607/* We use char because int might match the return type of a gcc2
4608    builtin and then its argument prototype would still apply.  */
4609char atof();
4610
4611int main() {
4612atof()
4613; return 0; }
4614EOF
4615if { (eval echo configure:4616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4616  rm -rf conftest*
4617  eval "ac_cv_lib_$ac_lib_var=yes"
4618else
4619  echo "configure: failed program was:" >&5
4620  cat conftest.$ac_ext >&5
4621  rm -rf conftest*
4622  eval "ac_cv_lib_$ac_lib_var=no"
4623fi
4624rm -f conftest*
4625LIBS="$ac_save_LIBS"
4626
4627fi
4628if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4629  echo "$ac_t""yes" 1>&6
4630    ac_tr_lib=HAVE_LIB`echo singfac | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4631    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4632  cat >> confdefs.h <<EOF
4633#define $ac_tr_lib 1
4634EOF
4635
4636  LIBS="-lsingfac $LIBS"
4637
4638else
4639  echo "$ac_t""no" 1>&6
4640fi
4641
4642
4643for ac_hdr in gmp.h smallgmp.h MP.h  MPT.h factory.h factor.h
4644do
4645ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4646echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4647echo "configure:4648: checking for $ac_hdr" >&5
4648if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4649  echo $ac_n "(cached) $ac_c" 1>&6
4650else
4651  cat > conftest.$ac_ext <<EOF
4652#line 4653 "configure"
4653#include "confdefs.h"
4654#include <$ac_hdr>
4655EOF
4656ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4657{ (eval echo configure:4658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4658ac_err=`grep -v '^ *+' conftest.out`
4659if test -z "$ac_err"; then
4660  rm -rf conftest*
4661  eval "ac_cv_header_$ac_safe=yes"
4662else
4663  echo "$ac_err" >&5
4664  echo "configure: failed program was:" >&5
4665  cat conftest.$ac_ext >&5
4666  rm -rf conftest*
4667  eval "ac_cv_header_$ac_safe=no"
4668fi
4669rm -f conftest*
4670fi
4671if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4672  echo "$ac_t""yes" 1>&6
4673    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4674  cat >> confdefs.h <<EOF
4675#define $ac_tr_hdr 1
4676EOF
4677 
4678else
4679  echo "$ac_t""no" 1>&6
4680fi
4681done
4682
4683
4684if test "$ac_cv_lib_gmp_mpq_init" = yes && \
4685 test "$ac_cv_header_gmp_h" = yes; then
4686    ac_gmp_ok=yes
4687fi
4688
4689if test "$ac_cv_lib_smallgmp_mpz_init" = yes && \
4690 test "$ac_cv_header_smallgmp_h" = yes && \
4691 test "$ac_cv_header_gmp_h" = yes; then
4692    ac_smallgmp_ok=yes
4693fi
4694
4695if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
4696 test "$ac_cv_lib_MPT_MPT_GetTree" && \
4697 test "$ac_cv_header_MP_h" = yes && \
4698 test "$ac_cv_header_MPT_h" = yes; then
4699  ac_MP_ok=yes
4700fi
4701
4702if test "$ac_cv_lib_singcf_atof" = yes && \
4703 test "$ac_cv_header_factory_h" = yes; then
4704  ac_factory_ok=yes
4705fi
4706
4707if test "$ac_cv_lib_singfac_atof" = yes && \
4708 test "$ac_cv_header_factor_h" = yes; then
4709  ac_libfac_ok=yes
4710fi
4711
4712# evaluate results
4713echo $ac_n "checking which apint package to use""... $ac_c" 1>&6
4714echo "configure:4715: checking which apint package to use" >&5
4715if test "${with_apint}" != gmp && test "${with_apint}" != smallgmp; then
4716  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
4717    echo "$ac_t""gmp" 1>&6
4718    will_have_gmp=yes
4719    NEED_LIBS="-lgmp ${NEED_LIBS}"
4720  elif test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
4721    echo "$ac_t""smallgmp" 1>&6
4722    cat >> confdefs.h <<\EOF
4723#define HAVE_SMALLGMP 1
4724EOF
4725
4726    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
4727  else
4728    echo "$ac_t""none" 1>&6
4729    { echo "configure: error: can not build without gmp or smallgmp" 1>&2; exit 1; }
4730  fi
4731elif test "${with_apint}" = gmp; then
4732  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
4733    echo "$ac_t""gmp" 1>&6
4734    will_have_gmp=yes
4735    NEED_LIBS="-lgmp ${NEED_LIBS}"
4736  else
4737    echo "$ac_t""none" 1>&6
4738    { echo "configure: error: can not build with gmp" 1>&2; exit 1; }
4739  fi
4740else
4741  if test "ac_gmp_smallgmp_ok" = yes || test "$enable_smallgmp" = "yes"; then
4742    echo "$ac_t""smallgmp" 1>&6
4743    cat >> confdefs.h <<\EOF
4744#define HAVE_SMALLGMP 1
4745EOF
4746
4747    NEED_LIBS="-lsmallgmp ${NEED_LIBS}"
4748  else
4749    echo "$ac_t""none" 1>&6
4750    { echo "configure: error: can not build with smallgmp" 1>&2; exit 1; }
4751  fi
4752fi
4753
4754#
4755# dl
4756if test "$with_dl" != no; then
4757  echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4758echo "configure:4759: checking for dlopen in -ldl" >&5
4759ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
4760if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4761  echo $ac_n "(cached) $ac_c" 1>&6
4762else
4763  ac_save_LIBS="$LIBS"
4764LIBS="-ldl  $LIBS"
4765cat > conftest.$ac_ext <<EOF
4766#line 4767 "configure"
4767#include "confdefs.h"
4768/* Override any gcc2 internal prototype to avoid an error.  */
4769/* We use char because int might match the return type of a gcc2
4770    builtin and then its argument prototype would still apply.  */
4771char dlopen();
4772
4773int main() {
4774dlopen()
4775; return 0; }
4776EOF
4777if { (eval echo configure:4778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4778  rm -rf conftest*
4779  eval "ac_cv_lib_$ac_lib_var=yes"
4780else
4781  echo "configure: failed program was:" >&5
4782  cat conftest.$ac_ext >&5
4783  rm -rf conftest*
4784  eval "ac_cv_lib_$ac_lib_var=no"
4785fi
4786rm -f conftest*
4787LIBS="$ac_save_LIBS"
4788
4789fi
4790if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4791  echo "$ac_t""yes" 1>&6
4792    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4793    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4794  cat >> confdefs.h <<EOF
4795#define $ac_tr_lib 1
4796EOF
4797
4798  LIBS="-ldl $LIBS"
4799
4800else
4801  echo "$ac_t""no" 1>&6
4802fi
4803
4804  if test "$ac_cv_lib_dl_dlopen" = yes; then
4805    NEED_LIBS="-ldl ${NEED_LIBS}"
4806    LD_DYN_FLAGS="-Xlinker -E"
4807    LD_LIBC="-lc"
4808   
4809    cat >> confdefs.h <<\EOF
4810#define HAVE_DL 1
4811EOF
4812
4813  fi
4814  echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
4815echo "configure:4816: checking for shl_load in -ldld" >&5
4816ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
4817if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4818  echo $ac_n "(cached) $ac_c" 1>&6
4819else
4820  ac_save_LIBS="$LIBS"
4821LIBS="-ldld  $LIBS"
4822cat > conftest.$ac_ext <<EOF
4823#line 4824 "configure"
4824#include "confdefs.h"
4825/* Override any gcc2 internal prototype to avoid an error.  */
4826/* We use char because int might match the return type of a gcc2
4827    builtin and then its argument prototype would still apply.  */
4828char shl_load();
4829
4830int main() {
4831shl_load()
4832; return 0; }
4833EOF
4834if { (eval echo configure:4835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
4835  rm -rf conftest*
4836  eval "ac_cv_lib_$ac_lib_var=yes"
4837else
4838  echo "configure: failed program was:" >&5
4839  cat conftest.$ac_ext >&5
4840  rm -rf conftest*
4841  eval "ac_cv_lib_$ac_lib_var=no"
4842fi
4843rm -f conftest*
4844LIBS="$ac_save_LIBS"
4845
4846fi
4847if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4848  echo "$ac_t""yes" 1>&6
4849    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4850    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4851  cat >> confdefs.h <<EOF
4852#define $ac_tr_lib 1
4853EOF
4854
4855  LIBS="-ldld $LIBS"
4856
4857else
4858  echo "$ac_t""no" 1>&6
4859fi
4860
4861  if test "$ac_cv_lib_dld_shl_load" = yes; then
4862    NEED_LIBS="-ldld ${NEED_LIBS}"
4863    LD_DYN_FLAGS="-Xlinker -E"
4864    LD_LIBC="-lc"
4865   
4866    cat >> confdefs.h <<\EOF
4867#define HAVE_DL 1
4868EOF
4869
4870  fi
4871fi
4872
4873echo $ac_n "checking whether to have MP""... $ac_c" 1>&6
4874echo "configure:4875: checking whether to have MP" >&5
4875if test "${with_MP}" != yes && test "${with_MP}" != no; then
4876  if (test "${will_have_gmp}" = yes) && \
4877     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
4878    echo "$ac_t""yes" 1>&6
4879    cat >> confdefs.h <<\EOF
4880#define HAVE_MPSR 1
4881EOF
4882
4883    NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
4884  else
4885    echo "$ac_t""no" 1>&6
4886  fi
4887elif  test "${with_MP}" = yes; then
4888  if (test "${will_have_gmp}" = yes) && \
4889     (test "$ac_MP_ok" =  yes || test "$enable_MP" = yes); then
4890    echo "$ac_t""yes" 1>&6
4891    cat >> confdefs.h <<\EOF
4892#define HAVE_MPSR 1
4893EOF
4894
4895    NEED_LIBS="-lMPT -lMP ${NEED_LIBS}"
4896  else
4897    echo "$ac_t""no" 1>&6
4898    { echo "configure: error: can not build with MP" 1>&2; exit 1; }
4899  fi
4900else
4901  echo "$ac_t""no" 1>&6
4902fi
4903
4904echo $ac_n "checking whether to have factory""... $ac_c" 1>&6
4905echo "configure:4906: checking whether to have factory" >&5
4906if test "${with_factory}" != yes && test "${with_factory}" != no; then
4907  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
4908    echo "$ac_t""yes" 1>&6
4909    cat >> confdefs.h <<\EOF
4910#define HAVE_FACTORY 1
4911EOF
4912
4913    will_have_factory=yes
4914    NEED_LIBS="-lsingcf ${NEED_LIBS}"
4915  else
4916    echo "$ac_t""no" 1>&6
4917  fi
4918elif  test "${with_factory}" = yes; then
4919  if test "$ac_factory_ok" =  yes || test "$enable_factory" = yes; then
4920    echo "$ac_t""yes" 1>&6
4921    cat >> confdefs.h <<\EOF
4922#define HAVE_FACTORY 1
4923EOF
4924
4925    will_have_factory=yes
4926    NEED_LIBS="-lsingcf ${NEED_LIBS}"
4927  else
4928    echo "$ac_t""no" 1>&6
4929    { echo "configure: error: can not build with factory" 1>&2; exit 1; }
4930  fi
4931else
4932  echo "$ac_t""no" 1>&6
4933fi
4934
4935echo $ac_n "checking whether to have libfac""... $ac_c" 1>&6
4936echo "configure:4937: checking whether to have libfac" >&5
4937if test "${with_libfac}" != yes && test "${with_libfac}" != no; then
4938  if (test "${will_have_factory}" = yes) && \
4939     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
4940    echo "$ac_t""yes" 1>&6
4941    cat >> confdefs.h <<\EOF
4942#define HAVE_LIBFAC_P 1
4943EOF
4944
4945    NEED_LIBS="-lsingfac ${NEED_LIBS}"
4946  else
4947    echo "$ac_t""no" 1>&6
4948  fi
4949elif  test "${with_libfac}" = yes; then
4950  if (test "${will_have_factory}" = yes) && \
4951     (test "$ac_libfac_ok" =  yes || test "$enable_libfac" = yes); then
4952    echo "$ac_t""yes" 1>&6
4953    cat >> confdefs.h <<\EOF
4954#define HAVE_LIBFAC_P 1
4955EOF
4956
4957    NEED_LIBS="-lsingfac ${NEED_LIBS}"
4958  else
4959    echo "$ac_t""no" 1>&6
4960    { echo "configure: error: can not build with libfac" 1>&2; exit 1; }
4961  fi
4962else
4963  echo "$ac_t""no" 1>&6
4964fi
4965
4966
4967echo $ac_n "checking whether to have dbm links""... $ac_c" 1>&6
4968echo "configure:4969: checking whether to have dbm links" >&5
4969if test "$with_dbm" != no; then
4970  cat >> confdefs.h <<\EOF
4971#define HAVE_DBM 1
4972EOF
4973
4974  echo "$ac_t""yes" 1>&6
4975else
4976  echo "$ac_t""no" 1>&6
4977fi
4978
4979echo $ac_n "checking whether to have namespaces""... $ac_c" 1>&6
4980echo "configure:4981: checking whether to have namespaces" >&5
4981if test "$with_namespaces" != yes; then
4982  echo "$ac_t""no" 1>&6
4983else
4984  cat >> confdefs.h <<\EOF
4985#define HAVE_NAMESPACES 1
4986EOF
4987
4988  echo "$ac_t""yes" 1>&6
4989fi
4990
4991echo $ac_n "checking whether to have dynamic loading""... $ac_c" 1>&6
4992echo "configure:4993: checking whether to have dynamic loading" >&5
4993if test "$with_dl" != yes; then
4994  echo "$ac_t""no" 1>&6
4995else
4996  cat >> confdefs.h <<\EOF
4997#define HAVE_DYNAMIC_LOADING 1
4998EOF
4999
5000  echo "$ac_t""yes" 1>&6
5001  case "$ac_cv_singuname" in
5002        unknown) ;;
5003        HPUX-9)
5004          echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
5005echo "configure:5006: checking for shl_load in -ldld" >&5
5006ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
5007if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5008  echo $ac_n "(cached) $ac_c" 1>&6
5009else
5010  ac_save_LIBS="$LIBS"
5011LIBS="-ldld  $LIBS"
5012cat > conftest.$ac_ext <<EOF
5013#line 5014 "configure"
5014#include "confdefs.h"
5015/* Override any gcc2 internal prototype to avoid an error.  */
5016/* We use char because int might match the return type of a gcc2
5017    builtin and then its argument prototype would still apply.  */
5018char shl_load();
5019
5020int main() {
5021shl_load()
5022; return 0; }
5023EOF
5024if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5025  rm -rf conftest*
5026  eval "ac_cv_lib_$ac_lib_var=yes"
5027else
5028  echo "configure: failed program was:" >&5
5029  cat conftest.$ac_ext >&5
5030  rm -rf conftest*
5031  eval "ac_cv_lib_$ac_lib_var=no"
5032fi
5033rm -f conftest*
5034LIBS="$ac_save_LIBS"
5035
5036fi
5037if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5038  echo "$ac_t""yes" 1>&6
5039    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5040    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5041  cat >> confdefs.h <<EOF
5042#define $ac_tr_lib 1
5043EOF
5044
5045  LIBS="-ldld $LIBS"
5046
5047else
5048  echo "$ac_t""no" 1>&6
5049fi
5050
5051          NEED_LIBS="-ldld ${NEED_LIBS}"
5052          LD_DYN_FLAGS="-Xlinker -E"
5053        ;;
5054        HPUX-10)
5055          echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
5056echo "configure:5057: checking for shl_load in -ldld" >&5
5057ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
5058if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5059  echo $ac_n "(cached) $ac_c" 1>&6
5060else
5061  ac_save_LIBS="$LIBS"
5062LIBS="-ldld  $LIBS"
5063cat > conftest.$ac_ext <<EOF
5064#line 5065 "configure"
5065#include "confdefs.h"
5066/* Override any gcc2 internal prototype to avoid an error.  */
5067/* We use char because int might match the return type of a gcc2
5068    builtin and then its argument prototype would still apply.  */
5069char shl_load();
5070
5071int main() {
5072shl_load()
5073; return 0; }
5074EOF
5075if { (eval echo configure:5076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5076  rm -rf conftest*
5077  eval "ac_cv_lib_$ac_lib_var=yes"
5078else
5079  echo "configure: failed program was:" >&5
5080  cat conftest.$ac_ext >&5
5081  rm -rf conftest*
5082  eval "ac_cv_lib_$ac_lib_var=no"
5083fi
5084rm -f conftest*
5085LIBS="$ac_save_LIBS"
5086
5087fi
5088if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5089  echo "$ac_t""yes" 1>&6
5090    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5091    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5092  cat >> confdefs.h <<EOF
5093#define $ac_tr_lib 1
5094EOF
5095
5096  LIBS="-ldld $LIBS"
5097
5098else
5099  echo "$ac_t""no" 1>&6
5100fi
5101
5102          NEED_LIBS="-ldld ${NEED_LIBS}"
5103          LD_DYN_FLAGS="-Xlinker -E"
5104        ;;
5105        ix86-Linux)
5106          NEED_LIBS="-ldl ${NEED_LIBS}"
5107          LD_DYN_FLAGS="-rdynamic"
5108        ;;
5109  esac
5110 
5111fi
5112
5113echo $ac_n "checking whether to use mtrack""... $ac_c" 1>&6
5114echo "configure:5115: checking whether to use mtrack" >&5
5115if test "$with_mtrack" = yes && test "$ac_cv_singuname" = ix86-Linux; then
5116  echo "$ac_t""yes" 1>&6
5117  cat >> confdefs.h <<\EOF
5118#define HAVE_MTRACK 1
5119EOF
5120
5121else
5122  echo "$ac_t""no" 1>&6
5123fi
5124
5125
5126
5127echo $ac_n "checking which exponent type to use""... $ac_c" 1>&6
5128echo "configure:5129: checking which exponent type to use" >&5
5129if test "$with_exp_type" = "char"; then
5130  echo "$ac_t""char" 1>&6
5131  cat >> confdefs.h <<\EOF
5132#define EXPONENT_TYPE char
5133EOF
5134
5135  cat >> confdefs.h <<\EOF
5136#define SIZEOF_EXPONENT SIZEOF_CHAR
5137EOF
5138
5139elif test "with_exp_type" = "int"; then
5140  echo "$ac_t""int" 1>&6
5141  cat >> confdefs.h <<\EOF
5142#define EXPONENT_TYPE int
5143EOF
5144
5145  cat >> confdefs.h <<\EOF
5146#define SIZEOF_EXPONENT SIZEOF_INT
5147EOF
5148
5149else
5150  echo "$ac_t""short" 1>&6
5151  cat >> confdefs.h <<\EOF
5152#define EXPONENT_TYPE short
5153EOF
5154
5155  cat >> confdefs.h <<\EOF
5156#define SIZEOF_TYPE SIZEOF_SHORT
5157EOF
5158
5159fi
5160
5161trap '' 1 2 15
5162cat > confcache <<\EOF
5163# This file is a shell script that caches the results of configure
5164# tests run on this system so they can be shared between configure
5165# scripts and configure runs.  It is not useful on other systems.
5166# If it contains results you don't want to keep, you may remove or edit it.
5167#
5168# By default, configure uses ./config.cache as the cache file,
5169# creating it if it does not exist already.  You can give configure
5170# the --cache-file=FILE option to use a different cache file; that is
5171# what configure does when it calls configure scripts in
5172# subdirectories, so they share the cache.
5173# Giving --cache-file=/dev/null disables caching, for debugging configure.
5174# config.status only pays attention to the cache file if you give it the
5175# --recheck option to rerun configure.
5176#
5177EOF
5178# The following way of writing the cache mishandles newlines in values,
5179# but we know of no workaround that is simple, portable, and efficient.
5180# So, don't put newlines in cache variables' values.
5181# Ultrix sh set writes to stderr and can't be redirected directly,
5182# and sets the high bit in the cache file unless we assign to the vars.
5183(set) 2>&1 |
5184  case `(ac_space=' '; set) 2>&1` in
5185  *ac_space=\ *)
5186    # `set' does not quote correctly, so add quotes (double-quote substitution
5187    # turns \\\\ into \\, and sed turns \\ into \).
5188    sed -n \
5189      -e "s/'/'\\\\''/g" \
5190      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5191    ;;
5192  *)
5193    # `set' quotes correctly as required by POSIX, so do not add quotes.
5194    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5195    ;;
5196  esac >> confcache
5197if cmp -s $cache_file confcache; then
5198  :
5199else
5200  if test -w $cache_file; then
5201    echo "updating cache $cache_file"
5202    cat confcache > $cache_file
5203  else
5204    echo "not updating unwritable cache $cache_file"
5205  fi
5206fi
5207rm -f confcache
5208
5209trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5210
5211test "x$prefix" = xNONE && prefix=$ac_default_prefix
5212# Let make expand exec_prefix.
5213test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5214
5215# Any assignment to VPATH causes Sun make to only execute
5216# the first set of double-colon rules, so remove it if not needed.
5217# If there is a colon in the path, we need to keep it.
5218if test "x$srcdir" = x.; then
5219  ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5220fi
5221
5222trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5223
5224DEFS=-DHAVE_CONFIG_H
5225
5226# Without the "./", some shells look in PATH for config.status.
5227: ${CONFIG_STATUS=./config.status}
5228
5229echo creating $CONFIG_STATUS
5230rm -f $CONFIG_STATUS
5231cat > $CONFIG_STATUS <<EOF
5232#! /bin/sh
5233# Generated automatically by configure.
5234# Run this file to recreate the current configuration.
5235# This directory was configured as follows,
5236# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5237#
5238# $0 $ac_configure_args
5239#
5240# Compiler output produced by configure, useful for debugging
5241# configure, is in ./config.log if it exists.
5242
5243ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5244for ac_option
5245do
5246  case "\$ac_option" in
5247  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5248    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5249    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5250  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5251    echo "$CONFIG_STATUS generated by autoconf version 2.12"
5252    exit 0 ;;
5253  -help | --help | --hel | --he | --h)
5254    echo "\$ac_cs_usage"; exit 0 ;;
5255  *) echo "\$ac_cs_usage"; exit 1 ;;
5256  esac
5257done
5258
5259ac_given_srcdir=$srcdir
5260
5261trap 'rm -fr `echo "Makefile mod2.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5262EOF
5263cat >> $CONFIG_STATUS <<EOF
5264
5265# Protect against being on the right side of a sed subst in config.status.
5266sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5267 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5268$ac_vpsub
5269$extrasub
5270s%@CFLAGS@%$CFLAGS%g
5271s%@CPPFLAGS@%$CPPFLAGS%g
5272s%@CXXFLAGS@%$CXXFLAGS%g
5273s%@DEFS@%$DEFS%g
5274s%@LDFLAGS@%$LDFLAGS%g
5275s%@LIBS@%$LIBS%g
5276s%@exec_prefix@%$exec_prefix%g
5277s%@prefix@%$prefix%g
5278s%@program_transform_name@%$program_transform_name%g
5279s%@bindir@%$bindir%g
5280s%@sbindir@%$sbindir%g
5281s%@libexecdir@%$libexecdir%g
5282s%@datadir@%$datadir%g
5283s%@sysconfdir@%$sysconfdir%g
5284s%@sharedstatedir@%$sharedstatedir%g
5285s%@localstatedir@%$localstatedir%g
5286s%@libdir@%$libdir%g
5287s%@includedir@%$includedir%g
5288s%@oldincludedir@%$oldincludedir%g
5289s%@infodir@%$infodir%g
5290s%@mandir@%$mandir%g
5291s%@SINGUNAME@%$SINGUNAME%g
5292s%@SING_UNAME@%$SING_UNAME%g
5293s%@SINGULAR_VERSION@%$SINGULAR_VERSION%g
5294s%@CC@%$CC%g
5295s%@CPP@%$CPP%g
5296s%@CXX@%$CXX%g
5297s%@PIPE@%$PIPE%g
5298s%@CXXTEMPLFLAGS@%$CXXTEMPLFLAGS%g
5299s%@CXXNOOPTFLAGS@%$CXXNOOPTFLAGS%g
5300s%@STATIC_LDFLAGS@%$STATIC_LDFLAGS%g
5301s%@SET_MAKE@%$SET_MAKE%g
5302s%@SINGULAR@%$SINGULAR%g
5303s%@LEX@%$LEX%g
5304s%@BISON@%$BISON%g
5305s%@LN_S@%$LN_S%g
5306s%@ALLOCA@%$ALLOCA%g
5307s%@PERL5@%$PERL5%g
5308s%@LD_LIBC@%$LD_LIBC%g
5309s%@NEED_LIBS@%$NEED_LIBS%g
5310s%@LD_DYN_FLAGS@%$LD_DYN_FLAGS%g
5311
5312CEOF
5313EOF
5314
5315cat >> $CONFIG_STATUS <<\EOF
5316
5317# Split the substitutions into bite-sized pieces for seds with
5318# small command number limits, like on Digital OSF/1 and HP-UX.
5319ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5320ac_file=1 # Number of current file.
5321ac_beg=1 # First line for current file.
5322ac_end=$ac_max_sed_cmds # Line after last line for current file.
5323ac_more_lines=:
5324ac_sed_cmds=""
5325while $ac_more_lines; do
5326  if test $ac_beg -gt 1; then
5327    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5328  else
5329    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5330  fi
5331  if test ! -s conftest.s$ac_file; then
5332    ac_more_lines=false
5333    rm -f conftest.s$ac_file
5334  else
5335    if test -z "$ac_sed_cmds"; then
5336      ac_sed_cmds="sed -f conftest.s$ac_file"
5337    else
5338      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5339    fi
5340    ac_file=`expr $ac_file + 1`
5341    ac_beg=$ac_end
5342    ac_end=`expr $ac_end + $ac_max_sed_cmds`
5343  fi
5344done
5345if test -z "$ac_sed_cmds"; then
5346  ac_sed_cmds=cat
5347fi
5348EOF
5349
5350cat >> $CONFIG_STATUS <<EOF
5351
5352CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
5353EOF
5354cat >> $CONFIG_STATUS <<\EOF
5355for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5356  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5357  case "$ac_file" in
5358  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5359       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5360  *) ac_file_in="${ac_file}.in" ;;
5361  esac
5362
5363  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5364
5365  # Remove last slash and all that follows it.  Not all systems have dirname.
5366  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5367  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5368    # The file is in a subdirectory.
5369    test ! -d "$ac_dir" && mkdir "$ac_dir"
5370    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5371    # A "../" for each directory in $ac_dir_suffix.
5372    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5373  else
5374    ac_dir_suffix= ac_dots=
5375  fi
5376
5377  case "$ac_given_srcdir" in
5378  .)  srcdir=.
5379      if test -z "$ac_dots"; then top_srcdir=.
5380      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5381  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5382  *) # Relative path.
5383    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5384    top_srcdir="$ac_dots$ac_given_srcdir" ;;
5385  esac
5386
5387
5388  echo creating "$ac_file"
5389  rm -f "$ac_file"
5390  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5391  case "$ac_file" in
5392  *Makefile*) ac_comsub="1i\\
5393# $configure_input" ;;
5394  *) ac_comsub= ;;
5395  esac
5396
5397  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5398  sed -e "$ac_comsub
5399s%@configure_input@%$configure_input%g
5400s%@srcdir@%$srcdir%g
5401s%@top_srcdir@%$top_srcdir%g
5402" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5403fi; done
5404rm -f conftest.s*
5405
5406# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5407# NAME is the cpp macro being defined and VALUE is the value it is being given.
5408#
5409# ac_d sets the value in "#define NAME VALUE" lines.
5410ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
5411ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
5412ac_dC='\3'
5413ac_dD='%g'
5414# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
5415ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5416ac_uB='\([      ]\)%\1#\2define\3'
5417ac_uC=' '
5418ac_uD='\4%g'
5419# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
5420ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
5421ac_eB='$%\1#\2define\3'
5422ac_eC=' '
5423ac_eD='%g'
5424
5425if test "${CONFIG_HEADERS+set}" != set; then
5426EOF
5427cat >> $CONFIG_STATUS <<EOF
5428  CONFIG_HEADERS="mod2.h"
5429EOF
5430cat >> $CONFIG_STATUS <<\EOF
5431fi
5432for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
5433  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5434  case "$ac_file" in
5435  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5436       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5437  *) ac_file_in="${ac_file}.in" ;;
5438  esac
5439
5440  echo creating $ac_file
5441
5442  rm -f conftest.frag conftest.in conftest.out
5443  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5444  cat $ac_file_inputs > conftest.in
5445
5446EOF
5447
5448# Transform confdefs.h into a sed script conftest.vals that substitutes
5449# the proper values into config.h.in to produce config.h.  And first:
5450# Protect against being on the right side of a sed subst in config.status.
5451# Protect against being in an unquoted here document in config.status.
5452rm -f conftest.vals
5453cat > conftest.hdr <<\EOF
5454s/[\\&%]/\\&/g
5455s%[\\$`]%\\&%g
5456s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5457s%ac_d%ac_u%gp
5458s%ac_u%ac_e%gp
5459EOF
5460sed -n -f conftest.hdr confdefs.h > conftest.vals
5461rm -f conftest.hdr
5462
5463# This sed command replaces #undef with comments.  This is necessary, for
5464# example, in the case of _POSIX_SOURCE, which is predefined and required
5465# on some systems where configure will not decide to define it.
5466cat >> conftest.vals <<\EOF
5467s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5468EOF
5469
5470# Break up conftest.vals because some shells have a limit on
5471# the size of here documents, and old seds have small limits too.
5472
5473rm -f conftest.tail
5474while :
5475do
5476  ac_lines=`grep -c . conftest.vals`
5477  # grep -c gives empty output for an empty file on some AIX systems.
5478  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
5479  # Write a limited-size here document to conftest.frag.
5480  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
5481  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
5482  echo 'CEOF
5483  sed -f conftest.frag conftest.in > conftest.out
5484  rm -f conftest.in
5485  mv conftest.out conftest.in
5486' >> $CONFIG_STATUS
5487  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
5488  rm -f conftest.vals
5489  mv conftest.tail conftest.vals
5490done
5491rm -f conftest.vals
5492
5493cat >> $CONFIG_STATUS <<\EOF
5494  rm -f conftest.frag conftest.h
5495  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
5496  cat conftest.in >> conftest.h
5497  rm -f conftest.in
5498  if cmp -s $ac_file conftest.h 2>/dev/null; then
5499    echo "$ac_file is unchanged"
5500    rm -f conftest.h
5501  else
5502    # Remove last slash and all that follows it.  Not all systems have dirname.
5503      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5504      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5505      # The file is in a subdirectory.
5506      test ! -d "$ac_dir" && mkdir "$ac_dir"
5507    fi
5508    rm -f $ac_file
5509    mv conftest.h $ac_file
5510  fi
5511fi; done
5512
5513EOF
5514cat >> $CONFIG_STATUS <<EOF
5515
5516EOF
5517cat >> $CONFIG_STATUS <<\EOF
5518\
5519 if test "$CONFIG_HEADERS"; then echo timestamp > stamp-h; fi
5520exit 0
5521EOF
5522chmod +x $CONFIG_STATUS
5523rm -fr confdefs* $ac_clean_files
5524test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
5525
5526
5527
5528
5529
Note: See TracBrowser for help on using the repository browser.