[SCM] 2D CAD system branch, upstream, updated. upstream/1.0.0_beta5-1-gd7004c1
Scott Howard
showard314 at gmail.com
Tue Mar 8 03:47:18 UTC 2011
The following commit has been merged in the upstream branch:
commit d7004c107066e874b20c7d5249d84c6e28b76544
Author: Scott Howard <showard314 at gmail.com>
Date: Mon Mar 7 22:46:24 2011 -0500
Imported Upstream version 1.0.0~beta5
diff --git a/fparser/Makefile b/fparser/Makefile
deleted file mode 100644
index 83c2535..0000000
--- a/fparser/Makefile
+++ /dev/null
@@ -1,113 +0,0 @@
-#
-#
-# Makefile for fparser
-#
-#
-
-#
-# fparser installation directories
-#
-#LIBDIR = /usr/local/lib
-#INCDIR = /usr/local/include/fparser
-VERSION = 2.51
-
-#LIBDIR = $(HOME)/local/lib
-#INCDIR = $(HOME)/local/include/fparser
-
-PREFIX ?= /usr
-
-LIBDIR = $(DESTDIR)/$(PREFIX)/lib
-INCDIR = $(DESTDIR)/$(PREFIX)/include/fparser
-
-#
-#------------------------ do not edit ------------------------
-#
-SHELL = /bin/sh
-
-CC = gcc
-CXX = gcc
-CFLAGS = -I./src -g -O2 -I/usr/X11/include -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DUNIX=1 -DSTDC_HEADERS=1
-INSTALL = /opt/local/bin/ginstall -c
-INSTALL_DATA = ${INSTALL} -m 644
-FIND = find
-MAKEDEPEND = makedepend
-AR = ar
-ARFLAGS = -rs
-
-BASE_DIR = ./src
-
-BASE_SRC = \
- $(BASE_DIR)/fparser.cpp
-
-BASE_INS = \
- $(BASE_DIR)/fparser.h
-
-SRC = $(BASE_SRC)
-OBJ = $(SRC:.cpp=.o)
-
-INS = $(BASE_INS)
-
-.cpp.o:
- $(CXX) $(CFLAGS) -c $< -o $@
-
-
-all: prepare ./lib/libfparser.a
-
-prepare:
- test -d ./include || mkdir -p ./include
- -( cd ./include; rm -f *.h; \
- for hf in `find ../src -name '*.h'`; do \
- if [ "x$$OS" = "xWindows_NT" ]; then \
- cp "$$hf" .; \
- else \
- ln -s "$$hf" 2> /dev/null; \
- fi \
- done )
-
-shared: ./lib/libfparser.so.$(VERSION)
- @echo
-
-./lib/libfparser.a: $(OBJ)
- test -d ./lib || mkdir ./lib
- $(AR) $(ARFLAGS) ./lib/libfparser.a $(OBJ)
-
-./lib/libfparser.so.$(VERSION): $(OBJ)
- test -d ./lib || mkdir ./lib
- $(CC) -p -shared -o ./lib/libfparser.so.$(VERSION) $(OBJ) -lc -lm
- -(cd ./lib ; ln -s libfparser.so.$(VERSION) libfparser.so)
-
-install: ./lib/libfparser.a
- test -d $(LIBDIR) || mkdir -p $(LIBDIR)
- test -d $(INCDIR) || mkdir -p $(INCDIR)
- $(INSTALL_DATA) ./lib/libfparser.a $(LIBDIR)
- #-(ln -s $(LIBDIR)/libfparser.a $(LIBDIR)/libfparser.a)
- for IFILE in $(INS); do \
- $(INSTALL_DATA) $$IFILE $(INCDIR); \
- done
-
-install-shared: ./lib/libfparser.so.$(VERSION)
- test -d $(LIBDIR) || mkdir -p $(LIBDIR)
- test -d $(INCDIR) || mkdir -p $(INCDIR)
- #$(INSTALL_DATA) ./lib/libfparser.so.$(VERSION) $(LIBDIR)
- -(ln -s $(LIBDIR)/libfparser.so.$(VERSION) $(LIBDIR)/libfparser.so)
- for IFILE in $(INS); do \
- $(INSTALL_DATA) $$IFILE $(INCDIR); \
- done
-
-clean:
- -rm -f $(OBJ)
- -rm -f ./lib/lib* Makefile.bak
- -rm -f ./include/fparser/*.h
- -$(FIND) . -name "*~" -exec rm -f {} \;
- -rm -f ./lib/libfparser.$(VERSION).a
-
-distclean: clean
- -rm -f Makefile configure
-
-depend:
- $(MAKEDEPEND) -- $(CFLAGS) -- $(SRC)
- @echo
- @echo "Run 'make' to build fparser library."
- @echo
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/fparser/Makefile.in b/fparser/Makefile.in
deleted file mode 100644
index 52660bb..0000000
--- a/fparser/Makefile.in
+++ /dev/null
@@ -1,113 +0,0 @@
-#
-#
-# Makefile for fparser
-#
-#
-
-#
-# fparser installation directories
-#
-#LIBDIR = @prefix@/lib
-#INCDIR = @prefix@/include/fparser
-VERSION = 2.51
-
-#LIBDIR = $(HOME)/local/lib
-#INCDIR = $(HOME)/local/include/fparser
-
-PREFIX ?= /usr
-
-LIBDIR = $(DESTDIR)/$(PREFIX)/lib
-INCDIR = $(DESTDIR)/$(PREFIX)/include/fparser
-
-#
-#------------------------ do not edit ------------------------
-#
-SHELL = /bin/sh
-
-CC = @CC@
-CXX = gcc
-CFLAGS = -I./src @CFLAGS@ @DEFS@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-FIND = @FIND@
-MAKEDEPEND = @MAKEDEPEND@
-AR = ar
-ARFLAGS = -rs
-
-BASE_DIR = ./src
-
-BASE_SRC = \
- $(BASE_DIR)/fparser.cpp
-
-BASE_INS = \
- $(BASE_DIR)/fparser.h
-
-SRC = $(BASE_SRC)
-OBJ = $(SRC:.cpp=.o)
-
-INS = $(BASE_INS)
-
-.cpp.o:
- $(CXX) $(CFLAGS) -c $< -o $@
-
-
-all: prepare ./lib/libfparser.a
-
-prepare:
- test -d ./include || mkdir -p ./include
- -( cd ./include; rm -f *.h; \
- for hf in `find ../src -name '*.h'`; do \
- if [ "x$$OS" = "xWindows_NT" ]; then \
- cp "$$hf" .; \
- else \
- ln -s "$$hf" 2> /dev/null; \
- fi \
- done )
-
-shared: ./lib/libfparser.so.$(VERSION)
- @echo
-
-./lib/libfparser.a: $(OBJ)
- test -d ./lib || mkdir ./lib
- $(AR) $(ARFLAGS) ./lib/libfparser.a $(OBJ)
-
-./lib/libfparser.so.$(VERSION): $(OBJ)
- test -d ./lib || mkdir ./lib
- $(CC) -p -shared -o ./lib/libfparser.so.$(VERSION) $(OBJ) -lc -lm
- -(cd ./lib ; ln -s libfparser.so.$(VERSION) libfparser.so)
-
-install: ./lib/libfparser.a
- test -d $(LIBDIR) || mkdir -p $(LIBDIR)
- test -d $(INCDIR) || mkdir -p $(INCDIR)
- $(INSTALL_DATA) ./lib/libfparser.a $(LIBDIR)
- #-(ln -s $(LIBDIR)/libfparser.a $(LIBDIR)/libfparser.a)
- for IFILE in $(INS); do \
- $(INSTALL_DATA) $$IFILE $(INCDIR); \
- done
-
-install-shared: ./lib/libfparser.so.$(VERSION)
- test -d $(LIBDIR) || mkdir -p $(LIBDIR)
- test -d $(INCDIR) || mkdir -p $(INCDIR)
- #$(INSTALL_DATA) ./lib/libfparser.so.$(VERSION) $(LIBDIR)
- -(ln -s $(LIBDIR)/libfparser.so.$(VERSION) $(LIBDIR)/libfparser.so)
- for IFILE in $(INS); do \
- $(INSTALL_DATA) $$IFILE $(INCDIR); \
- done
-
-clean:
- -rm -f $(OBJ)
- -rm -f ./lib/lib* Makefile.bak
- -rm -f ./include/fparser/*.h
- -$(FIND) . -name "*~" -exec rm -f {} \;
- -rm -f ./lib/libfparser.$(VERSION).a
-
-distclean: clean
- -rm -f Makefile configure
-
-depend:
- $(MAKEDEPEND) -- $(CFLAGS) -- $(SRC)
- @echo
- @echo "Run 'make' to build fparser library."
- @echo
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/fparser/configure b/fparser/configure
deleted file mode 100755
index ecbfe0e..0000000
--- a/fparser/configure
+++ /dev/null
@@ -1,4876 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
-#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_config_libobj_dir=.
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="src/fparser.cpp"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA FIND MAKEDEPEND X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS EGREP LIBOBJS LTLIBOBJS'
-ac_subst_files=''
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-ac_prev=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_option in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
- fi
-fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
- { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
- cat <<_ACEOF
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
-_ACEOF
-
- cat <<\_ACEOF
-
-X features:
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-x use the X Window System
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
- done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
- cat <<\_ACEOF
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit 0
-fi
-exec 5>config.log
-cat >&5 <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_sep=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-{
- (set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
- *)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-}
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- sed "/^$/d" confdefs.h | sort
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core core.* *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
- ' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-PRODUCT=fparser
-
-#
-# check cannonical system name
-#
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f $ac_dir/shtool; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
- { (exit 1); exit 1; }; }
-fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
- { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
- ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
- ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-case "$host" in
-*-linux-gnu ) cat >>confdefs.h <<\_ACEOF
-#define LINUX 1
-_ACEOF
- ;;
- *-aix* ) cat >>confdefs.h <<\_ACEOF
-#define AIX 1
-_ACEOF
- ;;
- * ) cat >>confdefs.h <<\_ACEOF
-#define UNIX 1
-_ACEOF
- ;;
-esac
-
-#
-# check C compiler, preprocesor, etc.
-#
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
-
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- test -n "$ac_ct_CC" && break
-done
-
- CC=$ac_ct_CC
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
- * )
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
- *)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL=$ac_install_sh
- fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-# Extract the first word of "find", so it can be a program name with args.
-set dummy find; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_FIND+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$FIND"; then
- ac_cv_prog_FIND="$FIND" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_FIND="find"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_FIND" && ac_cv_prog_FIND=":"
-fi
-fi
-FIND=$ac_cv_prog_FIND
-if test -n "$FIND"; then
- echo "$as_me:$LINENO: result: $FIND" >&5
-echo "${ECHO_T}$FIND" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-# Extract the first word of "makedepend", so it can be a program name with args.
-set dummy makedepend; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_MAKEDEPEND+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$MAKEDEPEND"; then
- ac_cv_prog_MAKEDEPEND="$MAKEDEPEND" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MAKEDEPEND="makedepend"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_MAKEDEPEND" && ac_cv_prog_MAKEDEPEND=":"
-fi
-fi
-MAKEDEPEND=$ac_cv_prog_MAKEDEPEND
-if test -n "$MAKEDEPEND"; then
- echo "$as_me:$LINENO: result: $MAKEDEPEND" >&5
-echo "${ECHO_T}$MAKEDEPEND" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-
-#
-# Try to locate the X Window System include files and libraries
-# and add /usr/local to include and lib path and add -lm (for testing)
-#
-
-
-echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&6
-
-
-# Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
- withval="$with_x"
-
-fi;
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
- # The user explicitly disabled X.
- have_x=disabled
-else
- if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
- # Both variables are already set.
- have_x=yes
- else
- if test "${ac_cv_have_x+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -fr conftest.dir
-if mkdir conftest.dir; then
- cd conftest.dir
- # Make sure to not put "make" in the Imakefile rules, since we grep it out.
- cat >Imakefile <<'_ACEOF'
-acfindx:
- @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-_ACEOF
- if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
- # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
- eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
- for ac_extension in a so sl; do
- if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
- test -f $ac_im_libdir/libX11.$ac_extension; then
- ac_im_usrlibdir=$ac_im_libdir; break
- fi
- done
- # Screen out bogus values from the imake configuration. They are
- # bogus both because they are the default anyway, and because
- # using them would break gcc on systems where it needs fixed includes.
- case $ac_im_incroot in
- /usr/include) ;;
- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
- esac
- case $ac_im_usrlibdir in
- /usr/lib | /lib) ;;
- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
- esac
- fi
- cd ..
- rm -fr conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Intrinsic.h.
- # First, try using that file with no special directory specified.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Intrinsic.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Intrinsic.h"; then
- ac_x_includes=$ac_dir
- break
- fi
-done
-fi
-rm -f conftest.err conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
- # Check for the libraries.
- # See if we find them without any special options.
- # Don't add to $LIBS permanently.
- ac_save_LIBS=$LIBS
- LIBS="-lXt $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <X11/Intrinsic.h>
-int
-main ()
-{
-XtMalloc (0)
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-LIBS=$ac_save_LIBS
-for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
- # Don't even attempt the hair of trying to link an X program!
- for ac_extension in a so sl; do
- if test -r $ac_dir/libXt.$ac_extension; then
- ac_x_libraries=$ac_dir
- break 2
- fi
- done
-done
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
- # Didn't find X anywhere. Cache the known absence of X.
- ac_cv_have_x="have_x=no"
-else
- # Record where we found X for the cache.
- ac_cv_have_x="have_x=yes \
- ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi
-fi
-
- fi
- eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
- echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$have_x" >&6
- no_x=yes
-else
- # If each of the values was on the command line, it overrides each guess.
- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
- # Update the cache value to reflect the command line values.
- ac_cv_have_x="have_x=yes \
- ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
- echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
-fi
-
-if test "$no_x" = yes; then
- # Not all programs may use this symbol, but it does not hurt to define it.
-
-cat >>confdefs.h <<\_ACEOF
-#define X_DISPLAY_MISSING 1
-_ACEOF
-
- X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
- if test -n "$x_includes"; then
- X_CFLAGS="$X_CFLAGS -I$x_includes"
- fi
-
- # It would also be nice to do this for all -L options, not just this one.
- if test -n "$x_libraries"; then
- X_LIBS="$X_LIBS -L$x_libraries"
- # For Solaris; some versions of Sun CC require a space after -R and
- # others require no space. Words are not sufficient . . . .
- case `(uname -sr) 2>/dev/null` in
- "SunOS 5"*)
- echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
-echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_R_nospace=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_R_nospace=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- if test $ac_R_nospace = yes; then
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- X_LIBS="$X_LIBS -R$x_libraries"
- else
- LIBS="$ac_xsave_LIBS -R $x_libraries"
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_R_space=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_R_space=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- if test $ac_R_space = yes; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- X_LIBS="$X_LIBS -R $x_libraries"
- else
- echo "$as_me:$LINENO: result: neither works" >&5
-echo "${ECHO_T}neither works" >&6
- fi
- fi
- LIBS=$ac_xsave_LIBS
- esac
- fi
-
- # Check for system-dependent libraries X programs must link with.
- # Do this before checking for the system-independent R6 libraries
- # (-lICE), since we may need -lsocket or whatever for X linking.
-
- if test "$ISC" = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
- else
- # Martyn Johnson says this is needed for Ultrix, if the X
- # libraries were built with DECnet support. And Karl Berry says
- # the Alpha needs dnet_stub (dnet does not exist).
- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char XOpenDisplay ();
-int
-main ()
-{
-XOpenDisplay ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
-echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dnet_ntoa ();
-int
-main ()
-{
-dnet_ntoa ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dnet_dnet_ntoa=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
-if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
- if test $ac_cv_lib_dnet_dnet_ntoa = no; then
- echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
-echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
-if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dnet_ntoa ();
-int
-main ()
-{
-dnet_ntoa ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
-if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
- fi
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- LIBS="$ac_xsave_LIBS"
-
- # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
- # to get the SysV transport functions.
- # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
- # needs -lnsl.
- # The nsl library prevents programs from opening the X display
- # on Irix 5.2, according to T.E. Dickey.
- # The functions gethostbyname, getservbyname, and inet_addr are
- # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
- echo "$as_me:$LINENO: checking for gethostbyname" >&5
-echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
-if test "${ac_cv_func_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-char (*f) () = gethostbyname;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != gethostbyname;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_gethostbyname=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
-
- if test $ac_cv_func_gethostbyname = no; then
- echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-int
-main ()
-{
-gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_nsl_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
- if test $ac_cv_lib_nsl_gethostbyname = no; then
- echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
-echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
-if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-int
-main ()
-{
-gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_bsd_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
-if test $ac_cv_lib_bsd_gethostbyname = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
- fi
- fi
-
- # lieder at skyler.mavd.honeywell.com says without -lsocket,
- # socket/setsockopt and other routines are undefined under SCO ODT
- # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
- # on later versions), says Simon Leinen: it contains gethostby*
- # variants that don't use the name server (or something). -lsocket
- # must be given before -lnsl if both are needed. We assume that
- # if connect needs -lnsl, so does gethostbyname.
- echo "$as_me:$LINENO: checking for connect" >&5
-echo $ECHO_N "checking for connect... $ECHO_C" >&6
-if test "${ac_cv_func_connect+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char connect (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char connect ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_connect) || defined (__stub___connect)
-choke me
-#else
-char (*f) () = connect;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != connect;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_connect=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_connect=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
-echo "${ECHO_T}$ac_cv_func_connect" >&6
-
- if test $ac_cv_func_connect = no; then
- echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
-echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_connect+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char connect ();
-int
-main ()
-{
-connect ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_socket_connect=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_socket_connect=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
-if test $ac_cv_lib_socket_connect = yes; then
- X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
- fi
-
- # Guillermo Gomez says -lposix is necessary on A/UX.
- echo "$as_me:$LINENO: checking for remove" >&5
-echo $ECHO_N "checking for remove... $ECHO_C" >&6
-if test "${ac_cv_func_remove+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char remove (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char remove ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_remove) || defined (__stub___remove)
-choke me
-#else
-char (*f) () = remove;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != remove;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_remove=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_remove=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
-echo "${ECHO_T}$ac_cv_func_remove" >&6
-
- if test $ac_cv_func_remove = no; then
- echo "$as_me:$LINENO: checking for remove in -lposix" >&5
-echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
-if test "${ac_cv_lib_posix_remove+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char remove ();
-int
-main ()
-{
-remove ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_posix_remove=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_posix_remove=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
-echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
-if test $ac_cv_lib_posix_remove = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
- fi
-
- # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
- echo "$as_me:$LINENO: checking for shmat" >&5
-echo $ECHO_N "checking for shmat... $ECHO_C" >&6
-if test "${ac_cv_func_shmat+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shmat (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shmat ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_shmat) || defined (__stub___shmat)
-choke me
-#else
-char (*f) () = shmat;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shmat;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_shmat=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shmat=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
-echo "${ECHO_T}$ac_cv_func_shmat" >&6
-
- if test $ac_cv_func_shmat = no; then
- echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
-echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
-if test "${ac_cv_lib_ipc_shmat+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shmat ();
-int
-main ()
-{
-shmat ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_ipc_shmat=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_ipc_shmat=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
-echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
-if test $ac_cv_lib_ipc_shmat = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
- fi
- fi
-
- # Check for libraries that X11R6 Xt/Xaw programs need.
- ac_save_LDFLAGS=$LDFLAGS
- test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
- # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
- # check for ICE first), but we must link in the order -lSM -lICE or
- # we get undefined symbols. So assume we have SM if we have ICE.
- # These have to be linked with before -lX11, unlike the other
- # libraries we check for below, so use a different variable.
- # John Interrante, Karl Berry
- echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
-echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
-if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char IceConnectionNumber ();
-int
-main ()
-{
-IceConnectionNumber ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_ICE_IceConnectionNumber=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
-if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
- X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
- LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-#CFLAGS="$CFLAGS $X_CFLAGS -I/usr/local/include"
-CFLAGS="$CFLAGS $X_CFLAGS"
-LDFLAGS="$LDFLAGS $X_LIBS -L/usr/local/lib"
-
-
-#
-# Declare variables which we want substituted in the Makefile.in's
-#
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-
-#
-# finally create makefiles using Makefile.in
-#
-echo
- ac_config_files="$ac_config_files Makefile"
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
- (set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
- ;;
- esac;
-} |
- sed '
- t clear
- : clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
- cat confcache >$cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then we branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-cat >confdef2opt.sed <<\_ACEOF
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
-t quote
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
-t quote
-d
-: quote
-s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
-s,\[,\\&,g
-s,\],\\&,g
-s,\$,$$,g
-p
-_ACEOF
-# We use echo to avoid assuming a particular line-breaking character.
-# The extra dot is to prevent the shell from consuming trailing
-# line-breaks from the sub-command output. A line-break within
-# single-quotes doesn't work because, if this script is created in a
-# platform that uses two characters for line-breaks (e.g., DOS), tr
-# would break.
-ac_LF_and_DOT=`echo; echo .`
-DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
-rm -f confdef2opt.sed
-
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
-fi
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
- sed '
- N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
- t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
- ' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
- # Exit status is that of the last command.
- exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
- as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- as_mkdir_p=false
-fi
-
-as_executable_p="test -f"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
-exec 6>&1
-
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
-
-Configuration files:
-$config_files
-
-Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.57,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- -*)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
- esac
-
- case $ac_option in
- # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1" ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-
-
-
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_config_target in $ac_config_targets
-do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
-#
-# CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at CPP@,$CPP,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at FIND@,$FIND,;t t
-s, at MAKEDEPEND@,$MAKEDEPEND,;t t
-s, at X_CFLAGS@,$X_CFLAGS,;t t
-s, at X_PRE_LIBS@,$X_PRE_LIBS,;t t
-s, at X_LIBS@,$X_LIBS,;t t
-s, at X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
-s, at EGREP@,$EGREP,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
- fi
-fi # test -n "$CONFIG_FILES"
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
-
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
- esac
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo $f;;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
-done
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
-echo
-echo "Run 'make depend' to create dependencies."
-echo
diff --git a/fparser/configure.in b/fparser/configure.in
deleted file mode 100644
index 5c75737..0000000
--- a/fparser/configure.in
+++ /dev/null
@@ -1,51 +0,0 @@
-
-#
-# Check for one project file
-#
-AC_INIT(src/fparser.cpp)
-
-PRODUCT=fparser
-
-#
-# check cannonical system name
-#
-AC_CANONICAL_HOST
-case "$host" in
-*-linux-gnu ) AC_DEFINE(LINUX) ;;
- *-aix* ) AC_DEFINE(AIX) ;;
- * ) AC_DEFINE(UNIX) ;;
-esac
-
-#
-# check C compiler, preprocesor, etc.
-#
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_INSTALL
-AC_CHECK_PROG(FIND, find, find, :)
-AC_CHECK_PROG(MAKEDEPEND, makedepend, makedepend, :)
-
-#
-# Try to locate the X Window System include files and libraries
-# and add /usr/local to include and lib path and add -lm (for testing)
-#
-AC_PATH_XTRA
-#CFLAGS="$CFLAGS $X_CFLAGS -I/usr/local/include"
-CFLAGS="$CFLAGS $X_CFLAGS"
-LDFLAGS="$LDFLAGS $X_LIBS -L/usr/local/lib"
-
-
-#
-# Declare variables which we want substituted in the Makefile.in's
-#
-AC_HEADER_STDC
-
-#
-# finally create makefiles using Makefile.in
-#
-echo
-AC_OUTPUT(Makefile)
-
-echo
-echo "Run 'make depend' to create dependencies."
-echo
diff --git a/fparser/install-sh b/fparser/install-sh
deleted file mode 100755
index 5871924..0000000
--- a/fparser/install-sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/fparser/src/fparser.cpp b/fparser/src/fparser.cpp
deleted file mode 100644
index 1c44c77..0000000
--- a/fparser/src/fparser.cpp
+++ /dev/null
@@ -1,3032 +0,0 @@
-/****************************************************************************
-**
-** This file is part of the LibreCAD project, a 2D CAD program
-**
-** Copyright (C) 2010 R. van Twisk (librecad at rvt.dds.nl)
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-**
-** This copyright notice MUST APPEAR in all copies of the script!
-**
-**********************************************************************/
-
-// Comment out the following line if your compiler supports the (non-standard)
-// asinh, acosh and atanh functions and you want them to be supported. If
-// you are not sure, just leave it (those function will then not be supported).
-#define NO_ASINH
-
-
-// Uncomment the following line to disable the eval() function if it could
-// be too dangerous in the target application:
-//#define DISABLE_EVAL
-
-
-// Comment this line out if you are not going to use the optimizer and want
-// a slightly smaller library. The Optimize() method can still be called,
-// but it will not do anything.
-// If you are unsure, just leave it. It won't slow down the other parts of
-// the library.
-#if !defined(_MSC_VER)
-#define SUPPORT_OPTIMIZER
-#endif
-
-
-//============================================================================
-
-#include "fparser.h"
-
-#include <cstdlib>
-#include <cstring>
-#include <cctype>
-#include <cmath>
-#include <new>
-#include <algorithm>
-
-using namespace std;
-
-#ifndef M_PI
-#define M_PI 3.1415926535897932384626433832795
-#endif
-
-namespace
-{
-// The functions must be in alphabetical order:
- enum OPCODE
- {
- cAbs, cAcos,
-#ifndef NO_ASINH
- cAcosh,
-#endif
- cAsin,
-#ifndef NO_ASINH
- cAsinh,
-#endif
- cAtan,
- cAtan2,
-#ifndef NO_ASINH
- cAtanh,
-#endif
- cCeil, cCos, cCosh, cCot, cCsc,
-#ifndef DISABLE_EVAL
- cEval,
-#endif
- cExp, cFloor, cIf, cInt, cLog, cLog10, cMax, cMin,
- cSec, cSin, cSinh, cSqrt, cTan, cTanh,
-
-// These do not need any ordering:
- cImmed, cJump,
- cNeg, cAdd, cSub, cMul, cDiv, cMod, cPow,
- cEqual, cLess, cGreater, cAnd, cOr,
-
- cDeg, cRad,
-
- cFCall, cPCall,
-
-#ifdef SUPPORT_OPTIMIZER
- cVar, cDup, cInv,
-#endif
-
- VarBegin
- };
-
- struct FuncDefinition
- {
- const char* name;
- unsigned nameLength;
- unsigned opcode;
- unsigned params;
-
- // This is basically strcmp(), but taking 'nameLength' as string
- // length (not ending '\0'):
- bool operator<(const FuncDefinition& rhs) const
- {
- for(unsigned i = 0; i < nameLength; ++i)
- {
- if(i == rhs.nameLength) return false;
- const char c1 = name[i], c2 = rhs.name[i];
- if(c1 < c2) return true;
- if(c2 < c1) return false;
- }
- return nameLength < rhs.nameLength;
- }
- };
-
-
-// This list must be in alphabetical order:
- const FuncDefinition Functions[]=
- {
- { "abs", 3, cAbs, 1 },
- { "acos", 4, cAcos, 1 },
-#ifndef NO_ASINH
- { "acosh", 5, cAcosh, 1 },
-#endif
- { "asin", 4, cAsin, 1 },
-#ifndef NO_ASINH
- { "asinh", 5, cAsinh, 1 },
-#endif
- { "atan", 4, cAtan, 1 },
- { "atan2", 5, cAtan2, 2 },
-#ifndef NO_ASINH
- { "atanh", 5, cAtanh, 1 },
-#endif
- { "ceil", 4, cCeil, 1 },
- { "cos", 3, cCos, 1 },
- { "cosh", 4, cCosh, 1 },
- { "cot", 3, cCot, 1 },
- { "csc", 3, cCsc, 1 },
-#ifndef DISABLE_EVAL
- { "eval", 4, cEval, 0 },
-#endif
- { "exp", 3, cExp, 1 },
- { "floor", 5, cFloor, 1 },
- { "if", 2, cIf, 0 },
- { "int", 3, cInt, 1 },
- { "log", 3, cLog, 1 },
- { "log10", 5, cLog10, 1 },
- { "max", 3, cMax, 2 },
- { "min", 3, cMin, 2 },
- { "sec", 3, cSec, 1 },
- { "sin", 3, cSin, 1 },
- { "sinh", 4, cSinh, 1 },
- { "sqrt", 4, cSqrt, 1 },
- { "tan", 3, cTan, 1 },
- { "tanh", 4, cTanh, 1 }
- };
-
- const unsigned FUNC_AMOUNT = sizeof(Functions)/sizeof(Functions[0]);
-
-
- // Returns a pointer to the FuncDefinition instance which 'name' is
- // the same as the one given by 'F'. If no such function name exists,
- // returns 0.
- inline const FuncDefinition* FindFunction(const char* F)
- {
- FuncDefinition func = { F, 0, 0, 0 };
- while(isalnum(F[func.nameLength])) ++func.nameLength;
- if(func.nameLength)
- {
- const FuncDefinition* found =
- lower_bound(Functions, Functions+FUNC_AMOUNT, func);
- if(found == Functions+FUNC_AMOUNT || func < *found)
- return 0;
- return found;
- }
- return 0;
- }
-};
-
-//---------------------------------------------------------------------------
-// Constructors and destructors
-//---------------------------------------------------------------------------
-//===========================================================================
-FunctionParser::FunctionParser():
- ParseErrorType(-1), EvalErrorType(0)
-{}
-
-FunctionParser::~FunctionParser()
-{}
-
-FunctionParser::CompiledCode::CompiledCode():
- ByteCode(0), ByteCodeSize(0),
- Immed(0), ImmedSize(0),
- Stack(0), StackSize(0)
-{}
-
-FunctionParser::CompiledCode::~CompiledCode()
-{
- if(ByteCode) { delete[] ByteCode; ByteCode=0; }
- if(Immed) { delete[] Immed; Immed=0; }
- if(Stack) { delete[] Stack; Stack=0; }
-}
-
-
-//---------------------------------------------------------------------------
-// Function parsing
-//---------------------------------------------------------------------------
-//===========================================================================
-namespace
-{
- // Error messages returned by ErrorMsg():
- const char* ParseErrorMessage[]=
- {
- "Syntax error", // 0
- "Mismatched parenthesis", // 1
- "Missing ')'", // 2
- "Empty parentheses", // 3
- "Syntax error: Operator expected", // 4
- "Not enough memory", // 5
- "An unexpected error ocurred. Please make a full bug report "
- "to warp at iki.fi", // 6
- "Syntax error in parameter 'Vars' given to "
- "FunctionParser::Parse()", // 7
- "Illegal number of parameters to function", // 8
- "Syntax error: Premature end of string", // 9
- "Syntax error: Expecting ( after function", // 10
- ""
- };
-
-
- // Parse variables
- bool ParseVars(const string& Vars, map<string, unsigned>& dest)
- {
- unsigned varNumber = VarBegin;
- unsigned ind1 = 0, ind2;
-
- while(ind1 < Vars.size())
- {
- if(!isalpha(Vars[ind1]) && Vars[ind1]!='_') return false;
- for(ind2=ind1+1; ind2<Vars.size() && Vars[ind2]!=','; ++ind2)
- if(!isalnum(Vars[ind2]) && Vars[ind2]!='_') return false;
- const string varName = Vars.substr(ind1, ind2-ind1);
-
- if(dest.insert(make_pair(varName, varNumber++)).second == false)
- return false;
-
- ind1 = ind2+1;
- }
- return true;
- }
-};
-
-bool FunctionParser::isValidName(const std::string& name)
-{
- if(name.empty() || (!isalpha(name[0]) && name[0] != '_')) return false;
- for(unsigned i=0; i<name.size(); ++i)
- if(!isalnum(name[i]) && name[i] != '_') return false;
-
- if(FindFunction(name.c_str())) return false;
-
- return true;
-}
-
-
-// Constants:
-bool FunctionParser::AddConstant(const string& name, double value)
-{
- if(isValidName(name))
- {
- const char* n = name.c_str();
- if(FindVariable(n, FuncParserNames) != FuncParserNames.end() ||
- FindVariable(n, FuncPtrNames) != FuncPtrNames.end())
- return false;
-
- Constants[name] = value;
- return true;
- }
- return false;
-}
-
-// Function pointers
-bool FunctionParser::AddFunction(const std::string& name,
- FunctionPtr func, unsigned paramsAmount)
-{
- if(paramsAmount == 0) return false; // Currently must be at least one
-
- if(isValidName(name))
- {
- const char* n = name.c_str();
- if(FindVariable(n, FuncParserNames) != FuncParserNames.end() ||
- FindConstant(n) != Constants.end())
- return false;
-
- FuncPtrNames[name] = FuncPtrs.size();
- FuncPtrs.push_back(FuncPtrData(func, paramsAmount));
- return true;
- }
- return false;
-}
-
-bool FunctionParser::checkRecursiveLinking(const FunctionParser* fp)
-{
- if(fp == this) return true;
- for(unsigned i=0; i<fp->FuncParsers.size(); ++i)
- if(checkRecursiveLinking(fp->FuncParsers[i])) return true;
- return false;
-}
-
-bool FunctionParser::AddFunction(const std::string& name,
- FunctionParser& parser)
-{
- if(parser.varAmount == 0) return false; // Currently must be at least one
-
- if(isValidName(name))
- {
- const char* n = name.c_str();
- if(FindVariable(n, FuncPtrNames) != FuncPtrNames.end() ||
- FindConstant(n) != Constants.end())
- return false;
-
- if(checkRecursiveLinking(&parser)) return false;
-
- FuncParserNames[name] = FuncParsers.size();
- FuncParsers.push_back(&parser);
- return true;
- }
- return false;
-}
-
-
-
-// Main parsing function
-// ---------------------
-int FunctionParser::Parse(const std::string& Function,
- const std::string& Vars,
- bool useDegrees)
-{
- Variables.clear();
-
- if(!ParseVars(Vars, Variables))
- {
- ParseErrorType = 7;
- return Function.size();
- }
- varAmount = Variables.size(); // this is for Eval()
-
- const char* Func = Function.c_str();
-
- ParseErrorType = -1;
-
- int Result = CheckSyntax(Func);
- if(Result>=0) return Result;
-
- useDegreeConversion = useDegrees;
- if(!Compile(Func)) return Function.size();
-
- Variables.clear();
-
- ParseErrorType = -1;
- return -1;
-}
-
-namespace
-{
- // Is given char an operator?
- inline bool IsOperator(int c)
- {
- return strchr("+-*/%^=<>&|,",c)!=NULL;
- }
-
- // skip whitespace
- inline void sws(const char* F, int& Ind)
- {
- while(F[Ind] && F[Ind] == ' ') ++Ind;
- }
-};
-
-// Returns an iterator to the variable with the same name as 'F', or to
-// Variables.end() if no such variable exists:
-inline FunctionParser::VarMap_t::const_iterator
-FunctionParser::FindVariable(const char* F, const VarMap_t& vars)
-{
- if(vars.size())
- {
- unsigned ind = 0;
- while(isalnum(F[ind]) || F[ind] == '_') ++ind;
- if(ind)
- {
- string name(F, ind);
- return vars.find(name);
- }
- }
- return vars.end();
-}
-
-inline FunctionParser::ConstMap_t::const_iterator
-FunctionParser::FindConstant(const char* F)
-{
- if(Constants.size())
- {
- unsigned ind = 0;
- while(isalnum(F[ind]) || F[ind] == '_') ++ind;
- if(ind)
- {
- string name(F, ind);
- return Constants.find(name);
- }
- }
- return Constants.end();
-}
-
-//---------------------------------------------------------------------------
-// Check function string syntax
-// ----------------------------
-int FunctionParser::CheckSyntax(const char* Function)
-{
- int Ind=0, ParenthCnt=0, c;
- char* Ptr;
-
- while(true)
- {
- sws(Function, Ind);
- c=Function[Ind];
-
-// Check for valid operand (must appear)
-
- // Check for leading -
- if(c=='-') { sws(Function, ++Ind); c=Function[Ind]; }
- if(c==0) { ParseErrorType=9; return Ind; }
-
- // Check for math function
- bool foundFunc = false;
- const FuncDefinition* fptr = FindFunction(&Function[Ind]);
- if(fptr)
- {
- Ind += fptr->nameLength;
- foundFunc = true;
- }
- else
- {
- // Check for user-defined function
- VarMap_t::const_iterator fIter =
- FindVariable(&Function[Ind], FuncPtrNames);
- if(fIter != FuncPtrNames.end())
- {
- Ind += fIter->first.size();
- foundFunc = true;
- }
- else
- {
- VarMap_t::const_iterator pIter =
- FindVariable(&Function[Ind], FuncParserNames);
- if(pIter != FuncParserNames.end())
- {
- Ind += pIter->first.size();
- foundFunc = true;
- }
- }
- }
-
- if(foundFunc)
- {
- sws(Function, Ind);
- c = Function[Ind];
- if(c!='(') { ParseErrorType=10; return Ind; }
- }
-
- // Check for opening parenthesis
- if(c=='(')
- {
- ++ParenthCnt;
- sws(Function, ++Ind);
- if(Function[Ind]==')') { ParseErrorType=3; return Ind; }
- continue;
- }
-
- // Check for number
- if(isdigit(c) || (c=='.' && isdigit(Function[Ind+1])))
- {
- strtod(&Function[Ind], &Ptr);
- Ind += int(Ptr-&Function[Ind]);
- sws(Function, Ind);
- c = Function[Ind];
- }
- else
- { // Check for variable
- VarMap_t::const_iterator vIter =
- FindVariable(&Function[Ind], Variables);
- if(vIter != Variables.end())
- Ind += vIter->first.size();
- else
- {
- // Check for constant
- ConstMap_t::const_iterator cIter =
- FindConstant(&Function[Ind]);
- if(cIter != Constants.end())
- Ind += cIter->first.size();
- else
- { ParseErrorType=0; return Ind; }
- }
- sws(Function, Ind);
- c = Function[Ind];
- }
-
- // Check for closing parenthesis
- while(c==')')
- {
- if((--ParenthCnt)<0) { ParseErrorType=1; return Ind; }
- sws(Function, ++Ind);
- c=Function[Ind];
- }
-
-// If we get here, we have a legal operand and now a legal operator or
-// end of string must follow
-
- // Check for EOS
- if(c==0) break; // The only way to end the checking loop without error
- // Check for operator
- if(!IsOperator(c)) { ParseErrorType=4; return Ind; }
-
-// If we get here, we have an operand and an operator; the next loop will
-// check for another operand (must appear)
- ++Ind;
- } // while
-
- // Check that all opened parentheses are also closed
- if(ParenthCnt>0) { ParseErrorType=2; return Ind; }
-
-// The string is ok
- ParseErrorType=-1;
- return -1;
-}
-
-
-// Compile function string to bytecode
-// -----------------------------------
-bool FunctionParser::Compile(const char* Function)
-{
- if(Comp.ByteCode) { delete[] Comp.ByteCode; Comp.ByteCode=0; }
- if(Comp.Immed) { delete[] Comp.Immed; Comp.Immed=0; }
- if(Comp.Stack) { delete[] Comp.Stack; Comp.Stack=0; }
-
- vector<unsigned> byteCode; byteCode.reserve(1024);
- tempByteCode = &byteCode;
-
- vector<double> immed; immed.reserve(1024);
- tempImmed = &immed;
-
- Comp.StackSize = Comp.StackPtr = 0;
-
- CompileExpression(Function, 0);
- if(ParseErrorType >= 0) return false;
-
- Comp.ByteCodeSize = byteCode.size();
- Comp.ImmedSize = immed.size();
-
- if(Comp.ByteCodeSize)
- {
- Comp.ByteCode = new unsigned[Comp.ByteCodeSize];
- memcpy(Comp.ByteCode, &byteCode[0],
- sizeof(unsigned)*Comp.ByteCodeSize);
- }
- if(Comp.ImmedSize)
- {
- Comp.Immed = new double[Comp.ImmedSize];
- memcpy(Comp.Immed, &immed[0],
- sizeof(double)*Comp.ImmedSize);
- }
- if(Comp.StackSize)
- Comp.Stack = new double[Comp.StackSize];
-
- return true;
-}
-
-
-inline void FunctionParser::AddCompiledByte(unsigned c)
-{
- tempByteCode->push_back(c);
-}
-
-inline void FunctionParser::AddImmediate(double i)
-{
- tempImmed->push_back(i);
-}
-
-inline void FunctionParser::AddFunctionOpcode(unsigned opcode)
-{
- if(useDegreeConversion)
- switch(opcode)
- {
- case cCos:
- case cCosh:
- case cCot:
- case cCsc:
- case cSec:
- case cSin:
- case cSinh:
- case cTan:
- case cTanh:
- AddCompiledByte(cRad);
- }
-
- AddCompiledByte(opcode);
-
- if(useDegreeConversion)
- switch(opcode)
- {
- case cAcos:
-#ifndef NO_ASINH
- case cAcosh:
- case cAsinh:
- case cAtanh:
-#endif
- case cAsin:
- case cAtan:
- case cAtan2:
- AddCompiledByte(cDeg);
- }
-}
-
-// Compile if()
-int FunctionParser::CompileIf(const char* F, int ind)
-{
- int ind2 = CompileExpression(F, ind, true); // condition
- sws(F, ind2);
- if(F[ind2] != ',') { ParseErrorType=8; return ind2; }
- AddCompiledByte(cIf);
- unsigned curByteCodeSize = tempByteCode->size();
- AddCompiledByte(0); // Jump index; to be set later
- AddCompiledByte(0); // Immed jump index; to be set later
-
- --Comp.StackPtr;
-
- ind2 = CompileExpression(F, ind2+1, true); // then
- sws(F, ind2);
- if(F[ind2] != ',') { ParseErrorType=8; return ind2; }
- AddCompiledByte(cJump);
- unsigned curByteCodeSize2 = tempByteCode->size();
- unsigned curImmedSize2 = tempImmed->size();
- AddCompiledByte(0); // Jump index; to be set later
- AddCompiledByte(0); // Immed jump index; to be set later
-
- --Comp.StackPtr;
-
- ind2 = CompileExpression(F, ind2+1, true); // else
- sws(F, ind2);
- if(F[ind2] != ')') { ParseErrorType=8; return ind2; }
-
- // Set jump indices
- (*tempByteCode)[curByteCodeSize] = curByteCodeSize2+1;
- (*tempByteCode)[curByteCodeSize+1] = curImmedSize2;
- (*tempByteCode)[curByteCodeSize2] = tempByteCode->size()-1;
- (*tempByteCode)[curByteCodeSize2+1] = tempImmed->size();
-
- return ind2+1;
-}
-
-int FunctionParser::CompileFunctionParams(const char* F, int ind,
- unsigned requiredParams)
-{
- unsigned curStackPtr = Comp.StackPtr;
- int ind2 = CompileExpression(F, ind);
-
- if(Comp.StackPtr != curStackPtr+requiredParams)
- { ParseErrorType=8; return ind; }
-
- Comp.StackPtr -= requiredParams - 1;
- sws(F, ind2);
- return ind2+1; // F[ind2] is ')'
-}
-
-// Compiles element
-int FunctionParser::CompileElement(const char* F, int ind)
-{
- sws(F, ind);
- char c = F[ind];
-
- if(c == '(')
- {
- ind = CompileExpression(F, ind+1);
- sws(F, ind);
- return ind+1; // F[ind] is ')'
- }
- else if(c == '-')
- {
- char c2 = F[ind+1];
- if(!isdigit(c2) && c2!='.')
- {
- int ind2 = CompileElement(F, ind+1);
- AddCompiledByte(cNeg);
- return ind2;
- }
- }
-
- if(isdigit(c) || c=='.' || c=='-') // Number
- {
- const char* startPtr = &F[ind];
- char* endPtr;
- double val = strtod(startPtr, &endPtr);
- AddImmediate(val);
- AddCompiledByte(cImmed);
- ++Comp.StackPtr; if(Comp.StackPtr>Comp.StackSize) Comp.StackSize++;
- return ind+(endPtr-startPtr);
- }
-
- if(isalpha(c) || c == '_') // Function, variable or constant
- {
- const FuncDefinition* func = FindFunction(F+ind);
- if(func) // is function
- {
- int ind2 = ind + func->nameLength;
- sws(F, ind2); // F[ind2] is '('
- if(strcmp(func->name, "if") == 0) // "if" is a special case
- {
- return CompileIf(F, ind2+1);
- }
-
-#ifndef DISABLE_EVAL
- unsigned requiredParams =
- strcmp(func->name, "eval") == 0 ?
- Variables.size() : func->params;
-#else
- unsigned requiredParams = func->params;
-#endif
- ind2 = CompileFunctionParams(F, ind2+1, requiredParams);
- AddFunctionOpcode(func->opcode);
- return ind2; // F[ind2-1] is ')'
- }
-
- VarMap_t::const_iterator vIter = FindVariable(F+ind, Variables);
- if(vIter != Variables.end()) // is variable
- {
- AddCompiledByte(vIter->second);
- ++Comp.StackPtr; if(Comp.StackPtr>Comp.StackSize) Comp.StackSize++;
- return ind + vIter->first.size();
- }
-
- ConstMap_t::const_iterator cIter = FindConstant(F+ind);
- if(cIter != Constants.end()) // is constant
- {
- AddImmediate(cIter->second);
- AddCompiledByte(cImmed);
- ++Comp.StackPtr; if(Comp.StackPtr>Comp.StackSize) Comp.StackSize++;
- return ind + cIter->first.size();
- }
-
- VarMap_t::const_iterator fIter = FindVariable(F+ind, FuncPtrNames);
- if(fIter != FuncPtrNames.end()) // is user-defined function pointer
- {
- unsigned index = fIter->second;
-
- int ind2 = ind + fIter->first.length();
- sws(F, ind2); // F[ind2] is '('
-
- ind2 = CompileFunctionParams(F, ind2+1, FuncPtrs[index].params);
-
- AddCompiledByte(cFCall);
- AddCompiledByte(index);
- return ind2;
- }
-
- VarMap_t::const_iterator pIter = FindVariable(F+ind, FuncParserNames);
- if(pIter != FuncParserNames.end()) // is user-defined function parser
- {
- unsigned index = pIter->second;
-
- int ind2 = ind + pIter->first.length();
- sws(F, ind2); // F[ind2] is '('
-
- ind2 = CompileFunctionParams(F, ind2+1,
- FuncParsers[index]->varAmount);
-
- AddCompiledByte(cPCall);
- AddCompiledByte(index);
- return ind2;
- }
- }
-
- ParseErrorType = 6;
- return ind;
-}
-
-// Compiles '^'
-int FunctionParser::CompilePow(const char* F, int ind)
-{
- int ind2 = CompileElement(F, ind);
- sws(F, ind2);
-
- while(F[ind2] == '^')
- {
- ind2 = CompileElement(F, ind2+1);
- sws(F, ind2);
- AddCompiledByte(cPow);
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles '*', '/' and '%'
-int FunctionParser::CompileMult(const char* F, int ind)
-{
- int ind2 = CompilePow(F, ind);
- sws(F, ind2);
- char op;
-
- while((op = F[ind2]) == '*' || op == '/' || op == '%')
- {
- ind2 = CompilePow(F, ind2+1);
- sws(F, ind2);
- switch(op)
- {
- case '*': AddCompiledByte(cMul); break;
- case '/': AddCompiledByte(cDiv); break;
- case '%': AddCompiledByte(cMod); break;
- }
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles '+' and '-'
-int FunctionParser::CompileAddition(const char* F, int ind)
-{
- int ind2 = CompileMult(F, ind);
- sws(F, ind2);
- char op;
-
- while((op = F[ind2]) == '+' || op == '-')
- {
- ind2 = CompileMult(F, ind2+1);
- sws(F, ind2);
- AddCompiledByte(op=='+' ? cAdd : cSub);
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles '=', '<' and '>'
-int FunctionParser::CompileComparison(const char* F, int ind)
-{
- int ind2 = CompileAddition(F, ind);
- sws(F, ind2);
- char op;
-
- while((op = F[ind2]) == '=' || op == '<' || op == '>')
- {
- ind2 = CompileAddition(F, ind2+1);
- sws(F, ind2);
- switch(op)
- {
- case '=': AddCompiledByte(cEqual); break;
- case '<': AddCompiledByte(cLess); break;
- case '>': AddCompiledByte(cGreater); break;
- }
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles '&'
-int FunctionParser::CompileAnd(const char* F, int ind)
-{
- int ind2 = CompileComparison(F, ind);
- sws(F, ind2);
-
- while(F[ind2] == '&')
- {
- ind2 = CompileComparison(F, ind2+1);
- sws(F, ind2);
- AddCompiledByte(cAnd);
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles '|'
-int FunctionParser::CompileOr(const char* F, int ind)
-{
- int ind2 = CompileAnd(F, ind);
- sws(F, ind2);
-
- while(F[ind2] == '|')
- {
- ind2 = CompileAnd(F, ind2+1);
- sws(F, ind2);
- AddCompiledByte(cOr);
- --Comp.StackPtr;
- }
-
- return ind2;
-}
-
-// Compiles ','
-int FunctionParser::CompileExpression(const char* F, int ind, bool stopAtComma)
-{
- int ind2 = CompileOr(F, ind);
- sws(F, ind2);
-
- if(stopAtComma) return ind2;
-
- while(F[ind2] == ',')
- {
- ind2 = CompileOr(F, ind2+1);
- sws(F, ind2);
- }
-
- return ind2;
-}
-
-
-// Return parse error message
-// --------------------------
-const char* FunctionParser::ErrorMsg(void) const
-{
- if(ParseErrorType>=0) return ParseErrorMessage[ParseErrorType];
- return 0;
-}
-
-//---------------------------------------------------------------------------
-// Function evaluation
-//---------------------------------------------------------------------------
-//===========================================================================
-namespace
-{
- inline int doubleToInt(double d)
- {
- return d<0 ? -int((-d)+.5) : int(d+.5);
- }
-
- inline double Min(double d1, double d2)
- {
- return d1<d2 ? d1 : d2;
- }
- inline double Max(double d1, double d2)
- {
- return d1>d2 ? d1 : d2;
- }
-
-
- inline double DegreesToRadians(double degrees)
- {
- return degrees*(M_PI/180.0);
- }
- inline double RadiansToDegrees(double radians)
- {
- return radians*(180.0/M_PI);
- }
-}
-
-double FunctionParser::Eval(const double* Vars)
-{
- unsigned IP, DP=0;
- int SP=-1;
-
- for(IP=0; IP<Comp.ByteCodeSize; IP++)
- {
- switch(Comp.ByteCode[IP])
- {
-// Functions:
- case cAbs: Comp.Stack[SP]=fabs(Comp.Stack[SP]); break;
- case cAcos: if(Comp.Stack[SP]<-1 || Comp.Stack[SP]>1)
- { EvalErrorType=4; return 0; }
- Comp.Stack[SP]=acos(Comp.Stack[SP]); break;
-#ifndef NO_ASINH
- case cAcosh: Comp.Stack[SP]=acosh(Comp.Stack[SP]); break;
-#endif
- case cAsin: if(Comp.Stack[SP]<-1 || Comp.Stack[SP]>1)
- { EvalErrorType=4; return 0; }
- Comp.Stack[SP]=asin(Comp.Stack[SP]); break;
-#ifndef NO_ASINH
- case cAsinh: Comp.Stack[SP]=asinh(Comp.Stack[SP]); break;
-#endif
- case cAtan: Comp.Stack[SP]=atan(Comp.Stack[SP]); break;
- case cAtan2: Comp.Stack[SP-1]=atan2(Comp.Stack[SP-1],Comp.Stack[SP]);
- SP--; break;
-#ifndef NO_ASINH
- case cAtanh: Comp.Stack[SP]=atanh(Comp.Stack[SP]); break;
-#endif
- case cCeil: Comp.Stack[SP]=ceil(Comp.Stack[SP]); break;
- case cCos: Comp.Stack[SP]=cos(Comp.Stack[SP]); break;
- case cCosh: Comp.Stack[SP]=cosh(Comp.Stack[SP]); break;
-
- case cCot:
- {
- double t = tan(Comp.Stack[SP]);
- if(t == 0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP] = 1/t; break;
- }
- case cCsc:
- {
- double s = sin(Comp.Stack[SP]);
- if(s == 0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP] = 1/s; break;
- }
-
-
-#ifndef DISABLE_EVAL
- case cEval:
- {
- double* tmpStack = Comp.Stack;
- Comp.Stack = new double[Comp.StackSize];
- double retVal = Eval(&tmpStack[SP-varAmount+1]);
- delete[] Comp.Stack;
- Comp.Stack = tmpStack;
- SP -= varAmount-1;
- Comp.Stack[SP] = retVal;
- break;
- }
-#endif
-
- case cExp: Comp.Stack[SP]=exp(Comp.Stack[SP]); break;
- case cFloor: Comp.Stack[SP]=floor(Comp.Stack[SP]); break;
-
- case cIf:
- {
- unsigned jumpAddr = Comp.ByteCode[++IP];
- unsigned immedAddr = Comp.ByteCode[++IP];
- if(doubleToInt(Comp.Stack[SP]) == 0)
- {
- IP = jumpAddr;
- DP = immedAddr;
- }
- SP--; break;
- }
-
- case cInt: Comp.Stack[SP]=floor(Comp.Stack[SP]+.5); break;
- case cLog: if(Comp.Stack[SP]<=0) { EvalErrorType=3; return 0; }
- Comp.Stack[SP]=log(Comp.Stack[SP]); break;
- case cLog10: if(Comp.Stack[SP]<=0) { EvalErrorType=3; return 0; }
- Comp.Stack[SP]=log10(Comp.Stack[SP]); break;
- case cMax: Comp.Stack[SP-1]=Max(Comp.Stack[SP-1],Comp.Stack[SP]);
- SP--; break;
- case cMin: Comp.Stack[SP-1]=Min(Comp.Stack[SP-1],Comp.Stack[SP]);
- SP--; break;
- case cSec:
- {
- double c = cos(Comp.Stack[SP]);
- if(c == 0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP] = 1/c; break;
- }
- case cSin: Comp.Stack[SP]=sin(Comp.Stack[SP]); break;
- case cSinh: Comp.Stack[SP]=sinh(Comp.Stack[SP]); break;
- case cSqrt: if(Comp.Stack[SP]<0) { EvalErrorType=2; return 0; }
- Comp.Stack[SP]=sqrt(Comp.Stack[SP]); break;
- case cTan: Comp.Stack[SP]=tan(Comp.Stack[SP]); break;
- case cTanh: Comp.Stack[SP]=tanh(Comp.Stack[SP]); break;
-
-
-// Misc:
- case cImmed: Comp.Stack[++SP]=Comp.Immed[DP++]; break;
- case cJump: DP = Comp.ByteCode[IP+2];
- IP = Comp.ByteCode[IP+1];
- break;
-
-// Operators:
- case cNeg: Comp.Stack[SP]=-Comp.Stack[SP]; break;
- case cAdd: Comp.Stack[SP-1]+=Comp.Stack[SP]; SP--; break;
- case cSub: Comp.Stack[SP-1]-=Comp.Stack[SP]; SP--; break;
- case cMul: Comp.Stack[SP-1]*=Comp.Stack[SP]; SP--; break;
- case cDiv: if(Comp.Stack[SP]==0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP-1]/=Comp.Stack[SP]; SP--; break;
- case cMod: if(Comp.Stack[SP]==0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP-1]=fmod(Comp.Stack[SP-1],Comp.Stack[SP]);
- SP--; break;
- case cPow: Comp.Stack[SP-1]=pow(Comp.Stack[SP-1],Comp.Stack[SP]);
- SP--; break;
-
- case cEqual: Comp.Stack[SP-1] = (Comp.Stack[SP-1]==Comp.Stack[SP]);
- SP--; break;
- case cLess: Comp.Stack[SP-1] = (Comp.Stack[SP-1]<Comp.Stack[SP]);
- SP--; break;
- case cGreater: Comp.Stack[SP-1] = (Comp.Stack[SP-1]>Comp.Stack[SP]);
- SP--; break;
- case cAnd: Comp.Stack[SP-1] =
- (doubleToInt(Comp.Stack[SP-1]) &&
- doubleToInt(Comp.Stack[SP]));
- SP--; break;
- case cOr: Comp.Stack[SP-1] =
- (doubleToInt(Comp.Stack[SP-1]) ||
- doubleToInt(Comp.Stack[SP]));
- SP--; break;
-
-// Degrees-radians conversion:
- case cDeg: Comp.Stack[SP]=RadiansToDegrees(Comp.Stack[SP]); break;
- case cRad: Comp.Stack[SP]=DegreesToRadians(Comp.Stack[SP]); break;
-
-// User-defined function calls:
- case cFCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- unsigned params = FuncPtrs[index].params;
- double retVal =
- FuncPtrs[index].ptr(&Comp.Stack[SP-params+1]);
- SP -= params-1;
- Comp.Stack[SP] = retVal;
- break;
- }
-
- case cPCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- unsigned params = FuncParsers[index]->varAmount;
- double retVal =
- FuncParsers[index]->Eval(&Comp.Stack[SP-params+1]);
- SP -= params-1;
- Comp.Stack[SP] = retVal;
- break;
- }
-
-
-#ifdef SUPPORT_OPTIMIZER
- case cVar: break; // Paranoia. These should never exist
- case cDup: Comp.Stack[SP+1]=Comp.Stack[SP]; ++SP; break;
- case cInv:
- if(Comp.Stack[SP]==0.0) { EvalErrorType=1; return 0; }
- Comp.Stack[SP]=1.0/Comp.Stack[SP];
- break;
-#endif
-
-// Variables:
- default:
- Comp.Stack[++SP]=Vars[Comp.ByteCode[IP]-VarBegin];
- }
- }
-
- EvalErrorType=0;
- return Comp.Stack[SP];
-}
-
-
-void FunctionParser::PrintByteCode(std::ostream& dest) const
-{
- for(unsigned IP=0, DP=0; IP<Comp.ByteCodeSize; IP++)
- {
- dest.width(8); dest.fill('0'); hex(dest); //uppercase(dest);
- dest << IP << ": ";
-
- unsigned opcode = Comp.ByteCode[IP];
-
- switch(opcode)
- {
- case cIf:
- dest << "jz\t";
- dest.width(8); dest.fill('0'); hex(dest); //uppercase(dest);
- dest << Comp.ByteCode[IP+1]+1 << endl;
- IP += 2;
- break;
-
- case cJump:
- dest << "jump\t";
- dest.width(8); dest.fill('0'); hex(dest); //uppercase(dest);
- dest << Comp.ByteCode[IP+1]+1 << endl;
- IP += 2;
- break;
- case cImmed:
- dest.precision(10);
- dest << "push\t" << Comp.Immed[DP++] << endl;
- break;
-
- case cFCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- VarMap_t::const_iterator iter = FuncPtrNames.begin();
- while(iter->second != index) ++iter;
- dest << "call\t" << iter->first << endl;
- break;
- }
-
- case cPCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- VarMap_t::const_iterator iter = FuncParserNames.begin();
- while(iter->second != index) ++iter;
- dest << "call\t" << iter->first << endl;
- break;
- }
-
- default:
- if(opcode < VarBegin)
- {
- string n;
- switch(opcode)
- {
- case cNeg: n = "neg"; break;
- case cAdd: n = "add"; break;
- case cSub: n = "sub"; break;
- case cMul: n = "mul"; break;
- case cDiv: n = "div"; break;
- case cMod: n = "mod"; break;
- case cPow: n = "pow"; break;
- case cEqual: n = "eq"; break;
- case cLess: n = "lt"; break;
- case cGreater: n = "gt"; break;
- case cAnd: n = "and"; break;
- case cOr: n = "or"; break;
- case cDeg: n = "deg"; break;
- case cRad: n = "rad"; break;
-
-#ifndef DISABLE_EVAL
- case cEval: n = "call\t0"; break;
-#endif
-
-#ifdef SUPPORT_OPTIMIZER
- case cVar: n = "(var)"; break;
- case cDup: n = "dup"; break;
- case cInv: n = "inv"; break;
-#endif
-
- default: n = Functions[opcode-cAbs].name;
- }
- dest << n << endl;
- }
- else
- {
- dest << "push\tVar" << opcode-VarBegin << endl;
- }
- }
- }
-}
-
-
-
-//========================================================================
-// Optimization code was contributed by Bisqwit (http://iki.fi/bisqwit/)
-//========================================================================
-#ifdef SUPPORT_OPTIMIZER
-
-#include <list>
-#include <utility>
-
-#define CONSTANT_E 2.71828182845904509080 // exp(1)
-#define CONSTANT_PI M_PI // atan2(0,-1)
-#define CONSTANT_L10 2.30258509299404590109 // log(10)
-#define CONSTANT_L10I 0.43429448190325176116 // 1/log(10)
-#define CONSTANT_L10E CONSTANT_L10I // log10(e)
-#define CONSTANT_L10EI CONSTANT_L10 // 1/log10(e)
-#define CONSTANT_DR (180.0 / M_PI) // 180/pi
-#define CONSTANT_RD (M_PI / 180.0) // pi/180
-
-class compres
-{
- // states: 0=false, 1=true, 2=unknown
-public:
- compres(bool b) : state(b) {}
- compres(char v) : state(v) {}
- // is it?
- operator bool() const { return state != 0; }
- // is it not?
- bool operator! () const { return state != 1; }
- bool operator==(bool b) const { return state != !b; }
- bool operator!=(bool b) const { return state != b; }
-private:
- char state;
-};
-
-namespace {
-const compres maybe = (char)2;
-}
-
-class SubTree
-{
- struct CodeTree *tree;
- bool sign; // Only possible when parent is cAdd or cMul
-
- inline void flipsign() { sign = !sign; }
-public:
- SubTree();
- SubTree(double value);
- SubTree(const SubTree &b);
- SubTree(const struct CodeTree &b);
-
- ~SubTree();
- const SubTree &operator= (const SubTree &b);
- const SubTree &operator= (const CodeTree &b);
-
- bool getsign() const { return sign; }
-
- const struct CodeTree* operator-> () const { return tree; }
- const struct CodeTree& operator* () const { return *tree; }
- struct CodeTree* operator-> () { return tree; }
- struct CodeTree& operator* () { return *tree; }
-
- bool operator< (const SubTree& b) const;
- bool operator== (const SubTree& b) const;
- void Negate(); // Note: Parent must be cAdd
- void Invert(); // Note: Parent must be cMul
-
- void CheckConstNeg();
- void CheckConstInv();
-};
-
-namespace {
-bool IsNegate(const SubTree &p1, const SubTree &p2);
-bool IsInverse(const SubTree &p1, const SubTree &p2);
-}
-
-typedef list<SubTree> paramlist;
-
-struct CodeTreeData
-{
- paramlist args;
-
-private:
- unsigned op; // Operation
- double value; // In case of cImmed
- unsigned var; // In case of cVar
- unsigned funcno; // In case of cFCall, cPCall
-
-public:
- CodeTreeData() : op(cAdd) {}
- ~CodeTreeData() {}
-
- void SetOp(unsigned newop) { op=newop; }
- void SetFuncNo(unsigned newno) { funcno=newno; }
- unsigned GetFuncNo() const { return funcno; }
-
- bool IsFunc() const { return op == cFCall || op == cPCall; }
- bool IsImmed() const { return op == cImmed; }
- bool IsVar() const { return op == cVar; }
- inline unsigned GetOp() const { return op; }
- inline double GetImmed() const
- {
- return value;
- }
- inline unsigned GetVar() const
- {
- return var;
- }
-
- void AddParam(const SubTree &p)
- {
- args.push_back(p);
- }
- void SetVar(unsigned v)
- {
- args.clear();
- op = cVar;
- var = v;
- }
- void SetImmed(double v)
- {
- args.clear();
- op = cImmed;
- value = orig = v;
- inverted = negated = false;
- }
- void NegateImmed()
- {
- negated = !negated;
- UpdateValue();
- }
- void InvertImmed()
- {
- inverted = !inverted;
- UpdateValue();
- }
-
- bool IsOriginal() const { return !(IsInverted() || IsNegated()); }
- bool IsInverted() const { return inverted; }
- bool IsNegated() const { return negated; }
- bool IsInvertedOriginal() const { return IsInverted() && !IsNegated(); }
- bool IsNegatedOriginal() const { return !IsInverted() && IsNegated(); }
-
-private:
- void UpdateValue()
- {
- value = orig;
- if(IsInverted()) { value = 1.0 / value;
- // FIXME: potential divide by zero.
- }
- if(IsNegated()) value = -value;
- }
-
- double orig;
- bool inverted;
- bool negated;
-protected:
- // Ensure we don't accidentally copy this
- void operator=(const CodeTreeData &b);
-};
-
-class CodeTreeDataPtr
-{
- typedef pair<CodeTreeData, unsigned> p_t;
- typedef p_t* pp;
- mutable pp p;
-
- void Alloc() const { ++p->second; }
- void Dealloc() const { if(!--p->second) delete p; p = 0; }
-
- void PrepareForWrite()
- {
- // We're ready if we're the only owner.
- if(p->second == 1) return;
-
- // Then make a clone.
- p_t *newtree = new p_t(p->first, 1);
- // Forget the old
- Dealloc();
- // Keep the new
- p = newtree;
- }
-
-public:
- CodeTreeDataPtr() : p(new p_t) { p->second = 1; }
- CodeTreeDataPtr(const CodeTreeDataPtr &b): p(b.p) { Alloc(); }
- ~CodeTreeDataPtr() { Dealloc(); }
- const CodeTreeDataPtr &operator= (const CodeTreeDataPtr &b)
- {
- b.Alloc();
- Dealloc();
- p = b.p;
- return *this;
- }
- const CodeTreeData *operator-> () const { return &p->first; }
- const CodeTreeData &operator* () const { return p->first; }
- CodeTreeData *operator-> () { PrepareForWrite(); return &p->first; }
- CodeTreeData &operator* () { PrepareForWrite(); return p->first; }
-
- void Shock();
-};
-
-#define CHECKCONSTNEG(item, op) \
- ((op)==cMul) \
- ? (item).CheckConstInv() \
- : (item).CheckConstNeg()
-
-struct CodeTree
-{
- CodeTreeDataPtr data;
-
-private:
- typedef paramlist::iterator pit;
- typedef paramlist::const_iterator pcit;
-
- template<unsigned v> inline void chk() const
- {
- }
-
-public:
- const pcit GetBegin() const { return data->args.begin(); }
- const pcit GetEnd() const { return data->args.end(); }
- const pit GetBegin() { return data->args.begin(); }
- const pit GetEnd() { return data->args.end(); }
- const SubTree& getp0() const { chk<1>();pcit tmp=GetBegin(); return *tmp; }
- const SubTree& getp1() const { chk<2>();pcit tmp=GetBegin(); ++tmp; return *tmp; }
- const SubTree& getp2() const { chk<3>();pcit tmp=GetBegin(); ++tmp; ++tmp; return *tmp; }
- unsigned GetArgCount() const { return data->args.size(); }
- void Erase(const pit p) { data->args.erase(p); }
-
- SubTree& getp0() { chk<1>();pit tmp=GetBegin(); return *tmp; }
- SubTree& getp1() { chk<2>();pit tmp=GetBegin(); ++tmp; return *tmp; }
- SubTree& getp2() { chk<3>();pit tmp=GetBegin(); ++tmp; ++tmp; return *tmp; }
-
- // set
- void SetImmed(double v) { data->SetImmed(v); }
- void SetOp(unsigned op) { data->SetOp(op); }
- void SetVar(unsigned v) { data->SetVar(v); }
- // get
- double GetImmed() const { return data->GetImmed(); }
- unsigned GetVar() const { return data->GetVar(); }
- unsigned GetOp() const { return data->GetOp(); }
- // test
- bool IsImmed() const { return data->IsImmed(); }
- bool IsVar() const { return data->IsVar(); }
- // act
- void AddParam(const SubTree &p) { data->AddParam(p); }
- void NegateImmed() { data->NegateImmed(); } // don't use when op!=cImmed
- void InvertImmed() { data->InvertImmed(); } // don't use when op!=cImmed
-
- compres NonZero() const { if(!IsImmed()) return maybe;
- return GetImmed() != 0.0; }
- compres IsPositive() const { if(!IsImmed()) return maybe;
- return GetImmed() > 0.0; }
-
-private:
- struct ConstList
- {
- double voidvalue;
- list<pit> cp;
- double value;
- unsigned size() const { return cp.size(); }
- };
- struct ConstList BuildConstList();
- void KillConst(const ConstList &cl)
- {
- for(list<pit>::const_iterator i=cl.cp.begin(); i!=cl.cp.end(); ++i)
- Erase(*i);
- }
- void FinishConst(const ConstList &cl)
- {
- if(cl.value != cl.voidvalue && cl.size() > 1) AddParam(cl.value);
- if(cl.value == cl.voidvalue || cl.size() > 1) KillConst(cl);
- }
-
-public:
- CodeTree() {}
- CodeTree(double v) { SetImmed(v); }
-
- CodeTree(unsigned op, const SubTree &p)
- {
- SetOp(op);
- AddParam(p);
- }
- CodeTree(unsigned op, const SubTree &p1, const SubTree &p2)
- {
- SetOp(op);
- AddParam(p1);
- AddParam(p2);
- }
-
- bool operator== (const CodeTree& b) const;
- bool operator< (const CodeTree& b) const;
-
-private:
- bool IsSortable() const
- {
- switch(GetOp())
- {
- case cAdd: case cMul:
- case cEqual:
- case cAnd: case cOr:
- case cMax: case cMin:
- return true;
- default:
- return false;
- }
- }
- void SortIfPossible()
- {
- if(IsSortable())
- {
- data->args.sort();
- }
- }
-
- void ReplaceWithConst(double value)
- {
- SetImmed(value);
-
- /* REMEMBER TO CALL CheckConstInv / CheckConstNeg
- * FOR PARENT SubTree, OR MAYHEM HAPPENS
- */
- }
-
- void ReplaceWith(const CodeTree &b)
- {
- // If b is child of *this, mayhem
- // happens. So we first make a clone
- // and then proceed with copy.
- CodeTreeDataPtr tmp = b.data;
- tmp.Shock();
- data = tmp;
- }
-
- void ReplaceWith(unsigned op, const SubTree &p)
- {
- ReplaceWith(CodeTree(op, p));
- }
-
- void ReplaceWith(unsigned op, const SubTree &p1, const SubTree &p2)
- {
- ReplaceWith(CodeTree(op, p1, p2));
- }
-
- void OptimizeConflict()
- {
- // This optimization does this: x-x = 0, x/x = 1, a+b-a = b.
-
- if(GetOp() == cAdd || GetOp() == cMul)
- {
- Redo:
- pit a, b;
- for(a=GetBegin(); a!=GetEnd(); ++a)
- {
- for(b=GetBegin(); ++b != GetEnd(); )
- {
- const SubTree &p1 = *a;
- const SubTree &p2 = *b;
-
- if(GetOp() == cMul ? IsInverse(p1,p2)
- : IsNegate(p1,p2))
- {
- // These parameters complement each others out
- Erase(b);
- Erase(a);
- goto Redo;
- }
- }
- }
- }
- OptimizeRedundant();
- }
-
- void OptimizeRedundant()
- {
- // This optimization does this: min()=0, max()=0, add()=0, mul()=1
-
- if(!GetArgCount())
- {
- if(GetOp() == cAdd || GetOp() == cMin || GetOp() == cMax)
- ReplaceWithConst(0);
- else if(GetOp() == cMul)
- ReplaceWithConst(1);
- return;
- }
-
- // And this: mul(x) = x, min(x) = x, max(x) = x, add(x) = x
-
- if(GetArgCount() == 1)
- {
- if(GetOp() == cMul || GetOp() == cAdd || GetOp() == cMin || GetOp() == cMax)
- if(!getp0().getsign())
- ReplaceWith(*getp0());
- }
-
- OptimizeDoubleNegations();
- }
-
- void OptimizeDoubleNegations()
- {
- if(GetOp() == cAdd)
- {
- // Eschew double negations
-
- // If any of the elements is cMul
- // and has a numeric constant, negate
- // the constant and negate sign.
-
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- SubTree &pa = *a;
- if(pa.getsign()
- && pa->GetOp() == cMul)
- {
- CodeTree &p = *pa;
- for(pit b=p.GetBegin();
- b!=p.GetEnd(); ++b)
- {
- SubTree &pb = *b;
- if(pb->IsImmed())
- {
- pb.Negate();
- pa.Negate();
- break;
- }
- }
- }
- }
- }
-
- if(GetOp() == cMul)
- {
- // If any of the elements is cPow
- // and has a numeric exponent, negate
- // the exponent and negate sign.
-
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- SubTree &pa = *a;
- if(pa.getsign() && pa->GetOp() == cPow)
- {
- CodeTree &p = *pa;
- if(p.getp1()->IsImmed())
- {
- // negate ok for pow when op=cImmed
- p.getp1().Negate();
- pa.Negate();
- }
- }
- }
- }
- }
-
- void OptimizeConstantMath1()
- {
- // This optimization does three things:
- // - For adding groups:
- // Constants are added together.
- // - For multiplying groups:
- // Constants are multiplied together.
- // - For function calls:
- // If all parameters are constants,
- // the call is replaced with constant value.
-
- // First, do this:
- OptimizeAddMulFlat();
-
- switch(GetOp())
- {
- case cAdd:
- {
- ConstList cl = BuildConstList();
- FinishConst(cl);
- break;
- }
- case cMul:
- {
- ConstList cl = BuildConstList();
-
- if(cl.value == 0.0) ReplaceWithConst(0.0);
- else FinishConst(cl);
-
- break;
- }
- #define ConstantUnaryFun(token, fun) \
- case token: { const SubTree &p0 = getp0(); \
- if(p0->IsImmed()) ReplaceWithConst(fun(p0->GetImmed())); \
- break; }
- #define ConstantBinaryFun(token, fun) \
- case token: { const SubTree &p0 = getp0(); \
- const SubTree &p1 = getp1(); \
- if(p0->IsImmed() && \
- p1->IsImmed()) ReplaceWithConst(fun(p0->GetImmed(), p1->GetImmed())); \
- break; }
-
- // FIXME: potential invalid parameters for functions
- // can cause exceptions here
-
- ConstantUnaryFun(cAbs, fabs);
- ConstantUnaryFun(cAcos, acos);
- ConstantUnaryFun(cAsin, asin);
- ConstantUnaryFun(cAtan, atan);
- ConstantUnaryFun(cCeil, ceil);
- ConstantUnaryFun(cCos, cos);
- ConstantUnaryFun(cCosh, cosh);
- ConstantUnaryFun(cFloor, floor);
- ConstantUnaryFun(cLog, log);
- ConstantUnaryFun(cSin, sin);
- ConstantUnaryFun(cSinh, sinh);
- ConstantUnaryFun(cTan, tan);
- ConstantUnaryFun(cTanh, tanh);
- ConstantBinaryFun(cAtan2, atan2);
- ConstantBinaryFun(cMax, Max);
- ConstantBinaryFun(cMin, Min);
- ConstantBinaryFun(cMod, fmod); // not a func, but belongs here too
- ConstantBinaryFun(cPow, pow);
-
- case cNeg:
- case cSub:
- case cDiv:
- /* Unreached (nonexistent operator)
- * TODO: internal error here?
- */
- break;
-
- case cCot:
- case cCsc:
- case cSec:
- case cDeg:
- case cRad:
- case cLog10:
- case cSqrt:
- case cExp:
- /* Unreached (nonexistent function)
- * TODO: internal error here?
- */
- break;
- }
-
- OptimizeConflict();
- }
-
- void OptimizeAddMulFlat()
- {
- // This optimization flattens the topography of the tree.
- // Examples:
- // x + (y+z) = x+y+z
- // x * (y/z) = x*y/z
- // x / (y/z) = x/y*z
-
- if(GetOp() == cAdd || GetOp() == cMul)
- {
- // If children are same type as parent add them here
- for(pit b, a=GetBegin(); a!=GetEnd(); a=b)
- {
- const SubTree &pa = *a; b=a; ++b;
- if(pa->GetOp() != GetOp()) continue;
-
- // Child is same type
- for(pcit c=pa->GetBegin();
- c!=pa->GetEnd();
- ++c)
- {
- const SubTree &pb = *c;
- if(pa.getsign())
- {
- // +a -(+b +c)
- // means b and c will be negated
-
- SubTree tmp = pb;
- if(GetOp() == cMul)
- tmp.Invert();
- else
- tmp.Negate();
- AddParam(tmp);
- }
- else
- AddParam(pb);
- }
- Erase(a);
-
- // Note: OptimizeConstantMath1() would be a good thing to call next.
- }
- }
- }
-
- void OptimizeLinearCombine()
- {
- // This optimization does the following:
- //
- // x*x*x*x -> x^4
- // x+x+x+x -> x*4
- // x*x -> x^2
- // x/z/z ->
- //
-
- // Remove conflicts first, so we don't have to worry about signs.
- OptimizeConflict();
-
- bool didchanges = false;
- if(GetOp() == cAdd || GetOp() == cMul)
- {
- Redo:
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
-
- list<pit> poslist;
-
- for(pit b=a; ++b!=GetEnd(); )
- {
- const SubTree &pb = *b;
- if(*pa == *pb)
- poslist.push_back(b);
- }
-
- unsigned min = 2;
- if(poslist.size() >= min)
- {
- SubTree arvo = pa;
- bool negate = arvo.getsign();
-
- double factor = poslist.size() + 1;
-
- if(negate)
- {
- arvo.Negate();
- factor = -factor;
- }
-
- CodeTree tmp(GetOp()==cAdd ? cMul : cPow,
- arvo,
- factor);
-
- list<pit>::const_iterator j;
- for(j=poslist.begin(); j!=poslist.end(); ++j)
- Erase(*j);
- poslist.clear();
-
- *a = tmp;
- didchanges = true;
- goto Redo;
- }
- }
- }
- if(didchanges)
- {
- // As a result, there might be need for this:
- OptimizeAddMulFlat();
- // And this:
- OptimizeRedundant();
- }
- }
-
- void OptimizeLogarithm()
- {
- /*
- This is basic logarithm math:
- pow(X,Y)/log(Y) = X
- log(X)/log(Y) = logY(X)
- log(X^Y) = log(X)*Y
- log(X*Y) = log(X)+log(Y)
- exp(log(X)*Y) = X^Y
-
- This function does these optimizations:
- pow(const_E, log(x)) = x
- pow(const_E, log(x)*y) = x^y
- pow(10, log(x)*const_L10I*y) = x^y
- pow(z, log(x)/log(z)*y) = x^y
-
- And this:
- log(x^z) = z * log(x)
- Which automatically causes these too:
- log(pow(const_E, x)) = x
- log(pow(y, x)) = x * log(y)
- log(pow(pow(const_E, y), x)) = x*y
-
- And it does this too:
- log(x) + log(y) + log(z) = log(x * y * z)
- log(x * exp(y)) = log(x) + y
-
- */
-
- // Must be already in exponential form.
-
- // Optimize exponents before doing something.
- OptimizeExponents();
-
- if(GetOp() == cLog)
- {
- // We should have one parameter for log() function.
- // If we don't, we're screwed.
-
- const SubTree &p = getp0();
-
- if(p->GetOp() == cPow)
- {
- // Found log(x^y)
- SubTree p0 = p->getp0(); // x
- SubTree p1 = p->getp1(); // y
-
- // Build the new logarithm.
- CodeTree tmp(GetOp(), p0); // log(x)
-
- // Become log(x) * y
- ReplaceWith(cMul, tmp, p1);
- }
- else if(p->GetOp() == cMul)
- {
- // Redefine &p nonconst
- SubTree &p = getp0();
-
- p->OptimizeAddMulFlat();
- p->OptimizeExponents();
- CHECKCONSTNEG(p, p->GetOp());
-
- list<SubTree> adds;
-
- for(pit b, a = p->GetBegin();
- a != p->GetEnd(); a=b)
- {
- SubTree &pa = *a; b=a; ++b;
- if(pa->GetOp() == cPow
- && pa->getp0()->IsImmed()
- && pa->getp0()->GetImmed() == CONSTANT_E)
- {
- adds.push_back(pa->getp1());
- p->Erase(a);
- continue;
- }
- }
- if(adds.size())
- {
- CodeTree tmp(cAdd, *this);
-
- list<SubTree>::const_iterator i;
- for(i=adds.begin(); i!=adds.end(); ++i)
- tmp.AddParam(*i);
-
- ReplaceWith(tmp);
- }
- }
- }
- if(GetOp() == cAdd)
- {
- // Check which ones are logs.
- list<pit> poslist;
-
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
- if(pa->GetOp() == cLog)
- poslist.push_back(a);
- }
-
- if(poslist.size() >= 2)
- {
- CodeTree tmp(cMul, 1.0); // eek
-
- list<pit>::const_iterator j;
- for(j=poslist.begin(); j!=poslist.end(); ++j)
- {
- const SubTree &pb = **j;
- // Take all of its children
- for(pcit b=pb->GetBegin();
- b!=pb->GetEnd();
- ++b)
- {
- SubTree tmp2 = *b;
- if(pb.getsign()) tmp2.Negate();
- tmp.AddParam(tmp2);
- }
- Erase(*j);
- }
- poslist.clear();
-
- AddParam(CodeTree(cLog, tmp));
- }
- // Done, hopefully
- }
- if(GetOp() == cPow)
- {
- const SubTree &p0 = getp0();
- SubTree &p1 = getp1();
-
- if(p0->IsImmed() && p0->GetImmed() == CONSTANT_E
- && p1->GetOp() == cLog)
- {
- // pow(const_E, log(x)) = x
- ReplaceWith(*(p1->getp0()));
- }
- else if(p1->GetOp() == cMul)
- {
- //bool didsomething = true;
-
- pit poslogpos; bool foundposlog = false;
- pit neglogpos; bool foundneglog = false;
-
- ConstList cl = p1->BuildConstList();
-
- for(pit a=p1->GetBegin(); a!=p1->GetEnd(); ++a)
- {
- const SubTree &pa = *a;
- if(pa->GetOp() == cLog)
- {
- if(!pa.getsign())
- {
- foundposlog = true;
- poslogpos = a;
- }
- else if(*p0 == *(pa->getp0()))
- {
- foundneglog = true;
- neglogpos = a;
- }
- }
- }
-
- if(p0->IsImmed()
- && p0->GetImmed() == 10.0
- && cl.value == CONSTANT_L10I
- && foundposlog)
- {
- SubTree base = (*poslogpos)->getp0();
- p1->KillConst(cl);
- p1->Erase(poslogpos);
- p1->OptimizeRedundant();
- SubTree mul = p1;
-
- ReplaceWith(cPow, base, mul);
-
- // FIXME: what optimizations should be done now?
- return;
- }
-
- // Put back the constant
- FinishConst(cl);
-
- if(p0->IsImmed()
- && p0->GetImmed() == CONSTANT_E
- && foundposlog)
- {
- SubTree base = (*poslogpos)->getp0();
- p1->Erase(poslogpos);
-
- p1->OptimizeRedundant();
- SubTree mul = p1;
-
- ReplaceWith(cPow, base, mul);
-
- // FIXME: what optimizations should be done now?
- return;
- }
-
- if(foundposlog
- && foundneglog
- && *((*neglogpos)->getp0()) == *p0)
- {
- SubTree base = (*poslogpos)->getp0();
- p1->Erase(poslogpos);
- p1->Erase(neglogpos);
-
- p1->OptimizeRedundant();
- SubTree mul = p1;
-
- ReplaceWith(cPow, base, mul);
-
- // FIXME: what optimizations should be done now?
- return;
- }
- }
- }
- }
-
- void OptimizeFunctionCalls()
- {
- /* Goals: sin(asin(x)) = x
- * cos(acos(x)) = x
- * tan(atan(x)) = x
- * NOTE:
- * Do NOT do these:
- * asin(sin(x))
- * acos(cos(x))
- * atan(tan(x))
- * Because someone might want to wrap the angle.
- */
- // FIXME: TODO
- }
-
- void OptimizePowMulAdd()
- {
- // x^3 * x -> x^4
- // x*3 + x -> x*4
- // FIXME: Do those
-
- // x^1 -> x
- if(GetOp() == cPow)
- {
- const SubTree &base = getp0();
- const SubTree &exponent = getp1();
-
- if(exponent->IsImmed())
- {
- if(exponent->GetImmed() == 1.0)
- ReplaceWith(*base);
- else if(exponent->GetImmed() == 0.0
- && base->NonZero())
- ReplaceWithConst(1.0);
- }
- }
- }
-
- void OptimizeExponents()
- {
- /* Goals:
- * (x^y)^z -> x^(y*z)
- * x^y * x^z -> x^(y+z)
- */
- // First move to exponential form.
- OptimizeLinearCombine();
-
- bool didchanges = false;
-
- Redo:
- if(GetOp() == cPow)
- {
- // (x^y)^z -> x^(y*z)
-
- const SubTree &p0 = getp0();
- const SubTree &p1 = getp1();
- if(p0->GetOp() == cPow)
- {
- CodeTree tmp(cMul, p0->getp1(), p1);
- tmp.Optimize();
-
- ReplaceWith(cPow, p0->getp0(), tmp);
-
- didchanges = true;
- goto Redo;
- }
- }
- if(GetOp() == cMul)
- {
- // x^y * x^z -> x^(y+z)
-
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
-
- if(pa->GetOp() != cPow) continue;
-
- list<pit> poslist;
-
- for(pit b=a; ++b != GetEnd(); )
- {
- const SubTree &pb = *b;
- if(pb->GetOp() == cPow
- && *(pa->getp0())
- == *(pb->getp0()))
- {
- poslist.push_back(b);
- }
- }
-
- if(poslist.size() >= 1)
- {
- poslist.push_back(a);
-
- CodeTree base = *(pa->getp0());
-
- CodeTree exponent(cAdd, 0.0); //eek
-
- // Collect all exponents to cAdd
- list<pit>::const_iterator i;
- for(i=poslist.begin(); i!=poslist.end(); ++i)
- {
- const SubTree &pb = **i;
-
- SubTree tmp2 = pb->getp1();
- if(pb.getsign()) tmp2.Invert();
-
- exponent.AddParam(tmp2);
- }
-
- exponent.Optimize();
-
- CodeTree result(cPow, base, exponent);
-
- for(i=poslist.begin(); i!=poslist.end(); ++i)
- Erase(*i);
- poslist.clear();
-
- AddParam(result); // We're cMul, remember
-
- didchanges = true;
- goto Redo;
- }
- }
- }
-
- OptimizePowMulAdd();
-
- if(didchanges)
- {
- // As a result, there might be need for this:
- OptimizeConflict();
- }
- }
-
- void OptimizeLinearExplode()
- {
- // x^2 -> x*x
- // But only if x is just a simple thing
-
- // Won't work on anything else.
- if(GetOp() != cPow) return;
-
- // TODO TODO TODO
- }
-
- void OptimizePascal()
- {
-#if 0 // Too big, too specific, etc
-
- // Won't work on anything else.
- if(GetOp() != cAdd) return;
-
- // Must be done after OptimizeLinearCombine();
-
- // Don't need pascal triangle
- // Coefficient for x^a * y^b * z^c = 3! / (a! * b! * c!)
-
- // We are greedy and want other than just binomials
- // FIXME
-
- // note: partial ones are also nice
- // x*x + x*y + y*y
- // = (x+y)^2 - x*y
- //
- // x x * x y * + y y * +
- // -> x y + dup * x y * -
-#endif
- }
-
-public:
-
- void Optimize();
-
- void Assemble(vector<unsigned> &byteCode,
- vector<double> &immed) const;
-
- void FinalOptimize()
- {
- // First optimize each parameter.
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- (*a)->FinalOptimize();
-
- /* These things are to be done:
- *
- * x * CONSTANT_DR -> cDeg(x)
- * x * CONSTANT_RD -> cRad(x)
- * pow(x, 0.5) -> sqrt(x)
- * log(x) * CONSTANT_L10I -> log10(x)
- * pow(CONSTANT_E, x) -> exp(x)
- * inv(sin(x)) -> csc(x)
- * inv(cos(x)) -> sec(x)
- * inv(tan(x)) -> cot(x)
- */
-
-
- if(GetOp() == cPow)
- {
- const SubTree &p0 = getp0();
- const SubTree &p1 = getp1();
- if(p0->GetOp() == cImmed
- && p0->GetImmed() == CONSTANT_E)
- {
- ReplaceWith(cExp, p1);
- }
- else if(p1->GetOp() == cImmed
- && p1->GetImmed() == 0.5)
- {
- ReplaceWith(cSqrt, p0);
- }
- }
- if(GetOp() == cMul)
- {
- if(GetArgCount() == 1 && getp0().getsign())
- {
- /***/if(getp0()->GetOp() == cSin)ReplaceWith(cCsc, getp0()->getp0());
- else if(getp0()->GetOp() == cCos)ReplaceWith(cSec, getp0()->getp0());
- else if(getp0()->GetOp() == cTan)ReplaceWith(cCot, getp0()->getp0());
- }
- }
- // Separate "if", because op may have just changed
- if(GetOp() == cMul)
- {
- CodeTree *found_log = 0;
-
- ConstList cl = BuildConstList();
-
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- SubTree &pa = *a;
- if(pa->GetOp() == cLog && !pa.getsign())
- found_log = &*pa;
- }
- if(cl.value == CONSTANT_L10I && found_log)
- {
- // Change the log() to log10()
- found_log->SetOp(cLog10);
- // And forget the constant
- KillConst(cl);
- }
- else if(cl.value == CONSTANT_DR)
- {
- OptimizeRedundant();
- ReplaceWith(cDeg, *this);
- }
- else if(cl.value == CONSTANT_RD)
- {
- OptimizeRedundant();
- ReplaceWith(cRad, *this);
- }
- else FinishConst(cl);
- }
-
- SortIfPossible();
- }
-};
-
-void CodeTreeDataPtr::Shock()
-{
- /*
- PrepareForWrite();
- paramlist &p2 = (*this)->args;
- for(paramlist::iterator i=p2.begin(); i!=p2.end(); ++i)
- {
- (*i)->data.Shock();
- }
- */
-}
-
-CodeTree::ConstList CodeTree::BuildConstList()
-{
- ConstList result;
- result.value =
- result.voidvalue = GetOp()==cMul ? 1.0 : 0.0;
-
- list<pit> &cp = result.cp;
- for(pit b, a=GetBegin(); a!=GetEnd(); a=b)
- {
- SubTree &pa = *a; b=a; ++b;
- if(!pa->IsImmed()) continue;
-
- double thisvalue = pa->GetImmed();
- if(thisvalue == result.voidvalue)
- {
- // This value is no good, forget it
- Erase(a);
- continue;
- }
- if(GetOp() == cMul)
- result.value *= thisvalue;
- else
- result.value += thisvalue;
- cp.push_back(a);
- }
- if(GetOp() == cMul)
- {
- /*
- Jos joku niistä arvoista on -1 eikä se ole ainoa arvo,
- niin joku muu niistä arvoista negatoidaan.
- */
- for(bool done=false; cp.size() > 1 && !done; )
- {
- done = true;
- for(list<pit>::iterator b,a=cp.begin(); a!=cp.end(); a=b)
- {
- b=a; ++b;
- if((**a)->GetImmed() == -1.0)
- {
- Erase(*a);
- cp.erase(a);
-
- // take randomly something
- (**cp.begin())->data->NegateImmed();
- if(cp.size() < 2)break;
- done = false;
- }
- }
- }
- }
- return result;
-}
-
-void CodeTree::Assemble
- (vector<unsigned> &byteCode,
- vector<double> &immed) const
-{
- #define AddCmd(op) byteCode.push_back((op))
- #define AddConst(v) do { \
- byteCode.push_back(cImmed); \
- immed.push_back((v)); \
- } while(0)
-
- if(IsVar())
- {
- AddCmd(GetVar());
- return;
- }
- if(IsImmed())
- {
- AddConst(GetImmed());
- return;
- }
-
- switch(GetOp())
- {
- case cAdd:
- case cMul:
- {
- unsigned opcount = 0;
- for(pcit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
-
- if(opcount < 2) ++opcount;
-
- bool pnega = pa.getsign();
-
- bool done = false;
- if(pa->IsImmed())
- {
- if(GetOp() == cMul
- && pa->data->IsInverted()
- && (pnega || opcount==2)
- )
- {
- CodeTree tmp = *pa;
- tmp.data->InvertImmed();
- tmp.Assemble(byteCode, immed);
- pnega = !pnega;
- done = true;
- }
- else if(GetOp() == cAdd
- && (pa->data->IsNegatedOriginal()
- // || pa->GetImmed() < 0
- )
- && (pnega || opcount==2)
- )
- {
- CodeTree tmp = *pa;
- tmp.data->NegateImmed();
- tmp.Assemble(byteCode, immed);
- pnega = !pnega;
- done = true;
- }
- }
- if(!done)
- pa->Assemble(byteCode, immed);
-
- if(opcount == 2)
- {
- unsigned tmpop = GetOp();
- if(pnega) // negate
- {
- tmpop = (tmpop == cMul) ? cDiv : cSub;
- }
- AddCmd(tmpop);
- }
- else if(pnega)
- {
- if(GetOp() == cMul) AddCmd(cInv);
- else AddCmd(cNeg);
- }
- }
- break;
- }
- case cIf:
- {
- // If the parameter amount is != 3, we're screwed.
- getp0()->Assemble(byteCode, immed);
-
- unsigned ofs = byteCode.size();
- AddCmd(cIf);
- AddCmd(0); // code index
- AddCmd(0); // immed index
-
- getp1()->Assemble(byteCode, immed);
-
- byteCode[ofs+1] = byteCode.size()+2;
- byteCode[ofs+2] = immed.size();
-
- ofs = byteCode.size();
- AddCmd(cJump);
- AddCmd(0); // code index
- AddCmd(0); // immed index
-
- getp2()->Assemble(byteCode, immed);
-
- byteCode[ofs+1] = byteCode.size()-1;
- byteCode[ofs+2] = immed.size();
-
- break;
- }
- case cFCall:
- {
- // If the parameter count is invalid, we're screwed.
- for(pcit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
- pa->Assemble(byteCode, immed);
- }
- AddCmd(GetOp());
- AddCmd(data->GetFuncNo());
- break;
- }
- case cPCall:
- {
- // If the parameter count is invalid, we're screwed.
- for(pcit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
- pa->Assemble(byteCode, immed);
- }
- AddCmd(GetOp());
- AddCmd(data->GetFuncNo());
- break;
- }
- default:
- {
- // If the parameter count is invalid, we're screwed.
- for(pcit a=GetBegin(); a!=GetEnd(); ++a)
- {
- const SubTree &pa = *a;
- pa->Assemble(byteCode, immed);
- }
- AddCmd(GetOp());
- break;
- }
- }
-}
-
-void CodeTree::Optimize()
-{
- // Phase:
- // Phase 0: Do local optimizations.
- // Phase 1: Optimize each.
- // Phase 2: Do local optimizations again.
-
- for(unsigned phase=0; phase<=2; ++phase)
- {
- if(phase == 1)
- {
- // Optimize each parameter.
- for(pit a=GetBegin(); a!=GetEnd(); ++a)
- {
- (*a)->Optimize();
- CHECKCONSTNEG(*a, GetOp());
- }
- continue;
- }
- if(phase == 0 || phase == 2)
- {
- // Do local optimizations.
-
- OptimizeConstantMath1();
- OptimizeLogarithm();
- OptimizeFunctionCalls();
- OptimizeExponents();
- OptimizeLinearExplode();
- OptimizePascal();
-
- /* Optimization paths:
-
- doublenegations=
- redundant= * doublenegations
- conflict= * redundant
- addmulflat=
- constantmath1= addmulflat * conflict
- linearcombine= conflict * addmulflat¹ redundant¹
- powmuladd=
- exponents= linearcombine * powmuladd conflict¹
- logarithm= exponents *
- functioncalls= IDLE
- linearexplode= IDLE
- pascal= IDLE
-
- * = actions here
- ¹ = only if made changes
- */
- }
- }
-}
-
-
-bool CodeTree::operator== (const CodeTree& b) const
-{
- if(GetOp() != b.GetOp()) return false;
- if(IsImmed()) if(GetImmed() != b.GetImmed()) return false;
- if(IsVar()) if(GetVar() != b.GetVar()) return false;
- if(data->IsFunc())
- if(data->GetFuncNo() != b.data->GetFuncNo()) return false;
- return data->args == b.data->args;
-}
-
-bool CodeTree::operator< (const CodeTree& b) const
-{
- if(GetArgCount() != b.GetArgCount())
- return GetArgCount() > b.GetArgCount();
-
- if(GetOp() != b.GetOp())
- {
- // sort immeds last
- if(IsImmed() != b.IsImmed()) return IsImmed() < b.IsImmed();
-
- return GetOp() < b.GetOp();
- }
-
- if(IsImmed())
- {
- if(GetImmed() != b.GetImmed()) return GetImmed() < b.GetImmed();
- }
- if(IsVar() && GetVar() != b.GetVar())
- {
- return GetVar() < b.GetVar();
- }
- if(data->IsFunc() && data->GetFuncNo() != b.data->GetFuncNo())
- {
- return data->GetFuncNo() < b.data->GetFuncNo();
- }
-
- pcit i = GetBegin(), j = b.GetBegin();
- for(; i != GetEnd(); ++i, ++j)
- {
- const SubTree &pa = *i, &pb = *j;
-
- if(!(pa == pb))
- return pa < pb;
- }
- return false;
-}
-
-namespace {
-bool IsNegate(const SubTree &p1, const SubTree &p2) /*const */
-{
- if(p1->IsImmed() && p2->IsImmed())
- {
- return p1->GetImmed() == -p2->GetImmed();
- }
- if(p1.getsign() == p2.getsign()) return false;
- return *p1 == *p2;
-}
-bool IsInverse(const SubTree &p1, const SubTree &p2) /*const*/
-{
- if(p1->IsImmed() && p2->IsImmed())
- {
- // FIXME: potential divide by zero.
- return p1->GetImmed() == 1.0 / p2->GetImmed();
- }
- if(p1.getsign() == p2.getsign()) return false;
- return *p1 == *p2;
-}
-}
-
-SubTree::SubTree() : tree(new CodeTree), sign(false)
-{
-}
-
-SubTree::SubTree(const SubTree &b) : tree(new CodeTree(*b.tree)), sign(b.sign)
-{
-}
-
-#define SubTreeDecl(p1, p2) \
- SubTree::SubTree p1 : tree(new CodeTree p2), sign(false) { }
-
-SubTreeDecl( (const struct CodeTree &b), (b) )
-SubTreeDecl( (double value), (value) )
-
-#undef SubTreeDecl
-
-SubTree::~SubTree()
-{
- delete tree; tree=0;
-}
-
-const SubTree &SubTree::operator= (const SubTree &b)
-{
- sign = b.sign;
- CodeTree *oldtree = tree;
- tree = new CodeTree(*b.tree);
- delete oldtree;
- return *this;
-}
-const SubTree &SubTree::operator= (const CodeTree &b)
-{
- sign = false;
- CodeTree *oldtree = tree;
- tree = new CodeTree(b);
- delete oldtree;
- return *this;
-}
-
-bool SubTree::operator< (const SubTree& b) const
-{
- if(getsign() != b.getsign()) return getsign() < b.getsign();
- return *tree < *b.tree;
-}
-bool SubTree::operator== (const SubTree& b) const
-{
- return sign == b.sign && *tree == *b.tree;
-}
-void SubTree::Negate() // Note: Parent must be cAdd
-{
- flipsign();
- CheckConstNeg();
-}
-void SubTree::CheckConstNeg()
-{
- if(tree->IsImmed() && getsign())
- {
- tree->NegateImmed();
- sign = false;
- }
-}
-void SubTree::Invert() // Note: Parent must be cMul
-{
- flipsign();
- CheckConstInv();
-}
-void SubTree::CheckConstInv()
-{
- if(tree->IsImmed() && getsign())
- {
- tree->InvertImmed();
- sign = false;
- }
-}
-
-void FunctionParser::MakeTree(struct CodeTree *result) const
-{
- vector<CodeTree> stack(1);
-
- #define GROW(n) do { \
- stacktop += n; \
- if(stack.size() <= stacktop) stack.resize(stacktop+1); \
- } while(0)
-
- #define EAT(n, opcode) do { \
- unsigned newstacktop = stacktop-n; \
- stack[stacktop].SetOp((opcode)); \
- for(unsigned a=0, b=(n); a<b; ++a) \
- stack[stacktop].AddParam(stack[newstacktop+a]); \
- stack.erase(stack.begin() + newstacktop, \
- stack.begin() + stacktop); \
- stacktop = newstacktop; GROW(1); \
- } while(0)
-
- #define ADDCONST(n) do { \
- stack[stacktop].SetImmed((n)); \
- GROW(1); \
- } while(0)
-
- unsigned stacktop=0;
-
- list<unsigned> labels;
-
- for(unsigned IP=0, DP=0; ; ++IP)
- {
- while(labels.size() > 0
- && *labels.begin() == IP)
- {
- // The "else" of an "if" ends here
- EAT(3, cIf);
- labels.erase(labels.begin());
- }
-
- if(IP >= Comp.ByteCodeSize)
- {
- break;
- }
-
- unsigned opcode = Comp.ByteCode[IP];
-
- if(opcode == cIf)
- {
- IP += 2;
- }
- else if(opcode == cJump)
- {
- labels.push_front(Comp.ByteCode[IP+1]+1);
- IP += 2;
- }
- else if(opcode == cImmed)
- {
- ADDCONST(Comp.Immed[DP++]);
- }
- else if(opcode < VarBegin)
- {
- switch(opcode)
- {
- // Unary operators
- case cNeg:
- {
- EAT(1, cAdd); // Unary minus is negative adding.
- stack[stacktop-1].getp0().Negate();
- break;
- }
- // Binary operators
- case cSub:
- {
- EAT(2, cAdd); // Minus is negative adding
- stack[stacktop-1].getp1().Negate();
- break;
- }
- case cDiv:
- {
- EAT(2, cMul); // Divide is inverse multiply
- stack[stacktop-1].getp1().Invert();
- break;
- }
-
- // ADD ALL TWO PARAMETER NON-FUNCTIONS HERE
- case cAdd: case cMul:
- case cMod: case cPow:
- case cEqual: case cLess: case cGreater:
- case cAnd: case cOr:
- EAT(2, opcode);
- break;
-
- case cFCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- unsigned params = FuncPtrs[index].params;
- EAT(params, opcode);
- stack[stacktop-1].data->SetFuncNo(index);
- break;
- }
- case cPCall:
- {
- unsigned index = Comp.ByteCode[++IP];
- unsigned params = FuncParsers[index]->varAmount;
- EAT(params, opcode);
- stack[stacktop-1].data->SetFuncNo(index);
- break;
- }
-
- // Converted to cMul on fly
- case cDeg:
- ADDCONST(CONSTANT_DR);
- EAT(2, cMul);
- break;
-
- // Converted to cMul on fly
- case cRad:
- ADDCONST(CONSTANT_RD);
- EAT(2, cMul);
- break;
-
- // Functions
- default:
- {
- const FuncDefinition& func = Functions[opcode-cAbs];
-
- unsigned paramcount = func.params;
-#ifndef DISABLE_EVAL
- if(opcode == cEval) paramcount = varAmount;
-#endif
- if(opcode == cSqrt)
- {
- // Converted on fly: sqrt(x) = x^0.5
- opcode = cPow;
- paramcount = 2;
- ADDCONST(0.5);
- }
- if(opcode == cExp)
- {
- // Converted on fly: exp(x) = CONSTANT_E^x
-
- opcode = cPow;
- paramcount = 2;
- // reverse the parameters... kludgey
- stack[stacktop] = stack[stacktop-1];
- stack[stacktop-1].SetImmed(CONSTANT_E);
- GROW(1);
- }
- bool do_inv = false;
- if(opcode == cCot) { do_inv = true; opcode = cTan; }
- if(opcode == cCsc) { do_inv = true; opcode = cSin; }
- if(opcode == cSec) { do_inv = true; opcode = cCos; }
-
- bool do_log10 = false;
- if(opcode == cLog10)
- {
- // Converted on fly: log10(x) = log(x) * CONSTANT_L10I
- opcode = cLog;
- do_log10 = true;
- }
- EAT(paramcount, opcode);
- if(do_log10)
- {
- ADDCONST(CONSTANT_L10I);
- EAT(2, cMul);
- }
- if(do_inv)
- {
- // Unary cMul, inverted. No need for "1.0"
- EAT(1, cMul);
- stack[stacktop-1].getp0().Invert();
- }
- break;
- }
- }
- }
- else
- {
- stack[stacktop].SetVar(opcode);
- GROW(1);
- }
- }
-
- if(!stacktop)
- {
- // ERROR: Stack does not have any values!
- return;
- }
-
- --stacktop; // Ignore the last element, it is always nop (cAdd).
-
- if(stacktop > 0)
- {
- // ERROR: Stack has too many values!
- return;
- }
-
- // Okay, the tree is now stack[0]
- *result = stack[0];
-}
-
-void FunctionParser::Optimize()
-{
-
- CodeTree tree;
- MakeTree(&tree);
-
- // Do all sorts of optimizations
- tree.Optimize();
- // Last changes before assembly
- tree.FinalOptimize();
-
- // Now rebuild from the tree.
-
- vector<unsigned> byteCode;
- vector<double> immed;
-
-#if 0
- byteCode.resize(Comp.ByteCodeSize);
- for(unsigned a=0; a<Comp.ByteCodeSize; ++a)byteCode[a] = Comp.ByteCode[a];
-
- immed.resize(Comp.ImmedSize);
- for(unsigned a=0; a<Comp.ImmedSize; ++a)immed[a] = Comp.Immed[a];
-#else
- byteCode.clear(); immed.clear();
- tree.Assemble(byteCode, immed);
-#endif
-
- delete[] Comp.ByteCode; Comp.ByteCode = 0;
- if((Comp.ByteCodeSize = byteCode.size()) > 0)
- {
- Comp.ByteCode = new unsigned[Comp.ByteCodeSize];
- for(unsigned a=0; a<byteCode.size(); ++a)
- Comp.ByteCode[a] = byteCode[a];
- }
-
- delete[] Comp.Immed; Comp.Immed = 0;
- if((Comp.ImmedSize = immed.size()) > 0)
- {
- Comp.Immed = new double[Comp.ImmedSize];
- for(unsigned a=0; a<immed.size(); ++a)
- Comp.Immed[a] = immed[a];
- }
-}
-
-
-#else /* !SUPPORT_OPTIMIZER */
-
-/* keep the linker happy */
-void FunctionParser::MakeTree(struct CodeTree *) const {}
-void FunctionParser::Optimize()
-{
- // Do nothing if no optimizations are supported.
-}
-#endif
diff --git a/fparser/src/fparser.h b/fparser/src/fparser.h
deleted file mode 100644
index 116df8a..0000000
--- a/fparser/src/fparser.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** This file is part of the LibreCAD project, a 2D CAD program
-**
-** Copyright (C) 2010 R. van Twisk (librecad at rvt.dds.nl)
-** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
-**
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-**
-** This copyright notice MUST APPEAR in all copies of the script!
-**
-**********************************************************************/
-
-#ifndef ONCE_FPARSER_H_
-#define ONCE_FPARSER_H_
-
-#include <string>
-#include <map>
-#include <vector>
-#include <iostream>
-
-class FunctionParser
-{
-public:
- int Parse(const std::string& Function, const std::string& Vars,
- bool useDegrees = false);
- const char* ErrorMsg(void) const;
- double Eval(const double* Vars);
- inline int EvalError(void) const { return EvalErrorType; }
-
- bool AddConstant(const std::string& name, double value);
-
- typedef double (*FunctionPtr)(const double*);
-
- bool AddFunction(const std::string& name,
- FunctionPtr, unsigned paramsAmount);
- bool AddFunction(const std::string& name, FunctionParser&);
-
- void Optimize();
-
-
- FunctionParser();
- ~FunctionParser();
-
-
-
- // For debugging purposes only:
- void PrintByteCode(std::ostream& dest) const;
-
-//========================================================================
-private:
-//========================================================================
- int varAmount, ParseErrorType,EvalErrorType;
-
- typedef std::map<std::string, unsigned> VarMap_t;
- VarMap_t Variables;
-
- typedef std::map<std::string, double> ConstMap_t;
- ConstMap_t Constants;
-
- VarMap_t FuncPtrNames;
- struct FuncPtrData
- {
- FunctionPtr ptr; unsigned params;
- FuncPtrData(FunctionPtr p, unsigned par): ptr(p), params(par) {}
- };
- std::vector<FuncPtrData> FuncPtrs;
-
- VarMap_t FuncParserNames;
- std::vector<FunctionParser*> FuncParsers;
-
- struct CompiledCode
- { CompiledCode();
- ~CompiledCode();
-
- unsigned* ByteCode;
- unsigned ByteCodeSize;
- double* Immed;
- unsigned ImmedSize;
- double* Stack;
- unsigned StackSize, StackPtr;
- } Comp;
-
- // Temp vectors for bytecode:
- std::vector<unsigned>* tempByteCode;
- std::vector<double>* tempImmed;
-
- bool useDegreeConversion;
-
- bool checkRecursiveLinking(const FunctionParser*);
-
- bool isValidName(const std::string&);
- VarMap_t::const_iterator FindVariable(const char*, const VarMap_t&);
- ConstMap_t::const_iterator FindConstant(const char*);
- int CheckSyntax(const char*);
- bool Compile(const char*);
- bool IsVariable(int);
- void AddCompiledByte(unsigned);
- void AddImmediate(double);
- void AddFunctionOpcode(unsigned);
- int CompileIf(const char*, int);
- int CompileFunctionParams(const char*, int, unsigned);
- int CompileElement(const char*, int);
- int CompilePow(const char*, int);
- int CompileMult(const char*, int);
- int CompileAddition(const char*, int);
- int CompileComparison(const char*, int);
- int CompileAnd(const char*, int);
- int CompileOr(const char*, int);
- int CompileExpression(const char*, int, bool=false);
-
-
- void MakeTree(struct CodeTree *result) const;
-
- FunctionParser(const FunctionParser&);
- const FunctionParser& operator=(const FunctionParser&);
-};
-
-#endif
diff --git a/fparser/src/fparser.txt b/fparser/src/fparser.txt
deleted file mode 100644
index afadc86..0000000
--- a/fparser/src/fparser.txt
+++ /dev/null
@@ -1,633 +0,0 @@
- Function parser for C++ v2.51 by Warp.
- ======================================
-
- Optimization code contributed by Bisqwit (http://iki.fi/bisqwit/)
-
-
- The usage license of this library is located at the end of this text file.
-
-
-
- What's new in v2.51
- -------------------
- - Tiny fixes to make it work with gcc 2.x (which is still sadly common).
-
- What's new in v2.5
- ------------------
- - A new AddConstant() method for adding constants to the parser.
- - Two AddFunction() methods for adding user-defined functions to the parser.
- - The library can now handle trigonometrical angles either in radians
- (default) or degrees with an optional parameter of Parse().
- - New functions added: cot(), csc() and sec().
- - Enhancements and bug fixes to the Optimize() method (please consider
- it still as experimental).
-
- What's new in v2.4:
- ------------------
- - A new Optimize() method which tries to simplify the bytecode so that
- it will be evaluated faster. Please note that this is still experimental.
- - New functions added: atan2() and log10().
- - Two new more detailed syntax error messages (previously simply
- "Syntax error").
-
- What's new in v2.3:
- ------------------
- - Variable names can now have digits and underscores (but they can't begin
- with a digit).
- - Parsing speed optimizations. The Parse() method can be even 40% faster
- than in the previous version.
- (Please be aware that the new parser has not been thoroughly tested;
- bugs are possible.)
- - A new "semi-undocumented" debugging function for printing the bytecode
- of the current function (in an asm-like syntax). Mostly useless from
- the user's point of view.
-
-
-
-=============================================================================
- - Preface
-=============================================================================
-
- Often people need to ask some mathematical expression from the user and
-then evaluate values for that expression. The simplest example is a program
-which draws the graphic of a user-defined function on screen.
-
- This library adds C-style function string parsing to the program. This
-means that you can evaluate the string "sqrt(1-x^2+y^2)" with given values
-of 'x' and 'y'.
-
- The library is intended to be very fast. It byte-compiles the function
-string at parse time and interpretes this byte-code at evaluation time.
-The evaluation is straightforward and no recursions are done (uses stack
-arithmetic).
- Empirical tests show that it indeed is very fast (specially compared to
-libraries which evaluate functions by just interpreting the raw function
-string).
-
- The library is made in ISO C++ and requires a standard-conforming C++
-compiler.
-
-
-=============================================================================
- - Usage
-=============================================================================
-
- To use the FunctionParser class, you have to include "fparser.hh". When
-compiling, you have to compile fparser.cc and link it to the main program.
-You can also make a library from the fparser.cc (see the help on your
-compiler to see how this is done).
-
-
- * Short descriptions of FunctionParser methods:
- --------------------------------------------
-
-int Parse(const std::string& Function, const std::string& Vars,
- bool useDegrees = false);
-
- Parses the given function and compiles it to internal format.
- Return value is -1 if successful, else the index value to the location
- of the error.
-
-
-const char* ErrorMsg(void) const;
-
- Returns an error message corresponding to the error in Parse(), or 0 if
- no such error occurred.
-
-
-double Eval(const double* Vars);
-
- Evaluates the function given to Parse().
-
-
-int EvalError(void) const;
-
- Returns 0 if no error happened in the previous call to Eval(), else an
- error code >1.
-
-
-void Optimize();
-
- Tries to optimize the bytecode for faster evaluation.
-
-
-bool AddConstant(const std::string& name, double value);
-
- Add a constant to the parser. Returns false if the name of the constant
- is invalid, else true.
-
-
-bool AddFunction(const std::string& name,
- double (*functionPtr)(const double*),
- unsigned paramsAmount);
-
- Add a user-defined function to the parser (as a function pointer).
- Returns false if the name of the function is invalid, else true.
-
-
-bool AddFunction(const std::string& name, FunctionParser&);
-
- Add a user-defined function to the parser (as a FunctionParser instance).
- Returns false if the name of the function is invalid, else true.
-
-
-
- * Long descriptions of FunctionParser methods:
- -------------------------------------------
-
----------------------------------------------------------------------------
-int Parse(const std::string& Function, const std::string& Vars,
- bool useDegrees = false);
----------------------------------------------------------------------------
-
- Parses the given function (and compiles it to internal format).
- Destroys previous function. Following calls to Eval() will evaluate
- the given function.
- The strings given as parameters are not needed anymore after parsing.
-
- Parameters:
- Function : String containing the function to parse.
- Vars : String containing the variable names, separated by commas.
- Eg. "x,y", "VarX,VarY,VarZ,n" or "x1,x2,x3,x4,__VAR__".
- useDegrees: (Optional.) Whether to use degrees or radians in
- trigonometric functions. (Default: radians)
-
- Variables can have any size and they are case sensitive (ie. "var",
- "VAR" and "Var" are *different* variable names). Letters, digits and
- underscores can be used in variable names, but the name of a variable
- can't begin with a digit. Each variable name can appear only once in
- the string. Function names are not legal variable names.
-
- Using longer variable names causes no overhead whatsoever to the Eval()
- method, so it's completely safe to use variable names of any size.
-
- The third, optional parameter specifies whether angles should be
- interpreted as radians or degrees in trigonometrical functions.
- If not specified, the default value is radians.
-
- Return values:
- -On success the function returns -1.
- -On error the function returns an index to where the error was found
- (0 is the first character, 1 the second, etc). If the error was not
- a parsing error returns an index to the end of the string + 1.
-
- Example: parser.Parse("3*x+y", "x,y");
-
-
----------------------------------------------------------------------------
-const char* ErrorMsg(void) const;
----------------------------------------------------------------------------
-
- Returns a pointer to an error message string corresponding to the error
- caused by Parse() (you can use this to print the proper error message to
- the user). If no such error has occurred, returns 0.
-
-
----------------------------------------------------------------------------
-double Eval(const double* Vars);
----------------------------------------------------------------------------
-
- Evaluates the function given to Parse().
- The array given as parameter must contain the same amount of values as
- the amount of variables given to Parse(). Each value corresponds to each
- variable, in the same order.
-
- Return values:
- -On success returns the evaluated value of the function given to
- Parse().
- -On error (such as division by 0) the return value is unspecified,
- probably 0.
-
- Example:
-
- double Vars[] = {1, -2.5};
- double result = parser.Eval(Vars);
-
-
----------------------------------------------------------------------------
-int EvalError(void) const;
----------------------------------------------------------------------------
-
- Used to test if the call to Eval() succeeded.
-
- Return values:
- If there was no error in the previous call to Eval(), returns 0,
- else returns a positive value as follows:
- 1: division by zero
- 2: sqrt error (sqrt of a negative value)
- 3: log error (logarithm of a negative value)
- 4: trigonometric error (asin or acos of illegal value)
-
-
----------------------------------------------------------------------------
-void Optimize();
----------------------------------------------------------------------------
-
- This method can be called after calling the Parse() method. It will try
- to simplify the internal bytecode so that it will evaluate faster (it
- tries to reduce the amount of opcodes in the bytecode).
-
- For example, the bytecode for the function "5+x*y-25*4/8" will be
- reduced to a bytecode equivalent to the function "x*y-7.5" (the original
- 11 opcodes will be reduced to 5). Besides calculating constant expressions
- (like in the example), it also performs other types of simplifications
- with variable and function expressions.
-
- This method is quite slow and the decision of whether to use it or
- not should depend on the type of application. If a function is parsed
- once and evaluated millions of times, then calling Optimize() may speed-up
- noticeably. However, if there are tons of functions to parse and each one
- is evaluated once or just a few times, then calling Optimize() will only
- slow down the program.
- Also, if the original function is expected to be optimal, then calling
- Optimize() would be useless.
-
- Note: Currently this method does not make any checks (like Eval() does)
- and thus things like "1/0" will cause undefined behaviour. (On the other
- hand, if such expression is given to the parser, Eval() will always give
- an error code, no matter what the parameters.) If caching this type of
- errors is important, a work-around is to call Eval() once before calling
- Optimize() and checking EvalError().
-
- If the destination application is not going to use this method,
- the compiler constant SUPPORT_OPTIMIZER can be undefined at the beginning
- of fparser.cc to make the library smaller (Optimize() can still be called,
- but it will not do anything).
-
- (If you are interested in seeing how this method optimizes the opcode,
- you can call the PrintByteCode() method before and after the call to
- Optimize() to see the difference.)
-
-
----------------------------------------------------------------------------
-bool AddConstant(const std::string& name, double value);
----------------------------------------------------------------------------
-
- This method can be used to add constants to the parser. Syntactically
- constants are identical to variables (ie. they follow the same naming
- rules and they can be used in the function string in the same way as
- variables), but internally constants are directly replaced with their
- value at parse time.
-
- Constants used by a function must be added before calling Parse()
- for that function. Constants are preserved between Parse() calls in
- the current FunctionParser instance, so they don't need to be added
- but once. (If you use the same constant in several instances of
- FunctionParser, you will need to add it to all the instances separately.)
-
- Constants can be added at any time and the value of old constants can
- be changed, but new additions and changes will only have effect the next
- time Parse() is called. (That is, changing the value of a constant
- after calling Parse() and before calling Eval() will have no effect.)
-
- The return value will be false if the 'name' of the constant was
- illegal, else true. If the name was illegal, the method does nothing.
-
- Example: parser.AddConstant("pi", 3.14159265);
-
- Now for example parser.Parse("x*pi", "x"); will be identical to the
- call parser.Parse("x*3.14159265", "x");
-
-
----------------------------------------------------------------------------
-bool AddFunction(const std::string& name,
- double (*functionPtr)(const double*),
- unsigned paramsAmount);
----------------------------------------------------------------------------
-
- This method can be used to add new functions to the parser. For example,
- if you would like to add a function "sqr(A)" which squares the value
- of A, you can do it with this method (so that you don't need to touch
- the source code of the parser).
-
- The method takes three parameters:
-
- - The name of the function. The name follows the same naming conventions
- as variable names.
-
- - A C++ function, which will be called when evaluating the function
- string (if the user-given function is called there). The C++ function
- must have the form:
- double functionName(const double* params);
-
- - The number of parameters the function takes. NOTE: Currently this
- value must be at least 1; the parser does not support functions which
- take no parameters (this problem may be fixed in the future).
-
- The return value will be false if the given name was invalid (either it
- did not follow the variable naming conventions, or the name was already
- reserved), else true. If the return value is false, nothing is added.
-
- Example:
- Suppose we have a C++ function like this:
-
- double Square(const double* p)
- {
- return p[0]*p[0];
- }
-
- Now we can add this function to the parser like this:
-
- parser.AddFunction("sqr", Square, 1);
-
- parser.Parse("2*sqr(x)", "x");
-
-
- IMPORTANT NOTE: If you use the Optimize() method, it will assume that
- the user-given function has no side-effects, that is, it always
- returns the same value for the same parameters. The optimizer will
- optimize the function call away in some cases, making this assumption.
-
-
----------------------------------------------------------------------------
-bool AddFunction(const std::string& name, FunctionParser&);
----------------------------------------------------------------------------
-
- This method is almost identical to the previous AddFunction(), but
- instead of taking a C++ function, it takes another FunctionParser
- instance.
-
- There are some important restrictions on making a FunctionParser instance
- call another:
-
- - The FunctionParser instance given as parameter must be initialized
- with a Parse() call before giving it as parameter. That is, if you
- want to use the parser A in the parser B, you must call A.Parse()
- before you can call B.AddFunction("name", A).
-
- - The amount of parameters in the FunctionParser instance given as
- parameter must not change after it has been given to the AddFunction()
- of another instance. Changing the number of parameters will result in
- malfunction.
-
- - AddFunction() will fail (ie. return false) if a recursive loop is
- formed. The method specifically checks that no such loop is built.
-
- - As with the other AddFunction(), the number of parameters taken by
- the user-defined function must be at least 1 (this may be fixed in
- the future).
-
- Example:
-
- FunctionParser f1, f2;
- f1.Parse("x*x", "x");
- f2.AddFunction("sqr", f1);
-
-
----------------------------------------------------------------------------
-
- Example program:
-
-#include "fparser.hh"
-#include <iostream>
-
-int main()
-{
- FunctionParser fp;
-
- int ret = fp.Parse("x+y-1", "x,y");
- if(ret >= 0)
- {
- std::cerr << "At col " << ret << ": " << fp.ErrorMsg() << std::endl;
- return 1;
- }
-
- double vals[] = { 4, 8 };
-
- std::cout << fp.Eval(vals) << std::endl;
-}
-
-
-
-=============================================================================
- - The function string
-=============================================================================
-
- The function string understood by the class is very similar to the C-syntax.
- Arithmetic float expressions can be created from float literals, variables
-or functions using the following operators in this order of precedence:
-
- () expressions in parentheses first
- -A unary minus
- A^B exponentiation (A raised to the power B)
- A*B A/B A%B multiplication, division and modulo
- A+B A-B addition and subtraction
- A=B A<B A>B comparison between A and B (result is either 0 or 1)
- A&B result is 1 if int(A) and int(B) differ from 0, else 0.
- A|B result is 1 if int(A) or int(B) differ from 0, else 0.
-
- Since the unary minus has higher precedence than any other operator, for
- example the following expression is valid: x*-y
- Note that the '=' comparison can be inaccurate due to floating point
- precision problems (eg. "sqrt(100)=10" probably returns 0, not 1).
-
- The class supports these functions:
-
- abs(A) : Absolute value of A. If A is negative, returns -A otherwise
- returns A.
- acos(A) : Arc-cosine of A. Returns the angle, measured in radians,
- whose cosine is A.
- acosh(A) : Same as acos() but for hyperbolic cosine.
- asin(A) : Arc-sine of A. Returns the angle, measured in radians, whose
- sine is A.
- asinh(A) : Same as asin() but for hyperbolic sine.
- atan(A) : Arc-tangent of (A). Returns the angle, measured in radians,
- whose tangent is (A).
- atan2(A,B): Arc-tangent of A/B. The two main differences to atan() is
- that it will return the right angle depending on the signs of
- A and B (atan() can only return values betwen -pi/2 and pi/2),
- and that the return value of pi/2 and -pi/2 are possible.
- atanh(A) : Same as atan() but for hyperbolic tangent.
- ceil(A) : Ceiling of A. Returns the smallest integer greater than A.
- Rounds up to the next higher integer.
- cos(A) : Cosine of A. Returns the cosine of the angle A, where A is
- measured in radians.
- cosh(A) : Same as cos() but for hyperbolic cosine.
- cot(A) : Cotangent of A (equivalent to 1/tan(A)).
- csc(A) : Cosecant of A (equivalent to 1/sin(A)).
- eval(...) : This a recursive call to the function to be evaluated. The
- number of parameters must be the same as the number of parameters
- taken by the function. Usually called inside if() to avoid
- infinite recursion.
- exp(A) : Exponential of A. Returns the value of e raised to the power
- A where e is the base of the natural logarithm, i.e. the
- non-repeating value approximately equal to 2.71828182846.
- floor(A) : Floor of A. Returns the largest integer less than A. Rounds
- down to the next lower integer.
- if(A,B,C) : If int(A) differs from 0, the return value of this function is B,
- else C. Only the parameter which needs to be evaluated is
- evaluated, the other parameter is skipped; this makes it safe to
- use eval() in them.
- int(A) : Rounds A to the closest integer. 0.5 is rounded to 1.
- log(A) : Natural (base e) logarithm of A.
- log10(A) : Base 10 logarithm of A.
- max(A,B) : If A>B, the result is A, else B.
- min(A,B) : If A<B, the result is A, else B.
- sec(A) : Secant of A (equivalent to 1/cos(A)).
- sin(A) : Sine of A. Returns the sine of the angle A, where A is
- measured in radians.
- sinh(A) : Same as sin() but for hyperbolic sine.
- sqrt(A) : Square root of A. Returns the value whose square is A.
- tan(A) : Tangent of A. Returns the tangent of the angle A, where A
- is measured in radians.
- tanh(A) : Same as tan() but for hyperbolic tangent.
-
-
- Examples of function string understood by the class:
-
- "1+2"
- "x-1"
- "-sin(sqrt(x^2+y^2))"
- "sqrt(XCoord*XCoord + YCoord*YCoord)"
-
- An example of a recursive function is the factorial function:
-
- "if(n>1, n*eval(n-1), 1)"
-
- Note that a recursive call has some overhead, which makes it a bit slower
- than any other operation. It may be a good idea to avoid recursive functions
- in very time-critical applications. Recursion also takes some memory, so
- extremely deep recursions should be avoided (eg. millions of nested recursive
- calls).
-
- Also note that the if() function is the only place where making a recursive
- call is safe. In any other place it will cause an infinite recursion (which
- will make the program eventually run out of memory). If this is something
- which should be avoided, it may be a good idea to disable the eval()
- function completely.
- The eval() function can be disabled with the DISABLE_EVAL precompiler
- constant (see the beginning of fparser.cc).
-
-
-=============================================================================
- - Contacting the author
-=============================================================================
-
- Any comments, bug reports, etc. should be sent to warp at iki.fi
-
-
-=============================================================================
- - The algorithm used in the library
-=============================================================================
-
- The whole idea behind the algorithm is to convert the regular infix
-format (the regular syntax for mathematical operations in most languages,
-like C and the input of the library) to postfix format. The postfix format
-is also called stack arithmetic since an expression in postfix format
-can be evaluated using a stack and operating with the top of the stack.
-
- For example:
-
- infix postfix
- 2+3 2 3 +
- 1+2+3 1 2 + 3 +
- 5*2+8/2 5 2 * 8 2 / +
- (5+9)*3 5 9 + 3 *
-
- The postfix notation should be read in this way:
-
- Let's take for example the expression: 5 2 * 8 2 / +
- - Put 5 on the stack
- - Put 2 on the stack
- - Multiply the two values on the top of the stack and put the result on
- the stack (removing the two old values)
- - Put 8 on the stack
- - Put 2 on the stack
- - Divide the two values on the top of the stack
- - Add the two values on the top of the stack (which are in this case
- the result of 5*2 and 8/2, that is, 10 and 4).
-
- At the end there's only one value in the stack, and that value is the
-result of the expression.
-
- Why stack arithmetic?
-
- The last example above can give you a hint.
- In infix format operators have precedence and we have to use parentheses to
-group operations with lower precedence to be calculated before operations
-with higher precedence.
- This causes a problem when evaluating an infix expression, specially
-when converting it to byte code. For example in this kind of expression:
- (x+1)/(y+2)
-we have to calculate first the two additions before we can calculate the
-division. We have to also keep counting parentheses, since there can be
-a countless amount of nested parentheses. This usually means that you
-have to do some type of recursion.
-
- The most simple and efficient way of calculating this is to convert it
-to postfix notation.
- The postfix notation has the advantage that you can make all operations
-in a straightforward way. You just evaluate the expression from left to
-right, applying each operation directly and that's it. There are no
-parentheses to worry about. You don't need recursion anywhere.
- You have to keep a stack, of course, but that's extremely easily done.
-Also you just operate with the top of the stack, which makes it very easy.
-You never have to go deeper than 2 items in the stack.
- And even better: Evaluating an expression in postfix format is never
-slower than in infix format. All the contrary, in many cases it's a lot
-faster (eg. because all parentheses are optimized away).
- The above example could be expressed in postfix format:
- x 1 + y 2 + /
-
- The good thing about the postfix notation is also the fact that it can
-be extremely easily expressed in bytecode form.
- You only need a byte value for each operation, for each variable and
-to push a constant to the stack.
- Then you can interpret this bytecode straightforwardly. You just interpret
-it byte by byte, from the beginning to the end. You never have to go back,
-make loops or anything.
-
- This is what makes byte-coded stack arithmetic so fast.
-
-
-
-=============================================================================
- Usage license:
-=============================================================================
-
-Copyright © 2003 Juha Nieminen, Joel Yliluoma
-
- 1. This library is free for non-commercial usage. You can do whatever you
- like with it as long as you don't claim you made it yourself.
-
- 2. It is possible to use this library in a commercial program, but in this
- case you MUST contact me first (warp at iki.fi) and ask express permission
- for this. I want to know what type of program it is going to be, its
- price and so on.
- If you are making a free program or a shareware program with just a
- nominal price (5 US dollars or less), you don't have to ask for
- permission.
- In any case, I DON'T WANT MONEY for the usage of this library. It is
- free, period.
-
- 3. You can make any modifications you want to it so that it conforms your
- needs. If you make modifications to it, you have, of course, credits for
- the modified parts.
-
- 4. If you use this library in your own program, you don't have to provide
- the source code if you don't want to (ie. the source code of your program
- or this library).
- If you DO include the source code for this library, this text file
- must be included in its original intact form.
-
- 5. If you distribute a program which uses this library, and specially if you
- provide the source code, proper credits MUST be included. Trying to
- obfuscate the fact that this library is not made by you or that it is
- free is expressly prohibited. When crediting the usage of this library,
- it's enough to include my name and email address, that is:
- "Juha Nieminen (warp at iki.fi)". Also a URL to the library download page
- would be nice, although not required. The official URL is:
- http://iki.fi/warp/FunctionParser/
-
- 6. And the necessary "lawyer stuff":
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- The software is provided "as is", without warranty of any kind,
- express or implied, including but not limited to the warranties of
- merchantability, fitness for a particular purpose and noninfringement.
- In no event shall the authors or copyright holders be liable for any
- claim, damages or other liability, whether in an action of contract,
- tort or otherwise, arising from, out of or in connection with the
- software or the use or other dealings in the software.
diff --git a/fparser/src/fparser.vcproj b/fparser/src/fparser.vcproj
deleted file mode 100644
index 0b053ef..0000000
--- a/fparser/src/fparser.vcproj
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="fparser"
- ProjectGUID="{17C7BBA1-C51A-45AA-A416-7F975B9C0670}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="..\lib"
- IntermediateDirectory="..\lib"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
- MinimalRebuild="TRUE"
- ExceptionHandling="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- AssemblerListingLocation=".\"
- ObjectFile=".\"
- ProgramDataBaseFileName=".\"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="..\lib\fparser.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- OmitFramePointers="TRUE"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/fparser.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
- <File
- RelativePath="fparser.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc">
- <File
- RelativePath="fparser.h">
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
--
2D CAD system
More information about the debian-science-commits
mailing list