diff --git a/CMakeLists.txt b/CMakeLists.txt index dbd646211..73d162ffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ IF(POLICY CMP0067) CMAKE_POLICY(SET CMP0067 OLD) ENDIF() -PROJECT(fish CXX) +PROJECT(fish) # We are C++11. SET(CMAKE_CXX_STANDARD 11) @@ -93,23 +93,22 @@ SET_SOURCE_FILES_PROPERTIES(src/fish_version.cpp # Set up PCRE2 INCLUDE(cmake/PCRE2.cmake) -# Set up muparser. -INCLUDE(muparser-2.2.5/CMakeLists.txt) - # Set up the docs. INCLUDE(cmake/Docs.cmake) # Define a function to link dependencies. FUNCTION(FISH_LINK_DEPS target) - TARGET_LINK_LIBRARIES(${target} fishlib) + TARGET_LINK_LIBRARIES(${target} fishlib tinyexpr) ENDFUNCTION(FISH_LINK_DEPS) +ADD_LIBRARY(tinyexpr STATIC src/tinyexpr.c src/tinyexpr.h) + # Define libfish.a. ADD_LIBRARY(fishlib STATIC ${FISH_SRCS}) TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS}) TARGET_LINK_LIBRARIES(fishlib ${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS} - ${PCRE2_LIB} muparser ${Intl_LIBRARIES}) + ${PCRE2_LIB} ${Intl_LIBRARIES}) # Define fish. ADD_EXECUTABLE(fish src/fish.cpp) diff --git a/Makefile.in b/Makefile.in index d34d9f286..cd81f821c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,6 +42,7 @@ SHELL := @SHELL@ # Programs # CXX := @CXX@ +CC := @CC@ INSTALL := @INSTALL@ LN_S := @LN_S@ SED := @SED@ @@ -66,15 +67,6 @@ extra_completionsdir = @extra_completionsdir@ extra_functionsdir = @extra_functionsdir@ extra_confdir = @extra_confdir@ -# -# muparser -# -MUPARSER_DIR = muparser-2.2.5 -MUPARSER_LIBDIR = $(MUPARSER_DIR)/lib -MUPARSER_LIB = $(MUPARSER_LIBDIR)/libmuparser.a -MUPARSER_H = $(MUPARSER_DIR)/include/muParser.h -EXTRA_MUPARSER = @EXTRA_MUPARSER@ - # # pcre2 # @@ -89,6 +81,7 @@ EXTRA_PCRE2 = @EXTRA_PCRE2@ # Various flags # CXXFLAGS = @CXXFLAGS@ $(EXTRA_CXXFLAGS) +CFLAGS = @CFLAGS@ CPPFLAGS = -D_UNICODE=1 -DLOCALEDIR=\"$(localedir)\" -DPREFIX=L\"$(prefix)\" -DDATADIR=L\"$(datadir)\" -DSYSCONFDIR=L\"$(sysconfdir)\" -DBINDIR=L\"$(bindir)\" -DDOCDIR=L\"$(docdir)\" -iquote. -iquote./src/ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -124,7 +117,7 @@ FISH_OBJS := obj/autoload.o obj/builtin.o obj/builtin_bg.o obj/builtin_bind.o ob obj/iothread.o obj/kill.o obj/output.o obj/pager.o obj/parse_execution.o \ obj/parse_productions.o obj/parse_tree.o obj/parse_util.o obj/parser.o \ obj/parser_keywords.o obj/path.o obj/postfork.o obj/proc.o obj/reader.o \ - obj/sanity.o obj/screen.o obj/signal.o obj/tokenizer.o obj/tnode.o obj/utf8.o \ + obj/sanity.o obj/screen.o obj/signal.o obj/tinyexpr.o obj/tokenizer.o obj/tnode.o obj/utf8.o \ obj/util.o obj/wcstringutil.o obj/wgetopt.o obj/wildcard.o obj/wutil.o FISH_INDENT_OBJS := obj/fish_indent.o obj/print_help.o $(FISH_OBJS) @@ -503,10 +496,6 @@ ifdef EXTRA_PCRE2 src/builtin_string.cpp: $(PCRE2_H) endif -#ifdef EXTRA_MUPARSER -#src/env.cpp: $(MUPARSER_H) -#endif - # # Generate the internal help functions by making doxygen create # man-pages. The convertion path looks like this: @@ -752,6 +741,10 @@ obj/%.o: src/%.cpp | show-CXX show-CXXFLAGS show-CPPFLAGS obj @echo " CXX $(em)$@$(sgr0)" $v $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ +obj/tinyexpr.o: src/tinyexpr.c | obj + @echo " CC $(em)$@$(sqr0)" + $v $(CC) $(CFLAGS) -c $< -o $@ + # # obj directory # @@ -762,7 +755,7 @@ obj: | show-MKDIR_P # # Build the fish program. # -fish: obj/fish.o $(FISH_OBJS) $(EXTRA_PCRE2) ${EXTRA_MUPARSER} +fish: obj/fish.o $(FISH_OBJS) $(EXTRA_PCRE2) @echo " CXX LD $(em)$@$(sgr0)" $v $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_OBJS) obj/fish.o $(LIBS) -o $@ @@ -774,32 +767,24 @@ $(PCRE2_H): @echo " autoconf $(em)$@$(sgr0)" $v (cd $(PCRE2_DIR) && ./config.status) -$(MUPARSER_LIB): $(MUPARSER_H) - @echo " MAKE $(em)$@$(sgr0)" - $v $(MAKE) V=$(V) -C $(MUPARSER_DIR) CPPFLAGS=-D_UNICODE=1 lib/libmuparser.a - -$(MUPARSER_H): - @echo " autoconf $(em)$@$(sgr0)" - $v (cd $(MUPARSER_DIR) && ./config.status) - # # Build the fish_tests program. # -fish_tests: $(FISH_TESTS_OBJS) $(EXTRA_PCRE2) ${EXTRA_MUPARSER} +fish_tests: $(FISH_TESTS_OBJS) $(EXTRA_PCRE2) @echo " CXX LD $(em)$@$(sgr0)" $v $(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $(FISH_TESTS_OBJS) $(LIBS) -o $@ # # Build the fish_indent program. # -fish_indent: $(FISH_INDENT_OBJS) $(EXTRA_PCRE2) ${EXTRA_MUPARSER} +fish_indent: $(FISH_INDENT_OBJS) $(EXTRA_PCRE2) @echo " CXX LD $(em)$@$(sgr0)" $v $(CXX) $(CXXFLAGS) $(LDFLAGS) $(FISH_INDENT_OBJS) $(LIBS) -o $@ # # Build the fish_key_reader program to show input from the terminal. # -fish_key_reader: $(FISH_KEYREAD_OBJS) $(EXTRA_PCRE2) ${EXTRA_MUPARSER} +fish_key_reader: $(FISH_KEYREAD_OBJS) $(EXTRA_PCRE2) @echo " CXX LD $(em)$@$(sgr0)" $v $(CXX) $(CXXFLAGS) $(LDFLAGS_FISH) $^ $(LIBS) -o $@ @@ -852,8 +837,6 @@ style-all: distclean: clean -$v test ! -f $(PCRE2_DIR)/Makefile || \ $(MAKE) V=$(V) -C $(PCRE2_DIR) distclean - -$v test ! -f $(MUPARSER_DIR)/Makefile || \ - $(MAKE) V=$(V) -C $(MUPARSER_DIR) distclean $v rm -rf config.status config.log config.h Makefile autom4te.cache aclocal.m4 .PHONY: distclean @@ -872,15 +855,10 @@ clean: ifeq ($(V), 0 ) -@test ! -f $(PCRE2_DIR)/Makefile || \ $(MAKE) -C $(PCRE2_DIR) clean - -@test ! -f $(MUPARSER_DIR)/Makefile || \ - $(MAKE) -C $(MUPARSER_DIR) clean else -@test ! -f $(PCRE2_DIR)/Makefile || \ $(MAKE) -s -C $(PCRE2_DIR) clean > /dev/null || \ $(MAKE) -s -C $(PCRE2_DIR) clean - -@test ! -f $(MUPARSER_DIR)/Makefile || \ - $(MAKE) -s -C $(MUPARSER_DIR) clean > /dev/null || \ - $(MAKE) -s -C $(MUPARSER_DIR) clean endif $v rm -f obj/*.o *.o doc.h doc.tmp $v rm -f doc_src/*.doxygen doc_src/*.cpp doc_src/*.o doc_src/commands.hdr @@ -1016,7 +994,7 @@ obj/builtin_jobs.o: src/parse_tree.h src/parse_constants.h src/tokenizer.h obj/builtin_jobs.o: src/wgetopt.h src/wutil.h obj/builtin_math.o: config.h src/builtin.h src/common.h src/fallback.h obj/builtin_math.o: src/signal.h src/builtin_math.h src/io.h src/env.h -obj/builtin_math.o: src/wgetopt.h src/wutil.h +obj/builtin_math.o: src/tinyexpr.h src/wgetopt.h src/wutil.h obj/builtin_printf.o: config.h src/builtin.h src/common.h src/fallback.h obj/builtin_printf.o: src/signal.h src/io.h src/env.h src/wutil.h obj/builtin_pwd.o: config.h src/builtin.h src/common.h src/fallback.h diff --git a/build_tools/lint.fish b/build_tools/lint.fish index 41c4d5bf1..266c15027 100755 --- a/build_tools/lint.fish +++ b/build_tools/lint.fish @@ -134,14 +134,14 @@ if set -q c_files[1] oclint-xcodebuild xcodebuild.log >/dev/null end if test $all = yes - oclint-json-compilation-database -e '/pcre2-10.22/' -e '/muparser-2.2.5/' -- -enable-global-analysis 2>&1 + oclint-json-compilation-database -e '/pcre2-10.22/' -- -enable-global-analysis 2>&1 else set i_files for f in $c_files set i_files $i_files -i $f end - echo oclint-json-compilation-database -e '/pcre2-10.22/' -e '/muparser-2.2.5/' $i_files - oclint-json-compilation-database -e '/pcre2-10.22/' -e '/muparser-2.2.5/' $i_files 2>&1 + echo oclint-json-compilation-database -e '/pcre2-10.22/' $i_files + oclint-json-compilation-database -e '/pcre2-10.22/' $i_files 2>&1 end else # Presumably we're on Linux or other platform not requiring special diff --git a/build_tools/style.fish b/build_tools/style.fish index a5889cb4e..645863882 100755 --- a/build_tools/style.fish +++ b/build_tools/style.fish @@ -29,7 +29,7 @@ if test $all = yes echo exit 1 end - set c_files src/*.h src/*.cpp muparser-2.2.5/src/*.cpp muparser-2.2.5/include/*.h + set c_files src/*.h src/*.cpp src/*.c # For now we don't restyle all fish scripts other than completion scripts. That's because people # really like to vertically align the elements of the `complete` command and fish_indent # currently does not honor that whitespace. diff --git a/configure.ac b/configure.ac index 1640984d7..c41ee59f8 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,6 @@ AC_SUBST(HAVE_DOXYGEN) AC_SUBST(LDFLAGS_FISH) AC_SUBST(WCHAR_T_BITS) AC_SUBST(EXTRA_PCRE2) -AC_SUBST(EXTRA_MUPARSER) # # If needed, run autoconf to regenerate the configure file @@ -682,26 +681,6 @@ if test "x$included_pcre2" = "xyes"; then LIBS="$LIBS $PCRE2_LIBS" fi - - -# ======== -# MuParser math expression library configuration. -EXTRA_MUPARSER= - -# Build configure/Makefile for muparser -AC_MSG_NOTICE([using included MuParser library]) -# unfortunately these get added to the global configuration -ac_configure_args="$ac_configure_args --enable-shared=no --enable-samples=no --enable-debug=no" -AC_CONFIG_SUBDIRS([muparser-2.2.5]) - -MUPARSER_CXXFLAGS='-I$(MUPARSER_DIR)/include' -MUPARSER_LIBS='-L$(MUPARSER_LIBDIR) -lmuparser' - -# Make the binary depend on the MuParser libraries so they get built -EXTRA_MUPARSER='$(MUPARSER_LIB)' -CXXFLAGS="$CXXFLAGS $MUPARSER_CXXFLAGS" -LIBS="$LIBS $MUPARSER_LIBS" - # Allow configurable extra directories. AC_SUBST(extra_completionsdir) AC_ARG_WITH([extra-completionsdir], diff --git a/doc_src/math.txt b/doc_src/math.txt index 29755a3f5..2a3ea5fbe 100644 --- a/doc_src/math.txt +++ b/doc_src/math.txt @@ -7,14 +7,10 @@ math [-sN | --scale=N] [--] EXPRESSION \subsection math-description Description -`math` is used to perform mathematical calculations. It supports all the usual operations such as addition, subtraction, etc. As well as functions like `abs()`, `sqrt()` and `log2()`. It also has several basic statistical functions like `min()`, `max`, and `avg()`. Internally all calculations are performed using floating point representation. Integer values are first converted to floating point before being used. The default output format is integer which causes floating point results to be rounded down to the nearest integer. The `--scale` option can be used to get floating point output. - -The `math` command is based on the MuParser library which is documented here. The stock MuParser does not support the modulo, `%`, operator but fish implements it using integer semantics. +`math` is used to perform mathematical calculations. It supports all the usual operations such as addition, subtraction, etc. As well as functions like `abs()`, `sqrt()` and `log2()`. Internally all calculations are performed using floating point representation. Integer values are first converted to floating point before being used. The default output format is integer which causes floating point results to be rounded down to the nearest integer. The `--scale` option can be used to get floating point output. Keep in mind that parameter expansion takes before expressions are evaluated. This can be very useful in order to perform calculations involving shell variables or the output of command substitutions, but it also means that parenthesis and the asterisk glob character have to be escaped or quoted. -The `math` command can evaluate multiple expressions separated by commas. The result of each expression is written on a separate line. This means you can evaluate multiple expressions and capture the results in a single invocation just like you can with commands like `string`. See the examples below. - The following options are available: - `-sN` or `--scale=N` sets the scale of the result. `N` must be an integer and defaults to zero. A scale of zero causes results to be rounded down to the nearest integer. So `3/2` returns `1` rather than `2` which `1.5` would normally round to. This is for compatibility with `bc` which was the basis for this command prior to fish 3.0.0. Scale values greater than zero causes the result to be rounded using the usual rules to the specified number of decimal places. @@ -23,11 +19,70 @@ The following options are available: If the expression is successfully evaluated the return `status` is zero (success) else one. +\subsection math-syntax + +`math` knows some operators, constants, functions and can (obviously) read numbers. + +For numbers, `.` is always the radix character regardless of locale - `2.5`, not `2,5`. Scientific notation (`10e5`) is also available. + +\subsection math-operators + +`math` knows the following operators: + +- `+` for addition and `-` for subtraction. + +- `*` for multiplication, `/` for division. + +- `^` for exponentiation. + +- `%` for modulo. + +- `(` and `)` for grouping. + +They are all used in an infix manner - `5 + 2`, not `+ 5 2`. + +\subsection math-constants + +`math` knows the following constants: + +- `e` - Euler's number. +- `pi` - You know that one. Half of Tau. + +Use them without a leading `$`. + +\subsection math-functions + +`math` supports the following functions: + +- `abs` +- `acos` +- `asin` +- `atan` +- `atan2` +- `ceil` +- `cos` +- `cosh` +- `exp` - the base-e exponential function +- `fac` - factorial +- `floor` +- `ln` +- `log` or `log10` - the base-10 logarithm +- `ncr` +- `npr` +- `pow(x,y)` returns x to the y (and can be written as `x ^ y`) +- `sin` +- `sinh` +- `sqrt` +- `tan` +- `tanh` + +All of the trigonometric functions use radians. + \subsection math-example Examples `math 1+1` outputs 2. -`math status - 128` outputs the numerical exit status of the last command minus 128. +`math $status - 128` outputs the numerical exit status of the last command minus 128. `math 10 / 6` outputs `1`. @@ -35,23 +90,11 @@ If the expression is successfully evaluated the return `status` is zero (success `math -s3 10 / 6` outputs `1.666`. -Capture the result of three expressions: - -\fish -$ set x 5 -$ set results (math "$x+$x, $x*3, $x^2") -$ set --show results -$results: not set in local scope -$results: set in global scope, unexported, with 3 elements -$results[1]: length=2 value=|10| -$results[2]: length=2 value=|15| -$results[3]: length=2 value=|25| -$results: not set in universal scope -\endfish +`math "sin(pi)"` outputs `0`. \subsection math-notes Compatibility notes -Fish 1.x and 2.x releases relied on the `bc` command for handling `math` expressions. Starting with fish 3.0.0 fish uses the MuParser library and evaluates the expression without the involvement of any external commands. +Fish 1.x and 2.x releases relied on the `bc` command for handling `math` expressions. Starting with fish 3.0.0 fish uses the tinyexpr library and evaluates the expression without the involvement of any external commands. You don't need to use `--` before the expression even if it begins with a minus sign which might otherwise be interpreted as an invalid option. If you do insert `--` before the expression it will cause option scanning to stop just like for every other command and it won't be part of the expression. diff --git a/muparser-2.2.5/CMakeLists.txt b/muparser-2.2.5/CMakeLists.txt deleted file mode 100644 index 64b49fe84..000000000 --- a/muparser-2.2.5/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -SET(MUPARSER_SRCS - ${CMAKE_CURRENT_LIST_DIR}/src/muParser.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserBase.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserBytecode.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserCallback.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserError.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserInt.cpp - ${CMAKE_CURRENT_LIST_DIR}/src/muParserTokenReader.cpp) - -ADD_LIBRARY(muparser STATIC ${MUPARSER_SRCS}) -TARGET_INCLUDE_DIRECTORIES(muparser PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) - -FILE(GLOB MUPARSER_HEADERS ${CMAKE_CURRENT_LIST_DIR}/include/*.h) -TARGET_SOURCES(muparser PRIVATE ${MUPARSER_HEADERS}) diff --git a/muparser-2.2.5/Changes.txt b/muparser-2.2.5/Changes.txt deleted file mode 100644 index 87077a5d9..000000000 --- a/muparser-2.2.5/Changes.txt +++ /dev/null @@ -1,557 +0,0 @@ -####################################################################### -# # -# # -# __________ # -# _____ __ __\______ \_____ _______ ______ ____ _______ # -# / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ # -# | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ # -# |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| # -# \/ \/ \/ \/ # -# Fast math parser Library # -# # -# Copyright (C) 2015 Ingo Berg # -# # -# Web: muparser.beltoforion.de # -# e-mail: muparser@beltoforion.de # -# # -# # -####################################################################### - - -History: --------- - -Rev 2.2.5: 27.04.2015 ---------------------- - Changes: - * example2 extended to work with UNICODE character set - * Applied patch from Issue 9 - - Bugfixes: - * muChar_t in muParserDLL.h was not set properly when UNICODE was used - * muparser.dll did not build on UNICODE systems - -Rev 2.2.4: 02.10.2014 ---------------------- - Changes: - * explicit positive sign allowed - - Bugfixes: - * Fix for Issue 6 (https://code.google.com/p/muparser/issues/detail?id=6) - * String constants did not work properly. Using more than a single one - was impossible. - * Project Files for VS2008 and VS2010 removed from the repository - * Fix for Issue 4 (https://code.google.com/p/muparser/issues/detail?id=4) - * Fix for VS2013 64 bit build option - * return type of ParserError::GetPos changed to int - * OpenMP support enabled in the VS2013 project files and precompiled windows DLL's - * Bulkmode did not evaluate properly if "=" and "," operator was used in the expression - -Rev 2.2.3: 22.12.2012 ---------------------- - - Removed features: - * build files for msvc2005, borland and watcom compiler were removed - - Bugfixes: - * Bugfix for Intel Compilers added: The power operator did not work properly - with Intel C++ composer XE 2011. - (see https://sourceforge.net/projects/muparser/forums/forum/462843/topic/5117983/index/page/1) - * Issue 3509860: Callbacks of functions with string parameters called twice - (see http://sourceforge.net/tracker/?func=detail&aid=3509860&group_id=137191&atid=737979) - * Issue 3570423: example1 shows slot number in hexadecimal - (see https://sourceforge.net/tracker/?func=detail&aid=3570423&group_id=137191&atid=737979) - * Fixes for compiling with the "MUP_MATH_EXCEPTIONS" macro definition: - - division by zero in constant expressions was reported with the code "ec_GENERIC" - instead of "ecDIV_BY_ZERO" - - added throwing of "ecDOMAIN_ERROR" to sqrt and log functions - - -Rev 2.2.2: 18.02.2012 ---------------------- - Bugfixes: - * Optimizer did'nt work properly for division: - (see https://sourceforge.net/projects/muparser/forums/forum/462843/topic/5037825) - -Rev 2.2.1: 22.01.2012 ---------------------- - Bugfixes: - * Optimizer bug in 64 bit systems fixed - (see https://sourceforge.net/projects/muparser/forums/forum/462843/topic/4977977/index/page/1) - -Rev 2.2.0: 22.01.2012 ---------------------- - Improvements: - * Optimizer rewritten and improved. In general: more optimizations are - now applied to the bytecode. The downside is that callback Functions - can no longer be flagged as non-optimizable. (The flag is still present - but ignored) This is necessary since the optimizer had to call the - functions in order to precalculate the result (see Bugfixes). These calls - posed a problems for callback functions with side effects and if-then-else - clauses in general since they undermined the shortcut evaluation prinziple. - - Bugfixes: - * Infix operators where not properly detected in the presence of a constant - name starting with an underscore which is a valid character for infix - operators too (i.e. "-_pi"). - * Issue 3463353: Callback functions are called twice during the first call to eval. - * Issue 3447007: GetUsedVar unnecessaryly executes callback functions. - - -Rev 2.1.0: 19.11.2011 ---------------------- - New feature: - * Function atan2 added - - Bugfixes: - * Issue 3438380: Changed behaviour of tellg with GCC >4.6 led to failures - in value detection callbacks. - * Issue 3438715: only "double" is a valid MUP_BASETYPE - MUP_BASETYPE can now be any of: - float, - double, - long double, - short, - unsigned short, - unsigned int, - long, - unsigned long. - Previousely only floating point types were allowed. - Using "int" is still not allowed! - * Compiler issues with GCC 4.6 fixed - * Custom value recognition callbacks added with AddValIdent had lower - priority than built in functions. This was causing problems with - hex value recognition since detection of non hex values had priority - over the detection of hex values. The "0" in the hex prefix "0x" would - be read as a separate non-hex number leaving the rest of the expression - unparseable. - -Rev 2.0.0: 04.09.2011 ---------------------- -This release introduces a new version numbering scheme in order to make -future changes in the ABI apparent to users of the library. The number is -now based on the SONAME property as used by GNU/Linux. - - Changes: - * Beginning with this version all version numbers will be SONAME compliant - * Project files for MSVC2010 added - * Project files for MSVC2003 removed - * Bytecode parsing engine cleaned up and rewritten - * Retrieving all results of expressions made up of comma separate - subexpressions is now possible with a new Eval overload. - * Callback functions with fixed number of arguments can now have up to 10 - Parameters (previous limit was 5) - - New features: - * ternary if-then-else operator added (C++ like; "(...) ? ... : ..." ) - * new intrinsic binary operators: "&&", "||" (logical and, or) - * A new bulkmode allows submitting large arrays as variables to compute large - numbers of expressions with a single call. This can drastically improve - parsing performance when interfacing the library from managed languages like - C#. (It doesn't bring any performance benefit for C++ users though...) - - Removed features: - * intrinsic "and", "or" and "xor" operators have been removed. I'd like to let - users the freedom of defining them on their own versions (either as logical or bitwise - operators). - * Implementation for complex numbers removed. This was merely a hack. If you - need complex numbers try muParserX which provides native support for them. - (see: http://beltoforion.de/muparserx/math_expression_parser_en.html) - - Bugfixes: - * User defined operators could collide with built in operators that entirely - contained their identifier. i.e. user defined "&" would not work with the built - in "&&" operator since the user defined operator was detected with a higher - priority resulting in a syntax error. - * Detection of unknown variables did not work properly in case a postfix operator - was defined which was part of the undefined variable. - i.e. If a postfix operator "m" was defined expressions like "multi*1.0" did - not detect "multi" as an undefined variable. - (Reference: http://sourceforge.net/tracker/index.php?func=detail&aid=3343891&group_id=137191&atid=737979) - * Postfix operators sharing the first few characters were causing bogus parsing exception. - (Reference: https://sourceforge.net/tracker/?func=detail&aid=3358571&group_id=137191&atid=737979) - -Rev 1.34: 04.09.2010 --------------------- - Changes: - * The prefix needed for parsing hex values is now "0x" and no longer "$". - * AddValIdent reintroduced into the DLL interface - - New features: - * The associativity of binary operators can now be changed. The pow operator - is now right associative. (This is what Mathematica is using) - * Seperator can now be used outside of functions. This allows compound - expressions like: - "a=10,b=20,c=a*b" The last "argument" will be taken as the return value - - Bugfixes: - * The copy constructor did not copy binary operator definitions. Those were lost - in the copied parser instance. - * Mixing special characters and alphabetic characters in binary operator names - led to inconsistent parsing behaviour when parsing expressions like "a ++ b" - and "a++b" when "++" is defined as a binary operator. Binary operators must - now consist entirely of special characters or of alphabetic ones. - (original bug report: https://sourceforge.net/projects/muparser/forums/forum/462843/topic/3696881/index/page/1) - * User defined operators were not exactly handled like built in operators. This - led to inconsistencies in expression evaluation when using them. The results - differed due to slightly different precedence rules. - * Using empty string arguments ("") would cause a crash of muParser - - -Rev 1.32: 29.01.2010 --------------------- - - Changes: - * "example3" renamed to "example2" - * Project/Makefiles files are now provided for: - - msvc2003 - - msvc2005 - - msvc2008 - - watcom (makefile) - - mingw (makefile) - - bcc (makefile) - * Project files for borland cpp builder were removed - - - New features: - * Added function returning muparsers version number - * Added function for resetting the locale - - - Bugfixes: - * Changes example1 in order to fix issues with irritating memory leak reports. - Added conditional code for memory leak detection with MSVC in example1. - (see: http://www.codeproject.com/KB/recipes/FastMathParser.aspx?msg=3286367#xx3286367xx) - * Fixed some warnings for gcc - - - -Rev 1.31cp: 15.01.2010 (Maintainance release for CodeProject) ----------------------- - - Changes: - * Archive structure changed - * C# wrapper added - * Fixed issued that prevented compiling with VS2010 Beta2 - - -Rev 1.30: 09.06.2008 --------------------- - - Changes: - * Epsilon of the numerical differentiation algorithm changed to allow greater accuracy. - - New features: - * Setting thousands separator and decimal separator is now possible - - Bugfixes: - * The dll interface did not provide a callback for functions without any arguments. - - -Rev 1.29: Januar 2008 ---------------------- - - Unrelease Version available only via SVN. - - -Rev 1.28: 02. July, 2007 ---------------------------- - - Library changes: - * Interface for the dynamic library changed and extended to create an interface - using pure C functions only. - * mupInit() removed - - Build system: - * MSVC7 Project files removed in favor of MSVC8 - - Bugfixes: - * The dynamic library did not build on other systems than linux due to a misplaced - preprocessor definition. This is fixed now. - - -Rev 1.27: ---------------------------- - - Build system: - * Modified build\ directory layout introducing some subfolders - for the various IDE supported - * Project files for BCB and MSVC7 added - * Switched to use bakefile 0.2.1 which now correctly creates the - "make uninstall" target for autoconf's Makefile.in - * Now the library debug builds are named "muparserd" instead of "muparser" - to allow multiple mixed release/debug builds to coexist; so e.g. on Windows - when building with DEBUG=1, you'll get "muparserd.lib" instead of "muparser.lib" - - New Features: - * Factory functions can now take a user defined pointer - * String functions can now be used with up to two additional - double parameters - * Support for UNICODE character types added - * Infix operator priority can now be changed by the user - - Bugfixes: - * An internal error was raised when evaluating an empty - expressions - * The error message raised in case of name collisions between - implicitely defined variables and postfix operators did contain - misleading data. - - -Rev 1.26: (unofficial release) ------------------------------- - - New Features: - * Unary operator precedence can now be changed by the user. - - -Rev 1.25: 5. February, 2006 ---------------------------- - - Build system: (special thanks to Francesco Montorsi for implementing it!) - * created a bakefile-based build system which adds support for the following win32 compilers: - -> MS visual C++ (6 and .NET) - -> BorlandC++ (5 or greater) - -> Mingw32 (tested with gcc 3.2) - -> Watcom (not tested) - and for GCC on Unix (using a standard autoconf's configure script). - - Compatibility improvements: - * fixed some small warnings when using -Wall with GCC on Unix - * added inclusion guards for win32-specific portions of code - * added fixes that remove compiler warnings on Intel C++ and the Solaris C++ compiler. - - -Rev 1.24: 29. October, 2005 ---------------------------- - -Changes: - - Compatibility improvements: - * parser now works on 64 bit compilers - * (bytecode base datatype can now be changed freely) - - -Rev 1.23: 19. October, 2005 ---------------------------- - -Changes: - - Bugfixes: - * Variable factory examples in Example1.cpp and Example3.cpp contained a subtle bug. - - New features: - * Added a MSVC6 project file and introduced muParserFixes.h in order to make it compile with MSVC6 - - -Rev 1.22: October, 2005 ------------------------ - -Release notes: - -All features of Version 1.22 are similar to Version 1.21. Version 1.22 fixes a compilation issue with -gcc 4.0. In order to fix this issue I rewrote part of the library to remove some unnecessary templates. -This should make the code cleaner. The Borland Project files were removed. If you want to use it -with Borland either use the dll version or create your own project files. I can't support it since I don't -have this compiler at hand. - -Changes: - - Project Changes: - * Borland project files removed - (The code should still compile with BCB but I cant provide you with project files) - - Internal Changes: - * unnecessary template files have been removed: - - new files: muParserError.cpp, muParserTokenReader.cpp, muParserCallback.cpp - - removed Files: muIParserTypes.h - - -Rev 1.2 / 1.21: April, 2005 ---------------------------- - -Release Notes: -First of all the interface has changed so this version is not backwards compatible. -After receiving a couple of questions about it, this version features support for -user defined binary operators. Consequently the built in operators can now be -turned off, thus you can deactivate them and write complete customized parser -subclasses that only contain the functionality you want. Another new feature is -the introduction of callback functions taking string arguments, implicit -generation of variables and the Assignement operator. - - Functionality - * New built in operator: xor; Logical xor. - * New built in operator: Assignement operator; Defining variables in terms of - other variables/constants - * New feature: Strings as arguments for callback functions - * New feature: User defined binary operators - * New feature: ParserInt a class with a sample implementation for - integer numbers. - * New feature: Callbacks to value regognition functions. - - * Removed: all predefined postfix operators have been removed. - * New project file: Now comes with a ready to use windows DLL. - * New project file: Makefile for cygwin now included. - * New example: Example3 shows usage of the DLL. - - Interface changes - * New member function: DefineOprt For adding user defined binary operators. - * New member function: EnableBuiltInOprt(bool) Enables/Disables built in - binary operators. - * New member function: AddValIdent(...) to add callbacks for custom value - recognition functions. - * Removed: SetVar(), SetConst(). - * Renamed: Most interface functions have been renamed - * Changed: The type for multiargument callbacks multfun_type has changed. - It no longer takes a std::vector as input. - - Internal changes - * new class muParserTokenReader.h encapsulates the token identification - and token assignement. - * Internal handling of function callbacks unified as a result the performance - of the bytecode evaluation increased. - - -Rev 1.10 : December 30, 2004 ----------------------------- - -Release Notes: -This version does not contain major new feature compared to V1.07 but its internal structure has -changed significantly. The String parsing routine is slower than the one of V1.07 but bytecode -parsing is equally fast. On the other hand the error messages of V1.09 are more flexible and you -can change its value datatype. It should work on 64-bit systems. For this reason I supply both -versions for download. If you use V1.07 and are happy with it there is no need for updating -your version. - - * New example program: Archive now contains two demo programs: One for standard C++ and one for - managed C++. - * New member function: RemoveVar(...) can be used for removing a single variable from the internal - storage. - * New member function: GetVar() can be used for querying the variable names and pointers of all - variables defined in the parser. - * New member function: GetConst() can be used for querying all defined constants and their values. - * New member function: GetFunDef() can be used for querying all defined functions and the number of - arguments they expect. - * Internal structure changed; hanging base datatype at compile time is now possible. - * Bugfix: Postfix operator parsing could fail in certain cases; This has been fixed now. - * Bugfix: Variable names must will now be tested if they conflict with constant or function names. - * Internal change: Removed most dependencies from the C-string libraries. - * Internal change: Bytecode is now stored in a separate class: ParserByteCode.h - * Internal change: GetUsedVar() does no longer require that variables are defined at time of call. - * Internal change: Error treatment changed. ParserException is no longer derived from - std::runtime_error; Internal treatment of Error messages changed. - * New functions in Parser interface: ValidNameChars(), ValidOprtChars() and ValidPrefixOprtChars() - they are used for defining the charset allowed for variable-, operator- and - function names. - - -Rev 1.09 : November 20, 2004 ----------------------------- - - * New member function: RemoveVar(...) can be used for removing a single variable from the internal - storage. - * Internal structure changed; changing base datatype at compile time is now possible. - * Bug fix: Postfix operator parsing could fail in certain cases; This has been fixed now. - * Internal change: Removed most dependencies from the C-string libraries. - * Internal change: Bytecode is now stored in a seperate class: ParserByteCode.h. - * Internal change: GetUsedVar() does no longer require that variables are defined at time of call. - * Internal change: Error treatment changed. ParserException is no longer derived from - std::runtime_error; Internal treatment of Error messages changed. - * New functions in Parser interface; ValidNameChars(), ValidOprtChars() and ValidPrefixOprtChars() - they are used for defining the charset allowed for variable-, operator- and function names. - - -Rev 1.08 : November, 2004 -------------------------- - - * unpublished; experimental template version with respect to data type and underlying string - type (string <-> widestring). The idea was dropped... - - -Rev 1.07 : September 4 2004 ---------------------------- - - * Improved portability; Changes to make life for MSVC 6 user easier, there are probably still some - issues left. - * Improved portability; Changes in order to allow compiling on BCB. - * New function; value_type Diff(value_type *a_Var, value_type a_fPos) 4th order Differentiation with - respect to a certain variable; added in muParser.h. - - -Rev 1.06 : August 20 2004 -------------------------- - - * Volatile functions added; All overloaded AddFun(...) functions can now take a third parameter - indicating that the function can not be optimized. - * Internal changes: muParserStack.h simplified; refactorings - * Parser is now distributed under the MIT License; all comments changed accordingly. - - -Rev 1.05 : August 20 2004 -------------------------- - - * Variable/constant names will now be checked for invalid characters. - * Querying the names of all variables used in an expression is now possible; new function: GetUsedVar(). - * Disabling bytecode parsing is now possible; new function: EnableByteCode(bool bStat). - * Predefined functions with variable number of arguments added: sum, avg, min, max. - * Unary prefix operators added; new functions: AddPrefixOp(...), ClearPrefixOp(). - * Postfix operator interface names changed; new function names: AddPostfixOp(...), ClearPostfixOp(). - * Hardcoded sign operators removed in favor of prefix operators; bytecode format changed accordingly. - * Internal changes: static array removed in Command code calculation routine; misc. changes. - - -Rev 1.04 : August 16 2004 -------------------------- - - * Support for functions with variable number of arguments added. - * Internal structure changed; new: ParserBase.h, ParserBase.cpp; removed: ParserException.h; - changed: Parser.h, Parser.cpp. - * Bug in the bytecode calculation function fixed (affected the unary minus operator). - * Optimizer can be deactivated; new function: EnableOptimizer(bool bStat). - - -Rev 1.03 : August 10 2004 -------------------------- - - * Support for user-defined unary postfix operators added; new functions: AddPostOp(), InitPostOp(), - ClearPostOp(). - * Minor changes to the bytecode parsing routine. - * User defined functions can now have up to four parameters. - * Performance optimized: simple formula optimization added; (precalculation of constant parts of the - expression). - * Bug fixes: Multi-arg function parameters, constant name lookup and unary minus did not work properly. - - -Rev 1.02 : July 30 2004 ------------------------ - - * Support for user defined constants added; new functions: InitConst(), AddConst(), SetConst(), - ClearConst(). - * Single variables can now be added using AddVar(); you have now the choice of adding them either - one by one or all at the same time using SetVar(const varmap_type &a_vVar). - * Internal handling of variables changed, is now similar to function handling. - * Virtual destructor added; InitFun(), InitConst() are now virtual too thus making it possible to - derive new parsers with a modified set of default functions and constants. - * Support for user defined functions with 2 or 3 parameters added; bytecode format changed to hold - function parameter count. - - -Rev 1.01 : July 23 2004 ------------------------ - - * Support for user defined functions has been added; new functions: AddFun(), ClearFun(), - InitFunctions(). - * Built in constants have been removed; the parser contained undocumented built in - constants pi, e. - There was the possibility of name conflicts with user defined variables. - * Setting multiple variables with SetVar can now be done with a map of names and pointers as the only - argument. For this reason, a new type Parser::varmap_type was added. The old version that took 3 - arguments (array of names, array of pointers, and array length) is now marked as deprecated. - * The names of logarithm functions have changed. The new names are: log2 for base 2, log10 or log for - base 10, and ln for base e. - - -Rev 1.00 : July 21 2004 ------------------------ - - * Initial release diff --git a/muparser-2.2.5/Install.txt b/muparser-2.2.5/Install.txt deleted file mode 100644 index ed8ae9728..000000000 --- a/muparser-2.2.5/Install.txt +++ /dev/null @@ -1,133 +0,0 @@ -####################################################################### -# # -# # -# __________ # -# _____ __ __\______ \_____ _______ ______ ____ _______ # -# / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ # -# | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ # -# |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| # -# \/ \/ \/ \/ # -# Fast math parser Library # -# # -# Copyright (C) 2012 Ingo Berg # -# # -# Web: muparser.beltoforion.de # -# e-mail: muparser@beltoforion.de # -# # -# # -####################################################################### - - - - Contents - ======== - - 1. Installation on win32 - 2. Installation on unix - 2.1 Other miscellaneous info Unix-specific - 3. Where to ask for help - - - - 1. Installation on win32 - ======================== - - muParser supports various win32 command-line compilers: - -> mingw - -> watcom - -> microsoft CL - and provides also the project files for MSVC6 IDE. - - In order to compile muParser from makefiles, open an MSDOS - prompt and then move to the muParser/build directory and - type: - - mingw32-make -fmakefile.mingw for mingw - nmake -fmakefile.vc for msvc - make -fmakefile.bcc for borland - wmake -fmakefile.wat for watcom - - All makefiles supports the following options: - - # Set to 1 to build debug version [0,1] - # 0 - Release - # 1 - Debug - DEBUG = 0 - - # Set to 1 to build shared (DLL) version [0,1] - # 0 - Static - # 1 - DLL - SHARED = 0 - - # Set to 1 to compile samples [0,1] - SAMPLES = 1 - - The muParser library is created in the 'lib' folder and the sample - binaries are created in samples\example1 or samples\example2. - - NOTE: samples\example1 can be compiled *only* when building - muParser as a STATIC library (SHARED=0). - samples\example2 can be compiled *only* when building - muParser as a SHARED library (SHARED=1). - - - - 2. Installation on Unix/Linux - ============================= - - muParser can be installed just extracting the sources somewhere - and then, from a terminal, typing: - - cd [path to muParser] - ./configure [--enable-shared=yes/no] [--enable-samples=yes/no] - [--enable-debug=yes/no] - make - [sudo*] make install - [sudo*] ldconfig - cd samples/example1 - ./example1 - - * = this command must be executed with root permissions and thus - you have to use 'sudo' or just 'su' to gain root access. - Note that installation and ldconfig are not strictly required unless - you built in shared mode. - - The "make" step will create the muParser library in 'lib' and the - sample binary in samples/example1. - The samples/example2 is win32-specific and thus won't be built. - - - - 2.1 Other miscellaneous info Unix-specific - ========================================== - - If you don't like to have your muParser folder filled by temporary - files created by GCC, then you can do the following: - - mkdir mybuild && cd mybuild && ../configure && make - - to put all object files in the "mybuild" directory. - - If you want to use muParser library in your programs, you can use - the pkg-config program (this works only if muParser was installed - with 'make install' !). The commands: - - pkg-config muparser --cflags - pkg-config muparser --libs - - will return all useful info you need to build your programs against - muParser ! - - - - 3. Where to ask for help - ======================== - - If you find problems with either compilation, installation or usage - of muParser, then you can ask in the muParser forum at: - - https://sourceforge.net/forum/forum.php?forum_id=462843 - - For more info about muParser, visit: - http://sourceforge.net/projects/muparser/ - http://muparser.sourceforge.net diff --git a/muparser-2.2.5/License.txt b/muparser-2.2.5/License.txt deleted file mode 100644 index 642865636..000000000 --- a/muparser-2.2.5/License.txt +++ /dev/null @@ -1,35 +0,0 @@ -####################################################################### -# # -# # -# __________ # -# _____ __ __\______ \_____ _______ ______ ____ _______ # -# / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ # -# | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ # -# |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| # -# \/ \/ \/ \/ # -# Fast math parser Library # -# # -# Copyright (C) 2011 Ingo Berg # -# # -# Web: muparser.beltoforion.de # -# e-mail: muparser@beltoforion.de # -# # -# # -####################################################################### - - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. - OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/muparser-2.2.5/Makefile.in b/muparser-2.2.5/Makefile.in deleted file mode 100644 index 712999ac9..000000000 --- a/muparser-2.2.5/Makefile.in +++ /dev/null @@ -1,286 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.9 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - -@MAKE_SET@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -datarootdir = @datarootdir@ -INSTALL = @INSTALL@ -SHARED_LD_CXX = @SHARED_LD_CXX@ -LIBEXT = @LIBEXT@ -LIBPREFIX = @LIBPREFIX@ -SO_SUFFIX = @SO_SUFFIX@ -DLLIMP_SUFFIX = @DLLIMP_SUFFIX@ -EXEEXT = @EXEEXT@ -LN_S = @LN_S@ -SETFILE = @SETFILE@ -PIC_FLAG = @PIC_FLAG@ -SONAME_FLAG = @SONAME_FLAG@ -STRIP = @STRIP@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_DIR = @INSTALL_DIR@ -BK_DEPS = @BK_DEPS@ -srcdir = @srcdir@ -top_builddir = @top_builddir@ -libdir = @libdir@ -DLLPREFIX = @DLLPREFIX@ -LIBS = @LIBS@ -AR = @AR@ -AROPTIONS = @AROPTIONS@ -RANLIB = @RANLIB@ -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ - -### Variables: ### - -DESTDIR = -MUPARSER_LIB_CXXFLAGS = $(____DEBUG) $(____SHARED) $(____SHARED_0) \ - -I$(srcdir)/include $(CPPFLAGS) $(CXXFLAGS) -std=c++11 -MUPARSER_LIB_OBJECTS = \ - muParser_lib_muParser.o \ - muParser_lib_muParserBase.o \ - muParser_lib_muParserBytecode.o \ - muParser_lib_muParserCallback.o \ - muParser_lib_muParserError.o \ - muParser_lib_muParserInt.o \ - muParser_lib_muParserTest.o \ - muParser_lib_muParserTokenReader.o -MUPARSER_LIB_HEADERS = \ - include/muParser.h \ - include/muParserBase.h \ - include/muParserBytecode.h \ - include/muParserCallback.h \ - include/muParserDef.h \ - include/muParserInt.h \ - include/muParserTest.h \ - include/muParserToken.h \ - include/muParserTokenReader.h -EXAMPLE1_CXXFLAGS = $(____DEBUG) -I$(srcdir)/include $(CPPFLAGS) $(CXXFLAGS) -std=c++11 -EXAMPLE1_OBJECTS = \ - example1_example1.o - -### Conditionally set variables: ### - -@COND_DEPS_TRACKING_0@CXXC = $(CXX) -@COND_DEPS_TRACKING_1@CXXC = $(BK_DEPS) $(CXX) -@COND_DEBUG_0@DEBUG_BUILD_POSTFIX = -@COND_DEBUG_1@DEBUG_BUILD_POSTFIX = d -__muParser_lib___depname = $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(LIBEXT) -@COND_SHARED_0@__install_muParser_lib___depname = install_muParser_lib -@COND_SHARED_0@__uninstall_muParser_lib___depname = uninstall_muParser_lib -@COND_SHARED_0@__install_muParser_lib_headers___depname = \ -@COND_SHARED_0@ install_muParser_lib_headers -@COND_SHARED_0@__uninstall_muParser_lib_headers___depname = \ -@COND_SHARED_0@ uninstall_muParser_lib_headers -@COND_SHARED_1@__install_muParser_dll___depname = install_muParser_dll -@COND_SHARED_1@__uninstall_muParser_dll___depname = uninstall_muParser_dll -COND_PLATFORM_MACOSX_1___muParser_dll___macinstnamecmd = -install_name \ - $(libdir)/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) -@COND_PLATFORM_MACOSX_1@__muParser_dll___macinstnamecmd = $(COND_PLATFORM_MACOSX_1___muParser_dll___macinstnamecmd) -@COND_SHARED_1@__install_muParser_dll_headers___depname = \ -@COND_SHARED_1@ install_muParser_dll_headers -@COND_SHARED_1@__uninstall_muParser_dll_headers___depname = \ -@COND_SHARED_1@ uninstall_muParser_dll_headers -COND_PLATFORM_OS2_1___muParser_dll___importlib = -import \ - $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_PLATFORM_OS2_1@__muParser_dll___importlib = $(COND_PLATFORM_OS2_1___muParser_dll___importlib) -COND_WINDOWS_IMPLIB_1___muParser_dll___importlib = \ - -Wl,--out-implib=$(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_WINDOWS_IMPLIB_1@__muParser_dll___importlib = $(COND_WINDOWS_IMPLIB_1___muParser_dll___importlib) -@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@__muParser_dll___targetsuf2 \ -@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@ = .$(SO_SUFFIX).2 -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__muParser_dll___targetsuf2 \ -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .2.$(SO_SUFFIX) -@COND_USE_SOVERSION_0@__muParser_dll___targetsuf2 = .$(SO_SUFFIX) -@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@__muParser_dll___targetsuf3 \ -@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ = \ -@COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1@ .$(SO_SUFFIX).2.2.4 -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@__muParser_dll___targetsuf3 \ -@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .2.2.4.$(SO_SUFFIX) -@COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1@__muParser_dll___targetsuf3 \ -@COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1@ = .$(SO_SUFFIX).2 -@COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1@__muParser_dll___targetsuf3 \ -@COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1@ = -2.$(SO_SUFFIX) -@COND_USE_SOVERSION_0@__muParser_dll___targetsuf3 = .$(SO_SUFFIX) -COND_USE_SOVERLINUX_1___muParser_dll___soname_flags = \ - $(SONAME_FLAG)$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) -@COND_USE_SOVERLINUX_1@__muParser_dll___soname_flags = $(COND_USE_SOVERLINUX_1___muParser_dll___soname_flags) -COND_USE_SOVERSOLARIS_1___muParser_dll___soname_flags = \ - $(SONAME_FLAG)$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) -@COND_USE_SOVERSOLARIS_1@__muParser_dll___soname_flags = $(COND_USE_SOVERSOLARIS_1___muParser_dll___soname_flags) -COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_cmd = (cd \ - $(top_builddir)/lib/; rm -f \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2); \ - $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2); \ - $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX)) -@COND_USE_SOTWOSYMLINKS_1@__muParser_dll___so_symlinks_cmd = $(COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_cmd) -COND_USE_SOVERSOLARIS_1___muParser_dll___so_symlinks_cmd = (cd \ - $(top_builddir)/lib/; rm -f \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX); $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX)) -@COND_USE_SOVERSOLARIS_1@__muParser_dll___so_symlinks_cmd = $(COND_USE_SOVERSOLARIS_1___muParser_dll___so_symlinks_cmd) -COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_inst_cmd = rm -f \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2); \ - $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2); \ - $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_USE_SOTWOSYMLINKS_1@__muParser_dll___so_symlinks_inst_cmd = $(COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_inst_cmd) -COND_USE_SOVERSOLARIS_1___muParser_dll___so_symlinks_inst_cmd = rm -f \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX); $(LN_S) \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX); -@COND_USE_SOVERSOLARIS_1@__muParser_dll___so_symlinks_inst_cmd = $(COND_USE_SOVERSOLARIS_1___muParser_dll___so_symlinks_inst_cmd) -COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_uninst_cmd = rm -f \ - $(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) \ - $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_USE_SOTWOSYMLINKS_1@__muParser_dll___so_symlinks_uninst_cmd = $(COND_USE_SOTWOSYMLINKS_1___muParser_dll___so_symlinks_uninst_cmd) -@COND_USE_SOVERSOLARIS_1@__muParser_dll___so_symlinks_uninst_cmd \ -@COND_USE_SOVERSOLARIS_1@ = rm -f \ -@COND_USE_SOVERSOLARIS_1@ $(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_PLATFORM_MACOSX_1@__muParser_dll___macver = \ -@COND_PLATFORM_MACOSX_1@ -compatibility_version 1 -current_version 1 -__example1___depname = $(top_builddir)/samples/example1/example1$(EXEEXT) -@COND_PLATFORM_MAC_0@__example1___mac_setfilecmd = @true -@COND_PLATFORM_MAC_1@__example1___mac_setfilecmd = \ -@COND_PLATFORM_MAC_1@ $(SETFILE) -t APPL \ -@COND_PLATFORM_MAC_1@ $(top_builddir)/samples/example1/example1$(EXEEXT) -@COND_SHARED_0@____SHARED = -@COND_SHARED_1@____SHARED = -DMUPARSER_DLL -@COND_SHARED_0@____SHARED_0 = -@COND_SHARED_1@____SHARED_0 = -DMUPARSERLIB_EXPORTS -@COND_DEBUG_0@____DEBUG = -@COND_DEBUG_1@____DEBUG = - -### Targets: ### - -all: $(__muParser_lib___depname) $(__example1___depname) - -install: $(__install_muParser_lib___depname) $(__install_muParser_lib_headers___depname) $(__install_muParser_dll___depname) $(__install_muParser_dll_headers___depname) - $(INSTALL_DIR) $(DESTDIR)$(libdir)/pkgconfig - $(INSTALL_DATA) build/autoconf/muparser.pc $(DESTDIR)$(libdir)/pkgconfig - -uninstall: $(__uninstall_muParser_lib___depname) $(__uninstall_muParser_lib_headers___depname) $(__uninstall_muParser_dll___depname) $(__uninstall_muParser_dll_headers___depname) - -install-strip: install - $(STRIP) $(DESTDIR)$(libdir)/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) - -clean: - rm -rf ./.deps ./.pch - rm -f ./*.o - rm -f $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(LIBEXT) - rm -f $(top_builddir)/lib/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) - rm -f $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) - rm -f $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) $(top_builddir)/lib/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf2) - rm -f $(top_builddir)/samples/example1/example1$(EXEEXT) - -distclean: clean - rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile - rm -f build/autoconf/muparser.pc - -@COND_SHARED_0@$(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(LIBEXT): $(MUPARSER_LIB_OBJECTS) -@COND_SHARED_0@ rm -f $@ -@COND_SHARED_0@ $(AR) $(AROPTIONS) $@ $(MUPARSER_LIB_OBJECTS) -@COND_SHARED_0@ $(RANLIB) $@ - -@COND_SHARED_0@install_muParser_lib: $(__muParser_lib___depname) -@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(libdir) -@COND_SHARED_0@ $(INSTALL_DATA) $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(LIBEXT) $(DESTDIR)$(libdir) - -@COND_SHARED_0@uninstall_muParser_lib: -@COND_SHARED_0@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(LIBEXT) - -@COND_SHARED_0@install_muParser_lib_headers: -@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(prefix) -@COND_SHARED_0@ for f in $(MUPARSER_LIB_HEADERS); do \ -@COND_SHARED_0@ if test ! -d $(DESTDIR)$(prefix)/`dirname $$f` ; then \ -@COND_SHARED_0@ $(INSTALL_DIR) $(DESTDIR)$(prefix)/`dirname $$f`; \ -@COND_SHARED_0@ fi; \ -@COND_SHARED_0@ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(prefix)/$$f; \ -@COND_SHARED_0@ done - -@COND_SHARED_0@uninstall_muParser_lib_headers: -@COND_SHARED_0@ for f in $(MUPARSER_LIB_HEADERS); do \ -@COND_SHARED_0@ rm -f $(DESTDIR)$(prefix)/$$f; \ -@COND_SHARED_0@ done - -@COND_SHARED_1@ -@COND_SHARED_1@ $(__muParser_dll___so_symlinks_cmd) - -@COND_SHARED_1@ $(INSTALL_DIR) $(DESTDIR)$(libdir) -@COND_SHARED_1@ $(INSTALL_DATA) $(top_builddir)/lib/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) $(DESTDIR)$(libdir) -@COND_SHARED_1@ $(INSTALL_PROGRAM) $(top_builddir)/lib/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) $(DESTDIR)$(libdir) -@COND_SHARED_1@ (cd $(DESTDIR)$(libdir) ; $(__muParser_dll___so_symlinks_inst_cmd)) - -@COND_SHARED_1@uninstall_muParser_dll: -@COND_SHARED_1@ rm -f $(DESTDIR)$(libdir)/$(LIBPREFIX)muparser$(DEBUG_BUILD_POSTFIX).$(DLLIMP_SUFFIX) -@COND_SHARED_1@ rm -f $(DESTDIR)$(libdir)/$(DLLPREFIX)muparser$(DEBUG_BUILD_POSTFIX)$(__muParser_dll___targetsuf3) -@COND_SHARED_1@ (cd $(DESTDIR)$(libdir) ; $(__muParser_dll___so_symlinks_uninst_cmd)) - -@COND_SAMPLES_1@$(top_builddir)/samples/example1/example1$(EXEEXT): $(EXAMPLE1_OBJECTS) $(__muParser_lib___depname) -@COND_SAMPLES_1@ $(CXX) -o $@ $(EXAMPLE1_OBJECTS) -L$(top_builddir)/lib -L$(srcdir)/lib $(LDFLAGS) -lmuparser$(DEBUG_BUILD_POSTFIX) $(LIBS) -@COND_SAMPLES_1@ -@COND_SAMPLES_1@ $(__example1___mac_setfilecmd) - -lib: $(__muParser_lib___depname) - -samples: $(__example1___depname) - -documentation: - ( cd $(srcdir)/docs && doxygen ) - -muParser_lib_muParser.o: $(srcdir)/src/muParser.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParser.cpp - -muParser_lib_muParserBase.o: $(srcdir)/src/muParserBase.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserBase.cpp - -muParser_lib_muParserBytecode.o: $(srcdir)/src/muParserBytecode.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserBytecode.cpp - -muParser_lib_muParserCallback.o: $(srcdir)/src/muParserCallback.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserCallback.cpp - -muParser_lib_muParserDLL.o: $(srcdir)/src/muParserDLL.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserDLL.cpp - -muParser_lib_muParserError.o: $(srcdir)/src/muParserError.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserError.cpp - -muParser_lib_muParserInt.o: $(srcdir)/src/muParserInt.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserInt.cpp - -muParser_lib_muParserTest.o: $(srcdir)/src/muParserTest.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserTest.cpp - -muParser_lib_muParserTokenReader.o: $(srcdir)/src/muParserTokenReader.cpp - $(CXXC) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(srcdir)/src/muParserTokenReader.cpp - -example1_example1.o: $(srcdir)/samples/example1/example1.cpp - $(CXXC) -c -o $@ $(EXAMPLE1_CXXFLAGS) $(srcdir)/samples/example1/example1.cpp - - -# Include dependency info, if present: -@IF_GNU_MAKE@-include ./.deps/*.d - -.PHONY: all install uninstall clean distclean install_muParser_lib \ - uninstall_muParser_lib install_muParser_lib_headers \ - uninstall_muParser_lib_headers install_muParser_dll uninstall_muParser_dll \ - install_muParser_dll_headers uninstall_muParser_dll_headers lib samples diff --git a/muparser-2.2.5/build/autoconf/acregen.sh b/muparser-2.2.5/build/autoconf/acregen.sh deleted file mode 100755 index ef0ed37bd..000000000 --- a/muparser-2.2.5/build/autoconf/acregen.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Author: Francesco Montorsi -# RCS-ID: $Id: acregen.sh 236 2009-11-24 23:12:00Z frm $ -# Creation date: 14/9/2005 -# -# A simple script to generate the configure script -# Some features of this version: -# - automatic test for aclocal version -# - able to be called from any folder -# (i.e. you can call it typing 'build/autoconf/acregen.sh', not only './acregen.sh') - - -# called when an old version of aclocal is found -function aclocalold() -{ - echo "Your aclocal version is $aclocal_maj.$aclocal_min.$aclocal_rel" - echo "Your automake installation is too old; please install automake >= $aclocal_minimal_maj.$aclocal_minimal_min.$aclocal_minimal_rel" - echo "You can download automake from ftp://sources.redhat.com/pub/automake/" - exit 1 -} - -# first check if we have an ACLOCAL version recent enough -aclocal_verfull=$(aclocal --version) -aclocal_maj=`echo $aclocal_verfull | sed 's/aclocal (GNU automake) \([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'` -aclocal_min=`echo $aclocal_verfull | sed 's/aclocal (GNU automake) \([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'` -aclocal_rel=`echo $aclocal_verfull | sed 's/aclocal (GNU automake) \([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'` -if [[ "$aclocal_rel" = "" ]]; then aclocal_rel="0"; fi - -#echo "Your aclocal version is $aclocal_maj.$aclocal_min.$aclocal_rel" # for debugging - -aclocal_minimal_maj=1 -aclocal_minimal_min=9 -aclocal_minimal_rel=6 - -majok=$(($aclocal_maj > $aclocal_minimal_maj)) -minok=$(($aclocal_maj == $aclocal_minimal_maj && $aclocal_min > $aclocal_minimal_min)) -relok=$(($aclocal_maj == $aclocal_minimal_maj && $aclocal_min == $aclocal_minimal_min && \ - $aclocal_rel >= $aclocal_minimal_rel)) - -versionok=$(($majok == 1 || $minok == 1 || $relok == 1)) -if [[ "$versionok" = "0" ]]; then aclocalold; fi - -# we can safely proceed -me=$(basename $0) -path=${0%%/$me} # path from which the script has been launched -current=$(pwd) -cd $path -aclocal && autoconf && mv configure ../.. -cd $current diff --git a/muparser-2.2.5/build/autoconf/autoconf_inc.m4 b/muparser-2.2.5/build/autoconf/autoconf_inc.m4 deleted file mode 100644 index cc17b060b..000000000 --- a/muparser-2.2.5/build/autoconf/autoconf_inc.m4 +++ /dev/null @@ -1,134 +0,0 @@ -dnl ### begin block 00_header[muparser.bkl] ### -dnl -dnl This macro was generated by -dnl Bakefile 0.2.9 (http://www.bakefile.org) -dnl Do not modify, all changes will be overwritten! - -BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.9" - -dnl ### begin block 20_COND_DEBUG_0[muparser.bkl] ### - COND_DEBUG_0="#" - if test "x$DEBUG" = "x0" ; then - COND_DEBUG_0="" - fi - AC_SUBST(COND_DEBUG_0) -dnl ### begin block 20_COND_DEBUG_1[muparser.bkl] ### - COND_DEBUG_1="#" - if test "x$DEBUG" = "x1" ; then - COND_DEBUG_1="" - fi - AC_SUBST(COND_DEBUG_1) -dnl ### begin block 20_COND_DEPS_TRACKING_0[muparser.bkl] ### - COND_DEPS_TRACKING_0="#" - if test "x$DEPS_TRACKING" = "x0" ; then - COND_DEPS_TRACKING_0="" - fi - AC_SUBST(COND_DEPS_TRACKING_0) -dnl ### begin block 20_COND_DEPS_TRACKING_1[muparser.bkl] ### - COND_DEPS_TRACKING_1="#" - if test "x$DEPS_TRACKING" = "x1" ; then - COND_DEPS_TRACKING_1="" - fi - AC_SUBST(COND_DEPS_TRACKING_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1[muparser.bkl] ### - COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERCYGWIN" = "x0" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="" - fi - AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_0_USE_SOVERSION_1[muparser.bkl] ### - COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="" - fi - AC_SUBST(COND_PLATFORM_MACOSX_0_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_1[muparser.bkl] ### - COND_PLATFORM_MACOSX_1="#" - if test "x$PLATFORM_MACOSX" = "x1" ; then - COND_PLATFORM_MACOSX_1="" - fi - AC_SUBST(COND_PLATFORM_MACOSX_1) -dnl ### begin block 20_COND_PLATFORM_MACOSX_1_USE_SOVERSION_1[muparser.bkl] ### - COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x1" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" - fi - AC_SUBST(COND_PLATFORM_MACOSX_1_USE_SOVERSION_1) -dnl ### begin block 20_COND_PLATFORM_MAC_0[muparser.bkl] ### - COND_PLATFORM_MAC_0="#" - if test "x$PLATFORM_MAC" = "x0" ; then - COND_PLATFORM_MAC_0="" - fi - AC_SUBST(COND_PLATFORM_MAC_0) -dnl ### begin block 20_COND_PLATFORM_MAC_1[muparser.bkl] ### - COND_PLATFORM_MAC_1="#" - if test "x$PLATFORM_MAC" = "x1" ; then - COND_PLATFORM_MAC_1="" - fi - AC_SUBST(COND_PLATFORM_MAC_1) -dnl ### begin block 20_COND_PLATFORM_OS2_1[muparser.bkl] ### - COND_PLATFORM_OS2_1="#" - if test "x$PLATFORM_OS2" = "x1" ; then - COND_PLATFORM_OS2_1="" - fi - AC_SUBST(COND_PLATFORM_OS2_1) -dnl ### begin block 20_COND_SAMPLES_1[muparser.bkl] ### - COND_SAMPLES_1="#" - if test "x$SAMPLES" = "x1" ; then - COND_SAMPLES_1="" - fi - AC_SUBST(COND_SAMPLES_1) -dnl ### begin block 20_COND_SHARED_0[muparser.bkl] ### - COND_SHARED_0="#" - if test "x$SHARED" = "x0" ; then - COND_SHARED_0="" - fi - AC_SUBST(COND_SHARED_0) -dnl ### begin block 20_COND_SHARED_1[muparser.bkl] ### - COND_SHARED_1="#" - if test "x$SHARED" = "x1" ; then - COND_SHARED_1="" - fi - AC_SUBST(COND_SHARED_1) -dnl ### begin block 20_COND_USE_SOTWOSYMLINKS_1[muparser.bkl] ### - COND_USE_SOTWOSYMLINKS_1="#" - if test "x$USE_SOTWOSYMLINKS" = "x1" ; then - COND_USE_SOTWOSYMLINKS_1="" - fi - AC_SUBST(COND_USE_SOTWOSYMLINKS_1) -dnl ### begin block 20_COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1[muparser.bkl] ### - COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="#" - if test "x$USE_SOVERCYGWIN" = "x1" -a "x$USE_SOVERSION" = "x1" ; then - COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="" - fi - AC_SUBST(COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1) -dnl ### begin block 20_COND_USE_SOVERLINUX_1[muparser.bkl] ### - COND_USE_SOVERLINUX_1="#" - if test "x$USE_SOVERLINUX" = "x1" ; then - COND_USE_SOVERLINUX_1="" - fi - AC_SUBST(COND_USE_SOVERLINUX_1) -dnl ### begin block 20_COND_USE_SOVERSION_0[muparser.bkl] ### - COND_USE_SOVERSION_0="#" - if test "x$USE_SOVERSION" = "x0" ; then - COND_USE_SOVERSION_0="" - fi - AC_SUBST(COND_USE_SOVERSION_0) -dnl ### begin block 20_COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1[muparser.bkl] ### - COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="#" - if test "x$USE_SOVERSION" = "x1" -a "x$USE_SOVERSOLARIS" = "x1" ; then - COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="" - fi - AC_SUBST(COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1) -dnl ### begin block 20_COND_USE_SOVERSOLARIS_1[muparser.bkl] ### - COND_USE_SOVERSOLARIS_1="#" - if test "x$USE_SOVERSOLARIS" = "x1" ; then - COND_USE_SOVERSOLARIS_1="" - fi - AC_SUBST(COND_USE_SOVERSOLARIS_1) -dnl ### begin block 20_COND_WINDOWS_IMPLIB_1[muparser.bkl] ### - COND_WINDOWS_IMPLIB_1="#" - if test "x$WINDOWS_IMPLIB" = "x1" ; then - COND_WINDOWS_IMPLIB_1="" - fi - AC_SUBST(COND_WINDOWS_IMPLIB_1) diff --git a/muparser-2.2.5/build/autoconf/bakefile-presets.m4 b/muparser-2.2.5/build/autoconf/bakefile-presets.m4 deleted file mode 100644 index 5d3159ee5..000000000 --- a/muparser-2.2.5/build/autoconf/bakefile-presets.m4 +++ /dev/null @@ -1,156 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl Support macros for makefiles generated with Bakefile presets -dnl --------------------------------------------------------------------------- - - -dnl --------------------------------------------------------------------------- -dnl AM_YESNO_OPTCHECK([name of the boolean variable to set], -dnl [name of the variable with yes/no values], -dnl [name of the --enable/--with option]) -dnl -dnl Converts the $3 variable, supposed to contain a yes/no value to a 1/0 -dnl boolean variable and saves the result into $1. -dnl Outputs also the standard checking-option message. -dnl Used by the m4 macros of the presets. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_YESNO_OPTCHECK], -[ - AC_MSG_CHECKING([for the $3 option]) - if [[ "x$$2" = "xyes" ]]; then - AC_MSG_RESULT([yes]) - $1=1 - else - AC_MSG_RESULT([no]) - $1=0 - fi -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_UNICODEOPT([default value for the --enable-unicode option]) -dnl -dnl Adds the --enable-unicode option to the configure script and sets the -dnl UNICODE=0/1 variable accordingly to the value of the option. -dnl To be used with unicodeopt.bkl preset. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_UNICODEOPT], -[ - default="$1" - if [[ -z "$default" ]]; then - default="no" - fi - - AC_ARG_ENABLE([unicode], - AC_HELP_STRING([--enable-unicode], [Builds in Unicode mode]), - [], [enableval="$default"]) - - AC_BAKEFILE_YESNO_OPTCHECK([UNICODE], [enableval], [--enable-unicode]) -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_DEBUGOPT([default value for the --enable-debug option]) -dnl -dnl Adds the --enable-debug option to the configure script and sets the -dnl DEBUG=0/1 variable accordingly to the value of the option. -dnl To be used with debugopt.bkl preset. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_DEBUGOPT], -[ - default="$1" - if [[ -z "$default" ]]; then - default="no" - fi - - AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [Builds in debug mode]), - [], [enableval="$default"]) - - AC_BAKEFILE_YESNO_OPTCHECK([DEBUG], [enableval], [--enable-debug]) - - dnl add the optimize/debug flags - if [[ "x$DEBUG" = "x1" ]]; then - - dnl NOTE: the -Wundef and -Wno-ctor-dtor-privacy are not enabled automatically by -Wall - dnl NOTE2: the '-Wno-ctor-dtor-privacy' has sense only when compiling C++ source files - dnl and thus we must be careful to add it only to CXXFLAGS and not to CFLAGS - dnl (remember that CPPFLAGS is reserved for both C and C++ compilers while - dnl CFLAGS is intended as flags for C compiler only and CXXFLAGS for C++ only) - my_CXXFLAGS="$my_CXXFLAGS -g -O0 -Wall -Wundef -Wno-ctor-dtor-privacy" - my_CFLAGS="$my_CFLAGS -g -O0 -Wall -Wundef" - else - my_CXXFLAGS="$my_CXXFLAGS -O2" - my_CFLAGS="$my_CFLAGS -O2" - fi - # User-supplied CXXFLAGS must always take precedence. - # This still sucks because using `make CFLAGS=-foobar` kills - # the project-supplied flags again. - CXXFLAGS="$my_CXXFLAGS $CXXFLAGS" - CFLAGS="$my_CFLAGS $CFLAGS" -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_SHAREDOPT([default value for the --enable-shared option]) -dnl -dnl Adds the --enable-shared option to the configure script and sets the -dnl SHARED=0/1 variable accordingly to the value of the option. -dnl To be used with sharedopt.bkl preset. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_SHAREDOPT], -[ - default="$1" - if [[ -z "$default" ]]; then - default="no" - fi - - AC_ARG_ENABLE([shared], - AC_HELP_STRING([--enable-shared], [Builds in shared mode]), - [], [enableval="$default"]) - - AC_BAKEFILE_YESNO_OPTCHECK([SHARED], [enableval], [--enable-shared]) -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_SHOW_DEBUGOPT -dnl -dnl Prints a message on stdout about the value of the DEBUG variable. -dnl This macro is useful to show summary messages at the end of the configure scripts. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_SHOW_DEBUGOPT], -[ - if [[ "$DEBUG" = "1" ]]; then - echo " - DEBUG build" - else - echo " - RELEASE build" - fi -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_SHOW_SHAREDOPT -dnl -dnl Prints a message on stdout about the value of the SHARED variable. -dnl This macro is useful to show summary messages at the end of the configure scripts. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_SHOW_SHAREDOPT], -[ - if [[ "$SHARED" = "1" ]]; then - echo " - SHARED mode" - else - echo " - STATIC mode" - fi -]) - -dnl --------------------------------------------------------------------------- -dnl AC_BAKEFILE_SHOW_UNICODEOPT -dnl -dnl Prints a message on stdout about the value of the UNICODE variable. -dnl This macro is useful to show summary messages at the end of the configure scripts. -dnl --------------------------------------------------------------------------- -AC_DEFUN([AC_BAKEFILE_SHOW_UNICODEOPT], -[ - if [[ "$UNICODE" = "1" ]]; then - echo " - UNICODE mode" - else - echo " - ANSI mode" - fi -]) - - diff --git a/muparser-2.2.5/build/autoconf/config.guess b/muparser-2.2.5/build/autoconf/config.guess deleted file mode 100755 index c38553dc7..000000000 --- a/muparser-2.2.5/build/autoconf/config.guess +++ /dev/null @@ -1,1497 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2006-02-23' - -# This file 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS_NT-*:*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - x86:Interix*:[345]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[345]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -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` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/muparser-2.2.5/build/autoconf/config.sub b/muparser-2.2.5/build/autoconf/config.sub deleted file mode 100755 index ad9f39571..000000000 --- a/muparser-2.2.5/build/autoconf/config.sub +++ /dev/null @@ -1,1608 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2006-02-23' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m32c) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - m32c-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/muparser-2.2.5/build/autoconf/configure.ac b/muparser-2.2.5/build/autoconf/configure.ac deleted file mode 100644 index 6746c8553..000000000 --- a/muparser-2.2.5/build/autoconf/configure.ac +++ /dev/null @@ -1,82 +0,0 @@ -# ====================================================================================== -# Author: Francesco Montorsi -# RCS-ID: $Id: configure.ac 634 2012-12-22 10:34:32Z ibg $ -# ====================================================================================== - - -# NOTE: -# the version of the project must be updated also in docs/Doxyfile ! -AC_INIT([muparser], [2.2.4], [muparser@beltoforion.de]) - -AC_PREREQ([2.57]) -AC_CONFIG_AUX_DIR([build/autoconf]) -AC_LANG(C++) - -# some helpers -m4_include(bakefile-presets.m4) - - - -## CONFIGURE CHECKS -##################################################################### - -dnl This allows us to use Bakefile, recognizing the system type -dnl (and sets the AC_CANONICAL_BUILD, AC_CANONICAL_HOST and -dnl AC_CANONICAL_TARGET variables) -AC_CANONICAL_SYSTEM - -# We want to inhibit AC_PROG_C* macros adding the default "-g -O2" flags. -# To do so, make sure that the variables are not unset - it is ok if they are -# empty. However, their value MUST be retained, since one may have -# called ./configure CFLAGS=-foobar. -CFLAGS="$CFLAGS" -CPPFLAGS="$CPPFLAGS" -CXXFLAGS="$CXXFLAGS" - -dnl Checks for basic programs used to compile/install. -AC_PROG_AWK -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_RANLIB -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CXXCPP - - -AC_BAKEFILE_DEBUGOPT([no]) -AC_BAKEFILE_SHAREDOPT([yes]) - -AC_ARG_ENABLE([samples], - AC_HELP_STRING([--enable-samples], [Builds the library samples, too]), - [], [enableval="yes"]) -AC_BAKEFILE_YESNO_OPTCHECK([SAMPLES], [enableval], [--enable-samples]) - -dnl Create the output folders in the current build directory -dnl (this handles cases like: -dnl mkdir mybuild && cd mybuild && ../configure && make ) -AS_MKDIR_P(lib) -AS_MKDIR_P(samples/example1) - -AC_BAKEFILE([m4_include(autoconf_inc.m4)]) -AC_CONFIG_FILES([Makefile build/autoconf/muparser.pc]) -AC_OUTPUT - - - -## CONFIGURE END MESSAGE -##################################################################### - -echo -echo " ----------------------------------------------------------------" -echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." -echo " Summary of main configuration settings for $PACKAGE_NAME:" -AC_BAKEFILE_SHOW_SHAREDOPT -AC_BAKEFILE_SHOW_DEBUGOPT -if [[ "$SAMPLES" = "1" ]]; then - echo " - SAMPLES enabled" -else - echo " - SAMPLES disabled" -fi -echo " Now, just run make." -echo " ----------------------------------------------------------------" -echo diff --git a/muparser-2.2.5/build/autoconf/install-sh b/muparser-2.2.5/build/autoconf/install-sh deleted file mode 100755 index 13f47935d..000000000 --- a/muparser-2.2.5/build/autoconf/install-sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh - diff --git a/muparser-2.2.5/build/autoconf/muparser.pc.in b/muparser-2.2.5/build/autoconf/muparser.pc.in deleted file mode 100644 index 1d580f6ec..000000000 --- a/muparser-2.2.5/build/autoconf/muparser.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: @PACKAGE_NAME@ -Description: Mathematical expressions parser library -Version: @PACKAGE_VERSION@ -Requires: -Libs: -L${libdir} -lmuparser -Cflags: -I${includedir} diff --git a/muparser-2.2.5/build/bakefiles/Bakefiles.bkgen b/muparser-2.2.5/build/bakefiles/Bakefiles.bkgen deleted file mode 100644 index b39bb4cc8..000000000 --- a/muparser-2.2.5/build/bakefiles/Bakefiles.bkgen +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - muparser.bkl - - dmars,dmars_smake,cbx_unix,cbuilderx,msevc4prj - - autoconf,mingw,msvc - - -o ../makefile.mingw - -o ../makefile.vc - - - - - - -o../../Makefile.in - - - - - -DAUTOCONF_MACROS_FILE=../autoconf/autoconf_inc.m4 - - - diff --git a/muparser-2.2.5/build/bakefiles/howto.txt b/muparser-2.2.5/build/bakefiles/howto.txt deleted file mode 100644 index 4e246bb0c..000000000 --- a/muparser-2.2.5/build/bakefiles/howto.txt +++ /dev/null @@ -1,28 +0,0 @@ -These are basic instructions for recreating the project files: - -Changing the version number: ----------------------------- -build/autoconf/configure.ac -Line 9: -AC_INIT .... - -Change SO version ------------------ -muparser.bkl / tag - -Updating the make- and projectfiles: ------------------------------------- -Clearing old project and makefiles: -bakefile_gen -c - -Remaking Projects and Makefiles: -bakefile_gen - -In addition to that automake must be started to create the new configure script: -rm -rf autoconf/autom4te.cache autoconf/aclocal.m4 -../autoconf/acregen.sh - -!!! IMPORTANT !!! -When building bakefile from the tar.gz archive make sure to -use the option --prefix=/usr wit the config file since its -path will default to /usr/local. This would cause strange errors! diff --git a/muparser-2.2.5/build/bakefiles/muparser.bkl b/muparser-2.2.5/build/bakefiles/muparser.bkl deleted file mode 100644 index e208cb7f5..000000000 --- a/muparser-2.2.5/build/bakefiles/muparser.bkl +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - obj$(DIRSEP)$(BUILDDIR) - - - - - d - - - - - - - - - $(top_builddir)/lib - $(top_builddir)/samples - - - - ../.. - - - .. - - - $(SRCDIR)/lib - $(SRCDIR)/samples - - - - - - - - - - - muparser$(DEBUG_BUILD_POSTFIX) - - - muparser$(DEBUG_BUILD_POSTFIX) - muparser$(DEBUG_BUILD_POSTFIX) - - 2.2 - 2.2.4 - 1 - - - - muParser=muParser_lib+muParser_dll - - - - build/autoconf/muparser.pc - - - - - - - - - - - - - - 1 - - - - - - - $(fileList('samples/example1/*.cpp')) - $(SAMPLEOUTPATH)/example1 - $(substituteFromDict(SHARED, {'1':'USINGDLL', '0':''})) - - - - - - $(fileList('samples/example1/*.cpp')) - $(SAMPLEOUTPATH)/example1 - - - - - - - $(fileList('samples/example2/*.c')) - $(SAMPLEOUTPATH)/example2 - $(substituteFromDict(SHARED, {'1':'USINGDLL', '0':''})) - - - - - - - - - - muParser_lib - muParser_dll - - - - example1 - - example2 - - - - - ( cd $(SRCDIR)$(DIRSEP)docs && doxygen ) - - - - - diff --git a/muparser-2.2.5/build/bakefiles/presets/debugopt.bkl b/muparser-2.2.5/build/bakefiles/presets/debugopt.bkl deleted file mode 100644 index eb47bc45e..000000000 --- a/muparser-2.2.5/build/bakefiles/presets/debugopt.bkl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - 0 - - - - - - - - rel - dbg - - - diff --git a/muparser-2.2.5/build/bakefiles/presets/setbuilddir.bkl b/muparser-2.2.5/build/bakefiles/presets/setbuilddir.bkl deleted file mode 100644 index 9e7eef0b7..000000000 --- a/muparser-2.2.5/build/bakefiles/presets/setbuilddir.bkl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - _$(SHAREDBUILDPOSTFIX) - _$(DEBUGBUILDPOSTFIX) - _$(UNICODEBUILDPOSTFIX) - - - - $(COMPILER)$(SHRDSTR)$(DBGSTR)$(UNICSTR) - - - - diff --git a/muparser-2.2.5/build/bakefiles/presets/sharedopt.bkl b/muparser-2.2.5/build/bakefiles/presets/sharedopt.bkl deleted file mode 100644 index 461437bfa..000000000 --- a/muparser-2.2.5/build/bakefiles/presets/sharedopt.bkl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - 0 - - - - - - static - shared - - - diff --git a/muparser-2.2.5/build/bakefiles/presets/unicodeopt.bkl b/muparser-2.2.5/build/bakefiles/presets/unicodeopt.bkl deleted file mode 100644 index 5fe3ac25d..000000000 --- a/muparser-2.2.5/build/bakefiles/presets/unicodeopt.bkl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - 0 - - - - - - - - a - u - - - diff --git a/muparser-2.2.5/build/makefile.mingw b/muparser-2.2.5/build/makefile.mingw deleted file mode 100644 index d7cb07a27..000000000 --- a/muparser-2.2.5/build/makefile.mingw +++ /dev/null @@ -1,283 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.9 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# Compiler flags to link shared library -LINK_DLL_FLAGS ?= -shared - -# C compiler -CC = gcc - -# C++ compiler -CXX = g++ - -# Standard flags for CC -CFLAGS ?= - -# Standard flags for C++ -CXXFLAGS ?= - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS ?= - -# Standard linker flags -LDFLAGS ?= - -# Set to 1 to build debug version [0,1] -DEBUG ?= 0 - -# Set to 1 to build shared (DLL) version [0,1] -SHARED ?= 0 - -# Set to 1 to compile samples [0,1] -SAMPLES ?= 1 - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -CPPDEPS = -MT$@ -MF$@.d -MD -MP -MUPARSER_LIB_CXXFLAGS = $(____DEBUG) $(____DEBUG_3) $(____DEBUG_9) \ - $(____DEBUG_8) $(____SHARED) $(____SHARED_0) -D_WIN32 -I..\include \ - $(CPPFLAGS) $(CXXFLAGS) -MUPARSER_LIB_OBJECTS = \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParser.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBase.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBytecode.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserCallback.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserDLL.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserError.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserInt.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTest.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTokenReader.o -MUPARSER_DLL_CXXFLAGS = $(____DEBUG) $(____DEBUG_3) $(____DEBUG_9) \ - $(____DEBUG_8) $(____SHARED) $(____SHARED_0) -D_WIN32 -I..\include \ - $(CPPFLAGS) $(CXXFLAGS) -MUPARSER_DLL_OBJECTS = \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParser.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBase.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBytecode.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserCallback.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserDLL.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserError.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserInt.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTest.o \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTokenReader.o -EXAMPLE1_CXXFLAGS = $(____DEBUG) $(____DEBUG_3) $(____DEBUG_9) $(____DEBUG_8) \ - -I..\include $(____SHARED_1) $(CPPFLAGS) $(CXXFLAGS) -EXAMPLE1_OBJECTS = \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example1_example1.o -EXAMPLE2_CFLAGS = $(____DEBUG) $(____DEBUG_3) $(____DEBUG_9) $(____DEBUG_8) \ - -I..\include $(____SHARED_1) $(CPPFLAGS) $(CFLAGS) -EXAMPLE2_OBJECTS = \ - obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example2_example2.o - -### Conditionally set variables: ### - -ifeq ($(DEBUG),0) -DEBUGBUILDPOSTFIX = rel -endif -ifeq ($(DEBUG),1) -DEBUGBUILDPOSTFIX = dbg -endif -ifeq ($(SHARED),0) -SHAREDBUILDPOSTFIX = static -endif -ifeq ($(SHARED),1) -SHAREDBUILDPOSTFIX = shared -endif -ifeq ($(DEBUG),0) -DEBUG_BUILD_POSTFIX = -endif -ifeq ($(DEBUG),1) -DEBUG_BUILD_POSTFIX = d -endif -ifeq ($(SHARED),0) -__muParser_lib___depname = ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a -endif -ifeq ($(SHARED),1) -__muParser_dll___depname = ..\lib\muparser$(DEBUG_BUILD_POSTFIX).dll -endif -ifeq ($(SAMPLES),1) -ifeq ($(SHARED),0) -__example1___depname = ..\samples\example1\example1.exe -endif -endif -ifeq ($(SAMPLES),1) -ifeq ($(SHARED),1) -__example2___depname = ..\samples\example2\example2.exe -endif -endif -ifeq ($(SHARED),0) -____SHARED = -endif -ifeq ($(SHARED),1) -____SHARED = -DMUPARSER_DLL -endif -ifeq ($(SHARED),0) -____SHARED_0 = -endif -ifeq ($(SHARED),1) -____SHARED_0 = -DMUPARSERLIB_EXPORTS -endif -ifeq ($(DEBUG),0) -____DEBUG = -DNDEBUG -endif -ifeq ($(DEBUG),1) -____DEBUG = -endif -ifeq ($(DEBUG),0) -____DEBUG_3 = -O2 -endif -ifeq ($(DEBUG),1) -____DEBUG_3 = -O0 -endif -ifeq ($(DEBUG),0) -____DEBUG_8 = -endif -ifeq ($(DEBUG),1) -____DEBUG_8 = -W -Wall -endif -ifeq ($(SHARED),0) -____SHARED_1 = -endif -ifeq ($(SHARED),1) -____SHARED_1 = -DUSINGDLL -endif -ifeq ($(DEBUG),0) -____DEBUG_9 = -endif -ifeq ($(DEBUG),1) -____DEBUG_9 = -g -endif - - -all: obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX): - -if not exist obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) mkdir obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) - -### Targets: ### - -all: $(__muParser_lib___depname) $(__muParser_dll___depname) $(__example1___depname) $(__example2___depname) - -clean: - -if exist obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.o del obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.o - -if exist obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.d del obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.d - -if exist ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a del ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a - -if exist ..\lib\muparser$(DEBUG_BUILD_POSTFIX).dll del ..\lib\muparser$(DEBUG_BUILD_POSTFIX).dll - -if exist ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a del ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a - -if exist ..\samples\example1\example1.exe del ..\samples\example1\example1.exe - -if exist ..\samples\example2\example2.exe del ..\samples\example2\example2.exe - -ifeq ($(SHARED),0) -..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a: $(MUPARSER_LIB_OBJECTS) - if exist $@ del $@ - ar rcu $@ $(MUPARSER_LIB_OBJECTS) - ranlib $@ -endif - -ifeq ($(SHARED),1) -..\lib\muparser$(DEBUG_BUILD_POSTFIX).dll: $(MUPARSER_DLL_OBJECTS) - $(CXX) $(LINK_DLL_FLAGS) -fPIC -o $@ $(MUPARSER_DLL_OBJECTS) $(____DEBUG_9) -Wl,--out-implib=..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a $(LDFLAGS) -endif - -ifeq ($(SAMPLES),1) -ifeq ($(SHARED),0) -..\samples\example1\example1.exe: $(EXAMPLE1_OBJECTS) $(__muParser_lib___depname) - $(CXX) -o $@ $(EXAMPLE1_OBJECTS) $(____DEBUG_9) -L..\lib $(LDFLAGS) ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a -endif -endif - -ifeq ($(SAMPLES),1) -ifeq ($(SHARED),1) -..\samples\example2\example2.exe: $(EXAMPLE2_OBJECTS) $(__muParser_lib___depname) - $(CC) -o $@ $(EXAMPLE2_OBJECTS) $(____DEBUG_9) -L..\lib $(LDFLAGS) ..\lib\libmuparser$(DEBUG_BUILD_POSTFIX).a -endif -endif - -lib: $(__muParser_lib___depname) $(__muParser_dll___depname) - -samples: $(__example1___depname) $(__example2___depname) - -documentation: - ( cd ..\docs && doxygen ) - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParser.o: ../src/muParser.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBase.o: ../src/muParserBase.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBytecode.o: ../src/muParserBytecode.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserCallback.o: ../src/muParserCallback.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserDLL.o: ../src/muParserDLL.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserError.o: ../src/muParserError.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserInt.o: ../src/muParserInt.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTest.o: ../src/muParserTest.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTokenReader.o: ../src/muParserTokenReader.cpp - $(CXX) -c -o $@ $(MUPARSER_LIB_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParser.o: ../src/muParser.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBase.o: ../src/muParserBase.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBytecode.o: ../src/muParserBytecode.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserCallback.o: ../src/muParserCallback.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserDLL.o: ../src/muParserDLL.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserError.o: ../src/muParserError.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserInt.o: ../src/muParserInt.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTest.o: ../src/muParserTest.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTokenReader.o: ../src/muParserTokenReader.cpp - $(CXX) -c -o $@ $(MUPARSER_DLL_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example1_example1.o: ../samples/example1/example1.cpp - $(CXX) -c -o $@ $(EXAMPLE1_CXXFLAGS) $(CPPDEPS) $< - -obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example2_example2.o: ../samples/example2/example2.c - $(CC) -c -o $@ $(EXAMPLE2_CFLAGS) $(CPPDEPS) $< - -.PHONY: all clean lib samples - - -SHELL := $(COMSPEC) - -# Dependencies tracking: --include obj\gcc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)/*.d diff --git a/muparser-2.2.5/build/makefile.vc b/muparser-2.2.5/build/makefile.vc deleted file mode 100644 index f217d02a2..000000000 --- a/muparser-2.2.5/build/makefile.vc +++ /dev/null @@ -1,322 +0,0 @@ -# ========================================================================= -# This makefile was generated by -# Bakefile 0.2.9 (http://www.bakefile.org) -# Do not modify, all changes will be overwritten! -# ========================================================================= - - - -# ------------------------------------------------------------------------- -# These are configurable options: -# ------------------------------------------------------------------------- - -# C compiler -CC = cl - -# C++ compiler -CXX = cl - -# Standard flags for CC -CFLAGS = - -# Standard flags for C++ -CXXFLAGS = - -# Standard preprocessor flags (common for CC and CXX) -CPPFLAGS = - -# Standard linker flags -LDFLAGS = - -# Set to 1 to build debug version [0,1] -# 0 - Release -# 1 - Debug -DEBUG = 0 - -# Set to 1 to build shared (DLL) version [0,1] -# 0 - Static -# 1 - DLL -SHARED = 0 - -# Set to 1 to compile samples [0,1] -SAMPLES = 1 - - - -# ------------------------------------------------------------------------- -# Do not modify the rest of this file! -# ------------------------------------------------------------------------- - -### Variables: ### - -MUPARSER_LIB_CXXFLAGS = /MD$(DEBUG_3) /DWIN32 $(____DEBUG_8) $(____DEBUG) \ - $(____DEBUG_9) /Fd..\lib\muparser$(DEBUG_3).pdb $(____DEBUG_6) \ - $(______DEBUG) $(____SHARED) $(____SHARED_0) /D_WIN32 /I..\include /GR /EHsc \ - $(CPPFLAGS) $(CXXFLAGS) -MUPARSER_LIB_OBJECTS = \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParser.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBase.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBytecode.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserCallback.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserDLL.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserError.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserInt.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTest.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTokenReader.obj -MUPARSER_DLL_CXXFLAGS = /MD$(DEBUG_3) /DWIN32 $(____DEBUG_8) $(____DEBUG) \ - $(____DEBUG_9) /Fd..\lib\muparser$(DEBUG_3).pdb $(____DEBUG_6) \ - $(______DEBUG) $(____SHARED) $(____SHARED_0) /D_WIN32 /I..\include /GR /EHsc \ - $(CPPFLAGS) $(CXXFLAGS) -MUPARSER_DLL_OBJECTS = \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParser.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBase.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBytecode.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserCallback.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserDLL.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserError.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserInt.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTest.obj \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTokenReader.obj -EXAMPLE1_CXXFLAGS = /MD$(DEBUG_3) /DWIN32 $(____DEBUG_8) $(____DEBUG) \ - $(____DEBUG_9) /Fd..\samples\example1\example1.pdb $(____DEBUG_6) \ - $(______DEBUG) /I..\include $(____SHARED_1) /GR /EHsc $(CPPFLAGS) $(CXXFLAGS) -EXAMPLE1_OBJECTS = \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example1_example1.obj -EXAMPLE2_CFLAGS = /MD$(DEBUG_3) /DWIN32 $(____DEBUG_8) $(____DEBUG) \ - $(____DEBUG_9) /Fd..\samples\example2\example2.pdb $(____DEBUG_6) \ - $(______DEBUG) /I..\include $(____SHARED_1) $(CPPFLAGS) $(CFLAGS) -EXAMPLE2_OBJECTS = \ - obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example2_example2.obj - -### Conditionally set variables: ### - -!if "$(DEBUG)" == "0" -DEBUGBUILDPOSTFIX = rel -!endif -!if "$(DEBUG)" == "1" -DEBUGBUILDPOSTFIX = dbg -!endif -!if "$(SHARED)" == "0" -SHAREDBUILDPOSTFIX = static -!endif -!if "$(SHARED)" == "1" -SHAREDBUILDPOSTFIX = shared -!endif -!if "$(SHARED)" == "0" -__muParser_lib___depname = ..\lib\muparser$(DEBUG_3).lib -!endif -!if "$(SHARED)" == "1" -__muParser_dll___depname = ..\lib\muparser$(DEBUG_3).dll -!endif -!if "$(DEBUG)" == "0" -____DEBUG_23_26 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_23_26 = $(____DEBUG_10) -!endif -!if "$(SAMPLES)" == "1" && "$(SHARED)" == "0" -__example1___depname = ..\samples\example1\example1.exe -!endif -!if "$(DEBUG)" == "0" -____DEBUG_40_43 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_40_43 = $(____DEBUG_10) -!endif -!if "$(SAMPLES)" == "1" && "$(SHARED)" == "1" -__example2___depname = ..\samples\example2\example2.exe -!endif -!if "$(DEBUG)" == "0" -____DEBUG_56_59 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_56_59 = $(____DEBUG_10) -!endif -!if "$(SHARED)" == "0" -____SHARED = -!endif -!if "$(SHARED)" == "1" -____SHARED = /DMUPARSER_DLL -!endif -!if "$(SHARED)" == "0" -____SHARED_0 = -!endif -!if "$(SHARED)" == "1" -____SHARED_0 = /DMUPARSERLIB_EXPORTS -!endif -!if "$(DEBUG)" == "0" -____DEBUG_8 = /DNDEBUG -!endif -!if "$(DEBUG)" == "1" -____DEBUG_8 = -!endif -!if "$(DEBUG)" == "0" -____DEBUG = /O2 -!endif -!if "$(DEBUG)" == "1" -____DEBUG = /Od -!endif -!if "$(DEBUG)" == "0" -____DEBUG_9 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_9 = /Zi -!endif -!if "$(DEBUG)" == "0" -____DEBUG_5 = -!endif -!if "$(DEBUG)" == "1" -____DEBUG_5 = /DEBUG -!endif -!if "$(DEBUG)" == "0" -____DEBUG_6 = /w -!endif -!if "$(DEBUG)" == "1" -____DEBUG_6 = /W4 -!endif -!if "$(DEBUG)" == "0" -______DEBUG = -!endif -!if "$(DEBUG)" == "1" -______DEBUG = /D_DEBUG -!endif -!if "$(DEBUG)" == "0" -DEBUG_3 = -!endif -!if "$(DEBUG)" == "1" -DEBUG_3 = d -!endif -!if "$(DEBUG)" == "0" -____DEBUG_10 = /opt:ref /opt:icf -!endif -!if "$(DEBUG)" == "1" -____DEBUG_10 = -!endif -!if "$(SHARED)" == "0" -____SHARED_1 = -!endif -!if "$(SHARED)" == "1" -____SHARED_1 = /DUSINGDLL -!endif - - -all: obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX): - -if not exist obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) mkdir obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX) - -### Targets: ### - -all: $(__muParser_lib___depname) $(__muParser_dll___depname) $(__example1___depname) $(__example2___depname) - -clean: - -if exist obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.obj del obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.obj - -if exist obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.res del obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.res - -if exist obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.pch del obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\*.pch - -if exist ..\lib\muparser$(DEBUG_3).lib del ..\lib\muparser$(DEBUG_3).lib - -if exist ..\lib\muparser$(DEBUG_3).dll del ..\lib\muparser$(DEBUG_3).dll - -if exist ..\lib\muparser$(DEBUG_3).ilk del ..\lib\muparser$(DEBUG_3).ilk - -if exist ..\lib\muparser$(DEBUG_3).pdb del ..\lib\muparser$(DEBUG_3).pdb - -if exist ..\lib\muparser$(DEBUG_3).lib del ..\lib\muparser$(DEBUG_3).lib - -if exist ..\samples\example1\example1.exe del ..\samples\example1\example1.exe - -if exist ..\samples\example1\example1.ilk del ..\samples\example1\example1.ilk - -if exist ..\samples\example1\example1.pdb del ..\samples\example1\example1.pdb - -if exist ..\samples\example2\example2.exe del ..\samples\example2\example2.exe - -if exist ..\samples\example2\example2.ilk del ..\samples\example2\example2.ilk - -if exist ..\samples\example2\example2.pdb del ..\samples\example2\example2.pdb - -!if "$(SHARED)" == "0" -..\lib\muparser$(DEBUG_3).lib: $(MUPARSER_LIB_OBJECTS) - if exist $@ del $@ - link /LIB /NOLOGO /OUT:$@ @<< - $(MUPARSER_LIB_OBJECTS) -<< -!endif - -!if "$(SHARED)" == "1" -..\lib\muparser$(DEBUG_3).dll: $(MUPARSER_DLL_OBJECTS) - link /DLL /NOLOGO /OUT:$@ $(____DEBUG_5) /pdb:"..\lib\muparser$(DEBUG_3).pdb" $(____DEBUG_23_26) $(LDFLAGS) @<< - $(MUPARSER_DLL_OBJECTS) /IMPLIB:..\lib\muparser$(DEBUG_3).lib -<< -!endif - -!if "$(SAMPLES)" == "1" && "$(SHARED)" == "0" -..\samples\example1\example1.exe: $(EXAMPLE1_OBJECTS) $(__muParser_lib___depname) - link /NOLOGO /OUT:$@ $(____DEBUG_5) /pdb:"..\samples\example1\example1.pdb" $(____DEBUG_40_43) /LIBPATH:..\lib $(LDFLAGS) @<< - $(EXAMPLE1_OBJECTS) ..\lib\muparser$(DEBUG_3).lib -<< -!endif - -!if "$(SAMPLES)" == "1" && "$(SHARED)" == "1" -..\samples\example2\example2.exe: $(EXAMPLE2_OBJECTS) $(__muParser_lib___depname) - link /NOLOGO /OUT:$@ $(____DEBUG_5) /pdb:"..\samples\example2\example2.pdb" $(____DEBUG_56_59) /LIBPATH:..\lib $(LDFLAGS) @<< - $(EXAMPLE2_OBJECTS) ..\lib\muparser$(DEBUG_3).lib -<< -!endif - -lib: $(__muParser_lib___depname) $(__muParser_dll___depname) - -samples: $(__example1___depname) $(__example2___depname) - -documentation: - ( cd ..\docs && doxygen ) - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParser.obj: ..\src\muParser.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParser.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBase.obj: ..\src\muParserBase.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserBase.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserBytecode.obj: ..\src\muParserBytecode.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserBytecode.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserCallback.obj: ..\src\muParserCallback.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserCallback.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserDLL.obj: ..\src\muParserDLL.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserDLL.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserError.obj: ..\src\muParserError.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserError.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserInt.obj: ..\src\muParserInt.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserInt.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTest.obj: ..\src\muParserTest.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserTest.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_lib_muParserTokenReader.obj: ..\src\muParserTokenReader.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_LIB_CXXFLAGS) ..\src\muParserTokenReader.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParser.obj: ..\src\muParser.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParser.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBase.obj: ..\src\muParserBase.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserBase.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserBytecode.obj: ..\src\muParserBytecode.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserBytecode.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserCallback.obj: ..\src\muParserCallback.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserCallback.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserDLL.obj: ..\src\muParserDLL.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserDLL.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserError.obj: ..\src\muParserError.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserError.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserInt.obj: ..\src\muParserInt.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserInt.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTest.obj: ..\src\muParserTest.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserTest.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\muParser_dll_muParserTokenReader.obj: ..\src\muParserTokenReader.cpp - $(CXX) /c /nologo /TP /Fo$@ $(MUPARSER_DLL_CXXFLAGS) ..\src\muParserTokenReader.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example1_example1.obj: ..\samples\example1\example1.cpp - $(CXX) /c /nologo /TP /Fo$@ $(EXAMPLE1_CXXFLAGS) ..\samples\example1\example1.cpp - -obj\vc_$(SHAREDBUILDPOSTFIX)_$(DEBUGBUILDPOSTFIX)\example2_example2.obj: ..\samples\example2\example2.c - $(CC) /c /nologo /TC /Fo$@ $(EXAMPLE2_CFLAGS) ..\samples\example2\example2.c - diff --git a/muparser-2.2.5/build/msvc2013/muparser.sln b/muparser-2.2.5/build/msvc2013/muparser.sln deleted file mode 100644 index 3da75108f..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser.sln +++ /dev/null @@ -1,119 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "muparser", "muparser_muParser.vcxproj", "{2A1F639A-7642-57CC-BF97-3EC5B5C89D91}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example1", "muparser_example1.vcxproj", "{A1DCD664-8803-54E2-B35F-84D96B9CA6DF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example2", "muparser_example2.vcxproj", "{B405983E-B929-5BCF-8CC8-03CF34796A23}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug DLL|Any CPU = Debug DLL|Any CPU - Debug DLL|Mixed Platforms = Debug DLL|Mixed Platforms - Debug DLL|Win32 = Debug DLL|Win32 - Debug DLL|x64 = Debug DLL|x64 - Debug Static|Any CPU = Debug Static|Any CPU - Debug Static|Mixed Platforms = Debug Static|Mixed Platforms - Debug Static|Win32 = Debug Static|Win32 - Debug Static|x64 = Debug Static|x64 - Release DLL|Any CPU = Release DLL|Any CPU - Release DLL|Mixed Platforms = Release DLL|Mixed Platforms - Release DLL|Win32 = Release DLL|Win32 - Release DLL|x64 = Release DLL|x64 - Release Static|Any CPU = Release Static|Any CPU - Release Static|Mixed Platforms = Release Static|Mixed Platforms - Release Static|Win32 = Release Static|Win32 - Release Static|x64 = Release Static|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Any CPU.ActiveCfg = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Any CPU.Build.0 = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Mixed Platforms.ActiveCfg = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Mixed Platforms.Build.0 = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug DLL|x64.Build.0 = Debug DLL|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Any CPU.ActiveCfg = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Any CPU.Build.0 = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Mixed Platforms.ActiveCfg = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Mixed Platforms.Build.0 = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Win32.ActiveCfg = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|Win32.Build.0 = Debug Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|x64.ActiveCfg = Debug Static|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Debug Static|x64.Build.0 = Debug Static|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Any CPU.ActiveCfg = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Any CPU.Build.0 = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Mixed Platforms.ActiveCfg = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Mixed Platforms.Build.0 = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|Win32.Build.0 = Release DLL|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|x64.ActiveCfg = Release DLL|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release DLL|x64.Build.0 = Release DLL|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Any CPU.ActiveCfg = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Any CPU.Build.0 = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Mixed Platforms.ActiveCfg = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Mixed Platforms.Build.0 = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Win32.ActiveCfg = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|Win32.Build.0 = Release Static|Win32 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|x64.ActiveCfg = Release Static|x64 - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91}.Release Static|x64.Build.0 = Release Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug DLL|Any CPU.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug DLL|Mixed Platforms.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug DLL|Mixed Platforms.Build.0 = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug DLL|Win32.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug DLL|x64.ActiveCfg = Debug Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Any CPU.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Any CPU.Build.0 = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Mixed Platforms.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Mixed Platforms.Build.0 = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Win32.ActiveCfg = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|Win32.Build.0 = Debug Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|x64.ActiveCfg = Debug Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Debug Static|x64.Build.0 = Debug Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release DLL|Any CPU.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release DLL|Mixed Platforms.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release DLL|Mixed Platforms.Build.0 = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release DLL|Win32.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release DLL|x64.ActiveCfg = Release Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Any CPU.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Any CPU.Build.0 = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Mixed Platforms.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Mixed Platforms.Build.0 = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Win32.ActiveCfg = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|Win32.Build.0 = Release Static|Win32 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|x64.ActiveCfg = Release Static|x64 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF}.Release Static|x64.Build.0 = Release Static|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Any CPU.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Any CPU.Build.0 = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Mixed Platforms.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Mixed Platforms.Build.0 = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug DLL|x64.Build.0 = Debug DLL|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug Static|Any CPU.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug Static|Mixed Platforms.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug Static|Mixed Platforms.Build.0 = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug Static|Win32.ActiveCfg = Debug DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Debug Static|x64.ActiveCfg = Debug DLL|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Any CPU.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Any CPU.Build.0 = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Mixed Platforms.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Mixed Platforms.Build.0 = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|Win32.Build.0 = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|x64.ActiveCfg = Release DLL|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release DLL|x64.Build.0 = Release DLL|x64 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release Static|Any CPU.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release Static|Mixed Platforms.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release Static|Mixed Platforms.Build.0 = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release Static|Win32.ActiveCfg = Release DLL|Win32 - {B405983E-B929-5BCF-8CC8-03CF34796A23}.Release Static|x64.ActiveCfg = Release DLL|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj b/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj deleted file mode 100644 index cb0f6cc4f..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj +++ /dev/null @@ -1,238 +0,0 @@ - - - - - Debug Static - Win32 - - - Debug Static - x64 - - - Release Static - Win32 - - - Release Static - x64 - - - - example1 - {A1DCD664-8803-54E2-B35F-84D96B9CA6DF} - - - - Application - false - Unicode - v120 - - - Application - false - v120 - Unicode - - - Application - Unicode - v120 - - - Application - v120 - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\samples\example1\ - obj\vc_static_rel\example1\ - false - true - ..\..\samples\example1\ - obj\vc_static_dbg\example1\ - true - true - ..\..\samples\example1\ - obj\vc_static_rel\example1\ - false - ..\..\samples\example1\ - obj\vc_static_dbg\example1\ - true - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - true - true - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) - Sync - MultiThreadedDLL - true - obj\vc_static_rel\example1\ - ..\..\samples\example1\example1.pdb - TurnOffAllWarnings - true - - - - - _CONSOLE;NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - ..\..\lib\muparser32.lib;%(AdditionalDependencies) - ..\..\samples\example1\example1.exe - true - ..\..\lib;%(AdditionalLibraryDirectories) - ..\..\samples\example1\example1.pdb - Console - MachineX86 - - - true - ..\..\samples\example1\muparser_example1.bsc - - - - - WIN32;_CONSOLE;_DEBUG;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - Sync - EnableFastChecks - MultiThreadedDebugDLL - true - true - obj\vc_static_dbg\example1\ - ..\..\samples\example1\example1.pdb - Level4 - true - ProgramDatabase - - - _CONSOLE;_DEBUG;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - ..\..\lib\muparserd32.lib;%(AdditionalDependencies) - ..\..\samples\example1\example1.exe - true - ..\..\lib;%(AdditionalLibraryDirectories) - true - ..\..\samples\example1\example1.pdb - Console - MachineX86 - - - true - ..\..\samples\example1\muparser_example1.bsc - - - - - MaxSpeed - AnySuitable - true - Speed - true - true - ..\..\include;%(AdditionalIncludeDirectories) - _CONSOLE;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - obj\vc_static_rel\example1\ - ..\..\samples\example1\example1.pdb - TurnOffAllWarnings - - - ..\..\lib\muparser64.lib;%(AdditionalDependencies) - ..\..\samples\example1\example1.exe - ..\..\lib;%(AdditionalLibraryDirectories) - Console - - - - - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - _CONSOLE;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - NotSet - obj\vc_static_dbg\example1\ - ..\..\samples\example1\example1.pdb - Level4 - ProgramDatabase - - - ..\..\lib\muparserd64.lib;%(AdditionalDependencies) - ..\..\samples\example1\example1.exe - ..\..\lib;%(AdditionalLibraryDirectories) - false - true - ..\..\samples\example1\example1.pdb - Console - NotSet - - - - - - - - {2a1f639a-7642-57cc-bf97-3ec5b5c89d91} - false - - - - - - \ No newline at end of file diff --git a/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj.filters b/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj.filters deleted file mode 100644 index c410514cb..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_example1.vcxproj.filters +++ /dev/null @@ -1,14 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - \ No newline at end of file diff --git a/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj b/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj deleted file mode 100644 index 06c0b6657..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - - Debug DLL - Win32 - - - Debug DLL - x64 - - - Release DLL - Win32 - - - Release DLL - x64 - - - - example2 - {B405983E-B929-5BCF-8CC8-03CF34796A23} - - - - Application - false - v120 - Unicode - - - Application - false - v120 - Unicode - - - Application - v120 - - - Application - v120 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\samples\example2\ - obj\vc_shared_rel\example2\ - false - true - ..\..\samples\example2\ - obj\vc_shared_rel\example2\ - ..\..\samples\example2\ - obj\vc_shared_dbg\example2\ - true - true - ..\..\samples\example2\ - obj\vc_shared_dbg\example2\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - WIN32;_CONSOLE;NDEBUG;USINGDLL;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - MaxSpeed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;NDEBUG;USINGDLL;%(PreprocessorDefinitions) - Sync - MultiThreadedDLL - true - obj\vc_shared_rel\example2\ - ..\..\samples\example2\example2.pdb - TurnOffAllWarnings - true - - - - - _CONSOLE;NDEBUG;USINGDLL;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - ..\..\lib\muparser32.lib;%(AdditionalDependencies) - ..\..\samples\example2\example2.exe - true - ..\..\lib;%(AdditionalLibraryDirectories) - ..\..\samples\example2\example2.pdb - Console - MachineX86 - - - true - ..\..\samples\example2\muparser_example2.bsc - - - - - MaxSpeed - AnySuitable - true - Speed - true - ..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDLL - - - ..\..\lib\muparser64.lib;%(AdditionalDependencies) - ..\..\samples\example2\example2.exe - - - - - WIN32;_CONSOLE;_DEBUG;USINGDLL;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_CONSOLE;_DEBUG;USINGDLL;%(PreprocessorDefinitions) - Sync - EnableFastChecks - MultiThreadedDebugDLL - true - true - obj\vc_shared_dbg\example2\ - ..\..\samples\example2\example2.pdb - Level4 - true - ProgramDatabase - - - _CONSOLE;_DEBUG;USINGDLL;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - ..\..\lib\muparserd32.lib;%(AdditionalDependencies) - ..\..\samples\example2\example2.exe - true - ..\..\lib;%(AdditionalLibraryDirectories) - true - ..\..\samples\example2\example2.pdb - Console - MachineX86 - - - true - ..\..\samples\example2\muparser_example2.bsc - - - - - ..\..\include;%(AdditionalIncludeDirectories) - MultiThreadedDebugDLL - - - ..\..\lib\muparserd64.lib;%(AdditionalDependencies) - ..\..\samples\example2\example2.exe - - - - - - - - {2a1f639a-7642-57cc-bf97-3ec5b5c89d91} - false - - - - - - \ No newline at end of file diff --git a/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj.filters b/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj.filters deleted file mode 100644 index e89c94103..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_example2.vcxproj.filters +++ /dev/null @@ -1,14 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - \ No newline at end of file diff --git a/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj b/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj deleted file mode 100644 index 203bc6b09..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj +++ /dev/null @@ -1,411 +0,0 @@ - - - - - Debug DLL - Win32 - - - Debug DLL - x64 - - - Debug Static - Win32 - - - Debug Static - x64 - - - Release DLL - Win32 - - - Release DLL - x64 - - - Release Static - Win32 - - - Release Static - x64 - - - - muparser - {2A1F639A-7642-57CC-BF97-3EC5B5C89D91} - muParser - - - - DynamicLibrary - false - v120 - Unicode - - - StaticLibrary - false - Unicode - v120 - - - DynamicLibrary - false - v120 - Unicode - - - StaticLibrary - false - v120 - Unicode - - - DynamicLibrary - v120 - - - StaticLibrary - Unicode - v120 - - - DynamicLibrary - v120 - - - StaticLibrary - v120 - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\lib\ - obj\vc_static_rel\muParser\ - ..\..\lib\ - obj\vc_shared_rel\muParser\ - false - true - ..\..\lib\ - obj\vc_static_dbg\muParser\ - ..\..\lib\ - obj\vc_shared_dbg\muParser\ - true - true - ..\..\lib\ - obj\vc_static_rel\muParser\ - ..\..\lib\ - obj\vc_shared_rel\muParser\ - ..\..\lib\ - obj\vc_static_dbg\muParser\ - ..\..\lib\ - obj\vc_shared_dbg\muParser\ - true - true - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - WIN32;_LIB;NDEBUG;_WIN32;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - MaxSpeed - AnySuitable - true - Speed - true - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_LIB;NDEBUG;_WIN32;MUP_USE_OPENMP;%(PreprocessorDefinitions) - Sync - MultiThreadedDLL - true - obj\vc_static_rel\muParser\ - ..\..\lib\muparser.pdb - TurnOffAllWarnings - true - - - - - NDEBUG;_WIN32;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - ..\..\lib\muparser32.lib - true - - - true - ..\..\lib\muparser_muParser.bsc - - - - - WIN32;_USRDLL;DLL_EXPORTS;NDEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - MaxSpeed - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;NDEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;MUP_USE_OPENMP;%(PreprocessorDefinitions) - Sync - MultiThreadedDLL - true - true - obj\vc_shared_rel\muParser\ - ..\..\lib\muparser32.pdb - TurnOffAllWarnings - true - - - - - NDEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - %(AdditionalDependencies) - ..\..\lib\muparser32.dll - true - %(AdditionalLibraryDirectories) - ..\..\lib\muparser.pdb - ..\..\lib\muparser32.lib - MachineX86 - - - true - ..\..\lib\muparser_muParser.bsc - - - - - WIN32;_LIB;_DEBUG;_WIN32;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;_WIN32;MUP_USE_OPENMP;%(PreprocessorDefinitions) - Sync - EnableFastChecks - true - MultiThreadedDebugDLL - true - true - obj\vc_static_dbg\muParser\ - ..\..\lib\muparserd.pdb - Level4 - true - ProgramDatabase - - - _DEBUG;_WIN32;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - ..\..\lib\muparserd32.lib - true - - - true - ..\..\lib\muparser_muParser.bsc - - - - - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;%(PreprocessorDefinitions) - ..\..\include;%(AdditionalIncludeDirectories) - - - /MP %(AdditionalOptions) - Disabled - ..\..\include;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;_CRT_SECURE_NO_WARNINGS;MUP_USE_OPENMP;%(PreprocessorDefinitions) - Sync - EnableFastChecks - MultiThreadedDebugDLL - true - true - true - obj\vc_shared_dbg\muParser\ - ..\..\lib\muparserd32.pdb - Level4 - true - ProgramDatabase - - - _DEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_WIN32;%(PreprocessorDefinitions) - 0x0409 - ..\..\include;%(AdditionalIncludeDirectories) - - - %(AdditionalOptions) - %(AdditionalDependencies) - ..\..\lib\muparserd32.dll - true - %(AdditionalLibraryDirectories) - true - ..\..\lib\muparserd32.pdb - ..\..\lib\muparserd32.lib - MachineX86 - - - true - ..\..\lib\muparser_muParser.bsc - - - - - MaxSpeed - AnySuitable - true - Speed - true - true - ..\..\include;%(AdditionalIncludeDirectories) - _LIB;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - - - ..\..\lib\muparser64.lib - - - - - ..\..\include;%(AdditionalIncludeDirectories) - _USRDLL;DLL_EXPORTS;NDEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;MUP_USE_OPENMP;%(PreprocessorDefinitions) - MultiThreadedDLL - obj\vc_shared_rel\muParser\ - ..\..\lib\muparser64.pdb - TurnOffAllWarnings - - - ..\..\lib\muparser64.dll - ..\..\lib\muparser64.lib - - - - - ..\..\include;%(AdditionalIncludeDirectories) - _LIB;_DEBUG;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - Level4 - ProgramDatabase - Disabled - - - ..\..\lib\muparserd64.lib - - - - - ..\..\include;%(AdditionalIncludeDirectories) - _USRDLL;DLL_EXPORTS;_DEBUG;MUPARSER_DLL;MUPARSERLIB_EXPORTS;_CRT_SECURE_NO_WARNINGS;MUP_USE_OPENMP;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - obj\vc_shared_dbg\muParser\ - ..\..\lib\muparserd64.pdb - Level4 - ProgramDatabase - - - ..\..\lib\muparserd64.dll - true - ..\..\lib\muparserd64.pdb - ..\..\lib\muparserd64.lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj.filters b/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj.filters deleted file mode 100644 index 7edebc77f..000000000 --- a/muparser-2.2.5/build/msvc2013/muparser_muParser.vcxproj.filters +++ /dev/null @@ -1,86 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/muparser-2.2.5/configure b/muparser-2.2.5/configure deleted file mode 100755 index 84543fc12..000000000 --- a/muparser-2.2.5/configure +++ /dev/null @@ -1,8355 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for muparser 2.2.4. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2012 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 more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -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 -IFS=$as_save_IFS - - ;; -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 - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: muparser@beltoforion.de about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; 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 - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# 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 - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # 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 sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='muparser' -PACKAGE_TARNAME='muparser' -PACKAGE_VERSION='2.2.4' -PACKAGE_STRING='muparser 2.2.4' -PACKAGE_BUGREPORT='muparser@beltoforion.de' -PACKAGE_URL='' - -ac_subst_vars='LTLIBOBJS -LIBOBJS -COND_WINDOWS_IMPLIB_1 -COND_USE_SOVERSOLARIS_1 -COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1 -COND_USE_SOVERSION_0 -COND_USE_SOVERLINUX_1 -COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1 -COND_USE_SOTWOSYMLINKS_1 -COND_SHARED_1 -COND_SHARED_0 -COND_SAMPLES_1 -COND_PLATFORM_OS2_1 -COND_PLATFORM_MAC_1 -COND_PLATFORM_MAC_0 -COND_PLATFORM_MACOSX_1_USE_SOVERSION_1 -COND_PLATFORM_MACOSX_1 -COND_PLATFORM_MACOSX_0_USE_SOVERSION_1 -COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1 -COND_DEPS_TRACKING_1 -COND_DEPS_TRACKING_0 -COND_DEBUG_1 -COND_DEBUG_0 -OBJCXXFLAGS -SETFILE -REZ -WINDRES -BK_DEPS -DEPS_TRACKING -SONAME_FLAG -USE_SOTWOSYMLINKS -USE_MACVERSION -USE_SOVERCYGWIN -USE_SOVERSOLARIS -USE_SOVERLINUX -USE_SOVERSION -WINDOWS_IMPLIB -PIC_FLAG -SHARED_LD_MODULE_CXX -SHARED_LD_MODULE_CC -SHARED_LD_CXX -SHARED_LD_CC -AIX_CXX_LD -dlldir -DLLPREFIX_MODULE -DLLPREFIX -LIBEXT -LIBPREFIX -DLLIMP_SUFFIX -SO_SUFFIX_MODULE -SO_SUFFIX -PLATFORM_BEOS -PLATFORM_OS2 -PLATFORM_MACOSX -PLATFORM_MACOS -PLATFORM_MAC -PLATFORM_MSDOS -PLATFORM_WIN32 -PLATFORM_UNIX -IF_GNU_MAKE -LDFLAGS_GUI -INSTALL_DIR -NM -STRIP -AROPTIONS -AR -MAKE_SET -SET_MAKE -CXXCPP -ac_ct_CXX -CXXFLAGS -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -RANLIB -LN_S -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -AWK -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_debug -enable_shared -enable_samples -enable_omf -enable_dependency_tracking -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -CXXCPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# 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. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -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 - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -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) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$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 ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$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 ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - 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 ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=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 ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_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'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -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 - 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 - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# 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 the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - 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 - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# 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 muparser 2.2.4 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 \`..'] - -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] - --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] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/muparser] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of muparser 2.2.4:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-debug Builds in debug mode - --enable-shared Builds in shared mode - --enable-samples Builds the library samples, too - --enable-omf use OMF object format (OS/2) - --disable-dependency-tracking - don't use dependency tracking even if the compiler - can - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP 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. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested 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 - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -muparser configure 2.2.4 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 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 -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by muparser $as_me 2.2.4, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -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` -/usr/bin/hostinfo = `(/usr/bin/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=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append 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 - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > 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 - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - 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. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_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 $ac_precious_vars; 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,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_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 - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_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. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -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_aux_dir= -for ac_dir in build/autoconf "$srcdir"/build/autoconf; 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 - as_fn_error $? "cannot find install-sh, install.sh, or shtool in build/autoconf \"$srcdir\"/build/autoconf" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -# some helpers - - - - - - - - - - - - - - - - - - - - - -## CONFIGURE CHECKS -##################################################################### - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -# We want to inhibit AC_PROG_C* macros adding the default "-g -O2" flags. -# To do so, make sure that the variables are not unset - it is ok if they are -# empty. However, their value MUST be retained, since one may have -# called ./configure CFLAGS=-foobar. -CFLAGS="$CFLAGS" -CPPFLAGS="$CPPFLAGS" -CXXFLAGS="$CXXFLAGS" - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -# 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" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&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/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /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_fn_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 - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -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. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$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' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -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 -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_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" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* 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; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -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 -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - 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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - default="no" - if [ -z "$default" ]; then - default="no" - fi - - # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; -else - enableval="$default" -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the --enable-debug option" >&5 -$as_echo_n "checking for the --enable-debug option... " >&6; } - if [ "x$enableval" = "xyes" ]; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - DEBUG=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - DEBUG=0 - fi - - - if [ "x$DEBUG" = "x1" ]; then - - my_CXXFLAGS="$my_CXXFLAGS -g -O0 -Wall -Wundef -Wno-ctor-dtor-privacy" - my_CFLAGS="$my_CFLAGS -g -O0 -Wall -Wundef" - else - my_CXXFLAGS="$my_CXXFLAGS -O2" - my_CFLAGS="$my_CFLAGS -O2" - fi - # User-supplied CXXFLAGS must always take precedence. - # This still sucks because using `make CFLAGS=-foobar` kills - # the project-supplied flags again. - CXXFLAGS="$my_CXXFLAGS $CXXFLAGS" - CFLAGS="$my_CFLAGS $CFLAGS" - - - default="yes" - if [ -z "$default" ]; then - default="no" - fi - - # Check whether --enable-shared was given. - # fish: disabled -# if test "${enable_shared+set}" = set; then : -# enableval=$enable_shared; -# else -# enableval="$default" -# fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the --enable-shared option" >&5 -$as_echo_n "checking for the --enable-shared option... " >&6; } - if [ "x$enableval" = "xyes" ]; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SHARED=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SHARED=0 - fi - - - -# Check whether --enable-samples was given. -if test "${enable_samples+set}" = set; then : - enableval=$enable_samples; -else - enableval="yes" -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the --enable-samples option" >&5 -$as_echo_n "checking for the --enable-samples option... " >&6; } - if [ "x$enableval" = "xyes" ]; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SAMPLES=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SAMPLES=0 - fi - - -as_dir=lib; as_fn_mkdir_p -as_dir=samples/example1; as_fn_mkdir_p - - - - - - - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel C compiler" >&5 -$as_echo_n "checking whether we are using the Intel C compiler... " >&6; } -if ${bakefile_cv_c_compiler___INTEL_COMPILER+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___INTEL_COMPILER=yes -else - bakefile_cv_c_compiler___INTEL_COMPILER=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___INTEL_COMPILER" >&5 -$as_echo "$bakefile_cv_c_compiler___INTEL_COMPILER" >&6; } - if test "x$bakefile_cv_c_compiler___INTEL_COMPILER" = "xyes"; then - :; INTELCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - if test "$INTELCC" = "yes"; then - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C compiler v8 or later" >&5 -$as_echo_n "checking whether we are using Intel C compiler v8 or later... " >&6; } -if ${bakefile_cv_c_compiler___INTEL_COMPILER_lt_800+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER || __INTEL_COMPILER < 800 - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___INTEL_COMPILER_lt_800=yes -else - bakefile_cv_c_compiler___INTEL_COMPILER_lt_800=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___INTEL_COMPILER_lt_800" >&5 -$as_echo "$bakefile_cv_c_compiler___INTEL_COMPILER_lt_800" >&6; } - if test "x$bakefile_cv_c_compiler___INTEL_COMPILER_lt_800" = "xyes"; then - :; INTELCC8=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C compiler v10 or later" >&5 -$as_echo_n "checking whether we are using Intel C compiler v10 or later... " >&6; } -if ${bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER || __INTEL_COMPILER < 1000 - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000=yes -else - bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000" >&5 -$as_echo "$bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000" >&6; } - if test "x$bakefile_cv_c_compiler___INTEL_COMPILER_lt_1000" = "xyes"; then - :; INTELCC10=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - - if test "x$GCC" != "xyes"; then - if test "xCC" = "xC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler requires -ext o" >&5 -$as_echo_n "checking if the C++ compiler requires -ext o... " >&6; } -if ${bakefile_cv_cxx_exto+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest.$ac_ext.o -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in `(ls conftest.* 2>/dev/null)`; do - case $ac_file in - conftest.$ac_ext.o) - bakefile_cv_cxx_exto="-ext o" - ;; - *) - ;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot figure out if compiler needs -ext o: cannot compile -See \`config.log' for more details" "$LINENO" 5; } - -fi -rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_exto" >&5 -$as_echo "$bakefile_cv_cxx_exto" >&6; } -if test "x$bakefile_cv_cxx_exto" '!=' "x"; then - if test "cxx" = "c"; then - CFLAGS="$bakefile_cv_cxx_exto $CFLAGS" - fi - if test "cxx" = "cxx"; then - CXXFLAGS="$bakefile_cv_cxx_exto $CXXFLAGS" - fi -fi - - if test "x$bakefile_cv_c_exto" '!=' "x"; then - unset ac_cv_prog_cc_g - ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 - fi - fi - - case `uname -s` in - AIX*) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the IBM xlC C compiler" >&5 -$as_echo_n "checking whether we are using the IBM xlC C compiler... " >&6; } -if ${bakefile_cv_c_compiler___xlC__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __xlC__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___xlC__=yes -else - bakefile_cv_c_compiler___xlC__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___xlC__" >&5 -$as_echo "$bakefile_cv_c_compiler___xlC__" >&6; } - if test "x$bakefile_cv_c_compiler___xlC__" = "xyes"; then - :; XLCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - Darwin) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Metrowerks C compiler" >&5 -$as_echo_n "checking whether we are using the Metrowerks C compiler... " >&6; } -if ${bakefile_cv_c_compiler___MWERKS__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __MWERKS__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___MWERKS__=yes -else - bakefile_cv_c_compiler___MWERKS__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___MWERKS__" >&5 -$as_echo "$bakefile_cv_c_compiler___MWERKS__" >&6; } - if test "x$bakefile_cv_c_compiler___MWERKS__" = "xyes"; then - :; MWCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - if test "$MWCC" != "yes"; then - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the IBM xlC C compiler" >&5 -$as_echo_n "checking whether we are using the IBM xlC C compiler... " >&6; } -if ${bakefile_cv_c_compiler___xlC__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __xlC__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___xlC__=yes -else - bakefile_cv_c_compiler___xlC__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___xlC__" >&5 -$as_echo "$bakefile_cv_c_compiler___xlC__" >&6; } - if test "x$bakefile_cv_c_compiler___xlC__" = "xyes"; then - :; XLCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - ;; - - IRIX*) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the SGI C compiler" >&5 -$as_echo_n "checking whether we are using the SGI C compiler... " >&6; } -if ${bakefile_cv_c_compiler__SGI_COMPILER_VERSION+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef _SGI_COMPILER_VERSION - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler__SGI_COMPILER_VERSION=yes -else - bakefile_cv_c_compiler__SGI_COMPILER_VERSION=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler__SGI_COMPILER_VERSION" >&5 -$as_echo "$bakefile_cv_c_compiler__SGI_COMPILER_VERSION" >&6; } - if test "x$bakefile_cv_c_compiler__SGI_COMPILER_VERSION" = "xyes"; then - :; SGICC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - Linux*) - if test "$INTELCC" != "yes"; then - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Sun C compiler" >&5 -$as_echo_n "checking whether we are using the Sun C compiler... " >&6; } -if ${bakefile_cv_c_compiler___SUNPRO_C+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __SUNPRO_C - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___SUNPRO_C=yes -else - bakefile_cv_c_compiler___SUNPRO_C=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___SUNPRO_C" >&5 -$as_echo "$bakefile_cv_c_compiler___SUNPRO_C" >&6; } - if test "x$bakefile_cv_c_compiler___SUNPRO_C" = "xyes"; then - :; SUNCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - ;; - - HP-UX*) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the HP C compiler" >&5 -$as_echo_n "checking whether we are using the HP C compiler... " >&6; } -if ${bakefile_cv_c_compiler___HP_cc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __HP_cc - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___HP_cc=yes -else - bakefile_cv_c_compiler___HP_cc=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___HP_cc" >&5 -$as_echo "$bakefile_cv_c_compiler___HP_cc" >&6; } - if test "x$bakefile_cv_c_compiler___HP_cc" = "xyes"; then - :; HPCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - OSF1) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Compaq C compiler" >&5 -$as_echo_n "checking whether we are using the Compaq C compiler... " >&6; } -if ${bakefile_cv_c_compiler___DECC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __DECC - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___DECC=yes -else - bakefile_cv_c_compiler___DECC=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___DECC" >&5 -$as_echo "$bakefile_cv_c_compiler___DECC" >&6; } - if test "x$bakefile_cv_c_compiler___DECC" = "xyes"; then - :; COMPAQCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - SunOS) - - - 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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Sun C compiler" >&5 -$as_echo_n "checking whether we are using the Sun C compiler... " >&6; } -if ${bakefile_cv_c_compiler___SUNPRO_C+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __SUNPRO_C - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bakefile_cv_c_compiler___SUNPRO_C=yes -else - bakefile_cv_c_compiler___SUNPRO_C=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_c_compiler___SUNPRO_C" >&5 -$as_echo "$bakefile_cv_c_compiler___SUNPRO_C" >&6; } - if test "x$bakefile_cv_c_compiler___SUNPRO_C" = "xyes"; then - :; SUNCC=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - esac - fi - - - - - - - - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel C++ compiler" >&5 -$as_echo_n "checking whether we are using the Intel C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___INTEL_COMPILER+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___INTEL_COMPILER=yes -else - bakefile_cv_cxx_compiler___INTEL_COMPILER=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___INTEL_COMPILER" >&5 -$as_echo "$bakefile_cv_cxx_compiler___INTEL_COMPILER" >&6; } - if test "x$bakefile_cv_cxx_compiler___INTEL_COMPILER" = "xyes"; then - :; INTELCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - if test "$INTELCXX" = "yes"; then - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C++ compiler v8 or later" >&5 -$as_echo_n "checking whether we are using Intel C++ compiler v8 or later... " >&6; } -if ${bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER || __INTEL_COMPILER < 800 - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800=yes -else - bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800" >&5 -$as_echo "$bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800" >&6; } - if test "x$bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_800" = "xyes"; then - :; INTELCXX8=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C++ compiler v10 or later" >&5 -$as_echo_n "checking whether we are using Intel C++ compiler v10 or later... " >&6; } -if ${bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __INTEL_COMPILER || __INTEL_COMPILER < 1000 - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000=yes -else - bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000" >&5 -$as_echo "$bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000" >&6; } - if test "x$bakefile_cv_cxx_compiler___INTEL_COMPILER_lt_1000" = "xyes"; then - :; INTELCXX10=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - - if test "x$GCXX" != "xyes"; then - if test "xCXX" = "xC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler requires -ext o" >&5 -$as_echo_n "checking if the C++ compiler requires -ext o... " >&6; } -if ${bakefile_cv_cxx_exto+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest.$ac_ext.o -if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in `(ls conftest.* 2>/dev/null)`; do - case $ac_file in - conftest.$ac_ext.o) - bakefile_cv_cxx_exto="-ext o" - ;; - *) - ;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot figure out if compiler needs -ext o: cannot compile -See \`config.log' for more details" "$LINENO" 5; } - -fi -rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_exto" >&5 -$as_echo "$bakefile_cv_cxx_exto" >&6; } -if test "x$bakefile_cv_cxx_exto" '!=' "x"; then - if test "cxx" = "c"; then - CFLAGS="$bakefile_cv_cxx_exto $CFLAGS" - fi - if test "cxx" = "cxx"; then - CXXFLAGS="$bakefile_cv_cxx_exto $CXXFLAGS" - fi -fi - - if test "x$bakefile_cv_c_exto" '!=' "x"; then - unset ac_cv_prog_cc_g - ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 - fi - fi - - case `uname -s` in - AIX*) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the IBM xlC C++ compiler" >&5 -$as_echo_n "checking whether we are using the IBM xlC C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___xlC__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __xlC__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___xlC__=yes -else - bakefile_cv_cxx_compiler___xlC__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___xlC__" >&5 -$as_echo "$bakefile_cv_cxx_compiler___xlC__" >&6; } - if test "x$bakefile_cv_cxx_compiler___xlC__" = "xyes"; then - :; XLCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - Darwin) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Metrowerks C++ compiler" >&5 -$as_echo_n "checking whether we are using the Metrowerks C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___MWERKS__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __MWERKS__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___MWERKS__=yes -else - bakefile_cv_cxx_compiler___MWERKS__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___MWERKS__" >&5 -$as_echo "$bakefile_cv_cxx_compiler___MWERKS__" >&6; } - if test "x$bakefile_cv_cxx_compiler___MWERKS__" = "xyes"; then - :; MWCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - if test "$MWCXX" != "yes"; then - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the IBM xlC C++ compiler" >&5 -$as_echo_n "checking whether we are using the IBM xlC C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___xlC__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __xlC__ - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___xlC__=yes -else - bakefile_cv_cxx_compiler___xlC__=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___xlC__" >&5 -$as_echo "$bakefile_cv_cxx_compiler___xlC__" >&6; } - if test "x$bakefile_cv_cxx_compiler___xlC__" = "xyes"; then - :; XLCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - ;; - - IRIX*) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the SGI C++ compiler" >&5 -$as_echo_n "checking whether we are using the SGI C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef _SGI_COMPILER_VERSION - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION=yes -else - bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION" >&5 -$as_echo "$bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION" >&6; } - if test "x$bakefile_cv_cxx_compiler__SGI_COMPILER_VERSION" = "xyes"; then - :; SGICXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - Linux*) - if test "$INTELCXX" != "yes"; then - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Sun C++ compiler" >&5 -$as_echo_n "checking whether we are using the Sun C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___SUNPRO_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __SUNPRO_CC - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___SUNPRO_CC=yes -else - bakefile_cv_cxx_compiler___SUNPRO_CC=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___SUNPRO_CC" >&5 -$as_echo "$bakefile_cv_cxx_compiler___SUNPRO_CC" >&6; } - if test "x$bakefile_cv_cxx_compiler___SUNPRO_CC" = "xyes"; then - :; SUNCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - fi - ;; - - HP-UX*) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the HP C++ compiler" >&5 -$as_echo_n "checking whether we are using the HP C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___HP_aCC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __HP_aCC - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___HP_aCC=yes -else - bakefile_cv_cxx_compiler___HP_aCC=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___HP_aCC" >&5 -$as_echo "$bakefile_cv_cxx_compiler___HP_aCC" >&6; } - if test "x$bakefile_cv_cxx_compiler___HP_aCC" = "xyes"; then - :; HPCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - OSF1) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Compaq C++ compiler" >&5 -$as_echo_n "checking whether we are using the Compaq C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___DECCXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __DECCXX - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___DECCXX=yes -else - bakefile_cv_cxx_compiler___DECCXX=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___DECCXX" >&5 -$as_echo "$bakefile_cv_cxx_compiler___DECCXX" >&6; } - if test "x$bakefile_cv_cxx_compiler___DECCXX" = "xyes"; then - :; COMPAQCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - - SunOS) - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Sun C++ compiler" >&5 -$as_echo_n "checking whether we are using the Sun C++ compiler... " >&6; } -if ${bakefile_cv_cxx_compiler___SUNPRO_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #ifndef __SUNPRO_CC - choke me - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - bakefile_cv_cxx_compiler___SUNPRO_CC=yes -else - bakefile_cv_cxx_compiler___SUNPRO_CC=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_cxx_compiler___SUNPRO_CC" >&5 -$as_echo "$bakefile_cv_cxx_compiler___SUNPRO_CC" >&6; } - if test "x$bakefile_cv_cxx_compiler___SUNPRO_CC" = "xyes"; then - :; SUNCXX=yes - else - :; - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ;; - esac - fi - - - - - - - - - if test "x$BAKEFILE_HOST" = "x"; then - if test "x${host}" = "x" ; then - as_fn_error $? "You must call the autoconf \"CANONICAL_HOST\" macro in your configure.ac (or .in) file." "$LINENO" 5 - fi - - BAKEFILE_HOST="${host}" - fi - - if test "x$BAKEFILE_CHECK_BASICS" != "xno"; then - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - - - if test "x$SUNCXX" = "xyes"; then - AR=$CXX - AROPTIONS="-xar -o" - - elif test "x$SGICC" = "xyes"; then - AR=$CXX - AROPTIONS="-ar -o" - - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="ar" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - - AROPTIONS=rcu - fi - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. -set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NM"; then - ac_ct_NM=$NM - # Extract the first word of "nm", so it can be a program name with args. -set dummy nm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NM" = x; then - NM=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -else - NM="$ac_cv_prog_NM" -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for command to install directories" >&5 -$as_echo_n "checking for command to install directories... " >&6; } - INSTALL_TEST_DIR=acbftest$$ - $INSTALL -d $INSTALL_TEST_DIR > /dev/null 2>&1 - if test $? = 0 -a -d $INSTALL_TEST_DIR; then - rmdir $INSTALL_TEST_DIR - INSTALL_DIR='$(INSTALL) -d' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL -d" >&5 -$as_echo "$INSTALL -d" >&6; } - else - INSTALL_DIR="mkdir -p" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: mkdir -p" >&5 -$as_echo "mkdir -p" >&6; } - fi - - - LDFLAGS_GUI= - case ${BAKEFILE_HOST} in - *-*-cygwin* | *-*-mingw32* ) - LDFLAGS_GUI="-mwindows" - esac - - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if make is GNU make" >&5 -$as_echo_n "checking if make is GNU make... " >&6; } -if ${bakefile_cv_prog_makeisgnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | - egrep -s GNU > /dev/null); then - bakefile_cv_prog_makeisgnu="yes" - else - bakefile_cv_prog_makeisgnu="no" - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_prog_makeisgnu" >&5 -$as_echo "$bakefile_cv_prog_makeisgnu" >&6; } - - if test "x$bakefile_cv_prog_makeisgnu" = "xyes"; then - IF_GNU_MAKE="" - else - IF_GNU_MAKE="#" - fi - - - - PLATFORM_UNIX=0 - PLATFORM_WIN32=0 - PLATFORM_MSDOS=0 - PLATFORM_MAC=0 - PLATFORM_MACOS=0 - PLATFORM_MACOSX=0 - PLATFORM_OS2=0 - PLATFORM_BEOS=0 - - if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then - case "${BAKEFILE_HOST}" in - *-*-mingw32* ) - PLATFORM_WIN32=1 - ;; - *-pc-msdosdjgpp ) - PLATFORM_MSDOS=1 - ;; - *-pc-os2_emx | *-pc-os2-emx ) - PLATFORM_OS2=1 - ;; - *-*-darwin* ) - PLATFORM_MAC=1 - PLATFORM_MACOSX=1 - ;; - *-*-beos* ) - PLATFORM_BEOS=1 - ;; - powerpc-apple-macos* ) - PLATFORM_MAC=1 - PLATFORM_MACOS=1 - ;; - * ) - PLATFORM_UNIX=1 - ;; - esac - else - case "$BAKEFILE_FORCE_PLATFORM" in - win32 ) - PLATFORM_WIN32=1 - ;; - msdos ) - PLATFORM_MSDOS=1 - ;; - os2 ) - PLATFORM_OS2=1 - ;; - darwin ) - PLATFORM_MAC=1 - PLATFORM_MACOSX=1 - ;; - unix ) - PLATFORM_UNIX=1 - ;; - beos ) - PLATFORM_BEOS=1 - ;; - * ) - as_fn_error $? "Unknown platform: $BAKEFILE_FORCE_PLATFORM" "$LINENO" 5 - ;; - esac - fi - - - - - - - - - - - - # Check whether --enable-omf was given. -if test "${enable_omf+set}" = set; then : - enableval=$enable_omf; bk_os2_use_omf="$enableval" -fi - - - case "${BAKEFILE_HOST}" in - *-*-darwin* ) - if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fno-common" - CXXFLAGS="$CXXFLAGS -fno-common" - fi - if test "x$XLCC" = "xyes"; then - CFLAGS="$CFLAGS -qnocommon" - CXXFLAGS="$CXXFLAGS -qnocommon" - fi - ;; - - *-pc-os2_emx | *-pc-os2-emx ) - if test "x$bk_os2_use_omf" = "xyes" ; then - AR=emxomfar - RANLIB=: - LDFLAGS="-Zomf $LDFLAGS" - CFLAGS="-Zomf $CFLAGS" - CXXFLAGS="-Zomf $CXXFLAGS" - OS2_LIBEXT="lib" - else - OS2_LIBEXT="a" - fi - ;; - - i*86-*-beos* ) - LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS" - ;; - esac - - - SO_SUFFIX="so" - SO_SUFFIX_MODULE="so" - EXEEXT="" - LIBPREFIX="lib" - LIBEXT=".a" - DLLPREFIX="lib" - DLLPREFIX_MODULE="" - DLLIMP_SUFFIX="" - dlldir="$libdir" - - case "${BAKEFILE_HOST}" in - ia64-hp-hpux* ) - ;; - *-hp-hpux* ) - SO_SUFFIX="sl" - SO_SUFFIX_MODULE="sl" - ;; - *-*-aix* ) - SO_SUFFIX="a" - SO_SUFFIX_MODULE="a" - ;; - *-*-cygwin* ) - SO_SUFFIX="dll" - SO_SUFFIX_MODULE="dll" - DLLIMP_SUFFIX="dll.a" - EXEEXT=".exe" - DLLPREFIX="cyg" - dlldir="$bindir" - ;; - *-*-mingw32* ) - SO_SUFFIX="dll" - SO_SUFFIX_MODULE="dll" - DLLIMP_SUFFIX="dll.a" - EXEEXT=".exe" - DLLPREFIX="" - dlldir="$bindir" - ;; - *-pc-msdosdjgpp ) - EXEEXT=".exe" - DLLPREFIX="" - dlldir="$bindir" - ;; - *-pc-os2_emx | *-pc-os2-emx ) - SO_SUFFIX="dll" - SO_SUFFIX_MODULE="dll" - DLLIMP_SUFFIX=$OS2_LIBEXT - EXEEXT=".exe" - DLLPREFIX="" - LIBPREFIX="" - LIBEXT=".$OS2_LIBEXT" - dlldir="$bindir" - ;; - *-*-darwin* ) - SO_SUFFIX="dylib" - SO_SUFFIX_MODULE="bundle" - ;; - esac - - if test "x$DLLIMP_SUFFIX" = "x" ; then - DLLIMP_SUFFIX="$SO_SUFFIX" - fi - - - - - - - - - - - - - PIC_FLAG="" - if test "x$GCC" = "xyes"; then - PIC_FLAG="-fPIC" - fi - - SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o" - SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o" - WINDOWS_IMPLIB=0 - - case "${BAKEFILE_HOST}" in - *-hp-hpux* ) - if test "x$GCC" != "xyes"; then - LDFLAGS="$LDFLAGS -L/usr/lib" - - SHARED_LD_CC="${CC} -b -o" - SHARED_LD_CXX="${CXX} -b -o" - PIC_FLAG="+Z" - fi - ;; - - *-*-linux* ) - if test "$INTELCC" = "yes" -a "$INTELCC8" != "yes"; then - PIC_FLAG="-KPIC" - elif test "x$SUNCXX" = "xyes"; then - SHARED_LD_CC="${CC} -G -o" - SHARED_LD_CXX="${CXX} -G -o" - PIC_FLAG="-KPIC" - fi - ;; - - *-*-solaris2* ) - if test "x$SUNCXX" = xyes ; then - SHARED_LD_CC="${CC} -G -o" - SHARED_LD_CXX="${CXX} -G -o" - PIC_FLAG="-KPIC" - fi - ;; - - *-*-darwin* ) - -D='$' -cat <shared-ld-sh -#!/bin/sh -#----------------------------------------------------------------------------- -#-- Name: distrib/mac/shared-ld-sh -#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X -#-- Author: Gilles Depeyrot -#-- Copyright: (c) 2002 Gilles Depeyrot -#-- Licence: any use permitted -#----------------------------------------------------------------------------- - -verbose=0 -args="" -objects="" -linking_flag="-dynamiclib" -ldargs="-r -keep_private_externs -nostdlib" - -if test "x${D}CXX" = "x"; then - CXX="c++" -fi - -while test ${D}# -gt 0; do - case ${D}1 in - - -v) - verbose=1 - ;; - - -o|-compatibility_version|-current_version|-framework|-undefined|-install_name) - # collect these options and values - args="${D}{args} ${D}1 ${D}2" - shift - ;; - - -arch|-isysroot) - # collect these options and values - ldargs="${D}{ldargs} ${D}1 ${D}2" - shift - ;; - - -s|-Wl,*) - # collect these load args - ldargs="${D}{ldargs} ${D}1" - ;; - - -l*|-L*|-flat_namespace|-headerpad_max_install_names) - # collect these options - args="${D}{args} ${D}1" - ;; - - -dynamiclib|-bundle) - linking_flag="${D}1" - ;; - - -*) - echo "shared-ld: unhandled option '${D}1'" - exit 1 - ;; - - *.o | *.a | *.dylib) - # collect object files - objects="${D}{objects} ${D}1" - ;; - - *) - echo "shared-ld: unhandled argument '${D}1'" - exit 1 - ;; - - esac - shift -done - -status=0 - -# -# Link one module containing all the others -# -if test ${D}{verbose} = 1; then - echo "${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o" -fi -${D}CXX ${D}{ldargs} ${D}{objects} -o master.${D}${D}.o -status=${D}? - -# -# Link the shared library from the single module created, but only if the -# previous command didn't fail: -# -if test ${D}{status} = 0; then - if test ${D}{verbose} = 1; then - echo "${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args}" - fi - ${D}CXX ${D}{linking_flag} master.${D}${D}.o ${D}{args} - status=${D}? -fi - -# -# Remove intermediate module -# -rm -f master.${D}${D}.o - -exit ${D}status -EOF - - chmod +x shared-ld-sh - - SHARED_LD_MODULE_CC="`pwd`/shared-ld-sh -bundle -headerpad_max_install_names -o" - SHARED_LD_MODULE_CXX="CXX=\"\$(CXX)\" $SHARED_LD_MODULE_CC" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc 3.1 or later" >&5 -$as_echo_n "checking for gcc 3.1 or later... " >&6; } -if ${bakefile_cv_gcc31+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - #if (__GNUC__ < 3) || \ - ((__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) - This is old gcc - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - bakefile_cv_gcc31=yes - -else - - bakefile_cv_gcc31=no - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bakefile_cv_gcc31" >&5 -$as_echo "$bakefile_cv_gcc31" >&6; } - if test "$bakefile_cv_gcc31" = "no"; then - SHARED_LD_CC="`pwd`/shared-ld-sh -dynamiclib -headerpad_max_install_names -o" - SHARED_LD_CXX="$SHARED_LD_CC" - else - SHARED_LD_CC="\${CC} -dynamiclib -single_module -headerpad_max_install_names -o" - SHARED_LD_CXX="\${CXX} -dynamiclib -single_module -headerpad_max_install_names -o" - fi - - if test "x$GCC" == "xyes"; then - PIC_FLAG="-dynamic -fPIC" - fi - if test "x$XLCC" = "xyes"; then - PIC_FLAG="-dynamic -DPIC" - fi - ;; - - *-*-aix* ) - if test "x$GCC" = "xyes"; then - PIC_FLAG="" - - case "${BAKEFILE_HOST}" in - *-*-aix5* ) - LD_EXPFULL="-Wl,-bexpfull" - ;; - esac - - SHARED_LD_CC="\$(CC) -shared $LD_EXPFULL -o" - SHARED_LD_CXX="\$(CXX) -shared $LD_EXPFULL -o" - else - # Extract the first word of "makeC++SharedLib", so it can be a program name with args. -set dummy makeC++SharedLib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AIX_CXX_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AIX_CXX_LD"; then - ac_cv_prog_AIX_CXX_LD="$AIX_CXX_LD" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AIX_CXX_LD="makeC++SharedLib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_AIX_CXX_LD" && ac_cv_prog_AIX_CXX_LD="/usr/lpp/xlC/bin/makeC++SharedLib" -fi -fi -AIX_CXX_LD=$ac_cv_prog_AIX_CXX_LD -if test -n "$AIX_CXX_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AIX_CXX_LD" >&5 -$as_echo "$AIX_CXX_LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - SHARED_LD_CC="$AIX_CC_LD -p 0 -o" - SHARED_LD_CXX="$AIX_CXX_LD -p 0 -o" - fi - ;; - - *-*-beos* ) - SHARED_LD_CC="${LD} -nostart -o" - SHARED_LD_CXX="${LD} -nostart -o" - ;; - - *-*-irix* ) - if test "x$GCC" != "xyes"; then - PIC_FLAG="-KPIC" - fi - ;; - - *-*-cygwin* | *-*-mingw32* ) - PIC_FLAG="" - SHARED_LD_CC="\$(CC) -shared -o" - SHARED_LD_CXX="\$(CXX) -shared -o" - WINDOWS_IMPLIB=1 - ;; - - *-pc-os2_emx | *-pc-os2-emx ) - SHARED_LD_CC="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" - SHARED_LD_CXX="`pwd`/dllar.sh -libf INITINSTANCE -libf TERMINSTANCE -o" - PIC_FLAG="" - -D='$' -cat <dllar.sh -#!/bin/sh -# -# dllar - a tool to build both a .dll and an .a file -# from a set of object (.o) files for EMX/OS2. -# -# Written by Andrew Zabolotny, bit@freya.etu.ru -# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de -# -# This script will accept a set of files on the command line. -# All the public symbols from the .o files will be exported into -# a .DEF file, then linker will be run (through gcc) against them to -# build a shared library consisting of all given .o files. All libraries -# (.a) will be first decompressed into component .o files then act as -# described above. You can optionally give a description (-d "description") -# which will be put into .DLL. To see the list of accepted options (as well -# as command-line format) simply run this program without options. The .DLL -# is built to be imported by name (there is no guarantee that new versions -# of the library you build will have same ordinals for same symbols). -# -# dllar 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, or (at your option) -# any later version. -# -# dllar 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 dllar; see the file COPYING. If not, write to the Free -# Software Foundation, 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# To successfuly run this program you will need: -# - Current drive should have LFN support (HPFS, ext2, network, etc) -# (Sometimes dllar generates filenames which won't fit 8.3 scheme) -# - gcc -# (used to build the .dll) -# - emxexp -# (used to create .def file from .o files) -# - emximp -# (used to create .a file from .def file) -# - GNU text utilites (cat, sort, uniq) -# used to process emxexp output -# - GNU file utilities (mv, rm) -# - GNU sed -# - lxlite (optional, see flag below) -# (used for general .dll cleanup) -# - -flag_USE_LXLITE=1; - -# -# helper functions -# basnam, variant of basename, which does _not_ remove the path, _iff_ -# second argument (suffix to remove) is given -basnam(){ - case ${D}# in - 1) - echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//' - ;; - 2) - echo ${D}1 | sed 's/'${D}2'${D}//' - ;; - *) - echo "error in basnam ${D}*" - exit 8 - ;; - esac -} - -# Cleanup temporary files and output -CleanUp() { - cd ${D}curDir - for i in ${D}inputFiles ; do - case ${D}i in - *!) - rm -rf \`basnam ${D}i !\` - ;; - *) - ;; - esac - done - - # Kill result in case of failure as there is just to many stupid make/nmake - # things out there which doesn't do this. - if [ ${D}# -eq 0 ]; then - rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile - fi -} - -# Print usage and exit script with rc=1. -PrintHelp() { - echo 'Usage: dllar.sh [-o[utput] output_file] [-i[mport] importlib_name]' - echo ' [-name-mangler-script script.sh]' - echo ' [-d[escription] "dll descrption"] [-cc "CC"] [-f[lags] "CFLAGS"]' - echo ' [-ord[inals]] -ex[clude] "symbol(s)"' - echo ' [-libf[lags] "{INIT|TERM}{GLOBAL|INSTANCE}"] [-nocrt[dll]] [-nolxl[ite]]' - echo ' [*.o] [*.a]' - echo '*> "output_file" should have no extension.' - echo ' If it has the .o, .a or .dll extension, it is automatically removed.' - echo ' The import library name is derived from this and is set to "name".a,' - echo ' unless overridden by -import' - echo '*> "importlib_name" should have no extension.' - echo ' If it has the .o, or .a extension, it is automatically removed.' - echo ' This name is used as the import library name and may be longer and' - echo ' more descriptive than the DLL name which has to follow the old ' - echo ' 8.3 convention of FAT.' - echo '*> "script.sh may be given to override the output_file name by a' - echo ' different name. It is mainly useful if the regular make process' - echo ' of some package does not take into account OS/2 restriction of' - echo ' DLL name lengths. It takes the importlib name as input and is' - echo ' supposed to procude a shorter name as output. The script should' - echo ' expect to get importlib_name without extension and should produce' - echo ' a (max.) 8 letter name without extension.' - echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)' - echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)' - echo ' These flags will be put at the start of GCC command line.' - echo '*> -ord[inals] tells dllar to export entries by ordinals. Be careful.' - echo '*> -ex[clude] defines symbols which will not be exported. You can define' - echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".' - echo ' If the last character of a symbol is "*", all symbols beginning' - echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).' - echo '*> -libf[lags] can be used to add INITGLOBAL/INITINSTANCE and/or' - echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.' - echo '*> -nocrt[dll] switch will disable linking the library against emx''s' - echo ' C runtime DLLs.' - echo '*> -nolxl[ite] switch will disable running lxlite on the resulting DLL.' - echo '*> All other switches (for example -L./ or -lmylib) will be passed' - echo ' unchanged to GCC at the end of command line.' - echo '*> If you create a DLL from a library and you do not specify -o,' - echo ' the basename for DLL and import library will be set to library name,' - echo ' the initial library will be renamed to 'name'_s.a (_s for static)' - echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial' - echo ' library will be renamed into gcc_s.a.' - echo '--------' - echo 'Example:' - echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord' - echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"' - CleanUp - exit 1 -} - -# Execute a command. -# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script. -# @Uses Whatever CleanUp() uses. -doCommand() { - echo "${D}*" - eval ${D}* - rcCmd=${D}? - - if [ ${D}rcCmd -ne 0 ]; then - echo "command failed, exit code="${D}rcCmd - CleanUp - exit ${D}rcCmd - fi -} - -# main routine -# setup globals -cmdLine=${D}* -outFile="" -outimpFile="" -inputFiles="" -renameScript="" -description="" -CC=gcc.exe -CFLAGS="-s -Zcrtdll" -EXTRA_CFLAGS="" -EXPORT_BY_ORDINALS=0 -exclude_symbols="" -library_flags="" -curDir=\`pwd\` -curDirS=curDir -case ${D}curDirS in -*/) - ;; -*) - curDirS=${D}{curDirS}"/" - ;; -esac -# Parse commandline -libsToLink=0 -omfLinking=0 -while [ ${D}1 ]; do - case ${D}1 in - -ord*) - EXPORT_BY_ORDINALS=1; - ;; - -o*) - shift - outFile=${D}1 - ;; - -i*) - shift - outimpFile=${D}1 - ;; - -name-mangler-script) - shift - renameScript=${D}1 - ;; - -d*) - shift - description=${D}1 - ;; - -f*) - shift - CFLAGS=${D}1 - ;; - -c*) - shift - CC=${D}1 - ;; - -h*) - PrintHelp - ;; - -ex*) - shift - exclude_symbols=${D}{exclude_symbols}${D}1" " - ;; - -libf*) - shift - library_flags=${D}{library_flags}${D}1" " - ;; - -nocrt*) - CFLAGS="-s" - ;; - -nolxl*) - flag_USE_LXLITE=0 - ;; - -* | /*) - case ${D}1 in - -L* | -l*) - libsToLink=1 - ;; - -Zomf) - omfLinking=1 - ;; - *) - ;; - esac - EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 - ;; - *.dll) - EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`" - if [ ${D}omfLinking -eq 1 ]; then - EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib" - else - EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a" - fi - ;; - *) - found=0; - if [ ${D}libsToLink -ne 0 ]; then - EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1 - else - for file in ${D}1 ; do - if [ -f ${D}file ]; then - inputFiles="${D}{inputFiles} ${D}file" - found=1 - fi - done - if [ ${D}found -eq 0 ]; then - echo "ERROR: No file(s) found: "${D}1 - exit 8 - fi - fi - ;; - esac - shift -done # iterate cmdline words - -# -if [ -z "${D}inputFiles" ]; then - echo "dllar: no input files" - PrintHelp -fi - -# Now extract all .o files from .a files -newInputFiles="" -for file in ${D}inputFiles ; do - case ${D}file in - *.a | *.lib) - case ${D}file in - *.a) - suffix=".a" - AR="ar" - ;; - *.lib) - suffix=".lib" - AR="emxomfar" - EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf" - ;; - *) - ;; - esac - dirname=\`basnam ${D}file ${D}suffix\`"_%" - mkdir ${D}dirname - if [ ${D}? -ne 0 ]; then - echo "Failed to create subdirectory ./${D}dirname" - CleanUp - exit 8; - fi - # Append '!' to indicate archive - newInputFiles="${D}newInputFiles ${D}{dirname}!" - doCommand "cd ${D}dirname; ${D}AR x ../${D}file" - cd ${D}curDir - found=0; - for subfile in ${D}dirname/*.o* ; do - if [ -f ${D}subfile ]; then - found=1 - if [ -s ${D}subfile ]; then - # FIXME: This should be: is file size > 32 byte, _not_ > 0! - newInputFiles="${D}newInputFiles ${D}subfile" - fi - fi - done - if [ ${D}found -eq 0 ]; then - echo "WARNING: there are no files in archive \\'${D}file\\'" - fi - ;; - *) - newInputFiles="${D}{newInputFiles} ${D}file" - ;; - esac -done -inputFiles="${D}newInputFiles" - -# Output filename(s). -do_backup=0; -if [ -z ${D}outFile ]; then - do_backup=1; - set outFile ${D}inputFiles; outFile=${D}2 -fi - -# If it is an archive, remove the '!' and the '_%' suffixes -case ${D}outFile in -*_%!) - outFile=\`basnam ${D}outFile _%!\` - ;; -*) - ;; -esac -case ${D}outFile in -*.dll) - outFile=\`basnam ${D}outFile .dll\` - ;; -*.DLL) - outFile=\`basnam ${D}outFile .DLL\` - ;; -*.o) - outFile=\`basnam ${D}outFile .o\` - ;; -*.obj) - outFile=\`basnam ${D}outFile .obj\` - ;; -*.a) - outFile=\`basnam ${D}outFile .a\` - ;; -*.lib) - outFile=\`basnam ${D}outFile .lib\` - ;; -*) - ;; -esac -case ${D}outimpFile in -*.a) - outimpFile=\`basnam ${D}outimpFile .a\` - ;; -*.lib) - outimpFile=\`basnam ${D}outimpFile .lib\` - ;; -*) - ;; -esac -if [ -z ${D}outimpFile ]; then - outimpFile=${D}outFile -fi -defFile="${D}{outFile}.def" -arcFile="${D}{outimpFile}.a" -arcFile2="${D}{outimpFile}.lib" - -#create ${D}dllFile as something matching 8.3 restrictions, -if [ -z ${D}renameScript ] ; then - dllFile="${D}outFile" -else - dllFile=\`${D}renameScript ${D}outimpFile\` -fi - -if [ ${D}do_backup -ne 0 ] ; then - if [ -f ${D}arcFile ] ; then - doCommand "mv ${D}arcFile ${D}{outFile}_s.a" - fi - if [ -f ${D}arcFile2 ] ; then - doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib" - fi -fi - -# Extract public symbols from all the object files. -tmpdefFile=${D}{defFile}_% -rm -f ${D}tmpdefFile -for file in ${D}inputFiles ; do - case ${D}file in - *!) - ;; - *) - doCommand "emxexp -u ${D}file >> ${D}tmpdefFile" - ;; - esac -done - -# Create the def file. -rm -f ${D}defFile -echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile -dllFile="${D}{dllFile}.dll" -if [ ! -z ${D}description ]; then - echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile -fi -echo "EXPORTS" >> ${D}defFile - -doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%" -grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile - -# Checks if the export is ok or not. -for word in ${D}exclude_symbols; do - grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}% - mv ${D}{tmpdefFile}% ${D}tmpdefFile -done - - -if [ ${D}EXPORT_BY_ORDINALS -ne 0 ]; then - sed "=" < ${D}tmpdefFile | \\ - sed ' - N - : loop - s/^\\([0-9]\\+\\)\\([^;]*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/ - t loop - ' > ${D}{tmpdefFile}% - grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile -else - rm -f ${D}{tmpdefFile}% -fi -cat ${D}tmpdefFile >> ${D}defFile -rm -f ${D}tmpdefFile - -# Do linking, create implib, and apply lxlite. -gccCmdl=""; -for file in ${D}inputFiles ; do - case ${D}file in - *!) - ;; - *) - gccCmdl="${D}gccCmdl ${D}file" - ;; - esac -done -doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS" -touch "${D}{outFile}.dll" - -doCommand "emximp -o ${D}arcFile ${D}defFile" -if [ ${D}flag_USE_LXLITE -ne 0 ]; then - add_flags=""; - if [ ${D}EXPORT_BY_ORDINALS -ne 0 ]; then - add_flags="-ynd" - fi - doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile" -fi -doCommand "emxomf -s -l ${D}arcFile" - -# Successful exit. -CleanUp 1 -exit 0 -EOF - - chmod +x dllar.sh - ;; - - powerpc-apple-macos* | \ - *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | *-*-k*bsd*-gnu | \ - *-*-mirbsd* | \ - *-*-sunos4* | \ - *-*-osf* | \ - *-*-dgux5* | \ - *-*-sysv5* | \ - *-pc-msdosdjgpp ) - ;; - - *) - as_fn_error $? "unknown system type $BAKEFILE_HOST." "$LINENO" 5 - esac - - if test "x$PIC_FLAG" != "x" ; then - PIC_FLAG="$PIC_FLAG -DPIC" - fi - - if test "x$SHARED_LD_MODULE_CC" = "x" ; then - SHARED_LD_MODULE_CC="$SHARED_LD_CC" - fi - if test "x$SHARED_LD_MODULE_CXX" = "x" ; then - SHARED_LD_MODULE_CXX="$SHARED_LD_CXX" - fi - - - - - - - - - - USE_SOVERSION=0 - USE_SOVERLINUX=0 - USE_SOVERSOLARIS=0 - USE_SOVERCYGWIN=0 - USE_SOTWOSYMLINKS=0 - USE_MACVERSION=0 - SONAME_FLAG= - - case "${BAKEFILE_HOST}" in - *-*-linux* | *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \ - *-*-k*bsd*-gnu | *-*-mirbsd* ) - if test "x$SUNCXX" = "xyes"; then - SONAME_FLAG="-h " - else - SONAME_FLAG="-Wl,-soname," - fi - USE_SOVERSION=1 - USE_SOVERLINUX=1 - USE_SOTWOSYMLINKS=1 - ;; - - *-*-solaris2* ) - SONAME_FLAG="-h " - USE_SOVERSION=1 - USE_SOVERSOLARIS=1 - ;; - - *-*-darwin* ) - USE_MACVERSION=1 - USE_SOVERSION=1 - USE_SOTWOSYMLINKS=1 - ;; - - *-*-cygwin* ) - USE_SOVERSION=1 - USE_SOVERCYGWIN=1 - ;; - esac - - - - - - - - - - - # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; bk_use_trackdeps="$enableval" -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dependency tracking method" >&5 -$as_echo_n "checking for dependency tracking method... " >&6; } - - BK_DEPS="" - if test "x$bk_use_trackdeps" = "xno" ; then - DEPS_TRACKING=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - else - DEPS_TRACKING=1 - - if test "x$GCC" = "xyes"; then - DEPSMODE=gcc - case "${BAKEFILE_HOST}" in - *-*-darwin* ) - DEPSFLAG="-no-cpp-precomp -MMD" - ;; - * ) - DEPSFLAG="-MMD" - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: gcc" >&5 -$as_echo "gcc" >&6; } - elif test "x$MWCC" = "xyes"; then - DEPSMODE=mwcc - DEPSFLAG="-MM" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: mwcc" >&5 -$as_echo "mwcc" >&6; } - elif test "x$SUNCC" = "xyes"; then - DEPSMODE=unixcc - DEPSFLAG="-xM1" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Sun cc" >&5 -$as_echo "Sun cc" >&6; } - elif test "x$SGICC" = "xyes"; then - DEPSMODE=unixcc - DEPSFLAG="-M" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: SGI cc" >&5 -$as_echo "SGI cc" >&6; } - elif test "x$HPCC" = "xyes"; then - DEPSMODE=unixcc - DEPSFLAG="+make" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: HP cc" >&5 -$as_echo "HP cc" >&6; } - elif test "x$COMPAQCC" = "xyes"; then - DEPSMODE=gcc - DEPSFLAG="-MD" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compaq cc" >&5 -$as_echo "Compaq cc" >&6; } - else - DEPS_TRACKING=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - fi - - if test $DEPS_TRACKING = 1 ; then - -D='$' -cat <bk-deps -#!/bin/sh - -# This script is part of Bakefile (http://www.bakefile.org) autoconf -# script. It is used to track C/C++ files dependencies in portable way. -# -# Permission is given to use this file in any way. - -DEPSMODE=${DEPSMODE} -DEPSFLAG="${DEPSFLAG}" -DEPSDIRBASE=.deps - -if test ${D}DEPSMODE = gcc ; then - ${D}* ${D}{DEPSFLAG} - status=${D}? - - # determine location of created files: - while test ${D}# -gt 0; do - case "${D}1" in - -o ) - shift - objfile=${D}1 - ;; - -* ) - ;; - * ) - srcfile=${D}1 - ;; - esac - shift - done - objfilebase=\`basename ${D}objfile\` - builddir=\`dirname ${D}objfile\` - depfile=\`basename ${D}srcfile | sed -e 's/\\..*${D}/.d/g'\` - depobjname=\`echo ${D}depfile |sed -e 's/\\.d/.o/g'\` - depsdir=${D}builddir/${D}DEPSDIRBASE - mkdir -p ${D}depsdir - - # if the compiler failed, we're done: - if test ${D}{status} != 0 ; then - rm -f ${D}depfile - exit ${D}{status} - fi - - # move created file to the location we want it in: - if test -f ${D}depfile ; then - sed -e "s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{depsdir}/${D}{objfilebase}.d - rm -f ${D}depfile - else - # "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d - depfile=\`echo "${D}objfile" | sed -e 's/\\..*${D}/.d/g'\` - if test ! -f ${D}depfile ; then - # "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++) - depfile="${D}objfile.d" - fi - if test -f ${D}depfile ; then - sed -e "\\,^${D}objfile,!s,${D}depobjname:,${D}objfile:,g" ${D}depfile >${D}{depsdir}/${D}{objfilebase}.d - rm -f ${D}depfile - fi - fi - exit 0 - -elif test ${D}DEPSMODE = mwcc ; then - ${D}* || exit ${D}? - # Run mwcc again with -MM and redirect into the dep file we want - # NOTE: We can't use shift here because we need ${D}* to be valid - prevarg= - for arg in ${D}* ; do - if test "${D}prevarg" = "-o"; then - objfile=${D}arg - else - case "${D}arg" in - -* ) - ;; - * ) - srcfile=${D}arg - ;; - esac - fi - prevarg="${D}arg" - done - - objfilebase=\`basename ${D}objfile\` - builddir=\`dirname ${D}objfile\` - depsdir=${D}builddir/${D}DEPSDIRBASE - mkdir -p ${D}depsdir - - ${D}* ${D}DEPSFLAG >${D}{depsdir}/${D}{objfilebase}.d - exit 0 - -elif test ${D}DEPSMODE = unixcc; then - ${D}* || exit ${D}? - # Run compiler again with deps flag and redirect into the dep file. - # It doesn't work if the '-o FILE' option is used, but without it the - # dependency file will contain the wrong name for the object. So it is - # removed from the command line, and the dep file is fixed with sed. - cmd="" - while test ${D}# -gt 0; do - case "${D}1" in - -o ) - shift - objfile=${D}1 - ;; - * ) - eval arg${D}#=\\${D}1 - cmd="${D}cmd \\${D}arg${D}#" - ;; - esac - shift - done - - objfilebase=\`basename ${D}objfile\` - builddir=\`dirname ${D}objfile\` - depsdir=${D}builddir/${D}DEPSDIRBASE - mkdir -p ${D}depsdir - - eval "${D}cmd ${D}DEPSFLAG" | sed "s|.*:|${D}objfile:|" >${D}{depsdir}/${D}{objfilebase}.d - exit 0 - -else - ${D}* - exit ${D}? -fi -EOF - - chmod +x bk-deps - BK_DEPS="`pwd`/bk-deps" - fi - fi - - - - - - case ${BAKEFILE_HOST} in - *-*-cygwin* | *-*-mingw32* ) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. -set dummy ${ac_tool_prefix}windres; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WINDRES+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WINDRES"; then - ac_cv_prog_WINDRES="$WINDRES" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_WINDRES="${ac_tool_prefix}windres" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WINDRES=$ac_cv_prog_WINDRES -if test -n "$WINDRES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 -$as_echo "$WINDRES" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_WINDRES"; then - ac_ct_WINDRES=$WINDRES - # Extract the first word of "windres", so it can be a program name with args. -set dummy windres; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_WINDRES"; then - ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_WINDRES="windres" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES -if test -n "$ac_ct_WINDRES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 -$as_echo "$ac_ct_WINDRES" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_WINDRES" = x; then - WINDRES="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - WINDRES=$ac_ct_WINDRES - fi -else - WINDRES="$ac_cv_prog_WINDRES" -fi - - ;; - - *-*-darwin* | powerpc-apple-macos* ) - # Extract the first word of "Rez", so it can be a program name with args. -set dummy Rez; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_REZ+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$REZ"; then - ac_cv_prog_REZ="$REZ" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_REZ="Rez" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_REZ" && ac_cv_prog_REZ="/Developer/Tools/Rez" -fi -fi -REZ=$ac_cv_prog_REZ -if test -n "$REZ"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REZ" >&5 -$as_echo "$REZ" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "SetFile", so it can be a program name with args. -set dummy SetFile; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_SETFILE+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$SETFILE"; then - ac_cv_prog_SETFILE="$SETFILE" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_SETFILE="SetFile" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_SETFILE" && ac_cv_prog_SETFILE="/Developer/Tools/SetFile" -fi -fi -SETFILE=$ac_cv_prog_SETFILE -if test -n "$SETFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 -$as_echo "$SETFILE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - ;; - esac - - - - - - - - - - BAKEFILE_BAKEFILE_M4_VERSION="0.2.9" - - -BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.9" - - COND_DEBUG_0="#" - if test "x$DEBUG" = "x0" ; then - COND_DEBUG_0="" - fi - - COND_DEBUG_1="#" - if test "x$DEBUG" = "x1" ; then - COND_DEBUG_1="" - fi - - COND_DEPS_TRACKING_0="#" - if test "x$DEPS_TRACKING" = "x0" ; then - COND_DEPS_TRACKING_0="" - fi - - COND_DEPS_TRACKING_1="#" - if test "x$DEPS_TRACKING" = "x1" ; then - COND_DEPS_TRACKING_1="" - fi - - COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERCYGWIN" = "x0" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1="" - fi - - COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x0" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_0_USE_SOVERSION_1="" - fi - - COND_PLATFORM_MACOSX_1="#" - if test "x$PLATFORM_MACOSX" = "x1" ; then - COND_PLATFORM_MACOSX_1="" - fi - - COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="#" - if test "x$PLATFORM_MACOSX" = "x1" -a "x$USE_SOVERSION" = "x1" ; then - COND_PLATFORM_MACOSX_1_USE_SOVERSION_1="" - fi - - COND_PLATFORM_MAC_0="#" - if test "x$PLATFORM_MAC" = "x0" ; then - COND_PLATFORM_MAC_0="" - fi - - COND_PLATFORM_MAC_1="#" - if test "x$PLATFORM_MAC" = "x1" ; then - COND_PLATFORM_MAC_1="" - fi - - COND_PLATFORM_OS2_1="#" - if test "x$PLATFORM_OS2" = "x1" ; then - COND_PLATFORM_OS2_1="" - fi - - COND_SAMPLES_1="#" - if test "x$SAMPLES" = "x1" ; then - COND_SAMPLES_1="" - fi - - COND_SHARED_0="#" - if test "x$SHARED" = "x0" ; then - COND_SHARED_0="" - fi - - COND_SHARED_1="#" - if test "x$SHARED" = "x1" ; then - COND_SHARED_1="" - fi - - COND_USE_SOTWOSYMLINKS_1="#" - if test "x$USE_SOTWOSYMLINKS" = "x1" ; then - COND_USE_SOTWOSYMLINKS_1="" - fi - - COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="#" - if test "x$USE_SOVERCYGWIN" = "x1" -a "x$USE_SOVERSION" = "x1" ; then - COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1="" - fi - - COND_USE_SOVERLINUX_1="#" - if test "x$USE_SOVERLINUX" = "x1" ; then - COND_USE_SOVERLINUX_1="" - fi - - COND_USE_SOVERSION_0="#" - if test "x$USE_SOVERSION" = "x0" ; then - COND_USE_SOVERSION_0="" - fi - - COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="#" - if test "x$USE_SOVERSION" = "x1" -a "x$USE_SOVERSOLARIS" = "x1" ; then - COND_USE_SOVERSION_1_USE_SOVERSOLARIS_1="" - fi - - COND_USE_SOVERSOLARIS_1="#" - if test "x$USE_SOVERSOLARIS" = "x1" ; then - COND_USE_SOVERSOLARIS_1="" - fi - - COND_WINDOWS_IMPLIB_1="#" - if test "x$WINDOWS_IMPLIB" = "x1" ; then - COND_WINDOWS_IMPLIB_1="" - fi - - - - if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then - as_fn_error $? "No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?" "$LINENO" 5 - fi - - if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then - as_fn_error $? "Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match." "$LINENO" 5 - fi - -ac_config_files="$ac_config_files Makefile build/autoconf/muparser.pc" - -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, we kill variables containing newlines. -# 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. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - 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}' - -# 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 branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $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} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -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 -IFS=$as_save_IFS - - ;; -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 - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; 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 - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# 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 - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by muparser $as_me 2.2.4, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - 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 ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -muparser config.status 2.2.4 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -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=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - 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 || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "build/autoconf/muparser.pc") CONFIG_FILES="$CONFIG_FILES build/autoconf/muparser.pc" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - 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 against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # 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. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# 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 || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - - - -## CONFIGURE END MESSAGE -##################################################################### - -echo -echo " ----------------------------------------------------------------" -echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." -echo " Summary of main configuration settings for $PACKAGE_NAME:" - - if [ "$SHARED" = "1" ]; then - echo " - SHARED mode" - else - echo " - STATIC mode" - fi - - - if [ "$DEBUG" = "1" ]; then - echo " - DEBUG build" - else - echo " - RELEASE build" - fi - -if [ "$SAMPLES" = "1" ]; then - echo " - SAMPLES enabled" -else - echo " - SAMPLES disabled" -fi -echo " Now, just run make." -echo " ----------------------------------------------------------------" -echo diff --git a/muparser-2.2.5/docs/Doxyfile b/muparser-2.2.5/docs/Doxyfile deleted file mode 100644 index 9793afe34..000000000 --- a/muparser-2.2.5/docs/Doxyfile +++ /dev/null @@ -1,1563 +0,0 @@ -# Doxyfile 1.6.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "muParser API -" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 1.35 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = html/ - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = YES - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 16 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set -# FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = YES - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = html/misc/Main.txt \ - html/misc/example.txt \ - ../src/ \ - ../include/ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = html/misc/ - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = classdocu/ - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = html/misc/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = NO - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = jpg - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = "C:\Program Files (x86)\Graphviz2.20\bin" - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/muparser-2.2.5/docs/muparser_doc.html b/muparser-2.2.5/docs/muparser_doc.html deleted file mode 100644 index 09dbba143..000000000 --- a/muparser-2.2.5/docs/muparser_doc.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - -
- -
- - - diff --git a/muparser-2.2.5/include/muParser.h b/muparser-2.2.5/include/muParser.h deleted file mode 100644 index 31e8937ef..000000000 --- a/muparser-2.2.5/include/muParser.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#ifndef MU_PARSER_H -#define MU_PARSER_H - -//--- Standard includes ------------------------------------------------------------------------ -#include - -//--- Parser includes -------------------------------------------------------------------------- -#include "muParserBase.h" - -/** \file - \brief Definition of the standard floating point parser. -*/ - -namespace mu { -/** \brief Mathematical expressions parser. - - Standard implementation of the mathematical expressions parser. - Can be used as a reference implementation for subclassing the parser. - - - (C) 2011 Ingo Berg
- muparser(at)beltoforion.de -
-*/ -/* final */ class Parser : public ParserBase { - public: - Parser(); - - void InitCharSets() override; - void InitFun() override; - void InitConst() override; - void InitOprt() override; - - protected: - // Trigonometric functions - static ValueOrError Sin(value_type); - static ValueOrError Cos(value_type); - static ValueOrError Tan(value_type); - static ValueOrError Tan2(value_type, value_type); - // arcus functions - static ValueOrError ASin(value_type); - static ValueOrError ACos(value_type); - static ValueOrError ATan(value_type); - static ValueOrError ATan2(value_type, value_type); - - // hyperbolic functions - static ValueOrError Sinh(value_type); - static ValueOrError Cosh(value_type); - static ValueOrError Tanh(value_type); - // arcus hyperbolic functions - static ValueOrError ASinh(value_type); - static ValueOrError ACosh(value_type); - static ValueOrError ATanh(value_type); - // Logarithm functions - static ValueOrError Log2(value_type); // Logarithm Base 2 - static ValueOrError Log10(value_type); // Logarithm Base 10 - static ValueOrError Ln(value_type); // Logarithm Base e (natural logarithm) - // misc - static ValueOrError Exp(value_type); - static ValueOrError Abs(value_type); - static ValueOrError Sqrt(value_type); - static ValueOrError Rint(value_type); - static ValueOrError Sign(value_type); - - // Prefix operators - // !!! Unary Minus is a MUST if you want to use negative signs !!! - static ValueOrError UnaryMinus(value_type); - static ValueOrError UnaryPlus(value_type); - - // Functions with variable number of arguments - static ValueOrError Sum(const value_type *, int); // sum - static ValueOrError Avg(const value_type *, int); // mean value - static ValueOrError Min(const value_type *, int); // minimum - static ValueOrError Max(const value_type *, int); // maximum - - static int IsVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal); -}; -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserBase.h b/muparser-2.2.5/include/muParserBase.h deleted file mode 100644 index edc92e127..000000000 --- a/muparser-2.2.5/include/muParserBase.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#ifndef MU_PARSER_BASE_H -#define MU_PARSER_BASE_H - -//--- Standard includes ------------------------------------------------------------------------ -#include -#include -#include -#include -#include -#include -#include - -//--- Parser includes -------------------------------------------------------------------------- -#include "muParserBytecode.h" -#include "muParserDef.h" -#include "muParserTokenReader.h" - -namespace mu { -/** \file - \brief This file contains the class definition of the muparser engine. -*/ - -//-------------------------------------------------------------------------------------------------- -/** \brief Mathematical expressions parser (base parser engine). - \author (C) 2013 Ingo Berg - - This is the implementation of a bytecode based mathematical expressions parser. - The formula will be parsed from string and converted into a bytecode. - Future calculations will be done with the bytecode instead the formula string - resulting in a significant performance increase. - Complementary to a set of internally implemented functions the parser is able to handle - user defined functions and variables. -*/ -class ParserBase { - friend class ParserTokenReader; - - private: - /** \brief Typedef for the parse functions. - - The parse function do the actual work. The parser exchanges - the function pointer to the parser function depending on - which state it is in. (i.e. bytecode parser vs. string parser) - */ - typedef ValueOrError (ParserBase::*ParseFunction)() const; - - /** \brief Type for a vector of strings. */ - typedef std::vector stringbuf_type; - - /** \brief Type used for parser tokens. */ - typedef ParserToken token_type; - - public: - /** \brief Type of the error class. - - Included for backwards compatibility. - */ - typedef ParserError exception_type; - - static void EnableDebugDump(bool bDumpCmd, bool bDumpStack); - - ParserBase(); - ParserBase(const ParserBase &a_Parser) = delete; - ParserBase &operator=(const ParserBase &a_Parser) = delete; - - virtual ~ParserBase(); - - ValueOrError Eval() const; - void Eval(std::vector *results) const; - - int GetNumResults() const; - - OptionalError SetExpr(const string_type &a_sExpr); - void SetVarFactory(facfun_type a_pFactory, void *pUserData = NULL); - - void SetDecSep(char_type cDecSep); - void SetThousandsSep(char_type cThousandsSep = 0); - void ResetLocale(); - - void EnableBuiltInOprt(bool a_bIsOn = true); - - bool HasBuiltInOprt() const; - void AddValIdent(identfun_type a_pCallback); - - /** \fn void mu::ParserBase::DefineFun(const string_type &a_strName, fun_type0 a_pFun) - \brief Define a parser function without arguments. - \param a_strName Name of the function - \param a_pFun Pointer to the callback function - */ - template - OptionalError DefineFun(const string_type &a_strName, T a_pFun) { - return AddCallback(a_strName, ParserCallback(a_pFun), m_FunDef, ValidNameChars()); - } - - OptionalError DefineOprt(const string_type &a_strName, fun_type2 a_pFun, unsigned a_iPri = 0, - EOprtAssociativity a_eAssociativity = oaLEFT); - OptionalError DefineConst(const string_type &a_sName, value_type a_fVal); - OptionalError DefineStrConst(const string_type &a_sName, const string_type &a_strVal); - OptionalError DefineVar(const string_type &a_sName, value_type *a_fVar); - OptionalError DefinePostfixOprt(const string_type &a_strFun, fun_type1 a_pOprt); - OptionalError DefineInfixOprt(const string_type &a_strName, fun_type1 a_pOprt, - int a_iPrec = prINFIX); - - // Clear user defined constants or operators. - void ClearConst(); - void ClearPostfixOprt(); - - void RemoveVar(const string_type &a_strVarName); - const varmap_type &GetVar() const; - const string_type &GetExpr() const; - - const char_type **GetOprtDef() const; - void DefineNameChars(const char_type *a_szCharset); - void DefineOprtChars(const char_type *a_szCharset); - void DefineInfixOprtChars(const char_type *a_szCharset); - - const char_type *ValidNameChars() const; - const char_type *ValidOprtChars() const; - const char_type *ValidInfixOprtChars() const; - - void SetArgSep(char_type cArgSep); - char_type GetArgSep() const; - - ParserError Error(EErrorCodes a_iErrc, int a_iPos = (int)mu::string_type::npos, - const string_type &a_strTok = string_type()) const; - - protected: - void Init(); - - virtual void InitCharSets() = 0; - virtual void InitFun() = 0; - virtual void InitConst() = 0; - virtual void InitOprt() = 0; - - static const char_type *c_DefaultOprt[]; - static std::locale s_locale; ///< The locale used by the parser - static bool g_DbgDumpCmdCode; - static bool g_DbgDumpStack; - - /** \brief A facet class used to change decimal and thousands separator. */ - template - class change_dec_sep : public std::numpunct { - public: - explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3) - : std::numpunct(), - m_nGroup(nGroup), - m_cDecPoint(cDecSep), - m_cThousandsSep(cThousandsSep) {} - - protected: - char_type do_decimal_point() const override { return m_cDecPoint; } - - char_type do_thousands_sep() const override { return m_cThousandsSep; } - - std::string do_grouping() const override { - // fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4 - // courtesy of Jens Bartsch - // original code: - // return std::string(1, (char)m_nGroup); - // new code: - return std::string(1, (char)(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX)); - } - - private: - int m_nGroup; - char_type m_cDecPoint; - char_type m_cThousandsSep; - }; - - private: - void ReInit() const; - - OptionalError AddCallback(const string_type &a_strName, const ParserCallback &a_Callback, - funmap_type &a_Storage, const char_type *a_szCharSet); - - OptionalError ApplyRemainingOprt(ParserStack &a_stOpt, - ParserStack &a_stVal) const; - OptionalError ApplyBinOprt(ParserStack &a_stOpt, - ParserStack &a_stVal) const; - - OptionalError ApplyIfElse(ParserStack &a_stOpt, - ParserStack &a_stVal) const; - - OptionalError ApplyFunc(ParserStack &a_stOpt, ParserStack &a_stVal, - int iArgCount) const; - - OptionalError ApplyStrFunc(const token_type &a_FunTok, - const std::vector &a_vArg) const; - - int GetOprtPrecedence(const token_type &a_Tok) const; - EOprtAssociativity GetOprtAssociativity(const token_type &a_Tok) const; - - OptionalError CreateRPN() const; - - ValueOrError ExecuteRPN() const; - ValueOrError InvokeFunction(generic_fun_type func, const value_type *args, int argCount) const; - - /// Build the RPN if necessary, and then execute it. - /// \return the result, or an error. - ValueOrError BuildAndExecuteRPN() const; - - OptionalError CheckName(const string_type &a_strName, const string_type &a_CharSet) const; - OptionalError CheckOprt(const string_type &a_sName, const ParserCallback &a_Callback, - const string_type &a_szCharSet) const; - - void StackDump(const ParserStack &a_stVal, - const ParserStack &a_stOprt) const; - - /** \brief Pointer to the parser function. - - Eval() calls the function whose address is stored there. - */ - mutable ParserByteCode m_vRPN; ///< The Bytecode class. - mutable stringbuf_type - m_vStringBuf; ///< String buffer, used for storing string function arguments - stringbuf_type m_vStringVarBuf; - - std::unique_ptr m_pTokenReader; - - funmap_type m_FunDef; ///< Map of function names and pointers. - funmap_type m_PostOprtDef; ///< Postfix operator callbacks - funmap_type m_InfixOprtDef; ///< unary infix operator. - funmap_type m_OprtDef; ///< Binary operator callbacks - valmap_type m_ConstDef; ///< user constants. - strmap_type m_StrVarDef; ///< user defined string constants - varmap_type m_VarDef; ///< user defind variables. - - bool m_bBuiltInOp = - true; ///< Flag that can be used for switching built in operators on and off - - string_type m_sNameChars; ///< Charset for names - string_type m_sOprtChars; ///< Charset for postfix/ binary operator tokens - string_type m_sInfixOprtChars; ///< Charset for infix operator tokens - - // items merely used for caching state information - /// This is merely a buffer used for the stack in the cmd parsing routine - mutable std::vector m_vStackBuffer; - mutable int m_nFinalResultIdx = 0; -}; -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserBytecode.h b/muparser-2.2.5/include/muParserBytecode.h deleted file mode 100644 index 1f432e0a9..000000000 --- a/muparser-2.2.5/include/muParserBytecode.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#ifndef MU_PARSER_BYTECODE_H -#define MU_PARSER_BYTECODE_H - -#include -#include -#include -#include - -#include "muParserDef.h" -#include "muParserToken.h" - -/** \file - \brief Definition of the parser bytecode class. -*/ - -namespace mu { -struct SToken { - ECmdCode Cmd; - - union { - struct // SValData - { - value_type *ptr; - value_type data; - } Val; - - struct // SFunData - { - // Note: generic_fun_type is merely a placeholder. The real type could be - // anything between gun_type1 and fun_type9. I can't use a void - // pointer due to constraints in the ANSI standard which allows - // data pointers and function pointers to differ in size. - generic_fun_type ptr; - int argc; - int idx; - } Fun; - - struct // SOprtData - { - value_type *ptr; - int offset; - } Oprt; - }; -}; - -/** \brief Bytecode implementation of the Math Parser. - -The bytecode contains the formula converted to revers polish notation stored in a continious -memory area. Associated with this data are operator codes, variable pointers, constant -values and function pointers. Those are necessary in order to calculate the result. -All those data items will be casted to the underlying datatype of the bytecode. - -\author (C) 2004-2013 Ingo Berg -*/ -class ParserByteCode { - private: - /** \brief Token type for internal use only. */ - typedef ParserToken token_type; - - /** \brief Position in the Calculation array. */ - unsigned m_iStackPos; - - /** \brief Maximum size needed for the stack. */ - std::size_t m_iMaxStackSize; - - /** \brief The actual rpn storage. */ - std::vector m_vRPN; - - public: - ParserByteCode(); - ParserByteCode(const ParserByteCode &a_ByteCode) = delete; - ParserByteCode &operator=(const ParserByteCode &a_ByteCode) = delete; - - void AddVar(value_type *a_pVar); - void AddVal(value_type a_fVal); - void AddOp(ECmdCode a_Oprt); - void AddIfElse(ECmdCode a_Oprt); - void AddAssignOp(value_type *a_pVar); - void AddFun(generic_fun_type a_pFun, int a_iArgc); - void AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx); - - void Finalize(); - void clear(); - std::size_t GetMaxStackSize() const; - std::size_t GetSize() const; - bool empty() const { return GetSize() == 0; } - - const SToken *GetBase() const; - void AsciiDump(); -}; - -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserCallback.h b/muparser-2.2.5/include/muParserCallback.h deleted file mode 100644 index a2cb4039c..000000000 --- a/muparser-2.2.5/include/muParserCallback.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#ifndef MU_PARSER_CALLBACK_H -#define MU_PARSER_CALLBACK_H - -#include "muParserDef.h" - -/** \file - \brief Definition of the parser callback class. -*/ - -namespace mu { - -/** \brief Encapsulation of prototypes for a numerical parser function. - - Encapsulates the prototyp for numerical parser functions. The class - stores the number of arguments for parser functions as well - as additional flags indication the function is non optimizeable. - The pointer to the callback function pointer is stored as void* - and needs to be casted according to the argument count. - Negative argument counts indicate a parser function with a variable number - of arguments. - - \author (C) 2004-2011 Ingo Berg -*/ -class ParserCallback final { - public: - explicit ParserCallback(fun_type0 a_pFun); - ParserCallback(fun_type1 a_pFun, int a_iPrec = -1, ECmdCode a_iCode = cmFUNC); - ParserCallback(fun_type2 a_pFun, int a_iPrec, EOprtAssociativity a_eAssociativity); - explicit ParserCallback(fun_type2 a_pFun); - explicit ParserCallback(fun_type3 a_pFun); - - explicit ParserCallback(multfun_type a_pFun); - explicit ParserCallback(strfun_type1 a_pFun); - explicit ParserCallback(strfun_type2 a_pFun); - explicit ParserCallback(strfun_type3 a_pFun); - ParserCallback(); - ParserCallback(const ParserCallback& a_Fun); - - void* GetAddr() const; - ECmdCode GetCode() const; - ETypeCode GetType() const; - int GetPri() const; - EOprtAssociativity GetAssociativity() const; - int GetArgc() const; - - private: - void* m_pFun; ///< Pointer to the callback function, casted to void - - /** \brief Number of numeric function arguments - - This number is negative for functions with variable number of arguments. in this cases - they represent the actual number of arguments found. - */ - int m_iArgc; - int m_iPri; ///< Valid only for binary and infix operators; Operator precedence. - EOprtAssociativity m_eOprtAsct; ///< Operator associativity; Valid only for binary operators - ECmdCode m_iCode; - ETypeCode m_iType; -}; - -//------------------------------------------------------------------------------ -/** \brief Container for Callback objects. */ -typedef std::map funmap_type; - -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserDef.h b/muparser-2.2.5/include/muParserDef.h deleted file mode 100644 index 36074a296..000000000 --- a/muparser-2.2.5/include/muParserDef.h +++ /dev/null @@ -1,426 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2014 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#ifndef MUP_DEF_H -#define MUP_DEF_H - -#include -#include -#include -#include -#include -#include -#include - -/** \file - \brief This file contains standard definitions used by the parser. -*/ - -#define MUP_VERSION _T("2.2.5") -#define MUP_VERSION_DATE _T("20150427; GC") - -#define MUP_CHARS _T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") - -/** \brief If this macro is defined mathematical exceptions (div by zero) will be thrown as - * exceptions. */ -//#define MUP_MATH_EXCEPTIONS - -/** \brief Define the base datatype for values. - - This datatype must be a built in value type. You can not use custom classes. - It should be working with all types except "int"! -*/ -#define MUP_BASETYPE double - -#if defined(_UNICODE) -/** \brief Definition of the basic parser string type. */ -#define MUP_STRING_TYPE std::wstring - -#if !defined(_T) -#define _T(x) L##x -#endif // not defined _T -#else -#ifndef _T -#define _T(x) x -#endif - -/** \brief Definition of the basic parser string type. */ -#define MUP_STRING_TYPE std::string -#endif - -namespace mu { -#if defined(_UNICODE) - -//------------------------------------------------------------------------------ -/** \brief Encapsulate wcout. */ -inline std::wostream &console() { return std::wcout; } - -/** \brief Encapsulate cin. */ -inline std::wistream &console_in() { return std::wcin; } - -#else - -/** \brief Encapsulate cout. - - Used for supporting UNICODE more easily. -*/ -inline std::ostream &console() { return std::cout; } - -/** \brief Encapsulate cin. - - Used for supporting UNICODE more easily. -*/ -inline std::istream &console_in() { return std::cin; } - -#endif - -/// Our stack type. -template -class ParserStack : public std::vector { - public: - // Convenience to get the top value and pop it. - T pop() { - T val = std::move(this->back()); - this->pop_back(); - return val; - } - - T &top() { return this->back(); } - - void push(T val) { this->push_back(std::move(val)); } -}; - -//------------------------------------------------------------------------------ -/** \brief Bytecode values. - - \attention The order of the operator entries must match the order in ParserBase::c_DefaultOprt! -*/ -enum ECmdCode { - // The following are codes for built in binary operators - // apart from built in operators the user has the opportunity to - // add user defined operators. - cmLE = 0, ///< Operator item: less or equal - cmGE = 1, ///< Operator item: greater or equal - cmNEQ = 2, ///< Operator item: not equal - cmEQ = 3, ///< Operator item: equals - cmLT = 4, ///< Operator item: less than - cmGT = 5, ///< Operator item: greater than - cmADD = 6, ///< Operator item: add - cmSUB = 7, ///< Operator item: subtract - cmMUL = 8, ///< Operator item: multiply - cmDIV = 9, ///< Operator item: division - cmPOW = 10, ///< Operator item: y to the power of ... - cmLAND = 11, - cmLOR = 12, - cmASSIGN = 13, ///< Operator item: Assignment operator - cmBO = 14, ///< Operator item: opening bracket - cmBC = 15, ///< Operator item: closing bracket - cmIF = 16, ///< For use in the ternary if-then-else operator - cmELSE = 17, ///< For use in the ternary if-then-else operator - cmENDIF = 18, ///< For use in the ternary if-then-else operator - cmARG_SEP = 19, ///< function argument separator - cmVAR = 20, ///< variable item - cmVAL = 21, ///< value item - - // operators and functions - cmFUNC, ///< Code for a generic function item - cmFUNC_STR, ///< Code for a function with a string parameter - cmSTRING, ///< Code for a string token - cmOPRT_BIN, ///< user defined binary operator - cmOPRT_POSTFIX, ///< code for postfix operators - cmOPRT_INFIX, ///< code for infix operators - cmEND, ///< end of formula - cmUNKNOWN ///< uninitialized item -}; - -//------------------------------------------------------------------------------ -/** \brief Types internally used by the parser. -*/ -enum ETypeCode { - tpSTR = 0, ///< String type (Function arguments and constants only, no string variables) - tpDBL = 1, ///< Floating point variables - tpVOID = 2 ///< Undefined type. -}; - -//------------------------------------------------------------------------------ -/** \brief Parser operator precedence values. */ -enum EOprtAssociativity { oaLEFT = 0, oaRIGHT = 1, oaNONE = 2 }; - -//------------------------------------------------------------------------------ -/** \brief Parser operator precedence values. */ -enum EOprtPrecedence { - // binary operators - prLOR = 1, - prLAND = 2, - prLOGIC = 3, ///< logic operators - prCMP = 4, ///< comparsion operators - prADD_SUB = 5, ///< addition - prMUL_DIV = 6, ///< multiplication/division - prPOW = 7, ///< power operator priority (highest) - - // infix operators - prINFIX = 6, ///< Signs have a higher priority than ADD_SUB, but lower than power operator - prPOSTFIX = 6 ///< Postfix operator priority (currently unused) -}; - -//------------------------------------------------------------------------------ -// basic types - -/** \brief The numeric datatype used by the parser. - - Normally this is a floating point type either single or double precision. -*/ -typedef MUP_BASETYPE value_type; - -/** \brief The stringtype used by the parser. - - Depends on wether UNICODE is used or not. -*/ -typedef MUP_STRING_TYPE string_type; - -/** \brief The character type used by the parser. - - Depends on wether UNICODE is used or not. -*/ -typedef string_type::value_type char_type; - -/** \brief Typedef for easily using stringstream that respect the parser stringtype. */ -typedef std::basic_stringstream, std::allocator > - stringstream_type; - -// Data container types - -/** \brief Type used for storing variables. */ -typedef std::map varmap_type; - -/** \brief Type used for storing constants. */ -typedef std::map valmap_type; - -/** \brief Type for assigning a string name to an index in the internal string table. */ -typedef std::map strmap_type; - -/** \brief Error codes. */ -enum EErrorCodes { - // Formula syntax errors - ecUNEXPECTED_OPERATOR = 0, ///< Unexpected binary operator found - ecUNASSIGNABLE_TOKEN = 1, ///< Token cant be identified. - ecUNEXPECTED_EOF = 2, ///< Unexpected end of formula. (Example: "2+sin(") - ecUNEXPECTED_ARG_SEP = 3, ///< An unexpected comma has been found. (Example: "1,23") - ecUNEXPECTED_ARG = 4, ///< An unexpected argument has been found - ecUNEXPECTED_VAL = 5, ///< An unexpected value token has been found - ecUNEXPECTED_VAR = 6, ///< An unexpected variable token has been found - ecUNEXPECTED_PARENS = 7, ///< Unexpected Parenthesis, opening or closing - ecUNEXPECTED_STR = 8, ///< A string has been found at an inapropriate position - ecSTRING_EXPECTED = 9, ///< A string function has been called with a different type of argument - ecVAL_EXPECTED = - 10, ///< A numerical function has been called with a non value type of argument - ecMISSING_PARENS = 11, ///< Missing parens. (Example: "3*sin(3") - ecUNEXPECTED_FUN = 12, ///< Unexpected function found. (Example: "sin(8)cos(9)") - ecUNTERMINATED_STRING = 13, ///< unterminated string constant. (Example: "3*valueof("hello)") - ecTOO_MANY_PARAMS = 14, ///< Too many function parameters - ecTOO_FEW_PARAMS = 15, ///< Too few function parameters. (Example: "ite(1<2,2)") - ecOPRT_TYPE_CONFLICT = - 16, ///< binary operators may only be applied to value items of the same type - ecSTR_RESULT = 17, ///< result is a string - - // Invalid Parser input Parameters - ecINVALID_NAME = 18, ///< Invalid function, variable or constant name. - ecINVALID_BINOP_IDENT = 19, ///< Invalid binary operator identifier - ecINVALID_INFIX_IDENT = 20, ///< Invalid function, variable or constant name. - ecINVALID_POSTFIX_IDENT = 21, ///< Invalid function, variable or constant name. - - ecBUILTIN_OVERLOAD = 22, ///< Trying to overload builtin operator - ecINVALID_FUN_PTR = 23, ///< Invalid callback function pointer - ecINVALID_VAR_PTR = 24, ///< Invalid variable pointer - ecEMPTY_EXPRESSION = 25, ///< The Expression is empty - ecNAME_CONFLICT = 26, ///< Name conflict - ecOPT_PRI = 27, ///< Invalid operator priority - // - ecDOMAIN_ERROR = 28, ///< catch division by zero, sqrt(-1), log(0) (currently unused) - ecDIV_BY_ZERO = 29, ///< Division by zero (currently unused) - ecGENERIC = 30, ///< Generic error - ecLOCALE = 31, ///< Conflict with current locale - - ecUNEXPECTED_CONDITIONAL = 32, - ecMISSING_ELSE_CLAUSE = 33, - ecMISPLACED_COLON = 34, - - ecUNREASONABLE_NUMBER_OF_COMPUTATIONS = 35, - - // The last two are special entries - ecCOUNT, ///< This is no error code, It just stores just the total number of error codes - ecUNDEFINED = -1 ///< Undefined message, placeholder to detect unassigned error messages -}; - -/// \return an error message for the given code. -string_type parser_error_for_code(EErrorCodes code); - -// Compatibility with non-clang compilers. -#ifndef __has_attribute -#define __has_attribute(x) 0 -#endif - -// Define a type-level attribute declaring that this type, when used as the return value -// of a function, should produce warnings. Only clang supports this on types. -#if __clang__ && __has_attribute(warn_unused_result) -#define MUPARSER_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -#define MUPARSER_ATTR_WARN_UNUSED_RESULT -#endif - -//--------------------------------------------------------------------------- -/** \brief Error class of the parser. - \author Ingo Berg - - Part of the math parser package. - */ -class ParserError { - private: - /** \brief Replace all ocuurences of a substring with another string. */ - void ReplaceSubString(string_type &strSource, const string_type &strFind, - const string_type &strReplaceWith); - void Reset(); - - public: - ParserError(); - explicit ParserError(EErrorCodes a_iErrc); - explicit ParserError(const string_type &sMsg); - ParserError(EErrorCodes a_iErrc, string_type sTok, int a_iPos = -1); - ParserError(EErrorCodes a_iErrc, int a_iPos, string_type sTok); - ParserError(const char_type *a_szMsg, int a_iPos = -1, string_type sTok = string_type()); - ParserError(ParserError &&) = default; - ParserError &operator=(ParserError &&) = default; - ParserError(const ParserError &a_Obj) = default; - ParserError &operator=(const ParserError &a_Obj) = default; - ~ParserError(); - - void SetFormula(const string_type &a_strFormula); - const string_type &GetExpr() const; - const string_type &GetMsg() const; - int GetPos() const; - const string_type &GetToken() const; - EErrorCodes GetCode() const; - - private: - string_type m_strMsg; ///< The message string - string_type m_strTok; ///< Token related with the error - int m_iPos = -1; ///< Formula position related to the error - EErrorCodes m_iErrc = ecUNDEFINED; ///< Error code -} MUPARSER_ATTR_WARN_UNUSED_RESULT; - -// OptionalError is used to optionally encapsulate an error. -class OptionalError { - std::unique_ptr error_{}; - - public: - /// Create an OptionalError that represents no error. - OptionalError() {} - - /// Create an OptionalError for the given error. - /* implicit */ OptionalError(ParserError err) : error_(new ParserError(std::move(err))) {} - - /// \return whether an error is present. - bool has_error() const { return bool(error_); } - - /// \return the error. asserts if this is not an error. - const ParserError &error() const { - assert(error_ && "Value did not error"); - return *error_; - } -} MUPARSER_ATTR_WARN_UNUSED_RESULT; - -// ValueOrError is used to propagate failures to callers. -class ValueOrError { - value_type value_{0}; - OptionalError error_{}; - - public: - /// \return true if this has a value, false if it is an error. - bool has_value() const { return !error_.has_error(); } - - /// \return false if this has a value,true if it is an error. - bool has_error() const { return error_.has_error(); } - - /// Construct from a value. - /* implicit */ ValueOrError(value_type value) : value_(value) {} - - /// Construct from an error. - /* implicit */ ValueOrError(ParserError err) : error_(std::move(err)) {} - - /// \return the error. asserts if this is not an error. - const ParserError &error() const { return error_.error(); } - - /// \return the value. asserts if this is an error. - value_type value() const { - assert(has_value() && "Value is an error"); - return value_; - } - - /// \return whether this has a value. - explicit operator bool() const { return has_value(); } - - value_type operator*() const { - assert(has_value() && "Cannot access value with error"); - return value_; - } - -} MUPARSER_ATTR_WARN_UNUSED_RESULT; - -// Parser callbacks - -/** \brief Callback type used for functions without arguments. */ -typedef ValueOrError (*generic_fun_type)(); - -/** \brief Callback type used for functions without arguments. */ -typedef ValueOrError (*fun_type0)(); - -/** \brief Callback type used for functions with a single arguments. */ -typedef ValueOrError (*fun_type1)(value_type); - -/** \brief Callback type used for functions with two arguments. */ -typedef ValueOrError (*fun_type2)(value_type, value_type); - -/** \brief Callback type used for functions with three arguments. */ -typedef ValueOrError (*fun_type3)(value_type, value_type, value_type); - -/** \brief Callback type used for functions with a variable argument list. */ -typedef ValueOrError (*multfun_type)(const value_type *, int); - -/** \brief Callback type used for functions taking a string as an argument. */ -typedef ValueOrError (*strfun_type1)(const char_type *); - -/** \brief Callback type used for functions taking a string and a value as arguments. */ -typedef ValueOrError (*strfun_type2)(const char_type *, value_type); - -/** \brief Callback type used for functions taking a string and two values as arguments. */ -typedef ValueOrError (*strfun_type3)(const char_type *, value_type, value_type); - -/** \brief Callback used for functions that identify values in a string. */ -typedef int (*identfun_type)(const char_type *sExpr, int *nPos, value_type *fVal); - -/** \brief Callback used for variable creation factory functions. */ -typedef value_type *(*facfun_type)(const char_type *, void *); -} // end of namespace - -#endif diff --git a/muparser-2.2.5/include/muParserInt.h b/muparser-2.2.5/include/muParserInt.h deleted file mode 100644 index 66d4acf44..000000000 --- a/muparser-2.2.5/include/muParserInt.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#ifndef MU_PARSER_INT_H -#define MU_PARSER_INT_H - -#include -#include "muParserBase.h" - -/** \file - \brief Definition of a parser using integer value. -*/ - -namespace mu { - -/** \brief Mathematical expressions parser. - - This version of the parser handles only integer numbers. It disables the built in operators thus - it is - slower than muParser. Integer values are stored in the double value_type and converted if needed. -*/ -class ParserInt : public ParserBase { - private: - static int Round(value_type v) { return (int)(v + ((v >= 0) ? 0.5 : -0.5)); }; - - static ValueOrError Abs(value_type); - static ValueOrError Sign(value_type); - static ValueOrError Ite(value_type, value_type, value_type); - // !! The unary Minus is a MUST, otherwise you cant use negative signs !! - static ValueOrError UnaryMinus(value_type); - // Functions with variable number of arguments - static ValueOrError Sum(const value_type* a_afArg, int a_iArgc); // sum - static ValueOrError Min(const value_type* a_afArg, int a_iArgc); // minimum - static ValueOrError Max(const value_type* a_afArg, int a_iArgc); // maximum - // binary operator callbacks - static ValueOrError Add(value_type v1, value_type v2); - static ValueOrError Sub(value_type v1, value_type v2); - static ValueOrError Mul(value_type v1, value_type v2); - static ValueOrError Div(value_type v1, value_type v2); - static ValueOrError Mod(value_type v1, value_type v2); - static ValueOrError Pow(value_type v1, value_type v2); - static ValueOrError Shr(value_type v1, value_type v2); - static ValueOrError Shl(value_type v1, value_type v2); - static ValueOrError LogAnd(value_type v1, value_type v2); - static ValueOrError LogOr(value_type v1, value_type v2); - static ValueOrError And(value_type v1, value_type v2); - static ValueOrError Or(value_type v1, value_type v2); - static ValueOrError Xor(value_type v1, value_type v2); - static ValueOrError Less(value_type v1, value_type v2); - static ValueOrError Greater(value_type v1, value_type v2); - static ValueOrError LessEq(value_type v1, value_type v2); - static ValueOrError GreaterEq(value_type v1, value_type v2); - static ValueOrError Equal(value_type v1, value_type v2); - static ValueOrError NotEqual(value_type v1, value_type v2); - static ValueOrError Not(value_type v1); - - static int IsHexVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal); - static int IsBinVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal); - static int IsVal(const char_type* a_szExpr, int* a_iPos, value_type* a_iVal); - - /** \brief A facet class used to change decimal and thousands separator. */ - template - class change_dec_sep : public std::numpunct { - public: - explicit change_dec_sep(char_type cDecSep, char_type cThousandsSep = 0, int nGroup = 3) - : std::numpunct(), - m_cDecPoint(cDecSep), - m_cThousandsSep(cThousandsSep), - m_nGroup(nGroup) {} - - protected: - virtual char_type do_decimal_point() const { return m_cDecPoint; } - - virtual char_type do_thousands_sep() const { return m_cThousandsSep; } - - virtual std::string do_grouping() const { - // fix for issue 4: https://code.google.com/p/muparser/issues/detail?id=4 - // courtesy of Jens Bartsch - // original code: - // return std::string(1, (char)m_nGroup); - // new code: - return std::string(1, (char)(m_cThousandsSep > 0 ? m_nGroup : CHAR_MAX)); - } - - private: - int m_nGroup; - char_type m_cDecPoint; - char_type m_cThousandsSep; - }; - - public: - ParserInt(); - - void InitFun() override; - void InitOprt() override; - void InitConst() override; - void InitCharSets() override; -}; - -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserTest.h b/muparser-2.2.5/include/muParserTest.h deleted file mode 100644 index d5bb7d3d9..000000000 --- a/muparser-2.2.5/include/muParserTest.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#ifndef MU_PARSER_TEST_H -#define MU_PARSER_TEST_H - -#include -#include // for accumulate -#include -#include "muParser.h" -#include "muParserInt.h" - -/** \file - \brief This file contains the parser test class. -*/ - -namespace mu { -/** \brief Namespace for test cases. */ -namespace Test { -//------------------------------------------------------------------------------ -/** \brief Test cases for unit testing. - - (C) 2004-2011 Ingo Berg -*/ -class ParserTester // final -{ - private: - static int c_iCount; - - // Multiarg callbacks - static ValueOrError f1of1(value_type v) { return v; }; - - static ValueOrError f1of2(value_type v, value_type) { return v; }; - static ValueOrError f2of2(value_type, value_type v) { return v; }; - - static ValueOrError f1of3(value_type v, value_type, value_type) { return v; }; - static ValueOrError f2of3(value_type, value_type v, value_type) { return v; }; - static ValueOrError f3of3(value_type, value_type, value_type v) { return v; }; - - static ValueOrError Min(value_type a_fVal1, value_type a_fVal2) { - return (a_fVal1 < a_fVal2) ? a_fVal1 : a_fVal2; - } - static ValueOrError Max(value_type a_fVal1, value_type a_fVal2) { - return (a_fVal1 > a_fVal2) ? a_fVal1 : a_fVal2; - } - - static ValueOrError plus2(value_type v1) { return v1 + 2; } - static ValueOrError times3(value_type v1) { return v1 * 3; } - static ValueOrError sqr(value_type v1) { return v1 * v1; } - static ValueOrError sign(value_type v) { return -v; } - static ValueOrError add(value_type v1, value_type v2) { return v1 + v2; } - static ValueOrError land(value_type v1, value_type v2) { return (int)v1 & (int)v2; } - - static ValueOrError FirstArg(const value_type* a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function FirstArg.")); - return a_afArg[0]; - } - - static ValueOrError LastArg(const value_type* a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function LastArg.")); - - return a_afArg[a_iArgc - 1]; - } - - static ValueOrError Sum(const value_type* a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function sum.")); - - value_type fRes = 0; - for (int i = 0; i < a_iArgc; ++i) fRes += a_afArg[i]; - return fRes; - } - - static ValueOrError Rnd(value_type v) { - return (value_type)(1 + (v * std::rand() / (RAND_MAX + 1.0))); - } - - static ValueOrError RndWithString(const char_type*) { - return (value_type)(1 + (1000.0f * std::rand() / (RAND_MAX + 1.0))); - } - - static ValueOrError Ping() { return 10; } - - static ValueOrError ValueOf(const char_type*) { return 123; } - - static ValueOrError StrFun1(const char_type* v1) { - int val(0); - stringstream_type(v1) >> val; - return (value_type)val; - } - - static ValueOrError StrFun2(const char_type* v1, value_type v2) { - int val(0); - stringstream_type(v1) >> val; - return (value_type)(val + v2); - } - - static ValueOrError StrFun3(const char_type* v1, value_type v2, value_type v3) { - int val(0); - stringstream_type(v1) >> val; - return val + v2 + v3; - } - - static ValueOrError StrToFloat(const char_type* a_szMsg) { - value_type val(0); - stringstream_type(a_szMsg) >> val; - return val; - } - - // postfix operator callback - static ValueOrError Mega(value_type a_fVal) { return a_fVal * (value_type)1e6; } - static ValueOrError Micro(value_type a_fVal) { return a_fVal * (value_type)1e-6; } - static ValueOrError Milli(value_type a_fVal) { return a_fVal / (value_type)1e3; } - - // Custom value recognition - static int IsHexVal(const char_type* a_szExpr, int* a_iPos, value_type* a_fVal); - - int TestNames(); - int TestSyntax(); - int TestMultiArg(); - int TestPostFix(); - int TestExpression(); - int TestInfixOprt(); - int TestBinOprt(); - int TestInterface(); - int TestException(); - int TestStrArg(); - int TestIfThenElse(); - - void Abort() const; - - public: - typedef int (ParserTester::*testfun_type)(); - - ParserTester(); - void Run(); - - private: - std::vector m_vTestFun; - void AddTest(testfun_type a_pFun); - - // Test Double Parser - int EqnTest(const string_type& a_str, double a_fRes, bool a_fPass); - int EqnTestWithVarChange(const string_type& a_str, double a_fRes1, double a_fVar1, - double a_fRes2, double a_fVar2); - int ThrowTest(const string_type& a_str, int a_iErrc, bool a_bFail = true); - - // Test Int Parser - int EqnTestInt(const string_type& a_str, double a_fRes, bool a_fPass); -}; -} // namespace Test -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserToken.h b/muparser-2.2.5/include/muParserToken.h deleted file mode 100644 index acfa0ff71..000000000 --- a/muparser-2.2.5/include/muParserToken.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#ifndef MU_PARSER_TOKEN_H -#define MU_PARSER_TOKEN_H - -#include -#include -#include -#include -#include - -#include "muParserCallback.h" - -/** \file - \brief This file contains the parser token definition. -*/ - -namespace mu { -/** \brief Encapsulation of the data for a single formula token. - - Formula token implementation. Part of the Math Parser Package. - Formula tokens can be either one of the following: -
    -
  • value
  • -
  • variable
  • -
  • function with numerical arguments
  • -
  • functions with a string as argument
  • -
  • prefix operators
  • -
  • infix operators
  • -
  • binary operator
  • -
- - \author (C) 2004-2013 Ingo Berg -*/ -template -class ParserToken { - private: - ECmdCode m_iCode; ///< Type of the token; The token type is a constant of type #ECmdCode. - ETypeCode m_iType; - void *m_pTok; ///< Stores Token pointer; not applicable for all tokens - int m_iIdx; ///< An otional index to an external buffer storing the token data - TString m_strTok; ///< Token string - TString m_strVal; ///< Value for string variables - value_type m_fVal; ///< the value - std::unique_ptr m_pCallback; - - public: - //--------------------------------------------------------------------------- - /** \brief Constructor (default). - - Sets token to an neutral state of type cmUNKNOWN. - \sa ECmdCode - */ - ParserToken() - : m_iCode(cmUNKNOWN), - m_iType(tpVOID), - m_pTok(0), - m_iIdx(-1), - m_strTok(), - m_strVal(), - m_fVal(0), - m_pCallback() {} - - //------------------------------------------------------------------------------ - /** \brief Create token from another one. - - Implemented by calling Assign(...) - \post m_iType==cmUNKNOWN - \sa #Assign - */ - ParserToken(const ParserToken &a_Tok) { Assign(a_Tok); } - - //------------------------------------------------------------------------------ - /** \brief Assignement operator. - - Copy token state from another token and return this. - Implemented by calling Assign(...). - */ - ParserToken &operator=(const ParserToken &a_Tok) { - Assign(a_Tok); - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief Copy token information from argument. - */ - void Assign(const ParserToken &a_Tok) { - m_iCode = a_Tok.m_iCode; - m_pTok = a_Tok.m_pTok; - m_strTok = a_Tok.m_strTok; - m_iIdx = a_Tok.m_iIdx; - m_strVal = a_Tok.m_strVal; - m_iType = a_Tok.m_iType; - m_fVal = a_Tok.m_fVal; - // create new callback object if a_Tok has one - m_pCallback.reset(a_Tok.m_pCallback ? new ParserCallback(*a_Tok.m_pCallback) : nullptr); - } - - //------------------------------------------------------------------------------ - /** \brief Assign a token type. - - Token may not be of type value, variable or function. Those have seperate set functions. - - \pre [assert] a_iType!=cmVAR - \pre [assert] a_iType!=cmVAL - \pre [assert] a_iType!=cmFUNC - \post m_fVal = 0 - \post m_pTok = 0 - */ - ParserToken &Set(ECmdCode a_iType, const TString &a_strTok = TString()) { - // The following types cant be set this way, they have special Set functions - assert(a_iType != cmVAR); - assert(a_iType != cmVAL); - assert(a_iType != cmFUNC); - - m_iCode = a_iType; - m_iType = tpVOID; - m_pTok = 0; - m_strTok = a_strTok; - m_iIdx = -1; - - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief Set Callback type. */ - ParserToken &Set(const ParserCallback &a_pCallback, const TString &a_sTok) { - assert(a_pCallback.GetAddr()); - - m_iCode = a_pCallback.GetCode(); - m_iType = tpVOID; - m_strTok = a_sTok; - m_pCallback.reset(new ParserCallback(a_pCallback)); - - m_pTok = 0; - m_iIdx = -1; - - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief Make this token a value token. - - Member variables not necessary for value tokens will be invalidated. - */ - ParserToken &SetVal(TBase a_fVal, const TString &a_strTok = TString()) { - m_iCode = cmVAL; - m_iType = tpDBL; - m_fVal = a_fVal; - m_strTok = a_strTok; - m_iIdx = -1; - - m_pTok = 0; - m_pCallback.reset(0); - - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief make this token a variable token. - - Member variables not necessary for variable tokens will be invalidated. - */ - ParserToken &SetVar(TBase *a_pVar, const TString &a_strTok) { - m_iCode = cmVAR; - m_iType = tpDBL; - m_strTok = a_strTok; - m_iIdx = -1; - m_pTok = (void *)a_pVar; - m_pCallback.reset(0); - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief Make this token a variable token. - - Member variables not necessary for variable tokens will be invalidated. - */ - ParserToken &SetString(const TString &a_strTok, std::size_t a_iSize) { - m_iCode = cmSTRING; - m_iType = tpSTR; - m_strTok = a_strTok; - m_iIdx = static_cast(a_iSize); - - m_pTok = 0; - m_pCallback.reset(0); - return *this; - } - - //------------------------------------------------------------------------------ - /** \brief Set an index associated with the token related data. - - In cmSTRFUNC - This is the index to a string table in the main parser. - \param a_iIdx The index the string function result will take in the bytecode parser. - \throw exception_type if #a_iIdx<0 or #m_iType!=cmSTRING - */ - void SetIdx(int a_iIdx) { - if (m_iCode != cmSTRING || a_iIdx < 0) assert(0 && "muParser internal error"); - - m_iIdx = a_iIdx; - } - - //------------------------------------------------------------------------------ - /** \brief Return Index associated with the token related data. - - In cmSTRFUNC - This is the index to a string table in the main parser. - - \throw exception_type if #m_iIdx<0 or #m_iType!=cmSTRING - \return The index the result will take in the Bytecode calculatin array (#m_iIdx). - */ - int GetIdx() const { - if (m_iIdx < 0 || m_iCode != cmSTRING) assert(0 && "muParser internal error"); - - return m_iIdx; - } - - //------------------------------------------------------------------------------ - /** \brief Return the token type. - - \return #m_iType - */ - ECmdCode GetCode() const { - if (m_pCallback.get()) { - return m_pCallback->GetCode(); - } else { - return m_iCode; - } - } - - //------------------------------------------------------------------------------ - ETypeCode GetType() const { - if (m_pCallback.get()) { - return m_pCallback->GetType(); - } else { - return m_iType; - } - } - - //------------------------------------------------------------------------------ - int GetPri() const { - if (!m_pCallback.get()) assert(0 && "muParser internal error"); - - if (m_pCallback->GetCode() != cmOPRT_BIN && m_pCallback->GetCode() != cmOPRT_INFIX) - assert(0 && "muParser internal error"); - - return m_pCallback->GetPri(); - } - - //------------------------------------------------------------------------------ - EOprtAssociativity GetAssociativity() const { - if (m_pCallback.get() == NULL || m_pCallback->GetCode() != cmOPRT_BIN) - assert(0 && "muParser internal error"); - - return m_pCallback->GetAssociativity(); - } - - //------------------------------------------------------------------------------ - /** \brief Return the address of the callback function assoziated with - function and operator tokens. - - \return The pointer stored in #m_pTok. - */ - generic_fun_type GetFuncAddr() const { - return m_pCallback ? (generic_fun_type)m_pCallback->GetAddr() : nullptr; - } - - //------------------------------------------------------------------------------ - /** \brifef Get value of the token. - - Only applicable to variable and value tokens. - */ - ValueOrError GetVal() const { - switch (m_iCode) { - case cmVAL: - return m_fVal; - case cmVAR: - return *((TBase *)m_pTok); - default: - return ParserError(ecVAL_EXPECTED); - } - } - - //------------------------------------------------------------------------------ - /** \brief Get address of a variable token. - - Valid only if m_iType==CmdVar. - \throw exception_type if token is no variable token. - */ - TBase *GetVar() const { - if (m_iCode != cmVAR) assert(0 && "muParser internal error"); - - return (TBase *)m_pTok; - } - - //------------------------------------------------------------------------------ - /** \brief Return the number of function arguments. - - Valid only if m_iType==CmdFUNC. - */ - int GetArgCount() const { - assert(m_pCallback.get()); - - if (!m_pCallback->GetAddr()) assert(0 && "muParser internal error"); - - return m_pCallback->GetArgc(); - } - - //------------------------------------------------------------------------------ - /** \brief Return the token identifier. - - If #m_iType is cmSTRING the token identifier is the value of the string argument - for a string function. - \return #m_strTok - \sa m_strTok - */ - const TString &GetAsString() const { return m_strTok; } -}; -} // namespace mu - -#endif diff --git a/muparser-2.2.5/include/muParserTokenReader.h b/muparser-2.2.5/include/muParserTokenReader.h deleted file mode 100644 index 9277c06a5..000000000 --- a/muparser-2.2.5/include/muParserTokenReader.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#ifndef MU_PARSER_TOKEN_READER_H -#define MU_PARSER_TOKEN_READER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "muParserDef.h" -#include "muParserToken.h" - -/** \file - \brief This file contains the parser token reader definition. -*/ - -namespace mu { -// Forward declaration -class ParserBase; - -/** \brief Token reader for the ParserBase class. -*/ -class ParserTokenReader final { - private: - typedef ParserToken token_type; - - public: - ParserTokenReader(ParserBase *a_pParent); - - void AddValIdent(identfun_type a_pCallback); - void SetVarCreator(facfun_type a_pFactory, void *pUserData); - void SetFormula(const string_type &a_strFormula); - void SetArgSep(char_type cArgSep); - - int GetPos() const; - const string_type &GetExpr() const; - char_type GetArgSep() const; - - void IgnoreUndefVar(bool bIgnore); - void ReInit(); - token_type ReadNextToken(); - - /// \return the first error (if any), clearing it. - OptionalError acquireFirstError() { - OptionalError ret = std::move(firstError_); - firstError_ = OptionalError{}; - return ret; - } - - private: - /** \brief Syntax codes. - - The syntax codes control the syntax check done during the first time parsing of - the expression string. They are flags that indicate which tokens are allowed next - if certain tokens are identified. - */ - enum ESynCodes { - noBO = 1 << 0, ///< to avoid i.e. "cos(7)(" - noBC = 1 << 1, ///< to avoid i.e. "sin)" or "()" - noVAL = 1 << 2, ///< to avoid i.e. "tan 2" or "sin(8)3.14" - noVAR = 1 << 3, ///< to avoid i.e. "sin a" or "sin(8)a" - noARG_SEP = 1 << 4, ///< to avoid i.e. ",," or "+," ... - noFUN = 1 << 5, ///< to avoid i.e. "sqrt cos" or "(1)sin" - noOPT = 1 << 6, ///< to avoid i.e. "(+)" - noPOSTOP = 1 << 7, ///< to avoid i.e. "(5!!)" "sin!" - noINFIXOP = 1 << 8, ///< to avoid i.e. "++4" "!!4" - noEND = 1 << 9, ///< to avoid unexpected end of formula - noSTR = 1 << 10, ///< to block numeric arguments on string functions - noASSIGN = 1 << 11, ///< to block assignement to constant i.e. "4=7" - noIF = 1 << 12, - noELSE = 1 << 13, - sfSTART_OF_LINE = noOPT | noBC | noPOSTOP | noASSIGN | noIF | noELSE | noARG_SEP, - noANY = ~0 ///< All of he above flags set - }; - - ParserTokenReader(const ParserTokenReader &a_Reader) = delete; - ParserTokenReader &operator=(const ParserTokenReader &a_Reader) = delete; - - void SetParent(ParserBase *a_pParent); - int ExtractToken(const char_type *a_szCharSet, string_type &a_strTok, int a_iPos) const; - int ExtractOperatorToken(string_type &a_sTok, int a_iPos) const; - - bool IsBuiltIn(token_type &a_Tok); - bool IsArgSep(token_type &a_Tok); - bool IsEOF(token_type &a_Tok); - bool IsInfixOpTok(token_type &a_Tok); - bool IsFunTok(token_type &a_Tok); - bool IsPostOpTok(token_type &a_Tok); - bool IsOprt(token_type &a_Tok); - bool IsValTok(token_type &a_Tok); - bool IsVarTok(token_type &a_Tok); - bool IsStrVarTok(token_type &a_Tok); - bool IsUndefVarTok(token_type &a_Tok); - bool IsString(token_type &a_Tok); - bool Error(EErrorCodes a_iErrc, int a_iPos = -1, const string_type &a_sTok = string_type()); - - token_type &SaveBeforeReturn(const token_type &tok); - - ParserBase *m_pParser; - string_type m_strFormula; - int m_iPos = 0; - int m_iSynFlags = 0; - bool m_bIgnoreUndefVar = false; - - OptionalError firstError_; /// The first error reported during parsing. - const funmap_type *m_pFunDef = nullptr; - const funmap_type *m_pPostOprtDef = nullptr; - const funmap_type *m_pInfixOprtDef = nullptr; - const funmap_type *m_pOprtDef = nullptr; - const valmap_type *m_pConstDef = nullptr; - const strmap_type *m_pStrVarDef = nullptr; - varmap_type *m_pVarDef = nullptr; ///< The only non const pointer to parser internals - facfun_type m_pFactory = nullptr; - void *m_pFactoryData = nullptr; - std::list m_vIdentFun; ///< Value token identification function - varmap_type m_UsedVar; - value_type m_fZero = 0; ///< Dummy value of zero, referenced by undefined variables - int m_iBrackets = 0; - token_type m_lastTok; - char_type m_cArgSep = ','; ///< The character used for separating function arguments -}; -} // namespace mu - -#endif diff --git a/muparser-2.2.5/lib/Readme.txt b/muparser-2.2.5/lib/Readme.txt deleted file mode 100644 index 7240cc374..000000000 --- a/muparser-2.2.5/lib/Readme.txt +++ /dev/null @@ -1 +0,0 @@ -Here goes the libraries (both static and shared) for this component. \ No newline at end of file diff --git a/muparser-2.2.5/samples/example1/example1.cpp b/muparser-2.2.5/samples/example1/example1.cpp deleted file mode 100644 index 3d9332d7a..000000000 --- a/muparser-2.2.5/samples/example1/example1.cpp +++ /dev/null @@ -1,353 +0,0 @@ -//--------------------------------------------------------------------------- -// -// __________ -// _____ __ __\______ \_____ _______ ______ ____ _______ -// / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ | -// | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ -// |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| -// \/ \/ \/ \/ -// (C) 2015 Ingo Berg -// -// example1.cpp - using the parser as a static library -// -//--------------------------------------------------------------------------- - -#include "muParserTest.h" - -#if defined(_WIN32) && defined(_DEBUG) -#define _CRTDBG_MAP_ALLOC -#include -#include -#define CREATE_LEAKAGE_REPORT -#endif - -#if defined(USINGDLL) && defined(_WIN32) -#error This sample can be used only with STATIC builds of muParser (on win32) -#endif - -/** \brief This macro will enable mathematical constants like M_PI. */ -#define _USE_MATH_DEFINES - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "muParser.h" - -using namespace std; -using namespace mu; - -#if defined(CREATE_LEAKAGE_REPORT) - -// Dumping memory leaks in the destructor of the static guard -// guarantees i won't get false positives from the ParserErrorMsg -// class wich is a singleton with a static instance. -struct DumpLeaks { - ~DumpLeaks() { _CrtDumpMemoryLeaks(); } -} static LeakDumper; - -#endif - -// Operator callback functions -ValueOrError Mega(value_type a_fVal) { return a_fVal * 1e6; } -ValueOrError Milli(value_type a_fVal) { return a_fVal / (value_type)1e3; } -ValueOrError Rnd(value_type v) { return v * std::rand() / (value_type)(RAND_MAX + 1.0); } -ValueOrError Not(value_type v) { return v == 0; } -ValueOrError Add(value_type v1, value_type v2) { return v1 + v2; } -ValueOrError Mul(value_type v1, value_type v2) { return v1 * v2; } - -//--------------------------------------------------------------------------- -ValueOrError ThrowAnException(value_type) { - throw std::runtime_error("This function does throw an exception."); -} - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- -ValueOrError Ping() { - mu::console() << "ping\n"; - return 0; -} - -//--------------------------------------------------------------------------- -ValueOrError StrFun0(const char_type *szMsg) { - if (szMsg) mu::console() << szMsg << std::endl; - - return 999; -} - -//--------------------------------------------------------------------------- -ValueOrError StrFun2(const char_type *v1, value_type v2, value_type v3) { - mu::console() << v1 << std::endl; - return v2 + v3; -} - -//--------------------------------------------------------------------------- -ValueOrError Debug(mu::value_type v1, mu::value_type v2) { - ParserBase::EnableDebugDump(v1 != 0, v2 != 0); - mu::console() << _T("Bytecode dumping ") << ((v1 != 0) ? _T("active") : _T("inactive")) - << _T("\n"); - return 1; -} - -//--------------------------------------------------------------------------- -// Factory function for creating new parser variables -// This could as well be a function performing database queries. -value_type *AddVariable(const char_type *a_szName, void *a_pUserData) { - // I don't want dynamic allocation here, so i used this static buffer - // If you want dynamic allocation you must allocate all variables dynamically - // in order to delete them later on. Or you find other ways to keep track of - // variables that have been created implicitely. - static value_type afValBuf[100]; - static int iVal = -1; - - ++iVal; - - mu::console() << _T("Generating new variable \"") << a_szName << std::dec - << _T("\" (slots left: ") << 99 - iVal << _T(")") - << _T(" User data pointer is:") << std::hex << a_pUserData << endl; - afValBuf[iVal] = 0; - - if (iVal >= 99) - throw mu::ParserError(_T("Variable buffer overflow.")); - else - return &afValBuf[iVal]; -} - -int IsHexValue(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - if (a_szExpr[1] == 0 || (a_szExpr[0] != '0' || a_szExpr[1] != 'x')) return 0; - - unsigned iVal(0); - - // New code based on streams for UNICODE compliance: - stringstream_type::pos_type nPos(0); - stringstream_type ss(a_szExpr + 2); - ss >> std::hex >> iVal; - nPos = ss.tellg(); - - if (nPos == (stringstream_type::pos_type)0) return 1; - - *a_iPos += (int)(2 + nPos); - *a_fVal = (value_type)iVal; - - return 1; -} - -//--------------------------------------------------------------------------- -void Splash() { - mu::console() << _T(" __________ \n"); - mu::console() << _T(" _____ __ __\\______ \\_____ _______ ______ ____ _______\n"); - mu::console() - << _T(" / \\ | | \\| ___/\\__ \\ \\_ __ \\/ ___/_/ __ \\\\_ __ \\ \n"); - mu::console() - << _T(" | Y Y \\| | /| | / __ \\_| | \\/\\___ \\ \\ ___/ | | \\/ \n"); - mu::console() << _T(" |__|_| /|____/ |____| (____ /|__| /____ > \\___ >|__| \n"); - mu::console() << _T(" \\/ \\/ \\/ \\/ \n"); - mu::console() << _T(" (C) 2015 Ingo Berg\n"); -} - -//--------------------------------------------------------------------------- -ValueOrError SelfTest() { - mu::console() << _T( "-----------------------------------------------------------\n"); - mu::console() << _T( "Running test suite:\n\n"); - - // Skip the self test if the value type is set to an integer type. - if (std::numeric_limits::is_integer) { - mu::console() - << _T( " Test skipped: integer data type are not compatible with the unit test!\n\n"); - } else { - mu::Test::ParserTester pt; - pt.Run(); - } - - return 0; -} - -//--------------------------------------------------------------------------- -ValueOrError Help() { - mu::console() << _T( "-----------------------------------------------------------\n"); - mu::console() << _T( "Commands:\n\n"); - mu::console() << _T( " list var - list parser variables\n"); - mu::console() << _T( " list exprvar - list expression variables\n"); - mu::console() << _T( " list const - list all numeric parser constants\n"); - mu::console() << _T( " locale de - switch to german locale\n"); - mu::console() << _T( " locale en - switch to english locale\n"); - mu::console() << _T( " locale reset - reset locale\n"); - mu::console() << _T( " quit - exits the parser\n"); - mu::console() << _T( "\nConstants:\n\n"); - mu::console() << _T( " \"_e\" 2.718281828459045235360287\n"); - mu::console() << _T( " \"_pi\" 3.141592653589793238462643\n"); - mu::console() << _T( "-----------------------------------------------------------\n"); - return 0; -} - -//--------------------------------------------------------------------------- -/** \brief Check for external keywords. -*/ -int CheckKeywords(const mu::char_type *a_szLine, mu::Parser &a_Parser) { - string_type sLine(a_szLine); - - if (sLine == _T("quit")) { - return -1; - } else if (sLine == _T("locale de")) { - mu::console() << _T("Setting german locale: ArgSep=';' DecSep=',' ThousandsSep='.'\n"); - a_Parser.SetArgSep(';'); - a_Parser.SetDecSep(','); - a_Parser.SetThousandsSep('.'); - return 1; - } else if (sLine == _T("locale en")) { - mu::console() << _T("Setting english locale: ArgSep=',' DecSep='.' ThousandsSep=''\n"); - a_Parser.SetArgSep(','); - a_Parser.SetDecSep('.'); - a_Parser.SetThousandsSep(); - return 1; - } else if (sLine == _T("locale reset")) { - mu::console() << _T("Resetting locale\n"); - a_Parser.ResetLocale(); - return 1; - } - - return 0; -} - -//--------------------------------------------------------------------------- -void Calc() { - mu::Parser parser; - -// Change locale settings if necessary -// function argument separator: sum(2;3;4) vs. sum(2,3,4) -// decimal separator: 3,14 vs. 3.14 -// thousands separator: 1000000 vs 1.000.000 -//#define USE_GERMAN_LOCALE -#ifdef USE_GERMAN_LOCALE - parser.SetArgSep(';'); - parser.SetDecSep(','); - parser.SetThousandsSep('.'); -#else -// this is the default, so i it's commented: -// parser.SetArgSep(','); -// parser.SetDecSep('.'); -// parser.SetThousandsSep(''); -#endif - - // Add some variables - value_type vVarVal[] = {1, 2}; // Values of the parser variables - parser.DefineVar(_T("a"), - &vVarVal[0]); // Assign Variable names and bind them to the C++ variables - parser.DefineVar(_T("b"), &vVarVal[1]); - parser.DefineVar(_T("ft"), &vVarVal[1]); - parser.DefineStrConst(_T("sVar1"), _T("Sample string 1")); - parser.DefineStrConst(_T("sVar2"), _T("Sample string 2")); - parser.AddValIdent(IsHexValue); - - // Add user defined unary operators - parser.DefinePostfixOprt(_T("M"), Mega); - parser.DefinePostfixOprt(_T("m"), Milli); - parser.DefineInfixOprt(_T("!"), Not); - parser.DefineFun(_T("strfun0"), StrFun0); - parser.DefineFun(_T("strfun2"), StrFun2); - parser.DefineFun(_T("ping"), Ping); - parser.DefineFun(_T("rnd"), Rnd); - parser.DefineFun(_T("throw"), ThrowAnException); - - parser.DefineOprt(_T("add"), Add, 0); - parser.DefineOprt(_T("mul"), Mul, 1); - - // These are service and debug functions - parser.DefineFun(_T("debug"), Debug); - parser.DefineFun(_T("selftest"), SelfTest); - parser.DefineFun(_T("help"), Help); - - parser.DefinePostfixOprt(_T("{ft}"), Milli); - parser.DefinePostfixOprt(_T("ft"), Milli); -#ifdef _DEBUG -// parser.EnableDebugDump(1, 0); -#endif - - // Define the variable factory - parser.SetVarFactory(AddVariable, &parser); - - for (;;) { - try { - string_type sLine; - std::getline(mu::console_in(), sLine); - - switch (CheckKeywords(sLine.c_str(), parser)) { - case 0: - break; - case 1: - continue; - case -1: - return; - } - - if (!sLine.length()) continue; - - parser.SetExpr(sLine); - mu::console() << std::setprecision(12); - - // There are multiple ways to retrieve the result... - // 1.) If you know there is only a single return value or in case you only need the last - // result of an expression consisting of comma separated subexpressions you can - // simply use: - mu::console() << _T("ans=") << *parser.Eval() << _T("\n"); - - // 2.) As an alternative you can also retrieve multiple return values using this API: - int nNum = parser.GetNumResults(); - if (nNum > 1) { - mu::console() << _T("Multiple return values detected! Complete list:\n"); - - // this is the hard way if you need to retrieve multiple subexpression - // results - std::vector vs; - parser.Eval(&vs); - mu::console() << std::setprecision(12); - for (const ValueOrError &v : vs) { - mu::console() << *v << _T("\n"); - } - } - } catch (mu::Parser::exception_type &e) { - mu::console() << _T("\nError:\n"); - mu::console() << _T("------\n"); - mu::console() << _T("Message: ") << e.GetMsg() << _T("\n"); - mu::console() << _T("Token: \"") << e.GetToken() << _T("\"\n"); - mu::console() << _T("Position: ") << (int)e.GetPos() << _T("\n"); - mu::console() << _T("Errc: ") << std::dec << e.GetCode() << _T("\n"); - } - } // while running -} - -//--------------------------------------------------------------------------- -int main(int, char **) { - Splash(); - (void)SelfTest(); - (void)Help(); - - // CheckLocale(); - // CheckDiff(); - - mu::console() << _T("Enter an expression or a command:\n"); - - try { - Calc(); - } catch (Parser::exception_type &e) { - // Only erros raised during the initialization will end up here - // formula related errors are treated in Calc() - console() << _T("Initialization error: ") << e.GetMsg() << endl; - console() << _T("aborting...") << endl; - string_type sBuf; - console_in() >> sBuf; - } catch (std::exception & /*exc*/) { - // there is no unicode compliant way to query exc.what() - // so i'll leave it for this example. - console() << _T("aborting...\n"); - } - - return 0; -} diff --git a/muparser-2.2.5/src/muParser.cpp b/muparser-2.2.5/src/muParser.cpp deleted file mode 100644 index b0b845e3f..000000000 --- a/muparser-2.2.5/src/muParser.cpp +++ /dev/null @@ -1,305 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#include "muParser.h" - -//--- Standard includes ------------------------------------------------------------------------ -#include -#include -#include -#include - -/** \brief Pi (what else?). */ -#define PARSER_CONST_PI 3.141592653589793238462643 - -/** \brief The Eulerian number. */ -#define PARSER_CONST_E 2.718281828459045235360287 - -using namespace std; - -/** \file - \brief Implementation of the standard floating point parser. -*/ - -/** \brief Namespace for mathematical applications. */ -namespace mu { - -//--------------------------------------------------------------------------- -// Trigonometric function -ValueOrError Parser::Sin(value_type v) { return std::sin(v); } -ValueOrError Parser::Cos(value_type v) { return std::cos(v); } -ValueOrError Parser::Tan(value_type v) { return std::tan(v); } -ValueOrError Parser::ASin(value_type v) { return std::asin(v); } -ValueOrError Parser::ACos(value_type v) { return std::acos(v); } -ValueOrError Parser::ATan(value_type v) { return std::atan(v); } -ValueOrError Parser::ATan2(value_type v1, value_type v2) { return std::atan2(v1, v2); } -ValueOrError Parser::Sinh(value_type v) { return std::sinh(v); } -ValueOrError Parser::Cosh(value_type v) { return std::cosh(v); } -ValueOrError Parser::Tanh(value_type v) { return std::tanh(v); } -ValueOrError Parser::ASinh(value_type v) { return std::asinh(v); } -ValueOrError Parser::ACosh(value_type v) { return std::acosh(v); } -ValueOrError Parser::ATanh(value_type v) { return std::atanh(v); } - -//--------------------------------------------------------------------------- -// Logarithm functions - -// Logarithm base 2 -ValueOrError Parser::Log2(value_type v) { -#ifdef MUP_MATH_EXCEPTIONS - if (v <= 0) return ParserError(ecDOMAIN_ERROR, _T("Log2")); -#endif - - return std::log2(v); -} - -// Logarithm base 10 -ValueOrError Parser::Log10(value_type v) { -#ifdef MUP_MATH_EXCEPTIONS - if (v <= 0) return ParserError(ecDOMAIN_ERROR, _T("Log10")); -#endif - - return std::log10(v); -} - -// Logarithm base e (natural logarithm) -ValueOrError Parser::Ln(value_type v) { -#ifdef MUP_MATH_EXCEPTIONS - if (v <= 0) return ParserError(ecDOMAIN_ERROR, _T("Ln")); -#endif - - return std::log(v); -} - -//--------------------------------------------------------------------------- -// misc -ValueOrError Parser::Exp(value_type v) { return std::exp(v); } -ValueOrError Parser::Abs(value_type v) { return std::abs(v); } -ValueOrError Parser::Sqrt(value_type v) { -#ifdef MUP_MATH_EXCEPTIONS - if (v < 0) return ParserError(ecDOMAIN_ERROR, _T("sqrt")); -#endif - - return std::sqrt(v); -} -ValueOrError Parser::Rint(value_type v) { return std::floor(v + 0.5); } -ValueOrError Parser::Sign(value_type v) { - // return 1, 0, -1 according to whether v is positive, zero, negative. - return (v > 0) - (v < 0); -} - -//--------------------------------------------------------------------------- -/** \brief Callback for the unary minus operator. - \param v The value to negate - \return -v -*/ -ValueOrError Parser::UnaryMinus(value_type v) { return -v; } - -//--------------------------------------------------------------------------- -/** \brief Callback for the unary minus operator. - \param v The value to negate - \return -v -*/ -ValueOrError Parser::UnaryPlus(value_type v) { return v; } - -//--------------------------------------------------------------------------- -/** \brief Callback for adding multiple values. - \param [in] a_afArg Vector with the function arguments - \param [in] a_iArgc The size of a_afArg -*/ -ValueOrError Parser::Sum(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function sum.")); - - value_type fRes = 0; - for (int i = 0; i < a_iArgc; ++i) fRes += a_afArg[i]; - return fRes; -} - -//--------------------------------------------------------------------------- -/** \brief Callback for averaging multiple values. - \param [in] a_afArg Vector with the function arguments - \param [in] a_iArgc The size of a_afArg -*/ -ValueOrError Parser::Avg(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function sum.")); - - value_type fRes = 0; - for (int i = 0; i < a_iArgc; ++i) fRes += a_afArg[i]; - return fRes / (value_type)a_iArgc; -} - -//--------------------------------------------------------------------------- -/** \brief Callback for determining the minimum value out of a vector. - \param [in] a_afArg Vector with the function arguments - \param [in] a_iArgc The size of a_afArg -*/ -ValueOrError Parser::Min(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function min.")); - - value_type fRes = a_afArg[0]; - for (int i = 0; i < a_iArgc; ++i) fRes = std::min(fRes, a_afArg[i]); - - return fRes; -} - -//--------------------------------------------------------------------------- -/** \brief Callback for determining the maximum value out of a vector. - \param [in] a_afArg Vector with the function arguments - \param [in] a_iArgc The size of a_afArg -*/ -ValueOrError Parser::Max(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function max.")); - - value_type fRes = a_afArg[0]; - for (int i = 0; i < a_iArgc; ++i) fRes = std::max(fRes, a_afArg[i]); - - return fRes; -} - -//--------------------------------------------------------------------------- -/** \brief Default value recognition callback. - \param [in] a_szExpr Pointer to the expression - \param [in, out] a_iPos Pointer to an index storing the current position within the expression - \param [out] a_fVal Pointer where the value should be stored in case one is found. - \return 1 if a value was found 0 otherwise. -*/ -int Parser::IsVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - value_type fVal(0); - - stringstream_type stream(a_szExpr); - stream.seekg(0); // todo: check if this really is necessary - stream.imbue(Parser::s_locale); - stream >> fVal; - stringstream_type::pos_type iEnd = stream.tellg(); // Position after reading - - if (iEnd == (stringstream_type::pos_type)-1) return 0; - - *a_iPos += (int)iEnd; - *a_fVal = fVal; - return 1; -} - -//--------------------------------------------------------------------------- -/** \brief Constructor. - - Call ParserBase class constructor and trigger Function, Operator and Constant initialization. -*/ -Parser::Parser() : ParserBase() { - AddValIdent(IsVal); - - InitCharSets(); - InitFun(); - InitConst(); - InitOprt(); -} - -//--------------------------------------------------------------------------- -/** \brief Define the character sets. - \sa DefineNameChars, DefineOprtChars, DefineInfixOprtChars - - This function is used for initializing the default character sets that define - the characters to be useable in function and variable names and operators. -*/ -void Parser::InitCharSets() { - DefineNameChars(_T("0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")); - DefineOprtChars(_T("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-*^/?<>=#!$%&|~'_{}")); - DefineInfixOprtChars(_T("/+-*^?<>=#!$%&|~'_")); -} - -/// assert that the given optional error \p oerr is not an error. -/// This is used only during initialization, when it ought to be impossible -/// to generate an error. -static void assertNoError(OptionalError oerr) { - assert(!oerr.has_error() && "Unexpected error during initialization"); - (void)oerr; -} - -//--------------------------------------------------------------------------- -/** \brief Initialize the default functions. */ -void Parser::InitFun() { - if (std::numeric_limits::is_integer) { - // When setting MUP_BASETYPE to an integer type - // Place functions for dealing with integer values here - // ... - // ... - // ... - } else { - // trigonometric functions - assertNoError(DefineFun(_T("sin"), Sin)); - assertNoError(DefineFun(_T("cos"), Cos)); - assertNoError(DefineFun(_T("tan"), Tan)); - // arcus functions - assertNoError(DefineFun(_T("asin"), ASin)); - assertNoError(DefineFun(_T("acos"), ACos)); - assertNoError(DefineFun(_T("atan"), ATan)); - assertNoError(DefineFun(_T("atan2"), ATan2)); - // hyperbolic functions - assertNoError(DefineFun(_T("sinh"), Sinh)); - assertNoError(DefineFun(_T("cosh"), Cosh)); - assertNoError(DefineFun(_T("tanh"), Tanh)); - // arcus hyperbolic functions - assertNoError(DefineFun(_T("asinh"), ASinh)); - assertNoError(DefineFun(_T("acosh"), ACosh)); - assertNoError(DefineFun(_T("atanh"), ATanh)); - // Logarithm functions - assertNoError(DefineFun(_T("log2"), Log2)); - assertNoError(DefineFun(_T("log10"), Log10)); - assertNoError(DefineFun(_T("log"), Ln)); - assertNoError(DefineFun(_T("ln"), Ln)); - // misc - assertNoError(DefineFun(_T("exp"), Exp)); - assertNoError(DefineFun(_T("sqrt"), Sqrt)); - assertNoError(DefineFun(_T("sign"), Sign)); - assertNoError(DefineFun(_T("rint"), Rint)); - assertNoError(DefineFun(_T("abs"), Abs)); - // Functions with variable number of arguments - assertNoError(DefineFun(_T("sum"), Sum)); - assertNoError(DefineFun(_T("avg"), Avg)); - assertNoError(DefineFun(_T("min"), Min)); - assertNoError(DefineFun(_T("max"), Max)); - } -} - -//--------------------------------------------------------------------------- -/** \brief Initialize constants. - - By default the parser recognizes two constants. Pi ("pi") and the Eulerian - number ("_e"). -*/ -void Parser::InitConst() { - assertNoError(DefineConst(_T("_pi"), (value_type)PARSER_CONST_PI)); - assertNoError(DefineConst(_T("_e"), (value_type)PARSER_CONST_E)); -} - -//--------------------------------------------------------------------------- -/** \brief Initialize operators. - - By default only the unary minus operator is added. -*/ -void Parser::InitOprt() { - assertNoError(DefineInfixOprt(_T("-"), UnaryMinus)); - assertNoError(DefineInfixOprt(_T("+"), UnaryPlus)); -} - -} // namespace mu diff --git a/muparser-2.2.5/src/muParserBase.cpp b/muparser-2.2.5/src/muParserBase.cpp deleted file mode 100644 index 69857e9d9..000000000 --- a/muparser-2.2.5/src/muParserBase.cpp +++ /dev/null @@ -1,1332 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#include "muParserBase.h" - -//--- Standard includes ------------------------------------------------------------------------ -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -/** \file - \brief This file contains the basic implementation of the muparser engine. -*/ - -namespace mu { -std::locale ParserBase::s_locale = - std::locale(std::locale::classic(), new change_dec_sep('.')); - -bool ParserBase::g_DbgDumpCmdCode = false; -bool ParserBase::g_DbgDumpStack = false; - -//------------------------------------------------------------------------------ -/** \brief Identifiers for built in binary operators. - - When defining custom binary operators with #AddOprt(...) make sure not to choose - names conflicting with these definitions. -*/ -const char_type *ParserBase::c_DefaultOprt[] = { - _T("<="), _T(">="), _T("!="), _T("=="), _T("<"), _T(">"), _T("+"), _T("-"), _T("*"), _T("/"), - _T("^"), _T("&&"), _T("||"), _T("="), _T("("), _T(")"), _T("?"), _T(":"), 0}; - -//------------------------------------------------------------------------------ -/** \brief Constructor. - \param a_szFormula the formula to interpret. - \throw ParserException if a_szFormula is null. -*/ -ParserBase::ParserBase() : m_pTokenReader(new ParserTokenReader(this)) {} - -//--------------------------------------------------------------------------- -ParserBase::~ParserBase() = default; - -//--------------------------------------------------------------------------- -/** \brief Set the decimal separator. - \param cDecSep Decimal separator as a character value. - \sa SetThousandsSep - - By default muparser uses the "C" locale. The decimal separator of this - locale is overwritten by the one provided here. -*/ -void ParserBase::SetDecSep(char_type cDecSep) { - char_type cThousandsSep = std::use_facet >(s_locale).thousands_sep(); - s_locale = std::locale(std::locale("C"), new change_dec_sep(cDecSep, cThousandsSep)); -} - -//--------------------------------------------------------------------------- -/** \brief Sets the thousands operator. - \param cThousandsSep The thousands separator as a character - \sa SetDecSep - - By default muparser uses the "C" locale. The thousands separator of this - locale is overwritten by the one provided here. -*/ -void ParserBase::SetThousandsSep(char_type cThousandsSep) { - char_type cDecSep = std::use_facet >(s_locale).decimal_point(); - s_locale = std::locale(std::locale("C"), new change_dec_sep(cDecSep, cThousandsSep)); -} - -//--------------------------------------------------------------------------- -/** \brief Resets the locale. - - The default locale used "." as decimal separator, no thousands separator and - "," as function argument separator. -*/ -void ParserBase::ResetLocale() { - s_locale = std::locale(std::locale("C"), new change_dec_sep('.')); - SetArgSep(','); -} - -//--------------------------------------------------------------------------- -/** \brief Reset parser to string parsing mode and clear internal buffers. - - Clear bytecode, reset the token reader. -*/ -void ParserBase::ReInit() const { - m_vStringBuf.clear(); - m_vRPN.clear(); - m_pTokenReader->ReInit(); -} - -//--------------------------------------------------------------------------- -/** \brief Add a value parsing function. - - When parsing an expression muParser tries to detect values in the expression - string using different valident callbacks. Thus it's possible to parse - for hex values, binary values and floating point values. -*/ -void ParserBase::AddValIdent(identfun_type a_pCallback) { - m_pTokenReader->AddValIdent(a_pCallback); -} - -//--------------------------------------------------------------------------- -/** \brief Set a function that can create variable pointer for unknown expression variables. - \param a_pFactory A pointer to the variable factory. - \param pUserData A user defined context pointer. -*/ -void ParserBase::SetVarFactory(facfun_type a_pFactory, void *pUserData) { - m_pTokenReader->SetVarCreator(a_pFactory, pUserData); -} - -//--------------------------------------------------------------------------- -/** \brief Add a function or operator callback to the parser. */ -OptionalError ParserBase::AddCallback(const string_type &a_strName, - const ParserCallback &a_Callback, funmap_type &a_Storage, - const char_type *a_szCharSet) { - assert(a_Callback.GetAddr() && "Null callback"); - - const funmap_type *pFunMap = &a_Storage; - - // Check for conflicting operator or function names - if (pFunMap != &m_FunDef && m_FunDef.find(a_strName) != m_FunDef.end()) - return Error(ecNAME_CONFLICT, -1, a_strName); - - if (pFunMap != &m_PostOprtDef && m_PostOprtDef.find(a_strName) != m_PostOprtDef.end()) - return Error(ecNAME_CONFLICT, -1, a_strName); - - if (pFunMap != &m_InfixOprtDef && pFunMap != &m_OprtDef && - m_InfixOprtDef.find(a_strName) != m_InfixOprtDef.end()) - return Error(ecNAME_CONFLICT, -1, a_strName); - - if (pFunMap != &m_InfixOprtDef && pFunMap != &m_OprtDef && - m_OprtDef.find(a_strName) != m_OprtDef.end()) - return Error(ecNAME_CONFLICT, -1, a_strName); - - OptionalError oerr = CheckOprt(a_strName, a_Callback, a_szCharSet); - if (oerr.has_error()) return oerr; - a_Storage[a_strName] = a_Callback; - ReInit(); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Check if a name contains invalid characters. - - \throw ParserException if the name contains invalid characters. -*/ -OptionalError ParserBase::CheckOprt(const string_type &a_sName, const ParserCallback &a_Callback, - const string_type &a_szCharSet) const { - if (!a_sName.length() || (a_sName.find_first_not_of(a_szCharSet) != string_type::npos) || - (a_sName[0] >= '0' && a_sName[0] <= '9')) { - switch (a_Callback.GetCode()) { - case cmOPRT_POSTFIX: - return Error(ecINVALID_POSTFIX_IDENT, -1, a_sName); - case cmOPRT_INFIX: - return Error(ecINVALID_INFIX_IDENT, -1, a_sName); - default: - return Error(ecINVALID_NAME, -1, a_sName); - } - } - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Check if a name contains invalid characters. - - \throw ParserException if the name contains invalid characters. -*/ -OptionalError ParserBase::CheckName(const string_type &a_sName, - const string_type &a_szCharSet) const { - if (!a_sName.length() || (a_sName.find_first_not_of(a_szCharSet) != string_type::npos) || - (a_sName[0] >= '0' && a_sName[0] <= '9')) { - return Error(ecINVALID_NAME); - } - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Set the formula. - \param a_strFormula Formula as string_type - \throw ParserException in case of syntax errors. - - Triggers first time calculation thus the creation of the bytecode and - scanning of used variables. -*/ -OptionalError ParserBase::SetExpr(const string_type &a_sExpr) { - // Check locale compatibility - std::locale loc; - if (m_pTokenReader->GetArgSep() == std::use_facet >(loc).decimal_point()) - return Error(ecLOCALE); - - // 20060222: Bugfix for Borland-Kylix: - // adding a space to the expression will keep Borlands KYLIX from going wild - // when calling tellg on a stringstream created from the expression after - // reading a value at the end of an expression. (mu::Parser::IsVal function) - // (tellg returns -1 otherwise causing the parser to ignore the value) - string_type sBuf(a_sExpr + _T(" ")); - m_pTokenReader->SetFormula(sBuf); - ReInit(); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Get the default symbols used for the built in operators. - \sa c_DefaultOprt -*/ -const char_type **ParserBase::GetOprtDef() const { return (const char_type **)(&c_DefaultOprt[0]); } - -//--------------------------------------------------------------------------- -/** \brief Define the set of valid characters to be used in names of - functions, variables, constants. -*/ -void ParserBase::DefineNameChars(const char_type *a_szCharset) { m_sNameChars = a_szCharset; } - -//--------------------------------------------------------------------------- -/** \brief Define the set of valid characters to be used in names of - binary operators and postfix operators. -*/ -void ParserBase::DefineOprtChars(const char_type *a_szCharset) { m_sOprtChars = a_szCharset; } - -//--------------------------------------------------------------------------- -/** \brief Define the set of valid characters to be used in names of - infix operators. -*/ -void ParserBase::DefineInfixOprtChars(const char_type *a_szCharset) { - m_sInfixOprtChars = a_szCharset; -} - -//--------------------------------------------------------------------------- -/** \brief Virtual function that defines the characters allowed in name identifiers. - \sa #ValidOprtChars, #ValidPrefixOprtChars -*/ -const char_type *ParserBase::ValidNameChars() const { - assert(m_sNameChars.size()); - return m_sNameChars.c_str(); -} - -//--------------------------------------------------------------------------- -/** \brief Virtual function that defines the characters allowed in operator definitions. - \sa #ValidNameChars, #ValidPrefixOprtChars -*/ -const char_type *ParserBase::ValidOprtChars() const { - assert(m_sOprtChars.size()); - return m_sOprtChars.c_str(); -} - -//--------------------------------------------------------------------------- -/** \brief Virtual function that defines the characters allowed in infix operator definitions. - \sa #ValidNameChars, #ValidOprtChars -*/ -const char_type *ParserBase::ValidInfixOprtChars() const { - assert(m_sInfixOprtChars.size()); - return m_sInfixOprtChars.c_str(); -} - -//--------------------------------------------------------------------------- -/** \brief Add a user defined operator. - \post Will reset the Parser to string parsing mode. -*/ -OptionalError ParserBase::DefinePostfixOprt(const string_type &a_sName, fun_type1 a_pFun) { - return AddCallback(a_sName, ParserCallback(a_pFun, prPOSTFIX, cmOPRT_POSTFIX), m_PostOprtDef, - ValidOprtChars()); -} - -//--------------------------------------------------------------------------- -/** \brief Initialize user defined functions. - - Calls the virtual functions InitFun(), InitConst() and InitOprt(). -*/ -void ParserBase::Init() { - InitCharSets(); - InitFun(); - InitConst(); - InitOprt(); -} - -//--------------------------------------------------------------------------- -/** \brief Add a user defined operator. - \post Will reset the Parser to string parsing mode. - \param [in] a_sName operator Identifier - \param [in] a_pFun Operator callback function - \param [in] a_iPrec Operator Precedence (default=prSIGN) - \sa EPrec -*/ -OptionalError ParserBase::DefineInfixOprt(const string_type &a_sName, fun_type1 a_pFun, - int a_iPrec) { - return AddCallback(a_sName, ParserCallback(a_pFun, a_iPrec, cmOPRT_INFIX), m_InfixOprtDef, - ValidInfixOprtChars()); -} - -//--------------------------------------------------------------------------- -/** \brief Define a binary operator. - \param [in] a_sName The identifier of the operator. - \param [in] a_pFun Pointer to the callback function. - \param [in] a_iPrec Precedence of the operator. - \param [in] a_eAssociativity The associativity of the operator. - - Adds a new Binary operator the the parser instance. -*/ -OptionalError ParserBase::DefineOprt(const string_type &a_sName, fun_type2 a_pFun, unsigned a_iPrec, - EOprtAssociativity a_eAssociativity) { - // Check for conflicts with built in operator names - for (int i = 0; m_bBuiltInOp && i < cmENDIF; ++i) - if (a_sName == string_type(c_DefaultOprt[i])) return Error(ecBUILTIN_OVERLOAD, -1, a_sName); - - return AddCallback(a_sName, ParserCallback(a_pFun, a_iPrec, a_eAssociativity), m_OprtDef, - ValidOprtChars()); -} - -//--------------------------------------------------------------------------- -/** \brief Define a new string constant. - \param [in] a_strName The name of the constant. - \param [in] a_strVal the value of the constant. -*/ -OptionalError ParserBase::DefineStrConst(const string_type &a_strName, - const string_type &a_strVal) { - // Test if a constant with that names already exists - if (m_StrVarDef.find(a_strName) != m_StrVarDef.end()) return Error(ecNAME_CONFLICT); - - OptionalError oerr = CheckName(a_strName, ValidNameChars()); - if (oerr.has_error()) return oerr; - - m_vStringVarBuf.push_back(a_strVal); // Store variable string in internal buffer - m_StrVarDef[a_strName] = m_vStringVarBuf.size() - 1; // bind buffer index to variable name - - ReInit(); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Add a user defined variable. - \param [in] a_sName the variable name - \param [in] a_pVar A pointer to the variable value. - \post Will reset the Parser to string parsing mode. - \throw ParserException in case the name contains invalid signs or a_pVar is NULL. -*/ -OptionalError ParserBase::DefineVar(const string_type &a_sName, value_type *a_pVar) { - assert(a_pVar != nullptr && "Null variable pointer"); - - // Test if a constant with that names already exists - if (m_ConstDef.find(a_sName) != m_ConstDef.end()) return Error(ecNAME_CONFLICT); - - OptionalError oerr = CheckName(a_sName, ValidNameChars()); - if (oerr.has_error()) return oerr; - - m_VarDef[a_sName] = a_pVar; - ReInit(); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Add a user defined constant. - \param [in] a_sName The name of the constant. - \param [in] a_fVal the value of the constant. - \post Will reset the Parser to string parsing mode. - \throw ParserException in case the name contains invalid signs. -*/ -OptionalError ParserBase::DefineConst(const string_type &a_sName, value_type a_fVal) { - OptionalError oerr = CheckName(a_sName, ValidNameChars()); - if (oerr.has_error()) return oerr; - m_ConstDef[a_sName] = a_fVal; - ReInit(); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Get operator priority. - \throw ParserException if a_Oprt is no operator code -*/ -int ParserBase::GetOprtPrecedence(const token_type &a_Tok) const { - switch (a_Tok.GetCode()) { - // built in operators - case cmEND: - return -5; - case cmARG_SEP: - return -4; - case cmASSIGN: - return -1; - case cmELSE: - case cmIF: - return 0; - case cmLAND: - return prLAND; - case cmLOR: - return prLOR; - case cmLT: - case cmGT: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - return prCMP; - case cmADD: - case cmSUB: - return prADD_SUB; - case cmMUL: - case cmDIV: - return prMUL_DIV; - case cmPOW: - return prPOW; - - // user defined binary operators - case cmOPRT_INFIX: - case cmOPRT_BIN: - return a_Tok.GetPri(); - default: - assert(0 && "Unexpected operator in muParser"); - return 999; - } -} - -//--------------------------------------------------------------------------- -/** \brief Get operator priority. - \throw ParserException if a_Oprt is no operator code -*/ -EOprtAssociativity ParserBase::GetOprtAssociativity(const token_type &a_Tok) const { - switch (a_Tok.GetCode()) { - case cmASSIGN: - case cmLAND: - case cmLOR: - case cmLT: - case cmGT: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - return oaLEFT; - case cmPOW: - return oaRIGHT; - case cmOPRT_BIN: - return a_Tok.GetAssociativity(); - default: - return oaNONE; - } -} - -//--------------------------------------------------------------------------- -/** \brief Retrieve the formula. */ -const string_type &ParserBase::GetExpr() const { return m_pTokenReader->GetExpr(); } - -//--------------------------------------------------------------------------- -/** \brief Execute a function that takes a single string argument. - \param a_FunTok Function token. - \throw exception_type If the function token is not a string function -*/ -OptionalError ParserBase::ApplyStrFunc(const token_type &a_FunTok, - const std::vector &a_vArg) const { - if (a_vArg.back().GetCode() != cmSTRING) - return Error(ecSTRING_EXPECTED, m_pTokenReader->GetPos(), a_FunTok.GetAsString()); - - token_type valTok; - generic_fun_type pFunc = a_FunTok.GetFuncAddr(); - assert(pFunc); - bool errored = false; - // Check function arguments; write dummy value into valtok to represent the result - switch (a_FunTok.GetArgCount()) { - case 0: - valTok.SetVal(1); - a_vArg[0].GetAsString(); - break; - case 1: - valTok.SetVal(1); - a_vArg[1].GetAsString(); - errored |= a_vArg[0].GetVal().has_error(); - break; - case 2: - valTok.SetVal(1); - a_vArg[2].GetAsString(); - errored |= a_vArg[1].GetVal().has_error(); - errored |= a_vArg[0].GetVal().has_error(); - break; - default: - assert(0 && "Unexpected arg count"); - } - if (errored) { - return Error(ecVAL_EXPECTED, m_pTokenReader->GetPos(), a_FunTok.GetAsString()); - } - - m_vRPN.AddStrFun(pFunc, a_FunTok.GetArgCount(), a_vArg.back().GetIdx()); - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Apply a function token. - \param iArgCount Number of Arguments actually gathered used only for multiarg functions. - \post The result is pushed to the value stack - \post The function token is removed from the stack - \return ParserError if Argument count does not match function requirements. -*/ -OptionalError ParserBase::ApplyFunc(ParserStack &a_stOpt, - ParserStack &a_stVal, int a_iArgCount) const { - assert(m_pTokenReader.get()); - - // Operator stack empty or does not contain tokens with callback functions - if (a_stOpt.empty() || a_stOpt.top().GetFuncAddr() == 0) return {}; - - token_type funTok = a_stOpt.pop(); - assert(funTok.GetFuncAddr()); - - // Binary operators must rely on their internal operator number - // since counting of operators relies on commas for function arguments - // binary operators do not have commas in their expression - int iArgCount = (funTok.GetCode() == cmOPRT_BIN) ? funTok.GetArgCount() : a_iArgCount; - - // determine how many parameters the function needs. To remember iArgCount includes the - // string parameter whilst GetArgCount() counts only numeric parameters. - int iArgRequired = funTok.GetArgCount() + ((funTok.GetType() == tpSTR) ? 1 : 0); - - // Thats the number of numerical parameters - int iArgNumerical = iArgCount - ((funTok.GetType() == tpSTR) ? 1 : 0); - - if (funTok.GetCode() == cmFUNC_STR && iArgCount - iArgNumerical > 1) - assert(0 && "muParser internal error"); - - if (funTok.GetArgCount() >= 0 && iArgCount > iArgRequired) - return Error(ecTOO_MANY_PARAMS, m_pTokenReader->GetPos() - 1, funTok.GetAsString()); - - if (funTok.GetCode() != cmOPRT_BIN && iArgCount < iArgRequired) - return Error(ecTOO_FEW_PARAMS, m_pTokenReader->GetPos() - 1, funTok.GetAsString()); - - if (funTok.GetCode() == cmFUNC_STR && iArgCount > iArgRequired) - return Error(ecTOO_MANY_PARAMS, m_pTokenReader->GetPos() - 1, funTok.GetAsString()); - - // Collect the numeric function arguments from the value stack and store them - // in a vector - std::vector stArg; - for (int i = 0; i < iArgNumerical; ++i) { - stArg.push_back(a_stVal.pop()); - if (stArg.back().GetType() == tpSTR && funTok.GetType() != tpSTR) - return Error(ecVAL_EXPECTED, m_pTokenReader->GetPos(), funTok.GetAsString()); - } - - switch (funTok.GetCode()) { - case cmFUNC_STR: { - stArg.push_back(a_stVal.pop()); - - if (stArg.back().GetType() == tpSTR && funTok.GetType() != tpSTR) - return Error(ecVAL_EXPECTED, m_pTokenReader->GetPos(), funTok.GetAsString()); - - OptionalError err = ApplyStrFunc(funTok, stArg); - if (err.has_error()) return err; - break; - } - - case cmOPRT_BIN: - case cmOPRT_POSTFIX: - case cmOPRT_INFIX: - case cmFUNC: - if (funTok.GetArgCount() == -1 && iArgCount == 0) - return Error(ecTOO_FEW_PARAMS, m_pTokenReader->GetPos(), funTok.GetAsString()); - - m_vRPN.AddFun(funTok.GetFuncAddr(), - (funTok.GetArgCount() == -1) ? -iArgNumerical : iArgNumerical); - break; - default: - assert(0 && "Unexpected function token"); - break; - } - - // Push dummy value representing the function result to the stack - token_type token; - token.SetVal(1); - a_stVal.push(token); - return {}; -} - -//--------------------------------------------------------------------------- -OptionalError ParserBase::ApplyIfElse(ParserStack &a_stOpt, - ParserStack &a_stVal) const { - // Check if there is an if Else clause to be calculated - while (a_stOpt.size() && a_stOpt.top().GetCode() == cmELSE) { - token_type opElse = a_stOpt.pop(); - assert(a_stOpt.size() > 0 && "Invalid if/else clause"); - - // Take the value associated with the else branch from the value stack - token_type vVal2 = a_stVal.pop(); - - assert(a_stOpt.size() > 0 && "Invalid if/else clause"); - assert(a_stVal.size() >= 2 && "Invalid if/else clause"); - - // it then else is a ternary operator Pop all three values from the value s - // tack and just return the right value - token_type vVal1 = a_stVal.pop(); - token_type vExpr = a_stVal.pop(); - - ValueOrError vExprValue = vExpr.GetVal(); - if (vExprValue.has_error()) return vExprValue.error(); - a_stVal.push((vExprValue.value() != 0) ? vVal1 : vVal2); - - token_type opIf = a_stOpt.pop(); - assert(opElse.GetCode() == cmELSE && "Invalid if/else clause"); - assert(opIf.GetCode() == cmIF && "Invalid if/else clause"); - - m_vRPN.AddIfElse(cmENDIF); - } // while pending if-else-clause found - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Performs the necessary steps to write code for - the execution of binary operators into the bytecode. -*/ -OptionalError ParserBase::ApplyBinOprt(ParserStack &a_stOpt, - ParserStack &a_stVal) const { - // is it a user defined binary operator? - if (a_stOpt.top().GetCode() == cmOPRT_BIN) { - return ApplyFunc(a_stOpt, a_stVal, 2); - } else { - assert(a_stVal.size() >= 2 && "Too few arguments for binary operator"); - token_type valTok1 = a_stVal.pop(), valTok2 = a_stVal.pop(), optTok = a_stOpt.pop(), resTok; - - if (valTok1.GetType() != valTok2.GetType() || - (valTok1.GetType() == tpSTR && valTok2.GetType() == tpSTR)) - return Error(ecOPRT_TYPE_CONFLICT, m_pTokenReader->GetPos(), optTok.GetAsString()); - - if (optTok.GetCode() == cmASSIGN) { - if (valTok2.GetCode() != cmVAR) return Error(ecUNEXPECTED_OPERATOR, -1, _T("=")); - - m_vRPN.AddAssignOp(valTok2.GetVar()); - } else - m_vRPN.AddOp(optTok.GetCode()); - - resTok.SetVal(1); - a_stVal.push(resTok); - } - return {}; -} - -//--------------------------------------------------------------------------- -/** \brief Apply a binary operator. - \param a_stOpt The operator stack - \param a_stVal The value stack -*/ -OptionalError ParserBase::ApplyRemainingOprt(ParserStack &stOpt, - ParserStack &stVal) const { - while (stOpt.size() && stOpt.top().GetCode() != cmBO && stOpt.top().GetCode() != cmIF) { - OptionalError oerr; - token_type tok = stOpt.top(); - switch (tok.GetCode()) { - case cmOPRT_INFIX: - case cmOPRT_BIN: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmLT: - case cmGT: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmLAND: - case cmLOR: - case cmASSIGN: - if (stOpt.top().GetCode() == cmOPRT_INFIX) - oerr = ApplyFunc(stOpt, stVal, 1); - else - oerr = ApplyBinOprt(stOpt, stVal); - break; - - case cmELSE: - oerr = ApplyIfElse(stOpt, stVal); - break; - - default: - assert(0 && "muParser internal error"); - } - if (oerr.has_error()) return oerr.error(); - } - return {}; -} - -/// Invoke the function \p func as the fun_typeN given argCount, passing in \p argCount arguments -/// starting at \p args. -ValueOrError ParserBase::InvokeFunction(generic_fun_type func, const value_type *args, - int argCount) const { - assert(0 <= argCount && argCount <= 10 && "Invalid arg count"); - switch (argCount) { - case 0: - return ((fun_type0)func)(); - case 1: - return ((fun_type1)func)(args[0]); - case 2: - return ((fun_type2)func)(args[0], args[1]); - case 3: - return ((fun_type3)func)(args[0], args[1], args[2]); - default: - // Unreachable. - assert(0 && "Internal error"); - return 0; - } -} - -//--------------------------------------------------------------------------- -/** \brief Execute the RPN. - - Command code contains precalculated stack positions of the values and the - associated operators. The Stack is filled beginning from index one the - value at index zero is not used at all. -*/ -ValueOrError ParserBase::ExecuteRPN() const { - assert(! m_vRPN.empty() && "Missing RPN"); - value_type *Stack = &m_vStackBuffer[0]; - int sidx(0); - for (const SToken *pTok = m_vRPN.GetBase(); pTok->Cmd != cmEND; ++pTok) { - switch (pTok->Cmd) { - // built in binary operators - case cmLE: - --sidx; - Stack[sidx] = Stack[sidx] <= Stack[sidx + 1]; - continue; - case cmGE: - --sidx; - Stack[sidx] = Stack[sidx] >= Stack[sidx + 1]; - continue; - case cmNEQ: - --sidx; - Stack[sidx] = Stack[sidx] != Stack[sidx + 1]; - continue; - case cmEQ: - --sidx; - Stack[sidx] = Stack[sidx] == Stack[sidx + 1]; - continue; - case cmLT: - --sidx; - Stack[sidx] = Stack[sidx] < Stack[sidx + 1]; - continue; - case cmGT: - --sidx; - Stack[sidx] = Stack[sidx] > Stack[sidx + 1]; - continue; - case cmADD: - --sidx; - Stack[sidx] += Stack[1 + sidx]; - continue; - case cmSUB: - --sidx; - Stack[sidx] -= Stack[1 + sidx]; - continue; - case cmMUL: - --sidx; - Stack[sidx] *= Stack[1 + sidx]; - continue; - case cmDIV: - --sidx; - -#if defined(MUP_MATH_EXCEPTIONS) - if (Stack[1 + sidx] == 0) Error(ecDIV_BY_ZERO); -#endif - Stack[sidx] /= Stack[1 + sidx]; - continue; - - case cmPOW: - --sidx; - Stack[sidx] = std::pow(Stack[sidx], Stack[1 + sidx]); - continue; - - case cmLAND: - --sidx; - Stack[sidx] = Stack[sidx] && Stack[sidx + 1]; - continue; - case cmLOR: - --sidx; - Stack[sidx] = Stack[sidx] || Stack[sidx + 1]; - continue; - - case cmASSIGN: - // Bugfix for Bulkmode: - // for details see: - // https://groups.google.com/forum/embed/?place=forum/muparser-dev&showsearch=true&showpopout=true&showtabs=false&parenturl=http://muparser.beltoforion.de/mup_forum.html&afterlogin&pli=1#!topic/muparser-dev/szgatgoHTws - --sidx; - Stack[sidx] = *(pTok->Oprt.ptr) = Stack[sidx + 1]; - continue; - // original code: - //--sidx; Stack[sidx] = *pTok->Oprt.ptr = Stack[sidx+1]; continue; - - // case cmBO: // unused, listed for compiler optimization purposes - // case cmBC: - // MUP_FAIL(INVALID_CODE_IN_BYTECODE); - // continue; - - case cmIF: - if (Stack[sidx--] == 0) pTok += pTok->Oprt.offset; - continue; - - case cmELSE: - pTok += pTok->Oprt.offset; - continue; - - case cmENDIF: - continue; - - // case cmARG_SEP: - // MUP_FAIL(INVALID_CODE_IN_BYTECODE); - // continue; - - // value and variable tokens - case cmVAR: - Stack[++sidx] = *(pTok->Val.ptr); - continue; - case cmVAL: - Stack[++sidx] = pTok->Val.data; - continue; - - // Next is treatment of numeric functions - case cmFUNC: { - int iArgCount = pTok->Fun.argc; - ValueOrError funcResult{0.0}; - if (iArgCount >= 0) { - sidx -= iArgCount - 1; - funcResult = InvokeFunction(pTok->Fun.ptr, &Stack[sidx], iArgCount); - } else { - // function with variable arguments store the number as a negative value - sidx -= -iArgCount - 1; - funcResult = ((multfun_type)pTok->Fun.ptr)(&Stack[sidx], -iArgCount); - } - if (!funcResult) return funcResult; - Stack[sidx] = *funcResult; - continue; - } - - // Next is treatment of string functions - case cmFUNC_STR: { - sidx -= pTok->Fun.argc - 1; - - // The index of the string argument in the string table - int iIdxStack = pTok->Fun.idx; - assert(iIdxStack >= 0 && iIdxStack < (int)m_vStringBuf.size() && - "Invalid string index"); - ValueOrError funcResult{0.0}; - switch (pTok->Fun.argc) // switch according to argument count - { - case 0: - funcResult = ((strfun_type1)pTok->Fun.ptr)(m_vStringBuf[iIdxStack].c_str()); - break; - case 1: - funcResult = ((strfun_type2)pTok->Fun.ptr)(m_vStringBuf[iIdxStack].c_str(), - Stack[sidx]); - break; - case 2: - funcResult = ((strfun_type3)pTok->Fun.ptr)(m_vStringBuf[iIdxStack].c_str(), - Stack[sidx], Stack[sidx + 1]); - break; - } - if (!funcResult) return funcResult; - Stack[sidx] = *funcResult; - continue; - } - - default: - assert(0 && "muParser internal error"); - return 0; - } // switch CmdCode - } // for all bytecode tokens - - return Stack[m_nFinalResultIdx]; -} - -//--------------------------------------------------------------------------- -OptionalError ParserBase::CreateRPN() const { - if (!m_pTokenReader->GetExpr().length()) return ParserError(ecUNEXPECTED_EOF, 0); - int ifElseCounter = 0; - - ParserStack stOpt, stVal; - ParserStack stArgCount; - token_type opta, opt; // for storing operators - token_type val, tval; // for storing value - - ReInit(); - - // The outermost counter counts the number of separated items - // such as in "a=10,b=20,c=c+a" - stArgCount.push(1); - - for (;;) { - opt = m_pTokenReader->ReadNextToken(); - OptionalError oerr = m_pTokenReader->acquireFirstError(); - if (oerr.has_error()) return oerr; - - switch (opt.GetCode()) { - // - // Next three are different kind of value entries - // - case cmSTRING: - opt.SetIdx((int)m_vStringBuf.size()); // Assign buffer index to token - stVal.push(opt); - m_vStringBuf.push_back(opt.GetAsString()); // Store string in internal buffer - break; - - case cmVAR: - stVal.push(opt); - m_vRPN.AddVar(static_cast(opt.GetVar())); - break; - - case cmVAL: { - stVal.push(opt); - ValueOrError optVal = opt.GetVal(); - if (optVal.has_error()) return optVal.error(); - m_vRPN.AddVal(optVal.value()); - break; - } - - case cmELSE: - ifElseCounter--; - if (ifElseCounter < 0) return Error(ecMISPLACED_COLON, m_pTokenReader->GetPos()); - - oerr = ApplyRemainingOprt(stOpt, stVal); - if (oerr.has_error()) return oerr.error(); - m_vRPN.AddIfElse(cmELSE); - stOpt.push(opt); - break; - - case cmARG_SEP: - if (stArgCount.empty()) - return Error(ecUNEXPECTED_ARG_SEP, m_pTokenReader->GetPos()); - ++stArgCount.top(); - // fallthrough intentional (no break!) - - case cmEND: - oerr = ApplyRemainingOprt(stOpt, stVal); - if (oerr.has_error()) return oerr.error(); - break; - - case cmBC: { - // The argument count for parameterless functions is zero - // by default an opening bracket sets parameter count to 1 - // in preparation of arguments to come. If the last token - // was an opening bracket we know better... - if (opta.GetCode() == cmBO) --stArgCount.top(); - - oerr = ApplyRemainingOprt(stOpt, stVal); - if (oerr.has_error()) return oerr.error(); - - // Check if the bracket content has been evaluated completely - if (stOpt.size() && stOpt.top().GetCode() == cmBO) { - // if opt is ")" and opta is "(" the bracket has been evaluated, now its time to - // check - // if there is either a function or a sign pending - // neither the opening nor the closing bracket will be pushed back to - // the operator stack - // Check if a function is standing in front of the opening bracket, - // if yes evaluate it afterwards check for infix operators - assert(stArgCount.size()); - int iArgCount = stArgCount.pop(); - - stOpt.pop(); // Take opening bracket from stack - - if (iArgCount > 1 && - (stOpt.size() == 0 || - (stOpt.top().GetCode() != cmFUNC && stOpt.top().GetCode() != cmFUNC_STR))) - return Error(ecUNEXPECTED_ARG, m_pTokenReader->GetPos()); - - // The opening bracket was popped from the stack now check if there - // was a function before this bracket - if (stOpt.size() && stOpt.top().GetCode() != cmOPRT_INFIX && - stOpt.top().GetCode() != cmOPRT_BIN && stOpt.top().GetFuncAddr() != 0) { - OptionalError err = ApplyFunc(stOpt, stVal, iArgCount); - if (err.has_error()) return err.error(); - } - } - } // if bracket content is evaluated - break; - - // - // Next are the binary operator entries - // - // case cmAND: // built in binary operators - // case cmOR: - // case cmXOR: - case cmIF: - ifElseCounter++; - // fallthrough intentional (no break!) - - case cmLAND: - case cmLOR: - case cmLT: - case cmGT: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmASSIGN: - case cmOPRT_BIN: - - // A binary operator (user defined or built in) has been found. - while (stOpt.size() && stOpt.top().GetCode() != cmBO && - stOpt.top().GetCode() != cmELSE && stOpt.top().GetCode() != cmIF) { - int nPrec1 = GetOprtPrecedence(stOpt.top()), nPrec2 = GetOprtPrecedence(opt); - - if (stOpt.top().GetCode() == opt.GetCode()) { - // Deal with operator associativity - EOprtAssociativity eOprtAsct = GetOprtAssociativity(opt); - if ((eOprtAsct == oaRIGHT && (nPrec1 <= nPrec2)) || - (eOprtAsct == oaLEFT && (nPrec1 < nPrec2))) { - break; - } - } else if (nPrec1 < nPrec2) { - // In case the operators are not equal the precedence decides alone... - break; - } - - OptionalError oerr; - if (stOpt.top().GetCode() == cmOPRT_INFIX) - oerr = ApplyFunc(stOpt, stVal, 1); - else - oerr = ApplyBinOprt(stOpt, stVal); - if (oerr.has_error()) { - return oerr.error(); - } - } // while ( ... ) - - if (opt.GetCode() == cmIF) m_vRPN.AddIfElse(opt.GetCode()); - - // The operator can't be evaluated right now, push back to the operator stack - stOpt.push(opt); - break; - - // - // Last section contains functions and operators implicitly mapped to functions - // - case cmBO: - stArgCount.push(1); - stOpt.push(opt); - break; - - case cmOPRT_INFIX: - case cmFUNC: - case cmFUNC_STR: - stOpt.push(opt); - break; - - case cmOPRT_POSTFIX: { - stOpt.push(opt); - OptionalError oerr = ApplyFunc(stOpt, stVal, 1); // this is the postfix operator - if (oerr.has_error()) return oerr.error(); - break; - } - - default: - assert(0 && "muParser internal error"); - } // end of switch operator-token - - opta = opt; - - if (opt.GetCode() == cmEND) { - m_vRPN.Finalize(); - break; - } - - if (ParserBase::g_DbgDumpStack) { - StackDump(stVal, stOpt); - m_vRPN.AsciiDump(); - } - } // while (true) - - if (ParserBase::g_DbgDumpCmdCode) m_vRPN.AsciiDump(); - - if (ifElseCounter > 0) return Error(ecMISSING_ELSE_CLAUSE); - - // get the last value (= final result) from the stack - assert(stArgCount.size() == 1 && "Expected arg count of 1"); - m_nFinalResultIdx = stArgCount.top(); - if (m_nFinalResultIdx == 0) assert(0 && "muParser internal error"); - - if (stVal.size() == 0) return Error(ecEMPTY_EXPRESSION); - - if (stVal.top().GetType() != tpDBL) return Error(ecSTR_RESULT); - - m_vStackBuffer.resize(m_vRPN.GetMaxStackSize()); - return {}; -} - -ValueOrError ParserBase::BuildAndExecuteRPN() const { - if (m_vRPN.empty()) { - OptionalError oerr = CreateRPN(); - if (oerr.has_error()) return oerr.error(); - assert(! m_vRPN.empty() && "RPN should no longer be empty"); - } - return ExecuteRPN(); -} - -//--------------------------------------------------------------------------- -/** \brief Create an error containing the parse error position. - - This function will create an Parser Exception object containing the error text and - its position. - - \param a_iErrc [in] The error code of type #EErrorCodes. - \param a_iPos [in] The position where the error was detected. - \param a_strTok [in] The token string representation associated with the error. -*/ -ParserError ParserBase::Error(EErrorCodes a_iErrc, int a_iPos, const string_type &a_sTok) const { - return ParserError(a_iErrc, a_sTok, a_iPos); -} - -//------------------------------------------------------------------------------ -/** \brief Remove a variable from internal storage. - - Removes a variable if it exists. If the Variable does not exist nothing will be done. -*/ -void ParserBase::RemoveVar(const string_type &a_strVarName) { - varmap_type::iterator item = m_VarDef.find(a_strVarName); - if (item != m_VarDef.end()) { - m_VarDef.erase(item); - ReInit(); - } -} - -//------------------------------------------------------------------------------ -/** \brief Clear all user defined constants. - - Both numeric and string constants will be removed from the internal storage. - \post Resets the parser to string parsing mode. -*/ -void ParserBase::ClearConst() { - m_ConstDef.clear(); - m_StrVarDef.clear(); - ReInit(); -} - -//------------------------------------------------------------------------------ -/** \brief Clear all user defined postfix operators. - \post Resets the parser to string parsing mode. -*/ -void ParserBase::ClearPostfixOprt() { - m_PostOprtDef.clear(); - ReInit(); -} - -//--------------------------------------------------------------------------- -/** \brief Enable the dumping of bytecode and stack content on the console. - \param bDumpCmd Flag to enable dumping of the current bytecode to the console. - \param bDumpStack Flag to enable dumping of the stack content is written to the console. - - This function is for debug purposes only! -*/ -void ParserBase::EnableDebugDump(bool bDumpCmd, bool bDumpStack) { - ParserBase::g_DbgDumpCmdCode = bDumpCmd; - ParserBase::g_DbgDumpStack = bDumpStack; -} - -//------------------------------------------------------------------------------ -/** \brief Enable or disable the built in binary operators. - \sa m_bBuiltInOp, ReInit() - - If you disable the built in binary operators there will be no binary operators - defined. Thus you must add them manually one by one. It is not possible to - disable built in operators selectively. This function will Reinitialize the - parser by calling ReInit(). -*/ -void ParserBase::EnableBuiltInOprt(bool a_bIsOn) { - m_bBuiltInOp = a_bIsOn; - ReInit(); -} - -//------------------------------------------------------------------------------ -/** \brief Query status of built in variables. - \return #m_bBuiltInOp; true if built in operators are enabled. -*/ -bool ParserBase::HasBuiltInOprt() const { return m_bBuiltInOp; } - -//------------------------------------------------------------------------------ -/** \brief Get the argument separator character. -*/ -char_type ParserBase::GetArgSep() const { return m_pTokenReader->GetArgSep(); } - -//------------------------------------------------------------------------------ -/** \brief Set argument separator. - \param cArgSep the argument separator character. -*/ -void ParserBase::SetArgSep(char_type cArgSep) { m_pTokenReader->SetArgSep(cArgSep); } - -//------------------------------------------------------------------------------ -/** \brief Dump stack content. - - This function is used for debugging only. -*/ -void ParserBase::StackDump(const ParserStack &a_stVal, - const ParserStack &a_stOprt) const { - ParserStack stOprt(a_stOprt), stVal(a_stVal); - - mu::console() << _T("\nValue stack:\n"); - while (!stVal.empty()) { - token_type val = stVal.pop(); - if (val.GetType() == tpSTR) - mu::console() << _T(" \"") << val.GetAsString() << _T("\" "); - else - mu::console() << _T(" ") << val.GetVal().value() << _T(" "); - } - mu::console() << "\nOperator stack:\n"; - - while (!stOprt.empty()) { - if (stOprt.top().GetCode() <= cmASSIGN) { - mu::console() << _T("OPRT_INTRNL \"") - << ParserBase::c_DefaultOprt[stOprt.top().GetCode()] << _T("\" \n"); - } else { - switch (stOprt.top().GetCode()) { - case cmVAR: - mu::console() << _T("VAR\n"); - break; - case cmVAL: - mu::console() << _T("VAL\n"); - break; - case cmFUNC: - mu::console() << _T("FUNC \"") << stOprt.top().GetAsString() << _T("\"\n"); - break; - case cmOPRT_INFIX: - mu::console() << _T("OPRT_INFIX \"") << stOprt.top().GetAsString() - << _T("\"\n"); - break; - case cmOPRT_BIN: - mu::console() << _T("OPRT_BIN \"") << stOprt.top().GetAsString() << _T("\"\n"); - break; - case cmFUNC_STR: - mu::console() << _T("FUNC_STR\n"); - break; - case cmEND: - mu::console() << _T("END\n"); - break; - case cmUNKNOWN: - mu::console() << _T("UNKNOWN\n"); - break; - case cmBO: - mu::console() << _T("BRACKET \"(\"\n"); - break; - case cmBC: - mu::console() << _T("BRACKET \")\"\n"); - break; - case cmIF: - mu::console() << _T("IF\n"); - break; - case cmELSE: - mu::console() << _T("ELSE\n"); - break; - case cmENDIF: - mu::console() << _T("ENDIF\n"); - break; - default: - mu::console() << stOprt.top().GetCode() << _T(" "); - break; - } - } - stOprt.pop(); - } - - mu::console() << dec << endl; -} - -//------------------------------------------------------------------------------ -/** \brief Evaluate an expression containing comma separated subexpressions - \param [out] nStackSize The total number of results available - \return Pointer to the array containing all expression results - - This member function can be used to retrieve all results of an expression - made up of multiple comma separated subexpressions (i.e. "x+y,sin(x),cos(y)") -*/ -void ParserBase::Eval(std::vector *outResult) const { - ValueOrError v = BuildAndExecuteRPN(); - if (v.has_error()) { - outResult->push_back(std::move(v)); - return; - } - int stackSize = m_nFinalResultIdx; - - // (for historic reasons the stack starts at position 1) - outResult->assign(&m_vStackBuffer[1], &m_vStackBuffer[1 + stackSize]); -} - -//--------------------------------------------------------------------------- -/** \brief Return the number of results on the calculation stack. - - If the expression contains comma separated subexpressions (i.e. "sin(y), x+y"). - There may be more than one return value. This function returns the number of - available results. -*/ -int ParserBase::GetNumResults() const { return m_nFinalResultIdx; } - -//--------------------------------------------------------------------------- -/** \brief Calculate the result. - - A note on const correctness: - I consider it important that Calc is a const function. - Due to caching operations Calc changes only the state of internal variables with one exception - m_UsedVar this is reset during string parsing and accessible from the outside. - - \pre A formula must be set. - \pre Variables must have been set (if needed) - - \sa #m_pParseFormula - \return The evaluation result - \throw ParseException if no Formula is set or in case of any other error related to the formula. -*/ -ValueOrError ParserBase::Eval() const { return BuildAndExecuteRPN(); } - -} // namespace mu diff --git a/muparser-2.2.5/src/muParserBytecode.cpp b/muparser-2.2.5/src/muParserBytecode.cpp deleted file mode 100644 index 92669acb1..000000000 --- a/muparser-2.2.5/src/muParserBytecode.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#include "muParserBytecode.h" - -#include -#include -#include -#include -#include -#include - -#include "muParserDef.h" -#include "muParserToken.h" - -namespace mu { -//--------------------------------------------------------------------------- -/** \brief Bytecode default constructor. */ -ParserByteCode::ParserByteCode() : m_iStackPos(0), m_iMaxStackSize(0), m_vRPN() { - m_vRPN.reserve(50); -} - -//--------------------------------------------------------------------------- -/** \brief Add a Variable pointer to bytecode. - \param a_pVar Pointer to be added. -*/ -void ParserByteCode::AddVar(value_type *a_pVar) { - ++m_iStackPos; - m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); - - SToken tok; - tok.Cmd = cmVAR; - tok.Val.ptr = a_pVar; - tok.Val.data = 0; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -/** \brief Add a Variable pointer to bytecode. - - Value entries in byte code consist of: -
    -
  • value array position of the value
  • -
  • the operator code according to ParserToken::cmVAL
  • -
  • the value stored in #mc_iSizeVal number of bytecode entries.
  • -
- - \param a_pVal Value to be added. -*/ -void ParserByteCode::AddVal(value_type a_fVal) { - ++m_iStackPos; - m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); - - // If optimization does not apply - SToken tok; - tok.Cmd = cmVAL; - tok.Val.ptr = NULL; - tok.Val.data = a_fVal; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -/** \brief Add an operator identifier to bytecode. - - Operator entries in byte code consist of: -
    -
  • value array position of the result
  • -
  • the operator code according to ParserToken::ECmdCode
  • -
- - \sa ParserToken::ECmdCode -*/ -void ParserByteCode::AddOp(ECmdCode a_Oprt) { - --m_iStackPos; - SToken tok; - tok.Cmd = a_Oprt; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -void ParserByteCode::AddIfElse(ECmdCode a_Oprt) { - SToken tok; - tok.Cmd = a_Oprt; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -/** \brief Add an assignment operator - - Operator entries in byte code consist of: -
    -
  • cmASSIGN code
  • -
  • the pointer of the destination variable
  • -
- - \sa ParserToken::ECmdCode -*/ -void ParserByteCode::AddAssignOp(value_type *a_pVar) { - --m_iStackPos; - - SToken tok; - tok.Cmd = cmASSIGN; - tok.Oprt.ptr = a_pVar; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -/** \brief Add function to bytecode. - - \param a_iArgc Number of arguments, negative numbers indicate multiarg functions. - \param a_pFun Pointer to function callback. -*/ -void ParserByteCode::AddFun(generic_fun_type a_pFun, int a_iArgc) { - if (a_iArgc >= 0) { - m_iStackPos = m_iStackPos - a_iArgc + 1; - } else { - // function with unlimited number of arguments - m_iStackPos = m_iStackPos + a_iArgc + 1; - } - m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); - - SToken tok; - tok.Cmd = cmFUNC; - tok.Fun.argc = a_iArgc; - tok.Fun.ptr = a_pFun; - m_vRPN.push_back(tok); -} - -//--------------------------------------------------------------------------- -/** \brief Add String function entry to the parser bytecode. - - A string function entry consists of the stack position of the return value, - followed by a cmSTRFUNC code, the function pointer and an index into the - string buffer maintained by the parser. -*/ -void ParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx) { - m_iStackPos = m_iStackPos - a_iArgc + 1; - - SToken tok; - tok.Cmd = cmFUNC_STR; - tok.Fun.argc = a_iArgc; - tok.Fun.idx = a_iIdx; - tok.Fun.ptr = a_pFun; - m_vRPN.push_back(tok); - - m_iMaxStackSize = std::max(m_iMaxStackSize, (size_t)m_iStackPos); -} - -//--------------------------------------------------------------------------- -/** \brief Add end marker to bytecode. -*/ -void ParserByteCode::Finalize() { - SToken tok; - tok.Cmd = cmEND; - m_vRPN.push_back(tok); - m_vRPN.shrink_to_fit(); - - // Determine the if-then-else jump offsets - ParserStack stIf, stElse; - for (int i = 0; i < (int)m_vRPN.size(); ++i) { - switch (m_vRPN[i].Cmd) { - case cmIF: - stIf.push_back(i); - break; - - case cmELSE: { - int idx = stIf.back(); - stIf.pop_back(); - m_vRPN[idx].Oprt.offset = i - idx; - stElse.push_back(i); - break; - } - - case cmENDIF: { - int idx = stElse.back(); - stElse.pop_back(); - m_vRPN[idx].Oprt.offset = i - idx; - break; - } - - default: - break; - } - } -} - -//--------------------------------------------------------------------------- -const SToken *ParserByteCode::GetBase() const { - if (m_vRPN.size() == 0) assert(0 && "muParser internal error"); - return &m_vRPN[0]; -} - -//--------------------------------------------------------------------------- -std::size_t ParserByteCode::GetMaxStackSize() const { return m_iMaxStackSize + 1; } - -//--------------------------------------------------------------------------- -/** \brief Returns the number of entries in the bytecode. */ -std::size_t ParserByteCode::GetSize() const { return m_vRPN.size(); } - -//--------------------------------------------------------------------------- -/** \brief Delete the bytecode. - - The name of this function is a violation of my own coding guidelines - but this way it's more in line with the STL functions thus more - intuitive. -*/ -void ParserByteCode::clear() { - m_vRPN.clear(); - m_iStackPos = 0; - m_iMaxStackSize = 0; -} - -//--------------------------------------------------------------------------- -/** \brief Dump bytecode (for debugging only!). */ -void ParserByteCode::AsciiDump() { - if (!m_vRPN.size()) { - mu::console() << _T("No bytecode available\n"); - return; - } - - mu::console() << _T("Number of RPN tokens:") << (int)m_vRPN.size() << _T("\n"); - for (std::size_t i = 0; i < m_vRPN.size() && m_vRPN[i].Cmd != cmEND; ++i) { - mu::console() << std::dec << i << _T(" : \t"); - switch (m_vRPN[i].Cmd) { - case cmVAL: - mu::console() << _T("VAL \t"); - mu::console() << _T("[") << m_vRPN[i].Val.data << _T("]\n"); - break; - - case cmVAR: - mu::console() << _T("VAR \t"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]\n"); - break; - - case cmFUNC: - mu::console() << _T("CALL\t"); - mu::console() << _T("[ARG:") << std::dec << m_vRPN[i].Fun.argc << _T("]"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Fun.ptr << _T("]"); - mu::console() << _T("\n"); - break; - - case cmFUNC_STR: - mu::console() << _T("CALL STRFUNC\t"); - mu::console() << _T("[ARG:") << std::dec << m_vRPN[i].Fun.argc << _T("]"); - mu::console() << _T("[IDX:") << std::dec << m_vRPN[i].Fun.idx << _T("]"); - mu::console() << _T("[ADDR: 0x") << m_vRPN[i].Fun.ptr << _T("]\n"); - break; - - case cmLT: - mu::console() << _T("LT\n"); - break; - case cmGT: - mu::console() << _T("GT\n"); - break; - case cmLE: - mu::console() << _T("LE\n"); - break; - case cmGE: - mu::console() << _T("GE\n"); - break; - case cmEQ: - mu::console() << _T("EQ\n"); - break; - case cmNEQ: - mu::console() << _T("NEQ\n"); - break; - case cmADD: - mu::console() << _T("ADD\n"); - break; - case cmLAND: - mu::console() << _T("&&\n"); - break; - case cmLOR: - mu::console() << _T("||\n"); - break; - case cmSUB: - mu::console() << _T("SUB\n"); - break; - case cmMUL: - mu::console() << _T("MUL\n"); - break; - case cmDIV: - mu::console() << _T("DIV\n"); - break; - case cmPOW: - mu::console() << _T("POW\n"); - break; - - case cmIF: - mu::console() << _T("IF\t"); - mu::console() << _T("[OFFSET:") << std::dec << m_vRPN[i].Oprt.offset << _T("]\n"); - break; - - case cmELSE: - mu::console() << _T("ELSE\t"); - mu::console() << _T("[OFFSET:") << std::dec << m_vRPN[i].Oprt.offset << _T("]\n"); - break; - - case cmENDIF: - mu::console() << _T("ENDIF\n"); - break; - - case cmASSIGN: - mu::console() << _T("ASSIGN\t"); - mu::console() << _T("[ADDR: 0x") << m_vRPN[i].Oprt.ptr << _T("]\n"); - break; - - default: - mu::console() << _T("(unknown code: ") << m_vRPN[i].Cmd << _T(")\n"); - break; - } // switch cmdCode - } // while bytecode - - mu::console() << _T("END") << std::endl; -} -} // namespace mu diff --git a/muparser-2.2.5/src/muParserCallback.cpp b/muparser-2.2.5/src/muParserCallback.cpp deleted file mode 100644 index ab06b4c17..000000000 --- a/muparser-2.2.5/src/muParserCallback.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2004-2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#include "muParserCallback.h" - -/** \file - \brief Implementation of the parser callback class. -*/ - -namespace mu { -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(fun_type0 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(0), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(fun_type1 a_pFun, int a_iPrec, ECmdCode a_iCode) - : m_pFun((void*)a_pFun), - m_iArgc(1), - m_iPri(a_iPrec), - m_eOprtAsct(oaNONE), - m_iCode(a_iCode), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -/** \brief Constructor for constructing function callbacks taking two arguments. -*/ -ParserCallback::ParserCallback(fun_type2 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(2), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -/** \brief Constructor for constructing binary operator callbacks. - \param a_pFun Pointer to a static function taking two arguments - \param a_bAllowOpti A flag indicating this function can be optimized - \param a_iPrec The operator precedence - \param a_eOprtAsct The operators associativity -*/ -ParserCallback::ParserCallback(fun_type2 a_pFun, int a_iPrec, EOprtAssociativity a_eOprtAsct) - : m_pFun((void*)a_pFun), - m_iArgc(2), - m_iPri(a_iPrec), - m_eOprtAsct(a_eOprtAsct), - m_iCode(cmOPRT_BIN), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(fun_type3 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(3), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(multfun_type a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(-1), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC), - m_iType(tpDBL) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(strfun_type1 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(0), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC_STR), - m_iType(tpSTR) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(strfun_type2 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(1), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC_STR), - m_iType(tpSTR) {} - -//--------------------------------------------------------------------------- -ParserCallback::ParserCallback(strfun_type3 a_pFun) - : m_pFun((void*)a_pFun), - m_iArgc(2), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmFUNC_STR), - m_iType(tpSTR) {} - -//--------------------------------------------------------------------------- -/** \brief Default constructor. -*/ -ParserCallback::ParserCallback() - : m_pFun(0), - m_iArgc(0), - m_iPri(-1), - m_eOprtAsct(oaNONE), - m_iCode(cmUNKNOWN), - m_iType(tpVOID) {} - -//--------------------------------------------------------------------------- -/** \brief Copy constructor. -*/ -ParserCallback::ParserCallback(const ParserCallback& ref) = default; - -//--------------------------------------------------------------------------- -/** \brief Get the callback address for the parser function. - - The type of the address is void. It needs to be recasted according to the - argument number to the right type. - \return #pFun -*/ -void* ParserCallback::GetAddr() const { return m_pFun; } - -//--------------------------------------------------------------------------- -/** \brief Return the callback code. */ -ECmdCode ParserCallback::GetCode() const { return m_iCode; } - -//--------------------------------------------------------------------------- -ETypeCode ParserCallback::GetType() const { return m_iType; } - -//--------------------------------------------------------------------------- -/** \brief Return the operator precedence.n - - Only valid if the callback token is an operator token (binary or infix). -*/ -int ParserCallback::GetPri() const { return m_iPri; } - -//--------------------------------------------------------------------------- -/** \brief Return the operators associativity.n - - Only valid if the callback token is a binary operator token. -*/ -EOprtAssociativity ParserCallback::GetAssociativity() const { return m_eOprtAsct; } - -//--------------------------------------------------------------------------- -/** \brief Returns the number of function Arguments. */ -int ParserCallback::GetArgc() const { return m_iArgc; } -} // namespace mu diff --git a/muparser-2.2.5/src/muParserError.cpp b/muparser-2.2.5/src/muParserError.cpp deleted file mode 100644 index a2e05ecc6..000000000 --- a/muparser-2.2.5/src/muParserError.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#include "muParserDef.h" - -#include - -#include - -namespace mu { -//--------------------------------------------------------------------------- -string_type parser_error_for_code(EErrorCodes code) { - switch (code) { - case ecUNASSIGNABLE_TOKEN: - return _T("Unexpected token \"$TOK$\" found at position $POS$."); - case ecINVALID_NAME: - return _T("Invalid function-, variable- or constant name: \"$TOK$\"."); - case ecINVALID_BINOP_IDENT: - return _T("Invalid binary operator identifier: \"$TOK$\"."); - case ecINVALID_INFIX_IDENT: - return _T("Invalid infix operator identifier: \"$TOK$\"."); - case ecINVALID_POSTFIX_IDENT: - return _T("Invalid postfix operator identifier: \"$TOK$\"."); - case ecINVALID_FUN_PTR: - return _T("Invalid pointer to callback function."); - case ecEMPTY_EXPRESSION: - return _T("Expression is empty."); - case ecINVALID_VAR_PTR: - return _T("Invalid pointer to variable."); - case ecUNEXPECTED_OPERATOR: - return _T("Unexpected operator \"$TOK$\" found at position $POS$"); - case ecUNEXPECTED_EOF: - return _T("Unexpected end of expression at position $POS$"); - case ecUNEXPECTED_ARG_SEP: - return _T("Unexpected argument separator at position $POS$"); - case ecUNEXPECTED_PARENS: - return _T("Unexpected parenthesis \"$TOK$\" at position $POS$"); - case ecUNEXPECTED_FUN: - return _T("Unexpected function \"$TOK$\" at position $POS$"); - case ecUNEXPECTED_VAL: - return _T("Unexpected value \"$TOK$\" found at position $POS$"); - case ecUNEXPECTED_VAR: - return _T("Unexpected variable \"$TOK$\" found at position $POS$"); - case ecUNEXPECTED_ARG: - return _T("Function arguments used without a function (position: $POS$)"); - case ecMISSING_PARENS: - return _T("Missing parenthesis"); - case ecTOO_MANY_PARAMS: - return _T("Too many parameters for function \"$TOK$\" at expression position $POS$"); - case ecTOO_FEW_PARAMS: - return _T("Too few parameters for function \"$TOK$\" at expression position $POS$"); - case ecDIV_BY_ZERO: - return _T("Divide by zero"); - case ecDOMAIN_ERROR: - return _T("Domain error"); - case ecNAME_CONFLICT: - return _T("Name conflict"); - case ecOPT_PRI: - return _T("Invalid value for operator priority (must be greater or equal to zero)."); - case ecBUILTIN_OVERLOAD: - return _T("user defined binary operator \"$TOK$\" conflicts with a built in operator."); - case ecUNEXPECTED_STR: - return _T("Unexpected string token found at position $POS$."); - case ecUNTERMINATED_STRING: - return _T("Unterminated string starting at position $POS$."); - case ecSTRING_EXPECTED: - return _T("String function called with a non string type of argument."); - case ecVAL_EXPECTED: - return _T("String value used where a numerical argument is expected."); - case ecOPRT_TYPE_CONFLICT: - return _T("No suitable overload for operator \"$TOK$\" at position $POS$."); - case ecSTR_RESULT: - return _T("Function result is a string."); - case ecGENERIC: - return _T("Parser error."); - case ecLOCALE: - return _T("Decimal separator is identic to function argument separator."); - case ecUNEXPECTED_CONDITIONAL: - return _T("The \"$TOK$\" operator must be preceeded by a closing bracket."); - case ecMISSING_ELSE_CLAUSE: - return _T("If-then-else operator is missing an else clause"); - case ecMISPLACED_COLON: - return _T("Misplaced colon at position $POS$"); - case ecUNREASONABLE_NUMBER_OF_COMPUTATIONS: - return _T("Number of computations to small for bulk mode. (Vectorisation overhead too ") - _T("costly)"); - default: - assert(0 && "Invalid error code"); - return string_type(); - } -} - -//--------------------------------------------------------------------------- -// -// ParserError class -// -//--------------------------------------------------------------------------- - -/** \brief Default constructor. */ -ParserError::ParserError() {} - -//------------------------------------------------------------------------------ -/** \brief This Constructor is used for internal exceptions only. - - It does not contain any information but the error code. -*/ -ParserError::ParserError(EErrorCodes a_iErrc) : m_iErrc(a_iErrc) { - m_strMsg = parser_error_for_code(m_iErrc); - stringstream_type stream; - stream << (int)m_iPos; - ReplaceSubString(m_strMsg, _T("$POS$"), stream.str()); - ReplaceSubString(m_strMsg, _T("$TOK$"), m_strTok); -} - -//------------------------------------------------------------------------------ -/** \brief Construct an error from a message text. */ -ParserError::ParserError(const string_type &sMsg) { - Reset(); - m_strMsg = sMsg; -} - -//------------------------------------------------------------------------------ -/** \brief Construct an error object. - \param [in] a_iErrc the error code. - \param [in] sTok The token string related to this error. - \param [in] a_iPos the position in the expression where the error occurred. -*/ -ParserError::ParserError(EErrorCodes iErrc, string_type sTok, int iPos) - : m_strTok(std::move(sTok)), m_iPos(iPos), m_iErrc(iErrc) { - m_strMsg = parser_error_for_code(m_iErrc); - stringstream_type stream; - stream << (int)m_iPos; - ReplaceSubString(m_strMsg, _T("$POS$"), stream.str()); - ReplaceSubString(m_strMsg, _T("$TOK$"), m_strTok); -} - -//------------------------------------------------------------------------------ -/** \brief Construct an error object. - \param [in] iErrc the error code. - \param [in] iPos the position in the expression where the error occurred. - \param [in] sTok The token string related to this error. -*/ -ParserError::ParserError(EErrorCodes iErrc, int iPos, string_type sTok) - : m_strMsg(), m_strTok(std::move(sTok)), m_iPos(iPos), m_iErrc(iErrc) { - m_strMsg = parser_error_for_code(m_iErrc); - stringstream_type stream; - stream << (int)m_iPos; - ReplaceSubString(m_strMsg, _T("$POS$"), stream.str()); - ReplaceSubString(m_strMsg, _T("$TOK$"), m_strTok); -} - -//------------------------------------------------------------------------------ -/** \brief Construct an error object. - \param [in] szMsg The error message text. - \param [in] iPos the position related to the error. - \param [in] sTok The token string related to this error. -*/ -ParserError::ParserError(const char_type *szMsg, int iPos, string_type sTok) - : m_strMsg(szMsg), m_strTok(std::move(sTok)), m_iPos(iPos), m_iErrc(ecGENERIC) { - stringstream_type stream; - stream << (int)m_iPos; - ReplaceSubString(m_strMsg, _T("$POS$"), stream.str()); - ReplaceSubString(m_strMsg, _T("$TOK$"), m_strTok); -} - -//------------------------------------------------------------------------------ -ParserError::~ParserError() = default; - -//------------------------------------------------------------------------------ -/** \brief Replace all occurrences of a substring with another string. - \param strFind The string that shall be replaced. - \param strReplaceWith The string that should be inserted instead of strFind -*/ -void ParserError::ReplaceSubString(string_type &strSource, const string_type &strFind, - const string_type &strReplaceWith) { - string_type strResult; - string_type::size_type iPos(0), iNext(0); - - for (;;) { - iNext = strSource.find(strFind, iPos); - strResult.append(strSource, iPos, iNext - iPos); - - if (iNext == string_type::npos) break; - - strResult.append(strReplaceWith); - iPos = iNext + strFind.length(); - } - - strSource.swap(strResult); -} - -//------------------------------------------------------------------------------ -/** \brief Reset the erro object. */ -void ParserError::Reset() { - m_strMsg = _T(""); - m_strTok = _T(""); - m_iPos = -1; - m_iErrc = ecUNDEFINED; -} - -//------------------------------------------------------------------------------ -/** \brief Returns the message string for this error. */ -const string_type &ParserError::GetMsg() const { return m_strMsg; } - -//------------------------------------------------------------------------------ -/** \brief Return the formula position related to the error. - - If the error is not related to a distinct position this will return -1 -*/ -int ParserError::GetPos() const { return m_iPos; } - -//------------------------------------------------------------------------------ -/** \brief Return string related with this token (if available). */ -const string_type &ParserError::GetToken() const { return m_strTok; } - -//------------------------------------------------------------------------------ -/** \brief Return the error code. */ -EErrorCodes ParserError::GetCode() const { return m_iErrc; } -} // namespace mu diff --git a/muparser-2.2.5/src/muParserInt.cpp b/muparser-2.2.5/src/muParserInt.cpp deleted file mode 100644 index 2de24800d..000000000 --- a/muparser-2.2.5/src/muParserInt.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2011 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#include "muParserInt.h" - -#include -#include -#include - -using namespace std; - -/** \file - \brief Implementation of a parser using integer value. -*/ - -/** \brief Namespace for mathematical applications. */ -namespace mu { -ValueOrError ParserInt::Abs(value_type v) { return (value_type)Round(fabs((double)v)); } -ValueOrError ParserInt::Sign(value_type v) { return (Round(v) < 0) ? -1 : (Round(v) > 0) ? 1 : 0; } -ValueOrError ParserInt::Ite(value_type v1, value_type v2, value_type v3) { - return (Round(v1) == 1) ? Round(v2) : Round(v3); -} -ValueOrError ParserInt::Add(value_type v1, value_type v2) { return Round(v1) + Round(v2); } -ValueOrError ParserInt::Sub(value_type v1, value_type v2) { return Round(v1) - Round(v2); } -ValueOrError ParserInt::Mul(value_type v1, value_type v2) { return Round(v1) * Round(v2); } -ValueOrError ParserInt::Div(value_type v1, value_type v2) { return Round(v1) / Round(v2); } -ValueOrError ParserInt::Mod(value_type v1, value_type v2) { return Round(v1) % Round(v2); } -ValueOrError ParserInt::Shr(value_type v1, value_type v2) { return Round(v1) >> Round(v2); } -ValueOrError ParserInt::Shl(value_type v1, value_type v2) { return Round(v1) << Round(v2); } -ValueOrError ParserInt::LogAnd(value_type v1, value_type v2) { return Round(v1) & Round(v2); } -ValueOrError ParserInt::LogOr(value_type v1, value_type v2) { return Round(v1) | Round(v2); } -ValueOrError ParserInt::And(value_type v1, value_type v2) { return Round(v1) && Round(v2); } -ValueOrError ParserInt::Or(value_type v1, value_type v2) { return Round(v1) || Round(v2); } -ValueOrError ParserInt::Less(value_type v1, value_type v2) { return Round(v1) < Round(v2); } -ValueOrError ParserInt::Greater(value_type v1, value_type v2) { return Round(v1) > Round(v2); } -ValueOrError ParserInt::LessEq(value_type v1, value_type v2) { return Round(v1) <= Round(v2); } -ValueOrError ParserInt::GreaterEq(value_type v1, value_type v2) { return Round(v1) >= Round(v2); } -ValueOrError ParserInt::Equal(value_type v1, value_type v2) { return Round(v1) == Round(v2); } -ValueOrError ParserInt::NotEqual(value_type v1, value_type v2) { return Round(v1) != Round(v2); } -ValueOrError ParserInt::Not(value_type v) { return !Round(v); } - -ValueOrError ParserInt::Pow(value_type v1, value_type v2) { - return std::pow((double)Round(v1), (double)Round(v2)); -} - -//--------------------------------------------------------------------------- -// Unary operator Callbacks: Infix operators -ValueOrError ParserInt::UnaryMinus(value_type v) { return -Round(v); } - -//--------------------------------------------------------------------------- -ValueOrError ParserInt::Sum(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function sum.")); - - value_type fRes = 0; - for (int i = 0; i < a_iArgc; ++i) fRes += a_afArg[i]; - - return fRes; -} - -//--------------------------------------------------------------------------- -ValueOrError ParserInt::Min(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function min.")); - - value_type fRes = a_afArg[0]; - for (int i = 0; i < a_iArgc; ++i) fRes = std::min(fRes, a_afArg[i]); - - return fRes; -} - -//--------------------------------------------------------------------------- -ValueOrError ParserInt::Max(const value_type *a_afArg, int a_iArgc) { - if (!a_iArgc) return ParserError(_T("too few arguments for function min.")); - - value_type fRes = a_afArg[0]; - for (int i = 0; i < a_iArgc; ++i) fRes = std::max(fRes, a_afArg[i]); - - return fRes; -} - -//--------------------------------------------------------------------------- -// Default value recognition callback -int ParserInt::IsVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - string_type buf(a_szExpr); - std::size_t pos = buf.find_first_not_of(_T("0123456789")); - - if (pos == std::string::npos) return 0; - - stringstream_type stream(buf.substr(0, pos)); - int iVal(0); - - stream >> iVal; - if (stream.fail()) return 0; - - stringstream_type::pos_type iEnd = stream.tellg(); // Position after reading - if (stream.fail()) iEnd = stream.str().length(); - - if (iEnd == (stringstream_type::pos_type)-1) return 0; - - *a_iPos += (int)iEnd; - *a_fVal = (value_type)iVal; - return 1; -} - -//--------------------------------------------------------------------------- -/** \brief Check a given position in the expression for the presence of - a hex value. - \param a_szExpr Pointer to the expression string - \param [in/out] a_iPos Pointer to an integer value holding the current parsing - position in the expression. - \param [out] a_fVal Pointer to the position where the detected value shall be stored. - - Hey values must be prefixed with "0x" in order to be detected properly. -*/ -int ParserInt::IsHexVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - if (a_szExpr[1] == 0 || (a_szExpr[0] != '0' || a_szExpr[1] != 'x')) return 0; - - unsigned iVal(0); - - // New code based on streams for UNICODE compliance: - stringstream_type::pos_type nPos(0); - stringstream_type ss(a_szExpr + 2); - ss >> std::hex >> iVal; - nPos = ss.tellg(); - - if (nPos == (stringstream_type::pos_type)0) return 1; - - *a_iPos += (int)(2 + nPos); - *a_fVal = (value_type)iVal; - return 1; -} - -//--------------------------------------------------------------------------- -int ParserInt::IsBinVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - if (a_szExpr[0] != '#') return 0; - - unsigned iVal(0), iBits(sizeof(iVal) * 8), i(0); - - for (i = 0; (a_szExpr[i + 1] == '0' || a_szExpr[i + 1] == '1') && i < iBits; ++i) - iVal |= (int)(a_szExpr[i + 1] == '1') << ((iBits - 1) - i); - - if (i == 0) return 0; - - // return false on overflow - if (i == iBits) return 0; - - *a_fVal = (unsigned)(iVal >> (iBits - i)); - *a_iPos += i + 1; - - return 1; -} - -//--------------------------------------------------------------------------- -/** \brief Constructor. - - Call ParserBase class constructor and trigger Function, Operator and Constant initialization. -*/ -ParserInt::ParserInt() : ParserBase() { - AddValIdent(IsVal); // lowest priority - AddValIdent(IsBinVal); - AddValIdent(IsHexVal); // highest priority - - InitCharSets(); - InitFun(); - InitOprt(); -} - -//--------------------------------------------------------------------------- -void ParserInt::InitConst() {} - -//--------------------------------------------------------------------------- -void ParserInt::InitCharSets() { - DefineNameChars(_T("0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")); - DefineOprtChars(_T("+-*^/?<>=!%&|~'_")); - DefineInfixOprtChars(_T("/+-*^?<>=!%&|~'_")); -} - -/// assert that the given optional error \p oerr is not an error. -/// This is used only during initialization, when it ought to be impossible -/// to generate an error. -static void assertNoError(OptionalError oerr) { - assert(!oerr.has_error() && "Unexpected error during initialization"); - (void)oerr; -} - -//--------------------------------------------------------------------------- -/** \brief Initialize the default functions. */ -void ParserInt::InitFun() { - assertNoError(DefineFun(_T("sign"), Sign)); - assertNoError(DefineFun(_T("abs"), Abs)); - assertNoError(DefineFun(_T("if"), Ite)); - assertNoError(DefineFun(_T("sum"), Sum)); - assertNoError(DefineFun(_T("min"), Min)); - assertNoError(DefineFun(_T("max"), Max)); -} - -//--------------------------------------------------------------------------- -/** \brief Initialize operators. */ -void ParserInt::InitOprt() { - // disable all built in operators, not all of them useful for integer numbers - // (they don't do rounding of values) - EnableBuiltInOprt(false); - - // Disable all built in operators, they wont work with integer numbers - // since they are designed for floating point numbers - assertNoError(DefineInfixOprt(_T("-"), UnaryMinus)); - assertNoError(DefineInfixOprt(_T("!"), Not)); - - assertNoError(DefineOprt(_T("&"), LogAnd, prLOGIC)); - assertNoError(DefineOprt(_T("|"), LogOr, prLOGIC)); - assertNoError(DefineOprt(_T("&&"), And, prLOGIC)); - assertNoError(DefineOprt(_T("||"), Or, prLOGIC)); - - assertNoError(DefineOprt(_T("<"), Less, prCMP)); - assertNoError(DefineOprt(_T(">"), Greater, prCMP)); - assertNoError(DefineOprt(_T("<="), LessEq, prCMP)); - assertNoError(DefineOprt(_T(">="), GreaterEq, prCMP)); - assertNoError(DefineOprt(_T("=="), Equal, prCMP)); - assertNoError(DefineOprt(_T("!="), NotEqual, prCMP)); - - assertNoError(DefineOprt(_T("+"), Add, prADD_SUB)); - assertNoError(DefineOprt(_T("-"), Sub, prADD_SUB)); - - assertNoError(DefineOprt(_T("*"), Mul, prMUL_DIV)); - assertNoError(DefineOprt(_T("/"), Div, prMUL_DIV)); - assertNoError(DefineOprt(_T("%"), Mod, prMUL_DIV)); - - assertNoError(DefineOprt(_T("^"), Pow, prPOW, oaRIGHT)); - assertNoError(DefineOprt(_T(">>"), Shr, prMUL_DIV + 1)); - assertNoError(DefineOprt(_T("<<"), Shl, prMUL_DIV + 1)); -} - -} // namespace mu diff --git a/muparser-2.2.5/src/muParserTest.cpp b/muparser-2.2.5/src/muParserTest.cpp deleted file mode 100644 index b1e66577b..000000000 --- a/muparser-2.2.5/src/muParserTest.cpp +++ /dev/null @@ -1,1225 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ - -#include "muParserTest.h" - -#include -#include -#include -#include - -#define PARSER_CONST_PI 3.141592653589793238462643 -#define PARSER_CONST_E 2.718281828459045235360287 - -using namespace std; - -/** \file - \brief This file contains the implementation of parser test cases. -*/ - -namespace mu { -namespace Test { - -static value_type getOrThrow(mu::ValueOrError voerr) { - if (voerr.has_error()) throw voerr.error(); - return *voerr; -} - -static void throwIfError(mu::OptionalError oerr) { - if (oerr.has_error()) { - throw oerr.error(); - } -} - -int ParserTester::c_iCount = 0; - -//--------------------------------------------------------------------------------------------- -ParserTester::ParserTester() : m_vTestFun() { - AddTest(&ParserTester::TestNames); - AddTest(&ParserTester::TestSyntax); - AddTest(&ParserTester::TestPostFix); - AddTest(&ParserTester::TestInfixOprt); - AddTest(&ParserTester::TestMultiArg); - AddTest(&ParserTester::TestExpression); - AddTest(&ParserTester::TestIfThenElse); - AddTest(&ParserTester::TestInterface); - AddTest(&ParserTester::TestBinOprt); - AddTest(&ParserTester::TestException); - AddTest(&ParserTester::TestStrArg); - - ParserTester::c_iCount = 0; -} - -//--------------------------------------------------------------------------------------------- -int ParserTester::IsHexVal(const char_type *a_szExpr, int *a_iPos, value_type *a_fVal) { - if (a_szExpr[1] == 0 || (a_szExpr[0] != '0' || a_szExpr[1] != 'x')) return 0; - - unsigned iVal(0); - - // New code based on streams for UNICODE compliance: - stringstream_type::pos_type nPos(0); - stringstream_type ss(a_szExpr + 2); - ss >> std::hex >> iVal; - nPos = ss.tellg(); - - if (nPos == (stringstream_type::pos_type)0) return 1; - - *a_iPos += (int)(2 + nPos); - *a_fVal = (value_type)iVal; - return 1; -} - -//--------------------------------------------------------------------------------------------- -int ParserTester::TestInterface() { - int iStat = 0; - mu::console() << _T("testing member functions..."); - - // Test RemoveVar - value_type afVal[3] = {1, 2, 3}; - Parser p; - - try { - throwIfError(p.DefineVar(_T("a"), &afVal[0])); - throwIfError(p.DefineVar(_T("b"), &afVal[1])); - throwIfError(p.DefineVar(_T("c"), &afVal[2])); - throwIfError(p.SetExpr(_T("a+b+c"))); - getOrThrow(p.Eval()); - } catch (...) { - iStat += 1; // this is not supposed to happen - } - - try { - p.RemoveVar(_T("c")); - getOrThrow(p.Eval()); - iStat += 1; // not supposed to reach this, nonexisting variable "c" deleted... - } catch (...) { - // failure is expected... - } - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------------------------- -int ParserTester::TestStrArg() { - int iStat = 0; - mu::console() << _T("testing string arguments..."); - - iStat += EqnTest(_T("valueof(\"\")"), 123, true); // empty string arguments caused a crash - iStat += EqnTest(_T("valueof(\"aaa\")+valueof(\"bbb\") "), 246, true); - iStat += EqnTest(_T("2*(valueof(\"aaa\")-23)+valueof(\"bbb\")"), 323, true); - // use in expressions with variables - iStat += EqnTest(_T("a*(atof(\"10\")-b)"), 8, true); - iStat += EqnTest(_T("a-(atof(\"10\")*b)"), -19, true); - // string + numeric arguments - iStat += EqnTest(_T("strfun1(\"100\")"), 100, true); - iStat += EqnTest(_T("strfun2(\"100\",1)"), 101, true); - iStat += EqnTest(_T("strfun3(\"99\",1,2)"), 102, true); - // string constants - iStat += EqnTest(_T("atof(str1)+atof(str2)"), 3.33, true); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------------------------- -int ParserTester::TestBinOprt() { - int iStat = 0; - mu::console() << _T("testing binary operators..."); - - // built in operators - // xor operator - - iStat += EqnTest(_T("a++b"), 3, true); - iStat += EqnTest(_T("a ++ b"), 3, true); - iStat += EqnTest(_T("1++2"), 3, true); - iStat += EqnTest(_T("1 ++ 2"), 3, true); - iStat += EqnTest(_T("a add b"), 3, true); - iStat += EqnTest(_T("1 add 2"), 3, true); - iStat += EqnTest(_T("aa"), 1, true); - iStat += EqnTest(_T("a>a"), 0, true); - iStat += EqnTest(_T("aa"), 0, true); - iStat += EqnTest(_T("a<=a"), 1, true); - iStat += EqnTest(_T("a<=b"), 1, true); - iStat += EqnTest(_T("b<=a"), 0, true); - iStat += EqnTest(_T("a>=a"), 1, true); - iStat += EqnTest(_T("b>=a"), 1, true); - iStat += EqnTest(_T("a>=b"), 0, true); - - // Test logical operators, especially if user defined "&" and the internal "&&" collide - iStat += EqnTest(_T("1 && 1"), 1, true); - iStat += EqnTest(_T("1 && 0"), 0, true); - iStat += EqnTest(_T("(aa)"), 1, true); - iStat += EqnTest(_T("(ab)"), 0, true); - // iStat += EqnTest(_T("12 and 255"), 12, true); - // iStat += EqnTest(_T("12 and 0"), 0, true); - iStat += EqnTest(_T("12 & 255"), 12, true); - iStat += EqnTest(_T("12 & 0"), 0, true); - iStat += EqnTest(_T("12&255"), 12, true); - iStat += EqnTest(_T("12&0"), 0, true); - - // Assignment operator - iStat += EqnTest(_T("a = b"), 2, true); - iStat += EqnTest(_T("a = sin(b)"), 0.909297, true); - iStat += EqnTest(_T("a = 1+sin(b)"), 1.909297, true); - iStat += EqnTest(_T("(a=b)*2"), 4, true); - iStat += EqnTest(_T("2*(a=b)"), 4, true); - iStat += EqnTest(_T("2*(a=b+1)"), 6, true); - iStat += EqnTest(_T("(a=b+1)*2"), 6, true); - iStat += EqnTest(_T("a=c, a*10"), 30, true); - - iStat += EqnTest(_T("2^2^3"), 256, true); - iStat += EqnTest(_T("1/2/3"), 1.0 / 6.0, true); - - // reference: http://www.wolframalpha.com/input/?i=3%2B4*2%2F%281-5%29^2^3 - iStat += EqnTest(_T("3+4*2/(1-5)^2^3"), 3.0001220703125, true); - - // Test user defined binary operators - iStat += EqnTestInt(_T("1 | 2"), 3, true); - iStat += EqnTestInt(_T("1 || 2"), 1, true); - iStat += EqnTestInt(_T("123 & 456"), 72, true); - iStat += EqnTestInt(_T("(123 & 456) % 10"), 2, true); - iStat += EqnTestInt(_T("1 && 0"), 0, true); - iStat += EqnTestInt(_T("123 && 456"), 1, true); - iStat += EqnTestInt(_T("1 << 3"), 8, true); - iStat += EqnTestInt(_T("8 >> 3"), 1, true); - iStat += EqnTestInt(_T("9 / 4"), 2, true); - iStat += EqnTestInt(_T("9 % 4"), 1, true); - iStat += EqnTestInt(_T("if(5%2,1,0)"), 1, true); - iStat += EqnTestInt(_T("if(4%2,1,0)"), 0, true); - iStat += EqnTestInt(_T("-10+1"), -9, true); - iStat += EqnTestInt(_T("1+2*3"), 7, true); - iStat += EqnTestInt(_T("const1 != const2"), 1, true); - iStat += EqnTestInt(_T("const1 != const2"), 0, false); - iStat += EqnTestInt(_T("const1 == const2"), 0, true); - iStat += EqnTestInt(_T("const1 == 1"), 1, true); - iStat += EqnTestInt(_T("10*(const1 == 1)"), 10, true); - iStat += EqnTestInt(_T("2*(const1 | const2)"), 6, true); - iStat += EqnTestInt(_T("2*(const1 | const2)"), 7, false); - iStat += EqnTestInt(_T("const1 < const2"), 1, true); - iStat += EqnTestInt(_T("const2 > const1"), 1, true); - iStat += EqnTestInt(_T("const1 <= 1"), 1, true); - iStat += EqnTestInt(_T("const2 >= 2"), 1, true); - iStat += EqnTestInt(_T("2*(const1 + const2)"), 6, true); - iStat += EqnTestInt(_T("2*(const1 - const2)"), -2, true); - iStat += EqnTestInt(_T("a != b"), 1, true); - iStat += EqnTestInt(_T("a != b"), 0, false); - iStat += EqnTestInt(_T("a == b"), 0, true); - iStat += EqnTestInt(_T("a == 1"), 1, true); - iStat += EqnTestInt(_T("10*(a == 1)"), 10, true); - iStat += EqnTestInt(_T("2*(a | b)"), 6, true); - iStat += EqnTestInt(_T("2*(a | b)"), 7, false); - iStat += EqnTestInt(_T("a < b"), 1, true); - iStat += EqnTestInt(_T("b > a"), 1, true); - iStat += EqnTestInt(_T("a <= 1"), 1, true); - iStat += EqnTestInt(_T("b >= 2"), 1, true); - iStat += EqnTestInt(_T("2*(a + b)"), 6, true); - iStat += EqnTestInt(_T("2*(a - b)"), -2, true); - iStat += EqnTestInt(_T("a + (a << b)"), 5, true); - iStat += EqnTestInt(_T("-2^2"), -4, true); - iStat += EqnTestInt(_T("3--a"), 4, true); - iStat += EqnTestInt(_T("3+-3^2"), -6, true); - - // Test reading of hex values: - iStat += EqnTestInt(_T("0xff"), 255, true); - iStat += EqnTestInt(_T("10+0xff"), 265, true); - iStat += EqnTestInt(_T("0xff+10"), 265, true); - iStat += EqnTestInt(_T("10*0xff"), 2550, true); - iStat += EqnTestInt(_T("0xff*10"), 2550, true); - iStat += EqnTestInt(_T("10+0xff+1"), 266, true); - iStat += EqnTestInt(_T("1+0xff+10"), 266, true); - - // incorrect: '^' is yor here, not power - // iStat += EqnTestInt("-(1+2)^2", -9, true); - // iStat += EqnTestInt("-1^3", -1, true); - - // Test precedence - // a=1, b=2, c=3 - iStat += EqnTestInt(_T("a + b * c"), 7, true); - iStat += EqnTestInt(_T("a * b + c"), 5, true); - iStat += EqnTestInt(_T("a10"), 0, true); - iStat += EqnTestInt(_T("a"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("?<"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("**"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("xor"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("and"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("or"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("not"), f1of1) - PARSER_THROWCHECK(PostfixOprt, true, _T("!"), f1of1) - // Binary operator - // The following must fail with builtin operators activated - // p.EnableBuiltInOp(true); -> this is the default - p.ClearPostfixOprt(); - PARSER_THROWCHECK(Oprt, false, _T("+"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("-"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("*"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("/"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("^"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("&&"), f1of2) - PARSER_THROWCHECK(Oprt, false, _T("||"), f1of2) - // without activated built in operators it should work - p.EnableBuiltInOprt(false); - PARSER_THROWCHECK(Oprt, true, _T("+"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("-"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("*"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("/"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("^"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("&&"), f1of2) - PARSER_THROWCHECK(Oprt, true, _T("||"), f1of2) -#undef PARSER_THROWCHECK - - if (failures == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << failures << _T(" errors") << endl; - - return failures; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestSyntax() { - int iStat = 0; - mu::console() << _T("testing syntax engine..."); - - iStat += ThrowTest(_T("1,"), ecUNEXPECTED_EOF); // incomplete hex definition - iStat += ThrowTest(_T("a,"), ecUNEXPECTED_EOF); // incomplete hex definition - iStat += ThrowTest(_T("sin(8),"), ecUNEXPECTED_EOF); // incomplete hex definition - iStat += ThrowTest(_T("(sin(8)),"), ecUNEXPECTED_EOF); // incomplete hex definition - iStat += ThrowTest(_T("a{m},"), ecUNEXPECTED_EOF); // incomplete hex definition - - iStat += EqnTest(_T("(1+ 2*a)"), 3, true); // Spaces within formula - iStat += EqnTest(_T("sqrt((4))"), 2, true); // Multiple brackets - iStat += EqnTest(_T("sqrt((2)+2)"), 2, true); // Multiple brackets - iStat += EqnTest(_T("sqrt(2+(2))"), 2, true); // Multiple brackets - iStat += EqnTest(_T("sqrt(a+(3))"), 2, true); // Multiple brackets - iStat += EqnTest(_T("sqrt((3)+a)"), 2, true); // Multiple brackets - iStat += EqnTest(_T("order(1,2)"), 1, true); // May not cause name collision with operator "or" - iStat += EqnTest(_T("(2+"), 0, false); // missing closing bracket - iStat += EqnTest(_T("2++4"), 0, false); // unexpected operator - iStat += EqnTest(_T("2+-4"), 0, false); // unexpected operator - iStat += EqnTest(_T("(2+)"), 0, false); // unexpected closing bracket - iStat += EqnTest(_T("--2"), 0, false); // double sign - iStat += EqnTest(_T("ksdfj"), 0, false); // unknown token - iStat += EqnTest(_T("()"), 0, false); // empty bracket without a function - iStat += EqnTest(_T("5+()"), 0, false); // empty bracket without a function - iStat += EqnTest(_T("sin(cos)"), 0, false); // unexpected function - iStat += EqnTest(_T("5t6"), 0, false); // unknown token - iStat += EqnTest(_T("5 t 6"), 0, false); // unknown token - iStat += EqnTest(_T("8*"), 0, false); // unexpected end of formula - iStat += EqnTest(_T(",3"), 0, false); // unexpected comma - iStat += EqnTest(_T("3,5"), 0, false); // unexpected comma - iStat += EqnTest(_T("sin(8,8)"), 0, false); // too many function args - iStat += EqnTest(_T("(7,8)"), 0, false); // too many function args - iStat += EqnTest(_T("sin)"), 0, false); // unexpected closing bracket - iStat += EqnTest(_T("a)"), 0, false); // unexpected closing bracket - iStat += EqnTest(_T("pi)"), 0, false); // unexpected closing bracket - iStat += EqnTest(_T("sin(())"), 0, false); // unexpected closing bracket - iStat += EqnTest(_T("sin()"), 0, false); // unexpected closing bracket - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestMultiArg() { - int iStat = 0; - mu::console() << _T("testing multiarg functions..."); - - // Compound expressions - iStat += EqnTest(_T("1,2,3"), 3, true); - iStat += EqnTest(_T("a,b,c"), 3, true); - iStat += EqnTest(_T("a=10,b=20,c=a*b"), 200, true); - iStat += EqnTest(_T("1,\n2,\n3"), 3, true); - iStat += EqnTest(_T("a,\nb,\nc"), 3, true); - iStat += EqnTest(_T("a=10,\nb=20,\nc=a*b"), 200, true); - iStat += EqnTest(_T("1,\r\n2,\r\n3"), 3, true); - iStat += EqnTest(_T("a,\r\nb,\r\nc"), 3, true); - iStat += EqnTest(_T("a=10,\r\nb=20,\r\nc=a*b"), 200, true); - - // picking the right argument - iStat += EqnTest(_T("f1of1(1)"), 1, true); - iStat += EqnTest(_T("f1of2(1, 2)"), 1, true); - iStat += EqnTest(_T("f2of2(1, 2)"), 2, true); - iStat += EqnTest(_T("f1of3(1, 2, 3)"), 1, true); - iStat += EqnTest(_T("f2of3(1, 2, 3)"), 2, true); - iStat += EqnTest(_T("f3of3(1, 2, 3)"), 3, true); - // Too few arguments / Too many arguments - iStat += EqnTest(_T("1+ping()"), 11, true); - iStat += EqnTest(_T("ping()+1"), 11, true); - iStat += EqnTest(_T("2*ping()"), 20, true); - iStat += EqnTest(_T("ping()*2"), 20, true); - iStat += EqnTest(_T("ping(1,2)"), 0, false); - iStat += EqnTest(_T("1+ping(1,2)"), 0, false); - iStat += EqnTest(_T("f1of1(1,2)"), 0, false); - iStat += EqnTest(_T("f1of1()"), 0, false); - iStat += EqnTest(_T("f1of2(1, 2, 3)"), 0, false); - iStat += EqnTest(_T("f1of2(1)"), 0, false); - iStat += EqnTest(_T("f1of3(1, 2, 3, 4)"), 0, false); - iStat += EqnTest(_T("f1of3(1)"), 0, false); - iStat += EqnTest(_T("(1,2,3)"), 0, false); - iStat += EqnTest(_T("1,2,3"), 0, false); - iStat += EqnTest(_T("(1*a,2,3)"), 0, false); - iStat += EqnTest(_T("1,2*a,3"), 0, false); - - // correct calculation of arguments - iStat += EqnTest(_T("min(a, 1)"), 1, true); - iStat += EqnTest(_T("min(3*2, 1)"), 1, true); - iStat += EqnTest(_T("min(3*2, 1)"), 6, false); - iStat += EqnTest(_T("firstArg(2,3,4)"), 2, true); - iStat += EqnTest(_T("lastArg(2,3,4)"), 4, true); - iStat += EqnTest(_T("min(3*a+1, 1)"), 1, true); - iStat += EqnTest(_T("max(3*a+1, 1)"), 4, true); - iStat += EqnTest(_T("max(3*a+1, 1)*2"), 8, true); - iStat += EqnTest(_T("2*max(3*a+1, 1)+2"), 10, true); - - // functions with Variable argument count - iStat += EqnTest(_T("sum(a)"), 1, true); - iStat += EqnTest(_T("sum(1,2,3)"), 6, true); - iStat += EqnTest(_T("sum(a,b,c)"), 6, true); - iStat += EqnTest(_T("sum(1,-max(1,2),3)*2"), 4, true); - iStat += EqnTest(_T("2*sum(1,2,3)"), 12, true); - iStat += EqnTest(_T("2*sum(1,2,3)+2"), 14, true); - iStat += EqnTest(_T("2*sum(-1,2,3)+2"), 10, true); - iStat += EqnTest(_T("2*sum(-1,2,-(-a))+2"), 6, true); - iStat += EqnTest(_T("2*sum(-1,10,-a)+2"), 18, true); - iStat += EqnTest(_T("2*sum(1,2,3)*2"), 24, true); - iStat += EqnTest(_T("sum(1,-max(1,2),3)*2"), 4, true); - iStat += EqnTest(_T("sum(1*3, 4, a+2)"), 10, true); - iStat += EqnTest(_T("sum(1*3, 2*sum(1,2,2), a+2)"), 16, true); - iStat += EqnTest(_T("sum(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2)"), 24, true); - - // some failures - iStat += EqnTest(_T("sum()"), 0, false); - iStat += EqnTest(_T("sum(,)"), 0, false); - iStat += EqnTest(_T("sum(1,2,)"), 0, false); - iStat += EqnTest(_T("sum(,1,2)"), 0, false); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestInfixOprt() { - int iStat(0); - mu::console() << "testing infix operators..."; - - iStat += EqnTest(_T("+1"), +1, true); - iStat += EqnTest(_T("-(+1)"), -1, true); - iStat += EqnTest(_T("-(+1)*2"), -2, true); - iStat += EqnTest(_T("-(+2)*sqrt(4)"), -4, true); - iStat += EqnTest(_T("3-+a"), 2, true); - iStat += EqnTest(_T("+1*3"), 3, true); - - iStat += EqnTest(_T("-1"), -1, true); - iStat += EqnTest(_T("-(-1)"), 1, true); - iStat += EqnTest(_T("-(-1)*2"), 2, true); - iStat += EqnTest(_T("-(-2)*sqrt(4)"), 4, true); - iStat += EqnTest(_T("-_pi"), -PARSER_CONST_PI, true); - iStat += EqnTest(_T("-a"), -1, true); - iStat += EqnTest(_T("-(a)"), -1, true); - iStat += EqnTest(_T("-(-a)"), 1, true); - iStat += EqnTest(_T("-(-a)*2"), 2, true); - iStat += EqnTest(_T("-(8)"), -8, true); - iStat += EqnTest(_T("-8"), -8, true); - iStat += EqnTest(_T("-(2+1)"), -3, true); - iStat += EqnTest(_T("-(f1of1(1+2*3)+1*2)"), -9, true); - iStat += EqnTest(_T("-(-f1of1(1+2*3)+1*2)"), 5, true); - iStat += EqnTest(_T("-sin(8)"), -0.989358, true); - iStat += EqnTest(_T("3-(-a)"), 4, true); - iStat += EqnTest(_T("3--a"), 4, true); - iStat += EqnTest(_T("-1*3"), -3, true); - - // Postfix / infix priorities - iStat += EqnTest(_T("~2#"), 8, true); - iStat += EqnTest(_T("~f1of1(2)#"), 8, true); - iStat += EqnTest(_T("~(b)#"), 8, true); - iStat += EqnTest(_T("(~b)#"), 12, true); - iStat += EqnTest(_T("~(2#)"), 8, true); - iStat += EqnTest(_T("~(f1of1(2)#)"), 8, true); - // - iStat += EqnTest(_T("-2^2"), -4, true); - iStat += EqnTest(_T("-(a+b)^2"), -9, true); - iStat += EqnTest(_T("(-3)^2"), 9, true); - iStat += EqnTest(_T("-(-2^2)"), 4, true); - iStat += EqnTest(_T("3+-3^2"), -6, true); - // The following assumes use of sqr as postfix operator ("§") together - // with a sign operator of low priority: - iStat += EqnTest(_T("-2'"), -4, true); - iStat += EqnTest(_T("-(1+1)'"), -4, true); - iStat += EqnTest(_T("2+-(1+1)'"), -2, true); - iStat += EqnTest(_T("2+-2'"), -2, true); - // This is the classic behaviour of the infix sign operator (here: "$") which is - // now deprecated: - iStat += EqnTest(_T("$2^2"), 4, true); - iStat += EqnTest(_T("$(a+b)^2"), 9, true); - iStat += EqnTest(_T("($3)^2"), 9, true); - iStat += EqnTest(_T("$($2^2)"), -4, true); - iStat += EqnTest(_T("3+$3^2"), 12, true); - - // infix operators sharing the first few characters - iStat += EqnTest(_T("~ 123"), 123 + 2, true); - iStat += EqnTest(_T("~~ 123"), 123 + 2, true); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestPostFix() { - int iStat = 0; - mu::console() << _T("testing postfix operators..."); - - // application - iStat += EqnTest(_T("3{m}+5"), 5.003, true); - iStat += EqnTest(_T("1000{m}"), 1, true); - iStat += EqnTest(_T("1000 {m}"), 1, true); - iStat += EqnTest(_T("(a){m}"), 1e-3, true); - iStat += EqnTest(_T("a{m}"), 1e-3, true); - iStat += EqnTest(_T("a {m}"), 1e-3, true); - iStat += EqnTest(_T("-(a){m}"), -1e-3, true); - iStat += EqnTest(_T("-2{m}"), -2e-3, true); - iStat += EqnTest(_T("-2 {m}"), -2e-3, true); - iStat += EqnTest(_T("f1of1(1000){m}"), 1, true); - iStat += EqnTest(_T("-f1of1(1000){m}"), -1, true); - iStat += EqnTest(_T("-f1of1(-1000){m}"), 1, true); - iStat += EqnTest(_T("2+(a*1000){m}"), 3, true); - - // can postfix operators "m" und "meg" be told apart properly? - iStat += EqnTest(_T("2*3000meg+2"), 2 * 3e9 + 2, true); - - // some incorrect results - iStat += EqnTest(_T("1000{m}"), 0.1, false); - iStat += EqnTest(_T("(a){m}"), 2, false); - // failure due to syntax checking - iStat += ThrowTest(_T("0x"), ecUNASSIGNABLE_TOKEN); // incomplete hex definition - iStat += ThrowTest(_T("3+"), ecUNEXPECTED_EOF); - iStat += ThrowTest(_T("4 + {m}"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("{m}4"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("sin({m})"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("{m} {m}"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("{m}(8)"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("4,{m}"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("-{m}"), ecUNASSIGNABLE_TOKEN); - iStat += ThrowTest(_T("2(-{m})"), ecUNEXPECTED_PARENS); - iStat += ThrowTest(_T("2({m})"), ecUNEXPECTED_PARENS); - - iStat += ThrowTest(_T("multi*1.0"), ecUNASSIGNABLE_TOKEN); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestExpression() { - int iStat = 0; - mu::console() << _T("testing expression samples..."); - - value_type b = 2; - - // Optimization - iStat += EqnTest(_T("2*b*5"), 20, true); - iStat += EqnTest(_T("2*b*5 + 4*b"), 28, true); - iStat += EqnTest(_T("2*a/3"), 2.0 / 3.0, true); - - // Addition auf cmVARMUL - iStat += EqnTest(_T("3+b"), b + 3, true); - iStat += EqnTest(_T("b+3"), b + 3, true); - iStat += EqnTest(_T("b*3+2"), b * 3 + 2, true); - iStat += EqnTest(_T("3*b+2"), b * 3 + 2, true); - iStat += EqnTest(_T("2+b*3"), b * 3 + 2, true); - iStat += EqnTest(_T("2+3*b"), b * 3 + 2, true); - iStat += EqnTest(_T("b+3*b"), b + 3 * b, true); - iStat += EqnTest(_T("3*b+b"), b + 3 * b, true); - - iStat += EqnTest(_T("2+b*3+b"), 2 + b * 3 + b, true); - iStat += EqnTest(_T("b+2+b*3"), b + 2 + b * 3, true); - - iStat += EqnTest(_T("(2*b+1)*4"), (2 * b + 1) * 4, true); - iStat += EqnTest(_T("4*(2*b+1)"), (2 * b + 1) * 4, true); - - // operator precedences - iStat += EqnTest(_T("1+2-3*4/5^6"), 2.99923, true); - iStat += EqnTest(_T("1^2/3*4-5+6"), 2.33333333, true); - iStat += EqnTest(_T("1+2*3"), 7, true); - iStat += EqnTest(_T("1+2*3"), 7, true); - iStat += EqnTest(_T("(1+2)*3"), 9, true); - iStat += EqnTest(_T("(1+2)*(-3)"), -9, true); - iStat += EqnTest(_T("2/4"), 0.5, true); - - iStat += EqnTest(_T("exp(ln(7))"), 7, true); - iStat += EqnTest(_T("e^ln(7)"), 7, true); - iStat += EqnTest(_T("e^(ln(7))"), 7, true); - iStat += EqnTest(_T("(e^(ln(7)))"), 7, true); - iStat += EqnTest(_T("1-(e^(ln(7)))"), -6, true); - iStat += EqnTest(_T("2*(e^(ln(7)))"), 14, true); - iStat += EqnTest(_T("10^log(5)"), pow(10.0, log(5.0)), true); - iStat += EqnTest(_T("10^log10(5)"), 5, true); - iStat += EqnTest(_T("2^log2(4)"), 4, true); - iStat += EqnTest(_T("-(sin(0)+1)"), -1, true); - iStat += EqnTest(_T("-(2^1.1)"), -2.14354692, true); - - iStat += EqnTest(_T("(cos(2.41)/b)"), -0.372056, true); - iStat += EqnTest(_T("(1*(2*(3*(4*(5*(6*(a+b)))))))"), 2160, true); - iStat += EqnTest(_T("(1*(2*(3*(4*(5*(6*(7*(a+b))))))))"), 15120, true); - iStat += EqnTest( - _T("(a/((((b+(((e*(((((pi*((((3.45*((pi+a)+pi))+b)+b)*a))+0.68)+e)+a)/") - _T("a))+a)+b))+b)*a)-pi))"), - 0.00377999, true); - - // long formula (Reference: Matlab) - iStat += EqnTest( - _T("(((-9))-e/(((((((pi-(((-7)+(-3)/4/e))))/") - _T("(((-5))-2)-((pi+(-0))*(sqrt((e+e))*(-8))*(((-pi)+(-pi)-(-9)*(6*5))") - _T("/(-e)-e))/2)/((((sqrt(2/(-e)+6)-(4-2))+((5/(-2))/(1*(-pi)+3))/8)*pi*((pi/((-2)/") - _T("(-6)*1*(-1))*(-6)+(-e)))))/") - _T("((e+(-2)+(-e)*((((-3)*9+(-e)))+(-9)))))))-((((e-7+(((5/pi-(3/1+pi)))))/e)/(-5))/") - _T("(sqrt((((((1+(-7))))+((((-") - _T("e)*(-e)))-8))*(-5)/((-e)))*(-6)-((((((-2)-(-9)-(-e)-1)/3))))/") - _T("(sqrt((8+(e-((-6))+(9*(-9))))*(((3+2-8))*(7+6") - _T("+(-5))+((0/(-e)*(-pi))+7)))+(((((-e)/e/e)+((-6)*5)*e+(3+(-5)/pi))))+pi))/") - _T("sqrt((((9))+((((pi))-8+2))+pi))/e") - _T("*4)*((-5)/(((-pi))*(sqrt(e)))))-(((((((-e)*(e)-pi))/4+(pi)*(-9)))))))+(-pi)"), - -12.23016549, true); - - // long formula (Reference: Matlab) - iStat += EqnTest( - _T("(atan(sin((((((((((((((((pi/cos((a/((((0.53-b)-pi)*e)/b))))+2.51)+a)-0.54)/") - _T("0.98)+b)*b)+e)/a)+b)+a)+b)+pi)/e") - _T(")+a)))*2.77)"), - -2.16995656, true); - - // long formula (Reference: Matlab) - iStat += EqnTest(_T("1+2-3*4/5^6*(2*(1-5+(3*7^9)*(4+6*7-3)))+12"), -7995810.09926, true); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -int ParserTester::TestIfThenElse() { - int iStat = 0; - mu::console() << _T("testing if-then-else operator..."); - - // Test error detection - iStat += ThrowTest(_T(":3"), ecUNEXPECTED_CONDITIONAL); - iStat += ThrowTest(_T("? 1 : 2"), ecUNEXPECTED_CONDITIONAL); - iStat += ThrowTest(_T("(ab) ? 10 : 11"), 11, true); - iStat += EqnTest(_T("(ab) ? c : d"), -2, true); - - iStat += EqnTest(_T("(a>b) ? 1 : 0"), 0, true); - iStat += EqnTest(_T("((a>b) ? 1 : 0) ? 1 : 2"), 2, true); - iStat += EqnTest(_T("((a>b) ? 1 : 0) ? 1 : sum((a>b) ? 1 : 2)"), 2, true); - iStat += EqnTest(_T("((a>b) ? 0 : 1) ? 1 : sum((a>b) ? 1 : 2)"), 1, true); - - iStat += EqnTest(_T("sum((a>b) ? 1 : 2)"), 2, true); - iStat += EqnTest(_T("sum((1) ? 1 : 2)"), 1, true); - iStat += EqnTest(_T("sum((a>b) ? 1 : 2, 100)"), 102, true); - iStat += EqnTest(_T("sum((1) ? 1 : 2, 100)"), 101, true); - iStat += EqnTest(_T("sum(3, (a>b) ? 3 : 10)"), 13, true); - iStat += EqnTest(_T("sum(3, (ab) ? 3 : 10)"), 130, true); - iStat += EqnTest(_T("10*sum(3, (ab) ? 3 : 10)*10"), 130, true); - iStat += EqnTest(_T("sum(3, (ab) ? sum(3, (ab) ? sum(3, (ab) ? sum(3, (ab)&&(a2)&&(1<2) ? 128 : 255"), 255, true); - iStat += EqnTest(_T("((1<2)&&(1<2)) ? 128 : 255"), 128, true); - iStat += EqnTest(_T("((1>2)&&(1<2)) ? 128 : 255"), 255, true); - iStat += EqnTest(_T("((ab)&&(a0 ? 1>2 ? 128 : 255 : 1>0 ? 32 : 64"), 255, true); - iStat += EqnTest(_T("1>0 ? 1>2 ? 128 : 255 :(1>0 ? 32 : 64)"), 255, true); - iStat += EqnTest(_T("1>0 ? 1>0 ? 128 : 255 : 1>2 ? 32 : 64"), 128, true); - iStat += EqnTest(_T("1>0 ? 1>0 ? 128 : 255 :(1>2 ? 32 : 64)"), 128, true); - iStat += EqnTest(_T("1>2 ? 1>2 ? 128 : 255 : 1>0 ? 32 : 64"), 32, true); - iStat += EqnTest(_T("1>2 ? 1>0 ? 128 : 255 : 1>2 ? 32 : 64"), 64, true); - iStat += EqnTest(_T("1>0 ? 50 : 1>0 ? 128 : 255"), 50, true); - iStat += EqnTest(_T("1>0 ? 50 : (1>0 ? 128 : 255)"), 50, true); - iStat += EqnTest(_T("1>0 ? 1>0 ? 128 : 255 : 50"), 128, true); - iStat += EqnTest(_T("1>2 ? 1>2 ? 128 : 255 : 1>0 ? 32 : 1>2 ? 64 : 16"), 32, true); - iStat += EqnTest(_T("1>2 ? 1>2 ? 128 : 255 : 1>0 ? 32 :(1>2 ? 64 : 16)"), 32, true); - iStat += EqnTest(_T("1>0 ? 1>2 ? 128 : 255 : 1>0 ? 32 :1>2 ? 64 : 16"), 255, true); - iStat += EqnTest(_T("1>0 ? 1>2 ? 128 : 255 : (1>0 ? 32 :1>2 ? 64 : 16)"), 255, true); - iStat += EqnTest(_T("1 ? 0 ? 128 : 255 : 1 ? 32 : 64"), 255, true); - - // assignment operators - iStat += EqnTest(_T("a= 0 ? 128 : 255, a"), 255, true); - iStat += EqnTest(_T("a=((a>b)&&(a - // this is now legal, for reference see: - // https://sourceforge.net/forum/message.php?msg_id=7411373 - // iStat += ThrowTest( _T("sin=9"), ecUNEXPECTED_OPERATOR); - //
- - iStat += ThrowTest(_T("(8)=5"), ecUNEXPECTED_OPERATOR); - iStat += ThrowTest(_T("(a)=5"), ecUNEXPECTED_OPERATOR); - iStat += ThrowTest(_T("a=\"tttt\""), ecOPRT_TYPE_CONFLICT); - - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; - - return iStat; -} - -//--------------------------------------------------------------------------- -void ParserTester::AddTest(testfun_type a_pFun) { m_vTestFun.push_back(a_pFun); } - -//--------------------------------------------------------------------------- -void ParserTester::Run() { - int iStat = 0; - try { - for (int i = 0; i < (int)m_vTestFun.size(); ++i) iStat += (this->*m_vTestFun[i])(); - } catch (Parser::exception_type &e) { - mu::console() << "\n" << e.GetMsg() << endl; - mu::console() << e.GetToken() << endl; - Abort(); - } catch (std::exception &e) { - mu::console() << e.what() << endl; - Abort(); - } catch (...) { - mu::console() << "Internal error"; - Abort(); - } - - if (iStat == 0) { - mu::console() << "Test passed (" << ParserTester::c_iCount << " expressions)" << endl; - } else { - mu::console() << "Test failed with " << iStat << " errors (" << ParserTester::c_iCount - << " expressions)" << endl; - } - ParserTester::c_iCount = 0; -} - -//--------------------------------------------------------------------------- -int ParserTester::ThrowTest(const string_type &a_str, int a_iErrc, bool a_bFail) { - ParserTester::c_iCount++; - - try { - value_type fVal[] = {1, 1, 1}; - Parser p; - - throwIfError(p.DefineVar(_T("a"), &fVal[0])); - throwIfError(p.DefineVar(_T("b"), &fVal[1])); - throwIfError(p.DefineVar(_T("c"), &fVal[2])); - throwIfError(p.DefinePostfixOprt(_T("{m}"), Milli)); - throwIfError(p.DefinePostfixOprt(_T("m"), Milli)); - throwIfError(p.DefineFun(_T("ping"), Ping)); - throwIfError(p.DefineFun(_T("valueof"), ValueOf)); - throwIfError(p.DefineFun(_T("strfun1"), StrFun1)); - throwIfError(p.DefineFun(_T("strfun2"), StrFun2)); - throwIfError(p.DefineFun(_T("strfun3"), StrFun3)); - throwIfError(p.SetExpr(a_str)); - getOrThrow(p.Eval()); - } catch (ParserError &e) { - // output the formula in case of an failed test - if (a_bFail == false || (a_bFail == true && a_iErrc != e.GetCode())) { - mu::console() << _T("\n ") - << _T("Expression: ") << a_str << _T(" Code:") << e.GetCode() << _T("(") - << e.GetMsg() << _T(")") - << _T(" Expected:") << a_iErrc; - } - - return (a_iErrc == e.GetCode()) ? 0 : 1; - } - - // if a_bFail==false no exception is expected - bool bRet((a_bFail == false) ? 0 : 1); - if (bRet == 1) { - mu::console() << _T("\n ") - << _T("Expression: ") << a_str << _T(" did evaluate; Expected error:") - << a_iErrc; - } - - return bRet; -} - -//--------------------------------------------------------------------------- -/** \brief Evaluate a tet expression. - - \return 1 in case of a failure, 0 otherwise. -*/ -int ParserTester::EqnTestWithVarChange(const string_type &a_str, double a_fVar1, double a_fRes1, - double a_fVar2, double a_fRes2) { - ParserTester::c_iCount++; - - try { - value_type fVal[2] = {-999, -999}; // should be equal - - Parser p; - value_type var = 0; - - // variable - throwIfError(p.DefineVar(_T("a"), &var)); - throwIfError(p.SetExpr(a_str)); - - var = a_fVar1; - fVal[0] = getOrThrow(p.Eval()); - - var = a_fVar2; - fVal[1] = getOrThrow(p.Eval()); - - if (fabs(a_fRes1 - fVal[0]) > 0.0000000001) - throw std::runtime_error("incorrect result (first pass)"); - - if (fabs(a_fRes2 - fVal[1]) > 0.0000000001) - throw std::runtime_error("incorrect result (second pass)"); - } catch (Parser::exception_type &e) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (") << e.GetMsg() << _T(")"); - return 1; - } catch (std::exception &e) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (") << e.what() << _T(")"); - return 1; // always return a failure since this exception is not expected - } catch (...) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (unexpected exception)"); - return 1; // exceptions other than ParserException are not allowed - } - - return 0; -} - -//--------------------------------------------------------------------------- -/** \brief Evaluate a tet expression. - - \return 1 in case of a failure, 0 otherwise. -*/ -int ParserTester::EqnTest(const string_type &a_str, double a_fRes, bool a_fPass) { - ParserTester::c_iCount++; - int iRet(0); - value_type fVal[] = {-999, -998, -997}; // initially should be different - - try { - std::auto_ptr p1; - Parser p2, p3; // three parser objects - // they will be used for testing copy and assignment operators - // p1 is a pointer since i'm going to delete it in order to test if - // parsers after copy construction still refer to members of it. - // !! If this is the case this function will crash !! - - p1.reset(new mu::Parser()); - // Add constants - throwIfError(p1->DefineConst(_T("pi"), (value_type)PARSER_CONST_PI)); - throwIfError(p1->DefineConst(_T("e"), (value_type)PARSER_CONST_E)); - throwIfError(p1->DefineConst(_T("const"), 1)); - throwIfError(p1->DefineConst(_T("const1"), 2)); - throwIfError(p1->DefineConst(_T("const2"), 3)); - // string constants - throwIfError(p1->DefineStrConst(_T("str1"), _T("1.11"))); - throwIfError(p1->DefineStrConst(_T("str2"), _T("2.22"))); - // variables - value_type vVarVal[] = {1, 2, 3, -2}; - throwIfError(p1->DefineVar(_T("a"), &vVarVal[0])); - throwIfError(p1->DefineVar(_T("aa"), &vVarVal[1])); - throwIfError(p1->DefineVar(_T("b"), &vVarVal[1])); - throwIfError(p1->DefineVar(_T("c"), &vVarVal[2])); - throwIfError(p1->DefineVar(_T("d"), &vVarVal[3])); - - // custom value ident functions - p1->AddValIdent(&ParserTester::IsHexVal); - - // functions - throwIfError(p1->DefineFun(_T("ping"), Ping)); - throwIfError(p1->DefineFun(_T("f1of1"), f1of1)); // one parameter - throwIfError(p1->DefineFun(_T("f1of2"), f1of2)); // two parameter - throwIfError(p1->DefineFun(_T("f2of2"), f2of2)); - throwIfError(p1->DefineFun(_T("f1of3"), f1of3)); // three parameter - throwIfError(p1->DefineFun(_T("f2of3"), f2of3)); - throwIfError(p1->DefineFun(_T("f3of3"), f3of3)); - - // binary operators - throwIfError(p1->DefineOprt(_T("add"), add, 0)); - throwIfError(p1->DefineOprt(_T("++"), add, 0)); - throwIfError(p1->DefineOprt(_T("&"), land, prLAND)); - - // sample functions - throwIfError(p1->DefineFun(_T("min"), Min)); - throwIfError(p1->DefineFun(_T("max"), Max)); - throwIfError(p1->DefineFun(_T("sum"), Sum)); - throwIfError(p1->DefineFun(_T("valueof"), ValueOf)); - throwIfError(p1->DefineFun(_T("atof"), StrToFloat)); - throwIfError(p1->DefineFun(_T("strfun1"), StrFun1)); - throwIfError(p1->DefineFun(_T("strfun2"), StrFun2)); - throwIfError(p1->DefineFun(_T("strfun3"), StrFun3)); - throwIfError(p1->DefineFun(_T("lastArg"), LastArg)); - throwIfError(p1->DefineFun(_T("firstArg"), FirstArg)); - throwIfError(p1->DefineFun(_T("order"), FirstArg)); - - // infix / postfix operator - // Note: Identifiers used here do not have any meaning - // they are mere placeholders to test certain features. - throwIfError(p1->DefineInfixOprt(_T("$"), sign, prPOW + 1)); // sign with high priority - throwIfError(p1->DefineInfixOprt(_T("~"), plus2)); // high priority - throwIfError(p1->DefineInfixOprt(_T("~~"), plus2)); - throwIfError(p1->DefinePostfixOprt(_T("{m}"), Milli)); - throwIfError(p1->DefinePostfixOprt(_T("{M}"), Mega)); - throwIfError(p1->DefinePostfixOprt(_T("m"), Milli)); - throwIfError(p1->DefinePostfixOprt(_T("meg"), Mega)); - throwIfError(p1->DefinePostfixOprt(_T("#"), times3)); - throwIfError(p1->DefinePostfixOprt(_T("'"), sqr)); - throwIfError(p1->SetExpr(a_str)); - - // Test bytecode integrity - // String parsing and bytecode parsing must yield the same result - fVal[0] = getOrThrow(p1->Eval()); // result from stringparsing - fVal[1] = getOrThrow(p1->Eval()); // result from bytecode - if (fVal[0] != fVal[1]) - throw Parser::exception_type(_T("Bytecode / string parsing mismatch.")); - - // Test Eval function for multiple return values. - std::vector v; - p1->Eval(&v); - fVal[2] = *v.back(); - - // limited floating point accuracy requires the following test - bool bCloseEnough(true); - for (unsigned i = 0; i < sizeof(fVal) / sizeof(value_type); ++i) { - bCloseEnough &= (fabs(a_fRes - fVal[i]) <= fabs(fVal[i] * 0.00001)); - -// The tests equations never result in infinity, if they do thats a bug. -// reference: -// http://sourceforge.net/projects/muparser/forums/forum/462843/topic/5037825 -#pragma warning(push) -#pragma warning(disable : 4127) - if (std::numeric_limits::has_infinity) -#pragma warning(pop) - { - bCloseEnough &= (fabs(fVal[i]) != numeric_limits::infinity()); - } - } - - iRet = ((bCloseEnough && a_fPass) || (!bCloseEnough && !a_fPass)) ? 0 : 1; - - if (iRet == 1) { - mu::console() << _T("\n fail: ") << a_str.c_str() - << _T(" (incorrect result; expected: ") << a_fRes << _T(" ;calculated: ") - << fVal[0] << _T(",") << fVal[1] << _T(",") << fVal[2] << _T(",") - << _T(")."); - } - } catch (Parser::exception_type &e) { - if (a_fPass) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (") << e.GetMsg() << _T(")"); - return 1; - } - } catch (std::exception &e) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (") << e.what() << _T(")"); - return 1; // always return a failure since this exception is not expected - } catch (...) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (unexpected exception)"); - return 1; // exceptions other than ParserException are not allowed - } - - return iRet; -} - -//--------------------------------------------------------------------------- -int ParserTester::EqnTestInt(const string_type &a_str, double a_fRes, bool a_fPass) { - ParserTester::c_iCount++; - - value_type vVarVal[] = {1, 2, 3}; // variable values - int iRet(0); - - try { - value_type fVal[2] = {-99, -999}; // results: initially should be different - ParserInt p; - throwIfError(p.DefineConst(_T("const1"), 1)); - throwIfError(p.DefineConst(_T("const2"), 2)); - throwIfError(p.DefineVar(_T("a"), &vVarVal[0])); - throwIfError(p.DefineVar(_T("b"), &vVarVal[1])); - throwIfError(p.DefineVar(_T("c"), &vVarVal[2])); - - throwIfError((p.SetExpr(a_str))); - fVal[0] = getOrThrow(p.Eval()); // result from stringparsing - fVal[1] = getOrThrow(p.Eval()); // result from bytecode - - if (fVal[0] != fVal[1]) throw Parser::exception_type(_T("Bytecode corrupt.")); - - iRet = ((a_fRes == fVal[0] && a_fPass) || (a_fRes != fVal[0] && !a_fPass)) ? 0 : 1; - if (iRet == 1) { - mu::console() << _T("\n fail: ") << a_str.c_str() - << _T(" (incorrect result; expected: ") << a_fRes << _T(" ;calculated: ") - << fVal[0] << _T(")."); - } - } catch (Parser::exception_type &e) { - if (a_fPass) { - mu::console() << _T("\n fail: ") << e.GetMsg(); - iRet = 1; - } - } catch (...) { - mu::console() << _T("\n fail: ") << a_str.c_str() << _T(" (unexpected exception)"); - iRet = 1; // exceptions other than ParserException are not allowed - } - - return iRet; -} - -//--------------------------------------------------------------------------- -/** \brief Internal error in test class Test is going to be aborted. */ -void ParserTester::Abort() const { - mu::console() << _T("Test failed (internal error in test class)") << endl; - while (!getchar()) - ; - exit(-1); -} -} // namespace test -} // namespace mu diff --git a/muparser-2.2.5/src/muParserTokenReader.cpp b/muparser-2.2.5/src/muParserTokenReader.cpp deleted file mode 100644 index 13090e5fc..000000000 --- a/muparser-2.2.5/src/muParserTokenReader.cpp +++ /dev/null @@ -1,752 +0,0 @@ -/* - __________ - _____ __ __\______ \_____ _______ ______ ____ _______ - / \ | | \| ___/\__ \ \_ __ \/ ___/_/ __ \\_ __ \ - | Y Y \| | /| | / __ \_| | \/\___ \ \ ___/ | | \/ - |__|_| /|____/ |____| (____ /|__| /____ > \___ >|__| - \/ \/ \/ \/ - Copyright (C) 2013 Ingo Berg - - Permission is hereby granted, free of charge, to any person obtaining a copy of this - software and associated documentation files (the "Software"), to deal in the Software - without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to the following conditions: - - 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. -*/ -#include -#include -#include -#include -#include -#include - -#include "muParserBase.h" -#include "muParserTokenReader.h" - -/** \file - \brief This file contains the parser token reader implementation. -*/ - -namespace mu { - -//--------------------------------------------------------------------------- -/** \brief Constructor. - - Create a Token reader and bind it to a parser object. - - \pre [assert] a_pParser may not be NULL - \post #m_pParser==a_pParser - \param a_pParent Parent parser object of the token reader. -*/ -ParserTokenReader::ParserTokenReader(ParserBase *a_pParent) { - assert(a_pParent && "Missing parent"); - SetParent(a_pParent); -} - -//--------------------------------------------------------------------------- -ParserTokenReader::token_type &ParserTokenReader::SaveBeforeReturn(const token_type &tok) { - m_lastTok = tok; - return m_lastTok; -} - -//--------------------------------------------------------------------------- -void ParserTokenReader::AddValIdent(identfun_type a_pCallback) { - // Use push_front is used to give user defined callbacks a higher priority than - // the built in ones. Otherwise reading hex numbers would not work - // since the "0" in "0xff" would always be read first making parsing of - // the rest impossible. - // reference: - // http://sourceforge.net/projects/muparser/forums/forum/462843/topic/4824956 - m_vIdentFun.push_front(a_pCallback); -} - -//--------------------------------------------------------------------------- -void ParserTokenReader::SetVarCreator(facfun_type a_pFactory, void *pUserData) { - m_pFactory = a_pFactory; - m_pFactoryData = pUserData; -} - -//--------------------------------------------------------------------------- -/** \brief Return the current position of the token reader in the formula string. - - \return #m_iPos -*/ -int ParserTokenReader::GetPos() const { return m_iPos; } - -//--------------------------------------------------------------------------- -/** \brief Return a reference to the formula. - - \return #m_strFormula -*/ -const string_type &ParserTokenReader::GetExpr() const { return m_strFormula; } - -//--------------------------------------------------------------------------- -/** \brief Initialize the token Reader. - - Sets the formula position index to zero and set Syntax flags to default for initial formula - parsing. - \pre [assert] triggered if a_szFormula==0 -*/ -void ParserTokenReader::SetFormula(const string_type &a_strFormula) { - m_strFormula = a_strFormula; - ReInit(); -} - -//--------------------------------------------------------------------------- -/** \brief Set Flag that controls behaviour in case of undefined variables being found. - - If true, the parser does not throw an exception if an undefined variable is found. - otherwise it does. This variable is used internally only! - It suppresses a "undefined variable" exception in GetUsedVar(). - Those function should return a complete list of variables including - those the are not defined by the time of it's call. -*/ -void ParserTokenReader::IgnoreUndefVar(bool bIgnore) { m_bIgnoreUndefVar = bIgnore; } - -//--------------------------------------------------------------------------- -/** \brief Reset the token reader to the start of the formula. - - The syntax flags will be reset to a value appropriate for the - start of a formula. - \post #m_iPos==0, #m_iSynFlags = noOPT | noBC | noPOSTOP | noSTR - \sa ESynCodes -*/ -void ParserTokenReader::ReInit() { - m_iPos = 0; - m_iSynFlags = sfSTART_OF_LINE; - m_iBrackets = 0; - m_UsedVar.clear(); - m_lastTok = token_type(); -} - -//--------------------------------------------------------------------------- -/** \brief Read the next token from the string. */ -ParserTokenReader::token_type ParserTokenReader::ReadNextToken() { - assert(m_pParser); - - const char_type *szFormula = m_strFormula.c_str(); - token_type tok; - - // Ignore all non printable characters when reading the expression - while (szFormula[m_iPos] > 0 && szFormula[m_iPos] <= 0x20) ++m_iPos; - - if (IsEOF(tok)) return SaveBeforeReturn(tok); // Check for end of formula - if (IsOprt(tok)) return SaveBeforeReturn(tok); // Check for user defined binary operator - if (IsFunTok(tok)) return SaveBeforeReturn(tok); // Check for function token - if (IsBuiltIn(tok)) return SaveBeforeReturn(tok); // Check built in operators / tokens - if (IsArgSep(tok)) return SaveBeforeReturn(tok); // Check for function argument separators - if (IsValTok(tok)) return SaveBeforeReturn(tok); // Check for values / constant tokens - if (IsVarTok(tok)) return SaveBeforeReturn(tok); // Check for variable tokens - if (IsStrVarTok(tok)) return SaveBeforeReturn(tok); // Check for string variables - if (IsString(tok)) return SaveBeforeReturn(tok); // Check for String tokens - if (IsInfixOpTok(tok)) return SaveBeforeReturn(tok); // Check for unary operators - if (IsPostOpTok(tok)) return SaveBeforeReturn(tok); // Check for unary operators - - // Check String for undefined variable token. Done only if a - // flag is set indicating to ignore undefined variables. - // This is a way to conditionally avoid an error if - // undefined variables occur. - // (The GetUsedVar function must suppress the error for - // undefined variables in order to collect all variable - // names including the undefined ones.) - if ((m_bIgnoreUndefVar || m_pFactory) && IsUndefVarTok(tok)) return SaveBeforeReturn(tok); - - // Check for unknown token - // - // !!! From this point on there is no exit without an error possible... - // - string_type strTok; - int iEnd = ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos); - if (iEnd != m_iPos) { - Error(ecUNASSIGNABLE_TOKEN, m_iPos, strTok); - return {}; - } - - Error(ecUNASSIGNABLE_TOKEN, m_iPos, m_strFormula.substr(m_iPos)); - return {}; -} - -//--------------------------------------------------------------------------- -void ParserTokenReader::SetParent(ParserBase *a_pParent) { - m_pParser = a_pParent; - m_pFunDef = &a_pParent->m_FunDef; - m_pOprtDef = &a_pParent->m_OprtDef; - m_pInfixOprtDef = &a_pParent->m_InfixOprtDef; - m_pPostOprtDef = &a_pParent->m_PostOprtDef; - m_pVarDef = &a_pParent->m_VarDef; - m_pStrVarDef = &a_pParent->m_StrVarDef; - m_pConstDef = &a_pParent->m_ConstDef; -} - -//--------------------------------------------------------------------------- -/** \brief Extract all characters that belong to a certain charset. - - \param a_szCharSet [in] Const char array of the characters allowed in the token. - \param a_strTok [out] The string that consists entirely of characters listed in a_szCharSet. - \param a_iPos [in] Position in the string from where to start reading. - \return The Position of the first character not listed in a_szCharSet. -*/ -int ParserTokenReader::ExtractToken(const char_type *a_szCharSet, string_type &a_sTok, - int a_iPos) const { - int iEnd = (int)m_strFormula.find_first_not_of(a_szCharSet, a_iPos); - - if (iEnd == (int)string_type::npos) iEnd = (int)m_strFormula.length(); - - // Assign token string if there was something found - if (a_iPos != iEnd) - a_sTok = string_type(m_strFormula.begin() + a_iPos, m_strFormula.begin() + iEnd); - - return iEnd; -} - -//--------------------------------------------------------------------------- -/** \brief Check Expression for the presence of a binary operator token. - - Userdefined binary operator "++" gives inconsistent parsing result for - the equations "a++b" and "a ++ b" if alphabetic characters are allowed - in operator tokens. To avoid this this function checks specifically - for operator tokens. -*/ -int ParserTokenReader::ExtractOperatorToken(string_type &a_sTok, int a_iPos) const { - // Changed as per Issue 6: https://code.google.com/p/muparser/issues/detail?id=6 - int iEnd = (int)m_strFormula.find_first_not_of(m_pParser->ValidOprtChars(), a_iPos); - if (iEnd == (int)string_type::npos) iEnd = (int)m_strFormula.length(); - - // Assign token string if there was something found - if (a_iPos != iEnd) { - a_sTok = string_type(m_strFormula.begin() + a_iPos, m_strFormula.begin() + iEnd); - return iEnd; - } else { - // There is still the chance of having to deal with an operator consisting exclusively - // of alphabetic characters. - return ExtractToken(MUP_CHARS, a_sTok, a_iPos); - } -} - -//--------------------------------------------------------------------------- -/** \brief Check if a built in operator or other token can be found - \param a_Tok [out] Operator token if one is found. This can either be a binary operator or an - infix operator token. - \return true if an operator token has been found. -*/ -bool ParserTokenReader::IsBuiltIn(token_type &a_Tok) { - const char_type **const pOprtDef = m_pParser->GetOprtDef(), - *const szFormula = m_strFormula.c_str(); - - // Compare token with function and operator strings - // check string for operator/function - for (int i = 0; pOprtDef[i]; i++) { - std::size_t len(std::char_traits::length(pOprtDef[i])); - if (string_type(pOprtDef[i]) == string_type(szFormula + m_iPos, szFormula + m_iPos + len)) { - switch (i) { - // case cmAND: - // case cmOR: - // case cmXOR: - case cmLAND: - case cmLOR: - case cmLT: - case cmGT: - case cmLE: - case cmGE: - case cmNEQ: - case cmEQ: - case cmADD: - case cmSUB: - case cmMUL: - case cmDIV: - case cmPOW: - case cmASSIGN: - // if (len!=sTok.length()) - // continue; - - // The assignment operator need special treatment - if (i == cmASSIGN && m_iSynFlags & noASSIGN) - return Error(ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef[i]); - - if (!m_pParser->HasBuiltInOprt()) continue; - if (m_iSynFlags & noOPT) { - // Maybe its an infix operator not an operator - // Both operator types can share characters in - // their identifiers - if (IsInfixOpTok(a_Tok)) return true; - - return Error(ecUNEXPECTED_OPERATOR, m_iPos, pOprtDef[i]); - } - - m_iSynFlags = - noBC | noOPT | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE | noEND; - break; - - case cmBO: - if (m_iSynFlags & noBO) return Error(ecUNEXPECTED_PARENS, m_iPos, pOprtDef[i]); - - if (m_lastTok.GetCode() == cmFUNC) - m_iSynFlags = - noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - else - m_iSynFlags = - noBC | noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN | noIF | noELSE; - - ++m_iBrackets; - break; - - case cmBC: - if (m_iSynFlags & noBC) return Error(ecUNEXPECTED_PARENS, m_iPos, pOprtDef[i]); - - m_iSynFlags = noBO | noVAR | noVAL | noFUN | noINFIXOP | noSTR | noASSIGN; - - if (--m_iBrackets < 0) return Error(ecUNEXPECTED_PARENS, m_iPos, pOprtDef[i]); - break; - - case cmELSE: - if (m_iSynFlags & noELSE) - return Error(ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef[i]); - - m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; - break; - - case cmIF: - if (m_iSynFlags & noIF) - return Error(ecUNEXPECTED_CONDITIONAL, m_iPos, pOprtDef[i]); - - m_iSynFlags = noBC | noPOSTOP | noEND | noOPT | noIF | noELSE; - break; - - default: // The operator is listed in c_DefaultOprt, but not here. This is a bad - // thing... - assert(0 && "missing operator in muParser"); - } // switch operator id - - m_iPos += (int)len; - a_Tok.Set((ECmdCode)i, pOprtDef[i]); - return true; - } // if operator string found - } // end of for all operator strings - - return false; -} - -//--------------------------------------------------------------------------- -bool ParserTokenReader::IsArgSep(token_type &a_Tok) { - const char_type *szFormula = m_strFormula.c_str(); - - if (szFormula[m_iPos] == m_cArgSep) { - // copy the separator into null terminated string - char_type szSep[2]; - szSep[0] = m_cArgSep; - szSep[1] = 0; - - if (m_iSynFlags & noARG_SEP) return Error(ecUNEXPECTED_ARG_SEP, m_iPos, szSep); - - m_iSynFlags = noBC | noOPT | noEND | noARG_SEP | noPOSTOP | noASSIGN; - m_iPos++; - a_Tok.Set(cmARG_SEP, szSep); - return true; - } - - return false; -} - -//--------------------------------------------------------------------------- -/** \brief Check for End of Formula. - - \return true if an end of formula is found false otherwise. - \param a_Tok [out] If an eof is found the corresponding token will be stored there. - \sa IsOprt, IsFunTok, IsStrFunTok, IsValTok, IsVarTok, IsString, IsInfixOpTok, IsPostOpTok -*/ -bool ParserTokenReader::IsEOF(token_type &a_Tok) { - const char_type *szFormula = m_strFormula.c_str(); - - // check for EOF - if (!szFormula[m_iPos] /*|| szFormula[m_iPos] == '\n'*/) { - if (m_iSynFlags & noEND) return Error(ecUNEXPECTED_EOF, m_iPos); - - if (m_iBrackets > 0) return Error(ecMISSING_PARENS, m_iPos, _T(")")); - - m_iSynFlags = 0; - a_Tok.Set(cmEND); - return true; - } - - return false; -} - -//--------------------------------------------------------------------------- -/** \brief Check if a string position contains a unary infix operator. - \return true if a function token has been found false otherwise. -*/ -bool ParserTokenReader::IsInfixOpTok(token_type &a_Tok) { - string_type sTok; - int iEnd = ExtractToken(m_pParser->ValidInfixOprtChars(), sTok, m_iPos); - if (iEnd == m_iPos) return false; - - // iterate over all postfix operator strings - funmap_type::const_reverse_iterator it = m_pInfixOprtDef->rbegin(); - for (; it != m_pInfixOprtDef->rend(); ++it) { - if (sTok.find(it->first) != 0) continue; - - a_Tok.Set(it->second, it->first); - m_iPos += (int)it->first.length(); - - if (m_iSynFlags & noINFIXOP) - return Error(ecUNEXPECTED_OPERATOR, m_iPos, a_Tok.GetAsString()); - - m_iSynFlags = noPOSTOP | noINFIXOP | noOPT | noBC | noSTR | noASSIGN; - return true; - } - - return false; - - /* - a_Tok.Set(item->second, sTok); - m_iPos = (int)iEnd; - - if (m_iSynFlags & noINFIXOP) - return Error(ecUNEXPECTED_OPERATOR, m_iPos, a_Tok.GetAsString()); - - m_iSynFlags = noPOSTOP | noINFIXOP | noOPT | noBC | noSTR | noASSIGN; - return true; - */ -} - -//--------------------------------------------------------------------------- -/** \brief Check whether the token at a given position is a function token. - \param a_Tok [out] If a value token is found it will be placed here. - \throw ParserException if Syntaxflags do not allow a function at a_iPos - \return true if a function token has been found false otherwise. - \pre [assert] m_pParser!=0 -*/ -bool ParserTokenReader::IsFunTok(token_type &a_Tok) { - string_type strTok; - int iEnd = ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos); - if (iEnd == m_iPos) return false; - - funmap_type::const_iterator item = m_pFunDef->find(strTok); - if (item == m_pFunDef->end()) return false; - - // Check if the next sign is an opening bracket - const char_type *szFormula = m_strFormula.c_str(); - if (szFormula[iEnd] != '(') return false; - - a_Tok.Set(item->second, strTok); - - m_iPos = (int)iEnd; - if (m_iSynFlags & noFUN) - return Error(ecUNEXPECTED_FUN, m_iPos - (int)a_Tok.GetAsString().length(), - a_Tok.GetAsString()); - - m_iSynFlags = noANY ^ noBO; - return true; -} - -//--------------------------------------------------------------------------- -/** \brief Check if a string position contains a binary operator. - \param a_Tok [out] Operator token if one is found. This can either be a binary operator or an - infix operator token. - \return true if an operator token has been found. -*/ -bool ParserTokenReader::IsOprt(token_type &a_Tok) { - const char_type *const szExpr = m_strFormula.c_str(); - string_type strTok; - - int iEnd = ExtractOperatorToken(strTok, m_iPos); - if (iEnd == m_iPos) return false; - - // Check if the operator is a built in operator, if so ignore it here - const char_type **const pOprtDef = m_pParser->GetOprtDef(); - for (int i = 0; m_pParser->HasBuiltInOprt() && pOprtDef[i]; ++i) { - if (string_type(pOprtDef[i]) == strTok) return false; - } - - // Note: - // All tokens in oprt_bin_maptype are have been sorted by their length - // Long operators must come first! Otherwise short names (like: "add") that - // are part of long token names (like: "add123") will be found instead - // of the long ones. - // Length sorting is done with ascending length so we use a reverse iterator here. - funmap_type::const_reverse_iterator it = m_pOprtDef->rbegin(); - for (; it != m_pOprtDef->rend(); ++it) { - const string_type &sID = it->first; - if (sID == string_type(szExpr + m_iPos, szExpr + m_iPos + sID.length())) { - a_Tok.Set(it->second, strTok); - - // operator was found - if (m_iSynFlags & noOPT) { - // An operator was found but is not expected to occur at - // this position of the formula, maybe it is an infix - // operator, not a binary operator. Both operator types - // can share characters in their identifiers. - if (IsInfixOpTok(a_Tok)) - return true; - else { - // nope, no infix operator - return false; - // return Error(ecUNEXPECTED_OPERATOR, m_iPos, a_Tok.GetAsString()); - } - } - - m_iPos += (int)sID.length(); - m_iSynFlags = noBC | noOPT | noARG_SEP | noPOSTOP | noEND | noASSIGN; - return true; - } - } - - return false; -} - -//--------------------------------------------------------------------------- -/** \brief Check if a string position contains a unary post value operator. */ -bool ParserTokenReader::IsPostOpTok(token_type &a_Tok) { - // Do not check for postfix operators if they are not allowed at - // the current expression index. - // - // This will fix the bug reported here: - // - // http://sourceforge.net/tracker/index.php?func=detail&aid=3343891&group_id=137191&atid=737979 - // - if (m_iSynFlags & noPOSTOP) return false; - // - - // Tricky problem with equations like "3m+5": - // m is a postfix operator, + is a valid sign for postfix operators and - // for binary operators parser detects "m+" as operator string and - // finds no matching postfix operator. - // - // This is a special case so this routine slightly differs from the other - // token readers. - - // Test if there could be a postfix operator - string_type sTok; - int iEnd = ExtractToken(m_pParser->ValidOprtChars(), sTok, m_iPos); - if (iEnd == m_iPos) return false; - - // iterate over all postfix operator strings - funmap_type::const_reverse_iterator it = m_pPostOprtDef->rbegin(); - for (; it != m_pPostOprtDef->rend(); ++it) { - if (sTok.find(it->first) != 0) continue; - - a_Tok.Set(it->second, sTok); - m_iPos += (int)it->first.length(); - - m_iSynFlags = noVAL | noVAR | noFUN | noBO | noPOSTOP | noSTR | noASSIGN; - return true; - } - - return false; -} - -//--------------------------------------------------------------------------- -/** \brief Check whether the token at a given position is a value token. - - Value tokens are either values or constants. - - \param a_Tok [out] If a value token is found it will be placed here. - \return true if a value token has been found. -*/ -bool ParserTokenReader::IsValTok(token_type &a_Tok) { - assert(m_pConstDef); - assert(m_pParser); - - string_type strTok; - value_type fVal(0); - int iEnd(0); - - // 2.) Check for user defined constant - // Read everything that could be a constant name - iEnd = ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos); - if (iEnd != m_iPos) { - valmap_type::const_iterator item = m_pConstDef->find(strTok); - if (item != m_pConstDef->end()) { - m_iPos = iEnd; - a_Tok.SetVal(item->second, strTok); - - if (m_iSynFlags & noVAL) - return Error(ecUNEXPECTED_VAL, m_iPos - (int)strTok.length(), strTok); - - m_iSynFlags = noVAL | noVAR | noFUN | noBO | noINFIXOP | noSTR | noASSIGN; - return true; - } - } - - // 3.call the value recognition functions provided by the user - // Call user defined value recognition functions - std::list::const_iterator item = m_vIdentFun.begin(); - for (item = m_vIdentFun.begin(); item != m_vIdentFun.end(); ++item) { - int iStart = m_iPos; - if ((*item)(m_strFormula.c_str() + m_iPos, &m_iPos, &fVal) == 1) { - // 2013-11-27 Issue 2: https://code.google.com/p/muparser/issues/detail?id=2 - strTok.assign(m_strFormula.c_str(), iStart, m_iPos - iStart); - - if (m_iSynFlags & noVAL) - return Error(ecUNEXPECTED_VAL, m_iPos - (int)strTok.length(), strTok); - - a_Tok.SetVal(fVal, strTok); - m_iSynFlags = noVAL | noVAR | noFUN | noBO | noINFIXOP | noSTR | noASSIGN; - return true; - } - } - - return false; -} - -//--------------------------------------------------------------------------- -/** \brief Check wheter a token at a given position is a variable token. - \param a_Tok [out] If a variable token has been found it will be placed here. - \return true if a variable token has been found. -*/ -bool ParserTokenReader::IsVarTok(token_type &a_Tok) { - if (m_pVarDef->empty()) return false; - - string_type strTok; - int iEnd = ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos); - if (iEnd == m_iPos) return false; - - varmap_type::const_iterator item = m_pVarDef->find(strTok); - if (item == m_pVarDef->end()) return false; - - if (m_iSynFlags & noVAR) return Error(ecUNEXPECTED_VAR, m_iPos, strTok); - - m_iPos = iEnd; - a_Tok.SetVar(item->second, strTok); - m_UsedVar[item->first] = item->second; // Add variable to used-var-list - - m_iSynFlags = noVAL | noVAR | noFUN | noBO | noINFIXOP | noSTR; - - // Zur Info hier die SynFlags von IsVal(): - // m_iSynFlags = noVAL | noVAR | noFUN | noBO | noINFIXOP | noSTR | noASSIGN; - return true; -} - -//--------------------------------------------------------------------------- -bool ParserTokenReader::IsStrVarTok(token_type &a_Tok) { - if (!m_pStrVarDef || m_pStrVarDef->empty()) return false; - - string_type strTok; - int iEnd = ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos); - if (iEnd == m_iPos) return false; - - strmap_type::const_iterator item = m_pStrVarDef->find(strTok); - if (item == m_pStrVarDef->end()) return false; - - if (m_iSynFlags & noSTR) return Error(ecUNEXPECTED_VAR, m_iPos, strTok); - - m_iPos = iEnd; - if (!m_pParser->m_vStringVarBuf.size()) assert(0 && "muParser internal error"); - - a_Tok.SetString(m_pParser->m_vStringVarBuf[item->second], m_pParser->m_vStringVarBuf.size()); - - m_iSynFlags = noANY ^ (noBC | noOPT | noEND | noARG_SEP); - return true; -} - -//--------------------------------------------------------------------------- -/** \brief Check wheter a token at a given position is an undefined variable. - - \param a_Tok [out] If a variable tom_pParser->m_vStringBufken has been found it will be placed - here. - \return true if a variable token has been found. -*/ -bool ParserTokenReader::IsUndefVarTok(token_type &a_Tok) { - string_type strTok; - int iEnd(ExtractToken(m_pParser->ValidNameChars(), strTok, m_iPos)); - if (iEnd == m_iPos) return false; - - if (m_iSynFlags & noVAR) { - // 20061021 added token string strTok instead of a_Tok.GetAsString() as the - // token identifier. - // related bug report: - // http://sourceforge.net/tracker/index.php?func=detail&aid=1578779&group_id=137191&atid=737979 - return Error(ecUNEXPECTED_VAR, m_iPos - (int)a_Tok.GetAsString().length(), strTok); - } - - // If a factory is available implicitely create new variables - if (m_pFactory) { - value_type *fVar = m_pFactory(strTok.c_str(), m_pFactoryData); - a_Tok.SetVar(fVar, strTok); - - // Do not use m_pParser->DefineVar( strTok, fVar ); - // in order to define the new variable, it will clear the - // m_UsedVar array which will kill previously defined variables - // from the list - // This is safe because the new variable can never override an existing one - // because they are checked first! - (*m_pVarDef)[strTok] = fVar; - m_UsedVar[strTok] = fVar; // Add variable to used-var-list - } else { - a_Tok.SetVar((value_type *)&m_fZero, strTok); - m_UsedVar[strTok] = 0; // Add variable to used-var-list - } - - m_iPos = iEnd; - - // Call the variable factory in order to let it define a new parser variable - m_iSynFlags = noVAL | noVAR | noFUN | noBO | noPOSTOP | noINFIXOP | noSTR; - return true; -} - -//--------------------------------------------------------------------------- -/** \brief Check wheter a token at a given position is a string. - \param a_Tok [out] If a variable token has been found it will be placed here. - \return true if a string token has been found. - \sa IsOprt, IsFunTok, IsStrFunTok, IsValTok, IsVarTok, IsEOF, IsInfixOpTok, IsPostOpTok -*/ -bool ParserTokenReader::IsString(token_type &a_Tok) { - if (m_strFormula[m_iPos] != '"') return false; - - string_type strBuf(&m_strFormula[m_iPos + 1]); - std::size_t iEnd(0), iSkip(0); - - // parser over escaped '\"' end replace them with '"' - for (iEnd = (int)strBuf.find(_T("\"")); iEnd != 0 && iEnd != string_type::npos; - iEnd = (int)strBuf.find(_T("\""), iEnd)) { - if (strBuf[iEnd - 1] != '\\') break; - strBuf.replace(iEnd - 1, 2, _T("\"")); - iSkip++; - } - - if (iEnd == string_type::npos) return Error(ecUNTERMINATED_STRING, m_iPos, _T("\"")); - - string_type strTok(strBuf.begin(), strBuf.begin() + iEnd); - - if (m_iSynFlags & noSTR) return Error(ecUNEXPECTED_STR, m_iPos, strTok); - - m_pParser->m_vStringBuf.push_back(strTok); // Store string in internal buffer - a_Tok.SetString(strTok, m_pParser->m_vStringBuf.size()); - - m_iPos += (int)strTok.length() + 2 + - (int)iSkip; // +2 wg Anführungszeichen; +iSkip für entfernte escape zeichen - m_iSynFlags = noANY ^ (noARG_SEP | noBC | noOPT | noEND); - - return true; -} - -//--------------------------------------------------------------------------- -/** \brief Create an error containing the parse error position. Store it in parseError_, if not - already set. - - \param a_iErrc [in] The error code of type #EErrorCodes. - \param a_iPos [in] The position where the error was detected. - \param a_strTok [in] The token string representation associated with the error. -*/ -bool ParserTokenReader::Error(EErrorCodes a_iErrc, int a_iPos, const string_type &a_sTok) { - if (!firstError_.has_error()) { - firstError_ = m_pParser->Error(a_iErrc, a_iPos, a_sTok); - } - return false; -} - -//--------------------------------------------------------------------------- -void ParserTokenReader::SetArgSep(char_type cArgSep) { m_cArgSep = cArgSep; } - -//--------------------------------------------------------------------------- -char_type ParserTokenReader::GetArgSep() const { return m_cArgSep; } -} // namespace mu diff --git a/src/builtin_math.cpp b/src/builtin_math.cpp index e86e6039a..1618307c2 100644 --- a/src/builtin_math.cpp +++ b/src/builtin_math.cpp @@ -7,6 +7,8 @@ #include #include +#include "tinyexpr.h" + #include "builtin.h" #include "builtin_math.h" #include "common.h" @@ -15,10 +17,6 @@ #include "wgetopt.h" #include "wutil.h" // IWYU pragma: keep -#include "muParser.h" -#include "muParserBase.h" -#include "muParserDef.h" - struct math_cmd_opts_t { bool print_help = false; int scale = 0; @@ -115,44 +113,53 @@ static const wchar_t *math_get_arg(int *argidx, wchar_t **argv, wcstring *storag return math_get_arg_argv(argidx, argv); } -/// Implement integer modulo math operator. -static mu::ValueOrError moduloOperator(double v, double w) { return (int)v % std::max(1, (int)w); }; +wcstring math_describe_error(te_error_t& error) { + if (error.position == 0) return L"NO ERROR?!?"; + assert(error.type != TE_ERROR_NONE && L"Error has no position"); + + switch(error.type) { + case TE_ERROR_UNKNOWN_VARIABLE: return _(L"Unknown variable"); + case TE_ERROR_MISSING_CLOSING_PAREN: return _(L"Missing closing parenthesis"); + case TE_ERROR_MISSING_OPENING_PAREN: return _(L"Missing opening parenthesis"); + case TE_ERROR_TOO_FEW_ARGS: return _(L"Too few arguments"); + case TE_ERROR_TOO_MANY_ARGS: return _(L"Too many arguments"); + case TE_ERROR_MISSING_OPERATOR: return _(L"Missing operator"); + case TE_ERROR_UNKNOWN: return _(L"Expression is bogus"); + default: return L"Unknown error"; + } +} /// Evaluate math expressions. static int evaluate_expression(const wchar_t *cmd, parser_t &parser, io_streams_t &streams, math_cmd_opts_t &opts, wcstring &expression) { UNUSED(parser); - // Helper to print an error and return an error code. - auto printError = [&streams, cmd](const mu::ParserError &err) { - streams.err.append_format(_(L"%ls: Invalid expression: %ls\n"), cmd, err.GetMsg().c_str()); - return STATUS_CMD_ERROR; - }; + int retval = STATUS_CMD_OK; + te_error_t error; + char *narrow_str = wcs2str(expression); + // Switch locale while computing stuff. + // This means that the "." is always the radix character, + // so numbers work the same across locales. + char *saved_locale = strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); + double v = te_interp(narrow_str, &error); - mu::Parser p; - // MuParser doesn't implement the modulo operator so we add it ourselves since there are - // likely users of our old math wrapper around bc that expect it to be available. - p.DefineOprtChars(L"%"); - mu::OptionalError oerr = p.DefineOprt(L"%", moduloOperator, mu::prINFIX); - assert(!oerr.has_error() && "Unexpected error defining modulo operator"); - (void)oerr; - - oerr = p.SetExpr(expression); - if (oerr.has_error()) return printError(oerr.error()); - - std::vector vs; - p.Eval(&vs); - for (const mu::ValueOrError &v : vs) { - if (v.has_error()) return printError(v.error()); - } - for (const mu::ValueOrError &v : vs) { + if (error.position == 0) { if (opts.scale == 0) { - streams.out.append_format(L"%ld\n", static_cast(*v)); + streams.out.append_format(L"%ld\n", static_cast(v)); } else { - streams.out.append_format(L"%.*lf\n", opts.scale, *v); + streams.out.append_format(L"%.*lf\n", opts.scale, v); } + } else { + streams.err.append_format(L"%ls: Error: %ls\n", cmd, math_describe_error(error).c_str()); + streams.err.append_format(L"'%ls'\n", expression.c_str()); + streams.err.append_format(L"%*lc^\n", error.position - 1, L' '); + retval = STATUS_CMD_ERROR; } - return STATUS_CMD_OK; + free(narrow_str); + setlocale(LC_NUMERIC, saved_locale); + free(saved_locale); + return retval; } /// The math builtin evaluates math expressions. diff --git a/src/tinyexpr.c b/src/tinyexpr.c new file mode 100755 index 000000000..a2ef44a77 --- /dev/null +++ b/src/tinyexpr.c @@ -0,0 +1,573 @@ +/* + * TINYEXPR - Tiny recursive descent parser and evaluation engine in C + * + * Copyright (c) 2015, 2016 Lewis Van Winkle + * + * http://CodePlea.com + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgement in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +// This version has been altered for inclusion in fish. +#include "tinyexpr.h" +#include +#include +#include +#include +#include + +typedef double (*te_fun2)(double, double); + +enum { + TOK_NULL = TE_FUNCTION0+16, TOK_ERROR, TOK_END, TOK_SEP, + TOK_OPEN, TOK_CLOSE, TOK_NUMBER, TOK_VARIABLE, TOK_INFIX +}; + + +enum {TE_CONSTANT = 1}; + + +typedef struct state { + const char *start; + const char *next; + int type; + union {double value; const double *bound; const void *function;}; + void *context; + + const te_variable *lookup; + int lookup_len; + te_error_type_t error; +} state; + + +#define TYPE_MASK(TYPE) ((TYPE)&0x0000001F) + +#define IS_PURE(TYPE) (((TYPE) & TE_FLAG_PURE) != 0) +#define IS_FUNCTION(TYPE) (((TYPE) & TE_FUNCTION0) != 0) +#define ARITY(TYPE) ( ((TYPE) & TE_FUNCTION0) ? ((TYPE) & 0x00000007) : 0 ) +#define NEW_EXPR(type, ...) new_expr((type), (const te_expr*[]){__VA_ARGS__}) + +static te_expr *new_expr(const int type, const te_expr *parameters[]) { + const int arity = ARITY(type); + const int psize = sizeof(void*) * arity; + const int size = (sizeof(te_expr) - sizeof(void*)) + psize; + te_expr *ret = malloc(size); + memset(ret, 0, size); + if (arity && parameters) { + memcpy(ret->parameters, parameters, psize); + } + ret->type = type; + ret->bound = 0; + return ret; +} + + +void te_free_parameters(te_expr *n) { + if (!n) return; + switch (TYPE_MASK(n->type)) { + case TE_FUNCTION7: te_free(n->parameters[6]); + case TE_FUNCTION6: te_free(n->parameters[5]); + case TE_FUNCTION5: te_free(n->parameters[4]); + case TE_FUNCTION4: te_free(n->parameters[3]); + case TE_FUNCTION3: te_free(n->parameters[2]); + case TE_FUNCTION2: te_free(n->parameters[1]); + case TE_FUNCTION1: te_free(n->parameters[0]); + } +} + + +void te_free(te_expr *n) { + if (!n) return; + te_free_parameters(n); + free(n); +} + + +static double pi() {return 3.14159265358979323846;} +static double e() {return 2.71828182845904523536;} +static double fac(double a) {/* simplest version of fac */ + if (a < 0.0) + return NAN; + if (a > UINT_MAX) + return INFINITY; + unsigned int ua = (unsigned int)(a); + unsigned long int result = 1, i; + for (i = 1; i <= ua; i++) { + if (i > ULONG_MAX / result) + return INFINITY; + result *= i; + } + return (double)result; +} +static double ncr(double n, double r) { + if (n < 0.0 || r < 0.0 || n < r) return NAN; + if (n > UINT_MAX || r > UINT_MAX) return INFINITY; + unsigned long int un = (unsigned int)(n), ur = (unsigned int)(r), i; + unsigned long int result = 1; + if (ur > un / 2) ur = un - ur; + for (i = 1; i <= ur; i++) { + if (result > ULONG_MAX / (un - ur + i)) + return INFINITY; + result *= un - ur + i; + result /= i; + } + return result; +} +static double npr(double n, double r) {return ncr(n, r) * fac(r);} + +static const te_variable functions[] = { + /* must be in alphabetical order */ + {"abs", fabs, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"acos", acos, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"asin", asin, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"atan", atan, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"atan2", atan2, TE_FUNCTION2 | TE_FLAG_PURE, 0}, + {"ceil", ceil, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"cos", cos, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"cosh", cosh, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"e", e, TE_FUNCTION0 | TE_FLAG_PURE, 0}, + {"exp", exp, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"fac", fac, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"floor", floor, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"ln", log, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"log", log10, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"log10", log10, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"ncr", ncr, TE_FUNCTION2 | TE_FLAG_PURE, 0}, + {"npr", npr, TE_FUNCTION2 | TE_FLAG_PURE, 0}, + {"pi", pi, TE_FUNCTION0 | TE_FLAG_PURE, 0}, + {"pow", pow, TE_FUNCTION2 | TE_FLAG_PURE, 0}, + {"sin", sin, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"sinh", sinh, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"sqrt", sqrt, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"tan", tan, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {"tanh", tanh, TE_FUNCTION1 | TE_FLAG_PURE, 0}, + {0, 0, 0, 0} +}; + +static const te_variable *find_builtin(const char *name, int len) { + int imin = 0; + int imax = sizeof(functions) / sizeof(te_variable) - 2; + + /*Binary search.*/ + while (imax >= imin) { + const int i = (imin + ((imax-imin)/2)); + int c = strncmp(name, functions[i].name, len); + if (!c) c = '\0' - functions[i].name[len]; + if (c == 0) { + return functions + i; + } else if (c > 0) { + imin = i + 1; + } else { + imax = i - 1; + } + } + + return 0; +} + +static const te_variable *find_lookup(const state *s, const char *name, int len) { + int iters; + const te_variable *var; + if (!s->lookup) return 0; + + for (var = s->lookup, iters = s->lookup_len; iters; ++var, --iters) { + if (strncmp(name, var->name, len) == 0 && var->name[len] == '\0') { + return var; + } + } + return 0; +} + + + +static double add(double a, double b) {return a + b;} +static double sub(double a, double b) {return a - b;} +static double mul(double a, double b) {return a * b;} +static double divide(double a, double b) {return a / b;} +static double negate(double a) {return -a;} + + +void next_token(state *s) { + s->type = TOK_NULL; + + do { + + if (!*s->next){ + s->type = TOK_END; + return; + } + + /* Try reading a number. */ + if ((s->next[0] >= '0' && s->next[0] <= '9') || s->next[0] == '.') { + s->value = strtod(s->next, (char**)&s->next); + s->type = TOK_NUMBER; + } else { + /* Look for a variable or builtin function call. */ + if (s->next[0] >= 'a' && s->next[0] <= 'z') { + const char *start; + start = s->next; + while ((s->next[0] >= 'a' && s->next[0] <= 'z') || (s->next[0] >= '0' && s->next[0] <= '9') || (s->next[0] == '_')) s->next++; + + const te_variable *var = find_lookup(s, start, s->next - start); + if (!var) var = find_builtin(start, s->next - start); + + if (var) { + switch(TYPE_MASK(var->type)) + { + case TE_VARIABLE: + s->type = TOK_VARIABLE; + s->bound = var->address; + break; + + case TE_FUNCTION0: case TE_FUNCTION1: case TE_FUNCTION2: case TE_FUNCTION3: + case TE_FUNCTION4: case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7: + s->type = var->type; + s->function = var->address; + break; + } + } else if (s->type != TOK_ERROR + || s->error == TE_ERROR_UNKNOWN) { + // Our error is more specific, so it takes precedence. + s->type = TOK_ERROR; + s->error = TE_ERROR_UNKNOWN_VARIABLE; + } + + } else { + /* Look for an operator or special character. */ + switch (s->next++[0]) { + case '+': s->type = TOK_INFIX; s->function = add; break; + case '-': s->type = TOK_INFIX; s->function = sub; break; + case '*': s->type = TOK_INFIX; s->function = mul; break; + case '/': s->type = TOK_INFIX; s->function = divide; break; + case '^': s->type = TOK_INFIX; s->function = pow; break; + case '%': s->type = TOK_INFIX; s->function = fmod; break; + case '(': s->type = TOK_OPEN; break; + case ')': s->type = TOK_CLOSE; break; + case ',': s->type = TOK_SEP; break; + case ' ': case '\t': case '\n': case '\r': break; + default: s->type = TOK_ERROR; s->error = TE_ERROR_MISSING_OPERATOR; break; + } + } + } + } while (s->type == TOK_NULL); +} + + +static te_expr *expr(state *s); +static te_expr *power(state *s); + +static te_expr *base(state *s) { + /* = | | {"(" ")"} | | "(" {"," } ")" | "(" ")" */ + te_expr *ret; + int arity; + + switch (TYPE_MASK(s->type)) { + case TOK_NUMBER: + ret = new_expr(TE_CONSTANT, 0); + ret->value = s->value; + next_token(s); + break; + + case TOK_VARIABLE: + ret = new_expr(TE_VARIABLE, 0); + ret->bound = s->bound; + next_token(s); + break; + + case TE_FUNCTION0: + ret = new_expr(s->type, 0); + ret->function = s->function; + next_token(s); + if (s->type == TOK_OPEN) { + next_token(s); + if (s->type == TOK_CLOSE) { + next_token(s); + } else if (s->type != TOK_ERROR + || s->error == TE_ERROR_UNKNOWN) { + s->type = TOK_ERROR; + s->error = TE_ERROR_MISSING_CLOSING_PAREN; + } + } + break; + + case TE_FUNCTION1: + case TE_FUNCTION2: case TE_FUNCTION3: case TE_FUNCTION4: + case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7: + arity = ARITY(s->type); + + ret = new_expr(s->type, 0); + ret->function = s->function; + next_token(s); + + if (s->type == TOK_OPEN) { + int i; + for(i = 0; i < arity; i++) { + next_token(s); + ret->parameters[i] = expr(s); + if(s->type != TOK_SEP) { + break; + } + } + if(s->type == TOK_CLOSE && i == arity - 1) { + next_token(s); + } else if (s->type != TOK_ERROR + || s->error == TE_ERROR_UNKNOWN) { + s->type = TOK_ERROR; + s->error = i < arity ? TE_ERROR_TOO_FEW_ARGS + : TE_ERROR_TOO_MANY_ARGS; + } + } else if (s->type != TOK_ERROR + || s->error == TE_ERROR_UNKNOWN) { + s->type = TOK_ERROR; + s->error = TE_ERROR_MISSING_OPENING_PAREN; + } + + break; + + case TOK_OPEN: + next_token(s); + ret = expr(s); + if (s->type == TOK_CLOSE) { + next_token(s); + } else if (s->type != TOK_ERROR + || s->error == TE_ERROR_UNKNOWN) { + s->type = TOK_ERROR; + s->error = TE_ERROR_MISSING_CLOSING_PAREN; + } + break; + + case TOK_END: + // The expression ended before we expected it. + // e.g. `2 - `. + // This means we have too few things. + // Instead of introducing another error, just call it + // "too few args". + ret = new_expr(0, 0); + s->type = TOK_ERROR; + s->error = TE_ERROR_TOO_FEW_ARGS; + ret->value = NAN; + break; + default: + ret = new_expr(0, 0); + s->type = TOK_ERROR; + s->error = TE_ERROR_UNKNOWN; + ret->value = NAN; + break; + } + + return ret; +} + + +static te_expr *power(state *s) { + /* = {("-" | "+")} */ + int sign = 1; + while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) { + if (s->function == sub) sign = -sign; + next_token(s); + } + + te_expr *ret; + + if (sign == 1) { + ret = base(s); + } else { + ret = NEW_EXPR(TE_FUNCTION1 | TE_FLAG_PURE, base(s)); + ret->function = negate; + } + + return ret; +} + +static te_expr *factor(state *s) { + /* = {"^" } */ + te_expr *ret = power(s); + + while (s->type == TOK_INFIX && (s->function == pow)) { + te_fun2 t = s->function; + next_token(s); + ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, power(s)); + ret->function = t; + } + + return ret; +} + + +static te_expr *term(state *s) { + /* = {("*" | "/" | "%") } */ + te_expr *ret = factor(s); + + while (s->type == TOK_INFIX && (s->function == mul || s->function == divide || s->function == fmod)) { + te_fun2 t = s->function; + next_token(s); + ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, factor(s)); + ret->function = t; + } + + return ret; +} + + +static te_expr *expr(state *s) { + /* = {("+" | "-") } */ + te_expr *ret = term(s); + + while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) { + te_fun2 t = s->function; + next_token(s); + ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, term(s)); + ret->function = t; + } + + return ret; +} + + +#define TE_FUN(...) ((double(*)(__VA_ARGS__))n->function) +#define M(e) te_eval(n->parameters[e]) + + +double te_eval(const te_expr *n) { + if (!n) return NAN; + + switch(TYPE_MASK(n->type)) { + case TE_CONSTANT: return n->value; + case TE_VARIABLE: return *n->bound; + + case TE_FUNCTION0: case TE_FUNCTION1: case TE_FUNCTION2: case TE_FUNCTION3: + case TE_FUNCTION4: case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7: + switch(ARITY(n->type)) { + case 0: return TE_FUN(void)(); + case 1: return TE_FUN(double)(M(0)); + case 2: return TE_FUN(double, double)(M(0), M(1)); + case 3: return TE_FUN(double, double, double)(M(0), M(1), M(2)); + case 4: return TE_FUN(double, double, double, double)(M(0), M(1), M(2), M(3)); + case 5: return TE_FUN(double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4)); + case 6: return TE_FUN(double, double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4), M(5)); + case 7: return TE_FUN(double, double, double, double, double, double, double)(M(0), M(1), M(2), M(3), M(4), M(5), M(6)); + default: return NAN; + } + + default: return NAN; + } + +} + +#undef TE_FUN +#undef M + +static void optimize(te_expr *n) { + /* Evaluates as much as possible. */ + if (n->type == TE_CONSTANT) return; + if (n->type == TE_VARIABLE) return; + + /* Only optimize out functions flagged as pure. */ + if (IS_PURE(n->type)) { + const int arity = ARITY(n->type); + int known = 1; + int i; + for (i = 0; i < arity; ++i) { + optimize(n->parameters[i]); + if (((te_expr*)(n->parameters[i]))->type != TE_CONSTANT) { + known = 0; + } + } + if (known) { + const double value = te_eval(n); + te_free_parameters(n); + n->type = TE_CONSTANT; + n->value = value; + } + } +} + + +te_expr *te_compile(const char *expression, const te_variable *variables, int var_count, te_error_t *error) { + state s; + s.start = s.next = expression; + s.lookup = variables; + s.lookup_len = var_count; + s.error = TE_ERROR_NONE; + + next_token(&s); + te_expr *root = expr(&s); + + if (s.type != TOK_END) { + te_free(root); + if (error) { + error->position = (s.next - s.start) + 1; + if (s.error != TE_ERROR_NONE) { + error->type = s.error; + } else { + // If we're not at the end but there's no error, then that means we have a superfluous + // token that we have no idea what to do with. + // This occurs in e.g. `2 + 2 4` - the "4" is just not part of the expression. + // We can report either "too many arguments" or "expected operator", but the operator + // should be reported between the "2" and the "4". + // So we report TOO_MANY_ARGS on the "4". + error->type = TE_ERROR_TOO_MANY_ARGS; + } + } + return 0; + } else { + optimize(root); + if (error) error->position = 0; + return root; + } +} + + +double te_interp(const char *expression, te_error_t *error) { + te_expr *n = te_compile(expression, 0, 0, error); + double ret; + if (n) { + ret = te_eval(n); + te_free(n); + } else { + ret = NAN; + } + return ret; +} + +static void pn (const te_expr *n, int depth) { + int i, arity; + printf("%*s", depth, ""); + + switch(TYPE_MASK(n->type)) { + case TE_CONSTANT: printf("%f\n", n->value); break; + case TE_VARIABLE: printf("bound %p\n", n->bound); break; + + case TE_FUNCTION0: case TE_FUNCTION1: case TE_FUNCTION2: case TE_FUNCTION3: + case TE_FUNCTION4: case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7: + arity = ARITY(n->type); + printf("f%d", arity); + for(i = 0; i < arity; i++) { + printf(" %p", n->parameters[i]); + } + printf("\n"); + for(i = 0; i < arity; i++) { + pn(n->parameters[i], depth + 1); + } + break; + } +} + + +void te_print(const te_expr *n) { + pn(n, 0); +} diff --git a/src/tinyexpr.h b/src/tinyexpr.h new file mode 100644 index 000000000..06d324379 --- /dev/null +++ b/src/tinyexpr.h @@ -0,0 +1,101 @@ +/* + * TINYEXPR - Tiny recursive descent parser and evaluation engine in C + * + * Copyright (c) 2015, 2016 Lewis Van Winkle + * + * http://CodePlea.com + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgement in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +// This version was altered for inclusion in fish. + +#ifndef __TINYEXPR_H__ +#define __TINYEXPR_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + + + typedef enum { + TE_ERROR_NONE = 0, + TE_ERROR_UNKNOWN_VARIABLE = 1, + TE_ERROR_MISSING_CLOSING_PAREN = 2, + TE_ERROR_MISSING_OPENING_PAREN = 3, + TE_ERROR_TOO_FEW_ARGS = 4, + TE_ERROR_TOO_MANY_ARGS = 5, + TE_ERROR_MISSING_OPERATOR = 6, + TE_ERROR_UNKNOWN = 7 + } te_error_type_t; + + + typedef struct te_error_t { + te_error_type_t type; + int position; + } te_error_t; + +typedef struct te_expr { + int type; + union {double value; const double *bound; const void *function;}; + void *parameters[1]; +} te_expr; + + +enum { + TE_VARIABLE = 0, + + TE_FUNCTION0 = 8, TE_FUNCTION1, TE_FUNCTION2, TE_FUNCTION3, + TE_FUNCTION4, TE_FUNCTION5, TE_FUNCTION6, TE_FUNCTION7, + + TE_FLAG_PURE = 32 +}; + +typedef struct te_variable { + const char *name; + const void *address; + int type; + void *context; +} te_variable; + + + +/* Parses the input expression, evaluates it, and frees it. */ +/* Returns NaN on error. */ +double te_interp(const char *expression, te_error_t *error); + +/* Parses the input expression and binds variables. */ +/* Returns NULL on error. */ +te_expr *te_compile(const char *expression, const te_variable *variables, int var_count, te_error_t *error); + +/* Evaluates the expression. */ +double te_eval(const te_expr *n); + +/* Prints debugging information on the syntax tree. */ +void te_print(const te_expr *n); + +/* Frees the expression. */ +/* This is safe to call on NULL pointers. */ +void te_free(te_expr *n); + + +#ifdef __cplusplus +} +#endif + +#endif /*__TINYEXPR_H__*/ diff --git a/tests/math.err b/tests/math.err index 212b31850..1d529b43d 100644 --- a/tests/math.err +++ b/tests/math.err @@ -7,7 +7,18 @@ #################### # Validate math error reporting -math: Invalid expression: Too few parameters for function "min" at expression position 5 -math: Invalid expression: String value used where a numerical argument is expected. -math: Invalid expression: Too few parameters for function "max" at expression position 5 -math: Invalid expression: Too few parameters for function "sum" at expression position 5 +math: Error: Too few arguments +'2 - ' + ^ +math: Error: Too few arguments +'ncr(1)' + ^ +math: Error: Expression is bogus +'max()' + ^ +math: Error: Too few arguments +'sin()' + ^ +math: Error: Too many arguments +'2 + 2 4' + ^ diff --git a/tests/math.in b/tests/math.in index 8fa48595f..ff63cc0a5 100644 --- a/tests/math.in +++ b/tests/math.in @@ -24,7 +24,8 @@ math "-$x * $y" math -s1 "-$x * $y" logmsg Validate math error reporting -not math 'min()' -not math 'min("abc")' +not math '2 - ' +not math 'ncr(1)' not math 'max()' -not math 'sum()' +not math 'sin()' +not math '2 + 2 4'