yabasic-2.91.4/0000777000175000017500000000000015055056465007002 5yabasic-2.91.4/aclocal.m40000777000175000017500000013726115055055350010567 # generated automatically by aclocal 1.17 -*- Autoconf -*- # Copyright (C) 1996-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, [m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.17' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.17], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.17])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([_AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2022-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". _AS_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SILENT_RULES # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) # Copyright (C) 2001-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR # Copyright (C) 2022-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) yabasic-2.91.4/AUTHORS0000777000175000017500000000024314735711653007775 Marc Ihm. Many other Individuals have contributed to yabasic; either by testing new versions, asking for features, adding documentation or giving encouragement. yabasic-2.91.4/bison.c0000777000175000017500000102647115055056416010212 /* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ #define YYBISON 30802 /* Bison version string. */ #define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de BISON part This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* definitions of yabasic */ #endif #ifdef WINDOWS #include #else #ifdef HAVE_MALLOC_H #include #else #include #endif #endif #if HAVE_ALLOCA_H #ifndef WINDOWS #include #endif #endif void __yy_bcopy(char *,char *,int); /* prototype missing */ int tileol; /* true, read should go to eon of line */ int function_type=ftNONE; /* contains function type while parsing function */ char *current_function=NULL; /* name of currently parsed function */ int exported=FALSE; /* true, if function is exported */ int yylex(void); extern struct library *current_library; /* defined in main.c: name of currently parsed library */ extern int yylineno; /* defined in flex */ int missing_endif=0; int missing_endif_line=0; int missing_endsub=0; int missing_endsub_line=0; int missing_next=0; int missing_next_line=0; int missing_wend=0; int missing_wend_line=0; int missing_until=0; int missing_until_line=0; int missing_loop=0; int missing_loop_line=0; int loop_nesting=0; int switch_nesting=0; void report_if_missing(char *text,int eof) { if (missing_loop || missing_endif || missing_next || missing_until || missing_wend) { if (eof) { error_without_position(sERROR,text); } else { error(sERROR,text); } collect_missing_clauses(string,-1); if (string[0]) { error_without_position(sERROR,string); } } } void report_conflicting_close(char *text,int missing) { error(sERROR,text); collect_missing_clauses(string,missing); error(sERROR,string); } void collect_missing_clauses(char *string, char exclude) { char buff[INBUFFLEN]; string[0]='\0'; if (missing_endif && exclude!='e') { if (string[0]) strcat(string,"; "); sprintf(buff,"if-statement starting at line %d has seen no 'endif' yet",missing_endif_line); strcat(string, buff); } if (missing_next && exclude!='n') { if (string[0]) strcat(string,"; "); sprintf(buff,"for-loop starting at line %d has seen no 'next' yet",missing_next_line); strcat(string, buff); } if (missing_wend && exclude!='w') { if (string[0]) strcat(string,"; "); sprintf(buff,"while-loop starting at line %d has seen no 'wend' yet",missing_wend_line); strcat(string, buff); } if (missing_until && exclude!='u') { if (string[0]) strcat(string,"; "); sprintf(buff,"repeat-loop starting at line %d has seen no 'until' yet",missing_until_line); strcat(string, buff); } if (missing_loop && exclude!='l') { if (string[0]) strcat(string,"; "); sprintf(buff,"do-loop starting at line %d has seen no 'loop' yet",missing_loop_line); strcat(string, buff); } } # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif #include "bison.h" /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_tFNUM = 3, /* tFNUM */ YYSYMBOL_tSYMBOL = 4, /* tSYMBOL */ YYSYMBOL_tSTRSYM = 5, /* tSTRSYM */ YYSYMBOL_tDOCU = 6, /* tDOCU */ YYSYMBOL_tDIGITS = 7, /* tDIGITS */ YYSYMBOL_tHEXDIGITS = 8, /* tHEXDIGITS */ YYSYMBOL_tBINDIGITS = 9, /* tBINDIGITS */ YYSYMBOL_tSTRING = 10, /* tSTRING */ YYSYMBOL_tFOR = 11, /* tFOR */ YYSYMBOL_tTO = 12, /* tTO */ YYSYMBOL_tSTEP = 13, /* tSTEP */ YYSYMBOL_tNEXT = 14, /* tNEXT */ YYSYMBOL_tWHILE = 15, /* tWHILE */ YYSYMBOL_tWEND = 16, /* tWEND */ YYSYMBOL_tREPEAT = 17, /* tREPEAT */ YYSYMBOL_tUNTIL = 18, /* tUNTIL */ YYSYMBOL_tIMPORT = 19, /* tIMPORT */ YYSYMBOL_tGOTO = 20, /* tGOTO */ YYSYMBOL_tGOSUB = 21, /* tGOSUB */ YYSYMBOL_tLABEL = 22, /* tLABEL */ YYSYMBOL_tON = 23, /* tON */ YYSYMBOL_tSUB = 24, /* tSUB */ YYSYMBOL_tENDSUB = 25, /* tENDSUB */ YYSYMBOL_tLOCAL = 26, /* tLOCAL */ YYSYMBOL_tSTATIC = 27, /* tSTATIC */ YYSYMBOL_tEXPORT = 28, /* tEXPORT */ YYSYMBOL_tERROR = 29, /* tERROR */ YYSYMBOL_tEXECUTE = 30, /* tEXECUTE */ YYSYMBOL_tEXECUTE2 = 31, /* tEXECUTE2 */ YYSYMBOL_tCOMPILE = 32, /* tCOMPILE */ YYSYMBOL_tRUNTIME_CREATED_SUB = 33, /* tRUNTIME_CREATED_SUB */ YYSYMBOL_tINTERRUPT = 34, /* tINTERRUPT */ YYSYMBOL_tBREAK = 35, /* tBREAK */ YYSYMBOL_tCONTINUE = 36, /* tCONTINUE */ YYSYMBOL_tSWITCH = 37, /* tSWITCH */ YYSYMBOL_tSEND = 38, /* tSEND */ YYSYMBOL_tCASE = 39, /* tCASE */ YYSYMBOL_tDEFAULT = 40, /* tDEFAULT */ YYSYMBOL_tLOOP = 41, /* tLOOP */ YYSYMBOL_tDO = 42, /* tDO */ YYSYMBOL_tSEP = 43, /* tSEP */ YYSYMBOL_tEOPROG = 44, /* tEOPROG */ YYSYMBOL_tIF = 45, /* tIF */ YYSYMBOL_tTHEN = 46, /* tTHEN */ YYSYMBOL_tELSE = 47, /* tELSE */ YYSYMBOL_tELSIF = 48, /* tELSIF */ YYSYMBOL_tENDIF = 49, /* tENDIF */ YYSYMBOL_tIMPLICITENDIF = 50, /* tIMPLICITENDIF */ YYSYMBOL_tUSING = 51, /* tUSING */ YYSYMBOL_tPRINT = 52, /* tPRINT */ YYSYMBOL_tINPUT = 53, /* tINPUT */ YYSYMBOL_tRETURN = 54, /* tRETURN */ YYSYMBOL_tDIM = 55, /* tDIM */ YYSYMBOL_tEND = 56, /* tEND */ YYSYMBOL_tEXIT = 57, /* tEXIT */ YYSYMBOL_tAT = 58, /* tAT */ YYSYMBOL_tSCREEN = 59, /* tSCREEN */ YYSYMBOL_tREVERSE = 60, /* tREVERSE */ YYSYMBOL_tCOLOUR = 61, /* tCOLOUR */ YYSYMBOL_tBACKCOLOUR = 62, /* tBACKCOLOUR */ YYSYMBOL_tAND = 63, /* tAND */ YYSYMBOL_tOR = 64, /* tOR */ YYSYMBOL_tNOT = 65, /* tNOT */ YYSYMBOL_tBITNOT = 66, /* tBITNOT */ YYSYMBOL_tEOR = 67, /* tEOR */ YYSYMBOL_tSHL = 68, /* tSHL */ YYSYMBOL_tSHR = 69, /* tSHR */ YYSYMBOL_tNEQ = 70, /* tNEQ */ YYSYMBOL_tLEQ = 71, /* tLEQ */ YYSYMBOL_tGEQ = 72, /* tGEQ */ YYSYMBOL_tLTN = 73, /* tLTN */ YYSYMBOL_tGTN = 74, /* tGTN */ YYSYMBOL_tEQU = 75, /* tEQU */ YYSYMBOL_tEQU2 = 76, /* tEQU2 */ YYSYMBOL_tPOW = 77, /* tPOW */ YYSYMBOL_tREAD = 78, /* tREAD */ YYSYMBOL_tDATA = 79, /* tDATA */ YYSYMBOL_tRESTORE = 80, /* tRESTORE */ YYSYMBOL_tOPEN = 81, /* tOPEN */ YYSYMBOL_tCLOSE = 82, /* tCLOSE */ YYSYMBOL_tSEEK = 83, /* tSEEK */ YYSYMBOL_tTELL = 84, /* tTELL */ YYSYMBOL_tAS = 85, /* tAS */ YYSYMBOL_tREADING = 86, /* tREADING */ YYSYMBOL_tWRITING = 87, /* tWRITING */ YYSYMBOL_tORIGIN = 88, /* tORIGIN */ YYSYMBOL_tWINDOW = 89, /* tWINDOW */ YYSYMBOL_tDOT = 90, /* tDOT */ YYSYMBOL_tLINE = 91, /* tLINE */ YYSYMBOL_tCIRCLE = 92, /* tCIRCLE */ YYSYMBOL_tTRIANGLE = 93, /* tTRIANGLE */ YYSYMBOL_tTEXT = 94, /* tTEXT */ YYSYMBOL_tCLEAR = 95, /* tCLEAR */ YYSYMBOL_tFILL = 96, /* tFILL */ YYSYMBOL_tPRINTER = 97, /* tPRINTER */ YYSYMBOL_tWAIT = 98, /* tWAIT */ YYSYMBOL_tBELL = 99, /* tBELL */ YYSYMBOL_tLET = 100, /* tLET */ YYSYMBOL_tARDIM = 101, /* tARDIM */ YYSYMBOL_tARSIZE = 102, /* tARSIZE */ YYSYMBOL_tBIND = 103, /* tBIND */ YYSYMBOL_tRECT = 104, /* tRECT */ YYSYMBOL_tGETBIT = 105, /* tGETBIT */ YYSYMBOL_tPUTBIT = 106, /* tPUTBIT */ YYSYMBOL_tGETCHAR = 107, /* tGETCHAR */ YYSYMBOL_tPUTCHAR = 108, /* tPUTCHAR */ YYSYMBOL_tNEW = 109, /* tNEW */ YYSYMBOL_tCURVE = 110, /* tCURVE */ YYSYMBOL_tSIN = 111, /* tSIN */ YYSYMBOL_tASIN = 112, /* tASIN */ YYSYMBOL_tCOS = 113, /* tCOS */ YYSYMBOL_tACOS = 114, /* tACOS */ YYSYMBOL_tTAN = 115, /* tTAN */ YYSYMBOL_tATAN = 116, /* tATAN */ YYSYMBOL_tEXP = 117, /* tEXP */ YYSYMBOL_tLOG = 118, /* tLOG */ YYSYMBOL_tSQRT = 119, /* tSQRT */ YYSYMBOL_tSQR = 120, /* tSQR */ YYSYMBOL_tMYEOF = 121, /* tMYEOF */ YYSYMBOL_tABS = 122, /* tABS */ YYSYMBOL_tSIG = 123, /* tSIG */ YYSYMBOL_tINT = 124, /* tINT */ YYSYMBOL_tCEIL = 125, /* tCEIL */ YYSYMBOL_tFLOOR = 126, /* tFLOOR */ YYSYMBOL_tFRAC = 127, /* tFRAC */ YYSYMBOL_tROUND = 128, /* tROUND */ YYSYMBOL_tMOD = 129, /* tMOD */ YYSYMBOL_tRAN = 130, /* tRAN */ YYSYMBOL_tVAL = 131, /* tVAL */ YYSYMBOL_tLEFT = 132, /* tLEFT */ YYSYMBOL_tRIGHT = 133, /* tRIGHT */ YYSYMBOL_tMID = 134, /* tMID */ YYSYMBOL_tLEN = 135, /* tLEN */ YYSYMBOL_tMIN = 136, /* tMIN */ YYSYMBOL_tMAX = 137, /* tMAX */ YYSYMBOL_tSTR = 138, /* tSTR */ YYSYMBOL_tINKEY = 139, /* tINKEY */ YYSYMBOL_tCHR = 140, /* tCHR */ YYSYMBOL_tASC = 141, /* tASC */ YYSYMBOL_tHEX = 142, /* tHEX */ YYSYMBOL_tDEC = 143, /* tDEC */ YYSYMBOL_tBIN = 144, /* tBIN */ YYSYMBOL_tUPPER = 145, /* tUPPER */ YYSYMBOL_tLOWER = 146, /* tLOWER */ YYSYMBOL_tMOUSEX = 147, /* tMOUSEX */ YYSYMBOL_tMOUSEY = 148, /* tMOUSEY */ YYSYMBOL_tMOUSEB = 149, /* tMOUSEB */ YYSYMBOL_tMOUSEMOD = 150, /* tMOUSEMOD */ YYSYMBOL_tTRIM = 151, /* tTRIM */ YYSYMBOL_tLTRIM = 152, /* tLTRIM */ YYSYMBOL_tRTRIM = 153, /* tRTRIM */ YYSYMBOL_tSTRING2 = 154, /* tSTRING2 */ YYSYMBOL_tINSTR = 155, /* tINSTR */ YYSYMBOL_tRINSTR = 156, /* tRINSTR */ YYSYMBOL_tCHOMP = 157, /* tCHOMP */ YYSYMBOL_tSYSTEM = 158, /* tSYSTEM */ YYSYMBOL_tSYSTEM2 = 159, /* tSYSTEM2 */ YYSYMBOL_tPEEK = 160, /* tPEEK */ YYSYMBOL_tPEEK2 = 161, /* tPEEK2 */ YYSYMBOL_tPOKE = 162, /* tPOKE */ YYSYMBOL_tFRNFN_CALL = 163, /* tFRNFN_CALL */ YYSYMBOL_tFRNFN_CALL2 = 164, /* tFRNFN_CALL2 */ YYSYMBOL_tFRNFN_SIZE = 165, /* tFRNFN_SIZE */ YYSYMBOL_tFRNBF_ALLOC = 166, /* tFRNBF_ALLOC */ YYSYMBOL_tFRNBF_FREE = 167, /* tFRNBF_FREE */ YYSYMBOL_tFRNBF_SIZE = 168, /* tFRNBF_SIZE */ YYSYMBOL_tFRNBF_DUMP = 169, /* tFRNBF_DUMP */ YYSYMBOL_tFRNBF_SET = 170, /* tFRNBF_SET */ YYSYMBOL_tFRNBF_GET = 171, /* tFRNBF_GET */ YYSYMBOL_tFRNBF_GET2 = 172, /* tFRNBF_GET2 */ YYSYMBOL_tFRNBF_GET_BUFFER = 173, /* tFRNBF_GET_BUFFER */ YYSYMBOL_tFRNBF_SET_BUFFER = 174, /* tFRNBF_SET_BUFFER */ YYSYMBOL_tDATE = 175, /* tDATE */ YYSYMBOL_tTIME = 176, /* tTIME */ YYSYMBOL_tTOKEN = 177, /* tTOKEN */ YYSYMBOL_tTOKENALT = 178, /* tTOKENALT */ YYSYMBOL_tSPLIT = 179, /* tSPLIT */ YYSYMBOL_tSPLITALT = 180, /* tSPLITALT */ YYSYMBOL_tGLOB = 181, /* tGLOB */ YYSYMBOL_tSTART_PROGRAM = 182, /* tSTART_PROGRAM */ YYSYMBOL_tSTART_EXPRESSION = 183, /* tSTART_EXPRESSION */ YYSYMBOL_tSTART_STRING_EXPRESSION = 184, /* tSTART_STRING_EXPRESSION */ YYSYMBOL_tSTART_ASSIGNMENT = 185, /* tSTART_ASSIGNMENT */ YYSYMBOL_tSTART_FUNCTION_DEFINITION = 186, /* tSTART_FUNCTION_DEFINITION */ YYSYMBOL_tEVAL = 187, /* tEVAL */ YYSYMBOL_tEVAL2 = 188, /* tEVAL2 */ YYSYMBOL_189_ = 189, /* '-' */ YYSYMBOL_190_ = 190, /* '+' */ YYSYMBOL_191_ = 191, /* '*' */ YYSYMBOL_192_ = 192, /* '/' */ YYSYMBOL_UMINUS = 193, /* UMINUS */ YYSYMBOL_194_ = 194, /* ';' */ YYSYMBOL_195_ = 195, /* ',' */ YYSYMBOL_196_ = 196, /* '(' */ YYSYMBOL_197_ = 197, /* ')' */ YYSYMBOL_198_ = 198, /* '#' */ YYSYMBOL_YYACCEPT = 199, /* $accept */ YYSYMBOL_program_or_expression = 200, /* program_or_expression */ YYSYMBOL_program = 201, /* program */ YYSYMBOL_statement_list = 202, /* statement_list */ YYSYMBOL_203_1 = 203, /* $@1 */ YYSYMBOL_204_2 = 204, /* $@2 */ YYSYMBOL_assignment = 205, /* assignment */ YYSYMBOL_statement = 206, /* statement */ YYSYMBOL_207_3 = 207, /* $@3 */ YYSYMBOL_208_4 = 208, /* $@4 */ YYSYMBOL_209_5 = 209, /* $@5 */ YYSYMBOL_210_6 = 210, /* $@6 */ YYSYMBOL_211_7 = 211, /* $@7 */ YYSYMBOL_212_8 = 212, /* $@8 */ YYSYMBOL_clear_fill_clause = 213, /* clear_fill_clause */ YYSYMBOL_string_assignment = 214, /* string_assignment */ YYSYMBOL_to = 215, /* to */ YYSYMBOL_open_clause = 216, /* open_clause */ YYSYMBOL_seek_clause = 217, /* seek_clause */ YYSYMBOL_string_scalar_or_array = 218, /* string_scalar_or_array */ YYSYMBOL_string_expression = 219, /* string_expression */ YYSYMBOL_string_function = 220, /* string_function */ YYSYMBOL_number_assignment = 221, /* number_assignment */ YYSYMBOL_expression = 222, /* expression */ YYSYMBOL_223_9 = 223, /* $@9 */ YYSYMBOL_224_10 = 224, /* $@10 */ YYSYMBOL_arrayref = 225, /* arrayref */ YYSYMBOL_string_arrayref = 226, /* string_arrayref */ YYSYMBOL_coordinates = 227, /* coordinates */ YYSYMBOL_function = 228, /* function */ YYSYMBOL_const = 229, /* const */ YYSYMBOL_number = 230, /* number */ YYSYMBOL_symbol_or_lineno = 231, /* symbol_or_lineno */ YYSYMBOL_dimlist = 232, /* dimlist */ YYSYMBOL_function_or_array = 233, /* function_or_array */ YYSYMBOL_stringfunction_or_array = 234, /* stringfunction_or_array */ YYSYMBOL_call_list = 235, /* call_list */ YYSYMBOL_236_11 = 236, /* $@11 */ YYSYMBOL_calls = 237, /* calls */ YYSYMBOL_call_item = 238, /* call_item */ YYSYMBOL_function_definition = 239, /* function_definition */ YYSYMBOL_240_12 = 240, /* $@12 */ YYSYMBOL_241_13 = 241, /* $@13 */ YYSYMBOL_242_14 = 242, /* $@14 */ YYSYMBOL_endsub = 243, /* endsub */ YYSYMBOL_function_name = 244, /* function_name */ YYSYMBOL_export = 245, /* export */ YYSYMBOL_local_list = 246, /* local_list */ YYSYMBOL_local_item = 247, /* local_item */ YYSYMBOL_static_list = 248, /* static_list */ YYSYMBOL_static_item = 249, /* static_item */ YYSYMBOL_paramlist = 250, /* paramlist */ YYSYMBOL_paramitem = 251, /* paramitem */ YYSYMBOL_for_loop = 252, /* for_loop */ YYSYMBOL_253_15 = 253, /* $@15 */ YYSYMBOL_254_16 = 254, /* $@16 */ YYSYMBOL_255_17 = 255, /* $@17 */ YYSYMBOL_256_18 = 256, /* $@18 */ YYSYMBOL_next = 257, /* next */ YYSYMBOL_step_part = 258, /* step_part */ YYSYMBOL_next_symbol = 259, /* next_symbol */ YYSYMBOL_switch_number_or_string = 260, /* switch_number_or_string */ YYSYMBOL_261_19 = 261, /* $@19 */ YYSYMBOL_sep_list = 262, /* sep_list */ YYSYMBOL_number_or_string = 263, /* number_or_string */ YYSYMBOL_case_list = 264, /* case_list */ YYSYMBOL_265_20 = 265, /* $@20 */ YYSYMBOL_default = 266, /* default */ YYSYMBOL_267_21 = 267, /* $@21 */ YYSYMBOL_do_loop = 268, /* do_loop */ YYSYMBOL_269_22 = 269, /* $@22 */ YYSYMBOL_loop = 270, /* loop */ YYSYMBOL_while_loop = 271, /* while_loop */ YYSYMBOL_272_23 = 272, /* $@23 */ YYSYMBOL_273_24 = 273, /* $@24 */ YYSYMBOL_wend = 274, /* wend */ YYSYMBOL_repeat_loop = 275, /* repeat_loop */ YYSYMBOL_276_25 = 276, /* $@25 */ YYSYMBOL_until = 277, /* until */ YYSYMBOL_if_clause = 278, /* if_clause */ YYSYMBOL_279_26 = 279, /* $@26 */ YYSYMBOL_280_27 = 280, /* $@27 */ YYSYMBOL_281_28 = 281, /* $@28 */ YYSYMBOL_282_29 = 282, /* $@29 */ YYSYMBOL_endif = 283, /* endif */ YYSYMBOL_short_if = 284, /* short_if */ YYSYMBOL_285_30 = 285, /* $@30 */ YYSYMBOL_end_of_if = 286, /* end_of_if */ YYSYMBOL_else_part = 287, /* else_part */ YYSYMBOL_elsif_part = 288, /* elsif_part */ YYSYMBOL_289_31 = 289, /* $@31 */ YYSYMBOL_290_32 = 290, /* $@32 */ YYSYMBOL_maybe_then = 291, /* maybe_then */ YYSYMBOL_inputlist = 292, /* inputlist */ YYSYMBOL_293_33 = 293, /* $@33 */ YYSYMBOL_input = 294, /* input */ YYSYMBOL_readlist = 295, /* readlist */ YYSYMBOL_readitem = 296, /* readitem */ YYSYMBOL_datalist = 297, /* datalist */ YYSYMBOL_printlist = 298, /* printlist */ YYSYMBOL_using = 299, /* using */ YYSYMBOL_inputbody = 300, /* inputbody */ YYSYMBOL_301_34 = 301, /* $@34 */ YYSYMBOL_302_35 = 302, /* $@35 */ YYSYMBOL_303_36 = 303, /* $@36 */ YYSYMBOL_304_37 = 304, /* $@37 */ YYSYMBOL_305_38 = 305, /* $@38 */ YYSYMBOL_306_39 = 306, /* $@39 */ YYSYMBOL_307_40 = 307, /* $@40 */ YYSYMBOL_308_41 = 308, /* $@41 */ YYSYMBOL_309_42 = 309, /* $@42 */ YYSYMBOL_310_43 = 310, /* $@43 */ YYSYMBOL_311_44 = 311, /* $@44 */ YYSYMBOL_312_45 = 312, /* $@45 */ YYSYMBOL_313_46 = 313, /* $@46 */ YYSYMBOL_prompt = 314, /* prompt */ YYSYMBOL_printintro = 315, /* printintro */ YYSYMBOL_hashed_number = 316, /* hashed_number */ YYSYMBOL_goto_list = 317, /* goto_list */ YYSYMBOL_gosub_list = 318 /* gosub_list */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; /* Unqualified %code blocks. */ void yyerror(char *message) { error(sERROR,message); } void lyyerror(int severity, char *message) { error(severity,message); } #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + YYSIZEOF (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 193 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 6703 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 199 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 120 /* YYNRULES -- Number of rules. */ #define YYNRULES 496 /* YYNSTATES -- Number of states. */ #define YYNSTATES 1204 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 444 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 198, 2, 2, 2, 2, 196, 197, 191, 190, 195, 189, 2, 192, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 194, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 193 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 191, 191, 192, 193, 194, 195, 198, 201, 202, 202, 202, 205, 206, 207, 208, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 226, 227, 227, 228, 229, 230, 231, 232, 233, 234, 234, 236, 236, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 249, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 266, 267, 268, 269, 270, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 321, 322, 323, 324, 325, 329, 330, 331, 332, 333, 334, 337, 338, 341, 342, 343, 344, 345, 348, 349, 352, 353, 356, 357, 358, 359, 360, 361, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 408, 409, 412, 412, 413, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 448, 451, 454, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 530, 531, 532, 535, 536, 537, 538, 541, 542, 545, 546, 547, 548, 551, 554, 557, 557, 560, 561, 562, 565, 566, 569, 570, 573, 569, 578, 579, 582, 583, 586, 587, 588, 589, 592, 593, 596, 597, 598, 599, 602, 603, 606, 607, 608, 609, 612, 613, 614, 617, 618, 619, 620, 623, 624, 629, 644, 623, 649, 650, 651, 652, 653, 654, 657, 658, 661, 662, 667, 667, 671, 672, 675, 676, 680, 682, 681, 686, 687, 687, 691, 691, 697, 698, 699, 700, 701, 702, 706, 707, 706, 713, 714, 718, 718, 723, 724, 725, 726, 727, 728, 731, 732, 732, 734, 731, 738, 739, 740, 741, 742, 743, 746, 746, 751, 752, 755, 756, 759, 761, 763, 760, 767, 768, 771, 772, 772, 775, 776, 778, 779, 783, 784, 787, 788, 790, 791, 795, 796, 797, 798, 801, 802, 803, 804, 805, 808, 809, 810, 813, 813, 814, 814, 815, 815, 816, 816, 817, 817, 818, 818, 819, 819, 820, 820, 821, 821, 822, 822, 823, 823, 824, 824, 825, 825, 828, 829, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 848, 849, 851, 852, 855, 856 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "tFNUM", "tSYMBOL", "tSTRSYM", "tDOCU", "tDIGITS", "tHEXDIGITS", "tBINDIGITS", "tSTRING", "tFOR", "tTO", "tSTEP", "tNEXT", "tWHILE", "tWEND", "tREPEAT", "tUNTIL", "tIMPORT", "tGOTO", "tGOSUB", "tLABEL", "tON", "tSUB", "tENDSUB", "tLOCAL", "tSTATIC", "tEXPORT", "tERROR", "tEXECUTE", "tEXECUTE2", "tCOMPILE", "tRUNTIME_CREATED_SUB", "tINTERRUPT", "tBREAK", "tCONTINUE", "tSWITCH", "tSEND", "tCASE", "tDEFAULT", "tLOOP", "tDO", "tSEP", "tEOPROG", "tIF", "tTHEN", "tELSE", "tELSIF", "tENDIF", "tIMPLICITENDIF", "tUSING", "tPRINT", "tINPUT", "tRETURN", "tDIM", "tEND", "tEXIT", "tAT", "tSCREEN", "tREVERSE", "tCOLOUR", "tBACKCOLOUR", "tAND", "tOR", "tNOT", "tBITNOT", "tEOR", "tSHL", "tSHR", "tNEQ", "tLEQ", "tGEQ", "tLTN", "tGTN", "tEQU", "tEQU2", "tPOW", "tREAD", "tDATA", "tRESTORE", "tOPEN", "tCLOSE", "tSEEK", "tTELL", "tAS", "tREADING", "tWRITING", "tORIGIN", "tWINDOW", "tDOT", "tLINE", "tCIRCLE", "tTRIANGLE", "tTEXT", "tCLEAR", "tFILL", "tPRINTER", "tWAIT", "tBELL", "tLET", "tARDIM", "tARSIZE", "tBIND", "tRECT", "tGETBIT", "tPUTBIT", "tGETCHAR", "tPUTCHAR", "tNEW", "tCURVE", "tSIN", "tASIN", "tCOS", "tACOS", "tTAN", "tATAN", "tEXP", "tLOG", "tSQRT", "tSQR", "tMYEOF", "tABS", "tSIG", "tINT", "tCEIL", "tFLOOR", "tFRAC", "tROUND", "tMOD", "tRAN", "tVAL", "tLEFT", "tRIGHT", "tMID", "tLEN", "tMIN", "tMAX", "tSTR", "tINKEY", "tCHR", "tASC", "tHEX", "tDEC", "tBIN", "tUPPER", "tLOWER", "tMOUSEX", "tMOUSEY", "tMOUSEB", "tMOUSEMOD", "tTRIM", "tLTRIM", "tRTRIM", "tSTRING2", "tINSTR", "tRINSTR", "tCHOMP", "tSYSTEM", "tSYSTEM2", "tPEEK", "tPEEK2", "tPOKE", "tFRNFN_CALL", "tFRNFN_CALL2", "tFRNFN_SIZE", "tFRNBF_ALLOC", "tFRNBF_FREE", "tFRNBF_SIZE", "tFRNBF_DUMP", "tFRNBF_SET", "tFRNBF_GET", "tFRNBF_GET2", "tFRNBF_GET_BUFFER", "tFRNBF_SET_BUFFER", "tDATE", "tTIME", "tTOKEN", "tTOKENALT", "tSPLIT", "tSPLITALT", "tGLOB", "tSTART_PROGRAM", "tSTART_EXPRESSION", "tSTART_STRING_EXPRESSION", "tSTART_ASSIGNMENT", "tSTART_FUNCTION_DEFINITION", "tEVAL", "tEVAL2", "'-'", "'+'", "'*'", "'/'", "UMINUS", "';'", "','", "'('", "')'", "'#'", "$accept", "program_or_expression", "program", "statement_list", "$@1", "$@2", "assignment", "statement", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "clear_fill_clause", "string_assignment", "to", "open_clause", "seek_clause", "string_scalar_or_array", "string_expression", "string_function", "number_assignment", "expression", "$@9", "$@10", "arrayref", "string_arrayref", "coordinates", "function", "const", "number", "symbol_or_lineno", "dimlist", "function_or_array", "stringfunction_or_array", "call_list", "$@11", "calls", "call_item", "function_definition", "$@12", "$@13", "$@14", "endsub", "function_name", "export", "local_list", "local_item", "static_list", "static_item", "paramlist", "paramitem", "for_loop", "$@15", "$@16", "$@17", "$@18", "next", "step_part", "next_symbol", "switch_number_or_string", "$@19", "sep_list", "number_or_string", "case_list", "$@20", "default", "$@21", "do_loop", "$@22", "loop", "while_loop", "$@23", "$@24", "wend", "repeat_loop", "$@25", "until", "if_clause", "$@26", "$@27", "$@28", "$@29", "endif", "short_if", "$@30", "end_of_if", "else_part", "elsif_part", "$@31", "$@32", "maybe_then", "inputlist", "$@33", "input", "readlist", "readitem", "datalist", "printlist", "using", "inputbody", "$@34", "$@35", "$@36", "$@37", "$@38", "$@39", "$@40", "$@41", "$@42", "$@43", "$@44", "$@45", "$@46", "prompt", "printintro", "hashed_number", "goto_list", "gosub_list", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #define YYPACT_NINF (-789) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-402) #define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 651, 3810, 3451, 3528, 61, -6, 30, -67, -66, -789, -789, -789, -789, -789, 76, 76, 76, 3071, -789, -789, -789, 3528, -789, -789, 3528, 34, 74, -789, -789, -789, 3451, -35, -789, 3451, 113, -789, 3451, 3451, 3451, 182, 43, 76, 1610, 1236, 2100, 18, 3451, 2881, 3451, 270, -39, 3451, -789, 50, 3528, 3528, 3528, -1, -102, 17, 35, 55, 78, 2100, 3528, 3528, 3528, -789, 88, -789, -789, -29, -789, -789, -789, -789, 115, 185, -789, 253, -789, -789, -789, -789, -789, -789, -789, -789, 94, 145, -789, -789, -789, -789, 157, 166, 178, 208, 3451, 212, 214, 231, 243, 245, 247, 255, 265, 267, 271, 275, 324, 334, 336, 382, 417, 423, 432, 468, 470, 482, 501, 514, 516, 520, 529, 549, 585, 587, 591, 598, 601, 610, 612, 615, 620, 621, 622, 623, 633, 634, 635, 642, 643, 644, 645, 647, 648, 649, 652, 653, 655, 656, 657, 658, 661, 662, 663, 666, 667, 668, 673, 674, 675, 678, 679, 680, 682, 683, 684, 687, 688, 689, 691, 692, 699, 700, 701, 705, 3451, 3451, 439, -789, 599, -789, -789, -789, -789, 3528, -15, 708, 115, 185, 724, -789, 3451, -789, 3528, -789, 368, 3451, 1438, -789, -789, -789, -789, -789, 192, 64, 302, 381, 553, -789, 3451, -789, 553, -789, -789, 3451, 1438, 305, 707, 737, 709, 3, 3451, -13, 439, 6511, 720, 725, 614, 6511, 439, 978, 439, 1511, 726, 731, 711, -789, -789, 496, 496, -789, -789, 733, -789, 3451, 3528, 3451, 28, 6511, 734, -789, -789, -789, -789, 735, 3528, 5586, -789, 3451, -789, 6, 738, -789, -789, 3451, 3261, -789, -789, 6511, -789, -789, 553, 1, 1, -789, 823, 823, 823, 2296, 3528, 49, 739, 553, 8, 22, -789, 859, 3451, 3451, 3451, 3451, 3528, -789, -789, -789, 3451, 3451, 613, 3451, 3451, 3451, 3451, 1904, 2100, 596, 596, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 2100, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 2491, 3528, 3528, 3528, 3528, 3528, 3451, 3451, 3451, 2686, 3451, 3528, 3451, 3528, 3451, 3528, 3528, 401, 1982, 2178, 2373, 3528, 3528, 3528, 3451, 3528, 3528, 3528, 3528, 3528, 2100, 3528, -789, -789, 3528, 3451, 3528, 3528, 3528, 3528, 3528, 723, 746, 3528, 823, 3528, 823, 3528, 3528, 3528, 827, 347, 892, 3528, 3528, 3528, 3528, 3528, 3528, 3528, 3528, -789, -789, -789, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, 3451, -104, -789, -789, -789, 6511, 755, 553, 756, 857, 6511, 608, -789, -789, -789, -789, 758, 762, 764, -789, 774, 775, 765, -789, 439, 6511, 777, -789, 439, 6511, 930, 695, 928, 1438, 3451, 779, 3528, -789, -789, 3451, 439, 750, -151, 780, 919, 782, 12, -789, 970, -789, -789, 611, 3451, 3451, -789, -789, 182, -789, -789, 69, 5632, 553, 6511, 244, 2568, 3451, 553, 3451, -789, -13, -789, -789, 3451, 3528, -789, 3451, 6, 3451, 3451, 785, 787, 788, 789, -789, 3659, -48, 3451, 3451, 3451, 3451, -789, 791, 6, 6, 6511, 553, 632, 790, 792, 5665, 5685, 3684, 5716, 5731, 5762, 793, 40, 796, 795, 798, 805, 806, 807, 810, 811, 6, 5795, 3965, 4011, 4042, 4075, 4095, 1741, 4110, 1767, 4141, 4172, 813, 4205, 4240, 4271, 4302, 4335, 4350, 4370, 5815, -789, 4401, -32, 149, 312, 326, -16, 5861, 5892, 374, 2897, -789, 4432, 4480, 24, 4500, -108, 4531, 39, 92, -789, 108, -789, 153, -789, 236, -789, 263, 272, 303, 327, 5925, 385, 400, 328, 329, 339, 412, 814, -64, 815, 818, 341, 4562, 352, 14, 466, 487, 503, -789, -789, 536, -100, 545, -90, 547, 360, 366, -789, -789, 553, 553, 553, 553, 553, 553, 553, -789, 3451, 3451, 511, 838, 1079, 922, 103, 165, -44, -789, -3, -3, 827, 827, -789, -789, -789, 1438, -789, -789, 3451, -789, -789, -789, -789, 76, 76, -789, -789, 302, -789, -789, 381, 3451, -789, 945, -789, -789, -789, -789, -789, -789, -789, -789, 375, 5945, 3451, 67, 4577, 3632, -789, -789, 3451, 3451, 812, 3528, -789, -789, 3451, -789, 676, 819, 820, 822, 824, 5960, 5991, 828, 829, -789, -789, -789, 3451, 917, 936, -789, 556, 6022, 6511, -789, -789, 559, -789, 3451, 6055, 6090, -789, 3451, 3451, 3451, -789, -789, 439, 6511, 439, 6511, 6121, 6152, 1438, 3451, 3451, 3451, -789, -789, -789, -789, -789, 3451, 3451, -789, 3451, 3451, 3451, -789, 3528, -789, 2763, -789, 835, 836, -789, -789, 3451, 3451, 3451, 3451, -789, -789, -789, -789, -789, 3451, -789, -789, 3451, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, 3451, -789, -789, 3451, 3451, 3451, -789, 3451, 3451, -789, 3528, -789, -789, -789, -789, -789, 3451, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, 3528, 3528, 3528, -789, -789, -789, -789, -789, 3528, -789, -789, -789, -789, -789, -789, 3451, -789, 3451, 3451, 3451, 1002, 3528, -789, 1002, 3528, -789, 3528, -789, -789, 613, 874, 3451, 44, 6511, -789, 839, -789, 840, 841, 846, -789, 847, 848, -789, -789, -789, 694, 1438, -789, -789, -789, 3451, 6185, 3528, 966, -789, 3528, 553, 439, 750, 6200, 3451, 71, 676, 676, 4610, 850, 851, -789, 842, -789, -789, -789, -789, 3451, 3451, -789, -789, 6220, 2100, 2100, 3528, 3528, 3528, -789, 3451, 3451, 860, 4630, 4661, 3086, 3528, 3528, -789, 6511, 6, -789, 863, 4707, 4740, 4760, 4791, 4806, 369, 865, 83, -789, -789, 4837, 4870, 870, 80, 4890, 4936, 4967, 5000, 5020, 3276, 5035, 5066, 86, 5097, 371, 193, 194, 406, 5130, 6251, 6282, 5165, 5, 409, 150, 415, 420, 96, -789, -789, -789, 76, 76, -789, -789, -789, -789, 3451, 993, 1022, 1027, 5196, 3451, 421, 875, 219, -789, 3451, 6330, 3528, 1014, -789, -789, -789, -789, -789, -789, 876, 879, 6511, 6511, 3528, -789, -789, 553, 553, 569, 6350, 6511, -789, 1005, 1010, 3451, 1011, 572, 553, 3451, 781, -789, -789, -789, -789, -789, -789, -789, 3528, -789, -789, -789, -789, 3451, -789, -789, -789, -789, -789, 3451, -789, -789, -789, 3528, -789, -789, -789, 3451, -789, 3451, -789, -789, -789, 3528, 3451, -789, 3528, -789, -789, 3528, -789, -789, -789, 3451, -789, -789, -789, -789, -789, 1029, 710, 5227, 1030, 3451, 3528, 5260, 3451, 424, 894, 970, 676, 896, 897, 676, -789, -789, 553, 3528, 3528, 3528, 3528, 5275, 3528, 3451, -789, 895, 899, 176, -789, 442, 6381, 5295, 444, 5326, 5357, 448, 5405, 457, 458, 402, 1438, 3970, 3451, 1050, -789, 902, -789, 903, 6412, 461, 732, 5425, 1042, 3451, 676, -789, -789, -789, -789, 553, 553, 553, 553, 1026, 553, 6511, 906, 909, 781, -789, -789, 3451, -789, -789, -789, -789, -789, -789, -789, -789, 3451, -789, 1027, 1069, 702, 1438, -789, 3528, 3451, 3451, -789, -789, 912, 970, -789, 913, 970, 6427, -789, 3528, -789, -789, -789, 1438, 5456, 6511, 1438, -789, -789, 1027, 706, 239, 6460, 5487, 970, 3528, 676, 970, 3451, 676, 3451, 553, 13, -789, 1027, 1438, -789, -789, -789, -789, -789, -789, -789, 3528, -789, 3451, -789, 676, 262, -789, 676, 6480, -789, 5502, -789, -789, -789, 766, 1027, 502, 5535, -789, 3528, -789, -789, 3451, -789, -789, -789, -789, -789, -789, -789, 1106, 1029, -789, -789, 531, 970, 5555, 970, -789, -789, -789, -789, 676, -789, 676, 970, -789, 970, -789, 676, 676, -789, -789 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_int16 yydefact[] = { 0, 118, 0, 0, 0, 330, 0, 0, 0, 112, 353, 388, 393, 18, 0, 0, 0, 0, 31, 33, 331, 0, 315, 315, 0, 332, 25, 27, 368, 380, 0, 477, 55, 67, 0, 109, 110, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 119, 120, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 2, 9, 17, 8, 0, 12, 46, 48, 14, 29, 30, 28, 0, 20, 21, 24, 23, 22, 35, 36, 303, 210, 140, 304, 305, 306, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 270, 273, 276, 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, 224, 204, 209, 142, 0, 0, 0, 0, 0, 0, 1, 0, 315, 0, 315, 0, 0, 16, 308, 307, 37, 38, 45, 0, 0, 0, 0, 19, 50, 317, 51, 49, 333, 26, 0, 16, 412, 0, 481, 0, 0, 441, 473, 69, 68, 0, 0, 70, 111, 60, 0, 62, 0, 433, 435, 63, 431, 437, 0, 0, 438, 300, 64, 66, 0, 96, 0, 0, 492, 0, 93, 98, 86, 47, 0, 0, 0, 74, 0, 57, 79, 0, 95, 94, 0, 0, 121, 122, 99, 13, 15, 113, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 114, 0, 0, 7, 0, 0, 0, 0, 0, 0, 322, 315, 315, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 315, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 192, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 188, 0, 123, 0, 0, 389, 9, 39, 40, 41, 43, 336, 337, 32, 334, 342, 343, 34, 340, 320, 321, 316, 318, 373, 372, 0, 9, 0, 16, 0, 0, 0, 478, 479, 0, 444, 446, 52, 0, 0, 0, 0, 56, 475, 315, 315, 0, 0, 0, 315, 315, 0, 302, 301, 0, 0, 97, 491, 0, 0, 0, 73, 0, 78, 473, 130, 129, 0, 0, 75, 0, 81, 0, 0, 138, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 189, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, 271, 0, 274, 0, 277, 0, 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 173, 0, 0, 0, 0, 0, 0, 0, 145, 225, 219, 221, 223, 220, 222, 217, 218, 144, 0, 0, 197, 199, 201, 198, 200, 195, 196, 215, 212, 211, 213, 214, 313, 314, 354, 16, 400, 398, 0, 399, 395, 397, 394, 0, 0, 315, 315, 0, 315, 315, 0, 0, 370, 374, 387, 385, 386, 383, 382, 384, 381, 402, 9, 0, 0, 0, 0, 0, 442, 53, 54, 0, 0, 0, 449, 451, 0, 476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 439, 440, 0, 0, 0, 133, 132, 136, 228, 58, 76, 89, 80, 0, 0, 0, 315, 0, 0, 0, 103, 104, 105, 106, 107, 108, 0, 0, 16, 0, 0, 0, 328, 329, 323, 292, 184, 0, 0, 283, 0, 0, 0, 293, 0, 294, 0, 287, 0, 0, 205, 206, 0, 0, 0, 0, 229, 230, 231, 232, 233, 0, 234, 236, 0, 237, 239, 240, 202, 246, 247, 241, 243, 244, 245, 242, 0, 249, 254, 0, 0, 0, 253, 0, 0, 153, 0, 150, 156, 157, 255, 182, 0, 256, 183, 158, 159, 269, 272, 275, 278, 162, 160, 161, 0, 0, 0, 164, 262, 165, 268, 267, 0, 174, 263, 166, 264, 167, 266, 0, 168, 0, 0, 0, 0, 0, 177, 0, 0, 179, 0, 299, 187, 193, 191, 0, 9, 396, 493, 42, 495, 44, 0, 0, 335, 0, 0, 341, 319, 371, 377, 16, 414, 415, 413, 0, 0, 0, 482, 480, 0, 447, 445, 446, 0, 0, 0, 0, 0, 0, 427, 429, 474, 424, 309, 311, 315, 315, 0, 0, 434, 436, 71, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 11, 87, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 392, 391, 390, 0, 0, 338, 339, 344, 345, 0, 0, 0, 403, 0, 0, 0, 0, 0, 443, 0, 0, 0, 463, 450, 452, 453, 315, 315, 425, 0, 0, 59, 61, 0, 134, 135, 131, 137, 90, 83, 84, 139, 0, 0, 0, 0, 116, 117, 0, 346, 281, 282, 284, 285, 286, 295, 296, 0, 297, 207, 208, 180, 0, 235, 238, 248, 146, 147, 0, 149, 251, 252, 0, 151, 257, 163, 0, 258, 0, 260, 175, 169, 0, 0, 186, 0, 289, 176, 0, 291, 178, 203, 0, 494, 496, 375, 378, 369, 418, 484, 0, 483, 0, 0, 0, 0, 0, 0, 475, 0, 0, 0, 0, 310, 312, 72, 0, 0, 0, 0, 0, 0, 0, 88, 349, 350, 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 364, 16, 118, 0, 416, 488, 0, 485, 0, 0, 0, 455, 0, 465, 0, 0, 454, 428, 430, 426, 91, 82, 126, 127, 0, 125, 115, 0, 0, 0, 324, 298, 0, 148, 152, 259, 261, 265, 185, 288, 290, 0, 355, 376, 9, 422, 16, 404, 0, 0, 0, 448, 467, 0, 475, 457, 0, 475, 0, 464, 0, 351, 352, 348, 16, 0, 365, 16, 423, 419, 417, 0, 0, 0, 0, 475, 0, 0, 475, 0, 0, 0, 124, 9, 181, 356, 16, 411, 408, 409, 410, 406, 407, 405, 0, 489, 0, 486, 0, 0, 456, 0, 0, 466, 0, 327, 326, 325, 0, 420, 0, 0, 468, 0, 469, 458, 0, 459, 359, 361, 362, 363, 358, 360, 366, 418, 490, 487, 0, 475, 0, 475, 367, 357, 421, 471, 0, 461, 0, 475, 470, 475, 460, 0, 0, 472, 462 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -789, -789, -789, -186, -789, -789, 1111, 410, -789, -789, -789, -789, -789, -789, -789, 1063, -274, -789, -789, -212, 844, -789, 1065, -2, -789, -789, 816, -305, -42, -789, 664, -36, -4, -789, 16, 20, 68, -789, -789, 478, 1116, -789, -789, -789, -789, -789, -789, -789, 484, -789, 486, -789, 45, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, 197, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -53, -789, -789, -789, -788, -789, -789, -789, 669, -789, -789, 290, 659, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -789, -563, -789, 27, -789, -789 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 6, 67, 68, 289, 707, 69, 70, 208, 209, 634, 635, 225, 474, 71, 72, 477, 73, 74, 485, 180, 181, 75, 259, 610, 609, 516, 517, 260, 183, 243, 184, 203, 230, 185, 186, 211, 212, 431, 432, 78, 501, 880, 1121, 1164, 713, 79, 423, 424, 427, 428, 1045, 1046, 80, 198, 814, 1124, 1165, 1181, 1099, 1190, 81, 217, 644, 435, 829, 1058, 930, 1059, 82, 218, 651, 83, 199, 626, 921, 84, 200, 633, 85, 437, 830, 1017, 1128, 1150, 86, 438, 833, 1104, 1061, 1143, 1182, 1126, 851, 1031, 852, 238, 239, 245, 447, 659, 452, 846, 847, 1028, 1111, 1135, 1188, 1198, 1027, 1114, 1132, 1186, 1196, 453, 669, 224, 252, 818, 820 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 182, 482, 483, 519, 244, 263, 264, 442, 194, 196, 443, 204, 205, 475, 416, 207, 665, 76, 475, 666, 190, 77, 20, 220, 191, 221, 222, 25, 219, 407, 193, 227, 436, 401, 231, 233, 235, 246, 1162, 468, 251, 251, 251, 660, 661, 448, 87, 449, 450, 271, 90, 91, 92, 240, 7, 8, 270, 1163, 942, 943, 919, 251, 215, 290, 291, 7, 8, 486, 487, 190, 256, 257, 87, 191, 401, 292, 90, 91, 92, 679, 201, 216, 390, 202, 419, 420, 390, 771, 920, 772, 284, 213, 475, 599, 278, 804, 300, 805, 383, 384, 385, 386, 387, 388, 389, 807, 258, 808, 1011, 277, 383, 384, 385, 386, 387, 388, 389, 228, 229, 383, 384, 385, 386, 387, 388, 389, 390, 392, 393, 195, 197, 791, 288, 792, 394, 395, 396, 397, 398, 399, 400, 401, 390, 392, 393, 402, 403, 404, 405, 700, 394, 395, 396, 397, 398, 399, 400, 401, 390, 392, 393, 53, 593, 223, 595, 757, 394, 395, 396, 397, 398, 399, 400, 401, 390, 390, 380, 382, 399, 400, 401, 761, 58, 59, 60, 451, 236, 237, 404, 405, 293, 390, 410, 58, 59, 60, 476, 415, 390, 444, 1004, 476, 1005, 493, 390, 462, 463, 692, 667, 798, 430, 799, 390, 279, 390, 434, 76, 494, 390, 473, 77, 769, 446, 709, 710, 479, 481, 417, 418, 390, 390, 280, 241, 242, 76, 723, 774, 724, 77, 390, 1073, 400, 401, 1076, 491, 465, 733, 467, 496, 497, 498, 281, 653, 402, 403, 404, 405, 390, 241, 242, 294, 390, 836, 411, 837, 413, 940, 520, 941, 402, 403, 404, 405, 390, 282, 476, 390, 295, 976, 489, 977, 991, 390, 992, 1116, 402, 403, 404, 405, 775, 195, 499, 402, 403, 404, 405, 504, 505, 390, 506, 507, 508, 509, 251, 251, 776, 421, 422, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 251, 533, 534, 535, 536, 537, 538, 539, 540, 542, 265, 682, 683, 512, 513, 548, 549, 551, 553, 554, 390, 556, 197, 558, 390, 758, 1007, 1157, 1008, 532, 1160, 777, -401, 572, 296, 402, 403, 404, 405, 251, 266, 267, 268, 297, 584, 502, 503, 269, 1169, 392, 393, 1172, 1086, 414, 1087, 298, 394, 395, 396, 397, 398, 399, 400, 401, 390, 390, 425, 426, 579, 995, 997, 996, 998, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 299, 1197, 89, 1199, 301, 390, 302, 93, 1202, 1203, 1022, 1098, 599, 383, 384, 385, 386, 387, 388, 389, 831, 832, 390, 303, 244, 390, 581, 582, 95, 778, 1151, 689, 1152, 654, 691, 304, 815, 305, 657, 306, 383, 384, 385, 386, 387, 388, 389, 307, 390, 390, 76, 674, 675, 1170, 77, 1171, 779, 308, 390, 309, 1072, 392, 393, 310, 686, 780, 687, 311, 394, 395, 396, 397, 398, 399, 400, 401, 693, 694, 383, 384, 385, 386, 387, 388, 389, 702, 704, 705, 706, 390, 402, 403, 404, 405, 913, 87, 781, 915, 390, 90, 91, 92, 107, 759, 108, 383, 384, 385, 386, 387, 388, 389, 390, 390, 390, 390, 312, 760, 670, 671, 782, 786, 787, 676, 677, 390, 313, 390, 314, 130, 131, 132, 788, 390, 795, 136, 137, 138, 390, 140, 599, 142, 143, 144, 1134, 797, 390, 1137, 149, 150, 151, 152, 390, 810, 155, 390, 157, 390, 159, 811, 390, 161, 974, 163, 994, 1155, 165, 764, 1158, 167, 168, 390, 169, 170, 315, 172, 784, 174, 395, 396, 397, 398, 399, 400, 401, 177, 390, 402, 403, 404, 405, 785, 390, 187, 561, 390, 514, 515, 390, 999, 967, 390, 1006, 812, 813, 789, 390, 390, 1009, 316, 390, 672, 673, 1010, 1020, 317, 981, 1070, 627, 1193, 628, 1195, 629, 816, 318, 390, 817, 819, 390, 1200, 390, 1201, 711, 712, 390, 1088, 430, 1091, 76, 391, 931, 1094, 77, 390, 390, 630, 867, 390, 631, 835, 1096, 1097, 390, 632, 1108, 842, 843, 800, 392, 393, 319, 848, 320, 878, 879, 394, 395, 396, 397, 398, 399, 400, 401, 390, 321, 861, 849, 850, 801, 394, 395, 396, 397, 398, 399, 400, 401, 893, 390, 390, 871, 872, 873, 322, 802, 1183, 402, 403, 404, 405, 821, 822, 877, 824, 825, 645, 323, 646, 324, 647, 881, 882, 325, 883, 884, 885, 1144, 390, 1145, 76, 1146, 326, 390, 77, 1192, 891, 892, 803, 894, 928, 929, 390, 648, 390, 895, 649, 806, 896, 809, 390, 650, 327, 390, 1147, 1125, 390, 1148, 864, 408, 897, 866, 1149, 898, 899, 900, 390, 901, 902, 390, 870, 1035, 392, 393, 1041, 409, 904, 1062, 1063, 394, 395, 396, 397, 398, 399, 400, 401, 1175, 328, 1176, 329, 1177, 1043, 1044, 330, 402, 403, 404, 405, 1109, 1110, 331, 440, 909, 332, 910, 911, 912, 658, 402, 403, 404, 405, 333, 1178, 334, 456, 1179, 335, 918, 392, 393, 1180, 336, 337, 338, 339, 394, 395, 396, 397, 398, 399, 400, 401, 484, 340, 341, 342, 932, 1, 2, 3, 4, 5, 343, 344, 345, 346, 939, 347, 348, 349, 76, 188, 350, 351, 77, 352, 353, 354, 355, 950, 951, 356, 357, 358, 251, 251, 359, 360, 361, 210, 958, 959, 214, 362, 363, 364, 1100, 1101, 365, 366, 367, 226, 368, 369, 370, 232, 234, 371, 372, 373, 250, 374, 375, 953, 954, 402, 403, 404, 405, 376, 377, 378, 274, 275, 276, 379, 495, 439, 401, 441, 461, 283, 285, 286, 287, 397, 398, 399, 400, 401, 454, 1127, 1012, 1013, 590, 455, 459, 948, 949, 1042, 434, 460, 464, 469, 470, 1019, 625, 478, 492, 1140, 1023, 392, 1142, 402, 403, 404, 405, 591, 394, 395, 396, 397, 398, 399, 400, 401, 623, 624, 636, 392, 393, 1166, 637, 638, 641, 1039, 394, 395, 396, 397, 398, 399, 400, 401, 639, 640, 642, 643, 652, 655, 662, 663, 664, 1048, 668, 695, 696, 697, 698, 1049, 708, 714, 828, 715, 722, 725, 726, 1051, 727, 1052, 398, 399, 400, 401, 1054, 728, 862, 729, 730, 731, 732, 515, 844, 1057, 747, 790, 793, 1029, 1030, 794, 853, 854, 855, 1066, 856, 863, 1069, 381, 935, 859, 860, 402, 403, 404, 405, 406, 889, 890, 922, 923, 1015, 947, 924, 1083, 412, 392, 393, 925, 926, 927, 945, 946, 394, 395, 396, 397, 398, 399, 400, 401, 429, 960, 1102, 968, 1016, 433, 975, 402, 403, 404, 405, 980, 445, 1115, -9, 1021, 1026, 1032, 76, 76, 1033, 1060, 77, 77, 1037, 402, 403, 404, 405, 1038, 1040, 1122, 1065, 600, 1071, 1084, 466, 1074, 1075, 1085, 1123, 1103, 1105, 1106, 1113, 1117, 471, 1118, 1130, 1131, 1119, -379, 1133, 1136, 1189, 402, 403, 404, 405, 189, 272, 876, 273, 76, 827, 192, 823, 77, 518, 1014, 490, 826, 680, 1191, 678, 1120, 937, 688, 1159, 0, 1161, 76, 500, 0, 76, 77, 0, 0, 77, 0, 0, 0, 0, 511, 395, 1168, 397, 398, 399, 400, 401, 0, 0, 76, 0, 0, 0, 77, 0, 0, 0, 402, 403, 404, 405, 1187, 0, 457, 0, 543, 544, 545, 546, 547, 0, 0, 550, 0, 0, 555, 0, 557, 0, 559, 560, 562, 564, 566, 568, 569, 570, 571, 0, 573, 574, 575, 576, 577, 578, 580, 0, 0, 583, 0, 585, 586, 587, 588, 589, 0, 0, 592, 0, 594, 0, 596, 597, 598, 0, 0, 0, 601, 602, 603, 604, 605, 606, 607, 608, 0, 0, 0, 0, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 95, 402, 403, 404, 405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 0, 0, 0, 0, 0, 0, 0, 685, 0, 0, 0, 103, 0, 0, 104, 0, 690, 0, 0, 253, 0, 0, 0, 0, 0, 0, 0, 254, 0, 701, 703, 105, 106, 0, 0, 107, 0, 108, 0, 0, 255, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, 0, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 0, 249, 0, 0, 0, 0, 0, 0, 0, 7, 8, 9, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 12, 0, 13, 14, 15, 16, 17, -330, 0, 18, 19, 20, 21, 22, 23, 24, 25, 0, 26, 27, 28, 0, 0, 0, 0, 29, 0, 0, 30, 0, 0, 429, 0, 0, 0, 31, 32, 33, 34, 35, 36, 0, 0, 0, 37, 38, 0, 840, 0, 0, 841, 0, 0, 845, 0, 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, 45, 46, 47, -118, -118, 48, 49, 50, 0, 51, 52, 53, 0, 0, 54, -118, 0, 55, 0, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 886, 0, 888, 58, 59, 60, 0, 392, 393, 0, 61, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 64, 0, 0, 65, 903, 0, 0, 66, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 905, 906, 907, 0, 0, 0, 0, 0, 908, 0, 0, 0, 0, 94, 95, 0, 0, 0, 0, 0, 0, 914, 0, 0, 916, 0, 917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 934, 0, 0, 936, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0, 104, 0, 0, 0, 0, 247, 402, 403, 404, 405, 0, 0, 458, 248, 955, 956, 957, 105, 106, 0, 0, 107, 0, 108, 965, 966, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 433, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 1025, 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, 0, 1034, 176, 177, 178, 0, 0, 0, 0, 392, 393, 179, 0, 249, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 1047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 392, 393, 0, 0, 0, 1050, 0, 394, 395, 396, 397, 398, 399, 400, 401, 1053, 0, 0, 1055, 0, 0, 1056, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1067, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1077, 1078, 1079, 1080, 0, 1082, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 94, 95, 740, 0, 741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1129, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 1139, 743, 0, 744, 0, 0, 96, 97, 98, 99, 100, 101, 102, 0, 0, 0, 1156, 0, 0, 0, 0, 0, 0, 0, 103, 0, 89, 104, 0, 0, 0, 93, 0, 0, 1167, 0, 0, 0, 0, 0, 510, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 0, 95, 1185, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 107, 0, 108, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 0, 249, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 94, 95, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 96, 97, 98, 99, 100, 101, 102, 177, 0, 0, 0, 0, 0, 0, 0, 187, 563, 0, 103, 0, 89, 104, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 0, 95, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 107, 0, 108, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 0, 249, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 94, 95, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 96, 97, 98, 99, 100, 101, 102, 177, 0, 0, 0, 0, 0, 0, 0, 187, 565, 0, 103, 89, 0, 104, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 95, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 107, 0, 108, 0, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 488, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 94, 95, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 96, 97, 98, 99, 100, 101, 102, 177, 0, 0, 0, 0, 0, 0, 0, 187, 567, 0, 103, 89, 0, 104, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 95, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 684, 169, 170, 171, 172, 173, 174, 175, 107, 0, 108, 0, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 541, 87, 88, 89, 0, 90, 91, 92, 93, 0, 0, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 94, 95, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 96, 97, 98, 99, 100, 101, 102, 177, 0, 0, 0, 0, 0, 0, 0, 187, 0, 0, 103, 89, 0, 104, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 95, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 887, 169, 170, 171, 172, 173, 174, 175, 107, 0, 108, 0, 0, 176, 177, 178, 0, 0, 0, 0, 0, 0, 179, 552, 87, 88, 89, 0, 90, 91, 92, 93, 0, 261, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 94, 95, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 262, 167, 168, 0, 169, 170, 0, 172, 0, 174, 96, 97, 98, 99, 100, 101, 102, 177, 0, 0, 0, 0, 0, 0, 0, 187, 392, 393, 103, 0, 0, 104, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, 0, 0, 176, 177, 178, 0, 0, 0, 87, 88, 89, 179, 90, 91, 92, 93, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 765, 0, 766, 0, 0, 0, 0, 0, 0, 94, 95, 0, 0, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0, 392, 393, 0, 103, 0, 0, 104, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, 0, 0, 176, 177, 178, 0, 0, 0, 87, 88, 89, 179, 90, 91, 92, 93, 0, 480, 0, 402, 403, 404, 405, 0, 0, 963, 0, 964, 0, 0, 0, 0, 0, 0, 0, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0, 392, 393, 0, 103, 0, 0, 104, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 0, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, 0, 0, 176, 177, 178, 0, 0, 0, 87, 88, 89, 179, 90, 91, 92, 93, 0, 0, 0, 402, 403, 404, 405, 0, 0, 987, 0, 988, 0, 0, 0, 0, 0, 0, 0, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 89, 0, 104, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 0, 0, 107, 0, 108, 95, 0, 0, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, 174, 175, 107, 0, 108, 0, 89, 176, 177, 178, 0, 93, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 131, 132, 95, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 0, 0, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 0, 392, 393, 187, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 107, 0, 108, 0, 0, 0, 0, 0, 0, 0, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 130, 131, 132, 0, 0, 0, 136, 137, 138, 0, 140, 0, 142, 143, 144, 0, 0, 0, 0, 149, 150, 151, 152, 0, 0, 155, 0, 157, 0, 159, 0, 0, 161, 0, 163, 0, 0, 165, 0, 0, 167, 168, 0, 169, 170, 0, 172, 0, 174, 0, 7, 8, 9, 0, 0, 0, 177, 10, 0, 0, 0, 11, 0, 12, 839, 13, 14, 15, 16, 17, -330, 0, 18, 19, 20, 21, 22, 23, 24, 25, 0, 26, 27, 28, 402, 403, 404, 405, 29, -16, -16, 30, 699, 0, 0, 0, 0, 0, 31, 32, 33, 34, 35, 36, 0, 0, 0, 37, 38, 402, 403, 404, 405, 0, 0, 0, 0, 718, 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, 48, 49, 50, 0, 51, 52, 53, 0, 0, 54, 0, 0, 55, 0, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 0, 7, 8, 9, 64, 0, 0, 65, 10, 0, 0, 66, 11, 0, 12, 0, 13, 14, 15, 16, 17, -330, 0, 18, 19, 20, 21, 22, 23, 24, 25, 0, 26, 27, 28, -16, 0, 0, 0, 29, -16, 0, 30, 0, 0, 0, 0, 0, 0, 31, 32, 33, 34, 35, 36, 392, 393, 0, 37, 38, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, 48, 49, 50, 0, 51, 52, 53, 0, 0, 54, 392, 393, 55, 0, 56, 57, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 392, 393, 0, 0, 61, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 64, 392, 393, 65, 0, 0, 0, 66, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 735, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 736, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 737, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 738, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 0, 0, 0, 0, 739, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 742, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 745, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 746, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 748, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 749, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 750, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 751, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 0, 0, 752, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 753, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 754, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 756, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 767, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 768, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 770, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 773, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 0, 0, 796, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 838, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 944, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 961, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 962, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 969, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 970, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 971, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 0, 0, 972, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 973, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 978, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 979, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 982, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 983, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 984, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 985, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 0, 0, 0, 0, 986, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 989, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 990, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 993, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1000, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1003, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1018, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1064, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 0, 0, 1068, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1081, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1090, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1092, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1093, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1095, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1112, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1141, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 0, 0, 1154, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1174, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1184, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 0, 0, 1194, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 472, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 681, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 716, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 717, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 719, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 720, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 721, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 734, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 755, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 762, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 763, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 783, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 0, 0, 834, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 857, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 858, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 865, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 868, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 869, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 874, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 875, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 933, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 938, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 952, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 1001, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 1002, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 392, 393, 0, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 1024, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 402, 403, 404, 405, 392, 393, 1036, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 392, 393, 1089, 0, 0, 0, 0, 394, 395, 396, 397, 398, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 1107, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 1138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 1153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405, 0, 0, 1173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 403, 404, 405 }; static const yytype_int16 yycheck[] = { 2, 275, 276, 308, 40, 47, 48, 4, 75, 75, 7, 15, 16, 12, 200, 17, 4, 1, 12, 7, 4, 1, 28, 58, 4, 60, 61, 33, 30, 44, 0, 33, 218, 77, 36, 37, 38, 41, 25, 11, 42, 43, 44, 194, 195, 58, 3, 60, 61, 51, 7, 8, 9, 10, 4, 5, 95, 44, 846, 847, 16, 63, 28, 92, 93, 4, 5, 279, 280, 53, 43, 44, 3, 53, 77, 104, 7, 8, 9, 10, 4, 7, 190, 7, 20, 21, 190, 195, 44, 197, 63, 23, 12, 197, 196, 195, 98, 197, 70, 71, 72, 73, 74, 75, 76, 195, 88, 197, 12, 110, 70, 71, 72, 73, 74, 75, 76, 4, 5, 70, 71, 72, 73, 74, 75, 76, 190, 63, 64, 196, 196, 195, 44, 197, 70, 71, 72, 73, 74, 75, 76, 77, 190, 63, 64, 189, 190, 191, 192, 197, 70, 71, 72, 73, 74, 75, 76, 77, 190, 63, 64, 100, 374, 198, 376, 197, 70, 71, 72, 73, 74, 75, 76, 77, 190, 190, 178, 179, 75, 76, 77, 197, 132, 133, 134, 198, 4, 5, 191, 192, 75, 190, 194, 132, 133, 134, 195, 199, 190, 196, 195, 195, 197, 195, 190, 241, 242, 481, 196, 195, 212, 197, 190, 196, 190, 217, 200, 195, 190, 261, 200, 197, 224, 497, 498, 267, 268, 35, 36, 190, 190, 196, 189, 190, 218, 195, 197, 197, 218, 190, 1028, 76, 77, 1031, 195, 247, 520, 249, 290, 291, 292, 196, 438, 189, 190, 191, 192, 190, 189, 190, 75, 190, 195, 195, 197, 197, 195, 309, 197, 189, 190, 191, 192, 190, 196, 195, 190, 24, 195, 281, 197, 195, 190, 197, 1072, 189, 190, 191, 192, 197, 196, 293, 189, 190, 191, 192, 298, 299, 190, 301, 302, 303, 304, 305, 306, 197, 4, 5, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 59, 86, 87, 305, 306, 336, 337, 338, 339, 340, 190, 342, 196, 344, 190, 195, 195, 1134, 197, 321, 1137, 197, 46, 354, 196, 189, 190, 191, 192, 360, 89, 90, 91, 196, 365, 296, 297, 96, 1155, 63, 64, 1158, 195, 4, 197, 196, 70, 71, 72, 73, 74, 75, 76, 77, 190, 190, 4, 5, 360, 195, 195, 197, 197, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 196, 1193, 5, 1195, 196, 190, 196, 10, 1200, 1201, 195, 13, 197, 70, 71, 72, 73, 74, 75, 76, 49, 50, 190, 196, 464, 190, 362, 363, 31, 197, 195, 477, 197, 439, 480, 196, 626, 196, 444, 196, 70, 71, 72, 73, 74, 75, 76, 196, 190, 190, 438, 457, 458, 195, 438, 197, 197, 196, 190, 196, 1027, 63, 64, 196, 470, 197, 472, 196, 70, 71, 72, 73, 74, 75, 76, 77, 482, 483, 70, 71, 72, 73, 74, 75, 76, 491, 492, 493, 494, 190, 189, 190, 191, 192, 803, 3, 197, 806, 190, 7, 8, 9, 105, 195, 107, 70, 71, 72, 73, 74, 75, 76, 190, 190, 190, 190, 196, 195, 454, 455, 197, 197, 197, 459, 460, 190, 196, 190, 196, 132, 133, 134, 197, 190, 197, 138, 139, 140, 190, 142, 197, 144, 145, 146, 1111, 197, 190, 1114, 151, 152, 153, 154, 190, 197, 157, 190, 159, 190, 161, 197, 190, 164, 197, 166, 197, 1132, 169, 197, 1135, 172, 173, 190, 175, 176, 196, 178, 195, 180, 71, 72, 73, 74, 75, 76, 77, 188, 190, 189, 190, 191, 192, 195, 190, 196, 197, 190, 4, 5, 190, 197, 878, 190, 197, 609, 610, 197, 190, 190, 197, 196, 190, 4, 5, 197, 197, 196, 894, 197, 14, 1186, 16, 1188, 18, 629, 196, 190, 634, 635, 190, 1196, 190, 1198, 4, 5, 190, 197, 642, 197, 626, 44, 830, 197, 626, 190, 190, 41, 692, 190, 44, 655, 197, 197, 190, 49, 197, 661, 662, 195, 63, 64, 196, 667, 196, 709, 710, 70, 71, 72, 73, 74, 75, 76, 77, 190, 196, 681, 4, 5, 195, 70, 71, 72, 73, 74, 75, 76, 77, 733, 190, 190, 696, 697, 698, 196, 195, 197, 189, 190, 191, 192, 636, 637, 708, 639, 640, 14, 196, 16, 196, 18, 716, 717, 196, 719, 720, 721, 14, 190, 16, 707, 18, 196, 190, 707, 197, 731, 732, 195, 734, 39, 40, 190, 41, 190, 740, 44, 195, 743, 195, 190, 49, 196, 190, 41, 46, 190, 44, 195, 44, 755, 195, 49, 758, 759, 760, 190, 762, 763, 190, 695, 195, 63, 64, 195, 44, 771, 60, 61, 70, 71, 72, 73, 74, 75, 76, 77, 14, 196, 16, 196, 18, 4, 5, 196, 189, 190, 191, 192, 60, 61, 196, 58, 798, 196, 800, 801, 802, 51, 189, 190, 191, 192, 196, 41, 196, 195, 44, 196, 814, 63, 64, 49, 196, 196, 196, 196, 70, 71, 72, 73, 74, 75, 76, 77, 5, 196, 196, 196, 834, 182, 183, 184, 185, 186, 196, 196, 196, 196, 844, 196, 196, 196, 830, 3, 196, 196, 830, 196, 196, 196, 196, 857, 858, 196, 196, 196, 862, 863, 196, 196, 196, 21, 868, 869, 24, 196, 196, 196, 1058, 1059, 196, 196, 196, 33, 196, 196, 196, 37, 38, 196, 196, 196, 42, 196, 196, 862, 863, 189, 190, 191, 192, 196, 196, 196, 54, 55, 56, 196, 43, 196, 77, 196, 195, 63, 64, 65, 66, 73, 74, 75, 76, 77, 196, 1103, 922, 923, 197, 196, 196, 855, 856, 967, 928, 196, 195, 195, 195, 933, 75, 195, 195, 1121, 938, 63, 1124, 189, 190, 191, 192, 197, 70, 71, 72, 73, 74, 75, 76, 77, 197, 197, 196, 63, 64, 1143, 196, 195, 195, 963, 70, 71, 72, 73, 74, 75, 76, 77, 196, 196, 195, 43, 46, 196, 196, 58, 196, 981, 10, 196, 195, 195, 195, 987, 195, 197, 43, 197, 197, 195, 197, 995, 196, 997, 74, 75, 76, 77, 1002, 196, 85, 197, 197, 195, 195, 5, 196, 1011, 197, 197, 197, 945, 946, 197, 197, 197, 196, 1021, 196, 85, 1024, 179, 58, 197, 197, 189, 190, 191, 192, 187, 197, 197, 195, 195, 43, 195, 197, 1041, 196, 63, 64, 197, 197, 197, 196, 196, 70, 71, 72, 73, 74, 75, 76, 77, 212, 197, 1060, 196, 38, 217, 197, 189, 190, 191, 192, 197, 224, 1071, 43, 196, 58, 197, 1058, 1059, 197, 48, 1058, 1059, 75, 189, 190, 191, 192, 75, 75, 1089, 58, 197, 196, 196, 248, 197, 197, 196, 1098, 47, 196, 196, 58, 75, 258, 197, 1106, 1107, 197, 38, 196, 196, 4, 189, 190, 191, 192, 4, 53, 707, 53, 1103, 642, 5, 638, 1103, 308, 928, 282, 641, 464, 1182, 461, 1086, 842, 474, 1136, -1, 1138, 1121, 294, -1, 1124, 1121, -1, -1, 1124, -1, -1, -1, -1, 305, 71, 1153, 73, 74, 75, 76, 77, -1, -1, 1143, -1, -1, -1, 1143, -1, -1, -1, 189, 190, 191, 192, 1173, -1, 195, -1, 331, 332, 333, 334, 335, -1, -1, 338, -1, -1, 341, -1, 343, -1, 345, 346, 347, 348, 349, 350, 351, 352, 353, -1, 355, 356, 357, 358, 359, 360, 361, -1, -1, 364, -1, 366, 367, 368, 369, 370, -1, -1, 373, -1, 375, -1, 377, 378, 379, -1, -1, -1, 383, 384, 385, 386, 387, 388, 389, 390, -1, -1, -1, -1, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 189, 190, 191, 192, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 441, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, -1, -1, 469, -1, -1, -1, 81, -1, -1, 84, -1, 478, -1, -1, 89, -1, -1, -1, -1, -1, -1, -1, 97, -1, 491, 492, 101, 102, -1, -1, 105, -1, 107, -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, -1, -1, -1, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, -1, -1, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, -1, -1, -1, -1, 42, -1, -1, 45, -1, -1, 642, -1, -1, -1, 52, 53, 54, 55, 56, 57, -1, -1, -1, 61, 62, -1, 658, -1, -1, 661, -1, -1, 664, -1, -1, -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, -1, -1, -1, -1, -1, 89, 90, 91, 92, 93, 94, 95, 96, -1, 98, 99, 100, -1, -1, 103, 104, -1, 106, -1, 108, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 723, -1, 725, 132, 133, 134, -1, 63, 64, -1, 139, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, 158, -1, -1, -1, 162, -1, -1, -1, -1, 167, -1, -1, 170, 765, -1, -1, 174, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, 783, 784, 785, -1, -1, -1, -1, -1, 791, -1, -1, -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, 804, -1, -1, 807, -1, 809, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, 69, 836, -1, -1, 839, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, 84, -1, -1, -1, -1, 89, 189, 190, 191, 192, -1, -1, 195, 97, 864, 865, 866, 101, 102, -1, -1, 105, -1, 107, 874, 875, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 928, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, 940, 175, 176, 177, 178, 179, 180, 181, -1, -1, -1, -1, 952, 187, 188, 189, -1, -1, -1, -1, 63, 64, 196, -1, 198, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 976, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, -1, -1, -1, 991, -1, 70, 71, 72, 73, 74, 75, 76, 77, 1001, -1, -1, 1004, -1, -1, 1007, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1035, 1036, 1037, 1038, -1, 1040, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 30, 31, 195, -1, 197, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1105, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, 1117, 195, -1, 197, -1, -1, 63, 64, 65, 66, 67, 68, 69, -1, -1, -1, 1133, -1, -1, -1, -1, -1, -1, -1, 81, -1, 5, 84, -1, -1, -1, 10, -1, -1, 1151, -1, -1, -1, -1, -1, 97, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, -1, 31, 1170, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, 105, -1, 107, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, 30, 31, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, 63, 64, 65, 66, 67, 68, 69, 188, -1, -1, -1, -1, -1, -1, -1, 196, 197, -1, 81, -1, 5, 84, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, -1, 31, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, 105, -1, 107, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, 30, 31, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, 63, 64, 65, 66, 67, 68, 69, 188, -1, -1, -1, -1, -1, -1, -1, 196, 197, -1, 81, 5, -1, 84, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, 31, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, 105, -1, 107, -1, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, 197, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, 30, 31, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, 63, 64, 65, 66, 67, 68, 69, 188, -1, -1, -1, -1, -1, -1, -1, 196, 197, -1, 81, 5, -1, 84, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, 31, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, 97, 175, 176, 177, 178, 179, 180, 181, 105, -1, 107, -1, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, 197, 3, 4, 5, -1, 7, 8, 9, 10, -1, -1, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, 30, 31, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, 63, 64, 65, 66, 67, 68, 69, 188, -1, -1, -1, -1, -1, -1, -1, 196, -1, -1, 81, 5, -1, 84, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, 31, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, 97, 175, 176, 177, 178, 179, 180, 181, 105, -1, 107, -1, -1, 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, 197, 3, 4, 5, -1, 7, 8, 9, 10, -1, 12, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, 30, 31, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, 53, 172, 173, -1, 175, 176, -1, 178, -1, 180, 63, 64, 65, 66, 67, 68, 69, 188, -1, -1, -1, -1, -1, -1, -1, 196, 63, 64, 81, -1, -1, 84, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, -1, -1, -1, -1, 187, 188, 189, -1, -1, -1, 3, 4, 5, 196, 7, 8, 9, 10, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, 197, -1, -1, -1, -1, -1, -1, 30, 31, -1, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, -1, 81, -1, -1, 84, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, -1, -1, -1, -1, 187, 188, 189, -1, -1, -1, 3, 4, 5, 196, 7, 8, 9, 10, -1, 12, -1, 189, 190, 191, 192, -1, -1, 195, -1, 197, -1, -1, -1, -1, -1, -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, -1, 81, -1, -1, 84, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, -1, -1, -1, -1, -1, 187, 188, 189, -1, -1, -1, 3, 4, 5, 196, 7, 8, 9, 10, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, 197, -1, -1, -1, -1, -1, -1, -1, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, 5, -1, 84, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 101, 102, -1, -1, 105, -1, 107, 31, -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, -1, 163, 164, 165, 166, -1, 168, 169, -1, 171, 172, 173, -1, 175, 176, 177, 178, 179, 180, 181, 105, -1, 107, -1, 5, 187, 188, 189, -1, 10, -1, -1, -1, -1, 196, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 132, 133, 134, 31, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, -1, -1, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, -1, -1, -1, -1, -1, -1, -1, 188, -1, -1, -1, -1, -1, 63, 64, 196, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 105, -1, 107, -1, -1, -1, -1, -1, -1, -1, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 132, 133, 134, -1, -1, -1, 138, 139, 140, -1, 142, -1, 144, 145, 146, -1, -1, -1, -1, 151, 152, 153, 154, -1, -1, 157, -1, 159, -1, 161, -1, -1, 164, -1, 166, -1, -1, 169, -1, -1, 172, 173, -1, 175, 176, -1, 178, -1, 180, -1, 4, 5, 6, -1, -1, -1, 188, 11, -1, -1, -1, 15, -1, 17, 196, 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 189, 190, 191, 192, 42, 43, 44, 45, 197, -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, -1, -1, -1, 61, 62, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, -1, -1, -1, -1, -1, 89, 90, 91, -1, -1, 94, 95, 96, -1, 98, 99, 100, -1, -1, 103, -1, -1, 106, -1, 108, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 132, 133, 134, -1, -1, -1, -1, 139, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 158, -1, -1, -1, 162, -1, 4, 5, 6, 167, -1, -1, 170, 11, -1, -1, 174, 15, -1, 17, -1, 19, 20, 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, -1, -1, -1, 42, 43, -1, 45, -1, -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, 63, 64, -1, 61, 62, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, 78, 79, 80, 81, 82, 83, -1, -1, -1, -1, -1, 89, 90, 91, -1, -1, 94, 95, 96, -1, 98, 99, 100, -1, -1, 103, 63, 64, 106, -1, 108, 109, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 132, 133, 134, 63, 64, -1, -1, 139, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, 158, -1, -1, -1, 162, -1, -1, -1, -1, 167, 63, 64, 170, -1, -1, -1, 174, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, -1, -1, 197, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, -1, -1, 197, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, 63, 64, -1, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, 63, 64, 195, -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192, -1, -1, 195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 189, 190, 191, 192 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = { 0, 182, 183, 184, 185, 186, 200, 4, 5, 6, 11, 15, 17, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 42, 45, 52, 53, 54, 55, 56, 57, 61, 62, 78, 79, 80, 81, 82, 83, 89, 90, 91, 94, 95, 96, 98, 99, 100, 103, 106, 108, 109, 132, 133, 134, 139, 158, 162, 167, 170, 174, 201, 202, 205, 206, 213, 214, 216, 217, 221, 233, 234, 239, 245, 252, 260, 268, 271, 275, 278, 284, 3, 4, 5, 7, 8, 9, 10, 30, 31, 63, 64, 65, 66, 67, 68, 69, 81, 84, 101, 102, 105, 107, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 168, 169, 171, 172, 173, 175, 176, 177, 178, 179, 180, 181, 187, 188, 189, 196, 219, 220, 222, 228, 230, 233, 234, 196, 219, 205, 233, 234, 239, 0, 75, 196, 75, 196, 253, 272, 276, 4, 7, 231, 231, 231, 34, 222, 207, 208, 219, 235, 236, 235, 219, 28, 7, 261, 269, 222, 58, 60, 61, 198, 315, 211, 219, 222, 4, 5, 232, 222, 219, 222, 219, 222, 4, 5, 295, 296, 10, 189, 190, 229, 230, 297, 231, 89, 97, 198, 219, 222, 316, 89, 97, 110, 316, 316, 88, 222, 227, 12, 53, 227, 227, 59, 89, 90, 91, 96, 95, 222, 214, 221, 219, 219, 219, 110, 196, 196, 196, 196, 196, 219, 316, 219, 219, 219, 44, 203, 92, 93, 104, 75, 75, 24, 196, 196, 196, 196, 222, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 222, 219, 222, 70, 71, 72, 73, 74, 75, 76, 190, 44, 63, 64, 70, 71, 72, 73, 74, 75, 76, 77, 189, 190, 191, 192, 219, 44, 44, 44, 222, 235, 219, 235, 4, 222, 202, 35, 36, 20, 21, 4, 5, 246, 247, 4, 5, 248, 249, 219, 222, 237, 238, 219, 222, 263, 202, 279, 285, 196, 58, 196, 4, 7, 196, 219, 222, 298, 58, 60, 61, 198, 300, 313, 196, 196, 195, 195, 195, 196, 196, 195, 230, 230, 195, 222, 219, 222, 11, 195, 195, 219, 195, 227, 212, 12, 195, 215, 195, 227, 12, 227, 215, 215, 5, 218, 218, 218, 197, 222, 219, 195, 195, 195, 195, 43, 227, 227, 227, 222, 219, 240, 235, 235, 222, 222, 222, 222, 222, 222, 97, 219, 316, 316, 4, 5, 225, 226, 225, 226, 227, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 316, 222, 222, 222, 222, 222, 222, 222, 222, 197, 222, 219, 219, 219, 219, 219, 222, 222, 219, 222, 197, 222, 222, 219, 222, 219, 222, 219, 219, 197, 219, 197, 219, 197, 219, 197, 219, 219, 219, 219, 222, 219, 219, 219, 219, 219, 219, 316, 219, 235, 235, 219, 222, 219, 219, 219, 219, 219, 197, 197, 219, 218, 219, 218, 219, 219, 219, 197, 197, 219, 219, 219, 219, 219, 219, 219, 219, 224, 223, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 197, 197, 75, 273, 14, 16, 18, 41, 44, 49, 277, 209, 210, 196, 196, 195, 196, 196, 195, 195, 43, 262, 14, 16, 18, 41, 44, 49, 270, 46, 202, 222, 196, 219, 222, 51, 299, 194, 195, 196, 58, 196, 4, 7, 196, 10, 314, 235, 235, 4, 5, 222, 222, 235, 235, 296, 10, 229, 195, 86, 87, 97, 219, 222, 222, 300, 227, 219, 227, 215, 222, 222, 196, 195, 195, 195, 197, 197, 219, 222, 219, 222, 222, 222, 204, 195, 215, 215, 4, 5, 244, 197, 197, 195, 195, 197, 195, 195, 195, 197, 195, 197, 195, 197, 196, 196, 197, 197, 195, 195, 215, 195, 197, 197, 197, 197, 197, 195, 197, 197, 195, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 195, 197, 197, 195, 195, 195, 197, 195, 195, 197, 195, 197, 197, 197, 197, 197, 195, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 195, 195, 195, 197, 197, 197, 197, 197, 195, 197, 197, 197, 197, 197, 197, 195, 197, 195, 195, 195, 195, 195, 197, 195, 195, 197, 195, 197, 197, 222, 222, 254, 202, 222, 231, 317, 231, 318, 235, 235, 247, 235, 235, 249, 238, 43, 264, 280, 49, 50, 286, 195, 222, 195, 197, 197, 196, 219, 219, 222, 222, 196, 219, 301, 302, 222, 4, 5, 292, 294, 197, 197, 196, 196, 195, 195, 197, 197, 222, 85, 85, 195, 195, 195, 227, 195, 195, 235, 222, 222, 222, 195, 195, 206, 222, 227, 227, 241, 222, 222, 222, 222, 222, 219, 97, 219, 197, 197, 222, 222, 227, 222, 222, 222, 222, 222, 222, 222, 222, 222, 219, 222, 219, 219, 219, 219, 222, 222, 222, 222, 226, 219, 226, 219, 219, 222, 16, 44, 274, 195, 195, 197, 197, 197, 197, 39, 40, 266, 202, 222, 195, 219, 58, 219, 299, 195, 222, 195, 197, 292, 292, 197, 196, 196, 195, 235, 235, 222, 222, 195, 316, 316, 219, 219, 219, 222, 222, 197, 197, 197, 195, 197, 219, 219, 215, 196, 197, 197, 197, 197, 197, 197, 197, 195, 197, 197, 197, 197, 215, 197, 197, 197, 197, 197, 195, 197, 197, 197, 195, 197, 197, 197, 195, 197, 195, 197, 197, 197, 195, 195, 197, 195, 197, 197, 195, 197, 197, 197, 12, 231, 231, 263, 43, 38, 281, 197, 222, 197, 196, 195, 222, 195, 219, 58, 308, 303, 235, 235, 293, 197, 197, 219, 195, 195, 75, 75, 222, 75, 195, 227, 4, 5, 250, 251, 219, 222, 222, 219, 222, 222, 219, 222, 219, 219, 222, 265, 267, 48, 288, 60, 61, 197, 58, 222, 219, 197, 222, 197, 196, 314, 292, 197, 197, 292, 219, 219, 219, 219, 197, 219, 222, 196, 196, 195, 197, 197, 195, 197, 197, 197, 197, 197, 197, 197, 197, 13, 258, 202, 202, 222, 47, 287, 196, 196, 195, 197, 60, 61, 304, 197, 58, 309, 222, 292, 75, 197, 197, 251, 242, 222, 222, 255, 46, 291, 202, 282, 219, 222, 222, 310, 196, 314, 305, 196, 314, 195, 219, 202, 197, 202, 289, 14, 16, 18, 41, 44, 49, 283, 195, 197, 195, 197, 314, 219, 292, 314, 222, 292, 222, 25, 44, 243, 256, 202, 219, 222, 292, 195, 197, 292, 195, 197, 14, 16, 18, 41, 44, 49, 257, 290, 197, 197, 219, 311, 222, 306, 4, 259, 288, 197, 314, 197, 314, 312, 292, 307, 292, 314, 314, 292, 292 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { 0, 199, 200, 200, 200, 200, 200, 201, 202, 203, 204, 202, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 206, 208, 206, 206, 206, 206, 206, 206, 206, 209, 206, 210, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 211, 206, 212, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 215, 215, 216, 216, 216, 216, 216, 217, 217, 218, 218, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, 221, 223, 222, 224, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 225, 226, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 230, 230, 230, 230, 231, 231, 232, 232, 232, 232, 233, 234, 236, 235, 237, 237, 237, 238, 238, 240, 241, 242, 239, 243, 243, 244, 244, 245, 245, 245, 245, 246, 246, 247, 247, 247, 247, 248, 248, 249, 249, 249, 249, 250, 250, 250, 251, 251, 251, 251, 253, 254, 255, 256, 252, 257, 257, 257, 257, 257, 257, 258, 258, 259, 259, 261, 260, 262, 262, 263, 263, 264, 265, 264, 266, 267, 266, 269, 268, 270, 270, 270, 270, 270, 270, 272, 273, 271, 274, 274, 276, 275, 277, 277, 277, 277, 277, 277, 279, 280, 281, 282, 278, 283, 283, 283, 283, 283, 283, 285, 284, 286, 286, 287, 287, 288, 289, 290, 288, 291, 291, 292, 293, 292, 294, 294, 294, 294, 295, 295, 296, 296, 296, 296, 297, 297, 297, 297, 298, 298, 298, 298, 298, 299, 299, 299, 301, 300, 302, 300, 303, 300, 304, 300, 305, 300, 306, 300, 307, 300, 308, 300, 309, 300, 310, 300, 311, 300, 312, 300, 313, 300, 314, 314, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 316, 316, 317, 317, 318, 318 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 2, 3, 3, 3, 3, 2, 1, 0, 0, 5, 1, 2, 1, 2, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 3, 0, 3, 1, 1, 2, 2, 3, 3, 0, 5, 0, 5, 2, 1, 2, 1, 2, 2, 2, 3, 4, 4, 0, 3, 0, 4, 6, 2, 6, 2, 2, 2, 1, 2, 1, 2, 2, 2, 5, 7, 3, 2, 3, 4, 5, 3, 2, 4, 3, 8, 6, 6, 2, 2, 5, 7, 4, 6, 8, 5, 2, 2, 2, 2, 3, 2, 2, 1, 1, 3, 4, 4, 4, 4, 4, 4, 1, 1, 2, 1, 2, 2, 8, 6, 6, 0, 1, 1, 2, 2, 3, 10, 8, 8, 8, 3, 1, 1, 6, 4, 4, 6, 6, 4, 6, 1, 4, 1, 1, 1, 1, 3, 3, 6, 6, 8, 6, 4, 6, 8, 4, 1, 3, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 4, 4, 4, 6, 1, 3, 1, 3, 4, 6, 6, 4, 6, 4, 6, 10, 4, 4, 4, 8, 6, 4, 3, 3, 0, 4, 0, 4, 2, 3, 3, 3, 3, 3, 3, 3, 4, 6, 1, 4, 4, 6, 6, 1, 1, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 6, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 3, 6, 6, 4, 4, 4, 4, 6, 6, 8, 6, 8, 4, 4, 4, 8, 4, 4, 4, 4, 1, 3, 4, 1, 3, 4, 1, 3, 4, 1, 3, 6, 6, 4, 6, 6, 6, 4, 8, 6, 8, 6, 4, 4, 4, 6, 6, 6, 8, 4, 1, 2, 2, 1, 1, 1, 1, 1, 1, 4, 6, 4, 6, 4, 4, 0, 2, 0, 1, 3, 1, 1, 0, 0, 0, 11, 1, 1, 1, 1, 0, 1, 1, 2, 1, 3, 1, 1, 4, 4, 1, 3, 1, 1, 4, 4, 0, 1, 3, 1, 1, 3, 3, 0, 0, 0, 0, 14, 1, 1, 1, 1, 1, 1, 0, 2, 0, 1, 0, 7, 1, 2, 1, 1, 0, 0, 5, 0, 0, 4, 0, 4, 1, 1, 1, 1, 1, 1, 0, 0, 6, 1, 1, 0, 4, 1, 2, 1, 1, 1, 1, 0, 0, 0, 0, 11, 1, 1, 1, 1, 1, 1, 0, 5, 1, 1, 0, 2, 0, 0, 0, 7, 0, 1, 1, 0, 4, 1, 4, 1, 4, 1, 3, 1, 4, 1, 4, 1, 1, 3, 3, 0, 2, 4, 1, 3, 0, 2, 6, 0, 4, 0, 4, 0, 6, 0, 9, 0, 10, 0, 13, 0, 15, 0, 7, 0, 9, 0, 10, 0, 13, 0, 15, 0, 3, 0, 1, 0, 2, 2, 4, 1, 4, 6, 6, 7, 10, 12, 7, 10, 12, 2, 1, 1, 3, 1, 3 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* YYLOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ # ifndef YYLOCATION_PRINT # if defined YY_LOCATION_PRINT /* Temporary convenience wrapper in case some people defined the undocumented and private YY_LOCATION_PRINT macros. */ # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) # elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ YY_ATTRIBUTE_UNUSED static int yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += YYFPRINTF (yyo, "-%d", end_col); } return res; } # define YYLOCATION_PRINT yy_location_print_ /* Temporary convenience wrapper in case some people defined the undocumented and private YY_LOCATION_PRINT macros. */ # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) # else # define YYLOCATION_PRINT(File, Loc) ((void) 0) /* Temporary convenience wrapper in case some people defined the undocumented and private YY_LOCATION_PRINT macros. */ # define YY_LOCATION_PRINT YYLOCATION_PRINT # endif # endif /* !defined YYLOCATION_PRINT */ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value, Location); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) { FILE *yyoutput = yyo; YY_USE (yyoutput); YY_USE (yylocationp); if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); YYLOCATION_PRINT (yyo, yylocationp); YYFPRINTF (yyo, ": "); yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)], &(yylsp[(yyi + 1) - (yynrhs)])); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) { YY_USE (yyvaluep); YY_USE (yylocationp); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Location data for the lookahead symbol. */ YYLTYPE yylloc # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; /* The location stack: array, bottom, top. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp = yyls; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ yylsp[0] = yylloc; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yyls1, yysize * YYSIZEOF (*yylsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; yyls = yyls1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; yyerror_range[1] = yylloc; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; /* Discard the shifted token. */ yychar = YYEMPTY; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { case 3: /* program_or_expression: tSTART_EXPRESSION expression tEOPROG */ {YYACCEPT;} break; case 4: /* program_or_expression: tSTART_STRING_EXPRESSION string_expression tEOPROG */ {YYACCEPT;} break; case 5: /* program_or_expression: tSTART_ASSIGNMENT assignment tEOPROG */ {YYACCEPT;} break; case 6: /* program_or_expression: tSTART_FUNCTION_DEFINITION function_definition tEOPROG */ {YYACCEPT;} break; case 7: /* program: statement_list tEOPROG */ {YYACCEPT;} break; case 9: /* $@1: %empty */ {if (severity_so_far >= sERROR) {YYABORT;}} break; case 10: /* $@2: %empty */ {if (in_short_if > 0 && (yyvsp[0].nnl) > 0) lyyerror(sERROR,"short if-statement (i.e. without 'then' and ended by newline) does not contain any statements");} break; case 18: /* statement: tIMPORT */ {report_if_missing("can not import a library in a loop or an if-statement",FALSE);} break; case 19: /* statement: tERROR string_expression */ {add_command(cERROR);} break; case 25: /* statement: tBREAK */ {add_command(cPOP_MULTI);create_mybreak(1);if (!loop_nesting && !switch_nesting) lyyerror(sERROR,"break outside loop or switch");} break; case 26: /* statement: tBREAK tDIGITS */ {add_command(cPOP_MULTI);create_mybreak(atoi((yyvsp[0].digits)));if (!loop_nesting && !switch_nesting) lyyerror(sERROR,"break outside loop or switch");} break; case 27: /* statement: tCONTINUE */ {add_command(cPOP_MULTI);add_command_with_switch_state(cCONTINUE);if (!loop_nesting) lyyerror(sERROR,"continue outside loop");} break; case 29: /* statement: function_or_array */ {create_call((yyvsp[0].symbol));add_command(cPOP);} break; case 30: /* statement: stringfunction_or_array */ {create_call((yyvsp[0].symbol));add_command(cPOP);} break; case 31: /* $@3: %empty */ {if (function_type==ftNONE) lyyerror(sERROR,"no use for 'local' outside functions");} break; case 33: /* $@4: %empty */ {if (function_type==ftNONE) lyyerror(sERROR,"no use for 'static' outside functions");} break; case 37: /* statement: tGOTO symbol_or_lineno */ {create_goto((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));} break; case 38: /* statement: tGOSUB symbol_or_lineno */ {create_gosub((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));} break; case 39: /* statement: tON tINTERRUPT tBREAK */ {create_exception(TRUE);} break; case 40: /* statement: tON tINTERRUPT tCONTINUE */ {create_exception(FALSE);} break; case 41: /* $@5: %empty */ {add_command(cSKIPPER);} break; case 42: /* statement: tON expression tGOTO $@5 goto_list */ {add_command(cNOP);} break; case 43: /* $@6: %empty */ {add_command(cSKIPPER);} break; case 44: /* statement: tON expression tGOSUB $@6 gosub_list */ {add_command(cNOP);} break; case 45: /* statement: tLABEL symbol_or_lineno */ {create_label((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol),cLABEL);} break; case 46: /* statement: open_clause */ {add_command(cCHECKOPEN);} break; case 47: /* statement: tCLOSE hashed_number */ {add_command(cCLOSE);} break; case 48: /* statement: seek_clause */ {add_command(cCHECKSEEK);} break; case 49: /* statement: tCOMPILE string_expression */ {add_command(cCOMPILE);} break; case 50: /* statement: tEXECUTE call_list */ {create_execute(0);add_command(cPOP);add_command(cPOP);} break; case 51: /* statement: tEXECUTE2 call_list */ {create_execute(1);add_command(cPOP);add_command(cPOP);} break; case 52: /* statement: tPRINT printintro printlist */ {create_colour(0);create_print('n');create_pps(cPOPSTREAM,0);} break; case 53: /* statement: tPRINT printintro printlist ';' */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 54: /* statement: tPRINT printintro printlist ',' */ {create_colour(0);create_print('t');create_pps(cPOPSTREAM,0);} break; case 55: /* $@7: %empty */ {tileol=FALSE;} break; case 57: /* $@8: %empty */ {tileol=TRUE;} break; case 59: /* statement: tCOLOUR expression ',' expression ',' expression */ {add_command(cGCOLOUR);} break; case 60: /* statement: tCOLOUR string_expression */ {add_command(cGCOLOUR2);} break; case 61: /* statement: tBACKCOLOUR expression ',' expression ',' expression */ {add_command(cGBACKCOLOUR);} break; case 62: /* statement: tBACKCOLOUR string_expression */ {add_command(cGBACKCOLOUR2);} break; case 65: /* statement: tRESTORE */ {create_restore("");} break; case 66: /* statement: tRESTORE symbol_or_lineno */ {create_restore((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));} break; case 67: /* statement: tRETURN */ {if (function_type!=ftNONE) { add_command(cCLEARSYMREFS);end_symref_chain(); add_command(cPOPSYMLIST); create_check_return_value(ftNONE,function_type); add_command(cRETURN_FROM_CALL); } else { add_command(cRETURN_FROM_GOSUB); }} break; case 68: /* statement: tRETURN expression */ {if (function_type==ftNONE) {lyyerror(sERROR,"a value can only be returned from a subroutine"); YYABORT;} add_command(cCLEARSYMREFS);end_symref_chain();add_command(cPOPSYMLIST);create_check_return_value(ftNUMBER,function_type);add_command(cRETURN_FROM_CALL);} break; case 69: /* statement: tRETURN string_expression */ {if (function_type==ftNONE) {lyyerror(sERROR,"can not return value"); YYABORT;} add_command(cCLEARSYMREFS);end_symref_chain();add_command(cPOPSYMLIST);create_check_return_value(ftSTRING,function_type);add_command(cRETURN_FROM_CALL);} break; case 71: /* statement: tOPEN tWINDOW expression ',' expression */ {create_openwin(FALSE);} break; case 72: /* statement: tOPEN tWINDOW expression ',' expression ',' string_expression */ {create_openwin(TRUE);} break; case 73: /* statement: tWINDOW tORIGIN string_expression */ {add_command(cMOVEORIGIN);} break; case 74: /* statement: tDOT coordinates */ {add_command(cDOT);} break; case 75: /* statement: tCLEAR tDOT coordinates */ {add_command(cDOT);putindrawmode(dmCLEAR);} break; case 76: /* statement: tLINE coordinates to coordinates */ {create_line(2);} break; case 77: /* statement: tCLEAR tLINE coordinates to coordinates */ {create_line(2);putindrawmode(dmCLEAR);} break; case 78: /* statement: tLINE tTO coordinates */ {create_line(1);} break; case 79: /* statement: tLINE coordinates */ {create_line(1);} break; case 80: /* statement: tCLEAR tLINE tTO coordinates */ {create_line(1);putindrawmode(dmCLEAR);} break; case 81: /* statement: tCLEAR tLINE coordinates */ {create_line(1);putindrawmode(dmCLEAR);} break; case 82: /* statement: tPUTBIT string_expression to expression ',' expression ',' string_expression */ {add_command(cPUTBIT);} break; case 83: /* statement: tPUTBIT string_expression to expression ',' expression */ {create_pushstr("solid"); add_command(cPUTBIT);} break; case 84: /* statement: tPUTCHAR string_expression to expression ',' expression */ {add_command(cPUTCHAR);} break; case 85: /* statement: tNEW tCURVE */ {create_line(-1);} break; case 86: /* statement: tCLOSE tCURVE */ {create_line(0);} break; case 87: /* statement: clear_fill_clause tCIRCLE coordinates ',' expression */ {add_command(cCIRCLE);putindrawmode(0);} break; case 88: /* statement: clear_fill_clause tTRIANGLE coordinates to coordinates to coordinates */ {add_command(cTRIANGLE);putindrawmode(0);} break; case 89: /* statement: tTEXT coordinates ',' string_expression */ {add_command(cTEXT1);} break; case 90: /* statement: tTEXT coordinates ',' string_expression ',' string_expression */ {add_command(cTEXT2);} break; case 91: /* statement: tTEXT coordinates ',' string_expression ',' string_expression ',' string_expression */ {add_command(cTEXT3);} break; case 92: /* statement: clear_fill_clause tRECT coordinates to coordinates */ {add_command(cRECT);putindrawmode(0);} break; case 93: /* statement: tCLOSE tWINDOW */ {add_command(cCLOSEWIN);} break; case 94: /* statement: tCLEAR tWINDOW */ {add_command(cCLEARWIN);} break; case 95: /* statement: tCLEAR tSCREEN */ {add_command(cCLEARSCR);} break; case 96: /* statement: tOPEN tPRINTER */ {create_openprinter(0);} break; case 97: /* statement: tOPEN tPRINTER string_expression */ {create_openprinter(1);} break; case 98: /* statement: tCLOSE tPRINTER */ {add_command(cCLOSEPRN);} break; case 99: /* statement: tWAIT expression */ {add_command(cWAIT);} break; case 100: /* statement: tBELL */ {add_command(cBELL);} break; case 101: /* statement: tINKEY */ {create_pushdbl(-1);create_function(fINKEY);add_command(cPOP);} break; case 102: /* statement: tINKEY '(' ')' */ {create_pushdbl(-1);create_function(fINKEY);add_command(cPOP);} break; case 103: /* statement: tINKEY '(' expression ')' */ {create_function(fINKEY);add_command(cPOP);} break; case 104: /* statement: tSYSTEM '(' string_expression ')' */ {create_function(fSYSTEM); add_command(cPOP);} break; case 105: /* statement: tPOKE string_expression ',' string_expression */ {create_poke('s');} break; case 106: /* statement: tPOKE string_expression ',' expression */ {create_poke('d');} break; case 107: /* statement: tPOKE hashed_number ',' string_expression */ {create_poke('S');} break; case 108: /* statement: tPOKE hashed_number ',' expression */ {create_poke('D');} break; case 109: /* statement: tEND */ {add_command(cEND);} break; case 110: /* statement: tEXIT */ {create_pushdbl(0);add_command(cEXIT);} break; case 111: /* statement: tEXIT expression */ {add_command(cEXIT);} break; case 112: /* statement: tDOCU */ {create_docu((yyvsp[0].symbol));} break; case 113: /* statement: tBIND string_expression */ {add_command(cBIND);} break; case 114: /* statement: tFRNBF_FREE string_expression */ {add_command(cFRNBF_FREE);} break; case 115: /* statement: tFRNBF_SET string_expression ',' expression ',' string_expression ',' expression */ {add_command(cFRNBF_SET_NUMBER);} break; case 116: /* statement: tFRNBF_SET string_expression ',' expression ',' string_expression */ {add_command(cFRNBF_SET_STRING);} break; case 117: /* statement: tFRNBF_SET_BUFFER string_expression ',' expression ',' string_expression */ {add_command(cFRNBF_SET_BUFFER);} break; case 118: /* clear_fill_clause: %empty */ {drawmode=0;} break; case 119: /* clear_fill_clause: tCLEAR */ {drawmode=dmCLEAR;} break; case 120: /* clear_fill_clause: tFILL */ {drawmode=dmFILL;} break; case 121: /* clear_fill_clause: tCLEAR tFILL */ {drawmode=dmFILL+dmCLEAR;} break; case 122: /* clear_fill_clause: tFILL tCLEAR */ {drawmode=dmFILL+dmCLEAR;} break; case 123: /* string_assignment: tSTRSYM tEQU string_expression */ {add_command_with_sym_and_diag(cPOPSTRSYM,dotify((yyvsp[-2].symbol),FALSE),NULL);} break; case 124: /* string_assignment: tMID '(' string_scalar_or_array ',' expression ',' expression ')' tEQU string_expression */ {create_changestring(fMID);} break; case 125: /* string_assignment: tMID '(' string_scalar_or_array ',' expression ')' tEQU string_expression */ {create_changestring(fMID2);} break; case 126: /* string_assignment: tLEFT '(' string_scalar_or_array ',' expression ')' tEQU string_expression */ {create_changestring(fLEFT);} break; case 127: /* string_assignment: tRIGHT '(' string_scalar_or_array ',' expression ')' tEQU string_expression */ {create_changestring(fRIGHT);} break; case 128: /* string_assignment: stringfunction_or_array tEQU string_expression */ {create_doarray(dotify((yyvsp[-2].symbol),FALSE),ASSIGNSTRINGARRAY);} break; case 131: /* open_clause: tOPEN hashed_number ',' string_expression ',' string_expression */ {create_myopen(OPEN_HAS_STREAM+OPEN_HAS_MODE);} break; case 132: /* open_clause: tOPEN hashed_number ',' string_expression */ {create_myopen(OPEN_HAS_STREAM);} break; case 133: /* open_clause: tOPEN hashed_number ',' tPRINTER */ {create_myopen(OPEN_HAS_STREAM+OPEN_PRINTER);} break; case 134: /* open_clause: tOPEN string_expression tFOR tREADING tAS hashed_number */ {add_command(cSWAP);create_pushstr("r");create_myopen(OPEN_HAS_STREAM+OPEN_HAS_MODE);} break; case 135: /* open_clause: tOPEN string_expression tFOR tWRITING tAS hashed_number */ {add_command(cSWAP);create_pushstr("w");create_myopen(OPEN_HAS_STREAM+OPEN_HAS_MODE);} break; case 136: /* seek_clause: tSEEK hashed_number ',' expression */ {add_command(cSEEK);} break; case 137: /* seek_clause: tSEEK hashed_number ',' expression ',' string_expression */ {add_command(cSEEK2);} break; case 138: /* string_scalar_or_array: tSTRSYM */ {add_command_with_sym_and_diag(cPUSHSTRPTR,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 139: /* string_scalar_or_array: tSTRSYM '(' call_list ')' */ {create_doarray(dotify((yyvsp[-3].symbol),FALSE),GETSTRINGPOINTER);} break; case 140: /* string_expression: tSTRSYM */ {add_command_with_sym_and_diag(cPUSHSTRSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 142: /* string_expression: stringfunction_or_array */ {add_command_with_sym_and_diag(cSTRINGFUNCTION_OR_ARRAY,(yyvsp[0].symbol),NULL);} break; case 143: /* string_expression: tSTRING */ {if ((yyvsp[0].string)==NULL) {lyyerror(sERROR,"String not terminated");create_pushstr("");} else {create_pushstr((yyvsp[0].string));}} break; case 144: /* string_expression: string_expression '+' string_expression */ {add_command(cCONCAT);} break; case 146: /* string_function: tLEFT '(' string_expression ',' expression ')' */ {create_function(fLEFT);} break; case 147: /* string_function: tRIGHT '(' string_expression ',' expression ')' */ {create_function(fRIGHT);} break; case 148: /* string_function: tMID '(' string_expression ',' expression ',' expression ')' */ {create_function(fMID);} break; case 149: /* string_function: tMID '(' string_expression ',' expression ')' */ {create_function(fMID2);} break; case 150: /* string_function: tSTR '(' expression ')' */ {create_function(fSTR);} break; case 151: /* string_function: tSTR '(' expression ',' string_expression ')' */ {create_function(fSTR2);} break; case 152: /* string_function: tSTR '(' expression ',' string_expression ',' string_expression ')' */ {create_function(fSTR3);} break; case 153: /* string_function: tSTR '(' string_expression ')' */ {create_function(fSTR4);} break; case 154: /* string_function: tINKEY */ {create_pushdbl(-1);create_function(fINKEY);} break; case 155: /* string_function: tINKEY '(' ')' */ {create_pushdbl(-1);create_function(fINKEY);} break; case 156: /* string_function: tINKEY '(' expression ')' */ {create_function(fINKEY);} break; case 157: /* string_function: tCHR '(' expression ')' */ {create_function(fCHR);} break; case 158: /* string_function: tUPPER '(' string_expression ')' */ {create_function(fUPPER);} break; case 159: /* string_function: tLOWER '(' string_expression ')' */ {create_function(fLOWER);} break; case 160: /* string_function: tLTRIM '(' string_expression ')' */ {create_function(fLTRIM);} break; case 161: /* string_function: tRTRIM '(' string_expression ')' */ {create_function(fRTRIM);} break; case 162: /* string_function: tTRIM '(' string_expression ')' */ {create_function(fTRIM);} break; case 163: /* string_function: tSTRING2 '(' expression ',' string_expression ')' */ {create_function(fSTRING);} break; case 164: /* string_function: tCHOMP '(' string_expression ')' */ {create_function(fCHOMP);} break; case 165: /* string_function: tSYSTEM2 '(' string_expression ')' */ {create_function(fSYSTEM2);} break; case 166: /* string_function: tFRNFN_CALL2 '(' call_list ')' */ {create_function(fFRNFN_CALL2);} break; case 167: /* string_function: tFRNBF_ALLOC '(' expression ')' */ {create_function(fFRNBF_ALLOC);} break; case 168: /* string_function: tFRNBF_DUMP '(' string_expression ')' */ {create_function(fFRNBF_DUMP);} break; case 169: /* string_function: tFRNBF_DUMP '(' string_expression ',' expression ')' */ {create_function(fFRNBF_DUMP2);} break; case 170: /* string_function: tDATE */ {create_function(fDATE);} break; case 171: /* string_function: tDATE '(' ')' */ {create_function(fDATE);} break; case 172: /* string_function: tTIME */ {create_function(fTIME);} break; case 173: /* string_function: tTIME '(' ')' */ {create_function(fTIME);} break; case 174: /* string_function: tPEEK2 '(' string_expression ')' */ {create_function(fPEEK2);} break; case 175: /* string_function: tPEEK2 '(' string_expression ',' string_expression ')' */ {create_function(fPEEK3);} break; case 176: /* string_function: tTOKENALT '(' string_scalar_or_array ',' string_expression ')' */ {add_command(cTOKENALT2);} break; case 177: /* string_function: tTOKENALT '(' string_scalar_or_array ')' */ {add_command(cTOKENALT);} break; case 178: /* string_function: tSPLITALT '(' string_scalar_or_array ',' string_expression ')' */ {add_command(cSPLITALT2);} break; case 179: /* string_function: tSPLITALT '(' string_scalar_or_array ')' */ {add_command(cSPLITALT);} break; case 180: /* string_function: tGETBIT '(' coordinates to coordinates ')' */ {create_function(fGETBIT);} break; case 181: /* string_function: tGETCHAR '(' expression ',' expression to expression ',' expression ')' */ {create_function(fGETCHAR);} break; case 182: /* string_function: tHEX '(' expression ')' */ {create_function(fHEX);} break; case 183: /* string_function: tBIN '(' expression ')' */ {create_function(fBIN);} break; case 184: /* string_function: tEXECUTE2 '(' call_list ')' */ {create_execute(1);add_command(cSWAP);add_command(cPOP);} break; case 185: /* string_function: tFRNBF_GET2 '(' string_expression ',' expression ',' expression ')' */ {create_function(fFRNBF_GET_STRING);} break; case 186: /* string_function: tFRNBF_GET_BUFFER '(' string_expression ',' expression ')' */ {create_function(fFRNBF_GET_BUFFER);} break; case 187: /* string_function: tEVAL2 '(' string_expression ')' */ {create_eval(evSTRING);} break; case 188: /* number_assignment: tSYMBOL tEQU expression */ {add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[-2].symbol),FALSE),NULL);} break; case 189: /* number_assignment: function_or_array tEQU expression */ {create_doarray((yyvsp[-2].symbol),ASSIGNARRAY);} break; case 190: /* $@9: %empty */ {add_command(cORSHORT);pushlabel();} break; case 191: /* expression: expression tOR $@9 expression */ {poplabel();create_boole('|');} break; case 192: /* $@10: %empty */ {add_command(cANDSHORT);pushlabel();} break; case 193: /* expression: expression tAND $@10 expression */ {poplabel();create_boole('&');} break; case 194: /* expression: tNOT expression */ {create_boole('!');} break; case 195: /* expression: expression tEQU expression */ {create_dblrelop('=');} break; case 196: /* expression: expression tEQU2 expression */ {create_dblrelop('=');} break; case 197: /* expression: expression tNEQ expression */ {create_dblrelop('!');} break; case 198: /* expression: expression tLTN expression */ {create_dblrelop('<');} break; case 199: /* expression: expression tLEQ expression */ {create_dblrelop('{');} break; case 200: /* expression: expression tGTN expression */ {create_dblrelop('>');} break; case 201: /* expression: expression tGEQ expression */ {create_dblrelop('}');} break; case 202: /* expression: tMYEOF '(' hashed_number ')' */ {add_command(cTESTEOF);} break; case 203: /* expression: tGLOB '(' string_expression ',' string_expression ')' */ {add_command(cGLOB);} break; case 204: /* expression: number */ {create_pushdbl((yyvsp[0].fnum));} break; case 205: /* expression: tARDIM '(' arrayref ')' */ {add_command_with_sym_and_diag(cARDIM,"",NULL);} break; case 206: /* expression: tARDIM '(' string_arrayref ')' */ {add_command_with_sym_and_diag(cARDIM,"",NULL);} break; case 207: /* expression: tARSIZE '(' arrayref ',' expression ')' */ {add_command_with_sym_and_diag(cARSIZE,"",NULL);} break; case 208: /* expression: tARSIZE '(' string_arrayref ',' expression ')' */ {add_command_with_sym_and_diag(cARSIZE,"",NULL);} break; case 209: /* expression: function_or_array */ {add_command_with_sym_and_diag(cFUNCTION_OR_ARRAY,(yyvsp[0].symbol),NULL);} break; case 210: /* expression: tSYMBOL */ {add_command_with_sym_and_diag(cPUSHDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 211: /* expression: expression '+' expression */ {create_dblbin('+');} break; case 212: /* expression: expression '-' expression */ {create_dblbin('-');} break; case 213: /* expression: expression '*' expression */ {create_dblbin('*');} break; case 214: /* expression: expression '/' expression */ {create_dblbin('/');} break; case 215: /* expression: expression tPOW expression */ {create_dblbin('^');} break; case 216: /* expression: '-' expression */ {add_command(cNEGATE);} break; case 217: /* expression: string_expression tEQU string_expression */ {create_strrelop('=');} break; case 218: /* expression: string_expression tEQU2 string_expression */ {create_strrelop('=');} break; case 219: /* expression: string_expression tNEQ string_expression */ {create_strrelop('!');} break; case 220: /* expression: string_expression tLTN string_expression */ {create_strrelop('<');} break; case 221: /* expression: string_expression tLEQ string_expression */ {create_strrelop('{');} break; case 222: /* expression: string_expression tGTN string_expression */ {create_strrelop('>');} break; case 223: /* expression: string_expression tGEQ string_expression */ {create_strrelop('}');} break; case 226: /* arrayref: tSYMBOL '(' ')' */ {create_pusharrayref(dotify((yyvsp[-2].symbol),FALSE),stNUMBERARRAYREF);} break; case 227: /* string_arrayref: tSTRSYM '(' ')' */ {create_pusharrayref(dotify((yyvsp[-2].symbol),FALSE),stSTRINGARRAYREF);} break; case 229: /* function: tSIN '(' expression ')' */ {create_function(fSIN);} break; case 230: /* function: tASIN '(' expression ')' */ {create_function(fASIN);} break; case 231: /* function: tCOS '(' expression ')' */ {create_function(fCOS);} break; case 232: /* function: tACOS '(' expression ')' */ {create_function(fACOS);} break; case 233: /* function: tTAN '(' expression ')' */ {create_function(fTAN);} break; case 234: /* function: tATAN '(' expression ')' */ {create_function(fATAN);} break; case 235: /* function: tATAN '(' expression ',' expression ')' */ {create_function(fATAN2);} break; case 236: /* function: tEXP '(' expression ')' */ {create_function(fEXP);} break; case 237: /* function: tLOG '(' expression ')' */ {create_function(fLOG);} break; case 238: /* function: tLOG '(' expression ',' expression ')' */ {create_function(fLOG2);} break; case 239: /* function: tSQRT '(' expression ')' */ {create_function(fSQRT);} break; case 240: /* function: tSQR '(' expression ')' */ {create_function(fSQR);} break; case 241: /* function: tINT '(' expression ')' */ {create_function(fINT);} break; case 242: /* function: tROUND '(' expression ')' */ {create_function(fROUND);} break; case 243: /* function: tCEIL '(' expression ')' */ {create_function(fCEIL);} break; case 244: /* function: tFLOOR '(' expression ')' */ {create_function(fFLOOR);} break; case 245: /* function: tFRAC '(' expression ')' */ {create_function(fFRAC);} break; case 246: /* function: tABS '(' expression ')' */ {create_function(fABS);} break; case 247: /* function: tSIG '(' expression ')' */ {create_function(fSIG);} break; case 248: /* function: tMOD '(' expression ',' expression ')' */ {create_function(fMOD);} break; case 249: /* function: tRAN '(' expression ')' */ {create_function(fRAN);} break; case 250: /* function: tRAN '(' ')' */ {create_function(fRAN2);} break; case 251: /* function: tMIN '(' expression ',' expression ')' */ {create_function(fMIN);} break; case 252: /* function: tMAX '(' expression ',' expression ')' */ {create_function(fMAX);} break; case 253: /* function: tLEN '(' string_expression ')' */ {create_function(fLEN);} break; case 254: /* function: tVAL '(' string_expression ')' */ {create_function(fVAL);} break; case 255: /* function: tASC '(' string_expression ')' */ {create_function(fASC);} break; case 256: /* function: tDEC '(' string_expression ')' */ {create_function(fDEC);} break; case 257: /* function: tDEC '(' string_expression ',' expression ')' */ {create_function(fDEC2);} break; case 258: /* function: tINSTR '(' string_expression ',' string_expression ')' */ {if (check_compat) lyyerror(sWARNING,"instr() has changed in version 2.712"); create_function(fINSTR);} break; case 259: /* function: tINSTR '(' string_expression ',' string_expression ',' expression ')' */ {create_function(fINSTR2);} break; case 260: /* function: tRINSTR '(' string_expression ',' string_expression ')' */ {create_function(fRINSTR);} break; case 261: /* function: tRINSTR '(' string_expression ',' string_expression ',' expression ')' */ {create_function(fRINSTR2);} break; case 262: /* function: tSYSTEM '(' string_expression ')' */ {create_function(fSYSTEM);} break; case 263: /* function: tFRNFN_CALL '(' call_list ')' */ {create_function(fFRNFN_CALL);} break; case 264: /* function: tFRNFN_SIZE '(' string_expression ')' */ {create_function(fFRNFN_SIZE);} break; case 265: /* function: tFRNBF_GET '(' string_expression ',' expression ',' string_expression ')' */ {create_function(fFRNBF_GET_NUMBER);} break; case 266: /* function: tFRNBF_SIZE '(' string_expression ')' */ {create_function(fFRNBF_SIZE);} break; case 267: /* function: tPEEK '(' hashed_number ')' */ {create_function(fPEEK4);} break; case 268: /* function: tPEEK '(' string_expression ')' */ {create_function(fPEEK);} break; case 269: /* function: tMOUSEX '(' string_expression ')' */ {create_function(fMOUSEX);} break; case 270: /* function: tMOUSEX */ {create_pushstr("");create_function(fMOUSEX);} break; case 271: /* function: tMOUSEX '(' ')' */ {create_pushstr("");create_function(fMOUSEX);} break; case 272: /* function: tMOUSEY '(' string_expression ')' */ {create_function(fMOUSEY);} break; case 273: /* function: tMOUSEY */ {create_pushstr("");create_function(fMOUSEY);} break; case 274: /* function: tMOUSEY '(' ')' */ {create_pushstr("");create_function(fMOUSEY);} break; case 275: /* function: tMOUSEB '(' string_expression ')' */ {create_function(fMOUSEB);} break; case 276: /* function: tMOUSEB */ {create_pushstr("");create_function(fMOUSEB);} break; case 277: /* function: tMOUSEB '(' ')' */ {create_pushstr("");create_function(fMOUSEB);} break; case 278: /* function: tMOUSEMOD '(' string_expression ')' */ {create_function(fMOUSEMOD);} break; case 279: /* function: tMOUSEMOD */ {create_pushstr("");create_function(fMOUSEMOD);} break; case 280: /* function: tMOUSEMOD '(' ')' */ {create_pushstr("");create_function(fMOUSEMOD);} break; case 281: /* function: tAND '(' expression ',' expression ')' */ {create_function(fAND);} break; case 282: /* function: tOR '(' expression ',' expression ')' */ {create_function(fOR);} break; case 283: /* function: tBITNOT '(' expression ')' */ {create_function(fBITNOT);} break; case 284: /* function: tEOR '(' expression ',' expression ')' */ {create_function(fEOR);} break; case 285: /* function: tSHL '(' expression ',' expression ')' */ {create_function(fSHL);} break; case 286: /* function: tSHR '(' expression ',' expression ')' */ {create_function(fSHR);} break; case 287: /* function: tTELL '(' hashed_number ')' */ {create_function(fTELL);} break; case 288: /* function: tTOKEN '(' string_expression ',' string_arrayref ',' string_expression ')' */ {add_command(cTOKEN2);} break; case 289: /* function: tTOKEN '(' string_expression ',' string_arrayref ')' */ {add_command(cTOKEN);} break; case 290: /* function: tSPLIT '(' string_expression ',' string_arrayref ',' string_expression ')' */ {add_command(cSPLIT2);} break; case 291: /* function: tSPLIT '(' string_expression ',' string_arrayref ')' */ {add_command(cSPLIT);} break; case 292: /* function: tEXECUTE '(' call_list ')' */ {create_execute(0);add_command(cSWAP);add_command(cPOP);} break; case 293: /* function: tOPEN '(' tPRINTER ')' */ {create_myopen(OPEN_PRINTER);} break; case 294: /* function: tOPEN '(' string_expression ')' */ {create_myopen(0);} break; case 295: /* function: tOPEN '(' string_expression ',' string_expression ')' */ {create_myopen(OPEN_HAS_MODE);} break; case 296: /* function: tOPEN '(' hashed_number ',' tPRINTER ')' */ {create_myopen(OPEN_PRINTER+OPEN_HAS_STREAM);} break; case 297: /* function: tOPEN '(' hashed_number ',' string_expression ')' */ {create_myopen(OPEN_HAS_STREAM);} break; case 298: /* function: tOPEN '(' hashed_number ',' string_expression ',' string_expression ')' */ {create_myopen(OPEN_HAS_STREAM+OPEN_HAS_MODE);} break; case 299: /* function: tEVAL '(' string_expression ')' */ {create_eval(evNUMBER);} break; case 300: /* const: number */ {(yyval.fnum)=(yyvsp[0].fnum);} break; case 301: /* const: '+' number */ {(yyval.fnum)=(yyvsp[0].fnum);} break; case 302: /* const: '-' number */ {(yyval.fnum)=-(yyvsp[0].fnum);} break; case 303: /* number: tFNUM */ {(yyval.fnum)=(yyvsp[0].fnum);} break; case 304: /* number: tDIGITS */ {(yyval.fnum)=strtod((yyvsp[0].digits),NULL);} break; case 305: /* number: tHEXDIGITS */ {(yyval.fnum)=(double)strtoul((yyvsp[0].digits),NULL,16);} break; case 306: /* number: tBINDIGITS */ {(yyval.fnum)=(double)strtoul((yyvsp[0].digits),NULL,2);} break; case 307: /* symbol_or_lineno: tDIGITS */ {(yyval.symbol)=my_strdup(dotify((yyvsp[0].digits),FALSE));} break; case 308: /* symbol_or_lineno: tSYMBOL */ {(yyval.symbol)=my_strdup(dotify((yyvsp[0].symbol),FALSE));} break; case 309: /* dimlist: tSYMBOL '(' call_list ')' */ {create_dim(dotify((yyvsp[-3].symbol),FALSE),'D');} break; case 310: /* dimlist: dimlist ',' tSYMBOL '(' call_list ')' */ {create_dim(dotify((yyvsp[-3].symbol),FALSE),'D');} break; case 311: /* dimlist: tSTRSYM '(' call_list ')' */ {create_dim(dotify((yyvsp[-3].symbol),FALSE),'S');} break; case 312: /* dimlist: dimlist ',' tSTRSYM '(' call_list ')' */ {create_dim(dotify((yyvsp[-3].symbol),FALSE),'S');} break; case 313: /* function_or_array: tSYMBOL '(' call_list ')' */ {(yyval.symbol)=my_strdup(dotify((yyvsp[-3].symbol),FALSE));} break; case 314: /* stringfunction_or_array: tSTRSYM '(' call_list ')' */ {(yyval.symbol)=my_strdup(dotify((yyvsp[-3].symbol),FALSE));} break; case 315: /* $@11: %empty */ {add_command(cPUSHFREE);} break; case 322: /* $@12: %empty */ {missing_endsub++;missing_endsub_line=yylineno;pushlabel();report_if_missing("can not define a function in a loop or an if-statement",FALSE);if (function_type!=ftNONE) {lyyerror(sERROR,"nested functions not allowed");YYABORT;}} break; case 323: /* $@13: %empty */ {if (exported) create_subr_link((yyvsp[0].symbol)); create_label((yyvsp[0].symbol),cUSER_FUNCTION); add_command(cPUSHSYMLIST);add_command(cCLEARSYMREFS);start_symref_chain(); create_count_params();} break; case 324: /* $@14: %empty */ {create_require(stFREE);add_command(cPOP);} break; case 325: /* function_definition: export tSUB $@12 function_name $@13 '(' paramlist ')' $@14 statement_list endsub */ {add_command(cCLEARSYMREFS);end_symref_chain();add_command(cPOPSYMLIST);create_check_return_value(ftNONE,function_type);function_type=ftNONE;add_command(cRETURN_FROM_CALL);create_endfunction();poplabel();} break; case 326: /* endsub: tEOPROG */ {if (missing_endsub) {sprintf(string,"subroutine starting at line %d has seen no 'end sub' at end of program",missing_endsub_line);error_without_position(sERROR,string);} YYABORT;} break; case 327: /* endsub: tENDSUB */ {missing_endsub--;} break; case 328: /* function_name: tSYMBOL */ {function_type=ftNUMBER;current_function=my_strdup(dotify((yyvsp[0].symbol),FALSE));(yyval.symbol)=my_strdup(dotify((yyvsp[0].symbol),FALSE));} break; case 329: /* function_name: tSTRSYM */ {function_type=ftSTRING;current_function=my_strdup(dotify((yyvsp[0].symbol),FALSE));(yyval.symbol)=my_strdup(dotify((yyvsp[0].symbol),FALSE));} break; case 330: /* export: %empty */ {exported=FALSE;} break; case 331: /* export: tEXPORT */ {exported=TRUE;} break; case 332: /* export: tRUNTIME_CREATED_SUB */ {exported=FALSE;} break; case 333: /* export: tRUNTIME_CREATED_SUB tEXPORT */ {exported=TRUE;} break; case 336: /* local_item: tSYMBOL */ {create_makelocal(dotify((yyvsp[0].symbol),FALSE),syNUMBER);} break; case 337: /* local_item: tSTRSYM */ {create_makelocal(dotify((yyvsp[0].symbol),FALSE),sySTRING);} break; case 338: /* local_item: tSYMBOL '(' call_list ')' */ {create_makelocal(dotify((yyvsp[-3].symbol),FALSE),syARRAY);create_dim(dotify((yyvsp[-3].symbol),FALSE),'d');} break; case 339: /* local_item: tSTRSYM '(' call_list ')' */ {create_makelocal(dotify((yyvsp[-3].symbol),FALSE),syARRAY);create_dim(dotify((yyvsp[-3].symbol),FALSE),'s');} break; case 342: /* static_item: tSYMBOL */ {create_makestatic(dotify((yyvsp[0].symbol),TRUE),syNUMBER);} break; case 343: /* static_item: tSTRSYM */ {create_makestatic(dotify((yyvsp[0].symbol),TRUE),sySTRING);} break; case 344: /* static_item: tSYMBOL '(' call_list ')' */ {create_makestatic(dotify((yyvsp[-3].symbol),TRUE),syARRAY);create_dim(dotify((yyvsp[-3].symbol),TRUE),'D');} break; case 345: /* static_item: tSTRSYM '(' call_list ')' */ {create_makestatic(dotify((yyvsp[-3].symbol),TRUE),syARRAY);create_dim(dotify((yyvsp[-3].symbol),TRUE),'S');} break; case 349: /* paramitem: tSYMBOL */ {create_require(stNUMBER);create_makelocal(dotify((yyvsp[0].symbol),FALSE),syNUMBER);add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 350: /* paramitem: tSTRSYM */ {create_require(stSTRING);create_makelocal(dotify((yyvsp[0].symbol),FALSE),sySTRING);add_command_with_sym_and_diag(cPOPSTRSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 351: /* paramitem: tSYMBOL '(' ')' */ {create_require(stNUMBERARRAYREF);create_arraylink(dotify((yyvsp[-2].symbol),FALSE),stNUMBERARRAYREF);} break; case 352: /* paramitem: tSTRSYM '(' ')' */ {create_require(stSTRINGARRAYREF);create_arraylink(dotify((yyvsp[-2].symbol),FALSE),stSTRINGARRAYREF);} break; case 353: /* $@15: %empty */ {loop_nesting++;add_command(cBEGIN_LOOP_MARK);missing_next++;missing_next_line=yylineno;} break; case 354: /* $@16: %empty */ {pushname(dotify((yyvsp[-1].symbol),FALSE)); /* will be used by next_symbol to check equality,NULL */ add_command(cRESETSKIPONCE); add_command(cRESETSKIPONCE2); pushgoto();add_command_with_switch_state(cCONTINUE_HERE);} break; case 355: /* $@17: %empty */ { /* pushes another expression */ add_command(cSKIPONCE); pushlabel(); add_command(cSTARTFOR); add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[-6].symbol),FALSE),NULL); poplabel(); add_command_with_sym_and_diag(cPUSHDBLSYM,dotify((yyvsp[-6].symbol),FALSE),NULL); add_command(cSKIPONCE); add_command(cFORINCREMENT); add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[-6].symbol),FALSE),NULL); add_command_with_sym_and_diag(cPUSHDBLSYM,dotify((yyvsp[-6].symbol),FALSE),NULL); add_command(cFORCHECK); add_command(cDECIDE); pushlabel();} break; case 356: /* $@18: %empty */ { swap();popgoto();poplabel();} break; case 357: /* for_loop: tFOR $@15 tSYMBOL tEQU $@16 expression tTO expression step_part $@17 statement_list $@18 next next_symbol */ {add_command(cBREAK_HERE);add_command(cEND_LOOP_MARK);loop_nesting--;} break; case 358: /* next: tEOPROG */ {if (missing_next) {sprintf(string,"for-loop starting at line %d has seen no 'next' at end of program",missing_next_line);error_without_position(sERROR,string);} YYABORT;} break; case 359: /* next: tNEXT */ {missing_next--;} break; case 360: /* next: tENDIF */ {report_conflicting_close("a closing next is expected before endif",'e');} break; case 361: /* next: tWEND */ {report_conflicting_close("a closing next is expected before wend",'w');} break; case 362: /* next: tUNTIL */ {report_conflicting_close("a closing next is expected before until",'l');} break; case 363: /* next: tLOOP */ {report_conflicting_close("a closing next is expected before loop",'l');} break; case 364: /* step_part: %empty */ {create_pushdbl(1);} break; case 366: /* next_symbol: %empty */ {pop(stSTRING);} break; case 367: /* next_symbol: tSYMBOL */ {if (strcmp(pop(stSTRING)->pointer,dotify((yyvsp[0].symbol),FALSE))) {lyyerror(sERROR,"'for' and 'next' do not match"); YYABORT;} } break; case 368: /* $@19: %empty */ {push_switch_id();add_command(cBEGIN_SWITCH_MARK);} break; case 369: /* switch_number_or_string: tSWITCH $@19 number_or_string sep_list case_list default tSEND */ {add_command(cBREAK_HERE);add_command(cPOP);add_command(cEND_SWITCH_MARK);pop_switch_id();} break; case 375: /* $@20: %empty */ {add_command(cSWITCH_COMPARE);add_command(cDECIDE);add_command(cNEXT_CASE);} break; case 376: /* case_list: case_list tCASE number_or_string $@20 statement_list */ {add_command(cNEXT_CASE_HERE);} break; case 378: /* $@21: %empty */ {add_command(cNEXT_CASE_HERE);} break; case 380: /* $@22: %empty */ {loop_nesting++;add_command(cBEGIN_LOOP_MARK);add_command_with_switch_state(cCONTINUE_HERE);missing_loop++;missing_loop_line=yylineno;pushgoto();} break; case 382: /* loop: tEOPROG */ {if (missing_loop) {sprintf(string,"do-loop starting at at line %d has seen no 'loop' at end of program",missing_loop_line);error_without_position(sERROR,string);} YYABORT;} break; case 383: /* loop: tLOOP */ {missing_loop--;popgoto();add_command(cBREAK_HERE);add_command(cEND_LOOP_MARK);loop_nesting--;} break; case 384: /* loop: tENDIF */ {report_conflicting_close("a closing loop is expected before endif",'e');} break; case 385: /* loop: tWEND */ {report_conflicting_close("a closing loop is expected before wend",'w');} break; case 386: /* loop: tUNTIL */ {report_conflicting_close("a closing loop is expected before until",'l');} break; case 387: /* loop: tNEXT */ {report_conflicting_close("a closing loop is expected before next",'n');} break; case 388: /* $@23: %empty */ {loop_nesting++;add_command(cBEGIN_LOOP_MARK);add_command_with_switch_state(cCONTINUE_HERE);missing_wend++;missing_wend_line=yylineno;pushgoto();} break; case 389: /* $@24: %empty */ {add_command(cDECIDE); pushlabel();} break; case 391: /* wend: tEOPROG */ {if (missing_wend) {sprintf(string,"while-loop starting at line %d has seen no 'wend' at end of program",missing_wend_line);error_without_position(sERROR,string);} YYABORT;} break; case 392: /* wend: tWEND */ {missing_wend--;swap();popgoto();poplabel();add_command(cBREAK_HERE);add_command(cEND_LOOP_MARK);loop_nesting--;} break; case 393: /* $@25: %empty */ {loop_nesting++;add_command(cBEGIN_LOOP_MARK);add_command_with_switch_state(cCONTINUE_HERE);missing_until++;missing_until_line=yylineno;pushgoto();} break; case 395: /* until: tEOPROG */ {if (missing_until) {sprintf(string,"repeat-loop starting at line %d has seen no 'until' at end of program",missing_until_line);error_without_position(sERROR,string);} YYABORT;} break; case 396: /* until: tUNTIL expression */ {missing_until--;add_command(cDECIDE);popgoto();add_command(cBREAK_HERE);add_command(cEND_LOOP_MARK);loop_nesting--;} break; case 397: /* until: tENDIF */ {report_conflicting_close("a closing until is expected before endif",'e');} break; case 398: /* until: tWEND */ {report_conflicting_close("a closing until is expected before wend",'w');} break; case 399: /* until: tLOOP */ {report_conflicting_close("a closing until is expected before loop",'l');} break; case 400: /* until: tNEXT */ {report_conflicting_close("a closing until is expected before next",'n');} break; case 401: /* $@26: %empty */ {add_command(cDECIDE);storelabel();pushlabel();} break; case 402: /* $@27: %empty */ {missing_endif++;missing_endif_line=yylineno;} break; case 403: /* $@28: %empty */ {swap();matchgoto();swap();poplabel();} break; case 404: /* $@29: %empty */ {poplabel();} break; case 406: /* endif: tEOPROG */ {if (missing_endif) {sprintf(string,"if-clause starting at line %d has seen no 'endif' (or 'fi') at end of program",missing_endif_line);error_without_position(sERROR,string);} YYABORT;} break; case 407: /* endif: tENDIF */ {missing_endif--;} break; case 408: /* endif: tWEND */ {report_conflicting_close("a closing endif is expected before wend",'w');} break; case 409: /* endif: tUNTIL */ {report_conflicting_close("a closing endif is expected before until",'l');} break; case 410: /* endif: tLOOP */ {report_conflicting_close("a closing endif is expected before loop",'l');} break; case 411: /* endif: tNEXT */ {report_conflicting_close("a closing endif is expected before next",'n');} break; case 412: /* $@30: %empty */ {in_short_if++;add_command(cDECIDE);pushlabel();} break; case 414: /* end_of_if: tENDIF */ {error(sERROR,"short if-statement (i.e. without 'then') does not allow 'endif'");} break; case 415: /* end_of_if: tIMPLICITENDIF */ {poplabel();} break; case 419: /* $@31: %empty */ {add_command(cDECIDE);pushlabel();} break; case 420: /* $@32: %empty */ {swap();matchgoto();swap();poplabel();} break; case 425: /* $@33: %empty */ {add_command(cCHKPROMPT);} break; case 427: /* input: tSYMBOL */ {create_myread('d',tileol);add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 428: /* input: tSYMBOL '(' call_list ')' */ {create_myread('d',tileol);create_doarray(dotify((yyvsp[-3].symbol),FALSE),ASSIGNARRAY);} break; case 429: /* input: tSTRSYM */ {create_myread('s',tileol);add_command_with_sym_and_diag(cPOPSTRSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 430: /* input: tSTRSYM '(' call_list ')' */ {create_myread('s',tileol);create_doarray(dotify((yyvsp[-3].symbol),FALSE),ASSIGNSTRINGARRAY);} break; case 433: /* readitem: tSYMBOL */ {create_readdata('d');add_command_with_sym_and_diag(cPOPDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 434: /* readitem: tSYMBOL '(' call_list ')' */ {create_readdata('d');create_doarray(dotify((yyvsp[-3].symbol),FALSE),ASSIGNARRAY);} break; case 435: /* readitem: tSTRSYM */ {create_readdata('s');add_command_with_sym_and_diag(cPOPSTRSYM,dotify((yyvsp[0].symbol),FALSE),NULL);} break; case 436: /* readitem: tSTRSYM '(' call_list ')' */ {create_readdata('s');create_doarray(dotify((yyvsp[-3].symbol),FALSE),ASSIGNSTRINGARRAY);} break; case 437: /* datalist: tSTRING */ {create_strdata((yyvsp[0].string));} break; case 438: /* datalist: const */ {create_dbldata((yyvsp[0].fnum));} break; case 439: /* datalist: datalist ',' tSTRING */ {create_strdata((yyvsp[0].string));} break; case 440: /* datalist: datalist ',' const */ {create_dbldata((yyvsp[0].fnum));} break; case 444: /* printlist: string_expression */ {create_print('s');} break; case 445: /* printlist: printlist ',' string_expression */ {create_print('s');} break; case 446: /* using: %empty */ {create_print('d');} break; case 447: /* using: tUSING string_expression */ {create_print('u');} break; case 448: /* using: tUSING '(' string_expression ',' string_expression ')' */ {create_print('U');} break; case 449: /* $@34: %empty */ {add_command_with_sym_and_diag(cPUSHDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);create_pps(cPUSHSTREAM,1);} break; case 450: /* inputbody: '#' tSYMBOL $@34 inputlist */ {create_pps(cPOPSTREAM,0);} break; case 451: /* $@35: %empty */ {create_pushdbl(atoi((yyvsp[0].digits)));create_pps(cPUSHSTREAM,1);} break; case 452: /* inputbody: '#' tDIGITS $@35 inputlist */ {create_pps(cPOPSTREAM,0);} break; case 453: /* $@36: %empty */ {create_pps(cPUSHSTREAM,1);} break; case 454: /* inputbody: '#' '(' expression ')' $@36 inputlist */ {create_pps(cPOPSTREAM,0);} break; case 455: /* $@37: %empty */ {add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 456: /* inputbody: tAT '(' expression ',' expression ')' $@37 prompt inputlist */ {create_pps(cPOPSTREAM,0);} break; case 457: /* $@38: %empty */ {add_command(cMOVE);create_colour(1);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 458: /* inputbody: tREVERSE tAT '(' expression ',' expression ')' $@38 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 459: /* $@39: %empty */ {add_command(cMOVE);create_colour(2);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 460: /* inputbody: tCOLOUR '(' string_expression ')' tAT '(' expression ',' expression ')' $@39 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 461: /* $@40: %empty */ {add_command(cMOVE);create_colour(3);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 462: /* inputbody: tCOLOUR '(' string_expression ',' string_expression ')' tAT '(' expression ',' expression ')' $@40 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 463: /* $@41: %empty */ {create_colour(2);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 464: /* inputbody: tCOLOUR '(' string_expression ')' $@41 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 465: /* $@42: %empty */ {create_colour(3);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 466: /* inputbody: tCOLOUR '(' string_expression ',' string_expression ')' $@42 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 467: /* $@43: %empty */ {create_colour(1);add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 468: /* inputbody: tAT '(' expression ',' expression ')' tREVERSE $@43 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 469: /* $@44: %empty */ {create_colour(2);add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 470: /* inputbody: tAT '(' expression ',' expression ')' tCOLOUR '(' string_expression ')' $@44 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 471: /* $@45: %empty */ {create_colour(3);add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 472: /* inputbody: tAT '(' expression ',' expression ')' tCOLOUR '(' string_expression ',' string_expression ')' $@45 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 473: /* $@46: %empty */ {create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,1);} break; case 474: /* inputbody: $@46 prompt inputlist */ {create_colour(0);create_pps(cPOPSTREAM,0);} break; case 475: /* prompt: %empty */ {create_pushstr("?");create_print('s');} break; case 476: /* prompt: tSTRING */ {create_pushstr((yyvsp[0].string));create_print('s');} break; case 477: /* printintro: %empty */ {create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 478: /* printintro: '#' tSYMBOL */ {add_command_with_sym_and_diag(cPUSHDBLSYM,dotify((yyvsp[0].symbol),FALSE),NULL);create_pps(cPUSHSTREAM,0);} break; case 479: /* printintro: '#' tDIGITS */ {create_pushdbl(atoi((yyvsp[0].digits)));create_pps(cPUSHSTREAM,0);} break; case 480: /* printintro: '#' '(' expression ')' */ {create_pps(cPUSHSTREAM,0);} break; case 481: /* printintro: tREVERSE */ {create_colour(1);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 482: /* printintro: tCOLOUR '(' string_expression ')' */ {create_colour(2);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 483: /* printintro: tCOLOUR '(' string_expression ',' string_expression ')' */ {create_colour(3);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 484: /* printintro: tAT '(' expression ',' expression ')' */ {add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 485: /* printintro: tREVERSE tAT '(' expression ',' expression ')' */ {add_command(cMOVE);create_colour(1);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 486: /* printintro: tCOLOUR '(' string_expression ')' tAT '(' expression ',' expression ')' */ {add_command(cMOVE);create_colour(2);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 487: /* printintro: tCOLOUR '(' string_expression ',' string_expression ')' tAT '(' expression ',' expression ')' */ {add_command(cMOVE);create_colour(3);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 488: /* printintro: tAT '(' expression ',' expression ')' tREVERSE */ {create_colour(1);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);add_command(cMOVE);} break; case 489: /* printintro: tAT '(' expression ',' expression ')' tCOLOUR '(' string_expression ')' */ {create_colour(2);add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 490: /* printintro: tAT '(' expression ',' expression ')' tCOLOUR '(' string_expression ',' string_expression ')' */ {create_colour(3);add_command(cMOVE);create_pushdbl(STDIO_STREAM);create_pps(cPUSHSTREAM,0);} break; case 493: /* goto_list: symbol_or_lineno */ {create_goto((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));add_command(cFINDNOP);} break; case 494: /* goto_list: goto_list ',' symbol_or_lineno */ {create_goto((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));add_command(cFINDNOP);} break; case 495: /* gosub_list: symbol_or_lineno */ {create_gosub((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));add_command(cFINDNOP);} break; case 496: /* gosub_list: gosub_list ',' symbol_or_lineno */ {create_gosub((function_type!=ftNONE)?dotify((yyvsp[0].symbol),TRUE):(yyvsp[0].symbol));add_command(cFINDNOP);} break; default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++yyvsp = yyval; *++yylsp = yyloc; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (YY_("syntax error")); } yyerror_range[1] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END yyerror_range[2] = yylloc; ++yylsp; YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturnlab; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturnlab; /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } yabasic-2.91.4/bison.h0000777000175000017500000003021315055056416010203 /* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_YY_BISON_H_INCLUDED # define YY_YY_BISON_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ tFNUM = 258, /* tFNUM */ tSYMBOL = 259, /* tSYMBOL */ tSTRSYM = 260, /* tSTRSYM */ tDOCU = 261, /* tDOCU */ tDIGITS = 262, /* tDIGITS */ tHEXDIGITS = 263, /* tHEXDIGITS */ tBINDIGITS = 264, /* tBINDIGITS */ tSTRING = 265, /* tSTRING */ tFOR = 266, /* tFOR */ tTO = 267, /* tTO */ tSTEP = 268, /* tSTEP */ tNEXT = 269, /* tNEXT */ tWHILE = 270, /* tWHILE */ tWEND = 271, /* tWEND */ tREPEAT = 272, /* tREPEAT */ tUNTIL = 273, /* tUNTIL */ tIMPORT = 274, /* tIMPORT */ tGOTO = 275, /* tGOTO */ tGOSUB = 276, /* tGOSUB */ tLABEL = 277, /* tLABEL */ tON = 278, /* tON */ tSUB = 279, /* tSUB */ tENDSUB = 280, /* tENDSUB */ tLOCAL = 281, /* tLOCAL */ tSTATIC = 282, /* tSTATIC */ tEXPORT = 283, /* tEXPORT */ tERROR = 284, /* tERROR */ tEXECUTE = 285, /* tEXECUTE */ tEXECUTE2 = 286, /* tEXECUTE2 */ tCOMPILE = 287, /* tCOMPILE */ tRUNTIME_CREATED_SUB = 288, /* tRUNTIME_CREATED_SUB */ tINTERRUPT = 289, /* tINTERRUPT */ tBREAK = 290, /* tBREAK */ tCONTINUE = 291, /* tCONTINUE */ tSWITCH = 292, /* tSWITCH */ tSEND = 293, /* tSEND */ tCASE = 294, /* tCASE */ tDEFAULT = 295, /* tDEFAULT */ tLOOP = 296, /* tLOOP */ tDO = 297, /* tDO */ tSEP = 298, /* tSEP */ tEOPROG = 299, /* tEOPROG */ tIF = 300, /* tIF */ tTHEN = 301, /* tTHEN */ tELSE = 302, /* tELSE */ tELSIF = 303, /* tELSIF */ tENDIF = 304, /* tENDIF */ tIMPLICITENDIF = 305, /* tIMPLICITENDIF */ tUSING = 306, /* tUSING */ tPRINT = 307, /* tPRINT */ tINPUT = 308, /* tINPUT */ tRETURN = 309, /* tRETURN */ tDIM = 310, /* tDIM */ tEND = 311, /* tEND */ tEXIT = 312, /* tEXIT */ tAT = 313, /* tAT */ tSCREEN = 314, /* tSCREEN */ tREVERSE = 315, /* tREVERSE */ tCOLOUR = 316, /* tCOLOUR */ tBACKCOLOUR = 317, /* tBACKCOLOUR */ tAND = 318, /* tAND */ tOR = 319, /* tOR */ tNOT = 320, /* tNOT */ tBITNOT = 321, /* tBITNOT */ tEOR = 322, /* tEOR */ tSHL = 323, /* tSHL */ tSHR = 324, /* tSHR */ tNEQ = 325, /* tNEQ */ tLEQ = 326, /* tLEQ */ tGEQ = 327, /* tGEQ */ tLTN = 328, /* tLTN */ tGTN = 329, /* tGTN */ tEQU = 330, /* tEQU */ tEQU2 = 331, /* tEQU2 */ tPOW = 332, /* tPOW */ tREAD = 333, /* tREAD */ tDATA = 334, /* tDATA */ tRESTORE = 335, /* tRESTORE */ tOPEN = 336, /* tOPEN */ tCLOSE = 337, /* tCLOSE */ tSEEK = 338, /* tSEEK */ tTELL = 339, /* tTELL */ tAS = 340, /* tAS */ tREADING = 341, /* tREADING */ tWRITING = 342, /* tWRITING */ tORIGIN = 343, /* tORIGIN */ tWINDOW = 344, /* tWINDOW */ tDOT = 345, /* tDOT */ tLINE = 346, /* tLINE */ tCIRCLE = 347, /* tCIRCLE */ tTRIANGLE = 348, /* tTRIANGLE */ tTEXT = 349, /* tTEXT */ tCLEAR = 350, /* tCLEAR */ tFILL = 351, /* tFILL */ tPRINTER = 352, /* tPRINTER */ tWAIT = 353, /* tWAIT */ tBELL = 354, /* tBELL */ tLET = 355, /* tLET */ tARDIM = 356, /* tARDIM */ tARSIZE = 357, /* tARSIZE */ tBIND = 358, /* tBIND */ tRECT = 359, /* tRECT */ tGETBIT = 360, /* tGETBIT */ tPUTBIT = 361, /* tPUTBIT */ tGETCHAR = 362, /* tGETCHAR */ tPUTCHAR = 363, /* tPUTCHAR */ tNEW = 364, /* tNEW */ tCURVE = 365, /* tCURVE */ tSIN = 366, /* tSIN */ tASIN = 367, /* tASIN */ tCOS = 368, /* tCOS */ tACOS = 369, /* tACOS */ tTAN = 370, /* tTAN */ tATAN = 371, /* tATAN */ tEXP = 372, /* tEXP */ tLOG = 373, /* tLOG */ tSQRT = 374, /* tSQRT */ tSQR = 375, /* tSQR */ tMYEOF = 376, /* tMYEOF */ tABS = 377, /* tABS */ tSIG = 378, /* tSIG */ tINT = 379, /* tINT */ tCEIL = 380, /* tCEIL */ tFLOOR = 381, /* tFLOOR */ tFRAC = 382, /* tFRAC */ tROUND = 383, /* tROUND */ tMOD = 384, /* tMOD */ tRAN = 385, /* tRAN */ tVAL = 386, /* tVAL */ tLEFT = 387, /* tLEFT */ tRIGHT = 388, /* tRIGHT */ tMID = 389, /* tMID */ tLEN = 390, /* tLEN */ tMIN = 391, /* tMIN */ tMAX = 392, /* tMAX */ tSTR = 393, /* tSTR */ tINKEY = 394, /* tINKEY */ tCHR = 395, /* tCHR */ tASC = 396, /* tASC */ tHEX = 397, /* tHEX */ tDEC = 398, /* tDEC */ tBIN = 399, /* tBIN */ tUPPER = 400, /* tUPPER */ tLOWER = 401, /* tLOWER */ tMOUSEX = 402, /* tMOUSEX */ tMOUSEY = 403, /* tMOUSEY */ tMOUSEB = 404, /* tMOUSEB */ tMOUSEMOD = 405, /* tMOUSEMOD */ tTRIM = 406, /* tTRIM */ tLTRIM = 407, /* tLTRIM */ tRTRIM = 408, /* tRTRIM */ tSTRING2 = 409, /* tSTRING2 */ tINSTR = 410, /* tINSTR */ tRINSTR = 411, /* tRINSTR */ tCHOMP = 412, /* tCHOMP */ tSYSTEM = 413, /* tSYSTEM */ tSYSTEM2 = 414, /* tSYSTEM2 */ tPEEK = 415, /* tPEEK */ tPEEK2 = 416, /* tPEEK2 */ tPOKE = 417, /* tPOKE */ tFRNFN_CALL = 418, /* tFRNFN_CALL */ tFRNFN_CALL2 = 419, /* tFRNFN_CALL2 */ tFRNFN_SIZE = 420, /* tFRNFN_SIZE */ tFRNBF_ALLOC = 421, /* tFRNBF_ALLOC */ tFRNBF_FREE = 422, /* tFRNBF_FREE */ tFRNBF_SIZE = 423, /* tFRNBF_SIZE */ tFRNBF_DUMP = 424, /* tFRNBF_DUMP */ tFRNBF_SET = 425, /* tFRNBF_SET */ tFRNBF_GET = 426, /* tFRNBF_GET */ tFRNBF_GET2 = 427, /* tFRNBF_GET2 */ tFRNBF_GET_BUFFER = 428, /* tFRNBF_GET_BUFFER */ tFRNBF_SET_BUFFER = 429, /* tFRNBF_SET_BUFFER */ tDATE = 430, /* tDATE */ tTIME = 431, /* tTIME */ tTOKEN = 432, /* tTOKEN */ tTOKENALT = 433, /* tTOKENALT */ tSPLIT = 434, /* tSPLIT */ tSPLITALT = 435, /* tSPLITALT */ tGLOB = 436, /* tGLOB */ tSTART_PROGRAM = 437, /* tSTART_PROGRAM */ tSTART_EXPRESSION = 438, /* tSTART_EXPRESSION */ tSTART_STRING_EXPRESSION = 439, /* tSTART_STRING_EXPRESSION */ tSTART_ASSIGNMENT = 440, /* tSTART_ASSIGNMENT */ tSTART_FUNCTION_DEFINITION = 441, /* tSTART_FUNCTION_DEFINITION */ tEVAL = 442, /* tEVAL */ tEVAL2 = 443, /* tEVAL2 */ UMINUS = 444 /* UMINUS */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { double fnum; /* double number */ int inum; /* integer number */ int token; /* token of command */ int nnl; /* number of newlines */ char *string; /* quoted string */ char *symbol; /* general symbol */ char *digits; /* string of digits */ char *docu; /* embedded documentation */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED typedef struct YYLTYPE YYLTYPE; struct YYLTYPE { int first_line; int first_column; int last_line; int last_column; }; # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; extern YYLTYPE yylloc; int yyparse (void); #endif /* !YY_YY_BISON_H_INCLUDED */ yabasic-2.91.4/ChangeLog0000777000175000017500000003147715055056415010506 Version 2.91.4 (August 31, 2025) - Fixed compile-warnings for missing prototypes - Some minor updates in toolchain Version 2.91.3 (June 14, 2025) - Fixed a bug with 'print reverse' under windows. - Documentation Version 2.91.2 (March 23, 2025) - New peeks 'displayheight' and 'displaywidth' to get the resolution of your monitor. - Fix for option '--docu' Version 2.91.1 (January 24, 2025) - New pokes 'console_foreground_color' and 'console_background_color' to set the default fore- and background color for the console. - The input-statement now supports the clauses at() and color(). Version 2.91.0 (January 7, 2025) - New poke 'console_foreground_intensity' to change (once perrun) the intensity of colored text printed with yabasic. - New function string$ to multiply a string. Version 2.90.5 (November 11, 2024) - Fixed a bug related with 'inkey$'. - For Windows: Needed to switch to a new version of Visual Studio. unfortunately, this breaks compatibility with Windows XP; however older versions of yabasic are still provided for download. Version 2.90.4 (September 17, 2023) - Fixed a bug related with 'print using' under windows. Thanx to Paul Shutler for reporting this ! Version 2.90.3 (February 26, 2023) - Introductory sections about subroutines and libraries - Updated the docu from docbook 4.5 to 5 Version 2.90.2 (January 6, 2022) - Fixed precision error for print using under windows - Better error-reporting for an edge case of short-if - Allow '==' to check for equality and '!=' for inequality ('=' and '<>' still work) Version 2.90.1 (July 11, 2021) - Repaired the docu (especially yabasic.htm) - Removed references to the old documentation (still available on github) Version 2.90.0 (July 10, 2021) - Fixed an error with local variables - Moved to a new building-environment (see github and there README.org for details) Version 2.89.1 (January 30, 2021) - Fixes for documentation Version 2.89.0 (December 29, 2020) - Fixed for Problem with system-command after clear screen on MacOS - Added functions eval and eval$ Version 2.87.1 (November 07, 2020) - Fixed for libffi on 32 bit systems - Updated included header files (windows) of ffi from libffi 3.3 Version 2.87.0 (August 12, 2020) - Fixed an edge-case in for-loops - Allow eof(0) and peek(0) to refer to standard input Version 2.86.9 (June 6, 2020) - Fix formatting of larger numbers with '####' et.al. Version 2.86.8 (May 9, 2020) - Bringing pkg.m4 with us to ease build process Version 2.86.7 (April 4, 2020) - Using pkg-config (if available) to locate libffi Version 2.86.6 (March 8, 2020) - Advancing version for technical reasons Version 2.86.5 (March 8, 2020) - Fix double backslash in string before quote Version 2.86.4 (January 1, 2020) - Fix for do-loop / continue Version 2.86.3 (December 15, 2019) - Fix for heap overflow found with honggfuzz Version 2.86.2 (December 12, 2019) - Another fix for heap-buffer-offerflow found with address sanitizer Version 2.86.1 (December 8, 2019) - Fix for heap-buffer-offerflow Version 2.86.0 (November 28, 2019) - Added new functions bitnot - Fixes for bit-arithmetic (signes/unsigned) Version 2.85.0 (November 16, 2019) - Added new functions shl, shr and round - Introduced binary literals preceeded by 0b - Fixes for hex literals - The error-command no longer adds a line number Version 2.84.3 (November 3, 2019) - Better debugging for library path - Clean builds for Windows setup-program Version 2.84.2 (October 6, 2019) - Fixed some potential stackoverflows - Removed empty dir related with nano - Tests with tmux only within the Rakefile Version 2.84.1 (July 20, 2019) - Make unload_library after call the default for foreign_functions - Fixes to docu - Requiring libffi for build (unless specified other by configure-option) - explicit error no longer unwinds call-stack Version 2.84.0 (July 12, 2019) - New command foreign_buffer_set_buffer Version 2.83.3 (June 30, 2019) - Documentation Version 2.83.2 (June 30, 2019) - Allow specifying null-pointer for foreign functions Version 2.83.1 (June 26, 2019) - Fix for line-numbers in errors after import - Updating the manual Version 2.83.0 (April 29, 2019) - Unix: Added a syntax-file for the nano-editor; contributed by Stephan Muesse - Made parentheses around condition in while and until optional - Better error messages on misaligned control structures - New family of functions and commands foreign_* to invoke functions from external c-libraries - Fixes for line-numbers in error messages - Revised and updated the documentation Version 2.82.1 (March 11, 2019) - Allowing comments after import statement - Fixes regarding error messages Version 2.82.0 (February 17, 2019) - Advanced version of autoconf and other tools - Fix in tests - Fixed nested import of libraries - Libraries can now be found in the directory of the main file too - Error messages try to show and mark the offending part of the code - Hexadecimal numerical literals are supported, e.g. print 0xff Version 2.81.4 (January 27, 2019) - Fixed error with inkey$ and clear screen - Fixed fatal error with inkey$ and upper case letters Version 2.81.3 (January 13, 2019) - Fixed a compile-problem on macos - Corrected a rendering problem on www.yabasic.de, which had cut off the bottom-lines of many pages Version 2.81.2 (January 2, 2019) - Fixed a problem under netbsd, which prevented yabasic from finding its own executable - Fix on macos for curses-initialization e.g. during "clear screen" - Fix that allows libraries to start with a comment introduced by a hash or a single quote - Made the prior "Guide into the guts" available again as "Some remarks on changing Yabasic"; see www.yabasic.de - Document options for unix and windows in the same chapter Version 2.81.1 (November 1, 2018) - Fix: Allow yabasic to run from within a script Version 2.81.0 (October 27, 2018) - New function chomp$ - Added new peek "interpreter_path" - Fixed a sporadic issue with bound programs Version 2.80.0 (September 8, 2018) - Added functions floor() and ceil() - Checking for function clock_gettime during configure Version 2.79.2 (May 13, 2018) - No changes over 2.79.1 - Advanced patchlevel to get in line with tagging again Version 2.79.1 (May 1, 2018) - Fixed error related with yydebug Version 2.79.0 (April 21, 2018) - Introduced new peeks "secondsrunning" and "millisrunning" - Bugfixes regarding the switch statement Version 2.78.5 (April 3, 2018) - Within a bound yabasic-programs the name is correctly set (as returned by peeking "program_name") - Introduced new string-peeks "program_name" and "program_file_name" - Bugfixes regarding bound programs and libraries Version 2.78.4 (March 21, 2018) - Fixed a problem with bound yabasic-programs, that include more than three libraries - Introduced new peek "secondsrunning" Version 2.78.3 (January 21, 2018) - Fixed an up to 4-times performance penalty, that has been introduced in a previous version - Brought back "Edit" to the windows context menu Version 2.78.2 (August 27, 2017) - The ran()-function is now guaranteed to return 2**30 different values Version 2.78.1 (August 13, 2017) - No more dump when using color without window open - Processing of yabasic.xml finds hellip-entity Version 2.78.0 (January 21, 2017) - Allowed for numeric argument after break - Fixed format of manpage - Reworked the switch-statement, added tests Version 2.77.3 (December 29, 2016) - Fixed insecure usage of strcpy - Better logging for windows installer - Spelling corrections Version 2.77.2 (December 17, 2016) - Fixes for coloured text under windows - msvcr140.dll is no longer required under Windows - Several spelling corrections - Updated and fixed man-page under linux Version 2.77.1 (September 7, 2016) - New poke "random_seed" to initialize random number generator - Bugfixes and additions to documentation - Yabasic is now covered by the MIT License - Switched to semantic Versioning (e.g. 2.77.1 instead of 2.771) - Adopted a development workflow based on git and github Version 2.764 (January 22, 2014) - Added support for later versions of ncurses and 64 bit Systems - Avoided forks for inkey$ Version 2.763 (September 19, 2005) - Tiny fix in the documentation: Sections now have their own toc again. Version 2.762 (September 16, 2005) - Swapped the precedence of unary minus and exponentiation to follow the mainstream of programming languages. Suggested by Mike Hoffman. - Fixed a bug with drawing the outline of a triangle. - Lots bugs and typos fixed in the docu. Thanx to A. Costa ! - rinstr() is okay again. - system$() may not dump any longer, if an external command returns no output. - Some improvements for compiling on FreeBSD. - Made the text-command working again. - Maybe yabasic does not leak resources under Windows 95 any longer. - Some fixes related with the console window under Windows - Added a list of reserved words to the documentation. - Special thanks to Derek and Mike Huffmann ! Version 2.76 (April 25, 2005) - Some major improvements for grafics - Full color support ! - Different fonts for the text-command - The new command triangle Version 2.75 (May 19, 2004) - Yabasic finally has an Icon under Windows - The str$()-function, may now format numbers like 123,456.56 (or 123.456,56 for german conventions) - Changed the system()-function under Windows to use the right command-processor - Added a list of command, grouped by topics to the documentation - Yellow is no longer brown under windows - Removed a security problem related with printing under Unix - Programs, that import libraries can now be bound, including all the imported libraries Version 2.740 (January 18, 2003) - Implemented the bind-feature - More verbose messages on failing open-calls Version 2.730 (August 19, 2003) - Complete rewrite of the documentation - Updated my system, which introduced new versions of the toolchain (gcc, autoconf, ...) - No changes in yabasic itself Version 2.720 - Added two argument version of log - Changed copyright notice Version 2.717 - Bugfix by Tom Ellestad: Better Error- checking for import-statement Version 2.716 - Bugfix: fixed 'open "foo" for reading as 1' Version 2.715 - Bugfix: continue is no longer disturbed by switch statements - The special option '--' stops option processing Version 2.714 - Bigfix: >> if (not open("bad","r")) error "!" << now works as designed Version 2.713 - Fixed a memory leak associated with arrays-refs - return from within a switch statement is now possible Version 2.712 - The new Option '-check' can be used to check for compatibility with previous versions of yabasic - The instr(a$,b$)-function now returns 0, if b$ is the empty string Version 2.710 - Improved the short if-statement to be more intuitive - Added switch-case statement - Better loop-control: break and continue Version 2.70 - Allowd hex-escapes in string constants (e.g. "\xa"). - Better warnings for forgotten endif, endsub or next. - Allowed for dumping of stack of subroutine calls. - Various bugfixes related with: print using,token$() and with printing to mixed streams Version 2.690 - implemented logical shortcuts, i.e. conditions within if or while statements are only evaluated as far as needed. - New form of the open statement: open "foo" for reading as #1 - New form of the open function: open(a,"foo") intended for use in if-statements: if (not open(a,"foo")) print "Shit !" - The same time an old variant of open within if has gone: if (not open a,"foo") print "Shit !" is no longer valid. - You may now write: print #a "Hello" - Finally: there is no distinction between expressions and conditions any more, i.e. wihin the condition of an if-statement you may now use arbitrary expressions; even something like this: if (cos(x)) print "Strange" - Fixed a bug with printing under Windows: The screen now scrolls up if the cursor has reached the bottom Version 2.681 - Finished the work started with 2.680; yabasic can now parse its own demo again correctly. Version 2.680 - Essentially removed the distinction between expressions and conditions, i.e. you may write things like this: okay=(1<10) : if (okay) print "Hallo" Included the man page with the distribution. Thanx to Dejan Lekic ! Version 2.671 - Bugfix, yabasic will now build under hpux. Version 2.670 - Changed the scheme of version numbers: 2.67 Release 0 is now 2.670 - Unix only: Used automake to generate Makefile.in. Therefore you now have all the standard GNU make targets: make check, make install, make uninstall. yabasic-2.91.4/compile0000777000175000017500000001635014735711653010306 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yabasic-2.91.4/config.guess0000777000175000017500000012367214735711653011256 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . 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 1992-2015 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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # 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 tuples: *-*-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 ;; sh5el) machine=sh5le-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 -q __ELF__ 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 ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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 powerpc-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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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 -q __LP64__ 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku 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 ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: yabasic-2.91.4/config.h.in0000777000175000017500000000645315055055404010750 /* config.h.in. Generated from configure.ac by autoheader. */ /* build-time, that will be displayed in banner */ #undef BUILD_TIME /* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have 'alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if works. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FFI_H /* Define to 1 if you have the 'getnstr' function. */ #undef HAVE_GETNSTR /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_PRCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the 'strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* architecture of build machine */ #undef UNIX_ARCHITECTURE /* libffi and dlopen available */ #undef USE_DL_FFI /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define as 'unsigned int' if doesn't define. */ #undef size_t yabasic-2.91.4/config.sub0000777000175000017500000010623214735711653010712 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # 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 3 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, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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 1992-2015 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; 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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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 ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; 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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -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* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -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* | -toppers* | -drops* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; 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 ;; -cnk*|-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: yabasic-2.91.4/configure0000777000175000017500000207065515055055352010642 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for yabasic 2.91.4. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 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 \${ZSH_VERSION+y} && (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 e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || 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 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac 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=`printf "%s\n" "$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 || printf "%s\n" 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 || printf "%s\n" 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 ' t clear :clear 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" || { printf "%s\n" "$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 } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} 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='yabasic' PACKAGE_TARNAME='yabasic' PACKAGE_VERSION='2.91.4' PACKAGE_STRING='yabasic 2.91.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS CPP XMKMF FFI_LIBS FFI_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LIBOBJS POW_LIB ALLOCA CCOPTIONS LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__xargs_n am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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 runstatedir 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static enable_pic with_pic enable_fast_install enable_aix_soname with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock with_ffi with_x ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR FFI_CFLAGS FFI_LIBS XMKMF CPP' # 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' runstatedir='${localstatedir}/run' 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 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=`printf "%s\n" "$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=`printf "%s\n" "$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 ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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=`printf "%s\n" "$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=`printf "%s\n" "$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. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$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" ;; *) printf "%s\n" "$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 runstatedir 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 || printf "%s\n" 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 yabasic 2.91.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] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --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/yabasic] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of yabasic 2.91.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-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-ffi Build with ffi-support for calling foreign libraries [default=yes] --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path FFI_CFLAGS C compiler flags for FFI, overriding pkg-config FFI_LIBS linker flags for FFI, overriding pkg-config XMKMF Path to xmkmf, Makefile generator for X Window System CPP C preprocessor Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. 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 printf "%s\n" "$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 yabasic configure 2.91.4 generated by GNU Autoconf 2.72 Copyright (C) 2023 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 conftest.beam 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 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 printf "%s\n" "$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_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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\"" printf "%s\n" "$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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac 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 yabasic $as_me 2.91.4, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "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=`printf "%s\n" "$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=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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 printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$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 printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (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; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* 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 do not provoke an error unfortunately, instead are silently treated as an "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 is necessary to write \x00 == 0 to get something that is 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 **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="compile config.guess config.sub ltmain.sh missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" 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,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-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 am__api_version='1.17' # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. 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 ;; esac fi if test ${ac_cv_path_install+y}; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$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' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was 's,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ *'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='yabasic' VERSION='2.91.4' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.5.4' macro_revision='2.5.4' ltmain=$ac_aux_dir/ltmain.sh # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$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 # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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. printf "%s\n" "$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 -version; 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\"" printf "%s\n" "$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 printf "%s\n" "$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 (void) { ; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$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+y} && 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 case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$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 (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$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 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _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 conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, this test is not required because there # is no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_FILECMD="file" printf "%s\n" "$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_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; *-mlibc) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 if test -n "$ac_tool_prefix"; then for ac_prog in ar 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 test -z "$STRIP" && STRIP=: test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_manifest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 printf %s "checking for -no_fixup_chains linker flag... " >&6; } if test ${lt_cv_support_no_fixup_chains+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_support_no_fixup_chains=yes else case e in #( e) lt_cv_support_no_fixup_chains=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_static=yes ;; esac fi # Check whether --enable-pic was given. if test ${enable_pic+y} then : enableval=$enable_pic; lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --enable-aix-soname was given. if test ${enable_aix_soname+y} then : enableval=$enable_aix_soname; case $enableval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$enable_aix_soname else case e in #( e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi ;; esac fi enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; *-mlibc) archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; serenity*) ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_c_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *-mlibc) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; serenity*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi ='-fPIC' archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc=no no_undefined_flag= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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. printf "%s\n" "$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 -version; 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\"" printf "%s\n" "$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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _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 conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CCOPTIONS+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CCOPTIONS"; then ac_cv_prog_CCOPTIONS="$CCOPTIONS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_CCOPTIONS="-Wall" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CCOPTIONS=$ac_cv_prog_CCOPTIONS if test -n "$CCOPTIONS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CCOPTIONS" >&5 printf "%s\n" "$CCOPTIONS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" if test "x$ac_cv_header_malloc_h" = xyes then : printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "alloc.h" "ac_cv_header_alloc_h" "$ac_includes_default" if test "x$ac_cv_header_alloc_h" = xyes then : printf "%s\n" "#define HAVE_ALLOC_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "prctl.h" "ac_cv_header_prctl_h" "$ac_includes_default" if test "x$ac_cv_header_prctl_h" = xyes then : printf "%s\n" "#define HAVE_PRCTL_H 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else case e in #( e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h ;; esac fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 printf %s "checking for working alloca.h... " >&6; } if test ${ac_cv_working_alloca_h+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_working_alloca_h=yes else case e in #( e) ac_cv_working_alloca_h=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 printf %s "checking for alloca... " >&6; } if test ${ac_cv_func_alloca_works+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_func_alloca_works=$ac_cv_working_alloca_h if test "$ac_cv_func_alloca_works" != yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef alloca # ifdef __GNUC__ # define alloca __builtin_alloca # elif defined _MSC_VER # include # define alloca _alloca # else # ifdef __cplusplus extern "C" # endif void *alloca (size_t); # endif #endif int main (void) { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_func_alloca_works=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 printf "%s\n" "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 printf %s "checking stack direction for C alloca... " >&6; } if test ${ac_cv_c_stack_direction+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ac_cv_c_stack_direction=0 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_stack_direction=1 else case e in #( e) ac_cv_c_stack_direction=-1 ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 printf "%s\n" "$ac_cv_c_stack_direction" >&6; } printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else case e in #( e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 printf %s "checking for working strtod... " >&6; } if test ${ac_cv_func_strtod+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "$cross_compiling" = yes then : ac_cv_func_strtod=no else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main (void) { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_strtod=yes else case e in #( e) ac_cv_func_strtod=no ;; esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 printf "%s\n" "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes then : fi if test $ac_cv_func_pow = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 printf %s "checking for pow in -lm... " >&6; } if test ${ac_cv_lib_m_pow+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char pow (void); int main (void) { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_pow=yes else case e in #( e) ac_cv_lib_m_pow=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 printf "%s\n" "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes then : POW_LIB=-lm else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 printf "%s\n" "$as_me: WARNING: cannot find library containing definition of pow" >&2;} ;; esac fi fi fi ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes then : printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes then : printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h fi # Check whether --with-ffi was given. if test ${with_ffi+y} then : withval=$with_ffi; else case e in #( e) with_ffi=yes ;; esac fi if test "x${with_ffi}" = xyes; then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi if test -n "$PKG_CONFIG"; then pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FFI" >&5 printf %s "checking for FFI... " >&6; } if test -n "$FFI_CFLAGS"; then pkg_cv_FFI_CFLAGS="$FFI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FFI_CFLAGS=`$PKG_CONFIG --cflags "libffi" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FFI_LIBS"; then pkg_cv_FFI_LIBS="$FFI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FFI_LIBS=`$PKG_CONFIG --libs "libffi" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FFI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libffi" 2>&1` else FFI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libffi" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FFI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libffi) were not met: $FFI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables FFI_CFLAGS and FFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables FFI_CFLAGS and FFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See 'config.log' for more details" "$LINENO" 5; } else FFI_CFLAGS=$pkg_cv_FFI_CFLAGS FFI_LIBS=$pkg_cv_FFI_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } CFLAGS="$CFLAGS $FFI_CFLAGS";LIBS="$LIBS $FFI_LIBS" fi fi have_ffi=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing ffi_call" >&5 printf %s "checking for library containing ffi_call... " >&6; } if test ${ac_cv_search_ffi_call+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char ffi_call (void); int main (void) { return ffi_call (); ; return 0; } _ACEOF for ac_lib in '' ffi do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_ffi_call=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_ffi_call+y} then : break fi done if test ${ac_cv_search_ffi_call+y} then : else case e in #( e) ac_cv_search_ffi_call=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ffi_call" >&5 printf "%s\n" "$ac_cv_search_ffi_call" >&6; } ac_res=$ac_cv_search_ffi_call if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" have_ffi=yes fi for ac_header in ffi.h do : ac_fn_c_check_header_compile "$LINENO" "ffi.h" "ac_cv_header_ffi_h" "$ac_includes_default" if test "x$ac_cv_header_ffi_h" = xyes then : printf "%s\n" "#define HAVE_FFI_H 1" >>confdefs.h else case e in #( e) have_ffi=no ;; esac fi done if test "x${have_ffi}" = xno ; then as_fn_error $? "Did not find libffi library and/or header; please install them or supply '--without-ffi' to built without ffi. If you have both installed and still get this error, you may manually locate the directories with header files and libraries and add them to the environment variables CFLAGS (as -Idir) and LDFLAGS (as -Ldir); see also 'configure --help' for details about supported environment variables." "$LINENO" 5 fi fi if test "x${with_ffi}" = xyes; then have_dlopen=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 printf %s "checking for library containing dlopen... " >&6; } if test ${ac_cv_search_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl dld do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dlopen+y} then : break fi done if test ${ac_cv_search_dlopen+y} then : else case e in #( e) ac_cv_search_dlopen=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 printf "%s\n" "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" have_dlopen=yes fi for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h else case e in #( e) have_dlopen=no ;; esac fi done if test "x${have_dlopen}" = xno ; then as_fn_error $? "Did not find dl library and/or header; please install them or supply '--without-ffi' to built without ffi and dlopen" "$LINENO" 5 fi fi if test "x${have_ffi}" = xyes && test "x${have_dlopen}" = xyes; then printf "%s\n" "#define USE_DL_FFI 1" >>confdefs.h else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: support for calling foreign libraries will NOT be available" >&5 printf "%s\n" "$as_me: support for calling foreign libraries will NOT be available" >&6;} fi have_curses_lib=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing initscr" >&5 printf %s "checking for library containing initscr... " >&6; } if test ${ac_cv_search_initscr+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char initscr (void); int main (void) { return initscr (); ; return 0; } _ACEOF for ac_lib in '' curses ncurses do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_initscr=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_initscr+y} then : break fi done if test ${ac_cv_search_initscr+y} then : else case e in #( e) ac_cv_search_initscr=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_initscr" >&5 printf "%s\n" "$ac_cv_search_initscr" >&6; } ac_res=$ac_cv_search_initscr if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" have_curses_lib=yes fi if test "x${have_curses_lib}" = xno ; then as_fn_error $? "Did not find curses/ncurses library" "$LINENO" 5 fi have_curses_head=no for ac_header in curses.h ncurses.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF have_curses_head=yes fi done if test "x${have_curses_head}" = xno ; then as_fn_error $? "Did not find curses/ncurses header" "$LINENO" 5 fi ac_fn_c_check_func "$LINENO" "getnstr" "ac_cv_func_getnstr" if test "x$ac_cv_func_getnstr" = xyes then : printf "%s\n" "#define HAVE_GETNSTR 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr" >&5 printf %s "checking for library containing dladdr... " >&6; } if test ${ac_cv_search_dladdr+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dladdr (void); int main (void) { return dladdr (); ; return 0; } _ACEOF for ac_lib in '' dl dld do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dladdr=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dladdr+y} then : break fi done if test ${ac_cv_search_dladdr+y} then : else case e in #( e) ac_cv_search_dladdr=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr" >&5 printf "%s\n" "$ac_cv_search_dladdr" >&6; } ac_res=$ac_cv_search_dladdr if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac 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_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac 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_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # 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. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac 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_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac 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 case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 printf %s "checking for X... " >&6; } # Check whether --with-x was given. if test ${with_x+y} then : withval=$with_x; fi # $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 else case e in #( e) # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : # We can compile and link X programs with no special options. ac_x_includes= ac_x_libraries= fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" # If that didn't work, only try xmkmf and file system searches # for native compilation. if test x"$ac_x_includes" = xno && test "$cross_compiling" = no then : rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /opt/X11/include /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= else case e in #( e) for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else case e in #( e) LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no fi # Record the results. case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) : # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no" ;; #( *) : # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; esac ;; esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 printf "%s\n" "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. printf "%s\n" "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 printf %s "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else case e in #( e) LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 printf "%s\n" "neither works" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (void); int main (void) { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (void); int main (void) { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes else case e in #( e) ac_cv_lib_dnet_dnet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (void); int main (void) { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else case e in #( e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes then : fi if test $ac_cv_func_gethostbyname = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes else case e in #( e) ac_cv_lib_nsl_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes else case e in #( e) ac_cv_lib_bsd_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes then : fi if test $ac_cv_func_connect = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char connect (void); int main (void) { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes else case e in #( e) ac_cv_lib_socket_connect=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes then : fi if test $ac_cv_func_remove = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char remove (void); int main (void) { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes else case e in #( e) ac_cv_lib_posix_remove=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes then : fi if test $ac_cv_func_shmat = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shmat (void); int main (void) { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes else case e in #( e) ac_cv_lib_ipc_shmat=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (void); int main (void) { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes else case e in #( e) ac_cv_lib_ICE_IceConnectionNumber=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "x${no_x}" = xyes ; then as_fn_error $? "Did not find X11 library and header" "$LINENO" 5 fi printf "%s\n" "#define UNIX_ARCHITECTURE \"$host\"" >>confdefs.h cat >>confdefs.h <<_ACEOF #define BUILD_TIME "`date -u -d @$SOURCE_DATE_EPOCH 2>/dev/null || date -u -r $SOURCE_DATE_EPOCH 2>/dev/null || date -u`" _ACEOF ac_config_headers="$ac_config_headers config.h:config.h.in" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # 'ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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+y} || &/ 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$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}' DEFS=-DHAVE_CONFIG_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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 || printf "%s\n" 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 # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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=`printf "%s\n" "$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 || printf "%s\n" 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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 yabasic $as_me 2.91.4, which was generated by GNU Autoconf 2.72. 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 case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ yabasic config.status 2.91.4 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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' MKDIR_P='$MKDIR_P' 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 ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: '$1' Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$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 \printf "%s\n" "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 printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.h.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) 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+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands 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" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" 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=`printf "%s\n" "$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 '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$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 || printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 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@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$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 s&@MKDIR_P@&$ac_MKDIR_P&;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"; } && { printf "%s\n" "$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 printf "%s\n" "$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 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2024 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi yabasic-2.91.4/configure.ac0000777000175000017500000000723715055055322011213 dnl Process this file with 'autoconf' to get a configure-script dnl Maybe run these two lines before: dnl apt install libtool dnl autoreconf --install dnl automake --add-missing --copy AC_INIT([yabasic], [2.91.4]) AC_CONFIG_SRCDIR([main.c]) AM_INIT_AUTOMAKE LT_INIT dnl get canonical system name AC_CANONICAL_HOST dnl find out, which c-compiler is available AC_PROG_CC dnl set compiler options AC_CHECK_PROG(CCOPTIONS,gcc,-Wall,) dnl check for required headers AC_CHECK_HEADERS([malloc.h alloc.h prctl.h]) dnl check for ; needed for bison AC_FUNC_ALLOCA dnl check for types AC_TYPE_SIZE_T dnl if strtod is not present, create replacement AC_FUNC_STRTOD dnl create define, if functions not available AC_CHECK_FUNCS([strerror mkstemp]) dnl use our own pkg.m4 from m4 dir AC_CONFIG_MACRO_DIRS([m4]) dnl option to control building with ffi AC_ARG_WITH([ffi], [AS_HELP_STRING([--with-ffi], [Build with ffi-support for calling foreign libraries @<:@default=yes@:>@])], [], [with_ffi=yes]) dnl check for libffi if test "x${with_ffi}" = xyes; then dnl pkg-config may help to locate ffi dnl if this cannot be found, I probably need to fix ACLOCAL_PATH to locate pkg.m4 dnl see also: aclocal --print-ac-dir PKG_PROG_PKG_CONFIG if test -n "$PKG_CONFIG"; then PKG_CHECK_MODULES([FFI], [libffi], [CFLAGS="$CFLAGS $FFI_CFLAGS";LIBS="$LIBS $FFI_LIBS"]) fi have_ffi=no AC_SEARCH_LIBS([ffi_call],[ffi],[have_ffi=yes]) AC_CHECK_HEADERS([ffi.h],[],[have_ffi=no]) if test "x${have_ffi}" = xno ; then AC_MSG_ERROR([Did not find libffi library and/or header; please install them or supply '--without-ffi' to built without ffi. If you have both installed and still get this error, you may manually locate the directories with header files and libraries and add them to the environment variables CFLAGS (as -Idir) and LDFLAGS (as -Ldir); see also 'configure --help' for details about supported environment variables.]) fi fi dnl check for dlopen if test "x${with_ffi}" = xyes; then have_dlopen=no AC_SEARCH_LIBS([dlopen],[dl dld],[have_dlopen=yes]) AC_CHECK_HEADERS([dlfcn.h],[],[have_dlopen=no]) if test "x${have_dlopen}" = xno ; then AC_MSG_ERROR([Did not find dl library and/or header; please install them or supply '--without-ffi' to built without ffi and dlopen]) fi fi dnl calling foreign libraries requires both dlopen and libffi if test "x${have_ffi}" = xyes && test "x${have_dlopen}" = xyes; then AC_DEFINE([USE_DL_FFI],1,[libffi and dlopen available]) else AC_MSG_NOTICE([support for calling foreign libraries will NOT be available]) fi dnl check for curses have_curses_lib=no AC_SEARCH_LIBS([initscr],[curses ncurses],[have_curses_lib=yes]) if test "x${have_curses_lib}" = xno ; then AC_MSG_ERROR([Did not find curses/ncurses library]) fi have_curses_head=no AC_CHECK_HEADERS([curses.h ncurses.h],[have_curses_head=yes]) if test "x${have_curses_head}" = xno ; then AC_MSG_ERROR([Did not find curses/ncurses header]) fi AC_CHECK_FUNCS(getnstr) dnl check for dladdr() function AC_SEARCH_LIBS([dladdr], [dl dld]) dnl check for X-Window system AC_PATH_XTRA if test "x${no_x}" = xyes ; then AC_MSG_ERROR([Did not find X11 library and header]) fi dnl architecture of build machine AC_DEFINE_UNQUOTED(UNIX_ARCHITECTURE,"$host",[architecture of build machine]) dnl build-time, that will be displayed in banner AC_DEFINE_UNQUOTED(BUILD_TIME,"`date -u -d @$SOURCE_DATE_EPOCH 2>/dev/null || date -u -r $SOURCE_DATE_EPOCH 2>/dev/null || date -u`",[build-time, that will be displayed in banner]) dnl produce results AC_CONFIG_HEADERS([config.h:config.h.in]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT yabasic-2.91.4/COPYING0000777000175000017500000000020114735711653007752 Yabasic may be copied only under the terms of the MIT License, which can be found in the file LICENSE within this directory. yabasic-2.91.4/demo.yab0000777000175000017500000001504314735711653010352 // // This program demos yabasic // // Check, if screen is large enough clear screen sw=peek("screenwidth"):sh=peek("screenheight") if (sw<78 or sh<24) then print print " Sorry, but your screen (",sw," x ",sh,") is to small (minimum 78 x 24) to run this demo !" print end endif sw=78:sh=24 // Initialize everything restore mmdata read mmnum:dim mmtext$(mmnum) for a=1 to mmnum:read mmtext$(a):next a // Main loop selection of demo ysel=1 label mainloop clear screen print colour("cyan","magenta") at(7,2) "################################" print colour("cyan","magenta") at(7,3) "################################" print colour("cyan","magenta") at(7,4) "################################" print colour("yellow","blue") at(8,3) " This is the demo for yabasic " yoff=7 for a=1 to mmnum if (a=mmnum) then ydisp=1:else ydisp=0:fi if (a=ysel) then print colour("blue","green") at(5,yoff+ydisp+a) mmtext$(a); else print at(5,yoff+ydisp+a) mmtext$(a); endif next a print at(3,sh-3) "Move selection with CURSOR KEYS (or u and d)," print at(3,sh-2) "Press RETURN or SPACE to choose, ESC to quit." do // loop for keys pressed rev=1 do // loop for blinking k$=inkey$(0.4) if (k$="") then if (ysel=mmnum) then if (rev=1) then print colour("blue","green") at(5,yoff+mmnum+1) mmtext$(mmnum); rev=0 else print colour("yellow","red") at(5,yoff+mmnum+1) mmtext$(mmnum); rev=1 endif endif else // key has been pressed, leave loop break endif loop // loop for blinking yalt=ysel if (k$="up" or k$="u") then if (ysel=1) then ysel=mmnum else ysel=ysel-1 fi redraw():heal():continue fi if (k$="down" or k$="d") then if (ysel=mmnum) then ysel=1 else ysel=ysel+1 fi redraw():heal():continue fi if (k$=" " or k$="enter" or k$="right") then on ysel gosub overview,bitmap,tetraeder,endit goto mainloop fi if (k$="esc") then endit() fi beep print at(3,sh-5) "Invalid key: ",k$," " loop // loop for keys pressed // redraw line sub redraw() if (yalt=mmnum) then ydisp=1:else ydisp=0:fi print at(5,yoff+yalt+ydisp) mmtext$(yalt); if (ysel=mmnum) then ydisp=1:else ydisp=0:fi print colour("blue","green") at(5,yoff+ysel+ydisp) mmtext$(ysel); return end sub // erase a line sub heal() print at(3,sh-5) " " return end sub // Go here to exit label endit print at(3,sh-8) "Bye ...\n "; sleep 1 exit return // Present a short overview label overview clear screen print print " Yabasic is a quite traditional basic: It comes with" print " print, input, for-next-loops, goto, gosub, while and" print " repeat. It has user defined procedures and libraries," print " however, it is not object oriented.\n" print " Yabasic makes it easy to open a window, draw lines" print " and print the resulting picture.\n" print " Yabasic programs are interpreted and run under Unix" print " and Windows. The Yabasic interpreter (around 200K)" print " and any Yabasic program can be glued together to" print " form a standalone executable.\n" print " Yabasic is free software, i.e. subject to the" print " MIT License.\n" print "\n\n\n While you read this, I am calculating prime numbers,\n" print " Press any key to return to main menu ..." can=1 print at(6,17) "This is a prime number: " label nextcan can=can+2 for i=2 to sqrt(can):if (frac(can/i)=0) then goto notprime:fi:next i print at(32,17) can; label notprime if (lower$(inkey$(0))<>"") then print at(10,sh) "Wrapping around once ..."; for x=1 to sw a$=getscreen$(0,0,1,sh-2) b$=getscreen$(1,0,sw-1,sh-2) putscreen b$,0,0 putscreen a$,sw-1,0 sleep 0.02 next x sleep 1 return fi goto nextcan // Show some animated bitmaps label bitmap clear screen print print "Yabasic offers some commands for drawing simple graphics." print reverse at(5,12) " Press any key to return to main menu ... " n=20 open window 400,400 for b=20 to 0 step -1 color 255-b*12,0,b*12 fill circle 200,200,b next b c$=getbit$(179,179,221,221) for a=1 to 2000 color ran(255),ran(255),ran(255) x=ran(500)-100:y=ran(500)-100 fill rectangle ran(500)-100,ran(500)-100,ran(500)-100,ran(500)-100 next a x=200:y=200:phi=ran(2*pi):dx=2*sin(phi):dy=2*cos(phi) o$="" count=0 label pong count=count+1 if o$<>"" putbit o$,xo-2,yo-2 if (count>1000) then phi=ran(2*pi):dx=2*sin(phi):dy=2*cos(phi) sleep 2 count=0 endif xo=x:yo=y x=x+dx:y=y+dy o$=getbit$(x-2,y-2,x+46,y+46) putbit c$,x,y,"t" if (x<0 or x>360) dx=-dx if (y<0 or y>360) dy=-dy if (inkey$(0.01)<>"") then close window return endif goto pong return label tetraeder open window 400,400 clear window clear screen print reverse at(5,12) " Press any key to return to main menu ... " dim opoints(4,3) restore points for n=1 to 4:for p=1 to 3:read opoints(n,p):next p:next n dim triangles(4,3) restore triangles for n=1 to 4:for p=1 to 3:read triangles(n,p):next p:next n phi=0:dphi=0.1:psi=0:dpsi=0.05 dim points(4,3) r=60:g=20 dr=0.5:dg=1.2:db=3 label main phi=phi+dphi psi=psi+dpsi for n=1 to 4 points(n,1)=opoints(n,1)*cos(phi)-opoints(n,2)*sin(phi) points(n,2)=opoints(n,2)*cos(phi)+opoints(n,1)*sin(phi) p2= points(n,2)*cos(psi)-opoints(n,3)*sin(psi) points(n,3)=opoints(n,3)*cos(psi)+ points(n,2)*sin(psi) points(n,2)=p2 next n r=r+dr:if (r<0 or r>60) dr=-dr g=g+dg:if (g<0 or g>60) dg=-dg b=b+db:if (b<0 or b>60) db=-db dm=dm+0.01 m=120-80*sin(dm) for n=1 to 4 p1=triangles(n,1) p2=triangles(n,2) p3=triangles(n,3) n1=points(p1,1)+points(p2,1)+points(p3,1) n2=points(p1,2)+points(p2,2)+points(p3,2) n3=points(p1,3)+points(p2,3)+points(p3,3) if (n3>0) then sp=n1*0.5-n2*0.7-n3*0.6 color 60+r+30*sp,60+g+30*sp,60+b+30*sp fill triangle 200+m*points(p1,1),200+m*points(p1,2),200+m*points(p2,1),200+m*points(p2,2),200+m*points(p3,1),200+m*points(p3,2) endif next n if (inkey$(0.1)<>"") close window:return clear window goto main label points data -1,-1,+1, +1,-1,-1, +1,+1,+1, -1,+1,-1 label triangles data 1,2,4, 2,3,4, 1,3,4, 1,2,3 // Data section ... label mmdata // Data for main menu: Number and text of entries in main menu data 4 data " Yabasic in a nutshell " data " Some graphics " data " A rotating Tetraeder " data " Exit this demo " yabasic-2.91.4/depcomp0000777000175000017500000005055214735711653010307 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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, see . # 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: yabasic-2.91.4/flex.c0000777000175000017500000044360215055056416010034 #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ /* %ok-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ #include #include #include #include /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* %endif */ /* begin standard C++ headers. */ /* %if-c++-only */ /* %endif */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* %ok-for-header */ /* %if-reentrant */ /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif /* %if-not-reentrant */ extern int yyleng; /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ extern FILE *yyin, *yyout; /* %endif */ /* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) #define YY_LINENO_REWIND_TO(dst) \ do {\ const char *p;\ for ( p = yy_cp-1; p >= (dst); --p)\ if ( *p == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ FILE *yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %if-not-reentrant */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* %endif */ /* %ok-for-header */ /* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; /* %ok-for-header */ /* %endif */ void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); /* %endif */ void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ #define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext /* %% [1.5] DFA */ /* %if-c-only Standard (non-C++) definition */ static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ (yytext_ptr) -= (yy_more_len); \ yyleng = (int) (yy_cp - (yytext_ptr)); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 247 #define YY_END_OF_BUFFER 248 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_acclist[1107] = { 0, 16386, 4, 4, 14, 14, 248, 246, 247, 1, 246, 247, 7, 247, 233, 246, 247, 246, 247, 234, 246, 247, 234, 246, 247, 234, 238, 246, 247, 234, 246, 247, 237, 238, 246, 247, 237, 238, 246, 247, 8, 234, 246, 247, 231, 246, 247, 229, 246, 247, 232, 246, 247, 81, 246, 247, 184, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 243, 246, 247, 223, 246, 247, 1, 246, 247, 16386, 246, 247, 246, 247, 8194, 237, 238, 246, 247, 8194, 237, 238, 246, 247, 247, 3, 247, 4, 247, 5, 247, 14, 247, 15, 247, 238, 247, 237, 238, 247, 237, 238, 247, 1, 6, 226, 245, 245, 224, 238, 10, 238, 237, 238, 227, 225, 230, 228, 244, 243, 243, 243, 243, 243, 44, 243, 183, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 42, 243, 243, 243, 243, 243, 243, 243, 243, 243, 69, 243, 243, 243, 243, 243, 243, 243, 243, 63, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 59, 243, 243, 92, 243, 243, 243, 239, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 43, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 1,16386, 8194, 17, 18, 8194, 237, 238, 3, 4, 14, 238, 10, 236, 235, 243, 149, 243, 243, 91, 243, 243, 179, 243, 243, 243, 243, 243, 243, 243, 243, 113, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 136, 243, 243, 243, 182, 243, 243, 84, 243, 16, 243, 102, 243, 243, 86, 243, 169, 243, 95, 243, 243, 243, 243, 243, 243, 140, 243, 243, 243, 243, 36, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 144, 243, 243, 243, 167, 243, 128, 243, 243, 243, 141, 243, 243, 243, 243, 154, 243, 243, 153, 243, 151, 243, 243, 122, 243, 243, 93, 243, 243, 243, 243, 243, 243, 243, 243, 243, 152, 243, 243, 243, 243, 12, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 97, 243, 98, 243, 150, 243, 134, 243, 243, 243, 143, 243, 243, 243, 243, 55, 243, 243, 243, 138, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 168, 243, 243, 243, 243, 243, 243, 96, 243, 243, 137, 243, 243, 135, 243, 139, 243, 243, 127, 243, 126, 243, 181, 244, 133, 243, 243, 243, 243, 39, 243, 145, 243, 243, 178, 244, 243, 243, 243, 243, 243, 243, 243, 89, 243, 243, 243, 16, 16, 243, 65, 243, 243, 243, 243, 243, 22, 243, 243, 87, 243, 243, 243, 108, 243, 243, 243, 148, 243, 243, 243, 243, 243, 222, 243, 243, 53, 243, 180, 244, 243, 243, 243, 243, 243, 243, 243, 103, 243, 243, 41, 243, 243, 243, 157, 244, 243, 48, 243, 243, 70, 243, 243, 243, 190, 243, 192, 243, 243, 243, 243, 88, 243, 112, 243, 243, 9, 11, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 72, 243, 243, 243, 142, 243, 243, 47, 243, 170, 244, 243, 243, 243, 243, 73, 243, 110, 243, 64, 243, 243, 243, 243, 243, 241, 243, 243, 243, 243, 123, 243, 50, 243, 243, 243, 243, 243, 243, 243, 243, 37, 243, 243, 243, 107, 243, 71, 243, 77, 243, 243, 243, 243, 104, 243, 188, 244, 243, 16, 16, 243, 243, 66, 243, 68, 243, 35, 243, 240, 243, 23, 244, 243, 243, 242, 243, 243, 146, 243, 243, 243, 243, 243, 243, 54, 243, 243, 243, 82, 243, 164, 243, 243, 62, 243, 155, 244, 57, 243, 243, 243, 243, 243, 243, 124, 243, 191, 244, 74, 243, 243, 243, 243, 243, 85, 243, 9, 9, 243, 243, 243, 243, 243, 243, 147, 243, 243, 243, 243, 125, 243, 220, 243, 243, 243, 243, 243, 243, 189, 244, 218, 243, 243, 162, 244, 52, 243, 243, 75, 243, 49, 243, 243, 243, 243, 243, 243, 243, 115, 243, 94, 243, 166, 244, 105, 243, 78, 243, 243, 243, 243, 243, 67, 243, 26, 27, 243, 34, 243, 109, 243, 243, 243, 243, 243, 243, 243, 171, 244, 243, 158, 244, 160, 244, 174, 243, 243, 172, 243, 173, 243, 243, 100, 243, 243, 116, 243, 243, 243, 243, 51, 243, 243, 83, 243, 243, 156, 244, 165, 243, 161, 244, 243, 185, 243, 221, 244, 58, 243, 243, 243, 38, 243, 186, 243, 219, 244, 243, 159, 244, 99, 243, 243, 243, 243, 243, 114, 243, 117, 244, 21, 243, 243, 40, 243, 243, 25, 19, 243, 243, 243, 243, 243, 243, 243, 243, 243, 119, 244, 243, 243, 243, 243, 243, 101, 243, 243, 45, 243, 243, 90, 243, 76, 243, 243, 163, 244, 243, 187, 244, 243, 46, 243, 129, 243, 243, 243, 118, 244, 61, 243, 243, 20, 244, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 13, 243, 243, 176, 243, 132, 243, 243, 243, 243, 243, 106, 243, 243, 131, 243, 79, 243, 243, 243, 28, 29, 243, 243, 243, 243, 243, 200, 243, 206, 243, 243, 243, 243, 243, 13, 60, 243, 243, 243, 132, 243, 120, 243, 111, 243, 243, 243, 243, 80, 243, 243, 30, 31, 243, 243, 243, 243, 217, 243, 202, 244, 243, 243, 215, 243, 194, 243, 198, 243, 121, 244, 13, 243, 243, 132, 243, 56, 243, 243, 243, 32, 33, 243, 243, 243, 213, 244, 243, 243, 196, 244, 13, 175, 243, 243, 243, 243, 243, 243, 243, 211, 244, 243, 243, 243, 243, 243, 16, 243, 243, 243, 243, 243, 177, 243, 243, 130, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 208, 243, 243, 243, 243, 243, 243, 243, 243, 243, 204, 244, 243, 243, 243, 243, 199, 243, 205, 243, 243, 243, 243, 243, 243, 243, 216, 243, 201, 244, 243, 243, 214, 243, 243, 243, 24, 243, 243, 212, 244, 243, 243, 243, 243, 210, 244, 243, 243, 243, 193, 243, 197, 243, 243, 243, 243, 195, 244, 243, 243, 243, 209, 244, 243, 243, 243, 207, 243, 203, 244 } ; static const flex_int16_t yy_accept[840] = { 0, 1, 1, 2, 2, 2, 3, 4, 5, 6, 6, 6, 7, 9, 12, 14, 17, 19, 22, 25, 29, 32, 36, 40, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 132, 134, 136, 141, 146, 147, 149, 151, 153, 155, 157, 159, 162, 165, 166, 167, 168, 168, 169, 170, 171, 172, 172, 173, 174, 176, 176, 176, 177, 178, 179, 180, 181, 181, 182, 183, 184, 185, 186, 188, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 207, 208, 209, 210, 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, 222, 223, 224, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 241, 242, 244, 245, 246, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 287, 288, 288, 289, 289, 290, 293, 294, 295, 296, 296, 297, 298, 299, 300, 301, 303, 304, 306, 307, 309, 310, 311, 312, 313, 314, 315, 316, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 331, 332, 333, 335, 336, 338, 340, 342, 343, 345, 347, 349, 350, 351, 352, 353, 354, 356, 357, 358, 359, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 374, 375, 376, 378, 380, 381, 382, 384, 385, 386, 387, 389, 390, 392, 394, 395, 397, 398, 400, 401, 402, 403, 404, 405, 406, 407, 408, 410, 411, 412, 413, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 428, 430, 432, 434, 435, 436, 438, 439, 440, 441, 443, 444, 445, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 459, 460, 461, 462, 463, 464, 466, 467, 469, 470, 472, 474, 475, 477, 479, 481, 483, 484, 485, 486, 488, 490, 491, 493, 494, 495, 496, 497, 498, 499, 500, 502, 503, 504, 505, 507, 509, 510, 510, 510, 511, 512, 513, 515, 516, 518, 519, 520, 522, 523, 524, 526, 527, 528, 529, 530, 532, 533, 535, 537, 538, 539, 540, 541, 542, 543, 544, 546, 547, 549, 550, 551, 553, 554, 556, 557, 559, 560, 561, 563, 565, 566, 567, 568, 570, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 587, 588, 589, 591, 592, 594, 596, 597, 598, 599, 600, 602, 604, 606, 607, 608, 609, 610, 612, 613, 614, 615, 617, 619, 620, 621, 622, 623, 624, 625, 626, 628, 629, 630, 632, 634, 636, 637, 638, 639, 641, 643, 644, 645, 646, 647, 648, 650, 650, 650, 650, 650, 650, 650, 652, 654, 656, 658, 659, 660, 662, 663, 665, 666, 667, 668, 669, 670, 672, 673, 674, 676, 678, 679, 681, 683, 685, 686, 687, 688, 689, 690, 692, 694, 696, 697, 698, 699, 700, 702, 703, 704, 705, 706, 707, 708, 709, 710, 712, 713, 714, 715, 717, 719, 720, 721, 722, 723, 724, 726, 728, 729, 731, 733, 734, 736, 738, 739, 740, 741, 742, 743, 744, 746, 748, 750, 752, 754, 755, 756, 757, 758, 760, 761, 761, 761, 761, 762, 762, 762, 763, 765, 767, 768, 769, 770, 771, 772, 773, 775, 776, 778, 780, 782, 783, 785, 787, 788, 790, 791, 793, 794, 795, 796, 798, 799, 801, 802, 804, 806, 808, 809, 811, 813, 815, 816, 817, 819, 821, 823, 824, 826, 828, 829, 830, 831, 832, 834, 836, 838, 839, 841, 842, 843, 843, 843, 843, 843, 845, 846, 847, 848, 849, 850, 851, 852, 853, 855, 856, 856, 857, 858, 859, 860, 862, 863, 865, 866, 868, 870, 871, 873, 874, 876, 877, 879, 881, 882, 883, 885, 887, 888, 888, 888, 888, 888, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 905, 907, 908, 909, 910, 911, 913, 914, 916, 918, 919, 920, 920, 921, 921, 922, 923, 924, 925, 926, 927, 929, 931, 932, 933, 934, 935, 935, 936, 938, 939, 940, 940, 940, 942, 944, 946, 947, 948, 949, 951, 952, 953, 954, 955, 956, 957, 958, 960, 962, 963, 964, 966, 968, 970, 972, 973, 974, 975, 975, 976, 977, 979, 980, 981, 982, 983, 984, 985, 986, 988, 989, 990, 992, 993, 995, 996, 997, 998, 999, 1000, 1001, 1003, 1004, 1005, 1006, 1007, 1008, 1010, 1011, 1012, 1013, 1014, 1016, 1017, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1054, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1064, 1066, 1067, 1068, 1070, 1071, 1072, 1074, 1075, 1077, 1078, 1079, 1080, 1081, 1083, 1084, 1085, 1086, 1088, 1090, 1091, 1092, 1093, 1095, 1096, 1097, 1098, 1100, 1101, 1102, 1103, 1105, 1107, 1107 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 6, 7, 1, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 13, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 1, 1, 1, 52, 53, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 35, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const YY_CHAR yy_meta[79] = { 0, 1, 2, 3, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 5, 1, 6, 6, 6, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 } ; static const flex_int16_t yy_base[858] = { 0, 0, 77, 63, 69, 432, 425, 419, 415, 74, 82, 405, 3487, 396, 390, 365, 99, 3487, 363, 88, 337, 93, 98, 3487, 99, 322, 318, 3487, 3487, 163, 229, 293, 119, 360, 430, 125, 122, 129, 83, 494, 159, 157, 207, 541, 589, 656, 708, 210, 128, 772, 156, 3487, 239, 332, 331, 267, 249, 3487, 192, 0, 3487, 0, 3487, 271, 287, 294, 313, 3487, 3487, 122, 128, 3487, 3487, 331, 359, 0, 362, 393, 121, 0, 3487, 3487, 3487, 3487, 3487, 0, 143, 288, 213, 357, 169, 387, 375, 313, 410, 424, 389, 355, 435, 303, 437, 376, 468, 478, 471, 446, 474, 512, 540, 488, 516, 531, 522, 331, 563, 590, 557, 573, 225, 611, 629, 615, 625, 665, 618, 230, 635, 720, 684, 701, 634, 761, 715, 698, 742, 765, 748, 681, 775, 245, 788, 797, 812, 822, 255, 828, 832, 834, 838, 900, 850, 841, 847, 853, 854, 863, 866, 893, 869, 898, 905, 943, 856, 927, 916, 963, 969, 936, 970, 973, 976, 948, 881, 985, 975, 989, 988, 1000, 1009, 1010, 1025, 1024, 440, 295, 3487, 258, 3487, 1040, 493, 0, 0, 660, 726, 0, 183, 0, 235, 447, 1045, 506, 631, 576, 1046, 1049, 1056, 1058, 1059, 1071, 1075, 591, 1094, 1076, 1090, 1072, 638, 1096, 1106, 1118, 1124, 1128, 1129, 659, 1131, 1140, 700, 1146, 860, 1156, 1062, 1150, 1202, 1069, 1135, 1152, 1180, 1166, 1178, 1168, 1175, 1207, 1211, 1192, 1213, 1216, 1218, 1239, 1240, 1243, 1220, 1161, 1246, 1250, 1255, 1261, 1267, 1277, 1278, 1281, 1283, 1284, 1304, 1297, 1302, 1311, 1314, 1317, 1324, 1329, 1330, 1331, 1340, 1342, 1344, 1345, 1346, 1347, 1349, 1356, 1358, 1359, 1374, 1365, 1375, 1376, 1388, 1408, 1419, 1390, 1393, 1421, 1423, 1402, 1426, 1437, 1440, 1446, 1452, 1453, 1457, 1463, 1467, 1468, 1474, 1479, 1480, 1486, 1495, 1490, 1496, 1499, 1502, 1506, 1513, 1516, 1515, 1531, 1527, 1532, 1525, 1549, 1559, 1560, 1565, 1562, 1569, 1571, 1581, 1586, 231, 1587, 1588, 1590, 1597, 1601, 1602, 1606, 3487, 1607, 1608, 1620, 1625, 1624, 1627, 1629, 3487, 1634, 1636, 1643, 1639, 1640, 1641, 1661, 1652, 1662, 1671, 225, 1692, 1674, 1689, 1681, 1666, 1709, 1706, 1711, 1677, 1716, 1720, 1727, 1743, 1744, 1740, 1731, 1738, 1754, 1756, 1757, 1760, 1771, 1772, 1775, 3487, 1777, 1789, 1791, 1800, 1802, 1793, 1796, 1811, 1814, 1816, 1817, 1818, 3487, 1831, 1827, 1843, 1833, 1834, 1837, 1847, 1858, 1864, 1867, 1870, 1869, 1873, 1879, 214, 3487, 1885, 1895, 1897, 1898, 1900, 1901, 1899, 1915, 1917, 1918, 1927, 1940, 1942, 1943, 1954, 1945, 3487, 1956, 1959, 1963, 1970, 1968, 1975, 1977, 1979, 1982, 1986, 1989, 1991, 1995, 1996, 1998, 2000, 2002, 2005, 2016, 2026, 2035, 2022, 2031, 2029, 2036, 2038, 2040, 2042, 2054, 2060, 2065, 2070, 2066, 2071, 3487, 2075, 0, 177, 2080, 2084, 2087, 88, 1845, 210, 262, 55, 323, 2089, 2102, 2104, 3487, 2106, 2107, 2109, 2111, 2113, 2116, 2118, 2122, 2129, 2134, 2135, 2138, 2139, 2140, 2149, 2150, 2151, 3487, 2152, 2154, 2155, 2173, 2166, 2175, 2177, 3487, 2182, 2179, 2184, 2180, 2191, 2198, 0, 173, 2200, 2201, 2214, 2211, 2210, 2224, 2227, 2228, 2241, 2245, 2251, 2254, 2258, 2255, 2261, 2268, 2270, 3487, 2274, 2281, 3487, 2283, 2284, 2285, 2288, 2290, 2297, 2309, 2310, 2295, 2311, 2312, 2313, 3487, 2315, 2316, 2330, 2332, 2335, 2342, 2333, 3487, 361, 398, 414, 3487, 437, 491, 2339, 2346, 2351, 2355, 2415, 2367, 2360, 2361, 2377, 3487, 2370, 3487, 3487, 2383, 2386, 2389, 2395, 2410, 2399, 2417, 2405, 2420, 2430, 2433, 2424, 2427, 2448, 2451, 3487, 2461, 3487, 2464, 2473, 3487, 2476, 2477, 2482, 2488, 2489, 3487, 2491, 3487, 2492, 2493, 2495, 2498, 2504, 2505, 3487, 2508, 2509, 2511, 2514, 3487, 69, 167, 202, 294, 2523, 2525, 2527, 2528, 2530, 2550, 2551, 2562, 2541, 3487, 2572, 159, 2555, 2575, 2577, 2590, 2592, 2603, 2597, 2604, 2607, 2610, 2614, 3487, 2617, 3487, 2620, 2624, 2629, 2630, 2631, 3487, 2633, 2649, 523, 524, 530, 546, 3487, 2655, 2656, 2642, 2651, 2676, 2677, 2682, 2687, 2683, 2693, 142, 2698, 2708, 2704, 2735, 2724, 2710, 2739, 2749, 2658, 2750, 2711, 2720, 2740, 2762, 567, 3487, 753, 3487, 2766, 2767, 2769, 2778, 2771, 2784, 2785, 2787, 2789, 2790, 2721, 0, 109, 2796, 2807, 2818, 196, 2821, 2848, 2817, 2820, 2836, 2837, 2847, 2849, 2851, 102, 77, 2853, 2854, 2858, 2863, 2865, 3487, 2874, 2875, 2868, 2881, 2885, 3487, 0, 2892, 2890, 2901, 3487, 2902, 2901, 2908, 2919, 3487, 3487, 2912, 2918, 2921, 3487, 2930, 2932, 3487, 0, 2933, 2934, 2946, 2947, 2950, 2960, 2948, 3487, 2966, 2970, 2976, 2981, 2991, 2992, 2995, 2997, 3002, 3008, 3006, 3017, 3020, 3021, 3030, 3033, 3034, 3027, 3050, 3047, 3045, 3062, 3036, 3065, 3078, 3080, 3043, 3096, 3083, 3093, 3099, 3105, 3110, 3124, 3112, 3126, 3128, 3130, 3131, 3487, 3133, 3137, 3149, 3153, 3146, 3148, 3165, 3171, 3150, 3178, 3181, 3200, 3203, 3487, 3207, 3209, 3206, 3212, 3223, 3213, 3224, 3487, 3225, 3236, 3238, 3237, 3487, 3239, 3241, 3248, 3250, 3251, 3262, 3266, 3273, 3487, 3253, 3276, 3278, 3487, 3279, 3298, 3303, 3308, 3487, 3487, 3368, 3376, 3384, 3392, 3397, 3405, 3413, 3421, 3429, 3437, 3440, 3441, 3446, 3454, 3462, 3469, 3473, 3475, 3478 } ; static const flex_int16_t yy_def[858] = { 0, 838, 1, 839, 839, 840, 840, 841, 841, 839, 839, 838, 838, 838, 838, 838, 842, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 30, 39, 843, 30, 843, 843, 843, 843, 838, 838, 844, 845, 838, 838, 838, 838, 846, 838, 847, 838, 838, 838, 838, 838, 838, 838, 842, 842, 838, 838, 838, 838, 848, 838, 838, 838, 849, 838, 838, 838, 838, 838, 850, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 838, 844, 838, 845, 838, 838, 838, 846, 847, 838, 838, 848, 838, 849, 851, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 851, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 852, 843, 843, 843, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 853, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 852, 852, 843, 843, 843, 838, 838, 838, 838, 838, 838, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 853, 853, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 838, 838, 838, 838, 838, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 838, 843, 843, 838, 843, 843, 843, 843, 843, 838, 843, 838, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 838, 838, 838, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 854, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 838, 843, 843, 843, 843, 843, 838, 843, 843, 838, 838, 838, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 855, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 838, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 856, 855, 843, 843, 843, 838, 838, 843, 843, 843, 843, 843, 843, 843, 843, 838, 838, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 838, 857, 843, 843, 838, 838, 843, 843, 843, 843, 838, 838, 843, 843, 843, 838, 843, 843, 838, 857, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 564, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 843, 838, 843, 843, 843, 843, 843, 843, 843, 843, 838, 843, 843, 843, 838, 843, 843, 843, 843, 838, 0, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838 } ; static const flex_int16_t yy_nxt[3566] = { 0, 12, 13, 14, 15, 16, 12, 12, 12, 17, 17, 18, 17, 17, 17, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 38, 44, 45, 46, 47, 48, 49, 50, 38, 38, 51, 38, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 38, 44, 45, 46, 47, 48, 49, 50, 38, 38, 52, 58, 58, 58, 53, 736, 54, 58, 58, 58, 63, 84, 64, 65, 65, 55, 56, 56, 63, 85, 64, 65, 65, 70, 558, 71, 73, 73, 73, 76, 735, 77, 77, 77, 76, 652, 77, 77, 77, 74, 553, 78, 80, 81, 74, 697, 70, 84, 71, 74, 84, 558, 70, 84, 71, 85, 84, 84, 85, 194, 194, 85, 652, 79, 85, 85, 105, 74, 553, 78, 106, 84, 74, 124, 107, 174, 121, 74, 697, 85, 108, 125, 629, 122, 84, 84, 123, 84, 126, 127, 79, 84, 85, 85, 105, 85, 511, 84, 106, 85, 464, 124, 107, 174, 121, 85, 133, 108, 136, 125, 122, 87, 88, 123, 134, 126, 127, 180, 137, 702, 135, 194, 194, 89, 138, 653, 703, 90, 91, 92, 188, 188, 188, 200, 133, 84, 136, 511, 84, 87, 88, 84, 134, 85, 180, 137, 85, 135, 464, 85, 89, 138, 653, 84, 90, 91, 92, 84, 84, 84, 200, 85, 181, 84, 556, 85, 85, 139, 654, 140, 171, 141, 172, 84, 198, 173, 93, 182, 182, 182, 94, 85, 186, 84, 95, 76, 241, 187, 187, 187, 96, 85, 556, 97, 139, 654, 140, 171, 141, 172, 74, 198, 173, 76, 93, 187, 187, 187, 94, 73, 73, 73, 95, 241, 557, 78, 84, 96, 74, 184, 97, 84, 74, 76, 85, 77, 77, 77, 74, 85, 76, 84, 77, 77, 77, 78, 66, 79, 74, 85, 98, 84, 557, 78, 99, 74, 74, 100, 101, 85, 74, 102, 655, 197, 103, 186, 184, 79, 212, 84, 104, 83, 204, 78, 79, 82, 74, 85, 98, 73, 73, 73, 99, 74, 75, 100, 101, 559, 102, 655, 197, 103, 74, 84, 79, 84, 212, 104, 84, 234, 204, 85, 191, 85, 191, 72, 85, 192, 192, 192, 73, 73, 73, 84, 84, 559, 210, 199, 68, 613, 74, 85, 85, 74, 67, 84, 234, 84, 109, 66, 110, 111, 203, 85, 112, 85, 838, 113, 114, 76, 115, 77, 77, 77, 210, 199, 201, 613, 84, 62, 215, 74, 202, 62, 74, 109, 85, 110, 111, 60, 203, 112, 84, 614, 113, 114, 60, 115, 84, 209, 85, 205, 838, 84, 201, 84, 85, 215, 206, 615, 202, 85, 74, 85, 84, 84, 838, 116, 182, 182, 182, 614, 85, 85, 207, 117, 209, 838, 118, 205, 208, 119, 616, 838, 120, 206, 84, 615, 213, 84, 211, 214, 84, 838, 85, 116, 84, 85, 838, 838, 85, 207, 223, 117, 85, 118, 84, 208, 119, 216, 616, 120, 84, 224, 85, 213, 225, 211, 214, 217, 85, 188, 188, 188, 84, 222, 218, 219, 220, 223, 84, 128, 85, 221, 84, 129, 617, 216, 85, 130, 84, 224, 85, 229, 225, 131, 217, 838, 85, 84, 132, 838, 222, 218, 219, 220, 230, 85, 84, 128, 221, 226, 682, 129, 617, 683, 85, 130, 838, 684, 229, 838, 131, 231, 838, 84, 233, 132, 142, 227, 838, 84, 143, 85, 230, 232, 144, 685, 226, 85, 682, 84, 145, 683, 84, 146, 228, 684, 147, 85, 235, 231, 85, 233, 838, 239, 142, 227, 84, 84, 143, 712, 232, 838, 144, 685, 85, 85, 838, 145, 838, 240, 146, 228, 838, 147, 148, 838, 235, 84, 149, 236, 239, 84, 150, 237, 84, 85, 838, 712, 151, 85, 238, 84, 85, 152, 153, 84, 240, 84, 838, 85, 84, 84, 148, 85, 344, 85, 149, 236, 85, 85, 150, 237, 85, 242, 243, 151, 330, 238, 838, 245, 152, 153, 84, 838, 246, 84, 249, 244, 838, 838, 85, 84, 259, 85, 838, 250, 192, 192, 192, 85, 242, 838, 243, 154, 330, 155, 245, 84, 156, 157, 84, 246, 158, 249, 244, 85, 159, 160, 85, 259, 161, 162, 250, 163, 84, 164, 84, 84, 247, 248, 255, 154, 85, 155, 85, 85, 156, 157, 838, 158, 838, 84, 838, 159, 160, 272, 84, 161, 162, 85, 163, 256, 164, 165, 85, 247, 248, 166, 255, 257, 167, 168, 192, 192, 192, 258, 265, 169, 84, 838, 170, 838, 272, 838, 84, 251, 85, 264, 838, 256, 252, 165, 85, 253, 254, 166, 257, 84, 167, 168, 266, 84, 258, 265, 169, 85, 838, 170, 84, 85, 267, 84, 251, 838, 264, 713, 85, 252, 260, 85, 253, 254, 261, 268, 84, 270, 271, 175, 266, 838, 262, 176, 85, 84, 177, 178, 838, 267, 263, 838, 269, 85, 273, 713, 179, 838, 260, 274, 84, 838, 261, 268, 270, 271, 838, 175, 85, 262, 84, 176, 275, 838, 177, 178, 84, 263, 85, 269, 84, 273, 84, 179, 85, 838, 84, 274, 85, 84, 85, 838, 838, 277, 85, 84, 838, 85, 84, 276, 275, 84, 84, 85, 84, 278, 85, 279, 84, 85, 85, 84, 85, 838, 84, 838, 85, 84, 281, 85, 280, 277, 85, 290, 307, 85, 276, 838, 292, 84, 291, 293, 278, 294, 296, 279, 838, 85, 295, 838, 301, 84, 838, 838, 297, 281, 84, 280, 84, 85, 298, 290, 307, 84, 85, 292, 85, 291, 293, 838, 294, 85, 296, 319, 84, 295, 299, 282, 301, 283, 284, 297, 85, 300, 838, 84, 302, 298, 838, 285, 838, 838, 286, 85, 84, 287, 288, 838, 289, 303, 319, 84, 85, 838, 299, 282, 84, 283, 284, 85, 300, 309, 308, 302, 85, 838, 285, 313, 838, 286, 304, 84, 287, 288, 305, 289, 303, 84, 84, 85, 838, 84, 838, 84, 84, 85, 85, 306, 309, 85, 308, 85, 85, 84, 318, 313, 84, 84, 304, 838, 838, 85, 305, 310, 85, 85, 838, 311, 84, 314, 315, 316, 838, 321, 306, 838, 85, 84, 84, 312, 320, 318, 838, 317, 322, 85, 85, 181, 323, 838, 310, 838, 838, 84, 311, 324, 314, 315, 838, 316, 321, 85, 182, 182, 182, 326, 312, 838, 320, 325, 317, 838, 322, 84, 84, 323, 76, 84, 187, 187, 187, 85, 85, 324, 84, 85, 84, 84, 838, 327, 84, 74, 85, 326, 85, 85, 325, 84, 85, 336, 84, 838, 838, 84, 84, 85, 331, 85, 85, 332, 329, 85, 85, 333, 838, 838, 327, 335, 84, 74, 334, 337, 84, 338, 84, 838, 85, 341, 838, 838, 85, 343, 85, 331, 84, 339, 332, 329, 838, 838, 333, 340, 85, 838, 335, 345, 84, 334, 342, 337, 838, 338, 84, 346, 85, 341, 84, 84, 343, 84, 85, 838, 339, 84, 85, 85, 838, 85, 84, 340, 838, 85, 838, 345, 84, 342, 85, 838, 84, 355, 84, 346, 85, 347, 84, 348, 85, 352, 85, 380, 349, 353, 85, 354, 84, 350, 84, 85, 838, 351, 838, 357, 85, 84, 85, 358, 84, 838, 84, 838, 347, 85, 348, 362, 85, 352, 85, 349, 838, 353, 84, 354, 350, 356, 364, 359, 351, 365, 85, 357, 84, 363, 838, 358, 366, 84, 367, 360, 85, 84, 362, 84, 838, 85, 84, 838, 84, 85, 84, 85, 356, 364, 85, 370, 85, 365, 85, 361, 838, 363, 838, 366, 838, 367, 371, 372, 373, 84, 84, 369, 374, 84, 368, 838, 84, 85, 85, 838, 84, 85, 370, 379, 85, 84, 838, 361, 85, 375, 377, 84, 838, 85, 371, 372, 373, 84, 369, 85, 374, 368, 838, 382, 838, 85, 376, 84, 84, 381, 379, 84, 378, 84, 84, 85, 85, 375, 377, 85, 385, 85, 85, 838, 383, 838, 838, 84, 838, 384, 386, 382, 84, 376, 84, 85, 381, 388, 838, 378, 85, 84, 85, 838, 84, 838, 387, 84, 385, 85, 838, 383, 85, 389, 393, 85, 384, 838, 386, 84, 84, 84, 85, 838, 391, 388, 390, 85, 85, 85, 84, 392, 84, 387, 84, 84, 84, 84, 85, 84, 85, 389, 85, 85, 85, 85, 84, 85, 84, 84, 838, 838, 391, 390, 85, 84, 85, 85, 394, 392, 838, 838, 398, 85, 84, 84, 84, 838, 397, 396, 395, 401, 85, 85, 85, 400, 399, 838, 84, 838, 84, 402, 838, 84, 403, 394, 85, 405, 85, 838, 398, 85, 84, 408, 409, 397, 396, 395, 84, 401, 85, 404, 400, 399, 406, 407, 85, 838, 402, 84, 838, 84, 403, 84, 838, 405, 84, 85, 411, 85, 838, 85, 412, 838, 85, 838, 838, 84, 404, 415, 84, 406, 410, 407, 413, 85, 84, 838, 85, 414, 838, 838, 84, 84, 85, 411, 838, 84, 416, 412, 85, 85, 838, 84, 417, 85, 415, 84, 84, 419, 410, 85, 413, 838, 84, 85, 85, 414, 418, 84, 84, 420, 85, 838, 838, 416, 84, 85, 85, 838, 84, 421, 417, 838, 85, 426, 84, 419, 85, 84, 838, 422, 84, 85, 85, 418, 84, 85, 420, 838, 85, 838, 838, 84, 85, 84, 84, 423, 424, 421, 425, 85, 427, 85, 85, 84, 428, 84, 838, 422, 838, 84, 84, 85, 429, 85, 431, 430, 434, 85, 85, 838, 838, 838, 423, 424, 436, 425, 433, 84, 427, 432, 439, 428, 435, 438, 838, 85, 437, 84, 84, 429, 84, 431, 430, 84, 434, 85, 85, 84, 85, 84, 440, 85, 436, 433, 838, 85, 432, 85, 439, 84, 435, 438, 443, 437, 84, 84, 84, 85, 84, 441, 838, 445, 85, 85, 85, 84, 85, 444, 440, 84, 84, 442, 838, 85, 84, 84, 84, 85, 85, 838, 443, 838, 85, 85, 85, 838, 441, 446, 84, 445, 448, 838, 84, 84, 444, 84, 85, 84, 442, 447, 85, 85, 84, 85, 84, 85, 449, 84, 84, 84, 85, 84, 85, 838, 446, 85, 85, 85, 448, 85, 84, 450, 451, 838, 838, 838, 447, 838, 85, 84, 461, 452, 453, 449, 455, 458, 459, 85, 85, 84, 454, 838, 84, 456, 359, 477, 457, 85, 450, 451, 85, 838, 460, 85, 838, 355, 838, 84, 452, 453, 84, 471, 455, 458, 459, 85, 838, 454, 85, 466, 456, 472, 838, 457, 84, 473, 468, 84, 462, 84, 460, 467, 85, 838, 84, 85, 469, 85, 84, 471, 470, 465, 85, 838, 838, 84, 85, 466, 472, 84, 838, 474, 473, 85, 468, 462, 84, 85, 84, 467, 475, 84, 84, 469, 85, 476, 85, 470, 465, 85, 85, 838, 84, 478, 84, 84, 483, 838, 84, 474, 85, 479, 85, 85, 480, 481, 85, 475, 838, 84, 84, 838, 476, 84, 482, 84, 484, 85, 85, 487, 478, 85, 486, 85, 483, 838, 485, 84, 479, 84, 488, 84, 480, 481, 495, 85, 838, 85, 84, 85, 84, 482, 85, 838, 484, 838, 85, 487, 85, 84, 486, 489, 84, 485, 84, 84, 84, 85, 488, 838, 85, 494, 85, 85, 85, 84, 838, 491, 838, 84, 490, 84, 84, 85, 492, 84, 493, 85, 489, 85, 85, 84, 496, 85, 838, 503, 838, 498, 494, 85, 838, 497, 499, 85, 491, 838, 84, 490, 502, 501, 500, 492, 84, 493, 85, 84, 838, 84, 84, 496, 85, 84, 838, 85, 498, 85, 85, 84, 497, 85, 499, 838, 554, 84, 555, 85, 502, 501, 500, 506, 508, 85, 505, 84, 507, 84, 84, 84, 84, 84, 504, 85, 512, 85, 85, 85, 85, 85, 509, 554, 838, 555, 838, 84, 838, 84, 84, 506, 508, 518, 505, 85, 507, 85, 85, 84, 513, 504, 838, 838, 512, 514, 515, 85, 838, 509, 516, 517, 84, 521, 84, 84, 520, 84, 519, 838, 85, 518, 85, 85, 838, 85, 84, 513, 84, 838, 838, 84, 514, 515, 85, 84, 85, 516, 517, 85, 84, 521, 84, 85, 520, 519, 522, 84, 85, 84, 85, 529, 523, 524, 84, 85, 527, 85, 84, 85, 525, 532, 85, 84, 526, 528, 85, 84, 84, 85, 84, 85, 84, 522, 84, 85, 85, 84, 85, 523, 85, 524, 85, 838, 527, 85, 530, 525, 84, 838, 531, 526, 838, 528, 84, 535, 85, 533, 84, 838, 536, 84, 85, 84, 534, 838, 85, 84, 84, 85, 545, 85, 84, 530, 84, 85, 85, 531, 85, 838, 85, 537, 85, 535, 533, 538, 84, 541, 536, 539, 542, 534, 84, 838, 85, 546, 838, 84, 84, 544, 85, 543, 84, 84, 540, 85, 85, 84, 537, 838, 85, 85, 84, 538, 541, 85, 84, 539, 542, 84, 85, 84, 838, 546, 85, 838, 544, 85, 543, 85, 549, 540, 548, 547, 84, 551, 84, 550, 84, 84, 552, 84, 85, 84, 85, 84, 85, 85, 84, 85, 84, 85, 838, 85, 84, 838, 85, 549, 85, 548, 547, 84, 85, 551, 550, 562, 84, 84, 552, 85, 84, 569, 84, 563, 85, 85, 560, 561, 85, 85, 85, 84, 84, 84, 84, 838, 571, 572, 838, 85, 85, 85, 85, 562, 85, 85, 564, 838, 84, 566, 565, 563, 567, 560, 561, 84, 85, 84, 568, 84, 838, 84, 84, 85, 84, 85, 84, 85, 570, 85, 85, 838, 85, 84, 85, 573, 566, 838, 838, 567, 84, 85, 84, 84, 577, 568, 574, 579, 85, 578, 85, 85, 588, 84, 582, 570, 84, 575, 576, 580, 85, 85, 581, 573, 85, 583, 84, 838, 838, 84, 590, 577, 838, 574, 85, 579, 578, 85, 85, 585, 584, 582, 838, 84, 575, 576, 580, 84, 586, 581, 587, 85, 583, 84, 838, 85, 593, 84, 838, 838, 84, 85, 589, 84, 85, 85, 585, 584, 85, 838, 84, 85, 84, 838, 591, 586, 599, 587, 85, 592, 85, 594, 595, 84, 85, 84, 601, 84, 838, 589, 84, 85, 84, 85, 85, 85, 597, 84, 85, 84, 85, 591, 596, 598, 838, 85, 592, 85, 600, 594, 595, 84, 84, 84, 608, 84, 838, 84, 84, 85, 85, 85, 85, 85, 597, 85, 85, 606, 838, 596, 598, 603, 84, 602, 84, 84, 600, 84, 604, 605, 85, 84, 85, 85, 84, 85, 838, 838, 84, 85, 838, 607, 85, 84, 606, 609, 85, 84, 603, 838, 602, 85, 627, 84, 618, 85, 604, 605, 838, 84, 85, 85, 84, 610, 629, 611, 612, 85, 607, 84, 85, 838, 838, 609, 838, 84, 628, 85, 84, 619, 625, 84, 618, 85, 838, 838, 85, 84, 838, 85, 610, 84, 611, 612, 838, 85, 626, 84, 838, 85, 838, 630, 84, 838, 628, 85, 619, 84, 625, 84, 85, 632, 84, 838, 631, 85, 84, 85, 838, 84, 85, 633, 84, 626, 85, 84, 620, 85, 630, 621, 85, 622, 623, 85, 838, 635, 838, 838, 632, 838, 84, 631, 638, 84, 624, 634, 838, 636, 85, 633, 637, 85, 838, 84, 620, 838, 84, 621, 838, 622, 623, 85, 838, 635, 85, 84, 639, 838, 84, 641, 638, 624, 634, 85, 84, 636, 85, 85, 637, 640, 84, 643, 85, 84, 84, 84, 838, 84, 85, 85, 84, 85, 85, 85, 639, 85, 84, 649, 85, 838, 84, 84, 838, 84, 85, 85, 84, 640, 85, 85, 645, 85, 642, 644, 85, 656, 838, 84, 646, 84, 84, 838, 84, 85, 650, 85, 838, 85, 85, 648, 85, 838, 838, 84, 647, 838, 838, 838, 645, 642, 644, 85, 84, 84, 651, 646, 838, 84, 838, 658, 85, 85, 650, 838, 84, 85, 648, 838, 660, 659, 665, 647, 85, 657, 84, 661, 662, 84, 838, 84, 663, 651, 85, 664, 838, 85, 658, 85, 838, 838, 838, 668, 84, 838, 84, 660, 659, 666, 665, 84, 85, 670, 85, 661, 662, 84, 84, 85, 663, 84, 838, 664, 84, 85, 85, 669, 84, 85, 668, 84, 85, 838, 84, 671, 85, 666, 84, 85, 672, 670, 85, 84, 84, 84, 85, 84, 673, 838, 838, 85, 85, 85, 669, 85, 84, 676, 675, 838, 838, 838, 671, 84, 85, 84, 677, 678, 672, 84, 84, 85, 84, 85, 674, 673, 838, 85, 85, 838, 85, 679, 681, 838, 680, 676, 675, 689, 690, 686, 84, 84, 838, 687, 677, 678, 84, 84, 85, 85, 688, 84, 838, 838, 85, 85, 838, 84, 679, 85, 681, 680, 84, 838, 689, 85, 690, 686, 84, 838, 85, 687, 84, 838, 84, 84, 85, 688, 691, 692, 85, 694, 85, 85, 84, 725, 838, 838, 84, 696, 693, 695, 85, 85, 702, 701, 85, 706, 838, 84, 699, 703, 838, 84, 84, 691, 692, 85, 694, 838, 700, 85, 85, 84, 84, 838, 696, 693, 695, 838, 705, 85, 85, 701, 707, 706, 84, 699, 838, 838, 84, 84, 838, 84, 85, 84, 704, 700, 85, 85, 710, 85, 84, 85, 838, 708, 709, 705, 719, 84, 85, 84, 707, 84, 84, 838, 85, 85, 718, 85, 84, 85, 85, 704, 711, 838, 716, 710, 85, 714, 715, 84, 708, 709, 722, 838, 717, 724, 838, 85, 729, 84, 84, 723, 84, 838, 718, 838, 730, 85, 85, 711, 85, 716, 720, 721, 714, 715, 838, 838, 84, 84, 722, 717, 727, 724, 728, 702, 85, 85, 723, 84, 84, 84, 703, 84, 838, 84, 84, 85, 85, 85, 84, 85, 732, 85, 85, 740, 838, 84, 85, 727, 84, 838, 728, 85, 731, 85, 84, 84, 85, 737, 734, 739, 838, 743, 85, 85, 733, 84, 738, 838, 732, 85, 84, 838, 84, 85, 741, 742, 729, 838, 85, 731, 85, 84, 84, 838, 730, 737, 734, 739, 84, 85, 85, 733, 84, 738, 838, 838, 85, 746, 84, 84, 85, 752, 741, 742, 745, 747, 85, 85, 838, 85, 84, 838, 84, 84, 84, 748, 750, 838, 85, 751, 85, 85, 85, 838, 838, 746, 84, 84, 84, 838, 84, 745, 749, 747, 85, 85, 85, 755, 85, 838, 84, 838, 838, 748, 750, 756, 84, 751, 85, 753, 84, 754, 838, 838, 85, 838, 84, 838, 85, 749, 757, 84, 758, 759, 85, 755, 760, 355, 838, 85, 761, 84, 84, 756, 762, 84, 753, 84, 754, 85, 85, 838, 84, 85, 838, 85, 84, 757, 84, 758, 85, 759, 763, 760, 85, 838, 85, 84, 761, 764, 84, 84, 762, 765, 767, 85, 768, 84, 85, 85, 84, 766, 769, 84, 84, 85, 84, 838, 85, 763, 770, 85, 85, 84, 85, 84, 764, 84, 838, 775, 765, 85, 767, 85, 768, 85, 773, 774, 766, 838, 769, 838, 84, 772, 838, 84, 788, 771, 770, 776, 85, 838, 777, 85, 778, 779, 838, 775, 84, 781, 84, 782, 784, 84, 773, 774, 85, 780, 85, 838, 772, 85, 838, 792, 788, 785, 84, 776, 783, 84, 777, 85, 778, 779, 85, 84, 781, 85, 782, 838, 84, 838, 84, 85, 780, 838, 787, 786, 85, 789, 85, 838, 785, 790, 84, 783, 84, 838, 84, 791, 84, 84, 85, 84, 85, 796, 85, 84, 85, 85, 794, 85, 793, 787, 786, 85, 806, 789, 84, 84, 84, 790, 800, 84, 85, 795, 85, 85, 85, 838, 838, 85, 838, 796, 797, 84, 798, 794, 801, 793, 803, 84, 802, 85, 799, 838, 805, 811, 84, 85, 800, 84, 795, 804, 838, 838, 85, 838, 809, 85, 810, 797, 807, 798, 808, 801, 838, 803, 812, 802, 814, 799, 813, 84, 805, 811, 84, 84, 85, 84, 804, 85, 84, 84, 85, 85, 809, 85, 810, 838, 85, 85, 838, 84, 819, 84, 812, 815, 838, 816, 813, 85, 85, 85, 838, 838, 84, 84, 84, 84, 838, 84, 817, 820, 85, 85, 85, 85, 84, 85, 828, 84, 838, 832, 838, 815, 85, 816, 85, 85, 824, 85, 84, 838, 821, 826, 84, 818, 823, 817, 85, 820, 827, 84, 85, 822, 84, 825, 84, 84, 838, 85, 838, 838, 85, 829, 85, 85, 824, 838, 830, 821, 838, 826, 818, 823, 838, 831, 84, 833, 827, 834, 822, 837, 825, 838, 85, 838, 84, 838, 838, 85, 838, 829, 838, 835, 85, 838, 830, 838, 838, 838, 838, 838, 838, 831, 838, 833, 838, 834, 838, 838, 838, 838, 836, 838, 838, 838, 838, 838, 838, 838, 835, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 836, 57, 57, 57, 57, 57, 57, 57, 57, 59, 59, 59, 59, 59, 59, 59, 59, 61, 61, 61, 61, 61, 61, 61, 61, 69, 69, 69, 69, 69, 69, 69, 69, 86, 86, 86, 86, 86, 183, 183, 183, 183, 183, 183, 183, 183, 185, 185, 185, 185, 185, 185, 185, 185, 189, 189, 838, 189, 189, 189, 189, 189, 190, 190, 838, 190, 190, 190, 190, 190, 193, 193, 838, 193, 193, 193, 193, 193, 195, 195, 196, 196, 328, 838, 328, 328, 328, 463, 463, 838, 463, 463, 463, 463, 463, 510, 510, 838, 510, 510, 510, 510, 510, 667, 838, 838, 838, 838, 667, 667, 698, 698, 698, 698, 726, 726, 744, 744, 744, 11, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838 } ; static const flex_int16_t yy_chk[3566] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 2, 713, 2, 4, 4, 4, 9, 38, 9, 9, 9, 2, 2, 2, 10, 38, 10, 10, 10, 16, 472, 16, 19, 19, 19, 21, 712, 21, 21, 21, 22, 614, 22, 22, 22, 19, 468, 21, 24, 24, 21, 698, 69, 32, 69, 22, 36, 472, 70, 35, 70, 32, 48, 37, 36, 78, 78, 35, 614, 21, 48, 37, 32, 19, 468, 21, 32, 86, 21, 36, 32, 48, 35, 22, 667, 86, 32, 37, 629, 35, 50, 41, 35, 40, 37, 37, 21, 29, 50, 41, 32, 40, 511, 90, 32, 29, 464, 36, 32, 48, 35, 90, 40, 32, 41, 37, 35, 29, 29, 35, 40, 37, 37, 50, 41, 702, 40, 194, 194, 29, 41, 615, 702, 29, 29, 29, 58, 58, 58, 90, 40, 42, 41, 408, 47, 29, 29, 88, 40, 42, 50, 41, 47, 40, 355, 88, 29, 41, 615, 118, 29, 29, 29, 30, 125, 328, 90, 118, 52, 196, 470, 30, 125, 42, 616, 42, 47, 42, 47, 139, 88, 47, 30, 52, 52, 52, 30, 139, 185, 144, 30, 56, 118, 56, 56, 56, 30, 144, 470, 30, 42, 616, 42, 47, 42, 47, 56, 88, 47, 55, 30, 55, 55, 55, 30, 63, 63, 63, 30, 118, 471, 55, 87, 30, 55, 183, 30, 31, 63, 64, 87, 64, 64, 64, 56, 31, 65, 99, 65, 65, 65, 64, 66, 55, 64, 99, 31, 93, 471, 55, 31, 65, 55, 31, 31, 93, 63, 31, 617, 87, 31, 54, 53, 64, 99, 113, 31, 26, 93, 64, 55, 25, 64, 113, 31, 73, 73, 73, 31, 65, 20, 31, 31, 473, 31, 617, 87, 31, 73, 97, 64, 89, 99, 31, 33, 113, 93, 97, 74, 89, 74, 18, 33, 74, 74, 74, 76, 76, 76, 92, 101, 473, 97, 89, 15, 554, 73, 92, 101, 76, 14, 91, 113, 96, 33, 13, 33, 33, 92, 91, 33, 96, 11, 33, 33, 77, 33, 77, 77, 77, 97, 89, 91, 554, 94, 8, 101, 76, 91, 7, 77, 33, 94, 33, 33, 6, 92, 33, 95, 555, 33, 33, 5, 33, 34, 96, 95, 94, 0, 98, 91, 100, 34, 101, 94, 556, 91, 98, 77, 100, 105, 197, 0, 34, 182, 182, 182, 555, 105, 197, 95, 34, 96, 0, 34, 94, 95, 34, 558, 0, 34, 94, 102, 556, 100, 104, 98, 100, 106, 0, 102, 34, 103, 104, 0, 0, 106, 95, 105, 34, 103, 34, 109, 95, 34, 102, 558, 34, 39, 106, 109, 100, 106, 98, 100, 102, 39, 188, 188, 188, 199, 104, 103, 103, 103, 105, 107, 39, 199, 103, 110, 39, 559, 102, 107, 39, 112, 106, 110, 109, 106, 39, 102, 0, 112, 111, 39, 0, 104, 103, 103, 103, 110, 111, 108, 39, 103, 107, 652, 39, 559, 653, 108, 39, 0, 654, 109, 0, 39, 111, 0, 116, 112, 39, 43, 108, 0, 114, 43, 116, 110, 111, 43, 655, 107, 114, 652, 117, 43, 653, 201, 43, 108, 654, 43, 117, 114, 111, 201, 112, 0, 116, 43, 108, 115, 209, 43, 682, 111, 0, 43, 655, 115, 209, 0, 43, 0, 117, 43, 108, 0, 43, 44, 0, 114, 119, 44, 115, 116, 121, 44, 115, 124, 119, 0, 682, 44, 121, 115, 122, 124, 44, 44, 120, 117, 200, 0, 122, 130, 126, 44, 120, 214, 200, 44, 115, 130, 126, 44, 115, 214, 119, 120, 44, 200, 115, 0, 121, 44, 44, 45, 0, 122, 221, 124, 120, 0, 0, 45, 123, 130, 221, 0, 126, 191, 191, 191, 123, 119, 0, 120, 45, 200, 45, 121, 137, 45, 45, 128, 122, 45, 124, 120, 137, 45, 45, 128, 130, 45, 45, 126, 45, 133, 45, 224, 129, 123, 123, 128, 45, 133, 45, 224, 129, 45, 45, 0, 45, 0, 132, 0, 45, 45, 137, 127, 45, 45, 132, 45, 129, 45, 46, 127, 123, 123, 46, 128, 129, 46, 46, 192, 192, 192, 129, 133, 46, 134, 0, 46, 0, 137, 0, 136, 127, 134, 132, 0, 129, 127, 46, 136, 127, 127, 46, 129, 131, 46, 46, 134, 135, 129, 133, 46, 131, 0, 46, 49, 135, 134, 138, 127, 0, 132, 684, 49, 127, 131, 138, 127, 127, 131, 135, 140, 136, 136, 49, 134, 0, 131, 49, 140, 141, 49, 49, 0, 134, 131, 0, 135, 141, 138, 684, 49, 0, 131, 140, 142, 0, 131, 135, 136, 136, 0, 49, 142, 131, 143, 49, 141, 0, 49, 49, 145, 131, 143, 135, 146, 138, 147, 49, 145, 0, 148, 140, 146, 151, 147, 0, 0, 143, 148, 152, 0, 151, 150, 142, 141, 153, 154, 152, 162, 145, 150, 146, 226, 153, 154, 155, 162, 0, 156, 0, 226, 158, 148, 155, 147, 143, 156, 150, 162, 158, 142, 0, 151, 172, 150, 152, 145, 153, 155, 146, 0, 172, 154, 0, 158, 157, 0, 0, 156, 148, 159, 147, 149, 157, 156, 150, 162, 160, 159, 151, 149, 150, 152, 0, 153, 160, 155, 172, 164, 154, 157, 149, 158, 149, 149, 156, 164, 157, 0, 163, 159, 156, 0, 149, 0, 0, 149, 163, 167, 149, 149, 0, 149, 160, 172, 161, 167, 0, 157, 149, 171, 149, 149, 161, 157, 164, 163, 159, 171, 0, 149, 167, 0, 149, 161, 165, 149, 149, 161, 149, 160, 166, 168, 165, 0, 169, 0, 174, 170, 166, 168, 161, 164, 169, 163, 174, 170, 173, 171, 167, 176, 175, 161, 0, 0, 173, 161, 165, 176, 175, 0, 166, 177, 168, 169, 170, 0, 174, 161, 0, 177, 178, 179, 166, 173, 171, 0, 170, 175, 178, 179, 181, 176, 0, 165, 0, 0, 180, 166, 177, 168, 169, 0, 170, 174, 180, 181, 181, 181, 179, 166, 0, 173, 178, 170, 0, 175, 198, 202, 176, 187, 203, 187, 187, 187, 198, 202, 177, 204, 203, 205, 206, 0, 180, 228, 187, 204, 179, 205, 206, 178, 231, 228, 207, 213, 0, 0, 208, 211, 231, 202, 207, 213, 203, 198, 208, 211, 204, 0, 0, 180, 206, 212, 187, 205, 207, 210, 208, 215, 0, 212, 211, 0, 0, 210, 213, 215, 202, 216, 208, 203, 198, 0, 0, 204, 210, 216, 0, 206, 215, 217, 205, 212, 207, 0, 208, 218, 216, 217, 211, 219, 220, 213, 222, 218, 0, 208, 232, 219, 220, 0, 222, 223, 210, 0, 232, 0, 215, 225, 212, 223, 0, 229, 227, 233, 216, 225, 217, 227, 218, 229, 223, 233, 249, 219, 223, 227, 225, 235, 220, 237, 249, 0, 222, 0, 229, 235, 238, 237, 229, 236, 0, 234, 0, 217, 238, 218, 233, 236, 223, 234, 219, 0, 223, 241, 225, 220, 227, 235, 230, 222, 236, 241, 229, 230, 234, 0, 229, 237, 239, 238, 230, 230, 240, 233, 242, 0, 239, 243, 0, 244, 240, 248, 242, 227, 235, 243, 241, 244, 236, 248, 230, 0, 234, 0, 237, 0, 238, 242, 243, 244, 245, 246, 240, 244, 247, 239, 0, 250, 245, 246, 0, 251, 247, 241, 248, 250, 252, 0, 230, 251, 245, 246, 253, 0, 252, 242, 243, 244, 254, 240, 253, 244, 239, 0, 251, 0, 254, 245, 255, 256, 250, 248, 257, 247, 258, 259, 255, 256, 245, 246, 257, 254, 258, 259, 0, 252, 0, 0, 261, 0, 253, 255, 251, 262, 245, 260, 261, 250, 259, 0, 247, 262, 263, 260, 0, 264, 0, 256, 265, 254, 263, 0, 252, 264, 260, 266, 265, 253, 0, 255, 267, 268, 269, 266, 0, 263, 259, 262, 267, 268, 269, 270, 264, 271, 256, 272, 273, 274, 275, 270, 276, 271, 260, 272, 273, 274, 275, 277, 276, 278, 279, 0, 0, 263, 262, 277, 281, 278, 279, 269, 264, 0, 0, 275, 281, 280, 282, 283, 0, 274, 273, 271, 278, 280, 282, 283, 277, 276, 0, 284, 0, 287, 279, 0, 288, 280, 269, 284, 282, 287, 0, 275, 288, 291, 285, 285, 274, 273, 271, 285, 278, 291, 280, 277, 276, 283, 284, 285, 0, 279, 286, 0, 289, 280, 290, 0, 282, 292, 286, 287, 289, 0, 290, 288, 0, 292, 0, 0, 293, 280, 291, 294, 283, 286, 284, 289, 293, 295, 0, 294, 290, 0, 0, 296, 297, 295, 287, 0, 298, 292, 288, 296, 297, 0, 299, 293, 298, 291, 300, 301, 295, 286, 299, 289, 0, 302, 300, 301, 290, 294, 303, 304, 296, 302, 0, 0, 292, 305, 303, 304, 0, 307, 301, 293, 0, 305, 306, 308, 295, 307, 309, 0, 302, 310, 306, 308, 294, 311, 309, 296, 0, 310, 0, 0, 312, 311, 314, 313, 303, 304, 301, 305, 312, 306, 314, 313, 318, 307, 316, 0, 302, 0, 315, 317, 318, 308, 316, 311, 309, 314, 315, 317, 0, 0, 0, 303, 304, 316, 305, 313, 319, 306, 312, 318, 307, 315, 317, 0, 319, 316, 320, 321, 308, 323, 311, 309, 322, 314, 320, 321, 324, 323, 325, 319, 322, 316, 313, 0, 324, 312, 325, 318, 326, 315, 317, 323, 316, 327, 329, 330, 326, 331, 320, 0, 325, 327, 329, 330, 332, 331, 324, 319, 333, 334, 322, 0, 332, 335, 337, 338, 333, 334, 0, 323, 0, 335, 337, 338, 0, 320, 326, 339, 325, 333, 0, 341, 340, 324, 342, 339, 343, 322, 330, 341, 340, 345, 342, 346, 343, 338, 348, 349, 350, 345, 347, 346, 0, 326, 348, 349, 350, 333, 347, 352, 339, 340, 0, 0, 0, 330, 0, 352, 351, 353, 343, 345, 338, 347, 349, 350, 351, 353, 354, 346, 0, 357, 348, 359, 364, 348, 354, 339, 340, 357, 0, 351, 364, 0, 356, 0, 358, 343, 345, 356, 360, 347, 349, 350, 358, 0, 346, 356, 357, 348, 360, 0, 348, 362, 360, 359, 361, 354, 363, 351, 358, 362, 0, 365, 361, 359, 363, 366, 360, 359, 356, 365, 0, 0, 367, 366, 357, 360, 371, 0, 361, 360, 367, 359, 354, 372, 371, 370, 358, 362, 368, 369, 359, 372, 363, 370, 359, 356, 368, 369, 0, 373, 365, 374, 375, 371, 0, 376, 361, 373, 367, 374, 375, 368, 369, 376, 362, 0, 377, 378, 0, 363, 379, 370, 381, 373, 377, 378, 376, 365, 379, 375, 381, 371, 0, 374, 382, 367, 383, 378, 386, 368, 369, 387, 382, 0, 383, 384, 386, 385, 370, 387, 0, 373, 0, 384, 376, 385, 388, 375, 381, 389, 374, 390, 391, 392, 388, 378, 0, 389, 386, 390, 391, 392, 395, 0, 383, 0, 394, 382, 397, 398, 395, 384, 399, 385, 394, 381, 397, 398, 396, 389, 399, 0, 400, 0, 392, 386, 396, 0, 391, 394, 400, 383, 0, 401, 382, 399, 398, 396, 384, 402, 385, 401, 403, 0, 405, 404, 389, 402, 406, 0, 403, 392, 405, 404, 407, 391, 406, 394, 0, 469, 410, 469, 407, 399, 398, 396, 404, 406, 410, 403, 411, 405, 412, 413, 416, 414, 415, 402, 411, 410, 412, 413, 416, 414, 415, 407, 469, 0, 469, 0, 417, 0, 418, 419, 404, 406, 416, 403, 417, 405, 418, 419, 420, 411, 402, 0, 0, 410, 412, 413, 420, 0, 407, 414, 415, 421, 419, 422, 423, 418, 425, 417, 0, 421, 416, 422, 423, 0, 425, 424, 411, 427, 0, 0, 428, 412, 413, 424, 429, 427, 414, 415, 428, 431, 419, 430, 429, 418, 417, 421, 432, 431, 433, 430, 434, 422, 424, 435, 432, 429, 433, 436, 434, 427, 437, 435, 438, 428, 430, 436, 439, 440, 437, 441, 438, 442, 421, 443, 439, 440, 444, 441, 422, 442, 424, 443, 0, 429, 444, 435, 427, 445, 0, 436, 428, 0, 430, 448, 441, 445, 439, 446, 0, 444, 450, 448, 449, 440, 0, 446, 447, 451, 450, 452, 449, 453, 435, 454, 447, 451, 436, 452, 0, 453, 445, 454, 441, 439, 446, 455, 448, 444, 447, 449, 440, 456, 0, 455, 453, 0, 457, 459, 450, 456, 449, 458, 460, 447, 457, 459, 462, 445, 0, 458, 460, 465, 446, 448, 462, 466, 447, 449, 467, 465, 474, 0, 453, 466, 0, 450, 467, 449, 474, 459, 447, 458, 457, 475, 465, 476, 462, 478, 479, 466, 480, 475, 481, 476, 482, 478, 479, 483, 480, 484, 481, 0, 482, 485, 0, 483, 459, 484, 458, 457, 486, 485, 465, 462, 481, 487, 488, 466, 486, 489, 490, 491, 483, 487, 488, 478, 479, 489, 490, 491, 492, 493, 494, 496, 0, 497, 498, 0, 492, 493, 494, 496, 481, 497, 498, 484, 0, 500, 486, 485, 483, 487, 478, 479, 499, 500, 501, 489, 502, 0, 505, 507, 499, 504, 501, 506, 502, 493, 505, 507, 0, 504, 508, 506, 499, 486, 0, 0, 487, 509, 508, 512, 513, 500, 489, 499, 504, 509, 501, 512, 513, 516, 515, 507, 493, 514, 499, 499, 505, 516, 515, 506, 499, 514, 508, 517, 0, 0, 518, 519, 500, 0, 499, 517, 504, 501, 518, 519, 513, 512, 507, 0, 520, 499, 499, 505, 521, 514, 506, 515, 520, 508, 522, 0, 521, 523, 525, 0, 0, 524, 522, 517, 526, 523, 525, 513, 512, 524, 0, 527, 526, 528, 0, 520, 514, 530, 515, 527, 521, 528, 524, 525, 531, 530, 533, 534, 535, 0, 517, 536, 531, 537, 533, 534, 535, 527, 541, 536, 538, 537, 520, 526, 528, 0, 541, 521, 538, 531, 524, 525, 539, 540, 542, 543, 544, 0, 546, 547, 539, 540, 542, 543, 544, 527, 546, 547, 541, 0, 526, 528, 538, 548, 537, 549, 552, 531, 550, 539, 540, 548, 560, 549, 552, 551, 550, 0, 0, 561, 560, 0, 542, 551, 562, 541, 548, 561, 563, 538, 0, 537, 562, 566, 567, 560, 563, 539, 540, 0, 565, 566, 567, 570, 549, 568, 550, 551, 565, 542, 568, 570, 0, 0, 548, 0, 573, 567, 568, 574, 563, 565, 575, 560, 573, 0, 0, 574, 576, 0, 575, 549, 578, 550, 551, 0, 576, 565, 580, 0, 578, 0, 570, 577, 0, 567, 580, 563, 564, 565, 579, 577, 574, 581, 0, 573, 564, 584, 579, 0, 585, 581, 577, 582, 565, 584, 583, 564, 585, 570, 564, 582, 564, 564, 583, 0, 581, 0, 0, 574, 0, 586, 573, 585, 587, 564, 579, 0, 582, 586, 577, 583, 587, 0, 589, 564, 0, 591, 564, 0, 564, 564, 589, 0, 581, 591, 592, 587, 0, 594, 595, 585, 564, 579, 592, 596, 582, 594, 595, 583, 591, 597, 598, 596, 600, 602, 603, 0, 604, 597, 598, 605, 600, 602, 603, 587, 604, 606, 607, 605, 0, 609, 610, 0, 611, 606, 607, 612, 591, 609, 610, 603, 611, 596, 600, 612, 618, 0, 619, 604, 620, 621, 0, 622, 618, 610, 619, 0, 620, 621, 606, 622, 0, 0, 626, 605, 0, 0, 0, 603, 596, 600, 626, 623, 624, 612, 604, 0, 630, 0, 620, 623, 624, 610, 0, 625, 630, 606, 0, 622, 621, 626, 605, 625, 619, 628, 623, 624, 631, 0, 632, 624, 612, 628, 625, 0, 631, 620, 632, 0, 0, 0, 630, 633, 0, 634, 622, 621, 628, 626, 636, 633, 632, 634, 623, 624, 635, 637, 636, 624, 638, 0, 625, 639, 635, 637, 631, 640, 638, 630, 642, 639, 0, 644, 633, 640, 628, 645, 642, 635, 632, 644, 646, 647, 648, 645, 650, 637, 0, 0, 646, 647, 648, 631, 650, 659, 644, 642, 0, 0, 0, 633, 651, 659, 660, 646, 647, 635, 657, 658, 651, 676, 660, 640, 637, 0, 657, 658, 0, 676, 648, 651, 0, 648, 644, 642, 659, 660, 657, 661, 662, 0, 657, 646, 647, 663, 665, 661, 662, 658, 664, 0, 0, 663, 665, 0, 666, 648, 664, 651, 648, 668, 0, 659, 666, 660, 657, 670, 0, 668, 657, 669, 0, 673, 678, 670, 658, 661, 662, 669, 664, 673, 678, 679, 696, 0, 0, 672, 666, 663, 665, 679, 696, 671, 670, 672, 673, 0, 671, 668, 671, 0, 674, 680, 661, 662, 671, 664, 0, 669, 674, 680, 675, 677, 0, 666, 663, 665, 0, 672, 675, 677, 670, 674, 673, 681, 668, 0, 0, 686, 687, 0, 688, 681, 690, 671, 669, 686, 687, 680, 688, 689, 690, 0, 675, 677, 672, 691, 692, 689, 693, 674, 694, 695, 0, 691, 692, 690, 693, 699, 694, 695, 671, 681, 0, 688, 680, 699, 686, 687, 700, 675, 677, 693, 0, 689, 695, 0, 700, 703, 705, 701, 694, 706, 0, 690, 0, 703, 705, 701, 681, 706, 688, 691, 692, 686, 687, 0, 0, 707, 708, 693, 689, 700, 695, 701, 704, 707, 708, 694, 709, 704, 710, 704, 711, 0, 714, 715, 709, 704, 710, 716, 711, 708, 714, 715, 717, 0, 718, 716, 700, 722, 0, 701, 717, 707, 718, 720, 721, 722, 714, 711, 716, 0, 723, 720, 721, 709, 724, 715, 0, 708, 723, 728, 0, 727, 724, 720, 721, 729, 0, 728, 707, 727, 732, 731, 0, 729, 714, 711, 716, 733, 732, 731, 709, 737, 715, 0, 0, 733, 728, 738, 734, 737, 739, 720, 721, 727, 731, 738, 734, 0, 739, 741, 0, 742, 745, 746, 733, 737, 0, 741, 738, 742, 745, 746, 0, 0, 728, 747, 748, 751, 0, 749, 727, 734, 731, 747, 748, 751, 746, 749, 0, 750, 0, 0, 733, 737, 747, 753, 738, 750, 741, 754, 742, 0, 0, 753, 0, 755, 0, 754, 734, 748, 756, 749, 750, 755, 746, 751, 758, 0, 756, 753, 757, 758, 747, 754, 759, 741, 760, 742, 757, 758, 0, 761, 759, 0, 760, 763, 748, 762, 749, 761, 750, 755, 751, 763, 0, 762, 764, 753, 756, 765, 766, 754, 757, 760, 764, 761, 770, 765, 766, 767, 759, 762, 768, 769, 770, 775, 0, 767, 755, 764, 768, 769, 779, 775, 773, 756, 772, 0, 770, 757, 779, 760, 773, 761, 772, 768, 769, 759, 0, 762, 0, 774, 767, 0, 776, 779, 766, 764, 771, 774, 0, 771, 776, 771, 771, 0, 770, 777, 772, 778, 773, 775, 781, 768, 769, 777, 771, 778, 0, 767, 781, 0, 782, 779, 776, 780, 771, 774, 783, 771, 782, 771, 771, 780, 784, 772, 783, 773, 0, 785, 0, 787, 784, 771, 0, 778, 777, 785, 780, 787, 0, 776, 780, 786, 774, 788, 0, 789, 781, 790, 791, 786, 793, 788, 787, 789, 794, 790, 791, 785, 793, 784, 778, 777, 794, 797, 780, 798, 795, 801, 780, 791, 796, 797, 786, 798, 795, 801, 0, 0, 796, 0, 787, 788, 799, 789, 785, 791, 784, 794, 800, 793, 799, 790, 0, 796, 801, 802, 800, 791, 803, 786, 795, 0, 0, 802, 0, 799, 803, 800, 788, 797, 789, 798, 791, 0, 794, 802, 793, 804, 790, 803, 805, 796, 801, 809, 807, 804, 808, 795, 805, 810, 812, 809, 807, 799, 808, 800, 0, 810, 812, 0, 811, 813, 815, 802, 807, 0, 808, 803, 811, 813, 815, 0, 0, 816, 818, 817, 820, 0, 821, 810, 813, 816, 818, 817, 820, 822, 821, 823, 824, 0, 829, 0, 807, 822, 808, 823, 824, 818, 829, 825, 0, 815, 821, 826, 811, 817, 810, 825, 813, 822, 827, 826, 816, 830, 820, 831, 833, 0, 827, 0, 0, 830, 825, 831, 833, 818, 0, 826, 815, 0, 821, 811, 817, 0, 827, 834, 830, 822, 831, 816, 835, 820, 0, 834, 0, 836, 0, 0, 835, 0, 825, 0, 833, 836, 0, 826, 0, 0, 0, 0, 0, 0, 827, 0, 830, 0, 831, 0, 0, 0, 0, 834, 0, 0, 0, 0, 0, 0, 0, 833, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 834, 839, 839, 839, 839, 839, 839, 839, 839, 840, 840, 840, 840, 840, 840, 840, 840, 841, 841, 841, 841, 841, 841, 841, 841, 842, 842, 842, 842, 842, 842, 842, 842, 843, 843, 843, 843, 843, 844, 844, 844, 844, 844, 844, 844, 844, 845, 845, 845, 845, 845, 845, 845, 845, 846, 846, 0, 846, 846, 846, 846, 846, 847, 847, 0, 847, 847, 847, 847, 847, 848, 848, 0, 848, 848, 848, 848, 848, 849, 849, 850, 850, 851, 0, 851, 851, 851, 852, 852, 0, 852, 852, 852, 852, 852, 853, 853, 0, 853, 853, 853, 853, 853, 854, 0, 0, 0, 0, 854, 854, 855, 855, 855, 855, 856, 856, 857, 857, 857, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, 838 } ; /* Table of booleans, true if rule could match eol. */ static const flex_int32_t yy_rule_can_match_eol[248] = { 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; extern int yy_flex_debug; int yy_flex_debug = 1; static const flex_int16_t yy_rule_linenum[247] = { 0, 114, 116, 117, 123, 124, 126, 127, 128, 130, 131, 132, 133, 135, 136, 137, 139, 145, 146, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 356, 357, 358, 359, 360, 361, 362, 363, 364, 366, 368, 374, 380, 386, 395, 396, 397, 398, 400, 405, 410, 427 } ; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ ++(yy_lp); \ goto find_rule; \ } static int yy_more_flag = 0; static int yy_more_len = 0; #define yymore() ((yy_more_flag) = 1) #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de FLEX part This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif #include #include "bison.h" /* get tokens from BISON */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* definitions of yabasic */ #endif int import_lib(char *); /* import library */ #define MAX_INCLUDE_DEPTH 5 #define MAX_INCLUDE_NUMBER 100 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; /* stack for included libraries */ int include_depth; /* current position in library_stack */ struct library *library_stack[MAX_INCLUDE_DEPTH]; /* stack for library file names */ int library_chain_length=0; /* length of library_chain */ struct library *library_chain[MAX_INCLUDE_NUMBER]; /* list of all library file names in order of appearance */ struct library *currlib; /* current library as relevant to bison */ int inlib; /* true, while in library */ int in_short_if=0; /* greater than zero, if within a short if */ int len_of_lineno=0; /* length of last line number */ YY_BUFFER_STATE from_string_buffer; /* to read from string */ /* Remark on yycolumn and yylineno: We only need to track yycolumn, yylineno is taken care for us entirely by flex (even during yyless). To handle yycolumn we need the YY_USER_ACTION which advances yycolumn by the length of each token; additionally we reset it to 1 every time we see a newline. The newline normally will be returned as token tSEP; only if the newline terminates a short if-statement (which has no endif), the token tIMPLICITENDIF will be returned. In any case we reset yycolumn appropriately. Bison, which consumes the tokens returned by this lexer, often needs to look ahead a few (two ?) tokens to parse correctly, this might trigger the lexer to read into the next line, which will in turn reset yycolumn. This needs to be handled correctly in effective_lineno(), which returns the current line number. There are also quite a lot of tests now, which make sure, that the linenumber for error messages is updated correctly. */ int yycolumn=1; int yydoublenl; #define YY_USER_ACTION yydoublenl=FALSE;yylloc.first_line=yylloc.last_line=yylineno; yylloc.first_column=yycolumn; yylloc.last_column=yycolumn+yyleng-1;yycolumn+=yyleng; #define YY_NO_UNISTD_H #define YY_NO_INPUT int start_token; #define INITIAL 0 #define PRELNO 1 #define PASTLNO 2 #define PASTIMPORT 3 #define EVAL_DIGITS 4 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ #include /* %endif */ /* %if-c++-only */ /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* %if-c-only */ static int yy_init_globals ( void ); /* %endif */ /* %if-reentrant */ /* %endif */ /* %endif End reentrant structures and macros. */ /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* %if-bison-bridge */ /* %endif */ /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif /* %not-for-header */ #ifndef YY_NO_UNPUT static void yyunput ( int c, char *buf_ptr ); #endif /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif /* %ok-for-header */ /* %endif */ #endif /* %if-c-only */ /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* %if-c-only Standard (non-C++) definition */ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ /* %if-c++-only C++ definition \ */\ /* %endif */ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) /* %endif */ /* %if-c++-only */ /* %endif */ #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %ok-for-header */ /* %not-for-header */ /* %tables-yydmap generated elements */ /* %endif */ /* end tables serialization structures and prototypes */ /* %ok-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ extern int yylex (void); #define YY_DECL int yylex (void) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) /* %if-c-only */ yyin = stdin; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! yyout ) /* %if-c-only */ yyout = stdout; /* %endif */ /* %if-c++-only */ /* %endif */ if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { /* %% [7.0] user's declarations go here */ if (start_token != evNONE) { int t = start_token; start_token = evNONE; return t; } while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ (yy_more_len) = 0; if ( (yy_more_flag) ) { (yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr)); (yy_more_flag) = 0; } yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; /* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 839 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 3487 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; if ( yy_act & YY_TRAILING_HEAD_MASK || (yy_looking_for_trail_begin) ) { if ( yy_act == (yy_looking_for_trail_begin) ) { (yy_looking_for_trail_begin) = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; } else { (yy_full_match) = yy_cp; (yy_full_state) = (yy_state_ptr); (yy_full_lp) = (yy_lp); break; } ++(yy_lp); goto find_rule; } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; /* %% [11.0] code for yylineno update goes here */ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = (yy_more_len); yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) yylineno++; ; } do_action: /* This label is used only to access EOF actions. */ /* %% [12.0] debug code goes here */ if ( yy_flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 247 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); else if ( yy_act == 247 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); else if ( yy_act == 248 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); } switch ( yy_act ) { /* beginning of action switch */ /* %% [13.0] actions go here */ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PRELNO): case YY_STATE_EOF(PASTLNO): case YY_STATE_EOF(PASTIMPORT): case YY_STATE_EOF(EVAL_DIGITS): { if (severity_threshold <= sDEBUG) { sprintf(string,"Closing file '%s'",currlib->short_name); error(sDEBUG,string); } if (--include_depth<0) { return tEOPROG; } else { if (!is_bound) { yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(include_stack[include_depth]); } report_if_missing("Premature end of file",TRUE); leave_lib(); yylval.nnl=0; return tSEP; } } YY_BREAK case 1: YY_RULE_SETUP {BEGIN(INITIAL);} /* ignore whitespace */ YY_BREAK case 2: YY_RULE_SETUP {if (program_state<=spCOMPILING) {BEGIN(PRELNO);return tLABEL;} else {BEGIN(EVAL_DIGITS);}} /* for functions eval() and compile(), when program state has advanced to spRUNNING, we do not accept line numbers */ YY_BREAK case 3: YY_RULE_SETUP { BEGIN(PASTLNO); yylval.symbol=(char *)my_strdup(yytext); len_of_lineno=strlen(yytext); return tSYMBOL; } YY_BREAK case 4: YY_RULE_SETUP {yycolumn=len_of_lineno+1;BEGIN(INITIAL);yyless(0);yylval.nnl=0;return tSEP;} YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP {yycolumn=1;BEGIN(INITIAL);yylval.nnl=1;return tSEP;} YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP {yycolumn=1;yydoublenl=TRUE;yylval.nnl=2; if (in_short_if) {in_short_if--;yyless(0);return tIMPLICITENDIF;} if (interactive && !inlib) {return tEOPROG;} else {return tSEP;}} YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP {yycolumn=1;yylval.nnl=1; if (in_short_if) {in_short_if--;yyless(0);return tIMPLICITENDIF;};return tSEP;} YY_BREAK case 8: YY_RULE_SETUP {yylval.nnl=0;if (in_short_if && check_compat) error(sWARNING,"Short if has changed in version 2.71");return tSEP;} YY_BREAK case 9: YY_RULE_SETUP {yylval.nnl=0;return tSEP;} /* comments span 'til end of line */ YY_BREAK case 10: YY_RULE_SETUP {yylval.nnl=0;return tSEP;} /* comments span 'til end of line */ YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP {yycolumn=1;yylval.nnl=1; if (in_short_if) {in_short_if--;yyless(0);return tIMPLICITENDIF;};return tSEP;} YY_BREAK case 12: YY_RULE_SETUP {yymore();} YY_BREAK case 13: YY_RULE_SETUP {BEGIN(PASTIMPORT);import_lib(my_strdup(yytext+7));return tIMPORT;} YY_BREAK case 14: YY_RULE_SETUP {yycolumn=1;BEGIN(INITIAL);yyless(0);unput('\n');yylval.nnl=0;return tSEP;} YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP {yycolumn=1;BEGIN(INITIAL);yylval.nnl=1;return tSEP;} YY_BREAK case 16: YY_RULE_SETUP { char *where=strpbrk(yytext," \t\r\f\v"); yylval.docu=(char *)my_strdup(where ? where+1 : NULL); return tDOCU; } YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP {yycolumn=1;yylval.nnl=1;return tSEP;} /* hash (#) as first character of a line may introduce comments too */ YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP {yycolumn=1;yylval.nnl=1;return tSEP;} /* apostrophe (') as first character may introduce comments too */ YY_BREAK case 19: YY_RULE_SETUP return tEXECUTE; YY_BREAK case 20: YY_RULE_SETUP return tEXECUTE2; YY_BREAK case 21: YY_RULE_SETUP return tCOMPILE; YY_BREAK case 22: YY_RULE_SETUP return tEVAL; YY_BREAK case 23: YY_RULE_SETUP return tEVAL2; YY_BREAK case 24: YY_RULE_SETUP return tRUNTIME_CREATED_SUB; YY_BREAK case 25: YY_RULE_SETUP return tENDSUB; YY_BREAK case 26: YY_RULE_SETUP return tENDIF; YY_BREAK case 27: YY_RULE_SETUP return tENDIF; YY_BREAK case 28: YY_RULE_SETUP return tWEND; YY_BREAK case 29: YY_RULE_SETUP return tWEND; YY_BREAK case 30: YY_RULE_SETUP return tSEND; YY_BREAK case 31: YY_RULE_SETUP return tSEND; YY_BREAK case 32: YY_RULE_SETUP return tSEND; YY_BREAK case 33: YY_RULE_SETUP return tSEND; YY_BREAK case 34: YY_RULE_SETUP return tEXPORT; YY_BREAK case 35: YY_RULE_SETUP return tERROR; YY_BREAK case 36: YY_RULE_SETUP return tFOR; YY_BREAK case 37: YY_RULE_SETUP return tBREAK; YY_BREAK case 38: YY_RULE_SETUP return tSWITCH; YY_BREAK case 39: YY_RULE_SETUP return tCASE; YY_BREAK case 40: YY_RULE_SETUP return tDEFAULT; YY_BREAK case 41: YY_RULE_SETUP return tLOOP; YY_BREAK case 42: YY_RULE_SETUP return tDO; YY_BREAK case 43: YY_RULE_SETUP return tTO; YY_BREAK case 44: YY_RULE_SETUP return tAS; YY_BREAK case 45: YY_RULE_SETUP return tREADING; YY_BREAK case 46: YY_RULE_SETUP return tWRITING; YY_BREAK case 47: YY_RULE_SETUP return tSTEP; YY_BREAK case 48: YY_RULE_SETUP return tNEXT; YY_BREAK case 49: YY_RULE_SETUP return tWHILE; YY_BREAK case 50: YY_RULE_SETUP return tWEND; YY_BREAK case 51: YY_RULE_SETUP return tREPEAT; YY_BREAK case 52: YY_RULE_SETUP return tUNTIL; YY_BREAK case 53: YY_RULE_SETUP return tGOTO; YY_BREAK case 54: YY_RULE_SETUP return tGOSUB; YY_BREAK case 55: YY_RULE_SETUP return tSUB; YY_BREAK case 56: YY_RULE_SETUP return tSUB; YY_BREAK case 57: YY_RULE_SETUP return tLOCAL; YY_BREAK case 58: YY_RULE_SETUP return tSTATIC; YY_BREAK case 59: YY_RULE_SETUP return tON; YY_BREAK case 60: YY_RULE_SETUP return tINTERRUPT; YY_BREAK case 61: YY_RULE_SETUP return tCONTINUE; YY_BREAK case 62: YY_RULE_SETUP return tLABEL; YY_BREAK case 63: YY_RULE_SETUP return tIF; YY_BREAK case 64: YY_RULE_SETUP return tTHEN; YY_BREAK case 65: YY_RULE_SETUP return tELSE; YY_BREAK case 66: YY_RULE_SETUP return tELSIF; YY_BREAK case 67: YY_RULE_SETUP return tELSIF; YY_BREAK case 68: YY_RULE_SETUP return tENDIF; YY_BREAK case 69: YY_RULE_SETUP return tENDIF; YY_BREAK case 70: YY_RULE_SETUP return tOPEN; YY_BREAK case 71: YY_RULE_SETUP return tCLOSE; YY_BREAK case 72: YY_RULE_SETUP return tSEEK; YY_BREAK case 73: YY_RULE_SETUP return tTELL; YY_BREAK case 74: YY_RULE_SETUP return tPRINT; YY_BREAK case 75: YY_RULE_SETUP return tUSING; YY_BREAK case 76: YY_RULE_SETUP return tREVERSE; YY_BREAK case 77: YY_RULE_SETUP return tCOLOUR; YY_BREAK case 78: YY_RULE_SETUP return tCOLOUR; YY_BREAK case 79: YY_RULE_SETUP return tBACKCOLOUR; YY_BREAK case 80: YY_RULE_SETUP return tBACKCOLOUR; YY_BREAK case 81: YY_RULE_SETUP return tPRINT; YY_BREAK case 82: YY_RULE_SETUP return tINPUT; YY_BREAK case 83: YY_RULE_SETUP return tRETURN; YY_BREAK case 84: YY_RULE_SETUP return tDIM; YY_BREAK case 85: YY_RULE_SETUP return tDIM; YY_BREAK case 86: YY_RULE_SETUP return tEND; YY_BREAK case 87: YY_RULE_SETUP return tEXIT; YY_BREAK case 88: YY_RULE_SETUP return tREAD; YY_BREAK case 89: YY_RULE_SETUP return tDATA; YY_BREAK case 90: YY_RULE_SETUP return tRESTORE; YY_BREAK case 91: YY_RULE_SETUP return tAND; YY_BREAK case 92: YY_RULE_SETUP return tOR; YY_BREAK case 93: YY_RULE_SETUP return tNOT; YY_BREAK case 94: YY_RULE_SETUP return tBITNOT; YY_BREAK case 95: YY_RULE_SETUP return tEOR; YY_BREAK case 96: YY_RULE_SETUP return tEOR; YY_BREAK case 97: YY_RULE_SETUP return tSHL; YY_BREAK case 98: YY_RULE_SETUP return tSHR; YY_BREAK case 99: YY_RULE_SETUP return tWINDOW; YY_BREAK case 100: YY_RULE_SETUP return tORIGIN; YY_BREAK case 101: YY_RULE_SETUP return tPRINTER; YY_BREAK case 102: YY_RULE_SETUP return tDOT; YY_BREAK case 103: YY_RULE_SETUP return tLINE; YY_BREAK case 104: YY_RULE_SETUP return tCURVE; YY_BREAK case 105: YY_RULE_SETUP return tCIRCLE; YY_BREAK case 106: YY_RULE_SETUP return tTRIANGLE; YY_BREAK case 107: YY_RULE_SETUP return tCLEAR; YY_BREAK case 108: YY_RULE_SETUP return tFILL; YY_BREAK case 109: YY_RULE_SETUP return tFILL; YY_BREAK case 110: YY_RULE_SETUP return tTEXT; YY_BREAK case 111: YY_RULE_SETUP return tRECT; YY_BREAK case 112: YY_RULE_SETUP return tRECT; YY_BREAK case 113: YY_RULE_SETUP return tRECT; YY_BREAK case 114: YY_RULE_SETUP return tPUTBIT; YY_BREAK case 115: YY_RULE_SETUP return tPUTBIT; YY_BREAK case 116: YY_RULE_SETUP return tPUTBIT; YY_BREAK case 117: YY_RULE_SETUP return tGETBIT; YY_BREAK case 118: YY_RULE_SETUP return tGETBIT; YY_BREAK case 119: YY_RULE_SETUP return tGETBIT; YY_BREAK case 120: YY_RULE_SETUP return tPUTCHAR; YY_BREAK case 121: YY_RULE_SETUP return tGETCHAR; YY_BREAK case 122: YY_RULE_SETUP return tNEW; YY_BREAK case 123: YY_RULE_SETUP return tWAIT; YY_BREAK case 124: YY_RULE_SETUP return tWAIT; YY_BREAK case 125: YY_RULE_SETUP return tWAIT; YY_BREAK case 126: YY_RULE_SETUP return tBELL; YY_BREAK case 127: YY_RULE_SETUP return tBELL; YY_BREAK case 128: YY_RULE_SETUP return tLET; YY_BREAK case 129: YY_RULE_SETUP return tARDIM; YY_BREAK case 130: YY_RULE_SETUP return tARDIM; YY_BREAK case 131: YY_RULE_SETUP return tARSIZE; YY_BREAK case 132: YY_RULE_SETUP {yylval.symbol=(char *)my_strdup("numparams"); return tSYMBOL;} YY_BREAK case 133: YY_RULE_SETUP return tBIND; YY_BREAK case 134: YY_RULE_SETUP return tSIN; YY_BREAK case 135: YY_RULE_SETUP return tASIN; YY_BREAK case 136: YY_RULE_SETUP return tCOS; YY_BREAK case 137: YY_RULE_SETUP return tACOS; YY_BREAK case 138: YY_RULE_SETUP return tTAN; YY_BREAK case 139: YY_RULE_SETUP return tATAN; YY_BREAK case 140: YY_RULE_SETUP return tEXP; YY_BREAK case 141: YY_RULE_SETUP return tLOG; YY_BREAK case 142: YY_RULE_SETUP return tSQRT; YY_BREAK case 143: YY_RULE_SETUP return tSQR; YY_BREAK case 144: YY_RULE_SETUP return tINT; YY_BREAK case 145: YY_RULE_SETUP return tCEIL; YY_BREAK case 146: YY_RULE_SETUP return tFLOOR; YY_BREAK case 147: YY_RULE_SETUP return tROUND; YY_BREAK case 148: YY_RULE_SETUP return tFRAC; YY_BREAK case 149: YY_RULE_SETUP return tABS; YY_BREAK case 150: YY_RULE_SETUP return tSIG; YY_BREAK case 151: YY_RULE_SETUP return tMOD; YY_BREAK case 152: YY_RULE_SETUP return tRAN; YY_BREAK case 153: YY_RULE_SETUP return tMIN; YY_BREAK case 154: YY_RULE_SETUP return tMAX; YY_BREAK case 155: YY_RULE_SETUP return tLEFT; YY_BREAK case 156: YY_RULE_SETUP return tRIGHT; YY_BREAK case 157: YY_RULE_SETUP return tMID; YY_BREAK case 158: YY_RULE_SETUP return tLOWER; YY_BREAK case 159: YY_RULE_SETUP return tUPPER; YY_BREAK case 160: YY_RULE_SETUP return tLTRIM; YY_BREAK case 161: YY_RULE_SETUP return tRTRIM; YY_BREAK case 162: YY_RULE_SETUP return tTRIM; YY_BREAK case 163: YY_RULE_SETUP return tSTRING2; YY_BREAK case 164: YY_RULE_SETUP return tINSTR; YY_BREAK case 165: YY_RULE_SETUP return tRINSTR; YY_BREAK case 166: YY_RULE_SETUP return tCHOMP; YY_BREAK case 167: YY_RULE_SETUP return tLEN; YY_BREAK case 168: YY_RULE_SETUP return tVAL; YY_BREAK case 169: YY_RULE_SETUP return tMYEOF; YY_BREAK case 170: YY_RULE_SETUP return tSTR; YY_BREAK case 171: YY_RULE_SETUP return tINKEY; YY_BREAK case 172: YY_RULE_SETUP return tMOUSEX; YY_BREAK case 173: YY_RULE_SETUP return tMOUSEY; YY_BREAK case 174: YY_RULE_SETUP return tMOUSEB; YY_BREAK case 175: YY_RULE_SETUP return tMOUSEB; YY_BREAK case 176: YY_RULE_SETUP return tMOUSEMOD; YY_BREAK case 177: YY_RULE_SETUP return tMOUSEMOD; YY_BREAK case 178: YY_RULE_SETUP return tCHR; YY_BREAK case 179: YY_RULE_SETUP return tASC; YY_BREAK case 180: YY_RULE_SETUP return tHEX; YY_BREAK case 181: YY_RULE_SETUP return tBIN; YY_BREAK case 182: YY_RULE_SETUP return tDEC; YY_BREAK case 183: YY_RULE_SETUP return tAT; YY_BREAK case 184: YY_RULE_SETUP return tAT; YY_BREAK case 185: YY_RULE_SETUP return tSCREEN; YY_BREAK case 186: YY_RULE_SETUP return tSYSTEM; YY_BREAK case 187: YY_RULE_SETUP return tSYSTEM2; YY_BREAK case 188: YY_RULE_SETUP return tDATE; YY_BREAK case 189: YY_RULE_SETUP return tTIME; YY_BREAK case 190: YY_RULE_SETUP return tPEEK; YY_BREAK case 191: YY_RULE_SETUP return tPEEK2; YY_BREAK case 192: YY_RULE_SETUP return tPOKE; YY_BREAK case 193: YY_RULE_SETUP return tFRNFN_CALL; YY_BREAK case 194: YY_RULE_SETUP return tFRNFN_CALL; YY_BREAK case 195: YY_RULE_SETUP return tFRNFN_CALL2; YY_BREAK case 196: YY_RULE_SETUP return tFRNFN_CALL2; YY_BREAK case 197: YY_RULE_SETUP return tFRNFN_SIZE; YY_BREAK case 198: YY_RULE_SETUP return tFRNFN_SIZE; YY_BREAK case 199: YY_RULE_SETUP return tFRNBF_GET; YY_BREAK case 200: YY_RULE_SETUP return tFRNBF_GET; YY_BREAK case 201: YY_RULE_SETUP return tFRNBF_GET2; YY_BREAK case 202: YY_RULE_SETUP return tFRNBF_GET2; YY_BREAK case 203: YY_RULE_SETUP return tFRNBF_GET_BUFFER; YY_BREAK case 204: YY_RULE_SETUP return tFRNBF_GET_BUFFER; YY_BREAK case 205: YY_RULE_SETUP return tFRNBF_SET; YY_BREAK case 206: YY_RULE_SETUP return tFRNBF_SET; YY_BREAK case 207: YY_RULE_SETUP return tFRNBF_SET_BUFFER; YY_BREAK case 208: YY_RULE_SETUP return tFRNBF_SET_BUFFER; YY_BREAK case 209: YY_RULE_SETUP return tFRNBF_ALLOC; YY_BREAK case 210: YY_RULE_SETUP return tFRNBF_ALLOC; YY_BREAK case 211: YY_RULE_SETUP return tFRNBF_ALLOC; YY_BREAK case 212: YY_RULE_SETUP return tFRNBF_DUMP; YY_BREAK case 213: YY_RULE_SETUP return tFRNBF_DUMP; YY_BREAK case 214: YY_RULE_SETUP return tFRNBF_SIZE; YY_BREAK case 215: YY_RULE_SETUP return tFRNBF_SIZE; YY_BREAK case 216: YY_RULE_SETUP return tFRNBF_FREE; YY_BREAK case 217: YY_RULE_SETUP return tFRNBF_FREE; YY_BREAK case 218: YY_RULE_SETUP return tTOKEN; YY_BREAK case 219: YY_RULE_SETUP return tTOKENALT; YY_BREAK case 220: YY_RULE_SETUP return tSPLIT; YY_BREAK case 221: YY_RULE_SETUP return tSPLITALT; YY_BREAK case 222: YY_RULE_SETUP return tGLOB; YY_BREAK case 223: YY_RULE_SETUP return tPOW; YY_BREAK case 224: YY_RULE_SETUP return tPOW; YY_BREAK case 225: YY_RULE_SETUP return tNEQ; YY_BREAK case 226: YY_RULE_SETUP return tNEQ; YY_BREAK case 227: YY_RULE_SETUP return tLEQ; YY_BREAK case 228: YY_RULE_SETUP return tGEQ; YY_BREAK case 229: YY_RULE_SETUP return tEQU; YY_BREAK case 230: YY_RULE_SETUP return tEQU2; YY_BREAK case 231: YY_RULE_SETUP return tLTN; YY_BREAK case 232: YY_RULE_SETUP return tGTN; YY_BREAK case 233: YY_RULE_SETUP return tNOT; YY_BREAK case 234: YY_RULE_SETUP {return yytext[0];} YY_BREAK case 235: YY_RULE_SETUP { yylval.digits=(char *)my_strdup(yytext+2); BEGIN(INITIAL); return tHEXDIGITS; } YY_BREAK case 236: YY_RULE_SETUP { yylval.digits=(char *)my_strdup(yytext+2); BEGIN(INITIAL); return tBINDIGITS; } YY_BREAK case 237: YY_RULE_SETUP { yylval.digits=(char *)my_strdup(yytext); BEGIN(INITIAL); return tDIGITS; } YY_BREAK case 238: YY_RULE_SETUP { { double d; sscanf(yytext,"%lg",&d); yylval.fnum=d; BEGIN(INITIAL); return tFNUM; } } YY_BREAK case 239: YY_RULE_SETUP {yylval.fnum=3.1415926535897932;return tFNUM;} YY_BREAK case 240: YY_RULE_SETUP {yylval.fnum=2.7182818284590452;return tFNUM;} YY_BREAK case 241: YY_RULE_SETUP {yylval.fnum=1; return tFNUM;} YY_BREAK case 242: YY_RULE_SETUP {yylval.fnum=0; return tFNUM;} YY_BREAK case 243: YY_RULE_SETUP { yylval.symbol=(char *)my_strdup(yytext); return tSYMBOL; } YY_BREAK case 244: YY_RULE_SETUP { yylval.symbol=(char *)my_strdup(yytext); return tSTRSYM; } YY_BREAK case 245: /* rule 245 can match eol */ YY_RULE_SETUP { if (yyleng<2 || yytext[yyleng-1]=='\n') { /* unterminated string has reached end of line, report qualified error in bison */ yyless(1); yylval.string=NULL; return tSTRING; } else if (yytext[yyleng-1]=='\"' && count_backslashes(yytext+yyleng-2)%2==1) { /* final quote was escaped, so put all text back and read more */ yyless(yyleng-1); yymore(); } else { /* properly quoted string; remove quotes and return it */ yylval.string=(char *)my_strdup(yytext+1); *(yylval.string+strlen(yylval.string)-1)='\0'; replace_escapes(yylval.string); return tSTRING; } } YY_BREAK case 246: YY_RULE_SETUP {if (isprint(yytext[0])) return yytext[0]; else return ' ';} YY_BREAK case 247: YY_RULE_SETUP YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; /* %if-c-only */ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; /* %endif */ /* %if-c++-only */ /* %endif */ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ static int yy_get_next_buffer (void) /* %endif */ /* %if-c++-only */ /* %endif */ { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ static yy_state_type yy_get_previous_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { yy_state_type yy_current_state; char *yy_cp; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { /* %% [16.0] code to find the next state goes here */ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 839 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) /* %endif */ /* %if-c++-only */ /* %endif */ { int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 839 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 838); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT /* %if-c-only */ static void yyunput (int c, char * yy_bp ) /* %endif */ /* %if-c++-only */ /* %endif */ { char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; /* %% [18.0] update yylineno here */ if ( c == '\n' ){ --yylineno; } (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } /* %if-c-only */ /* %endif */ #endif /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); /* %% [19.0] update BOL and yylineno */ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) yylineno++; ; return c; } /* %if-c-only */ #endif /* ifndef YY_NO_INPUT */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ void yyrestart (FILE * input_file ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /* %if-c++-only */ /* %endif */ /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ /* %if-c-only */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } /* %if-c-only */ static void yy_load_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; /* %if-c-only */ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; /* %endif */ /* %if-c++-only */ /* %endif */ (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ /* %if-c-only */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) /* %endif */ /* %if-c++-only */ /* %endif */ { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /* %if-c++-only */ /* %endif */ /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ /* %if-c-only */ void yy_delete_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ /* %if-c-only */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) /* %endif */ /* %if-c++-only */ /* %endif */ { int oerrno = errno; yy_flush_buffer( b ); /* %if-c-only */ b->yy_input_file = file; /* %endif */ /* %if-c++-only */ /* %endif */ b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } /* %if-c-only */ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; /* %endif */ /* %if-c++-only */ /* %endif */ errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ /* %if-c-only */ void yy_flush_buffer (YY_BUFFER_STATE b ) /* %endif */ /* %if-c++-only */ /* %endif */ { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ /* %if-c-only */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) /* %endif */ /* %if-c++-only */ /* %endif */ { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ /* %if-c-only */ void yypop_buffer_state (void) /* %endif */ /* %if-c++-only */ /* %endif */ { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* %endif */ /* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ /* %if-c-only */ static void yyensure_buffer_stack (void) /* %endif */ /* %if-c++-only */ /* %endif */ { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /* %endif */ /* %if-c-only */ /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } /* %endif */ #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif /* %if-c-only */ static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /* %if-c-only */ /* %if-reentrant */ /* %endif */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /* %if-reentrant */ /* %endif */ /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } /* %endif */ /* %if-reentrant */ /* %if-bison-bridge */ /* %endif */ /* %endif if-c-only */ /* %if-c-only */ static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); /* %if-reentrant */ /* %endif */ return 0; } /* %endif */ /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" /* %endif */ /* %ok-for-header */ void open_main(FILE *file,char *explicit,char *main_file_name) /* open main file */ { include_depth=0; if (explicit) { include_stack[include_depth]=yy_scan_string(explicit); } else { include_stack[include_depth]=yy_create_buffer(file,YY_BUF_SIZE); } library_stack[include_depth]=new_library(main_file_name,"main"); library_chain[library_chain_length++]=library_stack[include_depth]; if (!explicit) yy_switch_to_buffer(include_stack[include_depth]); currlib=library_stack[0]; inlib=FALSE; return; } void start_flex_from_string(char *text) /* open string with commands */ { from_string_buffer = yy_scan_string(text); /* yy_switch_to_buffer(from_string_buffer); */ } void end_flex_from_string(void) /* free structure used to read string */ { yy_delete_buffer(from_string_buffer); } int import_lib(char *name) /* import library */ { char *full; static int end_of_all_imports=FALSE; static int ignore_nested_imports=FALSE; FILE *lib_file; while(isspace(*name)) name++; name[strcspn(name, "\n")] = '\0'; /* This can only occur in bound programs; void all further import-statements */ if (!strcmp(name,"__END_OF_ALL_IMPORTS")) { error(sDEBUG,"Encountered special import __END_OF_ALL_IMPORTS"); end_of_all_imports=TRUE; } if (end_of_all_imports) return TRUE; /* This can only occur in bound programs, close currently imported library */ if (!strcmp(name,"__END_OF_CURRENT_IMPORT")) { error(sDEBUG,"Encountered special import __END_OF_CURRENT_IMPORT"); include_depth--; leave_lib(); ignore_nested_imports=FALSE; return TRUE; } /* This can only occur in bound programs, ignore nested import-statement */ if (!strcmp(name,"__IGNORE_NESTED_IMPORTS")) { error(sDEBUG,"Encountered special import __IGNORE_NESTED_IMPORTS"); ignore_nested_imports=TRUE; } if (ignore_nested_imports) return TRUE; include_depth++; inlib=TRUE; if (include_depth>=MAX_INCLUDE_DEPTH) { sprintf(string,"Could not import '%s': nested too deep (%d)",name,include_depth); error(sERROR,string); return FALSE; } if (is_bound) { full=name; } else { lib_file=open_library(name,&full); if (!lib_file) return FALSE; yy_switch_to_buffer(yy_create_buffer(lib_file,YY_BUF_SIZE)); include_stack[include_depth]=YY_CURRENT_BUFFER; } library_stack[include_depth]=new_library(full,NULL); library_chain[library_chain_length++]=library_stack[include_depth]; if (library_chain_length>=MAX_INCLUDE_NUMBER) { sprintf(string,"Cannot import more than %d libraries",MAX_INCLUDE_NUMBER); error(sERROR,string); return FALSE; } if (!library_stack[include_depth]) { sprintf(string,"library '%s' has already been imported",full); error(sERROR,string); return FALSE; } if (severity_threshold <= sNOTE) { if (is_bound) { sprintf(string,"importing library '%s'",name); } else { sprintf(string,"importing from file '%s'",full); } error(sNOTE,string); } currlib=library_stack[include_depth]; /* switch late because error() uses currlib */ return TRUE; } FILE *open_library(char *name,char **fullreturn) /* search and open a library */ { static char full_wdir[NAMEBUFFLEN]; static char full_main[NAMEBUFFLEN]; static char full_global[NAMEBUFFLEN]; char unquoted[NAMEBUFFLEN]; char *p; FILE *lib; int i; for(p=name;strchr(" \"'`",*p);p++) if (!*p) break; strncpy(unquoted,p,NAMEBUFFLEN); unquoted[NAMEBUFFLEN - 1] = '\0'; for(;!strchr(" \"'`",*p);p++) if (!*p) break; if (*p) unquoted[p-name-2]='\0'; name=unquoted; if (strchr(name,'.')) { sprintf(string,"library name '%s' contains '.'",name); error(sERROR,string); return NULL; } if (!strcmp(name,"main")) { if (is_bound) return NULL; error(sERROR,"invalid library name 'main'"); return NULL; } /* search in current working dir */ if (fullreturn) *fullreturn=full_wdir; strncpy(full_wdir,name,NAMEBUFFLEN); full_wdir[NAMEBUFFLEN - 1] = '\0'; strcat(full_wdir,".yab"); lib=fopen(full_wdir,"r"); if (lib) return lib; /* search in dir of main file */ if (fullreturn) *fullreturn=full_main; if (strchr(main_file_name,'/') || strchr(main_file_name,'\\')) { strncpy(full_main,main_file_name,NAMEBUFFLEN - 1); } else { full_main[0]='\0'; } for(i=0;i<2;i++) { p=strrchr(full_main,"\\/"[i]); if (p) *p='\0'; } if (full_main[0] && !strchr("\\/",full_main[strlen(full_main)-1])) { #ifdef UNIX strcat(full_main,"/"); #else strcat(full_main,"\\"); #endif } strcat(full_main,name); strcat(full_main,".yab"); lib=fopen(full_main,"r"); if (lib) return lib; /* search in global directory */ if (fullreturn) *fullreturn=full_global; strncpy(full_global,library_path,NAMEBUFFLEN - 1); if (full_global[0] && !strchr("\\/",full_global[strlen(full_global)-1])) { #ifdef UNIX strcat(full_global,"/"); #else strcat(full_global,"\\"); #endif } strcat(full_global,name); strcat(full_global,".yab"); lib=fopen(full_global,"r"); if (lib) return lib; sprintf(string,"could not open library '%s': not in current workingdir as '%s', not in directory of main file as '%s', not in library path as '%s'",name,full_wdir,full_main,full_global); error(sERROR,string); return NULL; } void leave_lib(void) /* processing, when end of library is found */ { if (include_depth<0) return; if (severity_threshold <= sDEBUG) { sprintf(string,"End of library '%s', continue with '%s', include depth is now %d",currlib->short_name,library_stack[include_depth]->short_name,include_depth); error(sDEBUG,string); } yylineno=currlib->yylineno_at_start; currlib=library_stack[include_depth]; inlib=(include_depth>0); } yabasic-2.91.4/flow.c0000777000175000017500000006032115055043126010030 /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de flow.c -- code for subroutines and flow-control This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ /* ------------- includes ---------------- */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* all prototypes and structures */ #endif /* ------------- external references ---------------- */ extern int mylineno; /* current line number */ extern int yyparse(); /* call bison parser */ extern int switch_nesting; /* ------------- local functions ---------------- */ static void load_pop_multi(struct command *, int); /* put correct value into preceding pop_multi-statement */ /* ------------- global variables ---------------- */ static struct command *labelroot = NULL; /* first label among commands */ static struct command *labelhead = NULL; /* last label seen so far */ int switch_id_stack[100]; int max_switch_id = 0; /* ------------- subroutines ---------------- */ void create_check_return_value( int is, int should) /* create command 'cCHECK_RETURN_VALUE' */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cCHECK_RETURN_VALUE, NULL, NULL); cmd->args = is; cmd->tag = should; } void check_return_value( struct command *cmd) /* check return value of function */ { int is, should; struct stackentry *s; is = cmd->args; should = cmd->tag; if (is == should) { /* okay, function returns expected type */ } else if (is == ftNONE) { /* no element on stack, create one */ s = push(); if (should == ftNUMBER) { s->type = stNUMBER; s->value = 0.0; } else { s->type = stSTRING; s->pointer = my_strdup(""); } } else { sprintf(string, "subroutine returns %s but should return %s", (is == ftSTRING) ? "a string" : "a number", (should == ftSTRING) ? "a string" : "a number"); error(sERROR, string); } if (severity_threshold <= sDEBUG) { s = stackhead->prev; if (s->type == stNUMBER) { sprintf(string, "subroutine returns number %g", s->value); } else if (s->type == stSTRING) { sprintf(string, "subroutine returns string '%s'", (char *)s->pointer); } else { sprintf(string, "subroutine returns something strange (%d)", s->type); } error(sDEBUG, string); } } void reorder_stack_after_call( int keep_topmost) /* reorganize stack after function call: keep return value and remove switch value (if any) */ { struct stackentry *keep, *kept; char *kept_string = NULL; double kept_value = 0; int kept_type = 0; if (keep_topmost) { keep = pop(stANY); kept_type = keep->type; if (keep->type == stSTRING) { kept_string = my_strdup((char *)keep->pointer); } else if (keep->type == stNUMBER) { kept_value = keep->value; } else { error(sFATAL, "expecting only string or number on stack"); } } while (stackhead->prev->type != stRET_ADDR && stackhead->prev->type != stRET_ADDR_CALL) { /* discard switch values */ pop(stANY); } /* push back kept value */ if (keep_topmost) { kept = push(); if (kept_type == stSTRING) { kept->pointer = kept_string; } else { kept->value = kept_value; } kept->type = kept_type; swap(); /* move return address to top */ } } void reorder_stack_before_call( struct stackentry *ret) /* reorganize stack before function call */ { struct stackentry *a, *b, *c; struct stackentry *top, *bot; struct stackentry *ttop, *bbot; int args; /* this is a function call; revert stack and shuffle return address to bottom */ /* push address below parameters */ args = 0; top = a = ret->prev; while (a->type != stFREE) { a = a->prev; args++; } bot = a->next; b = a->prev; /* remove ret */ ret->prev->next = ret->next; ret->next->prev = ret->prev; /* squeeze ret between a and b */ ret->next = a; a->prev = ret; b->next = ret; ret->prev = b; /* revert stack between top and bot */ if (args > 1) { a = bot; b = a->next; bbot = bot->prev; ttop = top->next; for (; args > 1; args--) { a->prev = b; c = b->next; b->next = a; a = b; b = c; } bot->next = ttop; bot->next->prev = bot; top->prev = bbot; top->prev->next = top; } } void myreturn(struct command *cmd) /* return from gosub of function call */ { struct stackentry *address; reorder_stack_after_call(cmd->type == cRETURN_FROM_CALL); address = pop(stANY); if (cmd->type == cRETURN_FROM_CALL) { if (address->type != stRET_ADDR_CALL) { error(sFATAL, "RETURN from a subroutine without CALL"); return; } } else { /* cRETURN_FROM_GOSUB */ if (address->type != stRET_ADDR) { error(sFATAL, "RETURN without GOSUB"); return; } } currcmd = (struct command *)address->pointer; } void create_subr_link(char *label) /* create link to subroutine */ { char global[NAMEBUFFLEN]; char *dot; struct command *cmd; if (!inlib) { if (severity_threshold <= sDEBUG) error(sDEBUG, "not in library, will not create link to subroutine"); return; } dot = strchr(label, '.'); if (strlen(library_stack[include_depth - 1]->short_name) + strlen(dot) >= NAMEBUFFLEN) { error(sERROR, "Name of function too long"); return; } strcpy(global, library_stack[include_depth - 1]->short_name); strcat(global, dot); /* check, if label is duplicate */ if (search_label(global, srmSUBR | srmLINK | srmLABEL)) { sprintf(string, "duplicate subroutine '%s'", strip(global)); error(sERROR, string); return; } cmd = add_command_with_sym_and_diag(cLINK_SUBR, NULL, label); /* store label */ cmd->pointer = my_strdup(global); link_label(cmd); } void create_endfunction(void) /* create command cEND_FUNCTION */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cEND_FUNCTION, NULL, NULL); link_label(cmd); } void function_or_array( struct command *cmd) /* decide whether to perform function or array */ { struct command *fu; fu = search_label(cmd->symname, srmSUBR | srmLINK); if (fu) { cmd->type = cCALL; cmd->pointer = cmd->symname; cmd->symname = NULL; if (severity_threshold <= sDEBUG) { sprintf(estring, "converting '%s' to '%s'", cexplanation[cFUNCTION_OR_ARRAY], cexplanation[cFUNCTION]); error(sDEBUG, estring); } } else { if (cmd->type == cFUNCTION_OR_ARRAY) { cmd->tag = CALLARRAY; } else { cmd->tag = CALLSTRINGARRAY; } cmd->type = cDOARRAY; cmd->args = -1; if (severity_threshold <= sDEBUG) { sprintf(estring, "converting '%s' to '%s'", cexplanation[cFUNCTION_OR_ARRAY], cexplanation[cDOARRAY]); error(sDEBUG, estring); } } } void create_makelocal(char *name, int type) /* create command 'cMAKELOCAL' */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cMAKELOCAL, name, NULL); cmd->args = type; } void makelocal(struct command *cmd) /* makes symbol local */ { if (get_sym(cmd->symname, cmd->args, amSEARCH_VERY_LOCAL)) { sprintf(string, "local variable '%s' already defined within this subroutine", strip(cmd->symname)); error(sERROR, string); return; } get_sym(cmd->symname, cmd->args, amADD_LOCAL); } void create_count_params(void) /* create command 'cCOUNT_PARAMS' */ { /* dotifying numparams at compiletime (as opposed to runtime) is essential, because the function name is not known at runtime */ add_command_with_sym_and_diag(cCOUNT_PARAMS, dotify("numparams", FALSE), NULL); } void count_params(struct command *cmd) /* count number of function parameters */ { struct symbol *sym; sym = get_sym(cmd->symname, syNUMBER, amADD_LOCAL); sym->value = abs(count_args(FALSE)); } void dump_sub(int short_dump) /* dump the stack of subroutine calls */ { struct stackentry *st = stackhead; struct command *cmd; char dumpbuffer[INBUFFLEN]; int first = TRUE; do { if (st->type == stRET_ADDR_CALL) { cmd = st->pointer; if (cmd->type == cCALL || cmd->type == cQCALL) { char *dot; dot = strchr(cmd->pointer, '.'); if (first && !short_dump) { error_without_position(sDUMP, "Executing in:"); } sprintf(dumpbuffer, "sub %s() called in %s,%d", dot ? (dot + 1) : (char *)cmd->pointer, cmd->lib->long_name, cmd->line); error_without_position(sDUMP, dumpbuffer); first = FALSE; } } st = st->prev; } while (st && st != stackroot); if (first && !short_dump) { if (!short_dump) { error_without_position(sDUMP, "Executing in:"); } } if (!short_dump) { error_without_position(sDUMP, "main program"); } return; } void create_goto(char *label) /* creates command goto */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cGOTO, NULL, label); cmd->pointer = my_strdup(label); add_switch_state(cmd); } void create_gosub(char *label) /* creates command gosub */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cGOSUB, NULL, label); /* specific info */ cmd->pointer = my_strdup(label); } void create_call(char *label) /* creates command function call */ { struct command *cmd; cmd = add_command_with_sym_and_diag(cCALL, NULL, label); /* specific info */ cmd->pointer = my_strdup(label); } struct command *add_switch_state( struct command *cmd) /* add switch state to a newly created command */ { cmd->switch_state = my_malloc(sizeof(struct switch_state)); cmd->switch_state->id = switch_id_stack[switch_nesting]; cmd->switch_state->nesting = switch_nesting; cmd->switch_state->pop_on_qgoto = 0; return cmd; } void initialize_switch_id_stack(void) /* initialize stack of switch_ids */ { switch_id_stack[0] = max_switch_id; } void push_switch_id(void) /* generate a new switch id on top of stack */ { if (switch_nesting >= 100) error(sFATAL, "more than 100 nested switch statements"); switch_nesting++; max_switch_id++; switch_id_stack[switch_nesting] = max_switch_id; } void pop_switch_id(void) /* pop last switch_id */ { if (switch_nesting <= 0) error(sFATAL, "no more switch ids to pop"); switch_nesting--; } void link_label(struct command *cmd) /* link label into list of labels */ { if (!labelroot) { labelroot = cmd; } else { labelhead->next_assoc = cmd; } labelhead = cmd; } struct command *search_label(char *name, int type) /* search label */ { struct command *curr; char *at = NULL; curr = labelroot; if (type & srmGLOBAL) { at = strchr(name, '@'); if (at) *at = '\0'; } while (curr) { if ((type & srmSUBR) && curr->type == cUSER_FUNCTION && !strcmp(curr->pointer, name)) { if (at) *at = '@'; return curr; } if ((type & srmLINK) && curr->type == cLINK_SUBR && !strcmp(curr->pointer, name)) { if (at) *at = '@'; return curr->next; } if ((type & srmLABEL) && curr->type == cLABEL && !strcmp(curr->pointer, name)) { if (at) *at = '@'; return curr; } curr = curr->next_assoc; } return NULL; } void jump(struct command *cmd) /* jump to specific Label; used as goto, gosub or function call */ { struct command *label; struct stackentry *ret; int type; char *dot; type = cmd->type; if (type == cGOSUB || type == cQGOSUB || type == cCALL || type == cQCALL) { /* leave return address for return */ ret = push(); ret->pointer = currcmd; if (type == cGOSUB || type == cQGOSUB) { ret->type = stRET_ADDR; } else { ret->type = stRET_ADDR_CALL; reorder_stack_before_call(ret); } } if (type == cQGOSUB || type == cQGOTO || type == cQCALL) { currcmd = (struct command *)cmd->jump; /* use remembered address */ if (type == cQGOTO && cmd->switch_state && cmd->switch_state->pop_on_qgoto) { /* jump out of switch-statment ? */ pop(stANY); } return; } label = search_label(cmd->pointer, srmSUBR | srmLINK | srmLABEL); if (!label && type == cCALL && (dot = strchr(cmd->pointer, '.'))) { strcpy(string, "main"); strcat(string, dot); label = search_label(string, srmLINK); } if (label) { /* found right label */ currcmd = label; /* jump to new location */ /* use the address instead of the name next time */ cmd->jump = label; switch (cmd->type) { case cGOTO: cmd->type = cQGOTO; cmd->switch_state->pop_on_qgoto = check_leave_switch(cmd, label); if (cmd->switch_state->pop_on_qgoto) { pop(stANY); } break; case cGOSUB: cmd->type = cQGOSUB; break; case cCALL: cmd->type = cQCALL; break; } } else { /* label not found */ sprintf(string, "can't find %s '%s'", (type == cCALL) ? "subroutine" : "label", strip((char *)cmd->pointer)); if (strchr(cmd->pointer, '@')) { strcat(string, " (not in this sub)"); } error(sERROR, string); } } /* Some background for the switch-statement (a note to self): The switch-statement ist tricky, because it needs a switch-value on stack against which to compare the different cases; if the program leaves the switch-statement prematurely (e.g. by 'goto' some other place), this switch-value is still in place and needs to be removed. This removal needs to be done differently depending on how the switch-statement is left. There are four ways to leave a switch-statement: return, continue, break and goto; each one has its own method to clean up left-over switch-values. Especially two tasks have to be handled: Nested switch-statements, e.g. by removing more than one switch-value. Most of these commands are converted during their first execution into a faster variant (e.g. cQGOTO), which needs to care for the stack too; and tests should be executed twice, to test the converted form too. return: May or may not return a value; this needs to be kept (stored away); then remove all switch-values up to the return address. Nested switch-statements are not a special problem. The variable switch_nesting cannot be helpful here because a gosub might happen from within an outer switch-statement, and return from an inner one; in that case only one switch-value can be removed. The switch-values are removed in reorder_stack_after_call. continue: Leave a loop; the destination is found by scanning the list of commands backward (so each command on the way can be examined for cBEGIN_SWITCH_MARK or cEND_SWITCH_MARK); during that process the number of left switch-statments is counted and stored within the preceding cPOP_MULTI-command; this is done in mycontinue with the help of load_pop_multi. break: Very similar to continue, but scans the list of commands forward. Accepts a numeric argument so it may need to leave multiple switch-statements or loops. Is handled within mybreak with load_pop_multi. goto: Might try to jump out of nested switch-statements into other nested switch-statements; however the commands between start and end of the jump are not scanned sequentially (rather with search_label); so this cannot be handled like continue or break. To allow some checking of a goto-statement, the parser (in yabasic.bison) records for each goto and label a switch_id and a switch_nesting. These are used to echeck some constellations of goto in check_leave_switch; other cases (e.g. goto from one switch-statement into another) are disallowed. */ int check_leave_switch(struct command *from, struct command *to) /* check, if goto or continue enters or leaves a switch_statement */ { if (from->switch_state->id == to->switch_state->id) { /* okay: move within a single switch statement or jump and land outside of * any switch statement */ } else if (from->switch_state->nesting == 1 && to->switch_state->nesting == 0) { /* okay: move out of single switch statement */ return 1; } else if (from->switch_state->id == 0 && to->switch_state->id != 0) { error(sERROR, "GOTO into a switch-statement"); } else if (from->switch_state->nesting != 0 && to->switch_state->nesting == 0) { error(sERROR, "GOTO out of multiple switch-statements"); } else { error(sERROR, "GOTO between switch-statements"); } return 0; } void create_label(char *label, int type) /* creates command label */ { struct command *cmd; /* check, if label is duplicate */ if (search_label(label, srmSUBR | srmLINK | srmLABEL)) { sprintf(string, "duplicate %s '%s'", (type == cLABEL) ? "label" : "subroutine", strip(label)); error(sERROR, string); return; } cmd = add_command_with_sym_and_diag(type, NULL, label); cmd->pointer = my_strdup(label); add_switch_state(cmd); link_label(cmd); } void decide() /* skips next command, if not 0 on stack */ { if (pop(stNUMBER)->value != 0) { currcmd = currcmd->next; /* skip one command */ if (severity_threshold <= sDEBUG) std_diag("skipping", currcmd->type, currcmd->symname, currcmd->diag); } else { if (severity_threshold <= sDEBUG) error(sDEBUG, "(no command skipped)"); } } void skipper() /* used for on_goto/gosub, skip specified number of commands */ { int i, len; struct command *ahead; /* command to follow */ len = (int)pop(stNUMBER)->value; i = 1; currcmd = currcmd->next; /* advance to first goto/gosub */ for (i = 1; i < len; i++) { ahead = currcmd->next->next; /* skip interleaving findnop statement */ if (ahead->type == cNOP) { break; } else { currcmd = ahead; } } } void skiponce(struct command *cmd) /* skip next command exectly once */ { if (cmd->tag) { currcmd = currcmd->next; } if (severity_threshold <= sDEBUG) { if (cmd->tag) { error(sDEBUG, "skipping next command"); } else { error(sDEBUG, "not Skipping next command"); } } cmd->tag = 0; } void resetskiponce(struct command *cmd, int n) /* find and reset nth skip */ { struct command *c; int i; c = cmd; for (i = 0; i < n; i++) { while (c->type != cSKIPONCE) { c = c->next; } if (i == 0 && n == 2) { c = c->next; } } c->tag = 1; } void pop_multi( struct command *cmd) /* pop and discard multiple values from stack */ { int to_pop = cmd->tag; while (to_pop > 0) { pop(stSTRING_OR_NUMBER); to_pop--; } } static void load_pop_multi( struct command *cmd, int to_pop) /* put correct value into preceding pop_multi-statement */ { if (cmd->prev->type != cPOP_MULTI) { sprintf(string, "while trying to load pop_multi; preceding command is rather '%s'", cexplanation[cmd->prev->type]); error(sFATAL, string); } cmd->prev->tag = to_pop; if (severity_threshold <= sDEBUG) { sprintf(string, "loading previous pop_multi-command with %d", to_pop); error(sDEBUG, string); } /* and execute it for the first time */ pop_multi(cmd->prev); } void create_mybreak(int depth) /* create command mybreak */ { struct command *cmd; if (depth > 3 || depth < 1) { sprintf(string, "invalid number of levels to break: %d; only 1,2 or 3 are allowed", depth); error(sERROR, string); } cmd = add_command(cBREAK_MULTI); cmd->tag = depth; } void mybreak(struct command *cmd) /* find break_here statement */ { struct command *curr; int loop_nesting = 0; int switch_nesting = 0; int to_break; int to_pop = 0; to_break = cmd->tag; curr = cmd; while (curr->type != cBREAK_HERE || 1 - loop_nesting - switch_nesting != to_break) { if (curr->type == cBEGIN_LOOP_MARK) { loop_nesting++; } if (curr->type == cEND_LOOP_MARK) { loop_nesting--; } if (curr->type == cBEGIN_SWITCH_MARK) { switch_nesting++; to_pop--; } if (curr->type == cEND_SWITCH_MARK) { switch_nesting--; to_pop++; } curr = curr->next; if (!curr) { curr = cmd; sprintf(estring, "break has left program (loop_nesting=%d, switch_nesting=%d)", loop_nesting, switch_nesting); error(sERROR, estring); } } cmd->type = cQGOTO; if (severity_threshold <= sDEBUG) { sprintf(estring, "converting '%s' to '%s'", cexplanation[cBREAK_MULTI], cexplanation[cQGOTO]); error(sDEBUG, estring); } load_pop_multi(cmd, to_pop); cmd->jump = currcmd = curr; } void mycontinue(struct command *cmd) /* find continue_here statement */ { struct command *curr; int loop_nesting = 0; int to_pop = 0; curr = cmd; while (curr->type != cCONTINUE_HERE || loop_nesting) { if (curr->type == cBEGIN_LOOP_MARK) { loop_nesting++; } if (curr->type == cEND_LOOP_MARK) { loop_nesting--; } if (curr->type == cBEGIN_SWITCH_MARK) { to_pop++; } if (curr->type == cEND_SWITCH_MARK) { to_pop--; } curr = curr->prev; if (!curr) { curr = cmd; sprintf(string, "continue has left program (loop_nesting=%d)", loop_nesting); error(sERROR, string); } } cmd->type = cQGOTO; if (severity_threshold <= sDEBUG) { sprintf(estring, "converting '%s' to '%s'", cexplanation[cCONTINUE], cexplanation[cQGOTO]); error(sDEBUG, estring); } load_pop_multi(cmd, to_pop); cmd->jump = currcmd = curr; } void next_case(struct command *cmd) /* find next_case_here statement */ { struct command *curr; int loop_nesting = 0; int switch_nesting = 0; curr = cmd; while (curr->type != cNEXT_CASE_HERE || loop_nesting || switch_nesting) { if (curr->type == cBEGIN_LOOP_MARK) { loop_nesting++; } if (curr->type == cEND_LOOP_MARK) { loop_nesting--; } if (curr->type == cBEGIN_SWITCH_MARK) { switch_nesting++; } if (curr->type == cEND_SWITCH_MARK) { switch_nesting--; } curr = curr->next; if (!curr) { curr = cmd; sprintf(estring, "search for next case has left program (loop_nesting=%d, " "switch_nesting=%d)", loop_nesting, switch_nesting); error(sERROR, estring); } } cmd->type = cQGOTO; if (severity_threshold <= sDEBUG) { sprintf(estring, "converting '%s' to '%s'", cexplanation[cNEXT_CASE], cexplanation[cQGOTO]); error(sDEBUG, estring); } cmd->jump = currcmd = curr; } void findnop(void) /* used for on_gosub, find trailing nop command */ { while (currcmd->type != cNOP) { currcmd = currcmd->next; /* next label */ } } void forcheck(void) /* check, if for-loop is done */ { double start, bound, step, val; val = pop(stNUMBER)->value; step = pop(stNUMBER)->value; bound = pop(stNUMBER)->value; start = stackhead->prev->value; if ((val <= bound && val >= start && step >= 0) || (val <= start && val >= bound && step <= 0)) { stackhead->prev->value = 1.; } else { stackhead->prev->value = 0.; } } void forincrement(void) /* increment value on stack */ { /* expecting on stack: BOUND,STEP,VAL,stackhead where for VAL=START to BOUND step STEP */ stackhead->prev->value += stackhead->prev->prev->value; } void startfor(void) /* compute initial value of for-variable */ { struct stackentry *p; p = push(); p->value = stackhead->prev->prev->prev->prev->value; p->type = stNUMBER; return; } yabasic-2.91.4/foreign.c0000777000175000017500000005701215055044666010527 /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de foreign.c -- code for calling foreign libraries This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ /* See: https://eli.thegreenplace.net/2013/03/04/flexible-runtime-interface-to-shared-libraries-with-libffi for an interesting example on using libffi by Eli Bendersky */ /* ------------- includes ---------------- */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* all prototypes and structures */ #endif /* ------------- defines and enums ---------------- */ enum kind_of_type { ktSIMPLE, ktCOMPLEX, ktANY }; /* ------------- externally visible variables ---------------- */ char last_frnfn_call_error_text[INBUFFLEN] = ""; /* last error message produced by foreign call */ int last_frnfn_call_okay = 1; /* true, if last foreign call has been okay */ /* ------------- define a stub only, if feature is not available * ---------------- */ #if defined(UNIX) && !defined(USE_DL_FFI) void no_frn_error(void) { error(sERROR, "This build of yabasic does not support calling foreign libraries"); } void frnfn_call(int type, double *pvalue, char **ppointer) { no_frn_error(); return; } double frnfn_size() { no_frn_error(); return 0.0; } char *frnbf_alloc() { no_frn_error(); return my_strdup(""); } void frnbf_free() { no_frn_error(); return; } int frnbf_size(void) { no_frn_error(); return 0; } char *frnbf_dump(int type) { no_frn_error(); return my_strdup(""); } void frnbf_set() { no_frn_error(); return; } void frnbf_set2() { no_frn_error(); return; } double frnbf_get() { no_frn_error(); return 0.0; } char *frnbf_get2() { no_frn_error(); return my_strdup(""); } char *frnbf_get_buffer() { no_frn_error(); return my_strdup(""); } void frnbf_set_buffer() { no_frn_error(); return; } #else #define NUM_FFI_TYPES 16 #ifdef WINDOWS #define FFI_BUILDING #endif #include #include #ifdef UNIX #include #endif /* ------------- types ---------------- */ union FFI_VAL { uint8_t ffiuint8; int8_t ffisint8; uint16_t ffiuint16; int16_t ffisint16; uint32_t ffiuint32; int32_t ffisint32; uint64_t ffiuint64; int64_t ffisint64; float ffifloat; double ffidouble; char ffischar; short ffisshort; int ffisint; long ffislong; void *ffipointer; char filler[64]; }; /* ------------- local functions ---------------- */ static int frn_decode_ffi_type(char *, ffi_type **, char **, int); static int frnfn_parse_stack(void); static void frn_cast_to_ffi_type(union FFI_VAL *, ffi_type *, double); static double frn_cast_from_ffi_type(union FFI_VAL *, ffi_type *); static void frnfn_cleanup(void); static int frnbf_parse_handle(char *, int *, void **); static int frnbf_verify_not_null(int); /* ------------- global variables ---------------- */ char *libname = NULL; /* name of library to call */ #ifdef UNIX void *lib = NULL; /* handle to library */ #else HINSTANCE lib = NULL; /* handle to library */ #endif char *funame = NULL; /* name of function to call */ int opt_error; /* should problems with library lead to yabasic-errors ? ffi-problems will in any case */ int opt_copy_string_result; /* should the string result be copied or passed through */ int opt_unload_library; /* should the library be unloaded after call */ ffi_cif cif; /* structure describing arguments for libffi */ int argcnt; /* number of arguments for function, i.e. length of both following lists */ ffi_type **vtypes; /* list of types for all individual values */ char **vtypestxt; /* list of types for all individual values as text */ ffi_type *rtype; /* expected return type of function */ char *rtypetxt; /* expected return type of function as text */ union FFI_VAL *values; /* actual values that should be passed to call, see union FFI_VAL above */ union FFI_VAL **pvalues; /* pointers to values */ /* ------------- subroutines ---------------- */ void frnfn_call( int type, double *pvalue, char **ppointer) /* load and execute function from external library */ { int ffi_ret; union FFI_VAL ffi_result; void *fu; #ifdef UNIX char *call_err; #endif last_frnfn_call_error_text[0] = '\0'; last_frnfn_call_okay = 0; if (!frnfn_parse_stack()) { frnfn_cleanup(); return; } /* Initialize the cif */ if ((ffi_ret = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, argcnt, rtype, vtypes)) != FFI_OK) { if (ffi_ret == FFI_BAD_TYPEDEF) { sprintf(string, "invalid type specification for function '%s' from library '%s'; " "check arguments", funame, libname); } else { sprintf(string, "unknown error when preparing function '%s' from library '%s'", funame, libname); } error(sERROR, string); frnfn_cleanup(); return; } #ifdef UNIX lib = dlopen(libname, RTLD_LAZY); #else lib = LoadLibrary(libname); #endif if (!lib) { sprintf(string, "could not load library '%s'", libname); if (opt_error) { error(sERROR, string); } else { strcpy(last_frnfn_call_error_text, string); } frnfn_cleanup(); return; } #ifdef UNIX dlerror(); /* Clear any existing error */ fu = dlsym(lib, funame); #else fu = GetProcAddress(lib, funame); #endif if (!fu) { sprintf(string, "could not find function '%s' in foreign library '%s'", funame, libname); if (opt_error) { error(sERROR, string); } else { strcpy(last_frnfn_call_error_text, string); } frnfn_cleanup(); return; } #ifdef UNIX call_err = dlerror(); if (call_err != NULL) { sprintf(string, "could not find function '%s' in foreign library '%s': %s", funame, libname, call_err); if (opt_error) { error(sERROR, string); } else { strcpy(last_frnfn_call_error_text, string); } frnfn_cleanup(); return; } #endif ffi_call(&cif, FFI_FN(fu), &ffi_result, (void **)pvalues); if (type == fFRNFN_CALL) { *pvalue = frn_cast_from_ffi_type(&ffi_result, rtype); } else { if (!strcmp(rtypetxt, "string")) { if (opt_copy_string_result) *ppointer = my_strdup(ffi_result.ffipointer); else *ppointer = ffi_result.ffipointer; } else { sprintf(string, "frnbf:%d:%p", ffi_result.ffipointer ? -2 : -1, ffi_result.ffipointer); *ppointer = my_strdup(string); } } frnfn_cleanup(); last_frnfn_call_okay = 1; } double frnfn_size() /* return size of structure */ { ffi_type *valtype; if (!frn_decode_ffi_type(pop(stSTRING)->pointer, &valtype, NULL, ktSIMPLE)) return 0.0; return valtype->size; } char *frnbf_alloc() /* create a new foreign buffer */ { int size; void *buff; size = (int)pop(stNUMBER)->value; if (size < -1) { sprintf(estring, "size of buffer cannot be less than -1, not %d", size); error(sERROR, estring); return my_strdup(""); } else if (size == -1) { buff = NULL; } else { buff = my_malloc(size); memset(buff, 0, size); } sprintf(string, "frnbf:%d:%p", size, buff); return my_strdup(string); } void frnbf_free() /* free a foreign buffer */ { int size; void *ptr; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return; my_free(ptr); return; } int frnbf_size(void) /* get size of buffer */ { int size; char *ptr; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, (void **)&ptr)) return 0; return size; } char *frnbf_dump(int type) /* dump a foreign buffer into readable form */ { int size, ssize, psize; char *ptr; char *dump, *d; int i; if (type == fFRNBF_DUMP2) ssize = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &psize, (void **)&ptr)) return my_strdup(""); size = (type == fFRNBF_DUMP2) ? ssize : psize; if (size < 0) size = 0; d = dump = my_malloc(2 * size + 1); d[size] = d[0] = '\0'; for (i = 0; i < size; i++) { d += sprintf(d, "%02X", (unsigned char)ptr[i]); } return dump; } void frnbf_set() /* set a value within a foreign buffer */ { int size; void *ptr; double val; size_t offset; char *type; ffi_type *valtype; val = pop(stNUMBER)->value; type = pop(stSTRING)->pointer; offset = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return; if (!frn_decode_ffi_type(type, &valtype, NULL, ktSIMPLE)) return; if (!frnbf_verify_not_null(size)) return; if (offset < 0 || (size >= 0 && offset + valtype->size > size)) { sprintf(estring, "overrun: offset of %ld plus size of type %s = %lu exceeds size of " "buffer %d", offset, type, valtype->size, size); error(sERROR, estring); return; } frn_cast_to_ffi_type((void *)((char *)ptr + offset), valtype, val); return; } void frnbf_set2() /* set a string within a foreign buffer */ { int size; void *ptr; char *str; int slen; int offset; str = pop(stSTRING)->pointer; slen = strlen(str); offset = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return; if (!frnbf_verify_not_null(size)) return; if (offset < 0 || (size >= 0 && offset + slen > size)) { sprintf(estring, "overrun: offset of %d plus size of string = %d exceeds size of " "buffer %d", offset, slen, size); error(sERROR, estring); return; } strcpy((char *)ptr + offset, str); return; } void frnbf_set_buffer() /* set a buffer within a foreign buffer */ { int size1, size2; void *ptr1, *ptr2; size_t offset; ffi_type *bufftype; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size2, &ptr2)) return; offset = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size1, &ptr1)) return; frn_decode_ffi_type("buffer", &bufftype, NULL, ktCOMPLEX); if (!frnbf_verify_not_null(size1)) return; if (offset < 0 || (size1 >= 0 && offset + bufftype->size > size1)) { sprintf(estring, "overrun: offset of %ld plus size of pointer = %lu exceeds size of " "buffer %d", offset, bufftype->size, size1); error(sERROR, estring); return; } *((char **)((char *)ptr1 + offset)) = (size2 == -1) ? NULL : ((char *)ptr2); return; } double frnbf_get() /* get a value from a foreign buffer */ { int size; void *ptr; size_t offset; char *type; ffi_type *valtype; type = pop(stSTRING)->pointer; offset = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return 0.0; if (!frn_decode_ffi_type(type, &valtype, NULL, ktSIMPLE)) return 0.0; if (!frnbf_verify_not_null(size)) return 0.0; if (offset < 0 || (size >= 0 && offset + valtype->size > size)) { sprintf(estring, "overrun: offset of %ld plus size of type %s = %lu exceeds size of " "buffer %d", offset, type, valtype->size, size); error(sERROR, estring); return 0.0; } return frn_cast_from_ffi_type((void *)((char *)ptr + offset), valtype); } char *frnbf_get2() /* get a string from a foreign buffer */ { int size; void *ptr; int offset, len; len = (int)pop(stNUMBER)->value; offset = (int)pop(stNUMBER)->value; if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return my_strdup(""); if (!frnbf_verify_not_null(size)) return my_strdup(""); if (offset < 0 || (size >= 0 && offset + len > size)) { sprintf(estring, "overrun: offset of %d plus length of string %d exceeds size of " "buffer %d", offset, len, size); error(sERROR, estring); return my_strdup(""); } return my_strndup((void *)((char *)ptr + offset), len); } char *frnbf_get_buffer() /* get a second buffer from a foreign buffer */ { int size; void *ptr; char *ptrptr; int offset, len; offset = (int)pop(stNUMBER)->value; len = sizeof(void *); if (!frnbf_parse_handle(pop(stSTRING)->pointer, &size, &ptr)) return my_strdup(""); if (!frnbf_verify_not_null(size)) return my_strdup(""); if (offset < 0 || (size >= 0 && offset + len > size)) { sprintf(estring, "overrun: offset of %d plus length of string %d exceeds size of " "buffer %d", offset, len, size); error(sERROR, estring); return my_strdup(""); } ptrptr = *((char **)((char *)ptr + offset)); sprintf(string, "frnbf:%d:%p", ptrptr ? -2 : -1, ptrptr); return my_strdup(string); } static int frnbf_parse_handle(char *handle, int *size, void **ptr) /* parse handle */ { if (sscanf(handle, "frnbf:%d:%p", size, ptr) != 2) { sprintf(estring, "invalid handle for foreign buffer: '%s'", handle); error(sERROR, estring); return FALSE; } return TRUE; } static int frnbf_verify_not_null( int size) /* check if destination buffer size stands for a null-pointer and issue error message if appropriate */ { if (size == -1) { sprintf(estring, "size of -1 designates a null-pointer, which cannot be " "used as a source to get or a destination to set a value"); error(sERROR, estring); return FALSE; } return TRUE; } static int frnfn_parse_stack(void) /* verify and process arguments from yabasic stack into libffi structures */ { struct stackentry *st, *stfirst, *stfirstarg; static char stfound[50]; int listlen = -1; int i, j; char *opt_str; int opt_has_no; void *bufptr; int bufsize; /* In this dunction: go through list of arguments multiple times, check types * and transfer them to libffi structures */ /* count args on stack */ st = stackhead; do { st = st->prev; listlen++; } while (st->type != stFREE); /* set options to default values */ opt_error = TRUE; opt_copy_string_result = FALSE; opt_unload_library = FALSE; /* pop arguments here, because the function is declared to have zero args */ for (i = 0; i < listlen; i++) { pop(stSTRING_OR_NUMBER); } pop(stFREE); stfirst = st->next; if (listlen < 3) { sprintf(string, "need at least 3 arguments, not %d", listlen); error(sERROR, string); return FALSE; } /* check and retrieve first three arguments, libname, type and funame; they * are always present */ st = stfirst; for (i = 0; i < 3; i++) { if (st->type != stSTRING) { stackdesc(st->type, stfound); sprintf(string, "argument at position %d needs to be a string, not %s", i, stfound); error(sERROR, string); return FALSE; } if (i == 0) libname = st->pointer; if (i == 1 && !frn_decode_ffi_type(st->pointer, &rtype, &rtypetxt, ktANY)) return FALSE; if (i == 2) funame = st->pointer; st = st->next; } /* check arguments to external function (pairs type and value), check and * process options */ stfirstarg = st; argcnt = 0; for (i = 3; i < listlen - 1; i += 2, st = st->next->next) { if (st->type != stSTRING) { stackdesc(st->type, stfound); sprintf(string, "argument at position %d needs to be a string, not %s", i, stfound); error(sERROR, string); return FALSE; } /* after optional string "options", parse rest of arguments as options */ if (!strcmp(st->pointer, "options")) { st = st->next; i++; for (; i < listlen; i++, st = st->next) { if (st->type != stSTRING) { stackdesc(st->type, stfound); sprintf( string, "argument at position %d needs to be an option string, not %s", i, stfound); error(sERROR, string); return FALSE; } opt_str = st->pointer; opt_has_no = (strncmp(opt_str, "no_", 3) == 0); if (opt_has_no) opt_str += 3; if (!strcmp(opt_str, "error")) opt_error = !opt_has_no; else if (!strcmp(opt_str, "copy_string_result")) opt_copy_string_result = !opt_has_no; else if (!strcmp(opt_str, "unload_library")) opt_unload_library = !opt_has_no; else { sprintf(estring, "options can only be 'error', 'copy_string_result' and " "'unload_library', optionally preceded by 'no_', not '%s'", opt_str); error(sERROR, estring); } } break; } argcnt++; } /* allocate memory for ffi structures */ vtypes = (ffi_type **)my_malloc(argcnt * sizeof(void *)); vtypestxt = (char **)my_malloc(argcnt * sizeof(char *)); values = (union FFI_VAL *)my_malloc(argcnt * sizeof(union FFI_VAL)); pvalues = (union FFI_VAL **)my_malloc(argcnt * sizeof(void *)); /* sort arguments passed on stack into ffi structures */ st = stfirstarg; for (i = 3, j = 0; i < 3 + 2 * argcnt; i += 2, st = st->next->next, j++) { if (st->next->type == stSTRING) { if (!frn_decode_ffi_type(st->pointer, vtypes + j, vtypestxt + j, ktCOMPLEX)) return FALSE; if (!strcmp(vtypestxt[j], "string")) { values[j].ffipointer = (char *)st->next->pointer; } else { /* buffer */ if (!frnbf_parse_handle((char *)st->next->pointer, &bufsize, &bufptr)) return FALSE; if (bufsize == -1) { values[j].ffipointer = NULL; } else { values[j].ffipointer = bufptr; } } } else { if (!frn_decode_ffi_type(st->pointer, vtypes + j, vtypestxt + j, ktSIMPLE)) return FALSE; frn_cast_to_ffi_type(values + j, vtypes[j], st->next->value); } pvalues[j] = values + j; } return TRUE; } static int frn_decode_ffi_type( char *type_string, ffi_type **type_ptr, char **typetxt, int kind_of_type) /* decode ffi type given by first argument (string) into second argument (pointer to a ffi_type) and maybe produce error message */ { int i; int from, to; static char *ffi_types_string[NUM_FFI_TYPES] = { "uint8", "int8", "uint16", "int16", "uint32", "int32", "uint64", "int64", "float", "double", "char", "short", "int", "long", "buffer", "string"}; static ffi_type *ffi_types_ptr[NUM_FFI_TYPES]; static int ffi_types_ptr_initialized = FALSE; if (!ffi_types_ptr_initialized) { ffi_types_ptr[0] = &ffi_type_uint8; ffi_types_ptr[1] = &ffi_type_sint8; ffi_types_ptr[2] = &ffi_type_uint16; ffi_types_ptr[3] = &ffi_type_sint16; ffi_types_ptr[4] = &ffi_type_uint32; ffi_types_ptr[5] = &ffi_type_sint32; ffi_types_ptr[6] = &ffi_type_uint64; ffi_types_ptr[7] = &ffi_type_sint64; ffi_types_ptr[8] = &ffi_type_float; ffi_types_ptr[9] = &ffi_type_double; ffi_types_ptr[10] = &ffi_type_schar; ffi_types_ptr[11] = &ffi_type_sshort; ffi_types_ptr[12] = &ffi_type_sint; ffi_types_ptr[13] = &ffi_type_slong; ffi_types_ptr[14] = &ffi_type_pointer; ffi_types_ptr[15] = &ffi_type_pointer; ffi_types_ptr_initialized = TRUE; } switch (kind_of_type) { case ktSIMPLE: from = 0; to = NUM_FFI_TYPES - 3; break; case ktCOMPLEX: from = NUM_FFI_TYPES - 2; to = NUM_FFI_TYPES - 1; break; case ktANY: from = 0; to = NUM_FFI_TYPES - 1; break; } for (i = from; i <= to; i++) { if (!strcmp(type_string, ffi_types_string[i])) { *type_ptr = ffi_types_ptr[i]; if (typetxt) *typetxt = ffi_types_string[i]; return TRUE; } } sprintf(string, "invalid type specification '%s', needs to be one of: ", type_string); for (i = from; i <= to; i++) { strcat(string, ffi_types_string[i]); strcat(string, ","); } string[strlen(string) - 1] = '\0'; error(sERROR, string); return FALSE; } static void frn_cast_to_ffi_type(union FFI_VAL *value, ffi_type *type, double num) /* cast and assign double value from yabasic into specified (numeric) ffi_type */ { if (type == &ffi_type_uint8) (*value).ffiuint8 = (uint8_t)num; if (type == &ffi_type_uint8) (*value).ffiuint8 = (uint8_t)num; if (type == &ffi_type_sint8) (*value).ffisint8 = (int8_t)num; if (type == &ffi_type_uint16) (*value).ffiuint16 = (uint16_t)num; if (type == &ffi_type_sint16) (*value).ffisint16 = (int16_t)num; if (type == &ffi_type_uint32) (*value).ffiuint32 = (uint32_t)num; if (type == &ffi_type_sint32) (*value).ffisint32 = (int32_t)num; if (type == &ffi_type_uint64) (*value).ffiuint64 = (uint64_t)num; if (type == &ffi_type_sint64) (*value).ffisint64 = (int64_t)num; if (type == &ffi_type_float) (*value).ffifloat = (float)num; if (type == &ffi_type_double) (*value).ffidouble = (double)num; if (type == &ffi_type_schar) (*value).ffischar = (char)num; if (type == &ffi_type_sshort) (*value).ffisshort = (short)num; if (type == &ffi_type_sint) (*value).ffisint = (int)num; if (type == &ffi_type_slong) (*value).ffislong = (long)num; } static double frn_cast_from_ffi_type( union FFI_VAL *value, ffi_type *type) /* cast and return value from ffi_type to double */ { if (type == &ffi_type_uint8) return (double)(*value).ffiuint8; if (type == &ffi_type_uint8) return (double)(*value).ffiuint8; if (type == &ffi_type_sint8) return (double)(*value).ffisint8; if (type == &ffi_type_uint16) return (double)(*value).ffiuint16; if (type == &ffi_type_sint16) return (double)(*value).ffisint16; if (type == &ffi_type_uint32) return (double)(*value).ffiuint32; if (type == &ffi_type_sint32) return (double)(*value).ffisint32; if (type == &ffi_type_uint64) return (double)(*value).ffiuint64; if (type == &ffi_type_sint64) return (double)(*value).ffisint64; if (type == &ffi_type_float) return (double)(*value).ffifloat; if (type == &ffi_type_double) return (double)(*value).ffidouble; if (type == &ffi_type_schar) return (double)(*value).ffischar; if (type == &ffi_type_sshort) return (double)(*value).ffisshort; if (type == &ffi_type_sint) return (double)(*value).ffisint; if (type == &ffi_type_slong) return (double)(*value).ffislong; error(sFATAL, "internal error, unknown type"); return 0.0; } static void frnfn_cleanup(void) /* free and cleanup structures after use */ { if (lib) { if (opt_unload_library) { #ifdef UNIX dlclose(lib); #else FreeLibrary(lib); #endif } lib = NULL; } if (vtypes) { my_free(vtypes); vtypes = NULL; } if (vtypestxt) { my_free(vtypestxt); vtypestxt = NULL; } if (values) { my_free(values); values = NULL; } if (pvalues) { my_free(pvalues); pvalues = NULL; } } #endif /* USE_DL_FFI */ yabasic-2.91.4/function.c0000777000175000017500000015557515055042702010725 /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de function.c -- code for functions This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ /* ------------- includes ---------------- */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* all prototypes and structures */ #endif #ifndef UINT64_MAX #include #endif /* ------------- external references ---------------- */ extern int mylineno; /* current line number */ extern int yyparse(); /* call bison parser */ /* ------------- local functions ---------------- */ static char *fromto(char *, int, int); /* get portion of string (mid$ et al) */ static void clear_buff(); /* clear system-input buffers */ static void store_buff(char *, int); /* store system-input buffer */ static int do_glob(char *, char *); /* actually do the globbing */ static double other2dec(char *, int); /* convert hex to decimal */ static char *dec2other(double, int); /* convert decimal to hex */ static double peek(char *); /* peek into internals */ static char *peek2(char *, struct command *); /* peek into internals */ static char *peek3(char *, char *); /* peek into internals */ static int peekfile(int); /* read a byte from stream */ static int do_system( char *); /* hand over execution of command to system, return exit code */ static char *do_system2(char *); /* hand over execution of command to system, return output as string */ static double myrand(void); /* generate random number in given range */ static char *recall_buff(void); /* recall store buffer */ /* ------------- global variables ---------------- */ struct command *lastdata = NULL; /* used to associate all data-commands with each others */ static struct buff_chain *buffroot; /* start of sys-input buffer */ static struct buff_chain **buffcurr; /* current entry in buff_chain */ static int buffcount; /* number of filled buffers */ char *last_inkey; /* last result of inkey$ */ /* ------------- subroutines ---------------- */ void token(struct command *cmd) /* extract token from variable */ { int split; struct stackentry *s; struct symbol *sym; struct array *ar; int num = 0, i; char *p, *q; char **pp; char *del, *line; int wasdel, isdel; if (cmd->type == cSPLIT2 || cmd->type == cTOKEN2) { del = pop(stSTRING)->pointer; } else { del = " \t"; } split = (cmd->type == cSPLIT || cmd->type == cSPLIT2); s = pop(stSTRINGARRAYREF); line = pop(stSTRING)->pointer; sym = get_sym(s->pointer, syARRAY, amSEARCH); if (!sym || !sym->pointer) { sprintf(string, "array '%s()' is not defined", strip(s->pointer)); error(sERROR, string); goto token_done; } ar = sym->pointer; if (ar->dimension > 1) { error(sERROR, "only one dimensional arrays allowed"); goto token_done; } /* count number of tokens */ isdel = TRUE; if (split && *line) { num = 1; } else { num = 0; } for (p = line; *p; ++p) { wasdel = isdel; isdel = (strchr(del, *p) != NULL); if (split) { if (isdel) { num++; } } else { if (isdel && isdel != wasdel) { num++; } } } if (!split && !isdel) { num++; } /* free previous array content */ for (i = 0; i < ar->bounds[0]; i++) { free(((char **)ar->pointer)[i]); } free(ar->pointer); ar->pointer = my_malloc((num + 1) * sizeof(char *)); pp = ar->pointer; pp[0] = my_strdup(""); /* extract tokens */ i = 1; isdel = TRUE; if (*line) { for (p = q = line;; p++) { wasdel = isdel; isdel = (strchr(del, *p) != NULL) || !*p; if ((split && isdel) || (!split && (isdel && isdel != wasdel))) { while (strchr(del, *q) && q < p) { q++; } pp[i] = my_strndup(q, p - q + 1); pp[i][p - q] = '\0'; q = p + 1; i++; } if (!*p) { break; } } } ar->bounds[0] = num + 1; token_done: s = push(); s->type = stNUMBER; s->value = num; } void tokenalt(struct command *cmd) /* extract token from variable with alternate semantics */ { char *del; /* delimiter for strings */ struct stackentry *t; char *old, *new, *tok; int split; if (cmd->type == cSPLITALT2 || cmd->type == cTOKENALT2) { del = pop(stSTRING)->pointer; } else { del = " \t"; } split = (cmd->type == cSPLITALT || cmd->type == cSPLITALT2); t = pop(stSTRING); old = t->pointer; t->pointer = NULL; /* prevent push from freeing the memory */ t = push(); t->type = stSTRING; new = old; tok = NULL; while (*new) { if (!tok && (!strchr(del, *new) || split)) { tok = new; /* found start of token */ } if (tok && strchr(del, *new)) { break; /* found end of token */ } new ++; } if (*new) { *new = '\0'; /* terminate token */ new ++; if (!split) { while (*new) { if (!strchr(del, *new)) { break; /* found start of next token */ } new ++; } } } t->pointer = my_strdup(tok ? tok : ""); /* copy token */ /* move rest of string */ while (*new) { *old = *new; old++; new ++; }; *old = '\0'; } void glob(void) /* check, if pattern globs string */ { char *str, *pat; struct stackentry *stack; int res; pat = (char *)pop(stSTRING)->pointer; str = (char *)pop(stSTRING)->pointer; res = do_glob(str, pat); stack = push(); stack->value = res; stack->type = stNUMBER; } static int do_glob(char *str, char *pat) /* actually do the globbing */ { int res; if (severity_threshold <= sDEBUG) { sprintf(string, "globbing '%s' on '%s'", str, pat); error(sDEBUG, string); } if (*pat == '\0' && *str == '\0') { return TRUE; } else if (*pat == '\0') { return FALSE; } else if (*pat == '?' && *str == '\0') { return FALSE; } else if (*pat == '?') { if (*str == '\0') { return FALSE; } pat++; str++; } else if (*pat == '*') { pat++; res = FALSE; while (*str && !(res = do_glob(str, pat))) { str++; } if (res) { return TRUE; } } else if (*str == '\0') { return FALSE; } else { while (*pat && *pat != '?' && *pat != '*') { if (*pat != *str) { return FALSE; } str++; pat++; } } return do_glob(str, pat); } void concat() /* concatenates two strings from stack */ { struct stackentry *c; char *aa, *bb, *cc; aa = pop(stSTRING)->pointer; bb = pop(stSTRING)->pointer; cc = (char *)my_malloc(sizeof(char) * (strlen(aa) + strlen(bb) + 1)); strcpy(cc, bb); strcat(cc, aa); c = push(); c->type = stSTRING; c->pointer = cc; } void create_changestring(int type) /* create command 'changestring' */ { struct command *cmd; cmd = add_command(cCHANGESTRING); cmd->args = type; } void changestring(struct command *cmd) /* changes a string */ { int type, a2, a3; char *newpart; char *oldstring; int i, len; struct stackentry *a1; type = cmd->args; newpart = pop(stSTRING)->pointer; if (type > fTWOARGS) { a3 = (int)pop(stNUMBER)->value; } if (type > fONEARGS) { a2 = (int)pop(stNUMBER)->value; } a1 = pop(stSTRING); oldstring = a1->pointer; a1->pointer = NULL; /* this prevents push from freeing the memory */ if (!oldstring || !*oldstring) { return; } switch (type) { case fMID: for (i = 1; i < a2 + a3; i++) { if (!oldstring[i - 1]) { break; } if (i >= a2) { if (!newpart[i - a2]) { break; } oldstring[i - 1] = newpart[i - a2]; } } break; case fMID2: len = strlen(oldstring); for (i = 1; i <= len; i++) { if (!oldstring[i - 1]) { break; } if (i >= a2) { if (!newpart[i - a2]) { break; } oldstring[i - 1] = newpart[i - a2]; } } break; case fLEFT: for (i = 1; i <= a2; i++) { if (!oldstring[i - 1] || !newpart[i - 1]) { break; } oldstring[i - 1] = newpart[i - 1]; } break; case fRIGHT: len = strlen(oldstring); for (i = 1; i <= len; i++) { if (i > len - a2) { if (!newpart[i - 1 - len + a2]) { break; } oldstring[i - 1] = newpart[i - 1 - len + a2]; } } break; } } void create_function(int type) /* create command 'function' */ /* type can be sin,cos,mid$ ... */ { struct command *cmd; cmd = add_command(cFUNCTION); if (severity_threshold <= sDEBUG) { sprintf(estring, "function '%s'", fexplanation[type]); error(sDEBUG, estring); } cmd->args = type; } void function(struct command *cmd) /* performs a function */ { struct stackentry *stack, *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL; char *pointer; double value; time_t datetime; int type, result, len, start, i, j, k, max, cnt; char *str, *str2; type = cmd->args; if (type > fTHREEARGS) { a4 = pop(stSTRING_OR_NUMBER); } if (type > fTWOARGS) { a3 = pop(stSTRING_OR_NUMBER); } if (type > fONEARGS) { a2 = pop(stSTRING_OR_NUMBER); } if (type > fZEROARGS) { a1 = pop(stSTRING_OR_NUMBER); } if (severity_threshold <= sDEBUG) { sprintf(estring, "function '%s'", fexplanation[type]); error(sDEBUG, estring); } switch (type) { case fSIN: value = sin(a1->value); result = stNUMBER; break; case fASIN: value = asin(a1->value); result = stNUMBER; break; case fCOS: value = cos(a1->value); result = stNUMBER; break; case fACOS: value = acos(a1->value); result = stNUMBER; break; case fTAN: value = tan(a1->value); result = stNUMBER; break; case fATAN: value = atan(a1->value); result = stNUMBER; break; case fEXP: value = exp(a1->value); result = stNUMBER; break; case fLOG: value = log(a1->value); result = stNUMBER; break; case fLOG2: value = log(a1->value) / log(a2->value); result = stNUMBER; break; case fLEN: value = (double)strlen(a1->pointer); result = stNUMBER; break; case fSTR: sprintf(string, "%g", a1->value); pointer = my_strdup(string); result = stSTRING; break; case fSTR2: case fSTR3: result = stSTRING; if (!myformat(string, INBUFFLEN, a1->value, a2->pointer, a3 ? a3->pointer : NULL)) { pointer = my_strdup(""); break; } pointer = my_strdup(string); break; case fSTR4: result = stSTRING; pointer = my_strdup(a1->pointer); case fCHOMP: result = stSTRING; pointer = a1->pointer; a1->pointer = NULL; pointer[strcspn(pointer, "\r\n")] = 0; break; case fSQRT: value = sqrt(a1->value); result = stNUMBER; break; case fSQR: value = a1->value * a1->value; result = stNUMBER; break; case fINT: if (a1->value < 0) { value = -floor(-a1->value); } else { value = floor(a1->value); } result = stNUMBER; break; case fCEIL: value = ceil(a1->value); result = stNUMBER; break; case fFLOOR: value = floor(a1->value); result = stNUMBER; break; case fROUND: value = round(a1->value); result = stNUMBER; break; case fFRAC: if (a1->value < 0) { value = a1->value + floor(-a1->value); } else { value = a1->value - floor(a1->value); } result = stNUMBER; break; case fABS: value = fabs(a1->value); result = stNUMBER; break; case fSIG: if (a1->value < 0) { value = -1.; } else if (a1->value > 0) { value = 1.; } else { value = 0.; } result = stNUMBER; break; case fMOD: value = a1->value - a2->value * (int)(a1->value / a2->value); result = stNUMBER; break; case fRAN: value = a1->value * myrand(); result = stNUMBER; break; case fRAN2: value = myrand(); result = stNUMBER; break; case fMIN: if (a1->value > a2->value) { value = a2->value; } else { value = a1->value; } result = stNUMBER; break; case fMAX: if (a1->value > a2->value) { value = a1->value; } else { value = a2->value; } result = stNUMBER; break; case fVAL: i = sscanf((char *)a1->pointer, "%lf", &value); if (i != 1) { value = 0; } result = stNUMBER; break; case fATAN2: value = atan2(a1->value, a2->value); result = stNUMBER; break; case fLEFT: str = a1->pointer; len = (int)a2->value; pointer = fromto(str, 0, len - 1); result = stSTRING; break; case fRIGHT: str = a1->pointer; max = strlen(str); len = (int)a2->value; pointer = fromto(str, max - len, max - 1); result = stSTRING; break; case fMID: str = a1->pointer; start = (int)a2->value; len = (int)a3->value; pointer = fromto(str, start - 1, start + len - 2); result = stSTRING; break; case fMID2: str = a1->pointer; start = (int)a2->value; pointer = fromto(str, start - 1, strlen(str)); result = stSTRING; break; case fINKEY: pointer = inkey(a1->value); strcpy(last_inkey, pointer); result = stSTRING; break; case fAND: value = (unsigned int)a1->value & (unsigned int)a2->value; result = stNUMBER; break; case fOR: value = (unsigned int)a1->value | (unsigned int)a2->value; result = stNUMBER; break; case fEOR: value = (unsigned int)a1->value ^ (unsigned int)a2->value; result = stNUMBER; break; case fBITNOT: value = ~(unsigned int)a1->value; result = stNUMBER; break; case fSHL: value = (unsigned int)a1->value << (int)a2->value; result = stNUMBER; break; case fSHR: value = (unsigned int)a1->value >> (int)a2->value; result = stNUMBER; break; case fMOUSEX: getmousexybm(a1->pointer, &i, NULL, NULL, NULL); value = i; result = stNUMBER; break; case fMOUSEY: getmousexybm(a1->pointer, NULL, &i, NULL, NULL); value = i; result = stNUMBER; break; case fMOUSEB: getmousexybm(a1->pointer, NULL, NULL, &i, NULL); value = i; result = stNUMBER; break; case fMOUSEMOD: getmousexybm(a1->pointer, NULL, NULL, NULL, &i); value = i; result = stNUMBER; break; case fCHR: pointer = my_malloc(2); i = (int)floor(a1->value); if (i > 255 || i < 0) { sprintf(estring, "can't convert %g to character", a1->value); error(sERROR, estring); return; } pointer[1] = '\0'; pointer[0] = (unsigned char)i; result = stSTRING; break; case fASC: value = ((unsigned char *)a1->pointer)[0]; result = stNUMBER; break; case fBIN: pointer = dec2other(a1->value, 2); result = stSTRING; break; case fHEX: pointer = dec2other(a1->value, 16); result = stSTRING; break; case fDEC: value = other2dec(a1->pointer, 16); result = stNUMBER; break; case fDEC2: value = other2dec(a1->pointer, (int)(a2->value)); result = stNUMBER; break; case fUPPER: str = a1->pointer; pointer = my_malloc(strlen(str) + 1); i = -1; do { i++; pointer[i] = toupper((int)str[i]); } while (pointer[i]); result = stSTRING; break; case fLOWER: str = a1->pointer; pointer = my_malloc(strlen(str) + 1); i = -1; do { i++; pointer[i] = tolower((int)str[i]); } while (pointer[i]); result = stSTRING; break; case fLTRIM: str = a1->pointer; while (isspace(*str)) { str++; } pointer = my_strdup(str); result = stSTRING; break; case fRTRIM: str = a1->pointer; i = strlen(str) - 1; while (isspace(str[i]) && i >= 0) { i--; } str[i + 1] = '\0'; pointer = my_strdup(str); result = stSTRING; break; case fTRIM: str = a1->pointer; i = strlen(str) - 1; while (isspace(str[i]) && i >= 0) { i--; } str[i + 1] = '\0'; while (isspace(*str)) { str++; } pointer = my_strdup(str); result = stSTRING; break; case fSTRING: cnt = (int)a1->value; if (cnt < 0) { sprintf(estring, "first argument to function 'string$' must be > 0, but found %d", cnt); error(sERROR, estring); return; } str = a2->pointer; len = strlen(str); pointer = my_malloc(cnt * strlen(str) * sizeof(char *) + 1); k = 0; for (i = 0; i < cnt; i++) { for (j = 0; j < len; j++) { pointer[k++] = str[j]; } } pointer[k] = '\0'; result = stSTRING; break; case fINSTR: str = a1->pointer; str2 = a2->pointer; if (*str2) { pointer = strstr(str, str2); } else { pointer = NULL; } if (pointer == NULL) { value = 0; } else { value = pointer - str + 1; } result = stNUMBER; break; case fINSTR2: str = a1->pointer; str2 = a2->pointer; start = (int)a3->value; if (start > (int)strlen(str)) { value = 0; } else { if (start < 1) { start = 1; } pointer = strstr(str + start - 1, str2); if (pointer == NULL) { value = 0; } else { value = pointer - str + 1; } } result = stNUMBER; break; case fRINSTR: str = a1->pointer; str2 = a2->pointer; len = strlen(str2); for (i = strlen(str) - 1; i >= 0; i--) if (!strncmp(str + i, str2, len)) { break; } value = i + 1; result = stNUMBER; break; case fRINSTR2: str = a1->pointer; str2 = a2->pointer; len = strlen(str2); start = (int)a3->value; if (start < 1) { value = 0; } else { if (start > (int)strlen(str)) { start = strlen(str); } for (i = start - 1; i >= 0; i--) if (!strncmp(str + i, str2, len)) { break; } value = i + 1; } result = stNUMBER; break; case fDATE: pointer = my_malloc(100); time(&datetime); strftime(pointer, 100, "%w-%m-%d-%Y-%a-%b", localtime(&datetime)); result = stSTRING; break; case fTIME: pointer = my_malloc(100); time(&datetime); strftime(pointer, 100, "%H-%M-%S", localtime(&datetime)); sprintf(pointer + strlen(pointer), "-%d", (int)((current_millis() - compilation_start) / 1000)); result = stSTRING; break; case fSYSTEM: str = a1->pointer; value = do_system(str); result = stNUMBER; break; case fSYSTEM2: str = a1->pointer; pointer = do_system2(str); result = stSTRING; break; case fFRNFN_CALL: frnfn_call(type, &value, &pointer); result = stNUMBER; break; case fFRNFN_CALL2: frnfn_call(type, &value, &pointer); result = stSTRING; break; case fFRNBF_ALLOC: pointer = frnbf_alloc(); result = stSTRING; break; case fFRNBF_SIZE: value = frnbf_size(); result = stNUMBER; break; case fFRNBF_DUMP: case fFRNBF_DUMP2: pointer = frnbf_dump(type); result = stSTRING; break; case fFRNFN_SIZE: value = frnfn_size(); result = stNUMBER; break; case fFRNBF_GET_NUMBER: value = frnbf_get(); result = stNUMBER; break; case fFRNBF_GET_STRING: pointer = frnbf_get2(); result = stSTRING; break; case fFRNBF_GET_BUFFER: pointer = frnbf_get_buffer(); result = stSTRING; break; case fPEEK: str = a1->pointer; value = peek(str); result = stNUMBER; break; case fPEEK2: str = a1->pointer; pointer = peek2(str, currcmd); result = stSTRING; break; case fPEEK3: str = a1->pointer; str2 = a2->pointer; pointer = peek3(str, str2); result = stSTRING; break; case fPEEK4: value = peekfile((int)a1->value); result = stNUMBER; break; case fGETBIT: pointer = getbit((int)a1->value, (int)a2->value, (int)a3->value, (int)a4->value); result = stSTRING; break; case fGETCHAR: pointer = getchars((int)a1->value, (int)a2->value, (int)a3->value, (int)a4->value); result = stSTRING; break; case fTELL: i = (int)(a1->value); if (badstream(i, 0)) { return; } if (!(stream_modes[i] & (mREAD | mWRITE))) { sprintf(string, "stream %d not opened", i); error(sERROR, string); value = 0; } else { value = ftell(streams[i]); } result = stNUMBER; break; default: error(sERROR, "function called but not implemented"); return; } stack = push(); /* copy result */ stack->type = result; if (result == stSTRING) { stack->pointer = pointer; } else { stack->value = value; } } static int do_system( char *cmd) /* hand over execution of command to system, return exit code */ { #ifdef UNIX int ret; if (con_xcap_inized) { reset_shell_mode(); putp(exit_ca_mode); } ret = system(cmd); if (con_xcap_inized) { if (tcsetpgrp(STDIN_FILENO, getpgid(getpid()))) { sprintf(string, "could not get control of terminal: %s", my_strerror(errno)); error(sERROR, string); return ret; } putp(enter_ca_mode); reset_prog_mode(); } return ret; #else STARTUPINFO start; PROCESS_INFORMATION proc; DWORD ec; /* exit code */ SECURITY_ATTRIBUTES prosec; SECURITY_ATTRIBUTES thrsec; char *comspec; ZeroMemory(&prosec, sizeof(prosec)); prosec.nLength = sizeof(prosec); prosec.bInheritHandle = TRUE; ZeroMemory(&thrsec, sizeof(thrsec)); thrsec.nLength = sizeof(thrsec); thrsec.bInheritHandle = TRUE; ZeroMemory(&start, sizeof(start)); start.cb = sizeof(STARTUPINFO); start.dwFlags = STARTF_USESTDHANDLES; start.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); start.hStdError = GetStdHandle(STD_ERROR_HANDLE); start.hStdInput = GetStdHandle(STD_INPUT_HANDLE); comspec = getenv("COMSPEC"); if (!comspec) { comspec = "command.com"; } sprintf(string, "%s /C %s", comspec, cmd); if (!CreateProcess(NULL, string, &prosec, &thrsec, TRUE, 0, NULL, NULL, &start, &proc)) { sprintf(string, "couldn't execute '%s'", cmd); error(sERROR, string); return -1; } WaitForSingleObject(proc.hProcess, INFINITE); if (!GetExitCodeProcess(proc.hProcess, &ec)) { ec = -1; } CloseHandle(proc.hProcess); CloseHandle(proc.hThread); return ec; #endif } static double myrand(void) { long ran; ran = (((long)rand()) & 0x7fffL) << 15 | ((long)rand() & 0x7fffL); return ((double)ran) / ((double)0x3fffffffL); } static void clear_buff() /* clear system-input buffers */ { buffcurr = &buffroot; buffcount = 0; } static void store_buff(char *buff, int len) /* store system-input buffer */ { *buffcurr = my_malloc(sizeof(struct buff_chain)); memcpy((*buffcurr)->buff, buff, PIPEBUFFLEN + 1); (*buffcurr)->len = len; (*buffcurr)->next = NULL; buffcurr = &((*buffcurr)->next); buffcount++; } static char *recall_buff(void) /* recall store buffer */ { struct buff_chain *curr, *old; char *result; int done, len; result = (char *)my_malloc(buffcount * (PIPEBUFFLEN + 1)); curr = buffroot; len = 0; for (done = 0; done < buffcount && curr; done++) { memcpy(result + len, curr->buff, PIPEBUFFLEN); len += curr->len; old = curr; curr = curr->next; my_free(old); } return result; } static char *do_system2(char *cmd) /* hand over execution of command to system, return output as string */ { static char buff[PIPEBUFFLEN + 1]; /* buffer to store command */ int len; /* number of bytes read */ #ifdef UNIX FILE *p; /* points to pipe */ int c; /* char read from pipe */ #else int ret; STARTUPINFO start; PROCESS_INFORMATION proc; HANDLE piperead, pipewrite; /* both ends of pipes */ SECURITY_ATTRIBUTES prosec; SECURITY_ATTRIBUTES thrsec; char *comspec; #endif clear_buff(); #ifdef UNIX p = popen(cmd, "r"); if (p == NULL) { sprintf(string, "couldn't execute '%s'", cmd); error(sERROR, string); return my_strdup(""); } do { len = 0; while (len < PIPEBUFFLEN) { c = fgetc(p); if (c == EOF) { buff[len] = '\0'; break; } buff[len] = c; len++; } store_buff(buff, len); } while (c != EOF); pclose(p); #else ZeroMemory(&prosec, sizeof(prosec)); prosec.nLength = sizeof(prosec); prosec.bInheritHandle = TRUE; ZeroMemory(&thrsec, sizeof(thrsec)); thrsec.nLength = sizeof(thrsec); thrsec.bInheritHandle = TRUE; /* create pipe for writing */ CreatePipe(&piperead, &pipewrite, &prosec, 0); ZeroMemory(&start, sizeof(start)); start.cb = sizeof(STARTUPINFO); start.dwFlags = STARTF_USESTDHANDLES; start.hStdOutput = pipewrite; start.hStdError = pipewrite; start.hStdInput = GetStdHandle(STD_INPUT_HANDLE); comspec = getenv("COMSPEC"); if (!comspec) { comspec = "command.com"; } sprintf(string, "%s /C %s", comspec, cmd); if (!CreateProcess(NULL, string, &prosec, &thrsec, TRUE, 0, NULL, NULL, &start, &proc)) { sprintf(string, "couldn't execute '%s'", cmd); error(sERROR, string); return my_strdup(""); } CloseHandle(pipewrite); do { /* wait for output to arrive */ if (!ReadFile(piperead, buff, PIPEBUFFLEN, (LPDWORD)&len, NULL)) { ret = GetLastError(); } else { ret = 0; } buff[len] = '\0'; if (len > 0) { store_buff(buff, len); } } while (ret != ERROR_BROKEN_PIPE && ret != ERROR_HANDLE_EOF); CloseHandle(piperead); CloseHandle(proc.hProcess); CloseHandle(proc.hThread); #endif return recall_buff(); } void getmousexybm(char *s, int *px, int *py, int *pb, int *pm) /* get mouse coordinates */ { int x = 0, y = 0, b = 0, m = 0; char c; if (!*s) s = last_inkey; if (*s) { sscanf(s, "MB%d%c+%d:%04d,%04d", &b, &c, &m, &x, &y); if (px) { *px = x; } if (py) { *py = y; } if (pb) { if (c == 'd') { *pb = b; } else { *pb = -b; } } if (pm) { *pm = m; } return; } if (px) { *px = mousex; } if (py) { *py = mousey; } if (pb) { *pb = mouseb; } if (pm) { *pm = mousemod; } } static char *dec2other(double d, int base) /* convert double to hex or binary number */ { int len; double dec, dec2; char *other; int negative = FALSE; if (d < 0) { dec2 = floor(-d); negative = TRUE; } else { dec2 = floor(d); } len = negative ? 2 : 1; for (dec = dec2; dec >= base; dec /= base) { len++; } other = my_malloc(len + 1); other[len] = '\0'; dec = dec2; for (len--; len >= 0; len--) { other[len] = "0123456789abcdef"[(int)(floor(dec - base * floor(dec / base) + 0.5))]; dec = floor(dec / base); } if (negative) { other[0] = '-'; } return other; } static double other2dec(char *hex, int base) /* convert hex or binary to double number */ { double dec; static char *digits = "0123456789abcdef"; char *found; int i, len; if (base != 2 && base != 16) { sprintf(string, "Cannot convert base-%d numbers", base); error(sERROR, string); return 0.; } dec = 0; len = strlen(hex); for (i = 0; i < len; i++) { dec *= base; found = strchr(digits, tolower(hex[i])); if (!found || found - digits >= base) { sprintf(string, "Not a base-%d number: '%s'", base, hex); error(sERROR, string); return 0.; } dec += found - digits; } return dec; } int myformat(char *dest, int max, double num, char *format, char *sep) /* format number according to string */ { int ret = myformat2(dest, max, num, format, sep); if (ret == 0) return TRUE; if (ret == 1) sprintf(estring, "'%s' is not a valid format", format); if (ret == 2) sprintf(estring, "length of formatted string exceeds maximum of %d bytes", INBUFFLEN); error(sERROR, estring); return FALSE; } int myformat2(char *dest, int max, double num, char *format, char *sep) /* do the work for myformat */ { static char *ctrl = "+- #0"; /* allowed control chars for c-format */ char formchar; char *found, *form; int pre, post, len, nread, digit, commas, dots, i, cr; int neg = FALSE; double ipdbl, fp, round; /* type from stdint.h, because long int is 32 bits only on windows */ uint64_t ip; static char *digits = "0123456789"; form = format; if (*form == '%') { /* c-style format */ form++; while ((found = strchr(ctrl, *form)) != NULL) form++; if (sscanf(form, "%*u.%*u%c%n", &formchar, &nread) != 1 && sscanf(form, "%*u.%c%n", &formchar, &nread) != 1 && sscanf(form, ".%*u%c%n", &formchar, &nread) != 1 && sscanf(form, "%*u%c%n", &formchar, &nread) != 1 && sscanf(form, "%c%n", &formchar, &nread) != 1) { return 1; } if (!strchr("feEgG", formchar) || form[nread]) { return 1; } /* seems okay, let's try to print */ len = snprintf(dest, max, format, num); if (len >= max) { return 2; } } else { /* basic-style format */ /* make num positive and remember if it has been negative initially */ if (num < 0) { neg = TRUE; num = fabs(num); } /* verify form of ##.###.###,## (e.g.) up front to be able to rely on this; also count various parts */ commas = 0; dots = 0; pre = 0; post = 0; for (form = format; *form; form++) { if (*form == ',') { if (dots) { /* commas in fractional part are not supported */ return 1; } commas++; } else if (*form == '.') { if (dots) { /* format has more than one decimal dot */ return 1; } dots++; } else if (*form == '#') { if (dots) { post++; } else { pre++; } } else { /* neither '#' nor '.' nor ',' */ return 1; } } /* prepare destination */ len = strlen(format); dest[len] = '\0'; /* round to given precision; round away from zero */ round = 0.5; for (i = 0; i < post; i++) { round /= 10.; } /* if number is below round offset, treat it as zero */ if (num < round) { neg = FALSE; num = 0.0; } else { /* do the rounding away from zero */ num += round; } /* because we cast to long we cannot cope with numbers larger than its max */ /* not casting to long on the other hand leads to frequent arithmetic errors */ if (num > UINT64_MAX) { strcpy(dest, format); return 0; } /* disassemble in integer and fractional part; both ip and fp will be * consumed stepwise in the process */ fp = modf(num, &ipdbl); ip = (uint64_t)ipdbl; /* variable cr serves as our cursor running from right to left and marks the * position to be written next */ /* write integer part */ cr = pre + commas - 1; do { if (format[cr] == '#') { /* get digit and reduce integer part */ digit = ip % 10; ip = ip / 10; dest[cr--] = digits[digit]; } else { /* format[cr] == ','; i.e. we do not need a new digit */ dest[cr--] = ip ? ',' : ' '; } } while (ip && cr >= 0); /* given format does not have enough room, this is an error; just copy * format into dest and return */ if ((neg && cr < 0) || ip) { strcpy(dest, format); return 0; } /* minus if appropriate */ if (neg) { dest[cr--] = '-'; } /* fill from cursor position back to start */ while (cr >= 0) { dest[cr--] = ' '; } /* cursor cr now runs from left to right */ /* do we need to write a fractional part ? */ cr = pre + commas; if (dots) { /* write decimal dot */ dest[cr++] = '.'; /* construct fractional part digit by digit */ while (cr < len) { /* remove integer part to avoid loss of precision */ fp = modf(fp, &ipdbl); fp *= 10; digit = ((unsigned long)fp) % 10; dest[cr++] = digits[digit]; } } else { /* no fractional part needed */ dest[cr++] = '\0'; } /* until now we used fixed separators ',' for thousands and '.' for decimal; but if user has given his own separators (e.g. german or swiss style) we need to correct this */ if (sep) { if (sep[0] && sep[1]) { for (i = 0; i < len; i++) { if (dest[i] == ',') { dest[i++] = sep[0]; } if (dest[i] == '.') { dest[i++] = sep[1]; } } } else { return 1; } } } return 0; } static char *fromto(char *str, int from, int to) /* gives back portion of string */ /* from and to can be in the range 1...strlen(str) */ { int len, i; char *part; len = strlen(str); if (from > to || to < 0 || from > len - 1) { /* give back empty string */ part = my_malloc(1); part[0] = '\0'; } else { if (from <= 0) { from = 0; } if (to >= len) { to = len - 1; } part = my_malloc(sizeof(char) * (to - from + 2)); /* characters and '/0' */ for (i = from; i <= to; i++) { part[i - from] = str[i]; /* copy */ } part[i - from] = '\0'; } return part; } void mywait(void) /* wait given number of seconds */ { double delay; #ifdef UNIX struct timeval tv; #else MSG msg; int timerid; #endif delay = pop(stNUMBER)->value; if (delay < 0) { delay = 0.; } #ifdef UNIX tv.tv_sec = (long)delay; tv.tv_usec = (delay - (long)delay) * 1000000; select(0, NULL, NULL, NULL, &tv); #else /* WINDOWS */ timerid = SetTimer(NULL, 0, (int)(delay * 1000), (TIMERPROC)NULL); GetMessage((LPMSG)&msg, NULL, WM_TIMER, WM_TIMER); KillTimer(NULL, timerid); #endif } void mybell(void) /* ring ascii bell */ { #ifdef UNIX printf("\007"); fflush(stdout); #else /* WINDOWS */ Beep(1000, 100); #endif } void create_poke(char flag) /* create Command 'cPOKE' */ { struct command *cmd; if (flag == 'S' || flag == 'D') { cmd = add_command(cPOKEFILE); } else { cmd = add_command(cPOKE); } cmd->tag = flag; } void poke(struct command *cmd) /* poke into internals */ { char *dest, *s, c; char *string_arg = NULL; double double_arg = 0; struct stackentry *stack; int count; if (cmd->tag == 's') { string_arg = pop(stSTRING)->pointer; } else { double_arg = pop(stNUMBER)->value; } dest = pop(stSTRING)->pointer; for (s = dest; *s; s++) { *s = tolower((int)*s); } if (!strcmp(dest, "fontheight") && !string_arg) { fontheight = (int)double_arg; #ifdef UNIX calc_psscale(); #endif } else if (!strcmp(dest, "font") && string_arg) { fontname = my_strdup(string_arg); } else if (!strcmp(dest, "dump") && string_arg) { dump_commands(string_arg); } else if (!strcmp(dest, "dump") && string_arg && !strcmp(string_arg, "symbols")) { dump_sym(); } else if (!strcmp(dest, "dump") && string_arg && (!strcmp(string_arg, "sub") || !strcmp(string_arg, "subs") || !strcmp(string_arg, "subroutine") || !strcmp(string_arg, "subroutines"))) { dump_sub(0); } else if (!strcmp(dest, "debug_internal") && string_arg) { if (!strcmp(string_arg, "x11_send_expose")) { x11_send_expose(); } else if (!strcmp(string_arg, "x11_note_on_receive_expose")) { x11_note_on_receive_expose = TRUE; } else { sprintf(estring, "invalid argument for poke 'debug_internal': '%s' ; allowed " "values are:\n" " x11_send_expose : send an artificial expose " "event to the open graphic window\n" " x11_note_on_receive_expose : make the redraw-coprocess " "output a note on\n" " receiving an x11 expose; infolevel must be set to 'note' " "at minimum;\n" " this needs to be issued before opening a window", string_arg); error(sERROR, estring); } } else if (!strcmp(dest, "console_foreground_intensity") || !strcmp(dest, "screen_foreground_intensity") || !strcmp(dest, "terminal_foreground_intensity")) { if (con_xcap_inized) { /* Remark: it is tempting to loosen the below restriction. However, doing this would open a can of bugs and missing implementation-details. E.g. currently we have no intensity in the result of getscreen$(), but we would need this, if intensity could be changed multiple times during program run. */ sprintf(estring, "console_foreground_intensity cannot be changed after " "'clear screen' has been called"); error(sERROR, estring); } else { if (!strcmp(string_arg, "legacy")) { con_fore_inten = cciLEGACY; } else if (!strcmp(string_arg, "bright")) { con_fore_inten = cciBRIGHT; } else if (!strcmp(string_arg, "normal")) { con_fore_inten = cciNORMAL; } } } else if (!strcmp(dest, "console_foreground_color") || !strcmp(dest, "screen_foreground_color") || !strcmp(dest, "terminal_foreground_color")) { if (con_xcap_inized) { /* Maybe see remark above for console_foreground_intensity */ sprintf(estring, "console_foreground_color cannot be changed after " "'clear screen' has been called"); error(sERROR, estring); } con_fore_col = name2yc(string_arg); if (con_fore_col < 0) { sprintf(estring, "unknown foreground colour: '%s'", string_arg); error(sERROR, estring); } } else if (!strcmp(dest, "console_background_color") || !strcmp(dest, "screen_background_color") || !strcmp(dest, "terminal_background_color")) { if (con_xcap_inized) { /* Maybe see remark above for console_foreground_intensity */ sprintf(estring, "console_background_color cannot be changed after " "'clear screen' has been called"); error(sERROR, estring); } con_back_col = name2yc(string_arg); if (con_back_col < 0) { sprintf(estring, "unknown background colour: '%s'", string_arg); error(sERROR, estring); } } else if (!strcmp(dest, "textalign") && string_arg) { if (!check_alignment(string_arg)) { return; } strncpy(text_align, string_arg, 2); } else if (!strcmp(dest, "windoworigin") && string_arg) { moveorigin(string_arg); } else if (!strcmp(dest, "infolevel") && string_arg) { c = tolower((int)*string_arg); switch (c) { case 'd': severity_threshold = sDEBUG; break; case 'n': severity_threshold = sNOTE; break; case 'w': severity_threshold = sWARNING; break; case 'e': severity_threshold = sERROR; break; case 'f': severity_threshold = sFATAL; break; default: sprintf(string, "invalid infolevel '%c'", c); error(sERROR, string); return; } if (severity_threshold <= sDEBUG) { sprintf(string, "switching infolevel to '%c'", c); error(sDEBUG, string); } } else if (!strcmp(dest, "stdout") && string_arg) { fputs(string_arg, stdout); } else if (!strcmp(dest, "random_seed") && !string_arg) { srand((unsigned int)double_arg); } else if (!strcmp(dest, "__assert_stack_size") && !string_arg) { count = -1; stack = stackhead; while (stack != stackroot) { count++; stack = stack->prev; } if (count != (int)double_arg) { sprintf(string, "assertion failed for number of entries on stack; expected = %d, " "actual = %d", (int)double_arg, count); error(sFATAL, string); } } else if (dest[0] == '#') { error(sERROR, "don't use quotes when poking into file"); } else { if (string_arg) { sprintf(string, "invalid poke: '%s', '%s'", dest, string_arg); } else { sprintf(string, "invalid poke: '%s', %g", dest, double_arg); } strncat(string, "; either the first argument is totally unknown (see the " "documentation of 'poke') or it expects a different type of second " "argument (string/number) than given", INBUFFLEN - 1 - strlen(string)); error(sERROR, string); } return; } void pokefile(struct command *cmd) /* poke into file */ { char *string_arg = NULL; double double_arg = 0; int stream; if (cmd->tag == 'S') { string_arg = pop(stSTRING)->pointer; } else { double_arg = pop(stNUMBER)->value; } stream = (int)(pop(stNUMBER)->value); if (badstream(stream, 0)) { return; } if (!(stream_modes[stream] & mWRITE)) { sprintf(string, "Stream %d not open for writing", stream); error(sERROR, string); return; } if (string_arg) { fputs(string_arg, streams[stream]); } else { if (double_arg < 0 || double_arg > 255) { error(sERROR, "stream poke out of byte range (0..255)"); return; } fputc((int)double_arg, streams[stream]); } } static double peek(char *dest) /* peek into internals */ { char *s; for (s = dest; *s; s++) { *s = tolower((int)*s); } if (!strcmp(dest, "winwidth")) { return winwidth; } else if (!strcmp(dest, "winheight")) { return winheight; } else if (!strcmp(dest, "fontheight")) { return fontheight; } else if (!strcmp(dest, "screenheight")) { return LINES; } else if (!strcmp(dest, "screenwidth")) { return COLS; } else if (!strcmp(dest, "displaywidth")) { if (displaywidth == 0) determine_display_size(); return displaywidth; } else if (!strcmp(dest, "displayheight")) { if (displayheight == 0) determine_display_size(); return displayheight; } else if (!strcmp(dest, "argument") || !strcmp(dest, "arguments")) { return yabargc; } else if (!strcmp(dest, "version")) { return strtod(VERSION, NULL); } else if (!strcmp(dest, "error")) { return errorcode; } else if (!strcmp(dest, "isbound")) { return is_bound; } else if (!strcmp(dest, "last_foreign_function_call_okay") || !strcmp(dest, "last_frnfn_call_okay")) { return (double)last_frnfn_call_okay; } else if (!strcmp(dest, "secondsrunning")) { return (double)((current_millis() - compilation_start) / 1000); } else if (!strcmp(dest, "millisrunning")) { return (double)(current_millis() - compilation_start); } else if (dest[0] == '#') { error(sERROR, "don't use quotes when peeking into a file"); return 0; } sprintf( string, "invalid peek: '%s'; see the documentation of 'peek' for accepted values", dest); error(sERROR, string); return 0; } static int peekfile(int s) /* read a byte from stream */ { if (s && badstream(s, 0)) { return 0; } if (s && !(stream_modes[s] & mREAD)) { sprintf(string, "stream %d not open for reading", s); error(sERROR, string); return 0; } return fgetc(s ? streams[s] : stdin); } static char *peek2(char *dest, struct command *curr) /* peek into internals */ { char *s; for (s = dest; *s; s++) { *s = tolower((int)*s); } if (!strcmp(dest, "infolevel")) { if (severity_threshold == sDEBUG) { return my_strdup("debug"); } else if (severity_threshold == sNOTE) { return my_strdup("note"); } else if (severity_threshold == sWARNING) { return my_strdup("warning"); } else if (severity_threshold == sERROR) { return my_strdup("error"); } else if (severity_threshold == sFATAL) { return my_strdup("fatal"); } else { return my_strdup("unknown"); } } else if (!strcmp(dest, "console_foreground_intensity") || !strcmp(dest, "screen_foreground_intensity") || !strcmp(dest, "terminal_foreground_intensity")) { if (con_fore_inten == cciLEGACY) { return my_strdup("legacy"); } else if (con_fore_inten == cciBRIGHT) { return my_strdup("bright"); } else if (con_fore_inten == cciNORMAL) { return my_strdup("normal"); } else { /* cannot happen, but anyway */ return my_strdup("unknown"); } } else if (!strcmp(dest, "console_foreground_color") || !strcmp(dest, "screen_foreground_color") || !strcmp(dest, "terminal_foreground_color")) { if (con_fore_col == -1) { return my_strdup("unset"); } else { return yc2name(con_fore_col); } } else if (!strcmp(dest, "console_background_color") || !strcmp(dest, "screen_background_color") || !strcmp(dest, "terminal_background_color")) { if (con_back_col == -1) { return my_strdup("unset"); } else { return yc2name(con_back_col); } } else if (!strcmp(dest, "textalign")) { return my_strdup(text_align); } else if (!strcmp(dest, "windoworigin")) { return my_strdup(winorigin); } else if (!strcmp(dest, "error")) { return my_strdup(estring); } else if (!strcmp(dest, "program_file_name")) { return my_strdup(main_file_name); } else if (!strcmp(dest, "program_name")) { return my_strdup(progname); } else if (!strcmp(dest, "interpreter_path")) { return my_strdup(inter_path); } else if (!strcmp(dest, "library")) { return my_strdup(curr->lib->short_name); } else if (!strcmp(dest, "version")) { return my_strdup(PACKAGE_VERSION); } else if (!strcmp(dest, "os")) { #ifdef UNIX return my_strdup("unix"); #else return my_strdup("windows"); #endif } else if (!strcmp(dest, "font")) { return my_strdup(fontname); } else if (!strcmp(dest, "last_foreign_function_call_error_text") || !strcmp(dest, "last_frnfn_call_error_text")) { return my_strdup(last_frnfn_call_error_text); } else if (!strcmp(dest, "argument") || !strcmp(dest, "arguments")) { if (yabargc > 0) { s = yabargv[0]; yabargc--; yabargv++; } else { s = ""; } return my_strdup(s); } else if (!strcmp(dest, "console_color_mode") || !strcmp(dest, "screen_color_mode") || !strcmp(dest, "terminal_color_mode")) { if (con_fore_inten == cciLEGACY) { return my_strdup("legacy"); } else if (con_fore_inten == cciBRIGHT) { return my_strdup("bright"); } else if (con_fore_inten == cciNORMAL) { return my_strdup("standard"); } else { sprintf( estring, "Internal error: Invalid value for console_foreground_intensity: %d", con_fore_inten); error(sERROR, estring); return my_strdup(""); } } else { sprintf(string, "invalid peek: '%s'; see the documentation of 'peek$' for accepted " "values", dest); error(sERROR, string); } return my_strdup(""); } static char *peek3(char *dest, char *cont) /* peek into internals */ { char *s; for (s = dest; *s; s++) { *s = tolower((int)*s); } if (!strcmp(dest, "env") || !strcmp(dest, "environment")) { return my_strdup(getenv(cont)); } else { error(sERROR, "invalid peek"); } return my_strdup(""); } void create_exception(int flag) /* create command 'exception' */ { struct command *cmd; cmd = add_command(cEXCEPTION); cmd->args = flag; } void exception(struct command *cmd) /* change handling of exceptions */ { if (cmd->args) { signal(SIGINT, signal_handler); /* enable keyboard interrupt */ #ifdef SIGHUP signal(SIGHUP, signal_handler); #endif #ifdef SIGQUIT signal(SIGQUIT, signal_handler); #endif #ifdef SIGABRT signal(SIGABRT, signal_handler); #endif #ifdef SIGTERM signal(SIGTERM, signal_handler); #endif } else { signal(SIGINT, SIG_IGN); /* ignore keyboard interrupt */ #ifdef SIGHUP signal(SIGHUP, SIG_IGN); #endif #ifdef SIGQUIT signal(SIGQUIT, SIG_IGN); #endif #ifdef SIGABRT signal(SIGABRT, SIG_IGN); #endif #ifdef SIGTERM signal(SIGTERM, SIG_IGN); #endif } return; } long long current_millis() { /* return current number of milliseconds */ #ifdef WINDOWS return GetTickCount(); #else struct timespec tsnow; clock_gettime(CLOCK_MONOTONIC, &tsnow); return tsnow.tv_sec * 1000LL + tsnow.tv_nsec / 1000000LL; #endif } void create_restore(char *label) /* create command 'restore' */ { struct command *c; c = add_command(cRESTORE); c->pointer = my_strdup(label); } void restore(struct command *cmd) /* reset data pointer to given label */ { struct command *label; struct command **datapointer; datapointer = &(cmd->lib->datapointer); if (cmd->type == cRESTORE) { /* first time; got to search the label */ if (*((char *)cmd->pointer) == '\0') { /* no label, restore to first command */ label = cmd->lib->firstdata; } else { label = search_label(cmd->pointer, srmLABEL | srmGLOBAL); if (!label) { /* did not find label */ sprintf(string, "can't find label '%s'", (char *)cmd->pointer); error(sERROR, string); return; } } *datapointer = label; if (lastdata) { while ((*datapointer)->type != cDATA && (*datapointer) != cmd_head) { *datapointer = (*datapointer)->next; } } cmd->pointer = *datapointer; cmd->type = cQRESTORE; } else { *datapointer = cmd->pointer; } return; } void create_dbldata(double value) /* create command dbldata */ { struct command *c; c = add_command(cDATA); c->pointer = my_malloc(sizeof(double)); if (lastdata) { lastdata->next_assoc = c; } lastdata = c; *((double *)c->pointer) = value; c->tag = 'd'; /* double value */ } void create_strdata(char *value) /* create command strdata */ { struct command *c; c = add_command(cDATA); if (lastdata) { lastdata->next_assoc = c; } lastdata = c; c->pointer = my_strdup(value); c->tag = 's'; /* string value */ } void create_readdata(char type) /* create command readdata */ { struct command *cmd; cmd = add_command(cREADDATA); cmd->tag = type; } void readdata(struct command *cmd) /* read data items */ { struct stackentry *read; char type; struct command **datapointer; datapointer = &(cmd->lib->datapointer); type = cmd->tag; while (*datapointer && ((*datapointer)->type != cDATA || cmd->lib != (*datapointer)->lib)) { *datapointer = (*datapointer)->next_assoc; } if (!*datapointer) { error(sERROR, "run out of data items"); return; } if (type != (*datapointer)->tag) { error(sERROR, "type of READ and DATA don't match"); return; } read = push(); if (type == 'd') { /* read a double value */ read->type = stNUMBER; read->value = *((double *)(*datapointer)->pointer); } else { read->type = stSTRING; read->pointer = my_strdup((*datapointer)->pointer); } *datapointer = (*datapointer)->next_assoc; /* next item */ } void create_dblrelop(char c) /* create command dblrelop */ { int type; switch (c) { case '=': type = cEQ; break; case '!': type = cNE; break; case '<': type = cLT; break; case '{': type = cLE; break; case '>': type = cGT; break; case '}': type = cGE; break; default: sprintf(string, "unknown dblrelop char: '%c'", c); error(sERROR, string); type = 0; } add_command(type); } void dblrelop(struct command *cmd) /* compare topmost double-values */ { double a, b, c; struct stackentry *result; b = pop(stNUMBER)->value; a = pop(stNUMBER)->value; switch (cmd->type) { case cEQ: c = (a == b); break; case cNE: c = (a != b); break; case cLE: c = (a <= b); break; case cLT: c = (a < b); break; case cGE: c = (a >= b); break; case cGT: c = (a > b); break; default: /* this is an error, but handled already in create_dblrelop; code below only * to silence compiler */ c = 0; } result = push(); result->value = c; result->type = stNUMBER; } void create_strrelop(char c) /* create command strrelop */ { int type; switch (c) { case '=': type = cSTREQ; break; case '!': type = cSTRNE; break; case '<': type = cSTRLT; break; case '{': type = cSTRLE; break; case '>': type = cSTRGT; break; case '}': type = cSTRGE; break; default: sprintf(string, "unknown strrelop char: '%c'", c); error(sERROR, string); type = 0; } add_command(type); } void strrelop(struct command *cmd) /* compare topmost string-values */ { char *a, *b; double c; struct stackentry *result; b = pop(stSTRING)->pointer; a = pop(stSTRING)->pointer; switch (cmd->type) { case cSTREQ: c = (strcmp(a, b) == 0); break; case cSTRNE: c = (strcmp(a, b) != 0); break; case cSTRLT: c = (strcmp(a, b) < 0); break; case cSTRLE: c = (strcmp(a, b) <= 0); break; case cSTRGT: c = (strcmp(a, b) > 0); break; case cSTRGE: c = (strcmp(a, b) >= 0); break; default: /* this is an error, but handled already in create_strrelop; code below only * to silence compiler */ c = 0; } result = push(); result->value = c; result->type = stNUMBER; } void switch_compare(void) /* compare topmost values for switch statement */ { struct stackentry *result, *first, *second; double r = 0.; first = pop(stANY); second = stackhead->prev; /* stSWITCH_STRING and stSWITCH_NUMBER compare true to any string or number */ if ((second->type == stSWITCH_STRING || second->type == stSTRING) && first->type == stSTRING) { if (second->type == stSWITCH_STRING) { r = 1.; } else { r = (strcmp(first->pointer, second->pointer) == 0) ? 1. : 0.; } } else if ((second->type == stSWITCH_NUMBER || second->type == stNUMBER) && first->type == stNUMBER) { if (second->type == stSWITCH_NUMBER) { r = 1.; } else { r = (first->value == second->value) ? 1. : 0.; } } else { error(sERROR, "mixing strings and numbers in a single switch statement is " "not allowed"); } /* if comparison was successful once, remember this for all future comparisons */ if (r == 1.) { if (second->type == stNUMBER) second->type = stSWITCH_NUMBER; if (second->type == stSTRING) second->type = stSWITCH_STRING; } result = push(); result->type = stNUMBER; result->value = r; } void logical_shortcut(struct command *cmd) /* shortcut and/or if possible */ { struct stackentry *result; double is; is = stackhead->prev->value; if ((cmd->type == cORSHORT && is != 0) || (cmd->type == cANDSHORT && is == 0)) { result = push(); error(sDEBUG, "logical shortcut taken"); result->type = stNUMBER; result->value = is; } else { currcmd = currcmd->next; } } void create_boole(char c) /* create command boole */ { int type; switch (c) { case '|': type = cOR; break; case '&': type = cAND; break; case '!': type = cNOT; break; default: sprintf(string, "unknown boole char: '%c'", c); error(sERROR, string); type = 0; } add_command(type); } void boole(struct command *cmd) /* perform and/or/not */ { int a, b, c; struct stackentry *result; a = (int)pop(stNUMBER)->value; if (cmd->type == cNOT) { c = !a; } else { b = (int)pop(stNUMBER)->value; if (cmd->type == cAND) { c = a && b; } else { c = a || b; } } result = push(); result->value = c; result->type = stNUMBER; } yabasic-2.91.4/graphic.c0000777000175000017500000022236115055045134010503 /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de graphic.c -- code for graphics and printing This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ /* ------------- includes ---------------- */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* all prototypes and structures */ #endif #ifdef UNIX #include #include #include #include #ifdef HAVE_PRCTL_H #include #endif #ifndef KEY_MAX #define KEY_MAX 0777 #endif #endif /* ------------- local functions ---------------- */ static void transform(double *, double *); /* do transformation of coordinates */ static void rtransform(double *, double *); /* reverse transformation */ static void itransform(int *, int *); /* integer variant of transform() */ static void irtransform(int *, int *); /* integer variant of rtransform() */ static int grafinit(void); /* initialize grafics (either X or Windows) */ static char *newrgb(int, int); /* create a new bitmap string */ static void addrgb(char *, unsigned short, unsigned short, unsigned short); /* add one rgb pixel to bitstring */ static int readrgb(char *, int, unsigned short *, unsigned short *, unsigned short *); /* read rgb pixel from string one after another */ static int change_font(char *); /* change font */ static int rgb_to_pixel(int, int, int); /* create a pixel value from rgb values */ #ifdef WINDOWS static DWORD winthread(LPWORD); /* window thread */ static void startdraw(int); /* prepare for drawing */ static void enddraw(); /* end of drawing */ #endif /* ------------- global variables ---------------- */ /* printing and plotting */ static char *printerfilename = NULL; /* filename to print on */ static int deleteprinterfile = FALSE; /* true, if we created the filename ourself an can delete it on close */ int print_to_file = FALSE; /* print to file ? */ #ifdef WINDOWS static LOGFONT logfont; /* structure for font-characteristics */ HFONT printerfont; /* handle of printer-font */ static HPEN printerpen; /* handle of printer-pen */ static HPEN revprinterpen; /* handle of reverse printer-pen */ HDC printer = NULL; /* handle of printer */ static float prnscale; /* scaling factor for printer */ static float prnoffx; /* offset for printer */ static float prnoffy; /* offset for printer */ #else FILE *printerfile = NULL; /* file to print on */ static double psscale; /* factor from window-pixels to ps-points */ static int firsttext = TRUE; /* true until text has been printed */ #endif int drawmode = 0; /* flag for drawing */ #ifdef UNIX static XFontStruct *myfont = NULL; /* properties of default font */ #else HFONT myfont; /* handle of font for screen */ #endif /* window coordinates */ int winopened = FALSE; /* flag if window is open already */ char *winorigin; /* e.g. "lt","rc"; defines origin of grafic window */ int winwidth, winheight; /* size of window */ int displaywidth = 0; /* width of display */ int displayheight = 0; /* height of display */ static int winx, winy; /* position of window */ /* mouse and keyboard */ int mousex = 0, mousey = 0, mouseb = 0, mousemod = 0; /* last known mouse coordinates */ char *ykey[kLASTKEY + 1]; /* keys returned by inkey */ #ifdef UNIX #else static DWORD wtid; /* id of win thread */ static HANDLE wtevent = INVALID_HANDLE_VALUE; /* handle for win thread event */ static HANDLE drawmutex = INVALID_HANDLE_VALUE; /* handle for drawing mutex */ #endif /* text and font */ char *text_align; /* specifies alignement of text */ int fontheight; /* height of font in pixel */ /* general window stuff */ static int bitcount; /* stateful counter for bitblit operations */ char *foreground = NULL; char *background = NULL; char *geometry = NULL; char *displayname = NULL; char *fontname = NULL; #ifdef UNIX static unsigned long forepixel, backpixel; /* colors */ Display *display = NULL; /* X-Display */ static Window root; /* ID of root window */ static Window window; /* ID of grafic window */ static GC gc; /* GC for drawing */ static GC rgc; /* GC for reverse drawing */ static XSizeHints sizehints; /* hints for window manager */ #else WNDCLASS myclass; /* window class for my program */ HANDLE this_instance; static HDC devcon; /* device context for screen */ static HDC bitcon; /* device context backing bitmap */ static HBITMAP backbit; /* backing bitmap */ char *my_class = "my_class"; BOOL Commandline; /* true if launched from command line */ HANDLE mainthread = INVALID_HANDLE_VALUE; /* handle to main thread */ static COLORREF backpixel; static COLORREF forepixel; static HBRUSH backbrush; static HBRUSH forebrush; static HPEN backpen; static HPEN forepen; HWND window; /* handle of my window */ #endif #ifdef UNIX /* variables for redraw coprocess */ Pixmap backbit; int backpid = -1; /* pid of process waiting for redraw events */ Colormap colormap; /* colormap for this visual */ XVisualInfo visualinfo; /* visual info; contains masks for red, green and blue */ static unsigned long rbits_shift = 0; /* position of red bits within pixel value */ static unsigned long gbits_shift = 0; /* same for green */ static unsigned long bbits_shift = 0; /* same for blue */ static unsigned long rbits_max = 0; /* number of red bits within pixel value */ static unsigned long gbits_max = 0; /* same for green */ static unsigned long bbits_max = 0; /* same for blue */ #endif /* ------------- functions ---------------- */ void create_openwin(int fnt) { /* create Command 'openwin' */ struct command *cmd; cmd = add_command(cOPENWIN); cmd->args = fnt; } void openwin(struct command *cmd) { /* open a Window */ int fnt; static int first = TRUE; /* flag to decide if initialization is necessary */ char *fname = NULL; #ifdef UNIX static XEvent event; /* what has happened ? */ XSetWindowAttributes attrib; /* properties of window */ int rx, ry, rw, rh; XGCValues vals; /* values of gc context */ XImage *patch; XWindowAttributes attributes; #endif if (winopened) { error(sWARNING, "Window already open"); return; } fnt = cmd->args; if (fnt) { fname = (char *)pop(stSTRING)->pointer; } winheight = (int)pop(stNUMBER)->value; if (winheight < 1) { error(sERROR, "winheight less than 1 pixel"); return; } winwidth = (int)pop(stNUMBER)->value; if (winwidth < 1) { error(sERROR, "winwidth less than 1 pixel"); return; } /* initialize grafics */ if (first && !grafinit()) { return; } if (fname && !change_font(fname)) { return; } #ifdef UNIX /* create the window */ attrib.backing_store = Always; attrib.save_under = TRUE; attrib.background_pixel = backpixel; attrib.colormap = colormap; window = XCreateWindow( display, root, winx, winy, winwidth, winheight, 0, CopyFromParent, CopyFromParent, visualinfo.visual, CWBackingStore | CWSaveUnder | CWBackPixel | CWColormap, &attrib); if (window == None) { error(sERROR, "Could not create window"); return; } /* put in name for the window */ XStoreName(display, window, progname); /* set size hints */ XSetWMNormalHints(display, window, &sizehints); /* want to get the exposure event */ XSelectInput(display, window, ExposureMask | VisibilityChangeMask); /* display it */ XMapWindow(display, window); /* wait for exposure */ XNextEvent(display, &event); /* no more events from window in this process */ XSelectInput(display, window, 0); calc_psscale(); /* create redraw pixmap */ XGetWindowAttributes(display, window, &attributes); backbit = XCreatePixmap(display, window, winwidth, winheight, attributes.depth); if (!backbit) { error(sERROR, "couldn't create backing pixmap"); return; } XFillRectangle(display, window, rgc, 0, 0, winwidth, winheight); XFillRectangle(display, backbit, rgc, 0, 0, winwidth, winheight); /* create redraw coprocess */ backpid = fork(); if (backpid == 0) { /* this is the child */ #ifdef HAVE_PRCTL_H prctl(PR_SET_PDEATHSIG, SIGHUP); #endif /* we (child-process) get our own display-connection, probably on purpose */ if (!display) display = XOpenDisplay(displayname); XSelectInput(display, window, ExposureMask); XGetGCValues(display, gc, GCPlaneMask, &vals); while (TRUE) { if (severity_threshold <= sNOTE && x11_note_on_receive_expose) { error(sNOTE, "Waiting for X11-event Expose"); } XNextEvent(display, &event); if (event.type == Expose) { if (severity_threshold <= sNOTE && x11_note_on_receive_expose) { error(sNOTE, "Received X11-event Expose"); } rx = event.xexpose.x; ry = event.xexpose.y; rw = event.xexpose.width; rh = event.xexpose.height; patch = XGetImage(display, backbit, rx, ry, rw, rh, vals.plane_mask, ZPixmap); if (patch) { XPutImage(display, window, gc, patch, 0, 0, rx, ry, rw, rh); XDestroyImage(patch); } } } } else if (backpid == -1) { error(sERROR, "Couldn't fork child"); return; } #else /* WINDOWS */ if (wtevent == INVALID_HANDLE_VALUE) { wtevent = CreateEvent(NULL, FALSE, FALSE, "winevent"); } if (drawmutex == INVALID_HANDLE_VALUE) { drawmutex = CreateMutex(NULL, FALSE, "drawmutex"); } ResetEvent(wtevent); /* create thread to care for window */ wthandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)winthread, 0, 0, (LPDWORD)&wtid); if (wthandle == NULL) { error(sERROR, "can't create thread for window"); return; } WaitForSingleObject(wtevent, INFINITE); #endif first = FALSE; winopened = TRUE; } #ifdef WINDOWS LRESULT CALLBACK mywindowproc(HWND handle, unsigned msg, UINT wparam, DWORD lparam) { RECT cr; /* client area rectangle */ PAINTSTRUCT ps; /* receives information for painting */ int skey; char *detail = NULL; int x, y, mod; switch (msg) { case WM_PAINT: if (GetUpdateRect(handle, &cr, 0)) { WaitForSingleObject(drawmutex, INFINITE); if (!BeginPaint(handle, &ps)) { return 1; } BitBlt(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top, bitcon, ps.rcPaint.left, ps.rcPaint.top, SRCCOPY); EndPaint(handle, &ps); ReleaseMutex(drawmutex); SetEvent(wtevent); } return 0; case WM_LBUTTONDOWN: if (!detail) { detail = "1d"; } case WM_LBUTTONUP: if (!detail) { detail = "1u"; } case WM_RBUTTONDOWN: if (!detail) { detail = "2d"; } case WM_RBUTTONUP: if (!detail) { detail = "2u"; } case WM_MBUTTONDOWN: if (!detail) { detail = "3d"; } case WM_MBUTTONUP: if (!detail) { detail = "3u"; } mod = 0; if (wparam & MK_CONTROL) { mod |= 4; } if (wparam & MK_SHIFT) { mod |= 1; } mouseb = atoi(detail); mousemod = mod; x = LOWORD(lparam); y = HIWORD(lparam); irtransform(&x, &y); mousex = x; mousey = y; sprintf(winkeybuff, "MB%s+%d:%04d,%04d", detail, mod, x, y); SetEvent(gotwinkey); return 0; case WM_CHAR: winkeybuff[0] = wparam; winkeybuff[1] = '\0'; SetEvent(gotwinkey); return 0; case WM_KEYDOWN: skey = -1; switch (wparam) { case VK_UP: skey = kUP; break; case VK_DOWN: skey = kDOWN; break; case VK_LEFT: skey = kLEFT; break; case VK_RIGHT: skey = kRIGHT; break; case VK_DELETE: skey = kDEL; break; case VK_INSERT: skey = kINS; break; case VK_CLEAR: skey = kCLEAR; break; case VK_HOME: skey = kHOME; break; case VK_END: skey = kEND; break; case VK_F1: skey = kF0; break; case VK_F2: skey = kF2; break; case VK_F3: skey = kF3; break; case VK_F4: skey = kF4; break; case VK_F5: skey = kF5; break; case VK_F6: skey = kF6; break; case VK_F7: skey = kF7; break; case VK_F8: skey = kF8; break; case VK_F9: skey = kF9; break; case VK_F10: skey = kF10; break; case VK_F11: skey = kF11; break; case VK_F12: skey = kF12; break; case VK_F13: skey = kF13; break; case VK_F14: skey = kF14; break; case VK_F15: skey = kF15; break; case VK_F16: skey = kF16; break; case VK_F17: skey = kF17; break; case VK_F18: skey = kF18; break; case VK_F19: skey = kF19; break; case VK_F20: skey = kF20; break; case VK_F21: skey = kF21; break; case VK_F22: skey = kF22; break; case VK_F23: skey = kF23; break; case VK_F24: skey = kF24; break; case VK_BACK: skey = kBACKSPACE; break; case VK_PRIOR: skey = kSCRNDOWN; break; case VK_NEXT: skey = kSCRNUP; break; case VK_RETURN: skey = kENTER; break; case VK_ESCAPE: skey = kESC; break; case VK_TAB: skey = kTAB; break; default: break; } if (skey == -1) { return (DefWindowProc(handle, msg, wparam, lparam)); } strcpy(winkeybuff, ykey[skey]); SetEvent(gotwinkey); return 0; default: return (DefWindowProc(handle, msg, wparam, lparam)); } } static DWORD winthread(LPWORD par) { /* procedure for windows-thread */ MSG msg; int w, h; RECT cr; /* client area rectangle */ winx = winy = 30; if (!geometry) { geometry = getreg("geometry"); } if (geometry) if (sscanf(geometry, "%ix%i+%i+%i", &w, &h, &winx, &winy) != 4 && sscanf(geometry, "+%i+%i", &winx, &winy) != 2 && sscanf(geometry, "%i+%i", &winx, &winy) != 2) { winx = winy = 30; } /* get window-size from client-area size */ cr.left = winx; cr.right = winx + winwidth; cr.top = winy; cr.bottom = winy + winheight; AdjustWindowRect(&cr, WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, FALSE); /* create my window */ window = CreateWindow(my_class, NULL, /* my style */ WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, /* window style */ winx, /* initial x-position */ winy, /* initial y-position */ cr.right - cr.left, /* initial x-size */ cr.bottom - cr.top, /* initial y-size */ NULL, /* parent window */ NULL, /* menu handle */ this_instance, /* my instance */ (LPVOID)NULL); /* dont know why */ /* show my window */ sprintf(string, "%s - Grafic Window", progname); SetWindowText(window, string); ShowWindow(this_instance, SW_SHOW); UpdateWindow(this_instance); SetForegroundWindow(window); winopened = TRUE; /* get colours */ backbrush = CreateSolidBrush(backpixel); backpen = CreatePen(PS_SOLID, 0, backpixel); forebrush = CreateSolidBrush(forepixel); forepen = CreatePen(PS_SOLID, 0, forepixel); /* create bitmap device context */ devcon = GetDC(window); bitcon = CreateCompatibleDC(devcon); cr.left = cr.top = 0; cr.right = winwidth; cr.bottom = winheight; backbit = CreateCompatibleBitmap(devcon, cr.right - cr.left, cr.bottom - cr.top); SelectObject(bitcon, backbit); SelectClipRgn(bitcon, NULL); IntersectClipRect(bitcon, 0, 0, winwidth, winheight); FillRect(bitcon, &cr, backbrush); SelectObject(bitcon, forebrush); SelectObject(bitcon, forepen); ReleaseDC(window, devcon); /* get and dispatch messages */ while (GetMessage((LPMSG)&msg, NULL, 0, 0)) { TranslateMessage((LPMSG)&msg); DispatchMessage((LPMSG)&msg); } /* delete all those objects */ DestroyWindow(window); DeleteObject(backbit); DeleteObject(backpen); DeleteObject(backbrush); DeleteDC(devcon); DeleteDC(bitcon); ExitThread(0); return 0; } static void startdraw(int clear) { /* prepare for drawing */ RECT interior; WaitForSingleObject(drawmutex, INFINITE); devcon = GetDC(window); if (clear) { SelectObject(devcon, backpen); SelectObject(bitcon, backpen); SelectObject(devcon, backbrush); SelectObject(bitcon, backbrush); SetTextColor(devcon, backpixel); SetTextColor(bitcon, backpixel); } else { SelectObject(devcon, forepen); SelectObject(bitcon, forepen); SelectObject(devcon, forebrush); SelectObject(bitcon, forebrush); SetTextColor(devcon, forepixel); SetTextColor(bitcon, forepixel); } GetClientRect(window, &interior); SelectClipRgn(devcon, NULL); IntersectClipRect(devcon, interior.left, interior.top, interior.right, interior.bottom); if (printer) { if (clear) { SelectObject(printer, revprinterpen); } else { SelectObject(printer, printerpen); } } } static void enddraw() { /* release drawing resources */ ReleaseDC(window, devcon); ReleaseMutex(drawmutex); } char *getreg(char *name) { /* get defaults from Registry */ char *keyname = "SOFTWARE\\yabasic"; HKEY key; char reg[80]; DWORD n; RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyname, 0, KEY_READ, &key); n = 80; reg[0] = '\0'; RegQueryValueEx(key, name, NULL, NULL, reg, &n); if (reg[0] == '\0') { return NULL; } return my_strdup(reg); } #endif static int grafinit(void) { /* initialize grafics (either X or Windows) */ #ifdef UNIX static int screen; /* Number of Screen on Display */ static XGCValues xgcvalues; /* Values for Graphics Context */ static unsigned int w, h; /* width and height of window */ int rbits_count, gbits_count, bbits_count; /* number of bits for r,g and b */ XColor exact_match, best_match; /* exact and best matches for required color */ #else /* */ int r, g, b; #endif char *fname = fontname; #ifdef UNIX /* get display */ display = XOpenDisplay(displayname); if (display == NULL) { sprintf(string, "could not open display: %s", my_strerror(errno)); error(sERROR, string); return FALSE; } /* get screen */ screen = DefaultScreen(display); root = RootWindow(display, screen); /* find out, which depth is available */ if (!XMatchVisualInfo(display, DefaultScreen(display), 24, TrueColor, &visualinfo) && !XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &visualinfo) && !XMatchVisualInfo(display, DefaultScreen(display), 16, TrueColor, &visualinfo) && !XMatchVisualInfo(display, DefaultScreen(display), 12, TrueColor, &visualinfo) && !XMatchVisualInfo(display, DefaultScreen(display), 8, TrueColor, &visualinfo)) { error(sERROR, "Could not get any TrueColor visual"); return FALSE; } /* convert color masks in more convenient values */ for (rbits_shift = 0; (visualinfo.red_mask & 1 << rbits_shift) == 0; rbits_shift++) ; rbits_max = visualinfo.red_mask >> rbits_shift; for (rbits_count = 0; rbits_max & (1 << rbits_count); rbits_count++) ; for (gbits_shift = 0; (visualinfo.green_mask & 1 << gbits_shift) == 0; gbits_shift++) ; gbits_max = visualinfo.green_mask >> gbits_shift; for (gbits_count = 0; gbits_max & (1 << gbits_count); gbits_count++) ; for (bbits_shift = 0; (visualinfo.blue_mask & 1 << bbits_shift) == 0; bbits_shift++) ; bbits_max = visualinfo.blue_mask >> bbits_shift; for (bbits_count = 0; bbits_max & (1 << bbits_count); bbits_count++) ; sprintf(string, "Creating a %d bit True Color map", visualinfo.depth); error(sNOTE, string); sprintf(string, "with %d, %d and %d bits for red, green and blue respectively", rbits_count, gbits_count, bbits_count); error(sNOTE, string); /* create the colormap */ colormap = XCreateColormap(display, DefaultRootWindow(display), visualinfo.visual, AllocNone); /* now, that we have the colormap, we try to get the colors requested for * fore- and background */ if (!foreground) { foreground = XGetDefault(display, "yabasic", "foreground"); } if (!foreground) { foreground = "black"; } if (!XLookupColor(display, colormap, foreground, &exact_match, &best_match)) { sprintf(string, "Could not find foreground color '%s'\n", background); error(sERROR, string); return FALSE; } forepixel = rgb_to_pixel(best_match.red >> 8, best_match.green >> 8, best_match.blue >> 8); if (!background) { background = XGetDefault(display, "yabasic", "background"); } if (!background) { background = "white"; } if (!XLookupColor(display, colormap, background, &exact_match, &best_match)) { sprintf(string, "Could not find background color '%s'\n", background); error(sERROR, string); return FALSE; } backpixel = rgb_to_pixel(best_match.red >> 8, best_match.green >> 8, best_match.blue >> 8); /* get size hints */ if (geometry == NULL) { geometry = XGetDefault(display, "yabasic", "geometry"); } XParseGeometry(geometry, &winx, &winy, &w, &h); sizehints.x = winx; sizehints.y = winy; sizehints.flags = USPosition; /* create graphics context, accept defaults ... */ xgcvalues.foreground = forepixel; xgcvalues.background = backpixel; gc = XCreateGC(display, root, GCForeground | GCBackground, &xgcvalues); /* create graphics context for reverse drawing */ xgcvalues.foreground = backpixel; xgcvalues.background = forepixel; rgc = XCreateGC(display, root, GCForeground | GCBackground, &xgcvalues); /* get font */ if (!fname) { fname = XGetDefault(display, "yabasic", "font"); } if (!fname) { fname = "6x10"; } if (!change_font(fname)) { return FALSE; } #elif WINDOWS /* choose font */ if (!fname) { fname = getreg("font"); } if (!fname) { fname = "swiss13"; } if (!change_font(fname)) { return FALSE; } /* get colours */ if (!foreground) { foreground = getreg("foreground"); } if (!foreground) { foreground = "0,0,0"; } if (sscanf(foreground, "%d,%d,%d", &r, &g, &b) != 3 || r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { sprintf(string, "command line option -foreground must be three numbers between 0 " "and 255, separated by commas (not '%s')", foreground); error(sERROR, string); return FALSE; } forepixel = RGB(r, g, b); if (!background) { background = getreg("background"); } if (!background) { background = "255,255,255"; } if (sscanf(background, "%d,%d,%d", &r, &g, &b) != 3 || r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { sprintf(string, "command line option -background must be three numbers between 0 " "and 255, separated by commas (not '%s')", background); error(sERROR, string); return FALSE; } backpixel = RGB(r, g, b); #endif return TRUE; } static int change_font(char *fname) { /* change font */ #ifdef WINDOWS int n; int f; /* int-value of font */ char *family; /* font family */ #else static XGCValues xgcvalues; /* Values for Graphics Context */ #endif #ifdef UNIX if (fontname) { if (myfont && !strcmp(fontname, fname)) { return TRUE; } else { if (myfont) { XUnloadFont(display, myfont->fid); } } if (fontname != fname) my_free(fontname); } fontname = my_strdup(fname); myfont = XLoadQueryFont(display, fontname); if (!myfont) { sprintf(string, "could not load font '%s', trying 'fixed' instead", fontname); error(sWARNING, string); myfont = XLoadQueryFont(display, "fixed"); if (!myfont) { error(sERROR, "could not get it"); return FALSE; } } fontheight = myfont->ascent; xgcvalues.font = myfont->fid; if (!XChangeGC(display, gc, GCFont, &xgcvalues)) { sprintf(string, "Could not change font to '%s'", fontname); error(sERROR, string); return FALSE; } firsttext = TRUE; #else if (fontname) { if (strcmp(fontname, fname)) { DeleteObject(myfont); } else { return TRUE; } my_free(fontname); } fontname = my_strdup(fname); f = FF_SWISS; fontheight = 13; family = my_strdup(fontname); for (n = 0; *(family + n) != '\0' && !isdigit(*(family + n)); n++) { *(family + n) = tolower((int)*(family + n)); } if (isdigit(*(family + n))) { sscanf(family + n, "%d", &fontheight); } *(family + n) = '\0'; if (!strcmp("decorative", family)) { f = FF_DECORATIVE; } else if (!strcmp("dontcare", family)) { f = FF_DONTCARE; } else if (!strcmp("modern", family)) { f = FF_MODERN; } else if (!strcmp("roman", family)) { f = FF_ROMAN; } else if (!strcmp("script", family)) { f = FF_SCRIPT; } else if (!strcmp("swiss", family)) { f = FF_SWISS; } else { sprintf(string, "Don't know font '%s' using 'swiss' instead", fontname); error(sWARNING, string); f = FF_SWISS; } logfont.lfHeight = -fontheight; logfont.lfWidth = 0; logfont.lfEscapement = 0; logfont.lfOrientation = 0; logfont.lfWeight = FW_DONTCARE; logfont.lfItalic = FALSE; logfont.lfUnderline = FALSE; logfont.lfStrikeOut = FALSE; logfont.lfCharSet = DEFAULT_CHARSET; logfont.lfOutPrecision = OUT_DEFAULT_PRECIS; logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; logfont.lfQuality = DEFAULT_QUALITY; logfont.lfPitchAndFamily = DEFAULT_PITCH | f; logfont.lfFaceName[0] = '\0'; myfont = CreateFontIndirect(&logfont); if (myfont == NULL) { sprintf(string, "Could not create font '%s' for screen", fontname); error(sERROR, string); return FALSE; } my_free(family); if (printer) { /* delete and create printerfont */ if (printerfont) { DeleteObject(printerfont); } logfont.lfHeight = (long)(-fontheight * prnscale); printerfont = CreateFontIndirect(&logfont); if (printerfont == NULL) { sprintf(string, "Could not create font for printer"); error(sERROR, string); return FALSE; } if (!SelectObject(printer, printerfont)) { error(sERROR, "could not select printerfont"); } } #endif return TRUE; } #ifdef UNIX void calc_psscale() { /* calculate scale-factor for postscript */ if ((float)winwidth / winheight > (float)18 / 25) { psscale = 18 * 0.39 * 72 / winwidth; } else { psscale = 25 * 0.39 * 72 / winheight; } } #endif void putindrawmode(int mode) { /* store drawmode in previous command */ if (mode) { last_cmd->tag = mode; } else { last_cmd->tag = drawmode; } drawmode = 0; } void dot(struct command *cmd) { /* draw a dot */ double x, y; int clear; y = pop(stNUMBER)->value; x = pop(stNUMBER)->value; transform(&x, &y); clear = cmd->tag & dmCLEAR; if (!winopened) { error(sERROR, "Got no window to draw"); return; } #ifdef UNIX if (clear) { XDrawPoint(display, window, rgc, x, y); XDrawPoint(display, backbit, rgc, x, y); } else { XDrawPoint(display, window, gc, x, y); XDrawPoint(display, backbit, gc, x, y); } XFlush(display); if (printerfile) { fprintf(printerfile, "%g %g (%c) DO\n", (x - 0.5) * psscale, (winheight - y + 0.5) * psscale, clear ? 'y' : 'n'); } #elif WINDOWS startdraw(clear); if (clear) { SetPixelV(devcon, (int)x, (int)y, backpixel); SetPixelV(bitcon, (int)x, (int)y, backpixel); if (printer) { MoveToEx(printer, (int)(x * prnscale + prnoffx), (int)(y * prnscale + prnoffy), NULL); LineTo(printer, (int)(x * prnscale + prnoffx), (int)(y * prnscale + prnoffy)); } } else { SetPixelV(devcon, (int)x, (int)y, forepixel); SetPixelV(bitcon, (int)x, (int)y, forepixel); if (printer) { MoveToEx(printer, (int)(x * prnscale + prnoffx), (int)(y * prnscale + prnoffy), NULL); LineTo(printer, (int)(x * prnscale + prnoffx), (int)(y * prnscale + prnoffy)); } } enddraw(); #endif } void create_line(int numpoints) { /* create Command 'line' */ struct command *cmd; cmd = add_command(cLINE); cmd->args = numpoints; cmd->tag = dmNORMAL; } void line(struct command *cmd) { /* draw a line */ double x1, y1, x2, y2; static double lastx, lasty; static int lastvalid = FALSE; static double initialx, initialy; static int initialvalid = FALSE; int numpoints; int clear; if (!winopened) { error(sERROR, "Got no window to draw"); return; } clear = cmd->tag & dmCLEAR; numpoints = cmd->args; if (numpoints == -1) { /* new curve */ lastvalid = FALSE; initialvalid = FALSE; return; } else if (numpoints == 0) { /* close curve */ if (!lastvalid || !initialvalid) { return; } lastvalid = FALSE; initialvalid = FALSE; x1 = lastx; y1 = lasty; x2 = initialx; y2 = initialy; } else { /* line to x2,y2 */ y2 = pop(stNUMBER)->value; x2 = pop(stNUMBER)->value; if (numpoints == 1) { if (!lastvalid) { initialx = lastx = x2; initialy = lasty = y2; initialvalid = lastvalid = TRUE; return; } y1 = lasty; x1 = lastx; } else { /* line x1,y1 to x2,y2 */ y1 = pop(stNUMBER)->value; x1 = pop(stNUMBER)->value; } } lastx = x2; lasty = y2; if (!initialvalid) { initialx = x1; initialy = y2; initialvalid = TRUE; } transform(&x1, &y1); transform(&x2, &y2); #ifdef UNIX if (clear) { XDrawLine(display, window, rgc, x1, y1, x2, y2); XDrawLine(display, backbit, rgc, x1, y1, x2, y2); } else { XDrawLine(display, window, gc, x1, y1, x2, y2); XDrawLine(display, backbit, gc, x1, y1, x2, y2); } XFlush(display); if (printerfile) { fprintf(printerfile, "%g %g %g %g (%c) LI\n", x1 * psscale, (winheight - y1) * psscale, x2 * psscale, (winheight - y2) * psscale, clear ? 'y' : 'n'); } fflush(printerfile); #elif WINDOWS startdraw(clear); MoveToEx(devcon, (int)x1, (int)y1, NULL); LineTo(devcon, (int)x2, (int)y2); if (clear) { SetPixelV(devcon, (int)x2, (int)y2, backpixel); } else { SetPixelV(devcon, (int)x2, (int)y2, forepixel); } MoveToEx(bitcon, (int)x1, (int)y1, NULL); LineTo(bitcon, (int)x2, (int)y2); if (clear) { SetPixelV(bitcon, (int)x2, (int)y2, backpixel); } else { SetPixelV(bitcon, (int)x2, (int)y2, forepixel); } if (printer) { MoveToEx(printer, (int)(x1 * prnscale + prnoffx), (int)(y1 * prnscale + prnoffy), NULL); LineTo(printer, (int)(x2 * prnscale + prnoffx), (int)(y2 * prnscale + prnoffy)); } enddraw(); #endif } void change_colour(struct command *cmd) { /* change colour for graphics */ int r, g, b; #ifdef UNIX int pixel; #else #endif if (!winopened) { error(sERROR, "Got no window to draw"); return; } if (cmd->type == cGCOLOUR || cmd->type == cGBACKCOLOUR) { b = (int)pop(stNUMBER)->value; g = (int)pop(stNUMBER)->value; r = (int)pop(stNUMBER)->value; if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { sprintf(string, "arguments to command colour must be between 0 and 255 (not " "%d,%d,%d)", r, g, b); error(sERROR, string); return; } } else { char *h; h = (char *)(pop(stSTRING)->pointer); if (sscanf(h, "%d,%d,%d", &r, &g, &b) != 3 || r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255) { sprintf(string, "string argument to command colour must be three numbers between " "0 and 255, separated by commas (not '%s')", h); error(sERROR, string); return; } } #ifdef UNIX pixel = rgb_to_pixel(r, g, b); forepixel = pixel; if (cmd->type == cGCOLOUR || cmd->type == cGCOLOUR2) { XSetForeground(display, gc, pixel); XSetBackground(display, gc, pixel); if (printerfile) { fprintf(printerfile, "rgb /r %g put\n", ((double)r) / 255); fprintf(printerfile, "rgb /g %g put\n", ((double)g) / 255); fprintf(printerfile, "rgb /b %g put\n", ((double)b) / 255); fprintf(printerfile, "(n) CLYN\n"); fflush(printerfile); } } else { XSetForeground(display, rgc, pixel); XSetBackground(display, rgc, pixel); } #else /* */ if (cmd->type == cGCOLOUR || cmd->type == cGCOLOUR2) { forepixel = RGB(r, g, b); DeleteObject(forebrush); forebrush = CreateSolidBrush(forepixel); DeleteObject(forepen); forepen = CreatePen(PS_SOLID, 0, forepixel); } else { backpixel = RGB(r, g, b); DeleteObject(backbrush); backbrush = CreateSolidBrush(backpixel); DeleteObject(backpen); backpen = CreatePen(PS_SOLID, 0, backpixel); } #endif } int rgb_to_pixel(int r, int g, int b) { /* create a pixel value from rgb values */ long pixel; #ifdef UNIX pixel = (visualinfo.red_mask & ((long)(r * rbits_max / 255) << rbits_shift)) + (visualinfo.green_mask & ((long)(g * gbits_max / 255) << gbits_shift)) + (visualinfo.blue_mask & ((long)(b * bbits_max / 255) << bbits_shift)); #else /* */ pixel = RGB(r, g, b); #endif return pixel; } static void pixel_to_rgb(int *r, int *g, int *b, int pixel) { /* create an rgb value from pixel */ #ifdef UNIX *r = (int)(((pixel >> rbits_shift) & rbits_max) * 255 / rbits_max); *g = (int)(((pixel >> gbits_shift) & gbits_max) * 255 / gbits_max); *b = (int)(((pixel >> bbits_shift) & bbits_max) * 255 / bbits_max); #else /* */ *r = GetRValue(pixel); *g = GetGValue(pixel); *b = GetBValue(pixel); #endif } void circle(struct command *cmd) { /* draw a circle */ double x, y, r; int fill, clear; fill = cmd->tag & dmFILL; clear = cmd->tag & dmCLEAR; r = pop(stNUMBER)->value; y = pop(stNUMBER)->value; x = pop(stNUMBER)->value; transform(&x, &y); if (!winopened) { error(sERROR, "Got no window to draw"); return; } #ifdef UNIX if (clear) { if (fill) { XFillArc(display, window, rgc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); XFillArc(display, backbit, rgc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); } else { XDrawArc(display, window, rgc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); XDrawArc(display, backbit, rgc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); } } else { if (fill) { XFillArc(display, window, gc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); XFillArc(display, backbit, gc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); } else { XDrawArc(display, window, gc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); XDrawArc(display, backbit, gc, x - r, y - r, 2 * r, 2 * r, 0 * 64, 360 * 64); } } XFlush(display); if (printerfile) { fprintf(printerfile, "N\n"); fprintf(printerfile, "%g %g %g (%c) (%c) CI\n", (winheight - y) * psscale, x * psscale, r * psscale, clear ? 'y' : 'n', fill ? 'y' : 'n'); fflush(printerfile); } #else /* WINDOWS */ startdraw(clear); if (fill) { Ellipse(devcon, (int)(x - r), (int)(y - r), (int)(x + r), (int)(y + r)); Ellipse(bitcon, (int)(x - r), (int)(y - r), (int)(x + r), (int)(y + r)); if (printer) { Ellipse(printer, (int)((x - r) * prnscale + prnoffx), (int)((y - r) * prnscale + prnoffy), (int)((x + r) * prnscale + prnoffx), (int)((y + r) * prnscale + prnoffy)); } } else { Arc(devcon, (int)(x - r), (int)(y - r), (int)(x + r), (int)(y + r), 0, 0, 0, 0); Arc(bitcon, (int)(x - r), (int)(y - r), (int)(x + r), (int)(y + r), 0, 0, 0, 0); if (printer) { Arc(printer, (int)((x - r) * prnscale + prnoffx), (int)((y - r) * prnscale + prnoffy), (int)((x + r) * prnscale + prnoffx), (int)((y + r) * prnscale + prnoffy), 0, 0, 0, 0); } } enddraw(); #endif } void triangle(struct command *cmd) { /* draw a triangle */ double x0, y0, x1, y1, x2, y2; #ifdef UNIX XPoint points[4]; #else /* */ POINT points[4]; POINT prpoints[4]; #endif int fill, clear; fill = cmd->tag & dmFILL; clear = cmd->tag & dmCLEAR; y2 = pop(stNUMBER)->value; x2 = pop(stNUMBER)->value; y1 = pop(stNUMBER)->value; x1 = pop(stNUMBER)->value; y0 = pop(stNUMBER)->value; x0 = pop(stNUMBER)->value; transform(&x0, &y0); transform(&x1, &y1); transform(&x2, &y2); points[2].y = (long)y2; points[2].x = (long)x2; points[1].y = (long)y1; points[1].x = (long)x1; points[0].y = (long)y0; points[0].x = (long)x0; points[3].y = (long)y0; points[3].x = (long)x0; if (!winopened) { error(sERROR, "Got no window to draw"); return; } #ifdef UNIX if (clear) { if (fill) { XFillPolygon(display, window, rgc, points, 4, Convex, CoordModeOrigin); XFillPolygon(display, backbit, rgc, points, 4, Convex, CoordModeOrigin); } else { XDrawLines(display, window, rgc, points, 4, CoordModeOrigin); XDrawLines(display, backbit, rgc, points, 4, CoordModeOrigin); } } else { if (fill) { XFillPolygon(display, window, gc, points, 4, Convex, CoordModeOrigin); XFillPolygon(display, backbit, gc, points, 4, Convex, CoordModeOrigin); } else { XDrawLines(display, window, gc, points, 4, CoordModeOrigin); XDrawLines(display, backbit, gc, points, 4, CoordModeOrigin); } } XFlush(display); if (printerfile) { fprintf(printerfile, "N\n"); fprintf(printerfile, "%g %g %g %g %g %g (%c) (%c) TRI\n", x0 * psscale, (winheight - y0) * psscale, x1 * psscale, (winheight - y1) * psscale, x2 * psscale, (winheight - y2) * psscale, clear ? 'y' : 'n', fill ? 'y' : 'n'); fflush(printerfile); } #else /* WINDOWS */ startdraw(clear); if (printer) { int i; for (i = 0; i < 3; i++) { prpoints[i].x = (long)(points[i].x * prnscale + prnoffx); prpoints[i].y = (long)(points[i].y * prnscale + prnoffy); } } if (fill) { Polygon(devcon, points, 3); Polygon(bitcon, points, 3); if (printer) { Polygon(printer, prpoints, 3); } } else { Polyline(devcon, points, 4); Polyline(bitcon, points, 4); if (printer) { Polyline(printer, prpoints, 3); } } enddraw(); #endif } void text(struct command *cmd) { /* write a text */ double x, y; char *text; char *arg1 = NULL; char *arg2 = NULL; char *align = NULL; char *fname = NULL; int xoff, yoff, len; #ifdef UNIX int i, d1, d2, d3; /* dummies */ XCharStruct size; static char *sample = "The Quick Brown Fox Jumped Over The Lazy Dog 0123456789"; #else UINT algn; #endif if (cmd->type == cTEXT3) { arg2 = pop(stSTRING)->pointer; } if (cmd->type == cTEXT2 || cmd->type == cTEXT3) { arg1 = pop(stSTRING)->pointer; } if (arg1) { if (check_alignment(arg1)) { align = arg1; } else { fname = arg1; } } if (arg2) { if (check_alignment(arg2)) { if (align) { sprintf(string, "Found two possible alignments: '%s' and '%s'", arg1, arg2); error(sERROR, string); } align = arg2; } else { fname = arg2; } } if (arg2 && check_alignment(arg2)) { align = arg2; if (arg1) { fname = arg1; } } if (arg1 && arg2 && !align) { error(sERROR, "There should be a specification for a text alignment (e.g. 'ct')"); error(sERROR, "among the last two arguments"); return; } if (!align) { align = text_align; } if (fname && !change_font(my_strdup(fname))) { return; } text = pop(stSTRING)->pointer; y = pop(stNUMBER)->value; x = pop(stNUMBER)->value; transform(&x, &y); if (!winopened) { error(sERROR, "Got no window to draw"); return; } len = strlen(text); #ifdef UNIX XTextExtents(myfont, text, len, &d1, &d2, &d3, &size); if (align[0] == 'l') { xoff = 0; } else if (align[0] == 'r') { xoff = -size.width; } else { xoff = -size.width / 2; } if (align[1] == 't') { yoff = fontheight; } else if (align[1] == 'b') { yoff = 0; } else { yoff = fontheight / 2; } XDrawString(display, window, gc, x + xoff, y + yoff, text, len); XDrawString(display, backbit, gc, x + xoff, y + yoff, text, len); XFlush(display); if (printerfile) { for (i = 0; i < INBUFFLEN; i++) { if (*text == '(' || *text == ')') { string[i] = '\\'; i++; } string[i] = *text; if (!*text) { break; } text++; } if (firsttext) { firsttext = FALSE; XTextExtents(myfont, sample, strlen(sample), &d1, &d2, &d3, &size); fprintf(printerfile, "/Helvetica findfont setfont newpath 0 0 moveto\n"); fprintf(printerfile, "(%s) false charpath flattenpath pathbbox\n", sample); fprintf(printerfile, "3 -1 roll pop pop sub abs %g exch div\n", (double)psscale * size.width * 1.095 /* mysterious scaling factor ! */); fprintf(printerfile, "/Helvetica findfont exch scalefont setfont\n"); } fprintf(printerfile, "%g %g (%c) (%s) AT\n", x * psscale, (winheight - y - yoff) * psscale, align[0], string); } #else /* WINDOWS */ startdraw(FALSE); SelectObject(devcon, myfont); SetBkMode(devcon, TRANSPARENT); SelectObject(bitcon, myfont); SetBkMode(bitcon, TRANSPARENT); algn = 0; xoff = yoff = 0; if (align[0] == 'l') { algn |= TA_LEFT; } else if (align[0] == 'r') { algn |= TA_RIGHT; } else { algn |= TA_CENTER; } if (align[1] == 't') { algn |= TA_TOP; } else if (align[1] == 'b') { algn |= TA_BOTTOM; } else { algn |= TA_BOTTOM; yoff = fontheight / 2; } SetTextAlign(devcon, algn); TextOut(devcon, (int)(x + xoff), (int)(y + yoff), text, len); SetTextAlign(bitcon, algn); TextOut(bitcon, (int)(x + xoff), (int)(y + yoff), text, len); enddraw(); if (printer) { SetBkMode(printer, TRANSPARENT); SetTextAlign(printer, algn); TextOut(printer, (int)((x + xoff) * prnscale + prnoffx), (int)((y + yoff) * prnscale + prnoffy), text, strlen(text)); } #endif } int check_alignment(char *al) { /* checks, if text-alignement is valid */ if (!al[0] || !al[1]) { return FALSE; } al[0] = tolower((int)al[0]); al[1] = tolower((int)al[1]); if (!strchr("clr", al[0]) || !strchr("ctb", al[1])) { return FALSE; } else { return TRUE; } } void closewin() { /* close the window */ #ifdef UNIX int status; #endif if (!winopened) { error(sWARNING, "Got no window to close"); return; } winopened = FALSE; #ifdef UNIX if (backpid > 0) { kill(backpid, SIGKILL); waitpid(backpid, &status, 0); backpid = -1; } XFreePixmap(display, backbit); XDestroyWindow(display, window); XFlush(display); if (printerfile) { closeprinter(); } #else /* WINDOWS */ PostThreadMessage(wtid, WM_QUIT, 0, 0); #endif } void clearwin() { /* clear the window */ #ifdef WINDOWS RECT interior; #endif if (!winopened) { error(sWARNING, "Got no window to clear"); return; } #ifdef UNIX XFillRectangle(display, window, rgc, 0, 0, winwidth, winheight); XFillRectangle(display, backbit, rgc, 0, 0, winwidth, winheight); XFlush(display); if (printerfile) { fprintf(printerfile, "showpage\n"); fflush(printerfile); } #else /* WINDOWS */ startdraw(FALSE); GetClientRect(window, &interior); FillRect(devcon, &interior, backbrush); FillRect(bitcon, &interior, backbrush); if (printer) { EndPage(printer); StartPage(printer); } enddraw(); #endif } void moveorigin(char * or) { /* move origin of window */ if (or == NULL) { or = pop(stSTRING)->pointer; } or [0] = tolower((int) or [0]); or [1] = tolower((int) or [1]); if (or [2] != '\0' || !strchr("lcr", or [0]) || !strchr("tbc", or [1])) { error(sERROR, "invalid window origin"); return; } strcpy(winorigin, or); return; } static void itransform(int *ix, int *iy) { /* integer variant of transform() */ double dx, dy; dx = *ix; dy = *iy; transform(&dx, &dy); *ix = (int)dx; *iy = (int)dy; } static void irtransform(int *ix, int *iy) { /* integer variant of rtransform() */ double dx, dy; dx = *ix; dy = *iy; rtransform(&dx, &dy); *ix = (int)dx; *iy = (int)dy; } static void transform(double *x, double *y) { /* do coordinate transformation from coordinates of yabasic (regarding origin) to coordinates of graphics-system */ double xz, yz, xd, yd; double xold, yold; if (severity_threshold <= sDEBUG) { xold = *x; yold = *y; } switch (winorigin[0]) { case 'l': xz = 0; xd = 1.0; break; case 'c': xz = winwidth / 2; xd = 1.0; break; case 'r': xz = winwidth; xd = -1.0; break; default: /* avoid compiler warning */ xd = xz = 0; } switch (winorigin[1]) { case 't': yz = 0; yd = 1.0; break; case 'c': yz = winheight / 2; yd = 1.0; break; case 'b': yz = winheight; yd = -1.0; break; default: /* avoid compiler warning */ yd = yz = 0; } *x = xz + (*x) * xd; *y = yz + (*y) * yd; if (severity_threshold <= sDEBUG) { sprintf(string, "transforming (%g,%g) into (%g,%g)", xold, yold, *x, *y); error(sDEBUG, string); } } static void rtransform(double *x, double *y) { /* do reverse coordinate transformation */ double xz, yz, xd, yd; double xold, yold; if (severity_threshold <= sDEBUG) { xold = *x; yold = *y; } switch (winorigin[0]) { case 'l': xz = 0; xd = 1.0; break; case 'c': xz = winwidth / 2; xd = 1.0; break; case 'r': xz = winwidth; xd = -1.0; break; default: /* avoid compiler warning */ xd = xz = 0; } switch (winorigin[1]) { case 't': yz = 0; yd = 1.0; break; case 'c': yz = winheight / 2; yd = 1.0; break; case 'b': yz = winheight; yd = -1.0; break; default: /* avoid compiler warning */ yd = yz = 0; } /* this is the inverse of transform, as long as xd * xd == 1 holds true */ *x = ((*x) - xz) * xd; *y = ((*y) - yz) * yd; if (severity_threshold <= sDEBUG) { sprintf(string, "transforming (%g,%g) into (%g,%g)", xold, yold, *x, *y); error(sDEBUG, string); } } void rect(struct command *cmd) { /* draw a (filled) rect */ #ifdef WINDOWS RECT box, prbox; #endif int fill, clear; double x1, y1, x2, y2, s; if (!winopened) { error(sERROR, "Got no window to draw"); return; } fill = cmd->tag & dmFILL; clear = cmd->tag & dmCLEAR; y2 = pop(stNUMBER)->value; x2 = pop(stNUMBER)->value; y1 = pop(stNUMBER)->value; x1 = pop(stNUMBER)->value; transform(&x1, &y1); transform(&x2, &y2); if (x1 > x2) { s = x2; x2 = x1; x1 = s; } if (y1 > y2) { s = y2; y2 = y1; y1 = s; } #ifdef UNIX if (clear) { if (fill) { XFillRectangle(display, window, rgc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); XFillRectangle(display, backbit, rgc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); } else { XDrawRectangle(display, window, rgc, x1, y1, x2 - x1, y2 - y1); XDrawRectangle(display, backbit, rgc, x1, y1, x2 - x1, y2 - y1); } } else { if (fill) { XFillRectangle(display, window, gc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); XFillRectangle(display, backbit, gc, x1, y1, x2 - x1 + 1, y2 - y1 + 1); } else { XDrawRectangle(display, window, gc, x1, y1, x2 - x1, y2 - y1); XDrawRectangle(display, backbit, gc, x1, y1, x2 - x1, y2 - y1); } } XFlush(display); if (printerfile) { fprintf(printerfile, "%g %g %g %g (%c) (%c) RE\n", x1 * psscale, (winheight - y1) * psscale, x2 * psscale, (winheight - y2) * psscale, clear ? 'y' : 'n', fill ? 'y' : 'n'); fflush(printerfile); } #else startdraw(clear); box.left = (long)x1; box.right = (long)x2 + 1; box.top = (long)y1; box.bottom = (long)y2 + 1; prbox.left = (long)(x1 * prnscale + prnoffx); prbox.right = (long)(x2 * prnscale + prnoffx); prbox.top = (long)(y1 * prnscale + prnoffy); prbox.bottom = (long)(y2 * prnscale + prnoffy); if (fill) { if (clear) { FillRect(devcon, &box, backbrush); } else { FillRect(devcon, &box, forebrush); } if (clear) { FillRect(bitcon, &box, backbrush); } else { FillRect(bitcon, &box, forebrush); } if (printer) { FillRect(printer, &prbox, GetStockObject(clear ? WHITE_BRUSH : BLACK_BRUSH)); } } else { if (clear) { FrameRect(devcon, &box, backbrush); } else { FrameRect(devcon, &box, forebrush); } if (clear) { FrameRect(bitcon, &box, backbrush); } else { FrameRect(bitcon, &box, forebrush); } if (printer) { MoveToEx(printer, prbox.left, prbox.top, NULL); LineTo(printer, prbox.left, prbox.bottom); LineTo(printer, prbox.right, prbox.bottom); LineTo(printer, prbox.right, prbox.top); LineTo(printer, prbox.left, prbox.top); } } enddraw(); #endif } void putbit(void) { /* put rect into win */ char *mode, *pm, *bitstring; char m; int xe, ye, we, he; int x, y, xdest, ydest, w, h, n; unsigned short red, green, blue; #ifdef UNIX int should_pixel; XImage *bits = NULL; XGCValues vals; #else /* */ static COLORREF should_pixel; #endif /* */ mode = pop(stSTRING)->pointer; if (print_to_file) { error(sERROR, "Cannot putbit to printer"); return; } if (!winopened) { error(sERROR, "Got no window to draw"); return; } for (pm = mode; *pm; pm++) { *pm = tolower(*pm); } if (!strncmp(mode, "solid", strlen(mode))) { m = 's'; } else if (strlen(mode) && !strncmp(mode, "transparent", strlen(mode))) { m = 't'; } else { sprintf(string, "Invalid mode for putbit: '%s', only 'solid' and 'transparent' are " "allowed", mode); error(sERROR, string); return; } ydest = (int)pop(stNUMBER)->value; xdest = (int)pop(stNUMBER)->value; itransform(&xdest, &ydest); bitstring = pop(stSTRING)->pointer; if (sscanf(bitstring, "rgb %d,%d:%n", &w, &h, &n) != 2 || w < 0 || h < 0) { error(sERROR, "Invalid bitmap (must start with 'rgb X,Y:', where X and Y are >0)"); return; } if (xdest >= winwidth || ydest >= winheight || xdest + w < 0 || ydest + h < 0) { return; } xe = xdest; ye = ydest; we = w; he = h; if (xe < 0) { we += xe; xe = 0; } if (ye < 0) { he += ye; ye = 0; } if (we > winwidth - xe) { we = winwidth - xe; } if (he > winheight - ye) { he = winheight - ye; } readrgb(bitstring, n, NULL, NULL, NULL); #ifdef UNIX if (xe + we > 0 && ye + he > 0) { XGetGCValues(display, gc, GCPlaneMask, &vals); bits = XGetImage(display, backbit, xe, ye, we, he, vals.plane_mask, XYPixmap); if (!bits) { error(sERROR, "Couldn't get bits from window"); return; } } #else /* */ startdraw(FALSE); #endif /* */ for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if (!readrgb(NULL, 0, &red, &green, &blue)) { sprintf(estring, "error while reading line %d of %d, pixel %d of %d from string", y + 1, h, x + 1, w); error(sERROR, estring); return; } should_pixel = rgb_to_pixel(red, green, blue); if (x + xdest >= xe && x + xdest < xe + we && y + ydest >= ye && y + ydest < ye + he) { if (m == 't' && backpixel == should_pixel) { /* do nothing */ } else { #ifdef UNIX XPutPixel(bits, x - xe + xdest, y - ye + ydest, should_pixel); #else SetPixelV(bitcon, xdest + x, ydest + y, should_pixel); #endif } } } } #ifdef UNIX if (bits) { XPutImage(display, window, gc, bits, 0, 0, xe, ye, we, he); XPutImage(display, backbit, gc, bits, 0, 0, xe, ye, we, he); XFlush(display); XDestroyImage(bits); } #else BitBlt(devcon, xe, ye, we, he, bitcon, xe, ye, SRCCOPY); enddraw(); #endif return; } char *getbit(int x1, int y1, int x2, int y2) { /* get rect from win */ int s, x, y, pixel; int xe1, ye1, xe2, ye2; char *bitstring; #ifdef UNIX XImage *bits = NULL; XGCValues vals; int red, green, blue; #endif if (!winopened) { error(sERROR, "Got no window to draw"); return my_strdup(""); } itransform(&x1, &y1); itransform(&x2, &y2); if (x2 < x1) { s = x1; x1 = x2; x2 = s; } if (y2 < y1) { s = y1; y1 = y2; y2 = s; } xe1 = x1; ye1 = y1; xe2 = x2; ye2 = y2; if (xe1 < 0) { xe1 = 0; } if (ye1 < 0) { ye1 = 0; } if (xe2 >= winwidth) { xe2 = winwidth - 1; } if (ye2 >= winheight) { ye2 = winheight - 1; } #ifdef UNIX if (xe1 <= xe2 && ye1 <= ye2) { XGetGCValues(display, gc, GCPlaneMask, &vals); bits = XGetImage(display, backbit, xe1, ye1, xe2 - xe1 + 1, ye2 - ye1 + 1, vals.plane_mask, XYPixmap); if (!bits) { error(sERROR, "Couldn't get bits from window"); return my_strdup(""); } } bitstring = newrgb(x2 - x1 + 1, y2 - y1 + 1); for (y = y1; y <= y2; y++) { for (x = x1; x <= x2; x++) { if (x >= xe1 && x <= xe2 && y >= ye1 && y <= ye2) { pixel = XGetPixel(bits, x - xe1, y - ye1); } else { pixel = backpixel; } pixel_to_rgb(&red, &green, &blue, pixel); addrgb(bitstring, red, green, blue); } } if (bits) { XDestroyImage(bits); } #else /* */ startdraw(FALSE); bitstring = newrgb(x2 - x1 + 1, y2 - y1 + 1); for (y = y1; y <= y2; y++) { for (x = x1; x <= x2; x++) { if (x >= xe1 && x <= xe2 && y >= ye1 && y <= ye2) { pixel = GetPixel(bitcon, x, y); } else { pixel = backpixel; } addrgb(bitstring, GetRValue(pixel), GetGValue(pixel), GetBValue(pixel)); } } enddraw(); #endif return bitstring; } static char *newrgb(int w, int h) { /* create a new bitmap string */ char *bits; sprintf(string, "rgb %d,%d:", w, h); bits = my_malloc(strlen(string) + ((w * h) * 6) + 2); strcpy(bits, string); bitcount = 0; return bits; } static void addrgb(char *bits, unsigned short red, unsigned short green, unsigned short blue) { /* add one rgb pixel to bitstring */ static char *pbits; if (bitcount == 0) { pbits = bits + strlen(bits); } bitcount++; sprintf(pbits, "%02x%02x%02x", red, green, blue); pbits += 6; } static int readrgb(char *bits, int off, unsigned short *red, unsigned short *green, unsigned short *blue) { /* read rgb bit from string one after another */ static char *bitpt; static char *bitstart; int r, g, b; int scanned; if (bits) { bitpt = bits + off; bitstart = bits; return 1; } scanned = sscanf(bitpt, "%02x%02x%02x", &r, &g, &b); if (scanned == 3) { *red = r; *green = g; *blue = b; bitpt += 6; return 1; } if (scanned == EOF) sprintf(estring, "Invalid bitmap: unexpected end of supplied string"); else sprintf(estring, "Invalid bitmap: could only extract %d hex-values from supplied " "string at position %ld: '%.6s'", scanned, bitpt - bitstart, bitpt); error(sERROR, estring); return 0; } void create_openprinter(int num) { /* create command 'openprinter' */ struct command *cmd; cmd = add_command(cOPENPRN); cmd->args = num; } void openprinter(struct command *cmd) { /* opens a printer */ #ifdef WINDOWS char PrinterName[NAMEBUFFLEN]; /* Name of default Printer */ char *p; /* points into PrinterName */ static int first = TRUE; DOCINFO di; float width, height, prnscalex, prnscaley; LOGBRUSH mybrush; RECT interior; #endif /* close file, if already open */ #ifdef UNIX if (printerfile) { closeprinter(); } #endif if (cmd->args == 1) { printerfilename = my_strdup((char *)(pop(stSTRING)->pointer)); print_to_file = TRUE; } else { printerfilename = my_strdup("\0"); print_to_file = FALSE; } #ifdef UNIX if (*printerfilename == '\0') { #ifdef HAVE_MKSTEMP int fd; my_free(printerfilename); printerfilename = my_strdup("/tmp/yabasic-postscript-output-XXXXXX"); fd = mkstemp(printerfilename); if (fd > 0) { printerfile = fdopen(fd, "w"); } else { printerfile = NULL; } #else struct stat s; my_free(printerfilename); printerfilename = my_strdup("/tmp/yabasic.ps"); if (stat(printerfilename, &s) && errno != ENOENT) { sprintf(string, "could not check printerfile '%s': %s", printerfilename, my_strerror(errno)); error(sERROR, string); return; } if (s.st_mode & S_IFLNK) { sprintf(string, "could not print to file '%s'; it is a symbolic link"); error(sERROR, string); return; } printerfile = fopen(printerfilename, "w"); #endif deleteprinterfile = TRUE; } else { printerfile = fopen(printerfilename, "w"); deleteprinterfile = FALSE; } if (!printerfile) { sprintf(string, "could not open file '%s' for printing: %s", printerfilename, my_strerror(errno)); error(sERROR, string); } #endif #ifdef WINDOWS if (first) { /* query win.ini for default printer */ GetProfileString("windows", "device", ",,,", PrinterName, NAMEBUFFLEN); /* truncate printer name */ p = PrinterName; while (*p && *p != ',') { p++; } *p = '\0'; printer = CreateDC(NULL, PrinterName, NULL, NULL); if (!printer) { printer = CreateDC(NULL, "winspool", NULL, NULL); } if (!printer) { error(sERROR, "Couldn't get handle for printer"); return; } /* calculate scaling-factors */ width = (float)GetDeviceCaps(printer, PHYSICALWIDTH); prnoffx = (float)GetDeviceCaps(printer, PHYSICALOFFSETX); prnscalex = (float)(width - 4 * prnoffx) / winwidth; height = (float)GetDeviceCaps(printer, PHYSICALHEIGHT); prnoffy = (float)GetDeviceCaps(printer, PHYSICALOFFSETY); prnscaley = (float)(height - 4 * prnoffy) / winheight; prnscale = (prnscalex < prnscaley) ? prnscalex : prnscaley; /* create printerpens */ mybrush.lbStyle = BS_SOLID; mybrush.lbColor = RGB(255, 255, 255); mybrush.lbHatch = HS_DIAGCROSS; revprinterpen = ExtCreatePen(PS_GEOMETRIC, (long)prnscale, &mybrush, 0, NULL); mybrush.lbStyle = BS_SOLID; mybrush.lbColor = RGB(0, 0, 0); mybrush.lbHatch = HS_DIAGCROSS; printerpen = ExtCreatePen(PS_GEOMETRIC, (long)prnscale, &mybrush, 0, NULL); /* set clipping region */ GetClientRect(window, &interior); SelectClipRgn(printer, NULL); IntersectClipRect(printer, (int)(interior.left * prnscalex + prnoffx), (int)(interior.top * prnscaley + prnoffy), (int)(interior.right * prnscalex + prnoffx), (int)(interior.bottom * prnscaley + prnoffy)); /* create printerfont */ logfont.lfHeight = (long)(-fontheight * prnscale); printerfont = CreateFontIndirect(&logfont); if (printerfont == NULL) { sprintf(string, "Could not create font for printer"); error(sERROR, string); return; } if (!SelectObject(printer, printerfont)) { error(sERROR, "could not select printerfont"); } } di.cbSize = sizeof(DOCINFO); di.lpszDocName = "yabasic grafics"; di.lpszOutput = (print_to_file) ? printerfilename : (LPTSTR)NULL; di.lpszDatatype = (LPTSTR)NULL; di.fwType = 0; if (StartDoc(printer, &di) == SP_ERROR) { error(sERROR, "Couldn't start printing"); return; } StartPage(printer); first = FALSE; #else /* UNIX */ fprintf(printerfile, "%%!PS-Adobe-1.0\n"); fprintf(printerfile, "%%%%Title: %s grafic\n", progname); fprintf(printerfile, "%%%%BoundingBox: 0 0 %i %i\n", (int)(winwidth * psscale), (int)(winheight * psscale)); fprintf(printerfile, "%%%%DocumentFonts: Helvetica\n"); fprintf(printerfile, "%%%%Creator: yabasic\n"); fprintf(printerfile, "%%%%Pages: (atend)\n"); fprintf(printerfile, "%%%%EndComments\n"); fprintf(printerfile, "gsave\n"); fprintf(printerfile, "/txt 4 dict def\n"); fprintf(printerfile, "/rec 6 dict def\n"); fprintf(printerfile, "/tri 8 dict def\n"); fprintf(printerfile, "/cir 5 dict def\n"); fprintf(printerfile, "/rgb 3 dict def\n"); fprintf(printerfile, "rgb /r 0 put\n"); fprintf(printerfile, "rgb /g 0 put\n"); fprintf(printerfile, "rgb /b 0 put\n"); fprintf(printerfile, "0 setgray\n"); fprintf(printerfile, "/M {moveto} def\n"); fprintf(printerfile, "/RL {rlineto} def\n"); fprintf(printerfile, "/L {lineto} def\n"); fprintf(printerfile, "/N {newpath} def\n"); fprintf(printerfile, "/S {stroke} def\n"); fprintf(printerfile, "/CLYN {(y) eq {1 setgray} {rgb /r get rgb /g get rgb " "/b get setrgbcolor} ifelse} def\n"); fprintf(printerfile, "/DO {CLYN N M 0 %g RL %g 0 RL 0 %g RL" " closepath fill (n) CLYN} def\n", psscale, psscale, -psscale); fprintf(printerfile, "/LI {CLYN N M L stroke (n) CLYN} def\n"); fprintf(printerfile, "/CI {mark 6 1 roll cir /fi 3 -1 roll put\n"); fprintf(printerfile, " cir /cl 3 -1 roll put\n"); fprintf(printerfile, " cir /r 3 -1 roll put\n"); fprintf(printerfile, " cir /x 3 -1 roll put\n"); fprintf(printerfile, " cir /y 3 -1 roll put\n"); fprintf(printerfile, " cir /cl get (y) CLYN\n"); fprintf(printerfile, " N cir /x get cir /y get cir /r get 0 360 arc\n"); fprintf(printerfile, " closepath cir /fi get (y) eq {fill} {stroke} ifelse\n"); fprintf(printerfile, " (n) CLYN cleartomark} def\n"); fprintf(printerfile, "/AT {mark 5 1 roll txt /txt 3 -1 roll put\n"); fprintf(printerfile, " txt /xa 3 -1 roll put\n"); fprintf(printerfile, " txt /y 3 -1 roll put\n"); fprintf(printerfile, " txt /x 3 -1 roll put\n"); fprintf(printerfile, " N txt /x get txt /y get M\n"); fprintf(printerfile, " txt /txt get false charpath flattenpath pathbbox\n"); fprintf(printerfile, " pop exch pop exch sub\n"); fprintf(printerfile, " txt /x get exch\n"); fprintf(printerfile, " txt /xa get (c) eq {2 div sub} if\n"); fprintf(printerfile, " txt /xa get (l) eq {pop} if\n"); fprintf(printerfile, " txt /xa get (r) eq {sub} if\n"); fprintf(printerfile, " txt /y get M\n"); fprintf(printerfile, " txt /txt get show cleartomark\n"); fprintf(printerfile, " } def\n"); fprintf(printerfile, "/RE {mark 7 1 roll rec /fi 3 -1 roll put\n"); fprintf(printerfile, " rec /cl 3 -1 roll put\n"); fprintf(printerfile, " rec /y2 3 -1 roll put\n"); fprintf(printerfile, " rec /x2 3 -1 roll put\n"); fprintf(printerfile, " rec /y1 3 -1 roll put\n"); fprintf(printerfile, " rec /x1 3 -1 roll put\n"); fprintf(printerfile, " rec /cl get CLYN\n"); fprintf(printerfile, " N rec /x1 get rec /y1 get M\n"); fprintf(printerfile, " rec /x1 get rec /y2 get L\n"); fprintf(printerfile, " rec /x2 get rec /y2 get L\n"); fprintf(printerfile, " rec /x2 get rec /y1 get L\n"); fprintf(printerfile, " rec /x1 get rec /y1 get L\n"); fprintf(printerfile, " closepath rec /fi get (y) eq {fill} {stroke} ifelse\n"); fprintf(printerfile, " (n) CLYN cleartomark} def\n"); fprintf(printerfile, "/TRI {mark 9 1 roll tri /fi 3 -1 roll put\n"); fprintf(printerfile, " tri /cl 3 -1 roll put\n"); fprintf(printerfile, " tri /y3 3 -1 roll put\n"); fprintf(printerfile, " tri /x3 3 -1 roll put\n"); fprintf(printerfile, " tri /y2 3 -1 roll put\n"); fprintf(printerfile, " tri /x2 3 -1 roll put\n"); fprintf(printerfile, " tri /y1 3 -1 roll put\n"); fprintf(printerfile, " tri /x1 3 -1 roll put\n"); fprintf(printerfile, " tri /cl get CLYN\n"); fprintf(printerfile, " N tri /x1 get tri /y1 get M\n"); fprintf(printerfile, " tri /x2 get tri /y2 get L\n"); fprintf(printerfile, " tri /x3 get tri /y3 get L\n"); fprintf(printerfile, " closepath tri /fi get (y) eq {fill} {stroke} ifelse\n"); fprintf(printerfile, " (n) CLYN cleartomark} def\n"); fprintf(printerfile, "30 30 translate\n"); fprintf(printerfile, "%g setlinewidth\n", psscale); firsttext = TRUE; /* font will be set in text-command */ fflush(printerfile); #endif } void closeprinter() { /* close printer */ #ifdef WINDOWS EndPage(printer); EndDoc(printer); #else /* UNIX */ if (printerfile) { fprintf(printerfile, "showpage\ngrestore\n%%%%Trailer\n"); fclose(printerfile); printerfile = NULL; if (deleteprinterfile) { deleteprinterfile = FALSE; sprintf(string, "lpr %s", printerfilename); if (system(string)) { sprintf(string, "couldn't print '%s'", printerfilename); error(sERROR, string); return; } remove(printerfilename); } } #endif if (printerfilename) { my_free(printerfilename); printerfilename = NULL; } print_to_file = FALSE; } #ifdef UNIX void getwinkey(char *retkey) { /* read a key from grafics window */ static XEvent event; /* what has happened ? */ static KeySym sym; /* keysmbol */ KeySym *keysym = NULL; int numsym; int yk, len, x, y; XSelectInput(display, window, KeyPressMask | ButtonPressMask | ButtonReleaseMask); do { if (keysym) { XFree(keysym); keysym = NULL; } if (!XCheckWindowEvent(display, window, KeyPressMask | ButtonPressMask | ButtonReleaseMask, &event)) { return; } len = XLookupString((XKeyPressedEvent *)&event, retkey, 100, &sym, NULL); if (event.type == KeyPress) { keysym = XGetKeyboardMapping(display, event.xkey.keycode, 1, &numsym); if (keysym) { sym = keysym[0]; XFree(keysym); keysym = NULL; } } } while (event.type == KeyPress && (sym == XK_Shift_L || sym == XK_Shift_R || sym == XK_Control_L || sym == XK_Control_R || sym == XK_Alt_L || sym == XK_Alt_R || sym == XK_Caps_Lock || sym == XK_Shift_Lock)); XSelectInput(display, window, 0); if (event.type == ButtonPress) { x = event.xbutton.x; y = event.xbutton.y; irtransform(&x, &y); sprintf(retkey, "MB%dd+%d:%04d,%04d", event.xbutton.button, event.xbutton.state & 15, x, y); return; } if (event.type == ButtonRelease) { x = event.xbutton.x; y = event.xbutton.y; irtransform(&x, &y); sprintf(retkey, "MB%du+%d:%04d,%04d", event.xbutton.button, event.xbutton.state & 15, x, y); return; } len = XLookupString((XKeyPressedEvent *)&event, retkey, 100, &sym, NULL); retkey[len] = '\0'; if (len != 1 || !isprint(retkey[0])) { yk = -1; keysym = XGetKeyboardMapping(display, event.xkey.keycode, 1, &numsym); if (keysym) { sym = keysym[0]; XFree(keysym); keysym = NULL; } switch (sym) { case XK_BackSpace: yk = kBACKSPACE; break; case XK_Tab: yk = kTAB; break; case XK_Insert: yk = kINS; break; case XK_Home: yk = kHOME; break; case XK_End: yk = kEND; break; case XK_Clear: yk = kCLEAR; break; case XK_Return: yk = kENTER; break; case XK_KP_Enter: yk = kENTER; break; case XK_Escape: yk = kESC; break; case XK_Delete: yk = kDEL; break; case XK_Left: yk = kLEFT; break; case XK_Up: yk = kUP; break; case XK_Right: yk = kRIGHT; break; case XK_Down: yk = kDOWN; break; case XK_Page_Up: yk = kSCRNUP; break; case XK_Page_Down: yk = kSCRNDOWN; break; case XK_F1: yk = kF1; break; case XK_F2: yk = kF2; break; case XK_F3: yk = kF3; break; case XK_F4: yk = kF4; break; case XK_F5: yk = kF5; break; case XK_F6: yk = kF6; break; case XK_F7: yk = kF7; break; case XK_F8: yk = kF8; break; case XK_F9: yk = kF9; break; case XK_F10: yk = kF10; break; case XK_F11: yk = kF11; break; case XK_F12: yk = kF12; break; case XK_F13: yk = kF13; break; case XK_F14: yk = kF14; break; case XK_F15: yk = kF15; break; case XK_F16: yk = kF16; break; case XK_F17: yk = kF17; break; case XK_F18: yk = kF18; break; case XK_F19: yk = kF19; break; case XK_F20: yk = kF20; break; case XK_F21: yk = kF21; break; case XK_F22: yk = kF22; break; case XK_F23: yk = kF23; break; case XK_F24: yk = kF24; break; default: break; } if (yk > 0) { strcpy(retkey, ykey[yk]); } else { sprintf(retkey, "key%x", (int)sym); } } } void gettermkey(char *keybuff) { /* read a key from terminal */ char *skey = NULL; int key; /* returned key */ key = getch(); switch (key) { case ERR: return; case KEY_UP: skey = ykey[kUP]; break; case KEY_DOWN: skey = ykey[kDOWN]; break; case KEY_LEFT: skey = ykey[kLEFT]; break; case KEY_RIGHT: skey = ykey[kRIGHT]; break; case KEY_DC: skey = ykey[kDEL]; break; case KEY_IC: skey = ykey[kINS]; break; case KEY_IL: skey = ykey[kINS]; break; case KEY_CLEAR: skey = ykey[kCLEAR]; break; case KEY_HOME: skey = ykey[kHOME]; break; #ifdef KEY_END case KEY_END: skey = ykey[kEND]; break; #endif case KEY_F0: skey = ykey[kF0]; break; case KEY_F(1): skey = ykey[kF1]; break; case KEY_F(2): skey = ykey[kF2]; break; case KEY_F(3): skey = ykey[kF3]; break; case KEY_F(4): skey = ykey[kF4]; break; case KEY_F(5): skey = ykey[kF5]; break; case KEY_F(6): skey = ykey[kF6]; break; case KEY_F(7): skey = ykey[kF7]; break; case KEY_F(8): skey = ykey[kF8]; break; case KEY_F(9): skey = ykey[kF9]; break; case KEY_F(10): skey = ykey[kF10]; break; case KEY_F(11): skey = ykey[kF11]; break; case KEY_F(12): skey = ykey[kF12]; break; case KEY_F(13): skey = ykey[kF13]; break; case KEY_F(14): skey = ykey[kF14]; break; case KEY_F(15): skey = ykey[kF15]; break; case KEY_F(16): skey = ykey[kF16]; break; case KEY_F(17): skey = ykey[kF17]; break; case KEY_F(18): skey = ykey[kF18]; break; case KEY_F(19): skey = ykey[kF19]; break; case KEY_F(20): skey = ykey[kF20]; break; case KEY_F(21): skey = ykey[kF21]; break; case KEY_F(22): skey = ykey[kF22]; break; case KEY_F(23): skey = ykey[kF23]; break; case KEY_F(24): skey = ykey[kF24]; break; case KEY_BACKSPACE: skey = ykey[kBACKSPACE]; break; case KEY_NPAGE: skey = ykey[kSCRNDOWN]; break; case KEY_PPAGE: skey = ykey[kSCRNUP]; break; case KEY_ENTER: skey = ykey[kENTER]; break; default: if (isprint(key)) { keybuff[0] = key; keybuff[1] = '\0'; } else if (key < 0 || key >= KEY_MAX) { keybuff[0] = '\0'; } else { switch (key) { case 0x1b: skey = ykey[kESC]; break; case 0x7f: skey = ykey[kDEL]; break; case 0xa: skey = ykey[kENTER]; break; case 0x9: skey = ykey[kTAB]; break; default: sprintf(keybuff, "key%x", key); } } break; } if (skey) { strcpy(keybuff, skey); } } #endif void x11_send_expose() { /* send expose event under unix */ #ifdef UNIX XExposeEvent event; if (!winopened) { error(sERROR, "No window to send event to"); return; } memset(&event, 0, sizeof(XExposeEvent)); event.type = Expose; if (!display) display = XOpenDisplay(displayname); event.display = display; event.window = window; event.x = 0; event.y = 0; event.width = winwidth; event.height = winheight; XSendEvent(display, window, 1, ExposureMask, (XEvent *)&event); XSync(display, 0); error(sNOTE, "Sent X11-event Expose to my own window"); #else error(sERROR, "'debug_internal' 'x11_send_expose' is not available under windows"); #endif } void determine_display_size(void) { /* determine size of display and store within global vars */ static int succeeded = FALSE; #ifdef UNIX static int failed = FALSE; int num; if (succeeded) return; if (failed) return; if (!display) display = XOpenDisplay(displayname); if (!display) { failed = TRUE; return; } num = DefaultScreen(display); displaywidth = DisplayWidth(display, num); displayheight = DisplayHeight(display, num); #else if (succeeded) return; /* if screen scaling is active (e.g. scaling factor of 150%), this returns * 1280 instead of 1920 */ displaywidth = GetSystemMetrics(SM_CXSCREEN); displayheight = GetSystemMetrics(SM_CYSCREEN); #endif succeeded = TRUE; } yabasic-2.91.4/INSTALL0000777000175000017500000000011514735711653007754 Just execute make install as root to install yabasic on your machine. yabasic-2.91.4/install-sh0000777000175000017500000003452314735711653010736 #!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: yabasic-2.91.4/io.c0000777000175000017500000013641615055044445007506 /* YABASIC --- a simple Basic Interpreter written by Marc Ihm 1995-2025 more info at www.yabasic.de io.c -- code for screen and file i/o This file is part of yabasic and may be copied under the terms of MIT License which can be found in the file LICENSE. */ /* ------------- includes ---------------- */ #ifndef YABASIC_INCLUDED #include "yabasic.h" /* all prototypes and structures */ #endif /* ------------- local defines ----------------- */ #define YC_BLACK 0 #define YC_WHITE 1 #define YC_RED 2 #define YC_BLUE 3 #define YC_GREEN 4 #define YC_YELLOW 5 #define YC_CYAN 6 #define YC_MAGENTA 7 #ifndef COLOR_BLACK #define COLOR_BLACK 0 #define COLOR_RED 1 #define COLOR_GREEN 2 #define COLOR_YELLOW 3 #define COLOR_BLUE 4 #define COLOR_MAGENTA 5 #define COLOR_CYAN 6 #define COLOR_WHITE 7 #endif #ifndef A_COLOR #define A_COLOR 0xff00 #endif /* ------------- external references ---------------- */ extern int mylineno; /* current line number */ extern int yyparse(); /* call bison parser */ /* ------------- local functions ---------------- */ static int onechar(void); /* read one char from currentinstream */ static void backchar(int); /* put char back into stream */ static void readline(void); /* read one line from current stream */ static void con_xcap_init(void); /* initialize console extra capabilities */ static void initcol(void); /* initialize colors */ int checkstream(void); /* test if currst is still valid */ #ifdef WINDOWS static DWORD keythread(LPWORD); /* wait for key input from console */ static int is_valid_key(INPUT_RECORD *); /* check if input rec is valid key */ static void decode_key(int, char *); /* decode keycode into string */ #endif int yc2oc(int, int); /* convert a yabasic color to operating system color */ char *yc2short(int); /* convert yabasic colours to short colour name */ int oc2yc(int); /* convert an operating system color to yabasic color */ /* ------------- global variables ---------------- */ static int prompted; /* TRUE, if prompt is fresh */ FILE *streams[FOPEN_MAX]; /* file streams */ int stream_modes[FOPEN_MAX]; /* modes for streams */ int lprstream = -1; /* stream associated with lineprinter */ static int currstr = STDIO_STREAM; /* currently switched stream */ static FILE *cinstr; /* current stream for input */ static FILE *coutstr; /* current stream for output */ static char linebuffer[INBUFFLEN]; /* buffer for one line of input */ int con_xcap_inized = FALSE; /* true, if console extra capabilities have been initialized */ static char *currchar; /* current char to read */ #ifdef UNIX FILE *lineprinter = NULL; /* handle for line printer */ #else static short stdfc; /* standard foreground color for console */ static short stdbc; /* standard background color for console */ static short stdfc_orig; /* initial standard foreground color for console */ static short stdbc_orig; /* initial standard background color for console */ HANDLE gotwinkey = INVALID_HANDLE_VALUE; /* mutex to signal key reception */ char conkeybuff[100]; /* Key received from console */ char winkeybuff[100]; /* Key received from window */ HANDLE wthandle = INVALID_HANDLE_VALUE; /* handle of win thread */ DWORD ktid; /* id of inkey thread */ int LINES = 0; /* number of lines on screen */ int COLS = 0; /* number of columns on screen */ HANDLE ConsoleInput; /* handle for console input */ HANDLE ConsoleOutput; /* handle for console output */ HANDLE lineprinter = INVALID_HANDLE_VALUE; /* handle for line printer */ #endif /* ------------- functions ---------------- */ void create_print(char type) /* create command 'print' */ { struct command *cmd; cmd = add_command(cPRINT); cmd->pointer = my_malloc(sizeof(int)); /* store type of print */ cmd->tag = type; } void print(struct command *cmd) /* print on screen */ { int type; struct stackentry *p, *q, *r; static int last = 'n'; char *s; long int n; double d; #ifdef UNIX #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif int x, y; #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #endif r = NULL; type = cmd->tag; if (!checkstream()) { return; } switch (type) { case 'n': /* print newline */ if (con_xcap_inized && coutstr == stdout) { #ifdef WINDOWS onestring("\r\n"); break; #else getyx(stdscr, y, x); if (y >= LINES - 1) { scrl(1); y = y - 1; } move(y + 1, 0); refresh(); break; #endif } else { string[0] = '\n'; if (abs(currstr) == lprstream) { string[1] = '\r'; string[2] = '\0'; } else { string[1] = '\0'; } } onestring(string); break; case 't': /* print tab */ string[0] = '\t'; string[1] = '\0'; onestring(string); break; case 'd': /* print double value */ p = pop(stNUMBER); d = p->value; n = (int)d; if (n == d && d <= LONG_MAX && d >= LONG_MIN) { sprintf(string, "%s%ld", (last == 'd') ? " " : "", n); } else { sprintf(string, "%s%g", (last == 'd') ? " " : "", d); } onestring(string); break; case 'U': r = pop(stSTRING); case 'u': /* print using */ p = pop(stSTRING); q = pop(stNUMBER); type = 'd'; s = string; if (last == 'd') { *s = ' '; s++; } if (!myformat(s, INBUFFLEN, q->value, p->pointer, r ? r->pointer : NULL)) { break; } onestring(string); break; case 's': p = pop(stSTRING); onestring((char *)p->pointer); break; } last = type; } void mymove(void) /* move to specific position on screen */ { int x, y; #ifdef WINDOWS COORD coord; #endif y = (int)pop(stNUMBER)->value; if (y < 0) { y = 0; } if (y > LINES - 1) { y = LINES - 1; } x = (int)pop(stNUMBER)->value; if (x < 0) { x = 0; } if (x > COLS - 1) { x = COLS - 1; } if (!con_xcap_inized) { error(sERROR, "need to call 'clear screen' first"); return; } #ifdef UNIX move(y, x); refresh(); #else coord.X = x; coord.Y = y; SetConsoleCursorPosition(ConsoleOutput, coord); #endif } void clearscreen(void) /* clear entire screen */ { #ifdef WINDOWS DWORD written; /* number of chars actually written */ COORD coord; /* coordinates to start writing */ #endif if (!con_xcap_inized) { con_xcap_init(); } #ifdef UNIX clear(); refresh(); #else coord.X = 0; coord.Y = 0; FillConsoleOutputCharacter(ConsoleOutput, ' ', LINES * COLS, coord, &written); /* This use of attributes needs to be consistent with the use in colour() */ SetConsoleTextAttribute(ConsoleOutput, (WORD)(stdfc | stdbc)); FillConsoleOutputAttribute(ConsoleOutput, (WORD)(stdfc | stdbc), LINES * COLS, coord, &written); SetConsoleCursorPosition(ConsoleOutput, coord); /* In theory, this does nothing more, than already done with the api-calls above; however to avoid coloring-problems this seems necessary nevertheless. See the comments around system("color") in main.c for some more motivation */ system("cls"); #endif } static void con_xcap_init(void) /* initialize console extra capabilities, e.g. curses */ { #ifdef WINDOWS CONSOLE_SCREEN_BUFFER_INFO coninfo; /* receives console size */ #endif if (con_fore_col != -1 && con_back_col == -1) { /* lifting this restriction leads to problems under linux: Poking only * background violates check 1 in input_with_color.yab */ sprintf(estring, "only 'console_foreground_color' has been poked, but you " "need to poke 'console_background_color' too"); error(sERROR, estring); return; } if (con_fore_col == -1 && con_back_col != -1) { sprintf(estring, "only 'console_background_color' has been poked, but you " "need to poke 'console_foreground_color' too"); error(sERROR, estring); return; } #ifdef UNIX if (tcsetpgrp(STDIN_FILENO, getpgid(getpid()))) { sprintf(estring, "could not get control of terminal: %s", my_strerror(errno)); error(sERROR, estring); return; }; if (!initscr()) { error(sERROR, "could not initialize curses"); return; }; initcol(); setscrreg(0, LINES); scrollok(stdscr, TRUE); leaveok(stdscr, TRUE); keypad(stdscr, TRUE); notimeout(stdscr, FALSE); /* wait after escape for escape-sequence */ set_escdelay(10); curs_set(0); intrflush(stdscr, FALSE); if (con_fore_inten == cciBRIGHT) { attron(A_BOLD); } #else GetConsoleScreenBufferInfo(ConsoleOutput, &coninfo); COLS = coninfo.srWindow.Right + 1; LINES = coninfo.srWindow.Bottom + 1; initcol(); #endif con_xcap_inized = TRUE; } void con_xcap_deinit(void) /* bring console back to normal/inital state */ { if (!con_xcap_inized) { return; } #ifdef UNIX endwin(); #else SetConsoleTextAttribute(ConsoleOutput, (WORD)(stdfc_orig | stdbc_orig)); #endif con_xcap_inized = FALSE; } char *inkey(double maxtime) /* get char from keyboard */ { char retkey[100]; long int max, now, start, left; #ifdef WINDOWS DWORD initial; DWORD oflags; /* saves normal state of console input buffer */ DWORD flags; /* new input mode for console input buffer */ HANDLE evn[2]; /* events to wait for */ DWORD wait_result; /* return value of wait operation */ INPUT_RECORD inrec; DWORD num; #else fd_set readfds; struct timeval tv; int maxfd; int winfd, termfd; int ret; #endif if (maxtime >= 0.0 && maxtime < 0.01) { maxtime = 0.01; } if (!con_xcap_inized) { error(sERROR, "need to call 'clear screen' first"); return my_strdup(""); } retkey[0] = '\0'; left = max = (long int)(maxtime * 1000000); /* Initialization */ #ifdef UNIX /* events */ winfd = (winopened && display) ? ConnectionNumber(display) : 0; termfd = fileno(stdin); maxfd = (termfd > winfd) ? termfd : winfd; /* timing */ gettimeofday(&tv, NULL); start = tv.tv_sec * 1000000 + tv.tv_usec; /* terminal */ noecho(); cbreak(); refresh(); #elif WINDOWS /* events */ if (gotwinkey == INVALID_HANDLE_VALUE) { gotwinkey = CreateEvent(NULL, FALSE, FALSE, NULL); } /* timing */ initial = GetTickCount(); start = 1000 * (GetTickCount() - initial); GetConsoleMode(ConsoleInput, &oflags); flags = oflags & ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); SetConsoleMode(ConsoleInput, flags); /* terminal */ evn[0] = gotwinkey; evn[1] = ConsoleInput; #endif while (((max >= 0 && left > 0) || max < 0) && !retkey[0]) { /* already got key ? */ #ifdef UNIX if (winopened && display && XPending(display)) { getwinkey(retkey); if (retkey[0]) { break; } } /* prepare to wait for key */ FD_ZERO(&readfds); if (winfd) { FD_SET(winfd, &readfds); } FD_SET(termfd, &readfds); #elif WINDOWS if (*winkeybuff) { strcpy(retkey, winkeybuff); winkeybuff[0] = '\0'; return my_strdup(retkey); } conkeybuff[0] = winkeybuff[0] = '\0'; #endif /* wait for key */ if (max >= 0) { #ifdef UNIX tv.tv_sec = left / 1000000; tv.tv_usec = left % 1000000; ret = select(maxfd + 1, &readfds, NULL, NULL, &tv); #elif WINDOWS wait_result = WaitForMultipleObjects(2, evn, FALSE, (DWORD)(left / 1000)); #endif } else { #ifdef UNIX ret = select(maxfd + 1, &readfds, NULL, NULL, NULL); #elif WINDOWS wait_result = WaitForMultipleObjects(2, evn, FALSE, INFINITE); #endif } /* report result */ #ifdef UNIX if (ret == -1) { error(sERROR, "waiting for input failed"); break; } #elif WINDOWS if (wait_result == WAIT_FAILED) { error(sERROR, "waiting for input failed"); break; } #endif /* collect key */ #ifdef UNIX if (FD_ISSET(termfd, &readfds)) { gettermkey(retkey); } else if (FD_ISSET(winfd, &readfds)) { getwinkey(retkey); } #elif WINDOWS if (wait_result == WAIT_OBJECT_0 + 1) { do { ReadConsoleInput(ConsoleInput, &inrec, 1, &num); GetNumberOfConsoleInputEvents(ConsoleInput, &num); } while (!is_valid_key(&inrec) && num > 0); conkeybuff[0] = '\0'; if (is_valid_key(&inrec)) { if (isprint(inrec.Event.KeyEvent.uChar.AsciiChar)) { conkeybuff[0] = inrec.Event.KeyEvent.uChar.AsciiChar; conkeybuff[1] = '\0'; } else { if (inrec.Event.KeyEvent.wVirtualKeyCode) { decode_key(inrec.Event.KeyEvent.wVirtualKeyCode, conkeybuff); } } } } else if (wait_result == WAIT_OBJECT_0) { /* key is already stored in winkeybuff */ } if (*winkeybuff) { strcpy(retkey, winkeybuff); } else { strcpy(retkey, conkeybuff); } conkeybuff[0] = winkeybuff[0] = '\0'; #endif /* adjust timing */ #ifdef UNIX gettimeofday(&tv, NULL); now = tv.tv_sec * 1000000 + tv.tv_usec; #elif WINDOWS now = 1000 * (GetTickCount() - initial); #endif left = max - now + start; } /* restore terminal state */ #ifdef UNIX echo(); nocbreak(); refresh(); #elif WINDOWS SetConsoleMode(ConsoleInput, oflags); #endif return my_strdup(retkey); } #ifdef WINDOWS static int is_valid_key(INPUT_RECORD *rec) /* check if input rec contains valid key */ { if (rec->EventType != KEY_EVENT || !rec->Event.KeyEvent.bKeyDown || rec->Event.KeyEvent.wVirtualKeyCode == VK_SHIFT || rec->Event.KeyEvent.wVirtualKeyCode == VK_CONTROL) { return FALSE; } return TRUE; } static void decode_key(int key, char *to) /* decode keycode into string */ { int skey; skey = -1; switch (key) { case 0x1b: skey = kESC; break; case 0x0d: skey = kENTER; break; case 0x09: skey = kTAB; break; case 0x21: skey = kSCRNUP; break; case 0x22: skey = kSCRNDOWN; break; case 0x70: skey = kF1; break; case 0x71: skey = kF2; break; case 0x72: skey = kF3; break; case 0x73: skey = kF4; break; case 0x74: skey = kF5; break; case 0x75: skey = kF6; break; case 0x76: skey = kF7; break; case 0x77: skey = kF8; break; case 0x78: skey = kF9; break; case 0x79: skey = kF10; break; case 0x7a: skey = kF11; break; case 0x7b: skey = kF12; break; case 0x24: skey = kHOME; break; case 0x23: skey = kEND; break; case 0x2d: skey = kINS; break; case 0x2e: skey = kDEL; break; case 0x08: skey = kBACKSPACE; break; case 0x27: skey = kRIGHT; break; case 0x25: skey = kLEFT; break; case 0x28: skey = kDOWN; break; case 0x26: skey = kUP; break; default: sprintf(conkeybuff, "key%x", key); } if (skey > 0) { strcpy(to, ykey[skey]); } } #endif char *replace_escapes(char *string) /* replace \n,\a, etc. */ { char *from, *to; char *p; int val; static char *hexdigits = "0123456789abcdef"; from = to = string; while (*from) { if (*from == '\\') { from++; switch (*from) { case 'n': *to = '\n'; break; case 't': *to = '\t'; break; case 'v': *to = '\v'; break; case 'b': *to = '\b'; break; case 'r': *to = '\r'; break; case 'f': *to = '\f'; break; case 'a': *to = '\a'; break; case '\\': *to = '\\'; break; case '\?': *to = '\?'; break; case '\'': *to = '\''; break; case '\"': *to = '\"'; break; case 'x': val = 0; if ((p = strchr(hexdigits, tolower(*(from + 1)))) && p - hexdigits < 16) { from++; val = p - hexdigits; if ((p = strchr(hexdigits, tolower(*(from + 1)))) && p - hexdigits < 16) { from++; val *= 16; val += p - hexdigits; } } *to = (char)val; break; default: *to = '\\'; to++; *to = *from; } } else { *to = *from; } from++; to++; } *to = '\0'; return string; } int count_backslashes( char *text) /* count number of backslashes up to position in string */ { int cnt = 0; while (*text == '\\') { text--; cnt++; } return cnt; } void create_myopen(int num) /* create command 'myopen' */ { struct command *cmd; cmd = add_command(cOPEN); cmd->tag = num; } void myopen(struct command *cmd) /* open specified file for given name */ { #ifdef WINDOWS char PrinterName[NAMEBUFFLEN]; /* Name of default Printer */ char *n; /* points into PrinterName */ DOC_INFO_1 di; #endif FILE *handle = NULL; int stream, i; char *name = NULL; char *mode = NULL; char **pmode; static char *valid_modes[] = {"r", "w", "a", "rb", "wb", "ab", ""}; static int smodes[] = {mREAD, mWRITE, mWRITE, mREAD, mWRITE, mWRITE}; int smode; struct stackentry *p; int has_mode, has_stream, printer; /* decode cmd->tag */ has_stream = cmd->tag & OPEN_HAS_STREAM; has_mode = cmd->tag & OPEN_HAS_MODE; printer = cmd->tag & OPEN_PRINTER; if (has_mode) { mode = my_strdup(pop(stSTRING)->pointer); } else { mode = printer ? my_strdup("w") : my_strdup("r"); } if (printer) { name = my_strdup("/usr/bin/lpr"); } else { name = my_strdup(pop(stSTRING)->pointer); } if (has_stream) { stream = (int)pop(stNUMBER)->value; } else { stream = 0; for (i = 1; i < FOPEN_MAX - 4; i++) { if (stream_modes[i] == mCLOSED) { stream = i; break; } } if (!stream) { sprintf(estring, "reached maximum number of open files"); errorcode = 5; goto open_done; } } p = push(); p->value = 0.; p->type = stNUMBER; if (printer && print_to_file) { sprintf(estring, "cannot open printer: already printing grafics"); errorcode = 6; goto open_done; } if (badstream(stream, 1)) { sprintf(estring, "invalid stream number %d", stream); errorcode = 9; goto open_done; } if (stream_modes[stream] != mCLOSED) { sprintf(estring, "stream already in use"); errorcode = 2; goto open_done; } smode = 0; for (pmode = valid_modes; **pmode; pmode++) { if (!strcmp(*pmode, mode)) { break; } smode++; } if (!**pmode) { sprintf(estring, "\'%s\' is not a valid filemode", mode); errorcode = 3; goto open_done; } if (printer) { #ifdef UNIX lineprinter = popen(name, "w"); if (!lineprinter) { sprintf(estring, "could not open line printer"); errorcode = 7; goto open_done; } #else /* query win.ini for default printer */ GetProfileString("windows", "device", ",,,", PrinterName, NAMEBUFFLEN); /* truncate printer name */ n = PrinterName; while (*n && *n != ',') { n++; } *n = '\0'; OpenPrinter(PrinterName, &lineprinter, NULL); di.pDocName = "yabasic text"; di.pOutputFile = (LPTSTR)NULL; di.pDatatype = "RAW"; if (!StartDocPrinter(lineprinter, 1, (LPBYTE)&di)) { sprintf(estring, "could not open line printer"); errorcode = 7; goto open_done; } StartPagePrinter(lineprinter); #endif lprstream = stream; } else { handle = fopen(name, mode); if (handle == NULL) { sprintf(estring, "could not open '%s': %s", name, my_strerror(errno)); errorcode = 4; goto open_done; } streams[stream] = handle; } stream_modes[stream] = smodes[smode]; errorcode = 0; p->value = stream; open_done: if (name) { my_free(name); } if (mode) { my_free(mode); } } void checkopen(void) /* check, if open has been sucessfully */ { double result; result = pop(stNUMBER)->value; if (result <= 0) { error(sERROR, estring); } } void myclose(void) /* close the specified stream */ { int s; #ifdef WINDOWS DWORD written; #endif s = (int)pop(stNUMBER)->value; if (badstream(s, 0)) { return; } if (stream_modes[s] == mCLOSED) { sprintf(string, "stream %d already closed", s); error(sWARNING, string); return; } if (s == lprstream) { #ifdef UNIX pclose(lineprinter); #else WritePrinter(lineprinter, "\f", 2, &written); EndPagePrinter(lineprinter); EndDocPrinter(lineprinter); ClosePrinter(lineprinter); lineprinter = INVALID_HANDLE_VALUE; #endif lprstream = -1; } else { fclose(streams[s]); } streams[s] = NULL; stream_modes[s] = mCLOSED; } void myseek(struct command *cmd) /* reposition file pointer */ { int s, p, m, i; struct stackentry *pp; char *mode; if (cmd->type == cSEEK2) { mode = (char *)my_strdup(pop(stSTRING)->pointer); } else { mode = my_strdup("begin"); } p = (int)pop(stNUMBER)->value; s = (int)pop(stNUMBER)->value; pp = push(); pp->value = 0.; pp->type = stNUMBER; for (i = 0; mode[i]; i++) { mode[i] = tolower(mode[i]); } if (!strcmp(mode, "begin")) { m = SEEK_SET; } else if (!strcmp(mode, "end")) { m = SEEK_END; } else if (!strcmp(mode, "here")) { m = SEEK_CUR; } else { sprintf(estring, "seek mode '%s' is none of begin,end,here", mode); errorcode = 12; my_free(mode); return; } my_free(mode); if (badstream(s, 0)) { return; } if (!(stream_modes[s] & (mREAD | mWRITE))) { sprintf(estring, "stream %d not open", s); errorcode = 11; return; } if (fseek(streams[s], (long)p, m)) { sprintf(estring, "could not position stream %d to byte %d", s, p); errorcode = 10; return; } pp->value = 1.0; } void create_pps(int type, int input) /* create command push_stream or pop_stream */ { struct command *cmd; cmd = add_command(type); cmd->args = input; } void push_stream(struct command *cmd) /* push current stream on stack and switch to new one */ { static int oldstream = STDIO_STREAM; struct stackentry *s; int stream; stream = (int)pop(stNUMBER)->value; if (badstream(stream, 0)) { return; } if (!cmd->args) { stream = -stream; } s = push(); s->type = stNUMBER; s->value = oldstream; if (severity_threshold <= sDEBUG) { sprintf(string, "pushing %d on stack, switching to %d", oldstream, stream); error(sDEBUG, string); } oldstream = stream; mystream(stream); } void pop_stream(void) /* pop stream from stack and switch to it */ { int stream; stream = (int)pop(stNUMBER)->value; if (severity_threshold <= sDEBUG) { sprintf(string, "popping %d from stack, switching to it", stream); error(sDEBUG, string); } mystream(stream); } void mystream(int stream) /* switch to specified stream */ { int stdio, input; stdio = (abs(stream) == STDIO_STREAM); input = (stream > 0); currstr = stream; if (stream < 0) { stream = -stream; } if (badstream(stream, 0)) { return; } if (stdio) { cinstr = stdin; coutstr = stdout; } else { cinstr = coutstr = NULL; if (input) { cinstr = streams[stream]; } else { coutstr = streams[stream]; } } } int checkstream(void) /* test if currst is still valid */ { int stdio, input; stdio = (abs(currstr) == STDIO_STREAM); input = (currstr > 0); if (!stdio) { if (input && !(stream_modes[abs(currstr)] & mREAD)) { sprintf(string, "stream %d not open for reading", abs(currstr)); error(sERROR, string); return FALSE; } if (!input && !(stream_modes[abs(currstr)] & (mWRITE | mPRINT))) { sprintf(string, "stream %d not open for writing or printing", abs(currstr)); error(sERROR, string); return FALSE; } } return TRUE; } void testeof(struct command *cmd) /* check if specified stream is at eof */ { int s, c; struct stackentry *result; FILE *str; s = (int)pop(stNUMBER)->value; if (s && badstream(s, 0)) { return; } result = push(); result->type = stNUMBER; if (s && !(stream_modes[s] & mREAD)) { result->value = 1.; return; } str = s ? streams[s] : stdin; c = getc(str); if (c == EOF) { result->value = 1.; return; } result->value = 0.; ungetc(c, str); return; } int badstream(int stream, int errcode) /* test for valid stream id */ { if (stream != STDIO_STREAM && (stream > FOPEN_MAX - 4 || stream <= 0)) { sprintf(errcode ? estring : string, "invalid stream: %d (can handle only streams from 1 to %d)", stream, FOPEN_MAX - 4); if (errcode) { errorcode = errcode; } else { error(sERROR, string); } return TRUE; } return FALSE; } void create_myread(char type, int tileol) /* create command 'read' */ { struct command *cmd; cmd = add_command(cREAD); cmd->args = tileol; /* true, if read should go til eol */ cmd->tag = type; /* can be 'd' or 's' */ } void myread(struct command *cmd) /* read string or double */ { double d; static char buffer[INBUFFLEN]; /* buffer with current input */ int numread; /* number of bytes read */ int tileol; /* true, if read should go til end of line */ struct stackentry *s; int currch; /* current character */ numread = 0; /* no chars read'til now */ buffer[0] = '\0'; tileol = cmd->args; /* skip leading whitespace */ if (!tileol) { do { currch = onechar(); } while (currch == ' ' || currch == '\t'); /* put back last char */ if (currch != EOF && currch != '\0') { backchar(currch); } if (currch == '\0' || currch == EOF) { goto done; } } /* read chars */ do { currch = onechar(); buffer[numread] = currch; numread++; } while (((tileol && currch != '\0') || (!tileol && currch != ' ' && currch != '\t' && currch != '\0')) && currch != EOF && numread < INBUFFLEN); /* put back last char */ if (currch != EOF && currch != '\0') { backchar(currch); } /* and remove it from buff */ if (currch != EOF) { numread--; } buffer[numread] = '\0'; if (currch == '\0' || currch == EOF) { goto done; } /* skip trailing whitespace */ if (!tileol) { do { currch = onechar(); } while (currch == ' ' || currch == '\t'); if (currch != EOF && currch != '\0') { backchar(currch); } } done: if (cmd->tag == 's') { /* read string */ s = push(); s->type = stSTRING; s->pointer = my_strdup(buffer); } else { /* read double */ s = push(); s->type = stNUMBER; s->value = 0.0; if (buffer[0] && (sscanf(buffer, "%lf", &d) == 1)) { s->value = d; } } } static void readline(void) /* read one line from current stream */ { #ifdef UNIX char *nl; /* position of newline */ #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif int x, y; #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #else int read; #endif if (!checkstream()) { return; } linebuffer[0] = '\0'; #ifdef UNIX if (con_xcap_inized && cinstr == stdin) { curs_set(1); getyx(stdscr, y, x); #ifdef HAVE_GETNSTR getnstr(linebuffer, INBUFFLEN); #else getstr(linebuffer); #endif curs_set(0); if ((nl = strchr(linebuffer, '\0'))) { *nl = '\n'; *(nl + 1) = '\0'; } if (y >= LINES - 1) { scrl(1); } refresh(); } #else if (con_xcap_inized && cinstr == stdin) { FlushConsoleInputBuffer(ConsoleInput); ReadConsole(ConsoleInput, linebuffer, INBUFFLEN, &read, NULL); if (read >= 2) { linebuffer[read - 2] = '\n'; linebuffer[read - 1] = '\0'; } } #endif else { (void)!fgets(linebuffer, INBUFFLEN, cinstr); } currchar = linebuffer; prompted = FALSE; } static int onechar() /* read one char from cinstr */ { int ch; if (!checkstream()) { return '\0'; } if (cinstr == stdin) { if (!currchar || !*currchar) { readline(); } do { ch = *currchar; currchar++; } while (!(!iscntrl(ch) || strchr(" \t\n", ch) || ch == '\0')); } else { do { ch = fgetc(cinstr); } while (!(!iscntrl(ch) || strchr(" \t\n", ch) || ch == '\0' || ch == EOF)); } if (ch == '\n' || ch == EOF) { return '\0'; } else { return ch; } } static void backchar(int ch) /* put char back into stream */ { if (!checkstream()) { return; } if (cinstr == stdin) { if (currchar > linebuffer) { currchar--; } } else { ungetc(ch, cinstr); } } void chkprompt() /* print an intermediate prompt if necessary */ { if (cinstr == stdin && (!currchar || !*currchar) && !prompted) { onestring("?"); } } void create_onestring(char *str) /* create command 'onestring' */ { struct command *cmd; cmd = add_command(cONESTRING); cmd->pointer = my_strdup(str); } void onestring(char *s) /* write string to current file */ { #ifdef WINDOWS DWORD len, written; DWORD consoleflags; #endif if (!checkstream()) { return; } if (con_xcap_inized && abs(currstr) == STDIO_STREAM) { #ifdef UNIX addstr(s); refresh(); #else len = strlen(s); GetConsoleMode(ConsoleOutput, &consoleflags); WriteConsole(ConsoleOutput, s, len, &written, NULL); #endif } else if (abs(currstr) == lprstream) { #ifdef UNIX fprintf(lineprinter, "%s", s); fflush(lineprinter); #else len = strlen(s); WritePrinter(lineprinter, s, len, &written); #endif } else { fprintf(coutstr, "%s", s); fflush(coutstr); } prompted = TRUE; } void create_colour(int flag) /* create command 'colour' */ { struct command *c; c = add_command(cCOLOUR); c->args = flag; } void colour(struct command *cmd) /* switch on colour */ { char *fore = NULL, *back = NULL, *p; int fc, bc; if (cmd->args && !con_xcap_inized) { error(sERROR, "need to call 'clear screen' first"); return; } if (cmd->args == 0) { /* colour clause */ if (!con_xcap_inized) { return; } #ifdef UNIX /* Turn off all attributes including color, probably bringing us back to * COLOR_PAIR(0) */ attrset(A_NORMAL); if (con_fore_inten == cciBRIGHT) { attron(A_BOLD); } #else /* This use of attributes needs to be consisten with the use in * clearscreen() */ SetConsoleTextAttribute(ConsoleOutput, (WORD)(stdfc | stdbc)); return; #endif } else if (cmd->args == 1) { /* reverse */ #ifdef UNIX attrset(A_REVERSE); return; #else SetConsoleTextAttribute(ConsoleOutput, (WORD)(yc2oc(oc2yc(stdfc), FALSE) | yc2oc(oc2yc(stdbc), TRUE))); return; #endif } else { /* decode extended colour-clause */ #ifdef UNIX if (!has_colors()) { pop(stSTRING); if (cmd->args == 3) { pop(stSTRING); } attrset(A_REVERSE); return; } #endif if (cmd->args == 2) { back = NULL; fore = pop(stSTRING)->pointer; for (p = fore; *p; p++) { *p = tolower(*p); } } else { back = pop(stSTRING)->pointer; for (p = back; *p; p++) { *p = tolower(*p); } fore = pop(stSTRING)->pointer; for (p = fore; *p; p++) { *p = tolower(*p); } } fc = name2yc(fore); if (fc < 0) { sprintf(estring, "unknown foreground colour: '%s'", fore); error(sERROR, estring); } if (back) { bc = name2yc(back); if (fc < 0) { sprintf(estring, "unknown background colour: '%s'", back); error(sERROR, estring); } } #ifdef UNIX if (back) { /* Encoding and decoding around init_pair, COLOR_PAIR and PAIR_NUMBER must * match */ attrset(COLOR_PAIR(fc + bc * 8 + 1)); } else { attrset(COLOR_PAIR(65 + fc)); } if (con_fore_inten == cciBRIGHT) { attron(A_BOLD); } #else SetConsoleTextAttribute( ConsoleOutput, (WORD)(yc2oc(fc, TRUE) | (back ? yc2oc(bc, FALSE) : stdbc))); #endif } } static void initcol(void) /* initialize console colors */ { static int first = TRUE; #ifdef UNIX short f, b; #else CONSOLE_SCREEN_BUFFER_INFO csbi; #endif if (!first) { return; } first = FALSE; #ifdef UNIX if (!has_colors()) { return; } start_color(); /* This makes color pair 0 to consist of default fore- and background */ assume_default_colors(yc2oc(con_fore_col, true), yc2oc(con_back_col, false)); /* 73 = 8 * 8 + 8 + 1 = pairs + fore-only + immutable-pair-0 */ if (COLOR_PAIRS < 73) return; for (b = 0; b < 8; b++) { for (f = 0; f < 8; f++) { /* arguments are fore, back. Skip color pair 0 which has been set above */ /* encoding and decoding around init_pair, COLOR_PAIR and PAIR_NUMBER must * match */ init_pair(f + b * 8 + 1, yc2oc(f, TRUE), yc2oc(b, FALSE)); } } for (f = 0; f < 8; f++) { init_pair(65 + f, yc2oc(f, TRUE), -1); } if (con_fore_inten == cciLEGACY) { init_color(COLOR_YELLOW, 1000, 1000, 0); } #else GetConsoleScreenBufferInfo(ConsoleOutput, &csbi); stdfc_orig = csbi.wAttributes & (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED); if (con_fore_col == -1) { stdfc = stdfc_orig; } else { stdfc = yc2oc(con_fore_col, TRUE); } stdbc_orig = csbi.wAttributes & (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED); if (con_back_col == -1) { stdbc = stdbc_orig; } else { stdbc = yc2oc(con_back_col, FALSE); } if (con_fore_inten == cciBRIGHT) { stdfc |= FOREGROUND_INTENSITY; } #endif } int name2yc(char *name) /* convert a color name to an integer */ { char *c; for (c = name; *c; c++) { *c = tolower(*c); } if (!strcmp(name, "black") || !strcmp(name, "bla")) { return YC_BLACK; } if (!strcmp(name, "white") || !strcmp(name, "whi")) { return YC_WHITE; } if (!strcmp(name, "red") || !strcmp(name, "red")) { return YC_RED; } if (!strcmp(name, "blue") || !strcmp(name, "blu")) { return YC_BLUE; } if (!strcmp(name, "green") || !strcmp(name, "gre")) { return YC_GREEN; } if (!strcmp(name, "yellow") || !strcmp(name, "yel")) { return YC_YELLOW; } if (!strcmp(name, "cyan") || !strcmp(name, "cya")) { return YC_CYAN; } if (!strcmp(name, "magenta") || !strcmp(name, "mag")) { return YC_MAGENTA; } return -1; } char *yc2name(int yc) /* convert an integer to a color name */ { if (yc == YC_BLACK) { return my_strdup("black"); } if (yc == YC_WHITE) { return my_strdup("white"); } if (yc == YC_RED) { return my_strdup("red"); } if (yc == YC_BLUE) { return my_strdup("blue"); } if (yc == YC_GREEN) { return my_strdup("green"); } if (yc == YC_YELLOW) { return my_strdup("yellow"); } if (yc == YC_CYAN) { return my_strdup("cyan"); } if (yc == YC_MAGENTA) { return my_strdup("magenta"); } return my_strdup("invalid"); } int yc2oc(int yc, int fore) /* convert a yabasic color to operating system color */ { #ifdef UNIX fore = FALSE; /* stop gcc from complaining */ if (yc == YC_BLACK) { return COLOR_BLACK; } if (yc == YC_WHITE) { return COLOR_WHITE; } if (yc == YC_RED) { return COLOR_RED; } if (yc == YC_BLUE) { return COLOR_BLUE; } if (yc == YC_GREEN) { return COLOR_GREEN; } if (yc == YC_YELLOW) { return COLOR_YELLOW; } if (yc == YC_CYAN) { return COLOR_CYAN; } if (yc == YC_MAGENTA) { return COLOR_MAGENTA; } #else if (con_fore_inten == cciLEGACY) { if (fore) { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; } if (yc == YC_RED) { return FOREGROUND_RED; } if (yc == YC_BLUE) { return FOREGROUND_BLUE; } if (yc == YC_GREEN) { return FOREGROUND_GREEN; } if (yc == YC_YELLOW) { return FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; } if (yc == YC_CYAN) { return FOREGROUND_GREEN | FOREGROUND_BLUE; } if (yc == YC_MAGENTA) { return FOREGROUND_BLUE | FOREGROUND_RED; } } else { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE; } if (yc == YC_RED) { return BACKGROUND_RED; } if (yc == YC_BLUE) { return BACKGROUND_BLUE; } if (yc == YC_GREEN) { return BACKGROUND_GREEN; } if (yc == YC_YELLOW) { return BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY; } if (yc == YC_CYAN) { return BACKGROUND_GREEN | BACKGROUND_BLUE; } if (yc == YC_MAGENTA) { return BACKGROUND_BLUE | BACKGROUND_RED; } } } else if (con_fore_inten == cciNORMAL) { if (fore) { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; } if (yc == YC_RED) { return FOREGROUND_RED; } if (yc == YC_BLUE) { return FOREGROUND_BLUE; } if (yc == YC_GREEN) { return FOREGROUND_GREEN; } if (yc == YC_YELLOW) { return FOREGROUND_GREEN | FOREGROUND_RED; } if (yc == YC_CYAN) { return FOREGROUND_GREEN | FOREGROUND_BLUE; } if (yc == YC_MAGENTA) { return FOREGROUND_BLUE | FOREGROUND_RED; } } else { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE; } if (yc == YC_RED) { return BACKGROUND_RED; } if (yc == YC_BLUE) { return BACKGROUND_BLUE; } if (yc == YC_GREEN) { return BACKGROUND_GREEN; } if (yc == YC_YELLOW) { return BACKGROUND_GREEN | BACKGROUND_RED; } if (yc == YC_CYAN) { return BACKGROUND_GREEN | BACKGROUND_BLUE; } if (yc == YC_MAGENTA) { return BACKGROUND_BLUE | BACKGROUND_RED; } } } else if (con_fore_inten == cciBRIGHT) { if (fore) { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; } if (yc == YC_RED) { return FOREGROUND_RED | FOREGROUND_INTENSITY; } if (yc == YC_BLUE) { return FOREGROUND_BLUE | FOREGROUND_INTENSITY; } if (yc == YC_GREEN) { return FOREGROUND_GREEN | FOREGROUND_INTENSITY; } if (yc == YC_YELLOW) { return FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY; } if (yc == YC_CYAN) { return FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; } if (yc == YC_MAGENTA) { return FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY; } } else { if (yc == YC_BLACK) { return 0; } if (yc == YC_WHITE) { return BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; } if (yc == YC_RED) { return BACKGROUND_RED | BACKGROUND_INTENSITY; } if (yc == YC_BLUE) { return BACKGROUND_BLUE | BACKGROUND_INTENSITY; } if (yc == YC_GREEN) { return BACKGROUND_GREEN | BACKGROUND_INTENSITY; } if (yc == YC_YELLOW) { return BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY; } if (yc == YC_CYAN) { return BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; } if (yc == YC_MAGENTA) { return BACKGROUND_BLUE | BACKGROUND_RED | BACKGROUND_INTENSITY; } } } else { sprintf( estring, "Internal error: Invalid value for console_foreground_intensity: %d", con_fore_inten); error(sERROR, estring); } #endif return -1; } int oc2yc(int oc) /* convert an operating system color to yabasic color */ { #ifdef UNIX if (oc == COLOR_BLACK) { return YC_BLACK; } if (oc == COLOR_WHITE) { return YC_WHITE; } if (oc == COLOR_RED) { return YC_RED; } if (oc == COLOR_BLUE) { return YC_BLUE; } if (oc == COLOR_GREEN) { return YC_GREEN; } if (oc == COLOR_YELLOW) { return YC_YELLOW; } if (oc == COLOR_CYAN) { return YC_CYAN; } if (oc == COLOR_MAGENTA) { return YC_MAGENTA; } #else if (oc == 0) { return YC_BLACK; } if (oc == (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN) || oc == (BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN) || oc == (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY) || oc == (BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY)) { return YC_WHITE; } if (oc == (FOREGROUND_RED) || oc == (BACKGROUND_RED) || oc == (FOREGROUND_RED | FOREGROUND_INTENSITY) || oc == (BACKGROUND_RED | BACKGROUND_INTENSITY)) { return YC_RED; } if (oc == (FOREGROUND_BLUE) || oc == (BACKGROUND_BLUE) || oc == (FOREGROUND_BLUE | FOREGROUND_INTENSITY) || oc == (BACKGROUND_BLUE | BACKGROUND_INTENSITY)) { return YC_BLUE; } if (oc == (FOREGROUND_GREEN) || oc == (BACKGROUND_GREEN) || oc == (FOREGROUND_GREEN | FOREGROUND_INTENSITY) || oc == (BACKGROUND_GREEN | BACKGROUND_INTENSITY)) { return YC_GREEN; } if (oc == (FOREGROUND_RED | FOREGROUND_GREEN) || oc == (BACKGROUND_RED | BACKGROUND_GREEN) || oc == (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY) || oc == (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_INTENSITY)) { return YC_YELLOW; } if (oc == (FOREGROUND_BLUE | FOREGROUND_GREEN) || oc == (BACKGROUND_BLUE | BACKGROUND_GREEN) || oc == (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY) || oc == (BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY)) { return YC_CYAN; } if (oc == (FOREGROUND_RED | FOREGROUND_BLUE) || oc == (BACKGROUND_RED | BACKGROUND_BLUE) || oc == (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY) || oc == (BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY)) { return YC_MAGENTA; } #endif return -1; } void putchars(void) /* put rect onto screen */ { char *ch, text, fore[4], back[4]; int n, sx, sy, x, y, f, b; int tox, toy; #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif int oldx, oldy; #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #ifdef WINDOWS CONSOLE_SCREEN_BUFFER_INFO csbi; COORD cp; WORD attributes; char buff[2]; int written; #endif toy = (int)(pop(stNUMBER)->value); tox = (int)(pop(stNUMBER)->value); ch = pop(stSTRING)->pointer; #ifdef UNIX getyx(stdscr, oldy, oldx); #else GetConsoleScreenBufferInfo(ConsoleOutput, &csbi); attributes = csbi.wAttributes; oldx = csbi.dwCursorPosition.X; oldy = csbi.dwCursorPosition.Y; #endif if (sscanf(ch, "%d,%d:%n", &sx, &sy, &n) != 2) { error(sERROR, "illegal screen string"); return; } ch += n; for (x = tox; x < tox + sx; x++) { if (x < 0 || x >= COLS) { continue; } for (y = toy; y < toy + sy; y++) { if (x < 0 || x >= COLS || y < 0 || y >= LINES) { for (n = 0; n < 10; n++) if (*ch) { ch++; } continue; } if (!*ch) { text = ' '; f = YC_BLACK; b = YC_BLACK; } else { text = *ch; strncpy(fore, ch + 2, 3); fore[3] = '\0'; strncpy(back, ch + 6, 3); back[3] = '\0'; for (n = 0; n < 10; n++) if (*ch) { ch++; } f = name2yc(fore); if (f < 0) { f = YC_WHITE; } b = name2yc(back); if (b < 0) { b = YC_WHITE; } } #ifdef UNIX if (has_colors()) { /* Encoding and decoding around init_pair, COLOR_PAIR and PAIR_NUMBER * must match */ attrset(COLOR_PAIR(f + b * 8 + 1)); if (con_fore_inten == cciBRIGHT) { attron(A_BOLD); } } mvaddch(y, x, text); #else cp.X = x; cp.Y = y; SetConsoleCursorPosition(ConsoleOutput, cp); SetConsoleTextAttribute(ConsoleOutput, (WORD)(yc2oc(f, TRUE) | yc2oc(b, FALSE))); buff[0] = text; buff[1] = '\0'; WriteConsole(ConsoleOutput, buff, 1, &written, NULL); #endif } } #ifdef UNIX if (has_colors()) { attrset(A_NORMAL); attron(COLOR_PAIR(0)); } else { attrset(A_NORMAL); } move(y, x); refresh(); #else cp.X = oldx; cp.Y = oldy; SetConsoleCursorPosition(ConsoleOutput, cp); SetConsoleTextAttribute(ConsoleOutput, attributes); #endif return; } char *getchars(int xf, int yf, int xt, int yt) /* get rect from screen */ { int x, y; #ifdef UNIX int c, ct, cc; #endif int cf, cb; int oldx, oldy; char *res; char cols[20]; #ifdef WINDOWS CONSOLE_SCREEN_BUFFER_INFO csbi; COORD cp; char charbuff[2]; WORD attrbuff[2]; int read; #endif if (xf > xt) { x = xf; xf = xt; xt = x; } if (yf > yt) { y = yf; yf = yt; yt = y; } res = my_malloc(12 + (xt - xf + 1) * (yt - yf + 1) * 12); sprintf(res, "%d,%d:", xt - xf + 1, yt - yf + 1); #ifdef UNIX getyx(stdscr, oldy, oldx); #else GetConsoleScreenBufferInfo(ConsoleOutput, &csbi); oldx = csbi.dwCursorPosition.X; oldy = csbi.dwCursorPosition.Y; #endif for (x = xf; x <= xt; x++) { for (y = yf; y <= yt; y++) { if (y < 0 || y >= LINES || x < 0 || x >= COLS) { strcat(res, " blbl"); } else { #ifdef UNIX c = mvinch(y, x); ct = c & A_CHARTEXT; if (!isprint(ct)) { ct = ' '; } /* encoding and decoding around init_pair, COLOR_PAIR and PAIR_NUMBER * must match */ cc = PAIR_NUMBER(c & A_COLOR); if (cc == 0) { cf = YC_WHITE; cb = YC_BLACK; } else if (cc >= 65) { cf = cc - 65; cb = YC_BLACK; } else { cf = (cc - 1) & 7; cb = (cc - 1 - cf) / 8; } if (has_colors()) { sprintf(cols, "%c:%s:%s,", ct, yc2short(cf), yc2short(cb)); } else { sprintf(cols, "%c:???:???,", ct); } #else cp.X = x; cp.Y = y; ReadConsoleOutputCharacter(ConsoleOutput, charbuff, 1, cp, &read); charbuff[1] = '\0'; ReadConsoleOutputAttribute(ConsoleOutput, attrbuff, 1, cp, &read); cf = oc2yc(attrbuff[0] & (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE)); cb = oc2yc(attrbuff[0] & (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE)); sprintf(cols, "%c:%s:%s,", charbuff[0], yc2short(cf), yc2short(cb)); #endif strcat(res, cols); } } } #ifdef UNIX move(oldy, oldx); #endif res[strlen(res) - 1] = '\0'; return res; } char *yc2short(int col) /* convert yabasic colours to short colour name */ { static char r1[4], r2[4]; static char *pr = r1; /* switch between two staic buffers for return value */ if (pr == r1) { pr = r2; } else { pr = r1; } strcpy(pr, "***"); if (col == YC_BLACK) { strcpy(pr, "Bla"); } if (col == YC_WHITE) { strcpy(pr, "Whi"); } if (col == YC_RED) { strcpy(pr, "Red"); } if (col == YC_BLUE) { strcpy(pr, "Blu"); } if (col == YC_GREEN) { strcpy(pr, "Gre"); } if (col == YC_YELLOW) { strcpy(pr, "Yel"); } if (col == YC_CYAN) { strcpy(pr, "Cya"); } if (col == YC_MAGENTA) { strcpy(pr, "Mag"); } return pr; } yabasic-2.91.4/LICENSE0000777000175000017500000000205614735711653007736 MIT License Copyright (c) 1995-2019 Marc Ihm 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. yabasic-2.91.4/ltmain.sh0000777000175000017500000122276515055055300010547 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2024 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.5.4 Debian-2.5.4-4" package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2024-12-01.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! 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 # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.5.4-4 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. Assumes ARG has no leading or trailing path separator # characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 case $host in i[3456]86-*-mingw32*) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" ;; *) eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" ;; esac } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. # -q