open-cobol-1.1/0000777000000000000000000000000011143001517007114 5open-cobol-1.1/m4/0000777000000000000000000000000011143001515007432 5open-cobol-1.1/m4/lib-link.m40000644000000000000000000005534307764237446011357 # lib-link.m4 serial 4 (gettext-0.12) dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) open-cobol-1.1/m4/po.m40000644000000000000000000004060107764237446010263 # po.m4 serial 2 (gettext-0.13) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # 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. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path 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 "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) open-cobol-1.1/m4/iconv.m40000644000000000000000000000665307764237446010774 # iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) open-cobol-1.1/m4/gettext.m40000644000000000000000000004513007764237446011333 # gettext.m4 serial 28 (gettext-0.13) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define(gt_included_intl, ifelse([$1], [external], [no], [yes])) define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias ();], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) AC_REQUIRE([jm_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then AM_LC_MESSAGES fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) open-cobol-1.1/m4/codeset.m40000644000000000000000000000157607764237446011303 # codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) open-cobol-1.1/m4/nls.m40000644000000000000000000000350507764237446010443 # nls.m4 serial 1 (gettext-0.12) dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) open-cobol-1.1/m4/progtest.m40000644000000000000000000000563407764237446011523 # progtest.m4 serial 3 (gettext-0.12) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) open-cobol-1.1/m4/lib-prefix.m40000644000000000000000000001250707764237446011712 # lib-prefix.m4 serial 3 (gettext-0.13) dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) open-cobol-1.1/po/0000777000000000000000000000000011143001517007532 5open-cobol-1.1/po/Makevars0000644000000000000000000000346207714247741011173 # Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --language=C --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Keisuke Nishida # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = open-cobol-list@lists.sourceforge.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = open-cobol-1.1/po/ja.po0000644000000000000000000012713411143001516010407 # Japanese translations for OpenCOBOL package # Copyright (C) 2002-2009 Keisuke Nishida # This file is distributed under the same license as the OpenCOBOL package. # Keisuke Nishida , 2002. # msgid "" msgstr "" "Project-Id-Version: OpenCOBOL 0.13\n" "Report-Msgid-Bugs-To: open-cobol-list@lists.sourceforge.net\n" "POT-Creation-Date: 2009-02-06 10:30+0100\n" "PO-Revision-Date: 2004-08-01 23:55+0900\n" "Last-Translator: Keisuke Nishida \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=EUC-JP\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: cobc/cobc.c:524 msgid "Options:" msgstr "" #: cobc/cobc.c:525 msgid " --help Display this message" msgstr "" #: cobc/cobc.c:526 msgid " --version, -V Display compiler version" msgstr "" #: cobc/cobc.c:527 msgid " -v Display the programs invoked by the compiler" msgstr "" #: cobc/cobc.c:528 msgid " -x Build an executable program" msgstr "" #: cobc/cobc.c:529 msgid " -m Build a dynamically loadable module (default)" msgstr "" #: cobc/cobc.c:530 msgid " -std= Compile for a specific dialect :" msgstr "" #: cobc/cobc.c:531 msgid " cobol2002 Cobol 2002" msgstr "" #: cobc/cobc.c:532 msgid " cobol85 Cobol 85" msgstr "" #: cobc/cobc.c:533 msgid " ibm IBM Compatible" msgstr "" #: cobc/cobc.c:534 msgid " mvs MVS Compatible" msgstr "" #: cobc/cobc.c:535 msgid " bs2000 BS2000 Compatible" msgstr "" #: cobc/cobc.c:536 msgid " mf Micro Focus Compatible" msgstr "" #: cobc/cobc.c:537 msgid " default When not specified" msgstr "" #: cobc/cobc.c:538 msgid " See config/default.conf and config/*.conf" msgstr "" #: cobc/cobc.c:539 msgid " -free Use free source format" msgstr "" #: cobc/cobc.c:540 msgid " -fixed Use fixed source format (default)" msgstr "" #: cobc/cobc.c:541 msgid " -O, -O2, -Os Enable optimization" msgstr "" #: cobc/cobc.c:542 msgid " -g Produce debugging information in the output" msgstr "" #: cobc/cobc.c:543 msgid " -debug Enable all run-time error checking" msgstr "" #: cobc/cobc.c:544 msgid " -o Place the output into " msgstr "" #: cobc/cobc.c:545 msgid " -b Combine all input files into a single" msgstr "" #: cobc/cobc.c:546 msgid " dynamically loadable module" msgstr "" #: cobc/cobc.c:547 msgid "" " -E Preprocess only; do not compile, assemble or link" msgstr "" #: cobc/cobc.c:548 msgid " -C Translation only; convert COBOL to C" msgstr "" #: cobc/cobc.c:549 msgid " -S Compile only; output assembly file" msgstr "" #: cobc/cobc.c:550 msgid " -c Compile and assemble, but do not link" msgstr "" #: cobc/cobc.c:551 msgid "" " -t Generate and place a program listing into " msgstr "" #: cobc/cobc.c:552 msgid " -I Add to copy/include search path" msgstr "" #: cobc/cobc.c:553 msgid " -L Add to library search path" msgstr "" #: cobc/cobc.c:554 msgid " -l Link the library " msgstr "" #: cobc/cobc.c:555 msgid " -D Pass to the C compiler" msgstr "" #: cobc/cobc.c:556 msgid " -conf= User defined dialect configuration - See -std=" msgstr "" #: cobc/cobc.c:557 msgid " --list-reserved Display reserved words" msgstr "" #: cobc/cobc.c:558 msgid " --list-intrinsics Display intrinsic functions" msgstr "" #: cobc/cobc.c:559 msgid " --list-mnemonics Display mnemonic names" msgstr "" #: cobc/cobc.c:560 msgid "" " -save-temps(=) Save intermediate files (default current directory)" msgstr "" #: cobc/cobc.c:561 msgid " -MT Set target file used in dependency list" msgstr "" #: cobc/cobc.c:562 msgid " -MF Place dependency list into " msgstr "" #: cobc/cobc.c:563 msgid " -ext Add default file extension" msgstr "" #: cobc/cobc.c:565 msgid " -W Enable ALL warnings" msgstr "" #: cobc/cobc.c:566 msgid " -Wall Enable all warnings except as noted below" msgstr "" #: cobc/cobc.c:571 msgid " (NOT set with -Wall)" msgstr "" #: cobc/cobc.c:727 #, c-format msgid "Invalid option -std=%s\n" msgstr "ÉÔÅö¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹ -std=%s\n" #: cobc/cobc.c:1236 msgid "-MT must be given to specify target file\n" msgstr "¥¿¡¼¥²¥Ã¥È¥Õ¥¡¥¤¥ë¤ò -MT ¤Ç»ØÄꤷ¤Æ²¼¤µ¤¤\n" #: cobc/tree.c:161 #, fuzzy, c-format msgid "%s clause is required for file '%s'" msgstr "%s ¶ç¤¬¥Õ¥¡¥¤¥ë `%s' ¤ËɬÍפǤ¹" #: cobc/tree.c:1378 #, fuzzy msgid "Numeric field cannot be larger than 36 digits" msgstr "18 ·å¤ò±Û¤¨¤ë¿ô»ú¹àÌܤϵö¤µ¤ì¤Þ¤»¤ó" #: cobc/tree.c:1406 #, fuzzy, c-format msgid "Invalid picture string - '%s'" msgstr "ÉÔÅö¤Ê PICTURE ÄêµÁ¤Ç¤¹" #: cobc/tree.c:1631 #, fuzzy, c-format msgid "Record size too small '%s'" msgstr "¥ì¥³¡¼¥ÉŤ¬Ã»¤«²á¤®¤Þ¤¹ `%s'" #: cobc/tree.c:1636 #, fuzzy, c-format msgid "Record size too large '%s' (%d)" msgstr "¥ì¥³¡¼¥ÉŤ¬Ä¹²á¤®¤Þ¤¹ `%s'" #: cobc/tree.c:1995 cobc/typeck.c:1803 cobc/typeck.c:1808 cobc/typeck.c:1813 #: cobc/typeck.c:2382 cobc/typeck.c:2461 #, fuzzy msgid "Invalid expression" msgstr "ÉÔÅö¤Ê¼°¤Ç¤¹" #: cobc/tree.c:2274 cobc/tree.c:2398 #, fuzzy, c-format msgid "FUNCTION %s has wrong number of arguments" msgstr "WHEN ¶ç¤Î°ú¿ô¤Î¿ô¤¬ÉÔÅö¤Ç¤¹" #: cobc/tree.c:2279 #, fuzzy, c-format msgid "FUNCTION %s can not have reference modification" msgstr "`%s' ¤ÏÉôʬ»²¾È¤Ç¤­¤Þ¤»¤ó" #: cobc/tree.c:2284 cobc/tree.c:2289 #, c-format msgid "FUNCTION %s has invalid reference modification" msgstr "" #: cobc/tree.c:2407 #, fuzzy, c-format msgid "FUNCTION %s not implemented" msgstr "`%s' ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/error.c:46 #, fuzzy, c-format msgid "%s: In paragraph '%s':\n" msgstr "%s: ÃÊÍî `%s':\n" #: cobc/error.c:50 #, fuzzy, c-format msgid "%s: In section '%s':\n" msgstr "%s: Àá `%s':\n" #: cobc/error.c:131 #, c-format msgid "%s is archaic in %s" msgstr "%s ¤Ï %s ¤Ç¤Ï¸Å¤¤»ÅÍͤǤ¹" #: cobc/error.c:136 #, c-format msgid "%s is obsolete in %s" msgstr "%s ¤Ï %s ¤Ç¤ÏÇÑÍ×ÁǤǤ¹" #: cobc/error.c:142 #, c-format msgid "%s ignored" msgstr "%s ¤ò̵»ë¤·¤Þ¤¹" #: cobc/error.c:147 #, fuzzy, c-format msgid "%s does not conform to %s" msgstr "%s ¤Ï %s ¤Ë½àµò¤·¤Æ¤¤¤Þ¤»¤ó" #: cobc/error.c:159 cobc/error.c:169 #, fuzzy, c-format msgid "Redefinition of '%s'" msgstr "`%s' ¤¬ºÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹" #: cobc/error.c:160 cobc/error.c:171 cobc/error.c:173 #, fuzzy, c-format msgid "'%s' previously defined here" msgstr "`%s' ¤Ï¤³¤³¤ÇÄêµÁ¤µ¤ì¤Þ¤·¤¿" #: cobc/error.c:193 #, c-format msgid "%s undefined" msgstr "%s ¤Ï̤ÄêµÁ¤Ç¤¹" #: cobc/error.c:217 #, c-format msgid "%s ambiguous; need qualification" msgstr "%s ¤Ï¿½ÅÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£°ì°Õ¤Ë½¤¾þ¤·¤Æ²¼¤µ¤¤" #: cobc/error.c:243 msgid "defined here" msgstr "¤Ï¤³¤³¤ÇÄêµÁ¤µ¤ì¤Þ¤·¤¿" #: cobc/error.c:252 #, fuzzy, c-format msgid "Group item '%s' cannot have %s clause" msgstr "¥°¥ë¡¼¥×¹àÌÜ `%s' ¤Ï %s ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/error.c:258 #, fuzzy, c-format msgid "Level %02d item '%s' cannot have %s clause" msgstr "¥ì¥Ù¥ë %02d ¹àÌÜ `%s' ¤Ï %s ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/error.c:265 #, fuzzy, c-format msgid "Level %02d item '%s' requires %s clause" msgstr "¥ì¥Ù¥ë %02d ¹àÌÜ `%s' ¤Ë¤Ï %s ¶ç¤¬É¬ÍפǤ¹" #: cobc/error.c:272 #, fuzzy, c-format msgid "Level %02d item '%s' cannot have other than %s clause" msgstr "¥ì¥Ù¥ë %02d ¹àÌÜ `%s' ¤Ï %s ¶ç°Ê³°¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:73 #, fuzzy, c-format msgid "Invalid level number '%s'" msgstr "ÉÔÅö¤Ê¥ì¥Ù¥ëÈÖ¹æ¤Ç¤¹ `%s'" #: cobc/field.c:124 cobc/field.c:166 #, fuzzy msgid "Level number must begin with 01 or 77" msgstr "¥ì¥Ù¥ëÈÖ¹æ¤Ï 01 ¤« 77 ¤Ç»Ï¤Þ¤é¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:201 cobc/field.c:214 #, fuzzy, c-format msgid "No previous data item of level %02d" msgstr "¥ì¥Ù¥ë %02d ¤Î¥Ç¡¼¥¿¹àÌܤ¬Á°¤Ë¤¢¤ê¤Þ¤»¤ó" #: cobc/field.c:244 #, fuzzy, c-format msgid "'%s' cannot be qualified here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:250 #, fuzzy, c-format msgid "'%s' cannot be subscripted here" msgstr "`%s' ¤Ïź»úÉÕ¤±½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:262 #, fuzzy, c-format msgid "'%s' undefined in '%s'" msgstr "`%s' ¤Ï `%s' ¤ÎÃæ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/field.c:274 #, fuzzy msgid "Level number of REDEFINES entries must be identical" msgstr "REDEFINES ¶ç¤Î¹àÌÜ¤ÏÆ±¤¸¥ì¥Ù¥ëÈÖ¹æ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:278 #, fuzzy msgid "Level number of REDEFINES entry cannot be 66 or 88" msgstr "REDEFINES ¶ç¤Î¹àÌܤϥì¥Ù¥ëÈÖ¹æ 66 ¤Þ¤¿¤Ï 88 ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:283 #, fuzzy, c-format msgid "'%s' not the original definition" msgstr "`%s' ¤ÏºÇ½é¤ÎÄêµÁ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/field.c:311 #, c-format msgid "'%s' ANY LENGTH only allowed in LINKAGE" msgstr "" #: cobc/field.c:315 #, c-format msgid "'%s' ANY LENGTH must be 01 level" msgstr "" #: cobc/field.c:319 #, fuzzy, c-format msgid "'%s' ANY LENGTH can not be BASED/EXTERNAL" msgstr "`%s' ¤Ï BLANK WHEN ZERO ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:324 cobc/field.c:332 #, fuzzy, c-format msgid "'%s' ANY LENGTH has invalid definition" msgstr "`%s' ¤ÏºÇ½é¤ÎÄêµÁ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/field.c:328 #, fuzzy, c-format msgid "'%s' ANY LENGTH must have a PICTURE" msgstr "`%s' ¤Ï OCCURS DEPENDING ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:343 #, fuzzy, c-format msgid "'%s' 77 level not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:348 #, c-format msgid "'%s' EXTERNAL must be specified at 01/77 level" msgstr "" #: cobc/field.c:352 #, c-format msgid "'%s' EXTERNAL can only be specified in WORKING-STORAGE section" msgstr "" #: cobc/field.c:356 #, c-format msgid "'%s' EXTERNAL and BASED are mutually exclusive" msgstr "" #: cobc/field.c:359 #, c-format msgid "'%s' EXTERNAL not allowed with REDEFINES" msgstr "" #: cobc/field.c:366 #, fuzzy, c-format msgid "'%s' BASED not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:369 #, c-format msgid "'%s' BASED not allowed with REDEFINES" msgstr "" #: cobc/field.c:372 #, fuzzy, c-format msgid "'%s' BASED only allowed at the 01 and 77 levels" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:405 #, fuzzy, c-format msgid "'%s' cannot have the OCCURS clause due to '%s'" msgstr "`%s' ¤Ï `%s' ¤Î¤¿¤á OCCURS ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:418 #, fuzzy, c-format msgid "'%s' ODO field item invalid here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:424 #, fuzzy, c-format msgid "'%s' cannot have OCCURS DEPENDING" msgstr "`%s' ¤Ï OCCURS DEPENDING ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:434 #, c-format msgid "'%s' ODO item must have GLOBAL attribute" msgstr "" #: cobc/field.c:438 #, c-format msgid "GLOBAL '%s' ODO item is not in the same section as OCCURS" msgstr "" #: cobc/field.c:448 #, fuzzy, c-format msgid "The original definition '%s' should not have OCCURS" msgstr "`%s' ¤Î¸µ¤ÎÄêµÁ¤Ë¤Ï OCCURS ¤òÉÕ¤±¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:455 msgid "REDEFINES must follow the original definition" msgstr "REDEFINES ¶ç¤Ï»²¾È¸µ¤Î¹àÌܤÎľ¸å¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:462 #, fuzzy, c-format msgid "'%s' cannot be variable length" msgstr "`%s' ¤Ï²ÄÊÑĹ¤Ë½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:466 #, fuzzy, c-format msgid "The original definition '%s' cannot be variable length" msgstr "`%s' ¤Î¸µ¤ÎÄêµÁ¤Ï²ÄÊÑŤǤ¢¤Ã¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" #: cobc/field.c:557 #, fuzzy, c-format msgid "Value required for constant item '%s'" msgstr "%s ¶ç¤¬¥Õ¥¡¥¤¥ë `%s' ¤ËɬÍפǤ¹" #: cobc/field.c:559 #, fuzzy, c-format msgid "PICTURE clause required for '%s'" msgstr "`%s' ¤Ë¤Ï PICTURE ¶ç¤¬É¬ÍפǤ¹" #: cobc/field.c:565 #, fuzzy, c-format msgid "'%s' cannot have PICTURE clause" msgstr "`%s' ¤Ï PICTURE ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:613 cobc/field.c:621 #, c-format msgid "'%s' PICTURE clause not compatible with USAGE" msgstr "" #: cobc/field.c:638 #, fuzzy, c-format msgid "'%s' cannot have JUSTIFIED RIGHT" msgstr "`%s' ¤Ï JUSTIFIED RIGHT ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:677 #, fuzzy, c-format msgid "'%s' cannot have BLANK WHEN ZERO" msgstr "`%s' ¤Ï BLANK WHEN ZERO ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:685 #, fuzzy msgid "Only level 88 item may have multiple values" msgstr "Ê£¿ô¤ÎÃͤϥì¥Ù¥ë 88 ¹àÌܤΤߤ˵ö¤µ¤ì¤Þ¤¹" #: cobc/field.c:691 #, fuzzy msgid "Entries under REDEFINES cannot have VALUE clause" msgstr "REDEFINES ¤Ë´Þ¤Þ¤ì¤ë¹àÌÜ¤Ï VALUE ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/field.c:694 msgid "VALUE clause ignored for EXTERNAL items" msgstr "" #: cobc/field.c:804 cobc/field.c:812 cobc/field.c:945 cobc/field.c:948 #, fuzzy, c-format msgid "Size of '%s' larger than size of '%s'" msgstr "`%s' ¤Î¥µ¥¤¥º¤¬ `%s' ¤Î¥µ¥¤¥º¤ò±Û¤¨¤Æ¤¤¤Þ¤¹" #: cobc/field.c:876 #, fuzzy, c-format msgid "'%s' binary field cannot be larger than 18 digits" msgstr "18 ·å¤ò±Û¤¨¤ë¿ô»ú¹àÌܤϵö¤µ¤ì¤Þ¤»¤ó" #: cobc/typeck.c:348 #, fuzzy msgid "Invalid use of 88 level item" msgstr "ÉÔÅö¤Ê¼°¤Ç¤¹" #: cobc/typeck.c:386 #, fuzzy, c-format msgid "'%s' is not group name" msgstr "`%s' ¤Ï½¸ÃĹàÌܤǤϤ¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:403 #, fuzzy, c-format msgid "'%s' is not a numeric name" msgstr "`%s' ¤Ï¿ô»ú¹àÌܤǤϤ¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:421 #, fuzzy, c-format msgid "'%s' is not numeric or numeric-edited name" msgstr "`%s' ¤Ï¿ô»ú¹àÌÜ¡¢¤â¤·¤¯¤Ï¿ô»úÊÔ½¸¹àÌܤǤϤ¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:436 #, fuzzy, c-format msgid "'%s' is not a numeric value" msgstr "`%s' ¤Ï¿ôÃͤǤϤ¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:485 #, fuzzy, c-format msgid "'%s' is not an integer value" msgstr "`%s' ¤ÏÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:489 msgid "A positive numeric integer is required here" msgstr "" #: cobc/typeck.c:623 #, fuzzy, c-format msgid "PROGRAM-ID '%s' invalid" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:641 #, fuzzy, c-format msgid "Switch-name is expected '%s'" msgstr "¥¹¥¤¥Ã¥Á̾¤¬É¬ÍפǤ¹ `%s'" #: cobc/typeck.c:794 cobc/typeck.c:826 #, fuzzy, c-format msgid "'%s' cannot be subscripted" msgstr "`%s' ¤Ïź»úÉÕ¤±½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:798 #, fuzzy, c-format msgid "'%s' cannot be reference modified" msgstr "`%s' ¤ÏÉôʬ»²¾È¤Ç¤­¤Þ¤»¤ó" #: cobc/typeck.c:829 #, fuzzy, c-format msgid "'%s' requires 1 subscript" msgstr "`%s' ¤Ï 1 ¤Ä¤Îź»ú¤òɬÍפȤ·¤Þ¤¹" #: cobc/typeck.c:832 #, fuzzy, c-format msgid "'%s' requires %d subscripts" msgstr "`%s' ¤Ï %d ¤Ä¤Îź»ú¤òɬÍפȤ·¤Þ¤¹" #: cobc/typeck.c:854 #, fuzzy, c-format msgid "Subscript of '%s' out of bounds: %d" msgstr "'%s' ¤Îź»ú¤¬ÈϰϤòͤ¨¤Æ¤¤¤Þ¤¹: %d" #: cobc/typeck.c:896 #, fuzzy, c-format msgid "Offset of '%s' out of bounds: %d" msgstr "'%s' ¤Î³«»Ï°ÌÃÖ¤¬ÈϰϤòͤ¨¤Æ¤¤¤Þ¤¹: %d" #: cobc/typeck.c:900 #, fuzzy, c-format msgid "Length of '%s' out of bounds: %d" msgstr "'%s' ¤ÎŤµ¤¬ÈϰϤòͤ¨¤Æ¤¤¤Þ¤¹: %d" #: cobc/typeck.c:971 #, fuzzy msgid "ANY LENGTH item not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:975 #, fuzzy msgid "88 level item not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:1224 #, c-format msgid "Duplicate character values in alphabet '%s'" msgstr "" #: cobc/typeck.c:1228 #, fuzzy, c-format msgid "Invalid character values in alphabet '%s'" msgstr "ÉÔÅö¤Ê¥ì¥Ù¥ëÈÖ¹æ¤Ç¤¹ `%s'" #: cobc/typeck.c:1265 #, fuzzy, c-format msgid "'%s' not alphabet name" msgstr "`%s' ¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:1324 #, c-format msgid "'%s' will be implicitly defined" msgstr "" #: cobc/typeck.c:1341 #, c-format msgid "ASSIGN data item '%s' invalid" msgstr "" #: cobc/typeck.c:1352 #, c-format msgid "'%s' CURSOR is not 4 or 6 characters long" msgstr "" #: cobc/typeck.c:1362 #, c-format msgid "'%s' CRT STATUS is not 4 characters long" msgstr "" #: cobc/typeck.c:1408 msgid "Invalid RECORD DEPENDING item" msgstr "" #: cobc/typeck.c:1432 #, fuzzy, c-format msgid "'%s' not procedure name" msgstr "`%s' ¤Ï¼ê³¤­Ì¾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:1552 #, fuzzy msgid "Suggest parentheses around AND within OR" msgstr "OR ¤ËÎÙÀܤ¹¤ë AND ¤Ë¤Ï³ç¸Ì¤¬¿ä¾©¤µ¤ì¤Þ¤¹" #: cobc/typeck.c:3015 #, fuzzy, c-format msgid "Invalid input stream '%s'" msgstr "`%s' ¤ÏÉÔÅö¤ÊÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤¹" #: cobc/typeck.c:3036 cobc/typeck.c:3045 cobc/typeck.c:3440 cobc/typeck.c:3443 #: cobc/typeck.c:3451 #, fuzzy, c-format msgid "'%s' undefined in SPECIAL-NAMES" msgstr "`%s' ¤Ï SPECIAL-NAMES ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/typeck.c:3071 msgid "Target of ALLOCATE is not a BASED item" msgstr "" #: cobc/typeck.c:3078 msgid "Target of RETURNING is not a data pointer" msgstr "" #: cobc/typeck.c:3084 msgid "The CHARACTERS field of ALLOCATE must be numeric" msgstr "" #: cobc/typeck.c:3118 msgid "Only alphanumeric FUNCTION types are allowed here" msgstr "" #: cobc/typeck.c:3125 #, fuzzy msgid "Invalid RETURNING field" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/typeck.c:3135 msgid "Figurative constant invalid here" msgstr "" #: cobc/typeck.c:3140 #, fuzzy, c-format msgid "'%s' Not a data name" msgstr "`%s' ¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:3147 #, fuzzy, c-format msgid "'%s' is not 01 or 77 level item" msgstr "`%s' ¤Ï¥ì¥Ù¥ë 01 ¤« 77 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/typeck.c:3158 #, fuzzy, c-format msgid "Wrong number of CALL parameters for '%s'" msgstr "WHEN ¶ç¤Î°ú¿ô¤Î¿ô¤¬ÉÔÅö¤Ç¤¹" #: cobc/typeck.c:3202 cobc/typeck.c:3245 cobc/typeck.c:5075 cobc/typeck.c:5195 #: cobc/typeck.c:5254 cobc/typeck.c:5914 msgid "Operation not allowed on SORT files" msgstr "" #: cobc/typeck.c:3330 #, c-format msgid "'%s' is an invalid type for DISPLAY operand" msgstr "" #: cobc/typeck.c:3335 msgid "Invalid type for DISPLAY operand" msgstr "" #: cobc/typeck.c:3419 #, fuzzy msgid "Invalid output stream" msgstr "ÉÔÅö¤ÊÆþÎÏ¥¹¥È¥ê¡¼¥à¤Ç¤¹" #: cobc/typeck.c:3533 #, fuzzy msgid "Invalid use of 88 level in WHEN expression" msgstr "ÉÔÅö¤Ê¼°¤Ç¤¹" #: cobc/typeck.c:3582 #, fuzzy msgid "Wrong number of WHEN parameters" msgstr "WHEN ¶ç¤Î°ú¿ô¤Î¿ô¤¬ÉÔÅö¤Ç¤¹" #: cobc/typeck.c:3626 cobc/typeck.c:3638 #, c-format msgid "" "Target %d of FREE, a data address identifier, must address a BASED data item" msgstr "" #: cobc/typeck.c:3644 #, fuzzy, c-format msgid "Target %d of FREE must be a data pointer" msgstr "SET ½ÐÍè¤ë¤Î¤Ï INDEXED ¤« POINTER ¤À¤±¤Ç¤¹" #: cobc/typeck.c:3667 #, fuzzy msgid "GO TO with multiple procedure-names" msgstr "GO TO ¤ËÊ£¿ô¤Î¼ê³¤­Ì¾¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹" #: cobc/typeck.c:3735 #, fuzzy msgid "Invalid target for INSPECT" msgstr "ÉÔÅö¤Ê¹ÔÏ¢·ë¤Ç¤¹" #: cobc/typeck.c:3742 cobc/typeck.c:3746 msgid "Invalid target for REPLACING/CONVERTING" msgstr "" #: cobc/typeck.c:3771 #, fuzzy msgid "Data name expected before CHARACTERS" msgstr "CHARACTERS ¤ÎÁ°¤Ë¥Ç¡¼¥¿Ì¾¤¬É¬ÍפǤ¹" #: cobc/typeck.c:3781 #, fuzzy msgid "Data name expected before ALL" msgstr "ALL ¤ÎÁ°¤Ë¥Ç¡¼¥¿Ì¾¤¬É¬ÍפǤ¹<" #: cobc/typeck.c:3791 #, fuzzy msgid "Data name expected before LEADING" msgstr "LEADING ¤ÎÁ°¤Ë¥Ç¡¼¥¿Ì¾¤¬É¬ÍפǤ¹<" #: cobc/typeck.c:3801 #, fuzzy msgid "Data name expected before TRAILING" msgstr "LEADING ¤ÎÁ°¤Ë¥Ç¡¼¥¿Ì¾¤¬É¬ÍפǤ¹<" #: cobc/typeck.c:3811 #, fuzzy, c-format msgid "ALL, LEADING or TRAILING expected before '%s'" msgstr "`%s' ¤ÎÁ°¤Ë ALL ¤Þ¤¿¤Ï LEADING¤¬É¬ÍפǤ¹" #: cobc/typeck.c:3890 #, c-format msgid "Internal register '%s' defined as BINARY-LONG" msgstr "" #: cobc/typeck.c:3892 #, fuzzy, c-format msgid "'%s' defined here as PIC %s" msgstr "`%s' ¤Ï¤³¤³¤Ç PIC %s ¤È¤·¤ÆÄêµÁ¤µ¤ì¤Þ¤·¤¿" #: cobc/typeck.c:3894 #, fuzzy, c-format msgid "'%s' defined here as a group of length %d" msgstr "`%s' ¤Ï¤³¤³¤ÇÂ礭¤µ %d ¤Î¥°¥ë¡¼¥×¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹" #: cobc/typeck.c:3968 #, fuzzy msgid "Invalid destination for MOVE" msgstr "ÉÔÅö¤Ê¹ÔÏ¢·ë¤Ç¤¹" #: cobc/typeck.c:4069 #, fuzzy msgid "Data item not signed" msgstr "¥Ç¡¼¥¿¹àÌܤËÉ乿¤¬¤¢¤ê¤Þ¤»¤ó" #: cobc/typeck.c:4073 #, fuzzy msgid "Ignoring negative sign" msgstr "¥Þ¥¤¥Ê¥¹É乿¤Ï̵»ë¤µ¤ì¤Þ¤¹" #: cobc/typeck.c:4356 #, fuzzy msgid "Move non-integer to alphanumeric" msgstr "ÈóÀ°¿ô¤«¤é±Ñ¿ô»ú¹àÌܤؤΠMOVE ¤Ï½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:4382 msgid "Invalid source for MOVE" msgstr "" #: cobc/typeck.c:4399 #, fuzzy msgid "Invalid VALUE clause" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/typeck.c:4401 #, fuzzy msgid "Invalid MOVE statement" msgstr "ÉÔÅö¤Ê MOVE ʸ¤Ç¤¹" #: cobc/typeck.c:4407 #, fuzzy msgid "Invalid VALUE clause - literal exceeds data size" msgstr "ÃͤÎÂ礭¤µ¤¬¹àÌܤÎÂ礭¤µ¤ò±Û¤¨¤Æ¤¤¤Þ¤¹" #: cobc/typeck.c:4411 #, fuzzy msgid "Numeric literal exceeds data size" msgstr "ÃͤÎÂ礭¤µ¤¬¹àÌܤÎÂ礭¤µ¤ò±Û¤¨¤Æ¤¤¤Þ¤¹" #: cobc/typeck.c:4417 #, fuzzy msgid "Numeric value is expected" msgstr "¿ôÃͤ¬É¬ÍפǤ¹" #: cobc/typeck.c:4421 #, fuzzy msgid "Alphanumeric value is expected" msgstr "ʸ»úÎó¤¬É¬ÍפǤ¹" #: cobc/typeck.c:4425 #, fuzzy msgid "Value does not fit the picture string" msgstr "Ãͤ¬ PICTURE ¤Ë¹çÃפ·¤Þ¤»¤ó" #: cobc/typeck.c:4429 #, fuzzy msgid "Value size exceeds data size" msgstr "ÃͤÎÂ礭¤µ¤¬¹àÌܤÎÂ礭¤µ¤ò±Û¤¨¤Æ¤¤¤Þ¤¹" #: cobc/typeck.c:4433 msgid "Sending field larger than receiving field" msgstr "" #: cobc/typeck.c:4437 msgid "Some digits may be truncated" msgstr "" #: cobc/typeck.c:5203 msgid "READ PREVIOUS only allowed for INDEXED SEQUENTIAL files" msgstr "" #: cobc/typeck.c:5210 msgid "KEY ignored with sequential READ" msgstr "½çÆÉ¤ß¹þ¤ß¤Î READ ¤Ç¤¢¤ë¤¿¤á KEY ¤Ï̵»ë¤µ¤ì¤Þ¤¹" #: cobc/typeck.c:5242 msgid "REWRITE requires a record name as subject" msgstr "" #: cobc/typeck.c:5247 msgid "REWRITE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5259 cobc/typeck.c:5919 cobc/parser.y:5136 msgid "INVALID KEY clause invalid with this file type" msgstr "" #: cobc/typeck.c:5262 cobc/typeck.c:5923 cobc/parser.y:5128 msgid "LOCK clause invalid with file LOCK AUTOMATIC" msgstr "" #: cobc/typeck.c:5294 msgid "RELEASE requires a record name as subject" msgstr "" #: cobc/typeck.c:5299 msgid "RELEASE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5306 #, fuzzy msgid "RELEASE not allowed on this record item" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:5383 #, fuzzy, c-format msgid "Undeclared key '%s'" msgstr "`%s' ¤Ï¥­¡¼Àë¸À¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/typeck.c:5387 #, fuzzy msgid "Invalid SEARCH ALL condition" msgstr "SEARCH ALL ¤Î¾ò·ï¼°¤¬ÉÔÅö¤Ç¤¹" #: cobc/typeck.c:5494 #, fuzzy msgid "The targets of SET must be either indexes or pointers" msgstr "SET ½ÐÍè¤ë¤Î¤Ï INDEXED ¤« POINTER ¤À¤±¤Ç¤¹" #: cobc/typeck.c:5506 cobc/typeck.c:5510 msgid "SET targets must be PROGRAM-POINTER" msgstr "" #: cobc/typeck.c:5524 #, fuzzy, c-format msgid "The address of '%s' cannot be changed" msgstr "`%s' ¤Î¥¢¥É¥ì¥¹¤ÏÊѹ¹¤Ç¤­¤Þ¤»¤ó" #: cobc/typeck.c:5586 cobc/typeck.c:5591 cobc/typeck.c:5618 cobc/typeck.c:5623 #, fuzzy msgid "Invalid SET statement" msgstr "ÉÔÅö¤Ê MOVE ʸ¤Ç¤¹" #: cobc/typeck.c:5627 #, fuzzy msgid "Field does not have FALSE clause" msgstr "REDEFINES ¤Ë´Þ¤Þ¤ì¤ë¹àÌÜ¤Ï VALUE ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:5661 #, fuzzy msgid "Invalid SORT filename" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/typeck.c:5677 msgid "Table sort without keys not implemented yet" msgstr "" #: cobc/typeck.c:5701 #, fuzzy msgid "Invalid SORT USING parameter" msgstr "ÉÔÅö¤Ê MOVE ʸ¤Ç¤¹" #: cobc/typeck.c:5725 #, fuzzy msgid "Invalid SORT GIVING parameter" msgstr "ÉÔÅö¤Ê MOVE ʸ¤Ç¤¹" #: cobc/typeck.c:5902 msgid "WRITE requires a record name as subject" msgstr "" #: cobc/typeck.c:5907 msgid "WRITE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5926 #, fuzzy msgid "LOCK clause invalid here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/typeck.c:5993 #, fuzzy msgid "Invalid mnemonic name" msgstr "ÉÔÅö¤Ê¥Ë¡¼¥â¥Ë¥Ã¥¯¤Ç¤¹" #: cobc/pplex.l:105 msgid "PROCESS statement is ignored" msgstr "PROCESS ʸ¤Ï̵»ë¤µ¤ì¤Þ¤¹" #: cobc/pplex.l:278 cobc/pplex.l:350 #, c-format msgid "%s: %s" msgstr "" #: cobc/pplex.l:415 cobc/pplex.l:460 #, fuzzy msgid "Invalid directive - ignored" msgstr "ÉÔÅö¤Ê PICTURE ÄêµÁ¤Ç¤¹" #: cobc/pplex.l:518 #, fuzzy msgid "Line not terminated by a newline" msgstr "¥Õ¥¡¥¤¥ë¤¬²þ¹Ô¤Ç½ª¤ï¤Ã¤Æ¤¤¤Þ¤»¤ó" #: cobc/pplex.l:565 #, fuzzy, c-format msgid "Invalid indicator '%c' at column 7" msgstr "7 ·åÌܤ¬ÉÔÅö¤Ê»Ø¼¨»Ò¤Ç¤¹ `%c'" #: cobc/pplex.l:608 #, fuzzy, c-format msgid "Source text after column %d" msgstr "¥½¡¼¥¹¹Ô¤¬ %d ·å¤ò±Û¤¨¤Æ¤¤¤Þ¤¹" #: cobc/pplex.l:637 cobc/pplex.l:647 #, fuzzy msgid "Invalid line continuation" msgstr "ÉÔÅö¤Ê¹ÔÏ¢·ë¤Ç¤¹" #: cobc/parser.y:39 #, fuzzy, c-format msgid "'%s' not implemented" msgstr "`%s' ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/parser.y:129 #, fuzzy msgid "Unreachable statement" msgstr "ÉÔÅö¤Ê MOVE ʸ¤Ç¤¹" #: cobc/parser.y:178 #, fuzzy, c-format msgid "'%s' not level 01 or 77" msgstr "`%s' ¤Ï¥ì¥Ù¥ë 01 ¤« 77 ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/parser.y:182 #, c-format msgid "'%s' is not in LINKAGE SECTION" msgstr "" #: cobc/parser.y:185 #, fuzzy, c-format msgid "'%s' can not be BASED/EXTERNAL" msgstr "`%s' ¤Ï BLANK WHEN ZERO ¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:190 #, c-format msgid "'%s' is not in WORKING-STORAGE SECTION" msgstr "" #: cobc/parser.y:197 #, c-format msgid "'%s' REDEFINES field not allowed here" msgstr "" #: cobc/parser.y:214 #, c-format msgid "LINKAGE item '%s' is not a PROCEDURE USING parameter" msgstr "" #: cobc/parser.y:221 #, c-format msgid "ENTRY '%s' duplicated" msgstr "" #: cobc/parser.y:235 cobc/parser.y:248 #, c-format msgid "%s statement not terminated by END-%s" msgstr "%s ʸ¤¬ END-%s ¤Ç½ª¤ï¤Ã¤Æ¤¤¤Þ¤»¤ó" #: cobc/parser.y:285 msgid "USE statement invalid for SORT file" msgstr "" #: cobc/parser.y:787 msgid "Multiple PROGRAM-ID's without matching END PROGRAM" msgstr "" #: cobc/parser.y:853 cobc/parser.y:877 #, c-format msgid "END PROGRAM '%s' is different to PROGRAM-ID '%s'" msgstr "" #: cobc/parser.y:901 #, c-format msgid "END FUNCTION '%s' is different to FUNCTION-ID '%s'" msgstr "" #: cobc/parser.y:960 #, fuzzy msgid "FUNCTION-ID is not yet implemented" msgstr "`%s' ¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" #: cobc/parser.y:1019 cobc/parser.y:1026 msgid "COMMON may only be used in a nested program" msgstr "" #: cobc/parser.y:1066 msgid "CONFIGURATION SECTION not allowed in nested programs" msgstr "" #: cobc/parser.y:1235 cobc/parser.y:1245 #, fuzzy, c-format msgid "Unknown system-name '%s'" msgstr "ÉÔÅö¤Ê¥·¥¹¥Æ¥à̾¤Ç¤¹ `%s'" #: cobc/parser.y:1237 #, fuzzy msgid "Invalid CRT clause" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/parser.y:1355 #, fuzzy msgid "Invalid SYMBOLIC clause" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/parser.y:1426 cobc/parser.y:1475 #, fuzzy, c-format msgid "Invalid currency sign '%s'" msgstr "ÉÔÅö¤ÊÄ̲ߵ­¹æ¤Ç¤¹ `%s'" #: cobc/parser.y:1534 cobc/parser.y:1543 msgid "INPUT-OUTPUT SECTION header missing - assumed" msgstr "" #: cobc/parser.y:1536 cobc/parser.y:1545 msgid "INPUT-OUTPUT SECTION header missing" msgstr "" #: cobc/parser.y:1748 cobc/parser.y:1757 cobc/parser.y:1766 cobc/parser.y:1775 msgid "Invalid or duplicate ORGANIZED clause" msgstr "" #: cobc/parser.y:1948 msgid "FILE SECTION header missing - assumed" msgstr "" #: cobc/parser.y:1950 msgid "FILE SECTION header missing" msgstr "" #: cobc/parser.y:1968 cobc/parser.y:1980 msgid "RECORD description missing or invalid" msgstr "" #: cobc/parser.y:2023 cobc/parser.y:2030 msgid "File cannot have both EXTERNAL and GLOBAL clauses" msgstr "" #: cobc/parser.y:2062 cobc/parser.y:2076 msgid "RECORD clause ignored for LINE SEQUENTIAL" msgstr "" #: cobc/parser.y:2067 cobc/parser.y:2092 cobc/parser.y:2115 #, fuzzy msgid "RECORD clause invalid" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2191 msgid "LINAGE clause with wrong file type" msgstr "" #: cobc/parser.y:2253 #, fuzzy, c-format msgid "Alphabet-name is expected '%s'" msgstr "¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È̾¤¬É¬ÍפǤ¹ `%s'" #: cobc/parser.y:2266 msgid "file descriptor REPORT IS" msgstr "" #: cobc/parser.y:2270 msgid "file descriptor REPORTS ARE" msgstr "" #: cobc/parser.y:2337 cobc/parser.y:3167 msgid "Item requires a data name" msgstr "" #: cobc/parser.y:2390 msgid "CONSTANT with GLOBAL clause is not yet supported" msgstr "" #: cobc/parser.y:2408 msgid "CONSTANT item not at 01 level" msgstr "" #: cobc/parser.y:2459 #, fuzzy msgid "REDEFINES clause should follow entry-name" msgstr "REDEFINES ¶ç¤Ï¹àÌÜ̾¤Îľ¸å¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/parser.y:2461 msgid "REDEFINES clause must follow entry-name" msgstr "REDEFINES ¶ç¤Ï¹àÌÜ̾¤Îľ¸å¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #: cobc/parser.y:2479 #, fuzzy msgid "EXTERNAL not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2481 #, fuzzy msgid "EXTERNAL only allowed at 01/77 level" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2483 msgid "EXTERNAL requires a data name" msgstr "" #: cobc/parser.y:2485 cobc/parser.y:2518 msgid "GLOBAL and EXTERNAL are mutually exclusive" msgstr "" #: cobc/parser.y:2487 cobc/parser.y:2765 msgid "BASED and EXTERNAL are mutually exclusive" msgstr "" #: cobc/parser.y:2489 msgid "EXTERNAL and REDEFINES are mutually exclusive" msgstr "" #: cobc/parser.y:2514 #, fuzzy msgid "GLOBAL only allowed at 01/77 level" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2516 msgid "GLOBAL requires a data name" msgstr "" #: cobc/parser.y:2520 #, fuzzy msgid "GLOBAL not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2639 msgid "Maximum OCCURS depth exceeded" msgstr "" #: cobc/parser.y:2759 #, fuzzy msgid "BASED not allowed here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2761 #, fuzzy msgid "BASED only allowed at 01/77 level" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:2763 msgid "BASED requires a data name" msgstr "" #: cobc/parser.y:2767 msgid "BASED and REDEFINES are mutually exclusive" msgstr "" #: cobc/parser.y:2769 cobc/parser.y:2842 msgid "BASED and ANY LENGTH are mutually exclusive" msgstr "" #: cobc/parser.y:2797 msgid "FALSE clause only allowed for 88 level" msgstr "" #: cobc/parser.y:2812 cobc/parser.y:2824 cobc/parser.y:2827 msgid "RENAMES may not reference a level 01 or > 50" msgstr "" #: cobc/parser.y:2858 msgid "LOCAL-STORAGE not allowed in nested programs" msgstr "" #: cobc/parser.y:2891 msgid "REPORT SECTION not supported" msgstr "" #: cobc/parser.y:2924 msgid "Report description using defaults" msgstr "" #: cobc/parser.y:2932 #, fuzzy msgid "GLOBAL is not allowed with RD" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:3011 msgid "looking for Report line TYPE" msgstr "" #: cobc/parser.y:3320 msgid "Executable program requested but PROCEDURE/ENTRY has USING clause" msgstr "" #: cobc/parser.y:3383 cobc/parser.y:4057 msgid "BY VALUE not allowed in CHAINED program" msgstr "" #: cobc/parser.y:3395 cobc/parser.y:3403 cobc/parser.y:3413 cobc/parser.y:3442 msgid "SIZE only allowed for BY VALUE items" msgstr "" #: cobc/parser.y:3415 cobc/parser.y:3432 cobc/parser.y:3444 cobc/parser.y:3461 #, fuzzy msgid "Invalid value for SIZE" msgstr "ÉÔÅö¤Ê¹ÔÏ¢·ë¤Ç¤¹" #: cobc/parser.y:3473 msgid "OPTIONAL only allowed for BY REFERENCE items" msgstr "" #: cobc/parser.y:3482 #, fuzzy msgid "RETURNING clause is required for a FUNCTION" msgstr "%s ¶ç¤¬¥Õ¥¡¥¤¥ë `%s' ¤ËɬÍפǤ¹" #: cobc/parser.y:3490 msgid "RETURNING item is not defined in LINKAGE SECTION" msgstr "" #: cobc/parser.y:3637 #, fuzzy, c-format msgid "Unknown statement '%s'" msgstr "¤½¤Î¤è¤¦¤Êʸ¤Ï¤¢¤ê¤Þ¤»¤ó `%s'" #: cobc/parser.y:3983 msgid "ALTER statement is obsolete and unsupported" msgstr "" #: cobc/parser.y:4029 msgid "OMITTED only allowed with BY REFERENCE" msgstr "" #: cobc/parser.y:4049 msgid "BY CONTENT not allowed in CHAINED program" msgstr "" #: cobc/parser.y:4370 msgid "ENTRY is invalid in nested program" msgstr "" #: cobc/parser.y:4373 #, fuzzy, c-format msgid "ENTRY '%s' invalid" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:4548 msgid "EXIT PROGRAM is not allowed within a USE GLOBAL procedure" msgstr "" #: cobc/parser.y:4559 cobc/parser.y:4576 msgid "EXIT PERFORM is only valid with inline PERFORM" msgstr "" #: cobc/parser.y:4593 msgid "EXIT SECTION is only valid with an active SECTION" msgstr "" #: cobc/parser.y:4611 msgid "EXIT PARAGRAPH is only valid with an active PARAGRAPH" msgstr "" #: cobc/parser.y:4893 msgid "INSPECT missing a keyword" msgstr "" #: cobc/parser.y:5132 #, fuzzy msgid "KEY clause invalid with this file type" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:5435 msgid "File sort requires KEY phrase" msgstr "" #: cobc/parser.y:5484 msgid "File sort requires USING or INPUT PROCEDURE" msgstr "" #: cobc/parser.y:5490 msgid "USING invalid with table SORT" msgstr "" #: cobc/parser.y:5498 msgid "INPUT PROCEDURE invalid with table SORT" msgstr "" #: cobc/parser.y:5509 msgid "File sort requires GIVING or OUTPUT PROCEDURE" msgstr "" #: cobc/parser.y:5515 msgid "GIVING invalid with table SORT" msgstr "" #: cobc/parser.y:5523 msgid "OUTPUT PROCEDURE invalid with table SORT" msgstr "" #: cobc/parser.y:5544 msgid "START not allowed on SEQUENTIAL files" msgstr "" #: cobc/parser.y:5550 cobc/parser.y:6370 cobc/parser.y:6443 #, fuzzy, c-format msgid "'%s' is not a file name" msgstr "`%s' ¤Ï¥Õ¥¡¥¤¥ë̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #: cobc/parser.y:5813 msgid "USE statement must be within DECLARATIVES" msgstr "" #: cobc/parser.y:5815 msgid "SECTION header missing before USE statement" msgstr "" #: cobc/parser.y:6356 #, fuzzy msgid "LINAGE-COUNTER must be qualified here" msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #: cobc/parser.y:6359 #, fuzzy msgid "Invalid LINAGE-COUNTER usage" msgstr "ÉÔÅö¤Ê VALUE ¶ç¤Ç¤¹" #: cobc/parser.y:6406 #, fuzzy, c-format msgid "'%s' not indexed" msgstr "`%s' ¤Ë¤Ï INDEXED BY ¤¬É¬ÍפǤ¹" #: cobc/parser.y:6407 #, fuzzy, c-format msgid "'%s' defined here" msgstr "`%s' ¤Ï¤³¤³¤ÇÄêµÁ¤µ¤ì¤Þ¤·¤¿" #: cobc/parser.y:6429 #, c-format msgid "Multiple reference to '%s' " msgstr "" #: cobc/parser.y:6669 cobc/parser.y:6671 #, fuzzy msgid "Integer value expected" msgstr "¿ôÃͤ¬É¬ÍפǤ¹" #: cobc/scanner.l:500 msgid "User defined name must be less than 32 characters" msgstr "" #: cobc/scanner.l:560 #, c-format msgid "CONSTANT (78 level) may not be used here - '%s'" msgstr "" #: cobc/scanner.l:729 #, fuzzy msgid "Alphanumeric literal has zero length" msgstr "ʸ»úÎó¤¬É¬ÍפǤ¹" #: cobc/scanner.l:730 msgid "A SPACE will be assumed" msgstr "" #: cobc/scanner.l:787 #, fuzzy, c-format msgid "Invalid X literal: %s" msgstr "ÉÔÅö¤Ê X Äê¿ô¤Ç¤¹: %s" #: cobc/scanner.l:823 #, fuzzy, c-format msgid "Invalid H literal: %s" msgstr "ÉÔÅö¤Ê H Äê¿ô¤Ç¤¹: %s" #: cobc/scanner.l:848 cobc/scanner.l:851 #, fuzzy msgid "Invalid numeric literal" msgstr "ÉÔÅö¤Ê¿ô»úÄê¿ô¤Ç¤¹" #: cobc/flag.def:26 msgid "Generate trace code (Executed SECTION/PARAGRAPH)" msgstr "" #: cobc/flag.def:29 msgid "Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS)" msgstr "" #: cobc/flag.def:32 msgid "Syntax error checking only; don't emit any output" msgstr "ʸˡ¥Á¥§¥Ã¥¯¤Î¤ß¡£²¿¤â½ÐÎϤ·¤Ê¤¤" #: cobc/flag.def:35 msgid "Output static function calls for the CALL statement" msgstr "CALL ʸ¤ÇÀÅŪ´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ê¤¦" #: cobc/flag.def:38 #, fuzzy msgid "Enable debugging lines ('D' in indicator column)" msgstr "¥Ç¥Ð¥Ã¥°¹Ô¤òÍ­¸ú¤Ë¤¹¤ë" #: cobc/flag.def:41 msgid "Generate source location code (Turned on by -debug or -g)" msgstr "" #: cobc/flag.def:44 msgid "Do automatic initialization of the Cobol runtime system" msgstr "" #: cobc/flag.def:47 msgid "Numeric display sign ASCII (Default on ASCII machines)" msgstr "" #: cobc/flag.def:50 msgid "Numeric display sign EBCDIC (Default on EBCDIC machines)" msgstr "" #: cobc/flag.def:53 msgid "PERFORM stack checking (Turned on by -debug or -g)" msgstr "" #: cobc/flag.def:56 msgid "Fold COPY subject to lower case (Default no transformation)" msgstr "" #: cobc/flag.def:59 msgid "Fold COPY subject to upper case (Default no transformation)" msgstr "" #: cobc/flag.def:62 msgid "Do not truncate binary fields according to PICTURE" msgstr "" #: cobc/flag.def:65 msgid "Allow use of intrinsic functions without FUNCTION keyword" msgstr "" #: cobc/flag.def:68 msgid "'*' or '/' in column 1 treated as comment (FIXED only)" msgstr "" #: cobc/flag.def:71 msgid "Pass extra NULL terminating pointers on CALL statements" msgstr "" #: cobc/warning.def:26 msgid "Warn if obsolete features are used" msgstr "ÇÑÍ×ÁǤ¬»È¤ï¤ì¤Æ¤¤¤ì¤Ð·Ù¹ð¤¹¤ë" #: cobc/warning.def:29 msgid "Warn if archaic features are used" msgstr "¸Å¤¤»ÅÍͤ¬»È¤ï¤ì¤Æ¤¤¤ì¤Ð·Ù¹ð¤¹¤ë" #: cobc/warning.def:32 #, fuzzy msgid "Warn incompatible redefinition of data items" msgstr "¥Ç¡¼¥¿¹àÌܤκÆÄêµÁ¤ò·Ù¹ð¤¹¤ë" #: cobc/warning.def:35 msgid "Warn inconsistent constant" msgstr "ÉÔŬÀÚ¤ÊÄê¿ô¤ò·Ù¹ð¤¹¤ë" #: cobc/warning.def:38 #, fuzzy msgid "Warn lack of parentheses around AND within OR" msgstr "OR ¤È AND ¤¬³ç¸Ì¤Ê¤·¤Çʤó¤Ç¤¤¤ì¤Ð·Ù¹ð¤¹¤ë" #: cobc/warning.def:41 msgid "Warn type mismatch strictly" msgstr "¥¿¥¤¥×¤ÎÉÔŬ¹ç¤ò¸·Ì©¤Ë·Ù¹ð¤¹¤ë" #: cobc/warning.def:44 #, fuzzy msgid "Warn implicitly defined data items" msgstr "¥Ç¡¼¥¿¹àÌܤκÆÄêµÁ¤ò·Ù¹ð¤¹¤ë" #: cobc/warning.def:47 msgid "Warn non 01/77 items for CALL params" msgstr "" #: cobc/warning.def:50 #, fuzzy msgid "Warn text after column 72, FIXED format" msgstr "72 ·å¤ò±Û¤¨¤ë¥Æ¥­¥¹¥È¤ò·Ù¹ð¤¹¤ë" #: cobc/warning.def:53 #, fuzzy msgid "Warn lack of scope terminator END-XXX" msgstr "½ª»ßÉä(END-XXX)¤¬¤Ê¤±¤ì¤Ð·Ù¹ð¤¹¤ë" #: cobc/warning.def:56 msgid "Warn possible field truncation" msgstr "" #: cobc/warning.def:59 msgid "Warn dangling LINKAGE items" msgstr "" #: cobc/warning.def:62 msgid "Warn unreachable statements" msgstr "" #, fuzzy #~ msgid "" #~ "Options:\n" #~ " --help Display this message\n" #~ " --version, -V Display compiler version\n" #~ " -v Display the programs invoked by the compiler\n" #~ " -x Build an executable program\n" #~ " -m Build a dynamically loadable module (default)\n" #~ " -std= Compile for a specific dialect :\n" #~ " cobol2002 Cobol 2002\n" #~ " cobol85 Cobol 85\n" #~ " ibm IBM Compatible\n" #~ " mvs MVS Compatible\n" #~ " bs2000 BS2000 Compatible\n" #~ " mf Micro Focus Compatible\n" #~ " default When not specified\n" #~ " See config/default.conf and config/*.conf\n" #~ " -free Use free source format\n" #~ " -fixed Use fixed source format (default)\n" #~ " -O, -O2, -Os Enable optimization\n" #~ " -g Produce debugging information in the output\n" #~ " -debug Enable all run-time error checking\n" #~ " -o Place the output into \n" #~ " -b Combine all input files into a single\n" #~ " dynamically loadable module\n" #~ " -E Preprocess only; do not compile, assemble or " #~ "link\n" #~ " -C Translation only; convert COBOL to C\n" #~ " -S Compile only; output assembly file\n" #~ " -c Compile and assemble, but do not link\n" #~ " -t Generate and place a program listing into \n" #~ " -I Add to copy/include search path\n" #~ " -L Add to library search path\n" #~ " -l Link the library \n" #~ " -D Pass to the C compiler\n" #~ " -conf= User defined dialect configuration - See -std=\n" #~ " --list-reserved Display all reserved words\n" #~ " --list-intrinsics Display intrinsic functions\n" #~ " -save-temps(=) Save intermediate files (default current " #~ "directory)\n" #~ " -MT Set target file used in dependency list\n" #~ " -MF Place dependency list into \n" #~ " -ext Add default file extension\n" #~ "\n" #~ " -Wall Enable all warnings" #~ msgstr "" #~ "°ìÈÌŪ¤Ê¥ª¥×¥·¥ç¥ó:\n" #~ " --help ¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨\n" #~ " --version ¥³¥ó¥Ñ¥¤¥é¤Î¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨\n" #~ " --verbose, -v ¥³¥ó¥Ñ¥¤¥é¤«¤é¸Æ¤Ð¤ì¤ë¥×¥í¥°¥é¥à¤òɽ¼¨¤¹¤ë\n" #~ " --list-reserved ͽÌó¸ì¤Î°ìÍ÷¤òɽ¼¨¤¹¤ë\n" #~ " -save-temps Ãæ´Ö¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Ê¤¤\n" #~ " -E Á°½èÍý¤Î¤ß¡£¥³¥ó¥Ñ¥¤¥ë¡¢¥¢¥»¥ó¥Ö¥ë¡¢¥ê¥ó¥¯¤ò¤·¤Ê" #~ "¤¤\n" #~ " -C ËÝÌõ¤Î¤ß¡£COBOL ¤ò C ¤ËÊÑ´¹¤¹¤ë\n" #~ " -S ¥³¥ó¥Ñ¥¤¥ë¤Î¤ß¡£¥¢¥»¥ó¥Ö¥ê¥Õ¥¡¥¤¥ë¤ò½ÐÎϤ¹¤ë\n" #~ " -c ¥³¥ó¥Ñ¥¤¥ë¤È¥¢¥»¥ó¥Ö¥ë¡£¥ê¥ó¥¯¤ò¤·¤Ê¤¤\n" #~ " -m ưŪ¥ê¥ó¥¯²Äǽ¤Ê¥â¥¸¥å¡¼¥ë¤òÀ¸À®¤¹¤ë\n" #~ " -O, -O2 ºÇŬ²½¤òÍ­¸ú¤Ë¤¹¤ë\n" #~ " -g ¥Ç¥Ð¥Ã¥°¾ðÊó¤ò½ÐÎϤ˴ޤá¤ë\n" #~ " -debug ¼Â¹Ô»þ¤Î¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÁ´¤ÆÍ­¸ú¤Ë¤¹¤ë\n" #~ " -o ½ÐÎϤò ¤ËÊݸ¤¹¤ë\n" #~ " -t ¥ê¥¹¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤ò½ÐÎϤ¹¤ë\n" #~ " -I ¥³¥Ô¡¼¥Õ¥¡¥¤¥ë¤ò ¤«¤éõ¤¹\n" #~ " -L ¥ê¥ó¥¯¥Õ¥¡¥¤¥ë¤ò ¤«¤éõ¤¹\n" #~ " -l ¥é¥¤¥Ö¥é¥ê ¤ò¥ê¥ó¥¯¤¹¤ë\n" #~ " -MT °Í¸¥ê¥¹¥È¤ÎÂоݥե¡¥¤¥ë¤ò»ØÄꤹ¤ë\n" #~ " -MF °Í¸¥ê¥¹¥È¤ò ¤ËÊݸ¤¹¤ë\n" #~ " -free ¥½¡¼¥¹¥³¡¼¥É¤Î½ñ¼°¤ò¼«Í³·Á¼°¤Ë¤¹¤ë\n" #~ " -fixed ¥½¡¼¥¹¥³¡¼¥É¤Î½ñ¼°¤ò¸ÇÄê·Á¼°¤Ë¤¹¤ë\n" #~ " -ext ¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥È³ÈÄ¥»Ò¤òÄɲ乤ë\n" #~ "\n" #~ " -Wall Á´¤Æ¤Î¥ï¡¼¥Ë¥ó¥°¤òÍ­¸ú¤Ë¤¹¤ë" #, fuzzy #~ msgid "Wrong number of data items" #~ msgstr "¥Ç¡¼¥¿¹àÌܤοô¤¬ÉÔÅö¤Ç¤¹" #, fuzzy #~ msgid "'%s' not numeric item" #~ msgstr "`%s' ¤Ï¿ô»ú¹àÌܤǤϤ¢¤ê¤Þ¤»¤ó" #, fuzzy #~ msgid "Invalid color '%d'" #~ msgstr "ÉÔÅö¤Ê¿§¤Ç¤¹ `%d'" #~ msgid "Include trace code in the output" #~ msgstr "¥È¥ì¡¼¥¹¤ò½ÐÎϤ˴ޤá¤ë" #~ msgid "Include source location in the output" #~ msgstr "¥½¡¼¥¹¤Î°ÌÃÖ¤ò½ÐÎϤ˴ޤá¤ë" #~ msgid "Include line directive in the output" #~ msgstr "¹Ô¾ðÊó¤ò½ÐÎϤ˴ޤá¤ë" #, fuzzy #~ msgid "'%s' ANY LENGTH not allowed with REDEFINES" #~ msgstr "`%s' ¤Ï½¤¾þ½ÐÍè¤Þ¤»¤ó" #, fuzzy #~ msgid "Cannot find module '%s'" #~ msgstr "¥â¥¸¥å¡¼¥ë¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó `%s'" #, fuzzy #~ msgid "Warning: cob_init expected in the main program\n" #~ msgstr "warning: ¥á¥¤¥ó¥×¥í¥°¥é¥à¤Ç cob_init ¸Æ¤Ð¤ì¤Æ¤¤¤Þ¤»¤ó\n" #, fuzzy #~ msgid "Invalid display sign '%d'" #~ msgstr "ÉÔÅö¤ÊÄ̲ߵ­¹æ¤Ç¤¹ `%s'" #, fuzzy #~ msgid "'%s' not numeric: '%s'" #~ msgstr "`%s' ¤Ï¿ô»ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: `%s'" #, fuzzy #~ msgid "OCCURS DEPENDING ON '%s' out of bounds: %d" #~ msgstr "OCCURS DEPENDING ON `%s' ¤¬ÈϰϤò±Û¤¨¤Æ¤¤¤Þ¤¹: %d" #, fuzzy #~ msgid "End of file" #~ msgstr "¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤Ç¤¹" #, fuzzy #~ msgid "Key out of range" #~ msgstr "¥­¡¼¤ÎÈϰϤ¬ÉÔÅö¤Ç¤¹" #, fuzzy #~ msgid "Key order not ascending" #~ msgstr "¥­¡¼¤¬¾º½ç¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" #, fuzzy #~ msgid "Record key already exists" #~ msgstr "¥ì¥³¡¼¥É¥­¡¼¤¬´û¤Ë¸ºß¤·¤Þ¤¹" #, fuzzy #~ msgid "Record key does not exist" #~ msgstr "¥ì¥³¡¼¥É¥­¡¼¤¬Â¸ºß¤·¤Þ¤»¤ó" #, fuzzy #~ msgid "Permanent file error" #~ msgstr "±Ê³¥Õ¥¡¥¤¥ë¥¨¥é¡¼¤Ç¤¹" #, fuzzy #~ msgid "File does not exist" #~ msgstr "¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó" #, fuzzy #~ msgid "Permission denied" #~ msgstr "ÍøÍѵö²Ä¤¬¤¢¤ê¤Þ¤»¤ó" #, fuzzy #~ msgid "File already open" #~ msgstr "¥Õ¥¡¥¤¥ë¤Ï´û¤Ë³«¤¤¤Æ¤¤¤Þ¤¹" #, fuzzy #~ msgid "File not open" #~ msgstr "¥Õ¥¡¥¤¥ë¤¬³«¤¤¤Æ¤¤¤Þ¤»¤ó" #~ msgid "READ must be executed first" #~ msgstr "READ ¤òÀè¤Ë¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" #, fuzzy #~ msgid "Record overflow" #~ msgstr "¥ì¥³¡¼¥É¤ÎÎΰè¤òͤ¨¤Æ¤¤¤Þ¤¹" #, fuzzy #~ msgid "Failed to read" #~ msgstr "ÆÉ¤ß¹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿" #, fuzzy #~ msgid "READ/START not allowed" #~ msgstr "READ¡¢START ¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó" #~ msgid "WRITE not allowed" #~ msgstr "WRITE ¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó" #, fuzzy #~ msgid "DELETE/REWRITE not allowed" #~ msgstr "DELETE¡¢REWRITE ¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó" #, fuzzy #~ msgid "Unknown file error" #~ msgstr "¸¶°øÉÔÌÀ¤Î¥Õ¥¡¥¤¥ë¥¨¥é¡¼¤Ç¤¹" #, fuzzy #~ msgid "78 level can not have a PICTURE clause - '%s'" #~ msgstr "`%s' ¤Ï PICTURE ¶ç¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó" #, fuzzy #~ msgid "Include the main function in the output (deprecated, use -x)" #~ msgstr "main ´Ø¿ô¤ò½ÐÎϤ˴ޤá¤ë" #, fuzzy #~ msgid "Inline runtime functions (deprecated)" #~ msgstr "°ìÈÌŪ¤Ê½èÍý¤Ç´Ø¿ô¤Î¥¤¥ó¥é¥¤¥ó²½¤ò¹Ô¤Ê¤¦" #~ msgid "cob_init() must be called before cob_resolve()" #~ msgstr "cob_resolve() ¤ÎÁ°¤Ë cob_init() ¤ò¸Æ¤Ð¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" open-cobol-1.1/po/LINGUAS0000644000000000000000000000004107473246714010513 # Set of available languages. ja open-cobol-1.1/po/remove-potcdate.sin0000644000000000000000000000066007764240135013300 # Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } open-cobol-1.1/po/POTFILES.in0000644000000000000000000000043607776517721011260 # List of source files containing translatable strings. # cobc cobc/cobc.c cobc/tree.c cobc/error.c cobc/field.c cobc/typeck.c cobc/pplex.l cobc/ppparse.y cobc/parser.y cobc/scanner.l cobc/flag.def cobc/warning.def # libcob libcob/call.c libcob/common.c libcob/fileio.c libcob/move.c open-cobol-1.1/po/ja.gmo0000644000000000000000000000406411143001517010550 Þ•¼\Ð Ñ òý%& L)Yƒ ›3¼ð' -51c!•"·Úõ «/Êú $!<^*n™/·!ç ."4Q † §Èçþ    %s ambiguous; need qualification%s ignored%s is archaic in %s%s is obsolete in %s%s statement not terminated by END-%s%s undefined-MT must be given to specify target file Invalid option -std=%s KEY ignored with sequential READOutput static function calls for the CALL statementPROCESS statement is ignoredREDEFINES clause must follow entry-nameREDEFINES must follow the original definitionSyntax error checking only; don't emit any outputWarn if archaic features are usedWarn if obsolete features are usedWarn inconsistent constantWarn type mismatch strictlydefined hereProject-Id-Version: OpenCOBOL 0.13 Report-Msgid-Bugs-To: open-cobol-list@lists.sourceforge.net POT-Creation-Date: 2009-02-06 10:30+0100 PO-Revision-Date: 2004-08-01 23:55+0900 Last-Translator: Keisuke Nishida Language-Team: Japanese MIME-Version: 1.0 Content-Type: text/plain; charset=EUC-JP Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; %s ¤Ï¿½ÅÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£°ì°Õ¤Ë½¤¾þ¤·¤Æ²¼¤µ¤¤%s ¤ò̵»ë¤·¤Þ¤¹%s ¤Ï %s ¤Ç¤Ï¸Å¤¤»ÅÍͤǤ¹%s ¤Ï %s ¤Ç¤ÏÇÑÍ×ÁǤǤ¹%s ʸ¤¬ END-%s ¤Ç½ª¤ï¤Ã¤Æ¤¤¤Þ¤»¤ó%s ¤Ï̤ÄêµÁ¤Ç¤¹¥¿¡¼¥²¥Ã¥È¥Õ¥¡¥¤¥ë¤ò -MT ¤Ç»ØÄꤷ¤Æ²¼¤µ¤¤ ÉÔÅö¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹ -std=%s ½çÆÉ¤ß¹þ¤ß¤Î READ ¤Ç¤¢¤ë¤¿¤á KEY ¤Ï̵»ë¤µ¤ì¤Þ¤¹CALL ʸ¤ÇÀÅŪ´Ø¿ô¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ê¤¦PROCESS ʸ¤Ï̵»ë¤µ¤ì¤Þ¤¹REDEFINES ¶ç¤Ï¹àÌÜ̾¤Îľ¸å¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤óREDEFINES ¶ç¤Ï»²¾È¸µ¤Î¹àÌܤÎľ¸å¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤óʸˡ¥Á¥§¥Ã¥¯¤Î¤ß¡£²¿¤â½ÐÎϤ·¤Ê¤¤¸Å¤¤»ÅÍͤ¬»È¤ï¤ì¤Æ¤¤¤ì¤Ð·Ù¹ð¤¹¤ëÇÑÍ×ÁǤ¬»È¤ï¤ì¤Æ¤¤¤ì¤Ð·Ù¹ð¤¹¤ëÉÔŬÀÚ¤ÊÄê¿ô¤ò·Ù¹ð¤¹¤ë¥¿¥¤¥×¤ÎÉÔŬ¹ç¤ò¸·Ì©¤Ë·Ù¹ð¤¹¤ë¤Ï¤³¤³¤ÇÄêµÁ¤µ¤ì¤Þ¤·¤¿open-cobol-1.1/po/open-cobol.pot0000644000000000000000000007424411143001516012241 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Keisuke Nishida # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: open-cobol-list@lists.sourceforge.net\n" "POT-Creation-Date: 2009-02-06 10:30+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: cobc/cobc.c:524 msgid "Options:" msgstr "" #: cobc/cobc.c:525 msgid " --help Display this message" msgstr "" #: cobc/cobc.c:526 msgid " --version, -V Display compiler version" msgstr "" #: cobc/cobc.c:527 msgid " -v Display the programs invoked by the compiler" msgstr "" #: cobc/cobc.c:528 msgid " -x Build an executable program" msgstr "" #: cobc/cobc.c:529 msgid " -m Build a dynamically loadable module (default)" msgstr "" #: cobc/cobc.c:530 msgid " -std= Compile for a specific dialect :" msgstr "" #: cobc/cobc.c:531 msgid " cobol2002 Cobol 2002" msgstr "" #: cobc/cobc.c:532 msgid " cobol85 Cobol 85" msgstr "" #: cobc/cobc.c:533 msgid " ibm IBM Compatible" msgstr "" #: cobc/cobc.c:534 msgid " mvs MVS Compatible" msgstr "" #: cobc/cobc.c:535 msgid " bs2000 BS2000 Compatible" msgstr "" #: cobc/cobc.c:536 msgid " mf Micro Focus Compatible" msgstr "" #: cobc/cobc.c:537 msgid " default When not specified" msgstr "" #: cobc/cobc.c:538 msgid " See config/default.conf and config/*.conf" msgstr "" #: cobc/cobc.c:539 msgid " -free Use free source format" msgstr "" #: cobc/cobc.c:540 msgid " -fixed Use fixed source format (default)" msgstr "" #: cobc/cobc.c:541 msgid " -O, -O2, -Os Enable optimization" msgstr "" #: cobc/cobc.c:542 msgid " -g Produce debugging information in the output" msgstr "" #: cobc/cobc.c:543 msgid " -debug Enable all run-time error checking" msgstr "" #: cobc/cobc.c:544 msgid " -o Place the output into " msgstr "" #: cobc/cobc.c:545 msgid " -b Combine all input files into a single" msgstr "" #: cobc/cobc.c:546 msgid " dynamically loadable module" msgstr "" #: cobc/cobc.c:547 msgid "" " -E Preprocess only; do not compile, assemble or link" msgstr "" #: cobc/cobc.c:548 msgid " -C Translation only; convert COBOL to C" msgstr "" #: cobc/cobc.c:549 msgid " -S Compile only; output assembly file" msgstr "" #: cobc/cobc.c:550 msgid " -c Compile and assemble, but do not link" msgstr "" #: cobc/cobc.c:551 msgid "" " -t Generate and place a program listing into " msgstr "" #: cobc/cobc.c:552 msgid " -I Add to copy/include search path" msgstr "" #: cobc/cobc.c:553 msgid " -L Add to library search path" msgstr "" #: cobc/cobc.c:554 msgid " -l Link the library " msgstr "" #: cobc/cobc.c:555 msgid " -D Pass to the C compiler" msgstr "" #: cobc/cobc.c:556 msgid " -conf= User defined dialect configuration - See -std=" msgstr "" #: cobc/cobc.c:557 msgid " --list-reserved Display reserved words" msgstr "" #: cobc/cobc.c:558 msgid " --list-intrinsics Display intrinsic functions" msgstr "" #: cobc/cobc.c:559 msgid " --list-mnemonics Display mnemonic names" msgstr "" #: cobc/cobc.c:560 msgid "" " -save-temps(=) Save intermediate files (default current directory)" msgstr "" #: cobc/cobc.c:561 msgid " -MT Set target file used in dependency list" msgstr "" #: cobc/cobc.c:562 msgid " -MF Place dependency list into " msgstr "" #: cobc/cobc.c:563 msgid " -ext Add default file extension" msgstr "" #: cobc/cobc.c:565 msgid " -W Enable ALL warnings" msgstr "" #: cobc/cobc.c:566 msgid " -Wall Enable all warnings except as noted below" msgstr "" #: cobc/cobc.c:571 msgid " (NOT set with -Wall)" msgstr "" #: cobc/cobc.c:727 #, c-format msgid "Invalid option -std=%s\n" msgstr "" #: cobc/cobc.c:1236 msgid "-MT must be given to specify target file\n" msgstr "" #: cobc/tree.c:161 #, c-format msgid "%s clause is required for file '%s'" msgstr "" #: cobc/tree.c:1378 msgid "Numeric field cannot be larger than 36 digits" msgstr "" #: cobc/tree.c:1406 #, c-format msgid "Invalid picture string - '%s'" msgstr "" #: cobc/tree.c:1631 #, c-format msgid "Record size too small '%s'" msgstr "" #: cobc/tree.c:1636 #, c-format msgid "Record size too large '%s' (%d)" msgstr "" #: cobc/tree.c:1995 cobc/typeck.c:1803 cobc/typeck.c:1808 cobc/typeck.c:1813 #: cobc/typeck.c:2382 cobc/typeck.c:2461 msgid "Invalid expression" msgstr "" #: cobc/tree.c:2274 cobc/tree.c:2398 #, c-format msgid "FUNCTION %s has wrong number of arguments" msgstr "" #: cobc/tree.c:2279 #, c-format msgid "FUNCTION %s can not have reference modification" msgstr "" #: cobc/tree.c:2284 cobc/tree.c:2289 #, c-format msgid "FUNCTION %s has invalid reference modification" msgstr "" #: cobc/tree.c:2407 #, c-format msgid "FUNCTION %s not implemented" msgstr "" #: cobc/error.c:46 #, c-format msgid "%s: In paragraph '%s':\n" msgstr "" #: cobc/error.c:50 #, c-format msgid "%s: In section '%s':\n" msgstr "" #: cobc/error.c:131 #, c-format msgid "%s is archaic in %s" msgstr "" #: cobc/error.c:136 #, c-format msgid "%s is obsolete in %s" msgstr "" #: cobc/error.c:142 #, c-format msgid "%s ignored" msgstr "" #: cobc/error.c:147 #, c-format msgid "%s does not conform to %s" msgstr "" #: cobc/error.c:159 cobc/error.c:169 #, c-format msgid "Redefinition of '%s'" msgstr "" #: cobc/error.c:160 cobc/error.c:171 cobc/error.c:173 #, c-format msgid "'%s' previously defined here" msgstr "" #: cobc/error.c:193 #, c-format msgid "%s undefined" msgstr "" #: cobc/error.c:217 #, c-format msgid "%s ambiguous; need qualification" msgstr "" #: cobc/error.c:243 msgid "defined here" msgstr "" #: cobc/error.c:252 #, c-format msgid "Group item '%s' cannot have %s clause" msgstr "" #: cobc/error.c:258 #, c-format msgid "Level %02d item '%s' cannot have %s clause" msgstr "" #: cobc/error.c:265 #, c-format msgid "Level %02d item '%s' requires %s clause" msgstr "" #: cobc/error.c:272 #, c-format msgid "Level %02d item '%s' cannot have other than %s clause" msgstr "" #: cobc/field.c:73 #, c-format msgid "Invalid level number '%s'" msgstr "" #: cobc/field.c:124 cobc/field.c:166 msgid "Level number must begin with 01 or 77" msgstr "" #: cobc/field.c:201 cobc/field.c:214 #, c-format msgid "No previous data item of level %02d" msgstr "" #: cobc/field.c:244 #, c-format msgid "'%s' cannot be qualified here" msgstr "" #: cobc/field.c:250 #, c-format msgid "'%s' cannot be subscripted here" msgstr "" #: cobc/field.c:262 #, c-format msgid "'%s' undefined in '%s'" msgstr "" #: cobc/field.c:274 msgid "Level number of REDEFINES entries must be identical" msgstr "" #: cobc/field.c:278 msgid "Level number of REDEFINES entry cannot be 66 or 88" msgstr "" #: cobc/field.c:283 #, c-format msgid "'%s' not the original definition" msgstr "" #: cobc/field.c:311 #, c-format msgid "'%s' ANY LENGTH only allowed in LINKAGE" msgstr "" #: cobc/field.c:315 #, c-format msgid "'%s' ANY LENGTH must be 01 level" msgstr "" #: cobc/field.c:319 #, c-format msgid "'%s' ANY LENGTH can not be BASED/EXTERNAL" msgstr "" #: cobc/field.c:324 cobc/field.c:332 #, c-format msgid "'%s' ANY LENGTH has invalid definition" msgstr "" #: cobc/field.c:328 #, c-format msgid "'%s' ANY LENGTH must have a PICTURE" msgstr "" #: cobc/field.c:343 #, c-format msgid "'%s' 77 level not allowed here" msgstr "" #: cobc/field.c:348 #, c-format msgid "'%s' EXTERNAL must be specified at 01/77 level" msgstr "" #: cobc/field.c:352 #, c-format msgid "'%s' EXTERNAL can only be specified in WORKING-STORAGE section" msgstr "" #: cobc/field.c:356 #, c-format msgid "'%s' EXTERNAL and BASED are mutually exclusive" msgstr "" #: cobc/field.c:359 #, c-format msgid "'%s' EXTERNAL not allowed with REDEFINES" msgstr "" #: cobc/field.c:366 #, c-format msgid "'%s' BASED not allowed here" msgstr "" #: cobc/field.c:369 #, c-format msgid "'%s' BASED not allowed with REDEFINES" msgstr "" #: cobc/field.c:372 #, c-format msgid "'%s' BASED only allowed at the 01 and 77 levels" msgstr "" #: cobc/field.c:405 #, c-format msgid "'%s' cannot have the OCCURS clause due to '%s'" msgstr "" #: cobc/field.c:418 #, c-format msgid "'%s' ODO field item invalid here" msgstr "" #: cobc/field.c:424 #, c-format msgid "'%s' cannot have OCCURS DEPENDING" msgstr "" #: cobc/field.c:434 #, c-format msgid "'%s' ODO item must have GLOBAL attribute" msgstr "" #: cobc/field.c:438 #, c-format msgid "GLOBAL '%s' ODO item is not in the same section as OCCURS" msgstr "" #: cobc/field.c:448 #, c-format msgid "The original definition '%s' should not have OCCURS" msgstr "" #: cobc/field.c:455 msgid "REDEFINES must follow the original definition" msgstr "" #: cobc/field.c:462 #, c-format msgid "'%s' cannot be variable length" msgstr "" #: cobc/field.c:466 #, c-format msgid "The original definition '%s' cannot be variable length" msgstr "" #: cobc/field.c:557 #, c-format msgid "Value required for constant item '%s'" msgstr "" #: cobc/field.c:559 #, c-format msgid "PICTURE clause required for '%s'" msgstr "" #: cobc/field.c:565 #, c-format msgid "'%s' cannot have PICTURE clause" msgstr "" #: cobc/field.c:613 cobc/field.c:621 #, c-format msgid "'%s' PICTURE clause not compatible with USAGE" msgstr "" #: cobc/field.c:638 #, c-format msgid "'%s' cannot have JUSTIFIED RIGHT" msgstr "" #: cobc/field.c:677 #, c-format msgid "'%s' cannot have BLANK WHEN ZERO" msgstr "" #: cobc/field.c:685 msgid "Only level 88 item may have multiple values" msgstr "" #: cobc/field.c:691 msgid "Entries under REDEFINES cannot have VALUE clause" msgstr "" #: cobc/field.c:694 msgid "VALUE clause ignored for EXTERNAL items" msgstr "" #: cobc/field.c:804 cobc/field.c:812 cobc/field.c:945 cobc/field.c:948 #, c-format msgid "Size of '%s' larger than size of '%s'" msgstr "" #: cobc/field.c:876 #, c-format msgid "'%s' binary field cannot be larger than 18 digits" msgstr "" #: cobc/typeck.c:348 msgid "Invalid use of 88 level item" msgstr "" #: cobc/typeck.c:386 #, c-format msgid "'%s' is not group name" msgstr "" #: cobc/typeck.c:403 #, c-format msgid "'%s' is not a numeric name" msgstr "" #: cobc/typeck.c:421 #, c-format msgid "'%s' is not numeric or numeric-edited name" msgstr "" #: cobc/typeck.c:436 #, c-format msgid "'%s' is not a numeric value" msgstr "" #: cobc/typeck.c:485 #, c-format msgid "'%s' is not an integer value" msgstr "" #: cobc/typeck.c:489 msgid "A positive numeric integer is required here" msgstr "" #: cobc/typeck.c:623 #, c-format msgid "PROGRAM-ID '%s' invalid" msgstr "" #: cobc/typeck.c:641 #, c-format msgid "Switch-name is expected '%s'" msgstr "" #: cobc/typeck.c:794 cobc/typeck.c:826 #, c-format msgid "'%s' cannot be subscripted" msgstr "" #: cobc/typeck.c:798 #, c-format msgid "'%s' cannot be reference modified" msgstr "" #: cobc/typeck.c:829 #, c-format msgid "'%s' requires 1 subscript" msgstr "" #: cobc/typeck.c:832 #, c-format msgid "'%s' requires %d subscripts" msgstr "" #: cobc/typeck.c:854 #, c-format msgid "Subscript of '%s' out of bounds: %d" msgstr "" #: cobc/typeck.c:896 #, c-format msgid "Offset of '%s' out of bounds: %d" msgstr "" #: cobc/typeck.c:900 #, c-format msgid "Length of '%s' out of bounds: %d" msgstr "" #: cobc/typeck.c:971 msgid "ANY LENGTH item not allowed here" msgstr "" #: cobc/typeck.c:975 msgid "88 level item not allowed here" msgstr "" #: cobc/typeck.c:1224 #, c-format msgid "Duplicate character values in alphabet '%s'" msgstr "" #: cobc/typeck.c:1228 #, c-format msgid "Invalid character values in alphabet '%s'" msgstr "" #: cobc/typeck.c:1265 #, c-format msgid "'%s' not alphabet name" msgstr "" #: cobc/typeck.c:1324 #, c-format msgid "'%s' will be implicitly defined" msgstr "" #: cobc/typeck.c:1341 #, c-format msgid "ASSIGN data item '%s' invalid" msgstr "" #: cobc/typeck.c:1352 #, c-format msgid "'%s' CURSOR is not 4 or 6 characters long" msgstr "" #: cobc/typeck.c:1362 #, c-format msgid "'%s' CRT STATUS is not 4 characters long" msgstr "" #: cobc/typeck.c:1408 msgid "Invalid RECORD DEPENDING item" msgstr "" #: cobc/typeck.c:1432 #, c-format msgid "'%s' not procedure name" msgstr "" #: cobc/typeck.c:1552 msgid "Suggest parentheses around AND within OR" msgstr "" #: cobc/typeck.c:3015 #, c-format msgid "Invalid input stream '%s'" msgstr "" #: cobc/typeck.c:3036 cobc/typeck.c:3045 cobc/typeck.c:3440 cobc/typeck.c:3443 #: cobc/typeck.c:3451 #, c-format msgid "'%s' undefined in SPECIAL-NAMES" msgstr "" #: cobc/typeck.c:3071 msgid "Target of ALLOCATE is not a BASED item" msgstr "" #: cobc/typeck.c:3078 msgid "Target of RETURNING is not a data pointer" msgstr "" #: cobc/typeck.c:3084 msgid "The CHARACTERS field of ALLOCATE must be numeric" msgstr "" #: cobc/typeck.c:3118 msgid "Only alphanumeric FUNCTION types are allowed here" msgstr "" #: cobc/typeck.c:3125 msgid "Invalid RETURNING field" msgstr "" #: cobc/typeck.c:3135 msgid "Figurative constant invalid here" msgstr "" #: cobc/typeck.c:3140 #, c-format msgid "'%s' Not a data name" msgstr "" #: cobc/typeck.c:3147 #, c-format msgid "'%s' is not 01 or 77 level item" msgstr "" #: cobc/typeck.c:3158 #, c-format msgid "Wrong number of CALL parameters for '%s'" msgstr "" #: cobc/typeck.c:3202 cobc/typeck.c:3245 cobc/typeck.c:5075 cobc/typeck.c:5195 #: cobc/typeck.c:5254 cobc/typeck.c:5914 msgid "Operation not allowed on SORT files" msgstr "" #: cobc/typeck.c:3330 #, c-format msgid "'%s' is an invalid type for DISPLAY operand" msgstr "" #: cobc/typeck.c:3335 msgid "Invalid type for DISPLAY operand" msgstr "" #: cobc/typeck.c:3419 msgid "Invalid output stream" msgstr "" #: cobc/typeck.c:3533 msgid "Invalid use of 88 level in WHEN expression" msgstr "" #: cobc/typeck.c:3582 msgid "Wrong number of WHEN parameters" msgstr "" #: cobc/typeck.c:3626 cobc/typeck.c:3638 #, c-format msgid "" "Target %d of FREE, a data address identifier, must address a BASED data item" msgstr "" #: cobc/typeck.c:3644 #, c-format msgid "Target %d of FREE must be a data pointer" msgstr "" #: cobc/typeck.c:3667 msgid "GO TO with multiple procedure-names" msgstr "" #: cobc/typeck.c:3735 msgid "Invalid target for INSPECT" msgstr "" #: cobc/typeck.c:3742 cobc/typeck.c:3746 msgid "Invalid target for REPLACING/CONVERTING" msgstr "" #: cobc/typeck.c:3771 msgid "Data name expected before CHARACTERS" msgstr "" #: cobc/typeck.c:3781 msgid "Data name expected before ALL" msgstr "" #: cobc/typeck.c:3791 msgid "Data name expected before LEADING" msgstr "" #: cobc/typeck.c:3801 msgid "Data name expected before TRAILING" msgstr "" #: cobc/typeck.c:3811 #, c-format msgid "ALL, LEADING or TRAILING expected before '%s'" msgstr "" #: cobc/typeck.c:3890 #, c-format msgid "Internal register '%s' defined as BINARY-LONG" msgstr "" #: cobc/typeck.c:3892 #, c-format msgid "'%s' defined here as PIC %s" msgstr "" #: cobc/typeck.c:3894 #, c-format msgid "'%s' defined here as a group of length %d" msgstr "" #: cobc/typeck.c:3968 msgid "Invalid destination for MOVE" msgstr "" #: cobc/typeck.c:4069 msgid "Data item not signed" msgstr "" #: cobc/typeck.c:4073 msgid "Ignoring negative sign" msgstr "" #: cobc/typeck.c:4356 msgid "Move non-integer to alphanumeric" msgstr "" #: cobc/typeck.c:4382 msgid "Invalid source for MOVE" msgstr "" #: cobc/typeck.c:4399 msgid "Invalid VALUE clause" msgstr "" #: cobc/typeck.c:4401 msgid "Invalid MOVE statement" msgstr "" #: cobc/typeck.c:4407 msgid "Invalid VALUE clause - literal exceeds data size" msgstr "" #: cobc/typeck.c:4411 msgid "Numeric literal exceeds data size" msgstr "" #: cobc/typeck.c:4417 msgid "Numeric value is expected" msgstr "" #: cobc/typeck.c:4421 msgid "Alphanumeric value is expected" msgstr "" #: cobc/typeck.c:4425 msgid "Value does not fit the picture string" msgstr "" #: cobc/typeck.c:4429 msgid "Value size exceeds data size" msgstr "" #: cobc/typeck.c:4433 msgid "Sending field larger than receiving field" msgstr "" #: cobc/typeck.c:4437 msgid "Some digits may be truncated" msgstr "" #: cobc/typeck.c:5203 msgid "READ PREVIOUS only allowed for INDEXED SEQUENTIAL files" msgstr "" #: cobc/typeck.c:5210 msgid "KEY ignored with sequential READ" msgstr "" #: cobc/typeck.c:5242 msgid "REWRITE requires a record name as subject" msgstr "" #: cobc/typeck.c:5247 msgid "REWRITE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5259 cobc/typeck.c:5919 cobc/parser.y:5136 msgid "INVALID KEY clause invalid with this file type" msgstr "" #: cobc/typeck.c:5262 cobc/typeck.c:5923 cobc/parser.y:5128 msgid "LOCK clause invalid with file LOCK AUTOMATIC" msgstr "" #: cobc/typeck.c:5294 msgid "RELEASE requires a record name as subject" msgstr "" #: cobc/typeck.c:5299 msgid "RELEASE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5306 msgid "RELEASE not allowed on this record item" msgstr "" #: cobc/typeck.c:5383 #, c-format msgid "Undeclared key '%s'" msgstr "" #: cobc/typeck.c:5387 msgid "Invalid SEARCH ALL condition" msgstr "" #: cobc/typeck.c:5494 msgid "The targets of SET must be either indexes or pointers" msgstr "" #: cobc/typeck.c:5506 cobc/typeck.c:5510 msgid "SET targets must be PROGRAM-POINTER" msgstr "" #: cobc/typeck.c:5524 #, c-format msgid "The address of '%s' cannot be changed" msgstr "" #: cobc/typeck.c:5586 cobc/typeck.c:5591 cobc/typeck.c:5618 cobc/typeck.c:5623 msgid "Invalid SET statement" msgstr "" #: cobc/typeck.c:5627 msgid "Field does not have FALSE clause" msgstr "" #: cobc/typeck.c:5661 msgid "Invalid SORT filename" msgstr "" #: cobc/typeck.c:5677 msgid "Table sort without keys not implemented yet" msgstr "" #: cobc/typeck.c:5701 msgid "Invalid SORT USING parameter" msgstr "" #: cobc/typeck.c:5725 msgid "Invalid SORT GIVING parameter" msgstr "" #: cobc/typeck.c:5902 msgid "WRITE requires a record name as subject" msgstr "" #: cobc/typeck.c:5907 msgid "WRITE subject does not refer to a record name" msgstr "" #: cobc/typeck.c:5926 msgid "LOCK clause invalid here" msgstr "" #: cobc/typeck.c:5993 msgid "Invalid mnemonic name" msgstr "" #: cobc/pplex.l:105 msgid "PROCESS statement is ignored" msgstr "" #: cobc/pplex.l:278 cobc/pplex.l:350 #, c-format msgid "%s: %s" msgstr "" #: cobc/pplex.l:415 cobc/pplex.l:460 msgid "Invalid directive - ignored" msgstr "" #: cobc/pplex.l:518 msgid "Line not terminated by a newline" msgstr "" #: cobc/pplex.l:565 #, c-format msgid "Invalid indicator '%c' at column 7" msgstr "" #: cobc/pplex.l:608 #, c-format msgid "Source text after column %d" msgstr "" #: cobc/pplex.l:637 cobc/pplex.l:647 msgid "Invalid line continuation" msgstr "" #: cobc/parser.y:39 #, c-format msgid "'%s' not implemented" msgstr "" #: cobc/parser.y:129 msgid "Unreachable statement" msgstr "" #: cobc/parser.y:178 #, c-format msgid "'%s' not level 01 or 77" msgstr "" #: cobc/parser.y:182 #, c-format msgid "'%s' is not in LINKAGE SECTION" msgstr "" #: cobc/parser.y:185 #, c-format msgid "'%s' can not be BASED/EXTERNAL" msgstr "" #: cobc/parser.y:190 #, c-format msgid "'%s' is not in WORKING-STORAGE SECTION" msgstr "" #: cobc/parser.y:197 #, c-format msgid "'%s' REDEFINES field not allowed here" msgstr "" #: cobc/parser.y:214 #, c-format msgid "LINKAGE item '%s' is not a PROCEDURE USING parameter" msgstr "" #: cobc/parser.y:221 #, c-format msgid "ENTRY '%s' duplicated" msgstr "" #: cobc/parser.y:235 cobc/parser.y:248 #, c-format msgid "%s statement not terminated by END-%s" msgstr "" #: cobc/parser.y:285 msgid "USE statement invalid for SORT file" msgstr "" #: cobc/parser.y:787 msgid "Multiple PROGRAM-ID's without matching END PROGRAM" msgstr "" #: cobc/parser.y:853 cobc/parser.y:877 #, c-format msgid "END PROGRAM '%s' is different to PROGRAM-ID '%s'" msgstr "" #: cobc/parser.y:901 #, c-format msgid "END FUNCTION '%s' is different to FUNCTION-ID '%s'" msgstr "" #: cobc/parser.y:960 msgid "FUNCTION-ID is not yet implemented" msgstr "" #: cobc/parser.y:1019 cobc/parser.y:1026 msgid "COMMON may only be used in a nested program" msgstr "" #: cobc/parser.y:1066 msgid "CONFIGURATION SECTION not allowed in nested programs" msgstr "" #: cobc/parser.y:1235 cobc/parser.y:1245 #, c-format msgid "Unknown system-name '%s'" msgstr "" #: cobc/parser.y:1237 msgid "Invalid CRT clause" msgstr "" #: cobc/parser.y:1355 msgid "Invalid SYMBOLIC clause" msgstr "" #: cobc/parser.y:1426 cobc/parser.y:1475 #, c-format msgid "Invalid currency sign '%s'" msgstr "" #: cobc/parser.y:1534 cobc/parser.y:1543 msgid "INPUT-OUTPUT SECTION header missing - assumed" msgstr "" #: cobc/parser.y:1536 cobc/parser.y:1545 msgid "INPUT-OUTPUT SECTION header missing" msgstr "" #: cobc/parser.y:1748 cobc/parser.y:1757 cobc/parser.y:1766 cobc/parser.y:1775 msgid "Invalid or duplicate ORGANIZED clause" msgstr "" #: cobc/parser.y:1948 msgid "FILE SECTION header missing - assumed" msgstr "" #: cobc/parser.y:1950 msgid "FILE SECTION header missing" msgstr "" #: cobc/parser.y:1968 cobc/parser.y:1980 msgid "RECORD description missing or invalid" msgstr "" #: cobc/parser.y:2023 cobc/parser.y:2030 msgid "File cannot have both EXTERNAL and GLOBAL clauses" msgstr "" #: cobc/parser.y:2062 cobc/parser.y:2076 msgid "RECORD clause ignored for LINE SEQUENTIAL" msgstr "" #: cobc/parser.y:2067 cobc/parser.y:2092 cobc/parser.y:2115 msgid "RECORD clause invalid" msgstr "" #: cobc/parser.y:2191 msgid "LINAGE clause with wrong file type" msgstr "" #: cobc/parser.y:2253 #, c-format msgid "Alphabet-name is expected '%s'" msgstr "" #: cobc/parser.y:2266 msgid "file descriptor REPORT IS" msgstr "" #: cobc/parser.y:2270 msgid "file descriptor REPORTS ARE" msgstr "" #: cobc/parser.y:2337 cobc/parser.y:3167 msgid "Item requires a data name" msgstr "" #: cobc/parser.y:2390 msgid "CONSTANT with GLOBAL clause is not yet supported" msgstr "" #: cobc/parser.y:2408 msgid "CONSTANT item not at 01 level" msgstr "" #: cobc/parser.y:2459 msgid "REDEFINES clause should follow entry-name" msgstr "" #: cobc/parser.y:2461 msgid "REDEFINES clause must follow entry-name" msgstr "" #: cobc/parser.y:2479 msgid "EXTERNAL not allowed here" msgstr "" #: cobc/parser.y:2481 msgid "EXTERNAL only allowed at 01/77 level" msgstr "" #: cobc/parser.y:2483 msgid "EXTERNAL requires a data name" msgstr "" #: cobc/parser.y:2485 cobc/parser.y:2518 msgid "GLOBAL and EXTERNAL are mutually exclusive" msgstr "" #: cobc/parser.y:2487 cobc/parser.y:2765 msgid "BASED and EXTERNAL are mutually exclusive" msgstr "" #: cobc/parser.y:2489 msgid "EXTERNAL and REDEFINES are mutually exclusive" msgstr "" #: cobc/parser.y:2514 msgid "GLOBAL only allowed at 01/77 level" msgstr "" #: cobc/parser.y:2516 msgid "GLOBAL requires a data name" msgstr "" #: cobc/parser.y:2520 msgid "GLOBAL not allowed here" msgstr "" #: cobc/parser.y:2639 msgid "Maximum OCCURS depth exceeded" msgstr "" #: cobc/parser.y:2759 msgid "BASED not allowed here" msgstr "" #: cobc/parser.y:2761 msgid "BASED only allowed at 01/77 level" msgstr "" #: cobc/parser.y:2763 msgid "BASED requires a data name" msgstr "" #: cobc/parser.y:2767 msgid "BASED and REDEFINES are mutually exclusive" msgstr "" #: cobc/parser.y:2769 cobc/parser.y:2842 msgid "BASED and ANY LENGTH are mutually exclusive" msgstr "" #: cobc/parser.y:2797 msgid "FALSE clause only allowed for 88 level" msgstr "" #: cobc/parser.y:2812 cobc/parser.y:2824 cobc/parser.y:2827 msgid "RENAMES may not reference a level 01 or > 50" msgstr "" #: cobc/parser.y:2858 msgid "LOCAL-STORAGE not allowed in nested programs" msgstr "" #: cobc/parser.y:2891 msgid "REPORT SECTION not supported" msgstr "" #: cobc/parser.y:2924 msgid "Report description using defaults" msgstr "" #: cobc/parser.y:2932 msgid "GLOBAL is not allowed with RD" msgstr "" #: cobc/parser.y:3011 msgid "looking for Report line TYPE" msgstr "" #: cobc/parser.y:3320 msgid "Executable program requested but PROCEDURE/ENTRY has USING clause" msgstr "" #: cobc/parser.y:3383 cobc/parser.y:4057 msgid "BY VALUE not allowed in CHAINED program" msgstr "" #: cobc/parser.y:3395 cobc/parser.y:3403 cobc/parser.y:3413 cobc/parser.y:3442 msgid "SIZE only allowed for BY VALUE items" msgstr "" #: cobc/parser.y:3415 cobc/parser.y:3432 cobc/parser.y:3444 cobc/parser.y:3461 msgid "Invalid value for SIZE" msgstr "" #: cobc/parser.y:3473 msgid "OPTIONAL only allowed for BY REFERENCE items" msgstr "" #: cobc/parser.y:3482 msgid "RETURNING clause is required for a FUNCTION" msgstr "" #: cobc/parser.y:3490 msgid "RETURNING item is not defined in LINKAGE SECTION" msgstr "" #: cobc/parser.y:3637 #, c-format msgid "Unknown statement '%s'" msgstr "" #: cobc/parser.y:3983 msgid "ALTER statement is obsolete and unsupported" msgstr "" #: cobc/parser.y:4029 msgid "OMITTED only allowed with BY REFERENCE" msgstr "" #: cobc/parser.y:4049 msgid "BY CONTENT not allowed in CHAINED program" msgstr "" #: cobc/parser.y:4370 msgid "ENTRY is invalid in nested program" msgstr "" #: cobc/parser.y:4373 #, c-format msgid "ENTRY '%s' invalid" msgstr "" #: cobc/parser.y:4548 msgid "EXIT PROGRAM is not allowed within a USE GLOBAL procedure" msgstr "" #: cobc/parser.y:4559 cobc/parser.y:4576 msgid "EXIT PERFORM is only valid with inline PERFORM" msgstr "" #: cobc/parser.y:4593 msgid "EXIT SECTION is only valid with an active SECTION" msgstr "" #: cobc/parser.y:4611 msgid "EXIT PARAGRAPH is only valid with an active PARAGRAPH" msgstr "" #: cobc/parser.y:4893 msgid "INSPECT missing a keyword" msgstr "" #: cobc/parser.y:5132 msgid "KEY clause invalid with this file type" msgstr "" #: cobc/parser.y:5435 msgid "File sort requires KEY phrase" msgstr "" #: cobc/parser.y:5484 msgid "File sort requires USING or INPUT PROCEDURE" msgstr "" #: cobc/parser.y:5490 msgid "USING invalid with table SORT" msgstr "" #: cobc/parser.y:5498 msgid "INPUT PROCEDURE invalid with table SORT" msgstr "" #: cobc/parser.y:5509 msgid "File sort requires GIVING or OUTPUT PROCEDURE" msgstr "" #: cobc/parser.y:5515 msgid "GIVING invalid with table SORT" msgstr "" #: cobc/parser.y:5523 msgid "OUTPUT PROCEDURE invalid with table SORT" msgstr "" #: cobc/parser.y:5544 msgid "START not allowed on SEQUENTIAL files" msgstr "" #: cobc/parser.y:5550 cobc/parser.y:6370 cobc/parser.y:6443 #, c-format msgid "'%s' is not a file name" msgstr "" #: cobc/parser.y:5813 msgid "USE statement must be within DECLARATIVES" msgstr "" #: cobc/parser.y:5815 msgid "SECTION header missing before USE statement" msgstr "" #: cobc/parser.y:6356 msgid "LINAGE-COUNTER must be qualified here" msgstr "" #: cobc/parser.y:6359 msgid "Invalid LINAGE-COUNTER usage" msgstr "" #: cobc/parser.y:6406 #, c-format msgid "'%s' not indexed" msgstr "" #: cobc/parser.y:6407 #, c-format msgid "'%s' defined here" msgstr "" #: cobc/parser.y:6429 #, c-format msgid "Multiple reference to '%s' " msgstr "" #: cobc/parser.y:6669 cobc/parser.y:6671 msgid "Integer value expected" msgstr "" #: cobc/scanner.l:500 msgid "User defined name must be less than 32 characters" msgstr "" #: cobc/scanner.l:560 #, c-format msgid "CONSTANT (78 level) may not be used here - '%s'" msgstr "" #: cobc/scanner.l:729 msgid "Alphanumeric literal has zero length" msgstr "" #: cobc/scanner.l:730 msgid "A SPACE will be assumed" msgstr "" #: cobc/scanner.l:787 #, c-format msgid "Invalid X literal: %s" msgstr "" #: cobc/scanner.l:823 #, c-format msgid "Invalid H literal: %s" msgstr "" #: cobc/scanner.l:848 cobc/scanner.l:851 msgid "Invalid numeric literal" msgstr "" #: cobc/flag.def:26 msgid "Generate trace code (Executed SECTION/PARAGRAPH)" msgstr "" #: cobc/flag.def:29 msgid "Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS)" msgstr "" #: cobc/flag.def:32 msgid "Syntax error checking only; don't emit any output" msgstr "" #: cobc/flag.def:35 msgid "Output static function calls for the CALL statement" msgstr "" #: cobc/flag.def:38 msgid "Enable debugging lines ('D' in indicator column)" msgstr "" #: cobc/flag.def:41 msgid "Generate source location code (Turned on by -debug or -g)" msgstr "" #: cobc/flag.def:44 msgid "Do automatic initialization of the Cobol runtime system" msgstr "" #: cobc/flag.def:47 msgid "Numeric display sign ASCII (Default on ASCII machines)" msgstr "" #: cobc/flag.def:50 msgid "Numeric display sign EBCDIC (Default on EBCDIC machines)" msgstr "" #: cobc/flag.def:53 msgid "PERFORM stack checking (Turned on by -debug or -g)" msgstr "" #: cobc/flag.def:56 msgid "Fold COPY subject to lower case (Default no transformation)" msgstr "" #: cobc/flag.def:59 msgid "Fold COPY subject to upper case (Default no transformation)" msgstr "" #: cobc/flag.def:62 msgid "Do not truncate binary fields according to PICTURE" msgstr "" #: cobc/flag.def:65 msgid "Allow use of intrinsic functions without FUNCTION keyword" msgstr "" #: cobc/flag.def:68 msgid "'*' or '/' in column 1 treated as comment (FIXED only)" msgstr "" #: cobc/flag.def:71 msgid "Pass extra NULL terminating pointers on CALL statements" msgstr "" #: cobc/warning.def:26 msgid "Warn if obsolete features are used" msgstr "" #: cobc/warning.def:29 msgid "Warn if archaic features are used" msgstr "" #: cobc/warning.def:32 msgid "Warn incompatible redefinition of data items" msgstr "" #: cobc/warning.def:35 msgid "Warn inconsistent constant" msgstr "" #: cobc/warning.def:38 msgid "Warn lack of parentheses around AND within OR" msgstr "" #: cobc/warning.def:41 msgid "Warn type mismatch strictly" msgstr "" #: cobc/warning.def:44 msgid "Warn implicitly defined data items" msgstr "" #: cobc/warning.def:47 msgid "Warn non 01/77 items for CALL params" msgstr "" #: cobc/warning.def:50 msgid "Warn text after column 72, FIXED format" msgstr "" #: cobc/warning.def:53 msgid "Warn lack of scope terminator END-XXX" msgstr "" #: cobc/warning.def:56 msgid "Warn possible field truncation" msgstr "" #: cobc/warning.def:59 msgid "Warn dangling LINKAGE items" msgstr "" #: cobc/warning.def:62 msgid "Warn unreachable statements" msgstr "" open-cobol-1.1/po/stamp-po0000644000000000000000000000001211143001517011122 timestamp open-cobol-1.1/po/ChangeLog0000644000000000000000000000011007500643120011214 2002-05-29 Keisuke Nishida * ja.po: New file. open-cobol-1.1/po/Makefile.in.in0000644000000000000000000002747207764237163012162 # Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.13 PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @echo "touch stamp-po" @echo timestamp > stamp-poT @mv stamp-poT stamp-po # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir); \ else \ cp -p $(srcdir)/$$file $(distdir); \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/bin/0000777000000000000000000000000011143001516007663 5open-cobol-1.1/bin/cobcrun.c0000644000000000000000000000452211136547021011411 /* * Copyright (C) 2004-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include "defaults.h" #include #include #include #include static void print_version (void) { int year; int day; char buff[64]; char month[64]; memset (buff, 0, sizeof(buff)); memset (month, 0, sizeof(month)); day = 0; year = 0; sscanf (__DATE__, "%s %d %d", month, &day, &year); if (day && year) { sprintf (buff, "%s %2.2d %4.4d %s", month, day, year, __TIME__); } else { sprintf (buff, "%s %s", __DATE__, __TIME__); } printf ("cobcrun (%s) %s.%d\n", PACKAGE_NAME, PACKAGE_VERSION, PATCH_LEVEL); puts ("Copyright (C) 2004-2009 Roger While"); printf ("Built %s\nPackaged %s\n", buff, octardate); } static void print_usage (void) { printf ("Usage: cobcrun PROGRAM [param ...]\n"); printf ("or : cobcrun --help (-h)\n"); printf (" Print this help\n"); printf ("or : cobcrun --version (-V)\n"); printf (" Print version information\n"); } int main (int argc, char **argv) { union { int (*func)(); void *func_void; } unifunc; if (argc <= 1) { print_usage (); return 1; } /* Quick check without getopt */ if (!strncmp (argv[1], "--version", 10) || !strncmp (argv[1], "-V", 4)) { print_version (); return 0; } if (!strncmp (argv[1], "--help", 10) || !strncmp (argv[1], "-h", 4)) { print_usage (); return 0; } if (strlen (argv[1]) > 31) { fprintf (stderr, "Invalid PROGRAM name\n"); return 1; } cob_init (argc - 1, &argv[1]); unifunc.func_void = cob_resolve (argv[1]); if (unifunc.func_void == NULL) { cob_call_error (); } cob_stop_run ( unifunc.func() ); } open-cobol-1.1/bin/Makefile.am0000644000000000000000000000043211130701401011626 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2004-2009 Roger While ## bin_PROGRAMS = cobcrun cobcrun_SOURCES = cobcrun.c AM_LDFLAGS = $(COB_EXPORT_DYN) cobcrun_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir) cobcrun_LDADD = $(top_builddir)/libcob/libcob.la open-cobol-1.1/bin/Makefile.in0000644000000000000000000004106011130703170011646 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = cobcrun$(EXEEXT) subdir = bin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_cobcrun_OBJECTS = cobcrun-cobcrun.$(OBJEXT) cobcrun_OBJECTS = $(am_cobcrun_OBJECTS) cobcrun_DEPENDENCIES = $(top_builddir)/libcob/libcob.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(cobcrun_SOURCES) DIST_SOURCES = $(cobcrun_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ cobcrun_SOURCES = cobcrun.c AM_LDFLAGS = $(COB_EXPORT_DYN) cobcrun_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir) cobcrun_LDADD = $(top_builddir)/libcob/libcob.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu bin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done cobcrun$(EXEEXT): $(cobcrun_OBJECTS) $(cobcrun_DEPENDENCIES) @rm -f cobcrun$(EXEEXT) $(LINK) $(cobcrun_LDFLAGS) $(cobcrun_OBJECTS) $(cobcrun_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobcrun-cobcrun.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< cobcrun-cobcrun.o: cobcrun.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobcrun_CFLAGS) $(CFLAGS) -MT cobcrun-cobcrun.o -MD -MP -MF "$(DEPDIR)/cobcrun-cobcrun.Tpo" -c -o cobcrun-cobcrun.o `test -f 'cobcrun.c' || echo '$(srcdir)/'`cobcrun.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobcrun-cobcrun.Tpo" "$(DEPDIR)/cobcrun-cobcrun.Po"; else rm -f "$(DEPDIR)/cobcrun-cobcrun.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cobcrun.c' object='cobcrun-cobcrun.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobcrun_CFLAGS) $(CFLAGS) -c -o cobcrun-cobcrun.o `test -f 'cobcrun.c' || echo '$(srcdir)/'`cobcrun.c cobcrun-cobcrun.obj: cobcrun.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobcrun_CFLAGS) $(CFLAGS) -MT cobcrun-cobcrun.obj -MD -MP -MF "$(DEPDIR)/cobcrun-cobcrun.Tpo" -c -o cobcrun-cobcrun.obj `if test -f 'cobcrun.c'; then $(CYGPATH_W) 'cobcrun.c'; else $(CYGPATH_W) '$(srcdir)/cobcrun.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobcrun-cobcrun.Tpo" "$(DEPDIR)/cobcrun-cobcrun.Po"; else rm -f "$(DEPDIR)/cobcrun-cobcrun.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cobcrun.c' object='cobcrun-cobcrun.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobcrun_CFLAGS) $(CFLAGS) -c -o cobcrun-cobcrun.obj `if test -f 'cobcrun.c'; then $(CYGPATH_W) 'cobcrun.c'; else $(CYGPATH_W) '$(srcdir)/cobcrun.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/bin/ChangeLog0000644000000000000000000000212011077062645011364 2008-10-20 Roger While * cobcrun.c : Allow help and version options 2007-12-27 Roger While ** Mark 1.0 RELEASE 2006-10-23 Roger While * Makefile.am : Remove gcc options 2005-12-31 Roger While * Makefile.am : Only generate version with shared library 2005-08-04 Roger While * Change exit to cob_stop_run 2005-05-27 Roger While * Fix Makefile again 2005-05-03 Roger While * Fix makefile 2005-02-02 Roger While * Forgot the GPL license 2004-11-29 Roger While * Initial checkout * cobcrun.c, Makefile.am, Makefile.in * syntax : cobcrun MYPROG [ arguments to MYPROG] * This allows complete applications to be compiled as modules and offers similar functionality to MF's cobrun and ACU's runcbl. In fact, you can run all three in the same directory and, if your scripts use an environment variable for the driver program (eg. $COBEXEC), then you can switch easily. open-cobol-1.1/lib/0000777000000000000000000000000011143001516007661 5open-cobol-1.1/lib/getopt.c0000644000000000000000000010332710703447610011263 /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include #ifdef HAVE_UNISTD_H # include #endif #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. */ # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) # endif # else # define _(msgid) (msgid) # endif # if defined _LIBC && defined USE_IN_LIBIO # include # endif #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized attribute_hidden; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL && argc == __libc_argc && argv == __libc_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #endif } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ open-cobol-1.1/lib/getopt.h0000644000000000000000000001446610476501577011307 /* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if (defined __STDC__ && __STDC__) || defined __cplusplus # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ open-cobol-1.1/lib/Makefile.am0000644000000000000000000000042111130701401011622 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## noinst_HEADERS = gettext.h noinst_LIBRARIES = libsupport.a libsupport_a_SOURCES = dummymac.c libsupport_a_LIBADD = @LIBOBJS@ open-cobol-1.1/lib/Makefile.in0000644000000000000000000003361411130703171011653 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ChangeLog getopt.c getopt.h getopt1.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libsupport_a_AR = $(AR) $(ARFLAGS) libsupport_a_DEPENDENCIES = @LIBOBJS@ am_libsupport_a_OBJECTS = dummymac.$(OBJEXT) libsupport_a_OBJECTS = $(am_libsupport_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libsupport_a_SOURCES) DIST_SOURCES = $(libsupport_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ noinst_HEADERS = gettext.h noinst_LIBRARIES = libsupport.a libsupport_a_SOURCES = dummymac.c libsupport_a_LIBADD = @LIBOBJS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libsupport.a: $(libsupport_a_OBJECTS) $(libsupport_a_DEPENDENCIES) -rm -f libsupport.a $(libsupport_a_AR) libsupport.a $(libsupport_a_OBJECTS) $(libsupport_a_LIBADD) $(RANLIB) libsupport.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummymac.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/lib/getopt1.c0000644000000000000000000001105110476501577011346 /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef _LIBC # include #else # include "getopt.h" #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } # ifdef _LIBC libc_hidden_def (getopt_long) libc_hidden_def (getopt_long_only) # endif #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ open-cobol-1.1/lib/gettext.h0000644000000000000000000000520210476501577011455 /* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include # include #else /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String #define _(s) gettext(s) #define N_(s) gettext_noop(s) #endif /* _LIBGETTEXT_H */ open-cobol-1.1/lib/dummymac.c0000644000000000000000000000006010517112054011555 void dummymacfix(void); void dummymacfix () { } open-cobol-1.1/lib/ChangeLog0000644000000000000000000000136511001667760011370 2007-12-27 Roger While ** Mark 1.0 RELEASE 2006-10-23 Roger While * Prototype in dummymac.c 2005-10-25 Roger While * New element dummymac.c - Needed while some versions of "ar" are not capable of generating empty archives. 2003-07-28 Keisuke Nishida * malloc.c, memcmp.c, realloc.c: Removed. 2002-08-29 Keisuke Nishida * mkstemp.c, tempname.c: Removed. 2002-08-28 Keisuke Nishida * Makefile.am: Use AC_LIBOBJ scheme. * memcmp.c, mkstemp.c, tempname.c: Extracted from fileutils-4.1.11. 2002-05-29 Keisuke Nishida * getopt.c, getopt.h, getopt1.c: Extracted from glibc-2.2.5. open-cobol-1.1/NEWS0000644000000000000000000002667010737200401007543 NEWS - user visible changes -*- outline -*- * OpenCOBOL 1.0 released * Changes in OpenCOBOL 0.33 ** New compile option '-x'. This causes the compiler to produce an executable program. '-fmain' is deprecated. ** Remove long option --verbose. Use '-v' for verbosity. Problem is with getopt_long_only which does not like eg. -mv ** New conformity option -std=bs2000. ** FUNCTION is implemented. See cobc/reserved.c for a list of what is implemented. ** Nested programs are partially supported. ** LINAGE is implemented. ** EXTERNAL on FD is implemented. ** SAME RECORD AREA is implemented. ** New config variables - "perform-osvs", "sticky-linkage". These are activated for -std=ibm and -std=mvs. "relax-level-hierarchy". Allows mismatched data description level numbers. Activated for -std=mf, ibm, mvs and bs2000. ** Support for non-gcc compilers. ** Large file support, system dynamic loading and Berkeley DB inclusion are default for the configure. ie. ./configure assumes --with-db --with-lfs64 --with-dl ** New configure option --with-patch-level= Default is 0. ** At run time, version checking is done. ie. When executing/loading Cobol programs, the version (eg. 0.33) and the patch level (eg. 0) are checked against the OC library version/patch level. ** Libtool is not required for systems that support native dynamic loading. This includes Linux, Cygwin and MingW amongst others. ** Note to developers : See README for required software versions. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.32 ** Stability update - See individual ChangeLogs ** New internal register - NUMBER-OF-CALL-PARAMETERS ** New config variables - larger-redefines-ok, relaxed-syntax-check ** Powerpc changes - We now pass all OC and Cobol85 tests ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.31 ** Stability update - See individual ChangeLogs ** New driver program - "cobcrun" This allows all application programs to be compiled as modules and driven by "cobcrun" similar to MF's "cobrun". Syntax - cobcrun [Arguments to program "MAINPROG"] As "cobcrun" is linked with the static version of Open Cobol libraries, it is easier to maintain concurrent versions on the same system. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.30 ** Installation changes *** No longer use readline. *** No longer use run-time configuration file (libcob.conf) *** libdb is now optional. Use the new configure option --with-db1 to link with libdb1. Use the new configure option --with-db to link with libdb. Otherwise, libdb will not be linked, and indexed files and SORT/MERGE statements will not work. *** New subdirectory `config' will be installed under $prefix/share/open-cobol. ** Compatibility changes *** New -std options: default used when you omit -std cobol85 COBOL 85 Standard cobol2002 COBOL 2002 Standard ibm IBM COBOL compatibility mf Micro Focus COBOL compatibility v023 OpenCOBOL 0.23 compatibility *** Compile-time options can be stored in a "config" file. See config/default.conf for details. *** Binary data items are now big endian. The config option `binary-byteorder' controls this. *** Numeric sign of USAGE DISPLAY items has been changed as follows: Positive: 0123456789 Negative: pqrstuvwxy The config option `display-sign' controls this. *** Data items defined in the working-storage section are initialized at the beginning of program by default. The config option `auto-initialize' controls this. *** SORT statement now creates a temporary file in /tmp for sorting and removes it after sorting. ** Feature changes *** COPY statements try to complement the following file extensions: .CBL, .COB, .cbl, or .cob. *** COPY / REPLACE statements are reimplemented for better replacement. *** SPECIAL-NAMES. FORMFEED IS ... *** ALPHABET ... IS EBCDIC. *** EXTERNAL clause. *** SHARING clause. *** USAGE COMP-5 and COMP-X. *** USAGE POINTER and ADDRESS OF operator. *** LENGTH OF operator. *** PROCEDURE DIVISION USING BY REFERENCE/CONTENT/VALUE. *** DISPLAY ... ENVIRONMENT-NAME. ACCEPT ... ENVIRONMENT-VALUE. *** COLLATING SEQUENCE in the SORT and MERGE statements. *** EXIT PERFORM [CYCLE] statement. *** SORT table. *** OPEN ... WITH NO REWIND / WITH LOCK recognized, though not working. *** Literal concatenation (the `&' operator). ** Compiler changes *** New compiler environment variable TMPDIR. *** New compiler environment variable COB_LDFLAGS. *** The runtime environment variable COB_CONFIG_FILE has been removed. *** New runtime environment variable COB_DYNAMIC_RELOADING. *** New compiler option `--list-reserved', which list all reserved words. *** New compiler option `-conf', which specifies the config file. *** New compiler option `-ext', which specifies the copy file extension. *** The compiler option `-O' now does C level optimization. *** New compiler option `-O2', which does further C level optimization. *** New compiler option `-L' and `-l', which are passed to the C compiler. *** New compiler option `-ftrace', which display section names at run time. *** New compiler option `-fsyntax-only', which does syntax error check only without any output. *** New compiler option `-fstatic-call', which is equivalent to `-static'. *** New compiler option `-fdebugging-line', which enables debugging lines. *** New compiler option `-fsource-location', which includes source location in the output. *** New compiler option `-fline-directive', which includes line directive in the output. *** New compiler option `-fruntime-inlining', which is the replacement of obsolete options `-finline-move' and `-finline-get-int'. *** New compiler option `-w', which inhibits warnings. *** New compiler option `-Wredefinition', which warns redefined names. *** The compiler options `-static' and `-dynamic' are obsolete. *** The compiler option `-column' removed. ** Many improvement for compatibility. ** Many many bug fixes. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.23 ** Installation changes *** We use the GNU MP library again. ** Run-time library changes *** `cob_resolve' now search the main program for the module name. ** Bug fixes *** Duplicate use of intermediate field variables. *** fseek issues on the MinGW environment. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.22 ** Installation changes *** We no longer depend on the GNU MP library. Decimal arithmetic is done by using `long long'. ** Compiler changes *** Alphabet-name has been implemented. *** Variable-length table has been implemented. *** De-editing (move numeric-edited to numeric) has been implemented. ** Bug fixes ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.21 ** Installation changes *** New configure argument --with-lfs64. ** Compiler changes *** New option -std, which specifies which COBOL standard to use. Currently the following standards are available: gnu GNU COBOL (default) cobol85 COBOL 85 cobol2002 COBOL 2002 mvs IBM COBOL for MVS & VM *** New option -O, which enables some optimization. *** New option -debug, which enables run-time error checking. *** New option -Wobsolete, which reports obsolete features. *** New option -Warchaic, which reports archaic features. *** -Wnext-sentence has been removed. Use -Warchaic instead. *** -fdebugging-line has been removed. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.20 ** cobpp has been integrated into cobc. Now cobc is the only binary program. ** cobc now generates an executable without `-main' flag. `-main' has been renamed to `-fmain', which is turned on by default if none of -E, -C, -S, -c, or -m is given. ** The default source format is now the fixed form. The format will not be detected automatically. You need to use SOURCE FORMAT compiler directive as described below. This conforms to the COBOL 2002 standard. ** Compiler directive "SOURCE FORMAT" is now supported. Put the following line at the beginning of file if you want to use the free-form: >>SOURCE FORMAT IS FREE ** Option `-semi-fixed' has been removed. If you want to expand the program text area over 72 columns, use the option `-column' instead. ** New option `-column', which specifies the end of program text area. ** New option `-T', which specifies the tab width. ** New warning options: -Wall Enable all warnings -Wcolumn-overflow Warn any text after column 72 -Wconstant Warn inconsistent constant -Wparentheses Warn lacks of parentheses around AND within OR -Wnext-sentence Warn uses of NEXT SENTENCE -Wimplicit-terminator Warn lacks of scope terminator (END-XXX) -Wstrict-typing Warn type mismatch strictly ** Option `debug' has been renamed to `-fdebugging-line'. ** USAGE PACKED-DECIMAL is now supported. ** Improved error checking. ** Additional testsuite entries. ** Bug fixes. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.12 ** Improved compile-time error check. ** Additional testsuite entries. ** Bug fixes. * Changes in OpenCOBOL 0.11 ----------------------------------------------------------------------- ** Part of run-time library interface has been redesigned. ** Bug fixes. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.10 ** Autoconf 2.57, Automake 1.7.2, Libtool 1.4.3, and Gettext 0.11.5 are used for packaging. ** New file cob.pc, which is used by pkg-config script. ** libcob.conf is now installed under sysconfdir (i.e., $(PREFIX)/etc). The default value of COB_CONFIG_FILE has been changed appropriately. ** The directory `tests' includes new testsuites. "make check" will run the tests. ** We use db1 again instead of db2 or db3. ** New option -semi-fixed. ** New option -Wtrailing-line. ** CALL statements now accept CONTENT LENGTH OF clause. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.9.7 ** The default value of COB_CONFIG_FILE has been changed to "$PREFIX/etc/open-cobol/libcob.conf". ** SORT and MERGE statements have been impelemented. ** Preliminary implementation of SCREEN SECTION. ** Many bug fixes and improvements. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.9.6 ** cobc now requires `-main' flag to build an executable from a COBOL file. Without -main, cobc does not generate a main function. See manual for details. ** Run-time configuration file: libcob.conf The environment variable `COB_CONFIG_FILE' specifies the file name (default: "${prefix}/share/open-cobol/libcob.conf"). ** Use gettext for international messages. ** Include the test suite in subdir `testsuite'. ** Many bug fixes and improvements. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.9.5 ** Support Berkeley DB 2.0. ** Many bug fixes. ----------------------------------------------------------------------- * Changes in OpenCOBOL 0.9.4 ** OpenCOBOL now requires Berkeley DB 3.0 or later. ** File I/O routine (libcob/fileio.c) has been reimplemented. ** New NIST Test Suite modules: SM, IC, SQ, RL, IX. ** Many bug fixes. open-cobol-1.1/TODO0000644000000000000000000000320310730717247007535 OpenCOBOL TODO -*- outline -*- 1 Pending requests 1.1 Handling of EBCDIC files 1.2 Listing file (2004-02-13: BUG: "COPY REPLACING ..." and REQUEST for "mini-listing") 1.3 Partial expression in the EVALUATE statement (2004-02-19: feature request: EVALUATE: partial-expression) 1.4 READ ... PREVIOUS 1.5 many bugs reported recently 2 Other features to be implemented 2.2 SCREEN SECTION COBOL 2002 has defined extended ACCEPT/DISPLAY. We can do this eventually. 2.3 Embedded SQL Frank Polscheit posted his implementation of SQL preprocessor. (2004-02-17: SQL pre-processor for OPEN-COBOL) Firebird (firebird.sourceforge.net) has a SQL preprocessor for their database. 2.4 New backends for INDEXED files - Look at C-ISAM replacements 3 Improvement of compiler internals 3.1 Error checking 3.1.1 Type checking with each statement Most statements do not check the type of thier parameters. We should do it at the beginning of each cb_emit_* functions. 3.1.2 Strict error checking depending on the standard Partially implemented 3.1.4 Use `error' token in the parser for better error recovery 4 Optimization 4.1 More inlining of run-time functions Done with various binary operands 5 Debugging support 5.1 Data access method We should generate all data hierarchy defined in a COBOL program with all relevant information, including data names, picture clauses, and source locations. We should also define a debugging function that receives a data name and displays its value using the generated data hierarchy. By calling the function from gdb, we can easily access the COBOL data at debugging time. 6 Better user manual Yes, we should open-cobol-1.1/cobc/0000777000000000000000000000000011143001516010021 5open-cobol-1.1/cobc/warning.def0000644000000000000000000000417011140601070012062 /* -*- c -*- * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "lib/gettext.h" /* CB_WARNDEF (var, name, wall, doc) */ CB_WARNDEF (cb_warn_obsolete, "obsolete", 1, N_("Warn if obsolete features are used")) CB_WARNDEF (cb_warn_archaic, "archaic", 1, N_("Warn if archaic features are used")) CB_WARNDEF (cb_warn_redefinition, "redefinition", 1, N_("Warn incompatible redefinition of data items")) CB_WARNDEF (cb_warn_constant, "constant", 1, N_("Warn inconsistent constant")) CB_WARNDEF (cb_warn_parentheses, "parentheses", 1, N_("Warn lack of parentheses around AND within OR")) CB_WARNDEF (cb_warn_strict_typing, "strict-typing", 1, N_("Warn type mismatch strictly")) CB_WARNDEF (cb_warn_implicit_define, "implicit-define", 1, N_("Warn implicitly defined data items")) CB_WARNDEF (cb_warn_call_params, "call-params", 0, N_("Warn non 01/77 items for CALL params")) CB_WARNDEF (cb_warn_column_overflow, "column-overflow", 0, N_("Warn text after column 72, FIXED format")) CB_WARNDEF (cb_warn_terminator, "terminator", 0, N_("Warn lack of scope terminator END-XXX")) CB_WARNDEF (cb_warn_truncate, "truncate", 0, N_("Warn possible field truncation")) CB_WARNDEF (cb_warn_linkage, "linkage", 0, N_("Warn dangling LINKAGE items")) CB_WARNDEF (cb_warn_unreachable, "unreachable", 0, N_("Warn unreachable statements")) open-cobol-1.1/cobc/typeck.c0000644000000000000000000041132011140116205011400 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef _WIN32 #define WINDOWS_LEAN_AND_MEAN #include #endif #ifdef HAVE_LOCALE_H #include #endif #include "cobc.h" #include "tree.h" struct system_table { const char *syst_name; const int syst_params; }; struct expr_node { /* The token of this node. * 'x' - values (cb_tree) * '+', '-', '*', '/', '^' - arithmetic operators * '=', '~', '<', '>', '[', ']' - relational operators * '!', '&', '|' - logical operators * '(', ')' - parentheses */ int token; /* The value itself if this node is a value */ cb_tree value; }; #define START_STACK_SIZE 32 #define TOKEN(offset) (expr_stack[expr_index + offset].token) #define VALUE(offset) (expr_stack[expr_index + offset].value) #define dpush(x) decimal_stack = cb_cons (x, decimal_stack) #define cb_emit(x) \ current_statement->body = cb_list_add (current_statement->body, x) #define cb_emit_list(l) \ current_statement->body = cb_list_append (current_statement->body, l) /* Global variables */ size_t sending_id = 0; size_t suppress_warn = 0; /* Local variables */ static cb_tree decimal_stack = NULL; static const char *inspect_func; static cb_tree inspect_data; static int expr_op; /* last operator */ static cb_tree expr_lh; /* last left hand */ static int expr_index; /* stack index */ static int expr_stack_size; /* stack max size */ static struct expr_node *expr_stack; /* expr node stack */ static char expr_prio[256]; static const struct system_table system_tab[] = { #undef COB_SYSTEM_GEN #define COB_SYSTEM_GEN(x, y, z) { x, y }, #include "libcob/system.def" { NULL, 0 } }; static const char *const bin_set_funcs[] = { NULL, "cob_setswp_u16_binary", "cob_setswp_u24_binary", "cob_setswp_u32_binary", "cob_setswp_u40_binary", "cob_setswp_u48_binary", "cob_setswp_u56_binary", "cob_setswp_u64_binary", NULL, "cob_setswp_s16_binary", "cob_setswp_s24_binary", "cob_setswp_s32_binary", "cob_setswp_s40_binary", "cob_setswp_s48_binary", "cob_setswp_s56_binary", "cob_setswp_s64_binary" }; static const char *const bin_compare_funcs[] = { "cob_cmp_u8_binary", "cob_cmp_u16_binary", "cob_cmp_u24_binary", "cob_cmp_u32_binary", "cob_cmp_u40_binary", "cob_cmp_u48_binary", "cob_cmp_u56_binary", "cob_cmp_u64_binary", "cob_cmp_s8_binary", "cob_cmp_s16_binary", "cob_cmp_s24_binary", "cob_cmp_s32_binary", "cob_cmp_s40_binary", "cob_cmp_s48_binary", "cob_cmp_s56_binary", "cob_cmp_s64_binary", "cob_cmp_u8_binary", "cob_cmpswp_u16_binary", "cob_cmpswp_u24_binary", "cob_cmpswp_u32_binary", "cob_cmpswp_u40_binary", "cob_cmpswp_u48_binary", "cob_cmpswp_u56_binary", "cob_cmpswp_u64_binary", "cob_cmp_s8_binary", "cob_cmpswp_s16_binary", "cob_cmpswp_s24_binary", "cob_cmpswp_s32_binary", "cob_cmpswp_s40_binary", "cob_cmpswp_s48_binary", "cob_cmpswp_s56_binary", "cob_cmpswp_s64_binary" }; static const char *const bin_add_funcs[] = { "cob_add_u8_binary", "cob_add_u16_binary", "cob_add_u24_binary", "cob_add_u32_binary", "cob_add_u40_binary", "cob_add_u48_binary", "cob_add_u56_binary", "cob_add_u64_binary", "cob_add_s8_binary", "cob_add_s16_binary", "cob_add_s24_binary", "cob_add_s32_binary", "cob_add_s40_binary", "cob_add_s48_binary", "cob_add_s56_binary", "cob_add_s64_binary", "cob_add_u8_binary", "cob_addswp_u16_binary", "cob_addswp_u24_binary", "cob_addswp_u32_binary", "cob_addswp_u40_binary", "cob_addswp_u48_binary", "cob_addswp_u56_binary", "cob_addswp_u64_binary", "cob_add_s8_binary", "cob_addswp_s16_binary", "cob_addswp_s24_binary", "cob_addswp_s32_binary", "cob_addswp_s40_binary", "cob_addswp_s48_binary", "cob_addswp_s56_binary", "cob_addswp_s64_binary" }; static const char *const bin_sub_funcs[] = { "cob_sub_u8_binary", "cob_sub_u16_binary", "cob_sub_u24_binary", "cob_sub_u32_binary", "cob_sub_u40_binary", "cob_sub_u48_binary", "cob_sub_u56_binary", "cob_sub_u64_binary", "cob_sub_s8_binary", "cob_sub_s16_binary", "cob_sub_s24_binary", "cob_sub_s32_binary", "cob_sub_s40_binary", "cob_sub_s48_binary", "cob_sub_s56_binary", "cob_sub_s64_binary", "cob_sub_u8_binary", "cob_subswp_u16_binary", "cob_subswp_u24_binary", "cob_subswp_u32_binary", "cob_subswp_u40_binary", "cob_subswp_u48_binary", "cob_subswp_u56_binary", "cob_subswp_u64_binary", "cob_sub_s8_binary", "cob_subswp_s16_binary", "cob_subswp_s24_binary", "cob_subswp_s32_binary", "cob_subswp_s40_binary", "cob_subswp_s48_binary", "cob_subswp_s56_binary", "cob_subswp_s64_binary" }; static const char *const align_bin_compare_funcs[] = { "cob_cmp_u8_binary", "cob_cmp_align_u16_binary", "cob_cmp_u24_binary", "cob_cmp_align_u32_binary", "cob_cmp_u40_binary", "cob_cmp_u48_binary", "cob_cmp_u56_binary", "cob_cmp_align_u64_binary", "cob_cmp_s8_binary", "cob_cmp_align_s16_binary", "cob_cmp_s24_binary", "cob_cmp_align_s32_binary", "cob_cmp_s40_binary", "cob_cmp_s48_binary", "cob_cmp_s56_binary", "cob_cmp_align_s64_binary", "cob_cmp_u8_binary", "cob_cmpswp_align_u16_binary", "cob_cmpswp_u24_binary", "cob_cmpswp_align_u32_binary", "cob_cmpswp_u40_binary", "cob_cmpswp_u48_binary", "cob_cmpswp_u56_binary", "cob_cmpswp_align_u64_binary", "cob_cmp_s8_binary", "cob_cmpswp_align_s16_binary", "cob_cmpswp_s24_binary", "cob_cmpswp_align_s32_binary", "cob_cmpswp_s40_binary", "cob_cmpswp_s48_binary", "cob_cmpswp_s56_binary", "cob_cmpswp_align_s64_binary" }; static const char *const align_bin_add_funcs[] = { "cob_add_u8_binary", "cob_add_align_u16_binary", "cob_add_u24_binary", "cob_add_align_u32_binary", "cob_add_u40_binary", "cob_add_u48_binary", "cob_add_u56_binary", "cob_add_align_u64_binary", "cob_add_s8_binary", "cob_add_align_s16_binary", "cob_add_s24_binary", "cob_add_align_s32_binary", "cob_add_s40_binary", "cob_add_s48_binary", "cob_add_s56_binary", "cob_add_align_s64_binary", "cob_add_u8_binary", "cob_addswp_u16_binary", "cob_addswp_u24_binary", "cob_addswp_u32_binary", "cob_addswp_u40_binary", "cob_addswp_u48_binary", "cob_addswp_u56_binary", "cob_addswp_u64_binary", "cob_add_s8_binary", "cob_addswp_s16_binary", "cob_addswp_s24_binary", "cob_addswp_s32_binary", "cob_addswp_s40_binary", "cob_addswp_s48_binary", "cob_addswp_s56_binary", "cob_addswp_s64_binary" }; static const char *const align_bin_sub_funcs[] = { "cob_sub_u8_binary", "cob_sub_align_u16_binary", "cob_sub_u24_binary", "cob_sub_align_u32_binary", "cob_sub_u40_binary", "cob_sub_u48_binary", "cob_sub_u56_binary", "cob_sub_align_u64_binary", "cob_sub_s8_binary", "cob_sub_align_s16_binary", "cob_sub_s24_binary", "cob_sub_align_s32_binary", "cob_sub_s40_binary", "cob_sub_s48_binary", "cob_sub_s56_binary", "cob_sub_align_s64_binary", "cob_sub_u8_binary", "cob_subswp_u16_binary", "cob_subswp_u24_binary", "cob_subswp_u32_binary", "cob_subswp_u40_binary", "cob_subswp_u48_binary", "cob_subswp_u56_binary", "cob_subswp_u64_binary", "cob_sub_s8_binary", "cob_subswp_s16_binary", "cob_subswp_s24_binary", "cob_subswp_s32_binary", "cob_subswp_s40_binary", "cob_subswp_s48_binary", "cob_subswp_s56_binary", "cob_subswp_s64_binary" }; /* functions */ static size_t cb_validate_one (cb_tree x) { cb_tree y; if (x == cb_error_node) { return 1; } if (!x) { return 0; } if (CB_REFERENCE_P (x)) { y = cb_ref (x); if (y == cb_error_node) { return 1; } if (CB_FIELD_P (y) && CB_FIELD (y)->level == 88) { cb_error_x (x, _("Invalid use of 88 level item")); return 1; } } return 0; } static size_t cb_validate_list (cb_tree l) { for (; l; l = CB_CHAIN (l)) { if (cb_validate_one (CB_VALUE (l))) { return 1; } } return 0; } static cb_tree cb_check_group_name (cb_tree x) { cb_tree y; if (x == cb_error_node) { return cb_error_node; } if (CB_REFERENCE_P (x)) { y = cb_ref (x); if (y == cb_error_node) { return cb_error_node; } if (CB_FIELD_P (y) && CB_FIELD (y)->children != NULL && CB_REFERENCE (x)->offset == NULL) { return x; } } cb_error_x (x, _("'%s' is not group name"), cb_name (x)); return cb_error_node; } static cb_tree cb_check_numeric_name (cb_tree x) { if (x == cb_error_node) { return cb_error_node; } if (CB_REFERENCE_P (x) && CB_FIELD_P (cb_ref (x)) && CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC) { return x; } cb_error_x (x, _("'%s' is not a numeric name"), cb_name (x)); return cb_error_node; } static cb_tree cb_check_numeric_edited_name (cb_tree x) { if (x == cb_error_node) { return cb_error_node; } if (CB_REFERENCE_P (x) && CB_FIELD_P (cb_ref (x)) && (CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC || CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC_EDITED)) { return x; } cb_error_x (x, _("'%s' is not numeric or numeric-edited name"), cb_name (x)); return cb_error_node; } cb_tree cb_check_numeric_value (cb_tree x) { if (x == cb_error_node) { return cb_error_node; } if (CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC) { return x; } cb_error_x (x, _("'%s' is not a numeric value"), cb_name (x)); return cb_error_node; } static cb_tree cb_check_integer_value (cb_tree x) { struct cb_literal *l; struct cb_field *f; cb_tree y; if (x == cb_error_node) { return cb_error_node; } if (CB_TREE_CATEGORY (x) != CB_CATEGORY_NUMERIC) { goto invalid; } switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: if (x != cb_zero) { goto invalid; } return x; case CB_TAG_LITERAL: l = CB_LITERAL (x); if (l->sign < 0 || l->scale > 0) { goto invliteral; } return x; case CB_TAG_REFERENCE: y = cb_ref (x); if (y == cb_error_node) { return cb_error_node; } f = CB_FIELD (y); if (f->pic->scale > 0) { goto invalid; } return x; case CB_TAG_BINARY_OP: /* TODO: need to check */ return x; case CB_TAG_INTRINSIC: /* TODO: need to check */ return x; default: invalid: cb_error_x (x, _("'%s' is not an integer value"), cb_name (x)); return cb_error_node; } invliteral: cb_error_x (x, _("A positive numeric integer is required here")); return cb_error_node; } void cb_build_registers (void) { #if !defined(__linux__) && !defined(__CYGWIN__) && defined(HAVE_TIMEZONE) long contz; #endif time_t t; char buff[48]; /* RETURN-CODE */ if (!current_program->nested_level) { current_program->cb_return_code = cb_build_index (cb_build_reference ("RETURN-CODE"), cb_zero, 0, NULL); cb_field (current_program->cb_return_code)->flag_is_global = 1; } /* SORT-RETURN */ current_program->cb_sort_return = cb_build_index (cb_build_reference ("SORT-RETURN"), cb_zero, 0, NULL); cb_field (current_program->cb_sort_return)->flag_no_init = 1; /* NUMBER-OF-CALL-PARAMETERS */ current_program->cb_call_params = cb_build_index (cb_build_reference ("NUMBER-OF-CALL-PARAMETERS"), cb_zero, 0, NULL); cb_field (current_program->cb_call_params)->flag_no_init = 1; /* TALLY */ /* 01 TALLY GLOBAL PICTURE 9(9) USAGE COMP-5 VALUE ZERO. */ /* TALLY/EXAMINE not standard/supported */ t = time (NULL); /* WHEN-COMPILED */ memset (buff, 0, sizeof (buff)); strftime (buff, 17, "%m/%d/%y%H.%M.%S", localtime (&t)); cb_build_constant (cb_build_reference ("WHEN-COMPILED"), cb_build_alphanumeric_literal ((ucharptr)buff, 16)); /* FUNCTION WHEN-COMPILED */ memset (buff, 0, sizeof (buff)); #if defined(__linux__) || defined(__CYGWIN__) strftime (buff, 22, "%Y%m%d%H%M%S00%z", localtime (&t)); #elif defined(HAVE_TIMEZONE) strftime (buff, 17, "%Y%m%d%H%M%S00", localtime (&t)); if (timezone <= 0) { contz = -timezone; buff[16] = '+'; } else { contz = timezone; buff[16] = '-'; } sprintf (&buff[17], "%2.2ld%2.2ld", contz / 3600, contz % 60); #else strftime (buff, 22, "%Y%m%d%H%M%S0000000", localtime (&t)); #endif cb_intr_whencomp = cb_build_alphanumeric_literal ((ucharptr)buff, 21); /* FUNCTION PI */ memset (buff, 0, sizeof (buff)); strcpy (buff, "31415926535897932384626433832795029"); cb_intr_pi = cb_build_numeric_literal (0, (ucharptr)buff, 34); /* FUNCTION E */ memset (buff, 0, sizeof (buff)); strcpy (buff, "27182818284590452353602874713526625"); cb_intr_e = cb_build_numeric_literal (0, (ucharptr)buff, 34); } char * cb_encode_program_id (const char *name) { unsigned char *p; const unsigned char *s; unsigned char buff[COB_SMALL_BUFF]; p = buff; s = (const unsigned char *)name; /* encode the initial digit */ if (isdigit (*s)) { p += sprintf ((char *)p, "_%02X", *s++); } /* encode invalid letters */ for (; *s; s++) { if (isalnum (*s) || *s == '_') { *p++ = *s; } else if (*s == '-') { *p++ = '_'; *p++ = '_'; } else { p += sprintf ((char *)p, "_%02X", *s); } } *p = 0; return strdup ((char *)buff); } const char * cb_build_program_id (cb_tree name, cb_tree alt_name) { const char *s; /* This needs some more thought, should we generate an entry point per program source name ? if (alt_name) { s = (char *)CB_LITERAL (alt_name)->data; } else if (CB_LITERAL_P (name)) { s = (char *)CB_LITERAL (name)->data; } else { s = (char *)CB_NAME (name); } if (!cb_flag_main && strcmp (s, source_name)) { cb_warning (_("Source name '%s' differs from PROGRAM-ID '%s'"), source_name, s); current_program->source_name = strdup (source_name); } End comment out */ if (alt_name) { current_program->orig_source_name = strdup ((char *)CB_LITERAL (alt_name)->data); s = (char *)CB_LITERAL (alt_name)->data; } else if (CB_LITERAL_P (name)) { current_program->orig_source_name = strdup ((char *)CB_LITERAL (name)->data); s = cb_encode_program_id ((char *)CB_LITERAL (name)->data); } else { current_program->orig_source_name = strdup (CB_NAME (name)); s = cb_encode_program_id (CB_NAME (name)); } if (cobc_check_valid_name (current_program->orig_source_name)) { cb_error (_("PROGRAM-ID '%s' invalid"), current_program->orig_source_name); } return s; } void cb_define_switch_name (cb_tree name, cb_tree sname, cb_tree flag, cb_tree ref) { cb_tree switch_id; cb_tree value; if (name == cb_error_node) { return; } if (sname == cb_error_node) { return; } if (CB_SYSTEM_NAME (sname)->category != CB_SWITCH_NAME) { cb_error_x (ref, _("Switch-name is expected '%s'"), CB_NAME (ref)); } else { switch_id = cb_int (CB_SYSTEM_NAME (sname)->token); value = cb_build_funcall_1 ("cob_get_switch", switch_id); if (flag == cb_int0) { value = cb_build_negation (value); } cb_build_constant (name, value); } } cb_tree cb_build_section_name (cb_tree name, int sect_or_para) { cb_tree x; if (name == cb_error_node) { return cb_error_node; } if (CB_REFERENCE (name)->word->count > 0) { x = CB_VALUE (CB_REFERENCE (name)->word->items); /* Used as a non-label name or used as a section name. Duplicate paragraphs are allowed if not referenced; Checked in typeck.c */ if (!CB_LABEL_P (x) || sect_or_para == 0 || (sect_or_para && CB_LABEL_P (x) && CB_LABEL (x)->is_section)) { redefinition_error (name); return cb_error_node; } } return name; } cb_tree cb_build_assignment_name (struct cb_file *cfile, cb_tree name) { const char *s; const char *p; if (name == cb_error_node) { return cb_error_node; } switch (CB_TREE_TAG (name)) { case CB_TAG_LITERAL: if (strcmp ((char *)(CB_LITERAL(name)->data), "$#@DUMMY@#$") == 0) { cfile->special = 2; } return name; case CB_TAG_REFERENCE: s = CB_REFERENCE (name)->word->name; if (strcasecmp (s, "KEYBOARD") == 0) { s = "#DUMMY#"; cfile->special = 1; return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s)); } switch (cb_assign_clause) { case CB_ASSIGN_COBOL2002: /* TODO */ return cb_error_node; case CB_ASSIGN_MF: if (cfile->external_assign) { p = strrchr (s, '-'); if (p) { s = p + 1; } return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s)); } current_program->reference_list = cb_list_add (current_program->reference_list, name); return name; case CB_ASSIGN_IBM: /* check organization */ if (strncmp (s, "S-", 2) == 0 || strncmp (s, "AS-", 3) == 0) { goto org; } /* skip the device label if exists */ if ((p = strchr (s, '-')) != NULL) { s = p + 1; } /* check organization again */ if (strncmp (s, "S-", 2) == 0 || strncmp (s, "AS-", 3) == 0) { org: /* skip it for now */ s = strchr (s, '-') + 1; } /* convert the name into literal */ return cb_build_alphanumeric_literal ((ucharptr)s, strlen (s)); } default: return cb_error_node; } } cb_tree cb_build_index (cb_tree x, cb_tree values, int indexed_by, struct cb_field *qual) { struct cb_field *f; f = CB_FIELD (cb_build_field (x)); f->usage = CB_USAGE_INDEX; cb_validate_field (f); if (values) { f->values = cb_list_init (values); } if (qual) { f->index_qual = qual; } f->flag_indexed_by = indexed_by; current_program->working_storage = cb_field_add (current_program->working_storage, f); return x; } cb_tree cb_build_identifier (cb_tree x) { struct cb_reference *r; struct cb_field *f; struct cb_field *p; const char *name; cb_tree v; cb_tree e1; cb_tree e2; cb_tree l; cb_tree sub; int offset; int length; int n; if (x == cb_error_node) { return cb_error_node; } r = CB_REFERENCE (x); name = r->word->name; /* resolve reference */ v = cb_ref (x); if (v == cb_error_node) { return cb_error_node; } /* check if it is a data name */ if (!CB_FIELD_P (v)) { if (r->subs) { cb_error_x (x, _("'%s' cannot be subscripted"), name); return cb_error_node; } if (r->offset) { cb_error_x (x, _("'%s' cannot be reference modified"), name); return cb_error_node; } return x; } f = CB_FIELD (v); /* BASED check */ if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_PTR)) { for (p = f; p->parent; p = p->parent) { ; } if (current_statement) { if (p->flag_item_based || (f->storage == CB_STORAGE_LINKAGE && !p->flag_is_pdiv_parm)) { current_statement->null_check = cb_build_funcall_2 ( "cob_check_based", cb_build_address (cb_build_field_reference (p, NULL)), cb_build_string0 ((ucharptr)name)); } } } /* check the number of subscripts */ if (!r->all && cb_list_length (r->subs) != f->indexes) { switch (f->indexes) { case 0: cb_error_x (x, _("'%s' cannot be subscripted"), name); return cb_error_node; case 1: cb_error_x (x, _("'%s' requires 1 subscript"), name); return cb_error_node; default: cb_error_x (x, _("'%s' requires %d subscripts"), name, f->indexes); return cb_error_node; } } /* subscript check */ if (!r->all && r->subs) { l = r->subs; for (p = f; p; p = p->parent) { if (p->flag_occurs) { sub = cb_check_integer_value (CB_VALUE (l)); l = CB_CHAIN (l); if (sub == cb_error_node) { continue; } /* compile-time check */ if (CB_LITERAL_P (sub)) { n = cb_get_int (sub); if (n < 1 || n > p->occurs_max) { cb_error_x (x, _("Subscript of '%s' out of bounds: %d"), name, n); } } /* run-time check */ if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_SUBSCRIPT)) { if (p->occurs_depending) { e1 = cb_build_funcall_4 ("cob_check_odo", cb_build_cast_integer (p->occurs_depending), cb_int (p->occurs_min), cb_int (p->occurs_max), cb_build_string0 ((ucharptr)(cb_field (p->occurs_depending)->name))); e2 = cb_build_funcall_4 ("cob_check_subscript", cb_build_cast_integer (sub), cb_int1, cb_build_cast_integer (p->occurs_depending), cb_build_string0 ((ucharptr)name)); r->check = cb_list_add (r->check, e1); r->check = cb_list_add (r->check, e2); } else { if (!CB_LITERAL_P (sub)) { e1 = cb_build_funcall_4 ("cob_check_subscript", cb_build_cast_integer (sub), cb_int1, cb_int (p->occurs_max), cb_build_string0 ((ucharptr)name)); r->check = cb_list_add (r->check, e1); } } } } } } /* reference modification check */ if (r->offset) { /* compile-time check */ if (CB_LITERAL_P (r->offset)) { offset = cb_get_int (r->offset); if (offset < 1 || offset > f->size) { cb_error_x (x, _("Offset of '%s' out of bounds: %d"), name, offset); } else if (r->length && CB_LITERAL_P (r->length)) { length = cb_get_int (r->length); if (length < 1 || length > f->size - offset + 1) { cb_error_x (x, _("Length of '%s' out of bounds: %d"), name, length); } } } /* run-time check */ if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_REF_MOD)) { if (!CB_LITERAL_P (r->offset) || (r->length && !CB_LITERAL_P (r->length))) { e1 = cb_build_funcall_4 ("cob_check_ref_mod", cb_build_cast_integer (r->offset), r->length ? cb_build_cast_integer (r->length) : cb_int1, cb_int (f->size), cb_build_string0 ((ucharptr)f->name)); r->check = cb_list_add (r->check, e1); } } } if (f->storage == CB_STORAGE_CONSTANT) { return CB_VALUE (f->values); } return x; } static cb_tree cb_build_length_1 (cb_tree x) { struct cb_field *f; cb_tree e; cb_tree size; f = CB_FIELD (cb_ref (x)); if (cb_field_variable_size (f) == NULL) { /* constant size */ return cb_int (cb_field_size (x)); } else { /* variable size */ e = NULL; for (f = f->children; f; f = f->sister) { size = cb_build_length_1 (cb_build_field_reference (f, x)); if (f->occurs_depending) { size = cb_build_binary_op (size, '*', f->occurs_depending); } else if (f->occurs_max > 1) { size = cb_build_binary_op (size, '*', cb_int (f->occurs_max)); } e = e ? cb_build_binary_op (e, '+', size) : size; } return e; } } cb_tree cb_build_const_length (cb_tree x) { struct cb_field *f; char buff[64]; if (x == cb_error_node) { return cb_error_node; } if (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node) { return cb_error_node; } memset (buff, 0, sizeof (buff)); f = CB_FIELD (cb_ref (x)); if (f->flag_any_length) { cb_error (_("ANY LENGTH item not allowed here")); return cb_error_node; } if (f->level == 88) { cb_error (_("88 level item not allowed here")); return cb_error_node; } if (!f->flag_is_verified) { cb_validate_field (f); } sprintf (buff, "%d", f->memory_size); return cb_build_numeric_literal (0, (ucharptr)buff, 0); } cb_tree cb_build_length (cb_tree x) { struct cb_field *f; struct cb_literal *l; cb_tree temp; char buff[64]; if (x == cb_error_node) { return cb_error_node; } if (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node) { return cb_error_node; } memset (buff, 0, sizeof (buff)); if (CB_LITERAL_P (x)) { l = CB_LITERAL (x); sprintf (buff, "%d", (int)l->size); return cb_build_numeric_literal (0, (ucharptr)buff, 0); } if (CB_REF_OR_FIELD_P (x)) { f = CB_FIELD (cb_ref (x)); if (f->flag_any_length) { return cb_build_any_intrinsic (cb_list_init (x)); } if (cb_field_variable_size (f) == NULL) { sprintf (buff, "%d", cb_field_size (x)); return cb_build_numeric_literal (0, (ucharptr)buff, 0); } } if (CB_INTRINSIC_P (x)) { return cb_build_any_intrinsic (cb_list_init (x)); } temp = cb_build_index (cb_build_filler (), NULL, 0, NULL); CB_FIELD (cb_ref (temp))->usage = CB_USAGE_LENGTH; CB_FIELD (cb_ref (temp))->count++; cb_emit (cb_build_assign (temp, cb_build_length_1 (x))); return temp; } cb_tree cb_build_address (cb_tree x) { if (x == cb_error_node || (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node)) { return cb_error_node; } return cb_build_cast_address (x); } cb_tree cb_build_ppointer (cb_tree x) { struct cb_field *f; if (x == cb_error_node || (CB_REFERENCE_P (x) && cb_ref (x) == cb_error_node)) { return cb_error_node; } if (CB_REFERENCE_P (x)) { f = cb_field (cb_ref(x)); f->count++; } return cb_build_cast_ppointer (x); } /* validate program */ static int get_value (cb_tree x) { if (x == cb_space) { return ' '; } else if (x == cb_zero) { return '0'; } else if (x == cb_quote) { return '"'; } else if (x == cb_norm_low) { return 0; } else if (x == cb_norm_high) { return 255; } else if (x == cb_null) { return 0; } else if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { return cb_get_int (x) - 1; } else { return CB_LITERAL (x)->data[0]; } } void cb_validate_program_environment (struct cb_program *prog) { cb_tree x; cb_tree y; cb_tree l; cb_tree ls; struct cb_alphabet_name *ap; unsigned char *data; size_t dupls; size_t unvals; size_t count; int lower; int upper; int size; int n; int i; int lastval; int values[256]; /* Check ALPHABET clauses */ for (l = current_program->alphabet_name_list; l; l = CB_CHAIN (l)) { ap = CB_ALPHABET_NAME (CB_VALUE (l)); if (ap->type != CB_ALPHABET_CUSTOM) { continue; } ap->low_val_char = 0; ap->high_val_char = 255; dupls = 0; unvals = 0; count = 0; lastval = 0; for (n = 0; n < 256; n++) { values[n] = -1; } for (y = ap->custom_list; y; y = CB_CHAIN (y)) { if (count > 255) { unvals = 1; break; } x = CB_VALUE (y); if (CB_PAIR_P (x)) { /* X THRU Y */ lower = get_value (CB_PAIR_X (x)); upper = get_value (CB_PAIR_Y (x)); lastval = upper; if (!count) { ap->low_val_char = lower; } if (lower < 0 || lower > 255) { unvals = 1; continue; } if (upper < 0 || upper > 255) { unvals = 1; continue; } if (lower <= upper) { for (i = lower; i <= upper; i++) { if (values[i] != -1) { dupls = 1; } values[i] = i; count++; } } else { for (i = lower; i >= upper; i--) { if (values[i] != -1) { dupls = 1; } values[i] = i; count++; } } } else if (CB_LIST_P (x)) { /* X ALSO Y ... */ if (!count) { ap->low_val_char = get_value (CB_VALUE (x)); } for (ls = x; ls; ls = CB_CHAIN (ls)) { n = get_value (CB_VALUE (ls)); if (!CB_CHAIN (ls)) { lastval = n; } if (n < 0 || n > 255) { unvals = 1; continue; } if (values[n] != -1) { dupls = 1; } values[n] = n; count++; } } else { /* literal */ if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { n = get_value (x); lastval = n; if (!count) { ap->low_val_char = n; } if (n < 0 || n > 255) { unvals = 1; continue; } if (values[n] != -1) { dupls = 1; } values[n] = n; count++; } else if (CB_LITERAL_P (x)) { size = (int)CB_LITERAL (x)->size; data = CB_LITERAL (x)->data; if (!count) { ap->low_val_char = data[0]; } lastval = data[size - 1]; for (i = 0; i < size; i++) { n = data[i]; if (values[n] != -1) { dupls = 1; } values[n] = n; count++; } } else { n = get_value (x); lastval = n; if (!count) { ap->low_val_char = n; } if (n < 0 || n > 255) { unvals = 1; continue; } if (values[n] != -1) { dupls = 1; } values[n] = n; count++; } } } if (dupls || unvals) { if (dupls) { cb_error_x (l, _("Duplicate character values in alphabet '%s'"), cb_name (CB_VALUE(l))); } if (unvals) { cb_error_x (l, _("Invalid character values in alphabet '%s'"), cb_name (CB_VALUE(l))); } ap->low_val_char = 0; ap->high_val_char = 255; continue; } /* Calculate HIGH-VALUE */ /* If all 256 values have been specified, HIGH-VALUE is the last one */ /* Otherwise if HIGH-VALUE has been specified, find the highest */ /* value that has not been used */ if (count == 256) { ap->high_val_char = lastval; } else if (values[255] != -1) { for (n = 254; n >= 0; n--) { if (values[n] == -1) { ap->high_val_char = n; break; } } } } /* Rest HIGH/LOW-VALUES */ cb_low = cb_norm_low; cb_high = cb_norm_high; /* resolve the program collating sequence */ if (!prog->collating_sequence) { return; } x = cb_ref (prog->collating_sequence); /* RXWRXW if (x == cb_error_node) { prog->collating_sequence = NULL; return; } */ if (!CB_ALPHABET_NAME_P (x)) { cb_error_x (prog->collating_sequence, _("'%s' not alphabet name"), cb_name (prog->collating_sequence)); prog->collating_sequence = NULL; return; } if (CB_ALPHABET_NAME (x)->type != CB_ALPHABET_CUSTOM) { return; } if (CB_ALPHABET_NAME (x)->low_val_char) { cb_low = cb_build_alphanumeric_literal ((ucharptr)"\0", 1); CB_LITERAL(cb_low)->data[0] = CB_ALPHABET_NAME (x)->low_val_char; CB_LITERAL(cb_low)->all = 1; } if (CB_ALPHABET_NAME (x)->high_val_char != 255){ cb_high = cb_build_alphanumeric_literal ((ucharptr)"\0", 1); CB_LITERAL(cb_high)->data[0] = CB_ALPHABET_NAME (x)->high_val_char; CB_LITERAL(cb_high)->all = 1; } } void cb_validate_program_data (struct cb_program *prog) { cb_tree l; cb_tree x; cb_tree assign; struct cb_field *p; struct cb_file *f; unsigned char *c; for (l = current_program->file_list; l; l = CB_CHAIN (l)) { f = CB_FILE (CB_VALUE (l)); if (!f->finalized) { finalize_file (f, NULL); } } /* build undeclared assignment name now */ if (cb_assign_clause == CB_ASSIGN_MF) { for (l = current_program->file_list; l; l = CB_CHAIN (l)) { assign = CB_FILE (CB_VALUE (l))->assign; if (!assign) { continue; } if (CB_REFERENCE_P (assign)) { for (x = current_program->file_list; x; x = CB_CHAIN (x)) { if (!strcmp (CB_FILE (CB_VALUE (x))->name, CB_REFERENCE (assign)->word->name)) { redefinition_error (assign); } } p = check_level_78 (CB_REFERENCE (assign)->word->name); if (p) { c = (unsigned char *)CB_LITERAL(CB_VALUE(p->values))->data; assign = CB_TREE (build_literal (CB_CATEGORY_ALPHANUMERIC, c, strlen ((char *)c))); CB_FILE (CB_VALUE (l))->assign = assign; } } if (CB_REFERENCE_P (assign) && CB_REFERENCE (assign)->word->count == 0) { if (cb_warn_implicit_define) { cb_warning (_("'%s' will be implicitly defined"), CB_NAME (assign)); } x = cb_build_implicit_field (assign, COB_SMALL_BUFF); p = current_program->working_storage; CB_FIELD (x)->count++; if (p) { while (p->sister) { p = p->sister; } p->sister = CB_FIELD (x); } else { current_program->working_storage = CB_FIELD (x); } } if (CB_REFERENCE_P (assign)) { x = cb_ref (assign); if (CB_FIELD_P (x) && CB_FIELD (x)->level == 88) { cb_error_x (assign, _("ASSIGN data item '%s' invalid"), CB_NAME (assign)); } } } } if (prog->cursor_pos) { x = cb_ref (prog->cursor_pos); if (x == cb_error_node) { prog->cursor_pos = NULL; } else if (CB_FIELD(x)->size != 6 && CB_FIELD(x)->size != 4) { cb_error_x (prog->cursor_pos, _("'%s' CURSOR is not 4 or 6 characters long"), cb_name (prog->cursor_pos)); prog->cursor_pos = NULL; } } if (prog->crt_status) { x = cb_ref (prog->crt_status); if (x == cb_error_node) { prog->crt_status = NULL; } else if (CB_FIELD(x)->size != 4) { cb_error_x (prog->crt_status, _("'%s' CRT STATUS is not 4 characters long"), cb_name (prog->crt_status)); prog->crt_status = NULL; } } else { l = cb_build_reference ("COB-CRT-STATUS"); p = CB_FIELD (cb_build_field (l)); p->usage = CB_USAGE_DISPLAY; p->pic = CB_PICTURE (cb_build_picture ("9(4)")); cb_validate_field (p); p->flag_no_init = 1; /* Do not initialize/bump ref count here p->values = cb_list_init (cb_zero); p->count++; */ current_program->working_storage = cb_field_add (current_program->working_storage, p); prog->crt_status = l; /* RXWRXW - Maybe better prog->crt_status = cb_build_index (cb_build_reference ("COB-CRT-STATUS"), cb_zero, 0, NULL); */ } /* resolve all references so far */ for (l = cb_list_reverse (prog->reference_list); l; l = CB_CHAIN (l)) { cb_ref (CB_VALUE (l)); } for (l = current_program->file_list; l; l = CB_CHAIN (l)) { f = CB_FILE (CB_VALUE (l)); if (f->record_depending && f->record_depending != cb_error_node) { x = f->record_depending; if (cb_ref (x) != cb_error_node) { /* RXW - This breaks old legacy programs if (CB_REF_OR_FIELD_P(x)) { p = cb_field (x); switch (p->storage) { case CB_STORAGE_WORKING: case CB_STORAGE_LOCAL: case CB_STORAGE_LINKAGE: break; default: cb_error (_("RECORD DEPENDING item must be in WORKING/LOCAL/LINKAGE section")); } } else { */ if (!CB_REFERENCE_P(x) && !CB_FIELD_P(x)) { cb_error (_("Invalid RECORD DEPENDING item")); } } } } } void cb_validate_program_body (struct cb_program *prog) { /* resolve all labels */ cb_tree l; cb_tree x; cb_tree v; for (l = cb_list_reverse (prog->label_list); l; l = CB_CHAIN (l)) { x = CB_VALUE (l); v = cb_ref (x); if (CB_LABEL_P (v)) { CB_LABEL (v)->need_begin = 1; if (CB_REFERENCE (x)->length) { CB_LABEL (v)->need_return = 1; } } else if (v != cb_error_node) { cb_error_x (x, _("'%s' not procedure name"), cb_name (x)); } } prog->file_list = cb_list_reverse (prog->file_list); prog->exec_list = cb_list_reverse (prog->exec_list); } /* * Expressions */ static void cb_expr_init (void) { static int initialized = 0; if (initialized == 0) { /* init priority talble */ expr_prio['x'] = 0; expr_prio['^'] = 1; expr_prio['*'] = 2; expr_prio['/'] = 2; expr_prio['+'] = 3; expr_prio['-'] = 3; expr_prio['='] = 4; expr_prio['~'] = 4; expr_prio['<'] = 4; expr_prio['>'] = 4; expr_prio['['] = 4; expr_prio[']'] = 4; expr_prio['!'] = 5; expr_prio['&'] = 6; expr_prio['|'] = 7; expr_prio[')'] = 8; expr_prio['('] = 9; expr_prio[0] = 10; /* init stack */ expr_stack_size = START_STACK_SIZE; expr_stack = cobc_malloc (sizeof (struct expr_node) * START_STACK_SIZE); expr_stack[0].token = 0; /* dummy */ expr_stack[1].token = 0; /* dummy */ expr_stack[2].token = 0; /* dummy */ initialized = 1; } expr_op = 0; expr_lh = NULL; expr_index = 3; } static int expr_reduce (int token) { /* Example: * index: -3 -2 -1 0 * token: 'x' '*' 'x' '+' ... */ int op; while (expr_prio[TOKEN (-2)] <= expr_prio[token]) { /* Reduce the expression depending on the last operator */ op = TOKEN (-2); switch (op) { case 'x': return 0; case '+': case '-': case '*': case '/': case '^': /* Arithmetic operators: 'x' op 'x' */ if (TOKEN (-1) != 'x' || TOKEN (-3) != 'x') { return -1; } TOKEN (-3) = 'x'; VALUE (-3) = cb_build_binary_op (VALUE (-3), op, VALUE (-1)); expr_index -= 2; break; case '!': /* Negation: '!' 'x' */ if (TOKEN (-1) != 'x') { return -1; } /* 'x' '=' 'x' '|' '!' 'x' */ if (expr_lh) { if (CB_TREE_CLASS (VALUE (-1)) != CB_CLASS_BOOLEAN) { VALUE (-1) = cb_build_binary_op (expr_lh, expr_op, VALUE (-1)); } } TOKEN (-2) = 'x'; VALUE (-2) = cb_build_negation (VALUE (-1)); expr_index -= 1; break; case '&': case '|': /* Logical AND/OR: 'x' op 'x' */ if (TOKEN (-1) != 'x' || TOKEN (-3) != 'x') { return -1; } /* 'x' '=' 'x' '|' 'x' */ if (expr_lh) { if (CB_TREE_CLASS (VALUE (-1)) != CB_CLASS_BOOLEAN) { VALUE (-1) = cb_build_binary_op (expr_lh, expr_op, VALUE (-1)); } if (CB_TREE_CLASS (VALUE (-3)) != CB_CLASS_BOOLEAN) { VALUE (-3) = cb_build_binary_op (expr_lh, expr_op, VALUE (-3)); } } /* warning for complex expressions without explicit parentheses (i.e., "a OR b AND c" or "a AND b OR c") */ if (cb_warn_parentheses && op == '|') { if ((CB_BINARY_OP_P (VALUE (-3)) && CB_BINARY_OP (VALUE (-3))->op == '&') || (CB_BINARY_OP_P (VALUE (-1)) && CB_BINARY_OP (VALUE (-1))->op == '&')) { cb_warning (_("Suggest parentheses around AND within OR")); } } TOKEN (-3) = 'x'; VALUE (-3) = cb_build_binary_op (VALUE (-3), op, VALUE (-1)); expr_index -= 2; break; case '(': case ')': return 0; default: /* Relational operators */ if (TOKEN (-1) != 'x') { return -1; } switch (TOKEN (-3)) { case 'x': /* Simple condition: 'x' op 'x' */ if (VALUE (-3) == cb_error_node || VALUE (-1) == cb_error_node) { VALUE (-3) = cb_error_node; } else { expr_lh = VALUE (-3); if (CB_REF_OR_FIELD_P (expr_lh)) { if (cb_field (expr_lh)->level == 88) { VALUE (-3) = cb_error_node; return -1; } } if (CB_REF_OR_FIELD_P (VALUE(-1))) { if (cb_field (VALUE(-1))->level == 88) { VALUE (-3) = cb_error_node; return -1; } } expr_op = op; TOKEN (-3) = 'x'; if (CB_TREE_CLASS (VALUE (-1)) != CB_CLASS_BOOLEAN) { VALUE (-3) = cb_build_binary_op (expr_lh, op, VALUE (-1)); } else { VALUE (-3) = VALUE (-1); } } expr_index -= 2; break; case '&': case '|': /* Complex condition: 'x' '=' 'x' '|' op 'x' */ if (VALUE (-1) == cb_error_node) { VALUE (-2) = cb_error_node; } else { expr_op = op; TOKEN (-2) = 'x'; if (CB_TREE_CLASS (VALUE (-1)) != CB_CLASS_BOOLEAN) { VALUE (-2) = cb_build_binary_op (expr_lh, op, VALUE (-1)); } else { VALUE (-2) = VALUE (-1); } } expr_index -= 1; break; default: return -1; } break; } } /* handle special case "op OR x AND" */ if (token == '&' && TOKEN (-2) == '|' && CB_TREE_CLASS (VALUE (-1)) != CB_CLASS_BOOLEAN) { TOKEN (-1) = 'x'; VALUE (-1) = cb_build_binary_op (expr_lh, expr_op, VALUE (-1)); } return 0; } static void cb_expr_shift_sign (const int op) { int have_not = 0; if (TOKEN (-1) == '!') { have_not = 1; expr_index--; } expr_reduce ('='); if (TOKEN (-1) == 'x') { VALUE (-1) = cb_build_binary_op (VALUE (-1), op, cb_zero); if (have_not) { VALUE (-1) = cb_build_negation (VALUE (-1)); } } } static void cb_expr_shift_class (const char *name) { int have_not = 0; if (TOKEN (-1) == '!') { have_not = 1; expr_index--; } expr_reduce ('='); if (TOKEN (-1) == 'x') { VALUE (-1) = cb_build_funcall_1 (name, VALUE (-1)); if (have_not) { VALUE (-1) = cb_build_negation (VALUE (-1)); } } } static void cb_expr_shift (int token, cb_tree value) { switch (token) { case 'x': /* sign ZERO condition */ if (value == cb_zero) { if (TOKEN (-1) == 'x' || TOKEN (-1) == '!') { cb_expr_shift_sign ('='); return; } } /* class condition */ if (CB_REFERENCE_P (value) && CB_CLASS_NAME_P (cb_ref (value))) { cb_expr_shift_class (CB_CLASS_NAME (cb_ref (value))->cname); return; } /* unary sign */ if ((TOKEN (-1) == '+' || TOKEN (-1) == '-') && TOKEN (-2) != 'x') { if (TOKEN (-1) == '-') { value = cb_build_binary_op (cb_zero, '-', value); } expr_index -= 1; } break; case '(': /* 'x' op '(' --> '(' 'x' op */ switch (TOKEN (-1)) { case '=': case '~': case '<': case '>': case '[': case ']': expr_op = TOKEN (-1); if (TOKEN (-2) == 'x') { expr_lh = VALUE (-2); } } break; case ')': /* enclose by parentheses */ expr_reduce (token); if (TOKEN (-2) == '(') { value = cb_build_parenthesis (VALUE (-1)); expr_index -= 2; cb_expr_shift ('x', value); return; } break; default: /* '<' '|' '=' --> '[' */ /* '>' '|' '=' --> ']' */ if (token == '=' && TOKEN (-1) == '|' && (TOKEN (-2) == '<' || TOKEN (-2) == '>')) { token = (TOKEN (-2) == '<') ? '[' : ']'; expr_index -= 2; } /* '!' '=' --> '~', etc. */ if (TOKEN (-1) == '!') { switch (token) { case '=': token = '~'; expr_index--; break; case '~': token = '='; expr_index--; break; case '<': token = ']'; expr_index--; break; case '>': token = '['; expr_index--; break; case '[': token = '>'; expr_index--; break; case ']': token = '<'; expr_index--; break; } } break; } /* reduce */ expr_reduce (token); /* allocate sufficient stack memory */ if (expr_index >= expr_stack_size) { expr_stack_size *= 2; expr_stack = cobc_realloc (expr_stack, sizeof (struct expr_node) * expr_stack_size); } /* put on the stack */ TOKEN (0) = token; VALUE (0) = value; expr_index++; } static void expr_expand (cb_tree *x) { struct cb_binary_op *p; start: /* remove parenthesis */ if (CB_BINARY_OP_P (*x)) { p = CB_BINARY_OP (*x); if (p->op == '@') { *x = p->x; goto start; } expr_expand (&p->x); if (p->y) { expr_expand (&p->y); } } } static cb_tree cb_expr_finish (void) { expr_reduce (0); /* reduce all */ if (expr_index != 4) { cb_error (_("Invalid expression")); return cb_error_node; } if (!expr_stack[3].value) { cb_error (_("Invalid expression")); return cb_error_node; } expr_expand (&expr_stack[3].value); if (expr_stack[3].token != 'x') { cb_error (_("Invalid expression")); return cb_error_node; } return expr_stack[3].value; } cb_tree cb_build_expr (cb_tree list) { cb_tree l; /* RXW cb_tree x; */ int op; cb_expr_init (); for (l = list; l; l = CB_CHAIN (l)) { op = CB_PURPOSE_INT (l); switch (op) { case '9': /* NUMERIC */ cb_expr_shift_class ("cob_is_numeric"); break; case 'A': /* ALPHABETIC */ cb_expr_shift_class ("cob_is_alpha"); break; case 'L': /* ALPHABETIC_LOWER */ cb_expr_shift_class ("cob_is_lower"); break; case 'U': /* ALPHABETIC_UPPER */ cb_expr_shift_class ("cob_is_upper"); break; case 'P': /* POSITIVE */ cb_expr_shift_sign ('>'); break; case 'N': /* NEGATIVE */ cb_expr_shift_sign ('<'); break; case 'O': /* OMITTED */ current_statement->null_check = NULL; cb_expr_shift_class ("cob_is_omitted"); break; /* RXW case 'x': if (CB_VALUE (l) && CB_REFERENCE_P (CB_VALUE (l))) { x = CB_CHAIN (l); if (x && cb_field (CB_VALUE (l))->level == 88) { switch (CB_PURPOSE_INT (x)) { case '&': case '|': case '(': case ')': break; default: cb_error (_("Invalid condition")); break; } } } cb_expr_shift (op, CB_VALUE (l)); break; */ default: cb_expr_shift (op, CB_VALUE (l)); break; } } return cb_expr_finish (); } /* * Numerical operation */ static cb_tree build_store_option (cb_tree x, cb_tree round_opt) { int opt = 0; if (round_opt == cb_int1) { opt |= COB_STORE_ROUND; } switch (CB_FIELD (cb_ref (x))->usage) { case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (current_statement->handler1) { opt |= COB_STORE_KEEP_ON_OVERFLOW; } break; default: if (!cb_binary_truncate) { if (current_statement->handler1) { opt |= COB_STORE_KEEP_ON_OVERFLOW; } break; } /* RXW Fixme - It seems as though we have NEVER implemented TRUNC, Code has always been wrong. Hmm. The following statement would activate what was intended but ... What should we do here? if (current_statement->handler1) { */ if (current_statement->handler_id) { opt |= COB_STORE_KEEP_ON_OVERFLOW; } else if (cb_binary_truncate) { opt |= COB_STORE_TRUNC_ON_OVERFLOW; } break; } return cb_int (opt); } static cb_tree decimal_alloc (void) { cb_tree x; x = cb_build_decimal (current_program->decimal_index); current_program->decimal_index++; if (current_program->decimal_index > current_program->decimal_index_max) { current_program->decimal_index_max = current_program->decimal_index; } return x; } static void decimal_free (void) { current_program->decimal_index--; } static void decimal_compute (const int op, cb_tree x, cb_tree y) { const char *func; switch (op) { case '+': func = "cob_decimal_add"; break; case '-': func = "cob_decimal_sub"; break; case '*': func = "cob_decimal_mul"; break; case '/': func = "cob_decimal_div"; break; case '^': func = "cob_decimal_pow"; break; default: fprintf (stderr, "Unexpected operation %d\n", op); ABORT (); } dpush (cb_build_funcall_2 (func, x, y)); } static void decimal_expand (cb_tree d, cb_tree x) { struct cb_literal *l; struct cb_field *f; struct cb_binary_op *p; cb_tree t; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: if (x == cb_zero) { dpush (cb_build_funcall_2 ("cob_decimal_set_int", d, cb_int0)); current_program->gen_decset = 1; } else { fprintf (stderr, "Unexpected constant expansion\n"); ABORT (); } break; case CB_TAG_LITERAL: /* set d, N */ l = CB_LITERAL (x); if (l->size < 10 && l->scale == 0) { dpush (cb_build_funcall_2 ("cob_decimal_set_int", d, cb_build_cast_integer (x))); current_program->gen_decset = 1; } else { dpush (cb_build_funcall_2 ("cob_decimal_set_field", d, x)); } break; case CB_TAG_REFERENCE: /* set d, X */ f = cb_field (x); /* check numeric */ if (CB_EXCEPTION_ENABLE (COB_EC_DATA_INCOMPATIBLE)) { if (f->usage == CB_USAGE_DISPLAY || f->usage == CB_USAGE_PACKED) { dpush (cb_build_funcall_2 ("cob_check_numeric", x, cb_build_string0 ((ucharptr)(f->name)))); } } if (cb_fits_int (x)) { if (f->pic->have_sign) { dpush (cb_build_funcall_2 ("cob_decimal_set_int", d, cb_build_cast_integer (x))); current_program->gen_decset = 1; } else { dpush (cb_build_funcall_2 ("cob_decimal_set_uint", d, cb_build_cast_integer (x))); current_program->gen_udecset = 1; } } else { dpush (cb_build_funcall_2 ("cob_decimal_set_field", d, x)); } break; case CB_TAG_BINARY_OP: /* set d, X * set t, Y * OP d, t */ p = CB_BINARY_OP (x); t = decimal_alloc (); decimal_expand (d, p->x); decimal_expand (t, p->y); decimal_compute (p->op, d, t); decimal_free (); break; case CB_TAG_INTRINSIC: dpush (cb_build_funcall_2 ("cob_decimal_set_field", d, x)); break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } static void decimal_assign (cb_tree x, cb_tree d, cb_tree round_opt) { dpush (cb_build_funcall_3 ("cob_decimal_get_field", d, x, build_store_option (x, round_opt))); } static cb_tree build_decimal_assign (cb_tree vars, int op, cb_tree val) { cb_tree l; cb_tree t; cb_tree s1 = NULL; cb_tree d; d = decimal_alloc (); /* set d, VAL */ decimal_expand (d, val); if (op == 0) { for (l = vars; l; l = CB_CHAIN (l)) { /* set VAR, d */ decimal_assign (CB_VALUE (l), d, CB_PURPOSE (l)); s1 = cb_list_add (s1, cb_list_reverse (decimal_stack)); decimal_stack = NULL; } } else { t = decimal_alloc (); for (l = vars; l; l = CB_CHAIN (l)) { /* set t, VAR * OP t, d * set VAR, t */ decimal_expand (t, CB_VALUE (l)); decimal_compute (op, t, d); decimal_assign (CB_VALUE (l), t, CB_PURPOSE (l)); s1 = cb_list_add (s1, cb_list_reverse (decimal_stack)); decimal_stack = NULL; } decimal_free (); } decimal_free (); return s1; } void cb_emit_arithmetic (cb_tree vars, int op, cb_tree val) { cb_tree l; struct cb_field *f; val = cb_check_numeric_value (val); if (op) { cb_list_map (cb_check_numeric_name, vars); } else { cb_list_map (cb_check_numeric_edited_name, vars); } if (cb_validate_one (val)) { return; } if (cb_validate_list (vars)) { return; } if (!CB_BINARY_OP_P (val)) { if (op == '+' || op == '-') { if (CB_EXCEPTION_ENABLE (COB_EC_DATA_INCOMPATIBLE) && (CB_REF_OR_FIELD_P (val))) { f = cb_field (val); if (f->usage == CB_USAGE_DISPLAY || f->usage == CB_USAGE_PACKED) { cb_emit (cb_build_funcall_2 ("cob_check_numeric", val, cb_build_string0 ((ucharptr)(f->name)))); } } for (l = vars; l; l = CB_CHAIN (l)) { if (CB_EXCEPTION_ENABLE (COB_EC_DATA_INCOMPATIBLE) && (CB_REF_OR_FIELD_P (CB_VALUE(l)))) { f = cb_field (CB_VALUE(l)); if (f->usage == CB_USAGE_DISPLAY || f->usage == CB_USAGE_PACKED) { cb_emit (cb_build_funcall_2 ("cob_check_numeric", CB_VALUE(l), cb_build_string0 ((ucharptr)(f->name)))); } } if (op == '+') { CB_VALUE (l) = cb_build_add (CB_VALUE (l), val, CB_PURPOSE (l)); } else { CB_VALUE (l) = cb_build_sub (CB_VALUE (l), val, CB_PURPOSE (l)); } } cb_emit_list (vars); return; } } cb_emit (build_decimal_assign (vars, op, val)); } /* * Condition */ static cb_tree build_cond_88 (cb_tree x) { struct cb_field *f; cb_tree l; cb_tree t; cb_tree c1 = NULL; cb_tree c2; f = cb_field (x); /* refer to parent's data storage */ x = cb_build_field_reference (f->parent, x); f->parent->count++; /* build condition */ for (l = f->values; l; l = CB_CHAIN (l)) { t = CB_VALUE (l); if (CB_PAIR_P (t)) { /* VALUE THRU VALUE */ c2 = cb_build_binary_op (cb_build_binary_op (CB_PAIR_X (t), '[', x), '&', cb_build_binary_op (x, '[', CB_PAIR_Y (t))); } else { /* VALUE */ c2 = cb_build_binary_op (x, '=', t); } if (c1 == NULL) { c1 = c2; } else { c1 = cb_build_binary_op (c1, '|', c2); } } return c1; } static cb_tree cb_build_optim_cond (struct cb_binary_op *p) { struct cb_field *f; struct cb_field *fy; const char *s; size_t n; if (CB_REF_OR_FIELD_P (p->y)) { fy = cb_field (p->y); if (!fy->pic->have_sign && (fy->usage == CB_USAGE_BINARY || fy->usage == CB_USAGE_COMP_5 || fy->usage == CB_USAGE_COMP_X)) { return cb_build_funcall_2 ("cob_cmp_uint", p->x, cb_build_cast_integer (p->y)); } } if (CB_REF_OR_FIELD_P (p->x)) { f = cb_field (p->x); if (!f->pic->scale && f->usage == CB_USAGE_PACKED) { if (f->pic->digits < 10) { return cb_build_funcall_2 ("cob_cmp_packed_int", p->x, cb_build_cast_integer (p->y)); } else { return cb_build_funcall_2 ("cob_cmp_packed", p->x, cb_build_cast_integer (p->y)); } } if (!f->pic->scale && f->usage == CB_USAGE_DISPLAY && !f->flag_sign_leading && !f->flag_sign_separate) { if (cb_fits_int (p->x)) { if (!f->pic->have_sign) { return cb_build_funcall_3 ("cob_cmp_numdisp", cb_build_cast_address (p->x), cb_int (f->size), cb_build_cast_integer (p->y)); } else { return cb_build_funcall_3 ("cob_cmp_sign_numdisp", cb_build_cast_address (p->x), cb_int (f->size), cb_build_cast_integer (p->y)); } } else if (cb_fits_long_long (p->x)) { if (!f->pic->have_sign) { return cb_build_funcall_3 ("cob_cmp_long_numdisp", cb_build_cast_address (p->x), cb_int (f->size), cb_build_cast_integer (p->y)); } else { return cb_build_funcall_3 ("cob_cmp_long_sign_numdisp", cb_build_cast_address (p->x), cb_int (f->size), cb_build_cast_integer (p->y)); } } } if (!f->pic->scale && (f->usage == CB_USAGE_BINARY || f->usage == CB_USAGE_COMP_5 || f->usage == CB_USAGE_INDEX || f->usage == CB_USAGE_COMP_X)) { n = (f->size - 1) + (8 * (f->pic->have_sign ? 1 : 0)) + (16 * (f->flag_binary_swap ? 1 : 0)); #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER) switch (f->size) { case 2: #ifdef COB_SHORT_BORK s = bin_compare_funcs[n]; break; #endif case 4: case 8: if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % f->size) == 0) { s = align_bin_compare_funcs[n]; } else { s = bin_compare_funcs[n]; } break; default: s = bin_compare_funcs[n]; break; } #else s = bin_compare_funcs[n]; #endif if (s) { return cb_build_funcall_2 (s, cb_build_cast_address (p->x), cb_build_cast_integer (p->y)); } } } return cb_build_funcall_2 ("cob_cmp_int", p->x, cb_build_cast_integer (p->y)); } static int cb_chk_num_cond (cb_tree x, cb_tree y) { struct cb_field *fx; struct cb_field *fy; if (!CB_REFERENCE_P (x) && !CB_FIELD_P (x)) { return 0; } if (!CB_REFERENCE_P (y) && !CB_FIELD_P (y)) { return 0; } if (CB_TREE_CATEGORY (x) != CB_CATEGORY_NUMERIC) { return 0; } if (CB_TREE_CATEGORY (y) != CB_CATEGORY_NUMERIC) { return 0; } if (CB_TREE_CLASS (x) != CB_CLASS_NUMERIC) { return 0; } if (CB_TREE_CLASS (y) != CB_CLASS_NUMERIC) { return 0; } fx = cb_field (x); fy = cb_field (y); if (fx->usage != CB_USAGE_DISPLAY) { return 0; } if (fy->usage != CB_USAGE_DISPLAY) { return 0; } if (fx->pic->have_sign || fy->pic->have_sign) { return 0; } if (fx->size != fy->size) { return 0; } if (fx->pic->scale != fy->pic->scale) { return 0; } return 1; } static int cb_chk_alpha_cond (cb_tree x) { if (current_program->alphabet_name_list) { return 0; } if (CB_LITERAL_P (x)) { return 1; } if (!CB_REFERENCE_P (x) && !CB_FIELD_P (x)) { return 0; } if (CB_TREE_CATEGORY (x) != CB_CATEGORY_ALPHANUMERIC && CB_TREE_CATEGORY (x) != CB_CATEGORY_ALPHABETIC) { return 0; } if (cb_field_variable_size (cb_field (x))) { return 0; } if (cb_field_size (x) < 0) { return 0; } return 1; } cb_tree cb_build_cond (cb_tree x) { int size1; int size2; struct cb_field *f; struct cb_binary_op *p; cb_tree d1; cb_tree d2; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: case CB_TAG_FUNCALL: return x; case CB_TAG_REFERENCE: if (!CB_FIELD_P (cb_ref (x))) { return cb_build_cond (cb_ref (x)); } f = cb_field (x); /* level 88 condition */ if (f->level == 88) { /* We need to build a 88 condition at every occurrence instead of once at the beginning because a 88 item may be subscripted (i.e., it is not a constant tree). */ return cb_build_cond (build_cond_88 (x)); } cb_error_x (x, _("Invalid expression")); return cb_error_node; case CB_TAG_BINARY_OP: p = CB_BINARY_OP (x); switch (p->op) { case '!': return cb_build_negation (cb_build_cond (p->x)); case '&': case '|': return cb_build_binary_op (cb_build_cond (p->x), p->op, cb_build_cond (p->y)); default: if (CB_INDEX_P (p->x) || CB_INDEX_P (p->y) || CB_TREE_CLASS (p->x) == CB_CLASS_POINTER || CB_TREE_CLASS (p->y) == CB_CLASS_POINTER) { x = cb_build_binary_op (p->x, '-', p->y); } else if (CB_BINARY_OP_P (p->x) || CB_BINARY_OP_P (p->y)) { /* decimal comparison */ d1 = decimal_alloc (); d2 = decimal_alloc (); decimal_expand (d1, p->x); decimal_expand (d2, p->y); dpush (cb_build_funcall_2 ("cob_decimal_cmp", d1, d2)); decimal_free (); decimal_free (); x = cb_list_reverse (decimal_stack); decimal_stack = NULL; } else { if (cb_chk_num_cond (p->x, p->y)) { size1 = cb_field_size (p->x); x = cb_build_funcall_3 ("memcmp", cb_build_cast_address (p->x), cb_build_cast_address (p->y), cb_int (size1)); break; } if (CB_TREE_CLASS (p->x) == CB_CLASS_NUMERIC && CB_TREE_CLASS (p->y) == CB_CLASS_NUMERIC && cb_fits_int (p->y)) { x = cb_build_optim_cond (p); break; } /* field comparison */ if ((CB_REF_OR_FIELD_P (p->x)) && (CB_TREE_CATEGORY (p->x) == CB_CATEGORY_ALPHANUMERIC || CB_TREE_CATEGORY (p->x) == CB_CATEGORY_ALPHABETIC) && (cb_field_size (p->x) == 1) && (!current_program->alphabet_name_list) && (p->y == cb_space || p->y == cb_low || p->y == cb_high || p->y == cb_zero)) { x = cb_build_funcall_2 ("$G", p->x, p->y); break; } if (cb_chk_alpha_cond (p->x) && cb_chk_alpha_cond (p->y)) { size1 = cb_field_size (p->x); size2 = cb_field_size (p->y); } else { size1 = 0; size2 = 0; } if (size1 == 1 && size2 == 1) { x = cb_build_funcall_2 ("$G", p->x, p->y); } else if (size1 != 0 && size1 == size2) { x = cb_build_funcall_3 ("memcmp", cb_build_cast_address (p->x), cb_build_cast_address (p->y), cb_int (size1)); } else { if (CB_TREE_CLASS (p->x) == CB_CLASS_NUMERIC && p->y == cb_zero) { x = cb_build_optim_cond (p); } else { x = cb_build_funcall_2 ("cob_cmp", p->x, p->y); } } } } return cb_build_binary_op (x, p->op, p->y); default: cb_error_x (x, _("Invalid expression")); return cb_error_node; } /* NOT REACHED */ return x; } /* * ADD/SUBTRACT CORRESPONDING */ static cb_tree cb_build_optim_add (cb_tree v, cb_tree n) { size_t z; const char *s; struct cb_field *f; if (CB_REF_OR_FIELD_P (v)) { f = cb_field (v); if (!f->pic->scale && (f->usage == CB_USAGE_BINARY || f->usage == CB_USAGE_COMP_5 || f->usage == CB_USAGE_COMP_X)) { z = (f->size - 1) + (8 * (f->pic->have_sign ? 1 : 0)) + (16 * (f->flag_binary_swap ? 1 : 0)); #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER) switch (f->size) { case 2: #ifdef COB_SHORT_BORK s = bin_add_funcs[z]; break; #endif case 4: case 8: if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % f->size) == 0) { s = align_bin_add_funcs[z]; } else { s = bin_add_funcs[z]; } break; default: s = bin_add_funcs[z]; break; } #else if (f->usage == CB_USAGE_COMP_5) { switch (f->size) { case 1: case 2: case 4: case 8: return cb_build_assign (v, cb_build_binary_op (v, '+', n)); } } s = bin_add_funcs[z]; #endif if (s) { return cb_build_funcall_2 (s, cb_build_cast_address (v), cb_build_cast_integer (n)); } } else if (!f->pic->scale && f->usage == CB_USAGE_PACKED && f->pic->digits < 10) { return cb_build_funcall_2 ("cob_add_packed_int", v, cb_build_cast_integer (n)); } } return cb_build_funcall_2 ("cob_add_int", v, cb_build_cast_integer (n)); } static cb_tree cb_build_optim_sub (cb_tree v, cb_tree n) { size_t z; const char *s; struct cb_field *f; if (CB_REF_OR_FIELD_P (v)) { f = cb_field (v); if (!f->pic->scale && (f->usage == CB_USAGE_BINARY || f->usage == CB_USAGE_COMP_5 || f->usage == CB_USAGE_COMP_X)) { z = (f->size - 1) + (8 * (f->pic->have_sign ? 1 : 0)) + (16 * (f->flag_binary_swap ? 1 : 0)); #if defined(COB_NON_ALIGNED) && !defined(_MSC_VER) switch (f->size) { case 2: #ifdef COB_SHORT_BORK s = bin_sub_funcs[z]; break; #endif case 4: case 8: if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % f->size) == 0) { s = align_bin_sub_funcs[z]; } else { s = bin_sub_funcs[z]; } break; default: s = bin_sub_funcs[z]; break; } #else if (f->usage == CB_USAGE_COMP_5) { switch (f->size) { case 1: case 2: case 4: case 8: return cb_build_assign (v, cb_build_binary_op (v, '-', n)); } } s = bin_sub_funcs[z]; #endif if (s) { return cb_build_funcall_2 (s, cb_build_cast_address (v), cb_build_cast_integer (n)); } } } return cb_build_funcall_2 ("cob_sub_int", v, cb_build_cast_integer (n)); } cb_tree cb_build_add (cb_tree v, cb_tree n, cb_tree round_opt) { cb_tree opt; struct cb_field *f; #ifdef COB_NON_ALIGNED if (CB_INDEX_P (v)) { return cb_build_move (cb_build_binary_op (v, '+', n), v); } if (CB_TREE_CLASS (v) == CB_CLASS_POINTER) { current_program->gen_ptrmanip = 1; return cb_build_funcall_3 ("cob_pointer_manip", v, n, cb_int0); } #else if (CB_INDEX_P (v) || CB_TREE_CLASS (v) == CB_CLASS_POINTER) { return cb_build_move (cb_build_binary_op (v, '+', n), v); } #endif if (CB_REF_OR_FIELD_P (v)) { f = cb_field (v); f->count++; } if (CB_REF_OR_FIELD_P (n)) { f = cb_field (n); f->count++; } if (round_opt == cb_high) { if (cb_fits_int (n)) { return cb_build_optim_add (v, n); } else { return cb_build_funcall_3 ("cob_add", v, n, cb_int0); } } opt = build_store_option (v, round_opt); if (opt == cb_int0 && cb_fits_int (n)) { return cb_build_optim_add (v, n); } return cb_build_funcall_3 ("cob_add", v, n, opt); } cb_tree cb_build_sub (cb_tree v, cb_tree n, cb_tree round_opt) { cb_tree opt; struct cb_field *f; #ifdef COB_NON_ALIGNED if (CB_INDEX_P (v)) { return cb_build_move (cb_build_binary_op (v, '-', n), v); } if (CB_TREE_CLASS (v) == CB_CLASS_POINTER) { current_program->gen_ptrmanip = 1; return cb_build_funcall_3 ("cob_pointer_manip", v, n, cb_int1); } #else if (CB_INDEX_P (v) || CB_TREE_CLASS (v) == CB_CLASS_POINTER) { return cb_build_move (cb_build_binary_op (v, '-', n), v); } #endif if (CB_REF_OR_FIELD_P (v)) { f = cb_field (v); f->count++; } if (CB_REF_OR_FIELD_P (n)) { f = cb_field (n); f->count++; } opt = build_store_option (v, round_opt); if (opt == cb_int0 && cb_fits_int (n)) { return cb_build_optim_sub (v, n); } return cb_build_funcall_3 ("cob_sub", v, n, opt); } static void emit_corresponding (cb_tree (*func) (cb_tree f1, cb_tree f2, cb_tree f3), cb_tree x1, cb_tree x2, cb_tree opt) { struct cb_field *f1, *f2; cb_tree t1; cb_tree t2; for (f1 = cb_field (x1)->children; f1; f1 = f1->sister) { if (!f1->redefines && !f1->flag_occurs) { for (f2 = cb_field (x2)->children; f2; f2 = f2->sister) { if (!f2->redefines && !f2->flag_occurs) { if (strcmp (f1->name, f2->name) == 0) { t1 = cb_build_field_reference (f1, x1); t2 = cb_build_field_reference (f2, x2); if (f1->children && f2->children) { emit_corresponding (func, t1, t2, opt); } else { cb_emit (func (t1, t2, opt)); } } } } } } } void cb_emit_corresponding (cb_tree (*func) (cb_tree f1, cb_tree f2, cb_tree f3), cb_tree x1, cb_tree x2, cb_tree opt) { x1 = cb_check_group_name (x1); x2 = cb_check_group_name (x2); if (cb_validate_one (x1)) { return; } if (cb_validate_one (x2)) { return; } emit_corresponding (func, x1, x2, opt); } static void emit_move_corresponding (cb_tree x1, cb_tree x2) { struct cb_field *f1, *f2; cb_tree t1; cb_tree t2; for (f1 = cb_field (x1)->children; f1; f1 = f1->sister) { if (!f1->redefines && !f1->flag_occurs) { for (f2 = cb_field (x2)->children; f2; f2 = f2->sister) { if (!f2->redefines && !f2->flag_occurs) { if (strcmp (f1->name, f2->name) == 0) { t1 = cb_build_field_reference (f1, x1); t2 = cb_build_field_reference (f2, x2); if (f1->children && f2->children) { emit_move_corresponding (t1, t2); } else { cb_emit (cb_build_move (t1, t2)); } } } } } } } void cb_emit_move_corresponding (cb_tree x1, cb_tree x2) { cb_tree l; cb_tree v; x1 = cb_check_group_name (x1); if (cb_validate_one (x1)) { return; } for (l = x2; l; l = CB_CHAIN(l)) { v = CB_VALUE(l); v = cb_check_group_name (v); if (cb_validate_one (v)) { return; } emit_move_corresponding (x1, v); } } static void output_screen_from (struct cb_field *p, const size_t sisters) { int type; if (sisters && p->sister) { output_screen_from (p->sister, 1); } if (p->children) { output_screen_from (p->children, 1); } type = (p->children ? COB_SCREEN_TYPE_GROUP : p->values ? COB_SCREEN_TYPE_VALUE : (p->size > 0) ? COB_SCREEN_TYPE_FIELD : COB_SCREEN_TYPE_ATTRIBUTE); if (type == COB_SCREEN_TYPE_FIELD && p->screen_from) { cb_emit (cb_build_funcall_2 ("cob_move", p->screen_from, CB_TREE (p))); } } static void output_screen_to (struct cb_field *p, const size_t sisters) { int type; if (sisters && p->sister) { output_screen_to (p->sister, 1); } if (p->children) { output_screen_to (p->children, 1); } type = (p->children ? COB_SCREEN_TYPE_GROUP : p->values ? COB_SCREEN_TYPE_VALUE : (p->size > 0) ? COB_SCREEN_TYPE_FIELD : COB_SCREEN_TYPE_ATTRIBUTE); if (type == COB_SCREEN_TYPE_FIELD && p->screen_to) { cb_emit (cb_build_funcall_2 ("cob_move", CB_TREE (p), p->screen_to)); } } /* * ACCEPT statement */ void cb_emit_accept (cb_tree var, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs) { cb_tree line; cb_tree column; if (cb_validate_one (var)) { return; } if (cb_validate_one (pos)) { return; } if (cb_validate_one (fgc)) { return; } if (cb_validate_one (bgc)) { return; } if (cb_validate_one (scroll)) { return; } if (current_program->flag_screen) { /* Bump ref count to force CRT STATUS field generation */ cb_field (current_program->crt_status)->count++; if ((CB_REF_OR_FIELD_P (var)) && CB_FIELD (cb_ref (var))->storage == CB_STORAGE_SCREEN) { output_screen_from (CB_FIELD (cb_ref (var)), 0); gen_screen_ptr = 1; if (pos) { if (CB_PAIR_P (pos)) { line = CB_PAIR_X (pos); column = CB_PAIR_Y (pos); cb_emit (cb_build_funcall_3 ("cob_screen_accept", var, line, column)); } else { cb_emit (cb_build_funcall_3 ("cob_screen_accept", var, pos, NULL)); } } else { cb_emit (cb_build_funcall_3 ("cob_screen_accept", var, NULL, NULL)); } gen_screen_ptr = 0; output_screen_to (CB_FIELD (cb_ref (var)), 0); } else { if (pos || fgc || bgc) { if (!pos) { cb_emit (cb_build_funcall_7 ("cob_field_accept", var, NULL, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } else if (CB_PAIR_P (pos)) { line = CB_PAIR_X (pos); column = CB_PAIR_Y (pos); cb_emit (cb_build_funcall_7 ("cob_field_accept", var, line, column, fgc, bgc, scroll, cb_int (dispattrs))); } else { cb_emit (cb_build_funcall_7 ("cob_field_accept", var, pos, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } } else { cb_emit (cb_build_funcall_7 ("cob_field_accept", var, NULL, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } } } else if (pos || fgc || bgc || scroll) { /* Bump ref count to force CRT STATUS field generation */ cb_field (current_program->crt_status)->count++; if (!pos) { cb_emit (cb_build_funcall_7 ("cob_field_accept", var, NULL, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } else if (CB_PAIR_P (pos)) { line = CB_PAIR_X (pos); column = CB_PAIR_Y (pos); cb_emit (cb_build_funcall_7 ("cob_field_accept", var, line, column, fgc, bgc, scroll, cb_int (dispattrs))); } else { cb_emit (cb_build_funcall_7 ("cob_field_accept", var, pos, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } } else { cb_emit (cb_build_funcall_1 ("cob_accept", var)); } } void cb_emit_accept_line_or_col (cb_tree var, const int l_or_c) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_2 ("cob_screen_line_col", var, cb_int (l_or_c))); } void cb_emit_accept_date (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_date", var)); } void cb_emit_accept_date_yyyymmdd (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_date_yyyymmdd", var)); } void cb_emit_accept_day (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_day", var)); } void cb_emit_accept_day_yyyyddd (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_day_yyyyddd", var)); } void cb_emit_accept_day_of_week (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_day_of_week", var)); } void cb_emit_accept_time (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_time", var)); } void cb_emit_accept_command_line (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_command_line", var)); } void cb_emit_get_environment (cb_tree envvar, cb_tree envval) { if (cb_validate_one (envvar)) { return; } if (cb_validate_one (envval)) { return; } cb_emit (cb_build_funcall_2 ("cob_get_environment", envvar, envval)); } void cb_emit_accept_environment (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_environment", var)); } void cb_emit_accept_arg_number (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_arg_number", var)); } void cb_emit_accept_arg_value (cb_tree var) { if (cb_validate_one (var)) { return; } cb_emit (cb_build_funcall_1 ("cob_accept_arg_value", var)); } void cb_emit_accept_mnemonic (cb_tree var, cb_tree mnemonic) { if (cb_validate_one (var)) { return; } switch (CB_SYSTEM_NAME (cb_ref (mnemonic))->token) { case CB_DEVICE_CONSOLE: case CB_DEVICE_SYSIN: cb_emit (cb_build_funcall_1 ("cob_accept", var)); break; default: cb_error_x (mnemonic, _("Invalid input stream '%s'"), cb_name (mnemonic)); break; } } void cb_emit_accept_name (cb_tree var, cb_tree name) { cb_tree sys; if (cb_validate_one (var)) { return; } if (CB_REFERENCE (name)->word->count == 0) { sys = lookup_system_name (CB_NAME (name)); if (sys != cb_error_node) { switch (CB_SYSTEM_NAME (sys)->token) { case CB_DEVICE_CONSOLE: case CB_DEVICE_SYSIN: cb_warning_x (name, _("'%s' undefined in SPECIAL-NAMES"), CB_NAME (name)); cb_emit (cb_build_funcall_1 ("cob_accept", var)); return; default: break; } } } cb_error_x (name, _("'%s' undefined in SPECIAL-NAMES"), CB_NAME (name)); } /* * ALLOCATE statement */ void cb_emit_allocate (cb_tree target1, cb_tree target2, cb_tree size, cb_tree initialize) { cb_tree x; char buff[32]; if (cb_validate_one (target1)) { return; } if (cb_validate_one (target2)) { return; } if (cb_validate_one (size)) { return; } if (target1) { if (!(CB_REFERENCE_P(target1) && cb_field (target1)->flag_item_based)) { cb_error_x (CB_TREE(current_statement), _("Target of ALLOCATE is not a BASED item")); } } if (target2) { if (!(CB_REFERENCE_P(target2) && CB_TREE_CLASS (target2) == CB_CLASS_POINTER)) { cb_error_x (CB_TREE(current_statement), _("Target of RETURNING is not a data pointer")); } } if (size) { if (CB_TREE_CLASS (size) != CB_CLASS_NUMERIC) { cb_error_x (CB_TREE(current_statement), _("The CHARACTERS field of ALLOCATE must be numeric")); } } if (target1) { sprintf (buff, "%d", cb_field (target1)->memory_size); x = cb_build_numeric_literal (0, (ucharptr)buff, 0); cb_emit (cb_build_funcall_3 ("cob_allocate", cb_build_cast_addr_of_addr (target1), target2, x)); } else { cb_emit (cb_build_funcall_3 ("cob_allocate", NULL, target2, size)); } if (initialize && target1) { current_statement->handler2 = cb_build_initialize (target1, cb_true, NULL, cb_true, 0); } } /* * CALL statement */ void cb_emit_call (cb_tree prog, cb_tree using, cb_tree returning, cb_tree on_exception, cb_tree not_on_exception) { cb_tree l; cb_tree x; const struct system_table *psyst; int is_sys_call = 0; if (CB_INTRINSIC_P (prog)) { if (CB_INTRINSIC(prog)->intr_tab->category != CB_CATEGORY_ALPHANUMERIC) { cb_error (_("Only alphanumeric FUNCTION types are allowed here")); return; } } if (returning) { if (CB_TREE_CLASS(returning) != CB_CLASS_NUMERIC && CB_TREE_CLASS(returning) != CB_CLASS_POINTER) { cb_error (_("Invalid RETURNING field")); return; } } for (l = using; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x == cb_error_node) { continue; } if (CB_CONST_P (x) && x != cb_null) { cb_error_x (x, _("Figurative constant invalid here")); } if ((CB_REFERENCE_P (x) && CB_FIELD_P(CB_REFERENCE(x)->value)) || CB_FIELD_P (x)) { if (cb_field (x)->level == 88) { cb_error_x (x, _("'%s' Not a data name"), CB_NAME (x)); return; } if (cb_warn_call_params && CB_PURPOSE_INT (l) == CB_CALL_BY_REFERENCE) { if (cb_field (x)->level != 01 && cb_field (x)->level != 77) { cb_warning_x (x, _("'%s' is not 01 or 77 level item"), CB_NAME (x)); } } } } if (CB_LITERAL_P(prog)) { for (psyst = (const struct system_table *)&system_tab[0]; psyst->syst_name; psyst++) { if (!strcmp((const char *)CB_LITERAL(prog)->data, (const char *)psyst->syst_name)) { if (psyst->syst_params > cb_list_length (using)) { cb_error (_("Wrong number of CALL parameters for '%s'"), (char *)psyst->syst_name); return; } is_sys_call = 1; break; } } } cb_emit (cb_build_call (prog, using, on_exception, not_on_exception, returning, is_sys_call)); } /* * CANCEL statement */ void cb_emit_cancel (cb_tree prog) { if (cb_validate_one (prog)) { return; } cb_emit (cb_build_funcall_1 ("cob_field_cancel", prog)); } /* * CLOSE statement */ void cb_emit_close (cb_tree file, cb_tree opt) { if (file == cb_error_node) { return; } file = cb_ref (file); if (file == cb_error_node) { return; } current_statement->file = file; if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } cb_emit (cb_build_funcall_3 ("cob_close", file, opt, CB_FILE(file)->file_status)); } /* * COMMIT statement */ void cb_emit_commit (void) { cb_emit (cb_build_funcall_0 ("cob_commit")); } /* * CONTINUE statement */ void cb_emit_continue (void) { cb_emit (cb_build_continue ()); } /* * DELETE statement */ void cb_emit_delete (cb_tree file) { if (file == cb_error_node) { return; } file = cb_ref (file); if (file == cb_error_node) { return; } current_statement->file = file; if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } cb_emit (cb_build_funcall_2 ("cob_delete", file, CB_FILE(file)->file_status)); } /* * DISPLAY statement */ void cb_emit_env_name (cb_tree value) { if (cb_validate_one (value)) { return; } cb_emit (cb_build_funcall_1 ("cob_display_environment", value)); } void cb_emit_env_value (cb_tree value) { if (cb_validate_one (value)) { return; } cb_emit (cb_build_funcall_1 ("cob_display_env_value", value)); } void cb_emit_arg_number (cb_tree value) { if (cb_validate_one (value)) { return; } cb_emit (cb_build_funcall_1 ("cob_display_arg_number", value)); } void cb_emit_command_line (cb_tree value) { if (cb_validate_one (value)) { return; } cb_emit (cb_build_funcall_1 ("cob_display_command_line", value)); } void cb_emit_display (cb_tree values, cb_tree upon, cb_tree no_adv, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs) { cb_tree l; cb_tree x; cb_tree line; cb_tree column; cb_tree p; if (cb_validate_list (values)) { return; } if (cb_validate_one (pos)) { return; } if (cb_validate_one (fgc)) { return; } if (cb_validate_one (bgc)) { return; } if (cb_validate_one (scroll)) { return; } for (l = values; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x == cb_error_node) { return; } switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: case CB_TAG_INTRINSIC: case CB_TAG_CONST: case CB_TAG_STRING: case CB_TAG_INTEGER: break; case CB_TAG_REFERENCE: if (!CB_FIELD_P(CB_REFERENCE(x)->value)) { cb_error_x (x, _("'%s' is an invalid type for DISPLAY operand"), cb_name (x)); return; } break; default: cb_error_x (x, _("Invalid type for DISPLAY operand")); return; } } if (upon == cb_error_node) { return; } x = CB_VALUE (values); if ((CB_REF_OR_FIELD_P (x)) && CB_FIELD (cb_ref (x))->storage == CB_STORAGE_SCREEN) { output_screen_from (CB_FIELD (cb_ref (x)), 0); gen_screen_ptr = 1; if (pos) { if (CB_PAIR_P (pos)) { line = CB_PAIR_X (pos); column = CB_PAIR_Y (pos); if (line == NULL) { line = cb_one; } if (column == NULL) { column = cb_one; } cb_emit (cb_build_funcall_3 ("cob_screen_display", x, line, column)); } else { cb_emit (cb_build_funcall_3 ("cob_screen_display", x, pos, NULL)); } } else { cb_emit (cb_build_funcall_3 ("cob_screen_display", x, NULL, NULL)); } gen_screen_ptr = 0; } else if (pos || fgc || bgc || scroll || dispattrs) { if (!pos) { cb_emit (cb_build_funcall_7 ("cob_field_display", CB_VALUE (values), NULL, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } else if (CB_PAIR_P (pos)) { line = CB_PAIR_X (pos); column = CB_PAIR_Y (pos); if (line == NULL) { line = cb_one; } if (column == NULL) { column = cb_one; } cb_emit (cb_build_funcall_7 ("cob_field_display", CB_VALUE (values), line, column, fgc, bgc, scroll, cb_int (dispattrs))); } else { cb_emit (cb_build_funcall_7 ("cob_field_display", CB_VALUE (values), pos, NULL, fgc, bgc, scroll, cb_int (dispattrs))); } } else { /* DISPLAY x ... [UPON device-name] */ p = cb_build_funcall_3 ("cob_display", upon, no_adv, values); CB_FUNCALL(p)->varcnt = cb_list_length (values); cb_emit (p); for (l = values; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (CB_FIELD_P (x)) { CB_FIELD (cb_ref (x))->count++; } } } } cb_tree cb_build_display_upon (cb_tree x) { if (x == cb_error_node) { return cb_error_node; } switch (CB_SYSTEM_NAME (cb_ref (x))->token) { case CB_DEVICE_CONSOLE: case CB_DEVICE_SYSOUT: return cb_int0; case CB_DEVICE_SYSERR: return cb_int1; default: cb_error_x (x, _("Invalid output stream")); return cb_error_node; } } cb_tree cb_build_display_upon_direct (cb_tree x) { const char *name; cb_tree sys; if (x == cb_error_node) { return cb_error_node; } name = CB_NAME (x); if (CB_REFERENCE (x)->word->count == 0) { sys = lookup_system_name (CB_NAME (x)); if (sys != cb_error_node) { switch (CB_SYSTEM_NAME (sys)->token) { case CB_DEVICE_CONSOLE: case CB_DEVICE_SYSOUT: cb_warning_x (x, _("'%s' undefined in SPECIAL-NAMES"), name); return cb_int0; case CB_DEVICE_SYSERR: cb_warning_x (x, _("'%s' undefined in SPECIAL-NAMES"), name); return cb_int1; default: break; } } } cb_error_x (x, _("'%s' undefined in SPECIAL-NAMES"), name); return cb_error_node; } /* * DIVIDE statement */ void cb_emit_divide (cb_tree dividend, cb_tree divisor, cb_tree quotient, cb_tree remainder) { if (cb_validate_one (dividend)) { return; } if (cb_validate_one (divisor)) { return; } CB_VALUE (quotient) = cb_check_numeric_edited_name (CB_VALUE (quotient)); CB_VALUE (remainder) = cb_check_numeric_edited_name (CB_VALUE (remainder)); if (cb_validate_one (CB_VALUE (quotient))) { return; } if (cb_validate_one (CB_VALUE (remainder))) { return; } cb_emit (cb_build_funcall_4 ("cob_div_quotient", dividend, divisor, CB_VALUE (quotient), build_store_option (CB_VALUE (quotient), CB_PURPOSE (quotient)))); cb_emit (cb_build_funcall_2 ("cob_div_remainder", CB_VALUE (remainder), build_store_option (CB_VALUE (remainder), cb_int0))); } /* * EVALUATE statement */ static cb_tree evaluate_test (cb_tree s, cb_tree o) { int flag; cb_tree x, y; cb_tree t; /* ANY is always true */ if (o == cb_any) { return cb_true; } /* object TRUE or FALSE */ if (o == cb_true) { return s; } if (o == cb_false) { return cb_build_negation (s); } flag = CB_PURPOSE_INT (o); x = CB_PAIR_X (CB_VALUE (o)); y = CB_PAIR_Y (CB_VALUE (o)); /* subject TRUE or FALSE */ if (s == cb_true) { return flag ? cb_build_negation (x) : x; } if (s == cb_false) { return flag ? x : cb_build_negation (x); } /* x THRU y */ if (y) { t = cb_build_binary_op (cb_build_binary_op (x, '[', s), '&', cb_build_binary_op (s, '[', y)); return flag ? cb_build_negation (t) : t; } if (CB_REFERENCE_P(x) && CB_FIELD_P(CB_REFERENCE(x)->value) && CB_FIELD(CB_REFERENCE(x)->value)->level == 88) { cb_error_x (CB_TREE (current_statement), _("Invalid use of 88 level in WHEN expression")); return NULL; } /* regular comparison */ if (flag) { return cb_build_binary_op (s, '~', x); } else { return cb_build_binary_op (s, '=', x); } } static cb_tree build_evaluate (cb_tree subject_list, cb_tree case_list) { cb_tree c1 = NULL; cb_tree c2; cb_tree c3; cb_tree subjs; cb_tree whens; cb_tree objs; cb_tree stmt; if (case_list == NULL) { return NULL; } whens = CB_VALUE (case_list); stmt = CB_VALUE (whens); whens = CB_CHAIN (whens); /* for each WHEN sequence */ for (; whens; whens = CB_CHAIN (whens)) { c2 = NULL; /* single WHEN test */ for (subjs = subject_list, objs = CB_VALUE (whens); subjs && objs; subjs = CB_CHAIN (subjs), objs = CB_CHAIN (objs)) { c3 = evaluate_test (CB_VALUE (subjs), CB_VALUE (objs)); if (c3 == NULL) { return NULL; } if (c2 == NULL) { c2 = c3; } else { c2 = cb_build_binary_op (c2, '&', c3); } } if (subjs || objs) { cb_error (_("Wrong number of WHEN parameters")); } /* connect multiple WHEN's */ if (c1 == NULL) { c1 = c2; } else { c1 = cb_build_binary_op (c1, '|', c2); } } if (c1 == NULL) { return stmt; } else { return cb_build_if (cb_build_cond (c1), stmt, build_evaluate (subject_list, CB_CHAIN (case_list))); } } void cb_emit_evaluate (cb_tree subject_list, cb_tree case_list) { cb_emit (build_evaluate (subject_list, case_list)); } /* * FREE statement */ void cb_emit_free (cb_tree vars) { cb_tree l; struct cb_field *f; int i; if (cb_validate_list (vars)) { return; } for (l = vars, i = 1; l; l = CB_CHAIN (l), i++) { if (CB_TREE_CLASS (CB_VALUE (l)) == CB_CLASS_POINTER) { if (CB_CAST_P (CB_VALUE (l))) { f = cb_field (CB_CAST (CB_VALUE(l))->val); if (!f->flag_item_based) { cb_error_x (CB_TREE (current_statement), _("Target %d of FREE, a data address identifier, must address a BASED data item"), i); } cb_emit (cb_build_funcall_2 ("cob_free_alloc", cb_build_cast_address (CB_VALUE (l)), NULL)); } else { cb_emit (cb_build_funcall_2 ("cob_free_alloc", NULL, cb_build_cast_address (CB_VALUE (l)))); } } else if (CB_REF_OR_FIELD_P (CB_VALUE (l))) { f = cb_field (CB_VALUE (l)); if (!f->flag_item_based) { cb_error_x (CB_TREE (current_statement), _("Target %d of FREE, a data address identifier, must address a BASED data item"), i); } cb_emit (cb_build_funcall_2 ("cob_free_alloc", cb_build_cast_addr_of_addr (CB_VALUE (l)), NULL)); } else { cb_error_x (CB_TREE (current_statement), _("Target %d of FREE must be a data pointer"), i); } } } /* * GO TO statement */ void cb_emit_goto (cb_tree target, cb_tree depending) { if (target == cb_error_node) { return; } if (depending) { /* GO TO procedure-name ... DEPENDING ON identifier */ cb_emit (cb_build_goto (target, depending)); } else { /* GO TO procedure-name */ if (target == NULL) { cb_verify (cb_goto_statement_without_name, "GO TO without procedure-name"); } else if (CB_CHAIN (target)) { cb_error (_("GO TO with multiple procedure-names")); } else { cb_emit (cb_build_goto (CB_VALUE (target), NULL)); } } } void cb_emit_exit (size_t goback) { if (goback) { cb_emit (cb_build_goto (cb_int1, NULL)); } else { cb_emit (cb_build_goto (NULL, NULL)); } } /* * IF statement */ void cb_emit_if (cb_tree cond, cb_tree stmt1, cb_tree stmt2) { cb_emit (cb_build_if (cond, stmt1, stmt2)); } /* * INITIALIZE statement */ void cb_emit_initialize (cb_tree vars, cb_tree fillinit, cb_tree value, cb_tree replacing, cb_tree def) { cb_tree l; int fill_init = 1; if (cb_validate_list (vars)) { return; } if (value == NULL && replacing == NULL) { def = cb_true; } if (fillinit == cb_true) { fill_init = 0; } for (l = vars; l; l = CB_CHAIN (l)) { cb_emit (cb_build_initialize (CB_VALUE (l), value, replacing, def, fill_init)); } } /* * INSPECT statement */ void cb_emit_inspect (cb_tree var, cb_tree body, cb_tree replacing, int replconv) { switch (CB_TREE_TAG(var)) { case CB_TAG_REFERENCE: break; case CB_TAG_INTRINSIC: switch (CB_TREE_CATEGORY(var)) { case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: case CB_CATEGORY_NATIONAL: break; default: cb_error (_("Invalid target for INSPECT")); return; } break; case CB_TAG_LITERAL: break; default: cb_error (_("Invalid target for REPLACING/CONVERTING")); return; } if (replconv && sending_id) { cb_error (_("Invalid target for REPLACING/CONVERTING")); } cb_emit (cb_build_funcall_2 ("cob_inspect_init", var, replacing)); cb_emit_list (body); cb_emit (cb_build_funcall_0 ("cob_inspect_finish")); } void cb_init_tarrying (void) { inspect_func = NULL; inspect_data = NULL; } cb_tree cb_build_tarrying_data (cb_tree x) { inspect_data = x; return NULL; } cb_tree cb_build_tarrying_characters (cb_tree l) { if (inspect_data == NULL) { cb_error (_("Data name expected before CHARACTERS")); } inspect_func = NULL; return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_characters", inspect_data)); } cb_tree cb_build_tarrying_all (void) { if (inspect_data == NULL) { cb_error (_("Data name expected before ALL")); } inspect_func = "cob_inspect_all"; return NULL; } cb_tree cb_build_tarrying_leading (void) { if (inspect_data == NULL) { cb_error (_("Data name expected before LEADING")); } inspect_func = "cob_inspect_leading"; return NULL; } cb_tree cb_build_tarrying_trailing (void) { if (inspect_data == NULL) { cb_error (_("Data name expected before TRAILING")); } inspect_func = "cob_inspect_trailing"; return NULL; } cb_tree cb_build_tarrying_value (cb_tree x, cb_tree l) { if (inspect_func == NULL) { cb_error_x (x, _("ALL, LEADING or TRAILING expected before '%s'"), cb_name (x)); } return cb_list_add (l, cb_build_funcall_2 (inspect_func, inspect_data, x)); } cb_tree cb_build_replacing_characters (cb_tree x, cb_tree l) { return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_characters", x)); } cb_tree cb_build_replacing_all (cb_tree x, cb_tree y, cb_tree l) { return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_all", y, x)); } cb_tree cb_build_replacing_leading (cb_tree x, cb_tree y, cb_tree l) { return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_leading", y, x)); } cb_tree cb_build_replacing_first (cb_tree x, cb_tree y, cb_tree l) { return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_first", y, x)); } cb_tree cb_build_replacing_trailing (cb_tree x, cb_tree y, cb_tree l) { return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_trailing", y, x)); } cb_tree cb_build_converting (cb_tree x, cb_tree y, cb_tree l) { return cb_list_add (l, cb_build_funcall_2 ("cob_inspect_converting", x, y)); } cb_tree cb_build_inspect_region_start (void) { return cb_list_init (cb_build_funcall_0 ("cob_inspect_start")); } cb_tree cb_build_inspect_region (cb_tree l, cb_tree pos, cb_tree x) { if (pos == CB_BEFORE) { return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_before", x)); } else { return cb_list_add (l, cb_build_funcall_1 ("cob_inspect_after", x)); } } /* * MOVE statement */ static void warning_destination (cb_tree x) { struct cb_reference *r; struct cb_field *f; cb_tree loc; r = CB_REFERENCE (x); f = CB_FIELD (r->value); loc = CB_TREE (f); if (r->offset) { return; } if (!strcmp (f->name, "RETURN-CODE") || !strcmp (f->name, "SORT-RETURN") || !strcmp (f->name, "NUMBER-OF-CALL-PARAMETERS")) { cb_warning (_("Internal register '%s' defined as BINARY-LONG"), f->name); } else if (f->pic) { cb_warning_x (loc, _("'%s' defined here as PIC %s"), f->name, f->pic->orig); } else { cb_warning_x (loc, _("'%s' defined here as a group of length %d"), f->name, f->size); } } static int move_error (cb_tree src, cb_tree dst, const size_t value_flag, const int flag, const int src_flag, const char *msg) { cb_tree loc; if (suppress_warn) { return 0; } loc = src->source_line ? src : dst; if (value_flag) { /* VALUE clause */ cb_warning_x (loc, msg); } else { /* MOVE statement */ if (flag) { cb_warning_x (loc, msg); if (src_flag) { warning_destination (src); } warning_destination (dst); } } return 0; } /* count the number of free places in an alphanumeric edited field */ static int count_pic_alphanumeric_edited (struct cb_field *field) { int count; int repeat; unsigned char *p; count = 0; for (p = (unsigned char *)(field->pic->str); *p; p += 5) { if (*p == '9' || *p == 'A' || *p == 'X') { memcpy ((unsigned char *)&repeat, p + 1, sizeof(int)); count += repeat; } } return count; } int validate_move (cb_tree src, cb_tree dst, size_t is_value) { struct cb_field *f; struct cb_literal *l; unsigned char *p; cb_tree loc; long long val; size_t i; size_t is_numeric_edited = 0; int src_scale_mod; int dst_scale_mod; int dst_size_mod; int size; int most_significant; int least_significant; loc = src->source_line ? src : dst; if (CB_REFERENCE_P(dst) && CB_ALPHABET_NAME_P(CB_REFERENCE(dst)->value)) { goto invalid; } if (CB_REFERENCE_P(dst) && CB_FILE_P(CB_REFERENCE(dst)->value)) { goto invalid; } if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_BOOLEAN) { cb_error_x (loc, _("Invalid destination for MOVE")); return -1; } if (CB_TREE_CLASS (dst) == CB_CLASS_POINTER) { if (CB_TREE_CLASS (src) == CB_CLASS_POINTER) { return 0; } else { goto invalid; } } f = cb_field (dst); switch (CB_TREE_TAG (src)) { case CB_TAG_CONST: if (src == cb_space) { if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_NUMERIC || (CB_TREE_CATEGORY (dst) == CB_CATEGORY_NUMERIC_EDITED && !is_value)) { goto invalid; } } else if (src == cb_zero) { if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_ALPHABETIC) { goto invalid; } } break; case CB_TAG_LITERAL: /* TODO: ALL literal */ l = CB_LITERAL (src); if (CB_TREE_CLASS (src) == CB_CLASS_NUMERIC) { /* Numeric literal */ if (l->all) { goto invalid; } most_significant = -999; least_significant = 999; /* compute the most significant figure place */ for (i = 0; i < l->size; i++) { if (l->data[i] != '0') { break; } } if (i != l->size) { most_significant = (int) (l->size - l->scale - i - 1); } /* compute the least significant figure place */ for (i = 0; i < l->size; i++) { if (l->data[l->size - i - 1] != '0') { break; } } if (i != l->size) { least_significant = (int) (-l->scale + i); } /* value check */ switch (CB_TREE_CATEGORY (dst)) { case CB_CATEGORY_ALPHANUMERIC: case CB_CATEGORY_ALPHANUMERIC_EDITED: if (is_value) { goto expect_alphanumeric; } if (l->scale == 0) { goto expect_alphanumeric; } else { goto invalid; } case CB_CATEGORY_NUMERIC: if (f->pic->scale < 0) { /* check for PIC 9(n)P(m) */ if (least_significant < -f->pic->scale) { goto value_mismatch; } } else if (f->pic->scale > f->pic->size) { /* check for PIC P(n)9(m) */ if (most_significant >= f->pic->size - f->pic->scale) { goto value_mismatch; } } break; case CB_CATEGORY_NUMERIC_EDITED: if (is_value) { goto expect_alphanumeric; } /* TODO */ break; default: if (is_value) { goto expect_alphanumeric; } goto invalid; } /* sign check */ if (l->sign != 0 && !f->pic->have_sign) { if (is_value) { cb_error_x (loc, _("Data item not signed")); return -1; } if (cb_warn_constant) { cb_warning_x (loc, _("Ignoring negative sign")); } } /* size check */ if (f->flag_real_binary || ((f->usage == CB_USAGE_COMP_5 || f->usage == CB_USAGE_COMP_X || f->usage == CB_USAGE_BINARY) && f->pic->scale == 0)) { p = l->data; for (i = 0; i < l->size; i++) { if (l->data[i] != '0') { p = &l->data[i]; break; } } i = l->size - i; switch (f->size) { case 1: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -128LL || val > 127LL) { goto numlit_overflow; } } else { if (val > 255LL) { goto numlit_overflow; } } break; case 2: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -32768LL || val > 32767LL) { goto numlit_overflow; } } else { if (val > 65535LL) { goto numlit_overflow; } } break; case 3: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -8388608LL || val > 8388607LL) { goto numlit_overflow; } } else { if (val > 16777215LL) { goto numlit_overflow; } } break; case 4: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -2147483648LL || val > 2147483647LL) { goto numlit_overflow; } } else { if (val > 4294967295LL) { goto numlit_overflow; } } break; case 5: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -549755813888LL || val > 549755813887LL) { goto numlit_overflow; } } else { if (val > 1099511627775LL) { goto numlit_overflow; } } break; case 6: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -140737488355328LL || val > 140737488355327LL) { goto numlit_overflow; } } else { if (val > 281474976710655LL) { goto numlit_overflow; } } break; case 7: if (i > 18) { goto numlit_overflow; } val = cb_get_long_long (src); if (f->pic->have_sign) { if (val < -36028797018963968LL || val > 36028797018963967LL) { goto numlit_overflow; } } else { if (val > 72057594037927935LL) { goto numlit_overflow; } } break; default: if (f->pic->have_sign) { if (i < 19) { break; } if (i > 19) { goto numlit_overflow; } if (memcmp (p, "9223372036854775807", 19) > 0) { goto numlit_overflow; } } else { if (i < 20) { break; } if (i > 20) { goto numlit_overflow; } if (memcmp (p, "18446744073709551615", 20) > 0) { goto numlit_overflow; } } break; } return 0; } if (least_significant < -f->pic->scale) { goto size_overflow; } if (f->pic->scale > 0) { size = f->pic->digits - f->pic->scale; } else { size = f->pic->digits; } if (most_significant >= size) { goto size_overflow; } } else { /* Alphanumeric literal */ /* value check */ switch (CB_TREE_CATEGORY (dst)) { case CB_CATEGORY_ALPHABETIC: for (i = 0; i < l->size; i++) { if (!isalpha (l->data[i]) && !isspace (l->data[i])) { goto value_mismatch; } } break; case CB_CATEGORY_NUMERIC: goto expect_numeric; case CB_CATEGORY_NUMERIC_EDITED: if (!is_value) { goto expect_numeric; } /* TODO: validate the value */ break; default: break; } /* size check */ size = cb_field_size (dst); if (size >= 0 && (int)l->size > size) { goto size_overflow; } } break; case CB_TAG_FIELD: case CB_TAG_REFERENCE: if (CB_REFERENCE_P(src) && CB_ALPHABET_NAME_P(CB_REFERENCE(src)->value)) { break; } if (CB_REFERENCE_P(src) && CB_FILE_P(CB_REFERENCE(src)->value)) { goto invalid; } size = cb_field_size (src); if (size < 0) { size = cb_field (src)->size; } /* non-elementary move */ if (cb_field (src)->children || cb_field (dst)->children) { if (size > cb_field (dst)->size) { goto size_overflow_1; } break; } /* elementary move */ switch (CB_TREE_CATEGORY (src)) { case CB_CATEGORY_ALPHANUMERIC: switch (CB_TREE_CATEGORY (dst)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_NUMERIC_EDITED: if (size > cb_field (dst)->pic->digits) { goto size_overflow_2; } break; case CB_CATEGORY_ALPHANUMERIC_EDITED: if (size > count_pic_alphanumeric_edited (cb_field (dst))) { goto size_overflow_1; } break; default: if (size > cb_field (dst)->size) { goto size_overflow_1; } break; } break; case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC_EDITED: switch (CB_TREE_CATEGORY (dst)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_NUMERIC_EDITED: goto invalid; case CB_CATEGORY_ALPHANUMERIC_EDITED: if (size > count_pic_alphanumeric_edited(cb_field (dst))) { goto size_overflow_1; } break; default: if (size > cb_field (dst)->size) { goto size_overflow_1; } break; } break; case CB_CATEGORY_NUMERIC: case CB_CATEGORY_NUMERIC_EDITED: switch (CB_TREE_CATEGORY (dst)) { case CB_CATEGORY_ALPHABETIC: goto invalid; case CB_CATEGORY_ALPHANUMERIC_EDITED: is_numeric_edited = 1; /* Drop through */ case CB_CATEGORY_ALPHANUMERIC: if (is_numeric_edited) { dst_size_mod = count_pic_alphanumeric_edited (cb_field (dst)); } else { dst_size_mod = cb_field (dst)->size; } if (CB_TREE_CATEGORY (src) == CB_CATEGORY_NUMERIC && cb_field (src)->pic->scale > 0) { if (cb_move_noninteger_to_alphanumeric == CB_ERROR) { goto invalid; } cb_warning_x (loc, _("Move non-integer to alphanumeric")); break; } if (CB_TREE_CATEGORY (src) == CB_CATEGORY_NUMERIC && cb_field (src)->pic->digits > dst_size_mod) { goto size_overflow_2; } if (CB_TREE_CATEGORY (src) == CB_CATEGORY_NUMERIC_EDITED && cb_field (src)->size > dst_size_mod) { goto size_overflow_1; } break; default: src_scale_mod = cb_field (src)->pic->scale < 0 ? 0 : cb_field (src)->pic->scale; dst_scale_mod = cb_field (dst)->pic->scale < 0 ? 0 : cb_field (dst)->pic->scale; if (cb_field (src)->pic->digits - src_scale_mod > cb_field (dst)->pic->digits - dst_scale_mod || src_scale_mod > dst_scale_mod) { goto size_overflow_2; } break; } break; default: cb_error_x (loc, _("Invalid source for MOVE")); return -1; } break; case CB_TAG_INTEGER: case CB_TAG_BINARY_OP: case CB_TAG_INTRINSIC: /* TODO: check this */ break; default: fprintf (stderr, "Invalid tree tag %d\n", CB_TREE_TAG (src)); ABORT (); } return 0; invalid: if (is_value) { cb_error_x (loc, _("Invalid VALUE clause")); } else { cb_error_x (loc, _("Invalid MOVE statement")); } return -1; numlit_overflow: if (is_value) { cb_error_x (loc, _("Invalid VALUE clause - literal exceeds data size")); return -1; } if (cb_warn_constant) { cb_warning_x (loc, _("Numeric literal exceeds data size")); } return 0; expect_numeric: return move_error (src, dst, is_value, cb_warn_strict_typing, 0, _("Numeric value is expected")); expect_alphanumeric: return move_error (src, dst, is_value, cb_warn_strict_typing, 0, _("Alphanumeric value is expected")); value_mismatch: return move_error (src, dst, is_value, cb_warn_constant, 0, _("Value does not fit the picture string")); size_overflow: return move_error (src, dst, is_value, cb_warn_constant, 0, _("Value size exceeds data size")); size_overflow_1: return move_error (src, dst, is_value, cb_warn_truncate, 1, _("Sending field larger than receiving field")); size_overflow_2: return move_error (src, dst, is_value, cb_warn_truncate, 1, _("Some digits may be truncated")); } static cb_tree cb_build_memset (cb_tree x, int c) { int size = cb_field_size (x); if (size == 1) { return cb_build_funcall_2 ("$E", x, cb_int (c)); } else { return cb_build_funcall_3 ("memset", cb_build_cast_address (x), cb_int (c), cb_build_cast_length (x)); } } static cb_tree cb_build_move_copy (cb_tree src, cb_tree dst) { int size = cb_field_size (dst); if (size == 1) { return cb_build_funcall_2 ("$F", dst, src); } else { return cb_build_funcall_3 ("memcpy", cb_build_cast_address (dst), cb_build_cast_address (src), cb_build_cast_length (dst)); } } static cb_tree cb_build_move_call (cb_tree src, cb_tree dst) { return cb_build_funcall_2 ("cob_move", src, dst); } static cb_tree cb_build_move_num_zero (cb_tree x) { struct cb_field *f; f = cb_field (x); switch (f->usage) { case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->flag_binary_swap) { return cb_build_memset (x, 0); } switch (f->size) { #ifdef COB_NON_ALIGNED case 1: return cb_build_assign (x, cb_int0); case 2: #ifdef COB_SHORT_BORK if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % 4 == 0)) { return cb_build_assign (x, cb_int0); } break; #endif case 4: case 8: if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % f->size == 0)) { return cb_build_assign (x, cb_int0); } break; #else case 1: case 2: case 4: case 8: return cb_build_assign (x, cb_int0); #endif } return cb_build_memset (x, 0); case CB_USAGE_DISPLAY: return cb_build_memset (x, '0'); case CB_USAGE_PACKED: return cb_build_funcall_1 ("cob_set_packed_zero", x); default: return cb_build_move_call (cb_zero, x); } } static cb_tree cb_build_move_space (cb_tree x) { switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: return cb_build_memset (x, ' '); default: return cb_build_move_call (cb_space, x); } } static cb_tree cb_build_move_zero (cb_tree x) { switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: if (cb_field (x)->flag_blank_zero) { return cb_build_move_space (x); } else { return cb_build_move_num_zero (x); } case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: return cb_build_memset (x, '0'); default: return cb_build_move_call (cb_zero, x); } } static cb_tree cb_build_move_high (cb_tree x) { switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: if (cb_high == cb_norm_high) { return cb_build_memset (x, 255); } else { return cb_build_move_call (cb_high, x); } default: return cb_build_move_call (cb_high, x); } } static cb_tree cb_build_move_low (cb_tree x) { switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: if (cb_low == cb_norm_low) { return cb_build_memset (x, 0); } else { return cb_build_move_call (cb_low, x); } default: return cb_build_move_call (cb_low, x); } } static cb_tree cb_build_move_quote (cb_tree x) { switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: return cb_build_memset (x, '"'); default: return cb_build_move_call (cb_quote, x); } } #ifdef COB_EBCDIC_MACHINE static void cob_put_sign_ascii (unsigned char *p) { switch (*p) { case '0': *p = (unsigned char)'p'; return; case '1': *p = (unsigned char)'q'; return; case '2': *p = (unsigned char)'r'; return; case '3': *p = (unsigned char)'s'; return; case '4': *p = (unsigned char)'t'; return; case '5': *p = (unsigned char)'u'; return; case '6': *p = (unsigned char)'v'; return; case '7': *p = (unsigned char)'w'; return; case '8': *p = (unsigned char)'x'; return; case '9': *p = (unsigned char)'y'; return; } } #endif static void cob_put_sign_ebcdic (unsigned char *p, const int sign) { if (sign < 0) { switch (*p) { case '0': *p = (unsigned char)'}'; return; case '1': *p = (unsigned char)'J'; return; case '2': *p = (unsigned char)'K'; return; case '3': *p = (unsigned char)'L'; return; case '4': *p = (unsigned char)'M'; return; case '5': *p = (unsigned char)'N'; return; case '6': *p = (unsigned char)'O'; return; case '7': *p = (unsigned char)'P'; return; case '8': *p = (unsigned char)'Q'; return; case '9': *p = (unsigned char)'R'; return; default: /* What to do here */ *p = (unsigned char)'}'; return; } } switch (*p) { case '0': *p = (unsigned char)'{'; return; case '1': *p = (unsigned char)'A'; return; case '2': *p = (unsigned char)'B'; return; case '3': *p = (unsigned char)'C'; return; case '4': *p = (unsigned char)'D'; return; case '5': *p = (unsigned char)'E'; return; case '6': *p = (unsigned char)'F'; return; case '7': *p = (unsigned char)'G'; return; case '8': *p = (unsigned char)'H'; return; case '9': *p = (unsigned char)'I'; return; default: /* What to do here */ *p = (unsigned char)'{'; return; } /* NOT REACHED */ } static cb_tree cb_build_move_literal (cb_tree src, cb_tree dst) { struct cb_literal *l; struct cb_field *f; unsigned char *buff; unsigned char *p; enum cb_category cat; int i; int diff; int val; int n; unsigned char bbyte; l = CB_LITERAL (src); f = cb_field (dst); cat = CB_TREE_CATEGORY (dst); if (l->all) { if (cat == CB_CATEGORY_NUMERIC || cat == CB_CATEGORY_NUMERIC_EDITED) { return cb_build_move_call (src, dst); } if (l->size == 1) { return cb_build_funcall_3 ("memset", cb_build_cast_address (dst), cb_int (l->data[0]), cb_build_cast_length (dst)); } bbyte = l->data[0]; for (i = 0; i < (int)l->size; i++) { if (bbyte != l->data[i]) { break; } bbyte = l->data[i]; } if (i == (int)l->size) { return cb_build_funcall_3 ("memset", cb_build_cast_address (dst), cb_int (l->data[0]), cb_build_cast_length (dst)); } if (f->size > 128) { return cb_build_move_call (src, dst); } buff = cobc_malloc ((size_t)f->size); for (i = 0; i < f->size; i++) { buff[i] = l->data[i % l->size]; } return cb_build_funcall_3 ("memcpy", cb_build_cast_address (dst), cb_build_string (buff, f->size), cb_build_cast_length (dst)); } else if ((cat == CB_CATEGORY_NUMERIC && f->usage == CB_USAGE_DISPLAY && f->pic->scale == l->scale && !f->flag_sign_leading && !f->flag_sign_separate) || ((cat == CB_CATEGORY_ALPHABETIC || cat == CB_CATEGORY_ALPHANUMERIC) && f->size < (int) (l->size + 16) && !cb_field_variable_size (f))) { buff = cobc_malloc ((size_t)f->size); diff = (int) (f->size - l->size); if (cat == CB_CATEGORY_NUMERIC) { if (diff <= 0) { memcpy (buff, l->data - diff, (size_t)f->size); } else { memset (buff, '0', (size_t)diff); memcpy (buff + diff, l->data, (size_t)l->size); } if (f->pic->have_sign) { p = &buff[f->size - 1]; if (cb_display_sign) { cob_put_sign_ebcdic (p, l->sign); } else if (l->sign < 0) { #ifdef COB_EBCDIC_MACHINE cob_put_sign_ascii (p); #else *p += 0x40; #endif } } } else { if (f->flag_justified) { if (diff <= 0) { memcpy (buff, l->data - diff, (size_t)f->size); } else { memset (buff, ' ', (size_t)diff); memcpy (buff + diff, l->data, (size_t)l->size); } } else { if (diff <= 0) { memcpy (buff, l->data, (size_t)f->size); } else { memcpy (buff, l->data, (size_t)l->size); memset (buff + l->size, ' ', (size_t)diff); } } } bbyte = *buff; if (f->size == 1) { free (buff); return cb_build_funcall_2 ("$E", dst, cb_int (bbyte)); } for (i = 0; i < f->size; i++) { if (bbyte != buff[i]) { break; } } if (i == f->size) { free (buff); return cb_build_funcall_3 ("memset", cb_build_cast_address (dst), cb_int (bbyte), cb_build_cast_length (dst)); } return cb_build_funcall_3 ("memcpy", cb_build_cast_address (dst), cb_build_string (buff, f->size), cb_build_cast_length (dst)); } else if (cb_fits_int (src) && f->size <= 8 && (f->usage == CB_USAGE_BINARY || f->usage == CB_USAGE_COMP_5 || f->usage == CB_USAGE_COMP_X)) { val = cb_get_int (src); n = f->pic->scale - l->scale; if ((l->size + n) > 9) { return cb_build_move_call (src, dst); } for (; n > 0; n--) { val *= 10; } for (; n < 0; n++) { val /= 10; } if (val == 0) { return cb_build_move_num_zero (dst); } if (f->size == 1) { return cb_build_assign (dst, cb_int (val)); } if (f->flag_binary_swap) { i = (f->size - 1) + (8 * (f->pic->have_sign ? 1 : 0)); return cb_build_funcall_2 (bin_set_funcs[i], cb_build_cast_address (dst), cb_int (val)); } switch (f->size) { case 2: #ifdef COB_SHORT_BORK if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % 4 == 0)) { return cb_build_assign (dst, cb_int (val)); } break; #endif case 4: case 8: #ifdef COB_NON_ALIGNED if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && (f->offset % f->size == 0)) { return cb_build_assign (dst, cb_int (val)); } break; #else return cb_build_assign (dst, cb_int (val)); #endif } return cb_build_move_call (src, dst); } else if (cb_fits_int (src) && f->usage == CB_USAGE_PACKED) { if (f->pic->scale < 0) { return cb_build_move_call (src, dst); } val = cb_get_int (src); n = f->pic->scale - l->scale; if ((l->size + n) > 9) { return cb_build_move_call (src, dst); } for (; n > 0; n--) { val *= 10; } for (; n < 0; n++) { val /= 10; } if (val == 0) { return cb_build_move_num_zero (dst); } return cb_build_funcall_2 ("cob_set_packed_int", dst, cb_int (val)); } else { return cb_build_move_call (src, dst); } } static cb_tree cb_build_move_field (cb_tree src, cb_tree dst) { struct cb_field *src_f; struct cb_field *dst_f; int src_size; int dst_size; src_f = cb_field (src); src_size = cb_field_size (src); dst_f = cb_field (dst); dst_size = cb_field_size (dst); if ((src_size > 0 && dst_size > 0 && src_size >= dst_size) && (!cb_field_variable_size (src_f) && !cb_field_variable_size (dst_f))) { switch (CB_TREE_CATEGORY (src)) { case CB_CATEGORY_ALPHABETIC: if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_ALPHABETIC || CB_TREE_CATEGORY (dst) == CB_CATEGORY_ALPHANUMERIC) { if (dst_f->flag_justified == 0) { return cb_build_move_copy (src, dst); } } break; case CB_CATEGORY_ALPHANUMERIC: if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_ALPHANUMERIC) { if (dst_f->flag_justified == 0) { return cb_build_move_copy (src, dst); } } break; case CB_CATEGORY_NUMERIC: if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_NUMERIC && src_f->usage == dst_f->usage && src_f->pic->size == dst_f->pic->size && src_f->pic->digits == dst_f->pic->digits && src_f->pic->scale == dst_f->pic->scale && src_f->pic->have_sign == dst_f->pic->have_sign && src_f->flag_binary_swap == dst_f->flag_binary_swap && src_f->flag_sign_leading == dst_f->flag_sign_leading && src_f->flag_sign_separate == dst_f->flag_sign_separate) { return cb_build_move_copy (src, dst); } else if (CB_TREE_CATEGORY (dst) == CB_CATEGORY_ALPHANUMERIC && src_f->usage == CB_USAGE_DISPLAY && src_f->pic->have_sign == 0 && !src_f->flag_sign_leading && !src_f->flag_sign_separate) { return cb_build_move_copy (src, dst); } break; default: break; } } return cb_build_move_call (src, dst); } cb_tree cb_build_move (cb_tree src, cb_tree dst) { struct cb_field *f; struct cb_field *p; if (src == cb_error_node || dst == cb_error_node) { return cb_error_node; } if (validate_move (src, dst, 0) < 0) { return cb_error_node; } if (CB_REFERENCE_P (src)) { CB_REFERENCE (src)->type = CB_SENDING_OPERAND; } if (CB_REFERENCE_P (dst)) { CB_REFERENCE (dst)->type = CB_RECEIVING_OPERAND; } if (CB_TREE_CLASS (dst) == CB_CLASS_POINTER) { return cb_build_assign (dst, src); } if (CB_REFERENCE_P (src) && CB_ALPHABET_NAME_P(CB_REFERENCE(src)->value)) { return cb_build_move_call (src, dst); } if (CB_INDEX_P (dst)) { if (src == cb_null) { return cb_build_assign (dst, cb_zero); } return cb_build_assign (dst, src); } if (CB_INDEX_P (src)) { return cb_build_funcall_2 ("cob_set_int", dst, cb_build_cast_integer (src)); } if (CB_INTRINSIC_P (src) || CB_INTRINSIC_P (dst)) { return cb_build_move_call (src, dst); } f = cb_field (dst); if (CB_EXCEPTION_ENABLE (COB_EC_BOUND_SUBSCRIPT)) { for (p = f; p; p = p->parent) { if (p->flag_occurs) { return cb_build_move_call (src, dst); } } if (CB_REF_OR_FIELD_P (src)) { for (p = cb_field (src); p; p = p->parent) { if (p->flag_occurs) { return cb_build_move_call (src, dst); } } } } /* output optimal code */ if (src == cb_zero) { return cb_build_move_zero (dst); } else if (src == cb_space) { return cb_build_move_space (dst); } else if (src == cb_high) { return cb_build_move_high (dst); } else if (src == cb_low) { return cb_build_move_low (dst); } else if (src == cb_quote) { return cb_build_move_quote (dst); } else if (CB_LITERAL_P (src)) { return cb_build_move_literal (src, dst); } return cb_build_move_field (src, dst); } void cb_emit_move (cb_tree src, cb_tree dsts) { cb_tree l; if (cb_validate_one (src)) { return; } if (cb_validate_list (dsts)) { return; } for (l = dsts; l; l = CB_CHAIN (l)) { cb_emit (cb_build_move (src, CB_VALUE (l))); } } /* * OPEN statement */ void cb_emit_open (cb_tree file, cb_tree mode, cb_tree sharing) { if (file == cb_error_node) { return; } file = cb_ref (file); if (file == cb_error_node) { return; } current_statement->file = file; if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } if (sharing == NULL) { sharing = CB_FILE (file)->sharing ? CB_FILE (file)->sharing : cb_int0; } /* READ ONLY */ if (sharing == cb_int0 && CB_INTEGER (mode)->val != COB_OPEN_INPUT) { sharing = cb_int1; } cb_emit (cb_build_funcall_4 ("cob_open", file, mode, sharing, CB_FILE(file)->file_status)); } /* * PERFORM statement */ void cb_emit_perform (cb_tree perform, cb_tree body) { if (perform == cb_error_node) { return; } CB_PERFORM (perform)->body = body; cb_emit (perform); } cb_tree cb_build_perform_once (cb_tree body) { cb_tree x; if (body == cb_error_node) { return cb_error_node; } x = cb_build_perform (CB_PERFORM_ONCE); CB_PERFORM (x)->body = body; return x; } cb_tree cb_build_perform_times (cb_tree times) { cb_tree x; if (cb_check_integer_value (times) == cb_error_node) { return cb_error_node; } x = cb_build_perform (CB_PERFORM_TIMES); CB_PERFORM (x)->data = times; return x; } cb_tree cb_build_perform_until (cb_tree condition, cb_tree varying) { cb_tree x; x = cb_build_perform (CB_PERFORM_UNTIL); CB_PERFORM (x)->test = condition; CB_PERFORM (x)->varying = varying; return x; } cb_tree cb_build_perform_forever (cb_tree body) { cb_tree x; if (body == cb_error_node) { return cb_error_node; } x = cb_build_perform (CB_PERFORM_FOREVER); CB_PERFORM (x)->body = body; return x; } cb_tree cb_build_perform_exit (struct cb_label *label) { cb_tree x; x = cb_build_perform (CB_PERFORM_EXIT); CB_PERFORM (x)->data = CB_TREE (label); return x; } /* * READ statement */ void cb_emit_read (cb_tree ref, cb_tree next, cb_tree into, cb_tree key, cb_tree lock_opts) { int read_opts = 0; cb_tree file; cb_tree rec; if (lock_opts == cb_int1) { read_opts = COB_READ_LOCK; } else if (lock_opts == cb_int2) { read_opts = COB_READ_NO_LOCK; } else if (lock_opts == cb_int3) { read_opts = COB_READ_IGNORE_LOCK; } else if (lock_opts == cb_int4) { read_opts = COB_READ_WAIT_LOCK; } if (ref == cb_error_node) { return; } file = cb_ref (ref); if (file == cb_error_node) { return; } rec = cb_build_field_reference (CB_FILE (file)->record, ref); if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } if (next == cb_int1 || next == cb_int2 || CB_FILE (file)->access_mode == COB_ACCESS_SEQUENTIAL) { /* READ NEXT/PREVIOUS */ if (next == cb_int2) { if (CB_FILE (file)->organization != COB_ORG_INDEXED) { cb_error_x (CB_TREE (current_statement), _("READ PREVIOUS only allowed for INDEXED SEQUENTIAL files")); } read_opts |= COB_READ_PREVIOUS; } else { read_opts |= COB_READ_NEXT; } if (key) { cb_warning (_("KEY ignored with sequential READ")); } cb_emit (cb_build_funcall_4 ("cob_read", file, cb_int0, CB_FILE(file)->file_status, cb_int (read_opts))); } else { /* READ */ cb_emit (cb_build_funcall_4 ("cob_read", file, key ? key : CB_FILE (file)->key, CB_FILE(file)->file_status, cb_int (read_opts))); } if (into) { current_statement->handler3 = cb_build_move (rec, into); } current_statement->file = file; } /* * REWRITE statement */ void cb_emit_rewrite (cb_tree record, cb_tree from, cb_tree lockopt) { cb_tree file; int opts = 0; if (record == cb_error_node || cb_ref (record) == cb_error_node) { return; } if (!CB_REF_OR_FIELD_P (cb_ref (record))) { cb_error_x (CB_TREE (current_statement), _("REWRITE requires a record name as subject")); return; } if (cb_field (record)->storage != CB_STORAGE_FILE) { cb_error_x (CB_TREE (current_statement), _("REWRITE subject does not refer to a record name")); return; } file = CB_TREE (CB_FIELD (cb_ref (record))->file); current_statement->file = file; if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } else if (current_statement->handler_id == COB_EC_I_O_INVALID_KEY && (CB_FILE(file)->organization != COB_ORG_RELATIVE && CB_FILE(file)->organization != COB_ORG_INDEXED)) { cb_error_x (CB_TREE(current_statement), _("INVALID KEY clause invalid with this file type")); } else if ((CB_FILE (file)->lock_mode & COB_LOCK_AUTOMATIC) && lockopt) { cb_error_x (CB_TREE (current_statement), _("LOCK clause invalid with file LOCK AUTOMATIC")); } else if (lockopt == cb_int1) { opts = COB_WRITE_LOCK; } if (from) { cb_emit (cb_build_move (from, record)); } cb_emit (cb_build_funcall_4 ("cob_rewrite", file, record, cb_int (opts), CB_FILE(file)->file_status)); } /* * RELEASE statement */ void cb_emit_release (cb_tree record, cb_tree from) { struct cb_field *f; cb_tree file; if (record == cb_error_node) { return; } if (from == cb_error_node) { return; } if (cb_ref (record) == cb_error_node) { return; } if (!CB_REF_OR_FIELD_P (cb_ref (record))) { cb_error_x (CB_TREE (current_statement), _("RELEASE requires a record name as subject")); return; } if (cb_field (record)->storage != CB_STORAGE_FILE) { cb_error_x (CB_TREE (current_statement), _("RELEASE subject does not refer to a record name")); return; } f = CB_FIELD (cb_ref (record)); file = CB_TREE (f->file); if (CB_FILE (file)->organization != COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("RELEASE not allowed on this record item")); return; } current_statement->file = file; if (from) { cb_emit (cb_build_move (from, record)); } cb_emit (cb_build_funcall_1 ("cob_file_release", file)); } /* * RETURN statement */ void cb_emit_return (cb_tree ref, cb_tree into) { cb_tree file; cb_tree rec; if (ref == cb_error_node) { return; } if (into == cb_error_node) { return; } file = cb_ref (ref); if (file == cb_error_node) { return; } rec = cb_build_field_reference (CB_FILE (file)->record, ref); cb_emit (cb_build_funcall_1 ("cob_file_return", file)); if (into) { current_statement->handler3 = cb_build_move (rec, into); } current_statement->file = file; } /* * ROLLBACK statement */ void cb_emit_rollback (void) { cb_emit (cb_build_funcall_0 ("cob_rollback")); } /* * SEARCH statement */ static void search_set_keys (struct cb_field *f, cb_tree x) { struct cb_binary_op *p; int i; if (CB_REFERENCE_P (x)) { x = build_cond_88 (x); } p = CB_BINARY_OP (x); switch (p->op) { case '&': search_set_keys (f, p->x); search_set_keys (f, p->y); break; case '=': for (i = 0; i < f->nkeys; i++) { if (cb_field (p->x) == cb_field (f->keys[i].key)) { f->keys[i].ref = p->x; f->keys[i].val = p->y; break; } } if (i == f->nkeys) { cb_error_x (x, _("Undeclared key '%s'"), cb_field (p->x)->name); } break; default: cb_error_x (x, _("Invalid SEARCH ALL condition")); break; } } static cb_tree cb_build_search_all (cb_tree table, cb_tree cond) { cb_tree c1 = NULL; cb_tree c2; struct cb_field *f; int i; f = cb_field (table); /* set keys */ for (i = 0; i < f->nkeys; i++) { f->keys[i].ref = NULL; } search_set_keys (f, cond); /* build condition */ for (i = 0; i < f->nkeys; i++) { if (f->keys[i].ref) { if (f->keys[i].dir == COB_ASCENDING) { c2 = cb_build_binary_op (f->keys[i].ref, '=', f->keys[i].val); } else { c2 = cb_build_binary_op (f->keys[i].val, '=', f->keys[i].ref); } if (c1 == NULL) { c1 = c2; } else { c1 = cb_build_binary_op (c1, '&', c2); } } } return cb_build_cond (c1); } void cb_emit_search (cb_tree table, cb_tree varying, cb_tree at_end, cb_tree whens) { if (cb_validate_one (table)) { return; } if (cb_validate_one (varying)) { return; } if (table == cb_error_node) { return; } cb_emit (cb_build_search (0, table, varying, at_end, whens)); } void cb_emit_search_all (cb_tree table, cb_tree at_end, cb_tree when, cb_tree stmts) { if (cb_validate_one (table)) { return; } if (table == cb_error_node) { return; } cb_emit (cb_build_search (1, table, NULL, at_end, cb_build_if (cb_build_search_all (table, when), stmts, NULL))); } /* * SET statement */ void cb_emit_setenv (cb_tree x, cb_tree y) { cb_emit (cb_build_funcall_2 ("cob_set_environment", x, y)); } void cb_emit_set_to (cb_tree vars, cb_tree x) { cb_tree l; cb_tree v; struct cb_cast *p; #if 0 enum cb_class class = CB_CLASS_UNKNOWN; #endif if (cb_validate_one (x)) { return; } if (cb_validate_list (vars)) { return; } #if 0 /* determine the class of targets */ for (l = vars; l; l = CB_CHAIN (l)) { if (CB_TREE_CLASS (CB_VALUE (l)) != CB_CLASS_UNKNOWN) { if (class == CB_CLASS_UNKNOWN) { class = CB_TREE_CLASS (CB_VALUE (l)); } else if (class != CB_TREE_CLASS (CB_VALUE (l))) { break; } } } if (l || (class != CB_CLASS_INDEX && class != CB_CLASS_POINTER)) { cb_error_x (CB_TREE (current_statement), _("The targets of SET must be either indexes or pointers")); return; } #endif if (CB_CAST_P (x)) { p = CB_CAST (x); if (p->type == CB_CAST_PROGRAM_POINTER) { for (l = vars; l; l = CB_CHAIN (l)) { v = CB_VALUE (l); if (!CB_REFERENCE_P (v)) { cb_error_x (CB_TREE (current_statement), _("SET targets must be PROGRAM-POINTER")); CB_VALUE (l) = cb_error_node; } else if (CB_FIELD(cb_ref(v))->usage != CB_USAGE_PROGRAM_POINTER) { cb_error_x (CB_TREE (current_statement), _("SET targets must be PROGRAM-POINTER")); CB_VALUE (l) = cb_error_node; } } } } /* validate the targets */ for (l = vars; l; l = CB_CHAIN (l)) { v = CB_VALUE (l); if (CB_CAST_P (v)) { p = CB_CAST (v); if (p->type == CB_CAST_ADDRESS && !CB_FIELD (cb_ref (p->val))->flag_item_based && CB_FIELD (cb_ref (p->val))->storage != CB_STORAGE_LINKAGE) { cb_error_x (p->val, _("The address of '%s' cannot be changed"), cb_name (p->val)); CB_VALUE (l) = cb_error_node; } } } if (cb_validate_list (vars)) { return; } for (l = vars; l; l = CB_CHAIN (l)) { cb_emit (cb_build_move (x, CB_VALUE (l))); } } void cb_emit_set_up_down (cb_tree l, cb_tree flag, cb_tree x) { if (cb_validate_one (x)) { return; } if (cb_validate_list (l)) { return; } for (; l; l = CB_CHAIN (l)) { if (flag == cb_int0) { cb_emit (cb_build_add (CB_VALUE (l), x, cb_int0)); } else { cb_emit (cb_build_sub (CB_VALUE (l), x, cb_int0)); } } } void cb_emit_set_on_off (cb_tree l, cb_tree flag) { struct cb_system_name *s; if (cb_validate_list (l)) { return; } for (; l; l = CB_CHAIN (l)) { s = CB_SYSTEM_NAME (cb_ref (CB_VALUE (l))); cb_emit (cb_build_funcall_2 ("cob_set_switch", cb_int (s->token), flag)); } } void cb_emit_set_true (cb_tree l) { cb_tree x; struct cb_field *f; cb_tree ref; cb_tree val; for (; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x == cb_error_node) { return; } if (!(CB_REFERENCE_P (x) && CB_FIELD_P(CB_REFERENCE(x)->value)) && !CB_FIELD_P (x)) { cb_error_x (x, _("Invalid SET statement")); return; } f = cb_field (x); if (f->level != 88) { cb_error_x (x, _("Invalid SET statement")); return; } ref = cb_build_field_reference (f->parent, x); val = CB_VALUE (f->values); if (CB_PAIR_P (val)) { val = CB_PAIR_X (val); } cb_emit (cb_build_move (val, ref)); } } void cb_emit_set_false (cb_tree l) { cb_tree x; struct cb_field *f; cb_tree ref; cb_tree val; for (; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x == cb_error_node) { return; } if (!(CB_REFERENCE_P (x) && CB_FIELD_P(CB_REFERENCE(x)->value)) && !CB_FIELD_P (x)) { cb_error_x (x, _("Invalid SET statement")); return; } f = cb_field (x); if (f->level != 88) { cb_error_x (x, _("Invalid SET statement")); return; } if (!f->false_88) { cb_error_x (x, _("Field does not have FALSE clause")); return; } ref = cb_build_field_reference (f->parent, x); val = CB_VALUE (f->false_88); if (CB_PAIR_P (val)) { val = CB_PAIR_X (val); } cb_emit (cb_build_move (val, ref)); } } /* * SORT statement */ void cb_emit_sort_init (cb_tree name, cb_tree keys, cb_tree col) { cb_tree l; struct cb_field *f; if (cb_validate_list (keys)) { return; } for (l = keys; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) == NULL) { CB_VALUE (l) = name; } cb_ref (CB_VALUE (l)); } if (CB_FILE_P (cb_ref (name))) { if (CB_FILE (cb_ref (name))->organization != COB_ORG_SORT) { cb_error_x (name, _("Invalid SORT filename")); } cb_field (current_program->cb_sort_return)->count++; cb_emit (cb_build_funcall_5 ("cob_file_sort_init", cb_ref (name), cb_int (cb_list_length (keys)), col, cb_build_cast_address (current_program->cb_sort_return), CB_FILE(cb_ref (name))->file_status)); for (l = keys; l; l = CB_CHAIN (l)) { cb_emit (cb_build_funcall_4 ("cob_file_sort_init_key", cb_ref (name), CB_PURPOSE (l), CB_VALUE (l), cb_int (cb_field (CB_VALUE(l))->offset))); } } else { f = CB_FIELD (cb_ref (name)); if (keys == NULL) { cb_error_x (name, _("Table sort without keys not implemented yet")); } cb_emit (cb_build_funcall_2 ("cob_table_sort_init", cb_int (cb_list_length (keys)), col)); for (l = keys; l; l = CB_CHAIN (l)) { cb_emit (cb_build_funcall_3 ("cob_table_sort_init_key", CB_PURPOSE (l), CB_VALUE (l), cb_int (cb_field (CB_VALUE(l))->offset))); } cb_emit (cb_build_funcall_2 ("cob_table_sort", name, (f->occurs_depending ? cb_build_cast_integer (f->occurs_depending) : cb_int (f->occurs_max)))); } } void cb_emit_sort_using (cb_tree file, cb_tree l) { if (cb_validate_list (l)) { return; } for (; l; l = CB_CHAIN (l)) { if (CB_FILE (cb_ref(CB_VALUE(l)))->organization == COB_ORG_SORT) { cb_error (_("Invalid SORT USING parameter")); } cb_emit (cb_build_funcall_2 ("cob_file_sort_using", cb_ref (file), cb_ref (CB_VALUE (l)))); } } void cb_emit_sort_input (cb_tree proc) { cb_emit (cb_build_perform_once (proc)); } void cb_emit_sort_giving (cb_tree file, cb_tree l) { cb_tree p; int listlen; if (cb_validate_list (l)) { return; } for (p = l; p; p = CB_CHAIN (p)) { if (CB_FILE (cb_ref(CB_VALUE(p)))->organization == COB_ORG_SORT) { cb_error (_("Invalid SORT GIVING parameter")); } } listlen = cb_list_length (l); p = cb_build_funcall_2 ("cob_file_sort_giving", cb_ref (file), l); CB_FUNCALL(p)->varcnt = listlen; cb_emit (p); } void cb_emit_sort_output (cb_tree proc) { cb_emit (cb_build_perform_once (proc)); } void cb_emit_sort_finish (cb_tree file) { if (CB_FILE_P (cb_ref (file))) { cb_emit (cb_build_funcall_1 ("cob_file_sort_close", cb_ref (file))); } } /* * START statement */ void cb_emit_start (cb_tree file, cb_tree op, cb_tree key) { if (cb_validate_one (key)) { return; } if (file != cb_error_node) { current_statement->file = cb_ref (file); cb_emit (cb_build_funcall_4 ("cob_start", cb_ref (file), op, key ? key : CB_FILE (cb_ref (file))->key, CB_FILE(cb_ref(file))->file_status)); } } /* * STOP statement */ void cb_emit_stop_run (cb_tree x) { cb_emit (cb_build_funcall_1 ("cob_stop_run", cb_build_cast_integer (x))); } /* * STRING statement */ void cb_emit_string (cb_tree items, cb_tree into, cb_tree pointer) { cb_tree start; cb_tree l; cb_tree end; cb_tree dlm; if (cb_validate_one (into)) { return; } if (cb_validate_one (pointer)) { return; } start = items; cb_emit (cb_build_funcall_2 ("cob_string_init", into, pointer)); while (start) { /* find DELIMITED item */ for (end = start; end; end = CB_CHAIN (end)) { if (CB_PAIR_P (CB_VALUE (end))) { break; } } /* cob_string_delimited */ dlm = end ? CB_PAIR_X (CB_VALUE (end)) : cb_int0; cb_emit (cb_build_funcall_1 ("cob_string_delimited", dlm)); /* cob_string_append */ for (l = start; l != end; l = CB_CHAIN (l)) { cb_emit (cb_build_funcall_1 ("cob_string_append", CB_VALUE (l))); } start = end ? CB_CHAIN (end) : NULL; } cb_emit (cb_build_funcall_0 ("cob_string_finish")); } /* * UNLOCK statement */ void cb_emit_unlock (cb_tree ref) { cb_tree file; if (ref != cb_error_node) { file = cb_ref (ref); cb_emit (cb_build_funcall_2 ("cob_unlock_file", file, CB_FILE(file)->file_status)); current_statement->file = file; } } /* * UNSTRING statement */ void cb_emit_unstring (cb_tree name, cb_tree delimited, cb_tree into, cb_tree pointer, cb_tree tallying) { if (cb_validate_one (name)) { return; } if (cb_validate_one (tallying)) { return; } if (cb_validate_list (delimited)) { return; } if (cb_validate_list (into)) { return; } cb_emit (cb_build_funcall_3 ("cob_unstring_init", name, pointer, cb_int (cb_list_length (delimited)))); cb_emit_list (delimited); cb_emit_list (into); if (tallying) { cb_emit (cb_build_funcall_1 ("cob_unstring_tallying", tallying)); } cb_emit (cb_build_funcall_0 ("cob_unstring_finish")); } cb_tree cb_build_unstring_delimited (cb_tree all, cb_tree value) { if (cb_validate_one (value)) { return cb_error_node; } return cb_build_funcall_2 ("cob_unstring_delimited", value, all); } cb_tree cb_build_unstring_into (cb_tree name, cb_tree delimiter, cb_tree count) { if (cb_validate_one (name)) { return cb_error_node; } if (delimiter == NULL) { delimiter = cb_int0; } if (count == NULL) { count = cb_int0; } return cb_build_funcall_3 ("cob_unstring_into", name, delimiter, count); } /* * WRITE statement */ void cb_emit_write (cb_tree record, cb_tree from, cb_tree opt, cb_tree lockopt) { cb_tree file; int val; if (record != cb_error_node && cb_ref (record) != cb_error_node) { if (!CB_REF_OR_FIELD_P (cb_ref (record))) { cb_error_x (CB_TREE (current_statement), _("WRITE requires a record name as subject")); return; } if (cb_field (record)->storage != CB_STORAGE_FILE) { cb_error_x (CB_TREE (current_statement), _("WRITE subject does not refer to a record name")); return; } file = CB_TREE (CB_FIELD (cb_ref (record))->file); current_statement->file = file; if (CB_FILE (file)->organization == COB_ORG_SORT) { cb_error_x (CB_TREE (current_statement), _("Operation not allowed on SORT files")); } else if (current_statement->handler_id == COB_EC_I_O_INVALID_KEY && (CB_FILE(file)->organization != COB_ORG_RELATIVE && CB_FILE(file)->organization != COB_ORG_INDEXED)) { cb_error_x (CB_TREE(current_statement), _("INVALID KEY clause invalid with this file type")); } else if (lockopt) { if ((CB_FILE (file)->lock_mode & COB_LOCK_AUTOMATIC)) { cb_error_x (CB_TREE (current_statement), _("LOCK clause invalid with file LOCK AUTOMATIC")); } else if (opt != cb_int0) { cb_error_x (CB_TREE (current_statement), _("LOCK clause invalid here")); } else if (lockopt == cb_int1) { opt = cb_int (COB_WRITE_LOCK); } } if (from) { cb_emit (cb_build_move (from, record)); } if (CB_FILE (file)->organization == COB_ORG_LINE_SEQUENTIAL && opt == cb_int0) { opt = cb_int (COB_WRITE_BEFORE | COB_WRITE_LINES | 1); } /* RXW - This is horrible */ if (current_statement->handler_id == COB_EC_I_O_EOP && current_statement->handler1) { if (CB_CAST_P(opt)) { val = CB_INTEGER(CB_BINARY_OP(CB_CAST(opt)->val)->x)->val; val |= COB_WRITE_EOP; CB_BINARY_OP(CB_CAST(opt)->val)->x = cb_int (val); } else { val = CB_INTEGER(opt)->val; val |= COB_WRITE_EOP; opt = cb_int (val); } } cb_emit (cb_build_funcall_4 ("cob_write", file, record, opt, CB_FILE(file)->file_status)); } } cb_tree cb_build_write_advancing_lines (cb_tree pos, cb_tree lines) { cb_tree e; int opt; opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER; e = cb_build_binary_op (cb_int (opt | COB_WRITE_LINES), '+', lines); return cb_build_cast_integer (e); } cb_tree cb_build_write_advancing_mnemonic (cb_tree pos, cb_tree mnemonic) { int opt; int token; token = CB_SYSTEM_NAME (cb_ref (mnemonic))->token; switch (token) { case CB_FEATURE_FORMFEED: opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER; return cb_int (opt | COB_WRITE_PAGE); case CB_FEATURE_C01: case CB_FEATURE_C02: case CB_FEATURE_C03: case CB_FEATURE_C04: case CB_FEATURE_C05: case CB_FEATURE_C06: case CB_FEATURE_C07: case CB_FEATURE_C08: case CB_FEATURE_C09: case CB_FEATURE_C10: case CB_FEATURE_C11: case CB_FEATURE_C12: opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER; return cb_int (opt | COB_WRITE_CHANNEL | COB_WRITE_PAGE | token); default: cb_error_x (mnemonic, _("Invalid mnemonic name")); return cb_error_node; } } cb_tree cb_build_write_advancing_page (cb_tree pos) { int opt = (pos == CB_BEFORE) ? COB_WRITE_BEFORE : COB_WRITE_AFTER; return cb_int (opt | COB_WRITE_PAGE); } open-cobol-1.1/cobc/parser.c0000644000000000000000000144625211142344365011426 /* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* 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. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOKEN_EOF = 0, ACCEPT = 258, ACCESS = 259, ADD = 260, ADDRESS = 261, ADVANCING = 262, AFTER = 263, ALL = 264, ALLOCATE = 265, ALPHABET = 266, ALPHABETIC = 267, ALPHABETIC_LOWER = 268, ALPHABETIC_UPPER = 269, ALPHANUMERIC = 270, ALPHANUMERIC_EDITED = 271, ALSO = 272, ALTER = 273, ALTERNATE = 274, AND = 275, ANY = 276, ARE = 277, AREA = 278, ARGUMENT_NUMBER = 279, ARGUMENT_VALUE = 280, AS = 281, ASCENDING = 282, ASSIGN = 283, AT = 284, AUTO = 285, AUTOMATIC = 286, BACKGROUND_COLOR = 287, BASED = 288, BEFORE = 289, BELL = 290, BINARY = 291, BINARY_C_LONG = 292, BINARY_CHAR = 293, BINARY_DOUBLE = 294, BINARY_LONG = 295, BINARY_SHORT = 296, BLANK = 297, BLANK_LINE = 298, BLANK_SCREEN = 299, BLINK = 300, BLOCK = 301, BOTTOM = 302, BY = 303, BYTE_LENGTH = 304, CALL = 305, CANCEL = 306, CH = 307, CHAINING = 308, CHARACTER = 309, CHARACTERS = 310, CLASS = 311, CLOSE = 312, CODE = 313, CODE_SET = 314, COLLATING = 315, COL = 316, COLS = 317, COLUMN = 318, COLUMNS = 319, COMMA = 320, COMMAND_LINE = 321, COMMA_DELIM = 322, COMMIT = 323, COMMON = 324, COMP = 325, COMPUTE = 326, COMP_1 = 327, COMP_2 = 328, COMP_3 = 329, COMP_4 = 330, COMP_5 = 331, COMP_X = 332, CONCATENATE_FUNC = 333, CONFIGURATION = 334, CONSTANT = 335, CONTAINS = 336, CONTENT = 337, CONTINUE = 338, CONTROL = 339, CONTROLS = 340, CONTROL_FOOTING = 341, CONTROL_HEADING = 342, CONVERTING = 343, CORRESPONDING = 344, COUNT = 345, CRT = 346, CURRENCY = 347, CURRENT_DATE_FUNC = 348, CURSOR = 349, CYCLE = 350, DATA = 351, DATE = 352, DAY = 353, DAY_OF_WEEK = 354, DE = 355, DEBUGGING = 356, DECIMAL_POINT = 357, DECLARATIVES = 358, DEFAULT = 359, DELETE = 360, DELIMITED = 361, DELIMITER = 362, DEPENDING = 363, DESCENDING = 364, DETAIL = 365, DISK = 366, DISPLAY = 367, DIVIDE = 368, DIVISION = 369, DOWN = 370, DUPLICATES = 371, DYNAMIC = 372, EBCDIC = 373, ELSE = 374, END = 375, END_ACCEPT = 376, END_ADD = 377, END_CALL = 378, END_COMPUTE = 379, END_DELETE = 380, END_DISPLAY = 381, END_DIVIDE = 382, END_EVALUATE = 383, END_FUNCTION = 384, END_IF = 385, END_MULTIPLY = 386, END_PERFORM = 387, END_PROGRAM = 388, END_READ = 389, END_RETURN = 390, END_REWRITE = 391, END_SEARCH = 392, END_START = 393, END_STRING = 394, END_SUBTRACT = 395, END_UNSTRING = 396, END_WRITE = 397, ENTRY = 398, ENVIRONMENT = 399, ENVIRONMENT_NAME = 400, ENVIRONMENT_VALUE = 401, EOL = 402, EOP = 403, EOS = 404, EQUAL = 405, EQUALS = 406, ERASE = 407, ERROR = 408, ESCAPE = 409, EVALUATE = 410, EVENT_STATUS = 411, EXCEPTION = 412, EXCLUSIVE = 413, EXIT = 414, EXTEND = 415, EXTERNAL = 416, FD = 417, FILE_CONTROL = 418, FILE_ID = 419, FILLER = 420, FINAL = 421, FIRST = 422, FOOTING = 423, FOR = 424, FOREGROUND_COLOR = 425, FOREVER = 426, FREE = 427, FROM = 428, FULL = 429, FUNCTION = 430, FUNCTION_ID = 431, FUNCTION_NAME = 432, GE = 433, GENERATE = 434, GIVING = 435, GLOBAL = 436, GO = 437, GOBACK = 438, GREATER = 439, GROUP = 440, HEADING = 441, HIGHLIGHT = 442, HIGH_VALUE = 443, IDENTIFICATION = 444, IF = 445, IGNORE = 446, IGNORING = 447, IN = 448, INDEX = 449, INDEXED = 450, INDICATE = 451, INITIALIZE = 452, INITIALIZED = 453, INITIATE = 454, INPUT = 455, INPUT_OUTPUT = 456, INSPECT = 457, INTO = 458, INTRINSIC = 459, INVALID = 460, INVALID_KEY = 461, IS = 462, I_O = 463, I_O_CONTROL = 464, JUSTIFIED = 465, KEY = 466, LABEL = 467, LAST = 468, LAST_DETAIL = 469, LE = 470, LEADING = 471, LEFT = 472, LENGTH = 473, LESS = 474, LIMIT = 475, LIMITS = 476, LINAGE = 477, LINAGE_COUNTER = 478, LINE = 479, LINES = 480, LINKAGE = 481, LITERAL = 482, LOCALE = 483, LOCALE_DT_FUNC = 484, LOCAL_STORAGE = 485, LOCK = 486, LOWER_CASE_FUNC = 487, LOWLIGHT = 488, LOW_VALUE = 489, MANUAL = 490, MEMORY = 491, MERGE = 492, MINUS = 493, MNEMONIC_NAME = 494, MODE = 495, MOVE = 496, MULTIPLE = 497, MULTIPLY = 498, NATIONAL = 499, NATIONAL_EDITED = 500, NATIVE = 501, NE = 502, NEGATIVE = 503, NEXT = 504, NEXT_SENTENCE = 505, NO = 506, NOT = 507, NOT_END = 508, NOT_EOP = 509, NOT_EXCEPTION = 510, NOT_INVALID_KEY = 511, NOT_OVERFLOW = 512, NOT_SIZE_ERROR = 513, NO_ADVANCING = 514, NUMBER = 515, NUMBERS = 516, NUMERIC = 517, NUMERIC_EDITED = 518, NUMVALC_FUNC = 519, OBJECT_COMPUTER = 520, OCCURS = 521, OF = 522, OFF = 523, OMITTED = 524, ON = 525, ONLY = 526, OPEN = 527, OPTIONAL = 528, OR = 529, ORDER = 530, ORGANIZATION = 531, OTHER = 532, OUTPUT = 533, OVERFLOW = 534, OVERLINE = 535, PACKED_DECIMAL = 536, PADDING = 537, PAGE = 538, PAGE_FOOTING = 539, PAGE_HEADING = 540, PARAGRAPH = 541, PERFORM = 542, PICTURE = 543, PLUS = 544, POINTER = 545, POSITION = 546, POSITIVE = 547, PRESENT = 548, PREVIOUS = 549, PRINTER = 550, PRINTING = 551, PROCEDURE = 552, PROCEDURES = 553, PROCEED = 554, PROGRAM = 555, PROGRAM_ID = 556, PROGRAM_NAME = 557, PROGRAM_POINTER = 558, PROMPT = 559, QUOTE = 560, RANDOM = 561, RD = 562, READ = 563, RECORD = 564, RECORDING = 565, RECORDS = 566, RECURSIVE = 567, REDEFINES = 568, REEL = 569, REFERENCE = 570, RELATIVE = 571, RELEASE = 572, REMAINDER = 573, REMOVAL = 574, RENAMES = 575, REPLACING = 576, REPORT = 577, REPORTING = 578, REPORTS = 579, REPORT_FOOTING = 580, REPORT_HEADING = 581, REPOSITORY = 582, REQUIRED = 583, RESERVE = 584, RETURN = 585, RETURNING = 586, REVERSE_FUNC = 587, REVERSE_VIDEO = 588, REWIND = 589, REWRITE = 590, RIGHT = 591, ROLLBACK = 592, ROUNDED = 593, RUN = 594, SAME = 595, SCREEN = 596, SCREEN_CONTROL = 597, SCROLL = 598, SD = 599, SEARCH = 600, SECTION = 601, SECURE = 602, SEGMENT_LIMIT = 603, SELECT = 604, SEMI_COLON = 605, SENTENCE = 606, SEPARATE = 607, SEQUENCE = 608, SEQUENTIAL = 609, SET = 610, SHARING = 611, SIGN = 612, SIGNED = 613, SIGNED_INT = 614, SIGNED_LONG = 615, SIGNED_SHORT = 616, SIZE = 617, SIZE_ERROR = 618, SORT = 619, SORT_MERGE = 620, SOURCE = 621, SOURCE_COMPUTER = 622, SPACE = 623, SPECIAL_NAMES = 624, STANDARD = 625, STANDARD_1 = 626, STANDARD_2 = 627, START = 628, STATUS = 629, STOP = 630, STRING = 631, SUBSTITUTE_FUNC = 632, SUBSTITUTE_CASE_FUNC = 633, SUBTRACT = 634, SUM = 635, SUPPRESS = 636, SYMBOLIC = 637, SYNCHRONIZED = 638, TALLYING = 639, TAPE = 640, TERMINATE = 641, TEST = 642, THAN = 643, THEN = 644, THRU = 645, TIME = 646, TIMES = 647, TO = 648, TOK_FALSE = 649, TOK_FILE = 650, TOK_INITIAL = 651, TOK_NULL = 652, TOK_TRUE = 653, TOP = 654, TRAILING = 655, TRANSFORM = 656, TRIM_FUNCTION = 657, TYPE = 658, UNDERLINE = 659, UNIT = 660, UNLOCK = 661, UNSIGNED = 662, UNSIGNED_INT = 663, UNSIGNED_LONG = 664, UNSIGNED_SHORT = 665, UNSTRING = 666, UNTIL = 667, UP = 668, UPDATE = 669, UPON = 670, UPON_ARGUMENT_NUMBER = 671, UPON_COMMAND_LINE = 672, UPON_ENVIRONMENT_NAME = 673, UPON_ENVIRONMENT_VALUE = 674, UPPER_CASE_FUNC = 675, USAGE = 676, USE = 677, USING = 678, VALUE = 679, VARYING = 680, WAIT = 681, WHEN = 682, WHEN_COMPILED_FUNC = 683, WITH = 684, WORD = 685, WORDS = 686, WORKING_STORAGE = 687, WRITE = 688, YYYYDDD = 689, YYYYMMDD = 690, ZERO = 691, UNARY_SIGN = 692 }; #endif #define TOKEN_EOF 0 #define ACCEPT 258 #define ACCESS 259 #define ADD 260 #define ADDRESS 261 #define ADVANCING 262 #define AFTER 263 #define ALL 264 #define ALLOCATE 265 #define ALPHABET 266 #define ALPHABETIC 267 #define ALPHABETIC_LOWER 268 #define ALPHABETIC_UPPER 269 #define ALPHANUMERIC 270 #define ALPHANUMERIC_EDITED 271 #define ALSO 272 #define ALTER 273 #define ALTERNATE 274 #define AND 275 #define ANY 276 #define ARE 277 #define AREA 278 #define ARGUMENT_NUMBER 279 #define ARGUMENT_VALUE 280 #define AS 281 #define ASCENDING 282 #define ASSIGN 283 #define AT 284 #define AUTO 285 #define AUTOMATIC 286 #define BACKGROUND_COLOR 287 #define BASED 288 #define BEFORE 289 #define BELL 290 #define BINARY 291 #define BINARY_C_LONG 292 #define BINARY_CHAR 293 #define BINARY_DOUBLE 294 #define BINARY_LONG 295 #define BINARY_SHORT 296 #define BLANK 297 #define BLANK_LINE 298 #define BLANK_SCREEN 299 #define BLINK 300 #define BLOCK 301 #define BOTTOM 302 #define BY 303 #define BYTE_LENGTH 304 #define CALL 305 #define CANCEL 306 #define CH 307 #define CHAINING 308 #define CHARACTER 309 #define CHARACTERS 310 #define CLASS 311 #define CLOSE 312 #define CODE 313 #define CODE_SET 314 #define COLLATING 315 #define COL 316 #define COLS 317 #define COLUMN 318 #define COLUMNS 319 #define COMMA 320 #define COMMAND_LINE 321 #define COMMA_DELIM 322 #define COMMIT 323 #define COMMON 324 #define COMP 325 #define COMPUTE 326 #define COMP_1 327 #define COMP_2 328 #define COMP_3 329 #define COMP_4 330 #define COMP_5 331 #define COMP_X 332 #define CONCATENATE_FUNC 333 #define CONFIGURATION 334 #define CONSTANT 335 #define CONTAINS 336 #define CONTENT 337 #define CONTINUE 338 #define CONTROL 339 #define CONTROLS 340 #define CONTROL_FOOTING 341 #define CONTROL_HEADING 342 #define CONVERTING 343 #define CORRESPONDING 344 #define COUNT 345 #define CRT 346 #define CURRENCY 347 #define CURRENT_DATE_FUNC 348 #define CURSOR 349 #define CYCLE 350 #define DATA 351 #define DATE 352 #define DAY 353 #define DAY_OF_WEEK 354 #define DE 355 #define DEBUGGING 356 #define DECIMAL_POINT 357 #define DECLARATIVES 358 #define DEFAULT 359 #define DELETE 360 #define DELIMITED 361 #define DELIMITER 362 #define DEPENDING 363 #define DESCENDING 364 #define DETAIL 365 #define DISK 366 #define DISPLAY 367 #define DIVIDE 368 #define DIVISION 369 #define DOWN 370 #define DUPLICATES 371 #define DYNAMIC 372 #define EBCDIC 373 #define ELSE 374 #define END 375 #define END_ACCEPT 376 #define END_ADD 377 #define END_CALL 378 #define END_COMPUTE 379 #define END_DELETE 380 #define END_DISPLAY 381 #define END_DIVIDE 382 #define END_EVALUATE 383 #define END_FUNCTION 384 #define END_IF 385 #define END_MULTIPLY 386 #define END_PERFORM 387 #define END_PROGRAM 388 #define END_READ 389 #define END_RETURN 390 #define END_REWRITE 391 #define END_SEARCH 392 #define END_START 393 #define END_STRING 394 #define END_SUBTRACT 395 #define END_UNSTRING 396 #define END_WRITE 397 #define ENTRY 398 #define ENVIRONMENT 399 #define ENVIRONMENT_NAME 400 #define ENVIRONMENT_VALUE 401 #define EOL 402 #define EOP 403 #define EOS 404 #define EQUAL 405 #define EQUALS 406 #define ERASE 407 #define ERROR 408 #define ESCAPE 409 #define EVALUATE 410 #define EVENT_STATUS 411 #define EXCEPTION 412 #define EXCLUSIVE 413 #define EXIT 414 #define EXTEND 415 #define EXTERNAL 416 #define FD 417 #define FILE_CONTROL 418 #define FILE_ID 419 #define FILLER 420 #define FINAL 421 #define FIRST 422 #define FOOTING 423 #define FOR 424 #define FOREGROUND_COLOR 425 #define FOREVER 426 #define FREE 427 #define FROM 428 #define FULL 429 #define FUNCTION 430 #define FUNCTION_ID 431 #define FUNCTION_NAME 432 #define GE 433 #define GENERATE 434 #define GIVING 435 #define GLOBAL 436 #define GO 437 #define GOBACK 438 #define GREATER 439 #define GROUP 440 #define HEADING 441 #define HIGHLIGHT 442 #define HIGH_VALUE 443 #define IDENTIFICATION 444 #define IF 445 #define IGNORE 446 #define IGNORING 447 #define IN 448 #define INDEX 449 #define INDEXED 450 #define INDICATE 451 #define INITIALIZE 452 #define INITIALIZED 453 #define INITIATE 454 #define INPUT 455 #define INPUT_OUTPUT 456 #define INSPECT 457 #define INTO 458 #define INTRINSIC 459 #define INVALID 460 #define INVALID_KEY 461 #define IS 462 #define I_O 463 #define I_O_CONTROL 464 #define JUSTIFIED 465 #define KEY 466 #define LABEL 467 #define LAST 468 #define LAST_DETAIL 469 #define LE 470 #define LEADING 471 #define LEFT 472 #define LENGTH 473 #define LESS 474 #define LIMIT 475 #define LIMITS 476 #define LINAGE 477 #define LINAGE_COUNTER 478 #define LINE 479 #define LINES 480 #define LINKAGE 481 #define LITERAL 482 #define LOCALE 483 #define LOCALE_DT_FUNC 484 #define LOCAL_STORAGE 485 #define LOCK 486 #define LOWER_CASE_FUNC 487 #define LOWLIGHT 488 #define LOW_VALUE 489 #define MANUAL 490 #define MEMORY 491 #define MERGE 492 #define MINUS 493 #define MNEMONIC_NAME 494 #define MODE 495 #define MOVE 496 #define MULTIPLE 497 #define MULTIPLY 498 #define NATIONAL 499 #define NATIONAL_EDITED 500 #define NATIVE 501 #define NE 502 #define NEGATIVE 503 #define NEXT 504 #define NEXT_SENTENCE 505 #define NO 506 #define NOT 507 #define NOT_END 508 #define NOT_EOP 509 #define NOT_EXCEPTION 510 #define NOT_INVALID_KEY 511 #define NOT_OVERFLOW 512 #define NOT_SIZE_ERROR 513 #define NO_ADVANCING 514 #define NUMBER 515 #define NUMBERS 516 #define NUMERIC 517 #define NUMERIC_EDITED 518 #define NUMVALC_FUNC 519 #define OBJECT_COMPUTER 520 #define OCCURS 521 #define OF 522 #define OFF 523 #define OMITTED 524 #define ON 525 #define ONLY 526 #define OPEN 527 #define OPTIONAL 528 #define OR 529 #define ORDER 530 #define ORGANIZATION 531 #define OTHER 532 #define OUTPUT 533 #define OVERFLOW 534 #define OVERLINE 535 #define PACKED_DECIMAL 536 #define PADDING 537 #define PAGE 538 #define PAGE_FOOTING 539 #define PAGE_HEADING 540 #define PARAGRAPH 541 #define PERFORM 542 #define PICTURE 543 #define PLUS 544 #define POINTER 545 #define POSITION 546 #define POSITIVE 547 #define PRESENT 548 #define PREVIOUS 549 #define PRINTER 550 #define PRINTING 551 #define PROCEDURE 552 #define PROCEDURES 553 #define PROCEED 554 #define PROGRAM 555 #define PROGRAM_ID 556 #define PROGRAM_NAME 557 #define PROGRAM_POINTER 558 #define PROMPT 559 #define QUOTE 560 #define RANDOM 561 #define RD 562 #define READ 563 #define RECORD 564 #define RECORDING 565 #define RECORDS 566 #define RECURSIVE 567 #define REDEFINES 568 #define REEL 569 #define REFERENCE 570 #define RELATIVE 571 #define RELEASE 572 #define REMAINDER 573 #define REMOVAL 574 #define RENAMES 575 #define REPLACING 576 #define REPORT 577 #define REPORTING 578 #define REPORTS 579 #define REPORT_FOOTING 580 #define REPORT_HEADING 581 #define REPOSITORY 582 #define REQUIRED 583 #define RESERVE 584 #define RETURN 585 #define RETURNING 586 #define REVERSE_FUNC 587 #define REVERSE_VIDEO 588 #define REWIND 589 #define REWRITE 590 #define RIGHT 591 #define ROLLBACK 592 #define ROUNDED 593 #define RUN 594 #define SAME 595 #define SCREEN 596 #define SCREEN_CONTROL 597 #define SCROLL 598 #define SD 599 #define SEARCH 600 #define SECTION 601 #define SECURE 602 #define SEGMENT_LIMIT 603 #define SELECT 604 #define SEMI_COLON 605 #define SENTENCE 606 #define SEPARATE 607 #define SEQUENCE 608 #define SEQUENTIAL 609 #define SET 610 #define SHARING 611 #define SIGN 612 #define SIGNED 613 #define SIGNED_INT 614 #define SIGNED_LONG 615 #define SIGNED_SHORT 616 #define SIZE 617 #define SIZE_ERROR 618 #define SORT 619 #define SORT_MERGE 620 #define SOURCE 621 #define SOURCE_COMPUTER 622 #define SPACE 623 #define SPECIAL_NAMES 624 #define STANDARD 625 #define STANDARD_1 626 #define STANDARD_2 627 #define START 628 #define STATUS 629 #define STOP 630 #define STRING 631 #define SUBSTITUTE_FUNC 632 #define SUBSTITUTE_CASE_FUNC 633 #define SUBTRACT 634 #define SUM 635 #define SUPPRESS 636 #define SYMBOLIC 637 #define SYNCHRONIZED 638 #define TALLYING 639 #define TAPE 640 #define TERMINATE 641 #define TEST 642 #define THAN 643 #define THEN 644 #define THRU 645 #define TIME 646 #define TIMES 647 #define TO 648 #define TOK_FALSE 649 #define TOK_FILE 650 #define TOK_INITIAL 651 #define TOK_NULL 652 #define TOK_TRUE 653 #define TOP 654 #define TRAILING 655 #define TRANSFORM 656 #define TRIM_FUNCTION 657 #define TYPE 658 #define UNDERLINE 659 #define UNIT 660 #define UNLOCK 661 #define UNSIGNED 662 #define UNSIGNED_INT 663 #define UNSIGNED_LONG 664 #define UNSIGNED_SHORT 665 #define UNSTRING 666 #define UNTIL 667 #define UP 668 #define UPDATE 669 #define UPON 670 #define UPON_ARGUMENT_NUMBER 671 #define UPON_COMMAND_LINE 672 #define UPON_ENVIRONMENT_NAME 673 #define UPON_ENVIRONMENT_VALUE 674 #define UPPER_CASE_FUNC 675 #define USAGE 676 #define USE 677 #define USING 678 #define VALUE 679 #define VARYING 680 #define WAIT 681 #define WHEN 682 #define WHEN_COMPILED_FUNC 683 #define WITH 684 #define WORD 685 #define WORDS 686 #define WORKING_STORAGE 687 #define WRITE 688 #define YYYYDDD 689 #define YYYYMMDD 690 #define ZERO 691 #define UNARY_SIGN 692 /* Copy the first part of user declarations. */ #line 26 "parser.y" #include "config.h" #include #include #include "cobc.h" #include "tree.h" #define yyerror cb_error #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define PENDING(x) cb_warning (_("'%s' not implemented"), x) #define emit_statement(x) \ current_program->exec_list = cb_cons (x, current_program->exec_list) #define push_expr(type, node) \ current_expr = cb_build_list (cb_int (type), node, current_expr) #define TERM_NONE 0 #define TERM_ACCEPT 1 #define TERM_ADD 2 #define TERM_CALL 3 #define TERM_COMPUTE 4 #define TERM_DELETE 5 #define TERM_DISPLAY 6 #define TERM_DIVIDE 7 #define TERM_EVALUATE 8 #define TERM_IF 9 #define TERM_MULTIPLY 10 #define TERM_PERFORM 11 #define TERM_READ 12 #define TERM_RECEIVE 13 #define TERM_RETURN 14 #define TERM_REWRITE 15 #define TERM_SEARCH 16 #define TERM_START 17 #define TERM_STRING 18 #define TERM_SUBTRACT 19 #define TERM_UNSTRING 20 #define TERM_WRITE 21 #define TERM_MAX 22 /* Global variables */ struct cb_program *current_program = NULL; struct cb_statement *current_statement = NULL; struct cb_label *current_section = NULL; struct cb_label *current_paragraph = NULL; size_t functions_are_all = 0; int non_const_word = 0; /* Local variables */ static struct cb_statement *main_statement; static cb_tree current_expr; static struct cb_field *current_field; static struct cb_field *description_field; static struct cb_file *current_file; static enum cb_storage current_storage; static size_t check_unreached = 0; static int call_mode; static int size_mode; static cb_tree perform_stack = NULL; static cb_tree qualifier = NULL; static cb_tree fgc; static cb_tree bgc; static cb_tree scroll; static cb_tree save_tree_1; static cb_tree save_tree_2; static cb_tree dummy_tree; static size_t in_declaratives = 0; static size_t current_linage = 0; static size_t prog_end = 0; static size_t use_global_ind = 0; static size_t samearea = 1; static size_t organized_seen = 0; static size_t inspect_keyword = 0; static int next_label_id = 0; static int eval_level = 0; static int eval_inc = 0; static int eval_inc2 = 0; static int depth = 0; static int dispattrs = 0; static struct cb_file *linage_file; static cb_tree next_label_list = NULL; static char *stack_progid[32]; static int term_array[TERM_MAX]; static int eval_check[64][64]; /* Static functions */ static void BEGIN_STATEMENT (const char *name, const size_t term) { if (cb_warn_unreachable && check_unreached) { cb_warning (_("Unreachable statement")); } current_statement = cb_build_statement ((char *)name); CB_TREE (current_statement)->source_file = (unsigned char *)cb_source_file; CB_TREE (current_statement)->source_line = cb_source_line; emit_statement (CB_TREE (current_statement)); if (term) { term_array[term]++; } main_statement = current_statement; } static void BEGIN_IMPLICIT_STATEMENT (void) { current_statement = cb_build_statement (NULL); main_statement->body = cb_list_add (main_statement->body, CB_TREE (current_statement)); } static void emit_entry (const char *name, const int encode, cb_tree using_list) { cb_tree l; cb_tree label; cb_tree x; struct cb_field *f; int parmnum; char buff[256]; sprintf (buff, "E$%s", name); label = cb_build_label (cb_build_reference (buff), NULL); if (encode) { CB_LABEL (label)->name = (unsigned char *)(cb_encode_program_id (name)); CB_LABEL (label)->orig_name = (unsigned char *)name; } else { CB_LABEL (label)->name = (unsigned char *)name; CB_LABEL (label)->orig_name = (unsigned char *)current_program->orig_source_name; } CB_LABEL (label)->need_begin = 1; CB_LABEL (label)->is_entry = 1; emit_statement (label); parmnum = 1; for (l = using_list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x != cb_error_node && cb_ref (x) != cb_error_node) { f = CB_FIELD (cb_ref (x)); if (f->level != 01 && f->level != 77) { cb_error_x (x, _("'%s' not level 01 or 77"), cb_name (x)); } if (!current_program->flag_chained) { if (f->storage != CB_STORAGE_LINKAGE) { cb_error_x (x, _("'%s' is not in LINKAGE SECTION"), cb_name (x)); } if (f->flag_item_based || f->flag_external) { cb_error_x (x, _("'%s' can not be BASED/EXTERNAL"), cb_name (x)); } f->flag_is_pdiv_parm = 1; } else { if (f->storage != CB_STORAGE_WORKING) { cb_error_x (x, _("'%s' is not in WORKING-STORAGE SECTION"), cb_name (x)); } f->flag_chained = 1; f->param_num = parmnum; parmnum++; } if (f->redefines) { cb_error_x (x, _("'%s' REDEFINES field not allowed here"), cb_name (x)); } } } /* Check dangling LINKAGE items */ if (cb_warn_linkage) { for (f = current_program->linkage_storage; f; f = f->sister) { for (l = using_list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x != cb_error_node && cb_ref (x) != cb_error_node) { if (f == CB_FIELD (cb_ref (x))) { break; } } } if (!l && !f->redefines) { cb_warning (_("LINKAGE item '%s' is not a PROCEDURE USING parameter"), f->name); } } } for (l = current_program->entry_list; l; l = CB_CHAIN (l)) { if (strcmp ((const char *)name, (const char *)(CB_LABEL(CB_PURPOSE(l))->name)) == 0) { cb_error_x (CB_TREE (current_statement), _("ENTRY '%s' duplicated"), name); } } current_program->entry_list = cb_list_append (current_program->entry_list, cb_build_pair (label, using_list)); } static void terminator_warning (const size_t termid) { check_unreached = 0; if (cb_warn_terminator && term_array[termid]) { cb_warning_x (CB_TREE (current_statement), _("%s statement not terminated by END-%s"), current_statement->name, current_statement->name); } if (term_array[termid]) { term_array[termid]--; } } static void terminator_error (void) { check_unreached = 0; cb_error_x (CB_TREE (current_statement), _("%s statement not terminated by END-%s"), current_statement->name, current_statement->name); } static void terminator_clear (const size_t termid) { check_unreached = 0; if (term_array[termid]) { term_array[termid]--; } } static int literal_value (cb_tree x) { if (x == cb_space) { return ' '; } else if (x == cb_zero) { return '0'; } else if (x == cb_quote) { return '"'; } else if (x == cb_null) { return 0; } else if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { return cb_get_int (x); } else { return CB_LITERAL (x)->data[0]; } } static void setup_use_file (struct cb_file *fileptr) { struct cb_file *newptr; if (fileptr->organization == COB_ORG_SORT) { cb_error (_("USE statement invalid for SORT file")); } if (fileptr->global) { newptr = cobc_malloc (sizeof(struct cb_file)); *newptr = *fileptr; newptr->handler = current_section; newptr->handler_prog = current_program; if (!use_global_ind) { current_program->local_file_list = cb_list_add (current_program->local_file_list, CB_TREE (newptr)); } else { current_program->global_file_list = cb_list_add (current_program->global_file_list, CB_TREE (newptr)); } } else { fileptr->handler = current_section; } } /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 1244 "parser.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* 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) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 5462 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 451 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 690 /* YYNRULES -- Number of rules. */ #define YYNRULES 1518 /* YYNRULES -- Number of states. */ #define YYNSTATES 2240 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 692 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned short 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, 2, 2, 2, 450, 2, 445, 446, 439, 437, 2, 438, 443, 440, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 449, 2, 448, 444, 447, 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, 442, 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, 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, 263, 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, 355, 356, 357, 358, 359, 360, 361, 362, 363, 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, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 441 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short yyprhs[] = { 0, 0, 3, 4, 7, 9, 12, 14, 16, 17, 18, 27, 28, 29, 38, 39, 40, 48, 49, 51, 54, 55, 59, 63, 67, 68, 76, 82, 84, 86, 87, 90, 91, 95, 97, 100, 102, 104, 106, 107, 113, 114, 119, 120, 123, 125, 127, 129, 131, 135, 136, 139, 143, 146, 150, 152, 156, 157, 160, 164, 167, 169, 172, 174, 176, 178, 184, 186, 188, 193, 197, 201, 202, 205, 207, 210, 214, 218, 220, 223, 227, 228, 231, 233, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 262, 263, 269, 270, 276, 278, 280, 281, 287, 289, 291, 293, 295, 297, 299, 302, 304, 308, 309, 314, 316, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 348, 352, 354, 357, 359, 362, 367, 369, 372, 374, 378, 383, 388, 392, 396, 401, 405, 409, 410, 416, 417, 422, 423, 428, 429, 433, 434, 437, 438, 445, 446, 449, 451, 453, 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, 475, 481, 486, 487, 489, 491, 492, 494, 496, 498, 500, 502, 507, 509, 511, 513, 520, 524, 530, 531, 533, 535, 540, 543, 546, 548, 549, 554, 560, 563, 565, 567, 571, 573, 575, 579, 581, 584, 589, 594, 599, 601, 605, 610, 615, 619, 623, 626, 629, 632, 633, 637, 638, 641, 643, 646, 648, 650, 656, 657, 659, 661, 663, 669, 671, 674, 677, 678, 681, 682, 692, 693, 694, 700, 701, 705, 706, 709, 713, 716, 719, 721, 723, 724, 729, 730, 733, 736, 739, 741, 743, 745, 747, 749, 751, 753, 755, 757, 763, 764, 766, 768, 773, 780, 790, 791, 795, 796, 799, 800, 803, 807, 809, 811, 817, 823, 825, 827, 831, 837, 838, 841, 843, 845, 847, 853, 858, 862, 867, 871, 875, 879, 880, 881, 887, 888, 890, 891, 894, 898, 903, 906, 908, 909, 914, 916, 917, 919, 921, 923, 924, 927, 929, 933, 937, 944, 945, 948, 950, 952, 954, 956, 958, 960, 962, 964, 966, 968, 970, 972, 974, 976, 979, 983, 984, 987, 990, 992, 994, 998, 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1018, 1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1039, 1042, 1044, 1047, 1050, 1052, 1055, 1058, 1060, 1063, 1066, 1068, 1071, 1074, 1076, 1078, 1082, 1086, 1094, 1095, 1098, 1099, 1103, 1105, 1106, 1112, 1114, 1116, 1117, 1121, 1123, 1126, 1128, 1131, 1134, 1135, 1137, 1139, 1143, 1145, 1146, 1155, 1157, 1160, 1162, 1166, 1167, 1171, 1174, 1179, 1182, 1183, 1184, 1190, 1191, 1192, 1198, 1199, 1200, 1206, 1207, 1209, 1211, 1214, 1220, 1221, 1224, 1227, 1231, 1233, 1235, 1238, 1241, 1244, 1245, 1247, 1249, 1252, 1261, 1262, 1266, 1267, 1272, 1273, 1278, 1279, 1283, 1284, 1288, 1290, 1295, 1298, 1300, 1302, 1303, 1306, 1311, 1312, 1315, 1317, 1319, 1321, 1323, 1325, 1327, 1329, 1331, 1333, 1335, 1337, 1339, 1341, 1343, 1345, 1347, 1351, 1353, 1355, 1357, 1359, 1361, 1363, 1365, 1370, 1375, 1378, 1380, 1382, 1385, 1389, 1391, 1395, 1402, 1405, 1409, 1412, 1414, 1417, 1420, 1422, 1425, 1426, 1428, 1430, 1435, 1438, 1439, 1441, 1443, 1444, 1445, 1446, 1453, 1454, 1456, 1458, 1461, 1463, 1464, 1470, 1471, 1474, 1476, 1478, 1480, 1482, 1485, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 1506, 1508, 1514, 1520, 1524, 1528, 1530, 1532, 1534, 1536, 1538, 1540, 1542, 1545, 1548, 1551, 1552, 1554, 1556, 1558, 1560, 1561, 1563, 1565, 1567, 1569, 1573, 1574, 1575, 1576, 1586, 1587, 1588, 1592, 1593, 1597, 1599, 1602, 1607, 1608, 1611, 1614, 1615, 1619, 1623, 1628, 1632, 1633, 1635, 1636, 1639, 1640, 1641, 1649, 1650, 1653, 1655, 1657, 1659, 1662, 1665, 1667, 1672, 1675, 1677, 1679, 1680, 1682, 1683, 1684, 1688, 1689, 1692, 1695, 1697, 1699, 1701, 1703, 1705, 1707, 1709, 1711, 1713, 1715, 1717, 1719, 1721, 1723, 1725, 1727, 1729, 1731, 1733, 1735, 1737, 1739, 1741, 1743, 1745, 1747, 1749, 1751, 1753, 1755, 1757, 1759, 1761, 1763, 1765, 1767, 1769, 1771, 1773, 1775, 1777, 1779, 1781, 1783, 1785, 1787, 1789, 1791, 1793, 1794, 1799, 1804, 1809, 1813, 1817, 1821, 1826, 1830, 1835, 1839, 1843, 1847, 1852, 1858, 1862, 1867, 1871, 1875, 1876, 1880, 1884, 1887, 1890, 1893, 1897, 1901, 1905, 1906, 1909, 1911, 1914, 1916, 1918, 1920, 1922, 1924, 1926, 1928, 1932, 1936, 1940, 1944, 1946, 1948, 1950, 1952, 1954, 1956, 1957, 1959, 1960, 1965, 1970, 1976, 1983, 1984, 1987, 1988, 1990, 1991, 1995, 1999, 2005, 2006, 2009, 2012, 2013, 2019, 2020, 2023, 2024, 2033, 2034, 2035, 2039, 2041, 2044, 2047, 2051, 2052, 2055, 2058, 2061, 2062, 2065, 2068, 2069, 2070, 2074, 2075, 2076, 2080, 2081, 2083, 2084, 2088, 2089, 2092, 2093, 2097, 2098, 2102, 2103, 2105, 2109, 2113, 2116, 2118, 2120, 2121, 2126, 2131, 2132, 2134, 2136, 2138, 2140, 2142, 2143, 2150, 2151, 2153, 2154, 2159, 2163, 2167, 2171, 2175, 2181, 2182, 2185, 2188, 2191, 2194, 2195, 2198, 2201, 2203, 2206, 2208, 2210, 2213, 2216, 2218, 2220, 2222, 2224, 2226, 2230, 2234, 2238, 2242, 2244, 2246, 2247, 2249, 2250, 2255, 2260, 2267, 2274, 2283, 2292, 2293, 2295, 2296, 2301, 2302, 2308, 2310, 2314, 2316, 2318, 2320, 2323, 2325, 2328, 2329, 2333, 2334, 2335, 2340, 2343, 2347, 2349, 2353, 2356, 2358, 2360, 2362, 2363, 2366, 2367, 2369, 2370, 2374, 2375, 2377, 2379, 2382, 2384, 2386, 2387, 2391, 2392, 2396, 2397, 2403, 2404, 2408, 2409, 2412, 2413, 2414, 2423, 2427, 2428, 2429, 2433, 2434, 2436, 2437, 2445, 2446, 2449, 2450, 2454, 2458, 2459, 2462, 2464, 2467, 2472, 2474, 2476, 2478, 2480, 2482, 2484, 2486, 2487, 2489, 2490, 2494, 2495, 2500, 2502, 2504, 2506, 2508, 2511, 2513, 2515, 2517, 2518, 2522, 2524, 2527, 2530, 2533, 2535, 2537, 2539, 2542, 2545, 2547, 2550, 2555, 2558, 2559, 2561, 2563, 2565, 2567, 2572, 2578, 2579, 2584, 2585, 2587, 2588, 2592, 2593, 2597, 2601, 2606, 2607, 2612, 2617, 2624, 2625, 2627, 2628, 2632, 2633, 2639, 2641, 2643, 2645, 2647, 2648, 2652, 2653, 2657, 2660, 2661, 2665, 2668, 2669, 2674, 2677, 2678, 2680, 2682, 2686, 2687, 2689, 2692, 2696, 2700, 2701, 2705, 2707, 2711, 2719, 2720, 2731, 2732, 2735, 2736, 2739, 2742, 2746, 2750, 2753, 2754, 2758, 2759, 2761, 2763, 2764, 2766, 2767, 2772, 2773, 2781, 2782, 2784, 2785, 2793, 2794, 2797, 2801, 2802, 2804, 2806, 2807, 2812, 2817, 2818, 2826, 2827, 2830, 2831, 2832, 2837, 2839, 2842, 2843, 2848, 2849, 2851, 2852, 2856, 2858, 2860, 2862, 2864, 2866, 2871, 2876, 2880, 2885, 2887, 2889, 2891, 2894, 2898, 2900, 2903, 2907, 2911, 2912, 2916, 2917, 2925, 2926, 2932, 2933, 2936, 2937, 2940, 2941, 2945, 2946, 2949, 2954, 2955, 2958, 2963, 2964, 2965, 2973, 2974, 2979, 2982, 2985, 2988, 2991, 2994, 2995, 2997, 2998, 3003, 3006, 3007, 3010, 3013, 3014, 3023, 3025, 3028, 3030, 3034, 3038, 3039, 3043, 3044, 3046, 3047, 3052, 3057, 3064, 3071, 3072, 3074, 3077, 3078, 3080, 3081, 3085, 3086, 3094, 3095, 3100, 3101, 3103, 3105, 3106, 3116, 3117, 3121, 3123, 3127, 3130, 3133, 3136, 3140, 3141, 3145, 3146, 3150, 3151, 3155, 3156, 3158, 3160, 3162, 3164, 3173, 3174, 3176, 3178, 3180, 3182, 3184, 3186, 3187, 3189, 3190, 3192, 3194, 3196, 3198, 3200, 3202, 3204, 3205, 3207, 3213, 3215, 3218, 3224, 3225, 3234, 3235, 3238, 3239, 3244, 3248, 3252, 3254, 3256, 3257, 3259, 3261, 3262, 3264, 3267, 3270, 3271, 3272, 3276, 3277, 3278, 3282, 3285, 3286, 3287, 3291, 3292, 3293, 3297, 3300, 3301, 3302, 3306, 3307, 3308, 3312, 3314, 3316, 3319, 3320, 3324, 3325, 3329, 3331, 3333, 3336, 3337, 3341, 3342, 3346, 3347, 3349, 3351, 3353, 3356, 3357, 3361, 3362, 3366, 3367, 3371, 3373, 3375, 3376, 3379, 3381, 3384, 3387, 3389, 3391, 3393, 3395, 3397, 3399, 3401, 3403, 3405, 3407, 3409, 3411, 3413, 3415, 3417, 3419, 3421, 3423, 3425, 3427, 3429, 3431, 3433, 3435, 3437, 3440, 3442, 3444, 3447, 3449, 3452, 3454, 3460, 3462, 3468, 3470, 3474, 3475, 3477, 3479, 3481, 3485, 3489, 3493, 3497, 3500, 3503, 3507, 3511, 3513, 3517, 3519, 3522, 3525, 3527, 3529, 3531, 3534, 3536, 3538, 3541, 3543, 3544, 3547, 3549, 3551, 3553, 3557, 3559, 3561, 3564, 3566, 3567, 3569, 3571, 3573, 3575, 3577, 3580, 3582, 3586, 3588, 3591, 3593, 3597, 3601, 3605, 3610, 3614, 3616, 3618, 3620, 3622, 3626, 3630, 3634, 3636, 3638, 3640, 3642, 3644, 3646, 3648, 3650, 3652, 3654, 3656, 3658, 3660, 3662, 3664, 3666, 3668, 3670, 3672, 3674, 3676, 3679, 3682, 3686, 3688, 3692, 3696, 3701, 3707, 3709, 3711, 3714, 3716, 3720, 3722, 3724, 3726, 3728, 3730, 3732, 3734, 3737, 3740, 3746, 3752, 3758, 3764, 3770, 3776, 3782, 3787, 3793, 3796, 3797, 3802, 3808, 3809, 3813, 3814, 3816, 3818, 3822, 3826, 3828, 3832, 3834, 3838, 3839, 3840, 3842, 3843, 3845, 3846, 3848, 3849, 3851, 3853, 3854, 3856, 3857, 3859, 3860, 3862, 3863, 3866, 3868, 3870, 3873, 3876, 3879, 3881, 3884, 3886, 3887, 3889, 3890, 3892, 3893, 3895, 3896, 3898, 3899, 3901, 3902, 3904, 3905, 3907, 3908, 3910, 3911, 3913, 3914, 3916, 3917, 3919, 3920, 3922, 3923, 3925, 3926, 3928, 3929, 3931, 3932, 3934, 3935, 3937, 3939, 3940, 3942, 3943, 3945, 3947, 3948, 3950, 3951, 3953, 3954, 3956, 3957, 3959, 3960, 3962, 3963, 3965, 3968, 3969, 3971, 3972, 3974, 3975, 3977, 3978, 3980, 3981, 3983, 3984, 3986, 3987, 3989, 3992, 3993, 3995, 3996, 3998, 3999, 4001, 4002, 4004, 4005, 4007, 4008, 4010, 4011, 4013, 4014, 4016, 4017 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { 452, 0, -1, -1, 453, 454, -1, 455, -1, 454, 455, -1, 456, -1, 462, -1, -1, -1, 469, 477, 457, 572, 458, 706, 465, 466, -1, -1, -1, 469, 477, 460, 572, 461, 706, 465, 467, -1, -1, -1, 471, 477, 463, 572, 464, 706, 468, -1, -1, 459, -1, 465, 459, -1, -1, 133, 472, 443, -1, 133, 472, 443, -1, 129, 472, 443, -1, -1, 301, 443, 472, 473, 470, 474, 443, -1, 176, 443, 472, 473, 443, -1, 302, -1, 227, -1, -1, 26, 227, -1, -1, 1115, 475, 1126, -1, 69, -1, 69, 476, -1, 476, -1, 396, -1, 312, -1, -1, 144, 114, 443, 478, 529, -1, -1, 79, 346, 443, 479, -1, -1, 479, 480, -1, 481, -1, 485, -1, 498, -1, 493, -1, 367, 443, 482, -1, -1, 484, 443, -1, 484, 483, 443, -1, 483, 443, -1, 1140, 101, 240, -1, 430, -1, 265, 443, 486, -1, -1, 484, 443, -1, 484, 487, 443, -1, 487, 443, -1, 488, -1, 487, 488, -1, 489, -1, 491, -1, 492, -1, 236, 362, 1115, 1076, 490, -1, 55, -1, 431, -1, 1126, 1099, 1115, 1055, -1, 348, 1115, 1076, -1, 327, 443, 494, -1, -1, 495, 443, -1, 496, -1, 495, 496, -1, 175, 497, 204, -1, 175, 9, 204, -1, 227, -1, 497, 227, -1, 369, 443, 499, -1, -1, 500, 443, -1, 501, -1, 500, 501, -1, 502, -1, 506, -1, 515, -1, 522, -1, 519, -1, 523, -1, 524, -1, 525, -1, 526, -1, 527, -1, 528, -1, 430, 1115, 91, -1, -1, 430, 1115, 1058, 503, 504, -1, -1, 504, 505, 1133, 1115, 1058, -1, 270, -1, 268, -1, -1, 11, 1058, 507, 1115, 508, -1, 246, -1, 371, -1, 372, -1, 118, -1, 509, -1, 510, -1, 509, 510, -1, 513, -1, 513, 390, 513, -1, -1, 513, 17, 511, 512, -1, 514, -1, 512, 17, 514, -1, 227, -1, 368, -1, 436, -1, 305, -1, 188, -1, 234, -1, 227, -1, 368, -1, 436, -1, 305, -1, 188, -1, 234, -1, 382, 1108, 516, -1, 517, 1116, 518, -1, 1058, -1, 517, 1058, -1, 1076, -1, 518, 1076, -1, 56, 1058, 1115, 520, -1, 521, -1, 520, 521, -1, 1079, -1, 1079, 390, 1079, -1, 228, 1058, 1115, 1055, -1, 92, 1130, 1115, 227, -1, 102, 1115, 65, -1, 94, 1115, 1055, -1, 91, 374, 1115, 1055, -1, 342, 1115, 1055, -1, 156, 1115, 1055, -1, -1, 201, 346, 443, 532, 562, -1, -1, 163, 443, 530, 533, -1, -1, 209, 443, 531, 563, -1, -1, 163, 443, 533, -1, -1, 533, 534, -1, -1, 349, 1093, 1058, 535, 536, 443, -1, -1, 536, 537, -1, 538, -1, 542, -1, 544, -1, 545, -1, 546, -1, 548, -1, 552, -1, 554, -1, 555, -1, 556, -1, 558, -1, 559, -1, 560, -1, 28, 1138, 540, 539, 541, -1, 28, 1138, 540, 111, -1, -1, 111, -1, 295, -1, -1, 161, -1, 117, -1, 227, -1, 112, -1, 1073, -1, 4, 1120, 1115, 543, -1, 354, -1, 117, -1, 306, -1, 19, 309, 1117, 1115, 557, 1089, -1, 1099, 1115, 430, -1, 547, 374, 1115, 1055, 1056, -1, -1, 395, -1, 364, -1, 231, 1120, 1115, 549, -1, 235, 550, -1, 31, 550, -1, 158, -1, -1, 429, 231, 270, 551, -1, 429, 231, 270, 242, 551, -1, 429, 337, -1, 309, -1, 311, -1, 276, 1115, 553, -1, 553, -1, 195, -1, 1127, 1105, 354, -1, 316, -1, 224, 354, -1, 282, 1107, 1115, 1057, -1, 309, 107, 1115, 371, -1, 309, 1117, 1115, 557, -1, 1055, -1, 1055, 444, 1054, -1, 1055, 366, 1115, 1054, -1, 316, 1117, 1115, 1055, -1, 329, 1076, 1102, -1, 356, 1140, 561, -1, 9, 1125, -1, 251, 1125, -1, 308, 271, -1, -1, 209, 443, 563, -1, -1, 564, 443, -1, 565, -1, 564, 565, -1, 566, -1, 568, -1, 340, 567, 1102, 1112, 1046, -1, -1, 309, -1, 364, -1, 365, -1, 242, 1111, 1134, 1109, 569, -1, 570, -1, 569, 570, -1, 1047, 571, -1, -1, 291, 1076, -1, -1, 96, 114, 443, 573, 604, 649, 651, 653, 694, -1, -1, -1, 395, 346, 443, 574, 576, -1, -1, 579, 575, 578, -1, -1, 576, 577, -1, 579, 580, 606, -1, 580, 606, -1, 578, 577, -1, 162, -1, 344, -1, -1, 1047, 581, 582, 443, -1, -1, 582, 583, -1, 1115, 161, -1, 1115, 181, -1, 584, -1, 586, -1, 590, -1, 592, -1, 594, -1, 595, -1, 601, -1, 602, -1, 603, -1, 46, 1109, 1076, 589, 585, -1, -1, 311, -1, 55, -1, 309, 1109, 1076, 1108, -1, 309, 1109, 1076, 393, 1076, 1108, -1, 309, 1115, 425, 1114, 1132, 588, 589, 1108, 587, -1, -1, 108, 1123, 1055, -1, -1, 1113, 1076, -1, -1, 393, 1076, -1, 212, 1097, 591, -1, 370, -1, 269, -1, 424, 267, 430, 1115, 593, -1, 424, 267, 164, 1115, 593, -1, 227, -1, 1073, -1, 96, 1097, 1054, -1, 222, 1115, 1057, 1119, 596, -1, -1, 596, 597, -1, 598, -1, 599, -1, 600, -1, 1140, 168, 1104, 1057, 1119, -1, 1104, 399, 1057, 1119, -1, 1104, 47, 1057, -1, 310, 1120, 1115, 430, -1, 59, 1115, 430, -1, 322, 1115, 693, -1, 324, 1101, 693, -1, -1, -1, 432, 346, 443, 605, 606, -1, -1, 607, -1, -1, 608, 609, -1, 1087, 610, 443, -1, 609, 1087, 610, 443, -1, 609, 443, -1, 617, -1, -1, 612, 613, 611, 618, -1, 430, -1, -1, 165, -1, 430, -1, 430, -1, -1, 1115, 181, -1, 1077, -1, 218, 1122, 1072, -1, 49, 1122, 1072, -1, 612, 614, 80, 615, 1103, 616, -1, -1, 618, 619, -1, 620, -1, 621, -1, 623, -1, 624, -1, 625, -1, 627, -1, 628, -1, 637, -1, 638, -1, 640, -1, 641, -1, 642, -1, 647, -1, 648, -1, 313, 1072, -1, 1115, 161, 622, -1, -1, 26, 227, -1, 1115, 181, -1, 288, -1, 626, -1, 421, 1115, 626, -1, 36, -1, 70, -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, 112, -1, 194, -1, 281, -1, 290, -1, 303, -1, 361, -1, 359, -1, 360, -1, 410, -1, 408, -1, 409, -1, 38, 358, -1, 38, 407, -1, 38, -1, 41, 358, -1, 41, 407, -1, 41, -1, 40, 358, -1, 40, 407, -1, 40, -1, 39, 358, -1, 39, 407, -1, 39, -1, 37, 358, -1, 37, 407, -1, 37, -1, 244, -1, 1131, 216, 1095, -1, 1131, 400, 1095, -1, 266, 1076, 629, 1137, 630, 631, 634, -1, -1, 393, 1076, -1, -1, 108, 1123, 1055, -1, 632, -1, -1, 632, 633, 1117, 1115, 1054, -1, 27, -1, 109, -1, -1, 195, 1106, 635, -1, 636, -1, 635, 636, -1, 430, -1, 210, 1128, -1, 383, 639, -1, -1, 217, -1, 336, -1, 42, 1139, 436, -1, 33, -1, -1, 424, 1116, 644, 643, 1139, 1129, 1138, 646, -1, 645, -1, 644, 645, -1, 1077, -1, 1077, 390, 1077, -1, -1, 394, 1115, 1077, -1, 320, 1073, -1, 320, 1073, 390, 1073, -1, 21, 218, -1, -1, -1, 230, 346, 443, 650, 606, -1, -1, -1, 226, 346, 443, 652, 606, -1, -1, -1, 322, 346, 443, 654, 655, -1, -1, 656, -1, 657, -1, 656, 657, -1, 307, 693, 658, 443, 672, -1, -1, 658, 659, -1, 1115, 181, -1, 58, 1115, 1068, -1, 660, -1, 664, -1, 84, 661, -1, 85, 661, -1, 662, 663, -1, -1, 166, -1, 1071, -1, 663, 1071, -1, 283, 1116, 670, 665, 666, 667, 668, 669, -1, -1, 186, 1115, 1076, -1, -1, 167, 110, 1115, 1076, -1, -1, 213, 87, 1115, 1076, -1, -1, 214, 1115, 1076, -1, -1, 168, 1115, 1076, -1, 1076, -1, 1076, 671, 1076, 64, -1, 1076, 671, -1, 224, -1, 225, -1, -1, 672, 673, -1, 612, 613, 674, 443, -1, -1, 674, 675, -1, 676, -1, 678, -1, 685, -1, 624, -1, 625, -1, 627, -1, 637, -1, 679, -1, 640, -1, 690, -1, 680, -1, 642, -1, 683, -1, 691, -1, 628, -1, 684, -1, 403, 1115, 677, -1, 326, -1, 285, -1, 87, -1, 110, -1, 86, -1, 284, -1, 325, -1, 249, 185, 1115, 1076, -1, 63, 1121, 1115, 1076, -1, 63, 261, -1, 64, -1, 681, -1, 680, 681, -1, 380, 1122, 682, -1, 1055, -1, 293, 427, 1027, -1, 425, 1071, 173, 1062, 48, 1062, -1, 686, 687, -1, 224, 689, 1116, -1, 225, 1101, -1, 688, -1, 687, 688, -1, 289, 1076, -1, 1076, -1, 249, 283, -1, -1, 260, -1, 261, -1, 366, 1115, 1071, 1094, -1, 185, 692, -1, -1, 196, -1, 430, -1, -1, -1, -1, 341, 346, 443, 695, 696, 697, -1, -1, 698, -1, 699, -1, 698, 699, -1, 617, -1, -1, 612, 613, 700, 701, 443, -1, -1, 701, 702, -1, 43, -1, 44, -1, 35, -1, 45, -1, 152, 147, -1, 152, 149, -1, 187, -1, 233, -1, 333, -1, 404, -1, 280, -1, 30, -1, 347, -1, 328, -1, 174, -1, 304, -1, 224, 1121, 1115, 703, 1070, -1, 63, 1121, 1115, 704, 1070, -1, 170, 1115, 1070, -1, 32, 1115, 1070, -1, 625, -1, 640, -1, 637, -1, 627, -1, 642, -1, 624, -1, 705, -1, 423, 1071, -1, 173, 1069, -1, 393, 1071, -1, -1, 289, -1, 437, -1, 238, -1, 438, -1, -1, 289, -1, 437, -1, 238, -1, 438, -1, 266, 1076, 1137, -1, -1, -1, -1, 297, 114, 709, 717, 443, 707, 718, 708, 720, -1, -1, -1, 423, 710, 712, -1, -1, 53, 711, 712, -1, 713, -1, 712, 713, -1, 714, 715, 716, 430, -1, -1, 1106, 315, -1, 1106, 424, -1, -1, 362, 1115, 30, -1, 362, 1115, 104, -1, 407, 362, 1115, 1076, -1, 362, 1115, 1076, -1, -1, 273, -1, -1, 331, 430, -1, -1, -1, 103, 443, 719, 720, 120, 103, 443, -1, -1, 720, 721, -1, 722, -1, 723, -1, 724, -1, 730, 443, -1, 1, 443, -1, 443, -1, 725, 346, 726, 443, -1, 430, 443, -1, 725, -1, 430, -1, -1, 227, -1, -1, -1, 728, 729, 730, -1, -1, 731, 732, -1, 730, 732, -1, 733, -1, 743, -1, 748, -1, 752, -1, 755, -1, 768, -1, 771, -1, 781, -1, 776, -1, 782, -1, 783, -1, 786, -1, 794, -1, 798, -1, 800, -1, 815, -1, 818, -1, 820, -1, 822, -1, 825, -1, 827, -1, 833, -1, 842, -1, 844, -1, 861, -1, 863, -1, 866, -1, 870, -1, 876, -1, 886, -1, 893, -1, 895, -1, 898, -1, 902, -1, 903, -1, 914, -1, 925, -1, 935, -1, 941, -1, 944, -1, 950, -1, 954, -1, 956, -1, 958, -1, 960, -1, 963, -1, 974, -1, 987, -1, 250, -1, -1, 3, 734, 735, 742, -1, 1071, 736, 739, 994, -1, 1071, 173, 154, 211, -1, 1071, 173, 225, -1, 1071, 173, 64, -1, 1071, 173, 97, -1, 1071, 173, 97, 435, -1, 1071, 173, 98, -1, 1071, 173, 98, 434, -1, 1071, 173, 99, -1, 1071, 173, 391, -1, 1071, 173, 66, -1, 1071, 173, 146, 994, -1, 1071, 173, 144, 1066, 994, -1, 1071, 173, 24, -1, 1071, 173, 25, 994, -1, 1071, 173, 1049, -1, 1071, 173, 430, -1, -1, 1104, 737, 738, -1, 1104, 738, 737, -1, 1104, 737, -1, 1104, 738, -1, 29, 1066, -1, 224, 1121, 1068, -1, 63, 1121, 1068, -1, 291, 1121, 1068, -1, -1, 429, 740, -1, 741, -1, 740, 741, -1, 35, -1, 45, -1, 187, -1, 233, -1, 333, -1, 404, -1, 280, -1, 170, 1115, 1070, -1, 32, 1115, 1070, -1, 343, 413, 1026, -1, 343, 115, 1026, -1, 30, -1, 174, -1, 328, -1, 347, -1, 414, -1, 304, -1, -1, 121, -1, -1, 5, 744, 745, 747, -1, 1061, 393, 1042, 1000, -1, 1061, 746, 180, 1042, 1000, -1, 89, 1071, 393, 1071, 1094, 1000, -1, -1, 393, 1062, -1, -1, 122, -1, -1, 10, 749, 750, -1, 430, 1090, 751, -1, 1028, 55, 1090, 331, 1060, -1, -1, 331, 1060, -1, 18, 753, -1, -1, 753, 1051, 393, 754, 1051, -1, -1, 299, 393, -1, -1, 50, 756, 1069, 757, 762, 763, 765, 767, -1, -1, -1, 423, 758, 759, -1, 760, -1, 759, 760, -1, 761, 269, -1, 761, 715, 1062, -1, -1, 1106, 315, -1, 1106, 82, -1, 1106, 424, -1, -1, 331, 1071, -1, 180, 1071, -1, -1, -1, 981, 764, 727, -1, -1, -1, 982, 766, 727, -1, -1, 123, -1, -1, 51, 769, 770, -1, -1, 770, 1068, -1, -1, 57, 772, 773, -1, -1, 773, 1047, 774, -1, -1, 775, -1, 775, 1112, 319, -1, 1140, 251, 334, -1, 1140, 231, -1, 314, -1, 405, -1, -1, 71, 777, 778, 779, -1, 1042, 780, 1028, 1000, -1, -1, 124, -1, 444, -1, 150, -1, 68, -1, 83, -1, -1, 105, 784, 1047, 1127, 1020, 785, -1, -1, 125, -1, -1, 112, 787, 788, 793, -1, 1068, 418, 995, -1, 1068, 419, 995, -1, 1068, 416, 995, -1, 1068, 417, 995, -1, 1061, 736, 789, 790, 995, -1, -1, 415, 1049, -1, 415, 430, -1, 415, 295, -1, 415, 91, -1, -1, 1140, 259, -1, 429, 791, -1, 792, -1, 791, 792, -1, 35, -1, 45, -1, 152, 147, -1, 152, 149, -1, 187, -1, 233, -1, 333, -1, 404, -1, 280, -1, 170, 1115, 1070, -1, 32, 1115, 1070, -1, 343, 413, 1026, -1, 343, 115, 1026, -1, 43, -1, 44, -1, -1, 126, -1, -1, 113, 795, 796, 797, -1, 1062, 203, 1042, 1000, -1, 1062, 203, 1062, 180, 1042, 1000, -1, 1062, 48, 1062, 180, 1042, 1000, -1, 1062, 203, 1062, 180, 1043, 318, 1043, 1000, -1, 1062, 48, 1062, 180, 1043, 318, 1043, 1000, -1, -1, 127, -1, -1, 143, 799, 227, 757, -1, -1, 155, 801, 802, 804, 814, -1, 803, -1, 802, 17, 803, -1, 1028, -1, 398, -1, 394, -1, 805, 808, -1, 806, -1, 805, 806, -1, -1, 810, 807, 727, -1, -1, -1, 427, 277, 809, 727, -1, 427, 811, -1, 810, 427, 811, -1, 812, -1, 811, 17, 812, -1, 1029, 813, -1, 21, -1, 398, -1, 394, -1, -1, 390, 1028, -1, -1, 128, -1, -1, 159, 816, 817, -1, -1, 300, -1, 287, -1, 287, 95, -1, 346, -1, 286, -1, -1, 172, 819, 1059, -1, -1, 179, 821, 1071, -1, -1, 182, 1138, 823, 1050, 824, -1, -1, 108, 1123, 1071, -1, -1, 183, 826, -1, -1, -1, 190, 828, 1027, 1136, 829, 727, 830, 832, -1, 190, 1, 130, -1, -1, -1, 119, 831, 727, -1, -1, 130, -1, -1, 197, 834, 1059, 835, 836, 837, 841, -1, -1, 1140, 165, -1, -1, 9, 1138, 424, -1, 840, 1138, 424, -1, -1, 321, 838, -1, 839, -1, 838, 839, -1, 840, 1110, 48, 1062, -1, 12, -1, 15, -1, 262, -1, 16, -1, 263, -1, 244, -1, 245, -1, -1, 104, -1, -1, 199, 843, 663, -1, -1, 202, 845, 846, 847, -1, 1071, -1, 1077, -1, 1080, -1, 848, -1, 847, 848, -1, 849, -1, 853, -1, 858, -1, -1, 384, 850, 851, -1, 852, -1, 851, 852, -1, 1066, 169, -1, 55, 859, -1, 9, -1, 216, -1, 400, -1, 1066, 859, -1, 321, 854, -1, 855, -1, 854, 855, -1, 55, 48, 1066, 859, -1, 856, 857, -1, -1, 9, -1, 216, -1, 167, -1, 400, -1, 1066, 48, 1067, 859, -1, 88, 1066, 393, 1067, 859, -1, -1, 859, 991, 860, 1062, -1, -1, 396, -1, -1, 237, 862, 927, -1, -1, 241, 864, 865, -1, 1062, 393, 1059, -1, 89, 1062, 393, 1059, -1, -1, 243, 867, 868, 869, -1, 1062, 48, 1042, 1000, -1, 1062, 48, 1062, 180, 1042, 1000, -1, -1, 131, -1, -1, 272, 871, 872, -1, -1, 872, 873, 874, 1046, 875, -1, 200, -1, 278, -1, 208, -1, 160, -1, -1, 356, 1140, 561, -1, -1, 1140, 251, 334, -1, 1140, 231, -1, -1, 287, 877, 878, -1, 881, 882, -1, -1, 882, 879, 727, 880, -1, 882, 132, -1, -1, 132, -1, 1051, -1, 1051, 390, 1051, -1, -1, 171, -1, 1069, 392, -1, 883, 412, 1027, -1, 883, 425, 884, -1, -1, 1140, 387, 991, -1, 885, -1, 884, 8, 885, -1, 1071, 173, 1062, 48, 1062, 412, 1027, -1, -1, 308, 887, 1047, 1091, 1127, 888, 889, 890, 891, 892, -1, -1, 203, 1071, -1, -1, 192, 231, -1, 1140, 231, -1, 1140, 251, 231, -1, 1140, 191, 231, -1, 1140, 426, -1, -1, 211, 1115, 1071, -1, -1, 1010, -1, 1021, -1, -1, 134, -1, -1, 317, 894, 1044, 989, -1, -1, 330, 896, 1047, 1127, 888, 1010, 897, -1, -1, 135, -1, -1, 335, 899, 1044, 989, 900, 1020, 901, -1, -1, 1140, 231, -1, 1140, 251, 231, -1, -1, 136, -1, 337, -1, -1, 345, 904, 905, 913, -1, 1045, 907, 908, 910, -1, -1, 9, 1045, 908, 427, 1028, 906, 727, -1, -1, 425, 1071, -1, -1, -1, 1104, 120, 909, 727, -1, 911, -1, 911, 910, -1, -1, 427, 1027, 912, 727, -1, -1, 137, -1, -1, 355, 915, 916, -1, 917, -1, 918, -1, 919, -1, 921, -1, 923, -1, 144, 1066, 393, 1066, -1, 1059, 393, 143, 1065, -1, 1059, 393, 1062, -1, 1059, 920, 48, 1062, -1, 413, -1, 115, -1, 922, -1, 921, 922, -1, 1048, 393, 505, -1, 924, -1, 923, 924, -1, 1059, 393, 398, -1, 1059, 393, 394, -1, -1, 364, 926, 927, -1, -1, 1073, 929, 931, 932, 928, 933, 934, -1, -1, 929, 1123, 633, 1117, 930, -1, -1, 930, 1073, -1, -1, 1098, 1124, -1, -1, 1099, 1115, 1055, -1, -1, 423, 1046, -1, 200, 297, 1115, 881, -1, -1, 180, 1046, -1, 278, 297, 1115, 881, -1, -1, -1, 373, 936, 1047, 937, 938, 1020, 940, -1, -1, 211, 1115, 939, 1062, -1, 1092, 1033, -1, 1092, 1034, -1, 1092, 1035, -1, 1092, 1036, -1, 1092, 1037, -1, -1, 138, -1, -1, 375, 339, 942, 943, -1, 375, 227, -1, -1, 331, 1062, -1, 180, 1062, -1, -1, 376, 945, 946, 203, 1071, 948, 1005, 949, -1, 947, -1, 946, 947, -1, 1062, -1, 106, 1106, 362, -1, 106, 1106, 1062, -1, -1, 1140, 290, 1071, -1, -1, 139, -1, -1, 379, 951, 952, 953, -1, 1061, 173, 1042, 1000, -1, 1061, 173, 1062, 180, 1042, 1000, -1, 89, 1071, 173, 1071, 1094, 1000, -1, -1, 140, -1, 381, 955, -1, -1, 296, -1, -1, 386, 957, 663, -1, -1, 401, 959, 1071, 173, 1066, 393, 1067, -1, -1, 406, 961, 1047, 962, -1, -1, 309, -1, 311, -1, -1, 411, 964, 1071, 965, 968, 948, 972, 1005, 973, -1, -1, 106, 1106, 966, -1, 967, -1, 966, 274, 967, -1, 1088, 1066, -1, 203, 969, -1, 968, 969, -1, 1071, 970, 971, -1, -1, 107, 1114, 1071, -1, -1, 90, 1114, 1071, -1, -1, 384, 1114, 1071, -1, -1, 141, -1, 975, -1, 984, -1, 986, -1, 422, 976, 978, 979, 980, 983, 1123, 977, -1, -1, 181, -1, 1046, -1, 200, -1, 278, -1, 208, -1, 160, -1, -1, 8, -1, -1, 370, -1, 157, -1, 153, -1, 157, -1, 279, -1, 255, -1, 257, -1, -1, 297, -1, 422, 1112, 101, 1123, 985, -1, 1051, -1, 9, 298, -1, 422, 976, 34, 323, 1071, -1, -1, 433, 988, 1044, 989, 900, 990, 992, 993, -1, -1, 173, 1068, -1, -1, 991, 1100, 1070, 1118, -1, 991, 1100, 1049, -1, 991, 1100, 283, -1, 34, -1, 8, -1, -1, 1015, -1, 1021, -1, -1, 142, -1, 996, 998, -1, 996, 998, -1, -1, -1, 157, 997, 727, -1, -1, -1, 255, 999, 727, -1, 1001, 1003, -1, -1, -1, 363, 1002, 727, -1, -1, -1, 258, 1004, 727, -1, 1006, 1008, -1, -1, -1, 279, 1007, 727, -1, -1, -1, 257, 1009, 727, -1, 1011, -1, 1013, -1, 1011, 1013, -1, -1, 120, 1012, 727, -1, -1, 253, 1014, 727, -1, 1016, -1, 1018, -1, 1016, 1018, -1, -1, 148, 1017, 727, -1, -1, 254, 1019, 727, -1, -1, 1021, -1, 1022, -1, 1024, -1, 1022, 1024, -1, -1, 206, 1023, 727, -1, -1, 256, 1025, 727, -1, -1, 1106, 1070, 1118, -1, 1028, -1, 1029, -1, -1, 1030, 1031, -1, 1032, -1, 1031, 207, -1, 1031, 1032, -1, 1062, -1, 445, -1, 446, -1, 437, -1, 438, -1, 439, -1, 440, -1, 442, -1, 1033, -1, 1034, -1, 1035, -1, 178, -1, 215, -1, 247, -1, 252, -1, 20, -1, 274, -1, 269, -1, 262, -1, 12, -1, 13, -1, 14, -1, 292, -1, 248, -1, 444, -1, 150, 1138, -1, 151, -1, 447, -1, 184, 1135, -1, 448, -1, 219, 1135, -1, 178, -1, 184, 1135, 274, 150, 1138, -1, 215, -1, 219, 1135, 274, 150, 1138, -1, 1040, -1, 1038, 1039, 1040, -1, -1, 67, -1, 350, -1, 1063, -1, 1040, 437, 1040, -1, 1040, 438, 1040, -1, 1040, 439, 1040, -1, 1040, 440, 1040, -1, 437, 1040, -1, 438, 1040, -1, 1040, 442, 1040, -1, 445, 1040, 446, -1, 223, -1, 223, 1096, 430, -1, 1043, -1, 1042, 1043, -1, 1062, 1094, -1, 1073, -1, 1073, -1, 1047, -1, 1046, 1047, -1, 430, -1, 1049, -1, 1048, 1049, -1, 239, -1, -1, 1050, 1051, -1, 1052, -1, 1073, -1, 1053, -1, 1053, 1096, 1053, -1, 227, -1, 1055, -1, 1054, 1055, -1, 1073, -1, -1, 1055, -1, 1055, -1, 227, -1, 430, -1, 1060, -1, 1059, 1060, -1, 1071, -1, 6, 1122, 1072, -1, 1062, -1, 1061, 1062, -1, 1071, -1, 218, 1122, 1072, -1, 218, 1122, 1078, -1, 218, 1122, 1080, -1, 6, 1122, 1064, 1065, -1, 6, 1122, 1072, -1, 1077, -1, 1080, -1, 1041, -1, 1071, -1, 218, 1122, 1072, -1, 218, 1122, 1078, -1, 218, 1122, 1080, -1, 1078, -1, 1080, -1, 1041, -1, 300, -1, 143, -1, 1072, -1, 227, -1, 1071, -1, 1078, -1, 1071, -1, 1077, -1, 1071, -1, 227, -1, 1071, -1, 227, -1, 1080, -1, 1071, -1, 1076, -1, 436, -1, 1072, -1, 1073, -1, 1073, 1074, -1, 1073, 1075, -1, 1073, 1074, 1075, -1, 430, -1, 430, 1096, 1073, -1, 445, 1038, 446, -1, 445, 1040, 449, 446, -1, 445, 1040, 449, 1040, 446, -1, 227, -1, 1078, -1, 9, 1079, -1, 1079, -1, 1078, 450, 1079, -1, 227, -1, 368, -1, 436, -1, 305, -1, 188, -1, 234, -1, 397, -1, 93, 1081, -1, 428, 1081, -1, 420, 445, 1040, 446, 1081, -1, 232, 445, 1040, 446, 1081, -1, 332, 445, 1040, 446, 1081, -1, 78, 445, 1038, 446, 1081, -1, 377, 445, 1038, 446, 1081, -1, 378, 445, 1038, 446, 1081, -1, 402, 445, 1084, 446, 1081, -1, 264, 445, 1085, 446, -1, 229, 445, 1086, 446, 1081, -1, 177, 1082, -1, -1, 445, 1040, 449, 446, -1, 445, 1040, 449, 1040, 446, -1, -1, 445, 1083, 446, -1, -1, 1038, -1, 1040, -1, 1040, 1039, 216, -1, 1040, 1039, 400, -1, 1040, -1, 1040, 1039, 1040, -1, 1040, -1, 1040, 1039, 1055, -1, -1, -1, 9, -1, -1, 1098, -1, -1, 198, -1, -1, 249, -1, 294, -1, -1, 252, -1, -1, 273, -1, -1, 338, -1, -1, 352, 1107, -1, 193, -1, 267, -1, 309, 1115, -1, 311, 1101, -1, 429, 116, -1, 116, -1, 60, 353, -1, 353, -1, -1, 7, -1, -1, 22, -1, -1, 23, -1, -1, 26, -1, -1, 29, -1, -1, 36, -1, -1, 48, -1, -1, 54, -1, -1, 55, -1, -1, 81, -1, -1, 96, -1, -1, 395, -1, -1, 169, -1, -1, 173, -1, -1, 193, -1, -1, 207, -1, -1, 207, -1, 22, -1, -1, 211, -1, -1, 224, -1, 225, -1, -1, 225, -1, -1, 240, -1, -1, 260, -1, -1, 267, -1, -1, 270, -1, -1, 275, -1, 193, 275, -1, -1, 277, -1, -1, 300, -1, -1, 309, -1, -1, 336, -1, -1, 355, -1, -1, 357, -1, -1, 357, -1, 357, 207, -1, -1, 362, -1, -1, 374, -1, -1, 385, -1, -1, 388, -1, -1, 389, -1, -1, 392, -1, -1, 393, -1, -1, 427, -1, -1, 429, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { 0, 757, 757, 757, 799, 800, 804, 805, 810, 811, 809, 819, 820, 818, 828, 829, 827, 834, 835, 836, 839, 840, 864, 888, 918, 917, 958, 1002, 1003, 1007, 1008, 1011, 1012, 1016, 1023, 1030, 1034, 1038, 1050, 1051, 1061, 1062, 1071, 1072, 1076, 1077, 1078, 1079, 1088, 1091, 1092, 1093, 1094, 1098, 1105, 1114, 1117, 1118, 1119, 1120, 1124, 1125, 1129, 1130, 1131, 1135, 1142, 1143, 1147, 1154, 1166, 1169, 1170, 1174, 1175, 1179, 1183, 1190, 1191, 1201, 1204, 1205, 1209, 1210, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1231, 1242, 1241, 1254, 1255, 1263, 1264, 1272, 1271, 1283, 1284, 1285, 1286, 1287, 1295, 1296, 1301, 1302, 1304, 1303, 1315, 1316, 1320, 1321, 1322, 1323, 1324, 1325, 1329, 1330, 1331, 1332, 1333, 1334, 1341, 1352, 1364, 1365, 1369, 1370, 1377, 1386, 1387, 1391, 1392, 1406, 1421, 1488, 1499, 1506, 1513, 1519, 1526, 1527, 1531, 1530, 1540, 1539, 1555, 1556, 1559, 1560, 1565, 1564, 1585, 1586, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1609, 1613, 1619, 1620, 1621, 1624, 1625, 1629, 1633, 1634, 1641, 1648, 1652, 1653, 1654, 1661, 1686, 1696, 1705, 1707, 1708, 1714, 1718, 1719, 1720, 1723, 1724, 1725, 1729, 1733, 1734, 1740, 1741, 1745, 1754, 1763, 1772, 1787, 1797, 1804, 1811, 1812, 1813, 1819, 1826, 1833, 1837, 1838, 1839, 1847, 1848, 1851, 1852, 1856, 1857, 1861, 1862, 1868, 1893, 1894, 1895, 1896, 1902, 1909, 1910, 1914, 1917, 1918, 1926, 1927, 1941, 1942, 1942, 1945, 1944, 1957, 1958, 1962, 1974, 1983, 1987, 1988, 1998, 1997, 2015, 2016, 2020, 2027, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2049, 2053, 2053, 2053, 2059, 2071, 2096, 2120, 2121, 2128, 2129, 2133, 2134, 2141, 2148, 2149, 2156, 2160, 2169, 2170, 2176, 2186, 2204, 2205, 2209, 2210, 2211, 2215, 2222, 2229, 2239, 2246, 2264, 2268, 2279, 2280, 2280, 2291, 2292, 2296, 2296, 2313, 2314, 2316, 2320, 2322, 2321, 2353, 2358, 2363, 2369, 2378, 2386, 2387, 2395, 2396, 2397, 2401, 2421, 2425, 2434, 2435, 2436, 2437, 2438, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2454, 2476, 2498, 2499, 2511, 2531, 2538, 2539, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2559, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2578, 2579, 2580, 2581, 2582, 2590, 2598, 2606, 2613, 2618, 2629, 2646, 2647, 2650, 2651, 2658, 2682, 2683, 2700, 2701, 2704, 2705, 2712, 2713, 2718, 2728, 2735, 2738, 2739, 2740, 2747, 2754, 2779, 2779, 2784, 2785, 2789, 2790, 2793, 2794, 2807, 2819, 2839, 2853, 2855, 2854, 2874, 2875, 2875, 2888, 2890, 2889, 2901, 2902, 2906, 2907, 2916, 2923, 2926, 2930, 2934, 2935, 2936, 2943, 2944, 2948, 2951, 2951, 2954, 2955, 2961, 2966, 2967, 2970, 2971, 2974, 2975, 2978, 2979, 2982, 2983, 2987, 2988, 2989, 2993, 2994, 2997, 2998, 3002, 3006, 3007, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3030, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3044, 3048, 3049, 3050, 3054, 3055, 3059, 3063, 3068, 3072, 3076, 3080, 3081, 3085, 3086, 3090, 3091, 3092, 3095, 3095, 3095, 3098, 3102, 3105, 3105, 3108, 3115, 3116, 3117, 3116, 3134, 3135, 3139, 3140, 3145, 3147, 3146, 3182, 3183, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3207, 3211, 3215, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3233, 3237, 3247, 3250, 3254, 3258, 3262, 3270, 3273, 3277, 3281, 3285, 3293, 3306, 3308, 3318, 3307, 3345, 3347, 3346, 3353, 3352, 3361, 3362, 3367, 3374, 3376, 3380, 3390, 3392, 3400, 3408, 3437, 3468, 3470, 3480, 3485, 3496, 3497, 3497, 3524, 3525, 3529, 3530, 3531, 3532, 3548, 3552, 3564, 3595, 3632, 3644, 3647, 3648, 3657, 3661, 3657, 3674, 3674, 3692, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3710, 3711, 3712, 3713, 3714, 3715, 3716, 3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3733, 3734, 3735, 3736, 3737, 3738, 3739, 3740, 3741, 3742, 3743, 3744, 3767, 3766, 3779, 3783, 3787, 3791, 3795, 3799, 3803, 3807, 3811, 3815, 3819, 3823, 3827, 3831, 3835, 3839, 3843, 3850, 3851, 3852, 3853, 3854, 3855, 3859, 3863, 3864, 3867, 3868, 3872, 3873, 3877, 3878, 3879, 3880, 3881, 3882, 3883, 3884, 3888, 3892, 3896, 3901, 3902, 3903, 3904, 3905, 3906, 3910, 3911, 3920, 3920, 3926, 3930, 3934, 3940, 3941, 3945, 3946, 3955, 3955, 3960, 3964, 3971, 3972, 3981, 3987, 3988, 3992, 3992, 4000, 4000, 4010, 4012, 4011, 4020, 4021, 4026, 4033, 4040, 4042, 4046, 4054, 4065, 4066, 4067, 4072, 4076, 4075, 4087, 4091, 4090, 4101, 4102, 4111, 4111, 4115, 4116, 4128, 4128, 4132, 4133, 4144, 4145, 4146, 4147, 4148, 4151, 4151, 4159, 4159, 4165, 4172, 4173, 4176, 4176, 4183, 4196, 4209, 4209, 4220, 4221, 4231, 4230, 4243, 4247, 4251, 4255, 4259, 4266, 4267, 4268, 4269, 4270, 4274, 4275, 4276, 4280, 4281, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4299, 4303, 4307, 4312, 4313, 4317, 4318, 4327, 4327, 4333, 4337, 4341, 4345, 4349, 4356, 4357, 4366, 4366, 4388, 4387, 4406, 4407, 4412, 4421, 4426, 4434, 4444, 4445, 4451, 4450, 4463, 4467, 4466, 4478, 4479, 4484, 4485, 4490, 4519, 4520, 4521, 4524, 4525, 4529, 4530, 4539, 4539, 4544, 4545, 4553, 4570, 4587, 4605, 4630, 4630, 4643, 4643, 4656, 4656, 4665, 4669, 4682, 4682, 4695, 4697, 4695, 4705, 4710, 4714, 4713, 4724, 4725, 4734, 4734, 4742, 4743, 4747, 4748, 4749, 4753, 4754, 4759, 4760, 4765, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4779, 4780, 4789, 4789, 4802, 4801, 4811, 4812, 4813, 4817, 4818, 4822, 4823, 4824, 4830, 4830, 4835, 4836, 4840, 4841, 4842, 4843, 4844, 4845, 4851, 4855, 4856, 4860, 4865, 4869, 4870, 4871, 4872, 4873, 4877, 4903, 4912, 4913, 4917, 4917, 4925, 4925, 4935, 4935, 4940, 4944, 4956, 4956, 4962, 4966, 4973, 4974, 4983, 4983, 4987, 4988, 5002, 5003, 5004, 5005, 5009, 5010, 5014, 5015, 5016, 5028, 5028, 5033, 5038, 5037, 5047, 5054, 5055, 5059, 5064, 5073, 5076, 5080, 5085, 5092, 5099, 5100, 5104, 5105, 5110, 5122, 5122, 5145, 5146, 5150, 5151, 5155, 5159, 5163, 5167, 5174, 5175, 5178, 5179, 5180, 5184, 5185, 5194, 5194, 5209, 5209, 5220, 5221, 5230, 5230, 5241, 5242, 5246, 5253, 5254, 5263, 5276, 5276, 5282, 5287, 5286, 5297, 5298, 5302, 5304, 5303, 5314, 5315, 5320, 5319, 5330, 5331, 5340, 5340, 5345, 5346, 5347, 5348, 5349, 5355, 5364, 5368, 5377, 5384, 5385, 5391, 5392, 5396, 5405, 5406, 5410, 5414, 5426, 5426, 5432, 5431, 5448, 5451, 5467, 5468, 5471, 5472, 5476, 5477, 5482, 5487, 5495, 5507, 5512, 5520, 5536, 5537, 5536, 5557, 5558, 5562, 5563, 5564, 5565, 5566, 5570, 5571, 5580, 5580, 5585, 5592, 5593, 5594, 5603, 5603, 5612, 5613, 5617, 5618, 5619, 5623, 5624, 5628, 5629, 5638, 5638, 5644, 5648, 5652, 5659, 5660, 5669, 5676, 5677, 5685, 5685, 5698, 5698, 5714, 5714, 5723, 5725, 5726, 5735, 5735, 5745, 5746, 5751, 5752, 5757, 5764, 5765, 5770, 5777, 5778, 5782, 5783, 5787, 5788, 5792, 5793, 5802, 5803, 5804, 5808, 5832, 5835, 5843, 5853, 5858, 5863, 5868, 5875, 5876, 5879, 5880, 5884, 5884, 5888, 5888, 5892, 5892, 5895, 5896, 5900, 5907, 5908, 5912, 5924, 5924, 5935, 5936, 5941, 5944, 5948, 5952, 5959, 5960, 5963, 5964, 5965, 5969, 5970, 5983, 5991, 5998, 6000, 5999, 6009, 6011, 6010, 6025, 6032, 6034, 6033, 6043, 6045, 6044, 6060, 6066, 6068, 6067, 6077, 6079, 6078, 6094, 6099, 6104, 6114, 6113, 6125, 6124, 6140, 6145, 6150, 6160, 6159, 6171, 6170, 6185, 6186, 6190, 6195, 6200, 6210, 6209, 6221, 6220, 6237, 6240, 6252, 6259, 6266, 6266, 6276, 6277, 6278, 6282, 6284, 6285, 6287, 6288, 6289, 6290, 6291, 6293, 6294, 6295, 6296, 6297, 6298, 6300, 6301, 6302, 6304, 6305, 6306, 6307, 6308, 6311, 6312, 6315, 6315, 6315, 6316, 6316, 6317, 6317, 6318, 6318, 6319, 6319, 6324, 6325, 6328, 6329, 6330, 6334, 6335, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6353, 6365, 6380, 6381, 6386, 6392, 6398, 6418, 6422, 6438, 6452, 6453, 6458, 6464, 6465, 6470, 6479, 6480, 6481, 6485, 6496, 6497, 6501, 6509, 6510, 6514, 6515, 6521, 6541, 6542, 6546, 6547, 6551, 6552, 6556, 6557, 6558, 6559, 6560, 6561, 6562, 6563, 6564, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6578, 6579, 6583, 6584, 6588, 6589, 6593, 6594, 6605, 6606, 6610, 6611, 6612, 6616, 6617, 6618, 6626, 6630, 6631, 6632, 6633, 6637, 6638, 6642, 6650, 6654, 6666, 6678, 6679, 6689, 6690, 6694, 6695, 6696, 6697, 6698, 6699, 6700, 6708, 6712, 6716, 6720, 6724, 6728, 6732, 6736, 6740, 6744, 6748, 6752, 6759, 6760, 6761, 6765, 6766, 6770, 6771, 6776, 6783, 6790, 6800, 6807, 6817, 6824, 6838, 6848, 6849, 6853, 6854, 6858, 6859, 6863, 6864, 6865, 6869, 6870, 6874, 6875, 6879, 6880, 6884, 6885, 6892, 6892, 6893, 6893, 6894, 6894, 6895, 6895, 6897, 6897, 6898, 6898, 6899, 6899, 6900, 6900, 6901, 6901, 6902, 6902, 6903, 6903, 6904, 6904, 6905, 6905, 6906, 6906, 6907, 6907, 6908, 6908, 6909, 6909, 6910, 6910, 6911, 6911, 6912, 6912, 6913, 6913, 6913, 6914, 6914, 6915, 6915, 6915, 6916, 6916, 6917, 6917, 6918, 6918, 6919, 6919, 6920, 6920, 6921, 6921, 6921, 6922, 6922, 6923, 6923, 6924, 6924, 6925, 6925, 6926, 6926, 6927, 6927, 6928, 6928, 6928, 6929, 6929, 6930, 6930, 6931, 6931, 6932, 6932, 6933, 6933, 6934, 6934, 6935, 6935, 6937, 6937, 6938, 6938 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[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", "$undefined", "ACCEPT", "ACCESS", "ADD", "ADDRESS", "ADVANCING", "AFTER", "ALL", "ALLOCATE", "ALPHABET", "ALPHABETIC", "\"ALPHABETIC-LOWER\"", "\"ALPHABETIC-UPPER\"", "ALPHANUMERIC", "\"ALPHANUMERIC-EDITED\"", "ALSO", "ALTER", "ALTERNATE", "AND", "ANY", "ARE", "AREA", "\"ARGUMENT-NUMBER\"", "\"ARGUMENT-VALUE\"", "AS", "ASCENDING", "ASSIGN", "AT", "AUTO", "AUTOMATIC", "\"BACKGROUND-COLOR\"", "BASED", "BEFORE", "BELL", "BINARY", "\"BINARY-C-LONG\"", "\"BINARY-CHAR\"", "\"BINARY-DOUBLE\"", "\"BINARY-LONG\"", "\"BINARY-SHORT\"", "BLANK", "\"BLANK-LINE\"", "\"BLANK-SCREEN\"", "BLINK", "BLOCK", "BOTTOM", "BY", "\"BYTE-LENGTH\"", "CALL", "CANCEL", "CH", "CHAINING", "CHARACTER", "CHARACTERS", "CLASS", "CLOSE", "CODE", "\"CODE-SET\"", "COLLATING", "COL", "COLS", "COLUMN", "COLUMNS", "COMMA", "\"COMMAND-LINE\"", "\"comma delimiter\"", "COMMIT", "COMMON", "COMP", "COMPUTE", "\"COMP-1\"", "\"COMP-2\"", "\"COMP-3\"", "\"COMP-4\"", "\"COMP-5\"", "\"COMP-X\"", "\"FUNCTION CONCATENATE\"", "CONFIGURATION", "CONSTANT", "CONTAINS", "CONTENT", "CONTINUE", "CONTROL", "CONTROLS", "\"CONTROL FOOTING\"", "\"CONTROL HEADING\"", "CONVERTING", "CORRESPONDING", "COUNT", "CRT", "CURRENCY", "\"FUNCTION CURRENT-DATE\"", "CURSOR", "CYCLE", "DATA", "DATE", "DAY", "\"DAY-OF-WEEK\"", "DE", "DEBUGGING", "\"DECIMAL-POINT\"", "DECLARATIVES", "DEFAULT", "DELETE", "DELIMITED", "DELIMITER", "DEPENDING", "DESCENDING", "DETAIL", "DISK", "DISPLAY", "DIVIDE", "DIVISION", "DOWN", "DUPLICATES", "DYNAMIC", "EBCDIC", "ELSE", "END", "\"END-ACCEPT\"", "\"END-ADD\"", "\"END-CALL\"", "\"END-COMPUTE\"", "\"END-DELETE\"", "\"END-DISPLAY\"", "\"END-DIVIDE\"", "\"END-EVALUATE\"", "\"END FUNCTION\"", "\"END-IF\"", "\"END-MULTIPLY\"", "\"END-PERFORM\"", "\"END PROGRAM\"", "\"END-READ\"", "\"END-RETURN\"", "\"END-REWRITE\"", "\"END-SEARCH\"", "\"END-START\"", "\"END-STRING\"", "\"END-SUBTRACT\"", "\"END-UNSTRING\"", "\"END-WRITE\"", "ENTRY", "ENVIRONMENT", "\"ENVIRONMENT-NAME\"", "\"ENVIRONMENT-VALUE\"", "EOL", "EOP", "EOS", "EQUAL", "EQUALS", "ERASE", "ERROR", "ESCAPE", "EVALUATE", "\"EVENT-STATUS\"", "EXCEPTION", "EXCLUSIVE", "EXIT", "EXTEND", "EXTERNAL", "FD", "\"FILE-CONTROL\"", "\"FILE-ID\"", "FILLER", "FINAL", "FIRST", "FOOTING", "FOR", "\"FOREGROUND-COLOR\"", "FOREVER", "FREE", "FROM", "FULL", "FUNCTION", "\"FUNCTION-ID\"", "\"FUNCTION\"", "GE", "GENERATE", "GIVING", "GLOBAL", "GO", "GOBACK", "GREATER", "GROUP", "HEADING", "HIGHLIGHT", "\"HIGH-VALUE\"", "IDENTIFICATION", "IF", "IGNORE", "IGNORING", "IN", "INDEX", "INDEXED", "INDICATE", "INITIALIZE", "INITIALIZED", "INITIATE", "INPUT", "\"INPUT-OUTPUT\"", "INSPECT", "INTO", "INTRINSIC", "INVALID", "\"INVALID KEY\"", "IS", "\"I-O\"", "\"I-O-CONTROL\"", "JUSTIFIED", "KEY", "LABEL", "LAST", "\"LAST DETAIL\"", "LE", "LEADING", "LEFT", "LENGTH", "LESS", "LIMIT", "LIMITS", "LINAGE", "\"LINAGE-COUNTER\"", "LINE", "LINES", "LINKAGE", "\"Literal\"", "LOCALE", "\"FUNCTION LOCALE\"", "\"LOCAL-STORAGE\"", "LOCK", "\"FUNCTION LOWER-CASE\"", "LOWLIGHT", "\"LOW-VALUE\"", "MANUAL", "MEMORY", "MERGE", "MINUS", "\"MNEMONIC NAME\"", "MODE", "MOVE", "MULTIPLE", "MULTIPLY", "NATIONAL", "\"NATIONAL-EDITED\"", "NATIVE", "NE", "NEGATIVE", "NEXT", "\"NEXT SENTENCE\"", "NO", "NOT", "\"NOT END\"", "\"NOT EOP\"", "\"NOT EXCEPTION\"", "\"NOT INVALID KEY\"", "\"NOT OVERFLOW\"", "\"NOT SIZE ERROR\"", "\"NO ADVANCING\"", "NUMBER", "NUMBERS", "NUMERIC", "\"NUMERIC-EDITED\"", "\"FUNCTION NUMVALC\"", "\"OBJECT-COMPUTER\"", "OCCURS", "OF", "OFF", "OMITTED", "ON", "ONLY", "OPEN", "OPTIONAL", "OR", "ORDER", "ORGANIZATION", "OTHER", "OUTPUT", "OVERFLOW", "OVERLINE", "\"PACKED-DECIMAL\"", "PADDING", "PAGE", "\"PAGE FOOTING\"", "\"PAGE HEADING\"", "PARAGRAPH", "PERFORM", "PICTURE", "PLUS", "POINTER", "POSITION", "POSITIVE", "PRESENT", "PREVIOUS", "PRINTER", "PRINTING", "PROCEDURE", "PROCEDURES", "PROCEED", "PROGRAM", "\"PROGRAM-ID\"", "\"Program name\"", "\"PROGRAM-POINTER\"", "PROMPT", "QUOTE", "RANDOM", "RD", "READ", "RECORD", "RECORDING", "RECORDS", "RECURSIVE", "REDEFINES", "REEL", "REFERENCE", "RELATIVE", "RELEASE", "REMAINDER", "REMOVAL", "RENAMES", "REPLACING", "REPORT", "REPORTING", "REPORTS", "\"REPORT FOOTING\"", "\"REPORT HEADING\"", "REPOSITORY", "REQUIRED", "RESERVE", "RETURN", "RETURNING", "\"FUNCTION REVERSE\"", "\"REVERSE-VIDEO\"", "REWIND", "REWRITE", "RIGHT", "ROLLBACK", "ROUNDED", "RUN", "SAME", "SCREEN", "\"SCREEN-CONTROL\"", "SCROLL", "SD", "SEARCH", "SECTION", "SECURE", "\"SEGMENT-LIMIT\"", "SELECT", "\"semi-colon\"", "SENTENCE", "SEPARATE", "SEQUENCE", "SEQUENTIAL", "SET", "SHARING", "SIGN", "SIGNED", "\"SIGNED-INT\"", "\"SIGNED-LONG\"", "\"SIGNED-SHORT\"", "SIZE", "\"SIZE ERROR\"", "SORT", "\"SORT-MERGE\"", "SOURCE", "\"SOURCE-COMPUTER\"", "SPACE", "\"SPECIAL-NAMES\"", "STANDARD", "\"STANDARD-1\"", "\"STANDARD-2\"", "START", "STATUS", "STOP", "STRING", "\"FUNCTION SUBSTITUTE\"", "\"FUNCTION SUBSTITUTE-CASE\"", "SUBTRACT", "SUM", "SUPPRESS", "SYMBOLIC", "SYNCHRONIZED", "TALLYING", "TAPE", "TERMINATE", "TEST", "THAN", "THEN", "THRU", "TIME", "TIMES", "TO", "\"FALSE\"", "\"FILE\"", "\"INITIAL\"", "\"NULL\"", "\"TRUE\"", "TOP", "TRAILING", "TRANSFORM", "\"FUNCTION TRIM\"", "TYPE", "UNDERLINE", "UNIT", "UNLOCK", "UNSIGNED", "\"UNSIGNED-INT\"", "\"UNSIGNED-LONG\"", "\"UNSIGNED-SHORT\"", "UNSTRING", "UNTIL", "UP", "UPDATE", "UPON", "\"UPON ARGUMENT-NUMBER\"", "\"UPON COMMAND-LINE\"", "\"UPON ENVIRONMENT-NAME\"", "\"UPON ENVIRONMENT-VALUE\"", "\"FUNCTION UPPER-CASE\"", "USAGE", "USE", "USING", "VALUE", "VARYING", "WAIT", "WHEN", "\"FUNCTION WHEN-COMPILED\"", "WITH", "\"Identifier\"", "WORDS", "\"WORKING-STORAGE\"", "WRITE", "YYYYDDD", "YYYYMMDD", "ZERO", "'+'", "'-'", "'*'", "'/'", "UNARY_SIGN", "'^'", "'.'", "'='", "'('", "')'", "'>'", "'<'", "':'", "'&'", "$accept", "start", "@1", "nested_list", "source_element", "program_definition", "@2", "@3", "program_mandatory", "@4", "@5", "function_definition", "@6", "@7", "nested_prog", "end_program", "end_mandatory", "end_function", "identification_division", "@8", "function_division", "program_name", "as_literal", "program_type", "program_type_clause", "_init_or_recurs", "environment_division", "configuration_section", "configuration_list", "configuration_paragraph", "source_computer_paragraph", "source_computer_entry", "with_debugging_mode", "computer_name", "object_computer_paragraph", "object_computer_entry", "object_clauses_list", "object_clauses", "object_computer_memory", "object_char_or_word", "object_computer_sequence", "object_computer_segment", "repository_paragraph", "opt_repository", "repository_list", "repository_name", "repository_literal_list", "special_names_paragraph", "opt_special_names", "special_name_list", "special_name", "mnemonic_name_clause", "@9", "special_name_mnemonic_on_off", "on_or_off", "alphabet_name_clause", "@10", "alphabet_definition", "alphabet_literal_list", "alphabet_literal", "@11", "alphabet_also_sequence", "alphabet_lits", "alphabet_also_literal", "symbolic_characters_clause", "symbolic_characters_list", "char_list", "integer_list", "class_name_clause", "class_item_list", "class_item", "locale_clause", "currency_sign_clause", "decimal_point_clause", "cursor_clause", "crt_status_clause", "screen_control", "event_status", "input_output_section", "@12", "@13", "file_control_paragraph", "file_control_sequence", "file_control_entry", "@14", "select_clause_sequence", "select_clause", "assign_clause", "_device", "_ext_clause", "assignment_name", "access_mode_clause", "access_mode", "alternative_record_key_clause", "collating_sequence_clause", "file_status_clause", "file_or_sort", "lock_mode_clause", "lock_mode", "lock_with", "lock_records", "organization_clause", "organization", "padding_character_clause", "record_delimiter_clause", "record_key_clause", "opt_splitk", "relative_key_clause", "reserve_clause", "sharing_clause", "sharing_option", "i_o_control_paragraph", "opt_i_o_control", "i_o_control_list", "i_o_control_clause", "same_clause", "same_option", "multiple_file_tape_clause", "multiple_file_list", "multiple_file", "multiple_file_position", "data_division", "file_section", "@15", "@16", "file_description_sequence", "file_description", "file_description_sequence_without_type", "file_type", "file_description_entry", "@17", "file_description_clause_sequence", "file_description_clause", "block_contains_clause", "_records_or_characters", "record_clause", "record_depending", "opt_from_integer", "opt_to_integer", "label_records_clause", "label_option", "value_of_clause", "valueof_name", "data_records_clause", "linage_clause", "linage_sequence", "linage_lines", "linage_footing", "linage_top", "linage_bottom", "recording_mode_clause", "code_set_clause", "report_clause", "working_storage_section", "@18", "record_description_list", "record_description_list_1", "@19", "record_description_list_2", "data_description", "@20", "level_number", "entry_name", "const_name", "const_global", "lit_or_length", "constant_entry", "data_description_clause_sequence", "data_description_clause", "redefines_clause", "external_clause", "as_extname", "global_clause", "picture_clause", "usage_clause", "usage", "sign_clause", "occurs_clause", "occurs_to_integer", "occurs_depending", "occurs_keys", "occurs_key_list", "ascending_or_descending", "occurs_indexed", "occurs_index_list", "occurs_index", "justified_clause", "synchronized_clause", "left_or_right", "blank_clause", "based_clause", "value_clause", "@21", "value_item_list", "value_item", "false_is", "renames_clause", "any_length_clause", "local_storage_section", "@22", "linkage_section", "@23", "report_section", "@24", "opt_report_description_list", "report_description_list", "report_description_entry", "report_description_options", "report_description_option", "control_clause", "control_field_list", "_final", "identifier_list", "page_limit_clause", "heading_clause", "first_detail", "last_heading", "last_detail", "footing_clause", "page_line_column", "line_or_lines", "report_group_description_list", "report_group_description_entry", "report_group_options", "report_group_option", "type_clause", "type_option", "next_group_clause", "column_clause", "sum_clause_list", "sum_clause", "ref_id_exp", "present_when_condition", "varying_clause", "line_clause", "line_keyword_clause", "report_line_integer_list", "line_or_plus", "_numbers", "source_clause", "group_indicate_clause", "_indicate", "report_name", "screen_section", "@25", "@26", "opt_screen_description_list", "screen_description_list", "screen_description", "@27", "screen_options", "screen_option", "screen_line_plus_minus", "screen_col_plus_minus", "screen_occurs_clause", "procedure_division", "@28", "@29", "procedure_using_chaining", "@30", "@31", "procedure_param_list", "procedure_param", "procedure_type", "size_optional", "procedure_optional", "procedure_returning", "procedure_declaratives", "@32", "procedure_list", "procedure", "section_header", "paragraph_header", "invalid_statement", "section_name", "opt_segment", "statement_list", "@33", "@34", "statements", "@35", "statement", "accept_statement", "@36", "accept_body", "opt_at_line_column", "line_number", "column_number", "opt_accp_attr", "accp_attrs", "accp_attr", "end_accept", "add_statement", "@37", "add_body", "add_to", "end_add", "allocate_statement", "@38", "allocate_body", "allocate_returning", "alter_statement", "alter_options", "_proceed_to", "call_statement", "@39", "call_using", "@40", "call_param_list", "call_param", "call_type", "call_returning", "call_on_exception", "@41", "call_not_on_exception", "@42", "end_call", "cancel_statement", "@43", "cancel_list", "close_statement", "@44", "close_list", "close_option", "reel_or_unit", "compute_statement", "@45", "compute_body", "end_compute", "comp_equal", "commit_statement", "continue_statement", "delete_statement", "@46", "end_delete", "display_statement", "@47", "display_body", "display_upon", "with_clause", "disp_attrs", "disp_attr", "end_display", "divide_statement", "@48", "divide_body", "end_divide", "entry_statement", "@49", "evaluate_statement", "@50", "evaluate_subject_list", "evaluate_subject", "evaluate_condition_list", "evaluate_case_list", "evaluate_case", "@51", "evaluate_other", "@52", "evaluate_when_list", "evaluate_object_list", "evaluate_object", "opt_evaluate_thru_expr", "end_evaluate", "exit_statement", "@53", "exit_body", "free_statement", "@54", "generate_statement", "@55", "goto_statement", "@56", "goto_depending", "goback_statement", "@57", "if_statement", "@58", "@59", "if_else_sentence", "@60", "end_if", "initialize_statement", "@61", "initialize_filler", "initialize_value", "initialize_replacing", "initialize_replacing_list", "initialize_replacing_item", "initialize_category", "initialize_default", "initiate_statement", "@62", "inspect_statement", "@63", "send_identifier", "inspect_list", "inspect_item", "inspect_tallying", "@64", "tallying_list", "tallying_item", "inspect_replacing", "replacing_list", "replacing_item", "rep_keyword", "replacing_region", "inspect_converting", "inspect_region", "_initial", "merge_statement", "@65", "move_statement", "@66", "move_body", "multiply_statement", "@67", "multiply_body", "end_multiply", "open_statement", "@68", "open_list", "open_mode", "open_sharing", "open_option", "perform_statement", "@69", "perform_body", "@70", "end_perform", "perform_procedure", "perform_option", "perform_test", "perform_varying_list", "perform_varying", "read_statement", "@71", "read_into", "with_lock", "read_key", "read_handler", "end_read", "release_statement", "@72", "return_statement", "@73", "end_return", "rewrite_statement", "@74", "write_lock", "end_rewrite", "rollback_statement", "search_statement", "@75", "search_body", "@76", "search_varying", "search_at_end", "@77", "search_whens", "search_when", "@78", "end_search", "set_statement", "@79", "set_body", "set_environment", "set_to", "set_up_down", "up_or_down", "set_to_on_off_sequence", "set_to_on_off", "set_to_true_false_sequence", "set_to_true_false", "sort_statement", "@80", "sort_body", "@81", "sort_key_list", "opt_key_list", "sort_duplicates", "sort_collating", "sort_input", "sort_output", "start_statement", "@82", "@83", "start_key", "start_op", "end_start", "stop_statement", "@84", "stop_returning", "string_statement", "@85", "string_item_list", "string_item", "opt_with_pointer", "end_string", "subtract_statement", "@86", "subtract_body", "end_subtract", "suppress_statement", "_printing", "terminate_statement", "@87", "transform_statement", "@88", "unlock_statement", "@89", "opt_record", "unstring_statement", "@90", "unstring_delimited", "unstring_delimited_list", "unstring_delimited_item", "unstring_into", "unstring_into_item", "unstring_into_delimiter", "unstring_into_count", "unstring_tallying", "end_unstring", "use_statement", "use_exception", "use_global", "use_exception_target", "_after", "_standard", "exception_or_error", "exception_or_overflow", "not_exception_or_overflow", "_procedure", "use_debugging", "use_debugging_target", "use_reporting", "write_statement", "@91", "write_from", "write_option", "before_or_after", "write_handler", "end_write", "on_accp_exception", "on_disp_exception", "opt_on_exception", "@92", "opt_not_on_exception", "@93", "on_size_error", "opt_on_size_error", "@94", "opt_not_on_size_error", "@95", "on_overflow", "opt_on_overflow", "@96", "opt_not_on_overflow", "@97", "at_end", "at_end_sentence", "@98", "not_at_end_sentence", "@99", "at_eop", "at_eop_sentence", "@100", "not_at_eop_sentence", "@101", "opt_invalid_key", "invalid_key", "invalid_key_sentence", "@102", "not_invalid_key_sentence", "@103", "_opt_scroll_lines", "condition", "expr", "partial_expr", "@104", "expr_tokens", "expr_token", "eq", "gt", "lt", "ge", "le", "exp_list", "e_sep", "exp", "linage_counter", "arithmetic_x_list", "arithmetic_x", "record_name", "table_name", "file_name_list", "file_name", "mnemonic_name_list", "mnemonic_name", "procedure_name_list", "procedure_name", "label", "integer_label", "reference_list", "reference", "opt_reference", "reference_or_literal", "undefined_word", "target_x_list", "target_x", "x_list", "x", "arith_x", "prog_or_entry", "alnum_or_id", "simple_value", "simple_all_value", "id_or_lit", "id_or_lit_or_func", "num_id_or_lit", "identifier", "identifier_1", "qualified_word", "subref", "refmod", "integer", "literal", "basic_literal", "basic_value", "function", "func_refmod", "func_args", "list_func_args", "trim_args", "numvalc_args", "locale_dt_args", "not_const_word", "flag_all", "flag_duplicates", "flag_initialized", "flag_next", "flag_not", "flag_optional", "flag_rounded", "flag_separate", "in_of", "records", "with_dups", "coll_sequence", "_advancing", "_are", "_area", "_as", "_at", "_binary", "_by", "_character", "_characters", "_contains", "_data", "_file", "_for", "_from", "_in", "_is", "_is_are", "_key", "_line_or_lines", "_lines", "_mode", "_number", "_of", "_on", "_in_order", "_other", "_program", "_record", "_right", "_set", "_sign", "_sign_is", "_size", "_status", "_tape", "_than", "_then", "_times", "_to", "_when", "_with", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 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, 355, 356, 357, 358, 359, 360, 361, 362, 363, 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, 406, 407, 408, 409, 410, 411, 412, 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, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 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, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 43, 45, 42, 47, 692, 94, 46, 61, 40, 41, 62, 60, 58, 38 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned short yyr1[] = { 0, 451, 453, 452, 454, 454, 455, 455, 457, 458, 456, 460, 461, 459, 463, 464, 462, 465, 465, 465, 466, 466, 467, 468, 470, 469, 471, 472, 472, 473, 473, 474, 474, 475, 475, 475, 476, 476, 477, 477, 478, 478, 479, 479, 480, 480, 480, 480, 481, 482, 482, 482, 482, 483, 484, 485, 486, 486, 486, 486, 487, 487, 488, 488, 488, 489, 490, 490, 491, 492, 493, 494, 494, 495, 495, 496, 496, 497, 497, 498, 499, 499, 500, 500, 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, 502, 503, 502, 504, 504, 505, 505, 507, 506, 508, 508, 508, 508, 508, 509, 509, 510, 510, 511, 510, 512, 512, 513, 513, 513, 513, 513, 513, 514, 514, 514, 514, 514, 514, 515, 516, 517, 517, 518, 518, 519, 520, 520, 521, 521, 522, 523, 524, 525, 526, 527, 528, 529, 529, 530, 529, 531, 529, 532, 532, 533, 533, 535, 534, 536, 536, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 538, 538, 539, 539, 539, 540, 540, 540, 541, 541, 541, 542, 543, 543, 543, 544, 545, 546, 547, 547, 547, 548, 549, 549, 549, 550, 550, 550, 550, 551, 551, 552, 552, 553, 553, 553, 553, 554, 555, 556, 557, 557, 557, 558, 559, 560, 561, 561, 561, 562, 562, 563, 563, 564, 564, 565, 565, 566, 567, 567, 567, 567, 568, 569, 569, 570, 571, 571, 572, 572, 573, 574, 573, 575, 573, 576, 576, 577, 578, 578, 579, 579, 581, 580, 582, 582, 583, 583, 583, 583, 583, 583, 583, 583, 583, 583, 583, 584, 585, 585, 585, 586, 586, 586, 587, 587, 588, 588, 589, 589, 590, 591, 591, 592, 592, 593, 593, 594, 595, 596, 596, 597, 597, 597, 598, 599, 600, 601, 602, 603, 603, 604, 605, 604, 606, 606, 608, 607, 609, 609, 609, 610, 611, 610, 612, 613, 613, 613, 614, 615, 615, 616, 616, 616, 617, 618, 618, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 620, 621, 622, 622, 623, 624, 625, 625, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 626, 627, 627, 628, 629, 629, 630, 630, 631, 632, 632, 633, 633, 634, 634, 635, 635, 636, 637, 638, 639, 639, 639, 640, 641, 643, 642, 644, 644, 645, 645, 646, 646, 647, 647, 648, 649, 650, 649, 651, 652, 651, 653, 654, 653, 655, 655, 656, 656, 657, 658, 658, 659, 659, 659, 659, 660, 660, 661, 662, 662, 663, 663, 664, 665, 665, 666, 666, 667, 667, 668, 668, 669, 669, 670, 670, 670, 671, 671, 672, 672, 673, 674, 674, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 675, 676, 677, 677, 677, 677, 677, 677, 677, 678, 679, 679, 679, 680, 680, 681, 682, 683, 684, 685, 686, 686, 687, 687, 688, 688, 688, 689, 689, 689, 690, 691, 692, 692, 693, 694, 695, 696, 694, 697, 697, 698, 698, 699, 700, 699, 701, 701, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 703, 703, 703, 703, 703, 704, 704, 704, 704, 704, 705, 706, 707, 708, 706, 709, 710, 709, 711, 709, 712, 712, 713, 714, 714, 714, 715, 715, 715, 715, 715, 716, 716, 717, 717, 718, 719, 718, 720, 720, 721, 721, 721, 721, 721, 721, 722, 723, 724, 725, 726, 726, 728, 729, 727, 731, 730, 730, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 734, 733, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 736, 736, 736, 736, 736, 736, 737, 738, 738, 739, 739, 740, 740, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, 742, 742, 744, 743, 745, 745, 745, 746, 746, 747, 747, 749, 748, 750, 750, 751, 751, 752, 753, 753, 754, 754, 756, 755, 757, 758, 757, 759, 759, 760, 760, 761, 761, 761, 761, 762, 762, 762, 763, 764, 763, 765, 766, 765, 767, 767, 769, 768, 770, 770, 772, 771, 773, 773, 774, 774, 774, 774, 774, 775, 775, 777, 776, 778, 779, 779, 780, 780, 781, 782, 784, 783, 785, 785, 787, 786, 788, 788, 788, 788, 788, 789, 789, 789, 789, 789, 790, 790, 790, 791, 791, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, 793, 793, 795, 794, 796, 796, 796, 796, 796, 797, 797, 799, 798, 801, 800, 802, 802, 803, 803, 803, 804, 805, 805, 807, 806, 808, 809, 808, 810, 810, 811, 811, 812, 812, 812, 812, 813, 813, 814, 814, 816, 815, 817, 817, 817, 817, 817, 817, 819, 818, 821, 820, 823, 822, 824, 824, 826, 825, 828, 829, 827, 827, 830, 831, 830, 832, 832, 834, 833, 835, 835, 836, 836, 836, 837, 837, 838, 838, 839, 840, 840, 840, 840, 840, 840, 840, 841, 841, 843, 842, 845, 844, 846, 846, 846, 847, 847, 848, 848, 848, 850, 849, 851, 851, 852, 852, 852, 852, 852, 852, 853, 854, 854, 855, 855, 856, 856, 856, 856, 856, 857, 858, 859, 859, 860, 860, 862, 861, 864, 863, 865, 865, 867, 866, 868, 868, 869, 869, 871, 870, 872, 872, 873, 873, 873, 873, 874, 874, 875, 875, 875, 877, 876, 878, 879, 878, 878, 880, 880, 881, 881, 882, 882, 882, 882, 882, 883, 883, 884, 884, 885, 887, 886, 888, 888, 889, 889, 889, 889, 889, 889, 890, 890, 891, 891, 891, 892, 892, 894, 893, 896, 895, 897, 897, 899, 898, 900, 900, 900, 901, 901, 902, 904, 903, 905, 906, 905, 907, 907, 908, 909, 908, 910, 910, 912, 911, 913, 913, 915, 914, 916, 916, 916, 916, 916, 917, 918, 918, 919, 920, 920, 921, 921, 922, 923, 923, 924, 924, 926, 925, 928, 927, 929, 929, 930, 930, 931, 931, 932, 932, 933, 933, 933, 934, 934, 934, 936, 937, 935, 938, 938, 939, 939, 939, 939, 939, 940, 940, 942, 941, 941, 943, 943, 943, 945, 944, 946, 946, 947, 947, 947, 948, 948, 949, 949, 951, 950, 952, 952, 952, 953, 953, 954, 955, 955, 957, 956, 959, 958, 961, 960, 962, 962, 962, 964, 963, 965, 965, 966, 966, 967, 968, 968, 969, 970, 970, 971, 971, 972, 972, 973, 973, 974, 974, 974, 975, 976, 976, 977, 977, 977, 977, 977, 978, 978, 979, 979, 980, 980, 981, 981, 982, 982, 983, 983, 984, 985, 985, 986, 988, 987, 989, 989, 990, 990, 990, 990, 991, 991, 992, 992, 992, 993, 993, 994, 995, 996, 997, 996, 998, 999, 998, 1000, 1001, 1002, 1001, 1003, 1004, 1003, 1005, 1006, 1007, 1006, 1008, 1009, 1008, 1010, 1010, 1010, 1012, 1011, 1014, 1013, 1015, 1015, 1015, 1017, 1016, 1019, 1018, 1020, 1020, 1021, 1021, 1021, 1023, 1022, 1025, 1024, 1026, 1026, 1027, 1028, 1030, 1029, 1031, 1031, 1031, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1033, 1033, 1033, 1034, 1034, 1035, 1035, 1036, 1036, 1037, 1037, 1038, 1038, 1039, 1039, 1039, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1041, 1041, 1042, 1042, 1043, 1044, 1045, 1046, 1046, 1047, 1048, 1048, 1049, 1050, 1050, 1051, 1052, 1052, 1052, 1053, 1054, 1054, 1055, 1056, 1056, 1057, 1057, 1058, 1059, 1059, 1060, 1060, 1061, 1061, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, 1067, 1068, 1068, 1069, 1069, 1069, 1070, 1070, 1070, 1071, 1072, 1072, 1072, 1072, 1073, 1073, 1074, 1075, 1075, 1076, 1077, 1077, 1078, 1078, 1079, 1079, 1079, 1079, 1079, 1079, 1079, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1080, 1081, 1081, 1081, 1082, 1082, 1083, 1083, 1084, 1084, 1084, 1085, 1085, 1086, 1086, 1087, 1088, 1088, 1089, 1089, 1090, 1090, 1091, 1091, 1091, 1092, 1092, 1093, 1093, 1094, 1094, 1095, 1095, 1096, 1096, 1097, 1097, 1098, 1098, 1099, 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1104, 1104, 1105, 1105, 1106, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, 1112, 1113, 1113, 1114, 1114, 1115, 1115, 1116, 1116, 1116, 1117, 1117, 1118, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, 1131, 1131, 1132, 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1136, 1137, 1137, 1138, 1138, 1139, 1139, 1140, 1140 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 2, 1, 1, 0, 0, 8, 0, 0, 8, 0, 0, 7, 0, 1, 2, 0, 3, 3, 3, 0, 7, 5, 1, 1, 0, 2, 0, 3, 1, 2, 1, 1, 1, 0, 5, 0, 4, 0, 2, 1, 1, 1, 1, 3, 0, 2, 3, 2, 3, 1, 3, 0, 2, 3, 2, 1, 2, 1, 1, 1, 5, 1, 1, 4, 3, 3, 0, 2, 1, 2, 3, 3, 1, 2, 3, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 5, 0, 5, 1, 1, 0, 5, 1, 1, 1, 1, 1, 1, 2, 1, 3, 0, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2, 1, 2, 4, 1, 2, 1, 3, 4, 4, 3, 3, 4, 3, 3, 0, 5, 0, 4, 0, 4, 0, 3, 0, 2, 0, 6, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 0, 1, 1, 0, 1, 1, 1, 1, 1, 4, 1, 1, 1, 6, 3, 5, 0, 1, 1, 4, 2, 2, 1, 0, 4, 5, 2, 1, 1, 3, 1, 1, 3, 1, 2, 4, 4, 4, 1, 3, 4, 4, 3, 3, 2, 2, 2, 0, 3, 0, 2, 1, 2, 1, 1, 5, 0, 1, 1, 1, 5, 1, 2, 2, 0, 2, 0, 9, 0, 0, 5, 0, 3, 0, 2, 3, 2, 2, 1, 1, 0, 4, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 0, 1, 1, 4, 6, 9, 0, 3, 0, 2, 0, 2, 3, 1, 1, 5, 5, 1, 1, 3, 5, 0, 2, 1, 1, 1, 5, 4, 3, 4, 3, 3, 3, 0, 0, 5, 0, 1, 0, 2, 3, 4, 2, 1, 0, 4, 1, 0, 1, 1, 1, 0, 2, 1, 3, 3, 6, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 0, 2, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 3, 3, 7, 0, 2, 0, 3, 1, 0, 5, 1, 1, 0, 3, 1, 2, 1, 2, 2, 0, 1, 1, 3, 1, 0, 8, 1, 2, 1, 3, 0, 3, 2, 4, 2, 0, 0, 5, 0, 0, 5, 0, 0, 5, 0, 1, 1, 2, 5, 0, 2, 2, 3, 1, 1, 2, 2, 2, 0, 1, 1, 2, 8, 0, 3, 0, 4, 0, 4, 0, 3, 0, 3, 1, 4, 2, 1, 1, 0, 2, 4, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 4, 4, 2, 1, 1, 2, 3, 1, 3, 6, 2, 3, 2, 1, 2, 2, 1, 2, 0, 1, 1, 4, 2, 0, 1, 1, 0, 0, 0, 6, 0, 1, 1, 2, 1, 0, 5, 0, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 3, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 3, 0, 0, 0, 9, 0, 0, 3, 0, 3, 1, 2, 4, 0, 2, 2, 0, 3, 3, 4, 3, 0, 1, 0, 2, 0, 0, 7, 0, 2, 1, 1, 1, 2, 2, 1, 4, 2, 1, 1, 0, 1, 0, 0, 3, 0, 2, 2, 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, 0, 4, 4, 4, 3, 3, 3, 4, 3, 4, 3, 3, 3, 4, 5, 3, 4, 3, 3, 0, 3, 3, 2, 2, 2, 3, 3, 3, 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 1, 0, 4, 4, 5, 6, 0, 2, 0, 1, 0, 3, 3, 5, 0, 2, 2, 0, 5, 0, 2, 0, 8, 0, 0, 3, 1, 2, 2, 3, 0, 2, 2, 2, 0, 2, 2, 0, 0, 3, 0, 0, 3, 0, 1, 0, 3, 0, 2, 0, 3, 0, 3, 0, 1, 3, 3, 2, 1, 1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 0, 6, 0, 1, 0, 4, 3, 3, 3, 3, 5, 0, 2, 2, 2, 2, 0, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 0, 1, 0, 4, 4, 6, 6, 8, 8, 0, 1, 0, 4, 0, 5, 1, 3, 1, 1, 1, 2, 1, 2, 0, 3, 0, 0, 4, 2, 3, 1, 3, 2, 1, 1, 1, 0, 2, 0, 1, 0, 3, 0, 1, 1, 2, 1, 1, 0, 3, 0, 3, 0, 5, 0, 3, 0, 2, 0, 0, 8, 3, 0, 0, 3, 0, 1, 0, 7, 0, 2, 0, 3, 3, 0, 2, 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 3, 0, 4, 1, 1, 1, 1, 2, 1, 1, 1, 0, 3, 1, 2, 2, 2, 1, 1, 1, 2, 2, 1, 2, 4, 2, 0, 1, 1, 1, 1, 4, 5, 0, 4, 0, 1, 0, 3, 0, 3, 3, 4, 0, 4, 4, 6, 0, 1, 0, 3, 0, 5, 1, 1, 1, 1, 0, 3, 0, 3, 2, 0, 3, 2, 0, 4, 2, 0, 1, 1, 3, 0, 1, 2, 3, 3, 0, 3, 1, 3, 7, 0, 10, 0, 2, 0, 2, 2, 3, 3, 2, 0, 3, 0, 1, 1, 0, 1, 0, 4, 0, 7, 0, 1, 0, 7, 0, 2, 3, 0, 1, 1, 0, 4, 4, 0, 7, 0, 2, 0, 0, 4, 1, 2, 0, 4, 0, 1, 0, 3, 1, 1, 1, 1, 1, 4, 4, 3, 4, 1, 1, 1, 2, 3, 1, 2, 3, 3, 0, 3, 0, 7, 0, 5, 0, 2, 0, 2, 0, 3, 0, 2, 4, 0, 2, 4, 0, 0, 7, 0, 4, 2, 2, 2, 2, 2, 0, 1, 0, 4, 2, 0, 2, 2, 0, 8, 1, 2, 1, 3, 3, 0, 3, 0, 1, 0, 4, 4, 6, 6, 0, 1, 2, 0, 1, 0, 3, 0, 7, 0, 4, 0, 1, 1, 0, 9, 0, 3, 1, 3, 2, 2, 2, 3, 0, 3, 0, 3, 0, 3, 0, 1, 1, 1, 1, 8, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 5, 1, 2, 5, 0, 8, 0, 2, 0, 4, 3, 3, 1, 1, 0, 1, 1, 0, 1, 2, 2, 0, 0, 3, 0, 0, 3, 2, 0, 0, 3, 0, 0, 3, 2, 0, 0, 3, 0, 0, 3, 1, 1, 2, 0, 3, 0, 3, 1, 1, 2, 0, 3, 0, 3, 0, 1, 1, 1, 2, 0, 3, 0, 3, 0, 3, 1, 1, 0, 2, 1, 2, 2, 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, 1, 1, 2, 1, 2, 1, 5, 1, 5, 1, 3, 0, 1, 1, 1, 3, 3, 3, 3, 2, 2, 3, 3, 1, 3, 1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 1, 0, 2, 1, 1, 1, 3, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 2, 1, 3, 1, 2, 1, 3, 3, 3, 4, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 3, 3, 4, 5, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 5, 5, 5, 5, 5, 5, 5, 4, 5, 2, 0, 4, 5, 0, 3, 0, 1, 1, 3, 3, 1, 3, 1, 3, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 2, 2, 2, 1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned short yydefact[] = { 2, 0, 0, 1, 0, 0, 3, 4, 6, 7, 38, 38, 0, 0, 5, 0, 8, 14, 28, 27, 29, 29, 0, 242, 242, 0, 0, 24, 40, 0, 9, 15, 30, 26, 1463, 0, 147, 0, 575, 575, 1464, 0, 0, 0, 0, 0, 0, 39, 244, 0, 17, 0, 25, 33, 37, 36, 1488, 35, 42, 149, 0, 151, 254, 255, 0, 305, 247, 579, 18, 20, 38, 0, 16, 34, 1489, 32, 41, 155, 153, 225, 0, 0, 423, 0, 582, 580, 597, 0, 19, 10, 11, 0, 0, 0, 0, 0, 43, 44, 45, 47, 46, 150, 0, 223, 1455, 232, 152, 0, 227, 229, 230, 245, 0, 0, 426, 1302, 248, 308, 256, 587, 587, 0, 0, 0, 242, 23, 56, 71, 49, 80, 1419, 156, 155, 0, 148, 1456, 1505, 233, 234, 235, 1437, 226, 228, 249, 306, 0, 0, 429, 253, 0, 252, 309, 1407, 258, 1446, 587, 584, 590, 0, 587, 598, 576, 21, 12, 0, 1463, 54, 1488, 55, 1488, 60, 62, 63, 64, 0, 0, 70, 0, 73, 1518, 48, 0, 1517, 0, 0, 0, 0, 1496, 1463, 1463, 1463, 0, 1463, 1449, 1463, 79, 0, 82, 84, 85, 86, 88, 87, 89, 90, 91, 92, 93, 94, 1420, 0, 154, 225, 1506, 1451, 1438, 1457, 246, 308, 424, 0, 0, 521, 308, 311, 0, 1463, 585, 1463, 0, 595, 588, 589, 599, 575, 1463, 0, 57, 1488, 59, 61, 0, 1432, 1463, 0, 77, 0, 72, 74, 52, 50, 0, 0, 1320, 102, 1463, 1463, 1497, 1463, 0, 0, 0, 1463, 0, 1450, 0, 0, 81, 83, 157, 224, 1452, 0, 1458, 0, 250, 307, 308, 427, 0, 0, 243, 251, 314, 0, 318, 0, 319, 315, 1451, 1463, 0, 0, 1463, 1451, 1475, 1463, 1435, 0, 257, 259, 262, 263, 264, 265, 266, 267, 268, 269, 270, 0, 0, 1463, 596, 0, 0, 577, 17, 0, 1369, 69, 58, 1431, 0, 76, 75, 78, 51, 53, 1463, 0, 0, 0, 1364, 143, 1315, 142, 146, 0, 145, 129, 1465, 131, 95, 96, 159, 236, 237, 240, 231, 1300, 425, 308, 430, 0, 0, 312, 320, 321, 316, 0, 0, 0, 1463, 1435, 0, 0, 0, 0, 0, 1476, 1463, 0, 1436, 0, 0, 260, 261, 591, 592, 594, 0, 586, 600, 602, 0, 0, 68, 0, 1378, 1374, 1379, 1377, 1375, 1380, 1376, 135, 136, 138, 144, 141, 1425, 1426, 0, 140, 1467, 1466, 132, 0, 98, 1490, 238, 0, 239, 1301, 428, 432, 522, 313, 329, 323, 282, 302, 1427, 1428, 291, 1313, 286, 285, 284, 1319, 1318, 1473, 1449, 1461, 0, 520, 303, 304, 1463, 1463, 593, 602, 0, 0, 13, 66, 67, 65, 107, 121, 117, 122, 104, 120, 118, 105, 106, 119, 103, 108, 109, 111, 137, 0, 1365, 130, 133, 97, 1475, 0, 1513, 207, 0, 1475, 1463, 1447, 1468, 209, 0, 1517, 194, 193, 158, 160, 161, 162, 163, 164, 165, 0, 166, 167, 206, 168, 169, 170, 171, 172, 173, 1463, 1443, 241, 0, 431, 433, 434, 523, 1463, 1439, 0, 0, 272, 1314, 1474, 293, 0, 275, 1462, 1501, 301, 0, 0, 0, 0, 613, 609, 603, 604, 605, 606, 612, 0, 0, 0, 110, 113, 0, 139, 134, 101, 100, 1503, 1463, 1468, 1514, 179, 210, 1463, 1490, 1448, 1463, 1463, 1469, 1463, 1463, 1437, 0, 1463, 0, 1444, 0, 437, 435, 525, 0, 411, 353, 386, 374, 383, 380, 377, 1515, 354, 355, 356, 357, 358, 359, 360, 361, 362, 1492, 387, 0, 363, 350, 364, 365, 0, 0, 1499, 367, 368, 366, 407, 370, 371, 369, 1463, 1465, 330, 331, 332, 333, 334, 335, 351, 336, 337, 338, 339, 340, 341, 342, 343, 344, 0, 0, 1440, 0, 324, 283, 274, 273, 271, 292, 1449, 1502, 280, 289, 288, 290, 287, 0, 608, 611, 614, 671, 722, 731, 738, 742, 766, 770, 788, 781, 789, 790, 794, 828, 837, 839, 866, 874, 876, 1513, 882, 0, 893, 914, 916, 952, 954, 958, 670, 964, 977, 997, 1014, 1016, 1020, 1027, 1028, 1044, 1064, 1082, 0, 1100, 1111, 1119, 1121, 1123, 1125, 1130, 1152, 1175, 607, 621, 622, 623, 624, 625, 626, 627, 628, 630, 629, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 1148, 1149, 1150, 669, 620, 22, 0, 112, 1504, 1463, 0, 1463, 181, 180, 176, 0, 1491, 209, 205, 0, 0, 0, 0, 218, 1486, 1486, 0, 219, 0, 190, 208, 1463, 319, 529, 524, 526, 527, 422, 384, 385, 372, 373, 381, 382, 378, 379, 375, 376, 1516, 0, 1493, 405, 391, 345, 1360, 420, 1500, 408, 409, 406, 0, 0, 347, 349, 1423, 1423, 0, 1479, 1479, 328, 325, 1370, 1372, 1442, 294, 295, 296, 297, 0, 0, 276, 1460, 282, 0, 0, 615, 0, 0, 0, 1239, 737, 0, 768, 772, 0, 0, 0, 0, 0, 1239, 868, 0, 0, 878, 883, 0, 1239, 0, 0, 0, 0, 0, 0, 966, 987, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 1094, 0, 0, 1120, 1118, 0, 0, 0, 0, 1153, 1159, 0, 0, 127, 123, 128, 126, 124, 125, 114, 115, 0, 187, 188, 186, 185, 0, 175, 178, 0, 199, 198, 199, 195, 211, 212, 213, 214, 217, 1487, 220, 221, 222, 1316, 1463, 446, 446, 1465, 466, 438, 441, 442, 0, 530, 528, 410, 0, 1511, 0, 1361, 1362, 0, 352, 412, 414, 416, 0, 346, 1447, 388, 389, 1371, 1480, 0, 0, 0, 0, 0, 1441, 1449, 281, 601, 610, 720, 690, 1359, 1479, 0, 0, 1393, 1396, 1479, 1293, 0, 0, 0, 0, 0, 0, 0, 0, 1393, 729, 1335, 727, 1325, 1327, 1333, 1334, 1412, 732, 0, 1238, 0, 1312, 0, 1308, 1310, 1309, 1354, 744, 1353, 1355, 767, 771, 784, 0, 1295, 1421, 1490, 1374, 826, 690, 0, 1327, 835, 0, 744, 845, 844, 0, 841, 843, 873, 870, 869, 872, 867, 1479, 875, 1321, 1323, 877, 1306, 887, 1509, 1237, 895, 915, 448, 0, 918, 919, 920, 953, 1068, 0, 955, 0, 962, 0, 965, 988, 1312, 978, 987, 980, 0, 985, 0, 1309, 0, 1414, 1177, 1298, 1490, 1177, 0, 1042, 1033, 1299, 0, 1305, 1045, 1046, 1047, 1048, 1049, 1057, 1050, 1060, 0, 1303, 0, 1065, 1083, 1097, 1445, 0, 1102, 1104, 0, 1116, 0, 1122, 0, 1127, 1132, 1160, 0, 1161, 1481, 1177, 0, 99, 1410, 183, 182, 174, 184, 0, 197, 196, 1463, 0, 1317, 191, 0, 447, 443, 0, 444, 0, 436, 439, 532, 392, 1512, 393, 1479, 0, 0, 0, 1281, 1279, 1342, 1284, 1336, 1340, 1341, 0, 1363, 421, 1515, 415, 0, 348, 1424, 327, 326, 1373, 300, 1473, 0, 278, 721, 672, 1442, 0, 699, 0, 0, 0, 0, 0, 1381, 1398, 1392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1382, 730, 723, 0, 0, 1326, 1413, 735, 1412, 1263, 1264, 1265, 1259, 1513, 1270, 1255, 1507, 1256, 1507, 1257, 1267, 1258, 1262, 1261, 1260, 1266, 1247, 1248, 1249, 1250, 1251, 1268, 1245, 1246, 1271, 1273, 1240, 1241, 1252, 1253, 1254, 1244, 740, 0, 745, 755, 1352, 769, 1351, 774, 785, 782, 787, 786, 1239, 1296, 1422, 1297, 1226, 827, 795, 801, 1192, 1192, 1192, 1192, 836, 829, 0, 0, 838, 1239, 1239, 864, 851, 847, 849, 871, 0, 1322, 880, 1510, 885, 897, 0, 449, 0, 941, 926, 917, 921, 923, 924, 925, 1072, 0, 0, 963, 959, 0, 971, 968, 970, 969, 972, 979, 982, 616, 1239, 0, 0, 989, 0, 1415, 1416, 1490, 0, 1015, 999, 1022, 1035, 1043, 1029, 0, 1035, 0, 1347, 1348, 1058, 1061, 0, 0, 1304, 1056, 0, 1055, 0, 1085, 0, 0, 1095, 0, 0, 1103, 0, 1117, 1112, 0, 0, 1128, 1129, 1126, 1445, 0, 0, 1162, 0, 1482, 0, 1022, 116, 1430, 0, 189, 1411, 0, 202, 0, 215, 440, 445, 451, 461, 319, 467, 1498, 1481, 396, 0, 1289, 1290, 0, 1282, 1283, 1366, 0, 0, 0, 0, 0, 0, 0, 0, 1494, 417, 299, 1473, 1481, 277, 695, 686, 1192, 676, 683, 677, 679, 681, 0, 1192, 0, 675, 682, 689, 688, 0, 1192, 1477, 1477, 1477, 693, 694, 1344, 1343, 0, 1332, 1281, 1279, 0, 0, 1281, 0, 1328, 1329, 1330, 1294, 1281, 0, 0, 1281, 0, 0, 1281, 1281, 1281, 0, 0, 1199, 1421, 0, 0, 733, 0, 1269, 1508, 1272, 1274, 1242, 1243, 0, 0, 1311, 751, 0, 0, 758, 779, 780, 773, 775, 0, 1199, 1231, 1233, 792, 1227, 1228, 1229, 0, 806, 1193, 798, 1195, 799, 796, 797, 0, 1199, 1421, 842, 859, 861, 860, 854, 856, 862, 865, 840, 1239, 848, 846, 1239, 616, 1324, 1481, 879, 1307, 616, 1513, 905, 906, 908, 910, 911, 907, 909, 900, 1513, 896, 0, 942, 0, 944, 943, 945, 936, 937, 0, 0, 922, 1074, 1483, 0, 0, 956, 1199, 1421, 1517, 0, 983, 617, 990, 991, 994, 0, 986, 1184, 1183, 993, 999, 1178, 0, 0, 1226, 0, 0, 0, 1034, 0, 0, 0, 1059, 0, 1063, 1062, 1053, 0, 1463, 1226, 1099, 1098, 1105, 1106, 1107, 0, 1199, 1421, 0, 1408, 0, 1107, 1174, 1164, 1163, 1169, 0, 1171, 1172, 1179, 1429, 0, 216, 1463, 453, 464, 465, 463, 321, 469, 545, 1463, 536, 534, 535, 537, 1477, 0, 1463, 0, 548, 540, 1477, 541, 0, 544, 549, 547, 542, 546, 0, 543, 0, 531, 559, 554, 557, 556, 555, 558, 533, 560, 0, 400, 395, 1337, 1338, 1339, 1292, 1280, 1285, 1286, 1287, 1288, 1291, 1367, 0, 1495, 1513, 298, 0, 687, 1195, 678, 680, 1192, 684, 674, 714, 1463, 703, 704, 1463, 715, 705, 706, 709, 719, 716, 707, 0, 717, 708, 718, 700, 701, 673, 1478, 0, 0, 0, 691, 692, 1346, 1331, 1345, 1393, 1421, 0, 1397, 0, 1393, 1393, 0, 1390, 1393, 1393, 1393, 0, 1393, 1393, 1200, 724, 1202, 1199, 736, 0, 741, 739, 746, 747, 590, 0, 757, 756, 1165, 1166, 761, 759, 0, 778, 0, 783, 616, 616, 793, 791, 1230, 805, 804, 803, 802, 1518, 1192, 0, 616, 1196, 1191, 0, 830, 0, 1239, 1239, 858, 852, 855, 850, 0, 888, 0, 0, 912, 0, 0, 0, 938, 940, 0, 932, 948, 933, 934, 927, 928, 948, 1066, 1463, 0, 1484, 1073, 398, 399, 1468, 957, 960, 0, 0, 974, 984, 981, 619, 0, 0, 1001, 1000, 1215, 1217, 1018, 1212, 1213, 1025, 1023, 0, 1239, 1036, 1239, 1030, 1038, 1051, 1052, 1054, 1417, 1092, 1206, 0, 1421, 1113, 0, 0, 1409, 1133, 1134, 0, 1137, 1140, 1144, 1138, 1170, 1481, 1173, 1185, 1433, 0, 203, 204, 200, 0, 0, 455, 0, 1498, 0, 1463, 538, 539, 0, 562, 1463, 1511, 563, 561, 394, 1445, 390, 1468, 1368, 418, 279, 1190, 685, 0, 0, 1235, 1235, 702, 697, 696, 698, 1386, 1199, 1394, 0, 1406, 1391, 1384, 1404, 1385, 1387, 1388, 1401, 1402, 1389, 1383, 616, 1203, 1198, 725, 734, 748, 749, 0, 753, 752, 754, 1167, 1168, 764, 762, 616, 776, 777, 1232, 1234, 1463, 811, 824, 825, 812, 0, 1463, 815, 816, 819, 817, 0, 818, 808, 809, 800, 807, 1194, 616, 1199, 1295, 1199, 1295, 857, 863, 616, 881, 889, 891, 898, 901, 902, 1453, 913, 894, 899, 948, 1349, 1350, 948, 0, 931, 929, 930, 935, 1076, 0, 1485, 1070, 1199, 973, 967, 0, 618, 995, 0, 0, 1007, 0, 616, 616, 1019, 1017, 1214, 1026, 1021, 1024, 1031, 616, 1040, 1039, 1418, 0, 0, 1093, 1084, 1207, 1109, 1209, 0, 1199, 1199, 1124, 1408, 1136, 1461, 1142, 1461, 1206, 0, 1222, 1224, 1188, 1186, 1219, 1220, 1187, 1434, 0, 201, 452, 1463, 0, 457, 462, 1477, 498, 518, 513, 1435, 0, 0, 1463, 1479, 1463, 0, 468, 474, 475, 476, 485, 477, 479, 482, 470, 471, 472, 478, 481, 499, 483, 486, 473, 0, 480, 484, 1358, 553, 1356, 1357, 569, 552, 564, 574, 0, 1463, 1463, 413, 711, 710, 713, 0, 712, 726, 1395, 1201, 616, 750, 765, 743, 616, 760, 0, 813, 814, 0, 1235, 1235, 810, 1197, 832, 0, 831, 0, 853, 616, 892, 886, 903, 1454, 0, 947, 939, 948, 950, 0, 0, 1079, 1075, 1069, 961, 976, 0, 0, 1002, 1463, 1009, 0, 1003, 0, 1006, 1216, 1218, 616, 1037, 616, 1086, 1275, 1507, 1277, 1507, 1087, 1088, 1089, 1090, 1091, 616, 1110, 1101, 1210, 1205, 1108, 1115, 1114, 1135, 0, 1461, 1139, 0, 1146, 1158, 1155, 1157, 1156, 1151, 1154, 616, 616, 1189, 1176, 1221, 1182, 1181, 1470, 0, 1463, 1463, 459, 497, 1463, 519, 517, 514, 515, 1465, 507, 1463, 1239, 0, 0, 0, 0, 500, 0, 0, 505, 508, 511, 572, 570, 571, 573, 0, 567, 565, 566, 568, 0, 404, 401, 402, 0, 0, 1470, 1204, 763, 821, 820, 823, 822, 1199, 1199, 890, 0, 946, 951, 0, 1463, 1077, 0, 0, 1067, 1071, 975, 0, 0, 1012, 1010, 1011, 1005, 1004, 1032, 1041, 1272, 1274, 1208, 616, 1141, 0, 1145, 1147, 1131, 1223, 1225, 1471, 1472, 1180, 454, 0, 0, 1463, 450, 0, 506, 0, 503, 1421, 501, 502, 492, 490, 491, 493, 489, 494, 488, 487, 0, 512, 510, 509, 551, 550, 403, 397, 419, 1236, 834, 833, 904, 949, 0, 1080, 1463, 1239, 1008, 1013, 998, 0, 0, 1211, 1143, 456, 458, 0, 496, 495, 516, 0, 1078, 0, 996, 1513, 1513, 460, 0, 1081, 1276, 1278, 504 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { -1, 1, 2, 6, 7, 8, 23, 38, 68, 124, 234, 9, 24, 39, 69, 89, 445, 72, 70, 34, 11, 20, 26, 41, 56, 57, 16, 36, 76, 96, 97, 180, 181, 167, 98, 168, 169, 170, 171, 448, 172, 173, 99, 176, 177, 178, 246, 100, 195, 196, 197, 198, 409, 468, 542, 199, 329, 459, 460, 461, 743, 880, 462, 881, 200, 340, 341, 466, 201, 396, 397, 202, 203, 204, 205, 206, 207, 208, 47, 77, 79, 103, 101, 131, 345, 410, 484, 485, 890, 751, 1089, 486, 886, 487, 488, 489, 490, 491, 894, 1092, 1782, 492, 493, 494, 495, 496, 897, 497, 498, 499, 764, 134, 106, 107, 108, 109, 140, 110, 346, 347, 413, 30, 65, 143, 83, 217, 148, 116, 149, 117, 153, 226, 300, 301, 626, 302, 1357, 819, 512, 303, 429, 304, 632, 305, 306, 627, 811, 812, 813, 814, 307, 308, 309, 82, 218, 150, 151, 152, 224, 286, 419, 287, 359, 360, 509, 806, 288, 508, 602, 603, 604, 928, 605, 606, 607, 608, 609, 610, 918, 1336, 1590, 1591, 1729, 1800, 2129, 2130, 611, 612, 796, 613, 614, 615, 1124, 924, 925, 1997, 616, 617, 114, 277, 147, 352, 222, 416, 504, 505, 506, 768, 910, 911, 1100, 1101, 1019, 912, 1551, 1785, 1953, 2097, 2181, 1330, 1554, 1104, 1333, 1787, 1974, 1975, 2196, 1976, 1977, 1978, 1979, 2187, 1980, 1981, 1982, 1983, 2115, 2116, 2104, 1984, 1985, 2101, 437, 281, 507, 564, 771, 772, 773, 1106, 1334, 1587, 2127, 2122, 1588, 50, 233, 384, 86, 120, 119, 155, 156, 157, 230, 314, 122, 316, 442, 443, 527, 528, 529, 530, 531, 823, 1497, 1498, 1737, 532, 533, 689, 690, 824, 944, 1140, 1378, 1379, 1374, 1631, 1632, 1137, 691, 825, 963, 1163, 1161, 692, 826, 971, 1409, 693, 827, 1418, 694, 828, 1204, 1420, 1666, 1667, 1668, 1423, 1674, 1845, 1843, 2010, 2009, 695, 829, 984, 696, 830, 985, 1426, 1427, 697, 831, 986, 1210, 1213, 698, 699, 700, 832, 1683, 701, 833, 992, 1437, 1690, 1863, 1864, 1219, 702, 834, 996, 1226, 703, 835, 704, 836, 1001, 1002, 1232, 1233, 1234, 1460, 1458, 1875, 1235, 1451, 1452, 1700, 1455, 705, 837, 1008, 706, 838, 707, 839, 708, 1014, 1463, 709, 841, 710, 843, 1465, 1878, 2025, 2027, 711, 844, 1242, 1474, 1708, 1880, 1881, 1882, 1884, 712, 845, 713, 846, 1021, 1248, 1249, 1250, 1486, 1719, 1720, 1251, 1483, 1484, 1485, 1713, 1252, 1891, 2146, 714, 847, 715, 848, 1028, 716, 849, 1030, 1257, 717, 850, 1032, 1263, 1496, 1901, 718, 851, 1035, 1266, 1736, 1036, 1037, 1038, 1500, 1501, 719, 852, 1510, 1907, 2046, 2156, 2217, 720, 853, 721, 854, 1912, 722, 855, 1511, 1915, 723, 724, 856, 1049, 2053, 1283, 1513, 1918, 1753, 1754, 2055, 1281, 725, 857, 1054, 1055, 1056, 1057, 1295, 1058, 1059, 1060, 1061, 726, 858, 1025, 1895, 1253, 2039, 1488, 1722, 2037, 2151, 727, 859, 1296, 1526, 1922, 1925, 728, 1067, 1299, 729, 862, 1069, 1070, 1760, 2068, 730, 863, 1073, 1305, 731, 865, 732, 866, 733, 867, 734, 868, 1310, 735, 869, 1312, 1767, 1768, 1538, 1770, 1936, 2077, 1938, 2171, 736, 737, 871, 2084, 1081, 1315, 1542, 1675, 1844, 1775, 738, 1544, 739, 740, 873, 1276, 1777, 2034, 1942, 2089, 1608, 1439, 1440, 1692, 1694, 1868, 1659, 1660, 1830, 1832, 2006, 1927, 1928, 2066, 2070, 2166, 1744, 1745, 1909, 1746, 1910, 1943, 1944, 2086, 1945, 2087, 1432, 1433, 1434, 1680, 1435, 1681, 2000, 1016, 1017, 973, 974, 1195, 1196, 1197, 1198, 1199, 2064, 2065, 1114, 1344, 1385, 964, 987, 1214, 1044, 1050, 349, 350, 1062, 1063, 1239, 1039, 977, 978, 425, 431, 1097, 432, 254, 1010, 1011, 965, 989, 1117, 1382, 1641, 1721, 1886, 994, 1040, 1987, 967, 946, 791, 920, 921, 1989, 968, 808, 809, 969, 1146, 1148, 1389, 1403, 1398, 1395, 225, 1769, 1322, 1166, 1274, 1923, 210, 1216, 930, 403, 365, 1323, 243, 1948, 374, 216, 621, 1141, 561, 158, 551, 265, 272, 2030, 136, 274, 820, 519, 42, 408, 554, 2176, 515, 371, 1635, 934, 1317, 1726, 901, 174, 501, 788, 1605, 258, 619, 630, 746, 214, 1413, 1241, 1109, 546, 786, 183 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -1922 static const short yypact[] = { -1922, 285, 446, -1922, 196, 229, 446, -1922, -1922, -1922, 559, 559, 397, 397, -1922, 577, -1922, -1922, -1922, -1922, 687, 687, 281, 836, 836, 560, 518, -1922, 921, 928, -1922, -1922, -1922, -1922, -54, 686, 882, 605, 768, 768, -1922, 641, 53, 671, 678, 778, 692, -1922, 13, 1016, 845, 1025, -1922, -28, -1922, -1922, 861, -1922, -1922, -1922, 724, -1922, -1922, -1922, 839, 769, -1922, 43, -1922, 473, 559, 397, -1922, -1922, -1922, -1922, 704, -1922, 1049, 427, 736, 870, 1004, 821, -1922, -1922, 911, 397, -1922, -1922, -1922, 817, 819, 820, 824, 825, -1922, -1922, -1922, -1922, -1922, 920, 828, 1065, 880, -48, -1922, 402, -1922, -1922, -1922, -1922, 834, 932, 1055, -1922, 418, 850, -1922, 86, 86, 853, 842, 847, 836, -1922, 569, 1118, 169, 747, 1021, -1922, -1922, 852, -1922, -1922, 913, -1922, -1922, -1922, 1274, -1922, -1922, -1922, -1922, 859, 957, 985, -1922, 821, -1922, -1922, -1922, -1922, -1922, 495, -1922, -34, -90, 515, -1922, -1922, -1922, -1922, 943, 1103, -1922, 468, -1922, 547, -1922, -1922, -1922, -1922, 67, 168, -1922, -38, -1922, -1922, -1922, 879, 673, 1212, 891, 891, 951, 976, 1103, 1103, 1103, 891, 1103, 1284, 1103, -1922, 112, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 891, 920, 427, -1922, 1261, -1922, 1175, 418, 850, -1922, 902, 1012, 1009, 850, 650, 935, 1054, -1922, 1103, 1000, 1095, -1922, -1922, 1268, 768, 1103, 1146, -1922, 634, -1922, -1922, 1022, -1922, 1103, 1170, -1922, 775, -1922, -1922, -1922, -1922, 936, 1137, -1922, -1922, 1103, 1103, -1922, 1103, 953, 1315, 953, 1103, 953, -1922, 891, 16, -1922, -1922, -1922, -1922, -1922, 821, -1922, 821, -1922, -1922, 850, -1922, 938, 1039, -1922, -1922, -1922, 935, -1922, 945, -19, -1922, 1261, 1103, -15, -15, 1103, 8, 1149, 1103, 1368, 1125, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 499, 200, 1103, -1922, 963, 952, -1922, 845, 1146, -1922, -1922, -1922, -1922, 953, -1922, -1922, -1922, -1922, -1922, 1103, 701, 953, 1176, 456, -1922, -1922, -1922, -1922, 953, -1922, -1922, 58, -1922, -1922, -1922, -1922, 821, -1922, 1114, 821, -1922, -1922, 850, -1922, 964, 965, -1922, -1922, 1329, -1922, 1331, 1146, 986, 1103, 1368, 953, -7, -37, 1146, 988, -1922, 1103, 990, -1922, 990, -8, -1922, -1922, -1922, -1922, -1922, 1146, -1922, -1922, -1922, 510, 126, -1922, 1077, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 701, -1922, 1038, -1922, -1922, -1922, -1922, 953, -1922, -1922, -1922, -1922, 1146, -1922, 796, -1922, 1146, -1922, -1922, -1922, 1107, -1922, -1922, -1922, 765, 1032, -1922, -1922, -1922, 953, -1922, -1922, -1922, -1922, -1922, -1922, 1206, 62, 1242, 1003, -1922, -1922, -1922, 1103, 1103, -1922, -1922, 2643, 397, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 931, -1922, 68, -1922, 701, -1922, 1146, -1922, 806, 1149, 1127, 1051, -1922, 1092, 1149, 1103, 1397, 262, 2, 1146, 1027, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1080, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1103, 1421, -1922, 990, -1922, 1107, -1922, -1922, 4620, 1440, 1286, 1146, 85, -1922, -1922, -1922, 1146, -1922, -1922, 1109, -1922, -27, -27, 2851, 1031, 1033, -1922, -1922, -1922, -1922, -1922, 1131, 3560, 3795, 1036, -1922, -1922, 931, -1922, -1922, -1922, -1922, 1106, 1103, 1270, -1922, 165, -1922, 1103, 713, -1922, 1103, 1103, -1922, 1103, 1103, 1274, 162, 1103, 1053, -1922, 1132, -1922, -1922, 935, 1269, -1922, -1922, 282, 522, 533, 552, 639, 1066, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1159, -1922, 1146, -1922, -1922, -1922, -1922, 953, 953, 1289, -1922, -1922, -1922, 526, -1922, -1922, -1922, 1103, 195, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 918, 442, -1922, 376, -1922, -1922, -1922, -1922, -1922, 150, 1284, -1922, 536, -1922, -1922, -1922, -1922, 1398, -1922, -1922, 1273, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1051, -1922, 2239, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 14, -1922, -1922, 1208, -1922, -1922, -1922, -1922, 154, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 981, -1922, -1922, 1103, 74, 1103, -1922, -1922, 555, 620, -1922, -1922, -1922, -37, 1135, 953, 953, -1922, 1230, 1230, 1238, -1922, 953, -1922, -1922, 25, -19, -1922, -1922, 935, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1075, -1922, -1922, 1119, -1922, 1071, 1128, -1922, -1922, -1922, -1922, 3077, 343, 1491, -1922, 1173, 1173, 701, 1259, 1259, -1922, -1922, 1081, -1922, -1922, -1922, -1922, -1922, -1922, 57, 1359, -1922, -1922, 1032, 1146, 1089, -1922, 1091, 953, 3638, 1108, -26, 982, -1922, -1922, 4203, 821, 4332, 4203, 1312, 372, 841, 102, 953, -1922, -1922, 1411, -1922, 102, 953, 4216, 953, 3821, 4203, -1922, 1594, 821, 953, 821, 953, 41, 66, 953, 821, -1922, -1922, 2984, 3875, -1922, -1922, 953, 953, 821, 953, -1922, 295, 1443, 953, -1922, -1922, -1922, -1922, -1922, -1922, 1530, -1922, 891, -1922, -1922, -1922, -1922, 953, 122, -1922, 159, 1121, -1922, 1121, -1922, -1922, -1922, -1922, 527, -1922, -1922, -1922, -1922, -1922, 953, 1103, 1386, 1386, 195, -1922, -1922, -1922, -1922, 1374, -1922, -1922, -1922, 1146, 1177, 4973, 1120, -1922, 953, -1922, 343, -1922, 1178, 1340, -1922, 1397, -1922, -1922, -1922, -1922, 953, 953, 701, -37, -37, 1542, 1284, -1922, -1922, -1922, 1453, 717, -1922, 1259, 1130, 953, 1133, 1140, 1259, 456, 1142, 1143, 1145, 1147, 1154, 1155, 1162, 1168, 1133, 1455, -1922, 3887, -1922, -1922, -1922, -1922, 1403, -1922, 1556, -1922, 3328, -1922, 1221, -1922, 456, -1922, -1922, 1192, -1922, -1922, 155, 821, 1492, 1241, -1922, 1279, 1311, 1024, 1495, 2087, 1104, 1165, 1496, 173, 1192, -1922, -1922, 37, -1922, -1922, -1922, 1527, -1922, -1922, -1922, 1259, 102, -1922, -1922, -1922, -1922, -1922, 1235, -1922, 93, 953, -1922, 108, -1922, -1922, -1922, -1922, -1922, 4203, -1922, 1233, 1497, 1581, 810, -1922, 1239, -1922, 1630, 1500, 683, 1243, 1244, -103, 1247, 648, 1466, -1922, 1311, 1466, 953, 1504, 1217, -1922, 876, -1922, -1922, -1922, -1922, -1922, 1405, -1922, 102, -1922, 408, -1922, 52, -1922, -1922, 494, 1597, 2357, -1922, -1922, 953, 1506, 4056, 953, 1474, 869, 1543, -1922, 1325, 1280, 1382, 1466, 981, -1922, 9, -1922, -1922, -1922, -1922, -5, -1922, -1922, 1103, 953, -1922, -1922, 155, -1922, -1922, 953, -1922, 1146, 935, -1922, -1922, -1922, -1922, 1545, 1259, 4973, 4973, 4973, 17, 878, -1922, -1922, -1922, 1081, -1922, 4973, -1922, -1922, 1066, -1922, 343, -1922, -1922, -1922, -1922, -1922, -1922, 1206, -37, 1548, -1922, -1922, 876, 857, 1228, 135, -23, 4973, 1265, 4973, -1922, 4973, -1922, 4529, 1229, 4973, 4973, 4973, 4973, 4973, 4973, 4973, 4973, -1922, -1922, -1922, 4203, 1480, -1922, -1922, 1332, 1403, -1922, -1922, -1922, -1922, 1051, -1922, -1922, 1276, -1922, 1276, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 3091, -1922, -1922, -1922, -1922, -1922, 1363, 1438, -1922, 548, -1922, -1922, -1922, 812, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 54, -1922, -1922, 1251, 1510, 1510, 1510, 1510, -1922, -1922, 4203, 4203, -1922, 372, 219, 1540, 1246, -1922, 1252, -1922, 953, -1922, 111, -1922, -1922, 1240, 1505, -1922, 876, 84, -1922, 108, -1922, -1922, -1922, -1922, 50, 1281, 102, -1922, -1922, 4203, -1922, -1922, -1922, -1922, 1324, -1922, -1922, -1922, -1922, 953, -26, -1922, 999, -1922, -1922, 1311, 155, -1922, 1475, 377, 244, -1922, -1922, 953, 244, 1288, -1922, 1081, -1922, -1922, 59, 806, -1922, -1922, 1910, -1922, 1635, 1477, 4203, 4203, -1922, 4137, 953, -1922, 1516, -1922, -1922, 4203, 876, -1922, -1922, -1922, 1597, 1488, 953, -1922, 998, -1922, 42, 377, -1922, -1922, 1577, -1922, -1922, 1424, -1922, 953, 953, -1922, 953, 1509, 833, -16, -1922, 4743, 1382, -1922, 4529, 1254, 1254, 984, -1922, -1922, -1922, 4973, 4973, 4973, 4973, 4973, 4973, 4781, 878, 1342, -1922, -1922, 1206, 1382, -1922, -1922, -1922, 1510, -1922, -1922, 1263, 1271, -1922, 876, 1510, 1493, -1922, -1922, -1922, -1922, 1402, 1510, 1442, 1442, 1442, 107, 1479, -1922, -1922, 369, -1922, 69, 915, 953, 898, 87, 1266, -1922, 1081, -1922, -1922, 511, 1267, 1023, 575, 1272, 1052, 91, 94, 694, 1275, 1124, 4149, 476, 4203, 102, -1922, 1376, -1922, -1922, -1922, -1922, -1922, -1922, 1318, -26, -1922, 138, 953, 953, 454, -1922, -1922, -1922, 105, 56, 1351, -1922, -1922, 1590, -1922, 1460, -1922, 4, 360, -1922, -1922, 1462, -1922, -1922, -1922, 1546, 4149, 530, -1922, -1922, -1922, -1922, 1703, -1922, 1335, -1922, -1922, 174, -1922, -1922, 219, -1922, -1922, 1382, -1922, -1922, -1922, 1051, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1401, 1051, -1922, 1338, -1922, 1680, -1922, -1922, -1922, 407, -1922, 876, 789, -1922, 67, 478, 232, 102, 102, 4149, 539, 1027, 821, 1600, -1922, -1922, 1725, -1922, 1561, -1922, -1922, -1922, -1922, 1475, -1922, 953, 501, 54, 469, 1309, 1617, -1922, 1313, 876, 770, -1922, 369, -1922, -1922, -1922, 4203, 1103, 54, -1922, -1922, -1922, -1922, -79, 953, 4149, 545, 1345, 1730, 953, -105, -1922, -1922, -1922, 1444, 1446, -1922, -1922, 999, -1922, 10, 953, 1103, 1580, -1922, -1922, 1146, -1922, -1922, -1922, 1103, -1922, -1922, -1922, -1922, 1442, 1088, 1103, 982, -1922, -1922, 1442, -1922, 1146, -1922, -1922, -1922, -1922, -1922, 953, -1922, 953, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 953, 1553, 232, -1922, 1081, -1922, -1922, 915, 465, 465, 1254, 1254, 1254, -1922, 1156, -1922, 1051, -1922, 953, -1922, 1462, -1922, -1922, 1510, -1922, -1922, -1922, 1103, -1922, -1922, 1103, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 18, -1922, -1922, -1922, 1402, -1922, -1922, -1922, 155, 155, 155, -1922, -1922, -1922, -1922, -1922, 1133, 1279, 4893, -1922, 953, 1133, 1133, 4973, -1922, 1133, 1133, 1133, 452, 1133, 1133, -1922, -1922, 1498, 4149, -1922, 102, -1922, -1922, 1322, -1922, -47, 120, -1922, -1922, -1922, -1922, 983, -1922, 1435, -1922, 1423, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1139, 1510, 1501, -1922, -1922, -1922, 4203, -1922, 4203, 219, -1922, -1922, -1922, 1703, -1922, 953, 1640, 1337, 900, 1658, 1343, 286, 876, -1922, -1922, 1716, -1922, -1922, -1922, -1922, 789, -1922, 1599, -1922, 1103, 1494, -1922, -1922, -1922, -1922, 1270, 102, -1922, 4203, 162, 406, -1922, -1922, -1922, 953, 4203, 675, -1922, -1922, -1922, 1637, 1517, -1922, 1638, -1922, 1544, -1922, -1922, -1922, -1922, 1313, -1922, -1922, -1922, 1521, 1639, 1499, 1486, 1279, -1922, 4203, 286, -1922, 1507, -1922, 876, -1922, 1672, 1396, -1922, -1922, 1382, -1922, 970, 1775, 934, -1922, -1922, -1922, 1146, 1673, 1571, 1721, 5019, -53, 1103, -1922, -1922, -53, -1922, 1103, 1177, -1922, -1922, -1922, 1597, -1922, 1270, -1922, 1392, -1922, -1922, -1922, -53, -53, 124, 124, -1922, -1922, -1922, -1922, -1922, 1351, -1922, 1166, -1922, -1922, -1922, 915, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 4203, -1922, -1922, -1922, -1922, -1922, 1665, -1922, -1922, -1922, -1922, -1922, -1922, 1103, -1922, -1922, -1922, -1922, 1110, 1103, -1922, -1922, -1922, -1922, 27, -1922, 1139, -1922, -1922, -1922, -1922, -1922, 4149, 1472, 4149, 1473, -1922, -1922, -1922, -1922, -1922, 1663, -1922, 900, -1922, 1698, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 286, 999, -1922, -1922, 999, -6, 953, -1922, -1922, 4149, -1922, -1922, 643, 3795, -1922, 1747, 1565, 1586, 414, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 4203, 749, -1922, -1922, -1922, 1660, 1551, 953, 1351, 4149, -1922, 1730, -1922, 1242, 1715, 1242, 1499, 401, -1922, -1922, 1667, -1922, 1557, -1922, -1922, -1922, 393, -1922, -1922, 1103, 1723, 1601, -1922, 912, -1922, 1618, 960, 1368, 1628, 1390, 1103, 1259, 1103, 953, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1445, -1922, -1922, -1922, -1922, 65, -1922, -1922, -1922, -1922, -1922, -1922, 450, -1922, 543, -1922, 1388, 1103, 1103, -1922, -1922, -1922, -1922, -53, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -53, -1922, -1922, -53, 124, 124, -1922, -1922, -1922, 4203, -1922, 4203, -1922, -1922, -1922, -1922, -1922, -1922, 1772, 999, 999, -1922, 1426, 1531, 821, 70, -1922, 953, -1922, -1922, 1490, 4203, -1922, 1103, 950, 1596, -1922, 1602, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1276, -1922, 1276, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 953, 1242, -1922, 953, 1689, -1922, -1922, -1922, -1922, -1922, 821, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1029, 1146, 1103, 1103, 1669, -1922, 1103, -1922, -1922, -1922, -1922, 195, -1922, 1103, -1922, 953, 953, 1113, 1662, -1922, 1558, 1146, 65, -1922, -1922, -1922, -1922, -1922, -1922, -53, -1922, -1922, -1922, -1922, -53, -1922, 1388, -1922, 953, 343, 1029, -1922, -1922, -1922, -1922, -1922, -1922, 1351, 1351, -1922, 4203, 999, -1922, 4203, 1103, 821, 821, 1554, -1922, -1922, -1922, 1427, 953, 1706, -1922, -1922, -1922, -1922, -1922, -1922, 1576, 1578, -1922, -1922, -1922, 953, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1146, 1146, 1103, -1922, 1146, -1922, 1146, -1922, 1279, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 4203, -1922, -1922, -1922, -1922, -1922, -1922, 953, -1922, -1922, -1922, -1922, -1922, -1922, -26, 821, 1103, -1922, -1922, -1922, -1922, 1704, 1705, -1922, -1922, -1922, -1922, 1146, -1922, -1922, -1922, 1805, -1922, -26, -1922, 1051, 1051, -1922, 4203, -1922, -1922, -1922, -1922 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { -1922, -1922, -1922, -1922, 1850, -1922, -1922, -1922, 72, -1922, -1922, -1922, -1922, -1922, 1549, -1922, -1922, -1922, 1186, -1922, -1922, 34, 1839, -1922, -1922, 1808, 874, -1922, -1922, -1922, -1922, -1922, 1681, 1737, -1922, -1922, 1700, 109, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1692, -1922, -1922, -1922, -1922, 1674, -1922, -1922, -1922, 581, -1922, -1922, -1922, -1922, 1412, -1922, -1922, 1336, 790, -1922, -1922, -1922, -1922, -1922, -1922, 1481, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1743, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 987, 97, -1922, 1330, -1922, -1922, -1922, 991, -1922, -1922, -1922, 149, -1922, 1671, -1922, 1779, -1922, -1922, -1922, -1922, 1541, -1922, 248, -1922, -1922, -1922, -1922, 1675, -1922, 1840, 1742, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1074, -1922, -1922, -1922, 1373, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 930, -1922, -1922, -1922, 1612, -1922, -518, -735, -1922, -1922, -1922, -402, -1922, -1922, -1922, -1922, -1922, -1922, -1278, -1275, 1100, -1273, 113, -1922, -1922, -1922, -1922, 307, -1922, -1922, -228, -1260, -1922, -1922, -1259, -1922, -1258, -1922, -1922, 975, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 1399, -1922, -1922, -1922, 995, -1922, -702, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -75, -1922, -1922, -1922, -1922, -1922, -1922, -210, -1922, -1922, -1922, -1922, -158, -1922, -1922, -1922, -1922, -1922, 1134, -1922, -1922, -1922, -1922, -1922, -1922, 209, -1922, -1922, -1922, -1922, -1922, 1787, 1035, -1922, 240, -1922, -1922, -1922, -1922, 1467, -1922, -1922, -1922, -1922, -1922, -1922, -944, -1922, -1922, 175, -1922, 1377, -1922, -1922, -1922, 922, 534, 540, -1922, -1922, 283, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 919, -1922, -1922, 254, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 60, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 695, -1922, -1922, 688, -1922, -1922, -1922, -1922, 463, 226, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 47, 696, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 680, -1922, -1922, -1922, 210, -1922, -1922, 447, -1922, -1922, -1922, -1468, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1921, 897, -1922, -1922, 199, -1922, -1922, 432, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 616, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 657, -1922, 187, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 885, -1922, 884, -1922, -1922, 1087, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 881, 409, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, 20, -1922, 413, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -163, -1922, -1136, -1922, -1922, -1037, -1155, -1129, -1922, 346, -1922, -1269, -1922, -1922, -1922, -1922, 19, -1922, -1922, -1922, -1922, -88, -1922, -1922, 211, -1922, -1922, -1922, -1922, 21, -1922, -502, -1634, -1922, -1922, 535, -1922, -1196, -1254, -807, -1168, -1922, -1922, 766, 44, 45, 51, -1922, -1922, 145, -184, -294, -117, -1114, -819, 63, 916, -1463, -83, -1922, -1039, -1922, -792, -1922, 758, -1084, -241, -1922, -563, -153, -813, -958, -181, -747, -1922, -1922, 455, -1010, -1532, -929, -801, -669, 691, -573, -220, -1922, 1050, -230, -618, -652, -277, -361, -922, -1922, -1922, -1922, -1922, -1922, 1752, -1922, -1922, 811, -1922, -1922, -1922, -1599, 1180, -263, 1685, 726, -401, -1922, -362, 1429, -1922, -606, -1922, -1054, 1057, -384, 684, -1922, -1922, -670, -1922, -1698, -164, -596, -471, -146, -925, 646, -1340, -797, -1183, -1922, 1227, 1934, -707, -1922, -1922, -1922, -1922, -1922, -1922, -1922, -1162, -1922, 198, -653, 871, -470 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1518 static const short yytable[] = { 118, 236, 424, 807, 840, 798, 320, 555, 935, 500, 557, 1327, 988, 1499, 1300, 1414, 872, 790, 334, 972, 337, 815, 339, 1291, 259, 260, 261, 981, 263, 1003, 266, 1018, 255, 1734, 914, 976, 1636, 1637, 262, 335, 1159, 335, 1284, 335, 1064, 1816, 769, 21, 1405, 517, 1048, 1543, 1238, 398, 1230, 1206, 1581, 269, 1009, 1582, 1238, 1583, 310, 1453, 311, 1009, 118, 1441, 1442, 1443, 1490, 318, 1009, 748, 1584, 1585, 1586, -1481, 966, 323, 405, 380, 387, 905, 1341, 536, 966, 997, 386, 271, 399, 330, 331, 1478, 332, 1685, 84, 404, 338, 1009, 1372, 1029, 1031, 335, 937, 91, 1238, 343, 1009, 906, 907, 335, 342, 344, 1445, 1071, 966, 264, 335, 398, 1380, 123, 53, 184, 426, 1320, 362, 241, 1358, 367, 369, 421, 372, 1809, 154, 1506, 1341, 175, 433, 1479, 624, 88, 2016, 1946, 1493, 335, 357, 335, 381, 357, 1142, 441, 1589, 40, 1341, 1149, 439, 816, 1341, -1481, 1679, 1341, 770, 1930, 1075, 388, 1320, 1292, 185, 1328, 1375, 761, 154, 1607, 319, 62, 1696, 244, 467, 810, 926, 446, 502, 465, 513, -1517, 154, 538, 407, 348, 430, 883, 1533, 895, 2035, 1448, 1245, -1441, 1375, 423, 631, 975, 1838, 186, 187, 335, 188, 435, 1354, -1468, 1052, -1517, 1237, 553, 189, 40, 438, 405, 1164, 1462, -1445, 1227, 1836, 1789, 1731, 231, 1324, 1200, 1023, 1794, 378, 1609, 40, 1932, -177, 1477, 539, 2075, 1609, 2078, 1448, 860, 1549, 1053, 817, 1609, 1164, 1289, 51, 556, 2149, 1480, 1779, 1894, 769, -1457, 510, 1536, -1517, 1727, 1430, 137, 427, 348, 1763, 406, 414, 1119, 190, 975, -1517, 1087, 31, 810, 273, 521, 522, 1381, 240, 1704, 1254, 623, 749, 1217, 54, 3, 628, 1677, 1453, -1360, 2229, 1453, 319, 1661, 363, 803, 364, 1535, -1491, 1686, 1481, 633, 633, 1079, 379, 1053, 926, 1678, 908, 2236, 1431, 549, 1103, 1337, 2113, 228, 138, 139, -1517, 1780, 1316, 1781, 1071, 273, 179, 333, 750, 1164, 228, 1080, 1613, 1238, 1325, 1134, 232, 870, 559, 1633, 975, 1277, 191, 1728, 919, 988, 618, 562, 1508, 240, 2150, -177, 179, -1445, 803, 861, 2114, 789, 1612, 63, 2033, 1376, 229, 1129, 1130, 428, -1441, 54, 1669, 1342, 55, 552, 770, 792, 163, 229, 1132, 1133, 1228, 333, 2168, 747, 884, 1042, 1205, 1986, 752, 803, 1088, 756, 757, -31, 758, 759, 1833, 333, 765, 245, 625, 1688, 1377, 1329, 1286, -1445, 406, 333, 333, 247, 1429, 333, 64, 988, 1778, 358, 2158, 762, 1555, 1406, 1478, 2036, 2031, 1342, 242, 2032, 440, 1003, -1457, 804, 1377, 319, 885, 1246, 1606, 1810, -1468, -1463, 1687, 1839, 797, 1342, 1321, 988, 2017, 1342, 1492, 317, 1342, 1293, 253, 1464, 1200, 55, 1662, 1701, 1518, -1445, 192, 516, 938, 88, 537, 1119, 1119, 1119, 1479, 1343, 1231, 1294, 85, 983, 909, 1119, 763, 333, 333, 553, 389, 1714, 2085, 1503, 534, 1321, 1444, 1446, 333, 1609, 1482, 1024, 1286, 988, 253, 333, 983, 1119, 1247, 1119, 193, 1119, 333, 1391, 1919, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1755, 1353, 1967, -1445, 1494, 1968, 390, 1969, 1643, 1703, 898, 899, 1411, 391, 1705, 179, 333, 904, 1545, 932, 1971, 1972, 1973, 1453, 389, 333, -1399, 1238, 1865, 335, 1653, 335, 335, 1654, 333, 194, 154, 1840, 335, 1523, 2003, 1243, -1441, 1527, 1528, -177, 1530, -1445, 267, 1135, 447, 1120, 1534, -1445, 2080, -1445, 154, 389, 2144, 1042, 1507, 1449, 1383, 390, 1355, 1450, 2148, 1480, 1806, 1390, 391, 1341, 179, 62, 1869, 882, 1871, 887, 333, 1332, 2227, 988, 333, 941, 392, 1939, 1286, 805, -941, 1640, 1556, 179, 166, 2020, 2081, 2022, 390, 913, 2047, 87, 979, -1517, 2082, 391, 1672, 1669, 1449, 2002, 2099, -1491, 1450, 1899, -1517, 319, 1742, 4, 1481, 18, 1115, 1665, 1026, -1517, -1488, 2040, 1041, 1053, 1045, -941, 1045, 1051, -1517, 1026, 12, 775, -941, 1341, 444, 104, 2048, 898, 1053, 392, 401, 1931, 891, 993, 1045, 393, 1286, -728, -1517, 801, 1131, 376, 2072, 2073, 1096, 1461, 2049, 888, 335, 1826, 104, 1090, 1724, 13, 1514, 1297, 983, 2091, 1514, 1730, 2083, 377, 392, 1074, 394, 335, 1593, 2212, 1107, 2118, 776, 1150, 22, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 19, 1748, 1889, 1123, 15, 164, 1834, 1812, 1813, 1814, 818, 1697, 393, -941, 25, 1286, 1202, 333, 335, 335, 1732, 1749, 1815, 395, 402, 28, 1764, 1820, 1821, 1421, 1085, 1823, 1824, 1825, 1673, 1828, 1829, 1848, 1849, 1428, 2119, 394, 1098, 105, 794, 393, 1994, 1138, 5, 1867, 990, 1120, 1120, 1120, 1725, 1743, 2001, 2001, 1676, 184, 1934, 1120, 1341, 63, -1459, 1592, 1793, 999, 105, 74, 1043, 1000, 1046, 1238, 394, 5, -941, 1066, 1757, 892, 395, -1441, 2123, 1120, 164, 1120, 1077, 1120, 32, 1392, 1689, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1715, 333, 469, 1290, 1116, 185, -941, 164, 179, 1482, 1512, 1642, -1445, 5, 395, 1706, 1215, 470, 165, 1338, 1339, 1340, 2138, 2139, 1709, 333, 471, 1298, -583, 1351, 1051, 1986, -1445, 115, 2124, 1286, 1286, 179, 115, -941, 186, 187, 2050, 188, 802, -941, 1716, 141, -581, 74, 1512, 189, 889, 1387, 1827, 2185, 426, 893, 241, 1394, 1396, 1397, 1399, 1342, 795, 1402, 1404, 1286, -1517, 1906, 1215, 74, 164, 2207, 2208, 1331, 2041, 335, 1870, 1215, 1872, 1422, 777, 1359, 1360, 1215, 1278, 17, 2005, 2120, 2121, 389, 1139, 779, 1874, 1094, 2042, 165, 2163, 1272, 2164, 1172, 1173, 2011, 1208, 190, 1347, 1348, -1517, 1349, 472, 2092, 781, 237, 1467, 988, 335, 1468, 1469, 165, 1047, -1445, 1318, 1361, -1488, 1362, 2019, 1342, -1517, 2057, 390, 778, 1326, 2024, 29, 2058, 74, 391, 1083, 473, -583, -1445, 780, -1441, 1273, 1917, 90, 988, -1463, 1642, 1345, 1346, 1347, 1348, 1803, 1349, 1363, 1364, 1365, -1405, -581, 782, 2231, 33, 2001, 2001, 2059, 2051, 2052, 1691, 2060, 92, 1259, 1095, 40, 361, 2054, 191, 1594, 389, 368, 325, 2125, 2126, 165, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 239, 472, 1905, 1119, 1116, 1116, 1116, 783, 1119, 166, 35, 1366, 326, 1367, 1116, 1717, 392, 1504, -1441, 1747, 1260, 1368, 1345, 1346, 1347, 1348, 390, 1349, 1261, 979, 473, -1403, 753, 391, 1759, 1733, 1116, 474, 1116, 754, 1116, 93, 43, 1505, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 37, -1517, 1342, 44, 784, 2204, 48, 979, 1596, 1597, 1598, 1599, 1600, 1601, 1603, 1552, 1553, 1286, 948, 1761, 2134, -1517, 389, 49, 2135, 1286, 1761, 393, 1742, 94, 475, 95, 540, 950, 541, 321, 476, 799, -1407, 2142, 1369, 45, 52, 426, 513, 1723, 1262, 192, 2007, 46, 1888, 283, 392, 1267, 1053, 979, 394, 800, 289, -1517, 179, 390, 179, 477, 335, 335, 1268, 2161, 391, 2162, 478, 290, 58, 543, 250, 1286, 1940, 450, 548, 59, 2165, 1991, 60, 479, 1424, 1004, 1005, 193, 67, 1345, 1346, 1347, 1348, 61, 1349, 395, 1998, 1999, -1400, 1006, 2172, 2173, 1470, 1471, 5, 1888, 276, 242, 291, 1540, 480, 282, 71, 1541, 1430, 393, 451, 951, 481, 74, 1472, 1473, 1521, 452, 2109, 78, 1522, 874, -192, 1850, 1634, 2098, 1851, 2056, 1430, 194, 1308, 111, 1309, 392, 1852, 1853, 1854, 80, 394, 1007, 10, 1718, 227, 482, 10, 1190, 227, 449, 1193, 1194, 979, 2189, 2190, 81, 2140, 1743, 2141, 983, 1431, 351, 875, 980, 1647, 954, 102, 1650, 955, 876, 112, 1425, 1655, 333, 2102, 2103, 2220, 2191, 1941, 395, 1431, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 113, 1790, 454, 1791, 1841, 483, 1842, 179, 121, 1780, 393, 1781, 956, 947, 1370, 1466, 803, 115, 1467, 2174, 2175, 1468, 1469, 2013, 1898, 2014, 125, 40, 126, 127, 1902, 450, 292, 128, 129, 130, 1908, 132, 1888, 394, 133, 135, 293, 144, 145, 2093, -310, 146, 415, 160, 1120, 161, 877, 1371, 1384, 1120, 162, 1855, 1388, 175, 209, 212, 2154, 215, 213, 455, 1400, 1401, 219, 220, 451, 235, 333, 221, 513, 1856, 40, 452, 395, 252, 957, 1345, 1346, 1347, 1348, 948, 1349, 253, 249, 453, 1786, 256, 1857, 1350, -751, 335, 1995, -751, 2133, 257, 950, 1345, 1346, 1347, 1348, 264, 1349, 1795, 271, 2136, 273, 278, 2137, 1645, 1798, 878, 280, 1818, 1345, 1346, 1347, 1348, 1822, 1349, 279, 958, 959, 1758, 312, 294, 295, 285, 1804, 458, 313, 335, 154, 315, 1858, 319, 324, 322, 296, 328, 297, 327, 336, 353, 454, 333, 960, 354, 1783, 335, 356, 370, 373, 1211, 375, 382, 1788, 383, 2209, 2192, 2193, 2210, -751, 1792, 961, 400, -1445, 412, 1819, 417, 418, -322, 962, 420, 333, 434, 503, -751, 422, 879, 951, 1859, 436, 1345, 1346, 1347, 1348, 511, 1349, 335, 464, 389, 1595, 514, 1615, 520, 1616, 518, 544, 1617, 2194, 2195, -1352, -1352, -1352, -1352, 545, 455, 547, 1618, 456, 457, 2228, 550, 1807, 2201, 558, 1808, 179, 560, 2202, 952, 1345, 1346, 1347, 1348, 953, 1349, 620, 622, 390, 1649, 954, 629, 1860, 955, 636, 391, 637, 638, 298, 742, 745, 553, 1861, 766, 1470, 1471, 767, 774, 2239, 1345, 1346, 1347, 1348, 785, 1349, 787, 793, 299, 1652, -751, 822, 821, 1472, 1473, 864, 956, 896, 900, 2183, 903, -751, 916, 917, 458, 2205, 945, 919, 927, 922, 982, 1221, 1222, 1223, 1224, 995, 929, 933, 939, 1116, 1012, 1013, 936, 942, 1116, 943, 1012, 1020, 1022, 970, 998, -751, 1015, 982, 1862, 1082, -751, 392, 1084, 1012, -751, 1091, -751, 1099, 1950, -751, 1105, -751, 1020, 1076, 1896, 1078, 1345, 1346, 1347, 1348, 1121, 1349, 1127, 1126, 1108, 1657, 810, 1619, 957, 1136, 1143, 1620, 1160, 1145, 2237, 2238, -1351, -1351, -1351, -1351, 1147, -751, 1151, 1152, 1621, 1153, -751, 1154, 1345, 1346, 1347, 1348, 2105, 1349, 1155, 1156, 1165, 1802, 1345, 1346, 1347, 1348, 1157, 1349, 393, 1118, 1167, 2004, 1158, 1201, 1203, 1209, 1215, 958, 959, 753, 1218, 1236, 1225, 1240, 1990, 1255, -751, 1256, 1258, 1992, -1354, 1265, 1269, 1271, 1622, 1270, -1445, 394, 1275, 1144, 1280, 1282, 960, 1053, 154, 1304, 1307, 1313, 1311, 1314, 414, 1316, 1335, -751, 2038, 1356, 1373, 1386, 1393, 1407, 961, 1417, 1408, 1412, 975, 1436, 1438, 1454, 962, 1476, 333, 948, 1456, 1491, 1207, 335, 395, 1509, 1459, 1495, 1517, 1623, 1524, -751, 1212, 2012, 950, 1525, 1532, -751, 1537, 2015, 1547, 1548, 1550, 1349, 1604, 1610, -751, -751, 1012, 1634, 1376, 1614, 1611, 1624, 1663, 948, 1012, 1244, 1664, 1646, 1648, 1658, 1682, 1431, 1693, 1651, -751, 1698, 1656, 1707, 950, -751, 1699, 1695, 982, 1711, -751, 1625, 1710, 1735, 1738, 1739, 1626, 1750, 1751, 1765, 1766, 1752, 1774, -751, 1285, 1776, 1627, -1445, 1784, 1799, 1628, -751, 1012, -751, 2117, 1846, 1012, 1831, 1847, -751, 1877, 1866, 1879, 1883, 1303, 1890, 1033, 1244, 1885, 1893, 1897, 1743, 951, 1911, 1921, 1914, 1916, 1929, 1924, 1926, 1935, 1937, 1933, 1947, 1951, 1952, 1954, 1996, 2094, 2008, 1207, 2021, 2023, 1020, 2026, 2029, 2043, 2044, 2045, 2108, 2067, 2110, 1033, 1118, 1118, 1118, 2076, 1629, 951, 2069, 2088, 2095, 1941, 1118, 2106, 2100, 2096, 1630, 2107, 2128, 2152, 2143, 1034, 2145, 954, 2153, 1963, 955, 2159, 2147, 1285, 2170, 2131, 2132, 2160, 1118, 2197, 1118, 2180, 1118, 2214, 2216, 2198, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 2218, 2213, 2219, 2235, 2232, 2233, 14, 980, 956, 954, 27, 73, 955, 251, 2177, 182, 385, 238, 2188, 248, 268, 1519, 535, 744, 1319, 211, 1949, 463, 1086, 755, 1093, 2155, 1900, 270, 2199, 2117, 142, 411, 66, 335, 426, 223, 275, 940, 956, 634, 355, 923, 1801, 1125, 1970, 2203, 1102, 2112, 563, 2200, 915, 159, 1837, 523, 741, 335, 1903, 1639, 1811, 1220, 947, 1229, 1638, 803, 1835, 1457, 1702, 2018, 1873, 1447, 957, 2028, 1487, 1892, 1712, 2178, 2179, 1264, 1546, 2182, 1285, 1904, 1475, 1740, 1516, 1920, 2184, 1287, 1288, 1065, 1012, 1772, 2222, 2223, 1302, 1773, 2225, 2074, 2226, 1805, 1913, 2079, 2157, 1502, 1419, 1416, 957, 513, 1279, 2090, 1207, 2061, 2062, 1684, 1122, 958, 959, 1515, 2063, 1756, 284, 366, 1410, 1489, 1012, -1517, 931, 2211, 335, 760, 1128, 2206, 948, 902, 75, 979, 1531, 1993, 2234, 1352, 960, 0, 1285, 0, 0, 0, 414, 950, 1539, 0, -992, 958, 959, 0, 979, 0, 0, 0, 961, 0, 2224, -1517, 0, -992, 1244, 0, 962, 179, 333, 0, 0, 0, 0, 0, 0, 0, 960, 0, 0, 1118, 1118, 1118, 1118, 1118, 1118, 1118, -992, 0, 0, 0, 0, 0, 0, 2230, 961, 0, 0, 1520, 0, -992, 0, 1285, 962, 179, 333, 0, 0, 0, 0, 414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 951, 0, 0, 0, 0, 0, 947, 0, 0, 803, 0, 389, 1012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1670, 1671, 0, 0, 1138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 952, 414, 0, 0, 0, 953, 0, 0, 0, 390, 0, 954, 0, 0, 955, 0, 391, 0, 0, 0, 0, 0, -1441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 948, 0, 0, 0, 0, 0, 0, 0, 0, 956, 0, 1285, 1285, 0, 0, 950, 0, 1012, 1012, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1741, 0, 0, 0, 0, 0, 0, 0, 1285, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 0, 0, 1762, 0, 0, 0, 0, 1771, 1771, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 842, 0, 957, 0, 0, -884, 0, 0, -884, 0, 0, -884, -884, -884, 0, 0, 0, 982, 0, -884, 0, 0, 0, 0, 951, 0, 0, 0, 1796, 0, 1797, 0, 0, 0, 0, 389, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1521, 952, 0, 394, 1522, 0, 953, -1441, 960, 0, 390, 0, 954, -884, 0, 955, 0, 391, 0, 0, 0, 0, 1207, 1207, 1207, 0, 961, 0, -884, 0, 0, 0, 1118, 0, 962, 0, 333, 1118, 0, 0, 0, 0, 395, 0, 0, 0, 0, 956, 0, 0, 1012, 0, 0, 0, 0, 0, 0, 0, 0, 947, 0, 0, 803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, -884, 0, 392, 0, 0, 1876, 0, 0, 0, 0, 0, 1887, 1285, 0, 0, 0, 0, 0, 0, 0, 1285, 0, 0, 0, 0, 0, -884, -884, 0, 957, 0, 1012, 0, -884, 0, 0, 0, -884, 0, 1502, 0, 0, 0, 0, 0, 948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 950, 0, 0, 0, -884, 393, 1887, -884, -884, 0, 1285, 0, -884, 1068, 958, 959, -884, 0, -884, 0, 0, -884, 0, -884, 0, 0, 0, 0, 0, 1988, 0, 0, 0, 1988, 394, 0, -884, -884, 0, 960, 0, -884, 0, 0, 0, 0, 0, 0, 1988, 1988, 0, -884, 0, -884, 0, 0, 0, 961, -884, 0, 0, 0, 0, -884, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 0, -884, 0, 0, 951, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, 389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, 0, 0, 0, 952, 0, 0, 0, 0, 953, 1887, 0, 0, 390, 0, 954, 0, 0, 955, 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, 0, 0, 0, 0, 0, 0, 0, 0, -884, -884, 0, 0, 2071, 956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -884, 0, 0, 1988, 0, -884, 0, -578, 524, 0, -619, 0, -619, 0, 0, 0, 0, -619, 0, 0, 2111, 0, 0, -884, 0, -619, 392, 0, 0, 0, 0, -884, 0, -884, 0, 0, 0, 0, 0, -884, -884, -884, -884, -884, 0, -884, 0, -884, -884, -884, -884, -884, 0, 957, 0, 0, 1988, -619, -619, 0, 0, 0, 0, 0, -619, 0, 0, 1988, 0, 0, 1988, 0, 0, 0, 0, -619, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, -619, 0, 0, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 394, -619, -619, 0, 0, 960, 0, 0, 0, 0, 0, 0, 2167, 0, 0, 2169, 0, 0, -578, 0, 0, 0, -578, 961, 0, 0, 0, 0, 0, 0, 0, 962, -619, 333, 0, 0, 0, 0, 0, 395, 0, 0, 0, 0, -619, 2186, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1988, 0, -619, 0, 0, 1988, -578, 0, 0, -619, 0, 0, -619, -619, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, -619, 0, -619, 0, 0, -619, 2215, 0, 0, 0, 0, 0, 524, 0, -619, 0, -619, 0, 0, 2221, 0, -619, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, -619, 0, -619, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, -619, -619, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, -619, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 0, -578, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, -619, 0, 0, 0, -619, 0, 0, -619, -619, 0, 0, 0, 0, 0, 0, 635, 0, -619, 0, 0, 0, 0, -619, 0, -619, 0, 0, 0, 0, 0, 0, 0, -619, 0, 947, 0, 0, 803, -619, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, -619, -619, 0, 0, -619, 0, 0, 0, 0, 0, -619, 0, -619, -619, 0, 0, -619, -619, -619, 0, 0, 0, 0, -619, -619, 0, 0, -619, -619, 0, 0, 0, 0, 0, 0, -619, 0, 0, -619, 0, 0, 0, -619, -619, -619, 0, 0, -619, -619, 0, 0, 0, 0, 0, 0, 0, 948, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 525, 0, 0, -619, 950, 0, 0, 0, 0, 0, 0, 0, 0, 526, 0, -619, 0, 1068, 0, -619, 0, -619, 0, 0, 947, 0, 0, 803, -619, 0, 1168, 1169, 1170, 0, 0, 0, 0, 0, 1171, 0, 567, 568, 569, 570, 571, 572, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 0, 0, 0, 574, 0, 575, 576, 577, 578, 579, 580, 0, 0, 0, 0, -619, 0, 951, 0, 0, 0, 0, 0, 0, -619, 948, 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, 0, -619, 0, 0, 950, 0, -619, 0, -619, 581, 0, 0, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 952, 0, 0, 0, -619, 953, 0, 0, 0, 390, 0, 954, 0, -619, 955, 0, 391, 0, 0, 0, 0, 0, -619, 0, -619, -619, 0, 0, -619, 0, -619, 0, 0, 0, 0, -619, 0, 0, 0, 1172, 1173, 0, 0, 0, 0, 0, 956, 0, 0, 0, -619, 0, 0, 0, 0, -619, 0, 0, 0, 0, -619, 0, 0, 0, 0, 0, 951, 1174, 0, 582, 0, -619, 0, 1175, 0, 0, 0, 389, 0, 525, 0, 0, -619, 0, 0, 0, 0, 392, 0, 0, 0, 0, 526, 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, 0, 1176, 0, 0, 952, 1177, 0, 0, 0, 953, 0, 957, 0, 390, 0, 954, 584, 0, 955, 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, 947, 0, 0, 803, 1178, 1179, 1168, 1169, 1170, 1180, 0, 0, 0, 0, 1171, 0, 0, 0, 393, 1181, 0, 956, 0, 0, 586, 0, 1182, 958, 959, 0, 0, 1183, 0, 588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 589, 394, 0, 1184, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 0, 0, 961, 0, 948, 0, 0, 0, 0, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 950, 0, 957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 593, 594, 595, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 1172, 1173, 0, 0, 0, 0, 0, 597, 598, 599, 394, 0, 0, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 951, 1174, 0, 0, 0, 0, 961, 1175, 0, 0, 0, 389, 0, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 1185, 1186, 1187, 1188, 0, 1189, 0, 1190, 1191, 1192, 1193, 1194, 0, 0, 0, 1176, 0, 0, 952, 1177, 0, 0, 0, 953, 0, 0, 0, 390, 0, 954, 0, 0, 955, 0, 391, 639, 0, 640, 0, 0, 0, 0, 641, 0, 0, 0, 0, 1178, 1179, 0, 642, 0, 1180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1181, 0, 956, 0, 0, 0, 0, 1182, 0, 0, 0, 0, 1183, 0, 0, 0, 0, 0, 0, 0, 643, 644, 0, 0, 0, 0, 0, 645, 0, 0, 1184, 0, 0, 0, 0, 0, 0, 0, 646, 0, 0, 647, 0, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 648, 947, 0, 0, 803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 957, 0, 0, 0, 0, 649, 0, 0, 0, 0, 0, 0, 650, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 652, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 653, 948, 0, 0, 654, 0, 0, 0, 0, 0, 394, 0, 949, 0, 0, 960, 950, 655, 0, 0, 0, 0, 0, 0, 656, 0, 0, 657, 658, 0, 0, 0, 0, 961, 0, 659, 0, 0, 0, 0, 0, 962, 660, 333, 661, 0, 0, 662, 0, 395, 1185, 1186, 1187, 1188, 0, 1189, 0, 1190, 1191, 1192, 1193, 1194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 663, 639, 0, 640, 664, 0, 665, 0, 641, 0, 0, 0, 0, 666, 0, 0, 642, 0, 951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, 947, 0, 0, 803, 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 644, 668, 0, 0, 0, 0, 645, 0, 0, 0, 952, 0, 0, 0, 0, 953, 0, 646, 0, 390, 647, 954, 669, 0, 955, 0, 391, 0, 0, 0, 0, 670, 648, 0, 0, 947, 0, 0, 803, 0, 0, 0, 0, 0, 671, 0, 0, 947, 0, 672, 803, 673, 0, 948, 649, 0, 956, 0, 0, 674, 0, 650, 651, 0, 1027, 0, 0, 0, 950, 675, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 0, 0, 0, 0, 0, 0, 0, 677, 0, 678, 679, 0, 652, 680, 0, 681, 0, 392, 0, 0, 682, 0, 0, 0, 653, 0, 0, 948, 654, 0, 0, 0, 0, 0, 0, 683, 0, 0, 1072, 948, 684, 655, 950, 0, 957, 685, 0, 0, 656, 0, 0, 657, 658, 0, 950, 0, 686, 0, 0, 659, 0, 0, 0, 0, 0, 0, 660, 687, 661, 0, 0, 662, 951, 0, 0, 0, 0, 688, 0, 0, 393, 0, 0, 389, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 663, 0, 0, 394, 664, 0, 665, 952, 960, 0, 0, 0, 953, 666, 0, 0, 390, 0, 954, 0, 951, 955, 0, 391, 0, 0, 961, 0, 0, 0, 947, 389, 951, 803, 962, 667, 333, 0, 0, 0, 0, 0, 395, 389, 0, 0, 0, 0, 0, 0, 668, 0, 0, 956, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 0, 0, 953, 0, 0, 0, 390, 669, 954, 952, 0, 955, 0, 391, 953, 0, 670, 0, 390, 0, 954, 0, 0, 955, 0, 391, 0, 0, 0, 671, 392, 0, 0, 0, 672, 0, 673, 0, 948, 0, 0, 0, 0, 956, 674, 0, 0, 947, 0, 0, 803, 0, 0, 950, 675, 956, 0, 957, 0, 947, 0, 0, 803, 676, 0, 0, 0, 0, 0, 0, 0, 0, 677, 0, 678, 679, 0, 0, 680, 0, 681, 0, 0, 0, 392, 682, 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 392, 0, 0, 0, 683, 0, 958, 959, 0, 684, 0, 0, 0, 0, 685, 957, 0, 947, 0, 0, 803, 0, 0, 948, 0, 686, 394, 957, 0, 0, 0, 960, 0, 803, 0, 948, 687, 1306, 950, 0, 0, 951, 0, 0, 0, 0, 0, 0, 0, 961, 950, 393, 389, 0, 0, 0, 0, 962, 0, 333, 958, 959, 0, 393, 0, 395, 0, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 394, 0, 952, 0, 0, 960, 0, 953, 1162, 948, 0, 390, 394, 954, 0, 0, 955, 960, 391, 0, 0, 0, 948, 961, 950, 0, 0, 0, 0, 0, 0, 962, 0, 333, 0, 961, 0, 950, 0, 395, 0, 0, 951, 962, 0, 333, 0, 0, 956, 0, 0, 395, 0, 389, 951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 389, 947, 0, 0, 803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 0, 0, 953, 392, 0, 0, 390, 0, 954, 952, 0, 955, 0, 391, 953, 0, 0, 0, 390, 0, 954, 0, 951, 955, 0, 391, 0, 0, 0, 0, 957, 0, 0, 389, 0, 951, 0, 0, 0, 0, 0, 0, 0, 956, 0, 0, 389, 0, 0, 0, 0, 0, 948, 0, 0, 956, 0, 0, 0, 0, 0, 0, 0, 952, 0, 0, 393, 950, 953, 0, 0, 0, 390, 0, 954, 958, 959, 955, 0, 391, 0, 0, 0, 0, 392, 390, 0, 954, 0, 0, 955, 0, 391, 0, 0, 394, 392, 0, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 956, 0, 957, 0, 0, 0, 0, 0, 0, 961, 0, 0, 0, 956, 957, 0, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 1529, 0, 0, 0, 0, 0, 393, 0, 0, 392, 951, 0, 0, 1658, 0, 958, 959, 0, 393, 0, 0, 389, 392, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 394, 957, 0, 0, 0, 960, 0, 0, 0, 0, 0, 0, 394, 0, 957, 0, 952, 960, 0, 0, 0, 953, 0, 961, 0, 991, 0, 954, 0, 0, 955, 962, 391, 333, 0, 961, 0, 393, 0, 395, 0, 0, 0, 962, 0, 333, 958, 959, 0, 0, 393, 395, 0, 0, 0, 0, 0, 0, 0, 958, 959, 0, 956, 0, 0, 0, 394, 0, 0, 0, 0, 960, 0, 948, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 960, 0, 0, 0, 950, 961, 0, 0, 0, 0, 0, 0, 0, 962, 0, 333, 0, 0, 961, 392, 0, 395, 0, 565, 0, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 566, 0, 0, 567, 568, 569, 570, 571, 572, 573, 0, 957, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 574, 0, 575, 576, 577, 578, 579, 580, 0, 0, 393, 0, 0, 0, 0, 0, 951, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 581, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 961, 0, 0, 0, 390, 0, 954, 0, 962, 955, 333, 391, 0, 0, 0, 0, 395, 0, 0, 0, 0, 1557, 0, 1558, 0, 0, 1559, 567, 568, 569, 570, 571, 572, 573, 1560, 1561, 1562, 0, 0, 0, 0, 956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1563, 0, 0, 0, 0, 0, 0, 574, 582, 575, 576, 577, 578, 579, 580, 0, 0, 0, 0, 0, 0, 40, 0, 0, 583, 0, 0, 0, 392, 0, -1498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 581, 0, 0, 0, 948, 0, 957, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 585, 0, 0, 0, 0, 0, 0, 0, 0, 1564, 0, 393, 0, 0, 0, 586, 0, 0, 0, 0, 958, 959, 587, 0, 588, 0, 0, 1565, 0, 0, 1566, 1567, 0, 0, 0, 0, 0, 589, 0, 0, 394, 0, 0, 0, 1568, 960, 0, 590, 0, 0, 0, 582, 0, 0, 591, 0, 0, 0, 0, 0, 0, 0, 0, 961, 0, 0, 0, 583, 0, 0, 0, 962, 951, 333, 0, 0, 0, 0, 0, 395, 0, 1569, 0, 389, 0, 948, 0, 0, 0, 0, 1570, 592, 0, 593, 594, 595, 0, 0, 0, 0, 950, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1110, 0, 0, 0, 596, 953, 0, 0, 0, 390, 1571, 954, 0, 0, 955, 0, 391, 0, 0, 0, 0, -1498, 0, 0, 1572, 586, 0, 0, 0, 597, 598, 599, 587, 0, 588, 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, 601, 956, 589, 1573, 0, 0, 0, 948, 0, 0, 0, 567, 568, 569, 570, 571, 572, 573, 0, -317, 0, 0, 950, 0, 0, 0, 951, 1574, 0, 0, 0, 0, 1575, 0, 0, 0, 0, 389, 1955, 1956, 0, 0, 392, 0, 0, 574, 1576, 575, 576, 577, 578, 579, 580, 0, 0, 0, 592, 0, 593, 594, 595, 0, 0, 0, 0, 0, 0, 1110, 0, 957, 0, 0, 953, 0, 0, 0, 390, 0, 954, 0, 0, 955, 0, 391, 0, 0, 0, 581, 0, 0, 0, 0, 1577, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1578, 0, 393, 951, 597, 598, 599, 0, 0, 0, 956, 958, 959, 0, 389, 0, 0, 600, 0, 1579, 601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 960, 0, 0, 1580, 0, 0, 0, 0, 1110, 0, 0, 0, 0, 953, 0, 392, 0, 390, 961, 954, 0, 1957, 955, 0, 391, 0, 962, 0, 333, 0, 582, 0, 0, 0, 395, 1111, 1112, 0, 0, 0, 0, 0, 957, 1113, 1602, 0, 583, 0, 0, 0, 0, 0, 0, 0, 956, 0, 0, 0, 0, 0, 1958, 1959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, 584, 0, 0, 0, 0, 1960, 0, 958, 959, 0, 0, 0, 0, 0, 0, 392, 0, 0, 0, 0, 0, 0, 585, 0, 0, 0, 0, 394, 0, 0, 0, 0, 960, 0, 0, 0, 0, 586, 0, 0, 0, 0, 957, 0, 587, 0, 588, 0, 0, 1961, 961, 0, 0, 0, 0, 0, 0, 0, 962, 589, 333, 0, 0, 0, 0, 0, 395, 1111, 1112, 0, 0, 0, 0, 0, 0, 1113, 1817, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 958, 959, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 960, 592, 0, 593, 594, 595, 0, 0, 0, 0, 1962, 0, 0, 0, 0, 0, 0, 0, 961, 0, 0, 0, 0, 0, 1963, 0, 962, 0, 333, 0, 0, 0, 0, 0, 395, 1111, 1112, 0, 0, 0, 0, 0, 0, 1113, 0, 0, 0, 1964, 0, 0, 0, 0, 597, 598, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, 601, 1965, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1966 }; static const short yycheck[] = { 83, 165, 364, 621, 657, 601, 236, 478, 805, 410, 480, 1095, 831, 1267, 1068, 1177, 686, 590, 259, 826, 261, 627, 263, 1062, 188, 189, 190, 828, 192, 836, 194, 844, 185, 1496, 769, 827, 1376, 1377, 191, 259, 962, 261, 1052, 263, 857, 1644, 564, 13, 1162, 433, 9, 9, 1010, 330, 17, 984, 1334, 210, 6, 1334, 1018, 1334, 226, 1231, 228, 6, 149, 1222, 1223, 1224, 1253, 235, 6, 544, 1334, 1334, 1334, 27, 825, 243, 22, 311, 323, 58, 67, 17, 833, 834, 318, 81, 331, 255, 256, 9, 258, 91, 53, 338, 262, 6, 1139, 848, 849, 323, 47, 71, 1064, 91, 6, 84, 85, 331, 265, 266, 1228, 862, 863, 55, 338, 396, 143, 87, 69, 11, 365, 116, 290, 60, 1138, 293, 294, 361, 296, 115, 48, 1271, 67, 175, 368, 55, 55, 69, 115, 1777, 1258, 365, 165, 367, 312, 165, 947, 381, 1335, 207, 67, 952, 164, 627, 67, 109, 1429, 67, 564, 1762, 866, 329, 116, 115, 56, 1098, 63, 9, 48, 1356, 227, 162, 1445, 9, 408, 29, 798, 55, 412, 403, 425, 290, 48, 464, 341, 272, 227, 117, 1306, 756, 200, 21, 88, 47, 63, 363, 227, 227, 82, 91, 92, 425, 94, 371, 1133, 207, 144, 290, 1009, 211, 102, 207, 374, 22, 965, 108, 82, 48, 269, 1563, 1493, 315, 231, 974, 846, 1569, 30, 1360, 207, 1765, 112, 1245, 466, 1935, 1367, 1937, 21, 227, 1326, 239, 628, 1374, 993, 1060, 39, 479, 180, 167, 242, 1721, 772, 101, 420, 1311, 165, 27, 206, 309, 269, 346, 1533, 207, 349, 919, 156, 227, 101, 112, 24, 29, 169, 439, 440, 300, 169, 1462, 1027, 511, 117, 990, 312, 0, 516, 231, 1456, 392, 2211, 1459, 227, 1407, 309, 9, 311, 1307, 36, 295, 216, 521, 522, 8, 104, 239, 924, 251, 283, 2230, 256, 475, 908, 1110, 249, 362, 364, 365, 168, 309, 270, 311, 1069, 169, 429, 430, 161, 1074, 362, 34, 1367, 1289, 337, 939, 424, 181, 500, 1374, 227, 1046, 228, 109, 445, 1162, 508, 503, 1275, 238, 278, 227, 429, 227, 9, 339, 289, 585, 1366, 344, 1890, 224, 407, 934, 935, 370, 120, 312, 1420, 350, 396, 107, 772, 591, 124, 407, 937, 938, 203, 430, 2076, 543, 306, 851, 227, 436, 548, 9, 227, 551, 552, 443, 554, 555, 1661, 430, 558, 227, 311, 1436, 291, 1101, 1052, 315, 207, 430, 430, 443, 1213, 430, 395, 1228, 1546, 430, 2046, 251, 430, 1162, 9, 423, 1886, 350, 353, 1889, 430, 1230, 319, 49, 291, 227, 354, 321, 1355, 413, 430, 425, 430, 315, 600, 350, 429, 1258, 413, 350, 1255, 234, 350, 393, 430, 1239, 1195, 396, 1408, 277, 393, 315, 342, 393, 399, 385, 390, 1111, 1112, 1113, 55, 446, 427, 413, 423, 828, 443, 1121, 308, 430, 430, 211, 188, 1485, 1939, 1269, 444, 429, 1227, 1228, 430, 1612, 400, 846, 1138, 1306, 430, 430, 851, 1143, 384, 1145, 382, 1147, 430, 1149, 1752, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1517, 1126, 1787, 424, 1258, 1787, 227, 1787, 446, 1460, 758, 759, 1172, 234, 1465, 429, 430, 765, 1317, 803, 1787, 1787, 1787, 1698, 188, 430, 446, 1492, 1690, 756, 446, 758, 759, 446, 430, 430, 48, 424, 765, 1293, 1816, 1018, 399, 1297, 1298, 430, 1300, 430, 443, 940, 431, 919, 1306, 436, 160, 424, 48, 188, 2033, 1036, 1274, 394, 1142, 227, 1134, 398, 2036, 167, 1612, 1149, 234, 67, 429, 162, 1695, 746, 1697, 748, 430, 1104, 2186, 1407, 430, 820, 305, 1775, 1245, 218, 188, 227, 1332, 429, 430, 1869, 200, 1871, 227, 768, 191, 133, 827, 231, 208, 234, 157, 1666, 394, 1810, 1955, 354, 398, 1732, 259, 227, 120, 176, 216, 227, 919, 1418, 847, 251, 60, 1899, 851, 239, 853, 227, 855, 856, 231, 858, 443, 358, 234, 67, 133, 242, 231, 887, 239, 305, 193, 1764, 31, 833, 873, 368, 1307, 180, 251, 216, 936, 161, 1930, 1931, 904, 1237, 251, 111, 887, 216, 242, 890, 193, 443, 1279, 180, 1036, 283, 1283, 1491, 278, 181, 305, 863, 397, 904, 1337, 2149, 917, 238, 407, 953, 114, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 302, 231, 1711, 922, 144, 236, 1663, 1635, 1636, 1637, 173, 180, 368, 305, 26, 1366, 978, 430, 937, 938, 180, 251, 1643, 436, 267, 443, 180, 1648, 1649, 180, 882, 1652, 1653, 1654, 279, 1656, 1657, 1680, 1681, 1208, 289, 397, 905, 340, 217, 368, 1799, 29, 301, 1692, 832, 1111, 1112, 1113, 275, 253, 1809, 1810, 1427, 11, 1769, 1121, 67, 344, 227, 1337, 1566, 394, 340, 300, 852, 398, 854, 1730, 397, 301, 368, 859, 1524, 158, 436, 63, 238, 1143, 236, 1145, 868, 1147, 227, 1149, 429, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 9, 430, 4, 393, 919, 56, 397, 236, 429, 400, 1278, 1382, 315, 301, 436, 1466, 338, 19, 348, 1111, 1112, 1113, 2016, 2017, 1475, 430, 28, 331, 331, 1121, 1048, 436, 315, 430, 289, 1485, 1486, 429, 430, 430, 91, 92, 426, 94, 400, 436, 55, 443, 331, 300, 1318, 102, 295, 1145, 400, 2107, 1095, 235, 60, 1151, 1152, 1153, 1154, 350, 336, 1157, 1158, 1517, 191, 192, 338, 300, 236, 2140, 2141, 1103, 231, 1095, 1695, 338, 1697, 331, 358, 24, 25, 338, 1047, 11, 1830, 437, 438, 188, 173, 358, 1699, 366, 251, 348, 2058, 249, 2060, 150, 151, 1845, 985, 156, 439, 440, 231, 442, 195, 1948, 358, 443, 12, 1732, 1134, 15, 16, 348, 855, 424, 1083, 64, 353, 66, 1868, 350, 251, 178, 227, 407, 1094, 1875, 96, 184, 300, 234, 873, 224, 443, 424, 407, 224, 294, 1750, 70, 1764, 181, 1520, 437, 438, 439, 440, 1605, 442, 97, 98, 99, 446, 443, 407, 2214, 443, 2016, 2017, 215, 1909, 1910, 1437, 219, 265, 160, 444, 207, 289, 1918, 228, 1337, 188, 294, 204, 437, 438, 348, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 443, 195, 1739, 1645, 1111, 1112, 1113, 358, 1650, 430, 79, 144, 227, 146, 1121, 216, 305, 8, 291, 1511, 200, 154, 437, 438, 439, 440, 227, 442, 208, 1239, 224, 446, 309, 234, 1526, 1495, 1143, 231, 1145, 316, 1147, 327, 346, 34, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 114, 231, 350, 163, 407, 2131, 443, 1269, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 224, 225, 1711, 78, 1531, 2006, 251, 188, 297, 2010, 1719, 1538, 368, 120, 367, 276, 369, 268, 93, 270, 443, 282, 161, 430, 2025, 225, 201, 443, 1326, 1327, 1488, 278, 342, 1837, 209, 1710, 443, 305, 412, 239, 1317, 397, 181, 46, 426, 429, 227, 429, 309, 1326, 1327, 425, 2053, 234, 2055, 316, 59, 443, 469, 443, 1769, 148, 188, 474, 443, 2066, 1792, 346, 329, 314, 286, 287, 382, 114, 437, 438, 439, 440, 443, 442, 436, 1807, 1808, 446, 300, 2086, 2087, 244, 245, 301, 1765, 218, 353, 96, 153, 356, 223, 129, 157, 206, 368, 227, 177, 364, 300, 262, 263, 394, 234, 1963, 443, 398, 188, 374, 32, 260, 261, 35, 1922, 206, 430, 309, 443, 311, 305, 43, 44, 45, 346, 397, 346, 2, 400, 155, 395, 6, 444, 159, 118, 447, 448, 1418, 86, 87, 432, 2021, 253, 2023, 1566, 256, 277, 227, 227, 1394, 229, 163, 1397, 232, 234, 346, 405, 1402, 430, 260, 261, 2166, 110, 254, 436, 256, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 230, 147, 305, 149, 255, 443, 257, 429, 331, 309, 368, 311, 264, 6, 391, 9, 9, 430, 12, 224, 225, 15, 16, 147, 1729, 149, 443, 207, 443, 443, 1734, 188, 212, 443, 443, 349, 1740, 443, 1890, 397, 209, 395, 222, 443, 346, 1948, 430, 226, 352, 430, 1645, 443, 305, 430, 1143, 1650, 443, 152, 1147, 175, 273, 443, 2043, 23, 385, 368, 1155, 1156, 443, 346, 227, 362, 430, 322, 1549, 170, 207, 234, 436, 101, 332, 437, 438, 439, 440, 78, 442, 430, 443, 246, 1554, 374, 187, 449, 6, 1549, 1801, 9, 2001, 357, 93, 437, 438, 439, 440, 55, 442, 1571, 81, 2012, 169, 443, 2015, 449, 1589, 368, 341, 1645, 437, 438, 439, 440, 1650, 442, 346, 377, 378, 1525, 362, 309, 310, 430, 1607, 436, 273, 1589, 48, 103, 233, 227, 204, 353, 322, 240, 324, 443, 65, 443, 305, 430, 402, 346, 1550, 1607, 443, 240, 22, 150, 267, 430, 1558, 443, 2143, 284, 285, 2146, 78, 1565, 420, 227, 82, 291, 1647, 443, 443, 80, 428, 80, 430, 425, 307, 93, 430, 436, 177, 280, 430, 437, 438, 439, 440, 393, 442, 1647, 390, 188, 446, 225, 30, 430, 32, 193, 309, 35, 325, 326, 416, 417, 418, 419, 393, 368, 354, 45, 371, 372, 2197, 54, 1616, 2122, 374, 1619, 429, 36, 2127, 218, 437, 438, 439, 440, 223, 442, 26, 181, 227, 446, 229, 362, 333, 232, 443, 234, 443, 346, 424, 443, 374, 211, 343, 430, 244, 245, 354, 218, 2235, 437, 438, 439, 440, 427, 442, 336, 207, 443, 446, 177, 227, 103, 262, 263, 296, 264, 371, 277, 2104, 271, 188, 436, 393, 436, 2132, 824, 445, 26, 390, 828, 416, 417, 418, 419, 833, 352, 267, 168, 1645, 838, 839, 450, 443, 1650, 443, 844, 845, 846, 430, 227, 218, 130, 851, 404, 101, 223, 305, 17, 857, 227, 429, 229, 166, 1783, 232, 181, 234, 866, 867, 1723, 869, 437, 438, 439, 440, 445, 442, 227, 390, 392, 446, 29, 170, 332, 121, 445, 174, 122, 445, 2232, 2233, 416, 417, 418, 419, 445, 264, 445, 445, 187, 445, 269, 445, 437, 438, 439, 440, 1959, 442, 445, 445, 198, 446, 437, 438, 439, 440, 445, 442, 368, 919, 55, 446, 445, 393, 423, 124, 338, 377, 378, 309, 126, 95, 127, 389, 1789, 393, 305, 131, 48, 1794, 392, 132, 390, 387, 233, 392, 315, 397, 173, 949, 137, 425, 402, 239, 48, 140, 173, 323, 106, 370, 1734, 270, 108, 332, 1896, 108, 429, 393, 430, 180, 420, 299, 331, 388, 227, 415, 157, 128, 428, 165, 430, 78, 427, 393, 984, 1896, 436, 203, 427, 356, 393, 280, 48, 362, 444, 1850, 93, 211, 173, 368, 203, 1856, 116, 270, 186, 442, 355, 435, 377, 378, 1010, 260, 224, 211, 434, 304, 331, 78, 1018, 1019, 393, 446, 446, 363, 125, 256, 255, 446, 397, 17, 446, 321, 93, 402, 390, 180, 1036, 48, 407, 328, 393, 132, 8, 173, 333, 427, 120, 393, 9, 427, 297, 420, 1052, 298, 343, 424, 167, 195, 347, 428, 1060, 430, 1983, 319, 1064, 258, 334, 436, 119, 259, 424, 104, 1072, 48, 171, 1075, 424, 169, 275, 253, 177, 135, 252, 136, 231, 290, 138, 279, 107, 384, 274, 7, 110, 213, 64, 394, 1951, 123, 1098, 318, 318, 1101, 130, 96, 48, 231, 211, 1962, 139, 1964, 171, 1111, 1112, 1113, 90, 404, 177, 257, 142, 87, 254, 1121, 185, 196, 214, 414, 427, 430, 2039, 48, 227, 396, 229, 334, 380, 232, 231, 297, 1138, 141, 1995, 1996, 231, 1143, 173, 1145, 168, 1147, 412, 134, 283, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 274, 297, 274, 48, 150, 150, 6, 227, 264, 229, 21, 53, 232, 182, 2094, 128, 317, 167, 2109, 177, 196, 1290, 460, 537, 1084, 132, 1779, 396, 887, 549, 893, 2045, 1733, 212, 2114, 2115, 107, 346, 48, 2109, 2131, 149, 217, 819, 264, 522, 284, 797, 1591, 924, 1787, 2129, 907, 1978, 505, 2115, 772, 120, 1668, 442, 533, 2131, 1737, 1379, 1631, 993, 6, 998, 1378, 9, 1666, 1233, 1459, 1863, 1698, 1230, 332, 1880, 1248, 1719, 1483, 2095, 2096, 1036, 1318, 2099, 1245, 1738, 1242, 1507, 1283, 1754, 2106, 1058, 1060, 858, 1255, 1538, 2178, 2179, 1069, 1538, 2182, 1933, 2184, 1609, 1745, 1938, 2046, 1268, 1202, 1195, 332, 2204, 1048, 1944, 1275, 1923, 1923, 1434, 920, 377, 378, 1282, 1923, 1520, 224, 292, 1167, 1253, 1289, 387, 802, 2147, 2204, 556, 929, 2133, 78, 762, 56, 2211, 1301, 1795, 2224, 1124, 402, -1, 1307, -1, -1, -1, 2085, 93, 1313, -1, 412, 377, 378, -1, 2230, -1, -1, -1, 420, -1, 2180, 387, -1, 425, 1329, -1, 428, 429, 430, -1, -1, -1, -1, -1, -1, -1, 402, -1, -1, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 412, -1, -1, -1, -1, -1, -1, 2213, 420, -1, -1, 143, -1, 425, -1, 1366, 428, 429, 430, -1, -1, -1, -1, 2148, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1386, -1, -1, -1, -1, -1, -1, -1, -1, -1, 177, -1, -1, -1, -1, -1, 6, -1, -1, 9, -1, 188, 1408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1421, 1422, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 218, 2212, -1, -1, -1, 223, -1, -1, -1, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, 264, -1, 1485, 1486, -1, -1, 93, -1, 1491, 1492, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1509, -1, -1, -1, -1, -1, -1, -1, 1517, -1, -1, -1, -1, -1, -1, 305, -1, -1, -1, -1, -1, -1, -1, 1532, -1, -1, -1, -1, 1537, 1538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 332, -1, -1, 6, -1, -1, 9, -1, -1, 12, 13, 14, -1, -1, -1, 1566, -1, 20, -1, -1, -1, -1, 177, -1, -1, -1, 1577, -1, 1579, -1, -1, -1, -1, 188, -1, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, 218, -1, 397, 398, -1, 223, 224, 402, -1, 227, -1, 229, 78, -1, 232, -1, 234, -1, -1, -1, -1, 1635, 1636, 1637, -1, 420, -1, 93, -1, -1, -1, 1645, -1, 428, -1, 430, 1650, -1, -1, -1, -1, 436, -1, -1, -1, -1, 264, -1, -1, 1663, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 150, 151, -1, 305, -1, -1, 1704, -1, -1, -1, -1, -1, 1710, 1711, -1, -1, -1, -1, -1, -1, -1, 1719, -1, -1, -1, -1, -1, 177, 178, -1, 332, -1, 1730, -1, 184, -1, -1, -1, 188, -1, 1738, -1, -1, -1, -1, -1, 78, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, 215, 368, 1765, 218, 219, -1, 1769, -1, 223, 106, 377, 378, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, -1, -1, -1, 1788, -1, -1, -1, 1792, 397, -1, 247, 248, -1, 402, -1, 252, -1, -1, -1, -1, -1, -1, 1807, 1808, -1, 262, -1, 264, -1, -1, -1, 420, 269, -1, -1, -1, -1, 274, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, -1, -1, -1, -1, -1, -1, -1, 292, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, 305, 188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 203, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, 218, -1, -1, -1, -1, 223, 1890, -1, -1, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, 1929, 264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, 1948, -1, 402, -1, 0, 1, -1, 3, -1, 5, -1, -1, -1, -1, 10, -1, -1, 1965, -1, -1, 420, -1, 18, 305, -1, -1, -1, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, 437, 438, 439, 440, -1, 442, -1, 444, 445, 446, 447, 448, -1, 332, -1, -1, 2001, 50, 51, -1, -1, -1, -1, -1, 57, -1, -1, 2012, -1, -1, 2015, -1, -1, -1, -1, 68, -1, -1, 71, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, 83, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, 397, 112, 113, -1, -1, 402, -1, -1, -1, -1, -1, -1, 2075, -1, -1, 2078, -1, -1, 129, -1, -1, -1, 133, 420, -1, -1, -1, -1, -1, -1, -1, 428, 143, 430, -1, -1, -1, -1, -1, 436, -1, -1, -1, -1, 155, 2108, -1, -1, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2122, -1, 172, -1, -1, 2127, 176, -1, -1, 179, -1, -1, 182, 183, -1, -1, -1, -1, -1, -1, 190, -1, -1, -1, -1, -1, -1, 197, -1, 199, -1, -1, 202, 2155, -1, -1, -1, -1, -1, 1, -1, 3, -1, 5, -1, -1, 2168, -1, 10, -1, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, 241, -1, 243, -1, -1, -1, -1, -1, -1, 250, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, 272, -1, -1, -1, 68, -1, -1, 71, -1, -1, -1, -1, -1, -1, -1, 287, -1, -1, -1, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, 301, -1, -1, -1, -1, -1, -1, 308, -1, -1, -1, -1, 105, -1, -1, -1, 317, -1, -1, 112, 113, -1, -1, -1, -1, -1, -1, 120, -1, 330, -1, -1, -1, -1, 335, -1, 337, -1, -1, -1, -1, -1, -1, -1, 345, -1, 6, -1, -1, 9, 143, -1, -1, -1, 355, -1, -1, -1, -1, -1, -1, -1, 155, 364, -1, -1, 159, -1, -1, -1, -1, -1, 373, -1, 375, 376, -1, -1, 379, 172, 381, -1, -1, -1, -1, 386, 179, -1, -1, 182, 183, -1, -1, -1, -1, -1, -1, 190, -1, -1, 401, -1, -1, -1, 197, 406, 199, -1, -1, 202, 411, -1, -1, -1, -1, -1, -1, -1, 78, -1, -1, 422, -1, -1, -1, -1, -1, -1, -1, 430, -1, -1, 433, 93, -1, -1, -1, -1, -1, -1, -1, -1, 443, -1, 237, -1, 106, -1, 241, -1, 243, -1, -1, 6, -1, -1, 9, 250, -1, 12, 13, 14, -1, -1, -1, -1, -1, 20, -1, 36, 37, 38, 39, 40, 41, -1, -1, -1, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 287, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, 308, -1, 177, -1, -1, -1, -1, -1, -1, 317, 78, -1, -1, 188, -1, -1, -1, -1, -1, -1, -1, -1, 330, -1, -1, 93, -1, 335, -1, 337, 112, -1, -1, -1, -1, -1, -1, 345, -1, -1, -1, -1, -1, 218, -1, -1, -1, 355, 223, -1, -1, -1, 227, -1, 229, -1, 364, 232, -1, 234, -1, -1, -1, -1, -1, 373, -1, 375, 376, -1, -1, 379, -1, 381, -1, -1, -1, -1, 386, -1, -1, -1, 150, 151, -1, -1, -1, -1, -1, 264, -1, -1, -1, 401, -1, -1, -1, -1, 406, -1, -1, -1, -1, 411, -1, -1, -1, -1, -1, 177, 178, -1, 194, -1, 422, -1, 184, -1, -1, -1, 188, -1, 430, -1, -1, 433, -1, -1, -1, -1, 305, -1, -1, -1, -1, 443, -1, -1, -1, 207, -1, -1, -1, -1, -1, -1, -1, 215, -1, -1, 218, 219, -1, -1, -1, 223, -1, 332, -1, 227, -1, 229, 244, -1, 232, -1, 234, -1, -1, -1, -1, -1, -1, -1, -1, 6, -1, -1, 9, 247, 248, 12, 13, 14, 252, -1, -1, -1, -1, 20, -1, -1, -1, 368, 262, -1, 264, -1, -1, 281, -1, 269, 377, 378, -1, -1, 274, -1, 290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 303, 397, -1, 292, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, 305, -1, -1, -1, -1, -1, -1, -1, 420, -1, 78, -1, -1, -1, -1, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, 93, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, 150, 151, -1, -1, -1, -1, -1, 408, 409, 410, 397, -1, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 177, 178, -1, -1, -1, -1, 420, 184, -1, -1, -1, 188, -1, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, 437, 438, 439, 440, -1, 442, -1, 444, 445, 446, 447, 448, -1, -1, -1, 215, -1, -1, 218, 219, -1, -1, -1, 223, -1, -1, -1, 227, -1, 229, -1, -1, 232, -1, 234, 3, -1, 5, -1, -1, -1, -1, 10, -1, -1, -1, -1, 247, 248, -1, 18, -1, 252, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, 264, -1, -1, -1, -1, 269, -1, -1, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, 50, 51, -1, -1, -1, -1, -1, 57, -1, -1, 292, -1, -1, -1, -1, -1, -1, -1, 68, -1, -1, 71, -1, 305, -1, -1, -1, -1, -1, -1, -1, -1, -1, 83, 6, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 332, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, 112, 113, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, 143, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, 155, 78, -1, -1, 159, -1, -1, -1, -1, -1, 397, -1, 89, -1, -1, 402, 93, 172, -1, -1, -1, -1, -1, -1, 179, -1, -1, 182, 183, -1, -1, -1, -1, 420, -1, 190, -1, -1, -1, -1, -1, 428, 197, 430, 199, -1, -1, 202, -1, 436, 437, 438, 439, 440, -1, 442, -1, 444, 445, 446, 447, 448, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, 3, -1, 5, 241, -1, 243, -1, 10, -1, -1, -1, -1, 250, -1, -1, 18, -1, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 188, 6, -1, -1, 9, -1, 272, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, 287, -1, -1, -1, -1, 57, -1, -1, -1, 218, -1, -1, -1, -1, 223, -1, 68, -1, 227, 71, 229, 308, -1, 232, -1, 234, -1, -1, -1, -1, 317, 83, -1, -1, 6, -1, -1, 9, -1, -1, -1, -1, -1, 330, -1, -1, 6, -1, 335, 9, 337, -1, 78, 105, -1, 264, -1, -1, 345, -1, 112, 113, -1, 89, -1, -1, -1, 93, 355, -1, -1, -1, -1, -1, -1, -1, -1, 364, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, 375, 376, -1, 143, 379, -1, 381, -1, 305, -1, -1, 386, -1, -1, -1, 155, -1, -1, 78, 159, -1, -1, -1, -1, -1, -1, 401, -1, -1, 89, 78, 406, 172, 93, -1, 332, 411, -1, -1, 179, -1, -1, 182, 183, -1, 93, -1, 422, -1, -1, 190, -1, -1, -1, -1, -1, -1, 197, 433, 199, -1, -1, 202, 177, -1, -1, -1, -1, 443, -1, -1, 368, -1, -1, 188, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, 397, 241, -1, 243, 218, 402, -1, -1, -1, 223, 250, -1, -1, 227, -1, 229, -1, 177, 232, -1, 234, -1, -1, 420, -1, -1, -1, 6, 188, 177, 9, 428, 272, 430, -1, -1, -1, -1, -1, 436, 188, -1, -1, -1, -1, -1, -1, 287, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, -1, 223, -1, -1, -1, 227, 308, 229, 218, -1, 232, -1, 234, 223, -1, 317, -1, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, -1, 330, 305, -1, -1, -1, 335, -1, 337, -1, 78, -1, -1, -1, -1, 264, 345, -1, -1, 6, -1, -1, 9, -1, -1, 93, 355, 264, -1, 332, -1, 6, -1, -1, 9, 364, -1, -1, -1, -1, -1, -1, -1, -1, 373, -1, 375, 376, -1, -1, 379, -1, 381, -1, -1, -1, 305, 386, -1, -1, -1, -1, -1, -1, -1, 368, -1, -1, 305, -1, -1, -1, 401, -1, 377, 378, -1, 406, -1, -1, -1, -1, 411, 332, -1, 6, -1, -1, 9, -1, -1, 78, -1, 422, 397, 332, -1, -1, -1, 402, -1, 9, -1, 78, 433, 173, 93, -1, -1, 177, -1, -1, -1, -1, -1, -1, -1, 420, 93, 368, 188, -1, -1, -1, -1, 428, -1, 430, 377, 378, -1, 368, -1, 436, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, 397, -1, 218, -1, -1, 402, -1, 223, 393, 78, -1, 227, 397, 229, -1, -1, 232, 402, 234, -1, -1, -1, 78, 420, 93, -1, -1, -1, -1, -1, -1, 428, -1, 430, -1, 420, -1, 93, -1, 436, -1, -1, 177, 428, -1, 430, -1, -1, 264, -1, -1, 436, -1, 188, 177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 188, 6, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, -1, 223, 305, -1, -1, 227, -1, 229, 218, -1, 232, -1, 234, 223, -1, -1, -1, 227, -1, 229, -1, 177, 232, -1, 234, -1, -1, -1, -1, 332, -1, -1, 188, -1, 177, -1, -1, -1, -1, -1, -1, -1, 264, -1, -1, 188, -1, -1, -1, -1, -1, 78, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, 368, 93, 223, -1, -1, -1, 227, -1, 229, 377, 378, 232, -1, 234, -1, -1, -1, -1, 305, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, 397, 305, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, 264, -1, 332, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, 264, 332, -1, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, 368, -1, -1, 305, 177, -1, -1, 363, -1, 377, 378, -1, 368, -1, -1, 188, 305, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, 397, 332, -1, -1, -1, 402, -1, -1, -1, -1, -1, -1, 397, -1, 332, -1, 218, 402, -1, -1, -1, 223, -1, 420, -1, 227, -1, 229, -1, -1, 232, 428, 234, 430, -1, 420, -1, 368, -1, 436, -1, -1, -1, 428, -1, 430, 377, 378, -1, -1, 368, 436, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, 264, -1, -1, -1, 397, -1, -1, -1, -1, 402, -1, 78, -1, -1, -1, -1, -1, 397, -1, -1, -1, -1, 402, -1, -1, -1, 93, 420, -1, -1, -1, -1, -1, -1, -1, 428, -1, 430, -1, -1, 420, 305, -1, 436, -1, 21, -1, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, 33, -1, -1, 36, 37, 38, 39, 40, 41, 42, -1, 332, -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, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, 368, -1, -1, -1, -1, -1, 177, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, 188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, 112, -1, 402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, 227, -1, 229, -1, 428, 232, 430, 234, -1, -1, -1, -1, 436, -1, -1, -1, -1, 30, -1, 32, -1, -1, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, -1, -1, 70, 194, 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, 207, -1, -1, 210, -1, -1, -1, 305, -1, 216, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 112, -1, -1, -1, 78, -1, 332, -1, -1, 244, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 266, -1, -1, -1, -1, -1, -1, -1, -1, 152, -1, 368, -1, -1, -1, 281, -1, -1, -1, -1, 377, 378, 288, -1, 290, -1, -1, 170, -1, -1, 173, 174, -1, -1, -1, -1, -1, 303, -1, -1, 397, -1, -1, -1, 187, 402, -1, 313, -1, -1, -1, 194, -1, -1, 320, -1, -1, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, 210, -1, -1, -1, 428, 177, 430, -1, -1, -1, -1, -1, 436, -1, 224, -1, 188, -1, 78, -1, -1, -1, -1, 233, 357, -1, 359, 360, 361, -1, -1, -1, -1, 93, 244, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 218, -1, -1, -1, 383, 223, -1, -1, -1, 227, 266, 229, -1, -1, 232, -1, 234, -1, -1, -1, -1, 400, -1, -1, 280, 281, -1, -1, -1, 408, 409, 410, 288, -1, 290, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, 424, 264, 303, 304, -1, -1, -1, 78, -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, -1, 443, -1, -1, 93, -1, -1, -1, 177, 328, -1, -1, -1, -1, 333, -1, -1, -1, -1, 188, 63, 64, -1, -1, 305, -1, -1, 70, 347, 72, 73, 74, 75, 76, 77, -1, -1, -1, 357, -1, 359, 360, 361, -1, -1, -1, -1, -1, -1, 218, -1, 332, -1, -1, 223, -1, -1, -1, 227, -1, 229, -1, -1, 232, -1, 234, -1, -1, -1, 112, -1, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 404, -1, 368, 177, 408, 409, 410, -1, -1, -1, 264, 377, 378, -1, 188, -1, -1, 421, -1, 423, 424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, -1, -1, 402, -1, -1, 443, -1, -1, -1, -1, 218, -1, -1, -1, -1, 223, -1, 305, -1, 227, 420, 229, -1, 185, 232, -1, 234, -1, 428, -1, 430, -1, 194, -1, -1, -1, 436, 437, 438, -1, -1, -1, -1, -1, 332, 445, 446, -1, 210, -1, -1, -1, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, 224, 225, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, 244, -1, -1, -1, -1, 249, -1, 377, 378, -1, -1, -1, -1, -1, -1, 305, -1, -1, -1, -1, -1, -1, 266, -1, -1, -1, -1, 397, -1, -1, -1, -1, 402, -1, -1, -1, -1, 281, -1, -1, -1, -1, 332, -1, 288, -1, 290, -1, -1, 293, 420, -1, -1, -1, -1, -1, -1, -1, 428, 303, 430, -1, -1, -1, -1, -1, 436, 437, 438, -1, -1, -1, -1, -1, -1, 445, 446, -1, 368, -1, -1, -1, -1, -1, -1, -1, -1, 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 397, -1, -1, -1, -1, 402, 357, -1, 359, 360, 361, -1, -1, -1, -1, 366, -1, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, -1, -1, 380, -1, 428, -1, 430, -1, -1, -1, -1, -1, 436, 437, 438, -1, -1, -1, -1, -1, -1, 445, -1, -1, -1, 403, -1, -1, -1, -1, 408, 409, 410, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, 424, 425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 443 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned short yystos[] = { 0, 452, 453, 0, 176, 301, 454, 455, 456, 462, 469, 471, 443, 443, 455, 144, 477, 477, 227, 302, 472, 472, 114, 457, 463, 26, 473, 473, 443, 96, 572, 572, 227, 443, 470, 79, 478, 114, 458, 464, 207, 474, 1115, 346, 163, 201, 209, 529, 443, 297, 706, 706, 443, 69, 312, 396, 475, 476, 443, 443, 346, 443, 162, 344, 395, 573, 579, 114, 459, 465, 469, 129, 468, 476, 300, 1126, 479, 530, 443, 531, 346, 432, 604, 575, 53, 423, 709, 133, 459, 466, 477, 472, 265, 327, 367, 369, 480, 481, 485, 493, 498, 533, 163, 532, 242, 340, 563, 564, 565, 566, 568, 443, 346, 230, 649, 430, 578, 580, 1047, 711, 710, 331, 717, 472, 460, 443, 443, 443, 443, 443, 349, 534, 443, 209, 562, 395, 1111, 309, 364, 365, 567, 443, 565, 574, 443, 346, 226, 651, 577, 579, 606, 607, 608, 581, 48, 712, 713, 714, 1106, 712, 430, 443, 443, 572, 236, 348, 430, 484, 486, 487, 488, 489, 491, 492, 1126, 175, 494, 495, 496, 429, 482, 483, 484, 1140, 11, 56, 91, 92, 94, 102, 156, 228, 342, 382, 430, 499, 500, 501, 502, 506, 515, 519, 522, 523, 524, 525, 526, 527, 528, 273, 1093, 533, 443, 385, 1134, 23, 1102, 576, 605, 443, 346, 322, 653, 580, 609, 1087, 582, 713, 362, 407, 715, 315, 424, 707, 461, 362, 1115, 443, 487, 443, 488, 60, 353, 1099, 9, 227, 497, 443, 496, 443, 443, 483, 101, 430, 1058, 1058, 374, 357, 1130, 1115, 1115, 1115, 1058, 1115, 55, 1108, 1115, 443, 501, 1058, 563, 81, 1109, 169, 1112, 577, 606, 650, 443, 346, 341, 694, 606, 443, 1087, 430, 610, 612, 617, 46, 59, 96, 212, 222, 309, 310, 322, 324, 424, 443, 583, 584, 586, 590, 592, 594, 595, 601, 602, 603, 1115, 1115, 362, 273, 716, 103, 718, 706, 1115, 227, 1076, 443, 353, 1115, 204, 204, 227, 443, 240, 507, 1115, 1115, 1115, 430, 1055, 1073, 65, 1055, 1115, 1055, 516, 517, 1058, 91, 1058, 535, 569, 570, 1047, 1046, 1047, 606, 652, 443, 346, 610, 443, 165, 430, 613, 614, 1109, 1115, 309, 311, 1097, 1097, 1115, 1109, 1115, 240, 1120, 1115, 22, 1101, 267, 161, 181, 30, 104, 1076, 1115, 430, 443, 708, 465, 1076, 1055, 1115, 188, 227, 234, 305, 368, 397, 436, 520, 521, 1079, 1055, 227, 193, 267, 1096, 1055, 22, 207, 1058, 1116, 503, 536, 570, 291, 571, 1047, 606, 654, 443, 443, 611, 80, 1076, 430, 1115, 1101, 1054, 1055, 269, 370, 591, 227, 1055, 1057, 1076, 425, 1115, 430, 693, 693, 164, 430, 1076, 719, 720, 133, 467, 55, 431, 490, 118, 188, 227, 234, 246, 305, 368, 371, 372, 436, 508, 509, 510, 513, 521, 390, 1073, 518, 1076, 504, 4, 19, 28, 195, 224, 231, 276, 282, 309, 316, 329, 356, 364, 395, 443, 537, 538, 542, 544, 545, 546, 547, 548, 552, 553, 554, 555, 556, 558, 559, 560, 1099, 1127, 1076, 307, 655, 656, 657, 695, 618, 615, 1115, 393, 589, 1055, 225, 1119, 393, 1108, 193, 1114, 430, 1115, 1115, 720, 1, 430, 443, 721, 722, 723, 724, 725, 730, 731, 472, 510, 17, 390, 1079, 1076, 268, 270, 505, 1120, 309, 393, 1138, 354, 1120, 1115, 54, 1107, 107, 211, 1117, 1117, 1076, 1140, 374, 1115, 36, 1105, 693, 657, 696, 21, 33, 36, 37, 38, 39, 40, 41, 42, 70, 72, 73, 74, 75, 76, 77, 112, 194, 210, 244, 266, 281, 288, 290, 303, 313, 320, 357, 359, 360, 361, 383, 408, 409, 410, 421, 424, 619, 620, 621, 623, 624, 625, 626, 627, 628, 637, 638, 640, 641, 642, 647, 648, 1115, 1131, 26, 1103, 181, 1076, 55, 311, 585, 596, 1076, 362, 1132, 227, 593, 1073, 593, 120, 443, 443, 346, 3, 5, 10, 18, 50, 51, 57, 68, 71, 83, 105, 112, 113, 143, 155, 159, 172, 179, 182, 183, 190, 197, 199, 202, 237, 241, 243, 250, 272, 287, 308, 317, 330, 335, 337, 345, 355, 364, 373, 375, 376, 379, 381, 386, 401, 406, 411, 422, 433, 443, 732, 733, 743, 748, 752, 755, 768, 771, 776, 781, 782, 783, 786, 794, 798, 800, 815, 818, 820, 822, 825, 827, 833, 842, 844, 861, 863, 866, 870, 876, 886, 893, 895, 898, 902, 903, 914, 925, 935, 941, 944, 950, 954, 956, 958, 960, 963, 974, 975, 984, 986, 987, 732, 443, 511, 513, 374, 1133, 1115, 1117, 117, 161, 540, 1115, 309, 316, 553, 1115, 1115, 1115, 1115, 1102, 9, 251, 308, 561, 1115, 430, 354, 658, 612, 617, 697, 698, 699, 218, 358, 407, 358, 407, 358, 407, 358, 407, 358, 407, 427, 1139, 336, 1128, 1076, 1072, 1073, 1073, 207, 217, 336, 639, 1115, 1116, 161, 181, 216, 400, 9, 49, 218, 616, 1077, 1078, 1079, 29, 597, 598, 599, 600, 1104, 1140, 1108, 173, 588, 1113, 103, 227, 726, 734, 744, 749, 753, 756, 769, 772, 777, 784, 787, 795, 799, 801, 816, 819, 821, 1138, 826, 1, 828, 834, 843, 845, 862, 864, 867, 871, 877, 887, 894, 896, 899, 904, 915, 926, 936, 227, 339, 945, 951, 296, 955, 957, 959, 961, 964, 181, 976, 1112, 988, 188, 227, 234, 305, 368, 436, 512, 514, 1115, 117, 306, 354, 543, 1115, 111, 295, 539, 31, 158, 235, 549, 1057, 371, 557, 1055, 1055, 277, 1125, 1125, 271, 1055, 58, 84, 85, 283, 443, 659, 660, 664, 1115, 613, 699, 436, 393, 629, 445, 1074, 1075, 390, 626, 644, 645, 1077, 26, 622, 352, 1095, 1095, 1079, 267, 1122, 1122, 450, 47, 399, 168, 589, 1076, 443, 443, 735, 1071, 1072, 6, 78, 89, 93, 177, 218, 223, 229, 232, 264, 332, 377, 378, 402, 420, 428, 745, 1041, 1061, 1062, 1071, 1077, 1080, 430, 750, 1028, 1029, 1030, 227, 1051, 1052, 1053, 1073, 227, 1069, 1071, 1080, 770, 773, 778, 1042, 1043, 1062, 1047, 227, 788, 1061, 1068, 1071, 796, 1062, 227, 394, 398, 802, 803, 1028, 286, 287, 300, 346, 817, 6, 1059, 1060, 1071, 1071, 823, 130, 1027, 1028, 1059, 663, 1071, 846, 1071, 1077, 1080, 927, 1073, 89, 865, 1062, 868, 1062, 872, 171, 227, 878, 881, 882, 883, 1051, 1069, 1073, 1140, 1047, 1044, 1073, 1047, 1044, 9, 905, 1045, 1073, 144, 239, 916, 917, 918, 919, 921, 922, 923, 924, 1048, 1049, 1059, 927, 1047, 942, 106, 946, 947, 1062, 89, 952, 1061, 663, 1071, 1047, 1071, 8, 34, 978, 101, 1044, 17, 1058, 557, 112, 227, 541, 1073, 429, 550, 550, 366, 444, 1055, 1056, 1115, 166, 661, 662, 661, 1116, 672, 181, 700, 1076, 392, 1137, 218, 437, 438, 445, 1038, 1040, 1041, 1063, 1071, 1078, 1080, 445, 1075, 1073, 643, 645, 390, 227, 1107, 1072, 1072, 1079, 1057, 1057, 1104, 1108, 121, 742, 29, 173, 736, 1104, 1122, 445, 1071, 445, 1081, 445, 1082, 1122, 1096, 445, 445, 445, 445, 445, 445, 445, 445, 1081, 122, 747, 393, 746, 1062, 198, 1090, 55, 12, 13, 14, 20, 150, 151, 178, 184, 215, 219, 247, 248, 252, 262, 269, 274, 292, 437, 438, 439, 440, 442, 444, 445, 446, 447, 448, 1031, 1032, 1033, 1034, 1035, 1062, 393, 1096, 423, 757, 227, 1068, 1071, 1047, 124, 779, 150, 444, 780, 1043, 338, 1094, 1127, 126, 793, 736, 416, 417, 418, 419, 127, 797, 48, 203, 757, 17, 427, 804, 805, 806, 810, 95, 1122, 1060, 1050, 389, 1136, 835, 1140, 1071, 88, 321, 384, 847, 848, 849, 853, 858, 929, 1062, 393, 131, 869, 48, 160, 200, 208, 278, 873, 882, 132, 879, 412, 425, 390, 392, 387, 249, 294, 1091, 173, 989, 1127, 989, 1045, 137, 913, 425, 907, 1066, 1071, 1078, 922, 924, 1059, 393, 1049, 115, 393, 413, 920, 937, 180, 331, 943, 1106, 203, 947, 1071, 140, 953, 173, 173, 309, 311, 962, 106, 965, 323, 370, 979, 270, 1123, 989, 514, 116, 429, 1089, 1098, 231, 337, 1115, 1054, 1068, 663, 670, 1076, 612, 673, 701, 108, 630, 1122, 1040, 1040, 1040, 67, 350, 446, 1039, 437, 438, 439, 440, 442, 449, 1040, 1139, 1077, 1119, 1057, 108, 587, 1066, 24, 25, 64, 66, 97, 98, 99, 144, 146, 154, 225, 391, 430, 1049, 429, 739, 63, 224, 291, 737, 738, 143, 300, 1064, 1072, 1038, 1040, 393, 1040, 1038, 1083, 1072, 1078, 1080, 430, 1040, 1086, 1040, 1040, 1085, 1040, 1038, 1038, 1040, 1084, 1040, 1042, 1062, 180, 331, 751, 1090, 1138, 388, 1135, 1135, 207, 1032, 299, 754, 1053, 758, 180, 331, 762, 314, 405, 774, 775, 1140, 1028, 206, 256, 1020, 1021, 1022, 1024, 415, 789, 157, 995, 996, 995, 995, 995, 1062, 1042, 1062, 803, 21, 394, 398, 811, 812, 1029, 128, 814, 427, 806, 808, 427, 807, 1072, 108, 824, 1051, 829, 9, 12, 15, 16, 244, 245, 262, 263, 836, 840, 165, 1066, 9, 55, 167, 216, 400, 854, 855, 856, 850, 848, 931, 1098, 1123, 393, 1059, 1042, 1062, 356, 874, 727, 728, 1027, 884, 885, 1071, 1051, 8, 34, 991, 1127, 1068, 203, 888, 900, 1140, 908, 1104, 1071, 908, 393, 393, 505, 143, 394, 398, 1062, 48, 211, 938, 1062, 1062, 362, 1062, 1071, 173, 1042, 1062, 1066, 1106, 203, 968, 1071, 153, 157, 980, 9, 985, 1051, 900, 116, 270, 1054, 186, 665, 224, 225, 671, 430, 613, 30, 32, 35, 43, 44, 45, 63, 152, 170, 173, 174, 187, 224, 233, 266, 280, 304, 328, 333, 347, 393, 404, 423, 443, 624, 625, 627, 637, 640, 642, 702, 705, 1123, 631, 632, 1072, 1078, 1080, 446, 1040, 1040, 1040, 1040, 1040, 1040, 446, 1040, 355, 1129, 1119, 1123, 994, 996, 435, 434, 1066, 994, 211, 30, 32, 35, 45, 170, 174, 187, 233, 280, 304, 328, 333, 343, 347, 404, 414, 740, 741, 994, 260, 1121, 1121, 1121, 738, 737, 227, 1065, 1072, 446, 1071, 449, 446, 1039, 446, 446, 1039, 446, 446, 446, 446, 1039, 446, 446, 363, 1000, 1001, 1042, 1060, 331, 393, 1051, 759, 760, 761, 1106, 1071, 1071, 157, 279, 763, 981, 1112, 231, 251, 1000, 1023, 1025, 125, 785, 1024, 91, 295, 430, 1049, 429, 790, 1140, 997, 255, 998, 180, 1000, 180, 17, 390, 813, 277, 811, 727, 1123, 727, 1138, 321, 837, 1138, 393, 48, 855, 857, 1066, 9, 55, 216, 400, 851, 852, 1066, 932, 1099, 193, 275, 1124, 27, 109, 633, 1059, 1000, 180, 1140, 1046, 132, 880, 729, 8, 173, 888, 1071, 120, 253, 1010, 1011, 1013, 1020, 231, 251, 427, 120, 427, 910, 911, 1066, 1065, 1062, 1115, 1020, 948, 1140, 1071, 1000, 180, 393, 9, 966, 967, 1088, 969, 1071, 948, 969, 297, 983, 298, 990, 991, 242, 309, 311, 551, 1115, 167, 666, 1076, 674, 1115, 1121, 147, 149, 1115, 1069, 1121, 1076, 1071, 1071, 1055, 195, 634, 633, 446, 1138, 1055, 998, 994, 1115, 1115, 115, 413, 741, 1068, 1068, 1068, 1081, 1094, 446, 1040, 1055, 1081, 1081, 1040, 1081, 1081, 1081, 216, 400, 1081, 1081, 1002, 258, 1003, 1000, 1060, 760, 269, 715, 82, 315, 424, 255, 257, 765, 982, 764, 319, 334, 727, 727, 32, 35, 43, 44, 45, 152, 170, 187, 233, 280, 333, 343, 404, 791, 792, 995, 259, 727, 999, 1042, 1043, 1042, 1043, 812, 1028, 809, 1071, 119, 830, 424, 838, 839, 840, 104, 841, 424, 1067, 1071, 1077, 1066, 48, 859, 852, 169, 859, 928, 1115, 275, 1117, 1042, 561, 875, 1140, 730, 885, 1062, 192, 889, 1140, 1012, 1014, 135, 897, 1013, 136, 901, 231, 1028, 909, 1027, 910, 252, 939, 1092, 138, 940, 279, 1005, 1006, 290, 1094, 1042, 1067, 274, 1066, 107, 970, 384, 972, 1123, 148, 254, 992, 1015, 1016, 1018, 1021, 7, 1100, 551, 1076, 110, 213, 667, 64, 63, 64, 185, 224, 225, 249, 293, 366, 380, 403, 425, 443, 624, 625, 627, 628, 637, 640, 642, 675, 676, 678, 679, 680, 681, 683, 684, 685, 686, 690, 691, 436, 1070, 1071, 1076, 1115, 1070, 1115, 1137, 1106, 1117, 394, 646, 1070, 1070, 1026, 1106, 1026, 1000, 446, 727, 1004, 1062, 123, 767, 766, 727, 1115, 147, 149, 1115, 115, 413, 792, 727, 1000, 318, 1000, 318, 727, 831, 130, 832, 839, 96, 1110, 859, 859, 1067, 991, 200, 423, 933, 1055, 930, 1000, 231, 251, 48, 231, 211, 890, 191, 231, 251, 426, 727, 727, 906, 727, 912, 1062, 178, 184, 215, 219, 1033, 1034, 1035, 1036, 1037, 1007, 139, 949, 257, 1008, 1071, 1000, 1000, 967, 1114, 90, 971, 1114, 1005, 160, 200, 208, 278, 977, 1046, 1017, 1019, 142, 993, 1018, 283, 1049, 1070, 1115, 87, 214, 668, 261, 1121, 196, 692, 260, 261, 689, 1101, 185, 427, 1115, 1122, 1115, 1071, 681, 249, 289, 687, 688, 1076, 238, 289, 437, 438, 704, 238, 289, 437, 438, 703, 430, 635, 636, 1115, 1115, 1070, 727, 727, 1070, 1070, 1026, 1026, 1043, 1043, 727, 48, 859, 396, 860, 297, 1046, 180, 278, 934, 1073, 334, 1062, 1115, 891, 1010, 1021, 231, 231, 727, 727, 1135, 1135, 727, 1009, 1071, 1114, 1071, 141, 973, 727, 727, 224, 225, 1118, 1076, 1115, 1115, 168, 669, 1115, 1116, 1115, 1027, 1071, 682, 1055, 86, 87, 110, 284, 285, 325, 326, 677, 173, 283, 1076, 688, 1070, 1070, 636, 1054, 1077, 1118, 1000, 1000, 1062, 1062, 1115, 1046, 297, 412, 1071, 134, 892, 274, 274, 727, 1071, 1076, 1076, 1115, 1076, 1076, 1094, 1062, 881, 1115, 1027, 150, 150, 1076, 48, 881, 1138, 1138, 1062 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* 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) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); 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. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylineno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (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) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, 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 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; 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: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef 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. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* 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 ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 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. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("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 (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; 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]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 757 "parser.y" { perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; eval_inc = 0; eval_inc2 = 0; prog_end = 0; depth = 0; inspect_keyword = 0; check_unreached = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (NULL, 0); cb_build_registers (); current_program->flag_main = cb_flag_main; ;} break; case 3: #line 781 "parser.y" { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } if (depth > 1) { cb_error (_("Multiple PROGRAM-ID's without matching END PROGRAM")); } if (errorcount > 0) { YYABORT; } if (!current_program->entry_list) { emit_entry (current_program->program_id, 0, NULL); } ;} break; case 8: #line 810 "parser.y" { cb_validate_program_environment (current_program); ;} break; case 9: #line 811 "parser.y" { cb_validate_program_data (current_program); ;} break; case 11: #line 819 "parser.y" { cb_validate_program_environment (current_program); ;} break; case 12: #line 820 "parser.y" { cb_validate_program_data (current_program); ;} break; case 14: #line 828 "parser.y" { cb_validate_program_environment (current_program); ;} break; case 15: #line 829 "parser.y" { cb_validate_program_data (current_program); ;} break; case 21: #line 841 "parser.y" { char *s; if (CB_LITERAL_P (yyvsp[-1])) { s = (char *)(CB_LITERAL (yyvsp[-1])->data); } else { s = (char *)(CB_NAME (yyvsp[-1])); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END PROGRAM '%s' is different to PROGRAM-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } ;} break; case 22: #line 865 "parser.y" { char *s; if (CB_LITERAL_P (yyvsp[-1])) { s = (char *)(CB_LITERAL (yyvsp[-1])->data); } else { s = (char *)(CB_NAME (yyvsp[-1])); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END PROGRAM '%s' is different to PROGRAM-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } ;} break; case 23: #line 889 "parser.y" { char *s; if (CB_LITERAL_P (yyvsp[-1])) { s = (char *)(CB_LITERAL (yyvsp[-1])->data); } else { s = (char *)(CB_NAME (yyvsp[-1])); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END FUNCTION '%s' is different to FUNCTION-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } ;} break; case 24: #line 918 "parser.y" { current_section = NULL; current_paragraph = NULL; if (CB_LITERAL_P (yyvsp[-1])) { stack_progid[depth] = (char *)(CB_LITERAL (yyvsp[-1])->data); } else { stack_progid[depth] = (char *)(CB_NAME (yyvsp[-1])); } if (prog_end) { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; inspect_keyword = 0; check_unreached = 0; eval_inc = 0; eval_inc2 = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (current_program, depth); cb_build_registers (); } else { prog_end = 1; } depth++; current_program->program_id = cb_build_program_id (yyvsp[-1], yyvsp[0]); ;} break; case 26: #line 959 "parser.y" { cb_error (_("FUNCTION-ID is not yet implemented")); current_section = NULL; current_paragraph = NULL; if (CB_LITERAL_P (yyvsp[-2])) { stack_progid[depth] = (char *)(CB_LITERAL (yyvsp[-2])->data); } else { stack_progid[depth] = (char *)(CB_NAME (yyvsp[-2])); } if (prog_end) { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; inspect_keyword = 0; check_unreached = 0; eval_inc = 0; eval_inc2 = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (current_program, depth); cb_build_registers (); } else { prog_end = 1; } depth++; current_program->program_id = cb_build_program_id (yyvsp[-2], yyvsp[-1]); current_program->prog_type = CB_FUNCTION_TYPE; current_program->flag_recursive = 1; current_program->flag_initial = 1; ;} break; case 29: #line 1007 "parser.y" { yyval = NULL; ;} break; case 30: #line 1008 "parser.y" { yyval = yyvsp[0]; ;} break; case 33: #line 1017 "parser.y" { if (!current_program->nested_level) { cb_error (_("COMMON may only be used in a nested program")); } current_program->flag_common = 1; ;} break; case 34: #line 1024 "parser.y" { if (!current_program->nested_level) { cb_error (_("COMMON may only be used in a nested program")); } current_program->flag_common = 1; ;} break; case 36: #line 1035 "parser.y" { current_program->flag_initial = 1; ;} break; case 37: #line 1039 "parser.y" { current_program->flag_recursive = 1; current_program->flag_initial = 1; ;} break; case 41: #line 1064 "parser.y" { if (current_program->nested_level) { cb_error (_("CONFIGURATION SECTION not allowed in nested programs")); } ;} break; case 53: #line 1099 "parser.y" { cb_verify (cb_debugging_line, "DEBUGGING MODE"); ;} break; case 54: #line 1105 "parser.y" { ;} break; case 65: #line 1136 "parser.y" { cb_verify (cb_memory_size_clause, "MEMORY SIZE"); ;} break; case 68: #line 1148 "parser.y" { current_program->collating_sequence = yyvsp[0]; ;} break; case 69: #line 1155 "parser.y" { /* Ignore */ ;} break; case 75: #line 1180 "parser.y" { current_program->function_spec_list = yyvsp[-1]; ;} break; case 76: #line 1184 "parser.y" { functions_are_all = 1; ;} break; case 77: #line 1190 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 78: #line 1192 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 95: #line 1232 "parser.y" { save_tree_1 = lookup_system_name (CB_NAME (yyvsp[-2])); if (save_tree_1 == cb_error_node) { cb_error_x (yyvsp[-2], _("Unknown system-name '%s'"), CB_NAME (yyvsp[-2])); } else if (CB_SYSTEM_NAME(save_tree_1)->token != CB_DEVICE_CONSOLE) { cb_error_x (save_tree_1, _("Invalid CRT clause")); } /* current_program->flag_screen = 1; */ ;} break; case 96: #line 1242 "parser.y" { save_tree_1 = lookup_system_name (CB_NAME (yyvsp[-2])); if (save_tree_1 == cb_error_node) { cb_error_x (yyvsp[-2], _("Unknown system-name '%s'"), CB_NAME (yyvsp[-2])); } else { cb_define (yyvsp[0], save_tree_1); } save_tree_2 = yyvsp[0]; ;} break; case 99: #line 1257 "parser.y" { cb_define_switch_name (yyvsp[0], save_tree_1, yyvsp[-3], save_tree_2); ;} break; case 100: #line 1263 "parser.y" { yyval = cb_int1; ;} break; case 101: #line 1264 "parser.y" { yyval = cb_int0; ;} break; case 102: #line 1272 "parser.y" { save_tree_1 = yyvsp[0]; ;} break; case 103: #line 1276 "parser.y" { current_program->alphabet_name_list = cb_list_add (current_program->alphabet_name_list, yyvsp[0]); ;} break; case 104: #line 1283 "parser.y" { yyval = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_NATIVE); ;} break; case 105: #line 1284 "parser.y" { yyval = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_STANDARD_1); ;} break; case 106: #line 1285 "parser.y" { yyval = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_STANDARD_2); ;} break; case 107: #line 1286 "parser.y" { yyval = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_EBCDIC); ;} break; case 108: #line 1288 "parser.y" { yyval = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_CUSTOM); CB_ALPHABET_NAME (yyval)->custom_list = yyvsp[0]; ;} break; case 109: #line 1295 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 110: #line 1297 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 111: #line 1301 "parser.y" { yyval = yyvsp[0]; ;} break; case 112: #line 1302 "parser.y" { yyval = cb_build_pair (yyvsp[-2], yyvsp[0]); ;} break; case 113: #line 1304 "parser.y" { yyval = cb_list_init (yyvsp[-1]); save_tree_2 = yyval; ;} break; case 114: #line 1309 "parser.y" { yyval = yyvsp[-1]; ;} break; case 117: #line 1320 "parser.y" { yyval = yyvsp[0]; ;} break; case 118: #line 1321 "parser.y" { yyval = cb_space; ;} break; case 119: #line 1322 "parser.y" { yyval = cb_zero; ;} break; case 120: #line 1323 "parser.y" { yyval = cb_quote; ;} break; case 121: #line 1324 "parser.y" { yyval = cb_norm_high; ;} break; case 122: #line 1325 "parser.y" { yyval = cb_norm_low; ;} break; case 123: #line 1329 "parser.y" { cb_list_add (save_tree_2, yyvsp[0]); ;} break; case 124: #line 1330 "parser.y" { cb_list_add (save_tree_2, cb_space); ;} break; case 125: #line 1331 "parser.y" { cb_list_add (save_tree_2, cb_zero); ;} break; case 126: #line 1332 "parser.y" { cb_list_add (save_tree_2, cb_quote); ;} break; case 127: #line 1333 "parser.y" { cb_list_add (save_tree_2, cb_norm_high); ;} break; case 128: #line 1334 "parser.y" { cb_list_add (save_tree_2, cb_norm_low); ;} break; case 129: #line 1342 "parser.y" { if (yyvsp[0]) { current_program->symbolic_list = cb_list_add (current_program->symbolic_list, yyvsp[0]); } PENDING ("SYMBOLIC CHARACTERS"); ;} break; case 130: #line 1353 "parser.y" { if (cb_list_length (yyvsp[-2]) != cb_list_length (yyvsp[0])) { cb_error (_("Invalid SYMBOLIC clause")); yyval = NULL; } else { yyval = NULL; } ;} break; case 131: #line 1364 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 132: #line 1365 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 133: #line 1369 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 134: #line 1370 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 135: #line 1378 "parser.y" { current_program->class_name_list = cb_list_add (current_program->class_name_list, cb_build_class_name (yyvsp[-2], yyvsp[0])); ;} break; case 136: #line 1386 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 137: #line 1387 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 138: #line 1391 "parser.y" { yyval = yyvsp[0]; ;} break; case 139: #line 1393 "parser.y" { /* if (CB_LITERAL ($1)->data[0] < CB_LITERAL ($3)->data[0]) */ if (literal_value (yyvsp[-2]) < literal_value (yyvsp[0])) { yyval = cb_build_pair (yyvsp[-2], yyvsp[0]); } else { yyval = cb_build_pair (yyvsp[0], yyvsp[-2]); } ;} break; case 140: #line 1407 "parser.y" { cb_tree l; l = cb_build_locale_name (yyvsp[-2], yyvsp[0]); if (l != cb_error_node) { current_program->locale_list = cb_list_add (current_program->locale_list, l); } ;} break; case 141: #line 1422 "parser.y" { unsigned char *s = CB_LITERAL (yyvsp[0])->data; if (CB_LITERAL (yyvsp[0])->size != 1) { cb_error_x (yyvsp[0], _("Invalid currency sign '%s'"), s); } switch (*s) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'A': case 'b': case 'B': case 'c': case 'C': case 'd': case 'D': case 'e': case 'E': case 'n': case 'N': case 'p': case 'P': case 'r': case 'R': case 's': case 'S': case 'v': case 'V': case 'x': case 'X': case 'z': case 'Z': case '+': case '-': case ',': case '.': case '*': case '/': case ';': case '(': case ')': case '=': case '"': case ' ': cb_error_x (yyvsp[0], _("Invalid currency sign '%s'"), s); break; default: break; } current_program->currency_symbol = s[0]; ;} break; case 142: #line 1489 "parser.y" { current_program->decimal_point = ','; current_program->numeric_separator = '.'; ;} break; case 143: #line 1499 "parser.y" { current_program->cursor_pos = yyvsp[0]; ;} break; case 144: #line 1506 "parser.y" { current_program->crt_status = yyvsp[0]; ;} break; case 145: #line 1513 "parser.y" { PENDING ("SCREEN CONTROL"); ;} break; case 146: #line 1519 "parser.y" { PENDING ("EVENT STATUS"); ;} break; case 149: #line 1531 "parser.y" { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("INPUT-OUTPUT SECTION header missing - assumed")); } else { cb_error (_("INPUT-OUTPUT SECTION header missing")); } ;} break; case 151: #line 1540 "parser.y" { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("INPUT-OUTPUT SECTION header missing - assumed")); } else { cb_error (_("INPUT-OUTPUT SECTION header missing")); } ;} break; case 157: #line 1565 "parser.y" { organized_seen = 0; if (yyvsp[0] == cb_error_node) { YYERROR; } /* build new file */ current_file = build_file (yyvsp[0]); current_file->optional = CB_INTEGER (yyvsp[-1])->val; /* register the file */ current_program->file_list = cb_cons (CB_TREE (current_file), current_program->file_list); ;} break; case 158: #line 1580 "parser.y" { validate_file (current_file, yyvsp[-3]); ;} break; case 174: #line 1610 "parser.y" { current_file->assign = cb_build_assignment_name (current_file, yyvsp[0]); ;} break; case 175: #line 1614 "parser.y" { current_file->fileid_assign = 1; ;} break; case 178: #line 1621 "parser.y" { current_file->organization = COB_ORG_LINE_SEQUENTIAL; ;} break; case 180: #line 1626 "parser.y" { current_file->external_assign = 1; ;} break; case 183: #line 1635 "parser.y" { const char *s; s = "$#@DUMMY@#$"; yyval = cb_build_alphanumeric_literal ((unsigned char *)s, strlen (s)); ;} break; case 186: #line 1652 "parser.y" { current_file->access_mode = COB_ACCESS_SEQUENTIAL; ;} break; case 187: #line 1653 "parser.y" { current_file->access_mode = COB_ACCESS_DYNAMIC; ;} break; case 188: #line 1654 "parser.y" { current_file->access_mode = COB_ACCESS_RANDOM; ;} break; case 189: #line 1662 "parser.y" { struct cb_alt_key *p; struct cb_alt_key *l; p = cobc_malloc (sizeof (struct cb_alt_key)); p->key = yyvsp[-1]; p->duplicates = CB_INTEGER (yyvsp[0])->val; p->next = NULL; /* add to the end of list */ if (current_file->alt_key_list == NULL) { current_file->alt_key_list = p; } else { l = current_file->alt_key_list; for (; l->next; l = l->next); l->next = p; } ;} break; case 190: #line 1687 "parser.y" { PENDING ("COLLATING SEQUENCE"); ;} break; case 191: #line 1697 "parser.y" { current_file->file_status = yyvsp[-1]; if (yyvsp[0]) { PENDING ("2nd FILE STATUS"); } ;} break; case 196: #line 1718 "parser.y" { current_file->lock_mode = COB_LOCK_MANUAL; ;} break; case 197: #line 1719 "parser.y" { current_file->lock_mode = COB_LOCK_AUTOMATIC; ;} break; case 198: #line 1720 "parser.y" { current_file->lock_mode = COB_LOCK_EXCLUSIVE; ;} break; case 201: #line 1726 "parser.y" { current_file->lock_mode |= COB_LOCK_MULTIPLE; ;} break; case 202: #line 1729 "parser.y" { PENDING ("WITH ROLLBACK"); ;} break; case 207: #line 1746 "parser.y" { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_INDEXED; organized_seen = 1; } ;} break; case 208: #line 1755 "parser.y" { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_SEQUENTIAL; organized_seen = 1; } ;} break; case 209: #line 1764 "parser.y" { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_RELATIVE; organized_seen = 1; } ;} break; case 210: #line 1773 "parser.y" { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_LINE_SEQUENTIAL; organized_seen = 1; } ;} break; case 211: #line 1788 "parser.y" { cb_verify (cb_padding_character_clause, "PADDING CHARACTER"); ;} break; case 212: #line 1797 "parser.y" { /* ignored */ ;} break; case 213: #line 1805 "parser.y" { current_file->key = yyvsp[0]; ;} break; case 214: #line 1811 "parser.y" { yyval = yyvsp[0]; ;} break; case 215: #line 1812 "parser.y" { PENDING ("SPLIT KEYS"); ;} break; case 216: #line 1813 "parser.y" { PENDING ("SPLIT KEYS"); ;} break; case 217: #line 1819 "parser.y" { current_file->key = yyvsp[0]; ;} break; case 218: #line 1826 "parser.y" { /* ignored */ ;} break; case 219: #line 1833 "parser.y" { current_file->sharing = yyvsp[0]; ;} break; case 220: #line 1837 "parser.y" { yyval = NULL; PENDING ("SHARING ALL OTHER"); ;} break; case 221: #line 1838 "parser.y" { yyval = cb_int1; ;} break; case 222: #line 1839 "parser.y" { yyval = cb_int0; ;} break; case 231: #line 1869 "parser.y" { cb_tree l; switch (CB_INTEGER (yyvsp[-3])->val) { case 0: /* SAME AREA */ break; case 1: /* SAME RECORD */ for (l = yyvsp[0]; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { CB_FILE (cb_ref (CB_VALUE (l)))->same_clause = samearea; } } samearea++; break; case 2: /* SAME SORT-MERGE */ break; } ;} break; case 232: #line 1893 "parser.y" { yyval = cb_int0; ;} break; case 233: #line 1894 "parser.y" { yyval = cb_int1; ;} break; case 234: #line 1895 "parser.y" { yyval = cb_int2; ;} break; case 235: #line 1896 "parser.y" { yyval = cb_int2; ;} break; case 236: #line 1903 "parser.y" { cb_verify (cb_multiple_file_tape_clause, "MULTIPLE FILE TAPE"); ;} break; case 239: #line 1914 "parser.y" { ;} break; case 245: #line 1942 "parser.y" { current_storage = CB_STORAGE_FILE; ;} break; case 247: #line 1945 "parser.y" { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("FILE SECTION header missing - assumed")); } else { cb_error (_("FILE SECTION header missing")); } current_storage = CB_STORAGE_FILE; ;} break; case 251: #line 1964 "parser.y" { if (yyvsp[0] && yyvsp[0] != cb_error_node) { finalize_file (current_file, CB_FIELD (yyvsp[0])); } else { cb_error (_("RECORD description missing or invalid")); } ;} break; case 252: #line 1976 "parser.y" { if (yyvsp[0] && yyvsp[0] != cb_error_node) { finalize_file (current_file, CB_FIELD (yyvsp[0])); } else { cb_error (_("RECORD description missing or invalid")); } ;} break; case 254: #line 1987 "parser.y" { yyval = cb_int0; ;} break; case 255: #line 1988 "parser.y" { yyval = cb_int1; ;} break; case 256: #line 1998 "parser.y" { if (yyvsp[0] == cb_error_node) { YYERROR; } current_file = CB_FILE (cb_ref (yyvsp[0])); if (yyvsp[-1] == cb_int1) { current_file->organization = COB_ORG_SORT; } ;} break; case 257: #line 2009 "parser.y" { /* Shut up bison */ dummy_tree = yyvsp[-2]; ;} break; case 260: #line 2021 "parser.y" { if (current_file->global) { cb_error (_("File cannot have both EXTERNAL and GLOBAL clauses")); } current_file->external = 1; ;} break; case 261: #line 2028 "parser.y" { if (current_file->external) { cb_error (_("File cannot have both EXTERNAL and GLOBAL clauses")); } current_file->global = 1; ;} break; case 271: #line 2050 "parser.y" { /* ignored */ ;} break; case 275: #line 2060 "parser.y" { if (current_file->organization == COB_ORG_LINE_SEQUENTIAL) { cb_warning (_("RECORD clause ignored for LINE SEQUENTIAL")); } else { current_file->record_max = cb_get_int (yyvsp[-1]); if (current_file->record_max < 1) { current_file->record_max = 1; cb_error (_("RECORD clause invalid")); } } ;} break; case 276: #line 2072 "parser.y" { int error_ind = 0; if (current_file->organization == COB_ORG_LINE_SEQUENTIAL) { cb_warning (_("RECORD clause ignored for LINE SEQUENTIAL")); } else { current_file->record_min = cb_get_int (yyvsp[-3]); current_file->record_max = cb_get_int (yyvsp[-1]); if (current_file->record_min < 0) { current_file->record_min = 0; error_ind = 1; } if (current_file->record_max < 1) { current_file->record_max = 1; error_ind = 1; } if (current_file->record_max <= current_file->record_min) { error_ind = 1; } if (error_ind) { cb_error (_("RECORD clause invalid")); } } ;} break; case 277: #line 2098 "parser.y" { int error_ind = 0; current_file->record_min = yyvsp[-3] ? cb_get_int (yyvsp[-3]) : 0; current_file->record_max = yyvsp[-2] ? cb_get_int (yyvsp[-2]) : 0; if (yyvsp[-3] && current_file->record_min < 0) { current_file->record_min = 0; error_ind = 1; } if (yyvsp[-2] && current_file->record_max < 1) { current_file->record_max = 1; error_ind = 1; } if ((yyvsp[-3] || yyvsp[-2]) && current_file->record_max <= current_file->record_min) { error_ind = 1; } if (error_ind) { cb_error (_("RECORD clause invalid")); } ;} break; case 279: #line 2122 "parser.y" { current_file->record_depending = yyvsp[0]; ;} break; case 280: #line 2128 "parser.y" { yyval = NULL; ;} break; case 281: #line 2129 "parser.y" { yyval = yyvsp[0]; ;} break; case 282: #line 2133 "parser.y" { yyval = NULL; ;} break; case 283: #line 2134 "parser.y" { yyval = yyvsp[0]; ;} break; case 284: #line 2142 "parser.y" { cb_verify (cb_label_records_clause, "LABEL RECORDS"); ;} break; case 287: #line 2157 "parser.y" { cb_verify (cb_value_of_clause, "VALUE OF"); ;} break; case 288: #line 2161 "parser.y" { if (!current_file->assign) { current_file->assign = cb_build_assignment_name (current_file, yyvsp[0]); } ;} break; case 291: #line 2177 "parser.y" { cb_verify (cb_data_records_clause, "DATA RECORDS"); ;} break; case 292: #line 2188 "parser.y" { if (current_file->organization != COB_ORG_LINE_SEQUENTIAL && current_file->organization != COB_ORG_SEQUENTIAL) { cb_error (_("LINAGE clause with wrong file type")); yyval = cb_error_node; } else { current_file->linage = yyvsp[-2]; current_file->organization = COB_ORG_LINE_SEQUENTIAL; if (current_linage == 0) { linage_file = current_file; } current_linage++; } ;} break; case 298: #line 2216 "parser.y" { current_file->latfoot = yyvsp[-1]; ;} break; case 299: #line 2223 "parser.y" { current_file->lattop = yyvsp[-1]; ;} break; case 300: #line 2230 "parser.y" { current_file->latbot = yyvsp[0]; ;} break; case 301: #line 2239 "parser.y" { /* ignore */ ;} break; case 302: #line 2247 "parser.y" { if (yyvsp[0] != cb_error_node) { cb_tree x; x = cb_ref (yyvsp[0]); if (!CB_ALPHABET_NAME_P (x)) { cb_error_x (yyvsp[0], _("Alphabet-name is expected '%s'"), cb_name (yyvsp[0])); } else if (CB_ALPHABET_NAME (x)->custom_list) { PENDING ("CODE-SET"); } } ;} break; case 303: #line 2265 "parser.y" { cb_warning (_("file descriptor REPORT IS")); ;} break; case 304: #line 2269 "parser.y" { cb_warning (_("file descriptor REPORTS ARE")); ;} break; case 306: #line 2280 "parser.y" { current_storage = CB_STORAGE_WORKING; ;} break; case 307: #line 2282 "parser.y" { if (yyvsp[0]) { current_program->working_storage = cb_field_add (current_program->working_storage, CB_FIELD (yyvsp[0])); } ;} break; case 308: #line 2291 "parser.y" { yyval = NULL; ;} break; case 309: #line 2292 "parser.y" { yyval = yyvsp[0]; ;} break; case 310: #line 2296 "parser.y" { current_field = NULL; description_field = NULL; cb_clear_real_field (); ;} break; case 311: #line 2302 "parser.y" { struct cb_field *p; for (p = description_field; p; p = p->sister) { cb_validate_field (p); } yyval = CB_TREE (description_field); ;} break; case 316: #line 2322 "parser.y" { cb_tree x; x = cb_build_field_tree (yyvsp[-1], yyvsp[0], current_field, current_storage, current_file); if (x == cb_error_node) { YYERROR; } else { current_field = CB_FIELD (x); } ;} break; case 317: #line 2333 "parser.y" { if (!qualifier && (current_field->level == 88 || current_field->level == 77 || current_field->level == 66 || current_field->flag_item_78)) { cb_error (_("Item requires a data name")); } if (current_field->level == 88) { cb_validate_88_item (current_field); } if (current_field->flag_item_78) { /* Reset to last non-78 item */ current_field = cb_validate_78_item (current_field); } if (!description_field) { description_field = current_field; } ;} break; case 319: #line 2358 "parser.y" { yyval = cb_build_filler (); qualifier = NULL; non_const_word = 0; ;} break; case 320: #line 2364 "parser.y" { yyval = cb_build_filler (); qualifier = NULL; non_const_word = 0; ;} break; case 321: #line 2370 "parser.y" { yyval = yyvsp[0]; qualifier = yyvsp[0]; non_const_word = 0; ;} break; case 322: #line 2379 "parser.y" { yyval = yyvsp[0]; qualifier = yyvsp[0]; non_const_word = 0; ;} break; case 324: #line 2388 "parser.y" { current_field->flag_is_global = 1; cb_error (_("CONSTANT with GLOBAL clause is not yet supported")); ;} break; case 325: #line 2395 "parser.y" { yyval = yyvsp[0]; ;} break; case 326: #line 2396 "parser.y" { yyval = cb_build_const_length (yyvsp[0]); ;} break; case 327: #line 2397 "parser.y" { yyval = cb_build_const_length (yyvsp[0]); ;} break; case 328: #line 2402 "parser.y" { cb_tree x; int level; level = cb_get_level (yyvsp[-5]); if (level && level != 1) { cb_error (_("CONSTANT item not at 01 level")); } x = cb_build_constant (yyvsp[-4], yyvsp[0]); CB_FIELD (x)->flag_item_78 = 1; CB_FIELD (x)->level = 1; cb_needs_01 = 1; /* Ignore return value */ cb_validate_78_item (CB_FIELD (x)); ;} break; case 329: #line 2421 "parser.y" { /* required to check redefines */ yyval = NULL; ;} break; case 330: #line 2427 "parser.y" { /* required to check redefines */ yyval = cb_true; ;} break; case 345: #line 2455 "parser.y" { if (yyvsp[-2] != NULL) { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning_x (yyvsp[0], _("REDEFINES clause should follow entry-name")); } else { cb_error_x (yyvsp[0], _("REDEFINES clause must follow entry-name")); } } current_field->redefines = cb_resolve_redefines (current_field, yyvsp[0]); if (current_field->redefines == NULL) { YYERROR; } ;} break; case 346: #line 2477 "parser.y" { if (current_storage != CB_STORAGE_WORKING) { cb_error (_("EXTERNAL not allowed here")); } else if (current_field->level != 1 && current_field->level != 77) { cb_error (_("EXTERNAL only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("EXTERNAL requires a data name")); } else if (current_field->flag_is_global) { cb_error (_("GLOBAL and EXTERNAL are mutually exclusive")); } else if (current_field->flag_item_based) { cb_error (_("BASED and EXTERNAL are mutually exclusive")); } else if (current_field->redefines) { cb_error (_("EXTERNAL and REDEFINES are mutually exclusive")); } else { current_field->flag_external = 1; has_external = 1; } ;} break; case 347: #line 2498 "parser.y" { current_field->ename = NULL; ;} break; case 348: #line 2500 "parser.y" { struct cb_field *x; x = CB_FIELD(cb_build_field (cb_build_reference ((char *)(CB_LITERAL (yyvsp[0])->data)))); current_field->ename = x->name; ;} break; case 349: #line 2512 "parser.y" { if (current_field->level != 1 && current_field->level != 77) { cb_error (_("GLOBAL only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("GLOBAL requires a data name")); } else if (current_field->flag_external) { cb_error (_("GLOBAL and EXTERNAL are mutually exclusive")); } else if (current_storage == CB_STORAGE_LOCAL) { cb_error (_("GLOBAL not allowed here")); } else { current_field->flag_is_global = 1; } ;} break; case 350: #line 2531 "parser.y" { current_field->pic = CB_PICTURE (yyvsp[0]); ;} break; case 353: #line 2543 "parser.y" { current_field->usage = CB_USAGE_BINARY; ;} break; case 354: #line 2544 "parser.y" { current_field->usage = CB_USAGE_BINARY; ;} break; case 355: #line 2545 "parser.y" { current_field->usage = CB_USAGE_FLOAT; ;} break; case 356: #line 2546 "parser.y" { current_field->usage = CB_USAGE_DOUBLE; ;} break; case 357: #line 2547 "parser.y" { current_field->usage = CB_USAGE_PACKED; ;} break; case 358: #line 2548 "parser.y" { current_field->usage = CB_USAGE_BINARY; ;} break; case 359: #line 2549 "parser.y" { current_field->usage = CB_USAGE_COMP_5; ;} break; case 360: #line 2550 "parser.y" { current_field->usage = CB_USAGE_COMP_X; ;} break; case 361: #line 2551 "parser.y" { current_field->usage = CB_USAGE_DISPLAY; ;} break; case 362: #line 2552 "parser.y" { current_field->usage = CB_USAGE_INDEX; ;} break; case 363: #line 2553 "parser.y" { current_field->usage = CB_USAGE_PACKED; ;} break; case 364: #line 2555 "parser.y" { current_field->usage = CB_USAGE_POINTER; current_field->flag_is_pointer = 1; ;} break; case 365: #line 2560 "parser.y" { current_field->usage = CB_USAGE_PROGRAM_POINTER; current_field->flag_is_pointer = 1; ;} break; case 366: #line 2564 "parser.y" { current_field->usage = CB_USAGE_SIGNED_SHORT; ;} break; case 367: #line 2565 "parser.y" { current_field->usage = CB_USAGE_SIGNED_INT; ;} break; case 368: #line 2566 "parser.y" { current_field->usage = CB_USAGE_SIGNED_LONG; ;} break; case 369: #line 2567 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_SHORT; ;} break; case 370: #line 2568 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_INT; ;} break; case 371: #line 2569 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_LONG; ;} break; case 372: #line 2570 "parser.y" { current_field->usage = CB_USAGE_SIGNED_CHAR; ;} break; case 373: #line 2571 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_CHAR; ;} break; case 374: #line 2572 "parser.y" { current_field->usage = CB_USAGE_SIGNED_CHAR; ;} break; case 375: #line 2573 "parser.y" { current_field->usage = CB_USAGE_SIGNED_SHORT; ;} break; case 376: #line 2574 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_SHORT; ;} break; case 377: #line 2575 "parser.y" { current_field->usage = CB_USAGE_SIGNED_SHORT; ;} break; case 378: #line 2576 "parser.y" { current_field->usage = CB_USAGE_SIGNED_INT; ;} break; case 379: #line 2577 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_INT; ;} break; case 380: #line 2578 "parser.y" { current_field->usage = CB_USAGE_SIGNED_INT; ;} break; case 381: #line 2579 "parser.y" { current_field->usage = CB_USAGE_SIGNED_LONG; ;} break; case 382: #line 2580 "parser.y" { current_field->usage = CB_USAGE_UNSIGNED_LONG; ;} break; case 383: #line 2581 "parser.y" { current_field->usage = CB_USAGE_SIGNED_LONG; ;} break; case 384: #line 2583 "parser.y" { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_SIGNED_INT; } else { current_field->usage = CB_USAGE_SIGNED_LONG; } ;} break; case 385: #line 2591 "parser.y" { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_UNSIGNED_INT; } else { current_field->usage = CB_USAGE_UNSIGNED_LONG; } ;} break; case 386: #line 2599 "parser.y" { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_SIGNED_INT; } else { current_field->usage = CB_USAGE_SIGNED_LONG; } ;} break; case 387: #line 2606 "parser.y" { PENDING ("USAGE NATIONAL");;} break; case 388: #line 2614 "parser.y" { current_field->flag_sign_separate = CB_INTEGER (yyvsp[0])->val; current_field->flag_sign_leading = 1; ;} break; case 389: #line 2619 "parser.y" { current_field->flag_sign_separate = CB_INTEGER (yyvsp[0])->val; current_field->flag_sign_leading = 0; ;} break; case 390: #line 2631 "parser.y" { if (current_field->occurs_depending && !(yyvsp[-4])) { cb_verify (cb_odo_without_to, "ODO without TO clause"); } current_field->occurs_min = yyvsp[-4] ? cb_get_int (yyvsp[-5]) : 1; current_field->occurs_max = yyvsp[-4] ? cb_get_int (yyvsp[-4]) : cb_get_int (yyvsp[-5]); current_field->indexes++; if (current_field->indexes > COB_MAX_SUBSCRIPTS) { cb_error (_("Maximum OCCURS depth exceeded")); } current_field->flag_occurs = 1; ;} break; case 391: #line 2646 "parser.y" { yyval = NULL; ;} break; case 392: #line 2647 "parser.y" { yyval = yyvsp[0]; ;} break; case 394: #line 2652 "parser.y" { current_field->occurs_depending = yyvsp[0]; ;} break; case 395: #line 2659 "parser.y" { if (yyvsp[0]) { cb_tree l; struct cb_key *keys; int i; int nkeys; l = yyvsp[0]; nkeys = cb_list_length (yyvsp[0]); keys = cobc_malloc (sizeof (struct cb_key) * nkeys); for (i = 0; i < nkeys; i++) { keys[i].dir = CB_PURPOSE_INT (l); keys[i].key = CB_VALUE (l); l = CB_CHAIN (l); } current_field->keys = keys; current_field->nkeys = nkeys; } ;} break; case 396: #line 2682 "parser.y" { yyval = NULL; ;} break; case 397: #line 2685 "parser.y" { cb_tree l; for (l = yyvsp[0]; l; l = CB_CHAIN (l)) { CB_PURPOSE (l) = yyvsp[-3]; if (qualifier && !CB_REFERENCE(CB_VALUE(l))->chain && strcasecmp (CB_NAME(CB_VALUE(l)), CB_NAME(qualifier))) { CB_REFERENCE(CB_VALUE(l))->chain = qualifier; } } yyval = cb_list_append (yyvsp[-4], yyvsp[0]); ;} break; case 398: #line 2700 "parser.y" { yyval = cb_int (COB_ASCENDING); ;} break; case 399: #line 2701 "parser.y" { yyval = cb_int (COB_DESCENDING); ;} break; case 401: #line 2706 "parser.y" { current_field->index_list = yyvsp[0]; ;} break; case 402: #line 2712 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 403: #line 2714 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 404: #line 2719 "parser.y" { yyval = cb_build_index (yyvsp[0], cb_int1, 1, current_field); ;} break; case 405: #line 2728 "parser.y" { current_field->flag_justified = 1; ;} break; case 406: #line 2735 "parser.y" { current_field->flag_synchronized = 1; ;} break; case 410: #line 2747 "parser.y" { current_field->flag_blank_zero = 1; ;} break; case 411: #line 2755 "parser.y" { if (current_storage != CB_STORAGE_WORKING && current_storage != CB_STORAGE_LINKAGE && current_storage != CB_STORAGE_LOCAL) { cb_error (_("BASED not allowed here")); } else if (current_field->level != 1 && current_field->level != 77) { cb_error (_("BASED only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("BASED requires a data name")); } else if (current_field->flag_external) { cb_error (_("BASED and EXTERNAL are mutually exclusive")); } else if (current_field->redefines) { cb_error (_("BASED and REDEFINES are mutually exclusive")); } else if (current_field->flag_any_length) { cb_error (_("BASED and ANY LENGTH are mutually exclusive")); } else { current_field->flag_item_based = 1; } ;} break; case 412: #line 2779 "parser.y" { current_field->values = yyvsp[0]; ;} break; case 414: #line 2784 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 415: #line 2785 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 416: #line 2789 "parser.y" { yyval = yyvsp[0]; ;} break; case 417: #line 2790 "parser.y" { yyval = cb_build_pair (yyvsp[-2], yyvsp[0]); ;} break; case 419: #line 2795 "parser.y" { if (current_field->level != 88) { cb_error (_("FALSE clause only allowed for 88 level")); } current_field->false_88 = cb_list_init (yyvsp[0]); ;} break; case 420: #line 2808 "parser.y" { if (cb_ref (yyvsp[0]) != cb_error_node) { if (CB_FIELD (cb_ref (yyvsp[0]))->level == 01 || CB_FIELD (cb_ref (yyvsp[0]))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else { current_field->redefines = CB_FIELD (cb_ref (yyvsp[0])); current_field->pic = current_field->redefines->pic; } } ;} break; case 421: #line 2820 "parser.y" { if (cb_ref (yyvsp[-2]) != cb_error_node && cb_ref (yyvsp[0]) != cb_error_node) { if (CB_FIELD (cb_ref (yyvsp[-2]))->level == 01 || CB_FIELD (cb_ref (yyvsp[-2]))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else if (CB_FIELD (cb_ref (yyvsp[0]))->level == 01 || CB_FIELD (cb_ref (yyvsp[0]))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else { current_field->redefines = CB_FIELD (cb_ref (yyvsp[-2])); current_field->rename_thru = CB_FIELD (cb_ref (yyvsp[0])); } } ;} break; case 422: #line 2840 "parser.y" { if (current_field->flag_item_based) { cb_error (_("BASED and ANY LENGTH are mutually exclusive")); } else { current_field->flag_any_length = 1; } ;} break; case 424: #line 2855 "parser.y" { current_storage = CB_STORAGE_LOCAL; if (current_program->nested_level) { cb_error (_("LOCAL-STORAGE not allowed in nested programs")); } ;} break; case 425: #line 2862 "parser.y" { if (yyvsp[0]) { current_program->local_storage = CB_FIELD (yyvsp[0]); } ;} break; case 427: #line 2875 "parser.y" { current_storage = CB_STORAGE_LINKAGE; ;} break; case 428: #line 2877 "parser.y" { if (yyvsp[0]) { current_program->linkage_storage = CB_FIELD (yyvsp[0]); } ;} break; case 430: #line 2890 "parser.y" { cb_error (_("REPORT SECTION not supported")); current_storage = CB_STORAGE_REPORT; ;} break; case 437: #line 2923 "parser.y" { cb_warning (_("Report description using defaults")); ;} break; case 439: #line 2931 "parser.y" { cb_error (_("GLOBAL is not allowed with RD")); ;} break; case 471: #line 3011 "parser.y" { cb_warning (_("looking for Report line TYPE")); ;} break; case 522: #line 3116 "parser.y" { current_storage = CB_STORAGE_SCREEN; ;} break; case 523: #line 3117 "parser.y" { current_field = NULL; description_field = NULL; cb_clear_real_field (); ;} break; case 524: #line 3123 "parser.y" { struct cb_field *p; for (p = description_field; p; p = p->sister) { cb_validate_field (p); } current_program->screen_storage = description_field; current_program->flag_screen = 1; ;} break; case 530: #line 3147 "parser.y" { cb_tree x; x = cb_build_field_tree (yyvsp[-1], yyvsp[0], current_field, current_storage, current_file); if (x == cb_error_node) { YYERROR; } current_field = CB_FIELD (x); if (current_field->parent) { current_field->screen_flag |= current_field->parent->screen_flag; current_field->screen_foreg = current_field->parent->screen_foreg; current_field->screen_backg = current_field->parent->screen_backg; } ;} break; case 531: #line 3163 "parser.y" { if (!qualifier && (current_field->level == 88 || current_field->level == 77 || current_field->level == 66 || current_field->flag_item_78)) { cb_error (_("Item requires a data name")); } if (current_field->level == 88) { cb_validate_88_item (current_field); } if (current_field->flag_item_78) { /* Reset to last non-78 item */ current_field = cb_validate_78_item (current_field); } if (!description_field) { description_field = current_field; } ;} break; case 534: #line 3187 "parser.y" { current_field->screen_flag |= COB_SCREEN_BLANK_LINE; ;} break; case 535: #line 3188 "parser.y" { current_field->screen_flag |= COB_SCREEN_BLANK_SCREEN; ;} break; case 536: #line 3189 "parser.y" { current_field->screen_flag |= COB_SCREEN_BELL; ;} break; case 537: #line 3190 "parser.y" { current_field->screen_flag |= COB_SCREEN_BLINK; ;} break; case 538: #line 3191 "parser.y" { current_field->screen_flag |= COB_SCREEN_ERASE_EOL; ;} break; case 539: #line 3192 "parser.y" { current_field->screen_flag |= COB_SCREEN_ERASE_EOS; ;} break; case 540: #line 3193 "parser.y" { current_field->screen_flag |= COB_SCREEN_HIGHLIGHT; ;} break; case 541: #line 3194 "parser.y" { current_field->screen_flag |= COB_SCREEN_LOWLIGHT; ;} break; case 542: #line 3195 "parser.y" { current_field->screen_flag |= COB_SCREEN_REVERSE; ;} break; case 543: #line 3196 "parser.y" { current_field->screen_flag |= COB_SCREEN_UNDERLINE; ;} break; case 544: #line 3197 "parser.y" { current_field->screen_flag |= COB_SCREEN_OVERLINE; ;} break; case 545: #line 3198 "parser.y" { current_field->screen_flag |= COB_SCREEN_AUTO; ;} break; case 546: #line 3199 "parser.y" { current_field->screen_flag |= COB_SCREEN_SECURE; ;} break; case 547: #line 3200 "parser.y" { current_field->screen_flag |= COB_SCREEN_REQUIRED; ;} break; case 548: #line 3201 "parser.y" { current_field->screen_flag |= COB_SCREEN_FULL; ;} break; case 549: #line 3202 "parser.y" { current_field->screen_flag |= COB_SCREEN_PROMPT; ;} break; case 550: #line 3204 "parser.y" { current_field->screen_line = yyvsp[0]; ;} break; case 551: #line 3208 "parser.y" { current_field->screen_column = yyvsp[0]; ;} break; case 552: #line 3212 "parser.y" { current_field->screen_foreg = yyvsp[0]; ;} break; case 553: #line 3216 "parser.y" { current_field->screen_backg = yyvsp[0]; ;} break; case 561: #line 3227 "parser.y" { current_field->screen_from = yyvsp[0]; current_field->screen_to = yyvsp[0]; current_field->screen_flag |= COB_SCREEN_PROMPT; current_field->screen_flag |= COB_SCREEN_INPUT; ;} break; case 562: #line 3234 "parser.y" { current_field->screen_from = yyvsp[0]; ;} break; case 563: #line 3238 "parser.y" { current_field->screen_to = yyvsp[0]; current_field->screen_flag |= COB_SCREEN_PROMPT; current_field->screen_flag |= COB_SCREEN_INPUT; ;} break; case 564: #line 3247 "parser.y" { /* Nothing */ ;} break; case 565: #line 3251 "parser.y" { current_field->screen_flag |= COB_SCREEN_LINE_PLUS; ;} break; case 566: #line 3255 "parser.y" { current_field->screen_flag |= COB_SCREEN_LINE_PLUS; ;} break; case 567: #line 3259 "parser.y" { current_field->screen_flag |= COB_SCREEN_LINE_MINUS; ;} break; case 568: #line 3263 "parser.y" { current_field->screen_flag |= COB_SCREEN_LINE_MINUS; ;} break; case 569: #line 3270 "parser.y" { /* Nothing */ ;} break; case 570: #line 3274 "parser.y" { current_field->screen_flag |= COB_SCREEN_COLUMN_PLUS; ;} break; case 571: #line 3278 "parser.y" { current_field->screen_flag |= COB_SCREEN_COLUMN_PLUS; ;} break; case 572: #line 3282 "parser.y" { current_field->screen_flag |= COB_SCREEN_COLUMN_MINUS; ;} break; case 573: #line 3286 "parser.y" { current_field->screen_flag |= COB_SCREEN_COLUMN_MINUS; ;} break; case 574: #line 3294 "parser.y" { current_field->occurs_max = cb_get_int (yyvsp[-1]); current_field->occurs_min = current_field->occurs_max; current_field->indexes++; current_field->flag_occurs = 1; ;} break; case 576: #line 3308 "parser.y" { current_section = NULL; current_paragraph = NULL; cb_define_system_name ("CONSOLE"); cb_define_system_name ("SYSIN"); cb_define_system_name ("SYSOUT"); cb_define_system_name ("SYSERR"); cb_set_in_procedure (); ;} break; case 577: #line 3318 "parser.y" { if (current_program->flag_main && !current_program->flag_chained && yyvsp[-4]) { cb_error (_("Executable program requested but PROCEDURE/ENTRY has USING clause")); } emit_entry (current_program->program_id, 0, yyvsp[-4]); /* main entry point */ if (current_program->source_name) { emit_entry (current_program->source_name, 1, yyvsp[-4]); } ;} break; case 578: #line 3328 "parser.y" { if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); } ;} break; case 579: #line 3345 "parser.y" { yyval = NULL; ;} break; case 580: #line 3347 "parser.y" { call_mode = CB_CALL_BY_REFERENCE; size_mode = CB_SIZE_4; ;} break; case 581: #line 3351 "parser.y" { yyval = yyvsp[0]; ;} break; case 582: #line 3353 "parser.y" { call_mode = CB_CALL_BY_REFERENCE; current_program->flag_chained = 1; ;} break; case 583: #line 3357 "parser.y" { yyval = yyvsp[0]; ;} break; case 584: #line 3361 "parser.y" { yyval = yyvsp[0]; ;} break; case 585: #line 3363 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 586: #line 3368 "parser.y" { yyval = cb_build_pair (cb_int (call_mode), cb_build_identifier (yyvsp[0])); CB_SIZES (yyval) = size_mode; ;} break; case 588: #line 3377 "parser.y" { call_mode = CB_CALL_BY_REFERENCE; ;} break; case 589: #line 3381 "parser.y" { if (current_program->flag_chained) { cb_error (_("BY VALUE not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_VALUE; } ;} break; case 591: #line 3393 "parser.y" { if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else { size_mode = CB_SIZE_AUTO; } ;} break; case 592: #line 3401 "parser.y" { if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else { size_mode = CB_SIZE_4; } ;} break; case 593: #line 3409 "parser.y" { unsigned char *s = CB_LITERAL (yyvsp[0])->data; if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else if (CB_LITERAL (yyvsp[0])->size != 1) { cb_error_x (yyvsp[0], _("Invalid value for SIZE")); } else { size_mode = CB_SIZE_UNSIGNED; switch (*s) { case '1': size_mode |= CB_SIZE_1; break; case '2': size_mode |= CB_SIZE_2; break; case '4': size_mode |= CB_SIZE_4; break; case '8': size_mode |= CB_SIZE_8; break; default: cb_error_x (yyvsp[0], _("Invalid value for SIZE")); break; } } ;} break; case 594: #line 3438 "parser.y" { unsigned char *s = CB_LITERAL (yyvsp[0])->data; if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else if (CB_LITERAL (yyvsp[0])->size != 1) { cb_error_x (yyvsp[0], _("Invalid value for SIZE")); } else { size_mode = 0; switch (*s) { case '1': size_mode = CB_SIZE_1; break; case '2': size_mode = CB_SIZE_2; break; case '4': size_mode = CB_SIZE_4; break; case '8': size_mode = CB_SIZE_8; break; default: cb_error_x (yyvsp[0], _("Invalid value for SIZE")); break; } } ;} break; case 596: #line 3471 "parser.y" { if (call_mode != CB_CALL_BY_REFERENCE) { cb_error (_("OPTIONAL only allowed for BY REFERENCE items")); } ;} break; case 597: #line 3480 "parser.y" { if (current_program->prog_type == CB_FUNCTION_TYPE) { cb_error (_("RETURNING clause is required for a FUNCTION")); } ;} break; case 598: #line 3486 "parser.y" { if (cb_ref (yyvsp[0]) != cb_error_node) { current_program->returning = yyvsp[0]; if (cb_field (yyvsp[0])->storage != CB_STORAGE_LINKAGE) { cb_error (_("RETURNING item is not defined in LINKAGE SECTION")); } } ;} break; case 600: #line 3497 "parser.y" { in_declaratives = 1; ;} break; case 601: #line 3500 "parser.y" { in_declaratives = 0; if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); current_paragraph = NULL; } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); current_section = NULL; } ;} break; case 607: #line 3533 "parser.y" { if (next_label_list) { cb_tree label; char name[16]; sprintf (name, "L$%d", next_label_id); label = cb_build_reference (name); emit_statement (cb_build_label (label, NULL)); current_program->label_list = cb_list_append (current_program->label_list, next_label_list); next_label_list = NULL; next_label_id++; } /* check_unreached = 0; */ ;} break; case 608: #line 3549 "parser.y" { check_unreached = 0; ;} break; case 609: #line 3553 "parser.y" { /* check_unreached = 0; */ ;} break; case 610: #line 3565 "parser.y" { non_const_word = 0; check_unreached = 0; if (yyvsp[-3] == cb_error_node) { YYERROR; } /* Exit the last section */ if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); } /* Begin a new section */ current_section = CB_LABEL (cb_build_label (yyvsp[-3], NULL)); current_section->is_section = 1; current_paragraph = NULL; emit_statement (CB_TREE (current_section)); ;} break; case 611: #line 3596 "parser.y" { cb_tree label; non_const_word = 0; check_unreached = 0; yyval = cb_build_section_name (yyvsp[-1], 1); /* if ($1 == cb_error_node) */ if (yyval == cb_error_node) { YYERROR; } /* Exit the last paragraph */ if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } /* Begin a new paragraph */ if (!current_section) { label = cb_build_reference ("MAIN SECTION"); current_section = CB_LABEL (cb_build_label (label, NULL)); current_section->is_section = 1; emit_statement (CB_TREE (current_section)); } current_paragraph = CB_LABEL (cb_build_label (yyval, current_section)); if (current_section) { current_section->children = cb_cons (CB_TREE (current_paragraph), current_section->children); } emit_statement (CB_TREE (current_paragraph)); ;} break; case 612: #line 3633 "parser.y" { non_const_word = 0; check_unreached = 0; if (yyvsp[0] != cb_error_node) { cb_error_x (yyvsp[0], _("Unknown statement '%s'"), CB_NAME (yyvsp[0])); } YYERROR; ;} break; case 613: #line 3644 "parser.y" { yyval = cb_build_section_name (yyvsp[0], 0); ;} break; case 615: #line 3648 "parser.y" { /* ignore */ ;} break; case 616: #line 3657 "parser.y" { yyval = current_program->exec_list; current_program->exec_list = NULL; ;} break; case 617: #line 3661 "parser.y" { yyval = CB_TREE (current_statement); current_statement = NULL; ;} break; case 618: #line 3666 "parser.y" { yyval = cb_list_reverse (current_program->exec_list); current_program->exec_list = yyvsp[-2]; current_statement = CB_STATEMENT (yyvsp[-1]); ;} break; case 619: #line 3674 "parser.y" { cb_tree label; if (!current_section) { label = cb_build_reference ("MAIN SECTION"); current_section = CB_LABEL (cb_build_label (label, NULL)); current_section->is_section = 1; emit_statement (CB_TREE (current_section)); } if (!current_paragraph) { label = cb_build_reference ("MAIN PARAGRAPH"); current_paragraph = CB_LABEL (cb_build_label (label, NULL)); emit_statement (CB_TREE (current_paragraph)); current_section->children = cb_cons (CB_TREE (current_paragraph), current_section->children); } ;} break; case 670: #line 3745 "parser.y" { if (cb_verify (cb_next_sentence_phrase, "NEXT SENTENCE")) { cb_tree label; char name[16]; BEGIN_STATEMENT ("NEXT SENTENCE", 0); sprintf (name, "L$%d", next_label_id); label = cb_build_reference (name); next_label_list = cb_list_add (next_label_list, label); emit_statement (cb_build_goto (label, NULL)); } check_unreached = 0; ;} break; case 671: #line 3767 "parser.y" { BEGIN_STATEMENT ("ACCEPT", TERM_ACCEPT); dispattrs = 0; fgc = NULL; bgc = NULL; scroll = NULL; ;} break; case 673: #line 3780 "parser.y" { cb_emit_accept (yyvsp[-3], yyvsp[-2], fgc, bgc, scroll, dispattrs); ;} break; case 674: #line 3784 "parser.y" { PENDING ("ACCEPT .. FROM ESCAPE KEY"); ;} break; case 675: #line 3788 "parser.y" { cb_emit_accept_line_or_col (yyvsp[-2], 0); ;} break; case 676: #line 3792 "parser.y" { cb_emit_accept_line_or_col (yyvsp[-2], 1); ;} break; case 677: #line 3796 "parser.y" { cb_emit_accept_date (yyvsp[-2]); ;} break; case 678: #line 3800 "parser.y" { cb_emit_accept_date_yyyymmdd (yyvsp[-3]); ;} break; case 679: #line 3804 "parser.y" { cb_emit_accept_day (yyvsp[-2]); ;} break; case 680: #line 3808 "parser.y" { cb_emit_accept_day_yyyyddd (yyvsp[-3]); ;} break; case 681: #line 3812 "parser.y" { cb_emit_accept_day_of_week (yyvsp[-2]); ;} break; case 682: #line 3816 "parser.y" { cb_emit_accept_time (yyvsp[-2]); ;} break; case 683: #line 3820 "parser.y" { cb_emit_accept_command_line (yyvsp[-2]); ;} break; case 684: #line 3824 "parser.y" { cb_emit_accept_environment (yyvsp[-3]); ;} break; case 685: #line 3828 "parser.y" { cb_emit_get_environment (yyvsp[-1], yyvsp[-4]); ;} break; case 686: #line 3832 "parser.y" { cb_emit_accept_arg_number (yyvsp[-2]); ;} break; case 687: #line 3836 "parser.y" { cb_emit_accept_arg_value (yyvsp[-3]); ;} break; case 688: #line 3840 "parser.y" { cb_emit_accept_mnemonic (yyvsp[-2], yyvsp[0]); ;} break; case 689: #line 3844 "parser.y" { cb_emit_accept_name (yyvsp[-2], yyvsp[0]); ;} break; case 690: #line 3850 "parser.y" { yyval = NULL; ;} break; case 691: #line 3851 "parser.y" { yyval = cb_build_pair (yyvsp[-1], yyvsp[0]); ;} break; case 692: #line 3852 "parser.y" { yyval = cb_build_pair (yyvsp[0], yyvsp[-1]); ;} break; case 693: #line 3853 "parser.y" { yyval = cb_build_pair (yyvsp[0], NULL); ;} break; case 694: #line 3854 "parser.y" { yyval = cb_build_pair (NULL, yyvsp[0]); ;} break; case 695: #line 3855 "parser.y" { yyval = yyvsp[0]; ;} break; case 696: #line 3859 "parser.y" { yyval = yyvsp[0]; ;} break; case 697: #line 3863 "parser.y" { yyval = yyvsp[0]; ;} break; case 698: #line 3864 "parser.y" { yyval = yyvsp[0]; ;} break; case 703: #line 3877 "parser.y" { dispattrs |= COB_SCREEN_BELL; ;} break; case 704: #line 3878 "parser.y" { dispattrs |= COB_SCREEN_BLINK; ;} break; case 705: #line 3879 "parser.y" { dispattrs |= COB_SCREEN_HIGHLIGHT; ;} break; case 706: #line 3880 "parser.y" { dispattrs |= COB_SCREEN_LOWLIGHT; ;} break; case 707: #line 3881 "parser.y" { dispattrs |= COB_SCREEN_REVERSE; ;} break; case 708: #line 3882 "parser.y" { dispattrs |= COB_SCREEN_UNDERLINE; ;} break; case 709: #line 3883 "parser.y" { dispattrs |= COB_SCREEN_OVERLINE; ;} break; case 710: #line 3885 "parser.y" { fgc = yyvsp[0]; ;} break; case 711: #line 3889 "parser.y" { bgc = yyvsp[0]; ;} break; case 712: #line 3893 "parser.y" { scroll = yyvsp[0]; ;} break; case 713: #line 3897 "parser.y" { dispattrs |= COB_SCREEN_SCROLL_DOWN; scroll = yyvsp[0]; ;} break; case 714: #line 3901 "parser.y" { dispattrs |= COB_SCREEN_AUTO; ;} break; case 715: #line 3902 "parser.y" { dispattrs |= COB_SCREEN_FULL; ;} break; case 716: #line 3903 "parser.y" { dispattrs |= COB_SCREEN_REQUIRED; ;} break; case 717: #line 3904 "parser.y" { dispattrs |= COB_SCREEN_SECURE; ;} break; case 718: #line 3905 "parser.y" { dispattrs |= COB_SCREEN_UPDATE; ;} break; case 719: #line 3906 "parser.y" { dispattrs |= COB_SCREEN_PROMPT; ;} break; case 720: #line 3910 "parser.y" { terminator_warning (TERM_ACCEPT); ;} break; case 721: #line 3911 "parser.y" { terminator_clear (TERM_ACCEPT); ;} break; case 722: #line 3920 "parser.y" { BEGIN_STATEMENT ("ADD", TERM_ADD); ;} break; case 724: #line 3927 "parser.y" { cb_emit_arithmetic (yyvsp[-1], '+', cb_build_binary_list (yyvsp[-3], '+')); ;} break; case 725: #line 3931 "parser.y" { cb_emit_arithmetic (yyvsp[-1], 0, cb_build_binary_list (yyvsp[-4], '+')); ;} break; case 726: #line 3935 "parser.y" { cb_emit_corresponding (cb_build_add, yyvsp[-2], yyvsp[-4], yyvsp[-1]); ;} break; case 728: #line 3941 "parser.y" { cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 729: #line 3945 "parser.y" { terminator_warning (TERM_ADD); ;} break; case 730: #line 3946 "parser.y" { terminator_clear (TERM_ADD); ;} break; case 731: #line 3955 "parser.y" { BEGIN_STATEMENT ("ALLOCATE", 0); ;} break; case 733: #line 3961 "parser.y" { cb_emit_allocate (yyvsp[-2], yyvsp[0], NULL, yyvsp[-1]); ;} break; case 734: #line 3965 "parser.y" { cb_emit_allocate (NULL, yyvsp[0], yyvsp[-4], yyvsp[-2]); ;} break; case 735: #line 3971 "parser.y" { yyval = NULL; ;} break; case 736: #line 3972 "parser.y" { yyval = yyvsp[0]; ;} break; case 737: #line 3982 "parser.y" { cb_error (_("ALTER statement is obsolete and unsupported")); ;} break; case 742: #line 4000 "parser.y" { BEGIN_STATEMENT ("CALL", TERM_CALL); ;} break; case 743: #line 4004 "parser.y" { cb_emit_call (yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1]); ;} break; case 744: #line 4010 "parser.y" { yyval = NULL; ;} break; case 745: #line 4012 "parser.y" { call_mode = CB_CALL_BY_REFERENCE; size_mode = CB_SIZE_4; ;} break; case 746: #line 4016 "parser.y" { yyval = yyvsp[0]; ;} break; case 747: #line 4020 "parser.y" { yyval = yyvsp[0]; ;} break; case 748: #line 4022 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 749: #line 4027 "parser.y" { if (call_mode != CB_CALL_BY_REFERENCE) { cb_error (_("OMITTED only allowed with BY REFERENCE")); } yyval = cb_build_pair (cb_int (call_mode), cb_null); ;} break; case 750: #line 4034 "parser.y" { yyval = cb_build_pair (cb_int (call_mode), yyvsp[0]); CB_SIZES (yyval) = size_mode; ;} break; case 752: #line 4043 "parser.y" { call_mode = CB_CALL_BY_REFERENCE; ;} break; case 753: #line 4047 "parser.y" { if (current_program->flag_chained) { cb_error (_("BY CONTENT not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_CONTENT; } ;} break; case 754: #line 4055 "parser.y" { if (current_program->flag_chained) { cb_error (_("BY VALUE not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_VALUE; } ;} break; case 755: #line 4065 "parser.y" { yyval = NULL; ;} break; case 756: #line 4066 "parser.y" { yyval = yyvsp[0]; ;} break; case 757: #line 4067 "parser.y" { yyval = yyvsp[0]; ;} break; case 758: #line 4072 "parser.y" { yyval = NULL; ;} break; case 759: #line 4076 "parser.y" { check_unreached = 0; ;} break; case 760: #line 4080 "parser.y" { yyval = yyvsp[0]; ;} break; case 761: #line 4087 "parser.y" { yyval = NULL; ;} break; case 762: #line 4091 "parser.y" { check_unreached = 0; ;} break; case 763: #line 4095 "parser.y" { yyval = yyvsp[0]; ;} break; case 764: #line 4101 "parser.y" { terminator_warning (TERM_CALL); ;} break; case 765: #line 4102 "parser.y" { terminator_clear (TERM_CALL); ;} break; case 766: #line 4111 "parser.y" { BEGIN_STATEMENT ("CANCEL", 0); ;} break; case 769: #line 4117 "parser.y" { cb_emit_cancel (yyvsp[0]); ;} break; case 770: #line 4128 "parser.y" { BEGIN_STATEMENT ("CLOSE", 0); ;} break; case 773: #line 4135 "parser.y" { BEGIN_IMPLICIT_STATEMENT (); if (yyvsp[-1] != cb_error_node) { cb_emit_close (yyvsp[-1], yyvsp[0]); } ;} break; case 774: #line 4144 "parser.y" { yyval = cb_int (COB_CLOSE_NORMAL); ;} break; case 775: #line 4145 "parser.y" { yyval = cb_int (COB_CLOSE_UNIT); ;} break; case 776: #line 4146 "parser.y" { yyval = cb_int (COB_CLOSE_UNIT_REMOVAL); ;} break; case 777: #line 4147 "parser.y" { yyval = cb_int (COB_CLOSE_NO_REWIND); ;} break; case 778: #line 4148 "parser.y" { yyval = cb_int (COB_CLOSE_LOCK); ;} break; case 781: #line 4159 "parser.y" { BEGIN_STATEMENT ("COMPUTE", TERM_COMPUTE); ;} break; case 783: #line 4166 "parser.y" { cb_emit_arithmetic (yyvsp[-3], 0, yyvsp[-1]); ;} break; case 784: #line 4172 "parser.y" { terminator_warning (TERM_COMPUTE); ;} break; case 785: #line 4173 "parser.y" { terminator_clear (TERM_COMPUTE); ;} break; case 788: #line 4184 "parser.y" { BEGIN_STATEMENT ("COMMIT", 0); cb_emit_commit (); ;} break; case 789: #line 4197 "parser.y" { BEGIN_STATEMENT ("CONTINUE", 0); cb_emit_continue (); ;} break; case 790: #line 4209 "parser.y" { BEGIN_STATEMENT ("DELETE", TERM_DELETE); ;} break; case 791: #line 4212 "parser.y" { if (yyvsp[-3] != cb_error_node) { cb_emit_delete (yyvsp[-3]); } ;} break; case 792: #line 4220 "parser.y" { terminator_warning (TERM_DELETE); ;} break; case 793: #line 4221 "parser.y" { terminator_clear (TERM_DELETE); ;} break; case 794: #line 4231 "parser.y" { BEGIN_STATEMENT ("DISPLAY", TERM_DISPLAY); dispattrs = 0; fgc = NULL; bgc = NULL; scroll = NULL; ;} break; case 796: #line 4244 "parser.y" { cb_emit_env_name (yyvsp[-2]); ;} break; case 797: #line 4248 "parser.y" { cb_emit_env_value (yyvsp[-2]); ;} break; case 798: #line 4252 "parser.y" { cb_emit_arg_number (yyvsp[-2]); ;} break; case 799: #line 4256 "parser.y" { cb_emit_command_line (yyvsp[-2]); ;} break; case 800: #line 4260 "parser.y" { cb_emit_display (yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[-3], fgc, bgc, scroll, dispattrs); ;} break; case 801: #line 4266 "parser.y" { yyval = cb_int0; ;} break; case 802: #line 4267 "parser.y" { yyval = cb_build_display_upon (yyvsp[0]); ;} break; case 803: #line 4268 "parser.y" { yyval = cb_build_display_upon_direct (yyvsp[0]); ;} break; case 804: #line 4269 "parser.y" { yyval = cb_int0; ;} break; case 805: #line 4270 "parser.y" { yyval = cb_int0; ;} break; case 806: #line 4274 "parser.y" { yyval = cb_int1; ;} break; case 807: #line 4275 "parser.y" { yyval = cb_int0; ;} break; case 808: #line 4276 "parser.y" { yyval = cb_int1; ;} break; case 811: #line 4286 "parser.y" { dispattrs |= COB_SCREEN_BELL; ;} break; case 812: #line 4287 "parser.y" { dispattrs |= COB_SCREEN_BLINK; ;} break; case 813: #line 4288 "parser.y" { dispattrs |= COB_SCREEN_ERASE_EOL; ;} break; case 814: #line 4289 "parser.y" { dispattrs |= COB_SCREEN_ERASE_EOS; ;} break; case 815: #line 4290 "parser.y" { dispattrs |= COB_SCREEN_HIGHLIGHT; ;} break; case 816: #line 4291 "parser.y" { dispattrs |= COB_SCREEN_LOWLIGHT; ;} break; case 817: #line 4292 "parser.y" { dispattrs |= COB_SCREEN_REVERSE; ;} break; case 818: #line 4293 "parser.y" { dispattrs |= COB_SCREEN_UNDERLINE; ;} break; case 819: #line 4294 "parser.y" { dispattrs |= COB_SCREEN_OVERLINE; ;} break; case 820: #line 4296 "parser.y" { fgc = yyvsp[0]; ;} break; case 821: #line 4300 "parser.y" { bgc = yyvsp[0]; ;} break; case 822: #line 4304 "parser.y" { scroll = yyvsp[0]; ;} break; case 823: #line 4308 "parser.y" { dispattrs |= COB_SCREEN_SCROLL_DOWN; scroll = yyvsp[0]; ;} break; case 824: #line 4312 "parser.y" { dispattrs |= COB_SCREEN_BLANK_LINE; ;} break; case 825: #line 4313 "parser.y" { dispattrs |= COB_SCREEN_BLANK_SCREEN; ;} break; case 826: #line 4317 "parser.y" { terminator_warning (TERM_DISPLAY); ;} break; case 827: #line 4318 "parser.y" { terminator_clear (TERM_DISPLAY); ;} break; case 828: #line 4327 "parser.y" { BEGIN_STATEMENT ("DIVIDE", TERM_DIVIDE); ;} break; case 830: #line 4334 "parser.y" { cb_emit_arithmetic (yyvsp[-1], '/', yyvsp[-3]); ;} break; case 831: #line 4338 "parser.y" { cb_emit_arithmetic (yyvsp[-1], 0, cb_build_binary_op (yyvsp[-3], '/', yyvsp[-5])); ;} break; case 832: #line 4342 "parser.y" { cb_emit_arithmetic (yyvsp[-1], 0, cb_build_binary_op (yyvsp[-5], '/', yyvsp[-3])); ;} break; case 833: #line 4346 "parser.y" { cb_emit_divide (yyvsp[-5], yyvsp[-7], yyvsp[-3], yyvsp[-1]); ;} break; case 834: #line 4350 "parser.y" { cb_emit_divide (yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ;} break; case 835: #line 4356 "parser.y" { terminator_warning (TERM_DIVIDE); ;} break; case 836: #line 4357 "parser.y" { terminator_clear (TERM_DIVIDE); ;} break; case 837: #line 4366 "parser.y" { BEGIN_STATEMENT ("ENTRY", 0); ;} break; case 838: #line 4368 "parser.y" { if (current_program->nested_level) { cb_error (_("ENTRY is invalid in nested program")); } else if (cb_verify (cb_entry_statement, "ENTRY")) { if (cobc_check_valid_name ((char *)(CB_LITERAL (yyvsp[-1])->data))) { cb_error (_("ENTRY '%s' invalid"), (char *)(CB_LITERAL (yyvsp[-1])->data)); } emit_entry ((char *)(CB_LITERAL (yyvsp[-1])->data), 1, yyvsp[0]); } check_unreached = 0; ;} break; case 839: #line 4388 "parser.y" { BEGIN_STATEMENT ("EVALUATE", TERM_EVALUATE); eval_level++; for (eval_inc = 0; eval_inc < 64; eval_inc++) { eval_check[eval_level][eval_inc] = 0; } eval_inc = 0; eval_inc2 = 0; ;} break; case 840: #line 4399 "parser.y" { cb_emit_evaluate (yyvsp[-2], yyvsp[-1]); eval_level--; ;} break; case 841: #line 4406 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 842: #line 4408 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 843: #line 4413 "parser.y" { yyval = yyvsp[0]; if (CB_REFERENCE_P (yyvsp[0])) { eval_check[eval_level][eval_inc++] = 0; } else { eval_check[eval_level][eval_inc++] = 1; } ;} break; case 844: #line 4422 "parser.y" { yyval = cb_true; eval_check[eval_level][eval_inc++] = 2; ;} break; case 845: #line 4427 "parser.y" { yyval = cb_false; eval_check[eval_level][eval_inc++] = 3; ;} break; case 846: #line 4435 "parser.y" { yyval = yyvsp[-1]; if (yyvsp[0]) { yyval = cb_list_add (yyval, yyvsp[0]); } ;} break; case 847: #line 4444 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 848: #line 4446 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 849: #line 4451 "parser.y" { check_unreached = 0; ;} break; case 850: #line 4455 "parser.y" { yyval = cb_cons (yyvsp[0], yyvsp[-2]); eval_inc2 = 0; ;} break; case 851: #line 4463 "parser.y" { yyval = NULL; ;} break; case 852: #line 4467 "parser.y" { check_unreached = 0; ;} break; case 853: #line 4471 "parser.y" { yyval = cb_cons (yyvsp[0], NULL); eval_inc2 = 0; ;} break; case 854: #line 4478 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 855: #line 4480 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 856: #line 4484 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 857: #line 4486 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 858: #line 4491 "parser.y" { cb_tree not; cb_tree e1; cb_tree e2; not = cb_int0; e2 = yyvsp[0]; /* in case the first token is NOT */ if (CB_PURPOSE_INT (yyvsp[-1]) == '!') { if (eval_check[eval_level][eval_inc2] < 2) { not = cb_int1; yyvsp[-1] = CB_CHAIN (yyvsp[-1]); } } /* build expr now */ e1 = cb_build_expr (yyvsp[-1]); if (e2 == NULL) { /* WHEN expr */ eval_inc2++; yyval = cb_build_pair (not, cb_build_pair (e1, NULL)); } else { /* WHEN expr THRU expr */ yyval = cb_build_pair (not, cb_build_pair (e1, e2)); eval_inc2++; } ;} break; case 859: #line 4519 "parser.y" { yyval = cb_any; eval_inc2++; ;} break; case 860: #line 4520 "parser.y" { yyval = cb_true; eval_inc2++; ;} break; case 861: #line 4521 "parser.y" { yyval = cb_false; eval_inc2++; ;} break; case 862: #line 4524 "parser.y" { yyval = NULL; ;} break; case 863: #line 4525 "parser.y" { yyval = yyvsp[0]; ;} break; case 864: #line 4529 "parser.y" { terminator_warning (TERM_EVALUATE); ;} break; case 865: #line 4530 "parser.y" { terminator_clear (TERM_EVALUATE); ;} break; case 866: #line 4539 "parser.y" { BEGIN_STATEMENT ("EXIT", 0); ;} break; case 868: #line 4544 "parser.y" { /* nothing */ ;} break; case 869: #line 4546 "parser.y" { if (in_declaratives && use_global_ind) { cb_error (_("EXIT PROGRAM is not allowed within a USE GLOBAL procedure")); } check_unreached = 1; cb_emit_exit (0); ;} break; case 870: #line 4554 "parser.y" { struct cb_perform *p; char name[64]; if (!perform_stack) { cb_error (_("EXIT PERFORM is only valid with inline PERFORM")); } else { p = CB_PERFORM (CB_VALUE (perform_stack)); if (!p->exit_label) { sprintf (name, "EXIT PERFORM %d", cb_id); p->exit_label = cb_build_reference (name); CB_LABEL (cb_build_label (p->exit_label, NULL))->need_begin = 1; } cb_emit_goto (cb_list_init (p->exit_label), NULL); } ;} break; case 871: #line 4571 "parser.y" { struct cb_perform *p; char name[64]; if (!perform_stack) { cb_error (_("EXIT PERFORM is only valid with inline PERFORM")); } else { p = CB_PERFORM (CB_VALUE (perform_stack)); if (!p->cycle_label) { sprintf (name, "EXIT PERFORM CYCLE %d", cb_id); p->cycle_label = cb_build_reference (name); CB_LABEL (cb_build_label (p->cycle_label, NULL))->need_begin = 1; } cb_emit_goto (cb_list_init (p->cycle_label), NULL); } ;} break; case 872: #line 4588 "parser.y" { cb_tree plabel; char name[64]; if (!current_section) { cb_error (_("EXIT SECTION is only valid with an active SECTION")); } else { if (!current_section->exit_label) { sprintf (name, "EXIT SECTION %d", cb_id); plabel = cb_build_reference (name); current_section->exit_label = cb_build_label (plabel, NULL); current_section->exit_label_ref = plabel; CB_LABEL (current_section->exit_label)->need_begin = 1; } cb_emit_goto (cb_list_init (current_section->exit_label_ref), NULL); } ;} break; case 873: #line 4606 "parser.y" { cb_tree plabel; char name[64]; if (!current_paragraph) { cb_error (_("EXIT PARAGRAPH is only valid with an active PARAGRAPH")); } else { if (!current_paragraph->exit_label) { sprintf (name, "EXIT PARAGRAPH %d", cb_id); plabel = cb_build_reference (name); current_paragraph->exit_label = cb_build_label (plabel, NULL); current_paragraph->exit_label_ref = plabel; CB_LABEL (current_paragraph->exit_label)->need_begin = 1; } cb_emit_goto (cb_list_init (current_paragraph->exit_label_ref), NULL); } ;} break; case 874: #line 4630 "parser.y" { BEGIN_STATEMENT ("FREE", 0); ;} break; case 875: #line 4632 "parser.y" { cb_emit_free (yyvsp[0]) ;} break; case 876: #line 4643 "parser.y" { BEGIN_STATEMENT ("GENERATE", 0); ;} break; case 877: #line 4645 "parser.y" { PENDING("GENERATE"); ;} break; case 878: #line 4656 "parser.y" { BEGIN_STATEMENT ("GO TO", 0); ;} break; case 879: #line 4658 "parser.y" { cb_emit_goto (yyvsp[-1], yyvsp[0]); ;} break; case 880: #line 4665 "parser.y" { check_unreached = 1; yyval = NULL; ;} break; case 881: #line 4670 "parser.y" { check_unreached = 0; yyval = yyvsp[0]; ;} break; case 882: #line 4682 "parser.y" { BEGIN_STATEMENT ("GOBACK", 0); ;} break; case 883: #line 4683 "parser.y" { check_unreached = 1; cb_emit_exit (1); ;} break; case 884: #line 4695 "parser.y" { BEGIN_STATEMENT ("IF", TERM_IF); ;} break; case 885: #line 4697 "parser.y" { check_unreached = 0; ;} break; case 886: #line 4702 "parser.y" { cb_emit_if (yyvsp[-5], yyvsp[-2], yyvsp[-1]); ;} break; case 888: #line 4710 "parser.y" { yyval = NULL; ;} break; case 889: #line 4714 "parser.y" { check_unreached = 0; ;} break; case 890: #line 4718 "parser.y" { yyval = yyvsp[0]; ;} break; case 891: #line 4724 "parser.y" { terminator_warning (TERM_IF); ;} break; case 892: #line 4725 "parser.y" { terminator_clear (TERM_IF); ;} break; case 893: #line 4734 "parser.y" { BEGIN_STATEMENT ("INITIALIZE", 0); ;} break; case 894: #line 4736 "parser.y" { cb_emit_initialize (yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;} break; case 895: #line 4742 "parser.y" { yyval = NULL; ;} break; case 896: #line 4743 "parser.y" { yyval = cb_true; ;} break; case 897: #line 4747 "parser.y" { yyval = NULL; ;} break; case 898: #line 4748 "parser.y" { yyval = cb_true; ;} break; case 899: #line 4749 "parser.y" { yyval = yyvsp[-2]; ;} break; case 900: #line 4753 "parser.y" { yyval = NULL; ;} break; case 901: #line 4755 "parser.y" { yyval = yyvsp[0]; ;} break; case 902: #line 4759 "parser.y" { yyval = yyvsp[0]; ;} break; case 903: #line 4761 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 904: #line 4765 "parser.y" { yyval = cb_build_pair (yyvsp[-3], yyvsp[0]); ;} break; case 905: #line 4769 "parser.y" { yyval = cb_int (CB_CATEGORY_ALPHABETIC); ;} break; case 906: #line 4770 "parser.y" { yyval = cb_int (CB_CATEGORY_ALPHANUMERIC); ;} break; case 907: #line 4771 "parser.y" { yyval = cb_int (CB_CATEGORY_NUMERIC); ;} break; case 908: #line 4772 "parser.y" { yyval = cb_int (CB_CATEGORY_ALPHANUMERIC_EDITED); ;} break; case 909: #line 4773 "parser.y" { yyval = cb_int (CB_CATEGORY_NUMERIC_EDITED); ;} break; case 910: #line 4774 "parser.y" { yyval = cb_int (CB_CATEGORY_NATIONAL); ;} break; case 911: #line 4775 "parser.y" { yyval = cb_int (CB_CATEGORY_NATIONAL_EDITED); ;} break; case 912: #line 4779 "parser.y" { yyval = NULL; ;} break; case 913: #line 4780 "parser.y" { yyval = cb_true; ;} break; case 914: #line 4789 "parser.y" { BEGIN_STATEMENT ("INITIATE", 0); ;} break; case 915: #line 4791 "parser.y" { PENDING("INITIATE"); ;} break; case 916: #line 4802 "parser.y" { BEGIN_STATEMENT ("INSPECT", 0); sending_id = 0; inspect_keyword = 0; ;} break; case 918: #line 4811 "parser.y" { save_tree_1 = yyvsp[0]; sending_id = 0; ;} break; case 919: #line 4812 "parser.y" { save_tree_1 = yyvsp[0]; sending_id = 1; ;} break; case 920: #line 4813 "parser.y" { save_tree_1 = yyvsp[0]; sending_id = 1; ;} break; case 923: #line 4822 "parser.y" { cb_emit_inspect (save_tree_1, yyvsp[0], cb_int0, 0); ;} break; case 924: #line 4823 "parser.y" { cb_emit_inspect (save_tree_1, yyvsp[0], cb_int1, 1); ;} break; case 925: #line 4824 "parser.y" { cb_emit_inspect (save_tree_1, yyvsp[0], cb_int0, 2); ;} break; case 926: #line 4830 "parser.y" { cb_init_tarrying (); ;} break; case 927: #line 4831 "parser.y" { yyval = yyvsp[0]; ;} break; case 928: #line 4835 "parser.y" { yyval = yyvsp[0]; ;} break; case 929: #line 4836 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 930: #line 4840 "parser.y" { yyval = cb_build_tarrying_data (yyvsp[-1]); ;} break; case 931: #line 4841 "parser.y" { yyval = cb_build_tarrying_characters (yyvsp[0]); ;} break; case 932: #line 4842 "parser.y" { yyval = cb_build_tarrying_all (); ;} break; case 933: #line 4843 "parser.y" { yyval = cb_build_tarrying_leading (); ;} break; case 934: #line 4844 "parser.y" { yyval = cb_build_tarrying_trailing (); ;} break; case 935: #line 4845 "parser.y" { yyval = cb_build_tarrying_value (yyvsp[-1], yyvsp[0]); ;} break; case 936: #line 4851 "parser.y" { yyval = yyvsp[0]; inspect_keyword = 0; ;} break; case 937: #line 4855 "parser.y" { yyval = yyvsp[0]; ;} break; case 938: #line 4856 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 939: #line 4861 "parser.y" { yyval = cb_build_replacing_characters (yyvsp[-1], yyvsp[0]); inspect_keyword = 0; ;} break; case 940: #line 4865 "parser.y" { yyval = yyvsp[0]; ;} break; case 941: #line 4869 "parser.y" { /* Nothing */ ;} break; case 942: #line 4870 "parser.y" { inspect_keyword = 1; ;} break; case 943: #line 4871 "parser.y" { inspect_keyword = 2; ;} break; case 944: #line 4872 "parser.y" { inspect_keyword = 3; ;} break; case 945: #line 4873 "parser.y" { inspect_keyword = 4; ;} break; case 946: #line 4878 "parser.y" { switch (inspect_keyword) { case 1: yyval = cb_build_replacing_all (yyvsp[-3], yyvsp[-1], yyvsp[0]); break; case 2: yyval = cb_build_replacing_leading (yyvsp[-3], yyvsp[-1], yyvsp[0]); break; case 3: yyval = cb_build_replacing_first (yyvsp[-3], yyvsp[-1], yyvsp[0]); break; case 4: yyval = cb_build_replacing_trailing (yyvsp[-3], yyvsp[-1], yyvsp[0]); break; default: cb_error (_("INSPECT missing a keyword")); yyval = cb_error_node; break; } ;} break; case 947: #line 4904 "parser.y" { yyval = cb_build_converting (yyvsp[-3], yyvsp[-1], yyvsp[0]); ;} break; case 948: #line 4912 "parser.y" { yyval = cb_build_inspect_region_start (); ;} break; case 949: #line 4914 "parser.y" { yyval = cb_build_inspect_region (yyvsp[-3], yyvsp[-2], yyvsp[0]); ;} break; case 952: #line 4925 "parser.y" { BEGIN_STATEMENT ("MERGE", 0); ;} break; case 954: #line 4935 "parser.y" { BEGIN_STATEMENT ("MOVE", 0); ;} break; case 956: #line 4941 "parser.y" { cb_emit_move (yyvsp[-2], yyvsp[0]); ;} break; case 957: #line 4945 "parser.y" { cb_emit_move_corresponding (yyvsp[-2], yyvsp[0]); ;} break; case 958: #line 4956 "parser.y" { BEGIN_STATEMENT ("MULTIPLY", TERM_MULTIPLY); ;} break; case 960: #line 4963 "parser.y" { cb_emit_arithmetic (yyvsp[-1], '*', yyvsp[-3]); ;} break; case 961: #line 4967 "parser.y" { cb_emit_arithmetic (yyvsp[-1], 0, cb_build_binary_op (yyvsp[-5], '*', yyvsp[-3])); ;} break; case 962: #line 4973 "parser.y" { terminator_warning (TERM_MULTIPLY); ;} break; case 963: #line 4974 "parser.y" { terminator_clear (TERM_MULTIPLY); ;} break; case 964: #line 4983 "parser.y" { BEGIN_STATEMENT ("OPEN", 0); ;} break; case 967: #line 4990 "parser.y" { cb_tree l; for (l = yyvsp[-1]; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { BEGIN_IMPLICIT_STATEMENT (); cb_emit_open (CB_VALUE (l), yyvsp[-3], yyvsp[-2]); } } ;} break; case 968: #line 5002 "parser.y" { yyval = cb_int (COB_OPEN_INPUT); ;} break; case 969: #line 5003 "parser.y" { yyval = cb_int (COB_OPEN_OUTPUT); ;} break; case 970: #line 5004 "parser.y" { yyval = cb_int (COB_OPEN_I_O); ;} break; case 971: #line 5005 "parser.y" { yyval = cb_int (COB_OPEN_EXTEND); ;} break; case 972: #line 5009 "parser.y" { yyval = NULL; ;} break; case 973: #line 5010 "parser.y" { yyval = yyvsp[0]; ;} break; case 974: #line 5014 "parser.y" { yyval = NULL; ;} break; case 975: #line 5015 "parser.y" { yyval = NULL; ;} break; case 976: #line 5016 "parser.y" { PENDING ("OPEN ... WITH LOCK"); ;} break; case 977: #line 5028 "parser.y" { BEGIN_STATEMENT ("PERFORM", TERM_PERFORM); ;} break; case 979: #line 5034 "parser.y" { cb_emit_perform (yyvsp[0], yyvsp[-1]); ;} break; case 980: #line 5038 "parser.y" { perform_stack = cb_cons (yyvsp[0], perform_stack); check_unreached = 0; ;} break; case 981: #line 5043 "parser.y" { perform_stack = CB_CHAIN (perform_stack); cb_emit_perform (yyvsp[-3], yyvsp[-1]); ;} break; case 982: #line 5048 "parser.y" { cb_emit_perform (yyvsp[-1], NULL); ;} break; case 983: #line 5054 "parser.y" { terminator_error (); ;} break; case 984: #line 5055 "parser.y" { terminator_clear (TERM_PERFORM); ;} break; case 985: #line 5060 "parser.y" { CB_REFERENCE (yyvsp[0])->length = cb_true; /* return from $1 */ yyval = cb_build_pair (yyvsp[0], yyvsp[0]); ;} break; case 986: #line 5065 "parser.y" { CB_REFERENCE (yyvsp[0])->length = cb_true; /* return from $3 */ yyval = cb_build_pair (yyvsp[-2], yyvsp[0]); ;} break; case 987: #line 5073 "parser.y" { yyval = cb_build_perform_once (NULL); ;} break; case 988: #line 5077 "parser.y" { yyval = cb_build_perform_forever (NULL); ;} break; case 989: #line 5081 "parser.y" { yyval = cb_build_perform_times (yyvsp[-1]); current_program->loop_counter++; ;} break; case 990: #line 5086 "parser.y" { cb_tree varying; varying = cb_list_init (cb_build_perform_varying (NULL, NULL, NULL, yyvsp[0])); yyval = cb_build_perform_until (yyvsp[-2], varying); ;} break; case 991: #line 5093 "parser.y" { yyval = cb_build_perform_until (yyvsp[-2], yyvsp[0]); ;} break; case 992: #line 5099 "parser.y" { yyval = CB_BEFORE; ;} break; case 993: #line 5100 "parser.y" { yyval = yyvsp[0]; ;} break; case 994: #line 5104 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 995: #line 5106 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 996: #line 5111 "parser.y" { yyval = cb_build_perform_varying (yyvsp[-6], yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 997: #line 5122 "parser.y" { BEGIN_STATEMENT ("READ", TERM_READ); ;} break; case 998: #line 5125 "parser.y" { if (yyvsp[-7] != cb_error_node) { if (yyvsp[-3] && (CB_FILE(cb_ref (yyvsp[-7]))->lock_mode & COB_LOCK_AUTOMATIC)) { cb_error (_("LOCK clause invalid with file LOCK AUTOMATIC")); } else if (yyvsp[-2] && (CB_FILE(cb_ref (yyvsp[-7]))->organization != COB_ORG_RELATIVE && CB_FILE(cb_ref (yyvsp[-7]))->organization != COB_ORG_INDEXED)) { cb_error (_("KEY clause invalid with this file type")); } else if (current_statement->handler_id == COB_EC_I_O_INVALID_KEY && (CB_FILE(cb_ref (yyvsp[-7]))->organization != COB_ORG_RELATIVE && CB_FILE(cb_ref (yyvsp[-7]))->organization != COB_ORG_INDEXED)) { cb_error (_("INVALID KEY clause invalid with this file type")); } else { cb_emit_read (yyvsp[-7], yyvsp[-6], yyvsp[-4], yyvsp[-2], yyvsp[-3]); } } ;} break; case 999: #line 5145 "parser.y" { yyval = NULL; ;} break; case 1000: #line 5146 "parser.y" { yyval = yyvsp[0]; ;} break; case 1001: #line 5150 "parser.y" { yyval = NULL; ;} break; case 1002: #line 5152 "parser.y" { yyval = cb_int3; ;} break; case 1003: #line 5156 "parser.y" { yyval = cb_int1; ;} break; case 1004: #line 5160 "parser.y" { yyval = cb_int2; ;} break; case 1005: #line 5164 "parser.y" { yyval = cb_int3; ;} break; case 1006: #line 5168 "parser.y" { yyval = cb_int4; ;} break; case 1007: #line 5174 "parser.y" { yyval = NULL; ;} break; case 1008: #line 5175 "parser.y" { yyval = yyvsp[0]; ;} break; case 1012: #line 5184 "parser.y" { terminator_warning (TERM_READ); ;} break; case 1013: #line 5185 "parser.y" { terminator_clear (TERM_READ); ;} break; case 1014: #line 5194 "parser.y" { BEGIN_STATEMENT ("RELEASE", 0); ;} break; case 1015: #line 5196 "parser.y" { if (yyvsp[-1] != cb_error_node) { cb_emit_release (yyvsp[-1], yyvsp[0]); } ;} break; case 1016: #line 5209 "parser.y" { BEGIN_STATEMENT ("RETURN", TERM_RETURN); ;} break; case 1017: #line 5212 "parser.y" { if (yyvsp[-4] != cb_error_node) { cb_emit_return (yyvsp[-4], yyvsp[-2]); } ;} break; case 1018: #line 5220 "parser.y" { terminator_warning (TERM_RETURN); ;} break; case 1019: #line 5221 "parser.y" { terminator_clear (TERM_RETURN); ;} break; case 1020: #line 5230 "parser.y" { BEGIN_STATEMENT ("REWRITE", TERM_REWRITE); ;} break; case 1021: #line 5233 "parser.y" { if (yyvsp[-4] != cb_error_node) { cb_emit_rewrite (yyvsp[-4], yyvsp[-3], yyvsp[-2]); } ;} break; case 1022: #line 5241 "parser.y" { yyval = NULL; ;} break; case 1023: #line 5243 "parser.y" { yyval = cb_int1; ;} break; case 1024: #line 5247 "parser.y" { yyval = cb_int2; ;} break; case 1025: #line 5253 "parser.y" { terminator_warning (TERM_REWRITE); ;} break; case 1026: #line 5254 "parser.y" { terminator_clear (TERM_REWRITE); ;} break; case 1027: #line 5264 "parser.y" { BEGIN_STATEMENT ("ROLLBACK", 0); cb_emit_rollback (); ;} break; case 1028: #line 5276 "parser.y" { BEGIN_STATEMENT ("SEARCH", TERM_SEARCH); ;} break; case 1030: #line 5283 "parser.y" { cb_emit_search (yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;} break; case 1031: #line 5287 "parser.y" { check_unreached = 0; ;} break; case 1032: #line 5291 "parser.y" { cb_emit_search_all (yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1033: #line 5297 "parser.y" { yyval = NULL; ;} break; case 1034: #line 5298 "parser.y" { yyval = yyvsp[0]; ;} break; case 1035: #line 5302 "parser.y" { yyval = NULL; ;} break; case 1036: #line 5304 "parser.y" { check_unreached = 0; ;} break; case 1037: #line 5308 "parser.y" { yyval = yyvsp[0]; ;} break; case 1038: #line 5314 "parser.y" { yyval = yyvsp[0]; ;} break; case 1039: #line 5315 "parser.y" { yyval = yyvsp[-1]; CB_IF (yyvsp[-1])->stmt2 = yyvsp[0]; ;} break; case 1040: #line 5320 "parser.y" { check_unreached = 0; ;} break; case 1041: #line 5324 "parser.y" { yyval = cb_build_if (yyvsp[-2], yyvsp[0], NULL); ;} break; case 1042: #line 5330 "parser.y" { terminator_warning (TERM_SEARCH); ;} break; case 1043: #line 5331 "parser.y" { terminator_clear (TERM_SEARCH); ;} break; case 1044: #line 5340 "parser.y" { BEGIN_STATEMENT ("SET", 0); ;} break; case 1051: #line 5356 "parser.y" { cb_emit_setenv (yyvsp[-2], yyvsp[0]); ;} break; case 1052: #line 5365 "parser.y" { cb_emit_set_to (yyvsp[-3], cb_build_ppointer (yyvsp[0])); ;} break; case 1053: #line 5369 "parser.y" { cb_emit_set_to (yyvsp[-2], yyvsp[0]); ;} break; case 1054: #line 5378 "parser.y" { cb_emit_set_up_down (yyvsp[-3], yyvsp[-2], yyvsp[0]); ;} break; case 1055: #line 5384 "parser.y" { yyval = cb_int0; ;} break; case 1056: #line 5385 "parser.y" { yyval = cb_int1; ;} break; case 1059: #line 5397 "parser.y" { cb_emit_set_on_off (yyvsp[-2], yyvsp[0]); ;} break; case 1062: #line 5411 "parser.y" { cb_emit_set_true (yyvsp[-2]); ;} break; case 1063: #line 5415 "parser.y" { cb_emit_set_false (yyvsp[-2]); ;} break; case 1064: #line 5426 "parser.y" { BEGIN_STATEMENT ("SORT", 0); ;} break; case 1066: #line 5432 "parser.y" { cb_emit_sort_init (yyvsp[-3], yyvsp[-2], yyvsp[0]); if (CB_FILE_P (cb_ref (yyvsp[-3])) && yyvsp[-2] == NULL) { cb_error (_("File sort requires KEY phrase")); } /* used in sort_input/sort_output */ save_tree_1 = yyvsp[-3]; ;} break; case 1067: #line 5441 "parser.y" { cb_emit_sort_finish (yyvsp[-6]); ;} break; case 1068: #line 5448 "parser.y" { yyval = NULL; ;} break; case 1069: #line 5453 "parser.y" { cb_tree l; if (yyvsp[0] == NULL) { yyvsp[0] = cb_list_init (NULL); } for (l = yyvsp[0]; l; l = CB_CHAIN (l)) { CB_PURPOSE (l) = yyvsp[-2]; } yyval = cb_list_append (yyvsp[-4], yyvsp[0]); ;} break; case 1070: #line 5467 "parser.y" { yyval = NULL; ;} break; case 1071: #line 5468 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1073: #line 5472 "parser.y" { /* nothing */ ;} break; case 1074: #line 5476 "parser.y" { yyval = cb_null; ;} break; case 1075: #line 5477 "parser.y" { yyval = cb_ref (yyvsp[0]); ;} break; case 1076: #line 5482 "parser.y" { if (CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("File sort requires USING or INPUT PROCEDURE")); } ;} break; case 1077: #line 5488 "parser.y" { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("USING invalid with table SORT")); } else { cb_emit_sort_using (save_tree_1, yyvsp[0]); } ;} break; case 1078: #line 5496 "parser.y" { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("INPUT PROCEDURE invalid with table SORT")); } else { cb_emit_sort_input (yyvsp[0]); } ;} break; case 1079: #line 5507 "parser.y" { if (CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("File sort requires GIVING or OUTPUT PROCEDURE")); } ;} break; case 1080: #line 5513 "parser.y" { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("GIVING invalid with table SORT")); } else { cb_emit_sort_giving (save_tree_1, yyvsp[0]); } ;} break; case 1081: #line 5521 "parser.y" { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("OUTPUT PROCEDURE invalid with table SORT")); } else { cb_emit_sort_output (yyvsp[0]); } ;} break; case 1082: #line 5536 "parser.y" { BEGIN_STATEMENT ("START", TERM_START); ;} break; case 1083: #line 5537 "parser.y" { yyval = cb_int (COB_EQ); ;} break; case 1084: #line 5540 "parser.y" { if (CB_FILE_P (cb_ref (yyvsp[-4]))) { if (CB_FILE (cb_ref (yyvsp[-4]))->organization != COB_ORG_INDEXED && CB_FILE (cb_ref (yyvsp[-4]))->organization != COB_ORG_RELATIVE) { cb_error (_("START not allowed on SEQUENTIAL files")); yyval = cb_error_node; } else { cb_emit_start (yyvsp[-4], yyvsp[-3], yyvsp[-2]); } } else { cb_error_x (yyvsp[-4], _("'%s' is not a file name"), CB_NAME (yyvsp[-4])); yyval = cb_error_node; } ;} break; case 1085: #line 5557 "parser.y" { yyval = NULL; ;} break; case 1086: #line 5558 "parser.y" { yyvsp[-4] = yyvsp[-1]; yyval = yyvsp[0]; ;} break; case 1087: #line 5562 "parser.y" { yyval = cb_int ((yyvsp[-1] == cb_int1) ? COB_NE : COB_EQ); ;} break; case 1088: #line 5563 "parser.y" { yyval = cb_int ((yyvsp[-1] == cb_int1) ? COB_LE : COB_GT); ;} break; case 1089: #line 5564 "parser.y" { yyval = cb_int ((yyvsp[-1] == cb_int1) ? COB_GE : COB_LT); ;} break; case 1090: #line 5565 "parser.y" { yyval = cb_int ((yyvsp[-1] == cb_int1) ? COB_LT : COB_GE); ;} break; case 1091: #line 5566 "parser.y" { yyval = cb_int ((yyvsp[-1] == cb_int1) ? COB_GT : COB_LE); ;} break; case 1092: #line 5570 "parser.y" { terminator_warning (TERM_START); ;} break; case 1093: #line 5571 "parser.y" { terminator_clear (TERM_START); ;} break; case 1094: #line 5580 "parser.y" { BEGIN_STATEMENT ("STOP", 0); ;} break; case 1095: #line 5582 "parser.y" { cb_emit_stop_run (yyvsp[0]); ;} break; case 1096: #line 5586 "parser.y" { cb_verify (cb_stop_literal_statement, "STOP literal"); ;} break; case 1097: #line 5592 "parser.y" { yyval = current_program->cb_return_code; ;} break; case 1098: #line 5593 "parser.y" { yyval = yyvsp[0]; ;} break; case 1099: #line 5594 "parser.y" { yyval = yyvsp[0]; ;} break; case 1100: #line 5603 "parser.y" { BEGIN_STATEMENT ("STRING", TERM_STRING); ;} break; case 1101: #line 5606 "parser.y" { cb_emit_string (yyvsp[-5], yyvsp[-3], yyvsp[-2]); ;} break; case 1102: #line 5612 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1103: #line 5613 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1104: #line 5617 "parser.y" { yyval = yyvsp[0]; ;} break; case 1105: #line 5618 "parser.y" { yyval = cb_build_pair (cb_int0, NULL); ;} break; case 1106: #line 5619 "parser.y" { yyval = cb_build_pair (yyvsp[0], NULL); ;} break; case 1107: #line 5623 "parser.y" { yyval = cb_int0; ;} break; case 1108: #line 5624 "parser.y" { yyval = yyvsp[0]; ;} break; case 1109: #line 5628 "parser.y" { terminator_warning (TERM_STRING); ;} break; case 1110: #line 5629 "parser.y" { terminator_clear (TERM_STRING); ;} break; case 1111: #line 5638 "parser.y" { BEGIN_STATEMENT ("SUBTRACT", TERM_SUBTRACT); ;} break; case 1113: #line 5645 "parser.y" { cb_emit_arithmetic (yyvsp[-1], '-', cb_build_binary_list (yyvsp[-3], '+')); ;} break; case 1114: #line 5649 "parser.y" { cb_emit_arithmetic (yyvsp[-1], 0, cb_build_binary_list (cb_cons (yyvsp[-3], yyvsp[-5]), '-')); ;} break; case 1115: #line 5653 "parser.y" { cb_emit_corresponding (cb_build_sub, yyvsp[-2], yyvsp[-4], yyvsp[-1]); ;} break; case 1116: #line 5659 "parser.y" { terminator_warning (TERM_SUBTRACT); ;} break; case 1117: #line 5660 "parser.y" { terminator_clear (TERM_SUBTRACT); ;} break; case 1118: #line 5670 "parser.y" { BEGIN_STATEMENT ("SUPPRESS", 0); PENDING("SUPPRESS"); ;} break; case 1121: #line 5685 "parser.y" { BEGIN_STATEMENT ("TERMINATE", 0); ;} break; case 1122: #line 5687 "parser.y" { PENDING("TERMINATE"); ;} break; case 1123: #line 5698 "parser.y" { BEGIN_STATEMENT ("TRANSFORM", 0); ;} break; case 1124: #line 5700 "parser.y" { cb_tree x; x = cb_build_converting (yyvsp[-2], yyvsp[0], cb_build_inspect_region_start ()); cb_emit_inspect (yyvsp[-4], x, cb_int0, 2); ;} break; case 1125: #line 5714 "parser.y" { BEGIN_STATEMENT ("UNLOCK", 0); ;} break; case 1126: #line 5716 "parser.y" { if (yyvsp[-1] != cb_error_node) { cb_emit_unlock (yyvsp[-1]); } ;} break; case 1130: #line 5735 "parser.y" { BEGIN_STATEMENT ("UNSTRING", TERM_UNSTRING); ;} break; case 1131: #line 5739 "parser.y" { cb_emit_unstring (yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2]); ;} break; case 1132: #line 5745 "parser.y" { yyval = NULL; ;} break; case 1133: #line 5747 "parser.y" { yyval = yyvsp[0]; ;} break; case 1134: #line 5751 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1135: #line 5753 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 1136: #line 5758 "parser.y" { yyval = cb_build_unstring_delimited (yyvsp[-1], yyvsp[0]); ;} break; case 1137: #line 5764 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1138: #line 5766 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1139: #line 5771 "parser.y" { yyval = cb_build_unstring_into (yyvsp[-2], yyvsp[-1], yyvsp[0]); ;} break; case 1140: #line 5777 "parser.y" { yyval = NULL; ;} break; case 1141: #line 5778 "parser.y" { yyval = yyvsp[0]; ;} break; case 1142: #line 5782 "parser.y" { yyval = NULL; ;} break; case 1143: #line 5783 "parser.y" { yyval = yyvsp[0]; ;} break; case 1144: #line 5787 "parser.y" { yyval = NULL; ;} break; case 1145: #line 5788 "parser.y" { yyval = yyvsp[0]; ;} break; case 1146: #line 5792 "parser.y" { terminator_warning (TERM_UNSTRING); ;} break; case 1147: #line 5793 "parser.y" { terminator_clear (TERM_UNSTRING); ;} break; case 1151: #line 5811 "parser.y" { if (!in_declaratives) { cb_error (_("USE statement must be within DECLARATIVES")); } else if (!current_section) { cb_error (_("SECTION header missing before USE statement")); } else { current_section->need_begin = 1; current_section->need_return = 1; CB_EXCEPTION_ENABLE (COB_EC_I_O) = 1; if (use_global_ind) { current_section->is_global = 1; current_program->global_list = cb_list_add (current_program->global_list, CB_TREE (current_section)); } } ;} break; case 1152: #line 5832 "parser.y" { use_global_ind = 0; ;} break; case 1153: #line 5836 "parser.y" { use_global_ind = 1; current_program->flag_global_use = 1; ;} break; case 1154: #line 5844 "parser.y" { cb_tree l; for (l = yyvsp[0]; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { setup_use_file (CB_FILE (cb_ref (CB_VALUE (l)))); } } ;} break; case 1155: #line 5854 "parser.y" { current_program->global_handler[COB_OPEN_INPUT].handler_label = current_section; current_program->global_handler[COB_OPEN_INPUT].handler_prog = current_program; ;} break; case 1156: #line 5859 "parser.y" { current_program->global_handler[COB_OPEN_OUTPUT].handler_label = current_section; current_program->global_handler[COB_OPEN_OUTPUT].handler_prog = current_program; ;} break; case 1157: #line 5864 "parser.y" { current_program->global_handler[COB_OPEN_I_O].handler_label = current_section; current_program->global_handler[COB_OPEN_I_O].handler_prog = current_program; ;} break; case 1158: #line 5869 "parser.y" { current_program->global_handler[COB_OPEN_EXTEND].handler_label = current_section; current_program->global_handler[COB_OPEN_EXTEND].handler_prog = current_program; ;} break; case 1171: #line 5901 "parser.y" { PENDING ("USE FOR DEBUGGING"); ;} break; case 1174: #line 5913 "parser.y" { PENDING ("USE BEFORE REPORTING"); ;} break; case 1175: #line 5924 "parser.y" { BEGIN_STATEMENT ("WRITE", TERM_WRITE); ;} break; case 1176: #line 5927 "parser.y" { if (yyvsp[-5] != cb_error_node) { cb_emit_write (yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[-3]); } ;} break; case 1177: #line 5935 "parser.y" { yyval = NULL; ;} break; case 1178: #line 5936 "parser.y" { yyval = yyvsp[0]; ;} break; case 1179: #line 5941 "parser.y" { yyval = cb_int0; ;} break; case 1180: #line 5945 "parser.y" { yyval = cb_build_write_advancing_lines (yyvsp[-3], yyvsp[-1]); ;} break; case 1181: #line 5949 "parser.y" { yyval = cb_build_write_advancing_mnemonic (yyvsp[-2], yyvsp[0]); ;} break; case 1182: #line 5953 "parser.y" { yyval = cb_build_write_advancing_page (yyvsp[-2]); ;} break; case 1183: #line 5959 "parser.y" { yyval = CB_BEFORE; ;} break; case 1184: #line 5960 "parser.y" { yyval = CB_AFTER; ;} break; case 1188: #line 5969 "parser.y" { terminator_warning (TERM_WRITE); ;} break; case 1189: #line 5970 "parser.y" { terminator_clear (TERM_WRITE); ;} break; case 1190: #line 5985 "parser.y" { current_statement->handler_id = COB_EC_IMP_ACCEPT; ;} break; case 1191: #line 5993 "parser.y" { current_statement->handler_id = COB_EC_IMP_DISPLAY; ;} break; case 1193: #line 6000 "parser.y" { check_unreached = 0; ;} break; case 1194: #line 6004 "parser.y" { current_statement->handler1 = yyvsp[0]; ;} break; case 1196: #line 6011 "parser.y" { check_unreached = 0; ;} break; case 1197: #line 6015 "parser.y" { current_statement->handler2 = yyvsp[0]; ;} break; case 1198: #line 6027 "parser.y" { current_statement->handler_id = COB_EC_SIZE; ;} break; case 1200: #line 6034 "parser.y" { check_unreached = 0; ;} break; case 1201: #line 6038 "parser.y" { current_statement->handler1 = yyvsp[0]; ;} break; case 1203: #line 6045 "parser.y" { check_unreached = 0; ;} break; case 1204: #line 6049 "parser.y" { current_statement->handler2 = yyvsp[0]; ;} break; case 1205: #line 6061 "parser.y" { current_statement->handler_id = COB_EC_OVERFLOW; ;} break; case 1207: #line 6068 "parser.y" { check_unreached = 0; ;} break; case 1208: #line 6072 "parser.y" { current_statement->handler1 = yyvsp[0]; ;} break; case 1210: #line 6079 "parser.y" { check_unreached = 0; ;} break; case 1211: #line 6083 "parser.y" { current_statement->handler2 = yyvsp[0]; ;} break; case 1212: #line 6095 "parser.y" { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler1 = yyvsp[0]; ;} break; case 1213: #line 6100 "parser.y" { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler2 = yyvsp[0]; ;} break; case 1214: #line 6105 "parser.y" { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler1 = yyvsp[-1]; current_statement->handler2 = yyvsp[0]; ;} break; case 1215: #line 6114 "parser.y" { check_unreached = 0; ;} break; case 1216: #line 6118 "parser.y" { yyval = yyvsp[0]; ;} break; case 1217: #line 6125 "parser.y" { check_unreached = 0; ;} break; case 1218: #line 6129 "parser.y" { yyval = yyvsp[0]; ;} break; case 1219: #line 6141 "parser.y" { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler1 = yyvsp[0]; ;} break; case 1220: #line 6146 "parser.y" { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler2 = yyvsp[0]; ;} break; case 1221: #line 6151 "parser.y" { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler1 = yyvsp[-1]; current_statement->handler2 = yyvsp[0]; ;} break; case 1222: #line 6160 "parser.y" { check_unreached = 0; ;} break; case 1223: #line 6164 "parser.y" { yyval = yyvsp[0]; ;} break; case 1224: #line 6171 "parser.y" { check_unreached = 0; ;} break; case 1225: #line 6175 "parser.y" { yyval = yyvsp[0]; ;} break; case 1228: #line 6191 "parser.y" { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler1 = yyvsp[0]; ;} break; case 1229: #line 6196 "parser.y" { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler2 = yyvsp[0]; ;} break; case 1230: #line 6201 "parser.y" { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler1 = yyvsp[-1]; current_statement->handler2 = yyvsp[0]; ;} break; case 1231: #line 6210 "parser.y" { check_unreached = 0; ;} break; case 1232: #line 6214 "parser.y" { yyval = yyvsp[0]; ;} break; case 1233: #line 6221 "parser.y" { check_unreached = 0; ;} break; case 1234: #line 6225 "parser.y" { yyval = yyvsp[0]; ;} break; case 1235: #line 6237 "parser.y" { yyval = cb_one; ;} break; case 1236: #line 6241 "parser.y" { yyval = yyvsp[-1]; ;} break; case 1237: #line 6253 "parser.y" { yyval = cb_build_cond (yyvsp[0]); ;} break; case 1238: #line 6260 "parser.y" { yyval = cb_build_expr (yyvsp[0]); ;} break; case 1239: #line 6266 "parser.y" { current_expr = NULL; ;} break; case 1240: #line 6270 "parser.y" { yyval = cb_list_reverse (current_expr); ;} break; case 1244: #line 6282 "parser.y" { push_expr ('x', yyvsp[0]); ;} break; case 1245: #line 6284 "parser.y" { push_expr ('(', NULL); ;} break; case 1246: #line 6285 "parser.y" { push_expr (')', NULL); ;} break; case 1247: #line 6287 "parser.y" { push_expr ('+', NULL); ;} break; case 1248: #line 6288 "parser.y" { push_expr ('-', NULL); ;} break; case 1249: #line 6289 "parser.y" { push_expr ('*', NULL); ;} break; case 1250: #line 6290 "parser.y" { push_expr ('/', NULL); ;} break; case 1251: #line 6291 "parser.y" { push_expr ('^', NULL); ;} break; case 1252: #line 6293 "parser.y" { push_expr ('=', NULL); ;} break; case 1253: #line 6294 "parser.y" { push_expr ('>', NULL); ;} break; case 1254: #line 6295 "parser.y" { push_expr ('<', NULL); ;} break; case 1255: #line 6296 "parser.y" { push_expr (']', NULL); ;} break; case 1256: #line 6297 "parser.y" { push_expr ('[', NULL); ;} break; case 1257: #line 6298 "parser.y" { push_expr ('~', NULL); ;} break; case 1258: #line 6300 "parser.y" { push_expr ('!', NULL); ;} break; case 1259: #line 6301 "parser.y" { push_expr ('&', NULL); ;} break; case 1260: #line 6302 "parser.y" { push_expr ('|', NULL); ;} break; case 1261: #line 6304 "parser.y" { push_expr ('O', NULL); ;} break; case 1262: #line 6305 "parser.y" { push_expr ('9', NULL); ;} break; case 1263: #line 6306 "parser.y" { push_expr ('A', NULL); ;} break; case 1264: #line 6307 "parser.y" { push_expr ('L', NULL); ;} break; case 1265: #line 6308 "parser.y" { push_expr ('U', NULL); ;} break; case 1266: #line 6311 "parser.y" { push_expr ('P', NULL); ;} break; case 1267: #line 6312 "parser.y" { push_expr ('N', NULL); ;} break; case 1279: #line 6324 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1280: #line 6325 "parser.y" { yyval = cb_list_add (yyvsp[-2], yyvsp[0]); ;} break; case 1284: #line 6334 "parser.y" { yyval = yyvsp[0]; ;} break; case 1285: #line 6335 "parser.y" { yyval = cb_build_binary_op (yyvsp[-2], '+', yyvsp[0]); ;} break; case 1286: #line 6336 "parser.y" { yyval = cb_build_binary_op (yyvsp[-2], '-', yyvsp[0]); ;} break; case 1287: #line 6337 "parser.y" { yyval = cb_build_binary_op (yyvsp[-2], '*', yyvsp[0]); ;} break; case 1288: #line 6338 "parser.y" { yyval = cb_build_binary_op (yyvsp[-2], '/', yyvsp[0]); ;} break; case 1289: #line 6339 "parser.y" { yyval = yyvsp[0]; ;} break; case 1290: #line 6340 "parser.y" { yyval = cb_build_binary_op (cb_zero, '-', yyvsp[0]); ;} break; case 1291: #line 6341 "parser.y" { yyval = cb_build_binary_op (yyvsp[-2], '^', yyvsp[0]); ;} break; case 1292: #line 6342 "parser.y" { yyval = yyvsp[-1]; ;} break; case 1293: #line 6354 "parser.y" { if (current_linage > 1) { cb_error (_("LINAGE-COUNTER must be qualified here")); yyval = cb_error_node; } else if (current_linage == 0) { cb_error (_("Invalid LINAGE-COUNTER usage")); yyval = cb_error_node; } else { yyval = linage_file->linage_ctr; } ;} break; case 1294: #line 6366 "parser.y" { if (CB_FILE_P (cb_ref (yyvsp[0]))) { yyval = CB_FILE (cb_ref (yyvsp[0]))->linage_ctr; } else { cb_error_x (yyvsp[0], _("'%s' is not a file name"), CB_NAME (yyvsp[0])); yyval = cb_error_node; } ;} break; case 1295: #line 6380 "parser.y" { yyval = yyvsp[0]; ;} break; case 1296: #line 6382 "parser.y" { yyval = cb_list_append (yyvsp[-1], yyvsp[0]); ;} break; case 1297: #line 6386 "parser.y" { yyval = cb_build_pair (yyvsp[0], yyvsp[-1]); ;} break; case 1298: #line 6392 "parser.y" { cb_build_identifier (yyvsp[0]); ;} break; case 1299: #line 6399 "parser.y" { cb_tree x; x = cb_ref (yyvsp[0]); if (!CB_FIELD_P (x)) { yyval = cb_error_node; } else if (!CB_FIELD (x)->index_list) { cb_error_x (yyvsp[0], _("'%s' not indexed"), cb_name (yyvsp[0])); cb_error_x (x, _("'%s' defined here"), cb_name (x)); yyval = cb_error_node; } else { yyval = yyvsp[0]; } ;} break; case 1300: #line 6419 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1301: #line 6423 "parser.y" { cb_tree l; if (yyvsp[0] != cb_error_node) { for (l = yyvsp[-1]; l; l = CB_CHAIN (l)) { if (!strcasecmp (CB_NAME (yyvsp[0]), CB_NAME (CB_VALUE (l)))) { cb_error_x (yyvsp[0], _("Multiple reference to '%s' "), CB_NAME (yyvsp[0])); } } yyval = cb_list_add (yyvsp[-1], yyvsp[0]); } ;} break; case 1302: #line 6439 "parser.y" { if (CB_FILE_P (cb_ref (yyvsp[0]))) { yyval = yyvsp[0]; } else { cb_error_x (yyvsp[0], _("'%s' is not a file name"), CB_NAME (yyvsp[0])); yyval = cb_error_node; } ;} break; case 1303: #line 6452 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1304: #line 6454 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1305: #line 6458 "parser.y" { yyval = yyvsp[0]; ;} break; case 1306: #line 6464 "parser.y" { yyval = NULL; ;} break; case 1307: #line 6466 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1308: #line 6471 "parser.y" { yyval = yyvsp[0]; CB_REFERENCE (yyval)->offset = CB_TREE (current_section); current_program->label_list = cb_cons (yyval, current_program->label_list); ;} break; case 1312: #line 6486 "parser.y" { yyval = cb_build_reference ((char *)(CB_LITERAL (yyvsp[0])->data)); yyval->source_file = yyvsp[0]->source_file; yyval->source_line = yyvsp[0]->source_line; ;} break; case 1313: #line 6496 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1314: #line 6497 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1315: #line 6502 "parser.y" { yyval = yyvsp[0]; current_program->reference_list = cb_cons (yyval, current_program->reference_list); ;} break; case 1316: #line 6509 "parser.y" { yyval = NULL; ;} break; case 1317: #line 6510 "parser.y" { yyval = yyvsp[0]; ;} break; case 1320: #line 6522 "parser.y" { yyval = yyvsp[0]; if (CB_REFERENCE (yyval)->word->count > 0) { redefinition_error (yyval); yyval = cb_error_node; } ;} break; case 1321: #line 6541 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1322: #line 6542 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1324: #line 6547 "parser.y" { yyval = cb_build_address (yyvsp[0]); ;} break; case 1325: #line 6551 "parser.y" { yyval = cb_list_init (yyvsp[0]); ;} break; case 1326: #line 6552 "parser.y" { yyval = cb_list_add (yyvsp[-1], yyvsp[0]); ;} break; case 1328: #line 6557 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1329: #line 6558 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1330: #line 6559 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1331: #line 6560 "parser.y" { yyval = cb_build_ppointer (yyvsp[0]); ;} break; case 1332: #line 6561 "parser.y" { yyval = cb_build_address (yyvsp[0]); ;} break; case 1337: #line 6569 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1338: #line 6570 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1339: #line 6571 "parser.y" { yyval = cb_build_length (yyvsp[0]); ;} break; case 1345: #line 6583 "parser.y" { yyval = yyvsp[0]; ;} break; case 1346: #line 6584 "parser.y" { yyval = yyvsp[0]; ;} break; case 1358: #line 6618 "parser.y" { yyval = cb_zero; ;} break; case 1359: #line 6626 "parser.y" { yyval = cb_build_identifier (yyvsp[0]); ;} break; case 1360: #line 6630 "parser.y" { yyval = yyvsp[0]; ;} break; case 1361: #line 6631 "parser.y" { yyval = yyvsp[-1]; ;} break; case 1362: #line 6632 "parser.y" { yyval = yyvsp[-1]; ;} break; case 1363: #line 6633 "parser.y" { yyval = yyvsp[-2]; ;} break; case 1364: #line 6637 "parser.y" { yyval = yyvsp[0]; ;} break; case 1365: #line 6638 "parser.y" { yyval = yyvsp[-2]; CB_REFERENCE (yyvsp[-2])->chain = yyvsp[0]; ;} break; case 1366: #line 6643 "parser.y" { yyval = yyvsp[-3]; CB_REFERENCE (yyvsp[-3])->subs = cb_list_reverse (yyvsp[-1]); ;} break; case 1367: #line 6651 "parser.y" { CB_REFERENCE (yyvsp[-4])->offset = yyvsp[-2]; ;} break; case 1368: #line 6655 "parser.y" { CB_REFERENCE (yyvsp[-5])->offset = yyvsp[-3]; CB_REFERENCE (yyvsp[-5])->length = yyvsp[-1]; ;} break; case 1369: #line 6667 "parser.y" { if (cb_tree_category (yyvsp[0]) != CB_CATEGORY_NUMERIC) { cb_error (_("Integer value expected")); } else if (CB_LITERAL (yyvsp[0])->sign < 0 || CB_LITERAL (yyvsp[0])->scale) { cb_error (_("Integer value expected")); } yyval = yyvsp[0]; ;} break; case 1370: #line 6678 "parser.y" { yyval = yyvsp[0]; ;} break; case 1371: #line 6680 "parser.y" { yyval = yyvsp[0]; if (CB_LITERAL_P (yyvsp[0])) { CB_LITERAL (yyvsp[0])->all = 1; } ;} break; case 1372: #line 6689 "parser.y" { yyval = yyvsp[0]; ;} break; case 1373: #line 6690 "parser.y" { yyval = cb_concat_literals (yyvsp[-2], yyvsp[0]); ;} break; case 1374: #line 6694 "parser.y" { yyval = yyvsp[0]; ;} break; case 1375: #line 6695 "parser.y" { yyval = cb_space; ;} break; case 1376: #line 6696 "parser.y" { yyval = cb_zero; ;} break; case 1377: #line 6697 "parser.y" { yyval = cb_quote; ;} break; case 1378: #line 6698 "parser.y" { yyval = cb_high; ;} break; case 1379: #line 6699 "parser.y" { yyval = cb_low; ;} break; case 1380: #line 6700 "parser.y" { yyval = cb_null; ;} break; case 1381: #line 6709 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-1], NULL, yyvsp[0]); ;} break; case 1382: #line 6713 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-1], NULL, yyvsp[0]); ;} break; case 1383: #line 6717 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], cb_list_init (yyvsp[-2]), yyvsp[0]); ;} break; case 1384: #line 6721 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], cb_list_init (yyvsp[-2]), yyvsp[0]); ;} break; case 1385: #line 6725 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], cb_list_init (yyvsp[-2]), yyvsp[0]); ;} break; case 1386: #line 6729 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1387: #line 6733 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1388: #line 6737 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1389: #line 6741 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1390: #line 6745 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-3], yyvsp[-1], NULL); ;} break; case 1391: #line 6749 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-4], yyvsp[-2], yyvsp[0]); ;} break; case 1392: #line 6753 "parser.y" { yyval = cb_build_intrinsic (yyvsp[-1], yyvsp[0], NULL); ;} break; case 1393: #line 6759 "parser.y" { yyval = NULL; ;} break; case 1394: #line 6760 "parser.y" { yyval = cb_build_pair (yyvsp[-2], NULL); ;} break; case 1395: #line 6761 "parser.y" { yyval = cb_build_pair (yyvsp[-3], yyvsp[-1]); ;} break; case 1396: #line 6765 "parser.y" { yyval = NULL; ;} break; case 1397: #line 6766 "parser.y" { yyval = yyvsp[-1]; ;} break; case 1398: #line 6770 "parser.y" { yyval = NULL; ;} break; case 1399: #line 6771 "parser.y" { yyval = yyvsp[0]; ;} break; case 1400: #line 6777 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[0]); yyval = cb_list_add (x, cb_int0); ;} break; case 1401: #line 6784 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[-2]); yyval = cb_list_add (x, cb_int1); ;} break; case 1402: #line 6791 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[-2]); yyval = cb_list_add (x, cb_int2); ;} break; case 1403: #line 6801 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[0]); yyval = cb_list_add (x, cb_null); ;} break; case 1404: #line 6808 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[-2]); yyval = cb_list_add (x, yyvsp[0]); ;} break; case 1405: #line 6818 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[0]); yyval = cb_list_add (x, cb_null); ;} break; case 1406: #line 6825 "parser.y" { cb_tree x; x = cb_list_init (yyvsp[-2]); yyval = cb_list_add (x, cb_ref (yyvsp[0])); ;} break; case 1407: #line 6838 "parser.y" { non_const_word = 1; ;} break; case 1408: #line 6848 "parser.y" { yyval = cb_int0; ;} break; case 1409: #line 6849 "parser.y" { yyval = cb_int1; ;} break; case 1410: #line 6853 "parser.y" { yyval = cb_int0; ;} break; case 1411: #line 6854 "parser.y" { yyval = cb_int1; ;} break; case 1412: #line 6858 "parser.y" { yyval = NULL; ;} break; case 1413: #line 6859 "parser.y" { yyval = cb_int1; ;} break; case 1414: #line 6863 "parser.y" { yyval = cb_int0; ;} break; case 1415: #line 6864 "parser.y" { yyval = cb_int1; ;} break; case 1416: #line 6865 "parser.y" { yyval = cb_int2; ;} break; case 1417: #line 6869 "parser.y" { yyval = cb_int0; ;} break; case 1418: #line 6870 "parser.y" { yyval = cb_int1; ;} break; case 1419: #line 6874 "parser.y" { yyval = cb_int0; ;} break; case 1420: #line 6875 "parser.y" { yyval = cb_int1; ;} break; case 1421: #line 6879 "parser.y" { yyval = cb_int0; ;} break; case 1422: #line 6880 "parser.y" { yyval = cb_int1; ;} break; case 1423: #line 6884 "parser.y" { yyval = cb_int0; ;} break; case 1424: #line 6885 "parser.y" { yyval = cb_int1; ;} break; } /* Line 991 of yacc.c. */ #line 12154 "parser.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* 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. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab2; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: /* Suppress GCC warning that yyerrlab1 is unused when no action invokes YYERROR. */ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ && !defined __cplusplus __attribute__ ((__unused__)) #endif goto yyerrlab2; /*---------------------------------------------------------------. | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ yyerrlab2: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 6941 "parser.y" open-cobol-1.1/cobc/parser.h0000644000000000000000000004631111142344366011423 /* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOKEN_EOF = 0, ACCEPT = 258, ACCESS = 259, ADD = 260, ADDRESS = 261, ADVANCING = 262, AFTER = 263, ALL = 264, ALLOCATE = 265, ALPHABET = 266, ALPHABETIC = 267, ALPHABETIC_LOWER = 268, ALPHABETIC_UPPER = 269, ALPHANUMERIC = 270, ALPHANUMERIC_EDITED = 271, ALSO = 272, ALTER = 273, ALTERNATE = 274, AND = 275, ANY = 276, ARE = 277, AREA = 278, ARGUMENT_NUMBER = 279, ARGUMENT_VALUE = 280, AS = 281, ASCENDING = 282, ASSIGN = 283, AT = 284, AUTO = 285, AUTOMATIC = 286, BACKGROUND_COLOR = 287, BASED = 288, BEFORE = 289, BELL = 290, BINARY = 291, BINARY_C_LONG = 292, BINARY_CHAR = 293, BINARY_DOUBLE = 294, BINARY_LONG = 295, BINARY_SHORT = 296, BLANK = 297, BLANK_LINE = 298, BLANK_SCREEN = 299, BLINK = 300, BLOCK = 301, BOTTOM = 302, BY = 303, BYTE_LENGTH = 304, CALL = 305, CANCEL = 306, CH = 307, CHAINING = 308, CHARACTER = 309, CHARACTERS = 310, CLASS = 311, CLOSE = 312, CODE = 313, CODE_SET = 314, COLLATING = 315, COL = 316, COLS = 317, COLUMN = 318, COLUMNS = 319, COMMA = 320, COMMAND_LINE = 321, COMMA_DELIM = 322, COMMIT = 323, COMMON = 324, COMP = 325, COMPUTE = 326, COMP_1 = 327, COMP_2 = 328, COMP_3 = 329, COMP_4 = 330, COMP_5 = 331, COMP_X = 332, CONCATENATE_FUNC = 333, CONFIGURATION = 334, CONSTANT = 335, CONTAINS = 336, CONTENT = 337, CONTINUE = 338, CONTROL = 339, CONTROLS = 340, CONTROL_FOOTING = 341, CONTROL_HEADING = 342, CONVERTING = 343, CORRESPONDING = 344, COUNT = 345, CRT = 346, CURRENCY = 347, CURRENT_DATE_FUNC = 348, CURSOR = 349, CYCLE = 350, DATA = 351, DATE = 352, DAY = 353, DAY_OF_WEEK = 354, DE = 355, DEBUGGING = 356, DECIMAL_POINT = 357, DECLARATIVES = 358, DEFAULT = 359, DELETE = 360, DELIMITED = 361, DELIMITER = 362, DEPENDING = 363, DESCENDING = 364, DETAIL = 365, DISK = 366, DISPLAY = 367, DIVIDE = 368, DIVISION = 369, DOWN = 370, DUPLICATES = 371, DYNAMIC = 372, EBCDIC = 373, ELSE = 374, END = 375, END_ACCEPT = 376, END_ADD = 377, END_CALL = 378, END_COMPUTE = 379, END_DELETE = 380, END_DISPLAY = 381, END_DIVIDE = 382, END_EVALUATE = 383, END_FUNCTION = 384, END_IF = 385, END_MULTIPLY = 386, END_PERFORM = 387, END_PROGRAM = 388, END_READ = 389, END_RETURN = 390, END_REWRITE = 391, END_SEARCH = 392, END_START = 393, END_STRING = 394, END_SUBTRACT = 395, END_UNSTRING = 396, END_WRITE = 397, ENTRY = 398, ENVIRONMENT = 399, ENVIRONMENT_NAME = 400, ENVIRONMENT_VALUE = 401, EOL = 402, EOP = 403, EOS = 404, EQUAL = 405, EQUALS = 406, ERASE = 407, ERROR = 408, ESCAPE = 409, EVALUATE = 410, EVENT_STATUS = 411, EXCEPTION = 412, EXCLUSIVE = 413, EXIT = 414, EXTEND = 415, EXTERNAL = 416, FD = 417, FILE_CONTROL = 418, FILE_ID = 419, FILLER = 420, FINAL = 421, FIRST = 422, FOOTING = 423, FOR = 424, FOREGROUND_COLOR = 425, FOREVER = 426, FREE = 427, FROM = 428, FULL = 429, FUNCTION = 430, FUNCTION_ID = 431, FUNCTION_NAME = 432, GE = 433, GENERATE = 434, GIVING = 435, GLOBAL = 436, GO = 437, GOBACK = 438, GREATER = 439, GROUP = 440, HEADING = 441, HIGHLIGHT = 442, HIGH_VALUE = 443, IDENTIFICATION = 444, IF = 445, IGNORE = 446, IGNORING = 447, IN = 448, INDEX = 449, INDEXED = 450, INDICATE = 451, INITIALIZE = 452, INITIALIZED = 453, INITIATE = 454, INPUT = 455, INPUT_OUTPUT = 456, INSPECT = 457, INTO = 458, INTRINSIC = 459, INVALID = 460, INVALID_KEY = 461, IS = 462, I_O = 463, I_O_CONTROL = 464, JUSTIFIED = 465, KEY = 466, LABEL = 467, LAST = 468, LAST_DETAIL = 469, LE = 470, LEADING = 471, LEFT = 472, LENGTH = 473, LESS = 474, LIMIT = 475, LIMITS = 476, LINAGE = 477, LINAGE_COUNTER = 478, LINE = 479, LINES = 480, LINKAGE = 481, LITERAL = 482, LOCALE = 483, LOCALE_DT_FUNC = 484, LOCAL_STORAGE = 485, LOCK = 486, LOWER_CASE_FUNC = 487, LOWLIGHT = 488, LOW_VALUE = 489, MANUAL = 490, MEMORY = 491, MERGE = 492, MINUS = 493, MNEMONIC_NAME = 494, MODE = 495, MOVE = 496, MULTIPLE = 497, MULTIPLY = 498, NATIONAL = 499, NATIONAL_EDITED = 500, NATIVE = 501, NE = 502, NEGATIVE = 503, NEXT = 504, NEXT_SENTENCE = 505, NO = 506, NOT = 507, NOT_END = 508, NOT_EOP = 509, NOT_EXCEPTION = 510, NOT_INVALID_KEY = 511, NOT_OVERFLOW = 512, NOT_SIZE_ERROR = 513, NO_ADVANCING = 514, NUMBER = 515, NUMBERS = 516, NUMERIC = 517, NUMERIC_EDITED = 518, NUMVALC_FUNC = 519, OBJECT_COMPUTER = 520, OCCURS = 521, OF = 522, OFF = 523, OMITTED = 524, ON = 525, ONLY = 526, OPEN = 527, OPTIONAL = 528, OR = 529, ORDER = 530, ORGANIZATION = 531, OTHER = 532, OUTPUT = 533, OVERFLOW = 534, OVERLINE = 535, PACKED_DECIMAL = 536, PADDING = 537, PAGE = 538, PAGE_FOOTING = 539, PAGE_HEADING = 540, PARAGRAPH = 541, PERFORM = 542, PICTURE = 543, PLUS = 544, POINTER = 545, POSITION = 546, POSITIVE = 547, PRESENT = 548, PREVIOUS = 549, PRINTER = 550, PRINTING = 551, PROCEDURE = 552, PROCEDURES = 553, PROCEED = 554, PROGRAM = 555, PROGRAM_ID = 556, PROGRAM_NAME = 557, PROGRAM_POINTER = 558, PROMPT = 559, QUOTE = 560, RANDOM = 561, RD = 562, READ = 563, RECORD = 564, RECORDING = 565, RECORDS = 566, RECURSIVE = 567, REDEFINES = 568, REEL = 569, REFERENCE = 570, RELATIVE = 571, RELEASE = 572, REMAINDER = 573, REMOVAL = 574, RENAMES = 575, REPLACING = 576, REPORT = 577, REPORTING = 578, REPORTS = 579, REPORT_FOOTING = 580, REPORT_HEADING = 581, REPOSITORY = 582, REQUIRED = 583, RESERVE = 584, RETURN = 585, RETURNING = 586, REVERSE_FUNC = 587, REVERSE_VIDEO = 588, REWIND = 589, REWRITE = 590, RIGHT = 591, ROLLBACK = 592, ROUNDED = 593, RUN = 594, SAME = 595, SCREEN = 596, SCREEN_CONTROL = 597, SCROLL = 598, SD = 599, SEARCH = 600, SECTION = 601, SECURE = 602, SEGMENT_LIMIT = 603, SELECT = 604, SEMI_COLON = 605, SENTENCE = 606, SEPARATE = 607, SEQUENCE = 608, SEQUENTIAL = 609, SET = 610, SHARING = 611, SIGN = 612, SIGNED = 613, SIGNED_INT = 614, SIGNED_LONG = 615, SIGNED_SHORT = 616, SIZE = 617, SIZE_ERROR = 618, SORT = 619, SORT_MERGE = 620, SOURCE = 621, SOURCE_COMPUTER = 622, SPACE = 623, SPECIAL_NAMES = 624, STANDARD = 625, STANDARD_1 = 626, STANDARD_2 = 627, START = 628, STATUS = 629, STOP = 630, STRING = 631, SUBSTITUTE_FUNC = 632, SUBSTITUTE_CASE_FUNC = 633, SUBTRACT = 634, SUM = 635, SUPPRESS = 636, SYMBOLIC = 637, SYNCHRONIZED = 638, TALLYING = 639, TAPE = 640, TERMINATE = 641, TEST = 642, THAN = 643, THEN = 644, THRU = 645, TIME = 646, TIMES = 647, TO = 648, TOK_FALSE = 649, TOK_FILE = 650, TOK_INITIAL = 651, TOK_NULL = 652, TOK_TRUE = 653, TOP = 654, TRAILING = 655, TRANSFORM = 656, TRIM_FUNCTION = 657, TYPE = 658, UNDERLINE = 659, UNIT = 660, UNLOCK = 661, UNSIGNED = 662, UNSIGNED_INT = 663, UNSIGNED_LONG = 664, UNSIGNED_SHORT = 665, UNSTRING = 666, UNTIL = 667, UP = 668, UPDATE = 669, UPON = 670, UPON_ARGUMENT_NUMBER = 671, UPON_COMMAND_LINE = 672, UPON_ENVIRONMENT_NAME = 673, UPON_ENVIRONMENT_VALUE = 674, UPPER_CASE_FUNC = 675, USAGE = 676, USE = 677, USING = 678, VALUE = 679, VARYING = 680, WAIT = 681, WHEN = 682, WHEN_COMPILED_FUNC = 683, WITH = 684, WORD = 685, WORDS = 686, WORKING_STORAGE = 687, WRITE = 688, YYYYDDD = 689, YYYYMMDD = 690, ZERO = 691, UNARY_SIGN = 692 }; #endif #define TOKEN_EOF 0 #define ACCEPT 258 #define ACCESS 259 #define ADD 260 #define ADDRESS 261 #define ADVANCING 262 #define AFTER 263 #define ALL 264 #define ALLOCATE 265 #define ALPHABET 266 #define ALPHABETIC 267 #define ALPHABETIC_LOWER 268 #define ALPHABETIC_UPPER 269 #define ALPHANUMERIC 270 #define ALPHANUMERIC_EDITED 271 #define ALSO 272 #define ALTER 273 #define ALTERNATE 274 #define AND 275 #define ANY 276 #define ARE 277 #define AREA 278 #define ARGUMENT_NUMBER 279 #define ARGUMENT_VALUE 280 #define AS 281 #define ASCENDING 282 #define ASSIGN 283 #define AT 284 #define AUTO 285 #define AUTOMATIC 286 #define BACKGROUND_COLOR 287 #define BASED 288 #define BEFORE 289 #define BELL 290 #define BINARY 291 #define BINARY_C_LONG 292 #define BINARY_CHAR 293 #define BINARY_DOUBLE 294 #define BINARY_LONG 295 #define BINARY_SHORT 296 #define BLANK 297 #define BLANK_LINE 298 #define BLANK_SCREEN 299 #define BLINK 300 #define BLOCK 301 #define BOTTOM 302 #define BY 303 #define BYTE_LENGTH 304 #define CALL 305 #define CANCEL 306 #define CH 307 #define CHAINING 308 #define CHARACTER 309 #define CHARACTERS 310 #define CLASS 311 #define CLOSE 312 #define CODE 313 #define CODE_SET 314 #define COLLATING 315 #define COL 316 #define COLS 317 #define COLUMN 318 #define COLUMNS 319 #define COMMA 320 #define COMMAND_LINE 321 #define COMMA_DELIM 322 #define COMMIT 323 #define COMMON 324 #define COMP 325 #define COMPUTE 326 #define COMP_1 327 #define COMP_2 328 #define COMP_3 329 #define COMP_4 330 #define COMP_5 331 #define COMP_X 332 #define CONCATENATE_FUNC 333 #define CONFIGURATION 334 #define CONSTANT 335 #define CONTAINS 336 #define CONTENT 337 #define CONTINUE 338 #define CONTROL 339 #define CONTROLS 340 #define CONTROL_FOOTING 341 #define CONTROL_HEADING 342 #define CONVERTING 343 #define CORRESPONDING 344 #define COUNT 345 #define CRT 346 #define CURRENCY 347 #define CURRENT_DATE_FUNC 348 #define CURSOR 349 #define CYCLE 350 #define DATA 351 #define DATE 352 #define DAY 353 #define DAY_OF_WEEK 354 #define DE 355 #define DEBUGGING 356 #define DECIMAL_POINT 357 #define DECLARATIVES 358 #define DEFAULT 359 #define DELETE 360 #define DELIMITED 361 #define DELIMITER 362 #define DEPENDING 363 #define DESCENDING 364 #define DETAIL 365 #define DISK 366 #define DISPLAY 367 #define DIVIDE 368 #define DIVISION 369 #define DOWN 370 #define DUPLICATES 371 #define DYNAMIC 372 #define EBCDIC 373 #define ELSE 374 #define END 375 #define END_ACCEPT 376 #define END_ADD 377 #define END_CALL 378 #define END_COMPUTE 379 #define END_DELETE 380 #define END_DISPLAY 381 #define END_DIVIDE 382 #define END_EVALUATE 383 #define END_FUNCTION 384 #define END_IF 385 #define END_MULTIPLY 386 #define END_PERFORM 387 #define END_PROGRAM 388 #define END_READ 389 #define END_RETURN 390 #define END_REWRITE 391 #define END_SEARCH 392 #define END_START 393 #define END_STRING 394 #define END_SUBTRACT 395 #define END_UNSTRING 396 #define END_WRITE 397 #define ENTRY 398 #define ENVIRONMENT 399 #define ENVIRONMENT_NAME 400 #define ENVIRONMENT_VALUE 401 #define EOL 402 #define EOP 403 #define EOS 404 #define EQUAL 405 #define EQUALS 406 #define ERASE 407 #define ERROR 408 #define ESCAPE 409 #define EVALUATE 410 #define EVENT_STATUS 411 #define EXCEPTION 412 #define EXCLUSIVE 413 #define EXIT 414 #define EXTEND 415 #define EXTERNAL 416 #define FD 417 #define FILE_CONTROL 418 #define FILE_ID 419 #define FILLER 420 #define FINAL 421 #define FIRST 422 #define FOOTING 423 #define FOR 424 #define FOREGROUND_COLOR 425 #define FOREVER 426 #define FREE 427 #define FROM 428 #define FULL 429 #define FUNCTION 430 #define FUNCTION_ID 431 #define FUNCTION_NAME 432 #define GE 433 #define GENERATE 434 #define GIVING 435 #define GLOBAL 436 #define GO 437 #define GOBACK 438 #define GREATER 439 #define GROUP 440 #define HEADING 441 #define HIGHLIGHT 442 #define HIGH_VALUE 443 #define IDENTIFICATION 444 #define IF 445 #define IGNORE 446 #define IGNORING 447 #define IN 448 #define INDEX 449 #define INDEXED 450 #define INDICATE 451 #define INITIALIZE 452 #define INITIALIZED 453 #define INITIATE 454 #define INPUT 455 #define INPUT_OUTPUT 456 #define INSPECT 457 #define INTO 458 #define INTRINSIC 459 #define INVALID 460 #define INVALID_KEY 461 #define IS 462 #define I_O 463 #define I_O_CONTROL 464 #define JUSTIFIED 465 #define KEY 466 #define LABEL 467 #define LAST 468 #define LAST_DETAIL 469 #define LE 470 #define LEADING 471 #define LEFT 472 #define LENGTH 473 #define LESS 474 #define LIMIT 475 #define LIMITS 476 #define LINAGE 477 #define LINAGE_COUNTER 478 #define LINE 479 #define LINES 480 #define LINKAGE 481 #define LITERAL 482 #define LOCALE 483 #define LOCALE_DT_FUNC 484 #define LOCAL_STORAGE 485 #define LOCK 486 #define LOWER_CASE_FUNC 487 #define LOWLIGHT 488 #define LOW_VALUE 489 #define MANUAL 490 #define MEMORY 491 #define MERGE 492 #define MINUS 493 #define MNEMONIC_NAME 494 #define MODE 495 #define MOVE 496 #define MULTIPLE 497 #define MULTIPLY 498 #define NATIONAL 499 #define NATIONAL_EDITED 500 #define NATIVE 501 #define NE 502 #define NEGATIVE 503 #define NEXT 504 #define NEXT_SENTENCE 505 #define NO 506 #define NOT 507 #define NOT_END 508 #define NOT_EOP 509 #define NOT_EXCEPTION 510 #define NOT_INVALID_KEY 511 #define NOT_OVERFLOW 512 #define NOT_SIZE_ERROR 513 #define NO_ADVANCING 514 #define NUMBER 515 #define NUMBERS 516 #define NUMERIC 517 #define NUMERIC_EDITED 518 #define NUMVALC_FUNC 519 #define OBJECT_COMPUTER 520 #define OCCURS 521 #define OF 522 #define OFF 523 #define OMITTED 524 #define ON 525 #define ONLY 526 #define OPEN 527 #define OPTIONAL 528 #define OR 529 #define ORDER 530 #define ORGANIZATION 531 #define OTHER 532 #define OUTPUT 533 #define OVERFLOW 534 #define OVERLINE 535 #define PACKED_DECIMAL 536 #define PADDING 537 #define PAGE 538 #define PAGE_FOOTING 539 #define PAGE_HEADING 540 #define PARAGRAPH 541 #define PERFORM 542 #define PICTURE 543 #define PLUS 544 #define POINTER 545 #define POSITION 546 #define POSITIVE 547 #define PRESENT 548 #define PREVIOUS 549 #define PRINTER 550 #define PRINTING 551 #define PROCEDURE 552 #define PROCEDURES 553 #define PROCEED 554 #define PROGRAM 555 #define PROGRAM_ID 556 #define PROGRAM_NAME 557 #define PROGRAM_POINTER 558 #define PROMPT 559 #define QUOTE 560 #define RANDOM 561 #define RD 562 #define READ 563 #define RECORD 564 #define RECORDING 565 #define RECORDS 566 #define RECURSIVE 567 #define REDEFINES 568 #define REEL 569 #define REFERENCE 570 #define RELATIVE 571 #define RELEASE 572 #define REMAINDER 573 #define REMOVAL 574 #define RENAMES 575 #define REPLACING 576 #define REPORT 577 #define REPORTING 578 #define REPORTS 579 #define REPORT_FOOTING 580 #define REPORT_HEADING 581 #define REPOSITORY 582 #define REQUIRED 583 #define RESERVE 584 #define RETURN 585 #define RETURNING 586 #define REVERSE_FUNC 587 #define REVERSE_VIDEO 588 #define REWIND 589 #define REWRITE 590 #define RIGHT 591 #define ROLLBACK 592 #define ROUNDED 593 #define RUN 594 #define SAME 595 #define SCREEN 596 #define SCREEN_CONTROL 597 #define SCROLL 598 #define SD 599 #define SEARCH 600 #define SECTION 601 #define SECURE 602 #define SEGMENT_LIMIT 603 #define SELECT 604 #define SEMI_COLON 605 #define SENTENCE 606 #define SEPARATE 607 #define SEQUENCE 608 #define SEQUENTIAL 609 #define SET 610 #define SHARING 611 #define SIGN 612 #define SIGNED 613 #define SIGNED_INT 614 #define SIGNED_LONG 615 #define SIGNED_SHORT 616 #define SIZE 617 #define SIZE_ERROR 618 #define SORT 619 #define SORT_MERGE 620 #define SOURCE 621 #define SOURCE_COMPUTER 622 #define SPACE 623 #define SPECIAL_NAMES 624 #define STANDARD 625 #define STANDARD_1 626 #define STANDARD_2 627 #define START 628 #define STATUS 629 #define STOP 630 #define STRING 631 #define SUBSTITUTE_FUNC 632 #define SUBSTITUTE_CASE_FUNC 633 #define SUBTRACT 634 #define SUM 635 #define SUPPRESS 636 #define SYMBOLIC 637 #define SYNCHRONIZED 638 #define TALLYING 639 #define TAPE 640 #define TERMINATE 641 #define TEST 642 #define THAN 643 #define THEN 644 #define THRU 645 #define TIME 646 #define TIMES 647 #define TO 648 #define TOK_FALSE 649 #define TOK_FILE 650 #define TOK_INITIAL 651 #define TOK_NULL 652 #define TOK_TRUE 653 #define TOP 654 #define TRAILING 655 #define TRANSFORM 656 #define TRIM_FUNCTION 657 #define TYPE 658 #define UNDERLINE 659 #define UNIT 660 #define UNLOCK 661 #define UNSIGNED 662 #define UNSIGNED_INT 663 #define UNSIGNED_LONG 664 #define UNSIGNED_SHORT 665 #define UNSTRING 666 #define UNTIL 667 #define UP 668 #define UPDATE 669 #define UPON 670 #define UPON_ARGUMENT_NUMBER 671 #define UPON_COMMAND_LINE 672 #define UPON_ENVIRONMENT_NAME 673 #define UPON_ENVIRONMENT_VALUE 674 #define UPPER_CASE_FUNC 675 #define USAGE 676 #define USE 677 #define USING 678 #define VALUE 679 #define VARYING 680 #define WAIT 681 #define WHEN 682 #define WHEN_COMPILED_FUNC 683 #define WITH 684 #define WORD 685 #define WORDS 686 #define WORKING_STORAGE 687 #define WRITE 688 #define YYYYDDD 689 #define YYYYMMDD 690 #define ZERO 691 #define UNARY_SIGN 692 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; open-cobol-1.1/cobc/parser.y0000644000000000000000000040264511142344262011445 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 - Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ %expect 118 %defines %verbose %{ #include "config.h" #include #include #include "cobc.h" #include "tree.h" #define yyerror cb_error #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define PENDING(x) cb_warning (_("'%s' not implemented"), x) #define emit_statement(x) \ current_program->exec_list = cb_cons (x, current_program->exec_list) #define push_expr(type, node) \ current_expr = cb_build_list (cb_int (type), node, current_expr) #define TERM_NONE 0 #define TERM_ACCEPT 1 #define TERM_ADD 2 #define TERM_CALL 3 #define TERM_COMPUTE 4 #define TERM_DELETE 5 #define TERM_DISPLAY 6 #define TERM_DIVIDE 7 #define TERM_EVALUATE 8 #define TERM_IF 9 #define TERM_MULTIPLY 10 #define TERM_PERFORM 11 #define TERM_READ 12 #define TERM_RECEIVE 13 #define TERM_RETURN 14 #define TERM_REWRITE 15 #define TERM_SEARCH 16 #define TERM_START 17 #define TERM_STRING 18 #define TERM_SUBTRACT 19 #define TERM_UNSTRING 20 #define TERM_WRITE 21 #define TERM_MAX 22 /* Global variables */ struct cb_program *current_program = NULL; struct cb_statement *current_statement = NULL; struct cb_label *current_section = NULL; struct cb_label *current_paragraph = NULL; size_t functions_are_all = 0; int non_const_word = 0; /* Local variables */ static struct cb_statement *main_statement; static cb_tree current_expr; static struct cb_field *current_field; static struct cb_field *description_field; static struct cb_file *current_file; static enum cb_storage current_storage; static size_t check_unreached = 0; static int call_mode; static int size_mode; static cb_tree perform_stack = NULL; static cb_tree qualifier = NULL; static cb_tree fgc; static cb_tree bgc; static cb_tree scroll; static cb_tree save_tree_1; static cb_tree save_tree_2; static cb_tree dummy_tree; static size_t in_declaratives = 0; static size_t current_linage = 0; static size_t prog_end = 0; static size_t use_global_ind = 0; static size_t samearea = 1; static size_t organized_seen = 0; static size_t inspect_keyword = 0; static int next_label_id = 0; static int eval_level = 0; static int eval_inc = 0; static int eval_inc2 = 0; static int depth = 0; static int dispattrs = 0; static struct cb_file *linage_file; static cb_tree next_label_list = NULL; static char *stack_progid[32]; static int term_array[TERM_MAX]; static int eval_check[64][64]; /* Static functions */ static void BEGIN_STATEMENT (const char *name, const size_t term) { if (cb_warn_unreachable && check_unreached) { cb_warning (_("Unreachable statement")); } current_statement = cb_build_statement ((char *)name); CB_TREE (current_statement)->source_file = (unsigned char *)cb_source_file; CB_TREE (current_statement)->source_line = cb_source_line; emit_statement (CB_TREE (current_statement)); if (term) { term_array[term]++; } main_statement = current_statement; } static void BEGIN_IMPLICIT_STATEMENT (void) { current_statement = cb_build_statement (NULL); main_statement->body = cb_list_add (main_statement->body, CB_TREE (current_statement)); } static void emit_entry (const char *name, const int encode, cb_tree using_list) { cb_tree l; cb_tree label; cb_tree x; struct cb_field *f; int parmnum; char buff[256]; sprintf (buff, "E$%s", name); label = cb_build_label (cb_build_reference (buff), NULL); if (encode) { CB_LABEL (label)->name = (unsigned char *)(cb_encode_program_id (name)); CB_LABEL (label)->orig_name = (unsigned char *)name; } else { CB_LABEL (label)->name = (unsigned char *)name; CB_LABEL (label)->orig_name = (unsigned char *)current_program->orig_source_name; } CB_LABEL (label)->need_begin = 1; CB_LABEL (label)->is_entry = 1; emit_statement (label); parmnum = 1; for (l = using_list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x != cb_error_node && cb_ref (x) != cb_error_node) { f = CB_FIELD (cb_ref (x)); if (f->level != 01 && f->level != 77) { cb_error_x (x, _("'%s' not level 01 or 77"), cb_name (x)); } if (!current_program->flag_chained) { if (f->storage != CB_STORAGE_LINKAGE) { cb_error_x (x, _("'%s' is not in LINKAGE SECTION"), cb_name (x)); } if (f->flag_item_based || f->flag_external) { cb_error_x (x, _("'%s' can not be BASED/EXTERNAL"), cb_name (x)); } f->flag_is_pdiv_parm = 1; } else { if (f->storage != CB_STORAGE_WORKING) { cb_error_x (x, _("'%s' is not in WORKING-STORAGE SECTION"), cb_name (x)); } f->flag_chained = 1; f->param_num = parmnum; parmnum++; } if (f->redefines) { cb_error_x (x, _("'%s' REDEFINES field not allowed here"), cb_name (x)); } } } /* Check dangling LINKAGE items */ if (cb_warn_linkage) { for (f = current_program->linkage_storage; f; f = f->sister) { for (l = using_list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (x != cb_error_node && cb_ref (x) != cb_error_node) { if (f == CB_FIELD (cb_ref (x))) { break; } } } if (!l && !f->redefines) { cb_warning (_("LINKAGE item '%s' is not a PROCEDURE USING parameter"), f->name); } } } for (l = current_program->entry_list; l; l = CB_CHAIN (l)) { if (strcmp ((const char *)name, (const char *)(CB_LABEL(CB_PURPOSE(l))->name)) == 0) { cb_error_x (CB_TREE (current_statement), _("ENTRY '%s' duplicated"), name); } } current_program->entry_list = cb_list_append (current_program->entry_list, cb_build_pair (label, using_list)); } static void terminator_warning (const size_t termid) { check_unreached = 0; if (cb_warn_terminator && term_array[termid]) { cb_warning_x (CB_TREE (current_statement), _("%s statement not terminated by END-%s"), current_statement->name, current_statement->name); } if (term_array[termid]) { term_array[termid]--; } } static void terminator_error (void) { check_unreached = 0; cb_error_x (CB_TREE (current_statement), _("%s statement not terminated by END-%s"), current_statement->name, current_statement->name); } static void terminator_clear (const size_t termid) { check_unreached = 0; if (term_array[termid]) { term_array[termid]--; } } static int literal_value (cb_tree x) { if (x == cb_space) { return ' '; } else if (x == cb_zero) { return '0'; } else if (x == cb_quote) { return '"'; } else if (x == cb_null) { return 0; } else if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { return cb_get_int (x); } else { return CB_LITERAL (x)->data[0]; } } static void setup_use_file (struct cb_file *fileptr) { struct cb_file *newptr; if (fileptr->organization == COB_ORG_SORT) { cb_error (_("USE statement invalid for SORT file")); } if (fileptr->global) { newptr = cobc_malloc (sizeof(struct cb_file)); *newptr = *fileptr; newptr->handler = current_section; newptr->handler_prog = current_program; if (!use_global_ind) { current_program->local_file_list = cb_list_add (current_program->local_file_list, CB_TREE (newptr)); } else { current_program->global_file_list = cb_list_add (current_program->global_file_list, CB_TREE (newptr)); } } else { fileptr->handler = current_section; } } %} %token TOKEN_EOF 0 "end of file" %token ACCEPT %token ACCESS %token ADD %token ADDRESS %token ADVANCING %token AFTER %token ALL %token ALLOCATE %token ALPHABET %token ALPHABETIC %token ALPHABETIC_LOWER "ALPHABETIC-LOWER" %token ALPHABETIC_UPPER "ALPHABETIC-UPPER" %token ALPHANUMERIC %token ALPHANUMERIC_EDITED "ALPHANUMERIC-EDITED" %token ALSO %token ALTER %token ALTERNATE %token AND %token ANY %token ARE %token AREA %token ARGUMENT_NUMBER "ARGUMENT-NUMBER" %token ARGUMENT_VALUE "ARGUMENT-VALUE" %token AS %token ASCENDING %token ASSIGN %token AT %token AUTO %token AUTOMATIC %token BACKGROUND_COLOR "BACKGROUND-COLOR" %token BASED %token BEFORE %token BELL %token BINARY %token BINARY_C_LONG "BINARY-C-LONG" %token BINARY_CHAR "BINARY-CHAR" %token BINARY_DOUBLE "BINARY-DOUBLE" %token BINARY_LONG "BINARY-LONG" %token BINARY_SHORT "BINARY-SHORT" %token BLANK %token BLANK_LINE "BLANK-LINE" %token BLANK_SCREEN "BLANK-SCREEN" %token BLINK %token BLOCK %token BOTTOM %token BY %token BYTE_LENGTH "BYTE-LENGTH" %token CALL %token CANCEL %token CH %token CHAINING %token CHARACTER %token CHARACTERS %token CLASS %token CLOSE %token CODE %token CODE_SET "CODE-SET" %token COLLATING %token COL %token COLS %token COLUMN %token COLUMNS %token COMMA %token COMMAND_LINE "COMMAND-LINE" %token COMMA_DELIM "comma delimiter" %token COMMIT %token COMMON %token COMP %token COMPUTE %token COMP_1 "COMP-1" %token COMP_2 "COMP-2" %token COMP_3 "COMP-3" %token COMP_4 "COMP-4" %token COMP_5 "COMP-5" %token COMP_X "COMP-X" %token CONCATENATE_FUNC "FUNCTION CONCATENATE" %token CONFIGURATION %token CONSTANT %token CONTAINS %token CONTENT %token CONTINUE %token CONTROL %token CONTROLS %token CONTROL_FOOTING "CONTROL FOOTING" %token CONTROL_HEADING "CONTROL HEADING" %token CONVERTING %token CORRESPONDING %token COUNT %token CRT %token CURRENCY %token CURRENT_DATE_FUNC "FUNCTION CURRENT-DATE" %token CURSOR %token CYCLE %token DATA %token DATE %token DAY %token DAY_OF_WEEK "DAY-OF-WEEK" %token DE %token DEBUGGING %token DECIMAL_POINT "DECIMAL-POINT" %token DECLARATIVES %token DEFAULT %token DELETE %token DELIMITED %token DELIMITER %token DEPENDING %token DESCENDING %token DETAIL %token DISK %token DISPLAY %token DIVIDE %token DIVISION %token DOWN %token DUPLICATES %token DYNAMIC %token EBCDIC %token ELSE %token END %token END_ACCEPT "END-ACCEPT" %token END_ADD "END-ADD" %token END_CALL "END-CALL" %token END_COMPUTE "END-COMPUTE" %token END_DELETE "END-DELETE" %token END_DISPLAY "END-DISPLAY" %token END_DIVIDE "END-DIVIDE" %token END_EVALUATE "END-EVALUATE" %token END_FUNCTION "END FUNCTION" %token END_IF "END-IF" %token END_MULTIPLY "END-MULTIPLY" %token END_PERFORM "END-PERFORM" %token END_PROGRAM "END PROGRAM" %token END_READ "END-READ" %token END_RETURN "END-RETURN" %token END_REWRITE "END-REWRITE" %token END_SEARCH "END-SEARCH" %token END_START "END-START" %token END_STRING "END-STRING" %token END_SUBTRACT "END-SUBTRACT" %token END_UNSTRING "END-UNSTRING" %token END_WRITE "END-WRITE" %token ENTRY %token ENVIRONMENT %token ENVIRONMENT_NAME "ENVIRONMENT-NAME" %token ENVIRONMENT_VALUE "ENVIRONMENT-VALUE" %token EOL %token EOP %token EOS %token EQUAL %token EQUALS %token ERASE %token ERROR %token ESCAPE %token EVALUATE %token EVENT_STATUS "EVENT-STATUS" %token EXCEPTION %token EXCLUSIVE %token EXIT %token EXTEND %token EXTERNAL %token FD %token FILE_CONTROL "FILE-CONTROL" %token FILE_ID "FILE-ID" %token FILLER %token FINAL %token FIRST %token FOOTING %token FOR %token FOREGROUND_COLOR "FOREGROUND-COLOR" %token FOREVER %token FREE %token FROM %token FULL %token FUNCTION %token FUNCTION_ID "FUNCTION-ID" %token FUNCTION_NAME "FUNCTION" %token GE %token GENERATE %token GIVING %token GLOBAL %token GO %token GOBACK %token GREATER %token GROUP %token HEADING %token HIGHLIGHT %token HIGH_VALUE "HIGH-VALUE" %token IDENTIFICATION %token IF %token IGNORE %token IGNORING %token IN %token INDEX %token INDEXED %token INDICATE %token INITIALIZE %token INITIALIZED %token INITIATE %token INPUT %token INPUT_OUTPUT "INPUT-OUTPUT" %token INSPECT %token INTO %token INTRINSIC %token INVALID %token INVALID_KEY "INVALID KEY" %token IS %token I_O "I-O" %token I_O_CONTROL "I-O-CONTROL" %token JUSTIFIED %token KEY %token LABEL %token LAST %token LAST_DETAIL "LAST DETAIL" %token LE %token LEADING %token LEFT %token LENGTH %token LESS %token LIMIT %token LIMITS %token LINAGE %token LINAGE_COUNTER "LINAGE-COUNTER" %token LINE %token LINES %token LINKAGE %token LITERAL "Literal" %token LOCALE %token LOCALE_DT_FUNC "FUNCTION LOCALE" %token LOCAL_STORAGE "LOCAL-STORAGE" %token LOCK %token LOWER_CASE_FUNC "FUNCTION LOWER-CASE" %token LOWLIGHT %token LOW_VALUE "LOW-VALUE" %token MANUAL %token MEMORY %token MERGE %token MINUS %token MNEMONIC_NAME "MNEMONIC NAME" %token MODE %token MOVE %token MULTIPLE %token MULTIPLY %token NATIONAL %token NATIONAL_EDITED "NATIONAL-EDITED" %token NATIVE %token NE %token NEGATIVE %token NEXT %token NEXT_SENTENCE "NEXT SENTENCE" %token NO %token NOT %token NOT_END "NOT END" %token NOT_EOP "NOT EOP" %token NOT_EXCEPTION "NOT EXCEPTION" %token NOT_INVALID_KEY "NOT INVALID KEY" %token NOT_OVERFLOW "NOT OVERFLOW" %token NOT_SIZE_ERROR "NOT SIZE ERROR" %token NO_ADVANCING "NO ADVANCING" %token NUMBER %token NUMBERS %token NUMERIC %token NUMERIC_EDITED "NUMERIC-EDITED" %token NUMVALC_FUNC "FUNCTION NUMVALC" %token OBJECT_COMPUTER "OBJECT-COMPUTER" %token OCCURS %token OF %token OFF %token OMITTED %token ON %token ONLY %token OPEN %token OPTIONAL %token OR %token ORDER %token ORGANIZATION %token OTHER %token OUTPUT %token OVERFLOW %token OVERLINE %token PACKED_DECIMAL "PACKED-DECIMAL" %token PADDING %token PAGE %token PAGE_FOOTING "PAGE FOOTING" %token PAGE_HEADING "PAGE HEADING" %token PARAGRAPH %token PERFORM %token PICTURE %token PLUS %token POINTER %token POSITION %token POSITIVE %token PRESENT %token PREVIOUS %token PRINTER %token PRINTING %token PROCEDURE %token PROCEDURES %token PROCEED %token PROGRAM %token PROGRAM_ID "PROGRAM-ID" %token PROGRAM_NAME "Program name" %token PROGRAM_POINTER "PROGRAM-POINTER" %token PROMPT %token QUOTE %token RANDOM %token RD %token READ %token RECORD %token RECORDING %token RECORDS %token RECURSIVE %token REDEFINES %token REEL %token REFERENCE %token RELATIVE %token RELEASE %token REMAINDER %token REMOVAL %token RENAMES %token REPLACING %token REPORT %token REPORTING %token REPORTS %token REPORT_FOOTING "REPORT FOOTING" %token REPORT_HEADING "REPORT HEADING" %token REPOSITORY %token REQUIRED %token RESERVE %token RETURN %token RETURNING %token REVERSE_FUNC "FUNCTION REVERSE" %token REVERSE_VIDEO "REVERSE-VIDEO" %token REWIND %token REWRITE %token RIGHT %token ROLLBACK %token ROUNDED %token RUN %token SAME %token SCREEN %token SCREEN_CONTROL "SCREEN-CONTROL" %token SCROLL %token SD %token SEARCH %token SECTION %token SECURE %token SEGMENT_LIMIT "SEGMENT-LIMIT" %token SELECT %token SEMI_COLON "semi-colon" %token SENTENCE %token SEPARATE %token SEQUENCE %token SEQUENTIAL %token SET %token SHARING %token SIGN %token SIGNED %token SIGNED_INT "SIGNED-INT" %token SIGNED_LONG "SIGNED-LONG" %token SIGNED_SHORT "SIGNED-SHORT" %token SIZE %token SIZE_ERROR "SIZE ERROR" %token SORT %token SORT_MERGE "SORT-MERGE" %token SOURCE %token SOURCE_COMPUTER "SOURCE-COMPUTER" %token SPACE %token SPECIAL_NAMES "SPECIAL-NAMES" %token STANDARD %token STANDARD_1 "STANDARD-1" %token STANDARD_2 "STANDARD-2" %token START %token STATUS %token STOP %token STRING %token SUBSTITUTE_FUNC "FUNCTION SUBSTITUTE" %token SUBSTITUTE_CASE_FUNC "FUNCTION SUBSTITUTE-CASE" %token SUBTRACT %token SUM %token SUPPRESS %token SYMBOLIC %token SYNCHRONIZED %token TALLYING %token TAPE %token TERMINATE %token TEST %token THAN %token THEN %token THRU %token TIME %token TIMES %token TO %token TOK_FALSE "FALSE" %token TOK_FILE "FILE" %token TOK_INITIAL "INITIAL" %token TOK_NULL "NULL" %token TOK_TRUE "TRUE" %token TOP %token TRAILING %token TRANSFORM %token TRIM_FUNCTION "FUNCTION TRIM" %token TYPE %token UNDERLINE %token UNIT %token UNLOCK %token UNSIGNED %token UNSIGNED_INT "UNSIGNED-INT" %token UNSIGNED_LONG "UNSIGNED-LONG" %token UNSIGNED_SHORT "UNSIGNED-SHORT" %token UNSTRING %token UNTIL %token UP %token UPDATE %token UPON %token UPON_ARGUMENT_NUMBER "UPON ARGUMENT-NUMBER" %token UPON_COMMAND_LINE "UPON COMMAND-LINE" %token UPON_ENVIRONMENT_NAME "UPON ENVIRONMENT-NAME" %token UPON_ENVIRONMENT_VALUE "UPON ENVIRONMENT-VALUE" %token UPPER_CASE_FUNC "FUNCTION UPPER-CASE" %token USAGE %token USE %token USING %token VALUE %token VARYING %token WAIT %token WHEN %token WHEN_COMPILED_FUNC "FUNCTION WHEN-COMPILED" %token WITH %token WORD "Identifier" %token WORDS %token WORKING_STORAGE "WORKING-STORAGE" %token WRITE %token YYYYDDD %token YYYYMMDD %token ZERO %left '+' '-' %left '*' '/' %left UNARY_SIGN %right '^' %% /***************************************************************************** * COBOL Compilation Unit *****************************************************************************/ start: { perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; eval_inc = 0; eval_inc2 = 0; prog_end = 0; depth = 0; inspect_keyword = 0; check_unreached = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (NULL, 0); cb_build_registers (); current_program->flag_main = cb_flag_main; } /* program_definition */ nested_list { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } if (depth > 1) { cb_error (_("Multiple PROGRAM-ID's without matching END PROGRAM")); } if (errorcount > 0) { YYABORT; } if (!current_program->entry_list) { emit_entry (current_program->program_id, 0, NULL); } } ; nested_list: source_element | nested_list source_element ; source_element: program_definition | function_definition ; program_definition: identification_division environment_division { cb_validate_program_environment (current_program); } data_division { cb_validate_program_data (current_program); } procedure_division nested_prog end_program ; program_mandatory: identification_division environment_division { cb_validate_program_environment (current_program); } data_division { cb_validate_program_data (current_program); } procedure_division nested_prog end_mandatory ; function_definition: function_division environment_division { cb_validate_program_environment (current_program); } data_division { cb_validate_program_data (current_program); } procedure_division end_function ; nested_prog: | program_mandatory | nested_prog program_mandatory ; end_program: | END_PROGRAM program_name '.' { char *s; if (CB_LITERAL_P ($2)) { s = (char *)(CB_LITERAL ($2)->data); } else { s = (char *)(CB_NAME ($2)); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END PROGRAM '%s' is different to PROGRAM-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } } ; end_mandatory: END_PROGRAM program_name '.' { char *s; if (CB_LITERAL_P ($2)) { s = (char *)(CB_LITERAL ($2)->data); } else { s = (char *)(CB_NAME ($2)); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END PROGRAM '%s' is different to PROGRAM-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } } ; end_function: END_FUNCTION program_name '.' { char *s; if (CB_LITERAL_P ($2)) { s = (char *)(CB_LITERAL ($2)->data); } else { s = (char *)(CB_NAME ($2)); } if (depth) { depth--; } if (strcmp (stack_progid[depth], s)) { cb_error (_("END FUNCTION '%s' is different to FUNCTION-ID '%s'"), s, stack_progid[depth]); } if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } } ; /***************************************************************************** * Identification division *****************************************************************************/ identification_division: PROGRAM_ID '.' program_name as_literal { current_section = NULL; current_paragraph = NULL; if (CB_LITERAL_P ($3)) { stack_progid[depth] = (char *)(CB_LITERAL ($3)->data); } else { stack_progid[depth] = (char *)(CB_NAME ($3)); } if (prog_end) { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; inspect_keyword = 0; check_unreached = 0; eval_inc = 0; eval_inc2 = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (current_program, depth); cb_build_registers (); } else { prog_end = 1; } depth++; current_program->program_id = cb_build_program_id ($3, $4); } program_type '.' ; function_division: FUNCTION_ID '.' program_name as_literal '.' { cb_error (_("FUNCTION-ID is not yet implemented")); current_section = NULL; current_paragraph = NULL; if (CB_LITERAL_P ($3)) { stack_progid[depth] = (char *)(CB_LITERAL ($3)->data); } else { stack_progid[depth] = (char *)(CB_NAME ($3)); } if (prog_end) { if (!current_program->flag_validated) { current_program->flag_validated = 1; cb_validate_program_body (current_program); } perform_stack = NULL; current_statement = NULL; next_label_id = 0; current_linage = 0; current_storage = 0; eval_level = 0; inspect_keyword = 0; check_unreached = 0; eval_inc = 0; eval_inc2 = 0; samearea = 1; memset ((char *)eval_check, 0, sizeof(eval_check)); memset ((char *)term_array, 0, sizeof(term_array)); linage_file = NULL; next_label_list = NULL; current_program = cb_build_program (current_program, depth); cb_build_registers (); } else { prog_end = 1; } depth++; current_program->program_id = cb_build_program_id ($3, $4); current_program->prog_type = CB_FUNCTION_TYPE; current_program->flag_recursive = 1; current_program->flag_initial = 1; } ; program_name: PROGRAM_NAME | LITERAL ; as_literal: /* empty */ { $$ = NULL; } | AS LITERAL { $$ = $2; } ; program_type: | _is program_type_clause _program ; program_type_clause: COMMON { if (!current_program->nested_level) { cb_error (_("COMMON may only be used in a nested program")); } current_program->flag_common = 1; } | COMMON _init_or_recurs { if (!current_program->nested_level) { cb_error (_("COMMON may only be used in a nested program")); } current_program->flag_common = 1; } | _init_or_recurs ; _init_or_recurs: TOK_INITIAL { current_program->flag_initial = 1; } | RECURSIVE { current_program->flag_recursive = 1; current_program->flag_initial = 1; } ; /***************************************************************************** * Environment division *****************************************************************************/ environment_division: | ENVIRONMENT DIVISION '.' configuration_section input_output_section ; /******************* * Configuration section *******************/ configuration_section: | CONFIGURATION SECTION '.' configuration_list { if (current_program->nested_level) { cb_error (_("CONFIGURATION SECTION not allowed in nested programs")); } } ; configuration_list: | configuration_list configuration_paragraph ; configuration_paragraph: source_computer_paragraph | object_computer_paragraph | special_names_paragraph | repository_paragraph ; /* * SOURCE-COMPUTER paragraph */ source_computer_paragraph: SOURCE_COMPUTER '.' source_computer_entry ; source_computer_entry: | computer_name '.' | computer_name with_debugging_mode '.' | with_debugging_mode '.' ; with_debugging_mode: _with DEBUGGING MODE { cb_verify (cb_debugging_line, "DEBUGGING MODE"); } ; computer_name: WORD { } ; /* * OBJECT-COMPUTER paragraph */ object_computer_paragraph: OBJECT_COMPUTER '.' object_computer_entry ; object_computer_entry: | computer_name '.' | computer_name object_clauses_list '.' | object_clauses_list '.' ; object_clauses_list: object_clauses | object_clauses_list object_clauses ; object_clauses: object_computer_memory | object_computer_sequence | object_computer_segment ; object_computer_memory: MEMORY SIZE _is integer object_char_or_word { cb_verify (cb_memory_size_clause, "MEMORY SIZE"); } ; object_char_or_word: CHARACTERS | WORDS ; object_computer_sequence: _program coll_sequence _is reference { current_program->collating_sequence = $4; } ; object_computer_segment: SEGMENT_LIMIT _is integer { /* Ignore */ } ; /* * REPOSITORY paragraph */ repository_paragraph: REPOSITORY '.' opt_repository ; opt_repository: | repository_list '.' ; repository_list: repository_name | repository_list repository_name ; repository_name: FUNCTION repository_literal_list INTRINSIC { current_program->function_spec_list = $2; } | FUNCTION ALL INTRINSIC { functions_are_all = 1; } ; repository_literal_list: LITERAL { $$ = cb_list_init ($1); } | repository_literal_list LITERAL { $$ = cb_list_add ($1, $2); } ; /* * SPECIAL-NAMES paragraph */ special_names_paragraph: SPECIAL_NAMES '.' opt_special_names ; opt_special_names: | special_name_list '.' ; special_name_list: special_name | special_name_list special_name ; special_name: mnemonic_name_clause | alphabet_name_clause | symbolic_characters_clause | locale_clause | class_name_clause | currency_sign_clause | decimal_point_clause | cursor_clause | crt_status_clause | screen_control | event_status ; /* Mnemonic name clause */ mnemonic_name_clause: WORD _is CRT { save_tree_1 = lookup_system_name (CB_NAME ($1)); if (save_tree_1 == cb_error_node) { cb_error_x ($1, _("Unknown system-name '%s'"), CB_NAME ($1)); } else if (CB_SYSTEM_NAME(save_tree_1)->token != CB_DEVICE_CONSOLE) { cb_error_x (save_tree_1, _("Invalid CRT clause")); } /* current_program->flag_screen = 1; */ } | WORD _is undefined_word { save_tree_1 = lookup_system_name (CB_NAME ($1)); if (save_tree_1 == cb_error_node) { cb_error_x ($1, _("Unknown system-name '%s'"), CB_NAME ($1)); } else { cb_define ($3, save_tree_1); } save_tree_2 = $3; } special_name_mnemonic_on_off ; special_name_mnemonic_on_off: | special_name_mnemonic_on_off on_or_off _status _is undefined_word { cb_define_switch_name ($5, save_tree_1, $2, save_tree_2); } ; on_or_off: ON { $$ = cb_int1; } | OFF { $$ = cb_int0; } ; /* Alphabet name clause */ alphabet_name_clause: ALPHABET undefined_word { save_tree_1 = $2; } _is alphabet_definition { current_program->alphabet_name_list = cb_list_add (current_program->alphabet_name_list, $5); } ; alphabet_definition: NATIVE { $$ = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_NATIVE); } | STANDARD_1 { $$ = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_STANDARD_1); } | STANDARD_2 { $$ = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_STANDARD_2); } | EBCDIC { $$ = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_EBCDIC); } | alphabet_literal_list { $$ = cb_build_alphabet_name (save_tree_1, CB_ALPHABET_CUSTOM); CB_ALPHABET_NAME ($$)->custom_list = $1; } ; alphabet_literal_list: alphabet_literal { $$ = cb_list_init ($1); } | alphabet_literal_list alphabet_literal { $$ = cb_list_add ($1, $2); } ; alphabet_literal: alphabet_lits { $$ = $1; } | alphabet_lits THRU alphabet_lits { $$ = cb_build_pair ($1, $3); } | alphabet_lits ALSO { $$ = cb_list_init ($1); save_tree_2 = $$; } alphabet_also_sequence { $$ = $3; } ; alphabet_also_sequence: alphabet_also_literal | alphabet_also_sequence ALSO alphabet_also_literal ; alphabet_lits: LITERAL { $$ = $1; } | SPACE { $$ = cb_space; } | ZERO { $$ = cb_zero; } | QUOTE { $$ = cb_quote; } | HIGH_VALUE { $$ = cb_norm_high; } | LOW_VALUE { $$ = cb_norm_low; } ; alphabet_also_literal: LITERAL { cb_list_add (save_tree_2, $1); } | SPACE { cb_list_add (save_tree_2, cb_space); } | ZERO { cb_list_add (save_tree_2, cb_zero); } | QUOTE { cb_list_add (save_tree_2, cb_quote); } | HIGH_VALUE { cb_list_add (save_tree_2, cb_norm_high); } | LOW_VALUE { cb_list_add (save_tree_2, cb_norm_low); } ; /* Symbolic characters clause */ symbolic_characters_clause: SYMBOLIC _characters symbolic_characters_list { if ($3) { current_program->symbolic_list = cb_list_add (current_program->symbolic_list, $3); } PENDING ("SYMBOLIC CHARACTERS"); } ; symbolic_characters_list: char_list _is_are integer_list { if (cb_list_length ($1) != cb_list_length ($3)) { cb_error (_("Invalid SYMBOLIC clause")); $$ = NULL; } else { $$ = NULL; } } ; char_list: undefined_word { $$ = cb_list_init ($1); } | char_list undefined_word { $$ = cb_list_add ($1, $2); } ; integer_list: integer { $$ = cb_list_init ($1); } | integer_list integer { $$ = cb_list_add ($1, $2); } ; /* Class name clause */ class_name_clause: CLASS undefined_word _is class_item_list { current_program->class_name_list = cb_list_add (current_program->class_name_list, cb_build_class_name ($2, $4)); } ; class_item_list: class_item { $$ = cb_list_init ($1); } | class_item_list class_item { $$ = cb_list_add ($1, $2); } ; class_item: basic_value { $$ = $1; } | basic_value THRU basic_value { /* if (CB_LITERAL ($1)->data[0] < CB_LITERAL ($3)->data[0]) */ if (literal_value ($1) < literal_value ($3)) { $$ = cb_build_pair ($1, $3); } else { $$ = cb_build_pair ($3, $1); } } ; /* LOCALE clause */ locale_clause: LOCALE undefined_word _is reference { cb_tree l; l = cb_build_locale_name ($2, $4); if (l != cb_error_node) { current_program->locale_list = cb_list_add (current_program->locale_list, l); } } ; /* CURRENCY SIGN clause */ currency_sign_clause: CURRENCY _sign _is LITERAL { unsigned char *s = CB_LITERAL ($4)->data; if (CB_LITERAL ($4)->size != 1) { cb_error_x ($4, _("Invalid currency sign '%s'"), s); } switch (*s) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'A': case 'b': case 'B': case 'c': case 'C': case 'd': case 'D': case 'e': case 'E': case 'n': case 'N': case 'p': case 'P': case 'r': case 'R': case 's': case 'S': case 'v': case 'V': case 'x': case 'X': case 'z': case 'Z': case '+': case '-': case ',': case '.': case '*': case '/': case ';': case '(': case ')': case '=': case '"': case ' ': cb_error_x ($4, _("Invalid currency sign '%s'"), s); break; default: break; } current_program->currency_symbol = s[0]; } ; /* DECIMAL-POINT clause */ decimal_point_clause: DECIMAL_POINT _is COMMA { current_program->decimal_point = ','; current_program->numeric_separator = '.'; } ; /* CURSOR clause */ cursor_clause: CURSOR _is reference { current_program->cursor_pos = $3; } ; /* CRT STATUS clause */ crt_status_clause: CRT STATUS _is reference { current_program->crt_status = $4; } ; /* SCREEN CONTROL */ screen_control: SCREEN_CONTROL _is reference { PENDING ("SCREEN CONTROL"); } ; /* EVENT STATUS */ event_status: EVENT_STATUS _is reference { PENDING ("EVENT STATUS"); } ; /******************* * INPUT-OUTPUT SECTION *******************/ input_output_section: | INPUT_OUTPUT SECTION '.' file_control_paragraph i_o_control_paragraph | FILE_CONTROL '.' { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("INPUT-OUTPUT SECTION header missing - assumed")); } else { cb_error (_("INPUT-OUTPUT SECTION header missing")); } } file_control_sequence | I_O_CONTROL '.' { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("INPUT-OUTPUT SECTION header missing - assumed")); } else { cb_error (_("INPUT-OUTPUT SECTION header missing")); } } opt_i_o_control ; /* * FILE-CONTROL paragraph */ file_control_paragraph: | FILE_CONTROL '.' file_control_sequence ; file_control_sequence: | file_control_sequence file_control_entry ; file_control_entry: SELECT flag_optional undefined_word { organized_seen = 0; if ($3 == cb_error_node) { YYERROR; } /* build new file */ current_file = build_file ($3); current_file->optional = CB_INTEGER ($2)->val; /* register the file */ current_program->file_list = cb_cons (CB_TREE (current_file), current_program->file_list); } select_clause_sequence '.' { validate_file (current_file, $3); } ; select_clause_sequence: | select_clause_sequence select_clause ; select_clause: assign_clause | access_mode_clause | alternative_record_key_clause | collating_sequence_clause | file_status_clause | lock_mode_clause | organization_clause | padding_character_clause | record_delimiter_clause | record_key_clause | relative_key_clause | reserve_clause | sharing_clause ; /* ASSIGN clause */ assign_clause: ASSIGN _to _ext_clause _device assignment_name { current_file->assign = cb_build_assignment_name (current_file, $5); } | ASSIGN _to _ext_clause DISK { current_file->fileid_assign = 1; } ; _device: | DISK | PRINTER { current_file->organization = COB_ORG_LINE_SEQUENTIAL; } ; _ext_clause: | EXTERNAL { current_file->external_assign = 1; } | DYNAMIC ; assignment_name: LITERAL | DISPLAY { const char *s; s = "$#@DUMMY@#$"; $$ = cb_build_alphanumeric_literal ((unsigned char *)s, strlen (s)); } | qualified_word ; /* ACCESS MODE clause */ access_mode_clause: ACCESS _mode _is access_mode ; access_mode: SEQUENTIAL { current_file->access_mode = COB_ACCESS_SEQUENTIAL; } | DYNAMIC { current_file->access_mode = COB_ACCESS_DYNAMIC; } | RANDOM { current_file->access_mode = COB_ACCESS_RANDOM; } ; /* ALTERNATIVE RECORD KEY clause */ alternative_record_key_clause: ALTERNATE RECORD _key _is opt_splitk flag_duplicates { struct cb_alt_key *p; struct cb_alt_key *l; p = cobc_malloc (sizeof (struct cb_alt_key)); p->key = $5; p->duplicates = CB_INTEGER ($6)->val; p->next = NULL; /* add to the end of list */ if (current_file->alt_key_list == NULL) { current_file->alt_key_list = p; } else { l = current_file->alt_key_list; for (; l->next; l = l->next); l->next = p; } } ; /* COLLATING SEQUENCE clause */ collating_sequence_clause: coll_sequence _is WORD { PENDING ("COLLATING SEQUENCE"); } ; /* FILE STATUS clause */ file_status_clause: file_or_sort STATUS _is reference opt_reference { current_file->file_status = $4; if ($5) { PENDING ("2nd FILE STATUS"); } } ; file_or_sort: /* empty */ | TOK_FILE | SORT ; /* LOCK MODE clause */ lock_mode_clause: LOCK _mode _is lock_mode ; lock_mode: MANUAL lock_with { current_file->lock_mode = COB_LOCK_MANUAL; } | AUTOMATIC lock_with { current_file->lock_mode = COB_LOCK_AUTOMATIC; } | EXCLUSIVE { current_file->lock_mode = COB_LOCK_EXCLUSIVE; } ; lock_with: | WITH LOCK ON lock_records | WITH LOCK ON MULTIPLE lock_records { current_file->lock_mode |= COB_LOCK_MULTIPLE; } | WITH ROLLBACK { PENDING ("WITH ROLLBACK"); } ; lock_records: RECORD | RECORDS ; /* ORGANIZATION clause */ organization_clause: ORGANIZATION _is organization | organization ; organization: INDEXED { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_INDEXED; organized_seen = 1; } } | _record _binary SEQUENTIAL { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_SEQUENTIAL; organized_seen = 1; } } | RELATIVE { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_RELATIVE; organized_seen = 1; } } | LINE SEQUENTIAL { if (organized_seen) { cb_error (_("Invalid or duplicate ORGANIZED clause")); } else { current_file->organization = COB_ORG_LINE_SEQUENTIAL; organized_seen = 1; } } ; /* PADDING CHARACTER clause */ padding_character_clause: PADDING _character _is reference_or_literal { cb_verify (cb_padding_character_clause, "PADDING CHARACTER"); } ; /* RECORD DELIMITER clause */ record_delimiter_clause: RECORD DELIMITER _is STANDARD_1 { /* ignored */ } ; /* RECORD KEY clause */ record_key_clause: RECORD _key _is opt_splitk { current_file->key = $4; } ; opt_splitk: reference { $$ = $1; } | reference '=' reference_list { PENDING ("SPLIT KEYS"); } | reference SOURCE _is reference_list { PENDING ("SPLIT KEYS"); } ; /* RELATIVE KEY clause */ relative_key_clause: RELATIVE _key _is reference { current_file->key = $4; } ; /* RESERVE clause */ reserve_clause: RESERVE integer _area { /* ignored */ } ; /* SHARING clause */ sharing_clause: SHARING _with sharing_option { current_file->sharing = $3; } ; sharing_option: ALL _other { $$ = NULL; PENDING ("SHARING ALL OTHER"); } | NO _other { $$ = cb_int1; } | READ ONLY { $$ = cb_int0; } ; /* * I-O-CONTROL paragraph */ i_o_control_paragraph: | I_O_CONTROL '.' opt_i_o_control ; opt_i_o_control: | i_o_control_list '.' ; i_o_control_list: i_o_control_clause | i_o_control_list i_o_control_clause ; i_o_control_clause: same_clause | multiple_file_tape_clause ; /* SAME clause */ same_clause: SAME same_option _area _for file_name_list { cb_tree l; switch (CB_INTEGER ($2)->val) { case 0: /* SAME AREA */ break; case 1: /* SAME RECORD */ for (l = $5; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { CB_FILE (cb_ref (CB_VALUE (l)))->same_clause = samearea; } } samearea++; break; case 2: /* SAME SORT-MERGE */ break; } } ; same_option: /* empty */ { $$ = cb_int0; } | RECORD { $$ = cb_int1; } | SORT { $$ = cb_int2; } | SORT_MERGE { $$ = cb_int2; } ; /* MULTIPLE FILE TAPE clause */ multiple_file_tape_clause: MULTIPLE _file _tape _contains multiple_file_list { cb_verify (cb_multiple_file_tape_clause, "MULTIPLE FILE TAPE"); } ; multiple_file_list: multiple_file | multiple_file_list multiple_file ; multiple_file: file_name multiple_file_position { } ; multiple_file_position: | POSITION integer ; /***************************************************************************** * DATA DIVISION. *****************************************************************************/ data_division: | DATA DIVISION '.' file_section working_storage_section local_storage_section linkage_section report_section screen_section ; /******************* * FILE SECTION *******************/ file_section: | TOK_FILE SECTION '.' { current_storage = CB_STORAGE_FILE; } file_description_sequence | file_type { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning (_("FILE SECTION header missing - assumed")); } else { cb_error (_("FILE SECTION header missing")); } current_storage = CB_STORAGE_FILE; } file_description_sequence_without_type ; file_description_sequence: | file_description_sequence file_description ; file_description: file_type file_description_entry record_description_list { if ($3 && $3 != cb_error_node) { finalize_file (current_file, CB_FIELD ($3)); } else { cb_error (_("RECORD description missing or invalid")); } } ; file_description_sequence_without_type: file_description_entry record_description_list { if ($2 && $2 != cb_error_node) { finalize_file (current_file, CB_FIELD ($2)); } else { cb_error (_("RECORD description missing or invalid")); } } | file_description_sequence_without_type file_description ; file_type: FD { $$ = cb_int0; } | SD { $$ = cb_int1; } ; /* * File description entry */ file_description_entry: file_name { if ($1 == cb_error_node) { YYERROR; } current_file = CB_FILE (cb_ref ($1)); if ($0 == cb_int1) { current_file->organization = COB_ORG_SORT; } } file_description_clause_sequence '.' { /* Shut up bison */ dummy_tree = $2; } ; file_description_clause_sequence: | file_description_clause_sequence file_description_clause ; file_description_clause: _is EXTERNAL { if (current_file->global) { cb_error (_("File cannot have both EXTERNAL and GLOBAL clauses")); } current_file->external = 1; } | _is GLOBAL { if (current_file->external) { cb_error (_("File cannot have both EXTERNAL and GLOBAL clauses")); } current_file->global = 1; } | block_contains_clause | record_clause | label_records_clause | value_of_clause | data_records_clause | linage_clause | recording_mode_clause | code_set_clause | report_clause ; /* BLOCK CONTAINS clause */ block_contains_clause: BLOCK _contains integer opt_to_integer _records_or_characters { /* ignored */ } ; _records_or_characters: | RECORDS | CHARACTERS ; /* RECORD clause */ record_clause: RECORD _contains integer _characters { if (current_file->organization == COB_ORG_LINE_SEQUENTIAL) { cb_warning (_("RECORD clause ignored for LINE SEQUENTIAL")); } else { current_file->record_max = cb_get_int ($3); if (current_file->record_max < 1) { current_file->record_max = 1; cb_error (_("RECORD clause invalid")); } } } | RECORD _contains integer TO integer _characters { int error_ind = 0; if (current_file->organization == COB_ORG_LINE_SEQUENTIAL) { cb_warning (_("RECORD clause ignored for LINE SEQUENTIAL")); } else { current_file->record_min = cb_get_int ($3); current_file->record_max = cb_get_int ($5); if (current_file->record_min < 0) { current_file->record_min = 0; error_ind = 1; } if (current_file->record_max < 1) { current_file->record_max = 1; error_ind = 1; } if (current_file->record_max <= current_file->record_min) { error_ind = 1; } if (error_ind) { cb_error (_("RECORD clause invalid")); } } } | RECORD _is VARYING _in _size opt_from_integer opt_to_integer _characters record_depending { int error_ind = 0; current_file->record_min = $6 ? cb_get_int ($6) : 0; current_file->record_max = $7 ? cb_get_int ($7) : 0; if ($6 && current_file->record_min < 0) { current_file->record_min = 0; error_ind = 1; } if ($7 && current_file->record_max < 1) { current_file->record_max = 1; error_ind = 1; } if (($6 || $7) && current_file->record_max <= current_file->record_min) { error_ind = 1; } if (error_ind) { cb_error (_("RECORD clause invalid")); } } ; record_depending: | DEPENDING _on reference { current_file->record_depending = $3; } ; opt_from_integer: /* empty */ { $$ = NULL; } | _from integer { $$ = $2; } ; opt_to_integer: /* empty */ { $$ = NULL; } | TO integer { $$ = $2; } ; /* LABEL RECORDS clause */ label_records_clause: LABEL records label_option { cb_verify (cb_label_records_clause, "LABEL RECORDS"); } ; label_option: STANDARD | OMITTED ; /* VALUE OF clause */ value_of_clause: VALUE OF WORD _is valueof_name { cb_verify (cb_value_of_clause, "VALUE OF"); } | VALUE OF FILE_ID _is valueof_name { if (!current_file->assign) { current_file->assign = cb_build_assignment_name (current_file, $5); } } ; valueof_name: LITERAL | qualified_word ; /* DATA RECORDS clause */ data_records_clause: DATA records reference_list { cb_verify (cb_data_records_clause, "DATA RECORDS"); } ; /* LINAGE clause */ linage_clause: LINAGE _is reference_or_literal _lines linage_sequence { if (current_file->organization != COB_ORG_LINE_SEQUENTIAL && current_file->organization != COB_ORG_SEQUENTIAL) { cb_error (_("LINAGE clause with wrong file type")); $$ = cb_error_node; } else { current_file->linage = $3; current_file->organization = COB_ORG_LINE_SEQUENTIAL; if (current_linage == 0) { linage_file = current_file; } current_linage++; } } ; linage_sequence: | linage_sequence linage_lines ; linage_lines: linage_footing | linage_top | linage_bottom ; linage_footing: _with FOOTING _at reference_or_literal _lines { current_file->latfoot = $4; } ; linage_top: _at TOP reference_or_literal _lines { current_file->lattop = $3; } ; linage_bottom: _at BOTTOM reference_or_literal { current_file->latbot = $3; } ; /* RECORDING MODE clause */ recording_mode_clause: RECORDING _mode _is WORD { /* ignore */ } ; /* CODE-SET clause */ code_set_clause: CODE_SET _is WORD { if ($3 != cb_error_node) { cb_tree x; x = cb_ref ($3); if (!CB_ALPHABET_NAME_P (x)) { cb_error_x ($3, _("Alphabet-name is expected '%s'"), cb_name ($3)); } else if (CB_ALPHABET_NAME (x)->custom_list) { PENDING ("CODE-SET"); } } } ; /* REPORT clause */ report_clause: REPORT _is report_name { cb_warning (_("file descriptor REPORT IS")); } | REPORTS _are report_name { cb_warning (_("file descriptor REPORTS ARE")); } ; /******************* * WORKING-STORAGE SECTION *******************/ working_storage_section: | WORKING_STORAGE SECTION '.' { current_storage = CB_STORAGE_WORKING; } record_description_list { if ($5) { current_program->working_storage = cb_field_add (current_program->working_storage, CB_FIELD ($5)); } } ; record_description_list: /* empty */ { $$ = NULL; } | record_description_list_1 { $$ = $1; } ; record_description_list_1: { current_field = NULL; description_field = NULL; cb_clear_real_field (); } record_description_list_2 { struct cb_field *p; for (p = description_field; p; p = p->sister) { cb_validate_field (p); } $$ = CB_TREE (description_field); } ; record_description_list_2: not_const_word data_description '.' | record_description_list_2 not_const_word data_description '.' | record_description_list_2 '.' ; data_description: constant_entry | level_number entry_name { cb_tree x; x = cb_build_field_tree ($1, $2, current_field, current_storage, current_file); if (x == cb_error_node) { YYERROR; } else { current_field = CB_FIELD (x); } } data_description_clause_sequence { if (!qualifier && (current_field->level == 88 || current_field->level == 77 || current_field->level == 66 || current_field->flag_item_78)) { cb_error (_("Item requires a data name")); } if (current_field->level == 88) { cb_validate_88_item (current_field); } if (current_field->flag_item_78) { /* Reset to last non-78 item */ current_field = cb_validate_78_item (current_field); } if (!description_field) { description_field = current_field; } } ; level_number: WORD ; entry_name: /* empty */ { $$ = cb_build_filler (); qualifier = NULL; non_const_word = 0; } | FILLER { $$ = cb_build_filler (); qualifier = NULL; non_const_word = 0; } | WORD { $$ = $1; qualifier = $1; non_const_word = 0; } ; const_name: WORD { $$ = $1; qualifier = $1; non_const_word = 0; } ; const_global: | _is GLOBAL { current_field->flag_is_global = 1; cb_error (_("CONSTANT with GLOBAL clause is not yet supported")); } ; lit_or_length: literal { $$ = $1; } | LENGTH _of identifier_1 { $$ = cb_build_const_length ($3); } | BYTE_LENGTH _of identifier_1 { $$ = cb_build_const_length ($3); } ; constant_entry: level_number const_name CONSTANT const_global _as lit_or_length { cb_tree x; int level; level = cb_get_level ($1); if (level && level != 1) { cb_error (_("CONSTANT item not at 01 level")); } x = cb_build_constant ($2, $6); CB_FIELD (x)->flag_item_78 = 1; CB_FIELD (x)->level = 1; cb_needs_01 = 1; /* Ignore return value */ cb_validate_78_item (CB_FIELD (x)); } ; data_description_clause_sequence: /* empty */ { /* required to check redefines */ $$ = NULL; } | data_description_clause_sequence data_description_clause { /* required to check redefines */ $$ = cb_true; } ; data_description_clause: redefines_clause | external_clause | global_clause | picture_clause | usage_clause | sign_clause | occurs_clause | justified_clause | synchronized_clause | blank_clause | based_clause | value_clause | renames_clause | any_length_clause ; /* REDEFINES clause */ redefines_clause: REDEFINES identifier_1 { if ($0 != NULL) { /* hack for MF compatibility */ if (cb_relaxed_syntax_check) { cb_warning_x ($2, _("REDEFINES clause should follow entry-name")); } else { cb_error_x ($2, _("REDEFINES clause must follow entry-name")); } } current_field->redefines = cb_resolve_redefines (current_field, $2); if (current_field->redefines == NULL) { YYERROR; } } ; /* EXTERNAL clause */ external_clause: _is EXTERNAL as_extname { if (current_storage != CB_STORAGE_WORKING) { cb_error (_("EXTERNAL not allowed here")); } else if (current_field->level != 1 && current_field->level != 77) { cb_error (_("EXTERNAL only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("EXTERNAL requires a data name")); } else if (current_field->flag_is_global) { cb_error (_("GLOBAL and EXTERNAL are mutually exclusive")); } else if (current_field->flag_item_based) { cb_error (_("BASED and EXTERNAL are mutually exclusive")); } else if (current_field->redefines) { cb_error (_("EXTERNAL and REDEFINES are mutually exclusive")); } else { current_field->flag_external = 1; has_external = 1; } } ; as_extname: /* empty */ { current_field->ename = NULL; } | AS LITERAL { struct cb_field *x; x = CB_FIELD(cb_build_field (cb_build_reference ((char *)(CB_LITERAL ($2)->data)))); current_field->ename = x->name; } ; /* GLOBAL clause */ global_clause: _is GLOBAL { if (current_field->level != 1 && current_field->level != 77) { cb_error (_("GLOBAL only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("GLOBAL requires a data name")); } else if (current_field->flag_external) { cb_error (_("GLOBAL and EXTERNAL are mutually exclusive")); } else if (current_storage == CB_STORAGE_LOCAL) { cb_error (_("GLOBAL not allowed here")); } else { current_field->flag_is_global = 1; } } ; /* PICTURE clause */ picture_clause: PICTURE { current_field->pic = CB_PICTURE ($1); } ; /* USAGE clause */ usage_clause: usage | USAGE _is usage ; usage: BINARY { current_field->usage = CB_USAGE_BINARY; } | COMP { current_field->usage = CB_USAGE_BINARY; } | COMP_1 { current_field->usage = CB_USAGE_FLOAT; } | COMP_2 { current_field->usage = CB_USAGE_DOUBLE; } | COMP_3 { current_field->usage = CB_USAGE_PACKED; } | COMP_4 { current_field->usage = CB_USAGE_BINARY; } | COMP_5 { current_field->usage = CB_USAGE_COMP_5; } | COMP_X { current_field->usage = CB_USAGE_COMP_X; } | DISPLAY { current_field->usage = CB_USAGE_DISPLAY; } | INDEX { current_field->usage = CB_USAGE_INDEX; } | PACKED_DECIMAL { current_field->usage = CB_USAGE_PACKED; } | POINTER { current_field->usage = CB_USAGE_POINTER; current_field->flag_is_pointer = 1; } | PROGRAM_POINTER { current_field->usage = CB_USAGE_PROGRAM_POINTER; current_field->flag_is_pointer = 1; } | SIGNED_SHORT { current_field->usage = CB_USAGE_SIGNED_SHORT; } | SIGNED_INT { current_field->usage = CB_USAGE_SIGNED_INT; } | SIGNED_LONG { current_field->usage = CB_USAGE_SIGNED_LONG; } | UNSIGNED_SHORT { current_field->usage = CB_USAGE_UNSIGNED_SHORT; } | UNSIGNED_INT { current_field->usage = CB_USAGE_UNSIGNED_INT; } | UNSIGNED_LONG { current_field->usage = CB_USAGE_UNSIGNED_LONG; } | BINARY_CHAR SIGNED { current_field->usage = CB_USAGE_SIGNED_CHAR; } | BINARY_CHAR UNSIGNED { current_field->usage = CB_USAGE_UNSIGNED_CHAR; } | BINARY_CHAR { current_field->usage = CB_USAGE_SIGNED_CHAR; } | BINARY_SHORT SIGNED { current_field->usage = CB_USAGE_SIGNED_SHORT; } | BINARY_SHORT UNSIGNED { current_field->usage = CB_USAGE_UNSIGNED_SHORT; } | BINARY_SHORT { current_field->usage = CB_USAGE_SIGNED_SHORT; } | BINARY_LONG SIGNED { current_field->usage = CB_USAGE_SIGNED_INT; } | BINARY_LONG UNSIGNED { current_field->usage = CB_USAGE_UNSIGNED_INT; } | BINARY_LONG { current_field->usage = CB_USAGE_SIGNED_INT; } | BINARY_DOUBLE SIGNED { current_field->usage = CB_USAGE_SIGNED_LONG; } | BINARY_DOUBLE UNSIGNED { current_field->usage = CB_USAGE_UNSIGNED_LONG; } | BINARY_DOUBLE { current_field->usage = CB_USAGE_SIGNED_LONG; } | BINARY_C_LONG SIGNED { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_SIGNED_INT; } else { current_field->usage = CB_USAGE_SIGNED_LONG; } } | BINARY_C_LONG UNSIGNED { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_UNSIGNED_INT; } else { current_field->usage = CB_USAGE_UNSIGNED_LONG; } } | BINARY_C_LONG { if (sizeof(long) == 4) { current_field->usage = CB_USAGE_SIGNED_INT; } else { current_field->usage = CB_USAGE_SIGNED_LONG; } } | NATIONAL { PENDING ("USAGE NATIONAL");} ; /* SIGN clause */ sign_clause: _sign_is LEADING flag_separate { current_field->flag_sign_separate = CB_INTEGER ($3)->val; current_field->flag_sign_leading = 1; } | _sign_is TRAILING flag_separate { current_field->flag_sign_separate = CB_INTEGER ($3)->val; current_field->flag_sign_leading = 0; } ; /* OCCURS clause */ occurs_clause: OCCURS integer occurs_to_integer _times occurs_depending occurs_keys occurs_indexed { if (current_field->occurs_depending && !($3)) { cb_verify (cb_odo_without_to, "ODO without TO clause"); } current_field->occurs_min = $3 ? cb_get_int ($2) : 1; current_field->occurs_max = $3 ? cb_get_int ($3) : cb_get_int ($2); current_field->indexes++; if (current_field->indexes > COB_MAX_SUBSCRIPTS) { cb_error (_("Maximum OCCURS depth exceeded")); } current_field->flag_occurs = 1; } ; occurs_to_integer: /* empty */ { $$ = NULL; } | TO integer { $$ = $2; } ; occurs_depending: | DEPENDING _on reference { current_field->occurs_depending = $3; } ; occurs_keys: occurs_key_list { if ($1) { cb_tree l; struct cb_key *keys; int i; int nkeys; l = $1; nkeys = cb_list_length ($1); keys = cobc_malloc (sizeof (struct cb_key) * nkeys); for (i = 0; i < nkeys; i++) { keys[i].dir = CB_PURPOSE_INT (l); keys[i].key = CB_VALUE (l); l = CB_CHAIN (l); } current_field->keys = keys; current_field->nkeys = nkeys; } } ; occurs_key_list: /* empty */ { $$ = NULL; } | occurs_key_list ascending_or_descending _key _is reference_list { cb_tree l; for (l = $5; l; l = CB_CHAIN (l)) { CB_PURPOSE (l) = $2; if (qualifier && !CB_REFERENCE(CB_VALUE(l))->chain && strcasecmp (CB_NAME(CB_VALUE(l)), CB_NAME(qualifier))) { CB_REFERENCE(CB_VALUE(l))->chain = qualifier; } } $$ = cb_list_append ($1, $5); } ; ascending_or_descending: ASCENDING { $$ = cb_int (COB_ASCENDING); } | DESCENDING { $$ = cb_int (COB_DESCENDING); } ; occurs_indexed: | INDEXED _by occurs_index_list { current_field->index_list = $3; } ; occurs_index_list: occurs_index { $$ = cb_list_init ($1); } | occurs_index_list occurs_index { $$ = cb_list_add ($1, $2); } ; occurs_index: WORD { $$ = cb_build_index ($1, cb_int1, 1, current_field); } ; /* JUSTIFIED clause */ justified_clause: JUSTIFIED _right { current_field->flag_justified = 1; } ; /* SYNCHRONIZED clause */ synchronized_clause: SYNCHRONIZED left_or_right { current_field->flag_synchronized = 1; } ; left_or_right: | LEFT | RIGHT ; /* BLANK clause */ blank_clause: BLANK _when ZERO { current_field->flag_blank_zero = 1; } ; /* BASED clause */ based_clause: BASED { if (current_storage != CB_STORAGE_WORKING && current_storage != CB_STORAGE_LINKAGE && current_storage != CB_STORAGE_LOCAL) { cb_error (_("BASED not allowed here")); } else if (current_field->level != 1 && current_field->level != 77) { cb_error (_("BASED only allowed at 01/77 level")); } else if (!qualifier) { cb_error (_("BASED requires a data name")); } else if (current_field->flag_external) { cb_error (_("BASED and EXTERNAL are mutually exclusive")); } else if (current_field->redefines) { cb_error (_("BASED and REDEFINES are mutually exclusive")); } else if (current_field->flag_any_length) { cb_error (_("BASED and ANY LENGTH are mutually exclusive")); } else { current_field->flag_item_based = 1; } } ; /* VALUE clause */ value_clause: VALUE _is_are value_item_list { current_field->values = $3; } _when _set _to false_is ; value_item_list: value_item { $$ = cb_list_init ($1); } | value_item_list value_item { $$ = cb_list_add ($1, $2); } ; value_item: literal { $$ = $1; } | literal THRU literal { $$ = cb_build_pair ($1, $3); } ; false_is: | TOK_FALSE _is literal { if (current_field->level != 88) { cb_error (_("FALSE clause only allowed for 88 level")); } current_field->false_88 = cb_list_init ($3); } ; /* RENAMES clause */ renames_clause: RENAMES qualified_word { if (cb_ref ($2) != cb_error_node) { if (CB_FIELD (cb_ref ($2))->level == 01 || CB_FIELD (cb_ref ($2))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else { current_field->redefines = CB_FIELD (cb_ref ($2)); current_field->pic = current_field->redefines->pic; } } } | RENAMES qualified_word THRU qualified_word { if (cb_ref ($2) != cb_error_node && cb_ref ($4) != cb_error_node) { if (CB_FIELD (cb_ref ($2))->level == 01 || CB_FIELD (cb_ref ($2))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else if (CB_FIELD (cb_ref ($4))->level == 01 || CB_FIELD (cb_ref ($4))->level > 50) { cb_error (_("RENAMES may not reference a level 01 or > 50")); } else { current_field->redefines = CB_FIELD (cb_ref ($2)); current_field->rename_thru = CB_FIELD (cb_ref ($4)); } } } ; /* ANY LENGTH clause */ any_length_clause: ANY LENGTH { if (current_field->flag_item_based) { cb_error (_("BASED and ANY LENGTH are mutually exclusive")); } else { current_field->flag_any_length = 1; } } ; /******************* * LOCAL-STORAGE SECTION *******************/ local_storage_section: | LOCAL_STORAGE SECTION '.' { current_storage = CB_STORAGE_LOCAL; if (current_program->nested_level) { cb_error (_("LOCAL-STORAGE not allowed in nested programs")); } } record_description_list { if ($5) { current_program->local_storage = CB_FIELD ($5); } } ; /******************* * LINKAGE SECTION *******************/ linkage_section: | LINKAGE SECTION '.' { current_storage = CB_STORAGE_LINKAGE; } record_description_list { if ($5) { current_program->linkage_storage = CB_FIELD ($5); } } ; /******************* * REPORT SECTION *******************/ report_section: | REPORT SECTION '.' { cb_error (_("REPORT SECTION not supported")); current_storage = CB_STORAGE_REPORT; } opt_report_description_list ; /******************* * Optional RD list *******************/ opt_report_description_list: | report_description_list ; report_description_list: report_description_entry | report_description_list report_description_entry ; /******************* * RD report description *******************/ report_description_entry: RD report_name report_description_options '.' report_group_description_list ; report_description_options: /* empty */ { cb_warning (_("Report description using defaults")); } | report_description_options report_description_option ; report_description_option: _is GLOBAL { cb_error (_("GLOBAL is not allowed with RD")); } | CODE _is id_or_lit | control_clause | page_limit_clause ; /******************* * report control breaks *******************/ control_clause: CONTROL control_field_list | CONTROLS control_field_list ; control_field_list: _final identifier_list ; _final: | FINAL ; identifier_list: identifier | identifier_list identifier ; /* PAGE clause */ page_limit_clause: PAGE _is_are page_line_column heading_clause first_detail last_heading last_detail footing_clause ; heading_clause: | HEADING _is integer ; first_detail: | FIRST DETAIL _is integer ; last_heading: | LAST CONTROL_HEADING _is integer ; last_detail: | LAST_DETAIL _is integer ; footing_clause: | FOOTING _is integer ; page_line_column: integer | integer line_or_lines integer COLUMNS | integer line_or_lines ; line_or_lines: LINE | LINES ; report_group_description_list: /* empty */ | report_group_description_list report_group_description_entry ; report_group_description_entry: level_number entry_name /* might need report_entry_name */ report_group_options '.' ; report_group_options: /* empty */ | report_group_options report_group_option ; report_group_option: type_clause { cb_warning (_("looking for Report line TYPE")); } | next_group_clause | line_clause | picture_clause | usage_clause | sign_clause | justified_clause | column_clause | blank_clause | source_clause | sum_clause_list | value_clause | present_when_condition | group_indicate_clause | occurs_clause | varying_clause ; type_clause: TYPE _is type_option ; type_option: REPORT_HEADING | PAGE_HEADING | CONTROL_HEADING | DETAIL | CONTROL_FOOTING | PAGE_FOOTING | REPORT_FOOTING ; next_group_clause: NEXT GROUP _is integer ; column_clause: COLUMN _number _is integer | COLUMN NUMBERS | COLUMNS ; sum_clause_list: sum_clause | sum_clause_list sum_clause ; sum_clause: SUM _of ref_id_exp ; ref_id_exp: reference /* | identifier */ ; present_when_condition: PRESENT WHEN condition ; varying_clause: VARYING identifier FROM x BY x ; line_clause: line_keyword_clause report_line_integer_list ; line_keyword_clause: LINE _numbers _is_are | LINES _are ; report_line_integer_list: line_or_plus | report_line_integer_list line_or_plus ; line_or_plus: PLUS integer | integer | NEXT PAGE /* _on broken here */ ; _numbers: | NUMBER | NUMBERS ; source_clause: /* id or exp */ SOURCE _is identifier flag_rounded ; group_indicate_clause: GROUP _indicate ; _indicate: | INDICATE ; report_name: WORD ; /******************* * SCREEN SECTION *******************/ screen_section: | SCREEN SECTION '.' { current_storage = CB_STORAGE_SCREEN; } { current_field = NULL; description_field = NULL; cb_clear_real_field (); } opt_screen_description_list { struct cb_field *p; for (p = description_field; p; p = p->sister) { cb_validate_field (p); } current_program->screen_storage = description_field; current_program->flag_screen = 1; } ; opt_screen_description_list: | screen_description_list ; screen_description_list: screen_description | screen_description_list screen_description ; screen_description: constant_entry | level_number entry_name { cb_tree x; x = cb_build_field_tree ($1, $2, current_field, current_storage, current_file); if (x == cb_error_node) { YYERROR; } current_field = CB_FIELD (x); if (current_field->parent) { current_field->screen_flag |= current_field->parent->screen_flag; current_field->screen_foreg = current_field->parent->screen_foreg; current_field->screen_backg = current_field->parent->screen_backg; } } screen_options '.' { if (!qualifier && (current_field->level == 88 || current_field->level == 77 || current_field->level == 66 || current_field->flag_item_78)) { cb_error (_("Item requires a data name")); } if (current_field->level == 88) { cb_validate_88_item (current_field); } if (current_field->flag_item_78) { /* Reset to last non-78 item */ current_field = cb_validate_78_item (current_field); } if (!description_field) { description_field = current_field; } } ; screen_options: | screen_options screen_option ; screen_option: BLANK_LINE { current_field->screen_flag |= COB_SCREEN_BLANK_LINE; } | BLANK_SCREEN { current_field->screen_flag |= COB_SCREEN_BLANK_SCREEN; } | BELL { current_field->screen_flag |= COB_SCREEN_BELL; } | BLINK { current_field->screen_flag |= COB_SCREEN_BLINK; } | ERASE EOL { current_field->screen_flag |= COB_SCREEN_ERASE_EOL; } | ERASE EOS { current_field->screen_flag |= COB_SCREEN_ERASE_EOS; } | HIGHLIGHT { current_field->screen_flag |= COB_SCREEN_HIGHLIGHT; } | LOWLIGHT { current_field->screen_flag |= COB_SCREEN_LOWLIGHT; } | REVERSE_VIDEO { current_field->screen_flag |= COB_SCREEN_REVERSE; } | UNDERLINE { current_field->screen_flag |= COB_SCREEN_UNDERLINE; } | OVERLINE { current_field->screen_flag |= COB_SCREEN_OVERLINE; } | AUTO { current_field->screen_flag |= COB_SCREEN_AUTO; } | SECURE { current_field->screen_flag |= COB_SCREEN_SECURE; } | REQUIRED { current_field->screen_flag |= COB_SCREEN_REQUIRED; } | FULL { current_field->screen_flag |= COB_SCREEN_FULL; } | PROMPT { current_field->screen_flag |= COB_SCREEN_PROMPT; } | LINE _number _is screen_line_plus_minus num_id_or_lit { current_field->screen_line = $5; } | COLUMN _number _is screen_col_plus_minus num_id_or_lit { current_field->screen_column = $5; } | FOREGROUND_COLOR _is num_id_or_lit { current_field->screen_foreg = $3; } | BACKGROUND_COLOR _is num_id_or_lit { current_field->screen_backg = $3; } | usage_clause | blank_clause | justified_clause | sign_clause | value_clause | picture_clause | screen_occurs_clause | USING identifier { current_field->screen_from = $2; current_field->screen_to = $2; current_field->screen_flag |= COB_SCREEN_PROMPT; current_field->screen_flag |= COB_SCREEN_INPUT; } | FROM id_or_lit_or_func { current_field->screen_from = $2; } | TO identifier { current_field->screen_to = $2; current_field->screen_flag |= COB_SCREEN_PROMPT; current_field->screen_flag |= COB_SCREEN_INPUT; } ; screen_line_plus_minus: /* empty */ { /* Nothing */ } | PLUS { current_field->screen_flag |= COB_SCREEN_LINE_PLUS; } | '+' { current_field->screen_flag |= COB_SCREEN_LINE_PLUS; } | MINUS { current_field->screen_flag |= COB_SCREEN_LINE_MINUS; } | '-' { current_field->screen_flag |= COB_SCREEN_LINE_MINUS; } ; screen_col_plus_minus: /* empty */ { /* Nothing */ } | PLUS { current_field->screen_flag |= COB_SCREEN_COLUMN_PLUS; } | '+' { current_field->screen_flag |= COB_SCREEN_COLUMN_PLUS; } | MINUS { current_field->screen_flag |= COB_SCREEN_COLUMN_MINUS; } | '-' { current_field->screen_flag |= COB_SCREEN_COLUMN_MINUS; } ; screen_occurs_clause: OCCURS integer _times { current_field->occurs_max = cb_get_int ($2); current_field->occurs_min = current_field->occurs_max; current_field->indexes++; current_field->flag_occurs = 1; } ; /***************************************************************************** * PROCEDURE DIVISION *****************************************************************************/ procedure_division: | PROCEDURE DIVISION procedure_using_chaining procedure_returning '.' { current_section = NULL; current_paragraph = NULL; cb_define_system_name ("CONSOLE"); cb_define_system_name ("SYSIN"); cb_define_system_name ("SYSOUT"); cb_define_system_name ("SYSERR"); cb_set_in_procedure (); } procedure_declaratives { if (current_program->flag_main && !current_program->flag_chained && $3) { cb_error (_("Executable program requested but PROCEDURE/ENTRY has USING clause")); } emit_entry (current_program->program_id, 0, $3); /* main entry point */ if (current_program->source_name) { emit_entry (current_program->source_name, 1, $3); } } procedure_list { if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); } } ; procedure_using_chaining: /* empty */ { $$ = NULL; } | USING { call_mode = CB_CALL_BY_REFERENCE; size_mode = CB_SIZE_4; } procedure_param_list { $$ = $3; } | CHAINING { call_mode = CB_CALL_BY_REFERENCE; current_program->flag_chained = 1; } procedure_param_list { $$ = $3; } ; procedure_param_list: procedure_param { $$ = $1; } | procedure_param_list procedure_param { $$ = cb_list_append ($1, $2); } ; procedure_param: procedure_type size_optional procedure_optional WORD { $$ = cb_build_pair (cb_int (call_mode), cb_build_identifier ($4)); CB_SIZES ($$) = size_mode; } ; procedure_type: /* empty */ | _by REFERENCE { call_mode = CB_CALL_BY_REFERENCE; } | _by VALUE { if (current_program->flag_chained) { cb_error (_("BY VALUE not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_VALUE; } } ; size_optional: /* empty */ | SIZE _is AUTO { if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else { size_mode = CB_SIZE_AUTO; } } | SIZE _is DEFAULT { if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else { size_mode = CB_SIZE_4; } } | UNSIGNED SIZE _is integer { unsigned char *s = CB_LITERAL ($4)->data; if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else if (CB_LITERAL ($4)->size != 1) { cb_error_x ($4, _("Invalid value for SIZE")); } else { size_mode = CB_SIZE_UNSIGNED; switch (*s) { case '1': size_mode |= CB_SIZE_1; break; case '2': size_mode |= CB_SIZE_2; break; case '4': size_mode |= CB_SIZE_4; break; case '8': size_mode |= CB_SIZE_8; break; default: cb_error_x ($4, _("Invalid value for SIZE")); break; } } } | SIZE _is integer { unsigned char *s = CB_LITERAL ($3)->data; if (call_mode != CB_CALL_BY_VALUE) { cb_error (_("SIZE only allowed for BY VALUE items")); } else if (CB_LITERAL ($3)->size != 1) { cb_error_x ($3, _("Invalid value for SIZE")); } else { size_mode = 0; switch (*s) { case '1': size_mode = CB_SIZE_1; break; case '2': size_mode = CB_SIZE_2; break; case '4': size_mode = CB_SIZE_4; break; case '8': size_mode = CB_SIZE_8; break; default: cb_error_x ($3, _("Invalid value for SIZE")); break; } } } ; procedure_optional: /* empty */ | OPTIONAL { if (call_mode != CB_CALL_BY_REFERENCE) { cb_error (_("OPTIONAL only allowed for BY REFERENCE items")); } } ; procedure_returning: /* empty */ { if (current_program->prog_type == CB_FUNCTION_TYPE) { cb_error (_("RETURNING clause is required for a FUNCTION")); } } | RETURNING WORD { if (cb_ref ($2) != cb_error_node) { current_program->returning = $2; if (cb_field ($2)->storage != CB_STORAGE_LINKAGE) { cb_error (_("RETURNING item is not defined in LINKAGE SECTION")); } } } ; procedure_declaratives: | DECLARATIVES '.' { in_declaratives = 1; } procedure_list END DECLARATIVES '.' { in_declaratives = 0; if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); current_paragraph = NULL; } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); current_section = NULL; } } ; /******************* * Procedure list *******************/ procedure_list: | procedure_list procedure ; procedure: section_header | paragraph_header | invalid_statement | statements '.' { if (next_label_list) { cb_tree label; char name[16]; sprintf (name, "L$%d", next_label_id); label = cb_build_reference (name); emit_statement (cb_build_label (label, NULL)); current_program->label_list = cb_list_append (current_program->label_list, next_label_list); next_label_list = NULL; next_label_id++; } /* check_unreached = 0; */ } | error '.' { check_unreached = 0; } | '.' { /* check_unreached = 0; */ } ; /******************* * Section/Paragraph *******************/ section_header: section_name SECTION opt_segment '.' { non_const_word = 0; check_unreached = 0; if ($1 == cb_error_node) { YYERROR; } /* Exit the last section */ if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } if (current_section) { if (current_section->exit_label) { emit_statement (current_section->exit_label); } emit_statement (cb_build_perform_exit (current_section)); } /* Begin a new section */ current_section = CB_LABEL (cb_build_label ($1, NULL)); current_section->is_section = 1; current_paragraph = NULL; emit_statement (CB_TREE (current_section)); } ; paragraph_header: WORD '.' { cb_tree label; non_const_word = 0; check_unreached = 0; $$ = cb_build_section_name ($1, 1); /* if ($1 == cb_error_node) */ if ($$ == cb_error_node) { YYERROR; } /* Exit the last paragraph */ if (current_paragraph) { if (current_paragraph->exit_label) { emit_statement (current_paragraph->exit_label); } emit_statement (cb_build_perform_exit (current_paragraph)); } /* Begin a new paragraph */ if (!current_section) { label = cb_build_reference ("MAIN SECTION"); current_section = CB_LABEL (cb_build_label (label, NULL)); current_section->is_section = 1; emit_statement (CB_TREE (current_section)); } current_paragraph = CB_LABEL (cb_build_label ($$, current_section)); if (current_section) { current_section->children = cb_cons (CB_TREE (current_paragraph), current_section->children); } emit_statement (CB_TREE (current_paragraph)); } ; invalid_statement: section_name { non_const_word = 0; check_unreached = 0; if ($1 != cb_error_node) { cb_error_x ($1, _("Unknown statement '%s'"), CB_NAME ($1)); } YYERROR; } ; section_name: WORD { $$ = cb_build_section_name ($1, 0); } ; opt_segment: | LITERAL { /* ignore */ } ; /******************* * Statements *******************/ statement_list: { $$ = current_program->exec_list; current_program->exec_list = NULL; } { $$ = CB_TREE (current_statement); current_statement = NULL; } statements { $$ = cb_list_reverse (current_program->exec_list); current_program->exec_list = $1; current_statement = CB_STATEMENT ($2); } ; statements: { cb_tree label; if (!current_section) { label = cb_build_reference ("MAIN SECTION"); current_section = CB_LABEL (cb_build_label (label, NULL)); current_section->is_section = 1; emit_statement (CB_TREE (current_section)); } if (!current_paragraph) { label = cb_build_reference ("MAIN PARAGRAPH"); current_paragraph = CB_LABEL (cb_build_label (label, NULL)); emit_statement (CB_TREE (current_paragraph)); current_section->children = cb_cons (CB_TREE (current_paragraph), current_section->children); } } statement | statements statement ; statement: accept_statement | add_statement | allocate_statement | alter_statement | call_statement | cancel_statement | close_statement | commit_statement | compute_statement | continue_statement | delete_statement | display_statement | divide_statement | entry_statement | evaluate_statement | exit_statement | free_statement | generate_statement | goto_statement | goback_statement | if_statement | initialize_statement | initiate_statement | inspect_statement | merge_statement | move_statement | multiply_statement | open_statement | perform_statement | read_statement | release_statement | return_statement | rewrite_statement | rollback_statement | search_statement | set_statement | sort_statement | start_statement | stop_statement | string_statement | subtract_statement | suppress_statement | terminate_statement | transform_statement | unlock_statement | unstring_statement | use_statement | write_statement | NEXT_SENTENCE { if (cb_verify (cb_next_sentence_phrase, "NEXT SENTENCE")) { cb_tree label; char name[16]; BEGIN_STATEMENT ("NEXT SENTENCE", 0); sprintf (name, "L$%d", next_label_id); label = cb_build_reference (name); next_label_list = cb_list_add (next_label_list, label); emit_statement (cb_build_goto (label, NULL)); } check_unreached = 0; } ; /* * ACCEPT statement */ accept_statement: ACCEPT { BEGIN_STATEMENT ("ACCEPT", TERM_ACCEPT); dispattrs = 0; fgc = NULL; bgc = NULL; scroll = NULL; } accept_body end_accept ; accept_body: identifier opt_at_line_column opt_accp_attr on_accp_exception { cb_emit_accept ($1, $2, fgc, bgc, scroll, dispattrs); } | identifier FROM ESCAPE KEY { PENDING ("ACCEPT .. FROM ESCAPE KEY"); } | identifier FROM LINES { cb_emit_accept_line_or_col ($1, 0); } | identifier FROM COLUMNS { cb_emit_accept_line_or_col ($1, 1); } | identifier FROM DATE { cb_emit_accept_date ($1); } | identifier FROM DATE YYYYMMDD { cb_emit_accept_date_yyyymmdd ($1); } | identifier FROM DAY { cb_emit_accept_day ($1); } | identifier FROM DAY YYYYDDD { cb_emit_accept_day_yyyyddd ($1); } | identifier FROM DAY_OF_WEEK { cb_emit_accept_day_of_week ($1); } | identifier FROM TIME { cb_emit_accept_time ($1); } | identifier FROM COMMAND_LINE { cb_emit_accept_command_line ($1); } | identifier FROM ENVIRONMENT_VALUE on_accp_exception { cb_emit_accept_environment ($1); } | identifier FROM ENVIRONMENT simple_value on_accp_exception { cb_emit_get_environment ($4, $1); } | identifier FROM ARGUMENT_NUMBER { cb_emit_accept_arg_number ($1); } | identifier FROM ARGUMENT_VALUE on_accp_exception { cb_emit_accept_arg_value ($1); } | identifier FROM mnemonic_name { cb_emit_accept_mnemonic ($1, $3); } | identifier FROM WORD { cb_emit_accept_name ($1, $3); } ; opt_at_line_column: /* empty */ { $$ = NULL; } | _at line_number column_number { $$ = cb_build_pair ($2, $3); } | _at column_number line_number { $$ = cb_build_pair ($3, $2); } | _at line_number { $$ = cb_build_pair ($2, NULL); } | _at column_number { $$ = cb_build_pair (NULL, $2); } | AT simple_value { $$ = $2; } ; line_number: LINE _number id_or_lit { $$ = $3; } ; column_number: COLUMN _number id_or_lit { $$ = $3; } | POSITION _number id_or_lit { $$ = $3; } ; opt_accp_attr: | WITH accp_attrs ; accp_attrs: accp_attr | accp_attrs accp_attr ; accp_attr: BELL { dispattrs |= COB_SCREEN_BELL; } | BLINK { dispattrs |= COB_SCREEN_BLINK; } | HIGHLIGHT { dispattrs |= COB_SCREEN_HIGHLIGHT; } | LOWLIGHT { dispattrs |= COB_SCREEN_LOWLIGHT; } | REVERSE_VIDEO { dispattrs |= COB_SCREEN_REVERSE; } | UNDERLINE { dispattrs |= COB_SCREEN_UNDERLINE; } | OVERLINE { dispattrs |= COB_SCREEN_OVERLINE; } | FOREGROUND_COLOR _is num_id_or_lit { fgc = $3; } | BACKGROUND_COLOR _is num_id_or_lit { bgc = $3; } | SCROLL UP _opt_scroll_lines { scroll = $3; } | SCROLL DOWN _opt_scroll_lines { dispattrs |= COB_SCREEN_SCROLL_DOWN; scroll = $3; } | AUTO { dispattrs |= COB_SCREEN_AUTO; } | FULL { dispattrs |= COB_SCREEN_FULL; } | REQUIRED { dispattrs |= COB_SCREEN_REQUIRED; } | SECURE { dispattrs |= COB_SCREEN_SECURE; } | UPDATE { dispattrs |= COB_SCREEN_UPDATE; } | PROMPT { dispattrs |= COB_SCREEN_PROMPT; } ; end_accept: /* empty */ { terminator_warning (TERM_ACCEPT); } | END_ACCEPT { terminator_clear (TERM_ACCEPT); } ; /* * ADD statement */ add_statement: ADD { BEGIN_STATEMENT ("ADD", TERM_ADD); } add_body end_add ; add_body: x_list TO arithmetic_x_list on_size_error { cb_emit_arithmetic ($3, '+', cb_build_binary_list ($1, '+')); } | x_list add_to GIVING arithmetic_x_list on_size_error { cb_emit_arithmetic ($4, 0, cb_build_binary_list ($1, '+')); } | CORRESPONDING identifier TO identifier flag_rounded on_size_error { cb_emit_corresponding (cb_build_add, $4, $2, $5); } ; add_to: | TO x { cb_list_add ($0, $2); } ; end_add: /* empty */ { terminator_warning (TERM_ADD); } | END_ADD { terminator_clear (TERM_ADD); } ; /* * ALLOCATE statement */ allocate_statement: ALLOCATE { BEGIN_STATEMENT ("ALLOCATE", 0); } allocate_body ; allocate_body: WORD flag_initialized allocate_returning { cb_emit_allocate ($1, $3, NULL, $2); } | expr CHARACTERS flag_initialized RETURNING target_x { cb_emit_allocate (NULL, $5, $1, $3); } ; allocate_returning: /* empty */ { $$ = NULL; } | RETURNING target_x { $$ = $2; } ; /* * ALTER statement */ alter_statement: ALTER alter_options { cb_error (_("ALTER statement is obsolete and unsupported")); } ; alter_options: | alter_options procedure_name TO _proceed_to procedure_name ; _proceed_to: | PROCEED TO ; /* * CALL statement */ call_statement: CALL { BEGIN_STATEMENT ("CALL", TERM_CALL); } id_or_lit_or_func call_using call_returning call_on_exception call_not_on_exception end_call { cb_emit_call ($3, $4, $5, $6, $7); } ; call_using: /* empty */ { $$ = NULL; } | USING { call_mode = CB_CALL_BY_REFERENCE; size_mode = CB_SIZE_4; } call_param_list { $$ = $3; } ; call_param_list: call_param { $$ = $1; } | call_param_list call_param { $$ = cb_list_append ($1, $2); } ; call_param: call_type OMITTED { if (call_mode != CB_CALL_BY_REFERENCE) { cb_error (_("OMITTED only allowed with BY REFERENCE")); } $$ = cb_build_pair (cb_int (call_mode), cb_null); } | call_type size_optional x { $$ = cb_build_pair (cb_int (call_mode), $3); CB_SIZES ($$) = size_mode; } ; call_type: /* empty */ | _by REFERENCE { call_mode = CB_CALL_BY_REFERENCE; } | _by CONTENT { if (current_program->flag_chained) { cb_error (_("BY CONTENT not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_CONTENT; } } | _by VALUE { if (current_program->flag_chained) { cb_error (_("BY VALUE not allowed in CHAINED program")); } else { call_mode = CB_CALL_BY_VALUE; } } ; call_returning: /* empty */ { $$ = NULL; } | RETURNING identifier { $$ = $2; } | GIVING identifier { $$ = $2; } ; call_on_exception: /* empty */ { $$ = NULL; } | exception_or_overflow { check_unreached = 0; } statement_list { $$ = $3; } ; call_not_on_exception: /* empty */ { $$ = NULL; } | not_exception_or_overflow { check_unreached = 0; } statement_list { $$ = $3; } ; end_call: /* empty */ { terminator_warning (TERM_CALL); } | END_CALL { terminator_clear (TERM_CALL); } ; /* * CANCEL statement */ cancel_statement: CANCEL { BEGIN_STATEMENT ("CANCEL", 0); } cancel_list ; cancel_list: | cancel_list id_or_lit { cb_emit_cancel ($2); } ; /* * CLOSE statement */ close_statement: CLOSE { BEGIN_STATEMENT ("CLOSE", 0); } close_list ; close_list: | close_list file_name close_option { BEGIN_IMPLICIT_STATEMENT (); if ($2 != cb_error_node) { cb_emit_close ($2, $3); } } ; close_option: /* empty */ { $$ = cb_int (COB_CLOSE_NORMAL); } | reel_or_unit { $$ = cb_int (COB_CLOSE_UNIT); } | reel_or_unit _for REMOVAL { $$ = cb_int (COB_CLOSE_UNIT_REMOVAL); } | _with NO REWIND { $$ = cb_int (COB_CLOSE_NO_REWIND); } | _with LOCK { $$ = cb_int (COB_CLOSE_LOCK); } ; reel_or_unit: REEL | UNIT ; /* * COMPUTE statement */ compute_statement: COMPUTE { BEGIN_STATEMENT ("COMPUTE", TERM_COMPUTE); } compute_body end_compute ; compute_body: arithmetic_x_list comp_equal expr on_size_error { cb_emit_arithmetic ($1, 0, $3); } ; end_compute: /* empty */ { terminator_warning (TERM_COMPUTE); } | END_COMPUTE { terminator_clear (TERM_COMPUTE); } ; comp_equal: '=' | EQUAL; /* * COMMIT statement */ commit_statement: COMMIT { BEGIN_STATEMENT ("COMMIT", 0); cb_emit_commit (); } ; /* * CONTINUE statement */ continue_statement: CONTINUE { BEGIN_STATEMENT ("CONTINUE", 0); cb_emit_continue (); } ; /* * DELETE statement */ delete_statement: DELETE { BEGIN_STATEMENT ("DELETE", TERM_DELETE); } file_name _record opt_invalid_key end_delete { if ($3 != cb_error_node) { cb_emit_delete ($3); } } ; end_delete: /* empty */ { terminator_warning (TERM_DELETE); } | END_DELETE { terminator_clear (TERM_DELETE); } ; /* * DISPLAY statement */ display_statement: DISPLAY { BEGIN_STATEMENT ("DISPLAY", TERM_DISPLAY); dispattrs = 0; fgc = NULL; bgc = NULL; scroll = NULL; } display_body end_display ; display_body: id_or_lit UPON_ENVIRONMENT_NAME on_disp_exception { cb_emit_env_name ($1); } | id_or_lit UPON_ENVIRONMENT_VALUE on_disp_exception { cb_emit_env_value ($1); } | id_or_lit UPON_ARGUMENT_NUMBER on_disp_exception { cb_emit_arg_number ($1); } | id_or_lit UPON_COMMAND_LINE on_disp_exception { cb_emit_command_line ($1); } | x_list opt_at_line_column display_upon with_clause on_disp_exception { cb_emit_display ($1, $3, $4, $2, fgc, bgc, scroll, dispattrs); } ; display_upon: /* empty */ { $$ = cb_int0; } | UPON mnemonic_name { $$ = cb_build_display_upon ($2); } | UPON WORD { $$ = cb_build_display_upon_direct ($2); } | UPON PRINTER { $$ = cb_int0; } | UPON CRT { $$ = cb_int0; } ; with_clause: /* empty */ { $$ = cb_int1; } | _with NO_ADVANCING { $$ = cb_int0; } | WITH disp_attrs { $$ = cb_int1; } ; disp_attrs: disp_attr | disp_attrs disp_attr ; disp_attr: BELL { dispattrs |= COB_SCREEN_BELL; } | BLINK { dispattrs |= COB_SCREEN_BLINK; } | ERASE EOL { dispattrs |= COB_SCREEN_ERASE_EOL; } | ERASE EOS { dispattrs |= COB_SCREEN_ERASE_EOS; } | HIGHLIGHT { dispattrs |= COB_SCREEN_HIGHLIGHT; } | LOWLIGHT { dispattrs |= COB_SCREEN_LOWLIGHT; } | REVERSE_VIDEO { dispattrs |= COB_SCREEN_REVERSE; } | UNDERLINE { dispattrs |= COB_SCREEN_UNDERLINE; } | OVERLINE { dispattrs |= COB_SCREEN_OVERLINE; } | FOREGROUND_COLOR _is num_id_or_lit { fgc = $3; } | BACKGROUND_COLOR _is num_id_or_lit { bgc = $3; } | SCROLL UP _opt_scroll_lines { scroll = $3; } | SCROLL DOWN _opt_scroll_lines { dispattrs |= COB_SCREEN_SCROLL_DOWN; scroll = $3; } | BLANK_LINE { dispattrs |= COB_SCREEN_BLANK_LINE; } | BLANK_SCREEN { dispattrs |= COB_SCREEN_BLANK_SCREEN; } ; end_display: /* empty */ { terminator_warning (TERM_DISPLAY); } | END_DISPLAY { terminator_clear (TERM_DISPLAY); } ; /* * DIVIDE statement */ divide_statement: DIVIDE { BEGIN_STATEMENT ("DIVIDE", TERM_DIVIDE); } divide_body end_divide ; divide_body: x INTO arithmetic_x_list on_size_error { cb_emit_arithmetic ($3, '/', $1); } | x INTO x GIVING arithmetic_x_list on_size_error { cb_emit_arithmetic ($5, 0, cb_build_binary_op ($3, '/', $1)); } | x BY x GIVING arithmetic_x_list on_size_error { cb_emit_arithmetic ($5, 0, cb_build_binary_op ($1, '/', $3)); } | x INTO x GIVING arithmetic_x REMAINDER arithmetic_x on_size_error { cb_emit_divide ($3, $1, $5, $7); } | x BY x GIVING arithmetic_x REMAINDER arithmetic_x on_size_error { cb_emit_divide ($1, $3, $5, $7); } ; end_divide: /* empty */ { terminator_warning (TERM_DIVIDE); } | END_DIVIDE { terminator_clear (TERM_DIVIDE); } ; /* * ENTRY statement */ entry_statement: ENTRY { BEGIN_STATEMENT ("ENTRY", 0); } LITERAL call_using { if (current_program->nested_level) { cb_error (_("ENTRY is invalid in nested program")); } else if (cb_verify (cb_entry_statement, "ENTRY")) { if (cobc_check_valid_name ((char *)(CB_LITERAL ($3)->data))) { cb_error (_("ENTRY '%s' invalid"), (char *)(CB_LITERAL ($3)->data)); } emit_entry ((char *)(CB_LITERAL ($3)->data), 1, $4); } check_unreached = 0; } ; /* * EVALUATE statement */ evaluate_statement: EVALUATE { BEGIN_STATEMENT ("EVALUATE", TERM_EVALUATE); eval_level++; for (eval_inc = 0; eval_inc < 64; eval_inc++) { eval_check[eval_level][eval_inc] = 0; } eval_inc = 0; eval_inc2 = 0; } evaluate_subject_list evaluate_condition_list end_evaluate { cb_emit_evaluate ($3, $4); eval_level--; } ; evaluate_subject_list: evaluate_subject { $$ = cb_list_init ($1); } | evaluate_subject_list ALSO evaluate_subject { $$ = cb_list_add ($1, $3); } ; evaluate_subject: expr { $$ = $1; if (CB_REFERENCE_P ($1)) { eval_check[eval_level][eval_inc++] = 0; } else { eval_check[eval_level][eval_inc++] = 1; } } | TOK_TRUE { $$ = cb_true; eval_check[eval_level][eval_inc++] = 2; } | TOK_FALSE { $$ = cb_false; eval_check[eval_level][eval_inc++] = 3; } ; evaluate_condition_list: evaluate_case_list evaluate_other { $$ = $1; if ($2) { $$ = cb_list_add ($$, $2); } } ; evaluate_case_list: evaluate_case { $$ = cb_list_init ($1); } | evaluate_case_list evaluate_case { $$ = cb_list_add ($1, $2); } ; evaluate_case: evaluate_when_list { check_unreached = 0; } statement_list { $$ = cb_cons ($3, $1); eval_inc2 = 0; } ; evaluate_other: /* Empty */ { $$ = NULL; } | WHEN OTHER { check_unreached = 0; } statement_list { $$ = cb_cons ($4, NULL); eval_inc2 = 0; } ; evaluate_when_list: WHEN evaluate_object_list { $$ = cb_list_init ($2); } | evaluate_when_list WHEN evaluate_object_list { $$ = cb_list_add ($1, $3); } ; evaluate_object_list: evaluate_object { $$ = cb_list_init ($1); } | evaluate_object_list ALSO evaluate_object { $$ = cb_list_add ($1, $3); } ; evaluate_object: partial_expr opt_evaluate_thru_expr { cb_tree not; cb_tree e1; cb_tree e2; not = cb_int0; e2 = $2; /* in case the first token is NOT */ if (CB_PURPOSE_INT ($1) == '!') { if (eval_check[eval_level][eval_inc2] < 2) { not = cb_int1; $1 = CB_CHAIN ($1); } } /* build expr now */ e1 = cb_build_expr ($1); if (e2 == NULL) { /* WHEN expr */ eval_inc2++; $$ = cb_build_pair (not, cb_build_pair (e1, NULL)); } else { /* WHEN expr THRU expr */ $$ = cb_build_pair (not, cb_build_pair (e1, e2)); eval_inc2++; } } | ANY { $$ = cb_any; eval_inc2++; } | TOK_TRUE { $$ = cb_true; eval_inc2++; } | TOK_FALSE { $$ = cb_false; eval_inc2++; } ; opt_evaluate_thru_expr: /* empty */ { $$ = NULL; } | THRU expr { $$ = $2; } ; end_evaluate: /* empty */ { terminator_warning (TERM_EVALUATE); } | END_EVALUATE { terminator_clear (TERM_EVALUATE); } ; /* * EXIT statement */ exit_statement: EXIT { BEGIN_STATEMENT ("EXIT", 0); } exit_body ; exit_body: /* empty */ { /* nothing */ } | PROGRAM { if (in_declaratives && use_global_ind) { cb_error (_("EXIT PROGRAM is not allowed within a USE GLOBAL procedure")); } check_unreached = 1; cb_emit_exit (0); } | PERFORM { struct cb_perform *p; char name[64]; if (!perform_stack) { cb_error (_("EXIT PERFORM is only valid with inline PERFORM")); } else { p = CB_PERFORM (CB_VALUE (perform_stack)); if (!p->exit_label) { sprintf (name, "EXIT PERFORM %d", cb_id); p->exit_label = cb_build_reference (name); CB_LABEL (cb_build_label (p->exit_label, NULL))->need_begin = 1; } cb_emit_goto (cb_list_init (p->exit_label), NULL); } } | PERFORM CYCLE { struct cb_perform *p; char name[64]; if (!perform_stack) { cb_error (_("EXIT PERFORM is only valid with inline PERFORM")); } else { p = CB_PERFORM (CB_VALUE (perform_stack)); if (!p->cycle_label) { sprintf (name, "EXIT PERFORM CYCLE %d", cb_id); p->cycle_label = cb_build_reference (name); CB_LABEL (cb_build_label (p->cycle_label, NULL))->need_begin = 1; } cb_emit_goto (cb_list_init (p->cycle_label), NULL); } } | SECTION { cb_tree plabel; char name[64]; if (!current_section) { cb_error (_("EXIT SECTION is only valid with an active SECTION")); } else { if (!current_section->exit_label) { sprintf (name, "EXIT SECTION %d", cb_id); plabel = cb_build_reference (name); current_section->exit_label = cb_build_label (plabel, NULL); current_section->exit_label_ref = plabel; CB_LABEL (current_section->exit_label)->need_begin = 1; } cb_emit_goto (cb_list_init (current_section->exit_label_ref), NULL); } } | PARAGRAPH { cb_tree plabel; char name[64]; if (!current_paragraph) { cb_error (_("EXIT PARAGRAPH is only valid with an active PARAGRAPH")); } else { if (!current_paragraph->exit_label) { sprintf (name, "EXIT PARAGRAPH %d", cb_id); plabel = cb_build_reference (name); current_paragraph->exit_label = cb_build_label (plabel, NULL); current_paragraph->exit_label_ref = plabel; CB_LABEL (current_paragraph->exit_label)->need_begin = 1; } cb_emit_goto (cb_list_init (current_paragraph->exit_label_ref), NULL); } } ; /* * FREE statement */ free_statement: FREE { BEGIN_STATEMENT ("FREE", 0); } target_x_list { cb_emit_free ($3) } ; /* * GENERATE statement */ generate_statement: GENERATE { BEGIN_STATEMENT ("GENERATE", 0); } identifier { PENDING("GENERATE"); } ; /* * GO TO statement */ goto_statement: GO _to { BEGIN_STATEMENT ("GO TO", 0); } procedure_name_list goto_depending { cb_emit_goto ($4, $5); } ; goto_depending: /* empty */ { check_unreached = 1; $$ = NULL; } | DEPENDING _on identifier { check_unreached = 0; $$ = $3; } ; /* * GOBACK statement */ goback_statement: GOBACK { BEGIN_STATEMENT ("GOBACK", 0); } { check_unreached = 1; cb_emit_exit (1); } ; /* * IF statement */ if_statement: IF { BEGIN_STATEMENT ("IF", TERM_IF); } condition _then { check_unreached = 0; } statement_list if_else_sentence end_if { cb_emit_if ($3, $6, $7); } | IF error END_IF ; if_else_sentence: /* empty */ { $$ = NULL; } | ELSE { check_unreached = 0; } statement_list { $$ = $3; } ; end_if: /* empty */ { terminator_warning (TERM_IF); } | END_IF { terminator_clear (TERM_IF); } ; /* * INITIALIZE statement */ initialize_statement: INITIALIZE { BEGIN_STATEMENT ("INITIALIZE", 0); } target_x_list initialize_filler initialize_value initialize_replacing initialize_default { cb_emit_initialize ($3, $4, $5, $6, $7); } ; initialize_filler: /* empty */ { $$ = NULL; } | _with FILLER { $$ = cb_true; } ; initialize_value: /* empty */ { $$ = NULL; } | ALL _to VALUE { $$ = cb_true; } | initialize_category _to VALUE { $$ = $1; } ; initialize_replacing: /* empty */ { $$ = NULL; } | REPLACING initialize_replacing_list { $$ = $2; } ; initialize_replacing_list: initialize_replacing_item { $$ = $1; } | initialize_replacing_list initialize_replacing_item { $$ = cb_list_append ($1, $2); } ; initialize_replacing_item: initialize_category _data BY x { $$ = cb_build_pair ($1, $4); } ; initialize_category: ALPHABETIC { $$ = cb_int (CB_CATEGORY_ALPHABETIC); } | ALPHANUMERIC { $$ = cb_int (CB_CATEGORY_ALPHANUMERIC); } | NUMERIC { $$ = cb_int (CB_CATEGORY_NUMERIC); } | ALPHANUMERIC_EDITED { $$ = cb_int (CB_CATEGORY_ALPHANUMERIC_EDITED); } | NUMERIC_EDITED { $$ = cb_int (CB_CATEGORY_NUMERIC_EDITED); } | NATIONAL { $$ = cb_int (CB_CATEGORY_NATIONAL); } | NATIONAL_EDITED { $$ = cb_int (CB_CATEGORY_NATIONAL_EDITED); } ; initialize_default: /* empty */ { $$ = NULL; } | DEFAULT { $$ = cb_true; } ; /* * INITIATE statement */ initiate_statement: INITIATE { BEGIN_STATEMENT ("INITIATE", 0); } identifier_list { PENDING("INITIATE"); } ; /* * INSPECT statement */ inspect_statement: INSPECT { BEGIN_STATEMENT ("INSPECT", 0); sending_id = 0; inspect_keyword = 0; } send_identifier inspect_list ; send_identifier: identifier { save_tree_1 = $1; sending_id = 0; } | literal { save_tree_1 = $1; sending_id = 1; } | function { save_tree_1 = $1; sending_id = 1; } ; inspect_list: inspect_item | inspect_list inspect_item ; inspect_item: inspect_tallying { cb_emit_inspect (save_tree_1, $1, cb_int0, 0); } | inspect_replacing { cb_emit_inspect (save_tree_1, $1, cb_int1, 1); } | inspect_converting { cb_emit_inspect (save_tree_1, $1, cb_int0, 2); } ; /* INSPECT TALLYING */ inspect_tallying: TALLYING { cb_init_tarrying (); } tallying_list { $$ = $3; } ; tallying_list: tallying_item { $$ = $1; } | tallying_list tallying_item { $$ = cb_list_append ($1, $2); } ; tallying_item: simple_value FOR { $$ = cb_build_tarrying_data ($1); } | CHARACTERS inspect_region { $$ = cb_build_tarrying_characters ($2); } | ALL { $$ = cb_build_tarrying_all (); } | LEADING { $$ = cb_build_tarrying_leading (); } | TRAILING { $$ = cb_build_tarrying_trailing (); } | simple_value inspect_region { $$ = cb_build_tarrying_value ($1, $2); } ; /* INSPECT REPLACING */ inspect_replacing: REPLACING replacing_list { $$ = $2; inspect_keyword = 0; } ; replacing_list: replacing_item { $$ = $1; } | replacing_list replacing_item { $$ = cb_list_append ($1, $2); } ; replacing_item: CHARACTERS BY simple_value inspect_region { $$ = cb_build_replacing_characters ($3, $4); inspect_keyword = 0; } | rep_keyword replacing_region { $$ = $2; } ; rep_keyword: /* empty */ { /* Nothing */ } | ALL { inspect_keyword = 1; } | LEADING { inspect_keyword = 2; } | FIRST { inspect_keyword = 3; } | TRAILING { inspect_keyword = 4; } ; replacing_region: simple_value BY simple_all_value inspect_region { switch (inspect_keyword) { case 1: $$ = cb_build_replacing_all ($1, $3, $4); break; case 2: $$ = cb_build_replacing_leading ($1, $3, $4); break; case 3: $$ = cb_build_replacing_first ($1, $3, $4); break; case 4: $$ = cb_build_replacing_trailing ($1, $3, $4); break; default: cb_error (_("INSPECT missing a keyword")); $$ = cb_error_node; break; } } ; /* INSPECT CONVERTING */ inspect_converting: CONVERTING simple_value TO simple_all_value inspect_region { $$ = cb_build_converting ($2, $4, $5); } ; /* INSPECT BEFORE/AFTER */ inspect_region: /* empty */ { $$ = cb_build_inspect_region_start (); } | inspect_region before_or_after _initial x { $$ = cb_build_inspect_region ($1, $2, $4); } ; _initial: | TOK_INITIAL ; /* * MERGE statement */ merge_statement: MERGE { BEGIN_STATEMENT ("MERGE", 0); } sort_body ; /* * MOVE statement */ move_statement: MOVE { BEGIN_STATEMENT ("MOVE", 0); } move_body ; move_body: x TO target_x_list { cb_emit_move ($1, $3); } | CORRESPONDING x TO target_x_list { cb_emit_move_corresponding ($2, $4); } ; /* * MULTIPLY statement */ multiply_statement: MULTIPLY { BEGIN_STATEMENT ("MULTIPLY", TERM_MULTIPLY); } multiply_body end_multiply ; multiply_body: x BY arithmetic_x_list on_size_error { cb_emit_arithmetic ($3, '*', $1); } | x BY x GIVING arithmetic_x_list on_size_error { cb_emit_arithmetic ($5, 0, cb_build_binary_op ($1, '*', $3)); } ; end_multiply: /* empty */ { terminator_warning (TERM_MULTIPLY); } | END_MULTIPLY { terminator_clear (TERM_MULTIPLY); } ; /* * OPEN statement */ open_statement: OPEN { BEGIN_STATEMENT ("OPEN", 0); } open_list ; open_list: | open_list open_mode open_sharing file_name_list open_option { cb_tree l; for (l = $4; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { BEGIN_IMPLICIT_STATEMENT (); cb_emit_open (CB_VALUE (l), $2, $3); } } } ; open_mode: INPUT { $$ = cb_int (COB_OPEN_INPUT); } | OUTPUT { $$ = cb_int (COB_OPEN_OUTPUT); } | I_O { $$ = cb_int (COB_OPEN_I_O); } | EXTEND { $$ = cb_int (COB_OPEN_EXTEND); } ; open_sharing: /* empty */ { $$ = NULL; } | SHARING _with sharing_option { $$ = $3; } ; open_option: /* empty */ { $$ = NULL; } | _with NO REWIND { $$ = NULL; } | _with LOCK { PENDING ("OPEN ... WITH LOCK"); } /* | _with LOCK { $$ = cb_int1; } */ ; /* * PERFORM statement */ perform_statement: PERFORM { BEGIN_STATEMENT ("PERFORM", TERM_PERFORM); } perform_body ; perform_body: perform_procedure perform_option { cb_emit_perform ($2, $1); } | perform_option { perform_stack = cb_cons ($1, perform_stack); check_unreached = 0; } statement_list end_perform { perform_stack = CB_CHAIN (perform_stack); cb_emit_perform ($1, $3); } | perform_option END_PERFORM { cb_emit_perform ($1, NULL); } ; end_perform: /* empty */ { terminator_error (); } | END_PERFORM { terminator_clear (TERM_PERFORM); } ; perform_procedure: procedure_name { CB_REFERENCE ($1)->length = cb_true; /* return from $1 */ $$ = cb_build_pair ($1, $1); } | procedure_name THRU procedure_name { CB_REFERENCE ($3)->length = cb_true; /* return from $3 */ $$ = cb_build_pair ($1, $3); } ; perform_option: /* empty */ { $$ = cb_build_perform_once (NULL); } | FOREVER { $$ = cb_build_perform_forever (NULL); } | id_or_lit_or_func TIMES { $$ = cb_build_perform_times ($1); current_program->loop_counter++; } | perform_test UNTIL condition { cb_tree varying; varying = cb_list_init (cb_build_perform_varying (NULL, NULL, NULL, $3)); $$ = cb_build_perform_until ($1, varying); } | perform_test VARYING perform_varying_list { $$ = cb_build_perform_until ($1, $3); } ; perform_test: /* empty */ { $$ = CB_BEFORE; } | _with TEST before_or_after { $$ = $3; } ; perform_varying_list: perform_varying { $$ = cb_list_init ($1); } | perform_varying_list AFTER perform_varying { $$ = cb_list_add ($1, $3); } ; perform_varying: identifier FROM x BY x UNTIL condition { $$ = cb_build_perform_varying ($1, $3, $5, $7); } ; /* * READ statements */ read_statement: READ { BEGIN_STATEMENT ("READ", TERM_READ); } file_name flag_next _record read_into with_lock read_key read_handler end_read { if ($3 != cb_error_node) { if ($7 && (CB_FILE(cb_ref ($3))->lock_mode & COB_LOCK_AUTOMATIC)) { cb_error (_("LOCK clause invalid with file LOCK AUTOMATIC")); } else if ($8 && (CB_FILE(cb_ref ($3))->organization != COB_ORG_RELATIVE && CB_FILE(cb_ref ($3))->organization != COB_ORG_INDEXED)) { cb_error (_("KEY clause invalid with this file type")); } else if (current_statement->handler_id == COB_EC_I_O_INVALID_KEY && (CB_FILE(cb_ref ($3))->organization != COB_ORG_RELATIVE && CB_FILE(cb_ref ($3))->organization != COB_ORG_INDEXED)) { cb_error (_("INVALID KEY clause invalid with this file type")); } else { cb_emit_read ($3, $4, $6, $8, $7); } } } ; read_into: /* empty */ { $$ = NULL; } | INTO identifier { $$ = $2; } ; with_lock: /* empty */ { $$ = NULL; } | IGNORING LOCK { $$ = cb_int3; } | _with LOCK { $$ = cb_int1; } | _with NO LOCK { $$ = cb_int2; } | _with IGNORE LOCK { $$ = cb_int3; } | _with WAIT { $$ = cb_int4; } ; read_key: /* empty */ { $$ = NULL; } | KEY _is identifier { $$ = $3; } ; read_handler: | at_end | invalid_key ; end_read: /* empty */ { terminator_warning (TERM_READ); } | END_READ { terminator_clear (TERM_READ); } ; /* * RELEASE statement */ release_statement: RELEASE { BEGIN_STATEMENT ("RELEASE", 0); } record_name write_from { if ($3 != cb_error_node) { cb_emit_release ($3, $4); } } ; /* * RETURN statement */ return_statement: RETURN { BEGIN_STATEMENT ("RETURN", TERM_RETURN); } file_name _record read_into at_end end_return { if ($3 != cb_error_node) { cb_emit_return ($3, $5); } } ; end_return: /* empty */ { terminator_warning (TERM_RETURN); } | END_RETURN { terminator_clear (TERM_RETURN); } ; /* * REWRITE statement */ rewrite_statement: REWRITE { BEGIN_STATEMENT ("REWRITE", TERM_REWRITE); } record_name write_from write_lock opt_invalid_key end_rewrite { if ($3 != cb_error_node) { cb_emit_rewrite ($3, $4, $5); } } ; write_lock: /* empty */ { $$ = NULL; } | _with LOCK { $$ = cb_int1; } | _with NO LOCK { $$ = cb_int2; } ; end_rewrite: /* empty */ { terminator_warning (TERM_REWRITE); } | END_REWRITE { terminator_clear (TERM_REWRITE); } ; /* * ROLLBACK statement */ rollback_statement: ROLLBACK { BEGIN_STATEMENT ("ROLLBACK", 0); cb_emit_rollback (); } ; /* * SEARCH statement */ search_statement: SEARCH { BEGIN_STATEMENT ("SEARCH", TERM_SEARCH); } search_body end_search ; search_body: table_name search_varying search_at_end search_whens { cb_emit_search ($1, $2, $3, $4); } | ALL table_name search_at_end WHEN expr { check_unreached = 0; } statement_list { cb_emit_search_all ($2, $3, $5, $7); } ; search_varying: /* empty */ { $$ = NULL; } | VARYING identifier { $$ = $2; } ; search_at_end: /* empty */ { $$ = NULL; } | _at END { check_unreached = 0; } statement_list { $$ = $4; } ; search_whens: search_when { $$ = $1; } | search_when search_whens { $$ = $1; CB_IF ($1)->stmt2 = $2; } ; search_when: WHEN condition { check_unreached = 0; } statement_list { $$ = cb_build_if ($2, $4, NULL); } ; end_search: /* empty */ { terminator_warning (TERM_SEARCH); } | END_SEARCH { terminator_clear (TERM_SEARCH); } ; /* * SET statement */ set_statement: SET { BEGIN_STATEMENT ("SET", 0); } set_body ; set_body: set_environment | set_to | set_up_down | set_to_on_off_sequence | set_to_true_false_sequence ; /* SET ENVIRONMENT ... TO ... */ set_environment: ENVIRONMENT simple_value TO simple_value { cb_emit_setenv ($2, $4); } ; /* SET name ... TO expr */ set_to: target_x_list TO ENTRY alnum_or_id { cb_emit_set_to ($1, cb_build_ppointer ($4)); } | target_x_list TO x { cb_emit_set_to ($1, $3); } ; /* SET name ... UP/DOWN BY expr */ set_up_down: target_x_list up_or_down BY x { cb_emit_set_up_down ($1, $2, $4); } ; up_or_down: UP { $$ = cb_int0; } | DOWN { $$ = cb_int1; } ; /* SET mnemonic-name-1 ... TO ON/OFF */ set_to_on_off_sequence: set_to_on_off | set_to_on_off_sequence set_to_on_off ; set_to_on_off: mnemonic_name_list TO on_or_off { cb_emit_set_on_off ($1, $3); } ; /* SET condition-name-1 ... TO TRUE/FALSE */ set_to_true_false_sequence: set_to_true_false | set_to_true_false_sequence set_to_true_false ; set_to_true_false: target_x_list TO TOK_TRUE { cb_emit_set_true ($1); } | target_x_list TO TOK_FALSE { cb_emit_set_false ($1); } ; /* * SORT statement */ sort_statement: SORT { BEGIN_STATEMENT ("SORT", 0); } sort_body ; sort_body: qualified_word sort_key_list sort_duplicates sort_collating { cb_emit_sort_init ($1, $2, $4); if (CB_FILE_P (cb_ref ($1)) && $2 == NULL) { cb_error (_("File sort requires KEY phrase")); } /* used in sort_input/sort_output */ save_tree_1 = $1; } sort_input sort_output { cb_emit_sort_finish ($1); } ; sort_key_list: /* empty */ { $$ = NULL; } | sort_key_list _on ascending_or_descending _key opt_key_list { cb_tree l; if ($5 == NULL) { $5 = cb_list_init (NULL); } for (l = $5; l; l = CB_CHAIN (l)) { CB_PURPOSE (l) = $3; } $$ = cb_list_append ($1, $5); } ; opt_key_list: /* empty */ { $$ = NULL; } | opt_key_list qualified_word { $$ = cb_list_add ($1, $2); } ; sort_duplicates: | with_dups _in_order { /* nothing */ } ; sort_collating: /* empty */ { $$ = cb_null; } | coll_sequence _is reference { $$ = cb_ref ($3); } ; sort_input: /* empty */ { if (CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("File sort requires USING or INPUT PROCEDURE")); } } | USING file_name_list { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("USING invalid with table SORT")); } else { cb_emit_sort_using (save_tree_1, $2); } } | INPUT PROCEDURE _is perform_procedure { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("INPUT PROCEDURE invalid with table SORT")); } else { cb_emit_sort_input ($4); } } ; sort_output: /* empty */ { if (CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("File sort requires GIVING or OUTPUT PROCEDURE")); } } | GIVING file_name_list { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("GIVING invalid with table SORT")); } else { cb_emit_sort_giving (save_tree_1, $2); } } | OUTPUT PROCEDURE _is perform_procedure { if (!CB_FILE_P (cb_ref (save_tree_1))) { cb_error (_("OUTPUT PROCEDURE invalid with table SORT")); } else { cb_emit_sort_output ($4); } } ; /* * START statement */ start_statement: START { BEGIN_STATEMENT ("START", TERM_START); } file_name { $$ = cb_int (COB_EQ); } start_key opt_invalid_key end_start { if (CB_FILE_P (cb_ref ($3))) { if (CB_FILE (cb_ref ($3))->organization != COB_ORG_INDEXED && CB_FILE (cb_ref ($3))->organization != COB_ORG_RELATIVE) { cb_error (_("START not allowed on SEQUENTIAL files")); $$ = cb_error_node; } else { cb_emit_start ($3, $4, $5); } } else { cb_error_x ($3, _("'%s' is not a file name"), CB_NAME ($3)); $$ = cb_error_node; } } ; start_key: /* empty */ { $$ = NULL; } | KEY _is start_op x { $0 = $3; $$ = $4; } ; start_op: flag_not eq { $$ = cb_int (($1 == cb_int1) ? COB_NE : COB_EQ); } | flag_not gt { $$ = cb_int (($1 == cb_int1) ? COB_LE : COB_GT); } | flag_not lt { $$ = cb_int (($1 == cb_int1) ? COB_GE : COB_LT); } | flag_not ge { $$ = cb_int (($1 == cb_int1) ? COB_LT : COB_GE); } | flag_not le { $$ = cb_int (($1 == cb_int1) ? COB_GT : COB_LE); } ; end_start: /* empty */ { terminator_warning (TERM_START); } | END_START { terminator_clear (TERM_START); } ; /* * STOP statement */ stop_statement: STOP RUN { BEGIN_STATEMENT ("STOP", 0); } stop_returning { cb_emit_stop_run ($4); } | STOP LITERAL { cb_verify (cb_stop_literal_statement, "STOP literal"); } ; stop_returning: /* empty */ { $$ = current_program->cb_return_code; } | RETURNING x { $$ = $2; } | GIVING x { $$ = $2; } ; /* * STRING statement */ string_statement: STRING { BEGIN_STATEMENT ("STRING", TERM_STRING); } string_item_list INTO identifier opt_with_pointer on_overflow end_string { cb_emit_string ($3, $5, $6); } ; string_item_list: string_item { $$ = cb_list_init ($1); } | string_item_list string_item { $$ = cb_list_add ($1, $2); } ; string_item: x { $$ = $1; } | DELIMITED _by SIZE { $$ = cb_build_pair (cb_int0, NULL); } | DELIMITED _by x { $$ = cb_build_pair ($3, NULL); } ; opt_with_pointer: /* empty */ { $$ = cb_int0; } | _with POINTER identifier { $$ = $3; } ; end_string: /* empty */ { terminator_warning (TERM_STRING); } | END_STRING { terminator_clear (TERM_STRING); } ; /* * SUBTRACT statement */ subtract_statement: SUBTRACT { BEGIN_STATEMENT ("SUBTRACT", TERM_SUBTRACT); } subtract_body end_subtract ; subtract_body: x_list FROM arithmetic_x_list on_size_error { cb_emit_arithmetic ($3, '-', cb_build_binary_list ($1, '+')); } | x_list FROM x GIVING arithmetic_x_list on_size_error { cb_emit_arithmetic ($5, 0, cb_build_binary_list (cb_cons ($3, $1), '-')); } | CORRESPONDING identifier FROM identifier flag_rounded on_size_error { cb_emit_corresponding (cb_build_sub, $4, $2, $5); } ; end_subtract: /* empty */ { terminator_warning (TERM_SUBTRACT); } | END_SUBTRACT { terminator_clear (TERM_SUBTRACT); } ; /* * SUPPRESS statement */ suppress_statement: SUPPRESS _printing { BEGIN_STATEMENT ("SUPPRESS", 0); PENDING("SUPPRESS"); } ; _printing: | PRINTING ; /* * TERMINATE statement */ terminate_statement: TERMINATE { BEGIN_STATEMENT ("TERMINATE", 0); } identifier_list { PENDING("TERMINATE"); } ; /* * TRANSFORM statement */ transform_statement: TRANSFORM { BEGIN_STATEMENT ("TRANSFORM", 0); } identifier FROM simple_value TO simple_all_value { cb_tree x; x = cb_build_converting ($5, $7, cb_build_inspect_region_start ()); cb_emit_inspect ($3, x, cb_int0, 2); } ; /* * UNLOCK statement */ unlock_statement: UNLOCK { BEGIN_STATEMENT ("UNLOCK", 0); } file_name opt_record { if ($3 != cb_error_node) { cb_emit_unlock ($3); } } ; opt_record: /* empty */ | RECORD | RECORDS ; /* * UNSTRING statement */ unstring_statement: UNSTRING { BEGIN_STATEMENT ("UNSTRING", TERM_UNSTRING); } identifier unstring_delimited unstring_into opt_with_pointer unstring_tallying on_overflow end_unstring { cb_emit_unstring ($3, $4, $5, $6, $7); } ; unstring_delimited: /* empty */ { $$ = NULL; } | DELIMITED _by unstring_delimited_list { $$ = $3; } ; unstring_delimited_list: unstring_delimited_item { $$ = cb_list_init ($1); } | unstring_delimited_list OR unstring_delimited_item { $$ = cb_list_add ($1, $3); } ; unstring_delimited_item: flag_all simple_value { $$ = cb_build_unstring_delimited ($1, $2); } ; unstring_into: INTO unstring_into_item { $$ = cb_list_init ($2); } | unstring_into unstring_into_item { $$ = cb_list_add ($1, $2); } ; unstring_into_item: identifier unstring_into_delimiter unstring_into_count { $$ = cb_build_unstring_into ($1, $2, $3); } ; unstring_into_delimiter: /* empty */ { $$ = NULL; } | DELIMITER _in identifier { $$ = $3; } ; unstring_into_count: /* empty */ { $$ = NULL; } | COUNT _in identifier { $$ = $3; } ; unstring_tallying: /* empty */ { $$ = NULL; } | TALLYING _in identifier { $$ = $3; } ; end_unstring: /* empty */ { terminator_warning (TERM_UNSTRING); } | END_UNSTRING { terminator_clear (TERM_UNSTRING); } ; /* * USE statement */ use_statement: use_exception | use_debugging | use_reporting ; use_exception: USE use_global _after _standard exception_or_error _procedure _on use_exception_target { if (!in_declaratives) { cb_error (_("USE statement must be within DECLARATIVES")); } else if (!current_section) { cb_error (_("SECTION header missing before USE statement")); } else { current_section->need_begin = 1; current_section->need_return = 1; CB_EXCEPTION_ENABLE (COB_EC_I_O) = 1; if (use_global_ind) { current_section->is_global = 1; current_program->global_list = cb_list_add (current_program->global_list, CB_TREE (current_section)); } } } ; use_global: /* empty */ { use_global_ind = 0; } | GLOBAL { use_global_ind = 1; current_program->flag_global_use = 1; } ; use_exception_target: file_name_list { cb_tree l; for (l = $1; l; l = CB_CHAIN (l)) { if (CB_VALUE (l) != cb_error_node) { setup_use_file (CB_FILE (cb_ref (CB_VALUE (l)))); } } } | INPUT { current_program->global_handler[COB_OPEN_INPUT].handler_label = current_section; current_program->global_handler[COB_OPEN_INPUT].handler_prog = current_program; } | OUTPUT { current_program->global_handler[COB_OPEN_OUTPUT].handler_label = current_section; current_program->global_handler[COB_OPEN_OUTPUT].handler_prog = current_program; } | I_O { current_program->global_handler[COB_OPEN_I_O].handler_label = current_section; current_program->global_handler[COB_OPEN_I_O].handler_prog = current_program; } | EXTEND { current_program->global_handler[COB_OPEN_EXTEND].handler_label = current_section; current_program->global_handler[COB_OPEN_EXTEND].handler_prog = current_program; } ; _after: | AFTER ; _standard: | STANDARD ; exception_or_error: EXCEPTION | ERROR ; exception_or_overflow: EXCEPTION | OVERFLOW ; not_exception_or_overflow: NOT_EXCEPTION | NOT_OVERFLOW ; _procedure: | PROCEDURE ; use_debugging: USE _for DEBUGGING _on use_debugging_target { PENDING ("USE FOR DEBUGGING"); } ; use_debugging_target: procedure_name | ALL PROCEDURES ; use_reporting: USE use_global BEFORE REPORTING identifier { PENDING ("USE BEFORE REPORTING"); } ; /* * WRITE statement */ write_statement: WRITE { BEGIN_STATEMENT ("WRITE", TERM_WRITE); } record_name write_from write_lock write_option write_handler end_write { if ($3 != cb_error_node) { cb_emit_write ($3, $4, $6, $5); } } ; write_from: /* empty */ { $$ = NULL; } | FROM id_or_lit { $$ = $2; } ; write_option: /* empty */ { $$ = cb_int0; } | before_or_after _advancing num_id_or_lit _line_or_lines { $$ = cb_build_write_advancing_lines ($1, $3); } | before_or_after _advancing mnemonic_name { $$ = cb_build_write_advancing_mnemonic ($1, $3); } | before_or_after _advancing PAGE { $$ = cb_build_write_advancing_page ($1); } ; before_or_after: BEFORE { $$ = CB_BEFORE; } | AFTER { $$ = CB_AFTER; } ; write_handler: | at_eop | invalid_key ; end_write: /* empty */ { terminator_warning (TERM_WRITE); } | END_WRITE { terminator_clear (TERM_WRITE); } ; /******************* * Status handlers *******************/ /* * ON EXCEPTION */ on_accp_exception: opt_on_exception opt_not_on_exception { current_statement->handler_id = COB_EC_IMP_ACCEPT; } ; on_disp_exception: opt_on_exception opt_not_on_exception { current_statement->handler_id = COB_EC_IMP_DISPLAY; } ; opt_on_exception: | EXCEPTION { check_unreached = 0; } statement_list { current_statement->handler1 = $3; } ; opt_not_on_exception: | NOT_EXCEPTION { check_unreached = 0; } statement_list { current_statement->handler2 = $3; } ; /* * ON SIZE ERROR */ on_size_error: opt_on_size_error opt_not_on_size_error { current_statement->handler_id = COB_EC_SIZE; } ; opt_on_size_error: | SIZE_ERROR { check_unreached = 0; } statement_list { current_statement->handler1 = $3; } ; opt_not_on_size_error: | NOT_SIZE_ERROR { check_unreached = 0; } statement_list { current_statement->handler2 = $3; } ; /* * ON OVERFLOW */ on_overflow: opt_on_overflow opt_not_on_overflow { current_statement->handler_id = COB_EC_OVERFLOW; } ; opt_on_overflow: | OVERFLOW { check_unreached = 0; } statement_list { current_statement->handler1 = $3; } ; opt_not_on_overflow: | NOT_OVERFLOW { check_unreached = 0; } statement_list { current_statement->handler2 = $3; } ; /* * AT END */ at_end: at_end_sentence { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler1 = $1; } | not_at_end_sentence { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler2 = $1; } | at_end_sentence not_at_end_sentence { current_statement->handler_id = COB_EC_I_O_AT_END; current_statement->handler1 = $1; current_statement->handler2 = $2; } ; at_end_sentence: END { check_unreached = 0; } statement_list { $$ = $3; } ; not_at_end_sentence: NOT_END { check_unreached = 0; } statement_list { $$ = $3; } ; /* * AT EOP */ at_eop: at_eop_sentence { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler1 = $1; } | not_at_eop_sentence { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler2 = $1; } | at_eop_sentence not_at_eop_sentence { current_statement->handler_id = COB_EC_I_O_EOP; current_statement->handler1 = $1; current_statement->handler2 = $2; } ; at_eop_sentence: EOP { check_unreached = 0; } statement_list { $$ = $3; } ; not_at_eop_sentence: NOT_EOP { check_unreached = 0; } statement_list { $$ = $3; } ; /* * INVALID KEY */ opt_invalid_key: | invalid_key ; invalid_key: invalid_key_sentence { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler1 = $1; } | not_invalid_key_sentence { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler2 = $1; } | invalid_key_sentence not_invalid_key_sentence { current_statement->handler_id = COB_EC_I_O_INVALID_KEY; current_statement->handler1 = $1; current_statement->handler2 = $2; } ; invalid_key_sentence: INVALID_KEY { check_unreached = 0; } statement_list { $$ = $3; } ; not_invalid_key_sentence: NOT_INVALID_KEY { check_unreached = 0; } statement_list { $$ = $3; } ; /***************************************************************************** * Common Constructs *****************************************************************************/ _opt_scroll_lines: /* empty */ { $$ = cb_one; } | _by num_id_or_lit _line_or_lines { $$ = $2; } ; /******************* * Expressions *******************/ condition: expr { $$ = cb_build_cond ($1); } ; expr: partial_expr { $$ = cb_build_expr ($1); } ; partial_expr: { current_expr = NULL; } expr_tokens { $$ = cb_list_reverse (current_expr); } ; expr_tokens: expr_token | expr_tokens IS | expr_tokens expr_token ; expr_token: x { push_expr ('x', $1); } /* parenthesis */ | '(' { push_expr ('(', NULL); } | ')' { push_expr (')', NULL); } /* arithmetic operators */ | '+' { push_expr ('+', NULL); } | '-' { push_expr ('-', NULL); } | '*' { push_expr ('*', NULL); } | '/' { push_expr ('/', NULL); } | '^' { push_expr ('^', NULL); } /* conditional operators */ | eq { push_expr ('=', NULL); } | gt { push_expr ('>', NULL); } | lt { push_expr ('<', NULL); } | GE { push_expr (']', NULL); } | LE { push_expr ('[', NULL); } | NE { push_expr ('~', NULL); } /* logical operators */ | NOT { push_expr ('!', NULL); } | AND { push_expr ('&', NULL); } | OR { push_expr ('|', NULL); } /* class condition */ | OMITTED { push_expr ('O', NULL); } | NUMERIC { push_expr ('9', NULL); } | ALPHABETIC { push_expr ('A', NULL); } | ALPHABETIC_LOWER { push_expr ('L', NULL); } | ALPHABETIC_UPPER { push_expr ('U', NULL); } /* sign condition */ /* ZERO is defined in 'x' */ | POSITIVE { push_expr ('P', NULL); } | NEGATIVE { push_expr ('N', NULL); } ; eq: '=' | EQUAL _to | EQUALS; gt: '>' | GREATER _than ; lt: '<' | LESS _than ; ge: GE | GREATER _than OR EQUAL _to ; le: LE | LESS _than OR EQUAL _to ; /* Arithmetic expression */ exp_list: exp { $$ = cb_list_init ($1); } | exp_list e_sep exp { $$ = cb_list_add ($1, $3); } ; e_sep: | COMMA_DELIM | SEMI_COLON ; exp: arith_x { $$ = $1; } | exp '+' exp { $$ = cb_build_binary_op ($1, '+', $3); } | exp '-' exp { $$ = cb_build_binary_op ($1, '-', $3); } | exp '*' exp { $$ = cb_build_binary_op ($1, '*', $3); } | exp '/' exp { $$ = cb_build_binary_op ($1, '/', $3); } | '+' exp %prec UNARY_SIGN { $$ = $2; } | '-' exp %prec UNARY_SIGN { $$ = cb_build_binary_op (cb_zero, '-', $2); } | exp '^' exp { $$ = cb_build_binary_op ($1, '^', $3); } | '(' exp ')' { $$ = $2; } ; /******************* * Names *******************/ /* LINAGE-COUNTER */ linage_counter: LINAGE_COUNTER { if (current_linage > 1) { cb_error (_("LINAGE-COUNTER must be qualified here")); $$ = cb_error_node; } else if (current_linage == 0) { cb_error (_("Invalid LINAGE-COUNTER usage")); $$ = cb_error_node; } else { $$ = linage_file->linage_ctr; } } | LINAGE_COUNTER in_of WORD { if (CB_FILE_P (cb_ref ($3))) { $$ = CB_FILE (cb_ref ($3))->linage_ctr; } else { cb_error_x ($3, _("'%s' is not a file name"), CB_NAME ($3)); $$ = cb_error_node; } } ; /* Data name */ arithmetic_x_list: arithmetic_x { $$ = $1; } | arithmetic_x_list arithmetic_x { $$ = cb_list_append ($1, $2); } ; arithmetic_x: x flag_rounded { $$ = cb_build_pair ($2, $1); } ; /* Record name */ record_name: qualified_word { cb_build_identifier ($1); } ; /* Table name */ table_name: qualified_word { cb_tree x; x = cb_ref ($1); if (!CB_FIELD_P (x)) { $$ = cb_error_node; } else if (!CB_FIELD (x)->index_list) { cb_error_x ($1, _("'%s' not indexed"), cb_name ($1)); cb_error_x (x, _("'%s' defined here"), cb_name (x)); $$ = cb_error_node; } else { $$ = $1; } } ; /* File name */ file_name_list: file_name { $$ = cb_list_init ($1); } | file_name_list file_name { cb_tree l; if ($2 != cb_error_node) { for (l = $1; l; l = CB_CHAIN (l)) { if (!strcasecmp (CB_NAME ($2), CB_NAME (CB_VALUE (l)))) { cb_error_x ($2, _("Multiple reference to '%s' "), CB_NAME ($2)); } } $$ = cb_list_add ($1, $2); } } ; file_name: WORD { if (CB_FILE_P (cb_ref ($1))) { $$ = $1; } else { cb_error_x ($1, _("'%s' is not a file name"), CB_NAME ($1)); $$ = cb_error_node; } } ; /* Mnemonic name */ mnemonic_name_list: mnemonic_name { $$ = cb_list_init ($1); } | mnemonic_name_list mnemonic_name { $$ = cb_list_add ($1, $2); } ; mnemonic_name: MNEMONIC_NAME { $$ = $1; } ; /* Procedure name */ procedure_name_list: /* empty */ { $$ = NULL; } | procedure_name_list procedure_name { $$ = cb_list_add ($1, $2); } ; procedure_name: label { $$ = $1; CB_REFERENCE ($$)->offset = CB_TREE (current_section); current_program->label_list = cb_cons ($$, current_program->label_list); } ; label: qualified_word | integer_label | integer_label in_of integer_label ; integer_label: LITERAL { $$ = cb_build_reference ((char *)(CB_LITERAL ($1)->data)); $$->source_file = $1->source_file; $$->source_line = $1->source_line; } ; /* Reference */ reference_list: reference { $$ = cb_list_init ($1); } | reference_list reference { $$ = cb_list_add ($1, $2); } ; reference: qualified_word { $$ = $1; current_program->reference_list = cb_cons ($$, current_program->reference_list); } ; opt_reference: /* empty */ { $$ = NULL; } | reference { $$ = $1; } ; reference_or_literal: reference | LITERAL ; /* Undefined word */ undefined_word: WORD { $$ = $1; if (CB_REFERENCE ($$)->word->count > 0) { redefinition_error ($$); $$ = cb_error_node; } } ; /******************* * Primitive elements *******************/ /* * Primitive value */ target_x_list: target_x { $$ = cb_list_init ($1); } | target_x_list target_x { $$ = cb_list_add ($1, $2); } ; target_x: identifier | ADDRESS _of identifier_1 { $$ = cb_build_address ($3); } ; x_list: x { $$ = cb_list_init ($1); } | x_list x { $$ = cb_list_add ($1, $2); } ; x: identifier | LENGTH _of identifier_1 { $$ = cb_build_length ($3); } | LENGTH _of basic_literal { $$ = cb_build_length ($3); } | LENGTH _of function { $$ = cb_build_length ($3); } | ADDRESS _of prog_or_entry alnum_or_id { $$ = cb_build_ppointer ($4); } | ADDRESS _of identifier_1 { $$ = cb_build_address ($3); } | literal | function | linage_counter ; arith_x: identifier | LENGTH _of identifier_1 { $$ = cb_build_length ($3); } | LENGTH _of basic_literal { $$ = cb_build_length ($3); } | LENGTH _of function { $$ = cb_build_length ($3); } | basic_literal | function | linage_counter ; prog_or_entry: PROGRAM | ENTRY ; alnum_or_id: identifier_1 { $$ = $1; } | LITERAL { $$ = $1; } ; simple_value: identifier | basic_literal ; simple_all_value: identifier | literal ; /* numeric_value: identifier | integer ; */ id_or_lit: identifier | LITERAL ; id_or_lit_or_func: identifier | LITERAL | function ; num_id_or_lit: identifier | integer | ZERO { $$ = cb_zero; } ; /* * Identifier */ identifier: identifier_1 { $$ = cb_build_identifier ($1); } ; identifier_1: qualified_word { $$ = $1; } | qualified_word subref { $$ = $1; } | qualified_word refmod { $$ = $1; } | qualified_word subref refmod { $$ = $1; } ; qualified_word: WORD { $$ = $1; } | WORD in_of qualified_word { $$ = $1; CB_REFERENCE ($1)->chain = $3; } ; subref: '(' exp_list ')' { $$ = $0; CB_REFERENCE ($0)->subs = cb_list_reverse ($2); } ; refmod: '(' exp ':' ')' { CB_REFERENCE ($0)->offset = $2; } | '(' exp ':' exp ')' { CB_REFERENCE ($0)->offset = $2; CB_REFERENCE ($0)->length = $4; } ; /* * Literal */ integer: LITERAL { if (cb_tree_category ($1) != CB_CATEGORY_NUMERIC) { cb_error (_("Integer value expected")); } else if (CB_LITERAL ($1)->sign < 0 || CB_LITERAL ($1)->scale) { cb_error (_("Integer value expected")); } $$ = $1; } ; literal: basic_literal { $$ = $1; } | ALL basic_value { $$ = $2; if (CB_LITERAL_P ($2)) { CB_LITERAL ($2)->all = 1; } } ; basic_literal: basic_value { $$ = $1; } | basic_literal '&' basic_value { $$ = cb_concat_literals ($1, $3); } ; basic_value: LITERAL { $$ = $1; } | SPACE { $$ = cb_space; } | ZERO { $$ = cb_zero; } | QUOTE { $$ = cb_quote; } | HIGH_VALUE { $$ = cb_high; } | LOW_VALUE { $$ = cb_low; } | TOK_NULL { $$ = cb_null; } ; /* * Function */ function: CURRENT_DATE_FUNC func_refmod { $$ = cb_build_intrinsic ($1, NULL, $2); } | WHEN_COMPILED_FUNC func_refmod { $$ = cb_build_intrinsic ($1, NULL, $2); } | UPPER_CASE_FUNC '(' exp ')' func_refmod { $$ = cb_build_intrinsic ($1, cb_list_init ($3), $5); } | LOWER_CASE_FUNC '(' exp ')' func_refmod { $$ = cb_build_intrinsic ($1, cb_list_init ($3), $5); } | REVERSE_FUNC '(' exp ')' func_refmod { $$ = cb_build_intrinsic ($1, cb_list_init ($3), $5); } | CONCATENATE_FUNC '(' exp_list ')' func_refmod { $$ = cb_build_intrinsic ($1, $3, $5); } | SUBSTITUTE_FUNC '(' exp_list ')' func_refmod { $$ = cb_build_intrinsic ($1, $3, $5); } | SUBSTITUTE_CASE_FUNC '(' exp_list ')' func_refmod { $$ = cb_build_intrinsic ($1, $3, $5); } | TRIM_FUNCTION '(' trim_args ')' func_refmod { $$ = cb_build_intrinsic ($1, $3, $5); } | NUMVALC_FUNC '(' numvalc_args ')' { $$ = cb_build_intrinsic ($1, $3, NULL); } | LOCALE_DT_FUNC '(' locale_dt_args ')' func_refmod { $$ = cb_build_intrinsic ($1, $3, $5); } | FUNCTION_NAME func_args { $$ = cb_build_intrinsic ($1, $2, NULL); } ; func_refmod: /* empty */ { $$ = NULL; } | '(' exp ':' ')' { $$ = cb_build_pair ($2, NULL); } | '(' exp ':' exp ')' { $$ = cb_build_pair ($2, $4); } ; func_args: /* empty */ { $$ = NULL; } | '(' list_func_args ')' { $$ = $2; } ; list_func_args: /* empty */ { $$ = NULL; } | exp_list { $$ = $1; } ; trim_args: exp { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_int0); } | exp e_sep LEADING { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_int1); } | exp e_sep TRAILING { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_int2); } ; numvalc_args: exp { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_null); } | exp e_sep exp { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, $3); } ; locale_dt_args: exp { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_null); } | exp e_sep reference { cb_tree x; x = cb_list_init ($1); $$ = cb_list_add (x, cb_ref ($3)); } ; /******************* * Common rules *******************/ not_const_word: { non_const_word = 1; } ; /* * Common flags */ flag_all: /* empty */ { $$ = cb_int0; } | ALL { $$ = cb_int1; } ; flag_duplicates: /* empty */ { $$ = cb_int0; } | with_dups { $$ = cb_int1; } ; flag_initialized: /* empty */ { $$ = NULL; } | INITIALIZED { $$ = cb_int1; } ; flag_next: /* empty */ { $$ = cb_int0; } | NEXT { $$ = cb_int1; } | PREVIOUS { $$ = cb_int2; } ; flag_not: /* empty */ { $$ = cb_int0; } | NOT { $$ = cb_int1; } ; flag_optional: /* empty */ { $$ = cb_int0; } | OPTIONAL { $$ = cb_int1; } ; flag_rounded: /* empty */ { $$ = cb_int0; } | ROUNDED { $$ = cb_int1; } ; flag_separate: /* empty */ { $$ = cb_int0; } | SEPARATE _character { $$ = cb_int1; } ; /* * Prepositions */ in_of: IN | OF ; records: RECORD _is | RECORDS _are ; with_dups: WITH DUPLICATES | DUPLICATES ; coll_sequence: COLLATING SEQUENCE | SEQUENCE ; _advancing: | ADVANCING ; _are: | ARE ; _area: | AREA ; _as: | AS ; _at: | AT ; _binary: | BINARY ; _by: | BY ; _character: | CHARACTER ; _characters: | CHARACTERS ; _contains: | CONTAINS ; _data: | DATA ; _file: | TOK_FILE ; _for: | FOR ; _from: | FROM ; _in: | IN ; _is: | IS ; _is_are: | IS | ARE ; _key: | KEY ; _line_or_lines: | LINE | LINES ; _lines: | LINES ; _mode: | MODE ; _number: | NUMBER ; _of: | OF ; _on: | ON ; _in_order: | ORDER | IN ORDER ; _other: | OTHER ; _program: | PROGRAM ; _record: | RECORD ; _right: | RIGHT ; _set: | SET ; _sign: | SIGN ; _sign_is: | SIGN | SIGN IS ; _size: | SIZE ; _status: | STATUS ; _tape: | TAPE ; _than: | THAN ; _then: | THEN ; _times: | TIMES ; _to: | TO ; /* _upon: | UPON ; */ _when: | WHEN ; _with: | WITH ; %% open-cobol-1.1/cobc/error.c0000644000000000000000000001457711136614062011260 /* * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include "cobc.h" #include "tree.h" static char *errnamebuff = NULL; static void print_error (char *file, int line, const char *prefix, const char *fmt, va_list ap) { static struct cb_label *last_section = NULL; static struct cb_label *last_paragraph = NULL; file = file ? file : cb_source_file; line = line ? line : cb_source_line; /* print the paragraph or section name */ if (current_section != last_section || current_paragraph != last_paragraph) { if (current_paragraph && strcmp ((const char *)(current_paragraph->name), "MAIN PARAGRAPH")) { fprintf (stderr, _("%s: In paragraph '%s':\n"), file, current_paragraph->name); } else if (current_section && strcmp ((const char *)(current_section->name), "MAIN SECTION")) { fprintf (stderr, _("%s: In section '%s':\n"), file, current_section->name); } last_section = current_section; last_paragraph = current_paragraph; } /* print the error */ fprintf (stderr, "%s:%d: %s", file, line, prefix); vfprintf (stderr, fmt, ap); fputs ("\n", stderr); } char * check_filler_name (char *name) { if (!memcmp (name, "WORK$", 5)) { name = (char *)"FILLER"; } return name; } void cb_warning (const char *fmt, ...) { va_list ap; va_start (ap, fmt); print_error (NULL, 0, "Warning: ", fmt, ap); va_end (ap); warningcount++; } void cb_error (const char *fmt, ...) { va_list ap; va_start (ap, fmt); print_error (NULL, 0, "Error: ", fmt, ap); va_end (ap); errorcount++; } void cb_warning_x (cb_tree x, const char *fmt, ...) { va_list ap; va_start (ap, fmt); print_error ((char *)(x->source_file), x->source_line, "Warning: ", fmt, ap); va_end (ap); warningcount++; } void cb_error_x (cb_tree x, const char *fmt, ...) { va_list ap; va_start (ap, fmt); print_error ((char *)(x->source_file), x->source_line, "Error: ", fmt, ap); va_end (ap); errorcount++; } int cb_verify (const enum cb_support tag, const char *feature) { switch (tag) { case CB_OK: return 1; case CB_WARNING: return 1; case CB_ARCHAIC: if (cb_warn_archaic) { cb_warning (_("%s is archaic in %s"), feature, cb_config_name); } return 1; case CB_OBSOLETE: if (cb_warn_obsolete) { cb_warning (_("%s is obsolete in %s"), feature, cb_config_name); } return 1; case CB_SKIP: return 0; case CB_IGNORE: cb_warning (_("%s ignored"), feature); return 0; case CB_ERROR: return 0; case CB_UNCONFORMABLE: cb_error (_("%s does not conform to %s"), feature, cb_config_name); return 0; } return 0; } void redefinition_error (cb_tree x) { struct cb_word *w; w = CB_REFERENCE (x)->word; cb_error_x (x, _("Redefinition of '%s'"), w->name); cb_error_x (CB_VALUE (w->items), _("'%s' previously defined here"), w->name); } void redefinition_warning (cb_tree x, cb_tree y) { struct cb_word *w; w = CB_REFERENCE (x)->word; cb_warning_x (x, _("Redefinition of '%s'"), w->name); if (y) { cb_warning_x (y, _("'%s' previously defined here"), w->name); } else { cb_warning_x (CB_VALUE (w->items), _("'%s' previously defined here"), w->name); } } void undefined_error (cb_tree x) { struct cb_reference *r; cb_tree c; if (!errnamebuff) { errnamebuff = cobc_malloc (COB_NORMAL_BUFF); } r = CB_REFERENCE (x); snprintf (errnamebuff, COB_NORMAL_MAX, "'%s'", CB_NAME (x)); for (c = r->chain; c; c = CB_REFERENCE (c)->chain) { strcat (errnamebuff, " in '"); strcat (errnamebuff, CB_NAME (c)); strcat (errnamebuff, "'"); } cb_error_x (x, _("%s undefined"), errnamebuff); } void ambiguous_error (cb_tree x) { struct cb_word *w; struct cb_field *p; struct cb_label *l2; cb_tree l; cb_tree y; w = CB_REFERENCE (x)->word; if (w->error == 0) { if (!errnamebuff) { errnamebuff = cobc_malloc (COB_NORMAL_BUFF); } /* display error on the first time */ snprintf (errnamebuff, COB_NORMAL_MAX, "'%s'", CB_NAME (x)); for (l = CB_REFERENCE (x)->chain; l; l = CB_REFERENCE (l)->chain) { strcat (errnamebuff, " in '"); strcat (errnamebuff, CB_NAME (l)); strcat (errnamebuff, "'"); } cb_error_x (x, _("%s ambiguous; need qualification"), errnamebuff); w->error = 1; /* display all fields with the same name */ for (l = w->items; l; l = CB_CHAIN (l)) { y = CB_VALUE (l); snprintf (errnamebuff, COB_NORMAL_MAX, "'%s' ", w->name); switch (CB_TREE_TAG (y)) { case CB_TAG_FIELD: for (p = CB_FIELD (y)->parent; p; p = p->parent) { strcat (errnamebuff, "in '"); strcat (errnamebuff, p->name); strcat (errnamebuff, "' "); } break; case CB_TAG_LABEL: l2 = CB_LABEL (y); if (l2->section) { strcat (errnamebuff, "in '"); strcat (errnamebuff, (const char *)(l2->section->name)); strcat (errnamebuff, "' "); } break; default: break; } strcat (errnamebuff, _("defined here")); cb_error_x (y, errnamebuff); } } } void group_error (cb_tree x, const char *clause) { cb_error_x (x, _("Group item '%s' cannot have %s clause"), check_filler_name (cb_name (x)), clause); } void level_redundant_error (cb_tree x, const char *clause) { cb_error_x (x, _("Level %02d item '%s' cannot have %s clause"), cb_field (x)->level, check_filler_name (cb_name (x)), clause); } void level_require_error (cb_tree x, const char *clause) { cb_error_x (x, _("Level %02d item '%s' requires %s clause"), cb_field (x)->level, check_filler_name (cb_name (x)), clause); } void level_except_error (cb_tree x, const char *clause) { cb_error_x (x, _("Level %02d item '%s' cannot have other than %s clause"), cb_field (x)->level, check_filler_name (cb_name (x)), clause); } open-cobol-1.1/cobc/field.c0000644000000000000000000006372011136614062011204 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include "cobc.h" #include "tree.h" /* Global variables */ size_t cb_needs_01 = 0; /* Local variables */ static struct cb_field *last_real_field = NULL; static const int pic_digits[] = { 2, 4, 7, 9, 12, 14, 16, 18 }; int cb_get_level (cb_tree x) { const char *p; const char *name; int level = 0; name = CB_NAME (x); /* get level */ for (p = name; *p; p++) { if (!isdigit (*p)) { goto level_error; } level = level * 10 + (*p - '0'); } /* check level */ switch (level) { case 66: case 77: case 78: case 88: break; default: if (level < 1 || level > 49) { goto level_error; } break; } return level; level_error: cb_error_x (x, _("Invalid level number '%s'"), name); return 0; } cb_tree cb_build_field_tree (cb_tree level, cb_tree name, struct cb_field *last_field, enum cb_storage storage, struct cb_file *fn) { struct cb_reference *r; struct cb_field *f; struct cb_field *p; struct cb_field *field_fill; cb_tree dummy_fill; cb_tree l; cb_tree x; int lv; if (level == cb_error_node || name == cb_error_node) { return cb_error_node; } /* check the level number */ lv = cb_get_level (level); if (!lv) { return cb_error_node; } /* build the field */ r = CB_REFERENCE (name); f = CB_FIELD (cb_build_field (name)); f->storage = storage; last_real_field = last_field; if (lv == 78) { f->level = 01; f->flag_item_78 = 1; return CB_TREE (f); } else { f->level = lv; } if (f->level == 01 && storage == CB_STORAGE_FILE) { if (fn->external) { f->flag_external = 1; has_external = 1; } else if (fn->global) { f->flag_is_global = 1; } } if (last_field) { if (last_field->level == 77 && f->level != 01 && f->level != 77 && f->level != 66 && f->level != 88) { cb_error_x (name, _("Level number must begin with 01 or 77")); return cb_error_node; } } /* checks for redefinition */ if (cb_warn_redefinition) { if (r->word->count > 1) { if (f->level == 01 || f->level == 77) { redefinition_warning (name, NULL); } else { for (l = r->word->items; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (!CB_FIELD_P (x) || CB_FIELD (x)->level == 01 || CB_FIELD (x)->level == 77 || (f->level == last_field->level && CB_FIELD (x)->parent == last_field->parent)) { redefinition_warning (name, x); break; } } } } } if (last_field && last_field->level == 88) { last_field = last_field->parent; } /* link the field into the tree */ if (f->level == 01 || f->level == 77) { /* top level */ cb_needs_01 = 0; if (last_field) { /* cb_field_add (cb_field_founder (last_field), f); */ cb_field_founder (last_field)->sister = f; } } else if (!last_field || cb_needs_01) { /* invalid top level */ cb_error_x (name, _("Level number must begin with 01 or 77")); return cb_error_node; } else if (f->level == 66) { /* level 66 */ f->parent = cb_field_founder (last_field); for (p = f->parent->children; p && p->sister; p = p->sister) ; if (p) { p->sister = f; } } else if (f->level == 88) { /* level 88 */ f->parent = last_field; } else if (f->level > last_field->level) { /* lower level */ last_field->children = f; f->parent = last_field; } else if (f->level == last_field->level) { /* same level */ same_level: last_field->sister = f; f->parent = last_field->parent; } else { /* upper level */ for (p = last_field->parent; p; p = p->parent) { if (p->level == f->level) { last_field = p; goto same_level; } if (cb_relax_level_hierarchy && p->level < f->level) { break; } } if (cb_relax_level_hierarchy) { dummy_fill = cb_build_filler (); field_fill = CB_FIELD (cb_build_field (dummy_fill)); cb_warning_x (name, _("No previous data item of level %02d"), f->level); field_fill->level = f->level; field_fill->storage = storage; field_fill->children = p->children; field_fill->parent = p; for (p = p->children; p != NULL; p = p->sister) { p->parent = field_fill; } field_fill->parent->children = field_fill; field_fill->sister = f; f->parent = field_fill->parent; last_field = field_fill; } else { cb_error_x (name, _("No previous data item of level %02d"), f->level); return cb_error_node; } } /* inherit parent's properties */ if (f->parent) { f->usage = f->parent->usage; f->indexes = f->parent->indexes; f->flag_sign_leading = f->parent->flag_sign_leading; f->flag_sign_separate = f->parent->flag_sign_separate; f->flag_is_global = f->parent->flag_is_global; } return CB_TREE (f); } struct cb_field * cb_resolve_redefines (struct cb_field *field, cb_tree redefines) { struct cb_field *f; struct cb_reference *r; const char *name; cb_tree x; r = CB_REFERENCE (redefines); name = CB_NAME (redefines); x = CB_TREE (field); /* check qualification */ if (r->chain) { cb_error_x (x, _("'%s' cannot be qualified here"), name); return NULL; } /* check subscripts */ if (r->subs) { cb_error_x (x, _("'%s' cannot be subscripted here"), name); return NULL; } /* resolve the name in the current group (if any) */ if (field->parent && field->parent->children) { for (f = field->parent->children; f; f = f->sister) { if (strcasecmp (f->name, name) == 0) { break; } } if (f == NULL) { cb_error_x (x, _("'%s' undefined in '%s'"), name, field->parent->name); return NULL; } } else { if (cb_ref (redefines) == cb_error_node) { return NULL; } f = cb_field (redefines); } /* check level number */ if (f->level != field->level) { cb_error_x (x, _("Level number of REDEFINES entries must be identical")); return NULL; } if (f->level == 66 || f->level == 88) { cb_error_x (x, _("Level number of REDEFINES entry cannot be 66 or 88")); return NULL; } if (!cb_indirect_redefines && f->redefines) { cb_error_x (x, _("'%s' not the original definition"), f->name); return NULL; } /* return the original definition */ while (f->redefines) { f = f->redefines; } return f; } static int validate_field_1 (struct cb_field *f) { cb_tree x; cb_tree l; char *name; struct cb_field *p; char *pp; unsigned char *pstr; int vorint; int need_picture; char pic[16]; x = CB_TREE (f); name = cb_name (x); if (f->flag_any_length) { if (f->storage != CB_STORAGE_LINKAGE) { cb_error_x (x, _("'%s' ANY LENGTH only allowed in LINKAGE"), name); return -1; } if (f->level != 01) { cb_error_x (x, _("'%s' ANY LENGTH must be 01 level"), name); return -1; } if (f->flag_item_based || f->flag_external) { cb_error_x (x, _("'%s' ANY LENGTH can not be BASED/EXTERNAL"), name); return -1; } if (f->flag_occurs || f->occurs_depending || f->children || f->values || f->flag_blank_zero) { cb_error_x (x, _("'%s' ANY LENGTH has invalid definition"), name); return -1; } if (!f->pic) { cb_error_x (x, _("'%s' ANY LENGTH must have a PICTURE"), name); return -1; } if (f->pic->size != 1 || f->usage != CB_USAGE_DISPLAY) { cb_error_x (x, _("'%s' ANY LENGTH has invalid definition"), name); return -1; } f->count++; return 0; } if (f->level == 77) { if (f->storage != CB_STORAGE_WORKING && f->storage != CB_STORAGE_LOCAL && f->storage != CB_STORAGE_LINKAGE) { cb_error_x (x, _("'%s' 77 level not allowed here"), name); } } if (f->flag_external) { if (f->level != 01 && f->level != 77) { cb_error_x (x, _("'%s' EXTERNAL must be specified at 01/77 level"), name); } if (f->storage != CB_STORAGE_WORKING && f->storage != CB_STORAGE_FILE) { cb_error_x (x, _("'%s' EXTERNAL can only be specified in WORKING-STORAGE section"), name); } if (f->flag_item_based) { cb_error_x (x, _("'%s' EXTERNAL and BASED are mutually exclusive"), name); } if (f->redefines) { cb_error_x (x, _("'%s' EXTERNAL not allowed with REDEFINES"), name); } } if (f->flag_item_based) { if (f->storage != CB_STORAGE_WORKING && f->storage != CB_STORAGE_LOCAL && f->storage != CB_STORAGE_LINKAGE) { cb_error_x (x, _("'%s' BASED not allowed here"), name); } if (f->redefines) { cb_error_x (x, _("'%s' BASED not allowed with REDEFINES"), name); } if (f->level != 01 && f->level != 77) { cb_error_x (x, _("'%s' BASED only allowed at the 01 and 77 levels"), name); } } if (f->level == 66) { if (!f->redefines) { level_require_error (x, "RENAMES"); return -1; } if (f->flag_occurs) { level_except_error (x, "RENAMES"); } return 0; } /* validate OCCURS */ if (f->flag_occurs) { if ((!cb_verify (cb_top_level_occurs_clause, "01/77 OCCURS") && (f->level == 01 || f->level == 77)) || (f->level == 66 || f->level == 88)) { level_redundant_error (x, "OCCURS"); } for (l = f->index_list; l; l = CB_CHAIN (l)) { cb_field (CB_VALUE (l))->flag_is_global = f->flag_is_global; } } /* validate OCCURS DEPENDING */ if (f->occurs_depending) { /* the data item that contains a OCCURS DEPENDING clause shall not be subordinate to a data item that has the OCCURS clause */ for (p = f->parent; p; p = p->parent) { if (p->flag_occurs) { cb_error_x (CB_TREE (p), _("'%s' cannot have the OCCURS clause due to '%s'"), check_filler_name ((char *)p->name), check_filler_name (name)); break; } } /* the data item that contains a OCCURS DEPENDING clause must be the last data item in the group */ for (p = f; p->parent; p = p->parent) { for (; p->sister; p = p->sister) { if (p->sister == cb_field (f->occurs_depending)) { cb_error_x (x, _("'%s' ODO field item invalid here"), p->sister->name); } if (!p->sister->redefines) { if (!cb_complex_odo) { cb_error_x (x, _("'%s' cannot have OCCURS DEPENDING"), check_filler_name (name)); break; } } } } /* If the field is GLOBAL, then the ODO must also be GLOBAL */ if (f->flag_is_global) { if (!cb_field (f->occurs_depending)->flag_is_global) { cb_error_x (x, _("'%s' ODO item must have GLOBAL attribute"), cb_field (f->occurs_depending)->name); } if (f->storage != cb_field (f->occurs_depending)->storage) { cb_error_x (x, _("GLOBAL '%s' ODO item is not in the same section as OCCURS"), cb_field (f->occurs_depending)->name); } } } /* validate REDEFINES */ if (f->redefines) { /* check OCCURS */ if (f->redefines->flag_occurs) { cb_warning_x (x, _("The original definition '%s' should not have OCCURS"), f->redefines->name); } /* check definition */ for (p = f->redefines->sister; p && p != f; p = p->sister) { if (!p->redefines) { cb_error_x (x, _("REDEFINES must follow the original definition")); break; } } /* check variable occurrence */ if (f->occurs_depending || cb_field_variable_size (f)) { cb_error_x (x, _("'%s' cannot be variable length"), f->name); } if (cb_field_variable_size (f->redefines)) { cb_error_x (x, _("The original definition '%s' cannot be variable length"), f->redefines->name); } } if (f->children) { /* group item */ if (f->pic) { group_error (x, "PICTURE"); } if (f->flag_justified) { group_error (x, "JUSTIFIED RIGHT"); } if (f->flag_blank_zero) { group_error (x, "BLANK WHEN ZERO"); } for (f = f->children; f; f = f->sister) { if (validate_field_1 (f) != 0) { return -1; } } } else { /* elementary item */ /* validate PICTURE */ need_picture = 1; if (f->usage == CB_USAGE_INDEX || f->usage == CB_USAGE_LENGTH || f->usage == CB_USAGE_OBJECT || f->usage == CB_USAGE_POINTER || f->usage == CB_USAGE_PROGRAM_POINTER || f->usage == CB_USAGE_FLOAT || f->usage == CB_USAGE_DOUBLE || f->usage == CB_USAGE_SIGNED_CHAR || f->usage == CB_USAGE_SIGNED_SHORT || f->usage == CB_USAGE_SIGNED_INT || f->usage == CB_USAGE_SIGNED_LONG || f->usage == CB_USAGE_UNSIGNED_CHAR || f->usage == CB_USAGE_UNSIGNED_SHORT || f->usage == CB_USAGE_UNSIGNED_INT || f->usage == CB_USAGE_UNSIGNED_LONG || f->usage == CB_USAGE_PROGRAM) { need_picture = 0; } if (f->pic == NULL && need_picture != 0) { if (f->storage == CB_STORAGE_SCREEN) { /* RXW if (f->values && CB_LITERAL(CB_VALUE(f->values))->size) { */ if (f->values) { sprintf (pic, "X(%d)", (int)CB_LITERAL(CB_VALUE(f->values))->size); } else { sprintf (pic, "X(1)"); } f->pic = CB_PICTURE (cb_build_picture (pic)); } else if (f->flag_item_78 && f->values && CB_VALUE(f->values) != cb_error_node) { f->count++; if (CB_NUMERIC_LITERAL_P(CB_VALUE(f->values))) { memset (pic, 0, sizeof (pic)); pp = pic; if (CB_LITERAL(CB_VALUE(f->values))->sign) { *pp++ = 'S'; } vorint = CB_LITERAL(CB_VALUE(f->values))->size - CB_LITERAL(CB_VALUE(f->values))->scale; if (vorint) { pp += sprintf (pp, "9(%d)", vorint); } if (CB_LITERAL(CB_VALUE(f->values))->scale) { sprintf (pp, "V9(%d)", CB_LITERAL(CB_VALUE(f->values))->scale); } if (CB_LITERAL(CB_VALUE(f->values))->size < 10) { f->usage = CB_USAGE_COMP_5; } else { f->usage = CB_USAGE_DISPLAY; } f->pic = CB_PICTURE (cb_build_picture (pic)); f->pic->category = CB_CATEGORY_NUMERIC; } else { sprintf (pic, "X(%d)", (int)CB_LITERAL(CB_VALUE(f->values))->size); f->pic = CB_PICTURE (cb_build_picture (pic)); f->pic->category = CB_CATEGORY_ALPHANUMERIC; f->usage = CB_USAGE_DISPLAY; } } else { if (f->flag_item_78) { cb_error_x (x, _("Value required for constant item '%s'"), name); } else { cb_error_x (x, _("PICTURE clause required for '%s'"), name); } return -1; } } if (f->pic != NULL && need_picture == 0) { cb_error_x (x, _("'%s' cannot have PICTURE clause"), name); } /* validate USAGE */ switch (f->usage) { case CB_USAGE_SIGNED_CHAR: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("S99")); f->flag_real_binary = 1; break; case CB_USAGE_SIGNED_SHORT: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("S9(4)")); f->flag_real_binary = 1; break; case CB_USAGE_SIGNED_INT: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("S9(9)")); f->flag_real_binary = 1; break; case CB_USAGE_SIGNED_LONG: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("S9(18)")); f->flag_real_binary = 1; break; case CB_USAGE_UNSIGNED_CHAR: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("99")); f->flag_real_binary = 1; break; case CB_USAGE_UNSIGNED_SHORT: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("9(4)")); f->flag_real_binary = 1; break; case CB_USAGE_UNSIGNED_INT: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("9(9)")); f->flag_real_binary = 1; break; case CB_USAGE_UNSIGNED_LONG: f->usage = CB_USAGE_COMP_5; f->pic = CB_PICTURE (cb_build_picture ("9(18)")); f->flag_real_binary = 1; break; case CB_USAGE_BINARY: case CB_USAGE_PACKED: if (f->pic->category != CB_CATEGORY_NUMERIC) { cb_error_x (x, _("'%s' PICTURE clause not compatible with USAGE"), name); } break; case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->pic) { if (f->pic->category != CB_CATEGORY_NUMERIC && f->pic->category != CB_CATEGORY_ALPHANUMERIC) { cb_error_x (x, _("'%s' PICTURE clause not compatible with USAGE"), name); } } break; default: break; } /* validate SIGN */ /* validate JUSTIFIED RIGHT */ if (f->flag_justified) { switch (f->pic->category) { case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: break; default: cb_error_x (x, _("'%s' cannot have JUSTIFIED RIGHT"), name); break; } } /* validate SYNCHRONIZED */ /* validate BLANK ZERO */ if (f->flag_blank_zero) { switch (f->pic->category) { case CB_CATEGORY_NUMERIC: /* reconstruct the picture string */ if (f->pic->scale > 0) { f->pic->str = cobc_malloc (20); pstr = (unsigned char *)(f->pic->str); *pstr++ = '9'; vorint = f->pic->digits - f->pic->scale; memcpy (pstr, (unsigned char *)&vorint, sizeof(int)); pstr += sizeof(int); *pstr++ = 'V'; vorint = 1; memcpy (pstr, (unsigned char *)&vorint, sizeof(int)); pstr += sizeof(int); *pstr++ = '9'; vorint = f->pic->scale; memcpy (pstr, (unsigned char *)&vorint, sizeof(int)); f->pic->size++; } else { f->pic->str = cobc_malloc (8); pstr = (unsigned char *)(f->pic->str); *pstr++ = '9'; vorint = f->pic->digits; memcpy (pstr, (unsigned char *)&vorint, sizeof(int)); } f->pic->category = CB_CATEGORY_NUMERIC_EDITED; break; case CB_CATEGORY_NUMERIC_EDITED: break; default: cb_error_x (x, _("'%s' cannot have BLANK WHEN ZERO"), name); break; } } /* validate VALUE */ if (f->values) { if (CB_PAIR_P (CB_VALUE (f->values)) || CB_CHAIN (f->values)) { cb_error_x (x, _("Only level 88 item may have multiple values")); } /* ISO+IEC+1989-2002: 13.16.42.2-10 */ for (p = f; p; p = p->parent) { if (p->redefines) { cb_error_x (x, _("Entries under REDEFINES cannot have VALUE clause")); } if (p->flag_external) { cb_warning_x (x, _("VALUE clause ignored for EXTERNAL items")); } } } } return 0; } static void setup_parameters (struct cb_field *f) { int flag_local; char pic[8]; /* determine the class */ if (f->children) { /* group field */ flag_local = f->flag_local; for (f = f->children; f; f = f->sister) { f->flag_local = flag_local; setup_parameters (f); } } else { /* regular field */ switch (f->usage) { case CB_USAGE_BINARY: #ifndef WORDS_BIGENDIAN if (cb_binary_byteorder == CB_BYTEORDER_BIG_ENDIAN) { f->flag_binary_swap = 1; } #endif break; case CB_USAGE_INDEX: f->pic = CB_PICTURE (cb_build_picture ("S9(9)")); break; case CB_USAGE_LENGTH: f->pic = CB_PICTURE (cb_build_picture ("9(9)")); break; case CB_USAGE_POINTER: case CB_USAGE_PROGRAM_POINTER: f->pic = CB_PICTURE (cb_build_picture ("9(10)")); break; case CB_USAGE_FLOAT: f->pic = CB_PICTURE (cb_build_picture ("S9(7)V9(7)")); break; case CB_USAGE_DOUBLE: f->pic = CB_PICTURE (cb_build_picture ("S9(9)V9(9)")); break; case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->pic->category == CB_CATEGORY_ALPHANUMERIC) { if (f->pic->size > 8) { sprintf (pic, "9(36)"); } else { sprintf (pic, "9(%d)", pic_digits[f->pic->size - 1]); } f->pic = CB_PICTURE (cb_build_picture (pic)); } #ifndef WORDS_BIGENDIAN if (f->usage == CB_USAGE_COMP_X) { if (cb_binary_byteorder == CB_BYTEORDER_BIG_ENDIAN) { f->flag_binary_swap = 1; } } #endif break; default: break; } } } static int compute_size (struct cb_field *f) { struct cb_field *c; int size; int align_size; int pad; if (f->level == 66) { /* rename */ if (f->rename_thru) { f->size = f->rename_thru->offset + f->rename_thru->size - f->redefines->offset; } else { f->size = f->redefines->size; } return f->size; } if (f->children) { /* groups */ size = 0; for (c = f->children; c; c = c->sister) { if (c->redefines) { c->offset = c->redefines->offset; compute_size (c); /* increase the size if redefinition is larger */ if (c->level != 66 && c->size * c->occurs_max > c->redefines->size * c->redefines->occurs_max) { if (cb_larger_redefines_ok) { cb_warning_x (CB_TREE (c), _("Size of '%s' larger than size of '%s'"), c->name, c->redefines->name); size += (c->size * c->occurs_max) - (c->redefines->size * c->redefines->occurs_max); } else { cb_error_x (CB_TREE (c), _("Size of '%s' larger than size of '%s'"), c->name, c->redefines->name); } } } else { c->offset = f->offset + size; size += compute_size (c) * c->occurs_max; /* word alignment */ if (c->flag_synchronized && cb_verify (cb_synchronized_clause, "SYNC")) { align_size = 1; switch (c->usage) { case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: case CB_USAGE_FLOAT: case CB_USAGE_DOUBLE: if (c->size == 2 || c->size == 4 || c->size == 8) { align_size = c->size; } break; case CB_USAGE_INDEX: case CB_USAGE_LENGTH: align_size = sizeof (int); break; case CB_USAGE_OBJECT: case CB_USAGE_POINTER: case CB_USAGE_PROGRAM_POINTER: case CB_USAGE_PROGRAM: align_size = sizeof (void *); break; default: break; } if (c->offset % align_size != 0) { pad = align_size - (c->offset % align_size); c->offset += pad; size += pad; } } } } f->size = size; } else { /* elementary item */ switch (f->usage) { case CB_USAGE_COMP_X: if (f->pic->category == CB_CATEGORY_ALPHANUMERIC) { break; } size = f->pic->size; f->size = ((size <= 2) ? 1 : (size <= 4) ? 2 : (size <= 7) ? 3 : (size <= 9) ? 4 : (size <= 12) ? 5 : (size <= 14) ? 6 : (size <= 16) ? 7 : (size <= 18) ? 8 : 16); break; case CB_USAGE_BINARY: case CB_USAGE_COMP_5: size = f->pic->size; if (size > 18) { f->flag_binary_swap = 0; cb_error_x (CB_TREE (f), _("'%s' binary field cannot be larger than 18 digits"), f->name); } switch (cb_binary_size) { case CB_BINARY_SIZE_2_4_8: if (f->flag_real_binary && size <= 2) { f->size = 1; } else { f->size = ((size <= 4) ? 2 : (size <= 9) ? 4 : (size <= 18) ? 8 : 16); } break; case CB_BINARY_SIZE_1_2_4_8: f->size = ((size <= 2) ? 1 : (size <= 4) ? 2 : (size <= 9) ? 4 : (size <= 18) ? 8 : 16); break; case CB_BINARY_SIZE_1__8: if (f->pic->have_sign) { f->size = ((size <= 2) ? 1 : (size <= 4) ? 2 : (size <= 6) ? 3 : (size <= 9) ? 4 : (size <= 11) ? 5 : (size <= 14) ? 6 : (size <= 16) ? 7 : (size <= 18) ? 8 : 16); } else { f->size = ((size <= 2) ? 1 : (size <= 4) ? 2 : (size <= 7) ? 3 : (size <= 9) ? 4 : (size <= 12) ? 5 : (size <= 14) ? 6 : (size <= 16) ? 7 : (size <= 18) ? 8 : 16); } break; } break; case CB_USAGE_DISPLAY: f->size = f->pic->size; if (f->pic->category == CB_CATEGORY_NUMERIC && f->pic->have_sign && f->flag_sign_separate) { f->size++; } break; case CB_USAGE_PACKED: f->size = f->pic->size / 2 + 1; break; case CB_USAGE_INDEX: case CB_USAGE_LENGTH: f->size = sizeof (int); break; case CB_USAGE_FLOAT: f->size = sizeof (float); break; case CB_USAGE_DOUBLE: f->size = sizeof (double); break; case CB_USAGE_OBJECT: case CB_USAGE_POINTER: case CB_USAGE_PROGRAM_POINTER: case CB_USAGE_PROGRAM: f->size = sizeof (void *); break; default: ABORT (); } } /* the size of redefining field should not be larger than the size of redefined field unless the redefined field is level 01 and non-external */ if (f->redefines && f->redefines->flag_external && (f->size * f->occurs_max > f->redefines->size * f->redefines->occurs_max)) { if (cb_larger_redefines_ok) { cb_warning_x (CB_TREE (f), _("Size of '%s' larger than size of '%s'"), f->name, f->redefines->name); } else { cb_error_x (CB_TREE (f), _("Size of '%s' larger than size of '%s'"), f->name, f->redefines->name); } } return f->size; } static int validate_field_value (struct cb_field *f) { if (f->values) { validate_move (CB_VALUE (f->values), CB_TREE (f), 1); } if (f->children) { for (f = f->children; f; f = f->sister) { validate_field_value (f); } } return 0; } void cb_validate_field (struct cb_field *f) { struct cb_field *c; if (validate_field_1 (f) != 0) { f->flag_invalid = 1; return; } /* RXW - Remove */ if (f->flag_item_78) { f->flag_is_verified = 1; return; } /* setup parameters */ if (f->storage == CB_STORAGE_LOCAL || f->storage == CB_STORAGE_LINKAGE || f->flag_item_based) { f->flag_local = 1; } if (f->storage == CB_STORAGE_LINKAGE || f->flag_item_based) { f->flag_base = 1; } setup_parameters (f); /* compute size */ compute_size (f); if (!f->redefines) { f->memory_size = f->size * f->occurs_max; } else if (f->redefines->memory_size < f->size * f->occurs_max) { f->redefines->memory_size = f->size * f->occurs_max; } validate_field_value (f); if (f->flag_is_global) { f->count++; for (c = f->children; c; c = c->sister) { c->flag_is_global = 1; c->count++; } } f->flag_is_verified = 1; } void cb_validate_88_item (struct cb_field *f) { cb_tree x; x = CB_TREE (f); if (!f->values) { level_require_error (x, "VALUE"); } if (f->pic || f->flag_occurs) { level_except_error (x, "VALUE"); } } struct cb_field * cb_validate_78_item (struct cb_field *f) { cb_tree x; x = CB_TREE (f); if (!f->values) { level_require_error (x, "VALUE"); } if (f->pic || f->flag_occurs) { level_except_error (x, "VALUE"); } cb_add_78 (f); return last_real_field; } void cb_clear_real_field (void) { last_real_field = NULL; } open-cobol-1.1/cobc/config.def0000644000000000000000000000566111130701401011666 /* -*- c -*- * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ CB_CONFIG_STRING (cb_config_name, "name") CB_CONFIG_INT (cb_tab_width, "tab-width") CB_CONFIG_INT (cb_text_column, "text-column") CB_CONFIG_ANY (enum cb_assign_clause, cb_assign_clause, "assign-clause") CB_CONFIG_ANY (enum cb_binary_size, cb_binary_size, "binary-size") CB_CONFIG_ANY (enum cb_binary_byteorder, cb_binary_byteorder, "binary-byteorder") CB_CONFIG_BOOLEAN (cb_filename_mapping, "filename-mapping") CB_CONFIG_BOOLEAN (cb_pretty_display, "pretty-display") CB_CONFIG_BOOLEAN (cb_binary_truncate, "binary-truncate") CB_CONFIG_BOOLEAN (cb_auto_initialize, "auto-initialize") CB_CONFIG_BOOLEAN (cb_complex_odo, "complex-odo") CB_CONFIG_BOOLEAN (cb_indirect_redefines, "indirect-redefines") CB_CONFIG_BOOLEAN (cb_larger_redefines_ok, "larger-redefines-ok") CB_CONFIG_BOOLEAN (cb_relaxed_syntax_check, "relaxed-syntax-check") CB_CONFIG_BOOLEAN (cb_perform_osvs, "perform-osvs") CB_CONFIG_BOOLEAN (cb_sticky_linkage, "sticky-linkage") CB_CONFIG_BOOLEAN (cb_relax_level_hierarchy, "relax-level-hierarchy") CB_CONFIG_SUPPORT (cb_author_paragraph, "author-paragraph") CB_CONFIG_SUPPORT (cb_memory_size_clause, "memory-size-clause") CB_CONFIG_SUPPORT (cb_multiple_file_tape_clause, "multiple-file-tape-clause") CB_CONFIG_SUPPORT (cb_label_records_clause, "label-records-clause") CB_CONFIG_SUPPORT (cb_value_of_clause, "value-of-clause") CB_CONFIG_SUPPORT (cb_data_records_clause, "data-records-clause") CB_CONFIG_SUPPORT (cb_top_level_occurs_clause, "top-level-occurs-clause") CB_CONFIG_SUPPORT (cb_synchronized_clause, "synchronized-clause") CB_CONFIG_SUPPORT (cb_goto_statement_without_name, "goto-statement-without-name") CB_CONFIG_SUPPORT (cb_stop_literal_statement, "stop-literal-statement") CB_CONFIG_SUPPORT (cb_debugging_line, "debugging-line") CB_CONFIG_SUPPORT (cb_padding_character_clause, "padding-character-clause") CB_CONFIG_SUPPORT (cb_next_sentence_phrase, "next-sentence-phrase") CB_CONFIG_SUPPORT (cb_eject_statement, "eject-statement") CB_CONFIG_SUPPORT (cb_entry_statement, "entry-statement") CB_CONFIG_SUPPORT (cb_move_noninteger_to_alphanumeric, "move-noninteger-to-alphanumeric") CB_CONFIG_SUPPORT (cb_odo_without_to, "odo-without-to") open-cobol-1.1/cobc/cobc.c0000644000000000000000000013122311141264200011010 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include "defaults.h" #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SIGNAL_H #include #endif #ifdef _WIN32 #include /* for GetTempPath, GetTempFileName */ #endif #ifdef HAVE_KPATHSEA_GETOPT_H #include #else #ifdef HAVE_GETOPT_H #include #else #include "lib/getopt.h" #endif #endif #ifdef HAVE_LOCALE_H #include #endif #include #include "cobc.h" #include "tree.h" /* Compile level */ enum cb_compile_level { CB_LEVEL_PREPROCESS = 1, CB_LEVEL_TRANSLATE, CB_LEVEL_COMPILE, CB_LEVEL_ASSEMBLE, CB_LEVEL_MODULE, CB_LEVEL_LIBRARY, CB_LEVEL_EXECUTABLE }; /* * Global variables */ int cb_source_format = CB_FORMAT_FIXED; #ifdef COB_EBCDIC_MACHINE int cb_display_sign = COB_DISPLAY_SIGN_EBCDIC; /* 1 */ #else int cb_display_sign = COB_DISPLAY_SIGN_ASCII; /* 0 */ #endif #undef COB_EXCEPTION #define COB_EXCEPTION(code,tag,name,critical) {name, 0x##code, 0}, struct cb_exception cb_exception_table[] = { {NULL, 0, 0}, /* CB_EC_ZERO */ #include {NULL, 0, 0} /* CB_EC_MAX */ }; #undef COB_EXCEPTION #undef CB_FLAG #define CB_FLAG(var,name,doc) int var = 0; #include "flag.def" #undef CB_FLAG #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) int var = 0; #include "warning.def" #undef CB_WARNDEF #ifdef _MSC_VER #define PATHSEPS ";" #else #define PATHSEPS ":" #endif int cb_id = 1; int cb_attr_id = 1; int cb_literal_id = 1; int cb_field_id = 1; int cb_storage_id = 1; int cb_flag_main = 0; int errorcount = 0; int warningcount = 0; int alt_ebcdic = 0; int optimize_flag = 0; char *cb_source_file = NULL; char *cb_oc_build_stamp = NULL; char *source_name; char *demangle_name; int cb_source_line = 0; FILE *cb_storage_file; char *cb_storage_file_name; FILE *cb_listing_file = NULL; FILE *cb_depend_file = NULL; char *cb_depend_target = NULL; struct cb_text_list *cb_depend_list = NULL; struct cb_text_list *cb_include_list = NULL; struct cb_text_list *cb_extension_list = NULL; int cb_saveargc; char **cb_saveargv; const char *cob_config_dir; /* * Local variables */ static const char *const cob_csyns[] = { "NULL", "L_initextern", "LRET_initextern", #ifndef __GNUC__ "P_switch", #endif "alignof", "asm", "auto", "break", "case", "char", "const", "continue", "default", "do", "double", "else", "enum", "exit_program", "extern", "float", "for", "frame_pointer", "frame_stack", "goto", "if", "inline", "int", "long", "offsetof", "register", "restrict", "return", "short", "signed", "sizeof", "static", "struct", "switch", "typedef", "typeof", "union", "unsigned", "void", "volatile", "_Bool", "_Complex", "_Imaginary" }; #define COB_NUM_CSYNS sizeof(cob_csyns) / sizeof(char *) static enum cb_compile_level cb_compile_level = 0; static enum cb_compile_level local_level = 0; static size_t iparams = 0; static int iargs; static char *cobcpy = NULL; static char *save_temps_dir = NULL; static jmp_buf cob_jmpbuf; static int wants_nonfinal = 0; static int cb_flag_module = 0; static int cb_flag_library = 0; static int save_temps = 0; static int save_csrc = 0; static int verbose_output = 0; static int cob_iteration = 0; #ifndef _WIN32 static pid_t cob_process_id = 0; #endif static int strip_output = 0; static int gflag_set = 0; static char *output_name; static const char *cob_tmpdir; /* /tmp */ static struct filename *file_list; /* NOTE fcopts MUST have at least one leading space */ #if defined (__GNUC__) && (__GNUC__ >= 3) static const char fcopts[] = " -finline-functions -fno-gcse -freorder-blocks "; #elif defined(__xlc__) static const char fcopts[] = " -Q -qro -qroconst "; #else static const char fcopts[] = " "; #endif #if defined (__GNUC__) && (__GNUC__ >= 3) static const char gccpipe[] = "-pipe"; #else static const char gccpipe[] = "\0"; #endif #ifdef HAVE_SIGNAL_H typedef void (*cob_sighandler_t) (int); static cob_sighandler_t hupsig = NULL; static cob_sighandler_t intsig = NULL; static cob_sighandler_t qutsig = NULL; #endif static const char short_options[] = "hVvECScbmxOgwo:t:I:L:l:D:"; static const struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, /* getopt_long_only has a problem with eg. -xv - remove {"verbose", no_argument, NULL, 'v'}, */ {"list-reserved", no_argument, NULL, 'R'}, {"list-intrinsics", no_argument, NULL, 'Q'}, {"list-mnemonics", no_argument, NULL, 'q'}, {"save-temps", optional_argument, NULL, '_'}, {"std", required_argument, NULL, '$'}, {"conf", required_argument, NULL, '&'}, {"debug", no_argument, NULL, 'd'}, {"ext", required_argument, NULL, 'e'}, {"free", no_argument, &cb_source_format, CB_FORMAT_FREE}, {"fixed", no_argument, &cb_source_format, CB_FORMAT_FIXED}, {"static", no_argument, &cb_flag_static_call, 1}, {"dynamic", no_argument, &cb_flag_static_call, 0}, {"O2", no_argument, NULL, '2'}, {"Os", no_argument, NULL, 's'}, {"MT", required_argument, NULL, '%'}, {"MF", required_argument, NULL, '@'}, #undef CB_FLAG #define CB_FLAG(var,name,doc) \ {"f"name, no_argument, &var, 1}, \ {"fno-"name, no_argument, &var, 0}, #include "flag.def" #undef CB_FLAG {"Wall", no_argument, NULL, 'W'}, {"W", no_argument, NULL, 'Z'}, #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) \ {"W"name, no_argument, &var, 1}, \ {"Wno-"name, no_argument, &var, 0}, #include "warning.def" #undef CB_WARNDEF {NULL, 0, NULL, 0} }; static const char *cob_cc; /* gcc */ static char cob_cflags[COB_SMALL_BUFF]; /* -I... */ static char cob_libs[COB_MEDIUM_BUFF]; /* -L... -lcob */ static char cob_define_flags[COB_SMALL_BUFF]; /* -D... */ static const char *cob_ldflags; static const char *cob_copy_dir; /* cobc functions */ /* * Global functions */ void cobc_abort (const char *filename, const int linenum) { fprintf (stderr, "%s:%d: Internal compiler error\n", filename, linenum); (void)longjmp (cob_jmpbuf, 1); } void cobc_tree_cast_error (cb_tree x, const char *filen, const int linenum, const int tagnum) { fprintf (stderr, "%s:%d: Invalid type cast from '%s'\n", filen, linenum, x ? cb_name (x) : "null"); fprintf (stderr, "Tag 1 %d Tag 2 %d\n", x ? CB_TREE_TAG(x) : 0, tagnum); (void)longjmp (cob_jmpbuf, 1); } void * cobc_malloc (const size_t size) { void *mptr; mptr = calloc (1, size); if (!mptr) { fprintf (stderr, "Cannot allocate %d bytes of memory - Aborting\n", (int)size); fflush (stderr); (void)longjmp (cob_jmpbuf, 1); } return mptr; } void * cobc_realloc (void *prevptr, const size_t size) { void *mptr; mptr = realloc (prevptr, size); if (!mptr) { fprintf (stderr, "Cannot reallocate %d bytes of memory - Aborting\n", (int)size); fflush (stderr); (void)longjmp (cob_jmpbuf, 1); } return mptr; } struct cb_text_list * cb_text_list_add (struct cb_text_list *list, const char *text) { struct cb_text_list *p; struct cb_text_list *l; p = cobc_malloc (sizeof (struct cb_text_list)); p->text = strdup (text); p->next = NULL; if (!list) { return p; } else { for (l = list; l->next; l = l->next) { ; } l->next = p; return list; } } size_t cobc_check_valid_name (char *name) { size_t n; for (n = 0; n < COB_NUM_CSYNS; ++n) { if (!strcmp (name, cob_csyns[n])) { return 1; } } return 0; } /* * Local functions */ static void cobc_init_var (char *var, const char *env, const char *def) { char *p = getenv (env); if (p) { strcpy (var, p); } else { strcpy (var, def); } } static void cobc_check_action (const char *name) { struct stat st; char buff[COB_SMALL_BUFF]; if (name && !stat (name, &st)) { if (!save_temps) { unlink (name); } else if (save_temps_dir) { memset (buff, 0, sizeof(buff)); sprintf (buff, "%s/%s", save_temps_dir, name); (void)rename (name, buff); } } } static void cobc_clean_up (int status) { struct filename *fn; struct local_filename *lf; int i; char buff[COB_SMALL_BUFF]; if (cb_listing_file) { fclose (cb_listing_file); cb_listing_file = NULL; } for (fn = file_list; fn; fn = fn->next) { if (fn->need_preprocess && (status || cb_compile_level > CB_LEVEL_PREPROCESS)) { cobc_check_action (fn->preprocess); } if (!save_csrc && fn->need_translate && (status || cb_compile_level > CB_LEVEL_TRANSLATE)) { cobc_check_action (fn->translate); cobc_check_action (fn->trstorage); if (fn->localfile) { for (lf = fn->localfile; lf; lf = lf->next) { cobc_check_action (lf->local_name); } } else if (fn->translate) { /* If we get syntax errors, we do not know the number of local include files */ memset (buff, 0, sizeof(buff)); for (i = 0; i < 30; i++) { if (i) { sprintf (buff, "%s.l%d.h", fn->translate, i); } else { sprintf (buff, "%s.l.h", fn->translate); } unlink (buff); } } } if (fn->need_assemble && (status || cb_compile_level > CB_LEVEL_ASSEMBLE)) { cobc_check_action (fn->object); } } } static void cobc_terminate (const char *str) { fprintf (stderr, "cobc: "); fflush (stderr); perror (str); cobc_clean_up (1); exit (1); } #ifdef HAVE_SIGNAL_H static void cobc_sig_handler (int sig) { save_temps = 0; cobc_clean_up (1); switch (sig) { #ifdef SIGHUP case SIGHUP: if ((hupsig != SIG_IGN) && (hupsig != SIG_DFL)) { (*hupsig) (SIGHUP); } break; #endif case SIGINT: if ((intsig != SIG_IGN) && (intsig != SIG_DFL)) { (*intsig) (SIGINT); } break; #ifdef SIGQUIT case SIGQUIT: if ((qutsig != SIG_IGN) && (qutsig != SIG_DFL)) { (*qutsig) (SIGQUIT); } break; #endif } exit (sig); } #endif /* * Command line */ static void cobc_print_version (void) { printf ("cobc (%s) %s.%d\n", PACKAGE_NAME, PACKAGE_VERSION, PATCH_LEVEL); puts ("Copyright (C) 2001-2009 Keisuke Nishida / Roger While"); printf ("Built %s\nPackaged %s\n", cb_oc_build_stamp, octardate); } static void cobc_print_usage (void) { printf ("Usage: cobc [options] file...\n\n"); puts (_("Options:")); puts (_(" --help Display this message")); puts (_(" --version, -V Display compiler version")); puts (_(" -v Display the programs invoked by the compiler")); puts (_(" -x Build an executable program")); puts (_(" -m Build a dynamically loadable module (default)")); puts (_(" -std= Compile for a specific dialect :")); puts (_(" cobol2002 Cobol 2002")); puts (_(" cobol85 Cobol 85")); puts (_(" ibm IBM Compatible")); puts (_(" mvs MVS Compatible")); puts (_(" bs2000 BS2000 Compatible")); puts (_(" mf Micro Focus Compatible")); puts (_(" default When not specified")); puts (_(" See config/default.conf and config/*.conf")); puts (_(" -free Use free source format")); puts (_(" -fixed Use fixed source format (default)")); puts (_(" -O, -O2, -Os Enable optimization")); puts (_(" -g Produce debugging information in the output")); puts (_(" -debug Enable all run-time error checking")); puts (_(" -o Place the output into ")); puts (_(" -b Combine all input files into a single")); puts (_(" dynamically loadable module")); puts (_(" -E Preprocess only; do not compile, assemble or link")); puts (_(" -C Translation only; convert COBOL to C")); puts (_(" -S Compile only; output assembly file")); puts (_(" -c Compile and assemble, but do not link")); puts (_(" -t Generate and place a program listing into ")); puts (_(" -I Add to copy/include search path")); puts (_(" -L Add to library search path")); puts (_(" -l Link the library ")); puts (_(" -D Pass to the C compiler")); puts (_(" -conf= User defined dialect configuration - See -std=")); puts (_(" --list-reserved Display reserved words")); puts (_(" --list-intrinsics Display intrinsic functions")); puts (_(" --list-mnemonics Display mnemonic names")); puts (_(" -save-temps(=) Save intermediate files (default current directory)")); puts (_(" -MT Set target file used in dependency list")); puts (_(" -MF Place dependency list into ")); puts (_(" -ext Add default file extension")); puts (""); puts (_(" -W Enable ALL warnings")); puts (_(" -Wall Enable all warnings except as noted below")); #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) \ printf (" -W%-19s %s", name, gettext (doc)); \ if (!wall) { \ puts (_(" (NOT set with -Wall)")); \ } else { \ printf ("\n"); \ } #include "warning.def" #undef CB_WARNDEF puts (""); #undef CB_FLAG #define CB_FLAG(var,name,doc) \ if (strcmp (name, "static-call")) \ printf (" -f%-19s %s\n", name, gettext (doc)); #include "flag.def" #undef CB_FLAG puts (""); } static void cobc_options_error (void) { fprintf (stderr, "Only one of options 'E', 'S', 'C' 'c' may be specified\n"); exit (1); } static int process_command_line (int argc, char *argv[]) { int c, idx; enum cob_exception_id i; struct stat st; char ext[COB_MINI_BUFF]; /* Enable default I/O exceptions */ CB_EXCEPTION_ENABLE (COB_EC_I_O) = 1; while ((c = getopt_long_only (argc, argv, short_options, long_options, &idx)) >= 0) { switch (c) { case 0: break; case '?': exit (1); case 'h': cobc_print_usage (); exit (0); case 'V': cobc_print_version (); exit (0); case 'R': cb_list_reserved (); exit (0); case 'Q': cb_list_intrinsics (); exit (0); case 'q': cb_list_mnemonics (); exit (0); case 'E': if (wants_nonfinal) { cobc_options_error (); } wants_nonfinal = 1; cb_compile_level = CB_LEVEL_PREPROCESS; break; case 'C': if (wants_nonfinal) { cobc_options_error (); } wants_nonfinal = 1; cb_compile_level = CB_LEVEL_TRANSLATE; break; case 'S': if (wants_nonfinal) { cobc_options_error (); } wants_nonfinal = 1; cb_compile_level = CB_LEVEL_COMPILE; break; case 'c': if (wants_nonfinal) { cobc_options_error (); } wants_nonfinal = 1; cb_compile_level = CB_LEVEL_ASSEMBLE; break; case 'b': if (cb_flag_main || cb_flag_module) { fprintf (stderr, "Only one of options 'm', 'x', 'b' may be specified\n"); exit (1); } cb_flag_library = 1; break; case 'm': if (cb_flag_main || cb_flag_library) { fprintf (stderr, "Only one of options 'm', 'x', 'b' may be specified\n"); exit (1); } cb_flag_module = 1; break; case 'x': if (cb_flag_module || cb_flag_library) { fprintf (stderr, "Only one of options 'm', 'x', 'b' may be specified\n"); exit (1); } cb_flag_main = 1; break; case 'v': verbose_output = 1; break; case 'o': output_name = strdup (optarg); break; case 'O': strcat (cob_cflags, " -O"); strcat (cob_cflags, fcopts); strcat (cob_cflags, COB_EXTRA_FLAGS); optimize_flag = 1; break; case '2': /* -O2 */ strip_output = 1; #if defined(__hpux) && !defined(__GNUC__) strcat (cob_cflags, " -O"); #else strcat (cob_cflags, " -O2"); #endif strcat (cob_cflags, fcopts); strcat (cob_cflags, COB_EXTRA_FLAGS); optimize_flag = 2; break; case 's': /* -Os */ strip_output = 1; #if defined(__hpux) && !defined(__GNUC__) strcat (cob_cflags, " -O"); #else strcat (cob_cflags, " -Os"); #endif strcat (cob_cflags, fcopts); strcat (cob_cflags, COB_EXTRA_FLAGS); optimize_flag = 2; break; case 'g': save_csrc = 1; gflag_set = 1; cb_flag_stack_check = 1; cb_flag_source_location = 1; #ifndef _MSC_VER strcat (cob_cflags, " -g"); #endif break; case '$': /* -std */ snprintf (ext, COB_MINI_MAX, "%s.conf", optarg); if (cb_load_std (ext) != 0) { fprintf (stderr, _("Invalid option -std=%s\n"), optarg); exit (1); } break; case '&': /* -conf */ if (cb_load_conf (optarg, 1, 0) != 0) { exit (1); } break; case 'd': /* -debug */ /* Turn on all exception conditions */ for (i = 1; i < COB_EC_MAX; i++) { CB_EXCEPTION_ENABLE (i) = 1; } cb_flag_source_location = 1; cb_flag_stack_check = 1; break; case '_': /* --save-temps */ save_temps = 1; if (optarg) { if (stat (optarg, &st) != 0 || !(S_ISDIR (st.st_mode))) { fprintf (stderr, "Warning - '%s' is not a directory, defaulting to current directory\n", optarg); fflush (stderr); } else { save_temps_dir = optarg; } } break; case 't': cb_listing_file = fopen (optarg, "w"); if (!cb_listing_file) { perror (optarg); } break; case 'D': /* -D */ #ifdef _MSC_VER strcat (cob_define_flags, "/D \""); strcat (cob_define_flags, optarg); strcat (cob_define_flags, "\" "); #else strcat (cob_define_flags, "-D"); strcat (cob_define_flags, optarg); strcat (cob_define_flags, " "); #endif break; case '%': /* -MT */ cb_depend_target = strdup (optarg); break; case '@': /* -MF */ cb_depend_file = fopen (optarg, "w"); if (!cb_depend_file) { perror (optarg); } break; case 'I': #ifdef _MSC_VER strcat (cob_define_flags, "/I \""); strcat (cob_define_flags, optarg); strcat (cob_define_flags, "\" "); #else strcat (cob_define_flags, "-I"); strcat (cob_define_flags, optarg); strcat (cob_define_flags, " "); #endif cb_include_list = cb_text_list_add (cb_include_list, optarg); break; case 'L': strcat (cob_libs, " -L"); strcat (cob_libs, optarg); break; case 'l': strcat (cob_libs, " -l"); strcat (cob_libs, optarg); break; case 'e': snprintf (ext, COB_MINI_MAX, ".%s", optarg); cb_extension_list = cb_text_list_add (cb_extension_list, ext); break; case 'w': #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) var = 0; #include "warning.def" #undef CB_WARNDEF break; case 'W': #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) if (wall) var = 1; #include "warning.def" #undef CB_WARNDEF break; case 'Z': #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) var = 1; #include "warning.def" #undef CB_WARNDEF break; default: ABORT (); } } if (cb_config_name == NULL) { if (cb_load_std ("default.conf") != 0) { fprintf (stderr, "Error: failed to load the initial config file\n"); exit (1); } } if (cb_flag_fold_copy_lower && cb_flag_fold_copy_upper) { fprintf (stderr, "Error: Invalid option combination\n"); exit (1); } #ifdef __GNUC__ strcat (cob_cflags, " -Wno-unused -fsigned-char"); #ifdef HAVE_PSIGN_OPT strcat (cob_cflags, " -Wno-pointer-sign"); #endif #endif if (gflag_set) { strip_output = 0; optimize_flag = 0; } if (cb_flag_traceall) { cb_flag_trace = 1; cb_flag_source_location = 1; } if (cb_flag_source_location) { optimize_flag = 0; } #if defined (__GNUC__) && (__GNUC__ >= 3) if (strip_output) { strcat (cob_cflags, " -fomit-frame-pointer"); } #endif /* default extension list */ cb_extension_list = cb_text_list_add (cb_extension_list, ".CPY"); cb_extension_list = cb_text_list_add (cb_extension_list, ".CBL"); cb_extension_list = cb_text_list_add (cb_extension_list, ".COB"); cb_extension_list = cb_text_list_add (cb_extension_list, ".cpy"); cb_extension_list = cb_text_list_add (cb_extension_list, ".cbl"); cb_extension_list = cb_text_list_add (cb_extension_list, ".cob"); cb_extension_list = cb_text_list_add (cb_extension_list, ""); return optind; } static void process_env_copy_path (void) { char *value; char *token; cobcpy = getenv ("COBCPY"); if (cobcpy == NULL || strlen (cobcpy) == 0) { /* env. not defined: nothing to do */ cobcpy = NULL; return; } /* clone value to avoid memory corruption */ value = strdup (cobcpy); /* tokenizing for path sep. */ token = strtok (value, PATHSEPS); while (token) { cb_include_list = cb_text_list_add (cb_include_list, token); token = strtok (NULL, PATHSEPS); } /* release memory of clone */ free (value); return; } static void file_basename (const char *filename, char *buff) { const char *startp; const char *endp; size_t len; /* Remove directory name */ startp = strrchr (filename, '/'); if (startp) { startp++; } else { startp = filename; } /* Remove extension */ endp = strrchr (filename, '.'); if (endp > startp) { len = endp - startp; } else { len = strlen (startp); } /* Copy base name */ strncpy (buff, startp, len); buff[len] = '\0'; } static const char * file_extension (const char *filename) { const char *p; p = strrchr (filename, '.'); if (p) { return p + 1; } else { return ""; } } static char * cobc_temp_name (const char *ext) { char buff[COB_MEDIUM_BUFF]; #ifdef _WIN32 char temp[MAX_PATH]; GetTempPath (MAX_PATH, temp); GetTempFileName (temp, "cob", 0, buff); DeleteFile (buff); strcpy (buff + strlen (buff) - 4, ext); /* replace ".tmp" by EXT */ #else sprintf (buff, "%s/cob%d_%d%s", cob_tmpdir, cob_process_id, cob_iteration, ext); #endif return strdup (buff); } static struct filename * process_filename (const char *filename) { const char *extension; struct filename *fn; struct filename *ffn; struct stat st; char basename[COB_SMALL_BUFF]; if (stat (filename, &st) != 0) { cobc_terminate (filename); } file_basename (filename, basename); if (cobc_check_valid_name (basename)) { fprintf (stderr, "Invalid file base name - %s\n", basename); return NULL; } fn = cobc_malloc (sizeof (struct filename)); fn->need_preprocess = 1; fn->need_translate = 1; fn->need_assemble = 1; fn->next = NULL; if (!file_list) { file_list = fn; } else { for (ffn = file_list; ffn->next; ffn = ffn->next) ; ffn->next = fn; } fn->demangle_source = cb_encode_program_id (basename); extension = file_extension (filename); /* Check input file type */ if (strcmp (extension, "i") == 0) { /* already preprocessed */ fn->need_preprocess = 0; } else if (strcmp (extension, "c") == 0 || strcmp (extension, "s") == 0) { /* already compiled */ fn->need_preprocess = 0; fn->need_translate = 0; #ifdef _MSC_VER } else if (strcmp (extension, "obj") == 0 || strcmp (extension, "lib") == 0) { #else } else if (strcmp (extension, "o") == 0) { #endif /* already assembled */ fn->need_preprocess = 0; fn->need_translate = 0; fn->need_assemble = 0; } /* Set source filename */ fn->source = cobc_malloc (strlen (filename) + 3); strcpy (fn->source, filename); /* Set preprocess filename */ if (!fn->need_preprocess) { fn->preprocess = strdup (fn->source); } else if (output_name && cb_compile_level == CB_LEVEL_PREPROCESS) { fn->preprocess = strdup (output_name); } else if (save_temps) { fn->preprocess = cobc_malloc (strlen (basename) + 5); sprintf (fn->preprocess, "%s.i", basename); } else { fn->preprocess = cobc_temp_name (".cob"); } /* Set translate filename */ if (!fn->need_translate) { fn->translate = strdup (fn->source); } else if (output_name && cb_compile_level == CB_LEVEL_TRANSLATE) { fn->translate = strdup (output_name); } else if (save_csrc || save_temps || cb_compile_level == CB_LEVEL_TRANSLATE) { fn->translate = cobc_malloc (strlen (basename) + 5); sprintf (fn->translate, "%s.c", basename); } else { fn->translate = cobc_temp_name (".c"); } /* Set storage filename */ if (fn->need_translate) { fn->trstorage = cobc_malloc (strlen (fn->translate) + 5); sprintf (fn->trstorage, "%s.h", fn->translate); } /* Set object filename */ if (!fn->need_assemble) { fn->object = strdup (fn->source); } else if (output_name && cb_compile_level == CB_LEVEL_ASSEMBLE) { fn->object = strdup (output_name); } else if (save_temps || cb_compile_level == CB_LEVEL_ASSEMBLE) { fn->object = cobc_malloc (strlen (basename) + 5); #ifdef _MSC_VER sprintf (fn->object, "%s.obj", basename); #else sprintf (fn->object, "%s.o", basename); #endif } else { #ifdef _MSC_VER fn->object = cobc_malloc (strlen (basename) + 5); sprintf (fn->object, "%s.obj", basename); #else fn->object = cobc_temp_name (".o"); #endif } cob_iteration++; return fn; } static int process (const char *cmd) { char *p; char *buffptr; size_t clen; int ret; char buff[COB_MEDIUM_BUFF]; if (strchr (cmd, '$') == NULL) { if (verbose_output) { fprintf (stderr, "%s\n", (char *)cmd); } return system (cmd); } clen = strlen (cmd) + 32; if (clen > COB_MEDIUM_BUFF) { buffptr = cobc_malloc (clen); } else { buffptr = buff; } p = buffptr; /* quote '$' */ for (; *cmd; cmd++) { if (*cmd == '$') { p += sprintf (p, "\\$"); } else { *p++ = *cmd; } } *p = 0; if (verbose_output) { fprintf (stderr, "%s\n", buffptr); } ret = system (buffptr); if (buffptr != buff) { free (buffptr); } return ret; } static int preprocess (struct filename *fn) { struct cb_text_list *l; int i; char line[COB_MEDIUM_BUFF]; errorcount = 0; if (output_name || cb_compile_level > CB_LEVEL_PREPROCESS) { ppout = fopen (fn->preprocess, "w"); if (!ppout) { cobc_terminate (fn->preprocess); } } else { ppout = stdout; } if (ppopen (fn->source, NULL) != 0) { if (ppout != stdout) { fclose (ppout); if (fn->preprocess) { unlink (fn->preprocess); } } exit (1); } if (verbose_output) { fprintf (stderr, "preprocessing %s into %s\n", fn->source, fn->preprocess); } ppparse (); if (ppout != stdout) { fclose (ppout); if (cb_listing_file) { ppout = fopen (fn->preprocess, "r"); if (ppout) { memset (line, 0, sizeof (line)); fprintf (cb_listing_file, "# Generated by %s.%d\n", PACKAGE_STRING, PATCH_LEVEL); fprintf (cb_listing_file, "# Built %s\n", cb_oc_build_stamp); fprintf (cb_listing_file, "# Packaged %s\n", octardate); fprintf (cb_listing_file, "# Environment\n"); fprintf (cb_listing_file, "# TMPDIR : %s\n", cob_tmpdir); fprintf (cb_listing_file, "# COBCPY : %s\n", cobcpy != NULL ? cobcpy : "is not set"); fprintf (cb_listing_file, "# Command : "); for (i = 0; i < cb_saveargc; i++) { fprintf (cb_listing_file, "%s ", cb_saveargv[i]); } fprintf (cb_listing_file, "\n#\n"); while (fgets (line, COB_MEDIUM_BUFF, ppout) != NULL) { if (cb_source_format != CB_FORMAT_FIXED) { fprintf (cb_listing_file, "%s", line); } else { if (line[0] == '\n') { fprintf (cb_listing_file, "%s", line); } else if (line[0] == ' ' && line[1] == '\n') { fprintf (cb_listing_file, "\n"); } else if (line[0] == ' ') { fprintf (cb_listing_file, " %s", line); } else if (line[0] == '#') { fprintf (cb_listing_file, "%s", line); } else if (line[0] == 0) { fprintf (cb_listing_file, "%s", line); } else { fprintf (cb_listing_file, " %s", line); } } memset (line, 0, sizeof (line)); } fclose (ppout); } } } fclose (ppin); if (errorcount > 0) { return -1; } /* Output dependency list */ if (cb_depend_file) { if (!cb_depend_target) { fputs (_("-MT must be given to specify target file\n"), stderr); exit (1); } fprintf (cb_depend_file, "%s: \\\n", cb_depend_target); for (l = cb_depend_list; l; l = l->next) { fprintf (cb_depend_file, " %s%s\n", l->text, l->next ? " \\" : ""); } for (l = cb_depend_list; l; l = l->next) { fprintf (cb_depend_file, "%s:\n", l->text); } fclose (cb_depend_file); } return 0; } static struct cb_program * program_list_reverse (struct cb_program *p) { struct cb_program *next; struct cb_program *last = NULL; for (; p; p = next) { next = p->next_program; p->next_program = last; last = p; } return last; } static int process_translate (struct filename *fn) { struct cb_program *p; struct cb_program *q; struct cb_program *r; struct handler_struct *hstr1; struct handler_struct *hstr2; struct local_filename *lf; int ret; int i; /* initialize */ cb_source_file = NULL; cb_source_line = 0; cb_init_constants (); cb_init_reserved (); /* open the input file */ yyin = fopen (fn->preprocess, "r"); if (!yyin) { cobc_terminate (fn->preprocess); } /* parse */ ret = yyparse (); fclose (yyin); if (ret) { return ret; } if (cb_flag_syntax_only || current_program->entry_list == NULL) { return 0; } /* Set up USE GLOBAL handlers */ p = current_program; for (q = p; q; q = q->next_program) { q->global_file_list = cb_list_reverse (q->global_file_list); if (q->nested_level) { for (r = q->next_program; r; r = r->next_program) { if (r->nested_level >= q->nested_level) { continue; } for (i = COB_OPEN_INPUT; i <= COB_OPEN_EXTEND; i++) { hstr1 = &q->global_handler[i]; hstr2 = &r->global_handler[i]; if (!hstr1->handler_label && hstr2->handler_label && hstr2->handler_label->is_global) { hstr1->handler_label = hstr2->handler_label; hstr1->handler_prog = r; } } if (!r->nested_level) { break; } } } } if (verbose_output) { fprintf (stderr, "translating %s into %s\n", fn->preprocess, fn->translate); } /* open the output file */ yyout = fopen (fn->translate, "w"); if (!yyout) { cobc_terminate (fn->translate); } /* open the common storage file */ cb_storage_file_name = fn->trstorage; cb_storage_file = fopen (cb_storage_file_name, "w"); if (!cb_storage_file) { cobc_terminate (cb_storage_file_name); } p = program_list_reverse (current_program); /* set up local storage files */ ret = 1; for (q = p; q; q = q->next_program, ret++) { lf = cobc_malloc (sizeof(struct local_filename)); lf->local_name = cobc_malloc (strlen (fn->translate) + 9); if (q == p && !q->next_program) { sprintf (lf->local_name, "%s.l.h", fn->translate); } else { sprintf (lf->local_name, "%s.l%d.h", fn->translate, ret); } lf->local_fp = fopen (lf->local_name, "w"); if (!lf->local_fp) { cobc_terminate (lf->local_name); } q->local_storage_file = lf->local_fp; q->local_storage_name = lf->local_name; lf->next = fn->localfile; fn->localfile = lf; } /* translate to C */ codegen (p, 0); /* close the files */ fclose (cb_storage_file); fclose (yyout); for (q = p; q; q = q->next_program) { fclose (q->local_storage_file); } return 0; } static int process_compile (struct filename *fn) { char buff[COB_MEDIUM_BUFF]; char name[COB_MEDIUM_BUFF]; if (output_name) { strcpy (name, output_name); } else { file_basename (fn->source, name); #ifndef _MSC_VER strcat (name, ".s"); #endif } #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s /c %s %s /Od /MDd /Zi /FR /c /Fa%s /Fo%s %s" : "%s /c %s %s /MD /c /Fa%s /Fo%s %s", cob_cc, cob_cflags, cob_define_flags, name, name, fn->translate); #else sprintf (buff, "%s %s -S -o %s %s %s %s", cob_cc, gccpipe, name, cob_cflags, cob_define_flags, fn->translate); #endif return process (buff); } static int process_assemble (struct filename *fn) { char buff[COB_MEDIUM_BUFF]; #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s /c %s %s /Od /MDd /Zi /FR /Fo%s %s" : "%s /c %s %s /MD /Fo%s %s", cob_cc, cob_cflags, cob_define_flags, fn->object, fn->translate); #else if (cb_compile_level == CB_LEVEL_MODULE || cb_compile_level == CB_LEVEL_LIBRARY) { sprintf (buff, "%s %s -c %s %s %s -o %s %s", cob_cc, gccpipe, cob_cflags, cob_define_flags, COB_PIC_FLAGS, fn->object, fn->translate); } else { sprintf (buff, "%s %s -c %s %s -o %s %s", cob_cc, gccpipe, cob_cflags, cob_define_flags, fn->object, fn->translate); } #endif return process (buff); } static int process_module_direct (struct filename *fn) { int ret; char buff[COB_MEDIUM_BUFF]; char name[COB_MEDIUM_BUFF]; if (output_name) { strcpy (name, output_name); #ifndef _MSC_VER if (strchr (output_name, '.') == NULL) { strcat (name, "."); strcat (name, COB_MODULE_EXT); } #endif } else { file_basename (fn->source, name); #ifndef _MSC_VER strcat (name, "."); strcat (name, COB_MODULE_EXT); #endif } #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s %s %s /Od /MDd /LDd /Zi /FR /Fe%s /Fo%s %s %s %s" : "%s %s %s /MD /LD /Fe%s /Fo%s %s %s %s", cob_cc, cob_cflags, cob_define_flags, name, name, cob_ldflags, fn->translate, cob_libs); ret = process (buff); #if _MSC_VER >= 1400 /* Embedding manifest */ if (ret == 0) { sprintf (buff, "mt /manifest %s.dll.manifest /outputresource:%s.dll;#2", name, name); ret = process (buff); } #endif #else /* _MSC_VER */ sprintf (buff, "%s %s %s %s %s %s %s %s -o %s %s %s", cob_cc, gccpipe, cob_cflags, cob_define_flags, COB_SHARED_OPT, cob_ldflags, COB_PIC_FLAGS, COB_EXPORT_DYN, name, fn->translate, cob_libs); ret = process (buff); #ifdef COB_STRIP_CMD if (strip_output && ret == 0) { sprintf (buff, "%s %s", COB_STRIP_CMD, name); ret = process (buff); } #endif #endif /* _MSC_VER */ return ret; } static int process_module (struct filename *fn) { int ret; char buff[COB_MEDIUM_BUFF]; char name[COB_MEDIUM_BUFF]; if (output_name) { strcpy (name, output_name); #ifndef _MSC_VER if (strchr (output_name, '.') == NULL) { strcat (name, "."); strcat (name, COB_MODULE_EXT); } #endif } else { file_basename (fn->source, name); strcat (name, "."); strcat (name, COB_MODULE_EXT); } #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s /Od /MDd /LDd /Zi /FR /Fe%s %s %s %s" : "%s /MD /LD /Fe%s %s %s %s", cob_cc, name, cob_ldflags, fn->object, cob_libs); ret = process (buff); #if _MSC_VER >= 1400 /* Embedding manifest */ if (ret == 0) { sprintf (buff, "mt /manifest %s.dll.manifest /outputresource:%s.dll;#2", name, name); ret = process (buff); } #endif #else /* _MSC_VER */ sprintf (buff, "%s %s %s %s %s %s -o %s %s %s", cob_cc, gccpipe, COB_SHARED_OPT, cob_ldflags, COB_PIC_FLAGS, COB_EXPORT_DYN, name, fn->object, cob_libs); ret = process (buff); #ifdef COB_STRIP_CMD if (strip_output && ret == 0) { sprintf (buff, "%s %s", COB_STRIP_CMD, name); ret = process (buff); } #endif #endif /* _MSC_VER */ return ret; } static int process_library (struct filename *l) { char *buffptr; char *objsptr; struct filename *f; size_t bufflen; int ret; char buff[COB_MEDIUM_BUFF]; char name[COB_MEDIUM_BUFF]; char objs[COB_MEDIUM_BUFF] = "\0"; bufflen = 0; for (f = l; f; f = f->next) { bufflen += strlen (f->object) + 2; } if (bufflen >= COB_MEDIUM_BUFF) { objsptr = cobc_malloc (bufflen); } else { objsptr = objs; } for (f = l; f; f = f->next) { strcat (objsptr, f->object); strcat (objsptr, " "); } if (output_name) { strcpy (name, output_name); #ifndef _MSC_VER if (strchr (output_name, '.') == NULL) { strcat (name, "."); strcat (name, COB_MODULE_EXT); } #endif } else { file_basename (l->source, name); #ifndef _MSC_VER strcat (name, "."); strcat (name, COB_MODULE_EXT); #endif } bufflen = strlen (cob_cc) + strlen (gccpipe) + strlen (cob_ldflags) + strlen (COB_EXPORT_DYN) + strlen (COB_SHARED_OPT) + strlen (name) + strlen (objsptr) + strlen (cob_libs) + strlen (COB_PIC_FLAGS) + 16; if (bufflen >= COB_MEDIUM_BUFF) { buffptr = cobc_malloc (bufflen); } else { buffptr = buff; } #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s /Od /MDd /LDd /Zi /FR /Fe%s %s %s %s" : "%s /MD /LD /Fe%s %s %s %s", cob_cc, name, cob_ldflags, objsptr, cob_libs); ret = process (buff); #if _MSC_VER >= 1400 /* Embedding manifest */ if (ret == 0) { sprintf (buff, "mt /manifest %s.dll.manifest /outputresource:%s.dll;#2", name, name); ret = process (buff); } #endif #else /* _MSC_VER */ sprintf (buffptr, "%s %s %s %s %s %s -o %s %s %s", cob_cc, gccpipe, COB_SHARED_OPT, cob_ldflags, COB_PIC_FLAGS, COB_EXPORT_DYN, name, objsptr, cob_libs); ret = process (buffptr); #ifdef COB_STRIP_CMD if (strip_output && ret == 0) { sprintf (buff, "%s %s", COB_STRIP_CMD, name); ret = process (buff); } #endif #endif /* _MSC_VER */ return ret; } static int process_link (struct filename *l) { char *buffptr; char *objsptr; struct filename *f; size_t bufflen; int ret; char buff[COB_MEDIUM_BUFF]; char name[COB_MEDIUM_BUFF]; char objs[COB_MEDIUM_BUFF] = "\0"; bufflen = 0; for (f = l; f; f = f->next) { bufflen += strlen (f->object) + 2; } if (bufflen >= COB_MEDIUM_BUFF) { objsptr = cobc_malloc (bufflen); } else { objsptr = objs; } for (f = l; f; f = f->next) { strcat (objsptr, f->object); strcat (objsptr, " "); } if (output_name) { strcpy (name, output_name); } else { file_basename (l->source, name); } bufflen = strlen (cob_cc) + strlen (gccpipe) + strlen (cob_ldflags) + strlen (COB_EXPORT_DYN) + strlen (name) + strlen (objsptr) + strlen (cob_libs) + 16; if (bufflen >= COB_MEDIUM_BUFF) { buffptr = cobc_malloc (bufflen); } else { buffptr = buff; } #ifdef _MSC_VER sprintf (buff, gflag_set ? "%s /Od /MDd /Zi /FR /Fe%s %s %s %s" : "%s /MD /Fe%s %s %s %s", cob_cc, name, cob_ldflags, objsptr, cob_libs); ret = process (buff); #if _MSC_VER >= 1400 /* Embedding manifest */ if (ret == 0) { sprintf (buff, "mt /manifest %s.exe.manifest /outputresource:%s.exe;#2", name, name); ret = process (buff); } #endif #else /* _MSC_VER */ sprintf (buffptr, "%s %s %s %s -o %s %s %s", cob_cc, gccpipe, cob_ldflags, COB_EXPORT_DYN, name, objsptr, cob_libs); ret = process (buffptr); #ifdef __hpux if (ret == 0) { sprintf (buff, "chatr -s +s enable %s%s 1>/dev/null 2>&1", name, COB_EXEEXT); process (buff); } #endif #ifdef COB_STRIP_CMD if (strip_output && ret == 0) { sprintf (buff, "%s %s%s", COB_STRIP_CMD, name, COB_EXEEXT); ret = process (buff); } #endif #endif /* _MSC_VER */ return ret; } int main (int argc, char *argv[]) { struct filename *fn; char *p; int status = 1; int year; int day; char month[32]; char buff[COB_SMALL_BUFF]; #ifdef HAVE_SIGNAL_H if ((intsig = signal (SIGINT, cobc_sig_handler)) == SIG_IGN) { (void)signal (SIGINT, SIG_IGN); } #ifdef SIGHUP if ((hupsig = signal (SIGHUP, cobc_sig_handler)) == SIG_IGN) { (void)signal (SIGHUP, SIG_IGN); } #endif #ifdef SIGQUIT if ((qutsig = signal (SIGQUIT, cobc_sig_handler)) == SIG_IGN) { (void)signal (SIGQUIT, SIG_IGN); } #endif #endif cb_saveargc = argc; cb_saveargv = argv; #ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); #endif #ifndef _WIN32 cob_process_id = getpid (); #endif /* Initialize global variables */ memset (buff, 0, sizeof(buff)); memset (month, 0, sizeof(month)); day = 0; year = 0; sscanf (__DATE__, "%s %d %d", month, &day, &year); if (day && year) { sprintf (buff, "%s %2.2d %4.4d %s", month, day, year, __TIME__); } else { sprintf (buff, "%s %s", __DATE__, __TIME__); } cb_oc_build_stamp = cobc_malloc (strlen (buff) + 1); strcpy (cb_oc_build_stamp, buff); output_name = NULL; if ((p = getenv ("TMPDIR")) != NULL) { cob_tmpdir = p; } else if ((p = getenv ("TMP")) != NULL) { cob_tmpdir = p; sprintf (buff, "TMPDIR=%s", p); p = strdup (buff); putenv (p); } else { cob_tmpdir = "/tmp"; putenv ((char *)"TMPDIR=/tmp"); } cob_cc = getenv ("COB_CC"); if (cob_cc == NULL) { cob_cc = COB_CC; } cobc_init_var (cob_cflags, "COB_CFLAGS", COB_CFLAGS); cobc_init_var (cob_libs, "COB_LIBS", COB_LIBS); cob_ldflags = getenv ("COB_LDFLAGS"); if (cob_ldflags == NULL) { cob_ldflags = COB_LDFLAGS; } cob_config_dir = getenv ("COB_CONFIG_DIR"); if (cob_config_dir == NULL) { cob_config_dir = COB_CONFIG_DIR; } cob_copy_dir = getenv ("COB_COPY_DIR"); if (cob_copy_dir == NULL) { cob_copy_dir = COB_COPY_DIR; } memset (cob_define_flags, 0, sizeof (cob_define_flags)); p = getenv ("COB_LDADD"); if (p) { strcat (cob_libs, " "); strcat (cob_libs, p); } p = getenv ("COB_EBCDIC"); if (p && (*p == 'F' || *p == 'f')) { alt_ebcdic = 1; } /* Process command line arguments */ iargs = process_command_line (argc, argv); /* Check the filename */ if (iargs == argc) { fprintf (stderr, "cobc: No input files\n"); exit (1); } /* processes COBCPY environment variable */ process_env_copy_path (); cb_include_list = cb_text_list_add (cb_include_list, cob_copy_dir); file_list = NULL; if (setjmp (cob_jmpbuf) != 0) { fprintf (stderr, "Aborting compile of %s at line %d\n", cb_source_file, cb_source_line); fflush (stderr); if (yyout) { fflush (yyout); } if (cb_storage_file) { fflush (cb_storage_file); } status = 1; cobc_clean_up (status); return status; } /* Defaults are set here */ if (!cb_flag_syntax_only) { if (!wants_nonfinal) { if (cb_flag_main) { cb_compile_level = CB_LEVEL_EXECUTABLE; } if (cb_flag_module) { cb_compile_level = CB_LEVEL_MODULE; } if (cb_flag_library) { cb_compile_level = CB_LEVEL_LIBRARY; } } if (cb_compile_level == 0 && !wants_nonfinal) { cb_compile_level = CB_LEVEL_MODULE; cb_flag_module = 1; } if (wants_nonfinal && cb_compile_level != CB_LEVEL_PREPROCESS && !cb_flag_main && !cb_flag_module && !cb_flag_library) { cb_flag_module = 1; } } else { cb_compile_level = CB_LEVEL_TRANSLATE; } if (output_name && cb_compile_level < CB_LEVEL_LIBRARY && (argc - iargs) > 1) { fprintf (stderr, "cobc: -o option invalid in this combination\n"); exit (1); } if (cb_flag_sign_ascii && cb_flag_sign_ebcdic) { fprintf (stderr, "Only one of -fsign-ascii or -fsign-ebcdic may be specified\n"); exit (1); } if (cb_flag_sign_ascii) { cb_display_sign = COB_DISPLAY_SIGN_ASCII; } if (cb_flag_sign_ebcdic) { cb_display_sign = COB_DISPLAY_SIGN_EBCDIC; } if (cb_flag_notrunc) { cb_binary_truncate = 0; cb_pretty_display = 0; } while (iargs < argc) { fn = process_filename (argv[iargs++]); if (!fn) { status = 1; cobc_clean_up (status); return status; } /* Preprocess */ if (cb_compile_level >= CB_LEVEL_PREPROCESS && fn->need_preprocess) { if (preprocess (fn) != 0) { cobc_clean_up (status); return status; } } } for (fn = file_list; fn; fn = fn->next) { cb_id = 1; cb_attr_id = 1; cb_literal_id = 1; cb_field_id = 1; cb_storage_id = 1; iparams++; demangle_name = fn->demangle_source; if (iparams > 1 && cb_compile_level == CB_LEVEL_EXECUTABLE && !cb_flag_syntax_only) { local_level = cb_compile_level; cb_flag_main = 0; cb_compile_level = CB_LEVEL_ASSEMBLE; } /* Translate */ if (cb_compile_level >= CB_LEVEL_TRANSLATE && fn->need_translate) { if (process_translate (fn) != 0) { cobc_clean_up (status); return status; } } if (cb_flag_syntax_only) { continue; } /* Compile */ if (cb_compile_level == CB_LEVEL_COMPILE) { if (process_compile (fn) != 0) { cobc_clean_up (status); return status; } } /* Build module */ if (cb_compile_level == CB_LEVEL_MODULE && fn->need_assemble) { if (process_module_direct (fn) != 0) { cobc_clean_up (status); return status; } } else { /* Assemble */ if (cb_compile_level >= CB_LEVEL_ASSEMBLE && fn->need_assemble) { if (process_assemble (fn) != 0) { cobc_clean_up (status); return status; } } /* Build module */ if (cb_compile_level == CB_LEVEL_MODULE) { if (process_module (fn) != 0) { cobc_clean_up (status); return status; } } } } if (!cb_flag_syntax_only) { /* Link */ if (local_level == CB_LEVEL_EXECUTABLE) { cb_compile_level = CB_LEVEL_EXECUTABLE; cb_flag_main = 1; } if (cb_compile_level == CB_LEVEL_LIBRARY) { if (process_library (file_list) != 0) { cobc_clean_up (status); return status; } } else if (cb_compile_level == CB_LEVEL_EXECUTABLE) { if (process_link (file_list) != 0) { cobc_clean_up (status); return status; } } } /* We have successfully completed */ status = 0; cobc_clean_up (status); return status; } open-cobol-1.1/cobc/cobc.h0000644000000000000000000001461611136106374011036 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef CB_COBC_H #define CB_COBC_H #include #include #include "lib/gettext.h" #if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__amd64__) #define COB_NON_ALIGNED /* Some DEC Alphas can only directly load shorts at 4-byte aligned addresses */ #ifdef __alpha #define COB_SHORT_BORK #endif #endif #define ABORT() cobc_abort(__FILE__,__LINE__) #define CB_FORMAT_FIXED 0 #define CB_FORMAT_FREE 1 extern int cb_source_format; extern int cb_display_sign; extern struct cb_exception { const char *name; /* exception name */ const int code; /* exception code */ int enable; /* if turned on */ } cb_exception_table[]; #define CB_EXCEPTION_NAME(id) cb_exception_table[id].name #define CB_EXCEPTION_CODE(id) cb_exception_table[id].code #define CB_EXCEPTION_ENABLE(id) cb_exception_table[id].enable #undef CB_FLAG #define CB_FLAG(var,name,doc) extern int var; #include "flag.def" #undef CB_FLAG #undef CB_WARNDEF #define CB_WARNDEF(var,name,wall,doc) extern int var; #include "warning.def" #undef CB_WARNDEF struct cb_text_list { const char *text; struct cb_text_list *next; }; struct cb_replace_list { struct cb_text_list *old_text; struct cb_text_list *new_text; struct cb_replace_list *next; }; struct local_filename { struct local_filename *next; char *local_name; FILE *local_fp; }; struct filename { struct filename *next; char *source; /* foo.cob */ char *preprocess; /* foo.i */ char *translate; /* foo.c */ char *trstorage; /* foo.c.h */ char *object; /* foo.o */ char *demangle_source; /* foo */ struct local_filename *localfile; /* foo.c.l[n].h */ int need_preprocess; int need_translate; int need_assemble; }; extern int cb_id; extern int cb_attr_id; extern int cb_literal_id; extern int cb_field_id; extern int cb_storage_id; extern int cb_flag_main; extern int errorcount; extern int warningcount; extern int alt_ebcdic; extern int optimize_flag; extern int has_external; extern char *cb_oc_build_stamp; extern char *cb_source_file; extern int cb_source_line; extern const char *cob_config_dir; extern char *source_name; extern char *demangle_name; extern FILE *cb_storage_file; extern char *cb_storage_file_name; extern char **cb_saveargv; extern int cb_saveargc; extern FILE *cb_listing_file; extern FILE *cb_depend_file; extern char *cb_depend_target; extern struct cb_text_list *cb_depend_list; extern struct cb_text_list *cb_include_list; extern struct cb_text_list *cb_extension_list; extern struct cb_program *current_program; extern struct cb_statement *current_statement; extern struct cb_label *current_section; extern struct cb_label *current_paragraph; extern size_t functions_are_all; extern struct cb_text_list *cb_text_list_add (struct cb_text_list *list, const char *name); extern void *cobc_malloc (const size_t size); extern void *cobc_realloc (void *prevptr, const size_t size); #ifdef __GNUC__ extern void cobc_abort (const char *filename, const int linenum) __attribute__ ((noreturn)); #else extern void cobc_abort (const char *filename, const int linenum); #endif extern size_t cobc_check_valid_name (char *name); /* config.c */ struct noreserve { struct noreserve *next; char *noresword; }; extern struct noreserve *norestab; enum cb_assign_clause { CB_ASSIGN_COBOL2002, /* COBOL 2002 standard */ CB_ASSIGN_MF, /* Micro Focus COBOL compatibility */ CB_ASSIGN_IBM /* IBM COBOL compatibility */ }; enum cb_binary_byteorder { CB_BYTEORDER_NATIVE, CB_BYTEORDER_BIG_ENDIAN }; enum cb_binary_size { CB_BINARY_SIZE_2_4_8, /* 2,4,8 bytes */ CB_BINARY_SIZE_1_2_4_8, /* 1,2,4,8 bytes */ CB_BINARY_SIZE_1__8 /* 1,2,3,4,5,6,7,8 bytes */ }; enum cb_operation_type { CB_OPERATION_READ, CB_OPERATION_WRITE, CB_OPERATION_ASSIGN }; enum cb_support { CB_OK, CB_WARNING, CB_ARCHAIC, CB_OBSOLETE, CB_SKIP, CB_IGNORE, CB_ERROR, CB_UNCONFORMABLE }; #undef CB_CONFIG_ANY #undef CB_CONFIG_INT #undef CB_CONFIG_STRING #undef CB_CONFIG_BOOLEAN #undef CB_CONFIG_SUPPORT #define CB_CONFIG_ANY(type,var,name) extern type var; #define CB_CONFIG_INT(var,name) extern int var; #define CB_CONFIG_STRING(var,name) extern const char *var; #define CB_CONFIG_BOOLEAN(var,name) extern int var; #define CB_CONFIG_SUPPORT(var,name) extern enum cb_support var; #include "config.def" #undef CB_CONFIG_ANY #undef CB_CONFIG_INT #undef CB_CONFIG_STRING #undef CB_CONFIG_BOOLEAN #undef CB_CONFIG_SUPPORT extern int cb_load_std (const char *name); extern int cb_load_conf (const char *fname, const int check_nodef, const int prefix_dir); /* preprocessor (in pplex.l, ppparse.y) */ extern FILE *ppin; extern FILE *ppout; extern int pplex (void); extern int ppparse (void); extern int ppopen (const char *name, struct cb_replace_list *replace_list); extern int ppcopy (const char *name, const char *lib, struct cb_replace_list *replace_list); extern void pp_set_replace_list (struct cb_replace_list *replace_list); /* parser (in scanner.l, parser.y) */ extern FILE *yyin; extern FILE *yyout; extern int yylex (void); extern int yyparse (void); /* typeck.c */ extern size_t sending_id; extern size_t suppress_warn; /* error.c */ #ifdef __GNUC__ extern void cb_warning (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern void cb_error (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); #else extern void cb_warning (const char *fmt, ...); extern void cb_error (const char *fmt, ...); #endif extern int cb_verify (const enum cb_support tag, const char *feature); #endif /* CB_COBC_H */ open-cobol-1.1/cobc/scanner.c0000644000000000000000000025145111142344366011556 #line 2 "scanner.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* 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. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; 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. */ yy_size_t 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; /* 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 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* 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". */ #define YY_CURRENT_BUFFER yy_current_buffer /* 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 = (char *) 0; static int yy_init = 1; /* 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; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* 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; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 99 #define YY_END_OF_BUFFER 100 static yyconst short int yy_accept[607] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 94, 16, 1, 10, 13, 14, 94, 93, 15, 17, 94, 94, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 2, 94, 19, 93, 15, 94, 24, 15, 96, 16, 17, 96, 98, 16, 97, 17, 16, 92, 0, 15, 88, 17, 89, 91, 90, 88, 88, 88, 88, 88, 88, 88, 88, 88, 0, 0, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 0, 0, 2, 0, 18, 19, 15, 0, 22, 23, 21, 0, 15, 96, 95, 97, 0, 88, 88, 88, 88, 88, 88, 88, 88, 0, 26, 0, 25, 0, 88, 88, 88, 88, 88, 0, 88, 0, 88, 88, 3, 88, 88, 88, 88, 88, 88, 0, 12, 0, 11, 20, 20, 0, 88, 88, 88, 0, 0, 69, 88, 88, 88, 0, 88, 88, 88, 88, 88, 0, 0, 0, 0, 0, 88, 88, 88, 88, 88, 88, 88, 88, 88, 0, 0, 88, 88, 88, 0, 0, 88, 88, 88, 88, 0, 88, 88, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 88, 88, 88, 88, 88, 0, 88, 0, 0, 0, 0, 88, 88, 0, 0, 88, 0, 88, 88, 0, 88, 88, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 88, 88, 88, 88, 88, 0, 88, 0, 0, 0, 59, 0, 67, 0, 0, 88, 88, 0, 0, 0, 0, 88, 88, 0, 88, 88, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 4, 88, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 6, 0, 0, 88, 0, 88, 5, 0, 88, 73, 0, 0, 0, 0, 58, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 88, 0, 0, 80, 81, 82, 83, 84, 85, 86, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 88, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 88, 0, 0, 88, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 34, 0, 0, 0, 88, 0, 54, 88, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 88, 0, 8, 0, 88, 0, 42, 0, 0, 57, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 32, 0, 0, 35, 28, 68, 31, 0, 78, 88, 72, 0, 46, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 60, 0, 39, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 29, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 52, 0, 0, 0, 0, 0, 49, 41, 40, 30, 0, 0, 0, 66, 37, 36, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 64, 70, 0, 55, 0, 0, 0, 0, 0, 0, 51, 0, 0, 77, 0, 0, 0, 47, 0, 0, 0, 0, 62, 0, 0, 0, 0, 76, 0, 0, 0, 74, 0, 0, 75, 0, 0, 79, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 5, 6, 1, 1, 1, 7, 8, 9, 10, 11, 12, 13, 14, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 15, 1, 24, 25, 26, 27, 1, 1, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 38, 45, 46, 47, 48, 49, 50, 51, 52, 53, 1, 1, 1, 1, 28, 1, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 38, 45, 46, 47, 48, 49, 50, 51, 52, 53, 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 yyconst int yy_meta[54] = { 0, 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2, 1, 1, 1, 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } ; static yyconst short int yy_base[622] = { 0, 0, 1278, 43, 1277, 56, 1276, 78, 81, 118, 146, 1281, 1285, 84, 1285, 1285, 1285, 1285, 1270, 1285, 162, 1255, 63, 1252, 84, 148, 173, 79, 176, 85, 78, 186, 179, 80, 187, 182, 200, 184, 210, 220, 227, 0, 1263, 1264, 1261, 252, 1262, 1261, 269, 0, 92, 1248, 1225, 1285, 97, 0, 1246, 132, 1285, 82, 279, 174, 1245, 1285, 1285, 1285, 248, 229, 290, 291, 231, 292, 249, 293, 295, 1263, 1260, 313, 294, 299, 181, 297, 326, 331, 325, 329, 334, 338, 339, 342, 226, 343, 347, 1261, 1258, 0, 1250, 1249, 1250, 0, 1249, 1248, 1285, 1247, 0, 0, 0, 0, 0, 135, 350, 303, 348, 391, 394, 361, 373, 371, 1253, 1285, 1250, 1285, 131, 387, 392, 395, 396, 397, 409, 424, 414, 417, 418, 421, 426, 422, 430, 442, 443, 446, 1251, 1285, 1248, 1285, 1242, 0, 61, 453, 451, 454, 162, 456, 1285, 459, 463, 465, 1216, 467, 470, 500, 473, 513, 1220, 540, 1200, 1201, 1212, 495, 532, 505, 509, 511, 518, 546, 527, 559, 1216, 1203, 562, 539, 557, 1198, 1200, 563, 576, 568, 571, 1195, 575, 579, 598, 481, 607, 1194, 1195, 326, 1199, 120, 1203, 1208, 1205, 1184, 585, 615, 592, 593, 601, 610, 613, 629, 614, 632, 641, 311, 654, 639, 646, 1194, 1192, 519, 666, 647, 653, 1197, 658, 659, 1200, 611, 1199, 1202, 674, 1198, 1185, 1197, 1178, 695, 1193, 1172, 1191, 1178, 1189, 660, 1178, 1187, 677, 667, 711, 688, 715, 1174, 698, 1173, 1174, 1174, 1285, 1172, 1285, 1177, 1182, 718, 710, 1181, 1176, 712, 1163, 714, 716, 1163, 717, 746, 1161, 1165, 1164, 730, 758, 763, 1172, 1175, 766, 1158, 1169, 1157, 1166, 773, 723, 1156, 1169, 759, 765, 777, 772, 786, 1152, 814, 1161, 1154, 1145, 1159, 1150, 1146, 792, 836, 769, 1143, 1144, 773, 1159, 778, 770, 1150, 779, 819, 1157, 1138, 1153, 98, 1285, 1140, 1285, 1138, 1141, 1129, 1130, 1141, 1143, 801, 1129, 1135, 839, 842, 1127, 1141, 834, 1129, 1138, 835, 1127, 1126, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1120, 1126, 1129, 1152, 1131, 1130, 1119, 1128, 1114, 848, 1122, 1129, 840, 1110, 863, 841, 1113, 860, 857, 1122, 1117, 1120, 1115, 1119, 1106, 1115, 1101, 1110, 1115, 1112, 1091, 1103, 879, 1105, 1098, 1095, 1285, 1102, 1101, 866, 1094, 1107, 871, 1093, 1089, 1092, 1103, 1086, 1086, 1285, 1096, 1085, 1098, 1285, 1081, 1082, 1083, 872, 1075, 1285, 874, 1080, 873, 1069, 1080, 1077, 1076, 905, 911, 1104, 1079, 1083, 1081, 1068, 1079, 1068, 1065, 1066, 1058, 1062, 1064, 1063, 882, 1057, 1071, 891, 1055, 922, 1068, 1058, 1056, 1069, 1055, 1049, 1062, 1060, 1044, 1285, 925, 1032, 903, 194, 904, 931, 1285, 1039, 1027, 1285, 1015, 1285, 1007, 1007, 940, 1003, 1012, 943, 993, 997, 991, 946, 985, 971, 970, 953, 950, 934, 1285, 898, 907, 888, 887, 1285, 874, 866, 1285, 1285, 1285, 1285, 222, 1285, 908, 1285, 864, 1285, 859, 863, 848, 952, 827, 817, 955, 958, 813, 961, 1285, 782, 1285, 1285, 783, 782, 776, 769, 801, 767, 751, 713, 711, 924, 1285, 734, 706, 965, 968, 704, 672, 664, 661, 1285, 659, 1285, 971, 658, 650, 643, 669, 624, 613, 974, 605, 593, 976, 551, 560, 1285, 519, 525, 488, 485, 979, 1285, 1285, 1285, 1285, 483, 482, 455, 1285, 1285, 1285, 473, 460, 982, 990, 443, 993, 430, 1285, 405, 406, 394, 403, 401, 1285, 1285, 996, 1285, 387, 373, 358, 375, 330, 316, 1285, 999, 281, 1285, 204, 272, 1006, 1285, 245, 227, 220, 197, 1285, 190, 164, 163, 130, 1285, 126, 66, 68, 1285, 67, 45, 1285, 368, 507, 1285, 1285, 1010, 1018, 1022, 1030, 1033, 1037, 1041, 1048, 1052, 1059, 1067, 1075, 1083, 1088, 63 } ; static yyconst short int yy_def[622] = { 0, 606, 1, 1, 3, 1, 5, 607, 607, 608, 608, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 606, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 610, 611, 606, 611, 609, 612, 613, 45, 614, 606, 606, 614, 606, 606, 615, 606, 606, 606, 609, 45, 609, 606, 606, 606, 606, 609, 609, 609, 609, 609, 609, 609, 609, 609, 616, 617, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 618, 619, 610, 611, 611, 606, 45, 613, 620, 606, 613, 621, 48, 614, 614, 615, 606, 609, 609, 609, 609, 609, 609, 609, 609, 616, 606, 617, 606, 606, 609, 609, 609, 609, 609, 606, 609, 606, 609, 609, 609, 609, 609, 609, 609, 609, 609, 618, 606, 619, 606, 620, 621, 606, 609, 609, 609, 606, 609, 606, 609, 609, 609, 606, 609, 609, 609, 609, 609, 606, 606, 606, 606, 606, 609, 609, 609, 609, 609, 609, 609, 609, 609, 606, 606, 609, 609, 609, 606, 606, 609, 609, 609, 609, 606, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 609, 609, 609, 609, 609, 606, 609, 606, 606, 606, 606, 609, 609, 606, 606, 609, 606, 609, 609, 606, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 609, 609, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 609, 609, 606, 606, 609, 606, 609, 609, 606, 609, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 609, 606, 606, 609, 606, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 609, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 609, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 609, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 0, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606 } ; static yyconst short int yy_nxt[1339] = { 0, 12, 13, 14, 13, 15, 12, 15, 16, 17, 18, 12, 12, 12, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 22, 12, 23, 12, 24, 25, 26, 27, 28, 29, 30, 31, 32, 30, 30, 33, 30, 34, 35, 36, 37, 38, 30, 39, 30, 30, 40, 30, 30, 42, 43, 42, 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, 46, 47, 46, 145, 48, 48, 48, 48, 48, 48, 48, 48, 48, 50, 14, 50, 50, 14, 50, 57, 603, 57, 63, 64, 59, 59, 59, 57, 59, 57, 59, 59, 57, 602, 57, 51, 176, 177, 51, 59, 59, 59, 79, 59, 601, 59, 59, 600, 52, 69, 80, 52, 53, 54, 14, 54, 53, 53, 53, 53, 53, 53, 53, 53, 66, 53, 74, 57, 122, 57, 109, 109, 109, 369, 370, 56, 53, 53, 53, 53, 53, 54, 14, 54, 53, 53, 53, 53, 53, 53, 53, 53, 599, 53, 59, 235, 156, 150, 150, 150, 598, 146, 236, 56, 53, 53, 53, 53, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60, 60, 59, 59, 67, 59, 59, 75, 59, 76, 59, 59, 181, 59, 484, 59, 59, 59, 59, 597, 59, 596, 182, 59, 485, 59, 59, 77, 59, 59, 59, 59, 68, 88, 70, 71, 81, 78, 126, 59, 83, 72, 484, 73, 59, 85, 82, 84, 93, 59, 94, 595, 485, 86, 59, 59, 59, 89, 59, 594, 59, 87, 587, 90, 59, 593, 109, 109, 109, 588, 59, 59, 592, 59, 110, 59, 91, 59, 59, 113, 92, 59, 96, 99, 99, 99, 99, 99, 99, 99, 99, 99, 59, 59, 591, 137, 59, 104, 115, 606, 105, 105, 105, 105, 105, 105, 105, 105, 105, 606, 60, 60, 60, 60, 60, 60, 60, 60, 60, 59, 59, 59, 59, 59, 59, 589, 59, 586, 59, 256, 256, 256, 59, 122, 59, 59, 59, 59, 59, 59, 116, 59, 59, 59, 128, 128, 128, 59, 111, 130, 130, 130, 114, 117, 59, 59, 112, 59, 59, 124, 59, 125, 123, 59, 127, 584, 148, 59, 59, 59, 59, 59, 59, 59, 131, 59, 59, 59, 59, 59, 132, 133, 59, 59, 231, 232, 59, 59, 604, 129, 59, 59, 59, 233, 59, 583, 138, 134, 605, 135, 59, 149, 59, 136, 582, 59, 139, 581, 147, 150, 150, 150, 152, 152, 152, 59, 59, 59, 155, 153, 151, 59, 154, 59, 59, 59, 59, 128, 128, 128, 580, 59, 130, 130, 130, 59, 59, 158, 59, 59, 59, 59, 163, 163, 163, 157, 59, 59, 579, 160, 59, 59, 577, 59, 162, 59, 576, 575, 159, 59, 161, 59, 59, 164, 574, 59, 59, 168, 59, 573, 59, 59, 59, 165, 59, 59, 166, 170, 167, 172, 59, 171, 59, 59, 169, 59, 59, 59, 59, 572, 59, 173, 59, 555, 59, 59, 59, 59, 59, 59, 59, 570, 59, 59, 175, 567, 174, 59, 178, 59, 59, 59, 179, 565, 59, 183, 180, 59, 190, 190, 190, 566, 184, 185, 59, 59, 189, 604, 186, 59, 188, 192, 192, 192, 59, 564, 191, 605, 59, 59, 59, 563, 59, 227, 59, 202, 561, 59, 263, 59, 203, 203, 203, 59, 560, 59, 59, 59, 163, 163, 163, 59, 59, 59, 209, 209, 209, 208, 59, 204, 205, 59, 206, 207, 210, 59, 59, 211, 211, 211, 214, 214, 214, 59, 559, 194, 59, 558, 59, 195, 59, 59, 59, 196, 220, 220, 220, 59, 215, 197, 59, 59, 198, 59, 59, 59, 59, 59, 59, 557, 216, 556, 59, 219, 59, 59, 190, 190, 190, 59, 59, 59, 59, 59, 222, 192, 192, 192, 224, 59, 59, 221, 225, 203, 203, 203, 59, 59, 245, 59, 59, 241, 59, 59, 554, 59, 226, 209, 209, 209, 211, 211, 211, 244, 59, 59, 553, 59, 59, 254, 254, 254, 551, 247, 246, 242, 250, 243, 59, 228, 255, 248, 214, 214, 214, 59, 59, 251, 249, 252, 550, 253, 59, 59, 220, 220, 220, 59, 59, 59, 59, 59, 273, 273, 273, 259, 59, 59, 549, 548, 265, 547, 59, 59, 59, 260, 59, 269, 268, 546, 257, 59, 266, 278, 278, 278, 258, 59, 293, 284, 544, 59, 543, 542, 288, 541, 287, 59, 264, 289, 289, 289, 59, 291, 291, 291, 300, 300, 300, 59, 59, 59, 59, 59, 59, 59, 59, 59, 273, 273, 273, 290, 59, 540, 59, 59, 59, 538, 59, 59, 59, 59, 59, 537, 311, 311, 311, 59, 302, 535, 310, 534, 305, 307, 308, 59, 316, 316, 316, 315, 301, 318, 318, 318, 278, 278, 278, 317, 59, 329, 59, 328, 328, 328, 332, 289, 289, 289, 59, 361, 533, 59, 59, 59, 291, 291, 291, 59, 59, 59, 300, 300, 300, 59, 59, 321, 59, 59, 358, 378, 378, 378, 59, 59, 532, 322, 363, 333, 323, 334, 531, 335, 530, 336, 293, 529, 360, 364, 364, 364, 528, 527, 352, 526, 353, 354, 338, 339, 340, 341, 342, 343, 344, 345, 355, 355, 355, 328, 328, 328, 382, 382, 382, 59, 59, 59, 355, 355, 355, 59, 59, 59, 524, 521, 365, 364, 364, 364, 59, 59, 59, 405, 405, 405, 59, 59, 59, 385, 381, 59, 520, 403, 59, 400, 406, 59, 388, 378, 378, 378, 59, 59, 59, 59, 59, 408, 517, 59, 516, 515, 59, 59, 365, 514, 428, 59, 59, 59, 59, 512, 59, 444, 446, 453, 453, 453, 59, 511, 422, 455, 455, 455, 59, 59, 454, 59, 448, 59, 510, 431, 472, 472, 472, 482, 482, 482, 509, 59, 59, 487, 487, 487, 59, 59, 59, 508, 507, 486, 493, 493, 493, 496, 496, 496, 500, 500, 500, 513, 59, 59, 518, 518, 518, 496, 496, 496, 523, 523, 523, 525, 525, 525, 536, 539, 539, 539, 518, 518, 518, 545, 545, 545, 552, 552, 552, 506, 555, 562, 562, 562, 568, 568, 568, 505, 522, 59, 504, 519, 569, 569, 569, 571, 571, 571, 578, 578, 578, 585, 585, 585, 59, 503, 502, 519, 590, 590, 590, 49, 49, 49, 49, 49, 49, 49, 49, 55, 55, 55, 55, 55, 55, 55, 55, 61, 501, 61, 61, 95, 95, 499, 95, 95, 95, 95, 95, 97, 97, 101, 498, 497, 101, 103, 495, 494, 103, 106, 492, 491, 106, 106, 106, 106, 106, 108, 490, 108, 118, 118, 489, 118, 118, 118, 118, 118, 120, 120, 488, 120, 120, 120, 120, 120, 140, 140, 483, 140, 140, 140, 140, 140, 142, 142, 481, 142, 142, 142, 142, 142, 144, 480, 479, 144, 478, 477, 476, 475, 474, 473, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 452, 451, 450, 449, 447, 445, 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, 430, 429, 427, 426, 425, 424, 423, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 407, 404, 402, 401, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 387, 386, 384, 383, 380, 379, 377, 376, 375, 374, 373, 372, 371, 368, 367, 366, 362, 359, 357, 356, 351, 350, 349, 348, 347, 346, 337, 331, 330, 327, 326, 325, 324, 320, 319, 314, 313, 312, 309, 306, 304, 303, 299, 298, 297, 296, 295, 294, 292, 286, 285, 283, 282, 281, 280, 279, 277, 276, 275, 274, 272, 271, 270, 267, 262, 261, 240, 239, 238, 237, 234, 230, 229, 223, 218, 217, 213, 212, 201, 200, 199, 193, 187, 104, 143, 141, 121, 119, 606, 104, 606, 98, 96, 96, 143, 141, 121, 119, 62, 62, 107, 62, 102, 100, 96, 98, 96, 65, 62, 58, 606, 41, 41, 41, 11, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606 } ; static yyconst short int yy_chk[1339] = { 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 621, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 8, 8, 8, 13, 601, 13, 22, 22, 30, 27, 33, 50, 59, 50, 24, 29, 54, 600, 54, 7, 146, 146, 8, 30, 27, 33, 33, 59, 598, 24, 29, 597, 7, 27, 33, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 24, 9, 29, 57, 122, 57, 109, 109, 109, 315, 315, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 596, 10, 25, 197, 122, 150, 150, 150, 594, 109, 197, 10, 10, 10, 10, 10, 20, 25, 20, 20, 20, 20, 20, 20, 20, 20, 20, 26, 61, 25, 28, 20, 31, 32, 31, 80, 35, 150, 37, 447, 31, 34, 26, 61, 593, 28, 592, 150, 32, 447, 80, 35, 32, 37, 36, 31, 34, 26, 37, 28, 28, 34, 32, 80, 38, 35, 28, 484, 28, 36, 36, 34, 35, 40, 39, 40, 591, 484, 36, 38, 90, 40, 38, 67, 589, 70, 36, 582, 38, 39, 588, 66, 66, 66, 582, 90, 40, 587, 67, 67, 70, 38, 66, 72, 70, 39, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 66, 72, 586, 90, 45, 48, 72, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 68, 69, 71, 73, 78, 74, 583, 81, 580, 79, 213, 213, 213, 111, 77, 68, 69, 71, 73, 78, 74, 73, 81, 77, 79, 82, 82, 82, 111, 68, 83, 83, 83, 71, 74, 84, 82, 69, 77, 85, 78, 83, 79, 77, 86, 81, 577, 111, 87, 88, 84, 82, 89, 91, 85, 84, 83, 92, 112, 86, 110, 85, 86, 87, 88, 195, 195, 89, 91, 603, 82, 115, 92, 112, 195, 110, 576, 91, 87, 603, 88, 117, 112, 116, 89, 575, 115, 92, 574, 110, 113, 113, 113, 114, 114, 114, 117, 123, 116, 117, 115, 113, 124, 116, 114, 125, 126, 127, 128, 128, 128, 573, 123, 130, 130, 130, 113, 124, 124, 114, 125, 126, 127, 129, 129, 129, 123, 131, 132, 572, 126, 133, 135, 567, 129, 128, 134, 566, 565, 125, 136, 127, 131, 132, 130, 564, 133, 135, 132, 129, 563, 134, 137, 138, 130, 136, 139, 130, 134, 131, 136, 148, 135, 147, 149, 133, 151, 137, 138, 153, 561, 139, 137, 154, 555, 155, 148, 157, 147, 149, 158, 151, 559, 160, 153, 139, 556, 138, 154, 147, 155, 191, 157, 148, 551, 158, 151, 149, 160, 159, 159, 159, 555, 153, 154, 167, 191, 158, 604, 155, 159, 157, 161, 161, 161, 169, 550, 160, 604, 170, 167, 171, 549, 161, 191, 159, 167, 543, 172, 219, 169, 168, 168, 168, 170, 542, 171, 174, 161, 163, 163, 163, 168, 172, 219, 173, 173, 173, 172, 179, 169, 170, 174, 171, 171, 174, 173, 168, 175, 175, 175, 178, 178, 178, 179, 541, 163, 180, 540, 175, 163, 173, 178, 183, 163, 184, 184, 184, 185, 179, 163, 186, 180, 163, 175, 188, 184, 178, 183, 189, 538, 180, 537, 185, 183, 202, 186, 190, 190, 190, 188, 184, 204, 205, 189, 186, 192, 192, 192, 188, 202, 206, 185, 189, 203, 203, 203, 204, 205, 205, 207, 227, 202, 208, 210, 535, 206, 190, 209, 209, 209, 211, 211, 211, 204, 207, 227, 534, 208, 210, 212, 212, 212, 532, 207, 206, 203, 210, 203, 215, 192, 212, 208, 214, 214, 214, 216, 221, 211, 209, 211, 531, 211, 222, 215, 220, 220, 220, 224, 225, 241, 216, 221, 230, 230, 230, 215, 245, 222, 530, 529, 221, 528, 224, 225, 241, 216, 244, 225, 224, 527, 214, 245, 222, 235, 235, 235, 214, 247, 250, 241, 524, 244, 522, 521, 245, 520, 244, 250, 220, 246, 246, 246, 247, 248, 248, 248, 259, 259, 259, 260, 246, 263, 250, 265, 248, 266, 268, 259, 273, 273, 273, 247, 284, 519, 260, 246, 263, 516, 265, 248, 266, 268, 259, 515, 269, 269, 269, 284, 260, 512, 268, 511, 263, 265, 266, 269, 274, 274, 274, 273, 259, 275, 275, 275, 278, 278, 278, 274, 287, 284, 269, 283, 283, 283, 288, 289, 289, 289, 302, 308, 510, 290, 305, 287, 291, 291, 291, 307, 310, 288, 300, 300, 300, 302, 308, 278, 290, 305, 305, 325, 325, 325, 307, 310, 509, 278, 310, 289, 278, 289, 508, 290, 507, 291, 293, 506, 307, 311, 311, 311, 505, 504, 300, 501, 300, 300, 293, 293, 293, 293, 293, 293, 293, 293, 301, 301, 301, 328, 328, 328, 329, 329, 329, 332, 335, 301, 355, 355, 355, 358, 361, 329, 498, 495, 311, 364, 364, 364, 332, 335, 301, 360, 360, 360, 358, 361, 329, 332, 328, 363, 494, 358, 360, 355, 361, 385, 335, 378, 378, 378, 388, 403, 408, 406, 363, 363, 492, 360, 491, 490, 385, 428, 364, 488, 385, 388, 403, 408, 406, 479, 431, 403, 406, 413, 413, 413, 428, 478, 378, 414, 414, 414, 446, 448, 413, 431, 408, 486, 476, 388, 433, 433, 433, 444, 444, 444, 475, 446, 448, 449, 449, 449, 486, 513, 444, 474, 473, 448, 458, 458, 458, 461, 461, 461, 465, 465, 465, 486, 513, 444, 493, 493, 493, 496, 496, 496, 497, 497, 497, 499, 499, 499, 513, 517, 517, 517, 518, 518, 518, 526, 526, 526, 533, 533, 533, 471, 536, 544, 544, 544, 557, 557, 557, 470, 496, 536, 469, 493, 558, 558, 558, 560, 560, 560, 570, 570, 570, 579, 579, 579, 536, 468, 467, 518, 584, 584, 584, 607, 607, 607, 607, 607, 607, 607, 607, 608, 608, 608, 608, 608, 608, 608, 608, 609, 466, 609, 609, 610, 610, 464, 610, 610, 610, 610, 610, 611, 611, 612, 463, 462, 612, 613, 460, 459, 613, 614, 457, 456, 614, 614, 614, 614, 614, 615, 454, 615, 616, 616, 452, 616, 616, 616, 616, 616, 617, 617, 451, 617, 617, 617, 617, 617, 618, 618, 445, 618, 618, 618, 618, 618, 619, 619, 442, 619, 619, 619, 619, 619, 620, 441, 440, 620, 439, 438, 437, 436, 435, 434, 432, 430, 429, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 412, 411, 410, 409, 407, 404, 402, 401, 400, 398, 397, 396, 394, 393, 392, 391, 390, 389, 387, 386, 384, 383, 381, 380, 379, 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, 362, 359, 357, 356, 354, 353, 352, 351, 350, 349, 348, 347, 346, 337, 336, 334, 333, 331, 330, 327, 326, 324, 323, 322, 321, 320, 319, 317, 314, 313, 312, 309, 306, 304, 303, 299, 298, 297, 296, 295, 294, 292, 286, 285, 282, 281, 280, 279, 277, 276, 272, 271, 270, 267, 264, 262, 261, 258, 257, 255, 253, 252, 251, 249, 243, 242, 240, 239, 238, 237, 236, 234, 233, 232, 231, 229, 228, 226, 223, 218, 217, 201, 200, 199, 198, 196, 194, 193, 187, 182, 181, 177, 176, 166, 165, 164, 162, 156, 144, 142, 140, 120, 118, 103, 101, 100, 98, 97, 96, 94, 93, 76, 75, 62, 56, 52, 51, 47, 46, 44, 43, 42, 23, 21, 18, 11, 6, 4, 2, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "scanner.l" #define INITIAL 0 /* -*- c -*- * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #define YY_NEVER_INTERACTIVE 1 #line 27 "scanner.l" #include "config.h" #include #include #include #include #include "cobc.h" #include "tree.h" #include "parser.h" #define SET_LOCATION(x) \ (x)->source_file = (unsigned char *)cb_source_file; \ (x)->source_line = cb_source_line struct cb_level_78 { struct cb_level_78 *next; struct cb_field *fld78; }; /* Local variables */ static struct cb_level_78 *lev78ptr = NULL; static unsigned char *plexbuff = NULL; static size_t plexsize; static size_t in_procedure; static size_t cb_force_pid_literal = 0; static int last_token_is_dot = 0; static int integer_is_label = 0; static int inside_bracket = 0; static int inside_repository = 0; static int read_literal (int mark); static int scan_x (char *text); static int scan_h (char *text); static int scan_numeric (char *text); static int scan_picture (char *text); static void count_lines (char *text); #define DECIMAL_IS_PERIOD 1 #define DECIMAL_IS_COMMA 2 #define PICTURE_STATE 3 #define FUNCTION_STATE 4 #line 931 "scanner.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #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) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', 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 if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #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 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* 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 break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 70 "scanner.l" if (current_program) { if (current_program->decimal_point == '.') { BEGIN DECIMAL_IS_PERIOD; } else { BEGIN DECIMAL_IS_COMMA; } } /* We treat integer literals immediately after '.' as labels; that is, they must be level numbers or section names. */ integer_is_label = 0; if (last_token_is_dot) { integer_is_label = 1; last_token_is_dot = 0; } #line 1106 "scanner.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { 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; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 607 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1285 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 90 "scanner.l" { cb_source_line++; } YY_BREAK case 2: YY_RULE_SETUP #line 94 "scanner.l" { /* line directive */ char *endp; if (strlen (yytext) > 1 && isdigit (*(yytext + 2))) { cb_source_line = strtol (yytext + 2, &endp, 10) - 1; cb_source_file = strdup (strchr (endp, '"') + 1); strrchr (cb_source_file, '"')[0] = '\0'; } } YY_BREAK case 3: #line 106 "scanner.l" case 4: YY_RULE_SETUP #line 106 "scanner.l" { BEGIN PICTURE_STATE; } YY_BREAK case 5: YY_RULE_SETUP #line 110 "scanner.l" { if (inside_repository) { return FUNCTION; } BEGIN FUNCTION_STATE; } YY_BREAK case 6: YY_RULE_SETUP #line 117 "scanner.l" { inside_repository = 0; return DIVISION; } YY_BREAK case 7: YY_RULE_SETUP #line 122 "scanner.l" { inside_repository = 0; cb_force_pid_literal = 1; return PROGRAM_ID; } YY_BREAK case 8: YY_RULE_SETUP #line 128 "scanner.l" { inside_repository = 0; cb_force_pid_literal = 1; return FUNCTION_ID; } YY_BREAK case 9: YY_RULE_SETUP #line 134 "scanner.l" { inside_repository = 1; return REPOSITORY; } YY_BREAK case 10: YY_RULE_SETUP #line 139 "scanner.l" { /* string literal */ cb_force_pid_literal = 0; return read_literal (yytext[0]); } YY_BREAK case 11: #line 146 "scanner.l" case 12: YY_RULE_SETUP #line 146 "scanner.l" { /* X string literal */ cb_force_pid_literal = 0; return scan_x (yytext + 2); } YY_BREAK case 13: YY_RULE_SETUP #line 152 "scanner.l" { inside_bracket++; return '('; } YY_BREAK case 14: YY_RULE_SETUP #line 157 "scanner.l" { if (inside_bracket > 0) { inside_bracket--; } return ')'; } YY_BREAK case 15: YY_RULE_SETUP #line 164 "scanner.l" { cb_force_pid_literal = 0; if (integer_is_label) { /* integer label */ yylval = cb_build_reference (yytext); SET_LOCATION (yylval); return WORD; } else { /* numeric literal */ return scan_numeric (yytext); } } YY_BREAK case 16: YY_RULE_SETUP #line 177 "scanner.l" { /* Ignore */ } YY_BREAK case 17: YY_RULE_SETUP #line 181 "scanner.l" { if (inside_bracket) { return SEMI_COLON; } /* Ignore */ } YY_BREAK case 18: YY_RULE_SETUP #line 188 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); } YY_BREAK case 19: YY_RULE_SETUP #line 193 "scanner.l" { if (inside_bracket) { return COMMA_DELIM; } /* Ignore */ } YY_BREAK case 20: YY_RULE_SETUP #line 200 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); } YY_BREAK case 21: YY_RULE_SETUP #line 205 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); } YY_BREAK case 22: YY_RULE_SETUP #line 210 "scanner.l" { /* numeric literal */ return scan_numeric (yytext); } YY_BREAK case 23: YY_RULE_SETUP #line 215 "scanner.l" { unput (','); } YY_BREAK case 24: YY_RULE_SETUP #line 219 "scanner.l" { if (inside_bracket) { return COMMA_DELIM; } /* Ignore */ } YY_BREAK case 25: #line 227 "scanner.l" case 26: YY_RULE_SETUP #line 227 "scanner.l" { /* H numeric literal */ cb_force_pid_literal = 0; return scan_h (yytext + 2); } YY_BREAK case 27: YY_RULE_SETUP #line 233 "scanner.l" { cb_force_pid_literal = 1; count_lines (yytext); return END_PROGRAM; } YY_BREAK case 28: YY_RULE_SETUP #line 239 "scanner.l" { cb_force_pid_literal = 1; count_lines (yytext); return END_FUNCTION; } YY_BREAK case 29: YY_RULE_SETUP #line 245 "scanner.l" { count_lines (yytext); return NEXT_SENTENCE; } YY_BREAK case 30: YY_RULE_SETUP #line 250 "scanner.l" { count_lines (yytext); return SCREEN_CONTROL; } YY_BREAK case 31: YY_RULE_SETUP #line 255 "scanner.l" { count_lines (yytext); return EVENT_STATUS; } YY_BREAK case 32: YY_RULE_SETUP #line 260 "scanner.l" { count_lines (yytext); return BLANK_SCREEN; } YY_BREAK case 33: YY_RULE_SETUP #line 265 "scanner.l" { count_lines (yytext); return BLANK_LINE; } YY_BREAK case 34: YY_RULE_SETUP #line 270 "scanner.l" { count_lines (yytext); return CONTROL; } YY_BREAK case 35: YY_RULE_SETUP #line 275 "scanner.l" { count_lines (yytext); return CONTROLS; } YY_BREAK case 36: YY_RULE_SETUP #line 280 "scanner.l" { count_lines (yytext); return CONTROL_HEADING; } YY_BREAK case 37: YY_RULE_SETUP #line 285 "scanner.l" { count_lines (yytext); return CONTROL_FOOTING; } YY_BREAK case 38: YY_RULE_SETUP #line 290 "scanner.l" { count_lines (yytext); return PAGE_HEADING; } YY_BREAK case 39: YY_RULE_SETUP #line 295 "scanner.l" { count_lines (yytext); return PAGE_FOOTING; } YY_BREAK case 40: YY_RULE_SETUP #line 300 "scanner.l" { count_lines (yytext); return REPORT_HEADING; } YY_BREAK case 41: YY_RULE_SETUP #line 305 "scanner.l" { count_lines (yytext); return REPORT_FOOTING; } YY_BREAK case 42: YY_RULE_SETUP #line 310 "scanner.l" { count_lines (yytext); return LAST_DETAIL; } YY_BREAK case 43: YY_RULE_SETUP #line 315 "scanner.l" { count_lines (yytext); return LAST_DETAIL; } YY_BREAK case 44: YY_RULE_SETUP #line 320 "scanner.l" { /* Ignore */ } YY_BREAK case 45: YY_RULE_SETUP #line 324 "scanner.l" { /* Ignore */ } YY_BREAK case 46: YY_RULE_SETUP #line 328 "scanner.l" { count_lines (yytext); return NO_ADVANCING; } YY_BREAK case 47: #line 334 "scanner.l" case 48: YY_RULE_SETUP #line 334 "scanner.l" { count_lines (yytext); return NOT_SIZE_ERROR; } YY_BREAK case 49: #line 340 "scanner.l" case 50: YY_RULE_SETUP #line 340 "scanner.l" { count_lines (yytext); return SIZE_ERROR; } YY_BREAK case 51: #line 346 "scanner.l" case 52: YY_RULE_SETUP #line 346 "scanner.l" { count_lines (yytext); return NOT_EXCEPTION; } YY_BREAK case 53: #line 352 "scanner.l" case 54: YY_RULE_SETUP #line 352 "scanner.l" { count_lines (yytext); return EXCEPTION; } YY_BREAK case 55: #line 358 "scanner.l" case 56: YY_RULE_SETUP #line 358 "scanner.l" { count_lines (yytext); return NOT_OVERFLOW; } YY_BREAK case 57: #line 364 "scanner.l" case 58: YY_RULE_SETUP #line 364 "scanner.l" { count_lines (yytext); return NOT_END; } YY_BREAK case 59: YY_RULE_SETUP #line 369 "scanner.l" { count_lines (yytext); return END; } YY_BREAK case 60: #line 375 "scanner.l" case 61: YY_RULE_SETUP #line 375 "scanner.l" { count_lines (yytext); return OVERFLOW; } YY_BREAK case 62: #line 381 "scanner.l" case 63: #line 382 "scanner.l" case 64: #line 383 "scanner.l" case 65: YY_RULE_SETUP #line 383 "scanner.l" { count_lines (yytext); return NOT_EOP; } YY_BREAK case 66: #line 389 "scanner.l" case 67: #line 390 "scanner.l" case 68: #line 391 "scanner.l" case 69: YY_RULE_SETUP #line 391 "scanner.l" { count_lines (yytext); return EOP; } YY_BREAK case 70: YY_RULE_SETUP #line 396 "scanner.l" { count_lines (yytext); return NOT_INVALID_KEY; } YY_BREAK case 71: YY_RULE_SETUP #line 401 "scanner.l" { count_lines (yytext); return NOT_INVALID_KEY; } YY_BREAK case 72: YY_RULE_SETUP #line 406 "scanner.l" { count_lines (yytext); return INVALID_KEY; } YY_BREAK case 73: YY_RULE_SETUP #line 411 "scanner.l" { count_lines (yytext); return INVALID_KEY; } YY_BREAK case 74: YY_RULE_SETUP #line 416 "scanner.l" { count_lines (yytext); return UPON_ENVIRONMENT_NAME; } YY_BREAK case 75: YY_RULE_SETUP #line 421 "scanner.l" { count_lines (yytext); return UPON_ENVIRONMENT_VALUE; } YY_BREAK case 76: YY_RULE_SETUP #line 426 "scanner.l" { count_lines (yytext); return UPON_ARGUMENT_NUMBER; } YY_BREAK case 77: YY_RULE_SETUP #line 431 "scanner.l" { count_lines (yytext); return UPON_COMMAND_LINE; } YY_BREAK case 78: #line 437 "scanner.l" case 79: YY_RULE_SETUP #line 437 "scanner.l" { /* Ignore */ } YY_BREAK case 80: YY_RULE_SETUP #line 441 "scanner.l" { yylval = cb_build_reference ("SWITCH-1"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 81: YY_RULE_SETUP #line 447 "scanner.l" { yylval = cb_build_reference ("SWITCH-2"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 82: YY_RULE_SETUP #line 453 "scanner.l" { yylval = cb_build_reference ("SWITCH-3"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 83: YY_RULE_SETUP #line 459 "scanner.l" { yylval = cb_build_reference ("SWITCH-4"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 84: YY_RULE_SETUP #line 465 "scanner.l" { yylval = cb_build_reference ("SWITCH-5"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 85: YY_RULE_SETUP #line 471 "scanner.l" { yylval = cb_build_reference ("SWITCH-6"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 86: YY_RULE_SETUP #line 477 "scanner.l" { yylval = cb_build_reference ("SWITCH-7"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 87: YY_RULE_SETUP #line 483 "scanner.l" { yylval = cb_build_reference ("SWITCH-8"); SET_LOCATION (yylval); return WORD; } YY_BREAK case 88: YY_RULE_SETUP #line 489 "scanner.l" { struct cb_word *word; struct cb_level_78 *p78; struct cb_intrinsic_table *cbp; cb_tree x; size_t wordlen; int token; /* Check word length */ wordlen = strlen (yytext); if (wordlen > 31) { cb_error (_("User defined name must be less than 32 characters")); } /* Check FUNCTION name without keyword */ if (in_procedure && functions_are_all) { cbp = lookup_intrinsic (yytext, 1); if (cbp) { yylval = cb_build_reference (yytext); SET_LOCATION (yylval); if (strcasecmp (yytext, "CONCATENATE") == 0) { return CONCATENATE_FUNC; } if (strcasecmp (yytext, "CURRENT-DATE") == 0) { return CURRENT_DATE_FUNC; } if (strcasecmp (yytext, "UPPER-CASE") == 0) { return UPPER_CASE_FUNC; } if (strcasecmp (yytext, "LOWER-CASE") == 0) { return LOWER_CASE_FUNC; } if (strcasecmp (yytext, "REVERSE") == 0) { return REVERSE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE") == 0) { return SUBSTITUTE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE-CASE") == 0) { return SUBSTITUTE_CASE_FUNC; } if (strcasecmp (yytext, "TRIM") == 0) { return TRIM_FUNCTION; } if (strcasecmp (yytext, "WHEN-COMPILED") == 0) { return WHEN_COMPILED_FUNC; } if (strcasecmp (yytext, "NUMVAL-C") == 0) { return NUMVALC_FUNC; } if (strcasecmp (yytext, "LOCALE-DATE") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME-FROM-SECONDS") == 0) { return LOCALE_DT_FUNC; } return FUNCTION_NAME; } } /* Check reserved word */ token = lookup_reserved_word (yytext); if (token != 0) { yylval = NULL; return token; } for (p78 = lev78ptr; p78; p78 = p78->next) { if (strcasecmp (yytext, p78->fld78->name) == 0) { if (non_const_word) { cb_error (_("CONSTANT (78 level) may not be used here - '%s'"), yytext); yylval = cb_error_node; return WORD; } yylval = CB_VALUE (p78->fld78->values); return LITERAL; } } /* User word */ if (cb_force_pid_literal) { /* Force PROGRAM-ID / END PROGRAM */ cb_force_pid_literal = 0; yylval = cb_build_alphanumeric_literal ((unsigned char *)yytext, wordlen); SET_LOCATION (yylval); return PROGRAM_NAME; } yylval = cb_build_reference (yytext); SET_LOCATION (yylval); /* Special name handling */ word = CB_REFERENCE (yylval)->word; if (word->count > 0) { x = CB_VALUE (word->items); if (CB_SYSTEM_NAME_P (x)) { return MNEMONIC_NAME; } } /* Fix me - with the above rules this cannot happen if (yytext[0] == '_' || yytext[0] == '-') { cb_error (_("'_' or '-' is invalid as first character of user defined name")); } if (yytext[wordlen - 1] == '_' || yytext[wordlen - 1] == '-') { cb_error (_("'_' or '-' is invalid as last character of user defined name")); } */ return WORD; } YY_BREAK case 89: YY_RULE_SETUP #line 599 "scanner.l" { yylval = NULL; return LE; } YY_BREAK case 90: YY_RULE_SETUP #line 604 "scanner.l" { yylval = NULL; return GE; } YY_BREAK case 91: YY_RULE_SETUP #line 609 "scanner.l" { yylval = NULL; return NE; } YY_BREAK case 92: YY_RULE_SETUP #line 614 "scanner.l" { yylval = NULL; return '^'; } YY_BREAK case 93: YY_RULE_SETUP #line 619 "scanner.l" { last_token_is_dot = 1; yylval = NULL; return '.'; } YY_BREAK case 94: YY_RULE_SETUP #line 625 "scanner.l" { yylval = NULL; return yytext[0]; } YY_BREAK case 95: YY_RULE_SETUP #line 632 "scanner.l" { /* ignore */ } YY_BREAK case 96: YY_RULE_SETUP #line 635 "scanner.l" { BEGIN INITIAL; return scan_picture (yytext); } YY_BREAK case 97: YY_RULE_SETUP #line 642 "scanner.l" { BEGIN INITIAL; yylval = cb_build_reference (yytext); SET_LOCATION (yylval); if (strcasecmp (yytext, "CONCATENATE") == 0) { return CONCATENATE_FUNC; } if (strcasecmp (yytext, "CURRENT-DATE") == 0) { return CURRENT_DATE_FUNC; } if (strcasecmp (yytext, "UPPER-CASE") == 0) { return UPPER_CASE_FUNC; } if (strcasecmp (yytext, "LOWER-CASE") == 0) { return LOWER_CASE_FUNC; } if (strcasecmp (yytext, "REVERSE") == 0) { return REVERSE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE") == 0) { return SUBSTITUTE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE-CASE") == 0) { return SUBSTITUTE_CASE_FUNC; } if (strcasecmp (yytext, "TRIM") == 0) { return TRIM_FUNCTION; } if (strcasecmp (yytext, "WHEN-COMPILED") == 0) { return WHEN_COMPILED_FUNC; } if (strcasecmp (yytext, "NUMVAL-C") == 0) { return NUMVALC_FUNC; } if (strcasecmp (yytext, "LOCALE-DATE") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME-FROM-SECONDS") == 0) { return LOCALE_DT_FUNC; } return FUNCTION_NAME; } YY_BREAK case 98: YY_RULE_SETUP #line 687 "scanner.l" { yylval = NULL; return yytext[0]; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(DECIMAL_IS_PERIOD): case YY_STATE_EOF(DECIMAL_IS_COMMA): case YY_STATE_EOF(PICTURE_STATE): case YY_STATE_EOF(FUNCTION_STATE): #line 693 "scanner.l" { last_token_is_dot = 0; integer_is_label = 0; inside_bracket = 0; inside_repository = 0; lev78ptr = NULL; cb_force_pid_literal = 0; yyterminate (); } YY_BREAK case 99: YY_RULE_SETUP #line 703 "scanner.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 2075 "scanner.c" 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->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->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->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->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 { 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->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 yylex */ /* 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 */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->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->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 607 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } 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 ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 607 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 606); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #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->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = 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 ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; 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; yy_current_buffer->yy_at_bol = (c == '\n'); return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { 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->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = 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; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( 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 *) yy_flex_alloc( 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; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #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(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { 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 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = 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 = 0; 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 #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[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_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* 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 (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 703 "scanner.l" static int read_literal (int mark) { size_t i = 0; int c; if (!plexbuff) { plexbuff = cobc_malloc (COB_MINI_BUFF); plexsize = COB_MINI_BUFF; } while ((c = input ()) != EOF) { plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--; unput (c); break; } if (i >= plexsize) { plexsize *= 2; plexbuff = cobc_realloc (plexbuff, plexsize); } } if (!i) { cb_warning (_("Alphanumeric literal has zero length")); cb_warning (_("A SPACE will be assumed")); i = 1; plexbuff[0] = ' '; } plexbuff[i] = 0; yylval = cb_build_alphanumeric_literal (plexbuff, i); SET_LOCATION (yylval); return LITERAL; } static int scan_x (char *text) { unsigned char *src; unsigned char *dst; size_t currlen; int high = 1; int c; if (!plexbuff) { plexbuff = cobc_malloc (COB_MINI_BUFF); plexsize = COB_MINI_BUFF; } currlen = strlen (text); if (currlen > plexsize) { plexsize = currlen; plexbuff = cobc_realloc (plexbuff, plexsize); } dst = plexbuff; src = (unsigned char *)text; while (isalnum (*src)) { c = toupper (*src); if ('0' <= c && c <= '9') { c = c - '0'; } else if ('A' <= c && c <= 'F') { c = c - 'A' + 10; } else { goto error; } if (high) { *dst = c << 4; } else { *dst++ += c; } src++; high = 1 - high; } if (high) { yylval = cb_build_alphanumeric_literal (plexbuff, dst - plexbuff); SET_LOCATION (yylval); return LITERAL; } /* Fall through */ error: cb_error (_("Invalid X literal: %s"), text); yylval = cb_error_node; return LITERAL; } static int scan_h (char *text) { unsigned char *p; long long val = 0; int c; char buff[48]; for (p = (unsigned char *)text; *p != '\'' && *p != '\"'; p++) { c = toupper (*p); if ('0' <= c && c <= '9') { c = c - '0'; } else if ('A' <= c && c <= 'F') { c = c - 'A' + 10; } else { goto error; } val = (val << 4) + c; } #ifdef _WIN32 sprintf (buff, "%I64d", val); #else sprintf (buff, "%lld", val); #endif yylval = cb_build_numeric_literal (0, (unsigned char *)buff, 0); SET_LOCATION (yylval); return LITERAL; error: cb_error (_("Invalid H literal: %s"), text); yylval = cb_error_node; return LITERAL; } static int scan_numeric (char *text) { unsigned char *s; int sign; int scale = 0; /* get sign */ sign = (*text == '+') ? 1 : (*text == '-') ? -1 : 0; if (sign) { text++; } /* get decimal point */ s = (unsigned char *)strchr (text, current_program->decimal_point); if (s) { scale = strlen ((char *)s) - 1; memmove (s, s + 1, (size_t)(scale + 1)); } if (strchr (text, '.')) { cb_error (_("Invalid numeric literal")); } if (strchr (text, ',')) { cb_error (_("Invalid numeric literal")); } yylval = cb_build_numeric_literal (sign, (unsigned char *)text, scale); SET_LOCATION (yylval); return LITERAL; } static int can_replace (const char *src1, const char *src2, const size_t size, const size_t iteration) { const unsigned char *p; if (strncasecmp (src1, src2, size)) { return 0; } p = (const unsigned char *)src1 + size; if (isalnum (*p) || *p == '-' || *p == '_') { return 0; } if (iteration) { p = (const unsigned char *)src1 - 1; if (isalnum (*p) || *p == '-' || *p == '_') { return 0; } } return 1; } static int scan_picture (char *text) { unsigned char *p; struct cb_level_78 *p78; size_t n; size_t i; size_t size; size_t sizep; char buff[COB_SMALL_BUFF]; char buff2[COB_SMALL_BUFF]; /* normalize the input */ for (p = (unsigned char *)text; *p; p++) { /* unput trailing '.' or ',' */ if (p[1] == 0 && (*p == '.' || *p == ',')) { unput (*p); *p = 0; break; } /* upcase */ *p = toupper (*p); } if (lev78ptr) { memset (buff, 0, sizeof (buff)); memset (buff2, 0, sizeof (buff2)); strcpy (buff, text); for (p78 = lev78ptr; p78; p78 = p78->next) { if (p78->fld78->values == cb_error_node) { strcpy (buff2, buff); continue; } if (CB_VALUE(p78->fld78->values) == cb_error_node) { strcpy (buff2, buff); continue; } p = (unsigned char *)CB_LITERAL(CB_VALUE(p78->fld78->values))->data; size = strlen (p78->fld78->name); sizep = strlen ((char *)p); i = 0; for (n = 0; n < strlen (buff); n++) { if (can_replace (&buff[n], p78->fld78->name, size, n)) { memcpy (&buff2[i], p, sizep); n += size - 1; i += sizep; } else { buff2[i++] = buff[n]; } } buff2[i] = 0; strcpy (buff, buff2); } yylval = cb_build_picture (buff2); } else { yylval = cb_build_picture (text); } return PICTURE; } static void count_lines (char *text) { char *p; for (p = text; *p; p++) { if (*p == '\n') { cb_source_line++; } } } void cb_reset_in_procedure (void) { in_procedure = 0; } void cb_set_in_procedure (void) { in_procedure = 1; } void cb_reset_78 (void) { lev78ptr = NULL; } void cb_add_78 (struct cb_field *f) { struct cb_level_78 *p78; p78 = cobc_malloc (sizeof(struct cb_level_78)); p78->fld78 = f; p78->next = lev78ptr; lev78ptr = p78; } struct cb_field * check_level_78 (const char *name) { struct cb_level_78 *p78; for (p78 = lev78ptr; p78; p78 = p78->next) { if (strcasecmp (name, p78->fld78->name) == 0) { return p78->fld78; } } return NULL; } open-cobol-1.1/cobc/scanner.l0000644000000000000000000004420111142344354011555 /* -*- c -*- * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ %option 8bit %option caseless %option noyywrap %option never-interactive %{ #include "config.h" #include #include #include #include #include "cobc.h" #include "tree.h" #include "parser.h" #define SET_LOCATION(x) \ (x)->source_file = (unsigned char *)cb_source_file; \ (x)->source_line = cb_source_line struct cb_level_78 { struct cb_level_78 *next; struct cb_field *fld78; }; /* Local variables */ static struct cb_level_78 *lev78ptr = NULL; static unsigned char *plexbuff = NULL; static size_t plexsize; static size_t in_procedure; static size_t cb_force_pid_literal = 0; static int last_token_is_dot = 0; static int integer_is_label = 0; static int inside_bracket = 0; static int inside_repository = 0; static int read_literal (int mark); static int scan_x (char *text); static int scan_h (char *text); static int scan_numeric (char *text); static int scan_picture (char *text); static void count_lines (char *text); %} %s DECIMAL_IS_PERIOD DECIMAL_IS_COMMA %x PICTURE_STATE FUNCTION_STATE %% %{ if (current_program) { if (current_program->decimal_point == '.') { BEGIN DECIMAL_IS_PERIOD; } else { BEGIN DECIMAL_IS_COMMA; } } /* We treat integer literals immediately after '.' as labels; that is, they must be level numbers or section names. */ integer_is_label = 0; if (last_token_is_dot) { integer_is_label = 1; last_token_is_dot = 0; } %} <*>\n { cb_source_line++; } ^"#".* { /* line directive */ char *endp; if (strlen (yytext) > 1 && isdigit (*(yytext + 2))) { cb_source_line = strtol (yytext + 2, &endp, 10) - 1; cb_source_file = strdup (strchr (endp, '"') + 1); strrchr (cb_source_file, '"')[0] = '\0'; } } "PIC" | "PICTURE" { BEGIN PICTURE_STATE; } "FUNCTION" { if (inside_repository) { return FUNCTION; } BEGIN FUNCTION_STATE; } "DIVISION" { inside_repository = 0; return DIVISION; } "PROGRAM-ID" { inside_repository = 0; cb_force_pid_literal = 1; return PROGRAM_ID; } "FUNCTION-ID" { inside_repository = 0; cb_force_pid_literal = 1; return FUNCTION_ID; } "REPOSITORY" { inside_repository = 1; return REPOSITORY; } [\'\"] { /* string literal */ cb_force_pid_literal = 0; return read_literal (yytext[0]); } X\'[^\'\n]*\' | X\"[^\"\n]*\" { /* X string literal */ cb_force_pid_literal = 0; return scan_x (yytext + 2); } "(" { inside_bracket++; return '('; } ")" { if (inside_bracket > 0) { inside_bracket--; } return ')'; } [0-9]+ { cb_force_pid_literal = 0; if (integer_is_label) { /* integer label */ yylval = cb_build_reference (yytext); SET_LOCATION (yylval); return WORD; } else { /* numeric literal */ return scan_numeric (yytext); } } <*>[ \t]+ { /* Ignore */ } <*>;+ { if (inside_bracket) { return SEMI_COLON; } /* Ignore */ } [+-]?[0-9.]*[0-9]+ { /* numeric literal */ return scan_numeric (yytext); } ,+ { if (inside_bracket) { return COMMA_DELIM; } /* Ignore */ } [+-]?[0-9]+[,]?[0-9]+ { /* numeric literal */ return scan_numeric (yytext); } [+-]?,[0-9]+ { /* numeric literal */ return scan_numeric (yytext); } [+-]?[0-9]+ { /* numeric literal */ return scan_numeric (yytext); } ,, { unput (','); } , { if (inside_bracket) { return COMMA_DELIM; } /* Ignore */ } H\'[^\'\n]*\' | H\"[^\"\n]*\" { /* H numeric literal */ cb_force_pid_literal = 0; return scan_h (yytext + 2); } "END"[ \t\n]+"PROGRAM" { cb_force_pid_literal = 1; count_lines (yytext); return END_PROGRAM; } "END"[ \t\n]+"FUNCTION" { cb_force_pid_literal = 1; count_lines (yytext); return END_FUNCTION; } "NEXT"[ \t\n]+"SENTENCE" { count_lines (yytext); return NEXT_SENTENCE; } "SCREEN"[ \t\n]+"CONTROL" { count_lines (yytext); return SCREEN_CONTROL; } "EVENT"[ \t\n]+"STATUS" { count_lines (yytext); return EVENT_STATUS; } "BLANK"[ \t\n]+"SCREEN" { count_lines (yytext); return BLANK_SCREEN; } "BLANK"[ \t\n]+"LINE" { count_lines (yytext); return BLANK_LINE; } "CONTROL"[ \t\n]+"IS" { count_lines (yytext); return CONTROL; } "CONTROLS"[ \t\n]+"ARE" { count_lines (yytext); return CONTROLS; } "CONTROL"[ \t\n]+"HEADING" { count_lines (yytext); return CONTROL_HEADING; } "CONTROL"[ \t\n]+"FOOTING" { count_lines (yytext); return CONTROL_FOOTING; } "PAGE"[ \t\n]+"HEADING" { count_lines (yytext); return PAGE_HEADING; } "PAGE"[ \t\n]+"FOOTING" { count_lines (yytext); return PAGE_FOOTING; } "REPORT"[ \t\n]+"HEADING" { count_lines (yytext); return REPORT_HEADING; } "REPORT"[ \t\n]+"FOOTING" { count_lines (yytext); return REPORT_FOOTING; } "LAST"[ \t\n]+"DETAIL" { count_lines (yytext); return LAST_DETAIL; } "LAST"[ \t\n]+"DE" { count_lines (yytext); return LAST_DETAIL; } "LIMIT" { /* Ignore */ } "LIMITS" { /* Ignore */ } "NO"[ \t\n]+"ADVANCING" { count_lines (yytext); return NO_ADVANCING; } "NOT"[ \t\n]+"ON"[ \t\n]+"SIZE"[ \t\n]+"ERROR"[ \t\n] | "NOT"[ \t\n]+"SIZE"[ \t\n]+"ERROR"[ \t\n] { count_lines (yytext); return NOT_SIZE_ERROR; } "ON"[ \t\n]+"SIZE"[ \t\n]+"ERROR"[ \t\n] | "SIZE"[ \t\n]+"ERROR"[ \t\n] { count_lines (yytext); return SIZE_ERROR; } "NOT"[ \t\n]+"ON"[ \t\n]+"EXCEPTION"[ \t\n] | "NOT"[ \t\n]+"EXCEPTION"[ \t\n] { count_lines (yytext); return NOT_EXCEPTION; } "ON"[ \t\n]+"EXCEPTION"[ \t\n] | "EXCEPTION"[ \t\n] { count_lines (yytext); return EXCEPTION; } "NOT"[ \t\n]+"ON"[ \t\n]+"OVERFLOW"[ \t\n] | "NOT"[ \t\n]+"OVERFLOW"[ \t\n] { count_lines (yytext); return NOT_OVERFLOW; } "NOT"[ \t\n]+"AT"[ \t\n]+"END"[ \t\n] | "NOT"[ \t\n]+"END"[ \t\n] { count_lines (yytext); return NOT_END; } "AT"[ \t\n]+"END"[ \t\n] { count_lines (yytext); return END; } "ON"[ \t\n]+"OVERFLOW"[ \t\n] | "OVERFLOW"[ \t\n] { count_lines (yytext); return OVERFLOW; } "NOT"[ \t\n]+"AT"[ \t\n]+"END-OF-PAGE"[ \t\n] | "NOT"[ \t\n]+"AT"[ \t\n]+"EOP"[ \t\n] | "NOT"[ \t\n]+"END-OF-PAGE"[ \t\n] | "NOT"[ \t\n]+"EOP"[ \t\n] { count_lines (yytext); return NOT_EOP; } "AT"[ \t\n]+"END-OF-PAGE"[ \t\n] | "AT"[ \t\n]+"EOP"[ \t\n] | "END-OF-PAGE"[ \t\n] | "EOP"[ \t\n] { count_lines (yytext); return EOP; } "NOT"[ \t\n]+"INVALID"[ \t\n]+"KEY"[ \t\n] { count_lines (yytext); return NOT_INVALID_KEY; } "NOT"[ \t\n]+"INVALID"[ \t\n] { count_lines (yytext); return NOT_INVALID_KEY; } "INVALID"[ \t\n]+"KEY"[ \t\n] { count_lines (yytext); return INVALID_KEY; } "INVALID"[ \t\n] { count_lines (yytext); return INVALID_KEY; } "UPON"[ \t\n]+"ENVIRONMENT-NAME" { count_lines (yytext); return UPON_ENVIRONMENT_NAME; } "UPON"[ \t\n]+"ENVIRONMENT-VALUE" { count_lines (yytext); return UPON_ENVIRONMENT_VALUE; } "UPON"[ \t\n]+"ARGUMENT-NUMBER" { count_lines (yytext); return UPON_ARGUMENT_NUMBER; } "UPON"[ \t\n]+"COMMAND-LINE" { count_lines (yytext); return UPON_COMMAND_LINE; } "ID"[ ]+"DIVISION"[ ]*"." | "IDENTIFICATION"[ ]+"DIVISION"[ ]*"." { /* Ignore */ } "SWITCH"[ ]+"1" { yylval = cb_build_reference ("SWITCH-1"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"2" { yylval = cb_build_reference ("SWITCH-2"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"3" { yylval = cb_build_reference ("SWITCH-3"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"4" { yylval = cb_build_reference ("SWITCH-4"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"5" { yylval = cb_build_reference ("SWITCH-5"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"6" { yylval = cb_build_reference ("SWITCH-6"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"7" { yylval = cb_build_reference ("SWITCH-7"); SET_LOCATION (yylval); return WORD; } "SWITCH"[ ]+"8" { yylval = cb_build_reference ("SWITCH-8"); SET_LOCATION (yylval); return WORD; } [A-Z0-9]([_A-Z0-9-]*[A-Z0-9]+)? { struct cb_word *word; struct cb_level_78 *p78; struct cb_intrinsic_table *cbp; cb_tree x; size_t wordlen; int token; /* Check word length */ wordlen = strlen (yytext); if (wordlen > 31) { cb_error (_("User defined name must be less than 32 characters")); } /* Check FUNCTION name without keyword */ if (in_procedure && functions_are_all) { cbp = lookup_intrinsic (yytext, 1); if (cbp) { yylval = cb_build_reference (yytext); SET_LOCATION (yylval); if (strcasecmp (yytext, "CONCATENATE") == 0) { return CONCATENATE_FUNC; } if (strcasecmp (yytext, "CURRENT-DATE") == 0) { return CURRENT_DATE_FUNC; } if (strcasecmp (yytext, "UPPER-CASE") == 0) { return UPPER_CASE_FUNC; } if (strcasecmp (yytext, "LOWER-CASE") == 0) { return LOWER_CASE_FUNC; } if (strcasecmp (yytext, "REVERSE") == 0) { return REVERSE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE") == 0) { return SUBSTITUTE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE-CASE") == 0) { return SUBSTITUTE_CASE_FUNC; } if (strcasecmp (yytext, "TRIM") == 0) { return TRIM_FUNCTION; } if (strcasecmp (yytext, "WHEN-COMPILED") == 0) { return WHEN_COMPILED_FUNC; } if (strcasecmp (yytext, "NUMVAL-C") == 0) { return NUMVALC_FUNC; } if (strcasecmp (yytext, "LOCALE-DATE") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME-FROM-SECONDS") == 0) { return LOCALE_DT_FUNC; } return FUNCTION_NAME; } } /* Check reserved word */ token = lookup_reserved_word (yytext); if (token != 0) { yylval = NULL; return token; } for (p78 = lev78ptr; p78; p78 = p78->next) { if (strcasecmp (yytext, p78->fld78->name) == 0) { if (non_const_word) { cb_error (_("CONSTANT (78 level) may not be used here - '%s'"), yytext); yylval = cb_error_node; return WORD; } yylval = CB_VALUE (p78->fld78->values); return LITERAL; } } /* User word */ if (cb_force_pid_literal) { /* Force PROGRAM-ID / END PROGRAM */ cb_force_pid_literal = 0; yylval = cb_build_alphanumeric_literal ((unsigned char *)yytext, wordlen); SET_LOCATION (yylval); return PROGRAM_NAME; } yylval = cb_build_reference (yytext); SET_LOCATION (yylval); /* Special name handling */ word = CB_REFERENCE (yylval)->word; if (word->count > 0) { x = CB_VALUE (word->items); if (CB_SYSTEM_NAME_P (x)) { return MNEMONIC_NAME; } } /* Fix me - with the above rules this cannot happen if (yytext[0] == '_' || yytext[0] == '-') { cb_error (_("'_' or '-' is invalid as first character of user defined name")); } if (yytext[wordlen - 1] == '_' || yytext[wordlen - 1] == '-') { cb_error (_("'_' or '-' is invalid as last character of user defined name")); } */ return WORD; } "<=" { yylval = NULL; return LE; } ">=" { yylval = NULL; return GE; } "<>" { yylval = NULL; return NE; } "**" { yylval = NULL; return '^'; } "." { last_token_is_dot = 1; yylval = NULL; return '.'; } . { yylval = NULL; return yytext[0]; } { "IS" { /* ignore */ } [^ \t\n;]+ { BEGIN INITIAL; return scan_picture (yytext); } } { [a-z0-9-]+ { BEGIN INITIAL; yylval = cb_build_reference (yytext); SET_LOCATION (yylval); if (strcasecmp (yytext, "CONCATENATE") == 0) { return CONCATENATE_FUNC; } if (strcasecmp (yytext, "CURRENT-DATE") == 0) { return CURRENT_DATE_FUNC; } if (strcasecmp (yytext, "UPPER-CASE") == 0) { return UPPER_CASE_FUNC; } if (strcasecmp (yytext, "LOWER-CASE") == 0) { return LOWER_CASE_FUNC; } if (strcasecmp (yytext, "REVERSE") == 0) { return REVERSE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE") == 0) { return SUBSTITUTE_FUNC; } if (strcasecmp (yytext, "SUBSTITUTE-CASE") == 0) { return SUBSTITUTE_CASE_FUNC; } if (strcasecmp (yytext, "TRIM") == 0) { return TRIM_FUNCTION; } if (strcasecmp (yytext, "WHEN-COMPILED") == 0) { return WHEN_COMPILED_FUNC; } if (strcasecmp (yytext, "NUMVAL-C") == 0) { return NUMVALC_FUNC; } if (strcasecmp (yytext, "LOCALE-DATE") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME") == 0) { return LOCALE_DT_FUNC; } if (strcasecmp (yytext, "LOCALE-TIME-FROM-SECONDS") == 0) { return LOCALE_DT_FUNC; } return FUNCTION_NAME; } . { yylval = NULL; return yytext[0]; } } <> { last_token_is_dot = 0; integer_is_label = 0; inside_bracket = 0; inside_repository = 0; lev78ptr = NULL; cb_force_pid_literal = 0; yyterminate (); } %% static int read_literal (int mark) { size_t i = 0; int c; if (!plexbuff) { plexbuff = cobc_malloc (COB_MINI_BUFF); plexsize = COB_MINI_BUFF; } while ((c = input ()) != EOF) { plexbuff[i++] = c; if (c == mark && (c = input ()) != mark) { i--; unput (c); break; } if (i >= plexsize) { plexsize *= 2; plexbuff = cobc_realloc (plexbuff, plexsize); } } if (!i) { cb_warning (_("Alphanumeric literal has zero length")); cb_warning (_("A SPACE will be assumed")); i = 1; plexbuff[0] = ' '; } plexbuff[i] = 0; yylval = cb_build_alphanumeric_literal (plexbuff, i); SET_LOCATION (yylval); return LITERAL; } static int scan_x (char *text) { unsigned char *src; unsigned char *dst; size_t currlen; int high = 1; int c; if (!plexbuff) { plexbuff = cobc_malloc (COB_MINI_BUFF); plexsize = COB_MINI_BUFF; } currlen = strlen (text); if (currlen > plexsize) { plexsize = currlen; plexbuff = cobc_realloc (plexbuff, plexsize); } dst = plexbuff; src = (unsigned char *)text; while (isalnum (*src)) { c = toupper (*src); if ('0' <= c && c <= '9') { c = c - '0'; } else if ('A' <= c && c <= 'F') { c = c - 'A' + 10; } else { goto error; } if (high) { *dst = c << 4; } else { *dst++ += c; } src++; high = 1 - high; } if (high) { yylval = cb_build_alphanumeric_literal (plexbuff, dst - plexbuff); SET_LOCATION (yylval); return LITERAL; } /* Fall through */ error: cb_error (_("Invalid X literal: %s"), text); yylval = cb_error_node; return LITERAL; } static int scan_h (char *text) { unsigned char *p; long long val = 0; int c; char buff[48]; for (p = (unsigned char *)text; *p != '\'' && *p != '\"'; p++) { c = toupper (*p); if ('0' <= c && c <= '9') { c = c - '0'; } else if ('A' <= c && c <= 'F') { c = c - 'A' + 10; } else { goto error; } val = (val << 4) + c; } #ifdef _WIN32 sprintf (buff, "%I64d", val); #else sprintf (buff, "%lld", val); #endif yylval = cb_build_numeric_literal (0, (unsigned char *)buff, 0); SET_LOCATION (yylval); return LITERAL; error: cb_error (_("Invalid H literal: %s"), text); yylval = cb_error_node; return LITERAL; } static int scan_numeric (char *text) { unsigned char *s; int sign; int scale = 0; /* get sign */ sign = (*text == '+') ? 1 : (*text == '-') ? -1 : 0; if (sign) { text++; } /* get decimal point */ s = (unsigned char *)strchr (text, current_program->decimal_point); if (s) { scale = strlen ((char *)s) - 1; memmove (s, s + 1, (size_t)(scale + 1)); } if (strchr (text, '.')) { cb_error (_("Invalid numeric literal")); } if (strchr (text, ',')) { cb_error (_("Invalid numeric literal")); } yylval = cb_build_numeric_literal (sign, (unsigned char *)text, scale); SET_LOCATION (yylval); return LITERAL; } static int can_replace (const char *src1, const char *src2, const size_t size, const size_t iteration) { const unsigned char *p; if (strncasecmp (src1, src2, size)) { return 0; } p = (const unsigned char *)src1 + size; if (isalnum (*p) || *p == '-' || *p == '_') { return 0; } if (iteration) { p = (const unsigned char *)src1 - 1; if (isalnum (*p) || *p == '-' || *p == '_') { return 0; } } return 1; } static int scan_picture (char *text) { unsigned char *p; struct cb_level_78 *p78; size_t n; size_t i; size_t size; size_t sizep; char buff[COB_SMALL_BUFF]; char buff2[COB_SMALL_BUFF]; /* normalize the input */ for (p = (unsigned char *)text; *p; p++) { /* unput trailing '.' or ',' */ if (p[1] == 0 && (*p == '.' || *p == ',')) { unput (*p); *p = 0; break; } /* upcase */ *p = toupper (*p); } if (lev78ptr) { memset (buff, 0, sizeof (buff)); memset (buff2, 0, sizeof (buff2)); strcpy (buff, text); for (p78 = lev78ptr; p78; p78 = p78->next) { if (p78->fld78->values == cb_error_node) { strcpy (buff2, buff); continue; } if (CB_VALUE(p78->fld78->values) == cb_error_node) { strcpy (buff2, buff); continue; } p = (unsigned char *)CB_LITERAL(CB_VALUE(p78->fld78->values))->data; size = strlen (p78->fld78->name); sizep = strlen ((char *)p); i = 0; for (n = 0; n < strlen (buff); n++) { if (can_replace (&buff[n], p78->fld78->name, size, n)) { memcpy (&buff2[i], p, sizep); n += size - 1; i += sizep; } else { buff2[i++] = buff[n]; } } buff2[i] = 0; strcpy (buff, buff2); } yylval = cb_build_picture (buff2); } else { yylval = cb_build_picture (text); } return PICTURE; } static void count_lines (char *text) { char *p; for (p = text; *p; p++) { if (*p == '\n') { cb_source_line++; } } } void cb_reset_in_procedure (void) { in_procedure = 0; } void cb_set_in_procedure (void) { in_procedure = 1; } void cb_reset_78 (void) { lev78ptr = NULL; } void cb_add_78 (struct cb_field *f) { struct cb_level_78 *p78; p78 = cobc_malloc (sizeof(struct cb_level_78)); p78->fld78 = f; p78->next = lev78ptr; lev78ptr = p78; } struct cb_field * check_level_78 (const char *name) { struct cb_level_78 *p78; for (p78 = lev78ptr; p78; p78 = p78->next) { if (strcasecmp (name, p78->fld78->name) == 0) { return p78->fld78; } } return NULL; } open-cobol-1.1/cobc/config.c0000644000000000000000000001731611136614062011366 /* * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include "defaults.h" #include #include #include #include #include "cobc.h" #undef CB_CONFIG_ANY #undef CB_CONFIG_INT #undef CB_CONFIG_STRING #undef CB_CONFIG_BOOLEAN #undef CB_CONFIG_SUPPORT #define CB_CONFIG_ANY(type,var,name) type var; #define CB_CONFIG_INT(var,name) int var; #define CB_CONFIG_STRING(var,name) const char *var; #define CB_CONFIG_BOOLEAN(var,name) int var; #define CB_CONFIG_SUPPORT(var,name) enum cb_support var; #include "config.def" enum cb_config_type { ANY, INT, /* integer */ STRING, /* "..." */ BOOLEAN, /* 'yes', 'no' */ SUPPORT /* 'ok', 'archaic', 'obsolete', 'skip', 'ignore', 'unconformable' */ }; struct noreserve *norestab = NULL; static struct { const enum cb_config_type type; const char *name; void *var; char *val; } config_table[] = { {STRING, "include", NULL, NULL}, {STRING, "not-reserved", NULL, NULL}, #undef CB_CONFIG_ANY #undef CB_CONFIG_INT #undef CB_CONFIG_STRING #undef CB_CONFIG_BOOLEAN #undef CB_CONFIG_SUPPORT #define CB_CONFIG_ANY(type,var,name) {ANY, name, &var, NULL}, #define CB_CONFIG_INT(var,name) {INT, name, &var, NULL}, #define CB_CONFIG_STRING(var,name) {STRING, name, &var, NULL}, #define CB_CONFIG_BOOLEAN(var,name) {BOOLEAN, name, &var, NULL}, #define CB_CONFIG_SUPPORT(var,name) {SUPPORT, name, &var, NULL}, #include "config.def" {0, NULL, NULL, NULL} }; static char * read_string (const char *text) { char *p; char *s = strdup (text); if (*s == '\"') { s++; } for (p = s; *p; p++) { if (*p == '\"') { *p = '\0'; } } return s; } static void invalid_value (const char *fname, const int line, const char *name) { fprintf (stderr, _("%s:%d: invalid value for '%s'\n"), fname, line, name); } static void unsupported_value (const char *fname, const int line, const char *val) { fprintf (stderr, _("%s:%d: '%s' not supported\n"), fname, line, val); } int cb_load_std (const char *name) { return cb_load_conf (name, 1, 1); } int cb_load_conf (const char *fname, const int check_nodef, const int prefix_dir) { char *s; char *e; const char *name; const char *val; void *var; FILE *fp; char *nores; struct noreserve *noresptr; int i; int j; int ret; int saveret; int line; char buff[COB_SMALL_BUFF]; /* initialize the config table */ if (check_nodef) { for (i = 0; config_table[i].name; i++) { config_table[i].val = NULL; } } if (prefix_dir) { snprintf (buff, COB_SMALL_MAX, "%s/%s", cob_config_dir, fname); name = buff; } else { name = fname; } /* open the config file */ fp = fopen (name, "r"); if (fp == NULL) { perror (name); return -1; } /* read the config file */ ret = 0; line = 0; while (fgets (buff, COB_SMALL_BUFF, fp)) { line++; /* skip comments */ if (buff[0] == '#') { continue; } /* skip blank lines */ for (s = buff; *s; s++) { if (isgraph (*s)) { break; } } if (!*s) { continue; } /* get the tag */ s = strpbrk (buff, " \t:="); if (!s) { fprintf (stderr, "%s:%d: invalid line\n", fname, line); ret = -1; continue; } *s = 0; /* find the entry */ for (i = 0; config_table[i].name; i++) { if (strcmp (buff, config_table[i].name) == 0) { break; } } if (!config_table[i].name) { fprintf (stderr, "%s:%d: unknown tag '%s'\n", fname, line, buff); ret = -1; continue; } /* get the value */ for (s++; *s && strchr (" \t:=", *s); s++) { ; } e = s + strlen (s) - 1; for (; e >= s && strchr (" \t\r\n", *e); e--) { ; } e[1] = 0; config_table[i].val = s; /* set the value */ name = config_table[i].name; var = config_table[i].var; val = config_table[i].val; switch (config_table[i].type) { case ANY: if (strcmp (name, "assign-clause") == 0) { if (strcmp (val, "cobol2002") == 0) { unsupported_value (fname, line, val); ret = -1; } else if (strcmp (val, "mf") == 0) { cb_assign_clause = CB_ASSIGN_MF; } else if (strcmp (val, "ibm") == 0) { cb_assign_clause = CB_ASSIGN_IBM; } else { invalid_value (fname, line, name); ret = -1; } } else if (strcmp (name, "binary-size") == 0) { if (strcmp (val, "2-4-8") == 0) { cb_binary_size = CB_BINARY_SIZE_2_4_8; } else if (strcmp (val, "1-2-4-8") == 0) { cb_binary_size = CB_BINARY_SIZE_1_2_4_8; } else if (strcmp (val, "1--8") == 0) { cb_binary_size = CB_BINARY_SIZE_1__8; } else { invalid_value (fname, line, name); ret = -1; } } else if (strcmp (name, "binary-byteorder") == 0) { if (strcmp (val, "native") == 0) { cb_binary_byteorder = CB_BYTEORDER_NATIVE; } else if (strcmp (val, "big-endian") == 0) { cb_binary_byteorder = CB_BYTEORDER_BIG_ENDIAN; } else { invalid_value (fname, line, name); ret = -1; } } break; case INT: for (j = 0; val[j]; j++) { if (!isdigit (val[j])) { invalid_value (fname, line, name); ret = -1; break; } } *((int *)var) = atoi (val); break; case STRING: val = read_string (val); if (strcmp (name, "include") == 0) { /* include another conf file */ saveret = ret; if (cb_load_conf (val, 0, 1) != 0) { return -1; } ret = saveret; } else if (strcmp (name, "not-reserved") == 0) { nores = read_string (val); noresptr = cobc_malloc (sizeof (struct noreserve)); noresptr->noresword = cobc_malloc (strlen (nores) + 1); strcpy (noresptr->noresword, nores); noresptr->next = norestab; norestab = noresptr; } else { *((const char **)var) = val; } break; case BOOLEAN: if (strcmp (val, "yes") == 0) { *((int *)var) = 1; } else if (strcmp (val, "no") == 0) { *((int *)var) = 0; } else { invalid_value (fname, line, name); ret = -1; } break; case SUPPORT: if (strcmp (val, "ok") == 0) { *((enum cb_support *)var) = CB_OK; } else if (strcmp (val, "warning") == 0) { *((enum cb_support *)var) = CB_WARNING; } else if (strcmp (val, "archaic") == 0) { *((enum cb_support *)var) = CB_ARCHAIC; } else if (strcmp (val, "obsolete") == 0) { *((enum cb_support *)var) = CB_OBSOLETE; } else if (strcmp (val, "skip") == 0) { *((enum cb_support *)var) = CB_SKIP; } else if (strcmp (val, "ignore") == 0) { *((enum cb_support *)var) = CB_IGNORE; } else if (strcmp (val, "error") == 0) { *((enum cb_support *)var) = CB_ERROR; } else if (strcmp (val, "unconformable") == 0) { *((enum cb_support *)var) = CB_UNCONFORMABLE; } else { invalid_value (fname, line, name); ret = -1; } break; default: fprintf (stderr, _("%s:%d: invalid type for '%s'\n"), fname, line, name); ret = -1; break; } } fclose (fp); /* checks for no definition */ if (check_nodef) { for (i = 2; config_table[i].name; i++) { if (config_table[i].val == NULL) { fprintf (stderr, "%s: no definition of '%s'\n", fname, config_table[i].name); ret = -1; } } } return ret; } open-cobol-1.1/cobc/Makefile.am0000644000000000000000000000121411140120631011764 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## bin_PROGRAMS = cobc cobc_SOURCES = cobc.c cobc.h config.c tree.c tree.h reserved.c error.c \ parser.c parser.h scanner.c field.c typeck.c codegen.c \ ppparse.c ppparse.h pplex.c config.def flag.def warning.def cobc_CFLAGS = -I$(top_srcdir) cobc_LDADD = $(COBC_LIBS) $(top_builddir)/lib/libsupport.a BUILT_SOURCES = parser.c parser.h scanner.c ppparse.c ppparse.h pplex.c EXTRA_DIST = ppparse.y pplex.l parser.y scanner.l CLEANFILES = parser.output %.c: %.l flex -s -o$@ $< %.c: %.y bison -o $@ $< open-cobol-1.1/cobc/Makefile.in0000644000000000000000000011055511140121170012005 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = cobc$(EXEEXT) subdir = cobc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_cobc_OBJECTS = cobc-cobc.$(OBJEXT) cobc-config.$(OBJEXT) \ cobc-tree.$(OBJEXT) cobc-reserved.$(OBJEXT) \ cobc-error.$(OBJEXT) cobc-parser.$(OBJEXT) \ cobc-scanner.$(OBJEXT) cobc-field.$(OBJEXT) \ cobc-typeck.$(OBJEXT) cobc-codegen.$(OBJEXT) \ cobc-ppparse.$(OBJEXT) cobc-pplex.$(OBJEXT) cobc_OBJECTS = $(am_cobc_OBJECTS) am__DEPENDENCIES_1 = cobc_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/lib/libsupport.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(cobc_SOURCES) DIST_SOURCES = $(cobc_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ cobc_SOURCES = cobc.c cobc.h config.c tree.c tree.h reserved.c error.c \ parser.c parser.h scanner.c field.c typeck.c codegen.c \ ppparse.c ppparse.h pplex.c config.def flag.def warning.def cobc_CFLAGS = -I$(top_srcdir) cobc_LDADD = $(COBC_LIBS) $(top_builddir)/lib/libsupport.a BUILT_SOURCES = parser.c parser.h scanner.c ppparse.c ppparse.h pplex.c EXTRA_DIST = ppparse.y pplex.l parser.y scanner.l CLEANFILES = parser.output all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cobc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu cobc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done cobc$(EXEEXT): $(cobc_OBJECTS) $(cobc_DEPENDENCIES) @rm -f cobc$(EXEEXT) $(LINK) $(cobc_LDFLAGS) $(cobc_OBJECTS) $(cobc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-cobc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-codegen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-field.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-pplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-ppparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-reserved.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-scanner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cobc-typeck.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< cobc-cobc.o: cobc.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-cobc.o -MD -MP -MF "$(DEPDIR)/cobc-cobc.Tpo" -c -o cobc-cobc.o `test -f 'cobc.c' || echo '$(srcdir)/'`cobc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-cobc.Tpo" "$(DEPDIR)/cobc-cobc.Po"; else rm -f "$(DEPDIR)/cobc-cobc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cobc.c' object='cobc-cobc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-cobc.o `test -f 'cobc.c' || echo '$(srcdir)/'`cobc.c cobc-cobc.obj: cobc.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-cobc.obj -MD -MP -MF "$(DEPDIR)/cobc-cobc.Tpo" -c -o cobc-cobc.obj `if test -f 'cobc.c'; then $(CYGPATH_W) 'cobc.c'; else $(CYGPATH_W) '$(srcdir)/cobc.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-cobc.Tpo" "$(DEPDIR)/cobc-cobc.Po"; else rm -f "$(DEPDIR)/cobc-cobc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cobc.c' object='cobc-cobc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-cobc.obj `if test -f 'cobc.c'; then $(CYGPATH_W) 'cobc.c'; else $(CYGPATH_W) '$(srcdir)/cobc.c'; fi` cobc-config.o: config.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-config.o -MD -MP -MF "$(DEPDIR)/cobc-config.Tpo" -c -o cobc-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-config.Tpo" "$(DEPDIR)/cobc-config.Po"; else rm -f "$(DEPDIR)/cobc-config.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config.c' object='cobc-config.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-config.o `test -f 'config.c' || echo '$(srcdir)/'`config.c cobc-config.obj: config.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-config.obj -MD -MP -MF "$(DEPDIR)/cobc-config.Tpo" -c -o cobc-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-config.Tpo" "$(DEPDIR)/cobc-config.Po"; else rm -f "$(DEPDIR)/cobc-config.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config.c' object='cobc-config.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-config.obj `if test -f 'config.c'; then $(CYGPATH_W) 'config.c'; else $(CYGPATH_W) '$(srcdir)/config.c'; fi` cobc-tree.o: tree.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-tree.o -MD -MP -MF "$(DEPDIR)/cobc-tree.Tpo" -c -o cobc-tree.o `test -f 'tree.c' || echo '$(srcdir)/'`tree.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-tree.Tpo" "$(DEPDIR)/cobc-tree.Po"; else rm -f "$(DEPDIR)/cobc-tree.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tree.c' object='cobc-tree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-tree.o `test -f 'tree.c' || echo '$(srcdir)/'`tree.c cobc-tree.obj: tree.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-tree.obj -MD -MP -MF "$(DEPDIR)/cobc-tree.Tpo" -c -o cobc-tree.obj `if test -f 'tree.c'; then $(CYGPATH_W) 'tree.c'; else $(CYGPATH_W) '$(srcdir)/tree.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-tree.Tpo" "$(DEPDIR)/cobc-tree.Po"; else rm -f "$(DEPDIR)/cobc-tree.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tree.c' object='cobc-tree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-tree.obj `if test -f 'tree.c'; then $(CYGPATH_W) 'tree.c'; else $(CYGPATH_W) '$(srcdir)/tree.c'; fi` cobc-reserved.o: reserved.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-reserved.o -MD -MP -MF "$(DEPDIR)/cobc-reserved.Tpo" -c -o cobc-reserved.o `test -f 'reserved.c' || echo '$(srcdir)/'`reserved.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-reserved.Tpo" "$(DEPDIR)/cobc-reserved.Po"; else rm -f "$(DEPDIR)/cobc-reserved.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reserved.c' object='cobc-reserved.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-reserved.o `test -f 'reserved.c' || echo '$(srcdir)/'`reserved.c cobc-reserved.obj: reserved.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-reserved.obj -MD -MP -MF "$(DEPDIR)/cobc-reserved.Tpo" -c -o cobc-reserved.obj `if test -f 'reserved.c'; then $(CYGPATH_W) 'reserved.c'; else $(CYGPATH_W) '$(srcdir)/reserved.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-reserved.Tpo" "$(DEPDIR)/cobc-reserved.Po"; else rm -f "$(DEPDIR)/cobc-reserved.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='reserved.c' object='cobc-reserved.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-reserved.obj `if test -f 'reserved.c'; then $(CYGPATH_W) 'reserved.c'; else $(CYGPATH_W) '$(srcdir)/reserved.c'; fi` cobc-error.o: error.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-error.o -MD -MP -MF "$(DEPDIR)/cobc-error.Tpo" -c -o cobc-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-error.Tpo" "$(DEPDIR)/cobc-error.Po"; else rm -f "$(DEPDIR)/cobc-error.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='cobc-error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c cobc-error.obj: error.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-error.obj -MD -MP -MF "$(DEPDIR)/cobc-error.Tpo" -c -o cobc-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-error.Tpo" "$(DEPDIR)/cobc-error.Po"; else rm -f "$(DEPDIR)/cobc-error.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='error.c' object='cobc-error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` cobc-parser.o: parser.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-parser.o -MD -MP -MF "$(DEPDIR)/cobc-parser.Tpo" -c -o cobc-parser.o `test -f 'parser.c' || echo '$(srcdir)/'`parser.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-parser.Tpo" "$(DEPDIR)/cobc-parser.Po"; else rm -f "$(DEPDIR)/cobc-parser.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser.c' object='cobc-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-parser.o `test -f 'parser.c' || echo '$(srcdir)/'`parser.c cobc-parser.obj: parser.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-parser.obj -MD -MP -MF "$(DEPDIR)/cobc-parser.Tpo" -c -o cobc-parser.obj `if test -f 'parser.c'; then $(CYGPATH_W) 'parser.c'; else $(CYGPATH_W) '$(srcdir)/parser.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-parser.Tpo" "$(DEPDIR)/cobc-parser.Po"; else rm -f "$(DEPDIR)/cobc-parser.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parser.c' object='cobc-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-parser.obj `if test -f 'parser.c'; then $(CYGPATH_W) 'parser.c'; else $(CYGPATH_W) '$(srcdir)/parser.c'; fi` cobc-scanner.o: scanner.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-scanner.o -MD -MP -MF "$(DEPDIR)/cobc-scanner.Tpo" -c -o cobc-scanner.o `test -f 'scanner.c' || echo '$(srcdir)/'`scanner.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-scanner.Tpo" "$(DEPDIR)/cobc-scanner.Po"; else rm -f "$(DEPDIR)/cobc-scanner.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scanner.c' object='cobc-scanner.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-scanner.o `test -f 'scanner.c' || echo '$(srcdir)/'`scanner.c cobc-scanner.obj: scanner.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-scanner.obj -MD -MP -MF "$(DEPDIR)/cobc-scanner.Tpo" -c -o cobc-scanner.obj `if test -f 'scanner.c'; then $(CYGPATH_W) 'scanner.c'; else $(CYGPATH_W) '$(srcdir)/scanner.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-scanner.Tpo" "$(DEPDIR)/cobc-scanner.Po"; else rm -f "$(DEPDIR)/cobc-scanner.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scanner.c' object='cobc-scanner.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-scanner.obj `if test -f 'scanner.c'; then $(CYGPATH_W) 'scanner.c'; else $(CYGPATH_W) '$(srcdir)/scanner.c'; fi` cobc-field.o: field.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-field.o -MD -MP -MF "$(DEPDIR)/cobc-field.Tpo" -c -o cobc-field.o `test -f 'field.c' || echo '$(srcdir)/'`field.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-field.Tpo" "$(DEPDIR)/cobc-field.Po"; else rm -f "$(DEPDIR)/cobc-field.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='field.c' object='cobc-field.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-field.o `test -f 'field.c' || echo '$(srcdir)/'`field.c cobc-field.obj: field.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-field.obj -MD -MP -MF "$(DEPDIR)/cobc-field.Tpo" -c -o cobc-field.obj `if test -f 'field.c'; then $(CYGPATH_W) 'field.c'; else $(CYGPATH_W) '$(srcdir)/field.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-field.Tpo" "$(DEPDIR)/cobc-field.Po"; else rm -f "$(DEPDIR)/cobc-field.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='field.c' object='cobc-field.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-field.obj `if test -f 'field.c'; then $(CYGPATH_W) 'field.c'; else $(CYGPATH_W) '$(srcdir)/field.c'; fi` cobc-typeck.o: typeck.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-typeck.o -MD -MP -MF "$(DEPDIR)/cobc-typeck.Tpo" -c -o cobc-typeck.o `test -f 'typeck.c' || echo '$(srcdir)/'`typeck.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-typeck.Tpo" "$(DEPDIR)/cobc-typeck.Po"; else rm -f "$(DEPDIR)/cobc-typeck.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='typeck.c' object='cobc-typeck.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-typeck.o `test -f 'typeck.c' || echo '$(srcdir)/'`typeck.c cobc-typeck.obj: typeck.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-typeck.obj -MD -MP -MF "$(DEPDIR)/cobc-typeck.Tpo" -c -o cobc-typeck.obj `if test -f 'typeck.c'; then $(CYGPATH_W) 'typeck.c'; else $(CYGPATH_W) '$(srcdir)/typeck.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-typeck.Tpo" "$(DEPDIR)/cobc-typeck.Po"; else rm -f "$(DEPDIR)/cobc-typeck.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='typeck.c' object='cobc-typeck.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-typeck.obj `if test -f 'typeck.c'; then $(CYGPATH_W) 'typeck.c'; else $(CYGPATH_W) '$(srcdir)/typeck.c'; fi` cobc-codegen.o: codegen.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-codegen.o -MD -MP -MF "$(DEPDIR)/cobc-codegen.Tpo" -c -o cobc-codegen.o `test -f 'codegen.c' || echo '$(srcdir)/'`codegen.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-codegen.Tpo" "$(DEPDIR)/cobc-codegen.Po"; else rm -f "$(DEPDIR)/cobc-codegen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='codegen.c' object='cobc-codegen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-codegen.o `test -f 'codegen.c' || echo '$(srcdir)/'`codegen.c cobc-codegen.obj: codegen.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-codegen.obj -MD -MP -MF "$(DEPDIR)/cobc-codegen.Tpo" -c -o cobc-codegen.obj `if test -f 'codegen.c'; then $(CYGPATH_W) 'codegen.c'; else $(CYGPATH_W) '$(srcdir)/codegen.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-codegen.Tpo" "$(DEPDIR)/cobc-codegen.Po"; else rm -f "$(DEPDIR)/cobc-codegen.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='codegen.c' object='cobc-codegen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-codegen.obj `if test -f 'codegen.c'; then $(CYGPATH_W) 'codegen.c'; else $(CYGPATH_W) '$(srcdir)/codegen.c'; fi` cobc-ppparse.o: ppparse.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-ppparse.o -MD -MP -MF "$(DEPDIR)/cobc-ppparse.Tpo" -c -o cobc-ppparse.o `test -f 'ppparse.c' || echo '$(srcdir)/'`ppparse.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-ppparse.Tpo" "$(DEPDIR)/cobc-ppparse.Po"; else rm -f "$(DEPDIR)/cobc-ppparse.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ppparse.c' object='cobc-ppparse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-ppparse.o `test -f 'ppparse.c' || echo '$(srcdir)/'`ppparse.c cobc-ppparse.obj: ppparse.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-ppparse.obj -MD -MP -MF "$(DEPDIR)/cobc-ppparse.Tpo" -c -o cobc-ppparse.obj `if test -f 'ppparse.c'; then $(CYGPATH_W) 'ppparse.c'; else $(CYGPATH_W) '$(srcdir)/ppparse.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-ppparse.Tpo" "$(DEPDIR)/cobc-ppparse.Po"; else rm -f "$(DEPDIR)/cobc-ppparse.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ppparse.c' object='cobc-ppparse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-ppparse.obj `if test -f 'ppparse.c'; then $(CYGPATH_W) 'ppparse.c'; else $(CYGPATH_W) '$(srcdir)/ppparse.c'; fi` cobc-pplex.o: pplex.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-pplex.o -MD -MP -MF "$(DEPDIR)/cobc-pplex.Tpo" -c -o cobc-pplex.o `test -f 'pplex.c' || echo '$(srcdir)/'`pplex.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-pplex.Tpo" "$(DEPDIR)/cobc-pplex.Po"; else rm -f "$(DEPDIR)/cobc-pplex.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pplex.c' object='cobc-pplex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-pplex.o `test -f 'pplex.c' || echo '$(srcdir)/'`pplex.c cobc-pplex.obj: pplex.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -MT cobc-pplex.obj -MD -MP -MF "$(DEPDIR)/cobc-pplex.Tpo" -c -o cobc-pplex.obj `if test -f 'pplex.c'; then $(CYGPATH_W) 'pplex.c'; else $(CYGPATH_W) '$(srcdir)/pplex.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cobc-pplex.Tpo" "$(DEPDIR)/cobc-pplex.Po"; else rm -f "$(DEPDIR)/cobc-pplex.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pplex.c' object='cobc-pplex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cobc_CFLAGS) $(CFLAGS) -c -o cobc-pplex.obj `if test -f 'pplex.c'; then $(CYGPATH_W) 'pplex.c'; else $(CYGPATH_W) '$(srcdir)/pplex.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am %.c: %.l flex -s -o$@ $< %.c: %.y bison -o $@ $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/cobc/reserved.c0000644000000000000000000010511711141313555011734 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include "cobc.h" #include "tree.h" #include "parser.h" static struct { const char *name; const enum cb_system_name_category category; const int token; cb_tree node; } system_table[] = { {"SYSIN", CB_DEVICE_NAME, CB_DEVICE_SYSIN, NULL}, {"SYSIPT", CB_DEVICE_NAME, CB_DEVICE_SYSIN, NULL}, {"SYSOUT", CB_DEVICE_NAME, CB_DEVICE_SYSOUT, NULL}, {"SYSLIST", CB_DEVICE_NAME, CB_DEVICE_SYSOUT, NULL}, {"SYSLST", CB_DEVICE_NAME, CB_DEVICE_SYSOUT, NULL}, {"PRINTER", CB_DEVICE_NAME, CB_DEVICE_SYSOUT, NULL}, {"SYSERR", CB_DEVICE_NAME, CB_DEVICE_SYSERR, NULL}, {"CONSOLE", CB_DEVICE_NAME, CB_DEVICE_CONSOLE, NULL}, {"C01", CB_FEATURE_NAME, CB_FEATURE_C01, NULL}, {"C02", CB_FEATURE_NAME, CB_FEATURE_C02, NULL}, {"C03", CB_FEATURE_NAME, CB_FEATURE_C03, NULL}, {"C04", CB_FEATURE_NAME, CB_FEATURE_C04, NULL}, {"C05", CB_FEATURE_NAME, CB_FEATURE_C05, NULL}, {"C06", CB_FEATURE_NAME, CB_FEATURE_C06, NULL}, {"C07", CB_FEATURE_NAME, CB_FEATURE_C07, NULL}, {"C08", CB_FEATURE_NAME, CB_FEATURE_C08, NULL}, {"C09", CB_FEATURE_NAME, CB_FEATURE_C09, NULL}, {"C10", CB_FEATURE_NAME, CB_FEATURE_C10, NULL}, {"C11", CB_FEATURE_NAME, CB_FEATURE_C11, NULL}, {"C12", CB_FEATURE_NAME, CB_FEATURE_C12, NULL}, {"FORMFEED", CB_FEATURE_NAME, CB_FEATURE_FORMFEED, NULL}, {"SWITCH-1", CB_SWITCH_NAME, CB_SWITCH_1, NULL}, {"SWITCH-2", CB_SWITCH_NAME, CB_SWITCH_2, NULL}, {"SWITCH-3", CB_SWITCH_NAME, CB_SWITCH_3, NULL}, {"SWITCH-4", CB_SWITCH_NAME, CB_SWITCH_4, NULL}, {"SWITCH-5", CB_SWITCH_NAME, CB_SWITCH_5, NULL}, {"SWITCH-6", CB_SWITCH_NAME, CB_SWITCH_6, NULL}, {"SWITCH-7", CB_SWITCH_NAME, CB_SWITCH_7, NULL}, {"SWITCH-8", CB_SWITCH_NAME, CB_SWITCH_8, NULL}, {NULL, 0, 0, NULL} }; struct reserved { const char *name; const int token; }; static const struct reserved reserved_words[] = { {"ACCEPT", ACCEPT}, /* 2002 */ {"ACCESS", ACCESS}, /* 2002 */ {"ACTIVE-CLASS", -1}, /* 2002 */ {"ADD", ADD}, /* 2002 */ {"ADDRESS", ADDRESS}, /* 2002 */ {"ADVANCING", ADVANCING}, /* 2002 */ {"AFTER", AFTER}, /* 2002 */ {"ALIGNED", -1}, /* 2002 */ {"ALL", ALL}, /* 2002 */ {"ALLOCATE", ALLOCATE}, /* 2002 */ {"ALPHABET", ALPHABET}, /* 2002 */ {"ALPHABETIC", ALPHABETIC}, /* 2002 */ {"ALPHABETIC-LOWER", ALPHABETIC_LOWER}, /* 2002 */ {"ALPHABETIC-UPPER", ALPHABETIC_UPPER}, /* 2002 */ {"ALPHANUMERIC", ALPHANUMERIC}, /* 2002 */ {"ALPHANUMERIC-EDITED", ALPHANUMERIC_EDITED}, /* 2002 */ {"ALSO", ALSO}, /* 2002 */ {"ALTER", ALTER}, /* 85 */ {"ALTERNATE", ALTERNATE}, /* 2002 */ {"AND", AND}, /* 2002 */ {"ANY", ANY}, /* 2002 */ {"ANYCASE", -1}, /* 2002 */ {"ARE", ARE}, /* 2002 */ {"AREA", AREA}, /* 2002 */ {"AREAS", AREA}, /* 2002 */ {"ARGUMENT-NUMBER", ARGUMENT_NUMBER}, /* extension */ {"ARGUMENT-VALUE", ARGUMENT_VALUE}, /* extension */ {"ARITHMETIC", -1}, /* 2002 (C/S) */ {"AS", AS}, /* 2002 */ {"ASCENDING", ASCENDING}, /* 2002 */ {"ASSIGN", ASSIGN}, /* 2002 */ {"AT", AT}, /* 2002 */ {"ATTRIBUTE", -1}, /* 2002 (C/S) */ {"AUTO", AUTO}, /* 2002 (C/S) */ {"AUTO-SKIP", AUTO}, /* extension */ {"AUTOMATIC", AUTOMATIC}, /* extension */ {"AUTOTERMINATE", AUTO}, /* extension */ {"B-AND", -1}, /* 2002 */ {"B-NOT", -1}, /* 2002 */ {"B-OR", -1}, /* 2002 */ {"B-XOR", -1}, /* 2002 */ {"BACKGROUND-COLOR", BACKGROUND_COLOR}, /* 2002 (C/S) */ {"BASED", BASED}, /* 2002 */ {"BEEP", BELL}, /* extension */ {"BEFORE", BEFORE}, /* 2002 */ {"BELL", BELL}, /* 2002 (C/S) */ {"BINARY", BINARY}, /* 2002 */ {"BINARY-C-LONG", BINARY_C_LONG}, /* Extension */ {"BINARY-CHAR", BINARY_CHAR}, /* 2002 */ {"BINARY-DOUBLE", BINARY_DOUBLE}, /* 2002 */ {"BINARY-LONG", BINARY_LONG}, /* 2002 */ {"BINARY-SHORT", BINARY_SHORT}, /* 2002 */ {"BIT", -1}, /* 2002 */ {"BLANK", BLANK}, /* 2002 */ {"BLINK", BLINK}, /* 2002 (C/S) */ {"BLOCK", BLOCK}, /* 2002 */ {"BOOLEAN", -1}, /* 2002 */ {"BOTTOM", BOTTOM}, /* 2002 */ {"BY", BY}, /* 2002 */ {"BYTE-LENGTH", BYTE_LENGTH}, /* 2002 (C/S) */ {"CALL", CALL}, /* 2002 */ {"CANCEL", CANCEL}, /* 2002 */ {"CD", -1}, /* 2002 */ {"CENTER", -1}, /* 2002 (C/S) */ {"CF", CONTROL_FOOTING}, /* 2002 */ {"CH", CONTROL_HEADING}, /* 2002 */ {"CHAIN", -1}, /* extension */ {"CHAINING", CHAINING}, /* extension */ {"CHARACTER", CHARACTER}, /* 2002 */ {"CHARACTERS", CHARACTERS}, /* 2002 */ {"CLASS", CLASS}, /* 2002 */ {"CLASS-ID", -1}, /* 2002 */ {"CLASSIFICATION", -1}, /* 2002 (C/S) */ {"CLOSE", CLOSE}, /* 2002 */ {"CODE", CODE}, /* 2002 */ {"CODE-SET", CODE_SET}, /* 2002 */ {"COL", COLUMN}, /* 2002 */ {"COLLATING", COLLATING}, /* 2002 */ {"COLS", COLUMNS}, /* 2002 */ {"COLUMN", COLUMN}, /* 2002 */ {"COLUMNS", COLUMNS}, /* 2002 */ {"COMMA", COMMA}, /* 2002 */ {"COMMAND-LINE", COMMAND_LINE}, /* extension */ {"COMMIT", COMMIT}, /* extension */ {"COMMON", COMMON}, /* 2002 */ {"COMMUNICATION", -1}, /* 2002 */ {"COMP", COMP}, /* 2002 */ #ifdef __MVS__ /* EBCDIC! */ {"COMP-X", COMP_X}, /* extension */ #endif {"COMP-1", COMP_1}, /* extension */ {"COMP-2", COMP_2}, /* extension */ {"COMP-3", COMP_3}, /* extension */ {"COMP-4", COMP_4}, /* extension */ {"COMP-5", COMP_5}, /* extension */ #ifndef __MVS__ {"COMP-X", COMP_X}, /* extension */ #endif {"COMPUTATIONAL", COMP}, /* 2002 */ #ifdef __MVS__ /* EBCDIC! */ {"COMPUTATIONAL-X", COMP_X}, /* extension */ #endif {"COMPUTATIONAL-1", COMP_1}, /* extension */ {"COMPUTATIONAL-2", COMP_2}, /* extension */ {"COMPUTATIONAL-3", COMP_3}, /* extension */ {"COMPUTATIONAL-4", COMP_4}, /* extension */ {"COMPUTATIONAL-5", COMP_5}, /* extension */ #ifndef __MVS__ {"COMPUTATIONAL-X", COMP_X}, /* extension */ #endif {"COMPUTE", COMPUTE}, /* 2002 */ {"CONDITION", -1}, /* 2002 */ {"CONFIGURATION", CONFIGURATION}, /* 2002 */ {"CONSTANT", CONSTANT}, /* 2002 */ {"CONTAINS", CONTAINS}, /* 2002 */ {"CONTENT", CONTENT}, /* 2002 */ {"CONTINUE", CONTINUE}, /* 2002 */ {"CONTROL", CONTROL}, /* 2002 */ {"CONTROLS", CONTROL}, /* 2002 */ {"CONVERTING", CONVERTING}, /* 2002 */ {"COPY", 0}, /* 2002 */ {"CORR", CORRESPONDING}, /* 2002 */ {"CORRESPONDING", CORRESPONDING}, /* 2002 */ {"COUNT", COUNT}, /* 2002 */ {"CRT", CRT}, /* 2002 */ {"CURRENCY", CURRENCY}, /* 2002 */ {"CURSOR", CURSOR}, /* 2002 */ {"CYCLE", CYCLE}, /* 2002 (C/S) */ {"DATA", DATA}, /* 2002 */ {"DATA-POINTER", -1}, /* 2002 */ {"DATE", DATE}, /* 2002 */ {"DAY", DAY}, /* 2002 */ {"DAY-OF-WEEK", DAY_OF_WEEK}, /* 2002 */ {"DE", DETAIL}, /* 2002 */ {"DEBUGGING", DEBUGGING}, /* 2002 */ {"DECIMAL-POINT", DECIMAL_POINT}, /* 2002 */ {"DECLARATIVES", DECLARATIVES}, /* 2002 */ {"DEFAULT", DEFAULT}, /* 2002 */ {"DELETE", DELETE}, /* 2002 */ {"DELIMITED", DELIMITED}, /* 2002 */ {"DELIMITER", DELIMITER}, /* 2002 */ {"DEPENDING", DEPENDING}, /* 2002 */ {"DESCENDING", DESCENDING}, /* 2002 */ {"DESTINATION", -1}, /* 2002 */ {"DETAIL", DETAIL}, /* 2002 */ {"DISABLE", -1}, /* 2002 */ {"DISK", DISK}, /* extension */ {"DISPLAY", DISPLAY}, /* 2002 */ {"DIVIDE", DIVIDE}, /* 2002 */ {"DIVISION", DIVISION}, /* 2002 */ {"DOWN", DOWN}, /* 2002 */ {"DUPLICATES", DUPLICATES}, /* 2002 */ {"DYNAMIC", DYNAMIC}, /* 2002 */ {"EBCDIC", EBCDIC}, /* extension */ {"EC", -1}, /* 2002 */ {"EGI", -1}, /* 2002 */ {"ELSE", ELSE}, /* 2002 */ {"EMI", -1}, /* 2002 */ {"ENABLE", -1}, /* 2002 */ {"END", END}, /* 2002 */ {"END-ACCEPT", END_ACCEPT}, /* 2002 */ {"END-ADD", END_ADD}, /* 2002 */ {"END-CALL", END_CALL}, /* 2002 */ {"END-COMPUTE", END_COMPUTE}, /* 2002 */ {"END-DELETE", END_DELETE}, /* 2002 */ {"END-DISPLAY", END_DISPLAY}, /* 2002 */ {"END-DIVIDE", END_DIVIDE}, /* 2002 */ {"END-EVALUATE", END_EVALUATE}, /* 2002 */ {"END-IF", END_IF}, /* 2002 */ {"END-MULTIPLY", END_MULTIPLY}, /* 2002 */ {"END-OF-PAGE", EOP}, /* 2002 */ {"END-PERFORM", END_PERFORM}, /* 2002 */ {"END-READ", END_READ}, /* 2002 */ {"END-RECEIVE", -1}, /* 2002 */ {"END-RETURN", END_RETURN}, /* 2002 */ {"END-REWRITE", END_REWRITE}, /* 2002 */ {"END-SEARCH", END_SEARCH}, /* 2002 */ {"END-START", END_START}, /* 2002 */ {"END-STRING", END_STRING}, /* 2002 */ {"END-SUBTRACT", END_SUBTRACT}, /* 2002 */ {"END-UNSTRING", END_UNSTRING}, /* 2002 */ {"END-WRITE", END_WRITE}, /* 2002 */ {"ENTRY", ENTRY}, /* extension */ {"ENTRY-CONVENTION", -1}, /* 2002 (C/S) */ {"ENVIRONMENT", ENVIRONMENT}, /* 2002 */ {"ENVIRONMENT-NAME", ENVIRONMENT_NAME}, /* extension */ {"ENVIRONMENT-VALUE", ENVIRONMENT_VALUE}, /* extension */ {"EO", -1}, /* 2002 */ {"EOL", EOL}, /* 2002 (C/S) */ {"EOP", EOP}, /* 2002 */ {"EOS", EOS}, /* 2002 (C/S) */ {"EQUAL", EQUAL}, /* 2002 */ {"EQUALS", EQUALS}, /* extension */ {"ERASE", ERASE}, /* 2002 (C/S) */ {"ERROR", ERROR}, /* 2002 */ {"ESCAPE", ESCAPE}, /* extension */ {"ESI", -1}, /* 2002 */ {"EVALUATE", EVALUATE}, /* 2002 */ {"EXCEPTION", EXCEPTION}, /* 2002 */ {"EXCEPTION-OBJECT", -1}, /* 2002 */ {"EXCLUSIVE", EXCLUSIVE}, /* extension */ {"EXIT", EXIT}, /* 2002 */ {"EXPANDS", -1}, /* 2002 (C/S) */ {"EXTEND", EXTEND}, /* 2002 */ {"EXTERNAL", EXTERNAL}, /* 2002 */ {"FACTORY", -1}, /* 2002 */ {"FALSE", TOK_FALSE}, /* 2002 */ {"FD", FD}, /* 2002 */ {"FILE", TOK_FILE}, /* 2002 */ {"FILE-CONTROL", FILE_CONTROL}, /* 2002 */ {"FILE-ID", FILE_ID}, /* extension */ {"FILLER", FILLER}, /* 2002 */ {"FINAL", FINAL}, /* 2002 */ {"FIRST", FIRST}, /* 2002 */ {"FLOAT-BINARY-16", -1}, /* 2008 */ {"FLOAT-BINARY-34", -1}, /* 2008 */ {"FLOAT-BINARY-7", -1}, /* 2008 */ {"FLOAT-DECIMAL-16", -1}, /* 2008 */ {"FLOAT-DECIMAL-34", -1}, /* 2008 */ {"FLOAT-EXTENDED", -1}, /* 2002 */ {"FLOAT-LONG", COMP_2}, /* 2002 */ {"FLOAT-SHORT", COMP_1}, /* 2002 */ {"FOOTING", FOOTING}, /* 2002 */ {"FOR", FOR}, /* 2002 */ {"FOREGROUND-COLOR", FOREGROUND_COLOR}, /* 2002 (C/S) */ {"FOREVER", FOREVER}, /* 2002 (C/S) */ {"FORMAT", -1}, /* 2002 */ {"FREE", FREE}, /* 2002 */ {"FROM", FROM}, /* 2002 */ {"FULL", FULL}, /* 2002 (C/S) */ {"FUNCTION", FUNCTION}, /* 2002 */ {"FUNCTION-ID", FUNCTION_ID}, /* 2002 */ {"FUNCTION-POINTER", -1}, /* 2008 */ {"GENERATE", GENERATE}, /* 2002 */ {"GET", -1}, /* 2002 */ {"GIVING", GIVING}, /* 2002 */ {"GLOBAL", GLOBAL}, /* 2002 */ {"GO", GO}, /* 2002 */ {"GOBACK", GOBACK}, /* 2002 */ {"GREATER", GREATER}, /* 2002 */ {"GROUP", GROUP}, /* 2002 */ {"GROUP-USAGE", -1}, /* 2002 */ {"HEADING", HEADING}, /* 2002 */ {"HIGH-VALUE", HIGH_VALUE}, /* 2002 */ {"HIGH-VALUES", HIGH_VALUE}, /* 2002 */ {"HIGHLIGHT", HIGHLIGHT}, /* 2002 (C/S) */ {"I-O", I_O}, /* 2002 */ {"I-O-CONTROL", I_O_CONTROL}, /* 2002 */ {"ID", IDENTIFICATION}, /* extension */ {"IDENTIFICATION", IDENTIFICATION}, /* 2002 */ {"IF", IF}, /* 2002 */ {"IGNORE", IGNORE}, /* extension */ {"IGNORING", IGNORING}, /* 2002 (C/S) */ {"IMPLEMENTS", -1}, /* 2002 (C/S) */ {"IN", IN}, /* 2002 */ {"INDEX", INDEX}, /* 2002 */ {"INDEXED", INDEXED}, /* 2002 */ {"INDICATE", INDICATE}, /* 2002 */ {"INFINITY", -1}, /* 2002 */ {"INHERITS", -1}, /* 2002 */ {"INITIAL", TOK_INITIAL}, /* 2002 */ {"INITIALIZE", INITIALIZE}, /* 2002 */ {"INITIALIZED", INITIALIZED}, /* 2002 */ {"INITIATE", INITIATE}, /* 2002 */ {"INPUT", INPUT}, /* 2002 */ {"INPUT-OUTPUT", INPUT_OUTPUT}, /* 2002 */ {"INSPECT", INSPECT}, /* 2002 */ {"INTERFACE", -1}, /* 2002 */ {"INTERFACE-ID", -1}, /* 2002 */ {"INTO", INTO}, /* 2002 */ {"INTRINSIC", INTRINSIC}, /* 2002 (C/S) */ {"INVALID", INVALID}, /* 2002 */ {"INVOKE", -1}, /* 2002 */ {"IS", IS}, /* 2002 */ {"JUST", JUSTIFIED}, /* 2002 */ {"JUSTIFIED", JUSTIFIED}, /* 2002 */ {"KEY", KEY}, /* 2002 */ {"LABEL", LABEL}, /* 85 */ {"LAST", LAST}, /* 2002 */ {"LC_ALL", -1}, /* 2002 (C/S) */ {"LC_COLLATE", -1}, /* 2002 (C/S) */ {"LC_CTYPE", -1}, /* 2002 (C/S) */ {"LC_MESSAGES", -1}, /* 2002 (C/S) */ {"LC_MONETARY", -1}, /* 2002 (C/S) */ {"LC_NUMERIC", -1}, /* 2002 (C/S) */ {"LC_TIME", -1}, /* 2002 (C/S) */ {"LEADING", LEADING}, /* 2002 */ {"LEFT", LEFT}, /* 2002 */ {"LENGTH", LENGTH}, /* 2002 */ {"LESS", LESS}, /* 2002 */ {"LIMIT", LIMIT}, /* 2002 */ {"LIMITS", LIMITS}, /* 2002 */ {"LINAGE", LINAGE}, /* 2002 */ {"LINAGE-COUNTER", LINAGE_COUNTER}, /* 2002 */ {"LINE", LINE}, /* 2002 */ {"LINE-COUNTER", -1}, /* 2002 */ {"LINES", LINES}, /* 2002 */ {"LINKAGE", LINKAGE}, /* 2002 */ {"LOCAL-STORAGE", LOCAL_STORAGE}, /* 2002 */ {"LOCALE", LOCALE}, /* 2002 */ {"LOCK", LOCK}, /* 2002 */ {"LOW-VALUE", LOW_VALUE}, /* 2002 */ {"LOW-VALUES", LOW_VALUE}, /* 2002 */ {"LOWLIGHT", LOWLIGHT}, /* 2002 (C/S) */ {"MANUAL", MANUAL}, /* 2002 (C/S) */ {"MEMORY", MEMORY}, /* 85 */ {"MERGE", MERGE}, /* 2002 */ {"MESSAGE", -1}, /* 2002 */ {"METHOD", -1}, /* 2002 */ {"METHOD-ID", -1}, /* 2002 */ {"MINUS", MINUS}, /* 2002 */ {"MODE", MODE}, /* 2002 */ {"MOVE", MOVE}, /* 2002 */ {"MULTIPLE", MULTIPLE}, /* 2002 (C/S) */ {"MULTIPLY", MULTIPLY}, /* 2002 */ {"NATIONAL", NATIONAL}, /* 2002 */ {"NATIONAL-EDITED", NATIONAL_EDITED}, /* 2002 */ {"NATIVE", NATIVE}, /* 2002 */ {"NEGATIVE", NEGATIVE}, /* 2002 */ {"NESTED", -1}, /* 2002 */ {"NEXT", NEXT}, /* 2002 */ {"NO", NO}, /* 2002 */ {"NONE", -1}, /* 2002 (C/S) */ {"NORMAL", -1}, /* 2002 (C/S) */ {"NOT", NOT}, /* 2002 */ {"NULL", TOK_NULL}, /* 2002 */ {"NULLS", TOK_NULL}, /* extension */ {"NUMBER", NUMBER}, /* 2002 */ {"NUMBERS", NUMBER}, /* 2002 (C/S) */ {"NUMERIC", NUMERIC}, /* 2002 */ {"NUMERIC-EDITED", NUMERIC_EDITED}, /* 2002 */ {"OBJECT", -1}, /* 2002 */ {"OBJECT-COMPUTER", OBJECT_COMPUTER}, /* 2002 */ {"OBJECT-REFERENCE", -1}, /* 2002 */ {"OCCURS", OCCURS}, /* 2002 */ {"OF", OF}, /* 2002 */ {"OFF", OFF}, /* 2002 */ {"OMITTED", OMITTED}, /* 2002 */ {"ON", ON}, /* 2002 */ {"ONLY", ONLY}, /* 2002 (C/S) */ {"OPEN", OPEN}, /* 2002 */ {"OPTIONAL", OPTIONAL}, /* 2002 */ {"OPTIONS", -1}, /* 2002 */ {"OR", OR}, /* 2002 */ {"ORDER", ORDER}, /* 2002 */ {"ORGANIZATION", ORGANIZATION}, /* 2002 */ {"OTHER", OTHER}, /* 2002 */ {"OUTPUT", OUTPUT}, /* 2002 */ {"OVERFLOW", OVERFLOW}, /* 2002 */ {"OVERLINE", OVERLINE}, /* extension */ {"OVERRIDE", -1}, /* 2002 */ {"PACKED-DECIMAL", PACKED_DECIMAL}, /* 2002 */ {"PADDING", PADDING}, /* 2002 */ {"PAGE", PAGE}, /* 2002 */ {"PAGE-COUNTER", -1}, /* 2002 */ {"PARAGRAPH", PARAGRAPH}, /* 2002 (C/S) */ {"PERFORM", PERFORM}, /* 2002 */ {"PF", PAGE_FOOTING}, /* 2002 */ {"PH", PAGE_HEADING}, /* 2002 */ {"PIC", 0}, /* 2002 */ {"PICTURE", 0}, /* 2002 */ {"PLUS", PLUS}, /* 2002 */ {"POINTER", POINTER}, /* 2002 */ {"POSITION", POSITION}, /* 85 */ {"POSITIVE", POSITIVE}, /* 2002 */ {"PRESENT", PRESENT}, /* 2002 */ {"PREVIOUS", PREVIOUS}, /* 2002 (C/S) */ {"PRINTER", PRINTER}, /* extension */ {"PRINTING", PRINTING}, /* 2002 */ {"PROCEDURE", PROCEDURE}, /* 2002 */ {"PROCEDURE-POINTER", PROGRAM_POINTER}, /* extension */ {"PROCEDURES", PROCEDURES}, /* extension */ {"PROCEED", PROCEED}, /* 85 */ {"PROGRAM", PROGRAM}, /* 2002 */ {"PROGRAM-ID", PROGRAM_ID}, /* 2002 */ {"PROGRAM-POINTER", PROGRAM_POINTER}, /* 2002 */ {"PROMPT", PROMPT}, /* extension */ {"PROPERTY", -1}, /* 2002 */ {"PROTOTYPE", -1}, /* 2002 */ {"PURGE", -1}, /* 2002 */ {"QUEUE", -1}, /* 2002 */ {"QUOTE", QUOTE}, /* 2002 */ {"QUOTES", QUOTE}, /* 2002 */ {"RAISE", -1}, /* 2002 */ {"RAISING", -1}, /* 2002 */ {"RANDOM", RANDOM}, /* 2002 */ {"RD", RD}, /* 2002 */ {"READ", READ}, /* 2002 */ {"RECEIVE", -1}, /* 2002 */ {"RECORD", RECORD}, /* 2002 */ {"RECORDING", RECORDING}, /* extension */ {"RECORDS", RECORDS}, /* 2002 */ {"RECURSIVE", RECURSIVE}, /* 2002 (C/S) */ {"REDEFINES", REDEFINES}, /* 2002 */ {"REEL", REEL}, /* 2002 */ {"REFERENCE", REFERENCE}, /* 2002 */ {"RELATION", -1}, /* 2002 (C/S) */ {"RELATIVE", RELATIVE}, /* 2002 */ {"RELEASE", RELEASE}, /* 2002 */ {"REMAINDER", REMAINDER}, /* 2002 */ {"REMOVAL", REMOVAL}, /* 2002 */ {"RENAMES", RENAMES}, /* 2002 */ {"REPLACE", -1}, /* 2002 */ {"REPLACING", REPLACING}, /* 2002 */ {"REPORT", REPORT}, /* 2002 */ {"REPORTING", REPORTING}, /* 2002 */ {"REPORTS", REPORTS}, /* 2002 */ {"REPOSITORY", REPOSITORY}, /* 2002 */ {"REPRESENTS-NOT-A-NUMBER", -1}, /* 2008 */ {"REQUIRED", REQUIRED}, /* 2002 (C/S) */ {"RESERVE", RESERVE}, /* 2002 */ {"RESET", -1}, /* 2002 */ {"RESUME", -1}, /* 2002 */ {"RETRY", -1}, /* 2002 */ {"RETURN", RETURN}, /* 2002 */ {"RETURNING", RETURNING}, /* 2002 */ {"REVERSE-VIDEO", REVERSE_VIDEO}, /* 2002 (C/S) */ {"REWIND", REWIND}, /* 2002 */ {"REWRITE", REWRITE}, /* 2002 */ {"RF", REPORT_FOOTING}, /* 2002 */ {"RH", REPORT_HEADING}, /* 2002 */ {"RIGHT", RIGHT}, /* 2002 */ {"ROLLBACK", ROLLBACK}, /* extension */ {"ROUNDED", ROUNDED}, /* 2002 */ {"RUN", RUN}, /* 2002 */ {"SAME", SAME}, /* 2002 */ {"SCREEN", SCREEN}, /* 2002 */ {"SCROLL", SCROLL}, /* extension */ {"SD", SD}, /* 2002 */ {"SEARCH", SEARCH}, /* 2002 */ {"SECONDS", -1}, /* 2002 (C/S) */ {"SECTION", SECTION}, /* 2002 */ {"SECURE", SECURE}, /* 2002 (C/S) */ {"SEGMENT", -1}, /* 2002 */ {"SEGMENT-LIMIT", SEGMENT_LIMIT}, /* 85 */ {"SELECT", SELECT}, /* 2002 */ {"SELF", -1}, /* 2002 */ {"SEND", -1}, /* 2002 */ {"SENTENCE", SENTENCE}, /* 2002 */ {"SEPARATE", SEPARATE}, /* 2002 */ {"SEQUENCE", SEQUENCE}, /* 2002 */ {"SEQUENTIAL", SEQUENTIAL}, /* 2002 */ {"SET", SET}, /* 2002 */ {"SHARING", SHARING}, /* 2002 */ {"SIGN", SIGN}, /* 2002 */ {"SIGNED", SIGNED}, /* 2002 (C/S) */ {"SIGNED-INT", SIGNED_INT}, /* extension */ {"SIGNED-LONG", SIGNED_LONG}, /* extension */ {"SIGNED-SHORT", SIGNED_SHORT}, /* extension */ {"SIZE", SIZE}, /* 2002 */ {"SORT", SORT}, /* 2002 */ {"SORT-MERGE", SORT_MERGE}, /* 2002 */ {"SOURCE", SOURCE}, /* 2002 */ {"SOURCE-COMPUTER", SOURCE_COMPUTER}, /* 2002 */ {"SOURCES", -1}, /* 2002 */ {"SPACE", SPACE}, /* 2002 */ {"SPACES", SPACE}, /* 2002 */ {"SPECIAL-NAMES", SPECIAL_NAMES}, /* 2002 */ {"STANDARD", STANDARD}, /* 2002 */ {"STANDARD-1", STANDARD_1}, /* 2002 */ {"STANDARD-2", STANDARD_2}, /* 2002 */ {"START", START}, /* 2002 */ {"STATEMENT", -1}, /* 2002 (C/S) */ {"STATUS", STATUS}, /* 2002 */ {"STEP", -1}, /* 2002 (C/S) */ {"STOP", STOP}, /* 2002 */ {"STRING", STRING}, /* 2002 */ {"STRONG", -1}, /* 2002 (C/S) */ {"SUB-QUEUE-1", -1}, /* 2002 */ {"SUB-QUEUE-2", -1}, /* 2002 */ {"SUB-QUEUE-3", -1}, /* 2002 */ {"SUBTRACT", SUBTRACT}, /* 2002 */ {"SUM", SUM}, /* 2002 */ {"SUPER", -1}, /* 2002 */ {"SUPPRESS", SUPPRESS}, /* 2002 */ {"SYMBOL", -1}, /* 2002 (C/S) */ {"SYMBOLIC", SYMBOLIC}, /* 2002 */ {"SYNC", SYNCHRONIZED}, /* 2002 */ {"SYNCHRONIZED", SYNCHRONIZED}, /* 2002 */ {"SYSTEM-DEFAULT", -1}, /* 2002 */ {"TABLE", -1}, /* 2002 */ {"TALLYING", TALLYING}, /* 2002 */ {"TAPE", TAPE}, /* 85 */ {"TERMINAL", -1}, /* 2002 */ {"TERMINATE", TERMINATE}, /* 2002 */ {"TEST", TEST}, /* 2002 */ {"TEXT", -1}, /* 2002 */ {"THAN", THAN}, /* 2002 */ {"THEN", THEN}, /* 2002 */ {"THROUGH", THRU}, /* 2002 */ {"THRU", THRU}, /* 2002 */ {"TIME", TIME}, /* 2002 */ {"TIMES", TIMES}, /* 2002 */ {"TO", TO}, /* 2002 */ {"TOP", TOP}, /* 2002 */ {"TRAILING", TRAILING}, /* 2002 */ {"TRANSFORM", TRANSFORM}, /* OSVS */ {"TRUE", TOK_TRUE}, /* 2002 */ {"TYPE", TYPE}, /* 2002 */ {"TYPEDEF", -1}, /* 2002 */ {"UCS-4", -1}, /* 2002 (C/S) */ {"UNDERLINE", UNDERLINE}, /* 2002 (C/S) */ {"UNIT", UNIT}, /* 2002 */ {"UNIVERSAL", -1}, /* 2002 */ {"UNLOCK", UNLOCK}, /* 2002 */ {"UNSIGNED", UNSIGNED}, /* 2002 (C/S) */ {"UNSIGNED-INT", UNSIGNED_INT}, /* extension */ {"UNSIGNED-LONG", UNSIGNED_LONG}, /* extension */ {"UNSIGNED-SHORT", UNSIGNED_SHORT}, /* extension */ {"UNSTRING", UNSTRING}, /* 2002 */ {"UNTIL", UNTIL}, /* 2002 */ {"UP", UP}, /* 2002 */ {"UPDATE", UPDATE}, /* extension */ {"UPON", UPON}, /* 2002 */ {"USAGE", USAGE}, /* 2002 */ {"USE", USE}, /* 2002 */ {"USER-DEFAULT", -1}, /* 2002 */ {"USING", USING}, /* 2002 */ {"UTF-16", -1}, /* 2002 (C/S) */ {"UTF-8", -1}, /* 2002 (C/S) */ {"VAL-STATUS", -1}, /* 2002 */ {"VALID", -1}, /* 2002 */ {"VALIDATE", -1}, /* 2002 */ {"VALIDATE-STATUS", -1}, /* 2002 */ {"VALUE", VALUE}, /* 2002 */ {"VALUES", VALUE}, /* 2002 */ {"VARYING", VARYING}, /* 2002 */ {"WAIT", WAIT}, /* extension */ {"WHEN", WHEN}, /* 2002 */ {"WITH", WITH}, /* 2002 */ {"WORDS", WORDS}, /* 85 */ {"WORKING-STORAGE", WORKING_STORAGE}, /* 2002 */ {"WRITE", WRITE}, /* 2002 */ {"YYYYDDD", YYYYDDD}, /* 2002 (C/S) */ {"YYYYMMDD", YYYYMMDD}, /* 2002 (C/S) */ {"ZERO", ZERO}, /* 2002 */ {"ZEROES", ZERO}, /* 2002 */ {"ZEROS", ZERO}, /* 2002 */ }; #define NUM_RESERVED_WORDS sizeof (reserved_words) / sizeof (struct reserved) /* FUNCTION List */ /* Name, Arguments, Implemented, Enum intrinsic, Routine, Category, Can refmod */ static const struct cb_intrinsic_table function_list[] = { { "ABS", 1, 1, CB_INTR_ABS, "cob_intr_abs", CB_CATEGORY_NUMERIC, 0 }, { "ACOS", 1, 1, CB_INTR_ACOS, "cob_intr_acos", CB_CATEGORY_NUMERIC, 0 }, { "ANNUITY", 2, 1, CB_INTR_ANNUITY, "cob_intr_annuity", CB_CATEGORY_NUMERIC, 0 }, { "ASIN", 1, 1, CB_INTR_ASIN, "cob_intr_asin", CB_CATEGORY_NUMERIC, 0 }, { "ATAN", 1, 1, CB_INTR_ATAN, "cob_intr_atan", CB_CATEGORY_NUMERIC, 0 }, { "BOOLEAN-OF-INTEGER", 2, 0, CB_INTR_BOOLEAN_OF_INTEGER, NULL, CB_CATEGORY_NUMERIC, 0 }, { "BYTE-LENGTH", 1, 1, CB_INTR_BYTE_LENGTH, "cob_intr_length", CB_CATEGORY_NUMERIC, 0 }, { "CHAR", 1, 1, CB_INTR_CHAR, "cob_intr_char", CB_CATEGORY_ALPHANUMERIC, 0 }, { "CHAR-NATIONAL", 1, 0, CB_INTR_CHAR_NATIONAL, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "COMBINED-DATETIME", 2, 1, CB_INTR_COMBINED_DATETIME, "cob_intr_combined_datetime", CB_CATEGORY_NUMERIC, 0 }, { "CONCATENATE", -1, 1, CB_INTR_CONCATENATE, "cob_intr_concatenate", CB_CATEGORY_ALPHANUMERIC, 1 }, { "COS", 1, 1, CB_INTR_COS, "cob_intr_cos", CB_CATEGORY_NUMERIC, 0 }, { "CURRENT-DATE", 0, 1, CB_INTR_CURRENT_DATE, "cob_intr_current_date", CB_CATEGORY_ALPHANUMERIC, 1 }, { "DATE-OF-INTEGER", 1, 1, CB_INTR_DATE_OF_INTEGER, "cob_intr_date_of_integer", CB_CATEGORY_NUMERIC, 0 }, { "DATE-TO-YYYYMMDD", -1, 1, CB_INTR_DATE_TO_YYYYMMDD, "cob_intr_date_to_yyyymmdd", CB_CATEGORY_NUMERIC, 0 }, { "DAY-OF-INTEGER", 1, 1, CB_INTR_DAY_OF_INTEGER, "cob_intr_day_of_integer", CB_CATEGORY_NUMERIC, 0 }, { "DAY-TO-YYYYDDD", -1, 1, CB_INTR_DAY_TO_YYYYDDD, "cob_intr_day_to_yyyyddd", CB_CATEGORY_NUMERIC, 0 }, { "DISPLAY-OF", -1, 0, CB_INTR_DISPLAY_OF, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "E", 0, 1, CB_INTR_E, NULL, CB_CATEGORY_NUMERIC, 0 }, { "EXCEPTION-FILE", 0, 1, CB_INTR_EXCEPTION_FILE, "cob_intr_exception_file", CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXCEPTION-FILE-N", 0, 0, CB_INTR_EXCEPTION_FILE_N, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXCEPTION-LOCATION", 0, 1, CB_INTR_EXCEPTION_LOCATION, "cob_intr_exception_location", CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXCEPTION-LOCATION-N", 0, 0, CB_INTR_EXCEPTION_LOCATION_N, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXCEPTION-STATEMENT", 0, 1, CB_INTR_EXCEPTION_STATEMENT, "cob_intr_exception_statement", CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXCEPTION-STATUS", 0, 1, CB_INTR_EXCEPTION_STATUS, "cob_intr_exception_status", CB_CATEGORY_ALPHANUMERIC, 0 }, { "EXP", 1, 1, CB_INTR_EXP, "cob_intr_exp", CB_CATEGORY_NUMERIC, 0 }, { "EXP10", 1, 1, CB_INTR_EXP10, "cob_intr_exp10", CB_CATEGORY_NUMERIC, 0 }, { "FACTORIAL", 1, 1, CB_INTR_FACTORIAL, "cob_intr_factorial", CB_CATEGORY_NUMERIC, 0 }, { "FRACTION-PART", 1, 1, CB_INTR_FRACTION_PART, "cob_intr_fraction_part", CB_CATEGORY_NUMERIC, 0 }, { "HIGHEST-ALGEBRAIC", 1, 0, CB_INTR_HIGHEST_ALGEBRAIC, NULL, CB_CATEGORY_NUMERIC, 0 }, { "INTEGER", 1, 1, CB_INTR_INTEGER, "cob_intr_integer", CB_CATEGORY_NUMERIC, 0 }, { "INTEGER-OF-BOOLEAN", 1, 0, CB_INTR_INTEGER_OF_BOOLEAN, NULL, CB_CATEGORY_NUMERIC, 0 }, { "INTEGER-OF-DATE", 1, 1, CB_INTR_INTEGER_OF_DATE, "cob_intr_integer_of_date", CB_CATEGORY_NUMERIC, 0 }, { "INTEGER-OF-DAY", 1, 1, CB_INTR_INTEGER_OF_DAY, "cob_intr_integer_of_day", CB_CATEGORY_NUMERIC, 0 }, { "INTEGER-PART", 1, 1, CB_INTR_INTEGER_PART, "cob_intr_integer_part", CB_CATEGORY_NUMERIC, 0 }, { "LENGTH", 1, 1, CB_INTR_LENGTH, "cob_intr_length", CB_CATEGORY_NUMERIC, 0 }, { "LOCALE-COMPARE", -1, 0, CB_INTR_LOCALE_COMPARE, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "LOCALE-DATE", 2, 1, CB_INTR_LOCALE_DATE, "cob_intr_locale_date", CB_CATEGORY_ALPHANUMERIC, 1 }, { "LOCALE-TIME", 2, 1, CB_INTR_LOCALE_TIME, "cob_intr_locale_time", CB_CATEGORY_ALPHANUMERIC, 1 }, { "LOCALE-TIME-FROM-SECONDS", 2, 1, CB_INTR_LOCALE_TIME_FROM_SECS, "cob_intr_lcl_time_from_secs", CB_CATEGORY_ALPHANUMERIC, 1 }, { "LOG", 1, 1, CB_INTR_LOG, "cob_intr_log", CB_CATEGORY_NUMERIC, 0 }, { "LOG10", 1, 1, CB_INTR_LOG10, "cob_intr_log10", CB_CATEGORY_NUMERIC, 0 }, { "LOWER-CASE", 1, 1, CB_INTR_LOWER_CASE, "cob_intr_lower_case", CB_CATEGORY_ALPHANUMERIC, 1 }, { "LOWEST-ALGEBRAIC", 1, 0, CB_INTR_LOWEST_ALGEBRAIC, NULL, CB_CATEGORY_NUMERIC, 0 }, { "MAX", -1, 1, CB_INTR_MAX, "cob_intr_max", CB_CATEGORY_NUMERIC, 0 }, { "MEAN", -1, 1, CB_INTR_MEAN, "cob_intr_mean", CB_CATEGORY_NUMERIC, 0 }, { "MEDIAN", -1, 1, CB_INTR_MEDIAN, "cob_intr_median", CB_CATEGORY_NUMERIC, 0 }, { "MIDRANGE", -1, 1, CB_INTR_MIDRANGE, "cob_intr_midrange", CB_CATEGORY_NUMERIC, 0 }, { "MIN", -1, 1, CB_INTR_MIN, "cob_intr_min", CB_CATEGORY_NUMERIC, 0 }, { "MOD", 2, 1, CB_INTR_MOD, "cob_intr_mod", CB_CATEGORY_NUMERIC, 0 }, { "NATIONAL-OF", -1, 0, CB_INTR_NATIONAL_OF, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "NUMVAL", 1, 1, CB_INTR_NUMVAL, "cob_intr_numval", CB_CATEGORY_NUMERIC, 0 }, { "NUMVAL-C", 2, 1, CB_INTR_NUMVAL_C, "cob_intr_numval_c", CB_CATEGORY_NUMERIC, 0 }, { "NUMVAL-F", 1, 0, CB_INTR_NUMVAL_F, NULL, CB_CATEGORY_NUMERIC, 0 }, { "ORD", 1, 1, CB_INTR_ORD, "cob_intr_ord", CB_CATEGORY_NUMERIC, 0 }, { "ORD-MAX", -1, 1, CB_INTR_ORD_MAX, "cob_intr_ord_max", CB_CATEGORY_NUMERIC, 0 }, { "ORD-MIN", -1, 1, CB_INTR_ORD_MIN, "cob_intr_ord_min", CB_CATEGORY_NUMERIC, 0 }, { "PI", 0, 1, CB_INTR_PI, NULL, CB_CATEGORY_NUMERIC, 0 }, { "PRESENT-VALUE", -1, 1, CB_INTR_PRESENT_VALUE, "cob_intr_present_value", CB_CATEGORY_NUMERIC, 0 }, { "RANDOM", -1, 1, CB_INTR_RANDOM, "cob_intr_random", CB_CATEGORY_NUMERIC, 0 }, { "RANGE", -1, 1, CB_INTR_RANGE, "cob_intr_range", CB_CATEGORY_NUMERIC, 0 }, { "REM", 2, 1, CB_INTR_REM, "cob_intr_rem", CB_CATEGORY_NUMERIC, 0 }, { "REVERSE", 1, 1, CB_INTR_REVERSE, "cob_intr_reverse", CB_CATEGORY_ALPHANUMERIC, 1 }, { "SECONDS-FROM-FORMATTED-TIME", 2, 1, CB_INTR_SECONDS_PAST_MIDNIGHT, "cob_intr_seconds_from_formatted_time", CB_CATEGORY_NUMERIC, 0 }, { "SECONDS-PAST-MIDNIGHT", 0, 1, CB_INTR_SECONDS_PAST_MIDNIGHT, "cob_intr_seconds_past_midnight", CB_CATEGORY_NUMERIC, 0 }, { "SIGN", 1, 1, CB_INTR_SIGN, "cob_intr_sign", CB_CATEGORY_NUMERIC, 0 }, { "SIN", 1, 1, CB_INTR_SIN, "cob_intr_sin", CB_CATEGORY_NUMERIC, 0 }, { "SQRT", 1, 1, CB_INTR_SQRT, "cob_intr_sqrt", CB_CATEGORY_NUMERIC, 0 }, { "STANDARD-COMPARE", -1, 0, CB_INTR_STANDARD_COMPARE, NULL, CB_CATEGORY_ALPHANUMERIC, 0 }, { "STANDARD-DEVIATION", -1, 1, CB_INTR_STANDARD_DEVIATION, "cob_intr_standard_deviation", CB_CATEGORY_NUMERIC, 0 }, { "STORED-CHAR-LENGTH", 1, 1, CB_INTR_STORED_CHAR_LENGTH, "cob_intr_stored_char_length", CB_CATEGORY_NUMERIC, 0 }, { "SUBSTITUTE", -1, 1, CB_INTR_SUBSTITUTE, "cob_intr_substitute", CB_CATEGORY_ALPHANUMERIC, 1 }, { "SUBSTITUTE-CASE", -1, 1, CB_INTR_SUBSTITUTE_CASE, "cob_intr_substitute_case", CB_CATEGORY_ALPHANUMERIC, 1 }, { "SUM", -1, 1, CB_INTR_SUM, "cob_intr_sum", CB_CATEGORY_NUMERIC, 0 }, { "TAN", 1, 1, CB_INTR_TAN, "cob_intr_tan", CB_CATEGORY_NUMERIC, 0 }, { "TEST-DATE-YYYYMMDD", 1, 1, CB_INTR_TEST_DATE_YYYYMMDD, "cob_intr_test_date_yyyymmdd", CB_CATEGORY_NUMERIC, 0 }, { "TEST-DAY-YYYYDDD", 1, 1, CB_INTR_TEST_DAY_YYYYDDD, "cob_intr_test_day_yyyyddd", CB_CATEGORY_NUMERIC, 0 }, { "TEST-NUMVAL", 1, 0, CB_INTR_TEST_NUMVAL, NULL, CB_CATEGORY_NUMERIC, 0 }, { "TEST-NUMVAL-C", -1, 0, CB_INTR_TEST_NUMVAL_C, NULL, CB_CATEGORY_NUMERIC, 0 }, { "TEST-NUMVAL-F", 1, 0, CB_INTR_TEST_NUMVAL_F, NULL, CB_CATEGORY_NUMERIC, 0 }, { "TRIM", 2, 1, CB_INTR_TRIM, "cob_intr_trim", CB_CATEGORY_ALPHANUMERIC, 1 }, { "UPPER-CASE", 1, 1, CB_INTR_UPPER_CASE, "cob_intr_upper_case", CB_CATEGORY_ALPHANUMERIC, 1 }, { "VARIANCE", -1, 1, CB_INTR_VARIANCE, "cob_intr_variance", CB_CATEGORY_NUMERIC, 0 }, { "WHEN-COMPILED", 0, 1, CB_INTR_WHEN_COMPILED, "cob_intr_when_compiled", CB_CATEGORY_ALPHANUMERIC, 1 }, { "YEAR-TO-YYYY", -1, 1, CB_INTR_YEAR_TO_YYYY, "cob_intr_year_to_yyyy", CB_CATEGORY_NUMERIC, 0 } }; #define NUM_INTRINSICS sizeof(function_list) / sizeof(struct cb_intrinsic_table) static int reserve_comp (const void *p1, const void *p2) { return strcasecmp (p1, ((struct reserved *)p2)->name); } static int intrinsic_comp (const void *p1, const void *p2) { return strcasecmp (p1, ((struct cb_intrinsic_table *)p2)->name); } cb_tree lookup_system_name (const char *name) { int i; for (i = 0; system_table[i].name != NULL; ++i) { if (strcasecmp (name, system_table[i].name) == 0) { return system_table[i].node; } } return cb_error_node; } int lookup_reserved_word (const char *name) { struct reserved *p; struct noreserve *noresptr; p = bsearch (name, reserved_words, NUM_RESERVED_WORDS, sizeof (struct reserved), reserve_comp); if (!p) { return 0; } for (noresptr = norestab; noresptr; noresptr = noresptr->next) { if (strcasecmp (name, noresptr->noresword) == 0) { return 0; } } if (p->token != -1) { return p->token; } cb_error (_("'%s' reserved word, but not supported yet"), name); return 0; } struct cb_intrinsic_table * lookup_intrinsic (const char *name, const int checkres) { struct cb_intrinsic_table *cbp; struct noreserve *noresptr; if (checkres) { for (noresptr = norestab; noresptr; noresptr = noresptr->next) { if (strcasecmp (name, noresptr->noresword) == 0) { return NULL; } } } cbp = bsearch (name, function_list, NUM_INTRINSICS, sizeof (struct cb_intrinsic_table), intrinsic_comp); if (cbp && cbp->implemented) { return cbp; } return NULL; } void cb_list_reserved (void) { const char *s; size_t i; size_t n; printf ("Reserved Words (Parsed Y/N)\n\n"); for (i = 0; i < NUM_RESERVED_WORDS; ++i) { n = strlen (reserved_words[i].name); switch (n / 8) { case 0: s = "\t\t\t\t"; break; case 1: s = "\t\t\t"; break; case 2: s = "\t\t"; break; default: s = "\t"; break; } printf ("%s%s(%s)\n", reserved_words[i].name, s, reserved_words[i].token != -1 ? "Y" : "N"); } } void cb_list_intrinsics (void) { const char *s; size_t i; size_t n; printf ("Intrinsic Function (Implemented Y/N)\n\n"); for (i = 0; i < NUM_INTRINSICS; ++i) { n = strlen (function_list[i].name); switch (n / 8) { case 0: s = "\t\t\t\t"; break; case 1: s = "\t\t\t"; break; case 2: s = "\t\t"; break; default: s = "\t"; break; } printf ("%s%s(%s)\n", function_list[i].name, s, function_list[i].implemented ? "Y" : "N"); } } void cb_list_mnemonics (void) { size_t i; printf ("Mnemonic names\n\n"); for (i = 0; system_table[i].name != NULL; ++i) { printf ("%s\n", system_table[i].name); } } void cb_init_reserved (void) { int i; /* build system-name table */ for (i = 0; system_table[i].name != NULL; ++i) { system_table[i].node = cb_build_system_name (system_table[i].category, system_table[i].token); } } open-cobol-1.1/cobc/ppparse.c0000644000000000000000000011262411140121377011566 /* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* 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. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* If NAME_PREFIX is specified substitute the variables and functions names. */ #define yyparse ppparse #define yylex pplex #define yyerror pperror #define yylval pplval #define yychar ppchar #define yydebug ppdebug #define yynerrs ppnerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOKEN_EOF = 0, COPY = 258, REPLACE = 259, SUPPRESS = 260, PRINTING = 261, REPLACING = 262, OFF = 263, IN = 264, OF = 265, BY = 266, EQEQ = 267, TOKEN = 268 }; #endif #define TOKEN_EOF 0 #define COPY 258 #define REPLACE 259 #define SUPPRESS 260 #define PRINTING 261 #define REPLACING 262 #define OFF 263 #define IN 264 #define OF 265 #define BY 266 #define EQEQ 267 #define TOKEN 268 /* Copy the first part of user declarations. */ #line 26 "ppparse.y" #include "config.h" #include #include #include #include #include #include "cobc.h" #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define pperror cb_error static char *fix_filename (char *name); static char *fold_lower (char *name); static char *fold_upper (char *name); static struct cb_replace_list *cb_replace_list_add (struct cb_replace_list *replace_list, struct cb_text_list *old_text, struct cb_text_list *new_text); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 48 "ppparse.y" typedef union YYSTYPE { char *s; struct cb_text_list *l; struct cb_replace_list *r; } YYSTYPE; /* Line 191 of yacc.c. */ #line 140 "ppparse.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 152 "ppparse.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* 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) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 41 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 17 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 15 /* YYNRULES -- Number of rules. */ #define YYNRULES 31 /* YYNRULES -- Number of states. */ #define YYNSTATES 50 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 268 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char 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, 2, 2, 2, 2, 2, 15, 16, 2, 2, 2, 2, 14, 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, 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 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 18, 19, 22, 25, 26, 29, 30, 33, 37, 41, 45, 50, 52, 54, 57, 61, 63, 66, 68, 72, 76, 81, 83, 86, 87 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 18, 0, -1, -1, 18, 19, -1, 20, -1, 24, -1, 3, 13, 21, 22, 23, 14, -1, -1, 9, 13, -1, 10, 13, -1, -1, 5, 31, -1, -1, 7, 25, -1, 4, 25, 14, -1, 4, 8, 14, -1, 26, 11, 26, -1, 25, 26, 11, 26, -1, 27, -1, 29, -1, 12, 12, -1, 12, 28, 12, -1, 13, -1, 28, 13, -1, 13, -1, 29, 9, 13, -1, 29, 10, 13, -1, 29, 15, 30, 16, -1, 13, -1, 30, 13, -1, -1, 6, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 63, 63, 63, 64, 64, 67, 89, 90, 91, 94, 95, 99, 100, 104, 105, 109, 110, 114, 115, 119, 120, 124, 125, 129, 130, 137, 144, 157, 158, 165, 165 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[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", "$undefined", "COPY", "REPLACE", "SUPPRESS", "PRINTING", "REPLACING", "OFF", "IN", "OF", "BY", "EQEQ", "TOKEN", "'.'", "'('", "')'", "$accept", "statement_list", "statement", "copy_statement", "copy_in", "copy_suppress", "copy_replacing", "replace_statement", "replacing_list", "text", "pseudo_text", "token_list", "identifier", "subscripts", "_printing", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 46, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 17, 18, 18, 19, 19, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 31, 31 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 1, 6, 0, 2, 2, 0, 2, 0, 2, 3, 3, 3, 4, 1, 1, 2, 3, 1, 2, 1, 3, 3, 4, 1, 2, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 2, 0, 1, 0, 0, 3, 4, 5, 7, 0, 0, 24, 0, 0, 18, 19, 0, 0, 10, 15, 20, 22, 0, 14, 0, 0, 0, 0, 0, 8, 9, 30, 12, 21, 23, 0, 16, 25, 26, 28, 0, 31, 11, 0, 0, 17, 29, 27, 13, 6 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 1, 5, 6, 18, 32, 44, 7, 12, 13, 14, 22, 15, 40, 42 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -13 static const yysigned_char yypact[] = { -13, 11, -13, -3, -4, -13, -13, -13, 10, -9, 9, -13, 4, 1, -13, -8, 15, 16, 25, -13, -13, -13, 12, -13, 20, 14, 19, 21, 22, -13, -13, 27, 30, -13, -13, 14, -13, -13, -13, -13, -10, -13, -13, 14, 24, -13, -13, -13, 14, -13 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -13, -13, -13, -13, -13, -13, -13, -13, -2, -12, -13, -13, -13, -13, -13 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 24, 26, 27, 46, 9, 19, 47, 28, 10, 11, 8, 2, 25, 36, 3, 4, 10, 11, 23, 16, 17, 20, 21, 45, 33, 34, 10, 11, 29, 30, 31, 35, 37, 41, 38, 39, 24, 43, 49, 0, 0, 48 }; static const yysigned_char yycheck[] = { 12, 9, 10, 13, 8, 14, 16, 15, 12, 13, 13, 0, 11, 25, 3, 4, 12, 13, 14, 9, 10, 12, 13, 35, 12, 13, 12, 13, 13, 13, 5, 11, 13, 6, 13, 13, 48, 7, 14, -1, -1, 43 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 18, 0, 3, 4, 19, 20, 24, 13, 8, 12, 13, 25, 26, 27, 29, 9, 10, 21, 14, 12, 13, 28, 14, 26, 11, 9, 10, 15, 13, 13, 5, 22, 12, 13, 11, 26, 13, 13, 13, 30, 6, 31, 7, 23, 26, 13, 16, 25, 14 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* 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) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (cinluded). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); 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. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylineno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (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) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, 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 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; 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: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef 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. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* 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 ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 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. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("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 (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; 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]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 6: #line 68 "ppparse.y" { fputc ('\n', ppout); yyvsp[-4].s = fix_filename (yyvsp[-4].s); if (cb_flag_fold_copy_lower) { yyvsp[-4].s = fold_lower (yyvsp[-4].s); } else if (cb_flag_fold_copy_upper) { yyvsp[-4].s = fold_upper (yyvsp[-4].s); } if (yyvsp[-3].s) { yyvsp[-3].s = fix_filename (yyvsp[-3].s); if (cb_flag_fold_copy_lower) { yyvsp[-3].s = fold_lower (yyvsp[-3].s); } else if (cb_flag_fold_copy_upper) { yyvsp[-3].s = fold_upper (yyvsp[-3].s); } } ppcopy (yyvsp[-4].s, yyvsp[-3].s, yyvsp[-1].r); ;} break; case 7: #line 89 "ppparse.y" { yyval.s = NULL; ;} break; case 8: #line 90 "ppparse.y" { yyval.s = yyvsp[0].s; ;} break; case 9: #line 91 "ppparse.y" { yyval.s = yyvsp[0].s; ;} break; case 12: #line 99 "ppparse.y" { yyval.r = NULL; ;} break; case 13: #line 100 "ppparse.y" { yyval.r = yyvsp[0].r; ;} break; case 14: #line 104 "ppparse.y" { pp_set_replace_list (yyvsp[-1].r); ;} break; case 15: #line 105 "ppparse.y" { pp_set_replace_list (NULL); ;} break; case 16: #line 109 "ppparse.y" { yyval.r = cb_replace_list_add (NULL, yyvsp[-2].l, yyvsp[0].l); ;} break; case 17: #line 110 "ppparse.y" { yyval.r = cb_replace_list_add (yyvsp[-3].r, yyvsp[-2].l, yyvsp[0].l); ;} break; case 18: #line 114 "ppparse.y" { yyval.l = yyvsp[0].l; ;} break; case 19: #line 115 "ppparse.y" { yyval.l = yyvsp[0].l; ;} break; case 20: #line 119 "ppparse.y" { yyval.l = NULL; ;} break; case 21: #line 120 "ppparse.y" { yyval.l = yyvsp[-1].l; ;} break; case 22: #line 124 "ppparse.y" { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} break; case 23: #line 125 "ppparse.y" { yyval.l = cb_text_list_add (yyvsp[-1].l, yyvsp[0].s); ;} break; case 24: #line 129 "ppparse.y" { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} break; case 25: #line 131 "ppparse.y" { yyval.l = cb_text_list_add (yyvsp[-2].l, " "); yyval.l = cb_text_list_add (yyval.l, "IN"); yyval.l = cb_text_list_add (yyval.l, " "); yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); ;} break; case 26: #line 138 "ppparse.y" { yyval.l = cb_text_list_add (yyvsp[-2].l, " "); yyval.l = cb_text_list_add (yyval.l, "OF"); yyval.l = cb_text_list_add (yyval.l, " "); yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); ;} break; case 27: #line 145 "ppparse.y" { struct cb_text_list *l; yyval.l = cb_text_list_add (yyvsp[-3].l, " "); yyval.l = cb_text_list_add (yyval.l, "("); yyvsp[-1].l = cb_text_list_add (yyvsp[-1].l, ")"); for (l = yyval.l; l->next; l = l->next); l->next = yyvsp[-1].l; ;} break; case 28: #line 157 "ppparse.y" { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} break; case 29: #line 159 "ppparse.y" { yyval.l = cb_text_list_add (yyvsp[-1].l, " "); yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); ;} break; } /* Line 991 of yacc.c. */ #line 1208 "ppparse.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* 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. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("syntax error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab2; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: /* Suppress GCC warning that yyerrlab1 is unused when no action invokes YYERROR. */ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ && !defined __cplusplus __attribute__ ((__unused__)) #endif goto yyerrlab2; /*---------------------------------------------------------------. | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ yyerrlab2: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); yyvsp--; yystate = *--yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 167 "ppparse.y" static char * fix_filename (char *name) { /* remove quotation from alphanumeric literals */ if (name[0] == '\'' || name[0] == '\"') { name++; name[strlen (name) - 1] = 0; } return name; } static char * fold_lower (char *name) { unsigned char *p; for (p = (unsigned char *)name; *p; p++) { if (isupper (*p)) { *p = tolower (*p); } } return name; } static char * fold_upper (char *name) { unsigned char *p; for (p = (unsigned char *)name; *p; p++) { if (islower (*p)) { *p = toupper (*p); } } return name; } static struct cb_replace_list * cb_replace_list_add (struct cb_replace_list *list, struct cb_text_list *old_text, struct cb_text_list *new_text) { struct cb_replace_list *p; struct cb_replace_list *l; p = cobc_malloc (sizeof (struct cb_replace_list)); p->old_text = old_text; p->new_text = new_text; p->next = NULL; if (!list) { return p; } else { for (l = list; l->next; l = l->next) ; l->next = p; return list; } } open-cobol-1.1/cobc/ppparse.h0000644000000000000000000000414411140121377011570 /* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOKEN_EOF = 0, COPY = 258, REPLACE = 259, SUPPRESS = 260, PRINTING = 261, REPLACING = 262, OFF = 263, IN = 264, OF = 265, BY = 266, EQEQ = 267, TOKEN = 268 }; #endif #define TOKEN_EOF 0 #define COPY 258 #define REPLACE 259 #define SUPPRESS 260 #define PRINTING 261 #define REPLACING 262 #define OFF 263 #define IN 264 #define OF 265 #define BY 266 #define EQEQ 267 #define TOKEN 268 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 48 "ppparse.y" typedef union YYSTYPE { char *s; struct cb_text_list *l; struct cb_replace_list *r; } YYSTYPE; /* Line 1249 of yacc.c. */ #line 70 "ppparse.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE pplval; open-cobol-1.1/cobc/ppparse.y0000644000000000000000000001125611130701401011602 /* -*- c -*- * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ %expect 0 %defines %name-prefix="pp" %{ #include "config.h" #include #include #include #include #include #include "cobc.h" #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define pperror cb_error static char *fix_filename (char *name); static char *fold_lower (char *name); static char *fold_upper (char *name); static struct cb_replace_list *cb_replace_list_add (struct cb_replace_list *replace_list, struct cb_text_list *old_text, struct cb_text_list *new_text); %} %union { char *s; struct cb_text_list *l; struct cb_replace_list *r; } %token TOKEN_EOF 0 "end of file" %token COPY REPLACE SUPPRESS PRINTING REPLACING OFF IN OF BY EQEQ %token TOKEN %type copy_in %type text pseudo_text token_list identifier subscripts %type copy_replacing replacing_list %% statement_list: | statement_list statement ; statement: copy_statement | replace_statement ; copy_statement: COPY TOKEN copy_in copy_suppress copy_replacing '.' { fputc ('\n', ppout); $2 = fix_filename ($2); if (cb_flag_fold_copy_lower) { $2 = fold_lower ($2); } else if (cb_flag_fold_copy_upper) { $2 = fold_upper ($2); } if ($3) { $3 = fix_filename ($3); if (cb_flag_fold_copy_lower) { $3 = fold_lower ($3); } else if (cb_flag_fold_copy_upper) { $3 = fold_upper ($3); } } ppcopy ($2, $3, $5); } ; copy_in: /* nothing */ { $$ = NULL; } | IN TOKEN { $$ = $2; } | OF TOKEN { $$ = $2; } ; copy_suppress: | SUPPRESS _printing ; copy_replacing: /* nothing */ { $$ = NULL; } | REPLACING replacing_list { $$ = $2; } ; replace_statement: REPLACE replacing_list '.' { pp_set_replace_list ($2); } | REPLACE OFF '.' { pp_set_replace_list (NULL); } ; replacing_list: text BY text { $$ = cb_replace_list_add (NULL, $1, $3); } | replacing_list text BY text { $$ = cb_replace_list_add ($1, $2, $4); } ; text: pseudo_text { $$ = $1; } | identifier { $$ = $1; } ; pseudo_text: EQEQ EQEQ { $$ = NULL; } | EQEQ token_list EQEQ { $$ = $2; } ; token_list: TOKEN { $$ = cb_text_list_add (NULL, $1); } | token_list TOKEN { $$ = cb_text_list_add ($1, $2); } ; identifier: TOKEN { $$ = cb_text_list_add (NULL, $1); } | identifier IN TOKEN { $$ = cb_text_list_add ($1, " "); $$ = cb_text_list_add ($$, "IN"); $$ = cb_text_list_add ($$, " "); $$ = cb_text_list_add ($$, $3); } | identifier OF TOKEN { $$ = cb_text_list_add ($1, " "); $$ = cb_text_list_add ($$, "OF"); $$ = cb_text_list_add ($$, " "); $$ = cb_text_list_add ($$, $3); } | identifier '(' subscripts ')' { struct cb_text_list *l; $$ = cb_text_list_add ($1, " "); $$ = cb_text_list_add ($$, "("); $3 = cb_text_list_add ($3, ")"); for (l = $$; l->next; l = l->next); l->next = $3; } ; subscripts: TOKEN { $$ = cb_text_list_add (NULL, $1); } | subscripts TOKEN { $$ = cb_text_list_add ($1, " "); $$ = cb_text_list_add ($$, $2); } ; _printing: | PRINTING ; %% static char * fix_filename (char *name) { /* remove quotation from alphanumeric literals */ if (name[0] == '\'' || name[0] == '\"') { name++; name[strlen (name) - 1] = 0; } return name; } static char * fold_lower (char *name) { unsigned char *p; for (p = (unsigned char *)name; *p; p++) { if (isupper (*p)) { *p = tolower (*p); } } return name; } static char * fold_upper (char *name) { unsigned char *p; for (p = (unsigned char *)name; *p; p++) { if (islower (*p)) { *p = toupper (*p); } } return name; } static struct cb_replace_list * cb_replace_list_add (struct cb_replace_list *list, struct cb_text_list *old_text, struct cb_text_list *new_text) { struct cb_replace_list *p; struct cb_replace_list *l; p = cobc_malloc (sizeof (struct cb_replace_list)); p->old_text = old_text; p->new_text = new_text; p->next = NULL; if (!list) { return p; } else { for (l = list; l->next; l = l->next) ; l->next = p; return list; } } open-cobol-1.1/cobc/flag.def0000644000000000000000000000513211130701401011323 /* -*- c -*- * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "lib/gettext.h" /* CB_FLAG (var, name, doc) */ CB_FLAG (cb_flag_trace, "trace", N_("Generate trace code (Executed SECTION/PARAGRAPH)")) CB_FLAG (cb_flag_traceall, "traceall", N_("Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS)")) CB_FLAG (cb_flag_syntax_only, "syntax-only", N_("Syntax error checking only; don't emit any output")) CB_FLAG (cb_flag_static_call, "static-call", N_("Output static function calls for the CALL statement")) CB_FLAG (cb_flag_debugging_line, "debugging-line", N_("Enable debugging lines ('D' in indicator column)")) CB_FLAG (cb_flag_source_location, "source-location", N_("Generate source location code (Turned on by -debug or -g)")) CB_FLAG (cb_flag_implicit_init, "implicit-init", N_("Do automatic initialization of the Cobol runtime system")) CB_FLAG (cb_flag_sign_ascii, "sign-ascii", N_("Numeric display sign ASCII (Default on ASCII machines)")) CB_FLAG (cb_flag_sign_ebcdic, "sign-ebcdic", N_("Numeric display sign EBCDIC (Default on EBCDIC machines)")) CB_FLAG (cb_flag_stack_check, "stack-check", N_("PERFORM stack checking (Turned on by -debug or -g)")) CB_FLAG (cb_flag_fold_copy_lower, "fold-copy-lower", N_("Fold COPY subject to lower case (Default no transformation)")) CB_FLAG (cb_flag_fold_copy_upper, "fold-copy-upper", N_("Fold COPY subject to upper case (Default no transformation)")) CB_FLAG (cb_flag_notrunc, "notrunc", N_("Do not truncate binary fields according to PICTURE")) CB_FLAG (cb_flag_functions_all, "functions-all", N_("Allow use of intrinsic functions without FUNCTION keyword")) CB_FLAG (cb_flag_mfcomment, "mfcomment", N_("'*' or '/' in column 1 treated as comment (FIXED only)")) CB_FLAG (cb_flag_null_param, "null-param", N_("Pass extra NULL terminating pointers on CALL statements")) open-cobol-1.1/cobc/tree.c0000644000000000000000000014274711141321420011054 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include "cobc.h" #include "tree.h" #define PIC_ALPHABETIC 0x01 #define PIC_NUMERIC 0x02 #define PIC_NATIONAL 0x04 #define PIC_EDITED 0x08 #define PIC_ALPHANUMERIC (PIC_ALPHABETIC | PIC_NUMERIC) #define PIC_ALPHABETIC_EDITED (PIC_ALPHABETIC | PIC_EDITED) #define PIC_ALPHANUMERIC_EDITED (PIC_ALPHANUMERIC | PIC_EDITED) #define PIC_NUMERIC_EDITED (PIC_NUMERIC | PIC_EDITED) #define PIC_NATIONAL_EDITED (PIC_NATIONAL | PIC_EDITED) /* Local variables */ static const enum cb_class category_to_class_table[] = { CB_CLASS_UNKNOWN, /* CB_CATEGORY_UNKNOWN */ CB_CLASS_ALPHABETIC, /* CB_CATEGORY_ALPHABETIC */ CB_CLASS_ALPHANUMERIC, /* CB_CATEGORY_ALPHANUMERIC */ CB_CLASS_ALPHANUMERIC, /* CB_CATEGORY_ALPHANUMERIC_EDITED */ CB_CLASS_BOOLEAN, /* CB_CATEGORY_BOOLEAN */ CB_CLASS_INDEX, /* CB_CATEGORY_INDEX */ CB_CLASS_NATIONAL, /* CB_CATEGORY_NATIONAL */ CB_CLASS_NATIONAL, /* CB_CATEGORY_NATIONAL_EDITED */ CB_CLASS_NUMERIC, /* CB_CATEGORY_NUMERIC */ CB_CLASS_ALPHANUMERIC, /* CB_CATEGORY_NUMERIC_EDITED */ CB_CLASS_OBJECT, /* CB_CATEGORY_OBJECT_REFERENCE */ CB_CLASS_POINTER, /* CB_CATEGORY_DATA_POINTER */ CB_CLASS_POINTER, /* CB_CATEGORY_PROGRAM_POINTER */ }; static struct int_node { struct int_node *next; cb_tree node; int n; } *int_node_table = NULL; static char *treenamebuff = NULL; static int filler_id = 1; /* Global variables */ /* * Constants */ cb_tree cb_any; cb_tree cb_true; cb_tree cb_false; cb_tree cb_null; cb_tree cb_zero; cb_tree cb_one; cb_tree cb_space; cb_tree cb_low; cb_tree cb_high; cb_tree cb_norm_low; cb_tree cb_norm_high; cb_tree cb_quote; cb_tree cb_int0; cb_tree cb_int1; cb_tree cb_int2; cb_tree cb_int3; cb_tree cb_int4; cb_tree cb_int5; cb_tree cb_i[8]; cb_tree cb_error_node; cb_tree cb_intr_whencomp; cb_tree cb_intr_pi; cb_tree cb_intr_e; cb_tree cb_standard_error_handler; size_t gen_screen_ptr = 0; /* Local functions */ static char * to_cname (const char *s) { char *copy; unsigned char *p; copy = strdup (s); for (p = (unsigned char *)copy; *p; p++) { *p = (*p == '-') ? '_' : toupper (*p); } return copy; } static size_t hash (const unsigned char *s) { size_t val = 0; for (; *s; s++) { val += toupper (*s); } return val % CB_WORD_HASH_SIZE; } static struct cb_word * lookup_word (const char *name) { struct cb_word *p; size_t val; val = hash ((const unsigned char *)name); /* find the existing word */ if (current_program) { for (p = current_program->word_table[val]; p; p = p->next) { if (strcasecmp (p->name, name) == 0) { return p; } } } /* create new word */ p = cobc_malloc (sizeof (struct cb_word)); p->name = strdup (name); /* insert it into the table */ if (current_program) { p->next = current_program->word_table[val]; current_program->word_table[val] = p; } return p; } static void file_error (cb_tree name, const char *clause) { cb_error_x (name, _("%s clause is required for file '%s'"), clause, CB_NAME (name)); } /* * Tree */ static void * make_tree (int tag, enum cb_category category, size_t size) { cb_tree x; x = cobc_malloc (size); x->tag = tag; x->category = category; return x; } static cb_tree make_constant (enum cb_category category, const char *val) { struct cb_const *p; p = make_tree (CB_TAG_CONST, category, sizeof (struct cb_const)); p->val = val; return CB_TREE (p); } static cb_tree make_constant_label (const char *name) { struct cb_label *p; p = CB_LABEL (cb_build_label (cb_build_reference (name), NULL)); p->need_begin = 1; return CB_TREE (p); } static int cb_name_1 (char *s, cb_tree x) { char *orig; struct cb_funcall *cbip; struct cb_binary_op *cbop; struct cb_reference *p; struct cb_intrinsic *cbit; cb_tree l; int i; orig = s; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: if (x == cb_any) { strcpy (s, "ANY"); } else if (x == cb_true) { strcpy (s, "TRUE"); } else if (x == cb_false) { strcpy (s, "FALSE"); } else if (x == cb_null) { strcpy (s, "NULL"); } else if (x == cb_zero) { strcpy (s, "ZERO"); } else if (x == cb_space) { strcpy (s, "SPACE"); } else if (x == cb_low || x == cb_norm_low) { strcpy (s, "LOW-VALUE"); } else if (x == cb_high || x == cb_norm_high) { strcpy (s, "HIGH-VALUE"); } else if (x == cb_quote) { strcpy (s, "QUOTE"); } else if (x == cb_error_node) { strcpy (s, "Internal error node"); } else { strcpy (s, "#"); } break; case CB_TAG_LITERAL: if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { strcpy (s, (char *)CB_LITERAL (x)->data); } else { sprintf (s, "\"%s\"", CB_LITERAL (x)->data); } break; case CB_TAG_FIELD: strcpy (s, CB_FIELD (x)->name); break; case CB_TAG_REFERENCE: p = CB_REFERENCE (x); s += sprintf (s, "%s", p->word->name); if (p->subs) { l = p->subs = cb_list_reverse (p->subs); s += sprintf (s, " ("); for (; l; l = CB_CHAIN (l)) { s += cb_name_1 (s, CB_VALUE (l)); s += sprintf (s, CB_CHAIN (l) ? ", " : ")"); } p->subs = cb_list_reverse (p->subs); } if (p->offset) { s += sprintf (s, " ("); s += cb_name_1 (s, p->offset); s += sprintf (s, ":"); if (p->length) { s += cb_name_1 (s, p->length); } strcpy (s, ")"); } if (p->chain) { s += sprintf (s, " in "); s += cb_name_1 (s, p->chain); } break; case CB_TAG_LABEL: sprintf (s, "%s", CB_LABEL (x)->name); break; case CB_TAG_ALPHABET_NAME: sprintf (s, "%s", CB_ALPHABET_NAME (x)->name); break; case CB_TAG_CLASS_NAME: sprintf (s, "%s", CB_CLASS_NAME (x)->name); break; case CB_TAG_LOCALE_NAME: sprintf (s, "%s", CB_LOCALE_NAME (x)->name); break; case CB_TAG_BINARY_OP: cbop = CB_BINARY_OP (x); if (cbop->op == '@') { s += sprintf (s, "("); s += cb_name_1 (s, cbop->x); s += sprintf (s, ")"); } else if (cbop->op == '!') { s += sprintf (s, "!"); s += cb_name_1 (s, cbop->x); } else { s += sprintf (s, "("); s += cb_name_1 (s, cbop->x); s += sprintf (s, " %c ", cbop->op); s += cb_name_1 (s, cbop->y); strcpy (s, ")"); } break; case CB_TAG_FUNCALL: cbip = CB_FUNCALL (x); s += sprintf (s, "%s", cbip->name); for (i = 0; i < cbip->argc; i++) { s += sprintf (s, (i == 0) ? "(" : ", "); s += cb_name_1 (s, cbip->argv[i]); } s += sprintf (s, ")"); break; case CB_TAG_INTRINSIC: cbit = CB_INTRINSIC (x); sprintf (s, "FUNCTION %s", cbit->intr_tab->name); break; default: sprintf (s, "#", CB_TREE_TAG (x), x); } return strlen (orig); } static cb_tree make_intrinsic (cb_tree name, struct cb_intrinsic_table *cbp, cb_tree args, cb_tree field, cb_tree refmod) { struct cb_intrinsic *x; /* Leave in, we may need this cb_tree l; for (l = args; l; l = CB_CHAIN(l)) { switch (CB_TREE_TAG (CB_VALUE(l))) { case CB_TAG_CONST: case CB_TAG_INTEGER: case CB_TAG_LITERAL: case CB_TAG_DECIMAL: case CB_TAG_FIELD: case CB_TAG_REFERENCE: case CB_TAG_INTRINSIC: break; default: cb_error (_("FUNCTION %s has invalid/not supported arguments - Tag %d"), cbp->name, CB_TREE_TAG(l)); return cb_error_node; } } */ x = make_tree (CB_TAG_INTRINSIC, cbp->category, sizeof (struct cb_intrinsic)); x->name = name; x->args = args; x->intr_tab = cbp; x->intr_field = field; if (refmod) { x->offset = CB_PAIR_X (refmod); x->length = CB_PAIR_Y (refmod); } return CB_TREE (x); } static cb_tree global_check (struct cb_reference *r, cb_tree items, size_t *ambiguous) { cb_tree candidate = NULL; struct cb_field *p; cb_tree v; cb_tree c; for (; items; items = CB_CHAIN (items)) { /* find a candidate value by resolving qualification */ v = CB_VALUE (items); c = r->chain; if (CB_FIELD_P (v)) { if (!CB_FIELD (v)->flag_is_global) { continue; } /* in case the value is a field, it might be qualified by its parent names and a file name */ if (CB_FIELD (v)->flag_indexed_by) { p = CB_FIELD (v)->index_qual; } else { p = CB_FIELD (v)->parent; } /* resolve by parents */ for (; p; p = p->parent) { if (c && strcasecmp (CB_NAME (c), p->name) == 0) { c = CB_REFERENCE (c)->chain; } } /* resolve by file */ if (c && CB_REFERENCE (c)->chain == NULL) { if (CB_REFERENCE (c)->word->count == 1 && CB_FILE_P (cb_ref (c)) && (CB_FILE (cb_ref (c)) == cb_field_founder (CB_FIELD (v))->file)) { c = CB_REFERENCE (c)->chain; } } } /* a well qualified value is a good candidate */ if (c == NULL) { if (candidate == NULL) { /* keep the first candidate */ candidate = v; } else { /* multiple candidates and possibly ambiguous */ *ambiguous = 1; } } } return candidate; } /* Global functions */ struct cb_literal * build_literal (enum cb_category category, const unsigned char *data, size_t size) { struct cb_literal *p; p = make_tree (CB_TAG_LITERAL, category, sizeof (struct cb_literal)); p->data = cobc_malloc ((size_t) (size + 1)); p->size = size; memcpy (p->data, data, (size_t) size); /* RXW - malloc zeroes p->data[size] = 0; */ return p; } char * cb_name (cb_tree x) { if (!treenamebuff) { treenamebuff = cobc_malloc (COB_NORMAL_BUFF); } cb_name_1 (treenamebuff, x); return treenamebuff; } enum cb_class cb_tree_class (cb_tree x) { return category_to_class_table[CB_TREE_CATEGORY (x)]; } enum cb_category cb_tree_category (cb_tree x) { struct cb_cast *p; struct cb_reference *r; struct cb_field *f; if (x == cb_error_node) { return 0; } if (x->category != CB_CATEGORY_UNKNOWN) { return x->category; } switch (CB_TREE_TAG (x)) { case CB_TAG_CAST: p = CB_CAST (x); switch (p->type) { case CB_CAST_ADDRESS: case CB_CAST_ADDR_OF_ADDR: x->category = CB_CATEGORY_DATA_POINTER; break; case CB_CAST_PROGRAM_POINTER: x->category = CB_CATEGORY_PROGRAM_POINTER; break; default: fprintf (stderr, "Unexpected cast type -> %d\n", p->type); ABORT (); } break; case CB_TAG_REFERENCE: r = CB_REFERENCE (x); if (r->offset) { x->category = CB_CATEGORY_ALPHANUMERIC; } else { x->category = cb_tree_category (r->value); } break; case CB_TAG_FIELD: f = CB_FIELD (x); if (f->children) { x->category = CB_CATEGORY_ALPHANUMERIC; } else if (f->usage == CB_USAGE_POINTER && f->level != 88) { x->category = CB_CATEGORY_DATA_POINTER; } else if (f->usage == CB_USAGE_PROGRAM_POINTER && f->level != 88) { x->category = CB_CATEGORY_PROGRAM_POINTER; } else { switch (f->level) { case 66: if (f->rename_thru) { x->category = CB_CATEGORY_ALPHANUMERIC; } else { x->category = cb_tree_category (CB_TREE (f->redefines)); } break; case 88: x->category = CB_CATEGORY_BOOLEAN; break; default: x->category = f->pic->category; break; } } break; case CB_TAG_ALPHABET_NAME: case CB_TAG_LOCALE_NAME: x->category = CB_CATEGORY_ALPHANUMERIC; break; case CB_TAG_BINARY_OP: x->category = CB_CATEGORY_BOOLEAN; break; default: fprintf (stderr, "Unknown tree tag %d Category %d\n", CB_TREE_TAG (x), x->category); ABORT (); } return x->category; } int cb_tree_type (cb_tree x) { struct cb_field *f; f = cb_field (x); if (f->children) { return COB_TYPE_GROUP; } switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_ALPHABETIC: case CB_CATEGORY_ALPHANUMERIC: return COB_TYPE_ALPHANUMERIC; case CB_CATEGORY_ALPHANUMERIC_EDITED: return COB_TYPE_ALPHANUMERIC_EDITED; case CB_CATEGORY_NUMERIC: switch (f->usage) { case CB_USAGE_DISPLAY: return COB_TYPE_NUMERIC_DISPLAY; case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: case CB_USAGE_INDEX: case CB_USAGE_LENGTH: return COB_TYPE_NUMERIC_BINARY; case CB_USAGE_FLOAT: return COB_TYPE_NUMERIC_FLOAT; case CB_USAGE_DOUBLE: return COB_TYPE_NUMERIC_DOUBLE; case CB_USAGE_PACKED: return COB_TYPE_NUMERIC_PACKED; default: fprintf (stderr, "Unexpected numeric usage -> %d\n", f->usage); ABORT (); } case CB_CATEGORY_NUMERIC_EDITED: return COB_TYPE_NUMERIC_EDITED; case CB_CATEGORY_OBJECT_REFERENCE: case CB_CATEGORY_DATA_POINTER: case CB_CATEGORY_PROGRAM_POINTER: return COB_TYPE_NUMERIC_BINARY; default: fprintf (stderr, "Unexpected category -> %d\n", CB_TREE_CATEGORY (x)); ABORT (); } /* NOT REACHED */ return 0; } int cb_fits_int (cb_tree x) { struct cb_literal *l; struct cb_field *f; switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: l = CB_LITERAL (x); if (l->scale <= 0 && l->size < 10) { return 1; } return 0; case CB_TAG_FIELD: f = CB_FIELD (x); switch (f->usage) { case CB_USAGE_INDEX: case CB_USAGE_LENGTH: return 1; case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->pic->scale <= 0 && f->size <= (int)sizeof (int)) { return 1; } return 0; case CB_USAGE_DISPLAY: if (f->size < 10) { if (!f->pic || f->pic->scale <= 0) { return 1; } } return 0; case CB_USAGE_PACKED: if (f->pic->scale <= 0 && f->pic->digits < 10) { return 1; } return 0; default: return 0; } case CB_TAG_REFERENCE: return cb_fits_int (CB_REFERENCE (x)->value); default: return 0; } } int cb_fits_long_long (cb_tree x) { struct cb_literal *l; struct cb_field *f; switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: l = CB_LITERAL (x); if (l->scale <= 0 && l->size < 19) { return 1; } return 0; case CB_TAG_FIELD: f = CB_FIELD (x); switch (f->usage) { case CB_USAGE_INDEX: case CB_USAGE_LENGTH: return 1; case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->pic->scale <= 0 && f->size <= (int)sizeof (long long)) { return 1; } return 0; case CB_USAGE_DISPLAY: if (f->pic->scale <= 0 && f->size < 19) { return 1; } return 0; default: return 0; } case CB_TAG_REFERENCE: return cb_fits_long_long (CB_REFERENCE (x)->value); default: return 0; } } int cb_get_int (cb_tree x) { struct cb_literal *l; size_t i; int val = 0; l = CB_LITERAL (x); for (i = 0; i < l->size; i++) { if (l->data[i] != '0') { break; } } /* RXWRXW if (l->size - i >= 10) { ABORT (); } */ for (; i < l->size; i++) { val = val * 10 + l->data[i] - '0'; } if (l->sign < 0) { val = -val; } return val; } long long cb_get_long_long (cb_tree x) { struct cb_literal *l; size_t i; long long val = 0; l = CB_LITERAL (x); for (i = 0; i < l->size; i++) { if (l->data[i] != '0') { break; } } if (l->size - i >= 19) { ABORT (); } for (; i < l->size; i++) { val = val * 10 + l->data[i] - '0'; } if (l->sign < 0) { val = -val; } return val; } void cb_init_constants (void) { char *s; int i; cb_error_node = make_constant (CB_CATEGORY_UNKNOWN, NULL); cb_any = make_constant (CB_CATEGORY_UNKNOWN, NULL); cb_true = make_constant (CB_CATEGORY_BOOLEAN, "1"); cb_false = make_constant (CB_CATEGORY_BOOLEAN, "0"); cb_null = make_constant (CB_CATEGORY_DATA_POINTER, "0"); cb_zero = make_constant (CB_CATEGORY_NUMERIC, "&cob_zero"); cb_one = make_constant (CB_CATEGORY_NUMERIC, "&cob_one"); cb_space = make_constant (CB_CATEGORY_ALPHANUMERIC, "&cob_space"); cb_low = make_constant (CB_CATEGORY_ALPHANUMERIC, "&cob_low"); cb_norm_low = cb_low; cb_high = make_constant (CB_CATEGORY_ALPHANUMERIC, "&cob_high"); cb_norm_high = cb_high; cb_quote = make_constant (CB_CATEGORY_ALPHANUMERIC, "&cob_quote"); cb_int0 = cb_int (0); cb_int1 = cb_int (1); cb_int2 = cb_int (2); cb_int3 = cb_int (3); cb_int4 = cb_int (4); cb_int5 = cb_int (5); for (i = 1; i < 8; i++) { s = cobc_malloc (4); sprintf (s, "i%d", i); cb_i[i] = make_constant (CB_CATEGORY_NUMERIC, s); } cb_standard_error_handler = make_constant_label ("Default Error Handler"); } /* * List */ cb_tree cb_build_list (cb_tree purpose, cb_tree value, cb_tree rest) { struct cb_list *p; p = make_tree (CB_TAG_LIST, CB_CATEGORY_UNKNOWN, sizeof (struct cb_list)); p->purpose = purpose; p->value = value; p->chain = rest; return CB_TREE (p); } cb_tree cb_list_append (cb_tree l1, cb_tree l2) { cb_tree l; if (l1 == NULL) { return l2; } else { l = l1; while (CB_CHAIN (l)) { l = CB_CHAIN (l); } CB_CHAIN (l) = l2; return l1; } } cb_tree cb_list_add (cb_tree l, cb_tree x) { return cb_list_append (l, cb_list_init (x)); } cb_tree cb_list_reverse (cb_tree l) { cb_tree next; cb_tree last = NULL; for (; l; l = next) { next = CB_CHAIN (l); CB_CHAIN (l) = last; last = l; } return last; } int cb_list_length (cb_tree l) { int n = 0; for (; l; l = CB_CHAIN (l)) { n++; } return n; } void cb_list_map (cb_tree (*func) (cb_tree x), cb_tree l) { for (; l; l = CB_CHAIN (l)) { CB_VALUE (l) = func (CB_VALUE (l)); } } /* * Program */ struct cb_program * cb_build_program (struct cb_program *last_program, int nest_level) { struct cb_program *p; cb_reset_78 (); cb_reset_in_procedure (); cb_clear_real_field (); p = cobc_malloc (sizeof (struct cb_program)); p->next_program = last_program; p->nested_level = nest_level; p->decimal_point = '.'; p->currency_symbol = '$'; p->numeric_separator = ','; if (nest_level) { p->global_file_list = last_program->global_file_list; p->collating_sequence = last_program->collating_sequence; p->function_spec_list = last_program->function_spec_list; p->class_spec_list = last_program->class_spec_list; p->interface_spec_list = last_program->interface_spec_list; p->program_spec_list = last_program->program_spec_list; p->property_spec_list = last_program->property_spec_list; p->alphabet_name_list = last_program->alphabet_name_list; p->class_name_list = last_program->class_name_list; p->locale_list = last_program->locale_list; p->symbolic_list = last_program->symbolic_list; p->decimal_point = last_program->decimal_point; p->numeric_separator = last_program->numeric_separator; p->currency_symbol = last_program->currency_symbol; p->cb_return_code = last_program->cb_return_code; } else { functions_are_all = cb_flag_functions_all; } return p; } /* * Integer */ cb_tree cb_int (int n) { struct cb_integer *x; struct int_node *p; for (p = int_node_table; p; p = p->next) { if (p->n == n) { return p->node; } } x = make_tree (CB_TAG_INTEGER, CB_CATEGORY_NUMERIC, sizeof (struct cb_integer)); x->val = n; p = cobc_malloc (sizeof (struct int_node)); p->n = n; p->node = CB_TREE (x); p->next = int_node_table; int_node_table = p; return p->node; } /* * String */ cb_tree cb_build_string (const unsigned char *data, size_t size) { struct cb_string *p; p = make_tree (CB_TAG_STRING, CB_CATEGORY_ALPHANUMERIC, sizeof (struct cb_string)); p->size = size; p->data = data; return CB_TREE (p); } /* * Alphabet-name */ cb_tree cb_build_alphabet_name (cb_tree name, enum cb_alphabet_name_type type) { struct cb_alphabet_name *p; p = make_tree (CB_TAG_ALPHABET_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_alphabet_name)); p->name = cb_define (name, CB_TREE (p)); p->cname = to_cname (p->name); p->type = type; return CB_TREE (p); } /* * Class-name */ cb_tree cb_build_class_name (cb_tree name, cb_tree list) { struct cb_class_name *p; char buff[COB_MINI_BUFF]; p = make_tree (CB_TAG_CLASS_NAME, CB_CATEGORY_BOOLEAN, sizeof (struct cb_class_name)); p->name = cb_define (name, CB_TREE (p)); snprintf (buff, COB_MINI_MAX, "is_%s", to_cname (p->name)); p->cname = strdup (buff); p->list = list; return CB_TREE (p); } /* * Locale-name */ cb_tree cb_build_locale_name (cb_tree name, cb_tree list) { struct cb_class_name *p; p = make_tree (CB_TAG_LOCALE_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_locale_name)); p->name = cb_define (name, CB_TREE (p)); p->cname = to_cname (p->name); p->list = list; return CB_TREE (p); } /* * System-name */ cb_tree cb_build_system_name (enum cb_system_name_category category, int token) { struct cb_system_name *p; p = make_tree (CB_TAG_SYSTEM_NAME, CB_CATEGORY_UNKNOWN, sizeof (struct cb_system_name)); p->category = category; p->token = token; return CB_TREE (p); } /* * Literal */ cb_tree cb_build_numeric_literal (int sign, const unsigned char *data, int scale) { struct cb_literal *p; p = build_literal (CB_CATEGORY_NUMERIC, data, strlen ((char *)data)); p->sign = (char)sign; p->scale = (char)scale; return CB_TREE (p); } cb_tree cb_build_alphanumeric_literal (const unsigned char *data, size_t size) { return CB_TREE (build_literal (CB_CATEGORY_ALPHANUMERIC, data, size)); } cb_tree cb_concat_literals (cb_tree x1, cb_tree x2) { unsigned char *buff; cb_tree x; unsigned char *data1; unsigned char *data2; size_t size1; size_t size2; if (x1 == cb_error_node || x2 == cb_error_node) { return cb_error_node; } if (CB_LITERAL_P (x1)) { data1 = CB_LITERAL (x1)->data; size1 = CB_LITERAL (x1)->size; } else if (CB_CONST_P (x1)) { size1 = 1; if (x1 == cb_space) { data1 = (unsigned char *)" "; } else if (x1 == cb_zero) { data1 = (unsigned char *)"0"; } else if (x1 == cb_quote) { data1 = (unsigned char *)"\""; } else if (x1 == cb_norm_low) { data1 = (unsigned char *)"\0"; } else if (x1 == cb_norm_high) { data1 = (unsigned char *)"\255"; } else if (x1 == cb_null) { data1 = (unsigned char *)"\0"; } else { return cb_error_node; } } else { return cb_error_node; } if (CB_LITERAL_P (x2)) { data2 = CB_LITERAL (x2)->data; size2 = CB_LITERAL (x2)->size; } else if (CB_CONST_P (x2)) { size2 = 1; if (x2 == cb_space) { data2 = (unsigned char *)" "; } else if (x2 == cb_zero) { data2 = (unsigned char *)"0"; } else if (x2 == cb_quote) { data2 = (unsigned char *)"\""; } else if (x2 == cb_norm_low) { data2 = (unsigned char *)"\0"; } else if (x2 == cb_norm_high) { data2 = (unsigned char *)"\255"; } else if (x2 == cb_null) { data2 = (unsigned char *)"\0"; } else { return cb_error_node; } } else { return cb_error_node; } buff = cobc_malloc (size1 + size2 + 3); memcpy (buff, data1, size1); memcpy (buff + size1, data2, size2); x = cb_build_alphanumeric_literal (buff, size1 + size2); free (buff); return x; } /* * Decimal */ cb_tree cb_build_decimal (int id) { struct cb_decimal *p; p = make_tree (CB_TAG_DECIMAL, CB_CATEGORY_NUMERIC, sizeof (struct cb_decimal)); p->id = id; return CB_TREE (p); } /* * Picture */ cb_tree cb_build_picture (const char *str) { struct cb_picture *pic; const char *p; size_t idx = 0; size_t buffcnt = 0; size_t at_beginning; size_t at_end; size_t p_char_seen; size_t s_char_seen; int category = 0; int size = 0; int allocated = 0; int digits = 0; int scale = 0; int s_count = 0; int v_count = 0; int i; int n; unsigned char c; unsigned char lastonechar = 0; unsigned char lasttwochar = 0; unsigned char buff[COB_SMALL_BUFF]; pic = make_tree (CB_TAG_PICTURE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_picture)); if (strlen (str) > 50) { goto error; } memset (buff, 0, sizeof (buff)); p_char_seen = 0; s_char_seen = 0; for (p = str; *p; p++) { n = 1; c = *p; repeat: /* count the number of repeated chars */ while (p[1] == c) { p++, n++; } /* add parenthesized numbers */ if (p[1] == '(') { i = 0; p += 2; for (; *p == '0'; p++) { ; } for (; *p != ')'; p++) { if (!isdigit (*p)) { goto error; } else { allocated++; if (allocated > 9) { goto error; } i = i * 10 + (*p - '0'); } } if (i == 0) { goto error; } n += i - 1; goto repeat; } /* check grammar and category */ /* FIXME: need more error check */ switch (c) { case 'A': if (s_char_seen || p_char_seen) { goto error; } category |= PIC_ALPHABETIC; break; case 'X': if (s_char_seen || p_char_seen) { goto error; } category |= PIC_ALPHANUMERIC; break; case '9': category |= PIC_NUMERIC; digits += n; if (v_count) { scale += n; } break; case 'N': if (s_char_seen || p_char_seen) { goto error; } category |= PIC_NATIONAL; break; case 'S': category |= PIC_NUMERIC; if (category & PIC_ALPHABETIC) { goto error; } s_count += n; if (s_count > 1 || idx != 0) { goto error; } s_char_seen = 1; continue; case ',': case '.': category |= PIC_NUMERIC_EDITED; if (s_char_seen || p_char_seen) { goto error; } if (c != current_program->decimal_point) { break; } /* fall through */ case 'V': category |= PIC_NUMERIC; if (category & PIC_ALPHABETIC) { goto error; } v_count += n; if (v_count > 1) { goto error; } break; case 'P': category |= PIC_NUMERIC; if (category & PIC_ALPHABETIC) { goto error; } if (p_char_seen) { goto error; } at_beginning = 0; at_end = 0; switch (buffcnt) { case 0: /* P..... */ at_beginning = 1; break; case 1: /* VP.... */ /* SP.... */ if (lastonechar == 'V' || lastonechar == 'S') { at_beginning = 1; } break; case 2: /* SVP... */ if (lasttwochar == 'S' && lastonechar == 'V') { at_beginning = 1; } break; } if (p[1] == 0 || (p[1] == 'V' && p[2] == 0)) { /* .....P */ /* ....PV */ at_end = 1; } if (!at_beginning && !at_end) { goto error; } p_char_seen = 1; if (at_beginning) { v_count++; /* implicit V */ } digits += n; if (v_count) { scale += n; } else { scale -= n; } break; case '0': case 'B': case '/': category |= PIC_EDITED; if (s_char_seen || p_char_seen) { goto error; } break; case '*': case 'Z': category |= PIC_NUMERIC_EDITED; if (category & PIC_ALPHABETIC) { goto error; } if (s_char_seen || p_char_seen) { goto error; } digits += n; if (v_count) { scale += n; } break; case '+': case '-': category |= PIC_NUMERIC_EDITED; if (category & PIC_ALPHABETIC) { goto error; } if (s_char_seen || p_char_seen) { goto error; } digits += n - 1; s_count++; /* FIXME: need more check */ break; case 'C': category |= PIC_NUMERIC_EDITED; if (!(p[1] == 'R' && p[2] == 0)) { goto error; } if (s_char_seen || p_char_seen) { goto error; } p++; s_count++; break; case 'D': category |= PIC_NUMERIC_EDITED; if (!(p[1] == 'B' && p[2] == 0)) { goto error; } if (s_char_seen || p_char_seen) { goto error; } p++; s_count++; break; default: if (c == current_program->currency_symbol) { category |= PIC_NUMERIC_EDITED; digits += n - 1; /* FIXME: need more check */ break; } goto error; } /* calculate size */ if (c != 'V' && c != 'P') { size += n; } if (c == 'C' || c == 'D' || c == 'N') { size += n; } /* store in the buffer */ buff[idx++] = c; lasttwochar = lastonechar; lastonechar = c; memcpy (&buff[idx], (unsigned char *)&n, sizeof(int)); idx += sizeof(int); ++buffcnt; } buff[idx] = 0; if (size == 0 && v_count) { goto error; } /* set picture */ pic->orig = strdup (str); pic->size = size; pic->digits = (unsigned char)digits; pic->scale = (signed char)scale; pic->have_sign = (unsigned char)s_count; /* set picture category */ switch (category) { case PIC_ALPHABETIC: pic->category = CB_CATEGORY_ALPHABETIC; break; case PIC_NUMERIC: pic->category = CB_CATEGORY_NUMERIC; if (digits > 36) { cb_error (_("Numeric field cannot be larger than 36 digits")); } break; case PIC_ALPHANUMERIC: case PIC_NATIONAL: pic->category = CB_CATEGORY_ALPHANUMERIC; break; case PIC_NUMERIC_EDITED: pic->str = cobc_malloc (idx + 1); memcpy (pic->str, buff, idx); pic->category = CB_CATEGORY_NUMERIC_EDITED; pic->lenstr = idx; break; case PIC_EDITED: case PIC_ALPHABETIC_EDITED: case PIC_ALPHANUMERIC_EDITED: case PIC_NATIONAL_EDITED: pic->str = cobc_malloc (idx + 1); memcpy (pic->str, buff, idx); pic->category = CB_CATEGORY_ALPHANUMERIC_EDITED; pic->lenstr = idx; break; default: goto error; } goto end; error: cb_error (_("Invalid picture string - '%s'"), str); end: return CB_TREE (pic); } /* * Field */ cb_tree cb_build_field (cb_tree name) { struct cb_field *p; p = make_tree (CB_TAG_FIELD, CB_CATEGORY_UNKNOWN, sizeof (struct cb_field)); p->id = cb_field_id++; p->name = cb_define (name, CB_TREE (p)); p->ename = NULL; p->usage = CB_USAGE_DISPLAY; p->storage = CB_STORAGE_WORKING; p->occurs_max = 1; return CB_TREE (p); } cb_tree cb_build_implicit_field (cb_tree name, int len) { cb_tree x; char pic[32]; x = cb_build_field (name); memset (pic, 0, sizeof(pic)); sprintf (pic, "X(%d)", len); CB_FIELD (x)->pic = CB_PICTURE (cb_build_picture (pic)); cb_validate_field (CB_FIELD (x)); return x; } cb_tree cb_build_constant (cb_tree name, cb_tree value) { cb_tree x; x = cb_build_field (name); x->category = cb_tree_category (value); CB_FIELD (x)->storage = CB_STORAGE_CONSTANT; CB_FIELD (x)->values = cb_list_init (value); return x; } struct cb_field * cb_field (cb_tree x) { if (CB_REFERENCE_P (x)) { return CB_FIELD (cb_ref (x)); } else { return CB_FIELD (x); } } struct cb_field * cb_field_add (struct cb_field *f, struct cb_field *p) { struct cb_field *t; if (f == NULL) { return p; } for (t = f; t->sister; t = t->sister) { ; } t->sister = p; return f; } int cb_field_size (cb_tree x) { struct cb_reference *r; struct cb_field *f; switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: return CB_LITERAL (x)->size; case CB_TAG_FIELD: return CB_FIELD (x)->size; case CB_TAG_REFERENCE: r = CB_REFERENCE (x); f = CB_FIELD (r->value); if (r->length) { if (CB_LITERAL_P (r->length)) { return cb_get_int (r->length); } else { return -1; } } else if (r->offset) { if (CB_LITERAL_P (r->offset)) { return f->size - cb_get_int (r->offset) + 1; } else { return -1; } } else { return f->size; } default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } /* NOT REACHED */ return 0; } struct cb_field * cb_field_founder (struct cb_field *f) { while (f->parent) { f = f->parent; } return f; } struct cb_field * cb_field_variable_size (struct cb_field *f) { struct cb_field *p; for (f = f->children; f; f = f->sister) { if (f->occurs_depending) { return f; } else if ((p = cb_field_variable_size (f)) != NULL) { return p; } } return NULL; } struct cb_field * cb_field_variable_address (struct cb_field *f) { struct cb_field *p; for (p = f->parent; p; f = f->parent, p = f->parent) { for (p = p->children; p != f; p = p->sister) { if (p->occurs_depending || cb_field_variable_size (p)) { return p; } } } return NULL; } /* Return 1 if P is subordinate to F */ int cb_field_subordinate (struct cb_field *p, struct cb_field *f) { for (p = p->parent; p; p = p->parent) { if (p == f) { return 1; } } return 0; } /* * File */ struct cb_file * build_file (cb_tree name) { struct cb_file *p; p = make_tree (CB_TAG_FILE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_file)); p->name = cb_define (name, CB_TREE (p)); p->cname = to_cname (p->name); p->organization = COB_ORG_SEQUENTIAL; p->access_mode = COB_ACCESS_SEQUENTIAL; p->handler = CB_LABEL (cb_standard_error_handler); p->handler_prog = current_program; return p; } void validate_file (struct cb_file *f, cb_tree name) { /* check RECORD/RELATIVE KEY clause */ switch (f->organization) { case COB_ORG_INDEXED: if (f->key == NULL) { file_error (name, "RECORD KEY"); } break; case COB_ORG_RELATIVE: if (f->key == NULL && f->access_mode != COB_ACCESS_SEQUENTIAL) { file_error (name, "RELATIVE KEY"); } break; } } void finalize_file (struct cb_file *f, struct cb_field *records) { struct cb_field *p; struct cb_field *v; cb_tree l; cb_tree x; char buff[COB_MINI_BUFF]; if (f->special) { f->organization = COB_ORG_LINE_SEQUENTIAL; } if (f->fileid_assign && !f->assign) { f->assign = cb_build_alphanumeric_literal ((unsigned char *)f->name, strlen (f->name)); } /* check the record size if it is limited */ for (p = records; p; p = p->sister) { if (f->record_min > 0) { if (p->size < f->record_min) { cb_error (_("Record size too small '%s'"), p->name); } } if (f->record_max > 0) { if (p->size > f->record_max) { cb_error (_("Record size too large '%s' (%d)"), p->name, p->size); } } } /* compute the record size */ if (f->record_min == 0) { if (records) { f->record_min = records->size; } else { f->record_min = 0; } } for (p = records; p; p = p->sister) { v = cb_field_variable_size (p); if (v && v->offset + v->size * v->occurs_min < f->record_min) { f->record_min = v->offset + v->size * v->occurs_min; } if (p->size < f->record_min) { f->record_min = p->size; } if (p->size > f->record_max) { f->record_max = p->size; } } if (f->same_clause) { for (l = current_program->file_list; l; l = CB_CHAIN (l)) { if (CB_FILE (CB_VALUE (l))->same_clause == f->same_clause) { if (CB_FILE (CB_VALUE (l))->finalized) { if (f->record_max > CB_FILE (CB_VALUE (l))->record->memory_size) { CB_FILE (CB_VALUE (l))->record->memory_size = f->record_max; } f->record = CB_FILE (CB_VALUE (l))->record; for (p = records; p; p = p->sister) { p->file = f; p->redefines = f->record; } for (p = f->record->sister; p; p = p->sister) { if (!p->sister) { p->sister = records; break; } } f->finalized = 1; return; } } } } /* create record */ snprintf (buff, COB_MINI_MAX, "%s_record", f->name); if (f->record_max == 0) { f->record_max = 32; f->record_min = 32; } if (f->organization == COB_ORG_LINE_SEQUENTIAL) { f->record_min = 0; } f->record = CB_FIELD (cb_build_implicit_field (cb_build_reference (buff), f->record_max)); f->record->sister = records; f->record->count++; if (f->external) { has_external = 1; f->record->flag_external = 1; } for (p = records; p; p = p->sister) { p->file = f; p->redefines = f->record; } f->finalized = 1; if (f->linage) { snprintf (buff, COB_MINI_MAX, "LC_%s", f->name); x = cb_build_field (cb_build_reference (buff)); CB_FIELD (x)->pic = CB_PICTURE (cb_build_picture ("9(9)")); CB_FIELD (x)->usage = CB_USAGE_COMP_5; CB_FIELD (x)->values = cb_list_init (cb_zero); CB_FIELD (x)->count++; cb_validate_field (CB_FIELD (x)); f->linage_ctr = cb_build_field_reference (CB_FIELD (x), NULL); current_program->working_storage = cb_field_add (current_program->working_storage, CB_FIELD (x)); } } /* * Reference */ cb_tree cb_build_reference (const char *name) { struct cb_reference *p; p = make_tree (CB_TAG_REFERENCE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_reference)); p->word = lookup_word (name); return CB_TREE (p); } cb_tree cb_build_filler (void) { cb_tree x; char name[16]; sprintf (name, "WORK$%d", filler_id++); x = cb_build_reference (name); x->source_line = cb_source_line; return x; } cb_tree cb_build_field_reference (struct cb_field *f, cb_tree ref) { cb_tree x; struct cb_word *word; x = cb_build_reference (f->name); word = CB_REFERENCE (x)->word; if (ref) { memcpy (x, ref, sizeof (struct cb_reference)); } x->category = CB_CATEGORY_UNKNOWN; CB_REFERENCE (x)->word = word; CB_REFERENCE (x)->value = CB_TREE (f); return x; } const char * cb_define (cb_tree name, cb_tree val) { struct cb_word *w; w = CB_REFERENCE (name)->word; w->items = cb_list_add (w->items, val); w->count++; val->source_file = name->source_file; val->source_line = name->source_line; CB_REFERENCE (name)->value = val; return w->name; } void cb_define_system_name (const char *name) { cb_tree x; x = cb_build_reference (name); if (CB_REFERENCE (x)->word->count == 0) { cb_define (x, lookup_system_name (name)); } } cb_tree cb_ref (cb_tree x) { struct cb_reference *r; struct cb_field *p; struct cb_label *s; cb_tree candidate = NULL; cb_tree items; cb_tree cb1; cb_tree cb2; cb_tree v; cb_tree c; struct cb_program *prog; struct cb_word *w; size_t val; size_t ambiguous = 0; r = CB_REFERENCE (x); /* if this reference has already been resolved (and the value has been cached), then just return the value */ if (r->value) { return r->value; } /* resolve the value */ items = r->word->items; for (; items; items = CB_CHAIN (items)) { /* find a candidate value by resolving qualification */ v = CB_VALUE (items); c = r->chain; switch (CB_TREE_TAG (v)) { case CB_TAG_FIELD: /* in case the value is a field, it might be qualified by its parent names and a file name */ if (CB_FIELD (v)->flag_indexed_by) { p = CB_FIELD (v)->index_qual; } else { p = CB_FIELD (v)->parent; } /* resolve by parents */ for (; p; p = p->parent) { if (c && strcasecmp (CB_NAME (c), p->name) == 0) { c = CB_REFERENCE (c)->chain; } } /* resolve by file */ if (c && CB_REFERENCE (c)->chain == NULL) { if (CB_REFERENCE (c)->word->count == 1 && CB_FILE_P (cb_ref (c)) && (CB_FILE (cb_ref (c)) == cb_field_founder (CB_FIELD (v))->file)) { c = CB_REFERENCE (c)->chain; } } break; case CB_TAG_LABEL: /* in case the value is a label, it might be qualified by its section name */ s = CB_LABEL (v)->section; /* unqualified paragraph name referenced within the section is resolved without ambiguity check if not duplicated */ if (c == NULL && r->offset && s == CB_LABEL (r->offset)) { for (cb1 = CB_CHAIN (items); cb1; cb1 = CB_CHAIN (cb1)) { cb2 = CB_VALUE (cb1); if (s == CB_LABEL (cb2)->section) { ambiguous_error (x); goto error; } } candidate = v; goto end; } /* resolve by section name */ if (c && s && strcasecmp (CB_NAME (c), (char *)s->name) == 0) { c = CB_REFERENCE (c)->chain; } break; default: /* other values cannot be qualified */ break; } /* a well qualified value is a good candidate */ if (c == NULL) { if (candidate == NULL) { /* keep the first candidate */ candidate = v; } else { /* multiple candidates and possibly ambiguous */ ambiguous = 1; /* continue search because the reference might not be ambiguous and exit loop by "goto end" later */ } } } /* there is no candidate */ if (candidate == NULL) { if (current_program->nested_level > 0) { /* Nested program - check parents for GLOBAL candidate */ ambiguous = 0; val = hash ((const unsigned char *)r->word->name); prog = current_program->next_program; for (; prog; prog = prog->next_program) { if (prog->nested_level >= current_program->nested_level) { continue; } for (w = prog->word_table[val]; w; w = w->next) { if (strcasecmp (r->word->name, w->name) == 0) { candidate = global_check (r, w->items, &ambiguous); if (candidate) { if (ambiguous) { ambiguous_error (x); goto error; } if (CB_FILE_P(candidate)) { current_program->gen_file_error = 1; } goto end; } } } if (prog->nested_level == 0) { break; } } } undefined_error (x); goto error; } /* the reference is ambiguous */ if (ambiguous) { ambiguous_error (x); goto error; } end: if (CB_FIELD_P (candidate)) { CB_FIELD (candidate)->count++; if (CB_FIELD (candidate)->flag_invalid) { goto error; } } r->value = candidate; return r->value; error: r->value = cb_error_node; return cb_error_node; } /* * Expression */ cb_tree cb_build_binary_op (cb_tree x, int op, cb_tree y) { struct cb_binary_op *p; enum cb_category category = CB_CATEGORY_UNKNOWN; switch (op) { case '+': case '-': case '*': case '/': case '^': /* arithmetic operators */ if (CB_TREE_CLASS (x) == CB_CLASS_POINTER || CB_TREE_CLASS (y) == CB_CLASS_POINTER) { category = CB_CATEGORY_DATA_POINTER; break; } x = cb_check_numeric_value (x); y = cb_check_numeric_value (y); if (x == cb_error_node || y == cb_error_node) { return cb_error_node; } category = CB_CATEGORY_NUMERIC; break; case '=': case '~': case '<': case '>': case '[': case ']': /* relational operators */ category = CB_CATEGORY_BOOLEAN; break; case '!': case '&': case '|': /* logical operators */ if (CB_TREE_CLASS (x) != CB_CLASS_BOOLEAN || (y && CB_TREE_CLASS (y) != CB_CLASS_BOOLEAN)) { cb_error (_("Invalid expression")); return cb_error_node; } category = CB_CATEGORY_BOOLEAN; break; case '@': /* parentheses */ category = CB_TREE_CATEGORY (x); break; default: fprintf (stderr, "Unexpected operator -> %d\n", op); ABORT (); } p = make_tree (CB_TAG_BINARY_OP, category, sizeof (struct cb_binary_op)); p->op = op; p->x = x; p->y = y; return CB_TREE (p); } cb_tree cb_build_binary_list (cb_tree l, int op) { cb_tree e; e = CB_VALUE (l); for (l = CB_CHAIN (l); l; l = CB_CHAIN (l)) { e = cb_build_binary_op (e, op, CB_VALUE (l)); } return e; } /* * Function call */ cb_tree cb_build_funcall (const char *name, int argc, cb_tree a1, cb_tree a2, cb_tree a3, cb_tree a4, cb_tree a5, cb_tree a6, cb_tree a7) { struct cb_funcall *p; p = make_tree (CB_TAG_FUNCALL, CB_CATEGORY_BOOLEAN, sizeof (struct cb_funcall)); p->name = name; p->argc = argc; p->varcnt = 0; p->screenptr = gen_screen_ptr; p->argv[0] = a1; p->argv[1] = a2; p->argv[2] = a3; p->argv[3] = a4; p->argv[4] = a5; p->argv[5] = a6; p->argv[6] = a7; return CB_TREE (p); } /* * Type cast */ cb_tree cb_build_cast (enum cb_cast_type type, cb_tree val) { struct cb_cast *p; enum cb_category category; if (type == CB_CAST_INTEGER) { category = CB_CATEGORY_NUMERIC; } else { category = CB_CATEGORY_UNKNOWN; } p = make_tree (CB_TAG_CAST, category, sizeof (struct cb_cast)); p->type = type; p->val = val; return CB_TREE (p); } /* * Label */ cb_tree cb_build_label (cb_tree name, struct cb_label *section) { struct cb_label *p; p = make_tree (CB_TAG_LABEL, CB_CATEGORY_UNKNOWN, sizeof (struct cb_label)); p->id = cb_id++; p->name = (const unsigned char *)cb_define (name, CB_TREE (p)); p->orig_name = p->name; p->section = section; return CB_TREE (p); } /* * Assign */ cb_tree cb_build_assign (cb_tree var, cb_tree val) { struct cb_assign *p; p = make_tree (CB_TAG_ASSIGN, CB_CATEGORY_UNKNOWN, sizeof (struct cb_assign)); p->var = var; p->val = val; return CB_TREE (p); } /* * INITIALIZE */ cb_tree cb_build_initialize (cb_tree var, cb_tree val, cb_tree rep, cb_tree def, int flag) { struct cb_initialize *p; p = make_tree (CB_TAG_INITIALIZE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_initialize)); p->var = var; p->val = val; p->rep = rep; p->def = def; p->flag_statement = flag; return CB_TREE (p); } /* * SEARCH */ cb_tree cb_build_search (int flag_all, cb_tree table, cb_tree var, cb_tree end_stmt, cb_tree whens) { struct cb_search *p; p = make_tree (CB_TAG_SEARCH, CB_CATEGORY_UNKNOWN, sizeof (struct cb_search)); p->flag_all = flag_all; p->table = table; p->var = var; p->end_stmt = end_stmt; p->whens = whens; return CB_TREE (p); } /* * CALL */ cb_tree cb_build_call (cb_tree name, cb_tree args, cb_tree stmt1, cb_tree stmt2, cb_tree returning, int is_system_call) { struct cb_call *p; p = make_tree (CB_TAG_CALL, CB_CATEGORY_UNKNOWN, sizeof (struct cb_call)); p->name = name; p->args = args; p->stmt1 = stmt1; p->stmt2 = stmt2; p->returning = returning; p->is_system = is_system_call; return CB_TREE (p); } /* * GO TO */ cb_tree cb_build_goto (cb_tree target, cb_tree depending) { struct cb_goto *p; p = make_tree (CB_TAG_GOTO, CB_CATEGORY_UNKNOWN, sizeof (struct cb_goto)); p->target = target; p->depending = depending; return CB_TREE (p); } /* * IF */ cb_tree cb_build_if (cb_tree test, cb_tree stmt1, cb_tree stmt2) { struct cb_if *p; p = make_tree (CB_TAG_IF, CB_CATEGORY_UNKNOWN, sizeof (struct cb_if)); p->test = test; p->stmt1 = stmt1; p->stmt2 = stmt2; return CB_TREE (p); } /* * PERFORM */ cb_tree cb_build_perform (int type) { struct cb_perform *p; p = make_tree (CB_TAG_PERFORM, CB_CATEGORY_UNKNOWN, sizeof (struct cb_perform)); p->type = type; return CB_TREE (p); } cb_tree cb_build_perform_varying (cb_tree name, cb_tree from, cb_tree by, cb_tree until) { struct cb_perform_varying *p; p = make_tree (CB_TAG_PERFORM_VARYING, CB_CATEGORY_UNKNOWN, sizeof (struct cb_perform_varying)); p->name = name; p->from = from; p->step = name ? cb_build_add (name, by, cb_high) : NULL; p->until = until; return CB_TREE (p); } /* * Statement */ struct cb_statement * cb_build_statement (const char *name) { struct cb_statement *p; p = make_tree (CB_TAG_STATEMENT, CB_CATEGORY_UNKNOWN, sizeof (struct cb_statement)); p->name = name; return p; } /* * CONTINUE */ cb_tree cb_build_continue (void) { struct cb_continue *p; p = make_tree (CB_TAG_CONTINUE, CB_CATEGORY_UNKNOWN, sizeof (struct cb_continue)); return CB_TREE (p); } /* * FUNCTION */ cb_tree cb_build_any_intrinsic (cb_tree args) { struct cb_intrinsic_table *cbp; cbp = lookup_intrinsic ("LENGTH", 0); return make_intrinsic (NULL, cbp, args, NULL, NULL); } cb_tree cb_build_intrinsic (cb_tree name, cb_tree args, cb_tree refmod) { struct cb_intrinsic_table *cbp; cb_tree x; int numargs; numargs = cb_list_length (args); cbp = lookup_intrinsic (CB_NAME (name), 0); if (cbp) { if ((cbp->args != -1 && numargs != cbp->args) || (cbp->args == -1 && cbp->intr_enum != CB_INTR_RANDOM && numargs < 1)) { cb_error_x (name, _("FUNCTION %s has wrong number of arguments"), cbp->name); return cb_error_node; } if (refmod) { if (!cbp->refmod) { cb_error_x (name, _("FUNCTION %s can not have reference modification"), cbp->name); return cb_error_node; } if (CB_LITERAL_P(CB_PAIR_X(refmod)) && cb_get_int (CB_PAIR_X(refmod))< 1) { cb_error_x (name, _("FUNCTION %s has invalid reference modification"), cbp->name); return cb_error_node; } if (CB_PAIR_Y(refmod) && CB_LITERAL_P(CB_PAIR_Y(refmod)) && cb_get_int (CB_PAIR_Y(refmod))< 1) { cb_error_x (name, _("FUNCTION %s has invalid reference modification"), cbp->name); return cb_error_node; } } /* cb_tree x; */ switch (cbp->intr_enum) { case CB_INTR_LENGTH: case CB_INTR_BYTE_LENGTH: x = CB_VALUE (args); if (CB_INTRINSIC_P (x)) { return make_intrinsic (name, cbp, args, NULL, NULL); } else if ((CB_FIELD_P (x) || CB_REFERENCE_P (x)) && cb_field(x)->flag_any_length) { return make_intrinsic (name, cbp, args, NULL, NULL); } else { return cb_build_length (CB_VALUE (args)); } case CB_INTR_WHEN_COMPILED: if (refmod) { return make_intrinsic (name, cbp, cb_list_init (cb_intr_whencomp), NULL, refmod); } else { return cb_intr_whencomp; } case CB_INTR_PI: return cb_intr_pi; case CB_INTR_E: return cb_intr_e; case CB_INTR_LOWER_CASE: case CB_INTR_UPPER_CASE: case CB_INTR_REVERSE: /* RXW Why did I do this ? - still do not know if (CB_INTRINSIC_P (CB_VALUE (args))) { return make_intrinsic (name, cbp, args, cb_int0); } else { return make_intrinsic (name, cbp, args, cb_build_length (CB_VALUE (args))); } RXW */ case CB_INTR_ABS: case CB_INTR_ACOS: case CB_INTR_ANNUITY: case CB_INTR_ASIN: case CB_INTR_ATAN: case CB_INTR_CHAR: case CB_INTR_COMBINED_DATETIME: case CB_INTR_COS: case CB_INTR_CURRENT_DATE: case CB_INTR_DATE_OF_INTEGER: case CB_INTR_DAY_OF_INTEGER: case CB_INTR_EXCEPTION_FILE: case CB_INTR_EXCEPTION_LOCATION: case CB_INTR_EXCEPTION_STATUS: case CB_INTR_EXCEPTION_STATEMENT: case CB_INTR_EXP: case CB_INTR_EXP10: case CB_INTR_FACTORIAL: case CB_INTR_FRACTION_PART: case CB_INTR_INTEGER: case CB_INTR_INTEGER_OF_DATE: case CB_INTR_INTEGER_OF_DAY: case CB_INTR_INTEGER_PART: case CB_INTR_LOCALE_DATE: case CB_INTR_LOCALE_TIME: case CB_INTR_LOCALE_TIME_FROM_SECS: case CB_INTR_LOG: case CB_INTR_LOG10: case CB_INTR_MOD: case CB_INTR_NUMVAL: case CB_INTR_NUMVAL_C: case CB_INTR_ORD: case CB_INTR_REM: case CB_INTR_SECONDS_FROM_FORMATTED_TIME: case CB_INTR_SECONDS_PAST_MIDNIGHT: case CB_INTR_SIGN: case CB_INTR_SIN: case CB_INTR_SQRT: case CB_INTR_STORED_CHAR_LENGTH: case CB_INTR_TAN: case CB_INTR_TEST_DATE_YYYYMMDD: case CB_INTR_TEST_DAY_YYYYDDD: case CB_INTR_TRIM: return make_intrinsic (name, cbp, args, NULL, refmod); case CB_INTR_CONCATENATE: return make_intrinsic (name, cbp, args, cb_int1, refmod); case CB_INTR_DATE_TO_YYYYMMDD: case CB_INTR_DAY_TO_YYYYDDD: case CB_INTR_MAX: case CB_INTR_MEAN: case CB_INTR_MEDIAN: case CB_INTR_MIDRANGE: case CB_INTR_MIN: case CB_INTR_ORD_MAX: case CB_INTR_ORD_MIN: case CB_INTR_PRESENT_VALUE: case CB_INTR_RANDOM: case CB_INTR_RANGE: case CB_INTR_STANDARD_DEVIATION: case CB_INTR_SUM: case CB_INTR_VARIANCE: case CB_INTR_YEAR_TO_YYYY: return make_intrinsic (name, cbp, args, cb_int1, NULL); case CB_INTR_SUBSTITUTE: case CB_INTR_SUBSTITUTE_CASE: if (numargs < 3 || (numargs % 2) == 0) { cb_error_x (name, _("FUNCTION %s has wrong number of arguments"), cbp->name); return cb_error_node; } return make_intrinsic (name, cbp, args, cb_int1, refmod); default: break; } } cb_error_x (name, _("FUNCTION %s not implemented"), CB_NAME (name)); return cb_error_node; } open-cobol-1.1/cobc/tree.h0000644000000000000000000012333711142344273011067 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef CB_TREE_H #define CB_TREE_H #define YYSTYPE cb_tree #define CB_BEFORE cb_int0 #define CB_AFTER cb_int1 #define COB_MAX_SUBSCRIPTS 16 #define CB_PREFIX_ATTR "a_" /* field attribute (cob_field_attr) */ #define CB_PREFIX_BASE "b_" /* base address (unsigned char *) */ #define CB_PREFIX_CONST "c_" /* constant or literal (cob_field) */ #define CB_PREFIX_DECIMAL "d_" /* decimal number (cob_decimal) */ #define CB_PREFIX_FIELD "f_" /* field (cob_field) */ #define CB_PREFIX_FILE "h_" /* file (cob_file) */ #define CB_PREFIX_KEYS "k_" /* file keys (struct cob_file_key []) */ #define CB_PREFIX_LABEL "l_" /* label */ #define CB_PREFIX_SEQUENCE "s_" /* collating sequence */ #define CB_PROGRAM_TYPE 0 #define CB_FUNCTION_TYPE 1 enum cb_tag { /* primitives */ CB_TAG_CONST, /* 0 constant value */ CB_TAG_INTEGER, /* 1 integer constant */ CB_TAG_STRING, /* 2 string constant */ CB_TAG_ALPHABET_NAME, /* 3 alphabet-name */ CB_TAG_CLASS_NAME, /* 4 class-name */ CB_TAG_LOCALE_NAME, /* 5 locale-name */ CB_TAG_SYSTEM_NAME, /* 6 system-name */ CB_TAG_LITERAL, /* 7 numeric/alphanumeric literal */ CB_TAG_DECIMAL, /* 8 decimal number */ CB_TAG_FIELD, /* 9 user-defined variable */ CB_TAG_FILE, /* 10 file description */ /* expressions */ CB_TAG_REFERENCE, /* 11 reference to a field, file, or label */ CB_TAG_BINARY_OP, /* 12 binary operation */ CB_TAG_FUNCALL, /* 13 run-time function call */ CB_TAG_CAST, /* 14 type cast */ CB_TAG_INTRINSIC, /* 15 intrinsic function */ /* statements */ CB_TAG_LABEL, /* 16 label statement */ CB_TAG_ASSIGN, /* 17 assignment statement */ CB_TAG_INITIALIZE, /* 18 INITIALIZE statement */ CB_TAG_SEARCH, /* 19 SEARCH statement */ CB_TAG_CALL, /* 20 CALL statement */ CB_TAG_GOTO, /* 21 GO TO statement */ CB_TAG_IF, /* 22 IF statement */ CB_TAG_PERFORM, /* 23 PERFORM statement */ CB_TAG_STATEMENT, /* 24 general statement */ CB_TAG_CONTINUE, /* 25 CONTINUE statement */ /* miscellaneous */ CB_TAG_PERFORM_VARYING, /* 26 PERFORM VARYING parameter */ CB_TAG_PICTURE, /* 27 PICTURE clause */ CB_TAG_LIST /* 28 list */ }; enum cb_alphabet_name_type { CB_ALPHABET_NATIVE, CB_ALPHABET_STANDARD_1, CB_ALPHABET_STANDARD_2, CB_ALPHABET_EBCDIC, CB_ALPHABET_CUSTOM }; enum cb_system_name_category { CB_CALL_CONVENTION_NAME, CB_CODE_NAME, CB_COMPUTER_NAME, CB_DEVICE_NAME, CB_ENTRY_CONVENTION_NAME, CB_EXTERNAL_LOCALE_NAME, CB_FEATURE_NAME, CB_LIBRARY_NAME, CB_SWITCH_NAME, CB_TEXT_NAME }; enum cb_device_name { CB_DEVICE_SYSIN, CB_DEVICE_SYSOUT, CB_DEVICE_SYSERR, CB_DEVICE_CONSOLE }; enum cb_feature_name { CB_FEATURE_FORMFEED, CB_FEATURE_C01, CB_FEATURE_C02, CB_FEATURE_C03, CB_FEATURE_C04, CB_FEATURE_C05, CB_FEATURE_C06, CB_FEATURE_C07, CB_FEATURE_C08, CB_FEATURE_C09, CB_FEATURE_C10, CB_FEATURE_C11, CB_FEATURE_C12 }; enum cb_switch_name { CB_SWITCH_1, CB_SWITCH_2, CB_SWITCH_3, CB_SWITCH_4, CB_SWITCH_5, CB_SWITCH_6, CB_SWITCH_7, CB_SWITCH_8 }; enum cb_class { CB_CLASS_UNKNOWN, /* 0 */ CB_CLASS_ALPHABETIC, /* 1 */ CB_CLASS_ALPHANUMERIC, /* 2 */ CB_CLASS_BOOLEAN, /* 3 */ CB_CLASS_INDEX, /* 4 */ CB_CLASS_NATIONAL, /* 5 */ CB_CLASS_NUMERIC, /* 6 */ CB_CLASS_OBJECT, /* 7 */ CB_CLASS_POINTER /* 8 */ }; enum cb_category { CB_CATEGORY_UNKNOWN, /* 0 */ CB_CATEGORY_ALPHABETIC, /* 1 */ CB_CATEGORY_ALPHANUMERIC, /* 2 */ CB_CATEGORY_ALPHANUMERIC_EDITED, /* 3 */ CB_CATEGORY_BOOLEAN, /* 4 */ CB_CATEGORY_INDEX, /* 5 */ CB_CATEGORY_NATIONAL, /* 6 */ CB_CATEGORY_NATIONAL_EDITED, /* 7 */ CB_CATEGORY_NUMERIC, /* 8 */ CB_CATEGORY_NUMERIC_EDITED, /* 9 */ CB_CATEGORY_OBJECT_REFERENCE, /* 10 */ CB_CATEGORY_DATA_POINTER, /* 11 */ CB_CATEGORY_PROGRAM_POINTER /* 12 */ }; enum cb_storage { CB_STORAGE_CONSTANT, /* Constants */ CB_STORAGE_FILE, /* FILE SECTION */ CB_STORAGE_WORKING, /* WORKING-STORAGE SECTION */ CB_STORAGE_LOCAL, /* LOCAL-STORAGE SECTION */ CB_STORAGE_LINKAGE, /* LINKAGE SECTION */ CB_STORAGE_SCREEN, /* SCREEN SECTION */ CB_STORAGE_REPORT, /* REPORT SECTION */ CB_STORAGE_COMMUNICATION /* COMMUNICATION SECTION */ }; enum cb_usage { CB_USAGE_BINARY, /* 0 */ CB_USAGE_BIT, /* 1 */ CB_USAGE_COMP_5, /* 2 */ CB_USAGE_COMP_X, /* 3 */ CB_USAGE_DISPLAY, /* 4 */ CB_USAGE_FLOAT, /* 5 */ CB_USAGE_DOUBLE, /* 6 */ CB_USAGE_INDEX, /* 7 */ CB_USAGE_NATIONAL, /* 8 */ CB_USAGE_OBJECT, /* 9 */ CB_USAGE_PACKED, /* 10 */ CB_USAGE_POINTER, /* 11 */ CB_USAGE_PROGRAM, /* 12 */ CB_USAGE_LENGTH, /* 13 */ CB_USAGE_PROGRAM_POINTER, /* 14 */ CB_USAGE_UNSIGNED_CHAR, /* 15 */ CB_USAGE_SIGNED_CHAR, /* 16 */ CB_USAGE_UNSIGNED_SHORT, /* 17 */ CB_USAGE_SIGNED_SHORT, /* 18 */ CB_USAGE_UNSIGNED_INT, /* 19 */ CB_USAGE_SIGNED_INT, /* 20 */ CB_USAGE_UNSIGNED_LONG, /* 21 */ CB_USAGE_SIGNED_LONG /* 22 */ }; enum cb_operand_type { CB_SENDING_OPERAND, CB_RECEIVING_OPERAND }; /* * Tree */ struct cb_tree_common { enum cb_tag tag; enum cb_category category; unsigned char *source_file; int source_line; }; typedef struct cb_tree_common *cb_tree; #define CB_TREE(x) ((struct cb_tree_common *) (x)) #define CB_TREE_TAG(x) (CB_TREE (x)->tag) #define CB_TREE_CLASS(x) cb_tree_class (CB_TREE (x)) #define CB_TREE_CATEGORY(x) cb_tree_category (CB_TREE (x)) #ifdef __GNUC__ #define CB_TREE_CAST(tg,ty,x) \ ({ \ cb_tree _x = (x); \ if (!_x || CB_TREE_TAG (_x) != tg) \ { \ cobc_tree_cast_error (_x, __FILE__, __LINE__, tg); \ } \ ((ty *) (_x)); \ }) #else #define CB_TREE_CAST(tg,ty,x) ((ty *) (x)) #endif extern char *cb_name (cb_tree x); extern enum cb_class cb_tree_class (cb_tree x); extern enum cb_category cb_tree_category (cb_tree x); extern int cb_tree_type (cb_tree x); extern int cb_fits_int (cb_tree x); extern int cb_fits_long_long (cb_tree x); extern int cb_get_int (cb_tree x); extern long long cb_get_long_long (cb_tree x); /* * Constants */ extern cb_tree cb_any; extern cb_tree cb_true; extern cb_tree cb_false; extern cb_tree cb_null; extern cb_tree cb_zero; extern cb_tree cb_one; extern cb_tree cb_space; extern cb_tree cb_low; extern cb_tree cb_high; extern cb_tree cb_norm_low; extern cb_tree cb_norm_high; extern cb_tree cb_quote; extern cb_tree cb_int0; extern cb_tree cb_int1; extern cb_tree cb_int2; extern cb_tree cb_int3; extern cb_tree cb_int4; extern cb_tree cb_int5; extern cb_tree cb_i[8]; extern cb_tree cb_error_node; extern cb_tree cb_intr_whencomp; extern cb_tree cb_intr_pi; extern cb_tree cb_intr_e; extern cb_tree cb_standard_error_handler; extern size_t gen_screen_ptr; struct cb_const { struct cb_tree_common common; const char *val; }; #define CB_CONST(x) (CB_TREE_CAST (CB_TAG_CONST, struct cb_const, x)) #define CB_CONST_P(x) (CB_TREE_TAG (x) == CB_TAG_CONST) extern void cb_init_constants (void); /* * Integer */ struct cb_integer { struct cb_tree_common common; int val; }; #define CB_INTEGER(x) (CB_TREE_CAST (CB_TAG_INTEGER, struct cb_integer, x)) #define CB_INTEGER_P(x) (CB_TREE_TAG (x) == CB_TAG_INTEGER) extern cb_tree cb_int (int n); /* * String */ struct cb_string { struct cb_tree_common common; size_t size; const unsigned char *data; }; #define CB_STRING(x) (CB_TREE_CAST (CB_TAG_STRING, struct cb_string, x)) #define CB_STRING_P(x) (CB_TREE_TAG (x) == CB_TAG_STRING) #define cb_build_string0(str) cb_build_string (str, strlen ((char *)str)) extern cb_tree cb_build_string (const unsigned char *data, size_t size); /* * Alphabet-name */ struct cb_alphabet_name { struct cb_tree_common common; const char *name; char *cname; cb_tree custom_list; enum cb_alphabet_name_type type; int low_val_char; int high_val_char; }; #define CB_ALPHABET_NAME(x) (CB_TREE_CAST (CB_TAG_ALPHABET_NAME, struct cb_alphabet_name, x)) #define CB_ALPHABET_NAME_P(x) (CB_TREE_TAG (x) == CB_TAG_ALPHABET_NAME) extern cb_tree cb_build_alphabet_name (cb_tree name, enum cb_alphabet_name_type type); /* * Class-name */ struct cb_class_name { struct cb_tree_common common; const char *name; char *cname; cb_tree list; }; #define CB_CLASS_NAME(x) (CB_TREE_CAST (CB_TAG_CLASS_NAME, struct cb_class_name, x)) #define CB_CLASS_NAME_P(x) (CB_TREE_TAG (x) == CB_TAG_CLASS_NAME) extern cb_tree cb_build_class_name (cb_tree name, cb_tree list); /* * Locale name */ struct cb_locale_name { struct cb_tree_common common; const char *name; char *cname; cb_tree list; }; #define CB_LOCALE_NAME(x) (CB_TREE_CAST (CB_TAG_LOCALE_NAME, struct cb_locale_name, x)) #define CB_LOCALE_NAME_P(x) (CB_TREE_TAG (x) == CB_TAG_LOCALE_NAME) extern cb_tree cb_build_locale_name (cb_tree name, cb_tree list); /* * System-name */ struct cb_system_name { struct cb_tree_common common; enum cb_system_name_category category; int token; }; #define CB_SYSTEM_NAME(x) (CB_TREE_CAST (CB_TAG_SYSTEM_NAME, struct cb_system_name, x)) #define CB_SYSTEM_NAME_P(x) (CB_TREE_TAG (x) == CB_TAG_SYSTEM_NAME) extern cb_tree cb_build_system_name (enum cb_system_name_category category, int token); /* * Literal */ struct cb_literal { struct cb_tree_common common; size_t size; unsigned char *data; signed char all; signed char sign; /* unsigned: 0 negative: -1 positive: 1 */ signed char scale; signed char spare; /* spare */ }; #define CB_LITERAL(x) (CB_TREE_CAST (CB_TAG_LITERAL, struct cb_literal, x)) #define CB_LITERAL_P(x) (CB_TREE_TAG (x) == CB_TAG_LITERAL) #define CB_NUMERIC_LITERAL_P(x) \ (CB_LITERAL_P (x) && CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC) extern cb_tree cb_build_numeric_literal (int sign, const unsigned char *data, int scale); extern cb_tree cb_build_alphanumeric_literal (const unsigned char *data, size_t size); extern cb_tree cb_concat_literals (cb_tree x1, cb_tree x2); /* * Decimal */ struct cb_decimal { struct cb_tree_common common; int id; }; #define CB_DECIMAL(x) (CB_TREE_CAST (CB_TAG_DECIMAL, struct cb_decimal, x)) #define CB_DECIMAL_P(x) (CB_TREE_TAG (x) == CB_TAG_DECIMAL) extern cb_tree cb_build_decimal (int id); /* * Picture */ struct cb_picture { struct cb_tree_common common; int size; /* byte size */ int lenstr; /* length of picture string */ char *orig; /* original picture string */ char *str; /* packed picture string */ enum cb_category category; /* field category */ unsigned char digits; /* the number of digit places */ signed char scale; /* 1/10^scale */ unsigned char have_sign; /* have 'S' */ unsigned char spare; /* spare */ }; #define CB_PICTURE(x) (CB_TREE_CAST (CB_TAG_PICTURE, struct cb_picture, x)) #define CB_PICTURE_P(x) (CB_TREE_TAG (x) == CB_TAG_PICTURE) extern cb_tree cb_build_picture (const char *str); /* * Field */ struct cb_field { struct cb_tree_common common; int id; /* field id */ int storage_id; /* storage id */ const char *name; /* the original name */ const char *ename; /* the externalized name */ int size; /* field size */ int memory_size; /* memory size */ int offset; /* byte offset from top (01 field) */ int level; /* level number */ int occurs_min; /* OCCURS */ int occurs_max; /* or OCCURS TO */ int indexes; /* number of parents who have OCCURS */ int count; /* reference count */ cb_tree occurs_depending; /* OCCURS ... DEPENDING ON */ enum cb_storage storage; enum cb_usage usage; /* USAGE */ cb_tree values; /* VALUE */ cb_tree false_88; /* 88 FALSE clause */ cb_tree index_list; /* INDEXED BY */ struct cb_field *parent; /* upper level field (NULL for 01 fields) */ struct cb_field *children; /* top of lower level fields */ struct cb_field *sister; /* fields in the same level */ struct cb_field *redefines; /* REDEFINES */ struct cb_field *rename_thru; /* RENAMES THRU */ struct cb_field *index_qual; /* INDEXED BY qualifier */ struct cb_file *file; /* file name associated in FD section */ struct cb_key { int dir; /* ASCENDING or DESCENDING */ cb_tree key; /* KEY */ cb_tree ref; /* reference used in SEARCH ALL */ cb_tree val; /* value to be compared in SEARCH ALL */ } *keys; int nkeys; /* the number of keys */ int param_num; /* CHAINING param number */ struct cb_picture *pic; /* PICTURE */ /* screen parameters */ cb_tree screen_line; cb_tree screen_column; cb_tree screen_from; cb_tree screen_to; cb_tree screen_foreg; cb_tree screen_backg; int screen_flag; /* flags used in SCREEN SECTION */ /* flags */ unsigned int flag_external : 1; /* EXTERNAL */ unsigned int flag_blank_zero : 1; /* BLANK WHEN ZERO */ unsigned int flag_justified : 1; /* JUSTIFIED RIGHT */ unsigned int flag_sign_leading : 1; /* SIGN IS LEADING */ unsigned int flag_sign_separate : 1; /* SIGN IS SEPARATE */ unsigned int flag_synchronized : 1; /* SYNCHRONIZED */ unsigned int flag_occurs : 1; /* OCCURS */ unsigned int flag_invalid : 1; /* is broken */ unsigned int flag_binary_swap : 1; /* binary byteswap */ unsigned int flag_local : 1; /* has local scope */ unsigned int flag_base : 1; /* has memory allocation */ unsigned int flag_field : 1; /* has been internally cached */ unsigned int flag_item_external : 1; /* is EXTERNAL */ unsigned int flag_chained : 1; /* CHAINING item */ unsigned int flag_real_binary : 1; /* is BINARY-CHAR/SHORT/LONG/DOUBLE */ unsigned int flag_item_based : 1; /* is BASED */ unsigned int flag_item_78 : 1; /* is 78 level */ unsigned int flag_any_length : 1; /* is ANY LENGTH */ unsigned int flag_anylen_done : 1; /* ANY LENGTH is set up */ unsigned int flag_indexed_by : 1; /* INDEXED BY item */ unsigned int flag_is_pointer : 1; /* is POINTER */ unsigned int flag_is_verified : 1; /* has been verified */ unsigned int flag_is_global : 1; /* is GLOBAL */ unsigned int flag_is_c_long : 1; /* is BINARY-C-LONG */ unsigned int flag_is_pdiv_parm : 1; /* is PROC DIV USING */ unsigned int flag_local_alloced : 1; /* LOCAL storage is allocated */ unsigned int flag_no_init : 1; /* no initialize unless used */ unsigned int flag_spare : 5; }; #define CB_FIELD(x) (CB_TREE_CAST (CB_TAG_FIELD, struct cb_field, x)) #define CB_FIELD_P(x) (CB_TREE_TAG (x) == CB_TAG_FIELD) extern cb_tree cb_build_field (cb_tree name); extern cb_tree cb_build_implicit_field (cb_tree name, int len); extern cb_tree cb_build_constant (cb_tree name, cb_tree value); extern struct cb_field *cb_field (cb_tree x); extern struct cb_field *cb_field_add (struct cb_field *f, struct cb_field *p); extern int cb_field_size (cb_tree x); extern struct cb_field *cb_field_founder (struct cb_field *f); extern struct cb_field *cb_field_variable_size (struct cb_field *f); extern struct cb_field *cb_field_variable_address (struct cb_field *f); extern int cb_field_subordinate (struct cb_field *p, struct cb_field *f); #define CB_REF_OR_FIELD_P(x) ((CB_FIELD_P (x) || CB_REFERENCE_P (x))) /* Index */ #define CB_INDEX_P(x) ((CB_FIELD_P (x) || CB_REFERENCE_P (x)) \ && cb_field (x)->usage == CB_USAGE_INDEX) /* * Label */ struct cb_label { struct cb_tree_common common; const unsigned char *name; struct cb_label *section; cb_tree exit_label; cb_tree exit_label_ref; cb_tree children; const unsigned char *orig_name; int id; int is_section; int is_entry; unsigned char need_begin; unsigned char need_return; unsigned char is_global; unsigned char spare; }; #define CB_LABEL(x) (CB_TREE_CAST (CB_TAG_LABEL, struct cb_label, x)) #define CB_LABEL_P(x) (CB_TREE_TAG (x) == CB_TAG_LABEL) extern cb_tree cb_build_label (cb_tree name, struct cb_label *section); struct handler_struct { struct cb_label *handler_label; struct cb_program *handler_prog; }; /* * File */ struct cb_alt_key { struct cb_alt_key *next; cb_tree key; int duplicates; int offset; }; struct cb_file { struct cb_tree_common common; const char *name; /* The original name */ char *cname; /* The name used in C */ /* SELECT */ cb_tree assign; /* ASSIGN */ cb_tree file_status; /* FILE STATUS */ cb_tree sharing; /* SHARING */ cb_tree key; /* RELATIVE/RECORD KEY */ struct cb_alt_key *alt_key_list; /* ALTERNATE RECORD KEY */ /* FD/SD */ struct cb_field *record; /* Record descriptor */ cb_tree record_depending; /* RECORD DEPENDING */ cb_tree linage; /* LINAGE */ cb_tree linage_ctr; /* LINAGE COUNTER */ cb_tree latfoot; /* LINAGE FOOTING */ cb_tree lattop; /* LINAGE TOP */ cb_tree latbot; /* LINAGE BOTTOM */ struct cb_label *handler; /* Error handler */ struct cb_program *handler_prog; /* Prog where defined */ int record_min; /* RECORD CONTAINS */ int record_max; /* RECORD CONTAINS */ int optional; /* OPTIONAL */ int organization; /* ORGANIZATION */ int access_mode; /* ACCESS MODE */ int lock_mode; /* LOCK MODE */ int same_clause; /* SAME clause */ int finalized; /* Is finalized */ int external; /* Is EXTERNAL */ int special; /* Special file */ int external_assign; /* ASSIGN EXTERNAL */ int fileid_assign; /* ASSIGN DISK */ int global; /* Is GLOBAL */ }; #define CB_FILE(x) (CB_TREE_CAST (CB_TAG_FILE, struct cb_file, x)) #define CB_FILE_P(x) (CB_TREE_TAG (x) == CB_TAG_FILE) extern struct cb_file *build_file (cb_tree name); extern void validate_file (struct cb_file *f, cb_tree name); extern void finalize_file (struct cb_file *f, struct cb_field *records); /* * Reference */ #define CB_WORD_HASH_SIZE 133 struct cb_word { struct cb_word *next; /* next word with the same hash value */ const char *name; /* word name */ cb_tree items; /* objects associated with this word */ int count; /* number of words with the same name */ int error; /* set to 1 if error displayed */ }; struct cb_reference { struct cb_tree_common common; struct cb_word *word; enum cb_operand_type type; cb_tree value; /* item referred by this reference */ cb_tree subs; /* the list of subscripts */ cb_tree offset; /* 1st operand of reference modification */ cb_tree length; /* 2nd operand of reference modification */ cb_tree check; cb_tree chain; /* next qualified name */ int all; }; #define CB_REFERENCE(x) (CB_TREE_CAST (CB_TAG_REFERENCE, struct cb_reference, x)) #define CB_REFERENCE_P(x) (CB_TREE_TAG (x) == CB_TAG_REFERENCE) #define CB_NAME(x) (CB_REFERENCE (x)->word->name) extern cb_tree cb_build_filler (void); extern cb_tree cb_build_reference (const char *name); extern cb_tree cb_build_field_reference (struct cb_field *f, cb_tree ref); extern const char *cb_define (cb_tree name, cb_tree val); extern void cb_define_system_name (const char *name); extern cb_tree cb_ref (cb_tree x); /* * Binary operation */ /* '+' x + y '-' x - y '*' x * y '/' x / y '^' x ** y '=' x = y '>' x > y '<' x < y '[' x <= y ']' x >= y '~' x != y '!' not x '&' x and y '|' x or y '@' ( x ) */ struct cb_binary_op { struct cb_tree_common common; int op; cb_tree x; cb_tree y; }; #define CB_BINARY_OP(x) (CB_TREE_CAST (CB_TAG_BINARY_OP, struct cb_binary_op, x)) #define CB_BINARY_OP_P(x) (CB_TREE_TAG (x) == CB_TAG_BINARY_OP) #define cb_build_parenthesis(x) cb_build_binary_op (x, '@', NULL) #define cb_build_negation(x) cb_build_binary_op (x, '!', NULL) extern cb_tree cb_build_binary_op (cb_tree x, int op, cb_tree y); extern cb_tree cb_build_binary_list (cb_tree l, int op); /* * Function call */ struct cb_funcall { struct cb_tree_common common; const char *name; cb_tree argv[7]; int argc; int varcnt; size_t screenptr; }; #define CB_FUNCALL(x) (CB_TREE_CAST (CB_TAG_FUNCALL, struct cb_funcall, x)) #define CB_FUNCALL_P(x) (CB_TREE_TAG (x) == CB_TAG_FUNCALL) extern cb_tree cb_build_funcall (const char *name, int argc, cb_tree a1, cb_tree a2, cb_tree a3, cb_tree a4, cb_tree a5, cb_tree a6, cb_tree a7); #define cb_build_funcall_0(f) \ cb_build_funcall(f, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL) #define cb_build_funcall_1(f,a1) \ cb_build_funcall(f, 1, a1, NULL, NULL, NULL, NULL, NULL, NULL) #define cb_build_funcall_2(f,a1,a2) \ cb_build_funcall(f, 2, a1, a2, NULL, NULL, NULL, NULL, NULL) #define cb_build_funcall_3(f,a1,a2,a3) \ cb_build_funcall(f, 3, a1, a2, a3, NULL, NULL, NULL, NULL) #define cb_build_funcall_4(f,a1,a2,a3,a4) \ cb_build_funcall(f, 4, a1, a2, a3, a4, NULL, NULL, NULL) #define cb_build_funcall_5(f,a1,a2,a3,a4,a5) \ cb_build_funcall(f, 5, a1, a2, a3, a4, a5, NULL, NULL) #define cb_build_funcall_6(f,a1,a2,a3,a4,a5,a6) \ cb_build_funcall(f, 6, a1, a2, a3, a4, a5, a6, NULL) #define cb_build_funcall_7(f,a1,a2,a3,a4,a5,a6,a7) \ cb_build_funcall(f, 7, a1, a2, a3, a4, a5, a6, a7) /* * Type cast */ enum cb_cast_type { CB_CAST_INTEGER, CB_CAST_ADDRESS, CB_CAST_ADDR_OF_ADDR, CB_CAST_LENGTH, CB_CAST_PROGRAM_POINTER }; struct cb_cast { struct cb_tree_common common; enum cb_cast_type type; cb_tree val; }; #define CB_CAST(x) (CB_TREE_CAST (CB_TAG_CAST, struct cb_cast, x)) #define CB_CAST_P(x) (CB_TREE_TAG (x) == CB_TAG_CAST) extern cb_tree cb_build_cast (enum cb_cast_type type, cb_tree val); #define cb_build_cast_integer(x) cb_build_cast (CB_CAST_INTEGER, x) #define cb_build_cast_address(x) cb_build_cast (CB_CAST_ADDRESS, x) #define cb_build_cast_addr_of_addr(x) cb_build_cast (CB_CAST_ADDR_OF_ADDR, x) #define cb_build_cast_length(x) cb_build_cast (CB_CAST_LENGTH, x) #define cb_build_cast_ppointer(x) cb_build_cast (CB_CAST_PROGRAM_POINTER, x) /* * Assign */ struct cb_assign { struct cb_tree_common common; cb_tree var; cb_tree val; }; #define CB_ASSIGN(x) (CB_TREE_CAST (CB_TAG_ASSIGN, struct cb_assign, x)) #define CB_ASSIGN_P(x) (CB_TREE_TAG (x) == CB_TAG_ASSIGN) extern cb_tree cb_build_assign (cb_tree var, cb_tree val); /* * Intrinsic FUNCTION */ enum cb_intr_enum { CB_INTR_ABS = 1, CB_INTR_ACOS, CB_INTR_ANNUITY, CB_INTR_ASIN, CB_INTR_ATAN, CB_INTR_BOOLEAN_OF_INTEGER, CB_INTR_BYTE_LENGTH, CB_INTR_CHAR, CB_INTR_CHAR_NATIONAL, CB_INTR_COMBINED_DATETIME, CB_INTR_CONCATENATE, CB_INTR_COS, CB_INTR_CURRENT_DATE, CB_INTR_DATE_OF_INTEGER, CB_INTR_DATE_TO_YYYYMMDD, CB_INTR_DAY_OF_INTEGER, CB_INTR_DAY_TO_YYYYDDD, CB_INTR_DISPLAY_OF, CB_INTR_E, CB_INTR_EXCEPTION_FILE, CB_INTR_EXCEPTION_FILE_N, CB_INTR_EXCEPTION_LOCATION, CB_INTR_EXCEPTION_LOCATION_N, CB_INTR_EXCEPTION_STATEMENT, CB_INTR_EXCEPTION_STATUS, CB_INTR_EXP, CB_INTR_EXP10, CB_INTR_FACTORIAL, CB_INTR_FRACTION_PART, CB_INTR_HIGHEST_ALGEBRAIC, CB_INTR_INTEGER, CB_INTR_INTEGER_OF_BOOLEAN, CB_INTR_INTEGER_OF_DATE, CB_INTR_INTEGER_OF_DAY, CB_INTR_INTEGER_PART, CB_INTR_LENGTH, CB_INTR_LOCALE_COMPARE, CB_INTR_LOCALE_DATE, CB_INTR_LOCALE_TIME, CB_INTR_LOCALE_TIME_FROM_SECS, CB_INTR_LOG, CB_INTR_LOG10, CB_INTR_LOWER_CASE, CB_INTR_LOWEST_ALGEBRAIC, CB_INTR_MAX, CB_INTR_MEAN, CB_INTR_MEDIAN, CB_INTR_MIDRANGE, CB_INTR_MIN, CB_INTR_MOD, CB_INTR_NATIONAL_OF, CB_INTR_NUMVAL, CB_INTR_NUMVAL_C, CB_INTR_NUMVAL_F, CB_INTR_ORD, CB_INTR_ORD_MAX, CB_INTR_ORD_MIN, CB_INTR_PI, CB_INTR_PRESENT_VALUE, CB_INTR_RANDOM, CB_INTR_RANGE, CB_INTR_REM, CB_INTR_REVERSE, CB_INTR_SECONDS_FROM_FORMATTED_TIME, CB_INTR_SECONDS_PAST_MIDNIGHT, CB_INTR_SIGN, CB_INTR_SIN, CB_INTR_SQRT, CB_INTR_STANDARD_COMPARE, CB_INTR_STANDARD_DEVIATION, CB_INTR_STORED_CHAR_LENGTH, CB_INTR_SUBSTITUTE, CB_INTR_SUBSTITUTE_CASE, CB_INTR_SUM, CB_INTR_TAN, CB_INTR_TEST_DATE_YYYYMMDD, CB_INTR_TEST_DAY_YYYYDDD, CB_INTR_TEST_NUMVAL, CB_INTR_TEST_NUMVAL_C, CB_INTR_TEST_NUMVAL_F, CB_INTR_TRIM, CB_INTR_UPPER_CASE, CB_INTR_VARIANCE, CB_INTR_WHEN_COMPILED, CB_INTR_YEAR_TO_YYYY }; struct cb_intrinsic_table { const char *name; /* FUNCTION NAME */ const int args; /* 0-n, negative = variable */ const int implemented; /* Have we implemented it? */ const enum cb_intr_enum intr_enum; /* Enum intrinsic */ const char *intr_routine; /* Routine name */ const enum cb_category category; /* Category */ const unsigned int refmod; /* Can be refmodded */ }; struct cb_intrinsic { struct cb_tree_common common; cb_tree name; cb_tree args; cb_tree intr_field; /* Field to use */ struct cb_intrinsic_table *intr_tab; cb_tree offset; cb_tree length; }; #define CB_INTRINSIC(x) (CB_TREE_CAST (CB_TAG_INTRINSIC, struct cb_intrinsic, x)) #define CB_INTRINSIC_P(x) (CB_TREE_TAG (x) == CB_TAG_INTRINSIC) extern struct cb_intrinsic_table *lookup_intrinsic (const char *name, const int checkres); extern cb_tree cb_build_intrinsic (cb_tree name, cb_tree args, cb_tree refmod); extern cb_tree cb_build_any_intrinsic (cb_tree args); /* * INITIALIZE */ struct cb_initialize { struct cb_tree_common common; cb_tree var; cb_tree val; cb_tree rep; cb_tree def; int flag_statement; }; #define CB_INITIALIZE(x) (CB_TREE_CAST (CB_TAG_INITIALIZE, struct cb_initialize, x)) #define CB_INITIALIZE_P(x) (CB_TREE_TAG (x) == CB_TAG_INITIALIZE) extern cb_tree cb_build_initialize (cb_tree var, cb_tree val, cb_tree rep, cb_tree def, int flag); /* * SEARCH */ struct cb_search { struct cb_tree_common common; int flag_all; cb_tree table; cb_tree var; cb_tree end_stmt; cb_tree whens; }; #define CB_SEARCH(x) (CB_TREE_CAST (CB_TAG_SEARCH, struct cb_search, x)) #define CB_SEARCH_P(x) (CB_TREE_TAG (x) == CB_TAG_SEARCH) extern cb_tree cb_build_search (int flag_all, cb_tree table, cb_tree var, cb_tree end_stmt, cb_tree whens); /* * CALL */ #define CB_CALL_BY_REFERENCE 1 #define CB_CALL_BY_CONTENT 2 #define CB_CALL_BY_VALUE 3 struct cb_call { struct cb_tree_common common; cb_tree name; cb_tree args; cb_tree stmt1; cb_tree stmt2; cb_tree returning; int is_system; }; #define CB_CALL(x) (CB_TREE_CAST (CB_TAG_CALL, struct cb_call, x)) #define CB_CALL_P(x) (CB_TREE_TAG (x) == CB_TAG_CALL) extern cb_tree cb_build_call (cb_tree name, cb_tree args, cb_tree stmt1, cb_tree stmt2, cb_tree returning, int is_system_call); /* * GO TO statement */ struct cb_goto { struct cb_tree_common common; cb_tree target; cb_tree depending; }; #define CB_GOTO(x) (CB_TREE_CAST (CB_TAG_GOTO, struct cb_goto, x)) #define CB_GOTO_P(x) (CB_TREE_TAG (x) == CB_TAG_GOTO) extern cb_tree cb_build_goto (cb_tree target, cb_tree depending); /* * IF */ struct cb_if { struct cb_tree_common common; cb_tree test; cb_tree stmt1; cb_tree stmt2; }; #define CB_IF(x) (CB_TREE_CAST (CB_TAG_IF, struct cb_if, x)) #define CB_IF_P(x) (CB_TREE_TAG (x) == CB_TAG_IF) extern cb_tree cb_build_if (cb_tree test, cb_tree stmt1, cb_tree stmt2); /* * PERFORM */ enum cb_perform_type { CB_PERFORM_EXIT, CB_PERFORM_ONCE, CB_PERFORM_TIMES, CB_PERFORM_UNTIL, CB_PERFORM_FOREVER }; struct cb_perform_varying { struct cb_tree_common common; cb_tree name; cb_tree from; cb_tree step; cb_tree until; }; struct cb_perform { struct cb_tree_common common; enum cb_perform_type type; cb_tree test; cb_tree body; cb_tree data; cb_tree varying; cb_tree exit_label; cb_tree cycle_label; }; #define CB_PERFORM_VARYING(x) (CB_TREE_CAST (CB_TAG_PERFORM_VARYING, struct cb_perform_varying, x)) #define CB_PERFORM(x) (CB_TREE_CAST (CB_TAG_PERFORM, struct cb_perform, x)) #define CB_PERFORM_P(x) (CB_TREE_TAG (x) == CB_TAG_PERFORM) extern cb_tree cb_build_perform (int type); extern cb_tree cb_build_perform_varying (cb_tree name, cb_tree from, cb_tree step, cb_tree until); /* * Statement */ struct cb_statement { struct cb_tree_common common; const char *name; cb_tree body; cb_tree file; cb_tree handler1; cb_tree handler2; cb_tree handler3; cb_tree null_check; int handler_id; int need_terminator; }; #define CB_STATEMENT(x) (CB_TREE_CAST (CB_TAG_STATEMENT, struct cb_statement, x)) #define CB_STATEMENT_P(x) (CB_TREE_TAG (x) == CB_TAG_STATEMENT) extern struct cb_statement *cb_build_statement (const char *name); /* * CONTINUE */ struct cb_continue { struct cb_tree_common common; }; #define CB_CONTINUE(x) (CB_TREE_CAST (CB_TAG_CONTINUE, struct cb_continue, x)) #define CB_CONTINUE_P(x) (CB_TREE_TAG (x) == CB_TAG_CONTINUE) extern cb_tree cb_build_continue (void); /* * List */ struct cb_list { struct cb_tree_common common; cb_tree purpose; cb_tree value; cb_tree chain; int sizes; }; #define CB_LIST(x) (CB_TREE_CAST (CB_TAG_LIST, struct cb_list, x)) #define CB_LIST_P(x) (CB_TREE_TAG (x) == CB_TAG_LIST) #define CB_PURPOSE(x) (CB_LIST (x)->purpose) #define CB_VALUE(x) (CB_LIST (x)->value) #define CB_CHAIN(x) (CB_LIST (x)->chain) #define CB_SIZES(x) (CB_LIST (x)->sizes) #define CB_PURPOSE_INT(x) (CB_INTEGER (CB_PURPOSE (x))->val) #define CB_SIZE_AUTO 0 #define CB_SIZE_1 1 #define CB_SIZE_2 2 #define CB_SIZE_4 3 #define CB_SIZE_8 4 #define CB_SIZE_UNSIGNED 8 #define CB_SIZES_INT(x) ((CB_LIST (x)->sizes) & 0x07) #define CB_SIZES_INT_UNSIGNED(x) ((CB_LIST (x)->sizes) & CB_SIZE_UNSIGNED) extern cb_tree cb_build_list (cb_tree purpose, cb_tree value, cb_tree rest); extern cb_tree cb_list_add (cb_tree l, cb_tree x); extern cb_tree cb_list_append (cb_tree l1, cb_tree l2); extern cb_tree cb_list_reverse (cb_tree l); extern int cb_list_length (cb_tree l); #define cb_list_init(x) cb_build_list (NULL, x, NULL) #define cb_cons(x,l) cb_build_list (NULL, x, l) /* Pair */ #define CB_PAIR_P(x) (CB_LIST_P (x) && CB_PAIR_X (x)) #define CB_PAIR_X(x) CB_PURPOSE (x) #define CB_PAIR_Y(x) CB_VALUE (x) #define cb_build_pair(x,y) cb_build_list (x, y, NULL) /* * Program */ struct cb_program { /* program variables */ struct cb_program *next_program; /* Nested */ const char *program_id; char *source_name; char *orig_source_name; FILE *local_storage_file; char *local_storage_name; cb_tree entry_list; cb_tree file_list; cb_tree exec_list; cb_tree label_list; cb_tree reference_list; cb_tree alphabet_name_list; cb_tree class_name_list; cb_tree parameter_list; cb_tree locale_list; cb_tree symbolic_list; cb_tree global_list; cb_tree cb_return_code; cb_tree cb_sort_return; cb_tree cb_call_params; cb_tree class_spec_list; cb_tree interface_spec_list; cb_tree function_spec_list; cb_tree program_spec_list; cb_tree property_spec_list; struct cb_field *working_storage; struct cb_field *local_storage; struct cb_field *linkage_storage; struct cb_field *screen_storage; cb_tree local_file_list; cb_tree global_file_list; struct handler_struct global_handler[5]; cb_tree collating_sequence; cb_tree cursor_pos; cb_tree crt_status; cb_tree returning; /* RETURNING */ struct cb_word *word_table[CB_WORD_HASH_SIZE]; /* internal variables */ int loop_counter; int decimal_index; int decimal_index_max; unsigned char decimal_point; /* '.' or ',' */ unsigned char currency_symbol; /* '$' or user-specified */ unsigned char numeric_separator; /* ',' or '.' */ unsigned char nested_level; /* Nested program level */ unsigned char flag_main; /* Gen main function */ unsigned char flag_common; /* COMMON PROGRAM */ unsigned char flag_initial; /* INITIAL PROGRAM */ unsigned char flag_recursive; /* RECURSIVE PROGRAM */ unsigned char flag_screen; /* have SCREEN SECTION */ unsigned char flag_validated; /* End program validate */ unsigned char flag_chained; /* PROCEDURE CHAINING */ unsigned char flag_global_use; /* USE GLOBAL */ unsigned char gen_decset; /* Gen decimal_set_int */ unsigned char gen_udecset; /* Gen decimal_set_uint */ unsigned char gen_ptrmanip; /* Gen cob_pointer_manip */ unsigned char gen_file_error; /* Gen error routine */ unsigned char prog_type; /* Program type */ unsigned char spare[3]; /* Spare */ }; extern struct cb_program *cb_build_program (struct cb_program *last_program, int nest_level); /* parser.y */ extern int non_const_word; /* reserved.c */ extern cb_tree lookup_system_name (const char *name); extern int lookup_reserved_word (const char *name); extern void cb_list_reserved (void); extern void cb_list_intrinsics (void); extern void cb_list_mnemonics (void); extern void cb_init_reserved (void); extern void cb_list_map (cb_tree (*func) (cb_tree x), cb_tree l); /* error.c */ #ifdef __GNUC__ extern void cb_warning_x (cb_tree x, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern void cb_error_x (cb_tree x, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); #else extern void cb_warning_x (cb_tree x, const char *fmt, ...); extern void cb_error_x (cb_tree x, const char *fmt, ...); #endif extern char *check_filler_name (char *name); extern void redefinition_error (cb_tree x); extern void redefinition_warning (cb_tree x, cb_tree y); extern void undefined_error (cb_tree x); extern void ambiguous_error (cb_tree x); extern void group_error (cb_tree x, const char *clause); extern void level_redundant_error (cb_tree x, const char *clause); extern void level_require_error (cb_tree x, const char *clause); extern void level_except_error (cb_tree x, const char *clause); struct cb_literal *build_literal (enum cb_category category, const unsigned char *data, size_t size); /* field.c */ extern size_t cb_needs_01; extern int cb_get_level (cb_tree x); extern cb_tree cb_build_field_tree (cb_tree level, cb_tree name, struct cb_field *last_field, enum cb_storage storage, struct cb_file *fn); extern struct cb_field *cb_resolve_redefines (struct cb_field *field, cb_tree redefines); extern void cb_validate_field (struct cb_field *p); extern void cb_validate_88_item (struct cb_field *p); extern struct cb_field *cb_validate_78_item (struct cb_field *p); extern void cb_clear_real_field (void); /* typeck.c */ extern cb_tree cb_check_numeric_value (cb_tree x); extern void cb_build_registers (void); extern char *cb_encode_program_id (const char *name); extern const char *cb_build_program_id (cb_tree name, cb_tree alt_name); extern void cb_define_switch_name (cb_tree name, cb_tree sname, cb_tree flag, cb_tree ref); extern cb_tree cb_build_section_name (cb_tree name, int sect_or_para); extern cb_tree cb_build_assignment_name (struct cb_file *curfile, cb_tree name); extern cb_tree cb_build_index (cb_tree name, cb_tree values, int indexed_by, struct cb_field *qual); extern cb_tree cb_build_identifier (cb_tree x); extern cb_tree cb_build_length (cb_tree x); extern cb_tree cb_build_const_length (cb_tree x); extern cb_tree cb_build_address (cb_tree x); extern cb_tree cb_build_ppointer (cb_tree x); extern void cb_validate_program_environment (struct cb_program *prog); extern void cb_validate_program_data (struct cb_program *prog); extern void cb_validate_program_body (struct cb_program *prog); extern cb_tree cb_build_expr (cb_tree list); extern cb_tree cb_build_cond (cb_tree x); extern void cb_emit_arithmetic (cb_tree vars, int op, cb_tree val); extern cb_tree cb_build_add (cb_tree v, cb_tree n, cb_tree round_opt); extern cb_tree cb_build_sub (cb_tree v, cb_tree n, cb_tree round_opt); extern void cb_emit_corresponding ( cb_tree (*func) (cb_tree f1, cb_tree f2, cb_tree f3), cb_tree x1, cb_tree x2, cb_tree opt); extern void cb_emit_move_corresponding (cb_tree x1, cb_tree x2); extern void cb_emit_accept (cb_tree var, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs); extern void cb_emit_accept_line_or_col (cb_tree var, const int l_or_c); extern void cb_emit_accept_date (cb_tree var); extern void cb_emit_accept_date_yyyymmdd (cb_tree var); extern void cb_emit_accept_day (cb_tree var); extern void cb_emit_accept_day_yyyyddd (cb_tree var); extern void cb_emit_accept_day_of_week (cb_tree var); extern void cb_emit_accept_time (cb_tree var); extern void cb_emit_accept_command_line (cb_tree var); extern void cb_emit_get_environment (cb_tree envvar, cb_tree envval); extern void cb_emit_accept_environment (cb_tree var); extern void cb_emit_accept_mnemonic (cb_tree var, cb_tree mnemonic); extern void cb_emit_accept_name (cb_tree var, cb_tree name); extern void cb_emit_accept_arg_number (cb_tree var); extern void cb_emit_accept_arg_value (cb_tree var); extern void cb_emit_allocate (cb_tree target1, cb_tree target2, cb_tree size, cb_tree initialize); extern void cb_emit_free (cb_tree vars); extern void cb_emit_call (cb_tree prog, cb_tree using, cb_tree returning, cb_tree on_exception, cb_tree not_on_exception); extern void cb_emit_cancel (cb_tree prog); extern void cb_emit_close (cb_tree file, cb_tree opt); extern void cb_emit_commit (void); extern void cb_emit_continue (void); extern void cb_emit_delete (cb_tree file); extern void cb_emit_display (cb_tree values, cb_tree upon, cb_tree no_adv, cb_tree pos, cb_tree fgc, cb_tree bgc, cb_tree scroll, int dispattrs); extern cb_tree cb_build_display_upon (cb_tree x); extern cb_tree cb_build_display_upon_direct (cb_tree x); extern void cb_emit_env_name (cb_tree value); extern void cb_emit_env_value (cb_tree value); extern void cb_emit_arg_number (cb_tree value); extern void cb_emit_command_line (cb_tree value); extern void cb_emit_divide (cb_tree dividend, cb_tree divisor, cb_tree quotient, cb_tree remainder); extern void cb_emit_evaluate (cb_tree subject_list, cb_tree case_list); extern void cb_emit_goto (cb_tree target, cb_tree depending); extern void cb_emit_exit (size_t goback); extern void cb_emit_if (cb_tree cond, cb_tree stmt1, cb_tree stmt2); extern void cb_emit_initialize (cb_tree vars, cb_tree fillinit, cb_tree value, cb_tree replacing, cb_tree def); extern void cb_emit_inspect (cb_tree var, cb_tree body, cb_tree replacing, int replconv); extern void cb_init_tarrying (void); extern cb_tree cb_build_tarrying_data (cb_tree x); extern cb_tree cb_build_tarrying_characters (cb_tree l); extern cb_tree cb_build_tarrying_all (void); extern cb_tree cb_build_tarrying_leading (void); extern cb_tree cb_build_tarrying_trailing (void); extern cb_tree cb_build_tarrying_value (cb_tree x, cb_tree l); extern cb_tree cb_build_replacing_characters (cb_tree x, cb_tree l); extern cb_tree cb_build_replacing_all (cb_tree x, cb_tree y, cb_tree l); extern cb_tree cb_build_replacing_leading (cb_tree x, cb_tree y, cb_tree l); extern cb_tree cb_build_replacing_first (cb_tree x, cb_tree y, cb_tree l); extern cb_tree cb_build_replacing_trailing (cb_tree x, cb_tree y, cb_tree l); extern cb_tree cb_build_converting (cb_tree x, cb_tree y, cb_tree l); extern cb_tree cb_build_inspect_region_start (void); extern cb_tree cb_build_inspect_region (cb_tree l, cb_tree pos, cb_tree x); extern int validate_move (cb_tree src, cb_tree dst, size_t is_value); extern cb_tree cb_build_move (cb_tree src, cb_tree dst); extern void cb_emit_move (cb_tree src, cb_tree dsts); extern void cb_emit_open (cb_tree file, cb_tree mode, cb_tree sharing); extern void cb_emit_perform (cb_tree perform, cb_tree body); extern cb_tree cb_build_perform_once (cb_tree body); extern cb_tree cb_build_perform_times (cb_tree count); extern cb_tree cb_build_perform_until (cb_tree condition, cb_tree varying); extern cb_tree cb_build_perform_forever (cb_tree body); extern cb_tree cb_build_perform_exit (struct cb_label *label); extern void cb_emit_read (cb_tree ref, cb_tree next, cb_tree into, cb_tree key, cb_tree lock_opts); extern void cb_emit_rewrite (cb_tree record, cb_tree from, cb_tree lockopt); extern void cb_emit_release (cb_tree ref, cb_tree from); extern void cb_emit_return (cb_tree ref, cb_tree into); extern void cb_emit_rollback (void); extern void cb_emit_search (cb_tree table, cb_tree varying, cb_tree at_end, cb_tree whens); extern void cb_emit_search_all (cb_tree table, cb_tree at_end, cb_tree when, cb_tree stmts); extern void cb_emit_setenv (cb_tree x, cb_tree y); extern void cb_emit_set_to (cb_tree l, cb_tree x); extern void cb_emit_set_up_down (cb_tree l, cb_tree flag, cb_tree x); extern void cb_emit_set_on_off (cb_tree l, cb_tree flag); extern void cb_emit_set_true (cb_tree l); extern void cb_emit_set_false (cb_tree l); extern void cb_emit_sort_init (cb_tree name, cb_tree keys, cb_tree col); extern void cb_emit_sort_using (cb_tree file, cb_tree l); extern void cb_emit_sort_input (cb_tree proc); extern void cb_emit_sort_giving (cb_tree file, cb_tree l); extern void cb_emit_sort_output (cb_tree proc); extern void cb_emit_sort_finish (cb_tree file); extern void cb_emit_start (cb_tree file, cb_tree op, cb_tree key); extern void cb_emit_stop_run (cb_tree x); extern void cb_emit_string (cb_tree items, cb_tree into, cb_tree pointer); extern void cb_emit_unlock (cb_tree ref); extern void cb_emit_unstring (cb_tree name, cb_tree delimited, cb_tree into, cb_tree pointer, cb_tree tallying); extern cb_tree cb_build_unstring_delimited (cb_tree all, cb_tree value); extern cb_tree cb_build_unstring_into (cb_tree name, cb_tree delimiter, cb_tree count); extern void cb_emit_write (cb_tree record, cb_tree from, cb_tree opt, cb_tree lockopt); extern cb_tree cb_build_write_advancing_lines (cb_tree pos, cb_tree lines); extern cb_tree cb_build_write_advancing_mnemonic (cb_tree pos, cb_tree mnemonic); extern cb_tree cb_build_write_advancing_page (cb_tree pos); extern void cobc_tree_cast_error (cb_tree x, const char *filen, const int linenum, const int tagnum); /* codegen.c */ extern void codegen (struct cb_program *prog, int nested); /* scanner.l */ extern void cb_set_in_procedure (void); extern void cb_reset_in_procedure (void); extern void cb_add_78 (struct cb_field *f); extern void cb_reset_78 (void); extern struct cb_field *check_level_78 (const char *name); #endif /* CB_TREE_H */ open-cobol-1.1/cobc/codegen.c0000644000000000000000000037223411140120555011522 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include "cobc.h" #include "tree.h" #define COB_USE_SETJMP 0 #define COB_MAX_SUBSCRIPTS 16 #define INITIALIZE_NONE 0 #define INITIALIZE_ONE 1 #define INITIALIZE_DEFAULT 2 #define INITIALIZE_COMPOUND 3 #define INITIALIZE_EXTERNAL 4 #ifndef __GNUC__ static int inside_check = 0; static int inside_stack[64]; #endif static int param_id = 0; static int stack_id = 0; static int num_cob_fields = 0; static int loop_counter = 0; static int progid = 0; static int last_line = 0; static int needs_exit_prog = 0; static int need_double = 0; static int gen_ebcdic = 0; static int gen_ebcdic_ascii = 0; static int gen_full_ebcdic = 0; static int gen_native = 0; static int gen_custom = 0; static int field_iteration = 0; static int screenptr = 0; static int i_counters[COB_MAX_SUBSCRIPTS]; static int output_indent_level = 0; static FILE *output_target; static const char *excp_current_program_id = NULL; static const char *excp_current_section = NULL; static const char *excp_current_paragraph = NULL; static struct cb_program *current_prog; static struct label_list { struct label_list *next; int id; int call_num; } *label_cache = NULL; static struct attr_list { struct attr_list *next; unsigned char *pic; int id; int type; int digits; int scale; int flags; int lenstr; } *attr_cache = NULL; static struct literal_list { struct literal_list *next; struct cb_literal *literal; cb_tree x; int id; } *literal_cache = NULL; static struct field_list { struct field_list *next; struct cb_field *f; cb_tree x; const char *curr_prog; int nulldata; } *field_cache = NULL; static struct call_list { struct call_list *next; const char *callname; } *call_cache = NULL; static struct base_list { struct base_list *next; struct cb_field *f; const char *curr_prog; } *base_cache = NULL; static struct local_list { struct local_list *next; struct cb_field *f; } *local_cache = NULL; struct sort_list { struct sort_list *next; }; struct system_table { const char *syst_name; const char *syst_call; }; static const struct system_table system_tab[] = { #undef COB_SYSTEM_GEN #define COB_SYSTEM_GEN(x, y, z) { x, #z }, #include "libcob/system.def" { NULL, NULL } }; /* Globals */ int has_external = 0; #ifdef __GNUC__ static void output (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); static void output_line (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); static void output_storage (const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2))); #else static void output (const char *fmt, ...); static void output_line (const char *fmt, ...); static void output_storage (const char *fmt, ...); #endif static void output_stmt (cb_tree x); static void output_integer (cb_tree x); static void output_index (cb_tree x); static void output_func_1 (const char *name, cb_tree x); static void output_param (cb_tree x, int id); static void lookup_call (const char *p) { struct call_list *clp; for (clp = call_cache; clp; clp = clp->next) { if (strcmp (p, clp->callname) == 0) { return; } } clp = cobc_malloc (sizeof (struct call_list)); clp->callname = p; clp->next = call_cache; call_cache = clp; } static struct attr_list * attr_list_reverse (struct attr_list *p) { struct attr_list *next; struct attr_list *last = NULL; for (; p; p = next) { next = p->next; p->next = last; last = p; } return last; } static struct literal_list * literal_list_reverse (struct literal_list *p) { struct literal_list *next; struct literal_list *last = NULL; for (; p; p = next) { next = p->next; p->next = last; last = p; } return last; } static struct local_list * local_list_reverse (struct local_list *p) { struct local_list *next; struct local_list *last = NULL; for (; p; p = next) { next = p->next; p->next = last; last = p; } return last; } /* * Output routines */ static void output (const char *fmt, ...) { va_list ap; if (output_target) { va_start (ap, fmt); vfprintf (output_target, fmt, ap); va_end (ap); } } static void output_newline (void) { if (output_target) { fputs ("\n", output_target); } } static void output_prefix (void) { int i; if (output_target) { for (i = 0; i < output_indent_level; i++) { fputc (' ', output_target); } } } static void output_line (const char *fmt, ...) { va_list ap; if (output_target) { output_prefix (); va_start (ap, fmt); vfprintf (output_target, fmt, ap); va_end (ap); fputc ('\n', output_target); } } static void output_indent (const char *str) { const char *p; int level = 2; for (p = str; *p == ' '; p++) { level++; } if (*p == '}' && strcmp (str, "})") != 0) { output_indent_level -= level; } output_line (str); if (*p == '{' && strcmp (str, ")}") != 0) { output_indent_level += level; } } static void output_string (const unsigned char *s, int size) { int i; int c; int printable = 1; for (i = 0; i < size; i++) { if (!isprint (s[i])) { printable = 0; } } output ("\""); for (i = 0; i < size; i++) { c = s[i]; if (printable) { if (c == '\"' || c == '\\') { output ("\\%c", c); } else { output ("%c", c); } } else { output ("\\%03o", c); } } output ("\""); } static void output_storage (const char *fmt, ...) { va_list ap; if (cb_storage_file) { va_start (ap, fmt); vfprintf (cb_storage_file, fmt, ap); va_end (ap); } } static void output_local (const char *fmt, ...) { va_list ap; if (current_prog->local_storage_file) { va_start (ap, fmt); vfprintf (current_prog->local_storage_file, fmt, ap); va_end (ap); } } /* * Field */ static void output_base (struct cb_field *f) { struct cb_field *f01; struct cb_field *p; struct cb_field *v; struct base_list *bl; char *nmp; char name[COB_MINI_BUFF]; f01 = cb_field_founder (f); if (f->flag_item_78) { fprintf (stderr, "Unexpected CONSTANT item\n"); ABORT (); } if (f01->redefines) { f01 = f01->redefines; } /* Base name */ if (f01->flag_external) { strcpy (name, f01->name); for (nmp = name; *nmp; nmp++) { if (*nmp == '-') { *nmp = '_'; } } } else { sprintf (name, "%d", f01->id); } if (!f01->flag_base) { if (!f01->flag_external) { if (!f01->flag_local || f01->flag_is_global) { bl = cobc_malloc (sizeof (struct base_list)); bl->f = f01; bl->curr_prog = excp_current_program_id; bl->next = base_cache; base_cache = bl; } else { if (current_prog->flag_global_use) { output_local ("unsigned char\t\t*%s%s = NULL;", CB_PREFIX_BASE, name); output_local ("\t/* %s */\n", f01->name); output_local ("static unsigned char\t*save_%s%s;\n", CB_PREFIX_BASE, name); } else { output_local ("unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name); output_local ("\t/* %s */\n", f01->name); } } } f01->flag_base = 1; } output ("%s%s", CB_PREFIX_BASE, name); if (cb_field_variable_address (f)) { for (p = f->parent; p; f = f->parent, p = f->parent) { for (p = p->children; p != f; p = p->sister) { v = cb_field_variable_size (p); if (v) { output (" + %d + ", v->offset - p->offset); if (v->size != 1) { output ("%d * ", v->size); } output_integer (v->occurs_depending); } else { output (" + %d", p->size * p->occurs_max); } } } } else if (f->offset > 0) { output (" + %d", f->offset); } } static void output_data (cb_tree x) { struct cb_literal *l; struct cb_reference *r; struct cb_field *f; cb_tree lsub; switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: l = CB_LITERAL (x); if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { output ("(unsigned char *)\"%s%s\"", l->data, (l->sign < 0) ? "-" : (l->sign > 0) ? "+" : ""); } else { output ("(unsigned char *)"); output_string (l->data, (int) l->size); } break; case CB_TAG_REFERENCE: r = CB_REFERENCE (x); f = CB_FIELD (r->value); /* Base address */ output_base (f); /* Subscripts */ if (r->subs) { lsub = r->subs; for (; f; f = f->parent) { if (f->flag_occurs) { output (" + "); if (f->size != 1) { output ("%d * ", f->size); } output_index (CB_VALUE (lsub)); lsub = CB_CHAIN (lsub); } } } /* Offset */ if (r->offset) { output (" + "); output_index (r->offset); } break; case CB_TAG_CAST: output ("&"); output_param (x, 0); break; case CB_TAG_INTRINSIC: output ("module.cob_procedure_parameters[%d]->data", field_iteration); break; case CB_TAG_CONST: if (x == cb_null) { output ("NULL"); return; } /* Fall through */ default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } static void output_size (cb_tree x) { struct cb_literal *l; struct cb_reference *r; struct cb_field *f; struct cb_field *p; struct cb_field *q; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: output ("1"); break; case CB_TAG_LITERAL: l = CB_LITERAL (x); output ("%d", (int)(l->size + ((l->sign != 0) ? 1 : 0))); break; case CB_TAG_REFERENCE: r = CB_REFERENCE (x); f = CB_FIELD (r->value); if (r->length) { output_integer (r->length); } else if (r->offset) { output ("%d - ", f->size); output_index (r->offset); } else { p = cb_field_variable_size (f); q = f; again: if (p && (r->type == CB_SENDING_OPERAND || !cb_field_subordinate (cb_field (p->occurs_depending), q))) { if (p->offset - q->offset > 0) { output ("%d + ", p->offset - q->offset); } if (p->size != 1) { output ("%d * ", p->size); } output_integer (p->occurs_depending); q = p; } else { output ("%d", q->size); } for (; q != f; q = q->parent) { if (q->sister && !q->sister->redefines) { q = q->sister; p = q->occurs_depending ? q : cb_field_variable_size (q); output (" + "); goto again; } } } break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } static int lookup_attr (int type, int digits, int scale, int flags, unsigned char *pic, int lenstr) { struct attr_list *l; /* Search attribute cache */ for (l = attr_cache; l; l = l->next) { if (type == l->type && digits == l->digits && scale == l->scale && flags == l->flags && ((pic == l->pic) || (pic && l->pic && lenstr == l->lenstr && memcmp ((char *)pic, (char *)(l->pic), (size_t)lenstr) == 0))) { return l->id; } } /* Output new attribute */ /* Cache it */ l = cobc_malloc (sizeof (struct attr_list)); l->id = cb_attr_id; l->type = type; l->digits = digits; l->scale = scale; l->flags = flags; l->pic = pic; l->lenstr = lenstr; l->next = attr_cache; attr_cache = l; return cb_attr_id++; } static void output_attr (cb_tree x) { struct cb_literal *l; struct cb_reference *r; struct cb_field *f; int id; int type; int flags; switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: l = CB_LITERAL (x); if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { flags = 0; if (l->sign != 0) { flags = COB_FLAG_HAVE_SIGN | COB_FLAG_SIGN_SEPARATE; } id = lookup_attr (COB_TYPE_NUMERIC_DISPLAY, (int) l->size, l->scale, flags, NULL, 0); } else { if (l->all) { id = lookup_attr (COB_TYPE_ALPHANUMERIC_ALL, 0, 0, 0, NULL, 0); } else { id = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); } } break; case CB_TAG_REFERENCE: type = cb_tree_type (x); r = CB_REFERENCE (x); f = CB_FIELD (r->value); flags = 0; if (r->offset) { id = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); } else { switch (type) { case COB_TYPE_GROUP: case COB_TYPE_ALPHANUMERIC: if (f->flag_justified) { id = lookup_attr (type, 0, 0, COB_FLAG_JUSTIFIED, NULL, 0); } else { id = lookup_attr (type, 0, 0, 0, NULL, 0); } break; default: if (f->pic->have_sign) { flags |= COB_FLAG_HAVE_SIGN; if (f->flag_sign_separate) { flags |= COB_FLAG_SIGN_SEPARATE; } if (f->flag_sign_leading) { flags |= COB_FLAG_SIGN_LEADING; } } if (f->flag_blank_zero) { flags |= COB_FLAG_BLANK_ZERO; } if (f->flag_justified) { flags |= COB_FLAG_JUSTIFIED; } if (f->flag_binary_swap) { flags |= COB_FLAG_BINARY_SWAP; } if (f->flag_real_binary) { flags |= COB_FLAG_REAL_BINARY; } if (f->flag_is_pointer) { flags |= COB_FLAG_IS_POINTER; } id = lookup_attr (type, f->pic->digits, f->pic->scale, flags, (ucharptr) f->pic->str, f->pic->lenstr); break; } } break; case CB_TAG_ALPHABET_NAME: id = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } output ("&%s%d", CB_PREFIX_ATTR, id); } static void output_field (cb_tree x) { output ("{"); output_size (x); output (", "); output_data (x); output (", "); output_attr (x); output ("}"); } /* * Literal */ static int lookup_literal (cb_tree x) { struct cb_literal *literal; struct literal_list *l; FILE *savetarget; literal = CB_LITERAL (x); /* Search literal cache */ for (l = literal_cache; l; l = l->next) { if (CB_TREE_CLASS (literal) == CB_TREE_CLASS (l->literal) && literal->size == l->literal->size && literal->all == l->literal->all && literal->sign == l->literal->sign && literal->scale == l->literal->scale && memcmp (literal->data, l->literal->data, literal->size) == 0) { return l->id; } } /* Output new literal */ savetarget = output_target; output_target = NULL; output_field (x); output_target = savetarget; /* Cache it */ l = cobc_malloc (sizeof (struct literal_list)); l->id = cb_literal_id; l->literal = literal; l->x = x; l->next = literal_cache; literal_cache = l; return cb_literal_id++; } /* * Integer */ static void output_integer (cb_tree x) { struct cb_binary_op *p; struct cb_cast *cp; struct cb_field *f; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: if (x == cb_zero) { output ("0"); } else if (x == cb_null) { output ("(unsigned char *)NULL"); } else { output ("%s", CB_CONST (x)->val); } break; case CB_TAG_INTEGER: output ("%d", CB_INTEGER (x)->val); break; case CB_TAG_LITERAL: output ("%d", cb_get_int (x)); break; case CB_TAG_BINARY_OP: p = CB_BINARY_OP (x); if (p->op == '^') { output ("(int) pow ("); output_integer (p->x); output (", "); output_integer (p->y); output (")"); } else { output ("("); if (need_double) { output ("(double)"); } output_integer (p->x); output (" %c ", p->op); if (need_double) { output ("(double)"); } output_integer (p->y); output (")"); } break; case CB_TAG_CAST: cp = CB_CAST (x); switch (cp->type) { case CB_CAST_ADDRESS: output ("("); output_data (cp->val); output (")"); break; case CB_CAST_PROGRAM_POINTER: output_func_1 ("cob_call_resolve", x); break; default: fprintf (stderr, "Unexpected cast type %d\n", cp->type); ABORT (); } break; case CB_TAG_REFERENCE: f = cb_field (x); switch (f->usage) { case CB_USAGE_INDEX: case CB_USAGE_LENGTH: output ("(*(int *) ("); output_data (x); output ("))"); return; case CB_USAGE_POINTER: #ifdef COB_NON_ALIGNED output ("(cob_get_pointer ("); output_data (x); output ("))"); #else output ("(*(unsigned char **) ("); output_data (x); output ("))"); #endif return; case CB_USAGE_PROGRAM_POINTER: #ifdef COB_NON_ALIGNED output ("(cob_get_prog_pointer ("); output_data (x); output ("))"); #else output ("(*(void **) ("); output_data (x); output ("))"); #endif return; case CB_USAGE_DISPLAY: if (f->pic && f->pic->scale >= 0 && f->size - f->pic->scale > 0 && f->size - f->pic->scale <= 9 && f->pic->have_sign == 0) { output ("cob_get_numdisp ("); output_data (x); output (", %d)", f->size - f->pic->scale); return; } break; case CB_USAGE_PACKED: if (f->pic->scale == 0 && f->pic->digits < 10) { output_func_1 ("cob_get_packed_int", x); return; } break; case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: if (f->size == 1) { output ("(*("); if (!f->pic->have_sign) { output ("unsigned "); } else { output ("signed "); } output ("char *) ("); output_data (x); output ("))"); return; } #ifdef COB_NON_ALIGNED if (f->storage != CB_STORAGE_LINKAGE && f->indexes == 0 && ( #ifdef COB_SHORT_BORK (f->size == 2 && (f->offset % 4 == 0)) || #else (f->size == 2 && (f->offset % 2 == 0)) || #endif (f->size == 4 && (f->offset % 4 == 0)) || (f->size == 8 && (f->offset % 8 == 0)))) { #else if (f->size == 2 || f->size == 4 || f->size == 8) { #endif if (f->flag_binary_swap) { output ("(("); if (!f->pic->have_sign) { output ("unsigned "); } switch (f->size) { case 2: output ("short)COB_BSWAP_16("); break; case 4: output ("int)COB_BSWAP_32("); break; case 8: output ("long long)COB_BSWAP_64("); break; } output ("*("); switch (f->size) { case 2: output ("short *)("); break; case 4: output ("int *)("); break; case 8: output ("long long *)("); break; } output_data (x); output (")))"); return; } else { output ("(*("); if (!f->pic->have_sign) { output ("unsigned "); } switch (f->size) { case 2: output ("short *)("); break; case 4: output ("int *)("); break; case 8: output ("long long *)("); break; } output_data (x); output ("))"); return; } } if (f->pic->have_sign == 0) { output ("(unsigned int)"); } break; default: break; } output_func_1 ("cob_get_int", x); break; case CB_TAG_INTRINSIC: output ("cob_get_int ("); output_param (x, -1); output (")"); break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } static void output_index (cb_tree x) { switch (CB_TREE_TAG (x)) { case CB_TAG_INTEGER: output ("%d", CB_INTEGER (x)->val - 1); break; case CB_TAG_LITERAL: output ("%d", cb_get_int (x) - 1); break; default: output ("("); output_integer (x); output (" - 1)"); break; } } /* * Parameter */ static void output_param (cb_tree x, int id) { struct cb_reference *r; struct cb_field *f; struct cb_field *pechk; struct cb_cast *cp; struct cb_binary_op *bp; struct field_list *fl; FILE *savetarget; struct cb_intrinsic *ip; struct cb_alphabet_name *abp; struct cb_alphabet_name *rbp; cb_tree l; int n; int extrefs; int sav_stack_id; char fname[12]; param_id = id; if (x == NULL) { output ("NULL"); return; } switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: output ("%s", CB_CONST (x)->val); break; case CB_TAG_INTEGER: output_integer (x); break; case CB_TAG_STRING: output_string (CB_STRING (x)->data, (int) CB_STRING (x)->size); break; case CB_TAG_LOCALE_NAME: output_param (CB_LOCALE_NAME(x)->list, id); break; case CB_TAG_ALPHABET_NAME: abp = CB_ALPHABET_NAME (x); switch (abp->type) { case CB_ALPHABET_STANDARD_1: case CB_ALPHABET_STANDARD_2: #ifdef COB_EBCDIC_MACHINE gen_ebcdic_ascii = 1; output ("cob_ebcdic_ascii"); break; #endif case CB_ALPHABET_NATIVE: gen_native = 1; output ("NULL"); break; case CB_ALPHABET_EBCDIC: #ifdef COB_EBCDIC_MACHINE gen_native = 1; output ("NULL"); #else gen_ebcdic = 1; output ("cob_a2e"); #endif break; case CB_ALPHABET_CUSTOM: gen_custom = 1; output ("%s%s", CB_PREFIX_SEQUENCE, abp->cname); break; } break; case CB_TAG_CAST: cp = CB_CAST (x); switch (cp->type) { case CB_CAST_INTEGER: output_integer (cp->val); break; case CB_CAST_ADDRESS: output_data (cp->val); break; case CB_CAST_ADDR_OF_ADDR: output ("&"); output_data (cp->val); break; case CB_CAST_LENGTH: output_size (cp->val); break; case CB_CAST_PROGRAM_POINTER: output_param (cp->val, id); break; } break; case CB_TAG_DECIMAL: output ("&d%d", CB_DECIMAL (x)->id); break; case CB_TAG_FILE: output ("%s%s", CB_PREFIX_FILE, CB_FILE (x)->cname); break; case CB_TAG_LITERAL: output ("&%s%d", CB_PREFIX_CONST, lookup_literal (x)); break; case CB_TAG_FIELD: /* TODO: remove me */ output_param (cb_build_field_reference (CB_FIELD (x), NULL), id); break; case CB_TAG_REFERENCE: r = CB_REFERENCE (x); extrefs = 0; if (r->check) { #ifdef __GNUC__ output_indent (" ({"); #else inside_stack[inside_check] = 0; ++inside_check; output (" (\n"); #endif for (l = r->check; l; l = CB_CHAIN (l)) { sav_stack_id = stack_id; output_stmt (CB_VALUE (l)); stack_id = sav_stack_id; } } if (CB_FILE_P (r->value)) { output ("%s%s", CB_PREFIX_FILE, CB_FILE (r->value)->cname); if (r->check) { #ifdef __GNUC__ output ("; })"); #else --inside_check; output (" )"); #endif } break; } if (CB_ALPHABET_NAME_P (r->value)) { rbp = CB_ALPHABET_NAME (r->value); switch (rbp->type) { case CB_ALPHABET_STANDARD_1: case CB_ALPHABET_STANDARD_2: #ifdef COB_EBCDIC_MACHINE gen_ebcdic_ascii = 1; output ("&f_ebcdic_ascii"); break; #endif case CB_ALPHABET_NATIVE: gen_native = 1; output ("&f_native"); break; case CB_ALPHABET_EBCDIC: #ifdef COB_EBCDIC_MACHINE gen_native = 1; output ("&f_native"); #else gen_full_ebcdic = 1; output ("&f_ebcdic"); #endif break; case CB_ALPHABET_CUSTOM: gen_custom = 1; output ("&f_%s", rbp->cname); break; } if (r->check) { #ifdef __GNUC__ output ("; })"); #else --inside_check; output (" )"); #endif } break; } f = CB_FIELD (r->value); if (f->redefines && f->redefines->flag_external) { extrefs = 1; f->flag_item_external = 1; f->flag_external = 1; } if (f->redefines && f->redefines->flag_item_based) { f->flag_local = 1; } for (pechk = f->parent; pechk; pechk = pechk->parent) { if (pechk->flag_external) { extrefs = 1; f->flag_item_external = 1; break; } if (pechk->redefines && pechk->redefines->flag_external) { extrefs = 1; f->flag_item_external = 1; f->flag_external = 1; break; } if (pechk->flag_item_based) { f->flag_local = 1; break; } if (pechk->redefines && pechk->redefines->flag_item_based) { f->flag_local = 1; break; } } if (f->flag_external) { f->flag_item_external = 1; } if (!r->subs && !r->offset && f->count > 0 && !cb_field_variable_size (f) && !cb_field_variable_address (f)) { if (!f->flag_field) { savetarget = output_target; output_target = NULL; output_field (x); fl = cobc_malloc (sizeof (struct field_list)); fl->x = x; fl->f = f; fl->curr_prog = excp_current_program_id; fl->nulldata = (r->subs != NULL); fl->next = field_cache; field_cache = fl; f->flag_field = 1; output_target = savetarget; } if (f->flag_local) { if (f->flag_any_length && f->flag_anylen_done) { output ("&%s%d", CB_PREFIX_FIELD, f->id); } else { output ("(%s%d.data = ", CB_PREFIX_FIELD, f->id); output_data (x); output (", &%s%d)", CB_PREFIX_FIELD, f->id); if (f->flag_any_length) { f->flag_anylen_done = 1; } } } else { if (screenptr && f->storage == CB_STORAGE_SCREEN) { output ("&s_%d", f->id); } else { output ("&%s%d", CB_PREFIX_FIELD, f->id); } } } else { if (stack_id >= num_cob_fields) { num_cob_fields = stack_id + 1; } sprintf (fname, "f%d", stack_id++); #ifndef __GNUC__ if (inside_check != 0) { if (inside_stack[inside_check-1] != 0) { inside_stack[inside_check-1] = 0; output (",\n"); } } #endif output ("(%s.size = ", fname); output_size (x); output (", %s.data = ", fname); output_data (x); output (", %s.attr = ", fname); output_attr (x); output (", &%s)", fname); } if (r->check) { #ifdef __GNUC__ output ("; })"); #else --inside_check; output (" )"); #endif } break; case CB_TAG_BINARY_OP: bp = CB_BINARY_OP (x); output ("cob_intr_binop ("); output_param (bp->x, id); output (", "); output ("%d", bp->op); output (", "); output_param (bp->y, id); output (")"); break; case CB_TAG_INTRINSIC: n = 0; ip = CB_INTRINSIC (x); output ("%s (", ip->intr_tab->intr_routine); if (ip->intr_tab->refmod) { if (ip->offset) { output_integer (ip->offset); output (", "); } else { output ("0, "); } if (ip->length) { output_integer (ip->length); } else { output ("0"); } if (ip->intr_field || ip->args) { output (", "); } } if (ip->intr_field) { if (ip->intr_field == cb_int0) { output ("NULL"); } else if (ip->intr_field == cb_int1) { for (l = ip->args; l; l = CB_CHAIN (l)) { n++; } output ("%d", n); } else { output_param (ip->intr_field, id); } if (ip->args) { output (", "); } } for (l = ip->args; l; l = CB_CHAIN (l)) { output_param (CB_VALUE (l), id); id++; param_id++; if (CB_CHAIN (l)) { output (", "); } } output (")"); break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } /* * Function call */ static void output_funcall (cb_tree x) { struct cb_funcall *p; cb_tree l; int i; p = CB_FUNCALL (x); if (p->name[0] == '$') { switch (p->name[1]) { case 'E': /* Set of one character */ output ("*("); output_data (p->argv[0]); output (") = "); output_param (p->argv[1], 1); break; case 'F': /* Move of one character */ output ("*("); output_data (p->argv[0]); output (") = *("); output_data (p->argv[1]); output (")"); break; case 'G': /* Test of one character */ output ("(int)(*("); output_data (p->argv[0]); if (p->argv[1] == cb_space) { output (") - ' ')"); } else if (p->argv[1] == cb_zero) { output (") - '0')"); } else if (p->argv[1] == cb_low) { output ("))"); } else if (p->argv[1] == cb_high) { output (") - 255)"); } else if (CB_LITERAL_P (p->argv[1])) { output (") - %d)", *(CB_LITERAL (p->argv[1])->data)); } else { output (") - *("); output_data (p->argv[1]); output ("))"); } break; default: ABORT (); } return; } screenptr = p->screenptr; output ("%s (", p->name); for (i = 0; i < p->argc; i++) { if (p->varcnt && i + 1 == p->argc) { output ("%d, ", p->varcnt); for (l = p->argv[i]; l; l = CB_CHAIN (l)) { output_param (CB_VALUE (l), i); i++; if (CB_CHAIN (l)) { output (", "); } } } else { output_param (p->argv[i], i); if (i + 1 < p->argc) { output (", "); } } } output (")"); screenptr = 0; } static void output_func_1 (const char *name, cb_tree x) { output ("%s (", name); output_param (x, param_id); output (")"); } /* * Condition */ static void output_cond (cb_tree x, int save_flag) { struct cb_binary_op *p; switch (CB_TREE_TAG (x)) { case CB_TAG_CONST: if (x == cb_true) { output ("1"); } else if (x == cb_false) { output ("0"); } else { ABORT (); } break; case CB_TAG_BINARY_OP: p = CB_BINARY_OP (x); switch (p->op) { case '!': output ("!"); output_cond (p->x, save_flag); break; case '&': case '|': output ("("); output_cond (p->x, save_flag); output (p->op == '&' ? " && " : " || "); output_cond (p->y, save_flag); output (")"); break; case '=': case '<': case '[': case '>': case ']': case '~': output ("((int)"); output_cond (p->x, save_flag); switch (p->op) { case '=': output (" == 0"); break; case '<': output (" < 0"); break; case '[': output (" <= 0"); break; case '>': output (" > 0"); break; case ']': output (" >= 0"); break; case '~': output (" != 0"); break; } output (")"); break; default: output_integer (x); break; } break; case CB_TAG_FUNCALL: if (save_flag) { output ("(ret = "); } output_funcall (x); if (save_flag) { output (")"); } break; case CB_TAG_LIST: if (save_flag) { output ("(ret = "); } #ifdef __GNUC__ output_indent ("({"); #else inside_stack[inside_check] = 0; ++inside_check; output ("(\n"); #endif for (; x; x = CB_CHAIN (x)) { output_stmt (CB_VALUE (x)); } #ifdef __GNUC__ output_indent ("})"); #else --inside_check; output (")"); #endif if (save_flag) { output (")"); } break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } /* * MOVE */ static void output_move (cb_tree src, cb_tree dst) { /* suppress warnings */ suppress_warn = 1; output_stmt (cb_build_move (src, dst)); suppress_warn = 0; } /* * INITIALIZE */ static int initialize_type (struct cb_initialize *p, struct cb_field *f, int topfield) { cb_tree l; int type; if (f->flag_item_78) { fprintf (stderr, "Unexpected CONSTANT item\n"); ABORT (); } if (f->flag_chained) { return INITIALIZE_ONE; } if (f->flag_external) { return INITIALIZE_EXTERNAL; } if (f->redefines && (!topfield || !p->flag_statement)) { return INITIALIZE_NONE; } if (p->val && f->values) { return INITIALIZE_ONE; } if (p->flag_statement && !f->children) { if (strlen (f->name) > 4 && f->name[4] == '$') { return INITIALIZE_NONE; } } if (f->children) { type = initialize_type (p, f->children, 0); if (type == INITIALIZE_ONE) { return INITIALIZE_COMPOUND; } for (f = f->children->sister; f; f = f->sister) { if (type != initialize_type (p, f, 0)) { return INITIALIZE_COMPOUND; } } return type; } else { for (l = p->rep; l; l = CB_CHAIN (l)) { if ((int)CB_PURPOSE_INT (l) == (int)CB_TREE_CATEGORY (f)) { return INITIALIZE_ONE; } } } if (p->def) { if (f->usage == CB_USAGE_FLOAT || f->usage == CB_USAGE_DOUBLE) { return INITIALIZE_ONE; } switch (CB_TREE_CATEGORY (f)) { case CB_CATEGORY_NUMERIC_EDITED: case CB_CATEGORY_ALPHANUMERIC_EDITED: case CB_CATEGORY_NATIONAL_EDITED: return INITIALIZE_ONE; default: if (cb_tree_type (CB_TREE (f)) == COB_TYPE_NUMERIC_PACKED) { return INITIALIZE_ONE; } else { return INITIALIZE_DEFAULT; } } } return INITIALIZE_NONE; } static int initialize_uniform_char (struct cb_field *f) { int c; if (f->children) { c = initialize_uniform_char (f->children); for (f = f->children->sister; f; f = f->sister) { if (!f->redefines) { if (c != initialize_uniform_char (f)) { return -1; } } } return c; } else { switch (cb_tree_type (CB_TREE (f))) { case COB_TYPE_NUMERIC_BINARY: return 0; case COB_TYPE_NUMERIC_DISPLAY: return '0'; case COB_TYPE_ALPHANUMERIC: return ' '; default: return -1; } } } static void output_figurative (cb_tree x, struct cb_field *f, const int value) { output_prefix (); if (f->size == 1) { output ("*(unsigned char *)("); output_data (x); output (") = %d;\n", value); } else { output ("memset ("); output_data (x); if (CB_REFERENCE_P(x) && CB_REFERENCE(x)->length) { output (", %d, ", value); output_size (x); output (");\n"); } else { output (", %d, %d);\n", value, f->size); } } } static void output_initialize_literal (cb_tree x, struct cb_field *f, struct cb_literal *l) { size_t i; size_t n; if (l->size == 1) { output_prefix (); output ("memset ("); output_data (x); if (CB_REFERENCE_P(x) && CB_REFERENCE(x)->length) { output (", %d, ", l->data[0]); output_size (x); output (");\n"); } else { output (", %d, %d);\n", l->data[0], f->size); } return; } if (l->size >= f->size) { output_prefix (); output ("memcpy ("); output_data (x); output (", "); output_string (l->data, f->size); output (", %d);\n", f->size); return; } i = f->size / l->size; i_counters[0] = 1; output_line ("for (i0 = 0; i0 < %u; i0++)", (unsigned int)i); output_indent (" {"); output_prefix (); output ("memcpy ("); output_data (x); output (" + (i0 * %u), ", (unsigned int)l->size); output_string (l->data, l->size); output (", %u);\n", (unsigned int)l->size); output_indent (" }"); n = f->size % l->size; if (n) { output_prefix (); output ("memcpy ("); output_data (x); output (" + (i0 * %u), ", (unsigned int)l->size); output_string (l->data, n); output (", %u);\n", (unsigned int)n); } } static void output_initialize_fp (cb_tree x, struct cb_field *f) { output_prefix (); if (f->usage == CB_USAGE_FLOAT) { output ("{float temp = 0.0;"); } else { output ("{double temp = 0.0;"); } output (" memcpy ("); output_data (x); output (", (char *)&temp, sizeof(temp));}\n"); } static void output_initialize_external (cb_tree x, struct cb_field *f) { unsigned char *p; char name[COB_MINI_BUFF]; output_prefix (); output_data (x); if (f->ename) { output (" = cob_external_addr (\"%s\", %d);\n", f->ename, f->size); } else { strcpy (name, f->name); for (p = (unsigned char *)name; *p; p++) { if (islower (*p)) { *p = toupper (*p); } } output (" = cob_external_addr (\"%s\", %d);\n", name, f->size); } } static void output_initialize_uniform (cb_tree x, int c, int size) { output_prefix (); if (size == 1) { output ("*(unsigned char *)("); output_data (x); output (") = %d;\n", c); } else { output ("memset ("); output_data (x); if (CB_REFERENCE_P(x) && CB_REFERENCE(x)->length) { output (", %d, ", c); output_size (x); output (");\n"); } else { output (", %d, %d);\n", c, size); } } } static void output_initialize_one (struct cb_initialize *p, cb_tree x) { struct cb_field *f; cb_tree value; cb_tree lrp; struct cb_literal *l; int i; int n; int buffchar; static char *buff = NULL; static int lastsize = 0; f = cb_field (x); /* CHAINING */ if (f->flag_chained) { output_prefix (); output ("cob_chain_setup ("); output_data (x); output (", %d, %d);\n", f->param_num, f->size); return; } /* Initialize by value */ if (p->val && f->values) { value = CB_VALUE (f->values); if (value == cb_space) { /* Fixme: This is to avoid an error when a numeric-edited item has VALUE SPACE because cob_build_move doubly checks the value. We should instead check the value only once. */ output_figurative (x, f, ' '); } else if (value == cb_low) { output_figurative (x, f, 0); } else if (value == cb_high) { output_figurative (x, f, 255); } else if (value == cb_quote) { output_figurative (x, f, '"'); } else if (value == cb_zero && f->usage == CB_USAGE_DISPLAY) { output_figurative (x, f, '0'); } else if (value == cb_null && f->usage == CB_USAGE_DISPLAY) { output_figurative (x, f, 0); } else if (CB_LITERAL_P (value) && CB_LITERAL (value)->all) { /* ALL literal */ output_initialize_literal (x, f, CB_LITERAL (value)); } else if (CB_CONST_P (value) || CB_TREE_CLASS (value) == CB_CLASS_NUMERIC) { /* Figurative literal, numeric literal */ output_move (value, x); } else { /* Alphanumeric literal */ /* We do not use output_move here because we do not want to have the value be edited. */ l = CB_LITERAL (value); if (!buff) { if (f->size <= COB_SMALL_BUFF) { buff = cobc_malloc (COB_SMALL_BUFF); lastsize = COB_SMALL_BUFF; } else { buff = cobc_malloc ((size_t)f->size); lastsize = f->size; } } else { if (f->size > lastsize) { free (buff); buff = cobc_malloc ((size_t)f->size); lastsize = f->size; } } l = CB_LITERAL (value); if ((int)l->size >= (int)f->size) { memcpy (buff, l->data, (size_t)f->size); } else { memcpy (buff, l->data, l->size); memset (buff + l->size, ' ', f->size - l->size); } output_prefix (); if (f->size == 1) { output ("*(unsigned char *) ("); output_data (x); output (") = %d;\n", *(unsigned char *)buff); } else { buffchar = *buff; for (i = 0; i < f->size; i++) { if (*(buff + i) != buffchar) { break; } } if (i == f->size) { output ("memset ("); output_data (x); output (", %d, %d);\n", buffchar, f->size); } else { if (f->size >= 8) { buffchar = *(buff + f->size - 1); n = 0; for (i = f->size - 1; i >= 0; i--, n++) { if (*(buff + i) != buffchar) { break; } } if (n > 2) { output ("memcpy ("); output_data (x); output (", "); output_string ((ucharptr) buff, f->size - n); output (", %d);\n", f->size - n); output_prefix (); output ("memset ("); output_data (x); output (" + %d, %d, %d);\n", f->size - n, buffchar, n); return; } } output ("memcpy ("); output_data (x); output (", "); output_string ((ucharptr) buff, f->size); output (", %d);\n", f->size); } } } return; } /* Initialize replacing */ if (!f->children) { for (lrp = p->rep; lrp; lrp = CB_CHAIN (lrp)) { if ((int)CB_PURPOSE_INT (lrp) == (int)CB_TREE_CATEGORY (x)) { output_move (CB_VALUE (lrp), x); return; } } } /* Initialize by default */ if (p->def) { if (f->usage == CB_USAGE_FLOAT || f->usage == CB_USAGE_DOUBLE) { output_initialize_fp (x, f); return; } switch (CB_TREE_CATEGORY (x)) { case CB_CATEGORY_NUMERIC: case CB_CATEGORY_NUMERIC_EDITED: output_move (cb_zero, x); break; case CB_CATEGORY_ALPHANUMERIC_EDITED: case CB_CATEGORY_NATIONAL_EDITED: output_move (cb_space, x); break; default: fprintf (stderr, "Unexpected tree category %d\n", CB_TREE_CATEGORY (x)); ABORT (); } } } static void output_initialize_compound (struct cb_initialize *p, cb_tree x) { struct cb_field *ff; struct cb_field *f; struct cb_field *last_field; cb_tree c; int type; int last_char; int i; size_t size; ff = cb_field (x); for (f = ff->children; f; f = f->sister) { type = initialize_type (p, f, 0); c = cb_build_field_reference (f, x); switch (type) { case INITIALIZE_NONE: break; case INITIALIZE_DEFAULT: { last_field = f; last_char = initialize_uniform_char (f); if (last_char != -1) { if (f->flag_occurs) { CB_REFERENCE (c)->subs = cb_cons (cb_int1, CB_REFERENCE (c)->subs); } for (; f->sister; f = f->sister) { if (!f->sister->redefines) { if (initialize_type (p, f->sister, 0) != INITIALIZE_DEFAULT || initialize_uniform_char (f->sister) != last_char) { break; } } } if (f->sister) { size = f->sister->offset - last_field->offset; } else { size = ff->offset + ff->size - last_field->offset; } output_initialize_uniform (c, last_char, (int) size); break; } /* Fall through */ } default: if (f->flag_occurs) { /* Begin occurs loop */ i = f->indexes; i_counters[i] = 1; output_line ("for (i%d = 1; i%d <= %d; i%d++)", i, i, f->occurs_max, i); output_indent (" {"); CB_REFERENCE (c)->subs = cb_cons (cb_i[i], CB_REFERENCE (c)->subs); } if (type == INITIALIZE_ONE) { output_initialize_one (p, c); } else { output_initialize_compound (p, c); } if (f->flag_occurs) { /* Close loop */ CB_REFERENCE (c)->subs = CB_CHAIN (CB_REFERENCE (c)->subs); output_indent (" }"); } } } } static void output_initialize (struct cb_initialize *p) { struct cb_field *f; int c; f = cb_field (p->var); switch (initialize_type (p, f, 1)) { case INITIALIZE_NONE: break; case INITIALIZE_ONE: output_initialize_one (p, p->var); break; case INITIALIZE_EXTERNAL: output_initialize_external (p->var, f); break; case INITIALIZE_DEFAULT: c = initialize_uniform_char (f); if (c != -1) { output_initialize_uniform (p->var, c, f->size); } else { output_initialize_compound (p, p->var); } break; case INITIALIZE_COMPOUND: output_initialize_compound (p, p->var); break; } } /* * SEARCH */ static void output_occurs (struct cb_field *p) { if (p->occurs_depending) { output_integer (p->occurs_depending); } else { output ("%d", p->occurs_max); } } static void output_search_whens (cb_tree table, cb_tree var, cb_tree stmt, cb_tree whens) { cb_tree l; struct cb_field *p; cb_tree idx = NULL; p = cb_field (table); /* Determine the index to use */ if (var) { for (l = p->index_list; l; l = CB_CHAIN (l)) { if (cb_ref (CB_VALUE (l)) == cb_ref (var)) { idx = var; } } } if (!idx) { idx = CB_VALUE (p->index_list); } /* Start loop */ output_line ("while (1)"); output_indent (" {"); /* End test */ output_prefix (); output ("if ("); output_integer (idx); output (" > "); output_occurs (p); output (")\n"); output_indent (" {"); if (stmt) { output_stmt (stmt); } output_line ("break;"); output_indent (" }"); /* WHEN test */ output_stmt (whens); output_line ("else"); output_indent (" {"); output_prefix (); output_integer (idx); output ("++;\n"); if (var && var != idx) { output_move (idx, var); } output_line ("continue;"); output_indent (" }"); output_line ("break;"); output_indent (" }"); } static void output_search_all (cb_tree table, cb_tree stmt, cb_tree cond, cb_tree when) { struct cb_field *p; cb_tree idx; p = cb_field (table); idx = CB_VALUE (p->index_list); /* Header */ output_indent ("{"); output_line ("int ret;"); output_line ("int head = %d - 1;", p->occurs_min); output_prefix (); output ("int tail = "); output_occurs (p); output (" + 1;\n"); /* Start loop */ output_line ("while (1)"); output_indent (" {"); /* End test */ output_line ("if (head >= tail - 1)"); output_indent (" {"); if (stmt) { output_stmt (stmt); } output_line ("break;"); output_indent (" }"); /* Next index */ output_prefix (); output_integer (idx); output (" = (head + tail) / 2;\n"); /* WHEN test */ output_prefix (); output ("if ("); output_cond (cond, 1); output (")\n"); output_indent_level += 2; output_stmt (when); output_indent_level -= 2; output_line ("else"); output_indent (" {"); output_line ("if (ret < 0)"); output_prefix (); output (" head = "); output_integer (idx); output (";\n"); output_line ("else"); output_prefix (); output (" tail = "); output_integer (idx); output (";\n"); output_line ("continue;"); output_indent (" }"); output_line ("break;"); output_indent (" }"); output_indent ("}"); } static void output_search (struct cb_search *p) { if (p->flag_all) { output_search_all (p->table, p->end_stmt, CB_IF (p->whens)->test, CB_IF (p->whens)->stmt1); } else { output_search_whens (p->table, p->var, p->end_stmt, p->whens); } } /* * CALL */ static void output_call (struct cb_call *p) { cb_tree x; cb_tree l; struct cb_literal *lp; char *callp; struct cb_field *f; char *system_call = NULL; struct system_table *psyst; size_t n; size_t parmnum; size_t retptr; int dynamic_link = 1; int sizes; retptr = 0; if (p->returning && CB_TREE_CLASS(p->returning) == CB_CLASS_POINTER) { retptr = 1; } /* System routine entry points */ if (p->is_system) { lp = CB_LITERAL (p->name); psyst = (struct system_table *)&system_tab[0]; for (; psyst->syst_name; psyst++) { if (!strcmp((const char *)lp->data, (const char *)psyst->syst_name)) { system_call = (char *)psyst->syst_call; dynamic_link = 0; break; } } } if (cb_flag_static_call && CB_LITERAL_P (p->name)) { dynamic_link = 0; } /* Local variables */ output_indent ("{"); #ifdef COB_NON_ALIGNED if (dynamic_link && retptr) { output_line ("void *temptr;"); } #endif if (CB_REFERENCE_P (p->name) && CB_FIELD_P (CB_REFERENCE (p->name)->value) && CB_FIELD (CB_REFERENCE (p->name)->value)->usage == CB_USAGE_PROGRAM_POINTER) { dynamic_link = 0; } /* Setup arguments */ for (l = p->args, n = 1; l; l = CB_CHAIN (l), n++) { x = CB_VALUE (l); switch (CB_PURPOSE_INT (l)) { case CB_CALL_BY_REFERENCE: if (CB_NUMERIC_LITERAL_P (x) || CB_BINARY_OP_P (x)) { output_line ("union {"); output_line ("\tunsigned char data[8];"); output_line ("\tlong long datall;"); output_line ("\tint dataint;"); output_line ("} content_%d;", (int)n); } else if (CB_CAST_P (x)) { output_line ("void *ptr_%d;", (int)n); } break; case CB_CALL_BY_CONTENT: if (CB_CAST_P (x)) { output_line ("void *ptr_%d;", (int)n); } else if (CB_TREE_TAG (x) != CB_TAG_INTRINSIC && x != cb_null && !(CB_CAST_P (x))) { output_line ("union {"); output ("\tunsigned char data["); if (CB_NUMERIC_LITERAL_P (x) || CB_BINARY_OP_P (x) || CB_CAST_P(x)) { output ("8"); } else { if (CB_REF_OR_FIELD_P (x)) { output ("%d", (int)cb_field (x)->size); } else { output_size (x); } } output ("];\n"); output_line ("\tlong long datall;"); output_line ("\tint dataint;"); output_line ("} content_%d;", (int)n); } break; } } output ("\n"); for (l = p->args, n = 1; l; l = CB_CHAIN (l), n++) { x = CB_VALUE (l); switch (CB_PURPOSE_INT (l)) { case CB_CALL_BY_REFERENCE: if (CB_NUMERIC_LITERAL_P (x)) { output_prefix (); if (cb_fits_int (x)) { output ("content_%d.dataint = ", (int)n); output ("%d", cb_get_int (x)); } else { output ("content_%d.datall = ", (int)n); output ("%lldLL", cb_get_long_long (x)); } output (";\n"); } else if (CB_BINARY_OP_P (x)) { output_prefix (); output ("content_%d.dataint = ", (int)n); output_integer (x); output (";\n"); } else if (CB_CAST_P (x)) { output_prefix (); output ("ptr_%d = ", (int)n); output_integer (x); output (";\n"); } break; case CB_CALL_BY_CONTENT: if (CB_CAST_P (x)) { output_prefix (); output ("ptr_%d = ", (int)n); output_integer (x); output (";\n"); } else if (CB_TREE_TAG (x) != CB_TAG_INTRINSIC) { if (CB_NUMERIC_LITERAL_P (x)) { output_prefix (); if (cb_fits_int (x)) { output ("content_%d.dataint = ", (int)n); output ("%d", cb_get_int (x)); } else { output ("content_%d.datall = ", (int)n); output ("%lldLL", cb_get_long_long (x)); } output (";\n"); } else if (CB_REF_OR_FIELD_P (x) && CB_TREE_CATEGORY (x) == CB_CATEGORY_NUMERIC && cb_field (x)->usage == CB_USAGE_LENGTH) { output_prefix (); output ("content_%d.dataint = ", (int)n); output_integer (x); output (";\n"); } else if (x != cb_null && !(CB_CAST_P (x))) { output_prefix (); output ("memcpy (content_%d.data, ", (int)n); output_data (x); output (", "); output_size (x); output (");\n"); } } break; } } /* Function name */ n = 0; for (l = p->args; l; l = CB_CHAIN (l), n++) { x = CB_VALUE (l); field_iteration = (int) n; output_prefix (); output ("module.cob_procedure_parameters[%d] = ", (int)n); switch (CB_TREE_TAG (x)) { case CB_TAG_LITERAL: case CB_TAG_FIELD: case CB_TAG_INTRINSIC: output_param (x, -1); break; case CB_TAG_REFERENCE: switch (CB_TREE_TAG (CB_REFERENCE(x)->value)) { case CB_TAG_LITERAL: case CB_TAG_FIELD: case CB_TAG_INTRINSIC: output_param (x, -1); break; default: output ("NULL"); break; } break; default: output ("NULL"); break; } output (";\n"); } for (parmnum = n; parmnum < n + 4; parmnum++) { output_line ("module.cob_procedure_parameters[%d] = NULL;", (int)parmnum); } parmnum = n; output_prefix (); output ("cob_call_params = %d;\n", (int)n); output_prefix (); if (!dynamic_link) { if (CB_REFERENCE_P (p->name) && CB_FIELD_P (CB_REFERENCE (p->name)->value) && CB_FIELD (CB_REFERENCE (p->name)->value)->usage == CB_USAGE_PROGRAM_POINTER) { output ("cob_unifunc.func_void = "); output_integer (p->name); output (";\n"); output_prefix (); if (retptr) { #ifdef COB_NON_ALIGNED output ("temptr"); #else output_integer (p->returning); #endif output (" = cob_unifunc.funcptr"); } else { output_integer (current_prog->cb_return_code); output (" = cob_unifunc.funcint"); } } else { /* Static link */ if (retptr) { #ifdef COB_NON_ALIGNED output ("temptr"); #else output_integer (p->returning); #endif } else { output_integer (current_prog->cb_return_code); } output (" = "); if (retptr) { output ("(void *)"); } if (system_call) { output ("%s", system_call); } else { output ("%s", cb_encode_program_id ((char *)(CB_LITERAL (p->name)->data))); } } } else { /* Dynamic link */ if (CB_LITERAL_P (p->name)) { callp = cb_encode_program_id ((char *)(CB_LITERAL (p->name)->data)); lookup_call (callp); output ("if (unlikely(call_%s.func_void == NULL)) {\n", callp); output_prefix (); output (" call_%s.func_void = ", callp); if (!p->stmt1) { output ("cob_resolve_1 ((const char *)\"%s\");\n", (char *)(CB_LITERAL (p->name)->data)); } else { output ("cob_resolve ((const char *)\"%s\");\n", (char *)(CB_LITERAL (p->name)->data)); } output_prefix (); output ("}\n"); } else { callp = NULL; output ("cob_unifunc.func_void = "); if (!p->stmt1) { output_funcall (cb_build_funcall_1 ( "cob_call_resolve_1", p->name)); } else { output_funcall (cb_build_funcall_1 ( "cob_call_resolve", p->name)); } output (";\n"); } if (p->stmt1) { if (callp) { output_line ("if (unlikely(call_%s.func_void == NULL))", callp); } else { output_line ("if (unlikely(cob_unifunc.func_void == NULL))"); } output_indent_level += 2; output_stmt (p->stmt1); output_indent_level -= 2; output_line ("else"); output_indent (" {"); } output_prefix (); if (retptr) { #ifdef COB_NON_ALIGNED output ("temptr"); #else output_integer (p->returning); #endif if (callp) { output (" = call_%s.funcptr", callp); } else { output (" = cob_unifunc.funcptr"); } } else { output_integer (current_prog->cb_return_code); if (callp) { output (" = call_%s.funcint", callp); } else { output (" = cob_unifunc.funcint"); } } } /* Arguments */ output (" ("); for (l = p->args, n = 1; l; l = CB_CHAIN (l), n++) { x = CB_VALUE (l); switch (CB_PURPOSE_INT (l)) { case CB_CALL_BY_REFERENCE: if (CB_NUMERIC_LITERAL_P (x) || CB_BINARY_OP_P (x)) { output ("content_%d.data", (int)n); } else if (CB_REFERENCE_P (x) && CB_FILE_P (cb_ref (x))) { output_param (cb_ref (x), -1); } else if (CB_CAST_P (x)) { output ("&ptr_%d", (int)n); } else { output_data (x); } break; case CB_CALL_BY_CONTENT: if (CB_TREE_TAG (x) != CB_TAG_INTRINSIC && x != cb_null) { if (CB_CAST_P (x)) { output ("&ptr_%d", (int)n); } else { output ("content_%d.data", (int)n); } } else { output_data (x); } break; case CB_CALL_BY_VALUE: if (CB_TREE_TAG (x) != CB_TAG_INTRINSIC) { switch (CB_TREE_TAG (x)) { case CB_TAG_CAST: output_integer (x); break; case CB_TAG_LITERAL: if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { output ("%d", cb_get_int (x)); } else { output ("%d", CB_LITERAL (x)->data[0]); } break; default: /* RXWRXW if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { output_integer (x); } else { output ("*("); output_data (x); output (")"); } */ f = cb_field (x); switch (f->usage) { case CB_USAGE_BINARY: case CB_USAGE_COMP_5: case CB_USAGE_COMP_X: /* RXWRXW */ case CB_USAGE_PACKED: case CB_USAGE_DISPLAY: sizes = CB_SIZES_INT (l); if (sizes == CB_SIZE_AUTO) { if (f->pic->have_sign) { output ("(unsigned "); } else { output ("("); } if (f->usage == CB_USAGE_PACKED || f->usage == CB_USAGE_DISPLAY) { sizes = f->pic->digits - f->pic->scale; } else { sizes = f->size; } switch (sizes) { case 0: sizes = CB_SIZE_4; break; case 1: sizes = CB_SIZE_1; break; case 2: sizes = CB_SIZE_2; break; case 3: sizes = CB_SIZE_4; break; case 4: sizes = CB_SIZE_4; break; case 5: sizes = CB_SIZE_8; break; case 6: sizes = CB_SIZE_8; break; case 7: sizes = CB_SIZE_8; break; default: sizes = CB_SIZE_8; break; } } else { if (CB_SIZES_INT_UNSIGNED(l)) { output ("(unsigned "); } else { output ("("); } } switch (sizes) { case CB_SIZE_1: output ("char"); break; case CB_SIZE_2: output ("short"); break; case CB_SIZE_4: output ("int"); break; case CB_SIZE_8: output ("long long"); break; default: output ("int"); break; } output (")("); output_integer (x); output (")"); break; case CB_USAGE_INDEX: case CB_USAGE_LENGTH: case CB_USAGE_POINTER: case CB_USAGE_PROGRAM_POINTER: output_integer (x); break; default: output ("*("); output_data (x); output (")"); break; } break; } } else { output_data (x); } break; } if (CB_CHAIN (l)) { output (", "); } } if (!system_call) { if (cb_sticky_linkage || cb_flag_null_param) { for (n = 0; n < 4; n++) { if (n != 0 || parmnum != 0) { output (", "); } output ("NULL"); } } } output (");\n"); if (p->returning) { if (!retptr) { /* suppress warnings */ suppress_warn = 1; output_stmt (cb_build_move (current_prog->cb_return_code, p->returning)); suppress_warn = 0; #ifdef COB_NON_ALIGNED } else { output_prefix (); output ("memcpy ("); output_data (p->returning); output (", &temptr, %d);\n", sizeof (void *)); #endif } } if (p->stmt2) { output_stmt (p->stmt2); } if (dynamic_link && p->stmt1) { output_indent (" }"); } output_indent ("}"); } /* * GO TO */ static void output_goto_1 (cb_tree x) { output_line ("goto %s%d;", CB_PREFIX_LABEL, CB_LABEL (cb_ref (x))->id); } static void output_goto (struct cb_goto *p) { cb_tree l; int i = 1; if (p->depending) { output_prefix (); output ("switch ("); output_param (cb_build_cast_integer (p->depending), 0); output (")\n"); output_indent (" {"); for (l = p->target; l; l = CB_CHAIN (l)) { output_indent_level -= 2; output_line ("case %d:", i++); output_indent_level += 2; output_goto_1 (CB_VALUE (l)); } output_indent (" }"); } else if (p->target == NULL) { needs_exit_prog = 1; if (cb_flag_implicit_init) { output_line ("goto exit_program;"); } else { output_line ("if (module.next)"); output_line (" goto exit_program;"); } } else if (p->target == cb_int1) { needs_exit_prog = 1; output_line ("goto exit_program;"); } else { output_goto_1 (p->target); } } /* * PERFORM */ static void output_perform_call (struct cb_label *lb, struct cb_label *le) { #ifndef __GNUC__ struct label_list *l; #endif if (lb == le) { output_line ("/* PERFORM %s */", lb->name); } else { output_line ("/* PERFORM %s THRU %s */", lb->name, le->name); } output_line ("frame_ptr++;"); if (cb_flag_stack_check) { output_line ("if (unlikely(frame_ptr == frame_overflow))"); output_line (" cob_fatal_error (COB_FERROR_STACK);"); } output_line ("frame_ptr->perform_through = %d;", le->id); #ifndef __GNUC__ l = cobc_malloc (sizeof (struct label_list)); l->next = label_cache; l->id = cb_id; if (label_cache == NULL) { l->call_num = 0; } else { l->call_num = label_cache->call_num + 1; } label_cache = l; output_line ("frame_ptr->return_address = %d;", l->call_num); output_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id); output_line ("%s%d:", CB_PREFIX_LABEL, cb_id); #elif COB_USE_SETJMP output_line ("if (setjmp (frame_ptr->return_address) == 0)"); output_line (" goto %s%d;", CB_PREFIX_LABEL, lb->id); #else output_line ("frame_ptr->return_address = &&%s%d;", CB_PREFIX_LABEL, cb_id); output_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id); output_line ("%s%d:", CB_PREFIX_LABEL, cb_id); #endif cb_id++; output_line ("frame_ptr--;"); } static void output_perform_exit (struct cb_label *l) { if (l->is_global) { output_newline (); output_line ("if (entry == %d) {", l->id); if (cb_flag_traceall) { output_line (" cob_reset_trace ();"); } /* Fixme - Check module push/pop */ output_line (" cob_current_module = cob_current_module->next;"); output_line (" return 0;"); output_line ("}"); } output_newline (); output_line ("if (frame_ptr->perform_through == %d)", l->id); #ifndef __GNUC__ output_line (" goto P_switch;"); #elif COB_USE_SETJMP output_line (" longjmp (frame_ptr->return_address, 1);"); #else output_line (" goto *frame_ptr->return_address;"); #endif if (cb_perform_osvs) { output_line ("for (temp_index = frame_ptr - 1; temp_index->perform_through; temp_index--) {"); output_line (" if (temp_index->perform_through == %d) {", l->id); output_line (" frame_ptr = temp_index;"); #ifndef __GNUC__ output_line (" goto P_switch;"); #elif COB_USE_SETJMP output_line (" longjmp (frame_ptr->return_address, 1);"); #else output_line (" goto *frame_ptr->return_address;"); #endif output_line (" }"); output_line ("}"); } } static void output_perform_once (struct cb_perform *p) { if (p->body && CB_PAIR_P (p->body)) { output_perform_call (CB_LABEL (cb_ref (CB_PAIR_X (p->body))), CB_LABEL (cb_ref (CB_PAIR_Y (p->body)))); } else { output_stmt (p->body); } if (p->cycle_label) { output_stmt (cb_ref (p->cycle_label)); } } static void output_perform_until (struct cb_perform *p, cb_tree l) { struct cb_perform_varying *v; cb_tree next; if (l == NULL) { /* Perform body at the end */ output_perform_once (p); return; } v = CB_PERFORM_VARYING (CB_VALUE (l)); next = CB_CHAIN (l); output_line ("while (1)"); output_indent (" {"); if (next && CB_PERFORM_VARYING (CB_VALUE (next))->name) { output_move (CB_PERFORM_VARYING (CB_VALUE (next))->from, CB_PERFORM_VARYING (CB_VALUE (next))->name); } if (p->test == CB_AFTER) { output_perform_until (p, next); } output_prefix (); output ("if ("); output_cond (v->until, 0); output (")\n"); output_line (" break;"); if (p->test == CB_BEFORE) { output_perform_until (p, next); } if (v->step) { output_stmt (v->step); } output_indent (" }"); } static void output_perform (struct cb_perform *p) { struct cb_perform_varying *v; switch (p->type) { case CB_PERFORM_EXIT: if (CB_LABEL (p->data)->need_return) { output_perform_exit (CB_LABEL (p->data)); } break; case CB_PERFORM_ONCE: output_perform_once (p); break; case CB_PERFORM_TIMES: output_prefix (); output ("for (n%d = ", loop_counter); output_param (cb_build_cast_integer (p->data), 0); output ("; n%d > 0; n%d--)\n", loop_counter, loop_counter); loop_counter++; output_indent (" {"); output_perform_once (p); output_indent (" }"); break; case CB_PERFORM_UNTIL: v = CB_PERFORM_VARYING (CB_VALUE (p->varying)); if (v->name) { output_move (v->from, v->name); } output_perform_until (p, p->varying); break; case CB_PERFORM_FOREVER: output_prefix (); output ("while (1)\n"); output_indent (" {"); output_perform_once (p); output_indent (" }"); break; } if (p->exit_label) { output_stmt (cb_ref (p->exit_label)); } } static void output_file_error (struct cb_file *pfile) { struct cb_file *fl; cb_tree l; for (l = current_prog->local_file_list; l; l = CB_CHAIN (l)) { fl = CB_FILE(CB_VALUE (l)); if (!strcmp (pfile->name, fl->name)) { output_perform_call (fl->handler, fl->handler); return; } } for (l = current_prog->global_file_list; l; l = CB_CHAIN (l)) { fl = CB_FILE(CB_VALUE (l)); if (!strcmp (pfile->name, fl->name)) { if (fl->handler_prog == current_prog) { output_perform_call (fl->handler, fl->handler); } else { if (cb_flag_traceall) { output_line ("cob_reset_trace ();"); } output_line ("%s_ (%d);", fl->handler_prog->program_id, fl->handler->id); if (cb_flag_traceall) { output_line ("cob_ready_trace ();"); } } return; } } output_perform_call (pfile->handler, pfile->handler); } /* * Output statement */ static void output_ferror_stmt (struct cb_statement *p, int code) { output_line ("if (unlikely(cob_exception_code != 0))"); output_indent (" {"); if (p->handler1) { if ((code & 0x00ff) == 0) { output_line ("if ((cob_exception_code & 0xff00) == 0x%04x)", code); } else { output_line ("if (cob_exception_code == 0x%04x)", code); } output_indent (" {"); output_stmt (p->handler1); output_indent (" }"); output_line ("else"); output_indent (" {"); } output_file_error (CB_FILE (p->file)); output_indent (" }"); if (p->handler1) { output_indent (" }"); } if (p->handler2 || p->handler3) { output_line ("else"); output_indent (" {"); if (p->handler3) { output_stmt (p->handler3); } if (p->handler2) { output_stmt (p->handler2); } output_indent (" }"); } } static void output_stmt (cb_tree x) { struct cb_statement *p; struct cb_label *lp; struct cb_assign *ap; struct cb_if *ip; #ifdef COB_NON_ALIGNED struct cb_cast *cp; #endif int code; stack_id = 0; if (x == NULL) { output_line (";"); return; } #ifndef __GNUC__ if (inside_check != 0) { if (inside_stack[inside_check - 1] != 0) { inside_stack[inside_check -1] = 0; output (",\n"); } } #endif switch (CB_TREE_TAG (x)) { case CB_TAG_STATEMENT: p = CB_STATEMENT (x); /* Output source location as a comment */ if (p->name) { output_line ("/* %s:%d: %s */", x->source_file, x->source_line, p->name); } /* Output source location as a code */ if (x->source_file && last_line != x->source_line) { if (cb_flag_source_location) { output_prefix (); output ("cob_set_location (\"%s\", \"%s\", %d, ", excp_current_program_id, x->source_file, x->source_line); if (excp_current_section) { output ("\"%s\", ", excp_current_section); } else { output ("NULL, "); } if (excp_current_paragraph) { output ("\"%s\", ", excp_current_paragraph); } else { output ("NULL, "); } if (p->name) { output ("\"%s\");\n", p->name); } else { output ("NULL);\n"); } } last_line = x->source_line; } if (p->handler1 || p->handler2 || (p->file && CB_EXCEPTION_ENABLE (COB_EC_I_O))) { output_line ("cob_exception_code = 0;"); } if (p->null_check) { output_stmt (p->null_check); } if (p->body) { output_stmt (p->body); } if (p->handler1 || p->handler2 || (p->file && CB_EXCEPTION_ENABLE (COB_EC_I_O))) { code = CB_EXCEPTION_CODE (p->handler_id); if (p->file) { output_ferror_stmt (p, code); } else { if (p->handler1) { if ((code & 0x00ff) == 0) { output_line ("if (unlikely((cob_exception_code & 0xff00) == 0x%04x))", code); } else { output_line ("if (unlikely(cob_exception_code == 0x%04x))", code); } output_indent (" {"); output_stmt (p->handler1); output_indent (" }"); if (p->handler2) { output_line ("else"); } } if (p->handler2) { if (p->handler1 == NULL) { output_line ("if (!cob_exception_code)"); } output_indent (" {"); output_stmt (p->handler2); output_indent (" }"); } } } break; case CB_TAG_LABEL: lp = CB_LABEL (x); output_newline (); if (lp->is_section) { if (strcmp ((const char *)(lp->name) , "MAIN SECTION")) { output_line ("/* %s SECTION */", lp->name); } else { output_line ("/* %s */", lp->name); } excp_current_section = (const char *)lp->name; excp_current_paragraph = NULL; } else { if (lp->is_entry) { output_line ("/* Entry %s */", lp->orig_name); } else { output_line ("/* %s */", lp->name); } excp_current_paragraph = (const char *)lp->name; if (!lp->need_begin) { output_newline (); } } if (lp->need_begin) { output_newline (); output_line ("%s%d:;", CB_PREFIX_LABEL, lp->id); } if (cb_flag_trace) { if (lp->is_section) { if (strcmp ((const char *)(lp->name) , "MAIN SECTION")) { output_line ("fputs (\"PROGRAM-ID: %s: %s SECTION\\n\", stderr);", excp_current_program_id, lp->orig_name); } else { output_line ("fputs (\"PROGRAM-ID: %s: %s\\n\", stderr);", excp_current_program_id, lp->orig_name); } } else if (lp->is_entry) { output_line ("fputs (\"PROGRAM-ID: %s: ENTRY %s\\n\", stderr);", excp_current_program_id, lp->orig_name); } else { output_line ("fputs (\"PROGRAM-ID: %s: %s\\n\", stderr);", excp_current_program_id, lp->orig_name); } output_line ("fflush (stderr);"); } break; case CB_TAG_FUNCALL: output_prefix (); output_funcall (x); #ifdef __GNUC__ output (";\n"); #else if (inside_check == 0) { output (";\n"); } else { inside_stack[inside_check -1] = 1; } #endif break; case CB_TAG_ASSIGN: ap = CB_ASSIGN (x); #ifdef COB_NON_ALIGNED /* Nonaligned */ if (CB_TREE_CLASS (ap->var) == CB_CLASS_POINTER || CB_TREE_CLASS (ap->val) == CB_CLASS_POINTER) { /* Pointer assignment */ output_indent ("{"); output_line ("void *temp_ptr;"); /* temp_ptr = source address; */ output_prefix (); if (ap->val == cb_null || ap->val == cb_zero) { /* MOVE NULL ... */ output ("temp_ptr = 0;\n"); } else if (CB_TREE_TAG (ap->val) == CB_TAG_CAST) { /* MOVE ADDRESS OF val ... */ cp = CB_CAST (ap->val); output ("temp_ptr = "); switch (cp->type) { case CB_CAST_ADDRESS: output_data (cp->val); break; case CB_CAST_PROGRAM_POINTER: output_func_1 ("cob_call_resolve", ap->val); break; default: fprintf (stderr, "Unexpected cast type %d\n", cp->type); ABORT (); } output (";\n"); } else { /* MOVE val ... */ output ("memcpy(&temp_ptr, "); output_data (ap->val); output (", sizeof(temp_ptr));\n"); } /* destination address = temp_ptr; */ output_prefix (); if (CB_TREE_TAG (ap->var) == CB_TAG_CAST) { /* SET ADDRESS OF var ... */ cp = CB_CAST (ap->var); if (cp->type != CB_CAST_ADDRESS) { fprintf (stderr, "Unexpected tree type %d\n", cp->type); ABORT (); } output_data (cp->val); output (" = temp_ptr;\n"); } else { /* MOVE ... TO var */ output ("memcpy("); output_data (ap->var); output (", &temp_ptr, sizeof(temp_ptr));\n"); } output_indent ("}"); } else { /* Numeric assignment */ output_prefix (); output_integer (ap->var); output (" = "); output_integer (ap->val); #ifdef __GNUC__ output (";\n"); #else if (inside_check == 0) { output (";\n"); } else { inside_stack[inside_check -1] = 1; } #endif } #else /* Nonaligned */ output_prefix (); output_integer (ap->var); output (" = "); output_integer (ap->val); #ifdef __GNUC__ output (";\n"); #else if (inside_check == 0) { output (";\n"); } else { inside_stack[inside_check -1] = 1; } #endif #endif /* Nonaligned */ break; case CB_TAG_INITIALIZE: output_initialize (CB_INITIALIZE (x)); break; case CB_TAG_SEARCH: output_search (CB_SEARCH (x)); break; case CB_TAG_CALL: output_call (CB_CALL (x)); break; case CB_TAG_GOTO: output_goto (CB_GOTO (x)); break; case CB_TAG_IF: ip = CB_IF (x); output_prefix (); output ("if ("); output_cond (ip->test, 0); output (")\n"); if (ip->stmt1) { output_indent_level += 2; output_stmt (ip->stmt1); output_indent_level -= 2; } else { output_line (" /* nothing */;"); } if (ip->stmt2) { output_line ("else"); output_indent_level += 2; output_stmt (ip->stmt2); output_indent_level -= 2; } break; case CB_TAG_PERFORM: output_perform (CB_PERFORM (x)); break; case CB_TAG_CONTINUE: output_prefix (); output (";\n"); break; case CB_TAG_LIST: output_indent ("{"); for (; x; x = CB_CHAIN (x)) { output_stmt (CB_VALUE (x)); } output_indent ("}"); break; default: fprintf (stderr, "Unexpected tree tag %d\n", CB_TREE_TAG (x)); ABORT (); } } /* * File definition */ static int output_file_allocation (struct cb_file *f) { if (f->global) { output_storage ("/* Global file %s */\n", f->name); } else { output_local ("/* File %s */\n", f->name); } /* Output RELATIVE/RECORD KEY's */ if (f->organization == COB_ORG_RELATIVE || f->organization == COB_ORG_INDEXED) { if (f->global) { output_storage ("static struct cob_file_key\t*%s%s = NULL;\n", CB_PREFIX_KEYS, f->cname); } else { output_local ("static struct cob_file_key\t*%s%s = NULL;\n", CB_PREFIX_KEYS, f->cname); } } if (f->global) { output_storage ("static cob_file\t\t*%s%s = NULL;\n", CB_PREFIX_FILE, f->cname); output_storage ("static unsigned char\t%s%s_status[4];\n", CB_PREFIX_FILE, f->cname); } else { output_local ("static cob_file\t\t*%s%s = NULL;\n", CB_PREFIX_FILE, f->cname); output_local ("static unsigned char\t%s%s_status[4];\n", CB_PREFIX_FILE, f->cname); } if (f->linage) { return 1; } return 0; } static void output_file_initialization (struct cb_file *f) { int nkeys = 1; struct cb_alt_key *l; if (f->external) { output_line ("%s%s = (cob_file *)cob_external_addr (\"%s\", sizeof(cob_file));", CB_PREFIX_FILE, f->cname, f->cname); output_line ("if (cob_initial_external)"); output_indent ("{"); if (f->linage) { output_line ("%s%s->linorkeyptr = cob_malloc (sizeof(struct linage_struct));", CB_PREFIX_FILE, f->cname); } } else { output_line ("if (!%s%s)", CB_PREFIX_FILE, f->cname); output_indent ("{"); output_line ("%s%s = cob_malloc (sizeof(cob_file));", CB_PREFIX_FILE, f->cname); if (f->linage) { output_line ("%s%s->linorkeyptr = cob_malloc (sizeof(struct linage_struct));", CB_PREFIX_FILE, f->cname); } output_indent ("}"); } /* Output RELATIVE/RECORD KEY's */ if (f->organization == COB_ORG_RELATIVE || f->organization == COB_ORG_INDEXED) { for (l = f->alt_key_list; l; l = l->next) { nkeys++; } output_line ("if (!%s%s)", CB_PREFIX_KEYS, f->cname); output_indent ("{"); output_line ("%s%s = cob_malloc (sizeof (struct cob_file_key) * %d);", CB_PREFIX_KEYS, f->cname, nkeys); output_indent ("}"); nkeys = 1; output_prefix (); output ("%s%s->field = ", CB_PREFIX_KEYS, f->cname); output_param (f->key, -1); output (";\n"); output_prefix (); output ("%s%s->flag = 0;\n", CB_PREFIX_KEYS, f->cname); output_prefix (); if (f->key) { output ("%s%s->offset = %d;\n", CB_PREFIX_KEYS, f->cname, cb_field (f->key)->offset); } else { output ("%s%s->offset = 0;\n", CB_PREFIX_KEYS, f->cname); } for (l = f->alt_key_list; l; l = l->next) { output_prefix (); output ("(%s%s + %d)->field = ", CB_PREFIX_KEYS, f->cname, nkeys); output_param (l->key, -1); output (";\n"); output_prefix (); output ("(%s%s + %d)->flag = %d;\n", CB_PREFIX_KEYS, f->cname, nkeys, l->duplicates); output_prefix (); output ("(%s%s + %d)->offset = %d;\n", CB_PREFIX_KEYS, f->cname, nkeys, cb_field (l->key)->offset); nkeys++; } } output_line ("%s%s->select_name = (const char *)\"%s\";", CB_PREFIX_FILE, f->cname, f->name); if (f->external && !f->file_status) { output_line ("%s%s->file_status = cob_external_addr (\"%s%s_status\", 4);", CB_PREFIX_FILE, f->cname, CB_PREFIX_FILE, f->cname); } else { output_line ("%s%s->file_status = %s%s_status;", CB_PREFIX_FILE, f->cname, CB_PREFIX_FILE, f->cname); output_line ("memset (%s%s_status, '0', 2);", CB_PREFIX_FILE, f->cname); } output_prefix (); output ("%s%s->assign = ", CB_PREFIX_FILE, f->cname); if (f->special) { output ("NULL"); } else { output_param (f->assign, -1); } output (";\n"); output_prefix (); output ("%s%s->record = ", CB_PREFIX_FILE, f->cname); output_param (CB_TREE (f->record), -1); output (";\n"); output_prefix (); output ("%s%s->record_size = ", CB_PREFIX_FILE, f->cname); if (f->record_depending) { output_param (f->record_depending, -1); } else { output ("NULL"); } output (";\n"); output_line ("%s%s->record_min = %d;", CB_PREFIX_FILE, f->cname, f->record_min); output_line ("%s%s->record_max = %d;", CB_PREFIX_FILE, f->cname, f->record_max); if (f->organization == COB_ORG_RELATIVE || f->organization == COB_ORG_INDEXED) { output_line ("%s%s->nkeys = %d;", CB_PREFIX_FILE, f->cname, nkeys); output_line ("%s%s->keys = %s%s;", CB_PREFIX_FILE, f->cname, CB_PREFIX_KEYS, f->cname); } else { output_line ("%s%s->nkeys = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->keys = NULL;", CB_PREFIX_FILE, f->cname); } output_line ("%s%s->file = NULL;", CB_PREFIX_FILE, f->cname); if (f->linage) { output_line ("lingptr = (struct linage_struct *)(%s%s->linorkeyptr);", CB_PREFIX_FILE, f->cname); output_prefix (); output ("lingptr->linage = "); output_param (f->linage, -1); output (";\n"); output_prefix (); output ("lingptr->linage_ctr = "); output_param (f->linage_ctr, -1); output (";\n"); if (f->latfoot) { output_prefix (); output ("lingptr->latfoot = "); output_param (f->latfoot, -1); output (";\n"); } else { output_line ("lingptr->latfoot = NULL;"); } if (f->lattop) { output_prefix (); output ("lingptr->lattop = "); output_param (f->lattop, -1); output (";\n"); } else { output_line ("lingptr->lattop = NULL;"); } if (f->latbot) { output_prefix (); output ("lingptr->latbot = "); output_param (f->latbot, -1); output (";\n"); } else { output_line ("lingptr->latbot = NULL;"); } output_line ("lingptr->lin_lines = 0;"); output_line ("lingptr->lin_foot = 0;"); output_line ("lingptr->lin_top = 0;"); output_line ("lingptr->lin_bot = 0;"); } output_line ("%s%s->organization = %d;", CB_PREFIX_FILE, f->cname, f->organization); output_line ("%s%s->access_mode = %d;", CB_PREFIX_FILE, f->cname, f->access_mode); output_line ("%s%s->lock_mode = %d;", CB_PREFIX_FILE, f->cname, f->lock_mode); output_line ("%s%s->open_mode = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_optional = %d;", CB_PREFIX_FILE, f->cname, f->optional); output_line ("%s%s->last_open_mode = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->special = %d;", CB_PREFIX_FILE, f->cname, f->special); output_line ("%s%s->flag_nonexistent = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_end_of_file = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_begin_of_file = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_first_read = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_read_done = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_select_features = %d;", CB_PREFIX_FILE, f->cname, ((f->file_status ? COB_SELECT_FILE_STATUS : 0) | (f->linage ? COB_SELECT_LINAGE : 0) | (f->external_assign ? COB_SELECT_EXTERNAL : 0))); output_line ("%s%s->flag_needs_nl = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->flag_needs_top = 0;", CB_PREFIX_FILE, f->cname); output_line ("%s%s->file_version = %d;", CB_PREFIX_FILE, f->cname, COB_FILE_VERSION); if (f->external) { output_indent ("}"); } } /* * Screen definition */ static void output_screen_definition (struct cb_field *p) { int type; if (p->sister) { output_screen_definition (p->sister); } if (p->children) { output_screen_definition (p->children); } type = (p->children ? COB_SCREEN_TYPE_GROUP : p->values ? COB_SCREEN_TYPE_VALUE : (p->size > 0) ? COB_SCREEN_TYPE_FIELD : COB_SCREEN_TYPE_ATTRIBUTE); output ("static cob_screen s_%d = {", p->id); if (p->sister) { output ("&s_%d, ", p->sister->id); } else { output ("NULL, "); } if (type == COB_SCREEN_TYPE_GROUP) { output ("&s_%d, ", p->children->id); } else { output ("NULL, "); } if (type == COB_SCREEN_TYPE_FIELD) { p->count++; output_param (cb_build_field_reference (p, NULL), -1); output (", "); } else { output ("NULL, "); } if (type == COB_SCREEN_TYPE_VALUE) { output_param (CB_VALUE(p->values), p->id); output (", "); } else { output ("NULL, "); } if (p->screen_line) { output_param (p->screen_line, 0); output (", "); } else { output ("NULL, "); } if (p->screen_column) { output_param (p->screen_column, 0); output (", "); } else { output ("NULL, "); } if (p->screen_foreg) { output_param (p->screen_foreg, 0); output (", "); } else { output ("NULL, "); } if (p->screen_backg) { output_param (p->screen_backg, 0); output (", "); } else { output ("NULL, "); } output ("%d, %d, %d};\n", type, p->occurs_min, p->screen_flag); } /* * Alphabet-name */ static int literal_value (cb_tree x) { if (x == cb_space) { return ' '; } else if (x == cb_zero) { return '0'; } else if (x == cb_quote) { return '"'; } else if (x == cb_norm_low) { return 0; } else if (x == cb_norm_high) { return 255; } else if (x == cb_null) { return 0; } else if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { return cb_get_int (x) - 1; } else { return CB_LITERAL (x)->data[0]; } } static void output_alphabet_name_definition (struct cb_alphabet_name *p) { cb_tree l; cb_tree ls; cb_tree x; unsigned char *data; int i; int n = 0; int size; int upper; int lower; int table[256]; /* Reset to -1 */ for (i = 0; i < 256; i++) { table[i] = -1; } for (l = p->custom_list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (CB_PAIR_P (x)) { /* X THRU Y */ lower = literal_value (CB_PAIR_X (x)); upper = literal_value (CB_PAIR_Y (x)); if (lower <= upper) { for (i = lower; i <= upper; i++) { table[i] = n++; } } else { for (i = upper; i >= lower; i--) { table[i] = n++; } } } else if (CB_LIST_P (x)) { /* X ALSO Y ... */ for (ls = x; ls; ls = CB_CHAIN (ls)) { table[literal_value (CB_VALUE (ls))] = n; } n++; } else { /* Literal */ if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { table[literal_value (x)] = n++; } else if (CB_LITERAL_P (x)) { size = (int)CB_LITERAL (x)->size; data = CB_LITERAL (x)->data; for (i = 0; i < size; i++) { table[data[i]] = n++; } } else { table[literal_value (x)] = n++; } } } /* Fill the rest of characters */ for (i = 0; i < 256; i++) { if (table[i] == -1) { table[i] = n++; } } /* Output the table */ output_local ("static const unsigned char %s%s[256] = {\n", CB_PREFIX_SEQUENCE, p->cname); for (i = 0; i < 256; i++) { if (i == 255) { output_local (" %d", table[i]); } else { output_local (" %d,", table[i]); } if (i % 16 == 15) { output_local ("\n"); } } output_local ("};\n"); i = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); output_local ("static cob_field f_%s = { 256, (unsigned char *)%s%s, &%s%d };\n", p->cname, CB_PREFIX_SEQUENCE, p->cname, CB_PREFIX_ATTR, i); output_local ("\n"); } /* * Class definition */ static void output_class_name_definition (struct cb_class_name *p) { cb_tree l; cb_tree x; unsigned char *data; size_t i; size_t size; int lower; int upper; output_line ("static int"); output_line ("%s (cob_field *f)", p->cname); output_indent ("{"); output_line ("int i;"); output_line ("for (i = 0; i < f->size; i++)"); output_prefix (); output (" if (!( "); for (l = p->list; l; l = CB_CHAIN (l)) { x = CB_VALUE (l); if (CB_PAIR_P (x)) { lower = literal_value (CB_PAIR_X (x)); upper = literal_value (CB_PAIR_Y (x)); if (!lower) { output ("f->data[i] <= %d", upper); } else { output ("(%d <= f->data[i] && f->data[i] <= %d)", lower, upper); } } else { if (CB_TREE_CLASS (x) == CB_CLASS_NUMERIC) { output ("f->data[i] == %d", literal_value(x)); } else if (x == cb_space) { output ("f->data[i] == %d", ' '); } else if (x == cb_zero) { output ("f->data[i] == %d", '0'); } else if (x == cb_quote) { output ("f->data[i] == %d", '"'); } else if (x == cb_null) { output ("f->data[i] == 0"); } else { size = CB_LITERAL (x)->size; data = CB_LITERAL (x)->data; for (i = 0; i < size; i++) { output ("f->data[i] == %d", data[i]); if (i + 1 < size) { output (" || "); } } } } if (CB_CHAIN (l)) { output ("\n"); output_prefix (); output (" || "); } } output (" ))\n"); output_line (" return 0;"); output_line ("return 1;"); output_indent ("}"); output_newline (); } static void output_initial_values (struct cb_field *p) { cb_tree x; cb_tree def; def = cb_auto_initialize ? cb_true : NULL; for (; p; p = p->sister) { x = cb_build_field_reference (p, NULL); if (p->flag_item_based) { continue; } /* For special registers */ if (p->flag_no_init && !p->count) { continue; } output_stmt (cb_build_initialize (x, cb_true, NULL, def, 0)); } } static void output_internal_function (struct cb_program *prog, cb_tree parameter_list) { cb_tree l; cb_tree l2; struct cb_field *f; struct cb_field *ff; struct field_list *k; struct local_list *locptr; struct cb_file *fl; char *p; struct handler_struct *hstr; #ifndef __GNUC__ struct label_list *pl; #endif int i; int n; int parmnum = 0; int seen = 0; int anyseen; char name[COB_MINI_BUFF]; /* Program function */ output ("static int\n%s_ (const int entry", prog->program_id); if (!prog->flag_chained) { for (l = parameter_list; l; l = CB_CHAIN (l)) { output (", unsigned char *%s%d", CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id); parmnum++; } } output (")\n"); output_indent ("{"); /* Local variables */ output_line ("/* Local variables */"); output_line ("#include \"%s\"", prog->local_storage_name); output_newline (); /* Alphabet-names */ if (prog->alphabet_name_list) { output_local ("/* Alphabet names */\n"); for (l = prog->alphabet_name_list; l; l = CB_CHAIN (l)) { output_alphabet_name_definition (CB_ALPHABET_NAME (CB_VALUE (l))); } output_local ("\n"); } output_line ("static int initialized = 0;"); if (prog->decimal_index_max) { output_local ("/* Decimal structures */\n"); for (i = 0; i < prog->decimal_index_max; i++) { output_local ("static cob_decimal d%d;\n", i); } output_local ("\n"); } output_prefix (); output ("static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];\n"); output_prefix (); output ("static struct cob_module module = { NULL, "); if (prog->collating_sequence) { output_param (cb_ref (prog->collating_sequence), -1); } else { output ("NULL"); } output (", "); if (prog->crt_status && cb_field (prog->crt_status)->count) { output_param (cb_ref (prog->crt_status), -1); } else { output ("NULL"); } output (", "); if (prog->cursor_pos) { output_param (cb_ref (prog->cursor_pos), -1); } else { output ("NULL"); } output (", cob_user_parameters"); /* Note spare byte at end */ output (", %d, '%c', '%c', '%c', %d, %d, %d, 0 };\n", cb_display_sign, prog->decimal_point, prog->currency_symbol, prog->numeric_separator, cb_filename_mapping, cb_binary_truncate, cb_pretty_display); output_newline (); /* External items */ for (f = prog->working_storage; f; f = f->sister) { if (f->flag_external) { strcpy (name, f->name); for (p = name; *p; p++) { if (*p == '-') { *p = '_'; } } output_local ("static unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name); output_local (" /* %s */\n", f->name); } } for (l = prog->file_list; l; l = CB_CHAIN (l)) { f = CB_FILE (CB_VALUE (l))->record; if (f->flag_external) { strcpy (name, f->name); for (p = name; *p; p++) { if (*p == '-') { *p = '_'; } } output_local ("static unsigned char\t*%s%s = NULL;", CB_PREFIX_BASE, name); output_local (" /* %s */\n", f->name); } } if (cb_sticky_linkage && parmnum) { output_local ("\n/* Sticky linkage save pointers */\n"); for (i = 0; i < parmnum; i++) { output_local ("static unsigned char\t*cob_parm_%d = NULL;\n", i); } output_local ("\n"); } /* Files */ if (prog->file_list) { i = 0; for (l = prog->file_list; l; l = CB_CHAIN (l)) { i += output_file_allocation (CB_FILE (CB_VALUE (l))); } if (i) { output_local ("\nstatic struct linage_struct *lingptr;\n"); } } if (prog->loop_counter) { output_local ("\n/* Loop counters */\n"); for (i = 0; i < prog->loop_counter; i++) { output_local ("int n%d;\n", i); } output_local ("\n"); } /* BASED working-storage */ i = 0; for (f = prog->working_storage; f; f = f->sister) { if (f->flag_item_based) { if (!i) { i = 1; output_local("/* BASED WORKING-STORAGE SECTION */\n"); } output_local ("static unsigned char *%s%d = NULL; /* %s */\n", CB_PREFIX_BASE, f->id, f->name); } } if (i) { output_local ("\n"); } /* BASED local-storage */ i = 0; for (f = prog->local_storage; f; f = f->sister) { if (f->flag_item_based) { if (!i) { i = 1; output_local("/* BASED LOCAL-STORAGE */\n"); } output_local ("unsigned char\t\t*%s%d = NULL; /* %s */\n", CB_PREFIX_BASE, f->id, f->name); if (prog->flag_global_use) { output_local ("static unsigned char\t*save_%s%d = NULL;\n", CB_PREFIX_BASE, f->id, f->name); } } } if (i) { output_local ("\n"); } /* Dangling linkage section items */ seen = 0; for (f = prog->linkage_storage; f; f = f->sister) { for (l = parameter_list; l; l = CB_CHAIN (l)) { if (f == cb_field (CB_VALUE (l))) { break; } } if (l == NULL) { if (!seen) { seen = 1; output_local ("\n/* LINKAGE SECTION (Items not referenced by USING clause) */\n"); } output_local ("static unsigned char\t*%s%d = NULL; /* %s */\n", CB_PREFIX_BASE, f->id, f->name); } } if (seen) { output_local ("\n"); } /* Screens */ if (prog->screen_storage) { output_target = current_prog->local_storage_file; output ("\n/* Screens */\n\n"); output_screen_definition (prog->screen_storage); output_newline (); output_target = yyout; } output_local ("\n/* Define perform frame stack */\n\n"); if (cb_perform_osvs) { output_local ("struct cob_frame\t*temp_index;\n"); } if (cb_flag_stack_check) { output_local ("struct cob_frame\t*frame_overflow;\n"); } output_local ("struct cob_frame\t*frame_ptr;\n"); output_local ("struct cob_frame\tframe_stack[%d];\n\n", COB_STACK_SIZE); i = 0; anyseen = 0; for (l = parameter_list; l; l = CB_CHAIN (l), i++) { f = cb_field (CB_VALUE (l)); if (f->flag_any_length) { if (!anyseen) { anyseen = 1; output_local ("/* ANY LENGTH fields */\n"); } output_local ("cob_field\t\t*anylen_%d;\n", i); if (prog->flag_global_use) { output_local ("static cob_field\t*save_anylen_%d;\n", i); } } } if (anyseen) { output_local ("\n"); } if (prog->flag_global_use && parameter_list) { output_local ("/* Parameter save */\n"); for (l = parameter_list; l; l = CB_CHAIN (l)) { f = cb_field (CB_VALUE (l)); output_local ("static unsigned char\t*save_%s%d;\n", CB_PREFIX_BASE, f->id); } output_local ("\n"); } output_line ("/* Start of function code */"); output_newline (); output_line ("/* CANCEL callback handling */"); output_line ("if (unlikely(entry < 0)) {"); output_line (" if (!initialized) {"); output_line (" return 0;"); output_line (" }"); for (l = prog->file_list; l; l = CB_CHAIN (l)) { fl = CB_FILE (CB_VALUE (l)); if (fl->organization != COB_ORG_SORT) { output_line (" cob_close (%s%s, 0, NULL);", CB_PREFIX_FILE, fl->cname); } } if (prog->decimal_index_max) { for (i = 0; i < prog->decimal_index_max; i++) { output_line (" mpz_clear (d%d.value);", i); output_line (" d%d.scale = 0;", i); } } output_line (" initialized = 0;"); output_line (" return 0;"); output_line ("}"); output_newline (); if (cb_sticky_linkage && parmnum) { output_line ("if (cob_call_params < %d) {", parmnum); output_line (" switch (cob_call_params) {"); for (i = 0, l = parameter_list; l; l = CB_CHAIN (l), i++) { output_line (" case %d:", i); output_line (" if (cob_parm_%d != NULL)", i); output_line (" %s%d = cob_parm_%d;", CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id, i); } output_line (" }"); output_line ("}"); for (i = 0, l = parameter_list; l; l = CB_CHAIN (l), i++) { output_line ("if (%s%d != NULL)", CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id); output_line (" cob_parm_%d = %s%d;", i, CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id); } output_newline (); } output_line ("/* Initialize frame stack */"); output_line ("frame_ptr = &frame_stack[0];"); output_line ("frame_ptr->perform_through = 0;"); if (cb_flag_stack_check) { output_line ("frame_overflow = &frame_stack[COB_STACK_SIZE - 1];"); } output_newline (); output_line ("/* Push module stack */"); output_line ("module.next = cob_current_module;"); output_line ("cob_current_module = &module;"); output_newline (); /* Initialization */ output_line ("/* Initialize program */"); output_line ("if (unlikely(initialized == 0))"); output_indent (" {"); output_line ("if (!cob_initialized) {"); if (cb_flag_implicit_init) { output_line (" cob_init (0, NULL);"); } else { output_line (" cob_fatal_error (COB_FERROR_INITIALIZED);"); } output_line ("}"); output_line ("cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);"); if (!prog->flag_main) { if (cb_flag_implicit_init) { output_line ("cob_set_cancel ((const char *)\"%s\", (void *)%s, (void *)%s_);", prog->orig_source_name, prog->program_id, prog->program_id); } else { output_line ("if (module.next)"); output_line (" cob_set_cancel ((const char *)\"%s\", (void *)%s, (void *)%s_);", prog->orig_source_name, prog->program_id, prog->program_id); } } if (prog->decimal_index_max) { output_line ("/* Initialize decimal numbers */"); for (i = 0; i < prog->decimal_index_max; i++) { output_line ("cob_decimal_init (&d%d);", i); } output_newline (); } if (!prog->flag_initial) { for (l = prog->file_list; l; l = CB_CHAIN (l)) { f = CB_FILE (CB_VALUE (l))->record; if (f->flag_external) { strcpy (name, f->name); for (p = name; *p; p++) { if (*p == '-') { *p = '_'; } } output_line ("%s%s = cob_external_addr (\"%s\", %d);", CB_PREFIX_BASE, name, name, CB_FILE (CB_VALUE (l))->record_max); } } output_initial_values (prog->working_storage); if (has_external) { output_line ("goto L_initextern;"); output_line ("LRET_initextern: ;"); } if (prog->file_list) { output_newline (); for (l = prog->file_list; l; l = CB_CHAIN (l)) { output_file_initialization (CB_FILE (CB_VALUE (l))); } output_newline (); } } output_line ("initialized = 1;"); if (prog->flag_chained) { output (" } else {\n"); output_line (" cob_fatal_error (COB_FERROR_CHAINING);"); output_indent (" }"); } else { output_indent (" }"); } output_newline (); /* Set up LOCAL-STORAGE cache */ if (prog->local_storage) { for (f = prog->local_storage; f; f = f->sister) { ff = cb_field_founder (f); if (ff->redefines) { ff = ff->redefines; } if (ff->flag_item_based || ff->flag_local_alloced) { continue; } if (ff->flag_item_78) { fprintf (stderr, "Unexpected CONSTANT item\n"); ABORT (); } ff->flag_local_alloced = 1; locptr = cobc_malloc (sizeof (struct local_list)); locptr->f = ff; locptr->next = local_cache; local_cache = locptr; } local_cache = local_list_reverse (local_cache); } /* Global entry dispatch */ if (prog->global_list) { output_line ("/* Global entry dispatch */"); output_newline (); for (l = prog->global_list; l; l = CB_CHAIN (l)) { output_line ("if (unlikely(entry == %d)) {", CB_LABEL (CB_VALUE (l))->id); if (cb_flag_traceall) { output_line ("\tcob_ready_trace ();"); } for (locptr = local_cache; locptr; locptr = locptr->next) { output_line ("\t%s%d = save_%s%d;", CB_PREFIX_BASE, locptr->f->id, CB_PREFIX_BASE, locptr->f->id); } i = 0; for (l2 = parameter_list; l2; l2 = CB_CHAIN (l), i++) { f = cb_field (CB_VALUE (l2)); output_line ("\t%s%d = save_%s%d;", CB_PREFIX_BASE, f->id, CB_PREFIX_BASE, f->id); if (f->flag_any_length) { output_line ("\tanylen_%d = save_anylen_%d;", i, i); } } output_line ("\tgoto %s%d;", CB_PREFIX_LABEL, CB_LABEL (CB_VALUE (l))->id); output_line ("}"); } output_newline (); } if (prog->flag_initial) { for (l = prog->file_list; l; l = CB_CHAIN (l)) { f = CB_FILE (CB_VALUE (l))->record; if (f->flag_external) { strcpy (name, f->name); for (p = name; *p; p++) { if (*p == '-') { *p = '_'; } } output_line ("%s%s = cob_external_addr (\"%s\", %d);", CB_PREFIX_BASE, name, name, CB_FILE (CB_VALUE (l))->record_max); } } output_initial_values (prog->working_storage); if (has_external) { output_line ("goto L_initextern;"); output_line ("LRET_initextern: ;"); } output_newline (); for (l = prog->file_list; l; l = CB_CHAIN (l)) { output_file_initialization (CB_FILE (CB_VALUE (l))); } output_newline (); } if (prog->local_storage) { if (local_cache) { output_line ("/* Allocate LOCAL storage */"); } for (locptr = local_cache; locptr; locptr = locptr->next) { output_line ("%s%d = cob_malloc (%d);", CB_PREFIX_BASE, locptr->f->id, locptr->f->memory_size); if (current_prog->flag_global_use) { output_line ("save_%s%d = %s%d;", CB_PREFIX_BASE, locptr->f->id, CB_PREFIX_BASE, locptr->f->id); } } output_newline (); output_line ("/* Initialialize LOCAL storage */"); output_initial_values (prog->local_storage); output_newline (); } if (cb_field (current_prog->cb_call_params)->count) { output_line ("/* Initialize number of call params */"); output (" "); output_integer (current_prog->cb_call_params); output_line (" = cob_call_params;"); } output_line ("cob_save_call_params = cob_call_params;"); output_newline (); if (cb_flag_traceall) { output_line ("cob_ready_trace ();"); output_newline (); } i = 0; if (anyseen) { output_line ("/* Initialize ANY LENGTH parameters */"); } for (l = parameter_list; l; l = CB_CHAIN (l), i++) { f = cb_field (CB_VALUE (l)); if (f->flag_any_length) { output (" anylen_%d = ", i); output_param (CB_VALUE (l), i); output (";\n"); if (prog->flag_global_use) { output_line ("save_anylen_%d = anylen_%d;", i, i); } output_line ("if (cob_call_params > %d && %s%d%s)", i, "module.next->cob_procedure_parameters[", i, "]"); output_line (" anylen_%d->size = %s%d%s;", i, "module.next->cob_procedure_parameters[", i, "]->size"); } } if (anyseen) { output_newline (); } if (prog->flag_global_use && parameter_list) { output_line ("/* Parameter save */"); for (l = parameter_list; l; l = CB_CHAIN (l)) { f = cb_field (CB_VALUE (l)); output_line ("save_%s%d = %s%d;", CB_PREFIX_BASE, f->id, CB_PREFIX_BASE, f->id); } output_newline (); } /* Entry dispatch */ output_line ("/* Entry dispatch */"); if (cb_list_length (prog->entry_list) > 1) { output_newline (); output_line ("switch (entry)"); output_line (" {"); for (i = 0, l = prog->entry_list; l; l = CB_CHAIN (l)) { output_line (" case %d:", i++); output_line (" goto %s%d;", CB_PREFIX_LABEL, CB_LABEL (CB_PURPOSE (l))->id); } output_line (" }"); output_line ("/* This should never be reached */"); output_line ("cob_fatal_error (COB_FERROR_CHAINING);"); output_newline (); } else { l = prog->entry_list; output_line ("goto %s%d;", CB_PREFIX_LABEL, CB_LABEL (CB_PURPOSE (l))->id); output_newline (); } /* PROCEDURE DIVISION */ output_line ("/* PROCEDURE DIVISION */"); for (l = prog->exec_list; l; l = CB_CHAIN (l)) { output_stmt (CB_VALUE (l)); } output_newline (); output_line ("/* Program exit */"); output_newline (); if (needs_exit_prog) { output_line ("exit_program:"); output_newline (); } if (prog->local_storage) { output_line ("/* Deallocate LOCAL storage */"); local_cache = local_list_reverse (local_cache); for (locptr = local_cache; locptr; locptr = locptr->next) { output_line ("if (%s%d) {", CB_PREFIX_BASE, locptr->f->id); output_line ("\tfree (%s%d);", CB_PREFIX_BASE, locptr->f->id); output_line ("\t%s%d = NULL;", CB_PREFIX_BASE, locptr->f->id); output_line ("}"); } output_newline (); } output_line ("/* Pop module stack */"); output_line ("cob_current_module = cob_current_module->next;"); output_newline (); if (cb_flag_traceall) { output_line ("cob_reset_trace ();"); output_newline (); } output_line ("/* Program return */"); output_prefix (); output ("return "); output_integer (current_prog->cb_return_code); output (";\n"); /* Error handlers */ if (prog->file_list || prog->gen_file_error) { output_newline (); seen = 0; for (i = COB_OPEN_INPUT; i <= COB_OPEN_EXTEND; i++) { if (prog->global_handler[i].handler_label) { seen = 1; break; } } output_stmt (cb_standard_error_handler); output_newline (); if (seen) { output_line ("switch (cob_error_file->last_open_mode)"); output_indent ("{"); for (i = COB_OPEN_INPUT; i <= COB_OPEN_EXTEND; i++) { hstr = &prog->global_handler[i]; if (hstr->handler_label) { output_line ("case %d:", i); output_indent ("{"); if (prog == hstr->handler_prog) { output_perform_call (hstr->handler_label, hstr->handler_label); } else { if (cb_flag_traceall) { output_line ("cob_reset_trace ();"); } output_prefix (); output ("%s_ (%d", hstr->handler_prog->program_id, hstr->handler_label->id); parmnum = cb_list_length (hstr->handler_prog->parameter_list); for (n = 0; n < parmnum; n++) { output (", NULL"); } output (");\n"); if (cb_flag_traceall) { output_line ("cob_ready_trace ();"); } } output_line ("break;"); output_indent ("}"); } } output_line ("default:"); output_indent ("{"); } output_line ("if (!(cob_error_file->flag_select_features & COB_SELECT_FILE_STATUS)) {"); output_line (" cob_default_error_handle ();"); output_line (" cob_stop_run (1);"); output_line ("}"); if (seen) { output_line ("break;"); output_indent ("}"); output_indent ("}"); } output_perform_exit (CB_LABEL (cb_standard_error_handler)); output_newline (); output_line ("cob_fatal_error (COB_FERROR_CODEGEN);"); output_newline (); } #ifndef __GNUC__ output_newline (); output_line ("/* Frame stack jump table */"); output_line ("P_switch:"); if (label_cache) { output_line (" switch (frame_ptr->return_address) {"); for (pl = label_cache; pl; pl = pl->next) { output_line (" case %d:", pl->call_num); output_line (" goto %s%d;", CB_PREFIX_LABEL, pl->id); } output_line (" }"); } output_line (" cob_fatal_error (COB_FERROR_CODEGEN);"); output_newline (); #endif if (has_external) { output_newline (); output_line ("/* EXTERNAL data initialization */"); output_line ("L_initextern: ;"); for (k = field_cache; k; k = k->next) { if (k->f->flag_item_external) { output_prefix (); output ("\t%s%d.data = ", CB_PREFIX_FIELD, k->f->id); output_data (k->x); output (";\n"); } } output_line ("\tgoto LRET_initextern;"); } output_indent ("}"); output_newline (); } static void output_entry_function (struct cb_program *prog, cb_tree entry, cb_tree parameter_list, const int gencode) { const unsigned char *entry_name; cb_tree using_list; cb_tree l, l1, l2; struct cb_field *f; int parmnum; entry_name = CB_LABEL (CB_PURPOSE (entry))->name; using_list = CB_VALUE (entry); #ifdef _MSC_VER if (!gencode) { output ("__declspec(dllexport) "); } #endif output ("int"); if (gencode) { output ("\n"); } else { output (" "); } output ("%s (", entry_name); if (prog->flag_chained) { using_list = NULL; parameter_list = NULL; } if (!gencode && !using_list) { output ("void);\n"); return; } parmnum = 0; for (l = using_list; l; l = CB_CHAIN (l), parmnum++) { f = cb_field (CB_VALUE (l)); switch (CB_PURPOSE_INT (l)) { case CB_CALL_BY_VALUE: if (CB_TREE_CLASS (CB_VALUE (l)) == CB_CLASS_NUMERIC) { if (CB_SIZES(l) & CB_SIZE_UNSIGNED) { output ("unsigned "); } switch (CB_SIZES_INT (l)) { case CB_SIZE_1: if (gencode) { output ("char i_%d", f->id); } else { output ("char"); } break; case CB_SIZE_2: if (gencode) { output ("short i_%d", f->id); } else { output ("short"); } break; case CB_SIZE_4: if (gencode) { output ("int i_%d", f->id); } else { output ("int"); } break; case CB_SIZE_8: if (gencode) { output ("long long i_%d", f->id); } else { output ("long long"); } break; } /* RXW if (!f->pic->have_sign) { output ("unsigned "); } if (gencode) { output ("int i_%d", f->id); } else { output ("int"); } */ break; } /* Fall through */ case CB_CALL_BY_REFERENCE: case CB_CALL_BY_CONTENT: if (gencode) { output ("unsigned char *%s%d", CB_PREFIX_BASE, f->id); } else { output ("unsigned char *"); } break; } if (CB_CHAIN (l)) { output (", "); } } if (gencode) { output (")\n"); } else { output (");\n"); return; } output ("{\n"); for (l1 = parameter_list; l1; l1 = CB_CHAIN (l1)) { for (l2 = using_list; l2; l2 = CB_CHAIN (l2)) { if (strcasecmp (cb_field (CB_VALUE (l1))->name, cb_field (CB_VALUE (l2))->name) == 0) { f = cb_field (CB_VALUE (l2)); if (CB_PURPOSE_INT (l2) == CB_CALL_BY_VALUE && (f->usage == CB_USAGE_POINTER || f->usage == CB_USAGE_PROGRAM_POINTER)) { output (" unsigned char *ptr_%d = %s%d;\n", f->id, CB_PREFIX_BASE, f->id); } } } } output (" return %s_ (%d", prog->program_id, progid++); for (l1 = parameter_list; l1; l1 = CB_CHAIN (l1)) { for (l2 = using_list; l2; l2 = CB_CHAIN (l2)) { if (strcasecmp (cb_field (CB_VALUE (l1))->name, cb_field (CB_VALUE (l2))->name) == 0) { f = cb_field (CB_VALUE (l2)); switch (CB_PURPOSE_INT (l2)) { case CB_CALL_BY_VALUE: if (f->usage == CB_USAGE_POINTER || f->usage == CB_USAGE_PROGRAM_POINTER) { output (", (unsigned char *)&ptr_%d", f->id); break; } else if (CB_TREE_CLASS (CB_VALUE (l2)) == CB_CLASS_NUMERIC) { output (", (unsigned char *)&i_%d", f->id); break; } /* Fall through */ case CB_CALL_BY_REFERENCE: case CB_CALL_BY_CONTENT: output (", %s%d", CB_PREFIX_BASE, f->id); break; } break; } } if (l2 == NULL) { output (", NULL"); } } output (");\n"); output ("}\n\n"); } static void output_main_function (struct cb_program *prog) { output_line ("/* Main function */"); output_line ("int"); output_line ("main (int argc, char **argv)"); output_indent ("{"); output_line ("cob_init (argc, argv);"); output_line ("cob_stop_run (%s ());", prog->program_id); output_indent ("}\n"); } static void output_header (FILE *fp, const char *locbuff) { int i; if (fp) { fprintf (fp, "/* Generated by cobc %s.%d */\n", PACKAGE_VERSION, PATCH_LEVEL); fprintf (fp, "/* Generated from %s */\n", cb_source_file); fprintf (fp, "/* Generated at %s */\n", locbuff); fprintf (fp, "/* OpenCOBOL build date %s */\n", cb_oc_build_stamp); fprintf (fp, "/* OpenCOBOL package date %s */\n", octardate); fprintf (fp, "/* Compile command "); for (i = 0; i < cb_saveargc; i++) { fprintf (fp, "%s ", cb_saveargv[i]); } fprintf (fp, "*/\n\n"); } } static int field_cache_cmp (void *mp1, void *mp2) { struct field_list *fl1; struct field_list *fl2; int ret; fl1 = (struct field_list *)mp1; fl2 = (struct field_list *)mp2; ret = strcasecmp (fl1->curr_prog, fl2->curr_prog); if (ret) { return ret; } return fl1->f->id - fl2->f->id; } static int base_cache_cmp (void *mp1, void *mp2) { struct base_list *fl1; struct base_list *fl2; fl1 = (struct base_list *)mp1; fl2 = (struct base_list *)mp2; return fl1->f->id - fl2->f->id; } /* Sort a structure linked list in place */ /* Assumed that "next" is first item in structure */ static void * list_cache_sort (void *inlist, int (*cmpfunc)(void *mp1, void *mp2)) { struct sort_list *p; struct sort_list *q; struct sort_list *e; struct sort_list *tail; struct sort_list *list; int insize; int nmerges; int psize; int qsize; int i; if (!inlist) { return NULL; } list = (struct sort_list *)inlist; insize = 1; while (1) { p = list; list = NULL; tail = NULL; nmerges = 0; while (p) { nmerges++; q = p; psize = 0; for (i = 0; i < insize; i++) { psize++; q = q->next; if (!q) { break; } } qsize = insize; while (psize > 0 || (qsize > 0 && q)) { if (psize == 0) { e = q; q = q->next; qsize--; } else if (qsize == 0 || !q) { e = p; p = p->next; psize--; } else if ((*cmpfunc) (p, q) <= 0) { e = p; p = p->next; psize--; } else { e = q; q = q->next; qsize--; } if (tail) { tail->next = e; } else { list = e; } tail = e; } p = q; } tail->next = NULL; if (nmerges <= 1) { return (void *)list; } insize *= 2; } } void codegen (struct cb_program *prog, int nested) { int i; cb_tree l; struct attr_list *j; struct literal_list *m; struct field_list *k; struct call_list *clp; struct base_list *blp; unsigned char *s; struct cb_program *cp; cb_tree l1; cb_tree l2; const char *prevprog; time_t loctime; char locbuff[48]; current_prog = prog; param_id = 0; stack_id = 0; num_cob_fields = 0; progid = 0; loop_counter = 0; output_indent_level = 0; last_line = 0; needs_exit_prog = 0; gen_custom = 0; call_cache = NULL; label_cache = NULL; local_cache = NULL; excp_current_program_id = prog->orig_source_name; excp_current_section = NULL; excp_current_paragraph = NULL; memset ((char *)i_counters, 0, sizeof (i_counters)); output_target = yyout; if (!nested) { gen_ebcdic = 0; gen_ebcdic_ascii = 0; gen_full_ebcdic = 0; gen_native = 0; attr_cache = NULL; base_cache = NULL; literal_cache = NULL; field_cache = NULL; loctime = time (NULL); strftime (locbuff, sizeof(locbuff) - 1, "%b %d %Y %H:%M:%S %Z", localtime (&loctime)); output_header (output_target, locbuff); output_header (cb_storage_file, locbuff); for (cp = prog; cp; cp = cp->next_program) { output_header (cp->local_storage_file, locbuff); } output_storage ("/* Frame stack declaration */\n"); output_storage ("struct cob_frame {\n"); output_storage ("\tint\tperform_through;\n"); #ifndef __GNUC__ output_storage ("\tint\treturn_address;\n"); #elif COB_USE_SETJMP output_storage ("\tjmp_buf\treturn_address;\n"); #else output_storage ("\tvoid\t*return_address;\n"); #endif output_storage ("};\n\n"); output_storage ("/* Union for CALL statement */\n"); output_storage ("union cob_call_union {\n"); output_storage ("\tvoid *(*funcptr)();\n"); output_storage ("\tint (*funcint)();\n"); output_storage ("\tvoid *func_void;\n"); output_storage ("};\n"); output_storage ("union cob_call_union\tcob_unifunc;\n\n"); output ("#define __USE_STRING_INLINES 1\n"); #ifdef _XOPEN_SOURCE_EXTENDED output ("#ifndef _XOPEN_SOURCE_EXTENDED\n"); output ("#define _XOPEN_SOURCE_EXTENDED 1\n"); output ("#endif\n"); #endif output ("#include \n"); output ("#include \n"); output ("#include \n"); output ("#include \n"); #if COB_USE_SETJMP output ("#include \n"); #endif #ifdef WORDS_BIGENDIAN output ("#define WORDS_BIGENDIAN 1\n"); #endif #ifdef HAVE_BUILTIN_EXPECT output ("#define HAVE_BUILTIN_EXPECT\n"); #endif if (optimize_flag) { output ("#define COB_LOCAL_INLINE\n"); } output ("#include \n\n"); output ("#define COB_SOURCE_FILE \"%s\"\n", cb_source_file); output ("#define COB_PACKAGE_VERSION \"%s\"\n", PACKAGE_VERSION); output ("#define COB_PATCH_LEVEL %d\n\n", PATCH_LEVEL); output ("/* Global variables */\n"); output ("#include \"%s\"\n\n", cb_storage_file_name); for (cp = prog; cp; cp = cp->next_program) { if (cp->gen_decset) { output("static void\n"); output("cob_decimal_set_int (cob_decimal *d, const int n)\n"); output("{\n"); output(" mpz_set_si (d->value, n);\n"); output(" d->scale = 0;\n"); output("}\n\n"); break; } } for (cp = prog; cp; cp = cp->next_program) { if (cp->gen_udecset) { output("static void\n"); output("cob_decimal_set_uint (cob_decimal *d, const unsigned int n)\n"); output("{\n"); output(" mpz_set_ui (d->value, n);\n"); output(" d->scale = 0;\n"); output("}\n\n"); break; } } for (cp = prog; cp; cp = cp->next_program) { if (cp->gen_ptrmanip) { output("static void\n"); output("cob_pointer_manip (cob_field *f1, cob_field *f2, size_t addsub)\n"); output("{\n"); output(" unsigned char *tmptr;\n"); output(" memcpy (&tmptr, f1->data, sizeof(void *));\n"); output(" if (addsub) {\n"); output(" tmptr -= cob_get_int (f2);\n"); output(" } else {\n"); output(" tmptr += cob_get_int (f2);\n"); output(" }\n"); output(" memcpy (f1->data, &tmptr, sizeof(void *));\n"); output("}\n\n"); break; } } output ("/* Function prototypes */\n\n"); for (cp = prog; cp; cp = cp->next_program) { /* Build parameter list */ for (l = cp->entry_list; l; l = CB_CHAIN (l)) { for (l1 = CB_VALUE (l); l1; l1 = CB_CHAIN (l1)) { for (l2 = cp->parameter_list; l2; l2 = CB_CHAIN (l2)) { if (strcasecmp (cb_field (CB_VALUE (l1))->name, cb_field (CB_VALUE (l2))->name) == 0) { break; } } if (l2 == NULL) { cp->parameter_list = cb_list_add (cp->parameter_list, CB_VALUE (l1)); } } } if (cp->flag_main) { output ("int %s ();\n", cp->program_id); } else { for (l = cp->entry_list; l; l = CB_CHAIN (l)) { output_entry_function (cp, l, cp->parameter_list, 0); } } output ("static int %s_ (const int", cp->program_id); if (!cp->flag_chained) { for (l = cp->parameter_list; l; l = CB_CHAIN (l)) { output (", unsigned char *"); } } output (");\n"); } output ("\n"); } /* Class-names */ if (!prog->nested_level && prog->class_name_list) { output ("/* Class names */\n"); for (l = prog->class_name_list; l; l = CB_CHAIN (l)) { output_class_name_definition (CB_CLASS_NAME (CB_VALUE (l))); } } /* Main function */ if (prog->flag_main) { output_main_function (prog); } /* Functions */ if (!nested) { output ("/* Functions */\n\n"); } for (l = prog->entry_list; l; l = CB_CHAIN (l)) { output_entry_function (prog, l, prog->parameter_list, 1); } output_internal_function (prog, prog->parameter_list); if (!prog->next_program) { output ("/* End functions */\n\n"); } if (gen_native || gen_full_ebcdic || gen_ebcdic_ascii || prog->alphabet_name_list) { (void)lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); } output_target = cb_storage_file; /* Program local stuff */ if (call_cache) { output_local ("\n/* Call pointers */\n"); for (clp = call_cache; clp; clp = clp->next) { output_local ("static union cob_call_union\tcall_%s = { NULL };\n", clp->callname); } output_local ("\n"); } for (i = 0; i < COB_MAX_SUBSCRIPTS; i++) { if (i_counters[i]) { output_local ("int\t\ti%d;\n", i); } } if (num_cob_fields) { output_local ("\n/* Local cob_field items */\n"); for (i = 0; i < num_cob_fields; i++) { output_local ("cob_field\tf%d;\n", i); } output_local ("\n"); } /* Skip to next nested program */ if (prog->next_program) { codegen (prog->next_program, 1); return; } /* Finalize the storage file */ if (base_cache) { output_storage ("\n/* Storage */\n"); base_cache = list_cache_sort (base_cache, &base_cache_cmp); prevprog = NULL; for (blp = base_cache; blp; blp = blp->next) { if (blp->curr_prog != prevprog) { prevprog = blp->curr_prog; output_storage ("\n/* PROGRAM-ID : %s */\n", prevprog); } #ifdef HAVE_ATTRIBUTE_ALIGNED output_storage ("static unsigned char %s%d[%d] __attribute__((aligned));", #else output_storage ("static unsigned char %s%d[%d];", #endif CB_PREFIX_BASE, blp->f->id, blp->f->memory_size); output_storage ("\t/* %s */\n", blp->f->name); } output_storage ("\n/* End of storage */\n\n"); } if (attr_cache) { output_storage ("\n/* Attributes */\n\n"); attr_cache = attr_list_reverse (attr_cache); for (j = attr_cache; j; j = j->next) { output_storage ("static const cob_field_attr %s%d = ", CB_PREFIX_ATTR, j->id); output_storage ("{%d, %d, %d, %d, ", j->type, j->digits, j->scale, j->flags); if (j->pic) { output_storage ("\""); for (s = j->pic; *s; s += 5) { output_storage ("%c\\%03o\\%03o\\%03o\\%03o", s[0], s[1], s[2], s[3], s[4]); } output_storage ("\""); } else { output_storage ("NULL"); } output_storage ("};\n"); } } if (field_cache) { output_storage ("\n/* Fields */\n"); field_cache = list_cache_sort (field_cache, &field_cache_cmp); prevprog = NULL; for (k = field_cache; k; k = k->next) { if (k->curr_prog != prevprog) { prevprog = k->curr_prog; output_storage ("\n/* PROGRAM-ID : %s */\n", prevprog); } output ("static cob_field %s%d\t= ", CB_PREFIX_FIELD, k->f->id); if (!k->f->flag_local && !k->f->flag_item_external) { output_field (k->x); } else { output ("{"); output_size (k->x); output (", NULL, "); output_attr (k->x); output ("}"); } output (";\t/* %s */\n", k->f->name); } output_storage ("\n/* End of fields */\n\n"); } if (literal_cache) { output_storage ("/* Constants */\n"); literal_cache = literal_list_reverse (literal_cache); for (m = literal_cache; m; m = m->next) { output ("static cob_field %s%d\t= ", CB_PREFIX_CONST, m->id); output_field (m->x); output (";\n"); } output ("\n"); } if (gen_ebcdic) { output_storage ("/* EBCDIC translate table */\n"); output ("static const unsigned char\tcob_a2e[256] = {\n"); if (alt_ebcdic) { output ("\t0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,\n"); output ("\t0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,\n"); output ("\t0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26,\n"); output ("\t0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,\n"); output ("\t0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,\n"); output ("\t0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,\n"); output ("\t0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,\n"); output ("\t0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,\n"); output ("\t0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,\n"); output ("\t0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,\n"); output ("\t0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,\n"); output ("\t0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,\n"); output ("\t0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n"); output ("\t0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,\n"); output ("\t0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,\n"); output ("\t0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07,\n"); output ("\t0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48,\n"); output ("\t0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67,\n"); output ("\t0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD,\n"); output ("\t0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4,\n"); output ("\t0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B,\n"); output ("\t0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B,\n"); output ("\t0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20,\n"); output ("\t0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE,\n"); output ("\t0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D,\n"); output ("\t0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A,\n"); output ("\t0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF,\n"); output ("\t0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35,\n"); output ("\t0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF,\n"); output ("\t0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14,\n"); output ("\t0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED,\n"); output ("\t0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF\n"); } else { /* MF */ output ("\t0x00, 0x01, 0x02, 0x03, 0x1D, 0x19, 0x1A, 0x1B,\n"); output ("\t0x0F, 0x04, 0x16, 0x06, 0x07, 0x08, 0x09, 0x0A,\n"); output ("\t0x0B, 0x0C, 0x0D, 0x0E, 0x1E, 0x1F, 0x1C, 0x17,\n"); output ("\t0x10, 0x11, 0x20, 0x18, 0x12, 0x13, 0x14, 0x15,\n"); output ("\t0x21, 0x27, 0x3A, 0x36, 0x28, 0x30, 0x26, 0x38,\n"); output ("\t0x24, 0x2A, 0x29, 0x25, 0x2F, 0x2C, 0x22, 0x2D,\n"); output ("\t0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A,\n"); output ("\t0x7B, 0x7C, 0x35, 0x2B, 0x23, 0x39, 0x32, 0x33,\n"); output ("\t0x37, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D,\n"); output ("\t0x5E, 0x5F, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,\n"); output ("\t0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,\n"); output ("\t0x70, 0x71, 0x72, 0x7D, 0x6A, 0x7E, 0x7F, 0x31,\n"); output ("\t0x34, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41,\n"); output ("\t0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n"); output ("\t0x4A, 0x4B, 0x4C, 0x4E, 0x4F, 0x50, 0x51, 0x52,\n"); output ("\t0x53, 0x54, 0x55, 0x56, 0x2E, 0x60, 0x4D, 0x05,\n"); output ("\t0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n"); output ("\t0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,\n"); output ("\t0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,\n"); output ("\t0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,\n"); output ("\t0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,\n"); output ("\t0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,\n"); output ("\t0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,\n"); output ("\t0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,\n"); output ("\t0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,\n"); output ("\t0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,\n"); output ("\t0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,\n"); output ("\t0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,\n"); output ("\t0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,\n"); output ("\t0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,\n"); output ("\t0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,\n"); output ("\t0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF\n"); } output ("};\n"); output_storage ("\n"); } if (gen_full_ebcdic) { output ("static const unsigned char\tcob_ebcdic[256] = {\n"); output ("\t0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,\n"); output ("\t0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,\n"); output ("\t0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26,\n"); output ("\t0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,\n"); output ("\t0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,\n"); output ("\t0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,\n"); output ("\t0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,\n"); output ("\t0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,\n"); output ("\t0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,\n"); output ("\t0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,\n"); output ("\t0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,\n"); output ("\t0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,\n"); output ("\t0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n"); output ("\t0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,\n"); output ("\t0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,\n"); output ("\t0xA7, 0xA8, 0xA9, 0xC0, 0x6A, 0xD0, 0xA1, 0x07,\n"); output ("\t0x68, 0xDC, 0x51, 0x42, 0x43, 0x44, 0x47, 0x48,\n"); output ("\t0x52, 0x53, 0x54, 0x57, 0x56, 0x58, 0x63, 0x67,\n"); output ("\t0x71, 0x9C, 0x9E, 0xCB, 0xCC, 0xCD, 0xDB, 0xDD,\n"); output ("\t0xDF, 0xEC, 0xFC, 0xB0, 0xB1, 0xB2, 0x3E, 0xB4,\n"); output ("\t0x45, 0x55, 0xCE, 0xDE, 0x49, 0x69, 0x9A, 0x9B,\n"); output ("\t0xAB, 0x9F, 0xBA, 0xB8, 0xB7, 0xAA, 0x8A, 0x8B,\n"); output ("\t0xB6, 0xB5, 0x62, 0x4F, 0x64, 0x65, 0x66, 0x20,\n"); output ("\t0x21, 0x22, 0x70, 0x23, 0x72, 0x73, 0x74, 0xBE,\n"); output ("\t0x76, 0x77, 0x78, 0x80, 0x24, 0x15, 0x8C, 0x8D,\n"); output ("\t0x8E, 0x41, 0x06, 0x17, 0x28, 0x29, 0x9D, 0x2A,\n"); output ("\t0x2B, 0x2C, 0x09, 0x0A, 0xAC, 0x4A, 0xAE, 0xAF,\n"); output ("\t0x1B, 0x30, 0x31, 0xFA, 0x1A, 0x33, 0x34, 0x35,\n"); output ("\t0x36, 0x59, 0x08, 0x38, 0xBC, 0x39, 0xA0, 0xBF,\n"); output ("\t0xCA, 0x3A, 0xFE, 0x3B, 0x04, 0xCF, 0xDA, 0x14,\n"); output ("\t0xE1, 0x8F, 0x46, 0x75, 0xFD, 0xEB, 0xEE, 0xED,\n"); output ("\t0x90, 0xEF, 0xB3, 0xFB, 0xB9, 0xEA, 0xBB, 0xFF\n"); output ("};\n"); i = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); output ("static cob_field f_ebcdic = { 256, (unsigned char *)cob_ebcdic, &%s%d };\n", CB_PREFIX_ATTR, i); output_storage ("\n"); } if (gen_ebcdic_ascii) { output ("static const unsigned char\tcob_ebcdic_ascii[256] = {\n"); output ("\t0x00, 0x01, 0x02, 0x03, 0xEC, 0x09, 0xCA, 0x7F,\n"); output ("\t0xE2, 0xD2, 0xD3, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,\n"); output ("\t0x10, 0x11, 0x12, 0x13, 0xEF, 0xC5, 0x08, 0xCB,\n"); output ("\t0x18, 0x19, 0xDC, 0xD8, 0x1C, 0x1D, 0x1E, 0x1F,\n"); output ("\t0xB7, 0xB8, 0xB9, 0xBB, 0xC4, 0x0A, 0x17, 0x1B,\n"); output ("\t0xCC, 0xCD, 0xCF, 0xD0, 0xD1, 0x05, 0x06, 0x07,\n"); output ("\t0xD9, 0xDA, 0x16, 0xDD, 0xDE, 0xDF, 0xE0, 0x04,\n"); output ("\t0xE3, 0xE5, 0xE9, 0xEB, 0x14, 0x15, 0x9E, 0x1A,\n"); output ("\t0x20, 0xC9, 0x83, 0x84, 0x85, 0xA0, 0xF2, 0x86,\n"); output ("\t0x87, 0xA4, 0xD5, 0x2E, 0x3C, 0x28, 0x2B, 0xB3,\n"); output ("\t0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x8B,\n"); output ("\t0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E,\n"); output ("\t0x2D, 0x2F, 0xB2, 0x8E, 0xB4, 0xB5, 0xB6, 0x8F,\n"); output ("\t0x80, 0xA5, 0x7C, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,\n"); output ("\t0xBA, 0x90, 0xBC, 0xBD, 0xBE, 0xF3, 0xC0, 0xC1,\n"); output ("\t0xC2, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,\n"); output ("\t0xC3, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,\n"); output ("\t0x68, 0x69, 0xAE, 0xAF, 0xC6, 0xC7, 0xC8, 0xF1,\n"); output ("\t0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,\n"); output ("\t0x71, 0x72, 0xA6, 0xA7, 0x91, 0xCE, 0x92, 0xA9,\n"); output ("\t0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n"); output ("\t0x79, 0x7A, 0xAD, 0xA8, 0xD4, 0x5B, 0xD6, 0xD7,\n"); output ("\t0x9B, 0x9C, 0x9D, 0xFA, 0x9F, 0xB1, 0xB0, 0xAC,\n"); output ("\t0xAB, 0xFC, 0xAA, 0xFE, 0xE4, 0x5D, 0xBF, 0xE7,\n"); output ("\t0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,\n"); output ("\t0x48, 0x49, 0xE8, 0x93, 0x94, 0x95, 0xA2, 0xED,\n"); output ("\t0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,\n"); output ("\t0x51, 0x52, 0xEE, 0x96, 0x81, 0x97, 0xA3, 0x98,\n"); output ("\t0x5C, 0xF0, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n"); output ("\t0x59, 0x5A, 0xFD, 0xF5, 0x99, 0xF7, 0xF6, 0xF9,\n"); output ("\t0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,\n"); output ("\t0x38, 0x39, 0xDB, 0xFB, 0x9A, 0xF4, 0xEA, 0xFF\n"); output ("};\n"); i = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); output ("static cob_field f_ebcdic_ascii = { 256, (unsigned char *)cob_ebcdic_ascii, &%s%d };\n", CB_PREFIX_ATTR, i); output_storage ("\n"); } if (gen_native) { output ("static const unsigned char\tcob_native[256] = {\n"); output ("\t0, 1, 2, 3, 4, 5, 6, 7,\n"); output ("\t8, 9, 10, 11, 12, 13, 14, 15,\n"); output ("\t16, 17, 18, 19, 20, 21, 22, 23,\n"); output ("\t24, 25, 26, 27, 28, 29, 30, 31,\n"); output ("\t32, 33, 34, 35, 36, 37, 38, 39,\n"); output ("\t40, 41, 42, 43, 44, 45, 46, 47,\n"); output ("\t48, 49, 50, 51, 52, 53, 54, 55,\n"); output ("\t56, 57, 58, 59, 60, 61, 62, 63,\n"); output ("\t64, 65, 66, 67, 68, 69, 70, 71,\n"); output ("\t72, 73, 74, 75, 76, 77, 78, 79,\n"); output ("\t80, 81, 82, 83, 84, 85, 86, 87,\n"); output ("\t88, 89, 90, 91, 92, 93, 94, 95,\n"); output ("\t96, 97, 98, 99, 100, 101, 102, 103,\n"); output ("\t104, 105, 106, 107, 108, 109, 110, 111,\n"); output ("\t112, 113, 114, 115, 116, 117, 118, 119,\n"); output ("\t120, 121, 122, 123, 124, 125, 126, 127,\n"); output ("\t128, 129, 130, 131, 132, 133, 134, 135,\n"); output ("\t136, 137, 138, 139, 140, 141, 142, 143,\n"); output ("\t144, 145, 146, 147, 148, 149, 150, 151,\n"); output ("\t152, 153, 154, 155, 156, 157, 158, 159,\n"); output ("\t160, 161, 162, 163, 164, 165, 166, 167,\n"); output ("\t168, 169, 170, 171, 172, 173, 174, 175,\n"); output ("\t176, 177, 178, 179, 180, 181, 182, 183,\n"); output ("\t184, 185, 186, 187, 188, 189, 190, 191,\n"); output ("\t192, 193, 194, 195, 196, 197, 198, 199,\n"); output ("\t200, 201, 202, 203, 204, 205, 206, 207,\n"); output ("\t208, 209, 210, 211, 212, 213, 214, 215,\n"); output ("\t216, 217, 218, 219, 220, 221, 222, 223,\n"); output ("\t224, 225, 226, 227, 228, 229, 230, 231,\n"); output ("\t232, 233, 234, 235, 236, 237, 238, 239,\n"); output ("\t240, 241, 242, 243, 244, 245, 246, 247,\n"); output ("\t248, 249, 250, 251, 252, 253, 254, 255\n"); output ("};\n"); i = lookup_attr (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL, 0); output ("static cob_field f_native = { 256, (unsigned char *)cob_native, &%s%d };\n", CB_PREFIX_ATTR, i); output_storage ("\n"); } } open-cobol-1.1/cobc/ChangeLog0000644000000000000000000021222611143000430011506 2009-02-06 Roger While * pplex.l : Check all of "Area A" after AUTHOR etc. 2009-02-02 Roger While * scanner.l : Fix parsing of # lines 2009-01-30 Roger While * warning.def, parser.y, scanner.l, tree.h : Unreachable statement warn * cobc.c : Fix program name 2009-01-29 Roger While * parser.y, scanner.l, tree.h : Force LITERAL for PROGRAM-ID 2009-01-28 Roger While * parser.y : Fix warning on non-USING LINKAGE item redefines * codegen.c : Remove refs to call.def * cobc.c, codegen.c, typeck.c : Remove -dynopt usage * Makefile.am : Remove call.def 2009-01-27 Roger While * parser.y : Fix PROGRAM-ID types * typeck.c : Change hyphen interpretation * codegen.c : Optimize CALL literal 2009-01-24 Roger While * cobc.c, codegen.c : Fix up labels 2009-01-24 Roger While * cobc.c : Fix signals for MinGW 2009-01-23 Roger While * tree.c, typeck.c : RETURN-CODE is GLOBAL in nested programs * reserved.c : Allow not-reserved from config on functions 2009-01-22 Roger While * typeck.c, tree.[ch], codegen.c : Change warning for special registers * parser.y : Divorce constant fields from the working list * typeck.c : Fix ACCEPT/DISPLAY AT llcc for screen items * reserved.c, tree.[ch], scanner.l, parser.y : Functions CONCATENATE and SUBSTITUTE-CASE 2009-01-20 Roger While * scanner.l : Allow empty alphanumeric literal * parser.y, codegen.c : Minimal value occurs support for screen items 2009-01-18 Roger While * parser.y, reserved.c : Preliminary parse syntax for RW * field.c : Fix 78 level 2009-01-17 Roger While * cobc.c, tree.h, reserved.c : --list-mnemonics 2009-01-15 Roger While * parser.y, tree.h, typeck.c, codegen.c : SCROLL for ACCEPT/DISPLAY * tree.c : Fix usage of FUNCTION as PERFORM subject 2009-01-14 Roger While * parser.y, tree.h, typeck.c : ACCEPT .. FROM LINES/COLUMNS 2009-01-12 Roger While * scanner.l : Fix DISPLAY UPON * parser.y, tree.h, field.c : Allow 78 level within record description 2009-01-03 Roger While * codegen.c : Fix group initialization with ODO subitems 2008-12-31 Roger While * codegen.c : Fix LOCAL-STORAGE variable definition * parser.y, scanner.l : Tighten checks 2008-12-21 Roger While * field.c : Fix GLOBAL INDEXED * scanner.l : Fix comma parsing yet again 2008-12-20 Roger While * General : Clean up * tree.[ch], reserved.c, scanner.l : Implement SUBSTITUTE function 2008-12-16 Roger While * codegen.c : Fix local storage * parser.y, scanner.l, tree.c, flag.def : CONFIGURATION SECTION is not allowed in nested programs. CONFIGURATION SECTION is inherited by nested programs. FUNCTION ALL INTRINSIC in REPOSITORY allows functions without FUNCTION keyword. Can also be activated with -ffunctions-all. 2008-12-15 Roger While * scanner.l : Clean up * parser.y : Fix program type parsing * parser.y, scanner.l, typeck.c : Split out display constructs 2008-12-12 Roger While * scanner.l : Fix comma parsing * cobc.c, tree.h, reserved.c : Option --list-intrinsics 2008-12-08 Roger While * parser.y, tree.h, codegen.c, reserved.c : Implement infinite PERFORM * tree.h, typeck.c, codegen.c : Do not gen internal registers unnecessarily 2008-12-03 Roger While * codegen.c : Better code for handling file errors 2008-12-01 Roger While * parser.y : Fix up OBJECT-COMPUTER paragraph * codegen.c : Use pointer for frame stack manipulation 2008-11-28 Roger While * parser.y, cobc.c, tree.[ch], codegen.c : USE GLOBAL changes 2008-11-21 Roger While * typeck.c : Fix binary initialization 2008-11-20 Roger While * General : Tidy up * typeck.c : Fix abort due to invalid syntax * parser.y : Tighten up checking 2008-11-14 Roger While * cobc.c : Insert signal processing 2008-11-12 Roger While * parser.y : Preliminary acceptance of REPOSITORY. LOCAL-STORAGE is not allowed in nested programs 2008-11-11 Roger While * tree.h, typeck.c, codegen.c : Fix BASED NULL check, add NULL check for LINKAGE item (-debug) when not a PROC DIV USING param 2008-11-09 Roger While * General : Correct CALL conventions, tidy code 2008-11-07 Roger While * General : Preliminary support for GLOBAL 2008-11-02 Roger While * cobc.[ch], tree.h, codegen.c, typeck.c : Handling of local fields, alphabet names, etc. Create local include file for each, possibly nested, program 2008-11-01 Roger While * scanner.l : Relax comma seperator rule 2008-10-31 Roger While * typeck.c : Figurative constant as call parameter is invalid 2008-10-30 Roger While * typeck.c : ASSIGN to 88 item is invalid 2008-10-27 Roger While * flags.def, pplex.l : New -fmfcomment - '*' and '/' in col 1 2008-10-26 Roger While * tree.h, typeck.c, codegen.c : Fix sign manipulation on overflow fields * typeck.c : Relax checking on literal to binary move 2008-10-24 Roger While * parser.y : Implement legacy TRANSFORM * parser.y : Allow SORT STATUS 2008-10-17 Roger While * typeck.c : Check BASED items in debug mode 2008-10-11 Roger While * field.c : Do not allow edited PIC with binary/packed fields 2008-10-05 Roger While * parser.y : Fix invalid SEARCH abort 2008-09-29 Roger While * codegen.c : Fix bug in multi-program source file genning * codegen.c : Tidy up date/time info in genned C code 2008-09-22 Roger While * typeck.c : Pass FILE STATUS for SORT files 2008-09-15 Roger While * cobc.c : -I options must also be passed to the C compiler * reserved.c, parser.y, typeck.c : Preliminary WAIT support 2008-08-20 Roger While * codegen.c : Change to check for __builtin_expect 2008-08-16 Roger While * codegen.c : Unions for function pointers 2008-08-10 Roger While * parser.y, cobc.[ch], typeck.c : Do not allow C keywords as file names or PROGRAM-ID's 2008-08-01 Roger While * pplex.l : Specific fix for >>D 2008-07-31 Roger While * parser.y : FOREGROUND/BACKGROUND must be propogated from parent 2008-07-28 Roger While * typeck.c : Check min/max values on BINARY-xxx/COMP-5/COMP-X properly 2008-07-26 Roger While * parser.y : Allow literal on FROM clause for WRITE/REWRITE/RELEASE * pplex.l : Rewrite source reading * warning.def : Don't set column-overflow/terminator with -Wall 2008-07-22 Roger While * cobc.[ch], warning.def : Remove unused field from macros 2008-07-21 Roger While * typeck.c : Tighten up 88 level checking * pplex.l : Directives parsing rewrite 2008-07-20 Roger While * parser.y : Catch mutliple PROGRAM-ID without matching END PROGRAM 2008-07-19 Roger While * General : Tidy up syntax 2008-07-18 Roger While * General : Tighten up invalid syntax checking * parser.y, tree.[ch], typeck.c : Experimental CONSTANT support 2008-07-16 Roger While * typeck.c : Fix segfault on invalid expressions, fix gcc warning * parser.y : Preliminary CONSTANT support * reserved.c : ACU keywords 2008-07-11 Roger While * parser.y, tree.c, typeck.c, codegen.c : ALPHABET/CLASS syntax/checking changes 2008-07-09 Roger While * tree.h, typeck.c, codegen.c : Fix up SCREEN handling 2008-07-08 Roger While * cobc.c : Prevent display of -fstatic-call in help text 2008-07-07 Roger While * codegen.c : Remove gcc nested function code 2008-07-05 Roger While * codegen.c : Prevent C warning with -fstatic-call and pointer return 2008-07-04 Roger While * General : Cleanup * pplex.l : Fix for strict directive parsing 2008-07-02 Roger While * reserved.c, parser.y : Implement BINARY-C-LONG * parser.y : Proper checks for missing END-xxx terminators 2008-07-01 Roger While * codegen.c : Fix BY VALUE passing of POINTER 2008-06-29 Roger While * tree.c : Temporary nuke of literal length test 2008-06-25 Roger While * parser.y : SCREEN section input field definition 2008-06-22 Roger While * pplex.l, ppparse.y : Fix SOURCE FORMAT directive 2008-06-17 Roger While * parser.y : Ammendments to SCREEN/ACCEPT/DISPLAY 2008-06-12 Roger While * tree.c, codegen.c : Fix possible segfault 2008-06-11 Roger While * parser.y : Fix ALTERNATE key 2008-06-10 Roger While * parser.y, tree.[ch], typeck.c, codegen.c : More SCREEN changes 2008-06-05 Roger While * codegen.c : Prepare for linptr reuse 2008-06-03 Roger While * tree.h, parser.y, typeck.c : Support UNLOCK statement 2008-05-31 Roger While * parser.y, tree.c : Allow VARYING on LINE SEQUENTIAL * tree.h, typeck.c : Prepare for parser changes * codegen.c : Do not do screen initialization until required 2008-05-23 Roger While * parser.y, typeck.c : Allow FUNCTION (obviously only alphanumeric) as the object of a CALL (eg. CALL FUNCTION UPPER-CASE (dataitem) ... * parser.y, tree.h, codegen.c : Better display of POINTER items 2008-05-22 Roger While * codegen.c : Fix pointer usage for non-aligned architecture 2008-05-21 Roger While * codegen.c : Fix use of special literals in CLASS clause 2008-05-19 Roger While * cobc.c : Fix "translating" verbose message being printed too early * parser.y, codegen.c, tree.h : More support for SCREEN 2008-05-16 Roger While * typeck.c : Allow MOVE NULL to index item 2008-05-14 Roger While * tree.h, typeck.c, parser.y : Simplify accept from environment * pplex.l : Add legacy REMARKS 2008-05-12 Roger While * codegen.c : Fix NULL params for sticky linkage * field.c, typeck.c, codegen.c : Add some more SCREEN code * typeck.c : Allow DISPLAY on stderr when screen active 2008-04-21 Roger While * codegen.c : Fix offset for fields following an ODO (MF) 2008-04-18 Roger While * typeck.c : Fix initialization of fractional packed fields 2008-04-15 Roger While * tree.[ch], parser.y, typeck.c : Handle qualified INDEXED BY items * cobc.c, codegen.c : Add build date to info lines 2008-04-02 Roger While * reserved.c, tree.[ch] : Implement FUNCTION COMBINED-DATETIME 2008-03-31 Roger While * reserved.c, scanner.l, tree.[ch] : Implement function LOCALE-TIME-FROM-SECONDS 2008-03-29 Roger While * General : Fix up sparse warnings 2008-03-24 Roger While * parser.y, tree.[ch], codegen.c : Refmodding for some FUNCTIONS 2008-03-19 Roger While * ppparse.y, pplex.l : Correct COPY ... IN .. processing * parser.y : Relax syntax for MF * parser.y, reserved.c : Allow PRINTER 2008-03-17 Roger While * typeck.c : Optimize MOVE ALL 2008-03-06 Roger While * flag.def : Remove line-directive, tidy up comments * codegen.c : Take out line directive * cobc.c : Turn on source location for -g * cobc.[ch] : Define ABORT to cobc_abort, make cob_jmpbuf static * cobc.[ch], scanner.l, typeck.c : Use new routine cobc_realloc * cobc.c : In case of unrecognized option, exit immediately 2008-03-05 Roger While * tree.c : Cater for SELECT without corresponding FD clause * cobc.c : Retain .c and .c.h files when -g option specified 2008-03-04 Roger While * cobc.c : The -ext option must take precedence over default suffixes 2008-02-22 Roger While * codegen.c : NULL terminate CALL, clean up 2008-02-19 Roger While * codegen.c : Fix INITIALIZE on field reference modification 2008-02-16 Roger While * parser.y, codegen.c, tree.[ch], field.c : Preliminary ANY LENGTH support 2008-02-14 Roger While * tree.c : Tighten checking on field size * parser.y : Produce real names instead of tokenized names on error Change "$end" to "end of file" 2008-02-12 Roger While * codegen.c : Use new function cob_set_location 2008-01-19 Roger While * warning.def, typeck.c : Warn when ASSIGN references implicit field 2008-01-10 Roger While * codegen.c : Fix up BY REFERENCE/CONTENT/VALUE processing 2008-01-09 Roger While * parser.y : BY CONTENT is not allowed in PROCEDURE header 2008-01-07 Roger While * parser.y, reserved.c, tree.c : Allow MF syntax for ASSIGN DISK/FILE-ID * parser.y, typeck.c, tree.c, tree.h : DISPLAY .. UPON COMMAND-LINE 2008-01-06 Roger While * typeck.c, codegen.c : Fix CALL statement returning a pointer Note, this needs fixing for alignment intolerant machines 2008-01-03 Roger While * typeck.c, codegen.c : Remove references to own_memxxx and SUPER_OPTIMIZE 2008-01-02 Roger While * parser.y : Fix up VALUE OF in FD clause 2007-12-27 Roger While ** Mark 1.0 RELEASE 2007-12-12 Roger While * typeck.c : numeric literal is not allowed with ALL 2007-12-03 Roger While * typeck.c : Fix values of PI and E 2007-10-30 Roger While * cobc.c, codegen.c : Fix size_t <-> int casts * typeck.c, codegen.c : Fix binary alignment on non-tolerant machines * typeck.c : Fix abort with invalid condition syntax 2007-10-24 Roger While * typeck.c : Fix unsigned comparison 2007-10-23 Roger While * codegen.c : Check HAVE_ATTRIBUTE_ALIGNED * typeck.c : Fix C-5 comparison 2007-10-22 Roger While * cobc.c : Fix -fnotrunc * typeck.c : Enumerate PI and E to 35 digits 2007-10-18 Roger While * typeck.c : Tighten up 88 level usage in conditions 2007-10-12 Roger While * tree.[ch], typeck.c, codegen.c : The special registers RETURN-CODE, SORT-RETURN and NUMBER-OF-CALL-PARAMETERS must be per module and not per compilation unit. 2007-10-10 Roger While * field.c : More checking for 77/78 levels 2007-09-20 Roger While * field.c : Fix up PIC string encoding 2007-09-12 Roger While * tree.h, typeck.c, reserved.c : Add in definitions for channels 2007-09-11 Roger While * codegen.c : Fix a PERFORM problem whereby the UNTIL was comparing signed to unsigned. 2007-09-10 Roger While * typeck.c, codegen.c : Fix unsafe optimization 2007-09-08 Roger While * parser.y, error.c : Fixes for EXIT SECTION/PARAGRAPH * flag.def, cobc.c : New option -fnotrunc ala MF 2007-09-07 Roger While * General : unistd.h is not available on native Win * codegen.c, tree.c, typeck.c : Fix up pic string creation * reserved.c, parser.y : Implement EXIT SECTION/PARAGRAPH 2007-08-31 Roger While * flags.def, codegen.c : New option -fstack-check, autoset when --debug or -g set, no longer reliant on a -O option * All : 78 levels in ASSIGN * typeck.c : Better checking for source moves * codegen.c : Cater for changed fileio struct 2007-08-23 Roger While * All : Remove ASCII 10/20, default display sign according to target machine, allow -fsign-ascii, -fsign-ebcdic 2007-08-20 Roger While * typeck.c : Fix a segfault with invalid expression 2007-08-17 Roger While * cobc.h, codegen.c : Detect native EBCDIC machine. Treat ALPHABET/COLLATING EBCDIC as native on EBCDIC machines. ALPHABET/COLLATING STANDARD-1/2 must go through transaltion on EBCDIC machines 2007-08-14 Roger While * codegen.c : Set file version 2007-08-12 Roger While * typeck.c : Fix for EBCDIC machines 2007-08-10 Roger While * parser.y, typeck.c, tree.h, flag.def : Implement -fassign-external This allows MF conform ASSIGN EXTERNAL filename mapping 2007-08-09 Roger While * cobc.c : Allow environment variable COBCPY to specify copy directories 2007-08-01 Roger While * codegen.c : If -fimplicit-init is specified, always set up the cancel callback 2007-07-30 Roger While * parser.y : Allow unqualified names in the OCCURS KEY clause 2007-07-26 Roger While * tree.h, parser.y, codegen.c : Trace improvements * parser.y, error.c, codegen.c : Fix a problem with valid duplicate paragraph names * typeck.c : Optimize comparison of unsigned numeric display fields 2007-07-24 Roger While * codegen.c : Reinstate aligned attribute 2007-07-21 Roger While * cobc.h, typeck.c, codegen.c : Fixup for DEC Alpha alignment * cobc.c : Use calloc instead of malloc 2007-07-18 Roger While * codegen.c : Fix a leak of cob_decimal structures when doing CANCEL 2007-07-09 Roger While * typeck.c : Fix debugging subscript check to report correct field name * tree.c, typeck.c : Optimize VARYING always 2007-07-07 Roger While * parser.y, tree.c : Tighten checks on RECORD clause 2007-07-05 Roger While * codegen.c : Fix wrong BY VALUE parameter generation 2007-07-01 Roger While * cobc.c : Always export TMPDIR to the enviroment * typeck.c : Further optimization 2007-06-26 Roger While * codegen.c : Fix C warning on CLASS clause 2007-06-25 Roger While * parser.y, typeck.c : Fix up EVALUATE checks yet again * parser.y, pplex.l : Constify string params to cb_error(_x) 2007-06-21 Roger While * tree.c : Produce error for partial expression code on WHEN clause * codegen.c : When calling a "system" function (eg. CBL_OPEN_FILE) with implicit "sticky linkage" (ie. -std=mvs), do not extend the parameter list with NULL's * cobc.c : Help was missing for -conf= 2007-06-19 Roger While * parser.y : Fix up WHEN NOT 2007-06-18 Roger While * General : Replace the word illegal with invalid 2007-06-16 Roger While * tree.h, parser.y, typeck.c, codegen.c : Fix subtle difference between GOBACK and EXIT PROGRAM 2007-06-14 Roger While * codegen.c : Fix field access on REDEFINES of BASED/EXTERNAL items 2007-06-06 Roger While * parser.y, typeck.c : LOCK clause on WRITE/REWRITE 2007-05-21 Roger While * parser.y, typeck.c : Implement IGNORING LOCK * parser.y : Take out PENDING status for LOCK on READ 2007-05-18 Roger While * parser.y : Prevent duplicate ORGANIZATION use; particularly the mistake INDEXED SEQUENTIAL 2007-05-16 Roger While * parser.y : LOCK clause on a READ is illegal when the SELECT clause specifies LOCK AUTOMATIC 2007-05-15 Roger While * parser.y : The END PROGRAM identifier must agree with the PROGRAM-ID 2007-05-14 Roger While * parser.y, codegen.c : Use original names, not the mangled names when tracing 2007-05-11 Roger While * codegen.c : Fix miscompilation with nested source programs * cobc.c : Tighten up checking for presence of input files 2007-05-09 Roger While * cobc.c : Implement -D option to specify defines for C compiles and eventuallly for conditional Cobol compilation. Fix up HP-UX machines that per default do not honour SHLIB_PATH. Implement -b option to create a single dynamically loadable object from multiple input files. 2007-05-08 Roger While * codegen.c : More fixes alignment intolerant machines 2007-05-04 Roger While * parser.y, codegen.c, tree.h : Preliminary support for LOCK clause in SELECT 2007-04-30 Roger While * field.c : BINARY-CHAR is always one byte regardless of -std= 2007-04-28 Roger While * codegen.c : If -fimplicit-init is used, we must always honour an EXIT PROGRAM 2007-04-26 Roger While * typeck.c, codegen.c : Fix POINTER on alignment intolerant architecture 2007-04-11 Roger While * parser.y, typeck.c, tree.[ch] : Either LINE or COLUMN can be optional on DISPLAY/ACCEPT 2007-04-10 Roger While * typeck.c : Enable runtime numeric checks for ADD/SUBTRACT in debug mode Pass number of delimiters for unstring * pplex.l : If -fdebugging-line is specified, treat a "D" in column 7 (fixed format) as a space 2007-03-29 Roger While * codegen.c : EXIT PROGRAM should be ignored for main program 2007-03-28 Roger While * field.c : Fix loop caused by ODO field item following ODO clause 2007-03-27 Roger While * codegen.c : Fix warning on 64-bit, display prog id with trace 2007-03-16 Roger While * typeck.c : Do more param checking otherwise we get a cast abort 2007-03-01 Roger While * codegen.c : Fix LOCALE reference, general code cleanup * parser.y : Allow LOCALE field reference 2007-02-23 Roger While * parser.y : Fix multiple EXIT PERFORM * cobc.[ch], tree.c, codegen.c : Use seperate id fields for attributes, literals and fields 2007-02-13 Roger While * tree.h, typeck.c, codegen.c : Gen cob_decimal_set_int if required * cobc.c : Test -Wno-pointer-sign only with _GNUC_ 2007-02-11 Roger While * codegen.c : Change char to int for flags * warning.def : Check for non 01/77 levels on CALL params should/is not activated per default (standards) 2007-02-09 Roger While * tree.[ch], typeck.c : Implement SORT-RETURN 2007-02-07 Roger While * parser.y, tree.[ch], reserved.c, scanner.l, codegen.c : Implement LOCALE in special names Implement FUNCTION's LOCALE-DATE, LOCALE-TIME 2007-02-01 Roger While * tree.h, typeck.c : A READ/RETURN INTO must not move contents when the AT END/INVALID KEY condition is met. 2007-01-29 Roger While * parser.y, tree.[hc] : Preliminary stuff for LOCALE * parser.y, config.def : Implement odo-without-to; For 85/2002, an ODO without a TO clause is not allowed 2007-01-26 Roger While * typeck.c : Harden validity tests 2007-01-24 Roger While * parser.y, typeck.c : Implement new SORT routines Note that these no longer need the ISAM handler 2007-01-17 Roger While * parser.y, typeck.c, tree.c : Add support for OMITTED as parameter to a CALL. Add support for "IF item OMITTED" 2007-01-16 Roger While * reserved.c, tree.[ch] : Implement FUNCTION's SECONDS-PAST-MIDNIGHT, SECONDS-FROM-FORMATTED-TIME 2007-01-15 Roger While * typeck.c, codegen.c : Pass field offsets for keys * parser.y, tree.[ch], codegen.c, typeck.c : Allow special ASSIGN [TO] DISPLAY 2007-01-10 Roger While * parser.y : A file SORT (as opposed to a table SORT) must have a KEY phrase and a USING or INPUT PROCEDURE and a GIVING or OUTPUT PROCEDURE. A table SORT must not have USING/INPUT or GIVING/OUTPUT. * parser.y, tree.[ch], codegen.c, typeck.c : Allow special ASSIGN [TO] KEYBOARD 2007-01-08 Roger While * codegen.c : Implement new cancel processing 2006-12-19 Roger While * parser.y : Fix DECLARATIVES followed by non-section, cleanup * flex files cleanup 2006-12-17 Roger While * reserved.c, tree.c, parser.y, codegen.c, scanner.l : Correct the NUMVAL-C function 2006-12-07 Roger While * reserved.c, tree.c, parser.y : Implement TRIM function 2006-11-28 Roger While * tree.[hc], error.c field.c : Fix incorrect line reporting of FILLER items * typeck.c : Use new compare routines 2006-11-18 Roger While * parser.y : Initialize EVALUATE check stack at current level at statement start 2006-11-12 Roger While * pplex.l : Check source suffixes also when a COPY refers to an absolute path name Fix an obscure problem whereby a 2 line data definition following a COPY and the second line was a literal continuation would not compile typeck.c : Remaining cmp/add/sub optimizations 2006-11-06 Roger While * tree.h, typeck.c, error.c, field.c : Fix incorrect line number on redefinition warning Fix abort when ASSIGN data name duplicates SELECT name 2006-10-25 Roger While * parser.y : Allow COBOL standard of INSPECT REPLACING NOTE - TALLYING is still deficient 2006-10-23 Roger While * Makefile.am : Remove gcc options cobc.c : Check for .lib suffix on MSC compile 2006-10-18 Roger While * typeck.c : Fix ODO subscript checking 2006-10-15 Roger While * typeck.c : Use table for optimization * cobc.c : Compilation defines generated by codegen * codegen.c : Generate optimization defines 2006-10-14 Roger While * scanner.l : Fix a problem with 78 level * tree.[ch] : Fix abort, clean up and new cb_fits_long_long 2006-09-30 Roger While * codegen.c : Sergey's non-gcc fixes * parser.y : Fix an abort with ENTRY * general : clean up 2006-08-23 Roger While * scanner.l, tree.c : Fix 78 levels 2006-08-11 Roger While * parser.y, cobc.h, typeck.c : The target of an INSPECT can be a FUNCTION/Literal provided there is only a TALLYING clause 2006-08-09 Roger While * reserved.c : Fix wrong categories for some functions 2006-08-03 Roger While * flags.def, codegen.c : -fimplicit-init, allow libraries to be built. 2006-07-31 Roger While * field.c : Fix COMP-X allocation 2006-07-28 Roger While * scanner.l : Usage of 78 is allowed in PIC clauses * typeck.c : Allow 66 as CALL parameter 2006-07-26 Roger While * All : clean up for gcc 4 * typeck.c, tree.[ch], codegen.c : System routines 2006-07-19 Roger While * parser.y, typeck.c : Tighten up field checking * All : General clean up 2006-07-14 Roger While * parser.y, field.c : Change EXTERNAL checking 2006-07-12 Roger While * parse.y, reserved.c, tree.h, tree.c typeck.c, codegen.c : Implement ALLOCATE/FREE 2006-07-02 Roger While * tree.c, typeck.c : Check not referenced SELECT 2006-06-28 Roger While * All : Change cob_malloc to cobc_malloc 2006-06-08 Roger While * typeck.c : With --debug, we should be generating subscript checking * pplex.l, cobc.c : Change listing output 2006-06-06 Roger While * parser.y : Initialize INDEXED BY fields to 1 * codegen.c, typeck.c : Optimization for machines that are not alignment tolerant 2006-06-05 Roger While * codegen.c, typeck.c, reserved.c, parser.y : Accept [WITH] [NO] LOCK on READ Accept UNLOCK filename [RECORD[S]] Implement PREVIOUS for IS files 2006-06-02 Roger While * typeck.c : Fix wrongly optimized partial reference 2006-05-27 Roger While * codegen.c : Stack overflow check, implement new cob_fatal_error, fix null ref on cob_current_section/paragraph 2006-05-23 Roger While * parser.y, scanner.l, field.c : Change 78 level processing 2006-05-20 Roger While * warning.def, cobc.[ch] : Change CB_WARNING to CB_WARNDEF Just to simplify as we have an enumerator with this name * warning.def, cobc.c, typeck.c : Implement -Wtruncate Thanks to Hans-Martin Rasch for providing the meat of this code. This warns when a MOVE might cause truncation. The option is NOT turned on by -Wall * typeck.c : Fixes for extended ACCEPT/DISPLAY 2006-05-18 Roger While * reserved.c, tree.c, codegen.c : Implement FUNCTION's EXCEPTION-FILE, EXCEPTION-STATEMENT, EXCEPTION-LOCATION and EXCEPTION-STATUS * codegen.c : Fixes for HP IA64 port 2006-05-13 Roger While * parser.y : Allow slightly different DISPLAY syntax * warning.def, typeck.c : Warning option "call-params" to check that CALL parameters are 01 or 77 * codegen.c : Fix a possible out-of-bounds reference discovered with valgrind 2006-05-12 Roger While * typeck.c : Do not accept 66, 88 levels as USING params * parser.y, typeck.c : [NOT] EXCEPTION on ACCEPT/DISPLAY 2006-05-10 Roger While * parser.y, typeck.c, codegen.c : Prelimary syntax support for CURSOR IS and CRT STATUS IS * reserved.c, tree.c, codegen.c : Implement STORED-CHAR-LENGTH (Fujitsu) 2006-05-09 Roger While * parser.y, reserved.c, field.c : Implement BINARY-(CHAR/SHORT/LONG/DOUBLE) and the ACU synonyms (UN)SIGNED-(SHORT/INT/LONG) 2006-05-08 Roger While * parser.y, tree.h, typeck.c : Implement TRAILING in INSPECT clause (ACU) 2006-05-06 Roger While * reserved.c, parser.y,codegen.c : PROCEDURE DIVISION CHAINING 2006-05-04 Roger While * codegen.c : Use likely/unlikely macros 2006-05-03 Roger While * parser.y, typeck.c, codegen.c : Preliminary changes for screen and extended accept/display * scanner.l : Allow MF extension from SPECIAL-NAMES SWITCH syntax 2006-05-01 Roger While * All : General clean up Changes for native EBCDIC machines Optimization - See libcob/ChangeLog * parser.y, typeck.c : Allow ACU's SET ENVIRONMENT * parser.y, typeck.c : Start changes for WHEN partial expression * parser.y : Allow CONSOLE [IS] CRT (MF, ACU) * cobc.c : Add CPY and cpy to automatically detected COPY extensions * codegen.c : Detect gcc < 3 (Doesn't like nested functions) * config.c : Fix an enum Allow sign-ebcdic and sign-ascii20 * pplex.l, scanner.l : Allow underscore '_' in user names (2002 standard) * field.c : Implement support for 78 level (MF, ACU) 2006-04-17 Roger While * typeck.c : Optimize cob_add_xxx, cob_cmp_xxx codegen.c, parser.y : Fix SPACE, ZERO in CLASS 2006-04-05 Roger While * field.c : Fix memory allocation when OCCURS at 01 level parser.y, codegen.c : Fix CLASS clause in SPECIAL-NAMES 2006-04-04 Roger While * parser.y : Correctly produce minimal one-line program > PROGRAM-ID. MYPROG. * codegen.c, field.c : Run lindent 2006-03-31 Roger While * typeck.c : Fix abort on invalid SET typeck.c, codegen.c, tree.c : Tidy abort reporting Allow usage of ALPHABET names as identifiers 2006-03-30 Roger While * reserved.c, parser.y : Allow DISK in SELECT 2006-03-25 Roger While * cobc.[hc], codegen.c : Allow alternate ASCII/EBCDIC SORT sequence. Exporting environment variable COB_EBCDIC=FULL will activate *at compile time* the full ASCII-EBDIC (256 character) sequence. Otherwise, we use, as it was upto now, the MF sequence. 2006-03-22 Roger While * reserved.c : Fix reserved table sequence (INTO) codegen.c : Fix ASCII/EBCDIC table again 2006-03-22 Roger While * typeck.c : Implement COLLATING on table SORT codegen.c : Update ASCII/EBCDIC table 2006-03-21 Roger While * pplex.l : Fix regression in comma processing 2006-03-20 Roger While * parser.y : Restrict values for CURRENCY SIGN parser.y, typeck.c, tree.h, tree.c, codegen.c : Support for PROGRAM-POINTER and PROCEDURE-POINTER. Allow CALL PROGRAM-POINTER. pplex.l, scanner.l, parser.y : Process comma in expressions 2006-03-16 Roger While * parser.y : Fix param check for PROCEDUE/ENTRY Allow EXTERNAL/DYNAMIC in SELECT typeck.c : Force ref count for display items 2006-03-10 Roger While * parser.y, tree.h, tree.c, typeck.c reserved.c : Prepare support for PROGRAM-POINTER and PROCEDURE-POINTER 2006-03-05 Roger While * parser.y : Make syntax more correct 2006-03-04 Roger While * codegen.c : Don't generate NULL params on CALL for !cb_sticky_linkage parser.y : Allow ACU variant of ACCEPT FROM ENVIRONMENT parser.y, tree.h, typeck.c : Implement WHEN SET TO FALSE IS Also SET TO FALSE 2006-03-02 Roger While * tree.c : cb_int cannot use hash table as value may be negative typeck.c : Param to cb_build_memset should be int 2006-02-28 Roger While * parser.y, tree.h, tree.c, typeck.c, codegen.c : Handle CONTINUE 2006-02-21 Roger While * typeck.c, codegen.c : Implement new inlines in libcob/codegen.h 2006-02-15 Roger While * parser.y : Check that PROCEDURE/ENTRY USING params are in the LINKAGE SECTION Check for executable program ("-x") and PROCEDURE/ENTRY with USING params 2006-02-12 Roger While * parser.y : Check duplicate ENTRY 2006-02-08 Roger While * parser.y : Fix EVALUATE/88 again parser.y, typeck.c, tree.h : Allow multiple destinations on MOVE CORRESPONDING typeck.c, codegen.c : Optimize COMP/COMP-3 2006-02-02 Roger While * parser.y : Fix EVALUATE and 88 level checking 2006-02-01 Roger While * All : Changes for nested programs Changes for EXTERNAL FD 2006-01-28 Roger While * typeck.c : Optimize move literals, check PROG-ID not = source name parser.y : ID DIV is optional, don't abort on rubbish input, generate "source name" entry point when != PROG-ID 2006-01-26 Roger While * reserved.c : Allow not-reserved for not implemented words 2006-01-25 Roger While * tree.h, tree.c, typeck.c, codegen.c : When using CALL .. RETURNING .. with an OVERFLOW clause, do not overwrite the returning field 2006-01-20 Roger While * parser.y, field.c : Prepare for duplicate paragraph names scanner.l : Fix incorrect parsing field.c : Allow mismatched level numbers based on config parameter relax-level-hierarchy codegen.c : Generate memset instead of memcpy for literals when literal is a repeated character pplex.l : Fix fixed format literal continuation 2006-01-18 Roger While * parser.y : Allow EQUAL in COMPUTE, Fix OBJECT-COMPUTER 2006-01-17 Roger While * cobc.c : Don't warn -x/-m when using -E field.c : Don't allow binary fields > 18 digits 2006-01-08 Roger While * tree.c, field.c, typeck.c : Preliminary support for numeric fields with up to 36 digits 2006-01-07 Roger While * cobc.c : Remove --verbose long option. getopt_long_only has a problem with eg. -mv Change 'Version' back to 'version'. 2006-01-05 Roger While * General : Bootstrap to new libtool/automake cobc.c : MS VS/VC changes Get COB_LDFLAGS from config tree.c : Fix invalid picture codegen.c : Non-gcc and MS VS/VC fixes 2006-01-03 Roger While * scanner.l : Fix wrong numeric scan 2005-12-30 Roger While * Change ifdef's on MINGW to WIN32 (Also defined on 64-bit Win) 2005-12-28 Roger While * General : Further fixes for non-gcc codegen.c : Don't use computed goto's for non-gcc 2005-12-27 Roger While * General : Change all occurrences of "char[variable]" typeck.c : Fix huge literal generation Hack for systems that need pointer alignment 2005-12-23 Roger While * reserved.c : Use bsearch 2005-12-19 Roger While * codegen.c : Fix sticky-linkage with ENTRY 2005-12-18 Roger While * All : cleanup of "shadowed" variables codegen.c : File struct initialization Save/restore params for sticky-linkage Generate Ebcdic table when needed 2005-12-13 Roger While * codegen.c : sticky-linkage changes 2005-12-13 Roger While * codegen.c : Do not statically initialize the file structure cobc.c : Change long_opt "version" to "Version" parser.y : Extra EXTERNAL checking 2005-12-09 Roger While * cobc.c : Show a warning to use '-x' for executables. typeck.c : Implement new display code. 2005-12-08 Roger While * cobc.h : New defines - COB_SMALL_BUFF, COB_MEDIUM_BUFF, COB_LARGE_BUFF * Relevant files : Replace all occurences of FILENAME_MAX/BUFSIZ * codegen.c : Do not use arrays for cob_decimal * flags.def : Mark -fmain as deprecated * cobc.c : Implement '-x' option (Create executable). Harden buffer checking for command lines. Check illegal option combinations. 2005-12-05 Roger While * tree.c : Take out unnecessary zero clears (Done by cob_malloc) cobc.c : Use the executable extension when stripping 2005-12-04 Roger While * tree.c : Fix buffer usage typeck.c : Fix strftime for MingW 2005-12-04 Roger While * codegen.c : Fix INITIALIZE 2005-11-28 Roger While * parser.y, tree.c, typeck.c : Improve error checking codegen.c : Fix -debug code generation 2005-11-25 Roger While * scanner.l, pplex.l : clean up cobc.c : Don't use mkstemp on non-Win Tidy cleanup code Add in bs2000 to help text getopt includes Put back in -fno-gcse codegen.c : Preliminary sticky-linkage code Further mods for perform-osvs 2005-11-09 Roger While * parser.y, tree.h, tree.c : Implement SAME RECORD 2005-11-06 Roger While * parser.y, cobc.h, typeck.c, codegen.c : EXTERNAL changes * typeck.c, codegen.c : character test optimization 2005-11-05 Roger While * codegen.c : Preliminary code for perform OSVS 2005-11-04 Roger While * cobc.c : Take out option -no-gcse * codegen.c : Don't use arrays for local stack variables Put in experimental (deactivated) setjmp/longjmp code for performs. 2005-11-01 Roger While * codegen.c : Take out attribute aligned. It borks under Cygwin latest. 2005-10-31 Roger While * cobc.c : Cater for -Wno-pointer-check correctly 2005-10-26 Roger While * typeck.c : Remove HAVE_DB ifdef 2005-10-25 Roger While * cobc.c, typeck.c : Add in optimizations (memset/memcpy) 2005-10-14 Roger While * All : More GCC 4 fixes * typeck.c : Take out last references to cb_runtime_inlining * flag.def : Mark -fruntime_inlining as deprecated in help text 2005-10-13 Roger While * cobc.c : For GCC >= 4, add -Wnopointer-sign 2005-10-06 Roger While * pplex.l : Ignore DATE-MODIFIED 2005-10-06 Roger While * Indent again - typeck.c indents too far - need to look at cb_build_identifier 2005-10-01 Roger While * Indent run on most source * Start optimizing in typeck/codegen - Unsigned numeric (Pic 9) field optimize Retrieval of binary-swap 2,4,8 byte fields Retrieval of 1 byte binary fields always optimized Optimize referencing linkage section items Test/set of 1 byte fields * cobc.c : Print patch level for -V (eg. 0.33.0) 2005-08-07 Roger While * codegen.c : Prototypes, unneeded fields * parser.y : unneeded fields * config.c : indent 2005-08-04 Roger While * codegen.c : Change initialization point of cob_screen_init Change generated exit to cob_stop_run * typeck.c : Typo 2005-07-31 Roger While * parser.y : Fix a DISPLAY usage clash * typeck.c : Bump the ref count for the field referred to by an 88 * codegen.c : Implement program versioning Change the aligned attribute again - Let the compiler do it except if the field is >= 64; then align 64 - Only for Intel/AMD 32-bit (Intel Optimization Manual) * cobc.c : Allow -g when optimizing with -Os or -O2 2005-07-14 Roger While * pplex.l : Carriage-return must be ignored if not followed by new-line. 2005-07-14 Roger While * parser.y : Check for START on SEQ file * All : Do malloc's through own new routine cob_malloc This will produce an error and terminate if memory can not be acquired. 2005-07-02 Roger While * scanner.l : Fix bugs in early parsing (Bug list) * pplex.l : Fix REPLACING (Bug list) * codegen.c : Change cob_module bit fields to char 2005-06-28 Roger While * Cater for FUNCTION's * Fix a LENGTH bug * Fix the 2 compile warnings in cobc.c 2005-06-13 Roger While * reserved.c : Add in missing 2002 reserved words. 2005-06-11 Roger While * Some cleanups 2005-06-09 Roger While * parser.y : Fix 88 level check for nested EVALUATE's. 2005-06-07 Roger While * parser.y : INITIALIZE WITH FILLER * tree.h, tree.c, typeck.c, codegen.c : Handle above and also handle an INITIALIZE on a REDEFINE. 2005-06-04 Roger While * typeck.c : disable optimization until we can do it really. 2005-06-01 Roger While * cobc.c : Include unistd.h for MinGW. field.c : Warning for VALUE on EXTERNAL field. 2005-05-31 Roger While * codegen.c : Fix code for children of external items. field.c, tree.h, tree.c, typeck.c, reserved.c : Rough implementation of COMP-1/2. 2005-05-31 Roger While * codegen.c : Fix false placement of the c.h file. 2005-05-23 Roger While * cobc.c : New option -dynopt codegen.c : Cater for -dynopt Optimize dynamic calling Move the include of the c.h down into the internal function. This is necessary for upcoming nested programs. parser.y : Cater for optimized dynamic calling. 2005-05-21 Roger While * New file call.def : Defines entry points that will be generated as static calls in Cobol programs. eg. Own C routines or other software entry points that are linked to the main program (or cobcrun). * codegen.c : Inline cob_module_xxx Cater for above call.def Check for cob_initialized in initialization path 2005-05-15 Roger While * error.c - Change "warning: " to "Warning: " and insert "Error: ". 2005-05-13 Roger While * cobc.c : Allow multiple input files when producing executable. 2005-05-03 Roger While * tree.h : bit fields are unsigned. Round to boundaries. typeck.c : Internal register NUMBER-OF-CALL-PARAMETERS. tree.c : Fix ambiguous paragraph errors. scanner.l : Move some syntax from the parser to here in the lexxer. pplex.l : Initialize variables. parser.y : Move some syntax to the lexxer. Initialize variables. Allow MF relaxed syntax. SORT DUPLICATES is default. No need for warning. field.c : Allow larger redefines than original field for -std=cobol2002 and -std=mf. config.def : New variables - larger-redefines-ok and relaxed-syntax-check. codegen.c : Do not generate unnecessary code eg. switch statement for only one entry point, loop counters. Cater for NUMBER-OF-CALL-PARAMETERS. Initialize variables. Restructure generated C code. Use builtin_expect. cobc.c : Initialize variables. Pass -fsigned-char to the compiler. Fix dangling file with multiple compile. cobc.h : Extern definitions. 2005-04-15 Keisuke Nishida * Makefile.am (cobc_CFLAGS): Add -fsigned-char. * codegen.c (output_perform_call): Work around the GCC bug on ppc. (Thanks to Tristan Gingold and Tom Murtagh) 2005-03-07 Roger While * cobc.h, config.c, reserved.c : New config variable - not-reserved 2005-03-03 Roger While * cobc.h, tree.h, parser.y, reserved.c, cobc.c, tree.c, codegen.c, typeck.c : Implement LINAGE Implement -Os Implement stripping of main/modules with O2 or Os Fix dangling preprocess file after non-existent file Fix ASSIGN implicit data-item when not referenced Implement some options for gcc >= 3 Change an incorrect long to int Change bit fields from long to int 2005-02-22 Roger While * codegen.c : Generated C code indentation typeck.c : Check usage of 66 level with pointer 2005-02-15 Roger While * codegen.c : Fix incorrect cast check, LENGTH OF past as int (COMP-5) 2005-02-15 Roger While * codegen.c : Fix .. BY VALUE LENGTH OF 2005-02-12 Roger While * tree.h, tree.c, typeck.c, field.c, codegen.c : .. BY CONTENT LENGTH OF .. 2005-02-11 Roger While * codegen.c : small optimization and module initialization sequence. 2005-02-09 Roger While * codegen.c : Change order of generating variable assignment. In the generated C header, we now have firstly the item definitions, then the attributes and finally the cob_field items. EXTERNAL variable pointers are generated local to the static prog function. We are fairly close to acieving Keisuke's wish for generating just one source file. 2005-02-08 Roger While * parser.y, codegen.c, tree.h, tree.c Implement EXTERNAL AS Literal 2005-02-08 Roger While * codegen.c : Rearrange generated code slightly Do not gen stack values we do not need Generate static function prototype so that we can gen code in order : main (if appropiate), entry points, static function 2005-02-07 Roger While * cobc.c : Slight change for Cygwin * codegen.c : Adjust handling for EXTERNAL items 2005-02-04 Roger While * codegen.c : Fix code gen for tag NULL 2005-02-04 Roger While * parser.y, typeck.c, tree.h, tree.c, reserved.c : implement DISPLAY .. UPON ENVIRONMENT-VALUE implement DISPLAY .. UPON ARGUMENT-NUMBER implement ACCEPT .. FROM ARGUMENT-NUMBER implement ACCEPT .. FROM ARGUMENT-VALUE 2005-02-01 Roger While * cobc.c : Add help text for -std= 2004-11-05 Roger While * codegen.c : readjust align to 8 2004-11-05 Roger While * cobc.h : Print file/line when ABORT() 2004-11-05 Roger While * codegen.c, field.c, tree.c, typeck.c : Handle arithemetic for !binary_trunc. 2004-11-02 Roger While * codegen.c : Thinko by me - Do not exit execution if there is a file USE declarative and no FILE STATUS. 2004-11-01 Roger While * tree.c : Fix bug 1014371 - 88 on POINTER 2004-10-31 Roger While * cobc.c, codegen.c : Activate exceptions for I/O 2004-10-31 Keisuke Nishida * parser.y (evaluate_object): Print error in the case when the compiler cannot handle the expression correctly. Need fix. 2004-10-30 Roger While * typeck.c, parser.y, error.c, field.c config.c, tree.c, tree.h, pplex.l : Replace back-tick "'" with quote "'" * codegen.c : specify aligned(4) and not just aligned. On IA32, wth gcc, default alignment is 16 which is non-optimal. For 64-bit non-Intel platforms we may need 8 here to cater for eventual direct casts for pointers and COMP-1/2 fields. 2004-10-29 Keisuke Nishida * typeck.c (cb_build_length_1): New function. (cb_build_length): Create an anonymous index and use it for length. 2004-09-28 Keisuke Nishida * typeck.c (cb_build_move_field): Compare flag_binary_swap for numeric moves. (Thanks to Roger While) 2004-09-07 Keisuke Nishida * tree.c (finalize_file): Use cb_build_implicit_field to create record. 2004-07-06 Keisuke Nishida * parser.y (add_statement, add_body, compute_statement, compute_body) (divide_statement, divide_body, multiply_statement, multiply_body) (subtract_statement, subtract_body): Parse on_size_error before emitting the statement. * typeck.c (build_store_option): New function. (decimal_assign, build_decimal_assign, cb_build_add) (cb_build_sub, cb_emit_divide): Updated for the new store scheme in libcob. 2004-05-15 Keisuke Nishida * parser.y (stop_statement): Accept RETURNING/GIVING phrase. * typeck.c, tree.h (cb_emit_stop_run): Take an argument. 2004-05-06 Keisuke Nishida * parser.y (procedure_division, entry_statement): Use using_clause. * codegen.c (codegen, output_entry_function): Handle using_list with BY REFERENCE/CONTENT/VALUE. * typeck.c, tree.h (cb_build_using_list): Removed. * cobc.c (process_translate): Do not call codegen when no entry. 2004-05-04 Keisuke Nishida * parser.y (x): Accept literal with LENGTH OF operator. * typeck.c (cb_build_length): Handle non-references. 2004-05-04 Keisuke Nishida * typeck.c (cb_build_move_field): Optimize when the usage of src and dst are the same, not only when they are DISPLAY. (cb_build_move_high, cb_build_move_low): Really move low/high values to numeric fields. (cb_build_move): Do not convert 0 literal to ZERO. 2004-04-19 Keisuke Nishida * tree.h (cb_perform): New members 'exit_label' and 'cycle_label'. * reserved.c (CYCLE): New reserved word. * parser.y (exit_statement): EXIT PERFORM [CYCLE] statement. * codegen.c (output_perform_once, output_perform): Output labels. 2004-04-07 Keisuke Nishida * parser.y (basic_literal, alnum_literal): Literal concatenation. * tree.c, tree.h (cb_concat_literals): New function. 2004-04-07 Keisuke Nishida * parser.y (sort_statement): Table sort. * typeck.c (cb_emit_sort_init): Updated for table sort. 2004-03-30 Keisuke Nishida * tree.c (cb_ref): Resolve by file name. 2004-03-29 Keisuke Nishida * cobc.c (process_link) [__CYGWIN__, __MINGW32__]: Set -Wl,--export-all-symbols instead of -Wl,--export-dynamic. (Thanks to peg@coboler.com) 2004-03-12 Keisuke Nishida * cobc.c (process_module, process_link): Modify compile options for Win32. 2004-03-10 Keisuke Nishida * parser.y (lock_mode_clause): Full parse without codegen. * reserved.c (AUTOMATIC, EXCLUSIVE, MANUAL, ROLLBACK): New words. 2004-03-10 Keisuke Nishida * codegen.c (output_call): Byte swap for literals. 2004-03-10 Keisuke Nishida * parser.y (assignment_name): Accept qualified_word. 2004-03-08 Keisuke Nishida * config.def (cb_synchronized_clause): New option. * field.c (compute_size): Handle the SYNCHRONIZED clause. * tree.c, tree.h (cb_field_align_size): Removed. 2004-03-08 Keisuke Nishida * pplex.l (switch_to_buffer): Duplicate file name. 2004-03-06 Keisuke Nishida * codegen.c (output_base): Always align the 01 items. * field.c (compute_size): No alignment for now. * tree.c, tree.h (cb_field_need_aligned): Removed. 2004-03-06 Keisuke Nishida * reserved.c (system_table): Add "SYSLST". 2004-03-06 Keisuke Nishida * typeck.c (cb_build_move): Handle cb_error_node. (cb_build_add, cb_build_sub): Native arithmetic for pointers. 2004-03-06 Keisuke Nishida * cobc.c: Use _WIN32 instead of __CYGWIN__ or __MINGW32__. 2003-05-21 Keisuke Nishida * tree.h (cb_class, cb_category): New enums. 2003-05-19 Keisuke Nishida * cobc.h (CB_STANDARD_GNU): New standard. * cobc.h, cobc.c (cb_standard): Default compiler is now gnu. 2003-05-18 Keisuke Nishida * cobc.c (short_options): New option '-O' * flag.def (cb_flag_inline_get_int, cb_flag_inline_move): New flags. * codegen.c (output_int32): Inlining cob_get_int. (output_move): Inlining cob_move. 2003-05-06 Keisuke Nishida * flag.def (cb_flag_check_numeric): Removed. (cb_flag_check_subscript): Removed. (cb_flag_check_ref_mod): Removed. * warning.def (cb_warn_obsolete): New variable. * cobc.h (cb_standard, cb_binary_rep): New variables. (cb_exception_table): New varialbe. (CB_EXCEPTION_CODE, CB_EXCEPTION_NAME, CB_EXCEPTION_ENABLE): New macro. * cobc.c (long_options): New option -std and -debug. (short_options): Remove -T. (process_command_line): Handle new/old options. (cb_obsolete, cb_unconformable): New functions. * tree.c (compute_size): Compute size depending on cb_binary_rep. * parser.y (push_file_handler): New macro. 2003-05-04 Keisuke Nishida * flag.def: New file. 2002-11-01 Keisuke Nishida * parser.y (resolve_predefined_names): Call recursively. * tree.h (YYLTYPE): Moved from parser.y. 2002-10-30 Keisuke Nishida * inline.c (output_search): Move index to variable. * inline.c (output_search_all): Unified 'cmp' variable. 2002-10-30 Keisuke Nishida * codegen.c (output_perform_until): Merge 'output_perform_before' and 'output_perform_after'. (output_perform): Call 'output_perform_until'. 2002-10-08 Keisuke Nishida * codegen.h (cobc_program_spec): New member 'loop_counter'. * parser.y (perform_option): Increment loop_counter. * codegen.c (loop_counter, loop_counter_max): Removed. (output_perform): Declare loop_counter as a local variable. (global_label, output_switch): Removed. (output_perform_call): Don't use global_label. (codegen): Merge codegen_1. Traverse the tree only once. 2002-10-06 Keisuke Nishida * Integrate numeric expressions and conditional expressions. * tree.h (cobc_tag_cond, cobc_cond_type, cobc_cond): Removed. (make_negative): New macro. * tree.c (make_expr): Build conditional as well. (make_cond, make_negative): Removed. * codegen.c, inline.c, parser.y: Updated. 2002-10-06 Keisuke Nishida * tree.h (cobc_evaluate): Removed. * tree.c (make_evaluate): Removed. * codegen.c (output_tree): Do not handle cobc_evaluate. (output_evaluate, output_evaluate_test): Removed. * parser.y (make_evaluate, make_evaluate_test): Build evaluate tree. 2002-10-02 Keisuke Nishida * parser.y (CONDITIONAL_NAME): Removed. (condition_name_list, condition_name, qualified_cond_name): Removed. (data_name, expr_item): Handle conditional names here. * scanner.l: Don't return CONDITIONAL_NAME. 2002-10-02 Keisuke Nishida * Rename 'label_name' to 'label'. * Rename 'file_name' to 'file'. 2002-10-01 Keisuke Nishida * tree.h (cobc_tag_register, cobc_register): Removed. * tree.c (make_register): Removed. 2002-09-30 Keisuke Nishida * cobc.h (COBC_PACKAGE): Use PACKAGE_NAME. 2002-09-29 Keisuke Nishida * codegen.c (output_file_name): Updated for new cob_file scheme. * parser.y (sort_keys): Rename 'cob_sort_keys' to 'cob_sort_init'. 2002-09-28 Keisuke Nishida * tree.c (init_constants): Typo fixed. Thanks to Mike Black. 2002-09-24 Keisuke Nishida * scanner.l: Do not support single-quoted strings. 2002-09-24 Keisuke Nishida * codegen.c (codegen_1): Do not support non-computed-goto jump. 2002-09-24 Keisuke Nishida * tree.h (cobc_parameter): Renamed from cobc_generic. All files updated. 2002-09-24 Keisuke Nishida * inline.c (output_call_statement): Output the pointer to the content length for COBC_CALL_BY_LENGTH. 2002-09-23 Keisuke Nishida * cobc.c (process_translate): Verbose output. 2002-09-17 Keisuke Nishida * cobc.c (probe_source_format): Removed. (preprocess): Don't set source format. (process_command_line): Set cobpp flags here. 2002-09-17 Keisuke Nishida * tree.h (COBC_CALL_BY_LENGTH): New macro. * reserved.c (reserved_words): Add LENGTH. * parser.y (call_mode): Add CONTENT LENGTH. * inline.c (output_call_statement): Handle COBC_CALL_BY_LENGTH. 2002-09-13 Keisuke Nishida * tree.h (cobc_field): Remove 'category'. Related files updated. * tree.c (setup_parameters): Merge 'validate_field' and 'setup_cname'. * parser.y (validate_field): Removed. 2002-09-12 Keisuke Nishida * cobc.c (temp_name): Call GetTempFileName with 3rd argument 0. Call DeleteFile to remove the temporary file. 2002-09-12 Keisuke Nishida * parser.y (validate_field_tree): Validate groups not having PICTURE. (validate_field_tree): Create PICTURE of INDEX here, not in USAGE. 2002-09-09 Keisuke Nishida * parser.y (ambiguous_error): display all fields with the same name. (occurs_index): Use undefined_word. Set cobc_location. 2002-08-29 Keisuke Nishida * cobc.c (temp_name): Use GetTempFileName on MinGW. 2002-08-28 Keisuke Nishida * cobc.c (terminate): Renamed from 'error'. (temp_name): Use GetTempPath on MinGW environment. 2002-08-20 Keisuke Nishida * parser.y: No support of comments in IDENTIFICATION DIVISION. (AUTHOR, DATE_WRITTEN, DATE_COMPILED, INSTALLATION, SECURITY): Removed. (identification_division_options, identification_division_option) (comment): Removed. * reserved.c (reserved_words): Removed the tokens above. * scanner.h, scanner.l (cobc_skip_comment): Removed. * scanner.l: Don't handle the case of cobc_skip_comment. 2002-08-20 Keisuke Nishida * cobc.c: New option -semi-fixed. 2002-08-02 Keisuke Nishida * codegen.c (output_compare): Use the new cob_cmp_all scheme. 2002-08-01 Keisuke Nishida * parser.y, reserved.c: SORT and MERGE support. 2002-08-01 Keisuke Nishida * tree.h (cobc_key): Define 'dir' as int. Use COB_ASCENDING or COB_DESCENDING for this. * inline.c (output_search_all): Updated. * parser.y (ascending_or_descending): Updated. 2002-08-01 Keisuke Nishida * parser.y (occurs_clause): Use predefined_name for DEPENDING ON. (record_depending): Set 'record_depending' directly. 2002-07-31 Keisuke Nishida * codegen.h (cobc_program_spec): Renamed from 'program_spec'. * parser.y (program_spec): Updated. * codegen.c: (output_switch): New variable. (output, output_newline, output_prefix, output_line): Updated. (loop_counter, loop_counter_max): New variables. (codegen_1): Renamed from codegen. Set counter variables. (codegen): New function. (output_perform): Use loop_counter. 2002-07-31 Keisuke Nishida * codegen.c (codegen): Return cob_return_code from main. 2002-07-30 Keisuke Nishida * tree.c, tree.h (make_perform_once): New function. 2002-07-26 Keisuke Nishida * parser.y: Accept SD clause. 2002-07-26 Keisuke Nishida * tree.c (make_word): Take constant and duplicate the name. 2002-07-22 Keisuke Nishida * parser.y (FUNCTION_NAME): Defined as the string type. * scanner.l (FUNCTION_STATE): Set value for FUNCTION_NAME. 2002-07-22 Keisuke Nishida * parser.y (display_with_no_advancing): Fixed port number. 2002-07-08 Keisuke Nishida * codegen.c (output_field): Support literals. (output_file_name): Output ASSIGN clause. * parser.y (open_list): Call "cob_open" without file name. 2002-07-08 Keisuke Nishida * codegen.c (output_field): New function. (output_file_name): Use it. 2002-07-05 Keisuke Nishida * parser.y (screen_description): Set default line/column. * codegen.c (output_screen_definition): Updated. Handle COB_SCREEN_TYPE_ATTRIBUTE. 2002-07-04 Keisuke Nishida * codegen.c (output_file_name): Rename 'cob_file_desc' to 'cob_file'. 2002-07-04 Keisuke Nishida * codegen.c (output_field_definition): New arguments 'gen_data' and 'gen_filler'. (output_file_name, codegen): Updated. * parser.y (screen_option): Set LINE/COLUMN flags appropriately. (screen_plus_minus): PLUS/MINUS flags. 2002-07-03 Keisuke Nishida * parser.y (program_sequence): Removed. 2002-07-01 Keisuke Nishida * tree.h (cobc_field): New members: f.screen, screen_line, screen_column, screen_from, screen_to, and screen_flag. * codegen.h (screen_storage): New members: enable_screen and screen_storage. * codegen.c (output_screen_definition): New function. (output_tree): Output screen data. (codegen): Output screen definition. * parser.y (special_name): Add CURSOR and CRT STATUS. (screen_section): New rules. (accept_statement, display_statement): Support screen data. * reserved.c (reserved_words): Add related tokens. 2002-06-26 Keisuke Nishida * tree.c (compute_size): Handle SIGN SEPARATE only for numeric fields. * parser.y (validate_field): Don't throw error for multiple redefines. 2002-06-26 Keisuke Nishida * cobc.c, cobc.h (cobc_flags): New variable. (LINK_STATIC, LINK_DYNAMIC): Removed. (cobc_main_flag, cobc_debug_flag, cobc_verbose_flag) (cobc_optimize_flag, cobc_failsafe_flag, cobc_link_style): Removed. * codegen.c (codegen, output_expr, output_line_directive): Updated. * inline.c (output_call_statement): Updated. 2002-06-24 Keisuke Nishida * parser.y (delete_statement, read_statement, start_statement) (write_statement): set $$ instead of current_file_name. (at_end, opt_invalid_key): Updated. 2002-06-18 Keisuke Nishida * Makefile.am (cobc_LDADD): Add LIBCOB_LIBS. 2002-06-17 Keisuke Nishida * inline.c, inline.h (output_call_statement): Take st1 and st2. * parser.y (call_mode): Renamed from 'current_call_mode'. (call_statement): Updated and clean up. 2002-06-11 Keisuke Nishida * cobc.c (process_module): Use COB_MODULE_EXT. Don't use -soname. 2002-06-11 Keisuke Nishida * codegen.c: Use 'cob_alnum_desc' where appropriate. 2002-06-11 Keisuke Nishida * codegen.c (output_field_definition): Output NULL for cob_field.desc when it is a group. 2002-06-11 Keisuke Nishida * codegen.c, inline.c: Updated for the change in libcob that moved the 'size' field from cob_field_desc to cob_field. 2002-06-09 Keisuke Nishida * tree.h (cobc_field): New member 'in_redefines'. * parser.y (validate_field): Set 'in_redefines' and validate REDEFINES. Display error if a field under REDEFINES has VALUE clause. (init_field): Inherit the 'in_redefines' flag. 2002-06-09 Keisuke Nishida * tree.c (make_tree, make_picture, make_word): Use memset to initialize the memory allocated. (make_literal, make_field, make_file_name, make_label_name_nodef) (make_perform): Let make_tree initialize the memory by zero. 2002-06-08 Keisuke Nishida * cobc.c (long_options): Accept '-main' option. * cobc.c, cobc.h (cobc_main_flag): New variable. (cobc_module_flag): Removed. * codegen.c (OUTPUT_HANDLER): Removed. (codegen): Updated. * parser.y (procedure_using): Don't show -m warning. 2002-06-06 Keisuke Nishida * inline.c (search_set_keys): Dont check syntax error. * parser.y (search_statement): Check syntax error here. (resolve_predefined_name): Return filler on error. 2002-06-06 Keisuke Nishida * codegen.c (codegen): Always generate program function, putting main() at the end. 2002-06-06 Keisuke Nishida * cobc.c (process_command_line, print_usage): Activate -g. 2002-06-05 Keisuke Nishida * cobc.c (print_usage): Don't show -g. 2002-06-04 Keisuke Nishida * codegen.c (output_perform_call): New function. (output_perform_once): Use 'output_perform_call'. * inline.c (output_file_handler): Use 'output_perform_call'. Cleanup. 2002-06-04 Keisuke Nishida * Makefile.am (cobc_CFLAGS): -I$(top_srcdir), not -I$(top_srcdir)/lib. * cobc.c, parser.y, scanner.l: Updated. 2002-06-03 Keisuke Nishida * cobc.c (init_environment): Recognize COB_LDADD. 2002-06-03 Keisuke Nishida * Makefile.am (cobc_LDADD): Add libsupport.a here. (cobc_LIBS): Removed. 2002-05-31 Keisuke Nishida * functions.h: Removed. * tree.h (cobc_call): New field 'name' and 'func'. Remove 'tag'. (make_call): Exported (make_call_0, make_call_1, make_call_2, make_call_3, make_call_4): Defined as macros. (make_inline_0, make_inline_1, make_inline_2, make_inline_3, make_inline_4, make_call_1_list): New macros. * tree.c (make_call): Updated and Exported. (make_call_0,make_call_1,make_call_2,make_call_3,make_call_4): Removed. * inline.c, codegen.h: (output_goto, output_goto_depending, output_move, output_initialize, output_initialize_replacing, output_display, output_search, output_search_all, output_call_statement): Exported. * codegen.c, codegen.h: Don't include functions.h. * codegen.c (output_call): Updated. * parser.y: Updated. (push_call_1_list, push_inline_0, push_inline_1, push_inline_2, push_inline_3, push_inline_4): New macros. * Makefile.am (cobc_SOURCES): Updated. 2002-05-31 Keisuke Nishida * Display index name with the error message. * codegen.c (output_refmod_offset, output_length) (output_field_definition): Updated. 2002-05-31 Keisuke Nishida * tree.c, tree.h (cobc_return_code): New variable. * parser.y (call_returning): Move RETURN-CODE to RETURNING field. * inline.c (output_move_index): New function. (output_call_statement): Don't take ret. 2002-05-31 Keisuke Nishida * codegen.c (output_expr): Give field name to cob_check_numeric. (output_field_definition): No longer output field name. 2002-05-29 Keisuke Nishida * parser.y (expr_item_list): Better source location. * codegen.c (output_compare): Take additional argument for better source location. (output_condition): Updated. * inline.c (output_search_all): Updated. 2002-05-29 Keisuke Nishida * codegen.c (output_recursive): Process top-level redefinition. 2002-05-29 Keisuke Nishida * Keep field names at run-time. * codegen.c (output_field_definition): Output field name. 2002-05-29 Keisuke Nishida * cobc.c: Rename 'COB_LDADD' to 'COB_LIBS' 2002-05-29 Keisuke Nishida * cobc.c (cobc_verbose_flag): New variable. (short_options, long_options): New option -v and --verbose. (process_command_line): Handle -v option. * cobc.h (cobc_verbose_flag): Declared. open-cobol-1.1/cobc/pplex.c0000644000000000000000000020634411142777156011265 #define yy_create_buffer pp_create_buffer #define yy_delete_buffer pp_delete_buffer #define yy_scan_buffer pp_scan_buffer #define yy_scan_string pp_scan_string #define yy_scan_bytes pp_scan_bytes #define yy_flex_debug pp_flex_debug #define yy_init_buffer pp_init_buffer #define yy_flush_buffer pp_flush_buffer #define yy_load_buffer_state pp_load_buffer_state #define yy_switch_to_buffer pp_switch_to_buffer #define yyin ppin #define yyleng ppleng #define yylex pplex #define yyout ppout #define yyrestart pprestart #define yytext pptext #line 19 "pplex.c" /* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* 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. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; 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. */ yy_size_t 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; /* 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 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* 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". */ #define YY_CURRENT_BUFFER yy_current_buffer /* 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 = (char *) 0; static int yy_init = 1; /* 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; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* 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; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 54 #define YY_END_OF_BUFFER 55 static yyconst short int yy_accept[240] = { 0, 0, 0, 6, 6, 0, 0, 0, 0, 55, 53, 45, 46, 53, 53, 48, 49, 53, 53, 53, 50, 53, 50, 53, 50, 50, 50, 50, 50, 50, 50, 50, 50, 2, 3, 6, 5, 6, 2, 3, 26, 10, 11, 26, 26, 14, 15, 26, 26, 26, 23, 12, 23, 26, 26, 23, 23, 23, 23, 23, 23, 23, 2, 3, 33, 27, 28, 33, 33, 33, 33, 33, 30, 33, 30, 33, 33, 30, 2, 3, 46, 0, 52, 0, 1, 0, 51, 45, 47, 50, 50, 46, 50, 50, 50, 50, 50, 50, 50, 50, 50, 2, 1, 3, 6, 1, 2, 1, 3, 11, 0, 25, 0, 0, 24, 10, 23, 23, 13, 16, 17, 18, 23, 23, 23, 28, 0, 32, 0, 0, 31, 27, 30, 30, 29, 1, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 1, 1, 1, 19, 23, 23, 23, 50, 7, 50, 50, 50, 50, 50, 50, 50, 50, 50, 23, 23, 23, 50, 50, 41, 50, 50, 50, 50, 50, 50, 42, 43, 44, 23, 23, 23, 34, 50, 50, 50, 41, 50, 50, 50, 50, 50, 50, 42, 43, 44, 23, 23, 23, 50, 50, 50, 8, 50, 4, 39, 9, 50, 23, 23, 23, 50, 50, 50, 50, 40, 21, 23, 20, 50, 50, 50, 50, 22, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 35, 38, 37, 36, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, 1, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 14, 14, 14, 14, 14, 14, 1, 18, 1, 19, 20, 1, 1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 21, 38, 39, 40, 41, 21, 42, 21, 43, 21, 1, 1, 1, 1, 21, 1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 21, 38, 39, 40, 41, 21, 42, 21, 43, 21, 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 yyconst int yy_meta[44] = { 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 } ; static yyconst short int yy_base[259] = { 0, 0, 36, 43, 44, 57, 40, 100, 42, 504, 756, 756, 485, 476, 472, 756, 756, 446, 134, 150, 158, 166, 174, 152, 44, 146, 135, 147, 167, 182, 183, 187, 190, 439, 0, 0, 756, 432, 420, 0, 756, 756, 429, 423, 402, 756, 756, 383, 191, 221, 229, 237, 245, 207, 378, 151, 215, 230, 202, 218, 208, 238, 373, 0, 756, 756, 358, 356, 352, 333, 254, 278, 286, 294, 302, 270, 296, 264, 287, 0, 284, 282, 756, 273, 0, 310, 318, 756, 264, 265, 0, 260, 273, 311, 319, 279, 326, 327, 330, 331, 339, 0, 0, 0, 0, 0, 0, 0, 0, 229, 222, 756, 214, 356, 364, 756, 272, 0, 756, 287, 334, 335, 365, 346, 372, 212, 207, 756, 199, 375, 384, 756, 342, 0, 756, 0, 376, 392, 396, 400, 401, 404, 405, 408, 409, 413, 416, 0, 0, 0, 421, 426, 427, 431, 435, 436, 439, 445, 446, 452, 453, 457, 460, 463, 474, 466, 471, 482, 486, 487, 490, 493, 497, 498, 502, 503, 513, 507, 516, 521, 526, 529, 532, 535, 536, 539, 540, 756, 545, 549, 550, 553, 554, 557, 756, 756, 756, 558, 564, 567, 571, 574, 578, 575, 588, 591, 592, 597, 601, 602, 605, 606, 609, 612, 613, 616, 617, 621, 622, 625, 629, 637, 626, 642, 645, 648, 653, 658, 657, 661, 664, 665, 668, 676, 679, 682, 685, 686, 695, 756, 707, 710, 713, 193, 716, 719, 722, 725, 728, 731, 734, 182, 737, 740, 44, 743, 746, 749, 752 } ; static yyconst short int yy_def[259] = { 0, 239, 1, 240, 240, 239, 5, 239, 7, 239, 239, 239, 239, 241, 242, 239, 239, 239, 239, 239, 243, 239, 243, 239, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 245, 246, 239, 246, 247, 248, 239, 239, 239, 249, 250, 239, 239, 239, 239, 239, 251, 239, 251, 239, 239, 251, 251, 251, 251, 251, 251, 251, 244, 245, 239, 239, 239, 252, 253, 239, 239, 239, 254, 239, 254, 239, 239, 254, 244, 245, 239, 241, 239, 242, 255, 239, 239, 239, 239, 243, 22, 239, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 256, 245, 246, 257, 247, 258, 248, 239, 249, 239, 250, 239, 239, 239, 251, 52, 239, 251, 251, 251, 251, 251, 251, 239, 252, 239, 253, 239, 239, 239, 254, 74, 239, 255, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 256, 257, 258, 251, 251, 251, 251, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 251, 251, 251, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 251, 251, 251, 243, 243, 243, 243, 239, 243, 243, 243, 243, 243, 243, 239, 239, 239, 251, 251, 251, 243, 243, 243, 243, 243, 243, 243, 243, 243, 251, 251, 251, 243, 243, 243, 243, 243, 251, 251, 251, 243, 243, 243, 243, 251, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 0, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239 } ; static yyconst short int yy_nxt[800] = { 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 10, 22, 22, 22, 22, 23, 10, 10, 24, 25, 24, 26, 27, 28, 24, 24, 24, 29, 24, 24, 24, 24, 24, 24, 30, 31, 32, 24, 24, 24, 24, 33, 36, 36, 132, 62, 34, 78, 37, 38, 63, 239, 79, 239, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 40, 52, 52, 52, 52, 53, 54, 40, 55, 55, 56, 55, 55, 55, 55, 55, 55, 57, 55, 55, 55, 55, 55, 58, 59, 60, 61, 55, 55, 55, 55, 64, 65, 66, 67, 68, 64, 64, 69, 70, 71, 72, 73, 64, 74, 74, 74, 74, 75, 76, 64, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 85, 239, 85, 239, 86, 86, 86, 86, 87, 88, 87, 91, 239, 239, 239, 239, 85, 239, 85, 239, 86, 86, 86, 86, 85, 94, 85, 93, 90, 90, 90, 90, 85, 239, 85, 239, 86, 86, 86, 86, 85, 116, 85, 92, 90, 90, 90, 90, 239, 239, 239, 239, 89, 239, 95, 239, 239, 113, 239, 113, 127, 114, 114, 114, 114, 115, 109, 127, 239, 98, 239, 125, 99, 96, 239, 111, 239, 97, 100, 115, 109, 239, 111, 239, 239, 121, 239, 113, 109, 113, 123, 114, 114, 114, 114, 113, 239, 113, 239, 117, 117, 117, 117, 113, 239, 113, 239, 114, 114, 114, 114, 113, 122, 113, 119, 117, 117, 117, 117, 91, 129, 120, 129, 88, 130, 130, 130, 130, 131, 125, 239, 239, 239, 239, 82, 124, 131, 125, 239, 239, 239, 239, 82, 80, 129, 239, 129, 239, 130, 130, 130, 130, 129, 239, 129, 239, 133, 133, 133, 133, 129, 139, 129, 102, 130, 130, 130, 130, 129, 136, 129, 134, 133, 133, 133, 133, 85, 239, 85, 239, 86, 86, 86, 86, 85, 239, 85, 239, 86, 86, 86, 86, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 137, 239, 140, 239, 239, 84, 239, 145, 239, 127, 239, 138, 127, 125, 150, 142, 143, 141, 113, 144, 113, 146, 114, 114, 114, 114, 113, 239, 113, 239, 114, 114, 114, 114, 239, 152, 239, 129, 239, 129, 239, 130, 130, 130, 130, 102, 129, 151, 129, 118, 130, 130, 130, 130, 239, 84, 239, 154, 239, 111, 239, 153, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 156, 239, 157, 239, 239, 111, 239, 160, 161, 239, 109, 239, 158, 155, 239, 239, 239, 239, 107, 239, 162, 239, 159, 239, 239, 239, 239, 239, 169, 239, 105, 164, 163, 239, 239, 239, 239, 102, 166, 165, 239, 239, 239, 239, 84, 239, 167, 239, 239, 168, 239, 239, 172, 239, 239, 82, 239, 173, 82, 239, 175, 239, 239, 170, 239, 171, 80, 177, 178, 179, 239, 181, 239, 174, 239, 239, 239, 239, 239, 176, 187, 239, 239, 239, 180, 239, 239, 239, 239, 184, 239, 239, 239, 239, 239, 239, 188, 194, 182, 185, 239, 239, 183, 239, 239, 192, 195, 186, 189, 239, 239, 196, 191, 239, 239, 190, 239, 239, 239, 239, 239, 193, 239, 239, 239, 239, 239, 239, 239, 239, 239, 198, 239, 239, 197, 239, 199, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 203, 200, 239, 239, 201, 239, 239, 202, 239, 207, 239, 204, 239, 239, 239, 239, 239, 239, 205, 239, 239, 206, 209, 210, 239, 239, 208, 239, 213, 239, 239, 239, 239, 239, 212, 211, 239, 214, 239, 215, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 217, 239, 239, 239, 239, 239, 239, 239, 239, 239, 218, 239, 221, 239, 216, 219, 220, 239, 239, 239, 224, 239, 239, 222, 239, 239, 223, 239, 239, 225, 239, 239, 239, 239, 226, 239, 227, 239, 239, 239, 239, 239, 228, 239, 239, 239, 239, 239, 239, 239, 239, 229, 239, 230, 231, 239, 239, 233, 239, 239, 234, 239, 239, 232, 239, 239, 239, 239, 239, 239, 235, 237, 239, 236, 238, 239, 239, 239, 35, 35, 35, 81, 239, 81, 83, 239, 83, 101, 239, 101, 103, 239, 103, 104, 239, 104, 106, 239, 106, 108, 239, 108, 110, 239, 110, 112, 239, 112, 126, 239, 126, 128, 239, 128, 135, 239, 135, 147, 239, 147, 148, 239, 148, 149, 239, 149, 9, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239 } ; static yyconst short int yy_chk[800] = { 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, 2, 3, 4, 254, 6, 2, 8, 3, 4, 6, 24, 8, 24, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 18, 26, 18, 26, 18, 18, 18, 18, 19, 19, 23, 23, 25, 27, 25, 27, 19, 55, 19, 55, 19, 19, 19, 19, 20, 27, 20, 26, 20, 20, 20, 20, 21, 28, 21, 28, 21, 21, 21, 21, 22, 251, 22, 25, 22, 22, 22, 22, 29, 30, 29, 30, 243, 31, 28, 31, 32, 48, 32, 48, 128, 48, 48, 48, 48, 53, 53, 126, 58, 31, 58, 125, 32, 29, 60, 112, 60, 30, 32, 49, 49, 56, 110, 56, 59, 58, 59, 49, 109, 49, 60, 49, 49, 49, 49, 50, 57, 50, 57, 50, 50, 50, 50, 51, 61, 51, 61, 51, 51, 51, 51, 52, 59, 52, 56, 52, 52, 52, 52, 91, 70, 57, 70, 88, 70, 70, 70, 70, 75, 75, 77, 89, 77, 89, 83, 61, 71, 71, 116, 92, 116, 92, 81, 80, 71, 95, 71, 95, 71, 71, 71, 71, 72, 119, 72, 119, 72, 72, 72, 72, 73, 95, 73, 78, 73, 73, 73, 73, 74, 92, 74, 76, 74, 74, 74, 74, 85, 93, 85, 93, 85, 85, 85, 85, 86, 94, 86, 94, 86, 86, 86, 86, 96, 97, 96, 97, 98, 99, 98, 99, 120, 121, 120, 121, 93, 100, 96, 100, 132, 69, 132, 99, 123, 68, 123, 94, 67, 66, 121, 97, 98, 96, 113, 98, 113, 100, 113, 113, 113, 113, 114, 122, 114, 122, 114, 114, 114, 114, 124, 123, 124, 129, 136, 129, 136, 129, 129, 129, 129, 62, 130, 122, 130, 54, 130, 130, 130, 130, 137, 47, 137, 136, 138, 44, 138, 124, 139, 140, 139, 140, 141, 142, 141, 142, 143, 144, 143, 144, 138, 145, 139, 145, 146, 43, 146, 142, 143, 150, 42, 150, 140, 137, 151, 152, 151, 152, 38, 153, 144, 153, 141, 154, 155, 154, 155, 156, 156, 156, 37, 146, 145, 157, 158, 157, 158, 33, 152, 151, 159, 160, 159, 160, 17, 161, 153, 161, 162, 154, 162, 163, 159, 163, 165, 14, 165, 160, 13, 166, 162, 166, 164, 157, 164, 158, 12, 164, 164, 164, 167, 166, 167, 161, 168, 169, 168, 169, 170, 163, 170, 171, 9, 171, 165, 172, 173, 172, 173, 169, 174, 175, 174, 175, 0, 177, 171, 177, 167, 169, 0, 176, 168, 176, 178, 175, 178, 169, 172, 179, 0, 179, 174, 0, 180, 173, 180, 181, 0, 181, 182, 176, 182, 183, 184, 183, 184, 185, 186, 185, 186, 181, 0, 188, 180, 188, 182, 189, 190, 189, 190, 191, 192, 191, 192, 193, 197, 193, 197, 188, 184, 0, 198, 185, 198, 199, 186, 199, 192, 200, 189, 200, 201, 203, 201, 203, 202, 190, 202, 0, 191, 197, 198, 0, 0, 193, 204, 201, 204, 205, 206, 205, 206, 200, 199, 207, 202, 207, 204, 208, 209, 208, 209, 210, 211, 210, 211, 212, 0, 212, 213, 214, 213, 214, 215, 216, 215, 216, 209, 217, 218, 217, 218, 219, 222, 219, 222, 220, 210, 220, 213, 0, 208, 211, 212, 221, 0, 221, 218, 0, 223, 214, 223, 224, 215, 224, 225, 220, 225, 0, 0, 226, 221, 226, 222, 228, 227, 228, 227, 229, 223, 229, 230, 231, 230, 231, 232, 0, 232, 225, 0, 226, 227, 0, 233, 229, 233, 234, 230, 234, 235, 228, 235, 236, 237, 236, 237, 0, 231, 233, 0, 232, 234, 238, 0, 238, 240, 240, 240, 241, 0, 241, 242, 0, 242, 244, 0, 244, 245, 0, 245, 246, 0, 246, 247, 0, 247, 248, 0, 248, 249, 0, 249, 250, 0, 250, 252, 0, 252, 253, 0, 253, 255, 0, 255, 256, 0, 256, 257, 0, 257, 258, 0, 258, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "pplex.l" #define INITIAL 0 /* -*- c -*- * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #define YY_NEVER_INTERACTIVE 1 #line 28 "pplex.l" #include "config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "cobc.h" #include "ppparse.h" static char *plexbuff1 = NULL; static char *plexbuff2 = NULL; static size_t newline_count = 0; static size_t within_comment = 0; static size_t inside_bracket = 0; static size_t consecutive_quotation = 0; static int quotation_mark = 0; static int last_line_1 = -1; static int last_line_2 = -1; static struct cb_replace_list *current_replace_list = NULL; static struct cb_text_list *text_queue = NULL; static struct copy_info { struct copy_info *next; char *file; int line; int replacing; int quotation_mark; YY_BUFFER_STATE buffer; } *copy_stack = NULL; #define YY_INPUT(buf,result,max_size) result = ppinput (buf, max_size); static int ppinput (char *buf, int max_size); static void ppecho (const char *text); static void switch_to_buffer (const int lineno, const char *filename, YY_BUFFER_STATE buffer); #define PROCESS_STATE 1 #define COPY_STATE 2 #define PSEUDO_STATE 3 #line 714 "pplex.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #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) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', 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 if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #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 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* 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 break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 84 "pplex.l" #line 874 "pplex.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { 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; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 756 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 89 "pplex.l" { ppecho (" "); } YY_BREAK case 2: #line 94 "pplex.l" case 3: YY_RULE_SETUP #line 94 "pplex.l" { ppecho (" "); if (cb_source_format != CB_FORMAT_FIXED) { ppecho (yytext); } } YY_BREAK case 4: YY_RULE_SETUP #line 101 "pplex.l" { BEGIN PROCESS_STATE; } YY_BREAK case 5: YY_RULE_SETUP #line 104 "pplex.l" { BEGIN INITIAL; unput ('\n'); } YY_BREAK case 6: YY_RULE_SETUP #line 105 "pplex.l" { cb_warning (_("PROCESS statement is ignored")); } YY_BREAK case 7: YY_RULE_SETUP #line 108 "pplex.l" { BEGIN COPY_STATE; return COPY; } YY_BREAK case 8: YY_RULE_SETUP #line 109 "pplex.l" { BEGIN COPY_STATE; return COPY; } YY_BREAK case 9: YY_RULE_SETUP #line 110 "pplex.l" { BEGIN COPY_STATE; return REPLACE; } YY_BREAK case 10: YY_RULE_SETUP #line 113 "pplex.l" { ECHO; cb_source_line++; } YY_BREAK case 11: YY_RULE_SETUP #line 114 "pplex.l" { /* ignore */ } YY_BREAK case 12: YY_RULE_SETUP #line 115 "pplex.l" { BEGIN INITIAL; return '.'; } YY_BREAK case 13: YY_RULE_SETUP #line 116 "pplex.l" { BEGIN PSEUDO_STATE; return EQEQ; } YY_BREAK case 14: YY_RULE_SETUP #line 117 "pplex.l" { return '('; } YY_BREAK case 15: YY_RULE_SETUP #line 118 "pplex.l" { return ')'; } YY_BREAK case 16: YY_RULE_SETUP #line 119 "pplex.l" { return BY; } YY_BREAK case 17: YY_RULE_SETUP #line 120 "pplex.l" { return IN; } YY_BREAK case 18: YY_RULE_SETUP #line 121 "pplex.l" { return OF; } YY_BREAK case 19: YY_RULE_SETUP #line 122 "pplex.l" { return OFF; } YY_BREAK case 20: YY_RULE_SETUP #line 123 "pplex.l" { return SUPPRESS; } YY_BREAK case 21: YY_RULE_SETUP #line 124 "pplex.l" { return PRINTING; } YY_BREAK case 22: YY_RULE_SETUP #line 125 "pplex.l" { return REPLACING; } YY_BREAK case 23: #line 127 "pplex.l" case 24: #line 128 "pplex.l" case 25: #line 129 "pplex.l" case 26: YY_RULE_SETUP #line 129 "pplex.l" { pplval.s = strdup (yytext); return TOKEN; } YY_BREAK case 27: YY_RULE_SETUP #line 133 "pplex.l" { ECHO; cb_source_line++; } YY_BREAK case 28: YY_RULE_SETUP #line 134 "pplex.l" { pplval.s = strdup (" "); return TOKEN; } YY_BREAK case 29: YY_RULE_SETUP #line 135 "pplex.l" { BEGIN COPY_STATE; return EQEQ; } YY_BREAK case 30: #line 137 "pplex.l" case 31: #line 138 "pplex.l" case 32: #line 139 "pplex.l" case 33: YY_RULE_SETUP #line 139 "pplex.l" { pplval.s = strdup (yytext); return TOKEN; } YY_BREAK case 34: #line 143 "pplex.l" case 35: #line 144 "pplex.l" case 36: #line 145 "pplex.l" case 37: #line 146 "pplex.l" case 38: #line 147 "pplex.l" case 39: #line 148 "pplex.l" case 40: YY_RULE_SETUP #line 148 "pplex.l" { /* these words are treated as comments */ if (cb_verify (cb_author_paragraph, yytext)) { /* skip comments until the end of line */ int c; within_comment = 1; while ((c = input ()) != EOF) { if (c == '\n') { break; } } unput (c); } } YY_BREAK case 41: #line 165 "pplex.l" case 42: #line 166 "pplex.l" case 43: #line 167 "pplex.l" case 44: YY_RULE_SETUP #line 167 "pplex.l" { /* these words are comments in IBM COBOL */ if (cb_verify (cb_eject_statement, yytext)) { /* do nothing for now */ } else { ECHO; } } YY_BREAK case 45: YY_RULE_SETUP #line 176 "pplex.l" { ppecho ("\n"); cb_source_line++; } YY_BREAK case 46: YY_RULE_SETUP #line 178 "pplex.l" { ppecho (" "); } YY_BREAK case 47: YY_RULE_SETUP #line 180 "pplex.l" { if (inside_bracket) { ppecho (", "); } else { ppecho (" "); } } YY_BREAK case 48: YY_RULE_SETUP #line 188 "pplex.l" { inside_bracket++; ppecho ("("); } YY_BREAK case 49: YY_RULE_SETUP #line 193 "pplex.l" { if (inside_bracket) { inside_bracket--; } ppecho (")"); } YY_BREAK case 50: #line 201 "pplex.l" case 51: #line 202 "pplex.l" case 52: #line 203 "pplex.l" case 53: YY_RULE_SETUP #line 203 "pplex.l" { ppecho (yytext); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PROCESS_STATE): case YY_STATE_EOF(COPY_STATE): case YY_STATE_EOF(PSEUDO_STATE): #line 205 "pplex.l" { struct copy_info *p; p = copy_stack; yy_delete_buffer (YY_CURRENT_BUFFER); /* Terminate at the end of all input */ if (p->next == NULL) { within_comment = 0; newline_count = 0; inside_bracket = 0; current_replace_list = NULL; text_queue = NULL; copy_stack = NULL; quotation_mark = 0; consecutive_quotation = 0; last_line_1 = -1; last_line_2 = -1; yyterminate (); } /* Close the current file */ fclose (ppin); /* Switch to the last buffer */ if (p->replacing) { pp_set_replace_list (NULL); } switch_to_buffer (p->line, p->file, p->buffer); quotation_mark = p->quotation_mark; copy_stack = p->next; free (p); } YY_BREAK case 54: YY_RULE_SETUP #line 241 "pplex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 1260 "pplex.c" 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->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->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->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->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 { 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->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 yylex */ /* 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 */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->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->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } 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 ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = 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 >= 240 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 239); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #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->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = 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 ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; 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; yy_current_buffer->yy_at_bol = (c == '\n'); return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { 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->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = 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; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( 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 *) yy_flex_alloc( 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; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #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(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { 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 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = 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 = 0; 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 #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[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_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* 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 (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 241 "pplex.l" void pp_set_replace_list (struct cb_replace_list *list) { current_replace_list = list; } static void switch_to_buffer (const int line, const char *file, YY_BUFFER_STATE buffer) { char *p; cb_source_line = line; cb_source_file = strdup (file); for (p = cb_source_file; *p; p++) { if (*p == '\\') { *p = '/'; } } yy_switch_to_buffer (buffer); fprintf (yyout, "# %d \"%s\"\n", line, cb_source_file); } int ppopen (const char *name, struct cb_replace_list *replace_list) { struct copy_info *p; for (; newline_count > 0; newline_count--) { ungetc ('\n', ppin); } /* Open the copy file */ ppin = fopen (name, "rb"); if (!ppin) { if (cb_source_file) { cb_error (_("%s: %s"), name, strerror (errno)); } else { perror (name); } return -1; } /* Add to dependency list */ if (cb_depend_file) { cb_depend_list = cb_text_list_add (cb_depend_list, name); } /* Preserve the current buffer */ p = cobc_malloc (sizeof (struct copy_info)); p->line = cb_source_line; p->file = cb_source_file; p->replacing = replace_list ? 1 : 0; p->buffer = YY_CURRENT_BUFFER; p->quotation_mark = quotation_mark; p->next = copy_stack; copy_stack = p; /* Switch to new buffer */ if (replace_list) { pp_set_replace_list (replace_list); } switch_to_buffer (1, name, yy_create_buffer (ppin, YY_BUF_SIZE)); return 0; } int ppcopy (const char *name, const char *lib, struct cb_replace_list *replace_list) { struct cb_text_list *il; struct cb_text_list *el; char *s; struct stat st; if (lib) { if (!plexbuff1) { plexbuff1 = cobc_malloc (COB_SMALL_BUFF); } snprintf (plexbuff1, COB_SMALL_MAX, "%s/%s", lib, name); s = plexbuff1; } else { s = (char *)name; } /* Find the file */ if (stat (s, &st) == 0) { return ppopen (s, replace_list); } if (!plexbuff2) { plexbuff2 = cobc_malloc (COB_SMALL_BUFF); } for (el = cb_extension_list; el; el = el->next) { snprintf (plexbuff2, COB_SMALL_MAX, "%s%s", s, el->text); if (stat (plexbuff2, &st) == 0) { return ppopen (plexbuff2, replace_list); } } if (*s != '/') { for (il = cb_include_list; il; il = il->next) { for (el = cb_extension_list; el; el = el->next) { snprintf (plexbuff2, COB_SMALL_MAX, "%s/%s%s", il->text, name, el->text); if (stat (plexbuff2, &st) == 0) { return ppopen (plexbuff2, replace_list); } } } } cb_error (_("%s: %s"), name, strerror (errno)); return -1; } /* Check directives */ /* This is horrible but we have to parse directives directly after the read */ /* as flex buffers up input and it is then too late to use the flex parser */ static void check_directive (char *buff, int *line_size) { char *s; char *dirptr; size_t cnt; int n; char sbuff[5][256]; if (cb_source_format == CB_FORMAT_FIXED) { if (*line_size < 8) { return; } if (buff[6] != ' ') { return; } s = &buff[7]; } else { s = buff; } for (; *s == ' '; s++) { ; } dirptr = s; if (*s != '>') { return; } s++; if (*s != '>') { return; } s++; if (*s == 'D') { if (cb_flag_debugging_line) { memset (dirptr, ' ', 3); } else { for (cnt = 0; cnt < newline_count; cnt++) { buff[cnt] = '\n'; } buff[cnt] = 0; strcat (buff, " *> DEBUG\n"); *line_size = strlen (buff); newline_count = 0; } return; } memset (sbuff[0], 0, sizeof (sbuff)); n = sscanf (s, "%255s %255s %255s %255s %255s", sbuff[0], sbuff[1], sbuff[2], sbuff[3], sbuff[4]); for (cnt = 0; cnt < newline_count; cnt++) { buff[cnt] = '\n'; } buff[cnt] = 0; newline_count = 0; strcat (buff, " *> DIRECTIVE\n"); *line_size = strlen (buff); if (n < 2 || strcasecmp (sbuff[0], "SOURCE")) { cb_warning (_("Invalid directive - ignored")); return; } switch (n) { case 2: if (!strcasecmp (sbuff[1], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[1], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; case 3: if (strcasecmp (sbuff[1], "FORMAT") && strcasecmp (sbuff[1], "IS")) { break; } if (!strcasecmp (sbuff[2], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[2], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; default: if (strcasecmp (sbuff[1], "FORMAT")) { break; } if (strcasecmp (sbuff[2], "IS")) { break; } if (!strcasecmp (sbuff[3], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[3], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; } cb_warning (_("Invalid directive - ignored")); } /* * Read line */ static int ppinput (char *buff, int max_size) { char *bp; size_t gotcr; size_t continuation = 0; int ipchar; int i; int n; int coln; start: /* read a line */ gotcr = 0; ipchar = 0; for (n = 0; n < 256 && ipchar != '\n';) { ipchar = getc (ppin); if (ipchar == EOF) { if (newline_count == 0) { return 0; } memset (buff, '\n', newline_count); buff[newline_count] = 0; newline_count = 0; return strlen (buff); } if (n == 0 && cb_source_format != CB_FORMAT_FIXED) { if (ipchar != ' ' && ipchar != '\n') { buff[n++] = ' '; } } if (gotcr) { if (ipchar != '\n') { buff[n++] = '\r'; } gotcr = 0; } if (ipchar == '\r') { gotcr = 1; } else if (ipchar == '\t') { buff[n++] = ' '; while (n % cb_tab_width != 0) { buff[n++] = ' '; } } else { buff[n++] = ipchar; } } if (buff[n - 1] != '\n') { cb_warning (_("Line not terminated by a newline")); buff[n++] = '\n'; } buff[n] = 0; check_directive (buff, &n); /* nothing more to do with free format */ if (cb_source_format != CB_FORMAT_FIXED) { return n; } /* line too short */ if (n < 8) { newline_count++; goto start; } if (cb_flag_mfcomment) { if (buff[0] == '*' || buff[0] == '/') { newline_count++; goto start; } } /* check the indicator (column 7) */ bp = buff + 7; switch (buff[6]) { case ' ': break; case '-': continuation = 1; break; case 'd': case 'D': /* debugging line */ if (cb_flag_debugging_line) { break; } newline_count++; goto start; case '*': case '/': /* comment line */ newline_count++; goto start; default: /* invalid indicator */ cb_error (_("Invalid indicator '%c' at column 7"), buff[6]); return YY_NULL; } /* skip comments that follow after AUTHORS, etc. */ if (within_comment) { /* Check all of "Area A" */ switch (n) { case 8: if (buff[7] == ' ') { newline_count++; goto start; } break; case 9: if (!memcmp (&buff[7], " ", 2)) { newline_count++; goto start; } break; case 10: if (!memcmp (&buff[7], " ", 3)) { newline_count++; goto start; } break; default: if (!memcmp (&buff[7], " ", 4)) { newline_count++; goto start; } break; } within_comment = 0; } /* check the text that is longer than cb_text_column */ if (n > cb_text_column + 1) { /* show warning if it is not whitespaces */ if (cb_warn_column_overflow && last_line_2 < cb_source_line - 1) { for (coln = cb_text_column; coln < n; coln++) { if (buff[coln] != ' ' && buff[coln] != '\n') { cb_warning (_("Source text after column %d"), cb_text_column); break; } } } /* remove it */ strcpy (buff + cb_text_column, "\n"); last_line_2 = cb_source_line; n = cb_text_column + 1; } /* skip blank lines */ for (i = 7; buff[i] == ' '; i++) ; if (buff[i] == '\n') { newline_count++; goto start; } if (continuation) { /* line continuation */ for (; *bp == ' '; bp++) ; /* validate concatenation */ if (consecutive_quotation) { if (bp[0] == quotation_mark && bp[1] == quotation_mark) { bp++; } else { cb_error (_("Invalid line continuation")); return YY_NULL; } quotation_mark = 0; consecutive_quotation = 0; } else if (quotation_mark) { /* literal concatenation */ if (*bp == quotation_mark) { bp++; } else { cb_error (_("Invalid line continuation")); return YY_NULL; } } } else { /* normal line */ quotation_mark = 0; consecutive_quotation = 0; } /* check if string literal is to be continued */ for (i = bp - buff; buff[i] != '\n'; i++) { if (buff[i] == '\'' || buff[i] == '\"') { if (quotation_mark == 0) { /* literal start */ quotation_mark = buff[i]; } else if (quotation_mark == buff[i]) { if (i == cb_text_column - 1) { /* consecutive quotation */ consecutive_quotation = 1; } else { /* literal end */ quotation_mark = 0; } } } } /* truncate trailing spaces, including the newline */ if (quotation_mark) { for (; i < 72;) { buff[i++] = ' '; } buff[i] = 0; } else { for (i--; buff[i] == ' '; i--) ; if (buff[i] == '\'' || buff[i] == '\"') { buff[++i] = ' '; } buff[i + 1] = 0; } if (continuation) { memmove (buff, bp, strlen (bp) + 1); newline_count++; } else { /* insert newlines at the start of the buffer */ memmove (buff + newline_count, bp, strlen (bp) + 1); memset (buff, '\n', newline_count); newline_count = 1; } return strlen (buff); } static void ppecho (const char *text) { struct cb_replace_list *r; struct cb_text_list *l; struct cb_text_list *queue; if (text_queue == NULL && (text[0] == ' ' || text[0] == '\n')) { fputs (text, ppout); } else if (!current_replace_list) { for (; text_queue; text_queue = text_queue->next) { fputs (text_queue->text, ppout); } fputs (text, ppout); } else { /* Do replacement */ text_queue = cb_text_list_add (text_queue, text); for (r = current_replace_list; r; r = r->next) { queue = text_queue; for (l = r->old_text; l; l = l->next) { while (l && (l->text[0] == ' ' || l->text[0] == '\n')) { l = l->next; } if (l == NULL) { break; } while (queue && (queue->text[0] == ' ' || queue->text[0] == '\n')) { queue = queue->next; } if (queue == NULL) { return; /* partial match */ } if (strcasecmp (l->text, queue->text) != 0) { break; } queue = queue->next; } if (l == NULL) { /* match */ for (l = r->new_text; l; l = l->next) { fputs (l->text, ppout); } /* text_queue = queue ? queue->next : NULL; */ text_queue = queue; continue; } } /* no match */ for (; text_queue; text_queue = text_queue->next) { fputs (text_queue->text, ppout); } } } open-cobol-1.1/cobc/pplex.l0000644000000000000000000003616611142777154011277 /* -*- c -*- * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * 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 software; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ %option 8bit %option caseless %option noyywrap %option never-interactive %option prefix="pp" %{ #include "config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include #include "cobc.h" #include "ppparse.h" static char *plexbuff1 = NULL; static char *plexbuff2 = NULL; static size_t newline_count = 0; static size_t within_comment = 0; static size_t inside_bracket = 0; static size_t consecutive_quotation = 0; static int quotation_mark = 0; static int last_line_1 = -1; static int last_line_2 = -1; static struct cb_replace_list *current_replace_list = NULL; static struct cb_text_list *text_queue = NULL; static struct copy_info { struct copy_info *next; char *file; int line; int replacing; int quotation_mark; YY_BUFFER_STATE buffer; } *copy_stack = NULL; #define YY_INPUT(buf,result,max_size) result = ppinput (buf, max_size); static int ppinput (char *buf, int max_size); static void ppecho (const char *text); static void switch_to_buffer (const int lineno, const char *filename, YY_BUFFER_STATE buffer); %} WORD [_0-9A-Z-]+ NUMRIC_LITERAL [+-]?[0-9,.]*[0-9] ALNUM_LITERAL \"[^\"\n]*\"|\'[^\'\n]*\' %x PROCESS_STATE COPY_STATE PSEUDO_STATE %% %{ %} <*>"*>".* { ppecho (" "); } <*>^"*".* | <*>^"/".* { ppecho (" "); if (cb_source_format != CB_FORMAT_FIXED) { ppecho (yytext); } } "PROCESS" { BEGIN PROCESS_STATE; } { \n { BEGIN INITIAL; unput ('\n'); } .* { cb_warning (_("PROCESS statement is ignored")); } } "COPY" { BEGIN COPY_STATE; return COPY; } "INCLUDE" { BEGIN COPY_STATE; return COPY; } "REPLACE" { BEGIN COPY_STATE; return REPLACE; } { [,;]?\n { ECHO; cb_source_line++; } [,;]?[ ]+ { /* ignore */ } "." { BEGIN INITIAL; return '.'; } "==" { BEGIN PSEUDO_STATE; return EQEQ; } "(" { return '('; } ")" { return ')'; } "BY" { return BY; } "IN" { return IN; } "OF" { return OF; } "OFF" { return OFF; } "SUPPRESS" { return SUPPRESS; } "PRINTING" { return PRINTING; } "REPLACING" { return REPLACING; } {WORD} | {NUMRIC_LITERAL} | {ALNUM_LITERAL} | . { pplval.s = strdup (yytext); return TOKEN; } } { [,;]?\n { ECHO; cb_source_line++; } [,;]?[ ]+ { pplval.s = strdup (" "); return TOKEN; } "==" { BEGIN COPY_STATE; return EQEQ; } {WORD} | {NUMRIC_LITERAL} | {ALNUM_LITERAL} | . { pplval.s = strdup (yytext); return TOKEN; } } "AUTHOR" | "DATE-WRITTEN" | "DATE-MODIFIED" | "DATE-COMPILED" | "INSTALLATION" | "REMARKS" | "SECURITY" { /* these words are treated as comments */ if (cb_verify (cb_author_paragraph, yytext)) { /* skip comments until the end of line */ int c; within_comment = 1; while ((c = input ()) != EOF) { if (c == '\n') { break; } } unput (c); } } "EJECT"\.? | "SKIP1"\.? | "SKIP2"\.? | "SKIP3"\.? { /* these words are comments in IBM COBOL */ if (cb_verify (cb_eject_statement, yytext)) { /* do nothing for now */ } else { ECHO; } } [,;]?\n { ppecho ("\n"); cb_source_line++; } [;]?[ ]+ { ppecho (" "); } [,]?[ ]+ { if (inside_bracket) { ppecho (", "); } else { ppecho (" "); } } "(" { inside_bracket++; ppecho ("("); } ")" { if (inside_bracket) { inside_bracket--; } ppecho (")"); } {WORD} | {NUMRIC_LITERAL} | {ALNUM_LITERAL} | . { ppecho (yytext); } <> { struct copy_info *p; p = copy_stack; yy_delete_buffer (YY_CURRENT_BUFFER); /* Terminate at the end of all input */ if (p->next == NULL) { within_comment = 0; newline_count = 0; inside_bracket = 0; current_replace_list = NULL; text_queue = NULL; copy_stack = NULL; quotation_mark = 0; consecutive_quotation = 0; last_line_1 = -1; last_line_2 = -1; yyterminate (); } /* Close the current file */ fclose (ppin); /* Switch to the last buffer */ if (p->replacing) { pp_set_replace_list (NULL); } switch_to_buffer (p->line, p->file, p->buffer); quotation_mark = p->quotation_mark; copy_stack = p->next; free (p); } %% void pp_set_replace_list (struct cb_replace_list *list) { current_replace_list = list; } static void switch_to_buffer (const int line, const char *file, YY_BUFFER_STATE buffer) { char *p; cb_source_line = line; cb_source_file = strdup (file); for (p = cb_source_file; *p; p++) { if (*p == '\\') { *p = '/'; } } yy_switch_to_buffer (buffer); fprintf (yyout, "# %d \"%s\"\n", line, cb_source_file); } int ppopen (const char *name, struct cb_replace_list *replace_list) { struct copy_info *p; for (; newline_count > 0; newline_count--) { ungetc ('\n', ppin); } /* Open the copy file */ ppin = fopen (name, "rb"); if (!ppin) { if (cb_source_file) { cb_error (_("%s: %s"), name, strerror (errno)); } else { perror (name); } return -1; } /* Add to dependency list */ if (cb_depend_file) { cb_depend_list = cb_text_list_add (cb_depend_list, name); } /* Preserve the current buffer */ p = cobc_malloc (sizeof (struct copy_info)); p->line = cb_source_line; p->file = cb_source_file; p->replacing = replace_list ? 1 : 0; p->buffer = YY_CURRENT_BUFFER; p->quotation_mark = quotation_mark; p->next = copy_stack; copy_stack = p; /* Switch to new buffer */ if (replace_list) { pp_set_replace_list (replace_list); } switch_to_buffer (1, name, yy_create_buffer (ppin, YY_BUF_SIZE)); return 0; } int ppcopy (const char *name, const char *lib, struct cb_replace_list *replace_list) { struct cb_text_list *il; struct cb_text_list *el; char *s; struct stat st; if (lib) { if (!plexbuff1) { plexbuff1 = cobc_malloc (COB_SMALL_BUFF); } snprintf (plexbuff1, COB_SMALL_MAX, "%s/%s", lib, name); s = plexbuff1; } else { s = (char *)name; } /* Find the file */ if (stat (s, &st) == 0) { return ppopen (s, replace_list); } if (!plexbuff2) { plexbuff2 = cobc_malloc (COB_SMALL_BUFF); } for (el = cb_extension_list; el; el = el->next) { snprintf (plexbuff2, COB_SMALL_MAX, "%s%s", s, el->text); if (stat (plexbuff2, &st) == 0) { return ppopen (plexbuff2, replace_list); } } if (*s != '/') { for (il = cb_include_list; il; il = il->next) { for (el = cb_extension_list; el; el = el->next) { snprintf (plexbuff2, COB_SMALL_MAX, "%s/%s%s", il->text, name, el->text); if (stat (plexbuff2, &st) == 0) { return ppopen (plexbuff2, replace_list); } } } } cb_error (_("%s: %s"), name, strerror (errno)); return -1; } /* Check directives */ /* This is horrible but we have to parse directives directly after the read */ /* as flex buffers up input and it is then too late to use the flex parser */ static void check_directive (char *buff, int *line_size) { char *s; char *dirptr; size_t cnt; int n; char sbuff[5][256]; if (cb_source_format == CB_FORMAT_FIXED) { if (*line_size < 8) { return; } if (buff[6] != ' ') { return; } s = &buff[7]; } else { s = buff; } for (; *s == ' '; s++) { ; } dirptr = s; if (*s != '>') { return; } s++; if (*s != '>') { return; } s++; if (*s == 'D') { if (cb_flag_debugging_line) { memset (dirptr, ' ', 3); } else { for (cnt = 0; cnt < newline_count; cnt++) { buff[cnt] = '\n'; } buff[cnt] = 0; strcat (buff, " *> DEBUG\n"); *line_size = strlen (buff); newline_count = 0; } return; } memset (sbuff[0], 0, sizeof (sbuff)); n = sscanf (s, "%255s %255s %255s %255s %255s", sbuff[0], sbuff[1], sbuff[2], sbuff[3], sbuff[4]); for (cnt = 0; cnt < newline_count; cnt++) { buff[cnt] = '\n'; } buff[cnt] = 0; newline_count = 0; strcat (buff, " *> DIRECTIVE\n"); *line_size = strlen (buff); if (n < 2 || strcasecmp (sbuff[0], "SOURCE")) { cb_warning (_("Invalid directive - ignored")); return; } switch (n) { case 2: if (!strcasecmp (sbuff[1], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[1], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; case 3: if (strcasecmp (sbuff[1], "FORMAT") && strcasecmp (sbuff[1], "IS")) { break; } if (!strcasecmp (sbuff[2], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[2], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; default: if (strcasecmp (sbuff[1], "FORMAT")) { break; } if (strcasecmp (sbuff[2], "IS")) { break; } if (!strcasecmp (sbuff[3], "FIXED")) { cb_source_format = CB_FORMAT_FIXED; return; } if (!strcasecmp (sbuff[3], "FREE")) { cb_source_format = CB_FORMAT_FREE; return; } break; } cb_warning (_("Invalid directive - ignored")); } /* * Read line */ static int ppinput (char *buff, int max_size) { char *bp; size_t gotcr; size_t continuation = 0; int ipchar; int i; int n; int coln; start: /* read a line */ gotcr = 0; ipchar = 0; for (n = 0; n < 256 && ipchar != '\n';) { ipchar = getc (ppin); if (ipchar == EOF) { if (newline_count == 0) { return 0; } memset (buff, '\n', newline_count); buff[newline_count] = 0; newline_count = 0; return strlen (buff); } if (n == 0 && cb_source_format != CB_FORMAT_FIXED) { if (ipchar != ' ' && ipchar != '\n') { buff[n++] = ' '; } } if (gotcr) { if (ipchar != '\n') { buff[n++] = '\r'; } gotcr = 0; } if (ipchar == '\r') { gotcr = 1; } else if (ipchar == '\t') { buff[n++] = ' '; while (n % cb_tab_width != 0) { buff[n++] = ' '; } } else { buff[n++] = ipchar; } } if (buff[n - 1] != '\n') { cb_warning (_("Line not terminated by a newline")); buff[n++] = '\n'; } buff[n] = 0; check_directive (buff, &n); /* nothing more to do with free format */ if (cb_source_format != CB_FORMAT_FIXED) { return n; } /* line too short */ if (n < 8) { newline_count++; goto start; } if (cb_flag_mfcomment) { if (buff[0] == '*' || buff[0] == '/') { newline_count++; goto start; } } /* check the indicator (column 7) */ bp = buff + 7; switch (buff[6]) { case ' ': break; case '-': continuation = 1; break; case 'd': case 'D': /* debugging line */ if (cb_flag_debugging_line) { break; } newline_count++; goto start; case '*': case '/': /* comment line */ newline_count++; goto start; default: /* invalid indicator */ cb_error (_("Invalid indicator '%c' at column 7"), buff[6]); return YY_NULL; } /* skip comments that follow after AUTHORS, etc. */ if (within_comment) { /* Check all of "Area A" */ switch (n) { case 8: if (buff[7] == ' ') { newline_count++; goto start; } break; case 9: if (!memcmp (&buff[7], " ", 2)) { newline_count++; goto start; } break; case 10: if (!memcmp (&buff[7], " ", 3)) { newline_count++; goto start; } break; default: if (!memcmp (&buff[7], " ", 4)) { newline_count++; goto start; } break; } within_comment = 0; } /* check the text that is longer than cb_text_column */ if (n > cb_text_column + 1) { /* show warning if it is not whitespaces */ if (cb_warn_column_overflow && last_line_2 < cb_source_line - 1) { for (coln = cb_text_column; coln < n; coln++) { if (buff[coln] != ' ' && buff[coln] != '\n') { cb_warning (_("Source text after column %d"), cb_text_column); break; } } } /* remove it */ strcpy (buff + cb_text_column, "\n"); last_line_2 = cb_source_line; n = cb_text_column + 1; } /* skip blank lines */ for (i = 7; buff[i] == ' '; i++) ; if (buff[i] == '\n') { newline_count++; goto start; } if (continuation) { /* line continuation */ for (; *bp == ' '; bp++) ; /* validate concatenation */ if (consecutive_quotation) { if (bp[0] == quotation_mark && bp[1] == quotation_mark) { bp++; } else { cb_error (_("Invalid line continuation")); return YY_NULL; } quotation_mark = 0; consecutive_quotation = 0; } else if (quotation_mark) { /* literal concatenation */ if (*bp == quotation_mark) { bp++; } else { cb_error (_("Invalid line continuation")); return YY_NULL; } } } else { /* normal line */ quotation_mark = 0; consecutive_quotation = 0; } /* check if string literal is to be continued */ for (i = bp - buff; buff[i] != '\n'; i++) { if (buff[i] == '\'' || buff[i] == '\"') { if (quotation_mark == 0) { /* literal start */ quotation_mark = buff[i]; } else if (quotation_mark == buff[i]) { if (i == cb_text_column - 1) { /* consecutive quotation */ consecutive_quotation = 1; } else { /* literal end */ quotation_mark = 0; } } } } /* truncate trailing spaces, including the newline */ if (quotation_mark) { for (; i < 72;) { buff[i++] = ' '; } buff[i] = 0; } else { for (i--; buff[i] == ' '; i--) ; if (buff[i] == '\'' || buff[i] == '\"') { buff[++i] = ' '; } buff[i + 1] = 0; } if (continuation) { memmove (buff, bp, strlen (bp) + 1); newline_count++; } else { /* insert newlines at the start of the buffer */ memmove (buff + newline_count, bp, strlen (bp) + 1); memset (buff, '\n', newline_count); newline_count = 1; } return strlen (buff); } static void ppecho (const char *text) { struct cb_replace_list *r; struct cb_text_list *l; struct cb_text_list *queue; if (text_queue == NULL && (text[0] == ' ' || text[0] == '\n')) { fputs (text, ppout); } else if (!current_replace_list) { for (; text_queue; text_queue = text_queue->next) { fputs (text_queue->text, ppout); } fputs (text, ppout); } else { /* Do replacement */ text_queue = cb_text_list_add (text_queue, text); for (r = current_replace_list; r; r = r->next) { queue = text_queue; for (l = r->old_text; l; l = l->next) { while (l && (l->text[0] == ' ' || l->text[0] == '\n')) { l = l->next; } if (l == NULL) { break; } while (queue && (queue->text[0] == ' ' || queue->text[0] == '\n')) { queue = queue->next; } if (queue == NULL) { return; /* partial match */ } if (strcasecmp (l->text, queue->text) != 0) { break; } queue = queue->next; } if (l == NULL) { /* match */ for (l = r->new_text; l; l = l->next) { fputs (l->text, ppout); } /* text_queue = queue ? queue->next : NULL; */ text_queue = queue; continue; } } /* no match */ for (; text_queue; text_queue = text_queue->next) { fputs (text_queue->text, ppout); } } } open-cobol-1.1/copy/0000777000000000000000000000000011143001516010065 5open-cobol-1.1/copy/Makefile.am0000644000000000000000000000026511130701401012034 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2008-2009 Roger While ## copydir = @COB_COPY_DIR@ copy_DATA = screenio.cpy EXTRA_DIST = $(copy_DATA) open-cobol-1.1/copy/Makefile.in0000644000000000000000000002470711130703170012061 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = copy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(copydir)" copyDATA_INSTALL = $(INSTALL_DATA) DATA = $(copy_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ copydir = @COB_COPY_DIR@ copy_DATA = screenio.cpy EXTRA_DIST = $(copy_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu copy/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu copy/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-copyDATA: $(copy_DATA) @$(NORMAL_INSTALL) test -z "$(copydir)" || $(mkdir_p) "$(DESTDIR)$(copydir)" @list='$(copy_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(copyDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(copydir)/$$f'"; \ $(copyDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(copydir)/$$f"; \ done uninstall-copyDATA: @$(NORMAL_UNINSTALL) @list='$(copy_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(copydir)/$$f'"; \ rm -f "$(DESTDIR)$(copydir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(copydir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-copyDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-copyDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-copyDATA install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-copyDATA uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/copy/screenio.cpy0000644000000000000000000000723711142010722012334 *> Colors 78 COB-COLOR-BLACK VALUE 0. 78 COB-COLOR-BLUE VALUE 1. 78 COB-COLOR-GREEN VALUE 2. 78 COB-COLOR-CYAN VALUE 3. 78 COB-COLOR-RED VALUE 4. 78 COB-COLOR-MAGENTA VALUE 5. 78 COB-COLOR-YELLOW VALUE 6. 78 COB-COLOR-WHITE VALUE 7. *> *> Values that may be returned in CRT STATUS (or COB-CRT-STATUS) *> Normal return - Value 0000 78 COB-SCR-OK VALUE 0. *> Function keys - Values 1xxx 78 COB-SCR-F1 VALUE 1001. 78 COB-SCR-F2 VALUE 1002. 78 COB-SCR-F3 VALUE 1003. 78 COB-SCR-F4 VALUE 1004. 78 COB-SCR-F5 VALUE 1005. 78 COB-SCR-F6 VALUE 1006. 78 COB-SCR-F7 VALUE 1007. 78 COB-SCR-F8 VALUE 1008. 78 COB-SCR-F9 VALUE 1009. 78 COB-SCR-F10 VALUE 1010. 78 COB-SCR-F11 VALUE 1011. 78 COB-SCR-F12 VALUE 1012. 78 COB-SCR-F13 VALUE 1013. 78 COB-SCR-F14 VALUE 1014. 78 COB-SCR-F15 VALUE 1015. 78 COB-SCR-F16 VALUE 1016. 78 COB-SCR-F17 VALUE 1017. 78 COB-SCR-F18 VALUE 1018. 78 COB-SCR-F19 VALUE 1019. 78 COB-SCR-F20 VALUE 1020. 78 COB-SCR-F21 VALUE 1021. 78 COB-SCR-F22 VALUE 1022. 78 COB-SCR-F23 VALUE 1023. 78 COB-SCR-F24 VALUE 1024. 78 COB-SCR-F25 VALUE 1025. 78 COB-SCR-F26 VALUE 1026. 78 COB-SCR-F27 VALUE 1027. 78 COB-SCR-F28 VALUE 1028. 78 COB-SCR-F29 VALUE 1029. 78 COB-SCR-F30 VALUE 1030. 78 COB-SCR-F31 VALUE 1031. 78 COB-SCR-F32 VALUE 1032. 78 COB-SCR-F33 VALUE 1033. 78 COB-SCR-F34 VALUE 1034. 78 COB-SCR-F35 VALUE 1035. 78 COB-SCR-F36 VALUE 1036. 78 COB-SCR-F37 VALUE 1037. 78 COB-SCR-F38 VALUE 1038. 78 COB-SCR-F39 VALUE 1039. 78 COB-SCR-F40 VALUE 1040. 78 COB-SCR-F41 VALUE 1041. 78 COB-SCR-F42 VALUE 1042. 78 COB-SCR-F43 VALUE 1043. 78 COB-SCR-F44 VALUE 1044. 78 COB-SCR-F45 VALUE 1045. 78 COB-SCR-F46 VALUE 1046. 78 COB-SCR-F47 VALUE 1047. 78 COB-SCR-F48 VALUE 1048. 78 COB-SCR-F49 VALUE 1049. 78 COB-SCR-F50 VALUE 1050. 78 COB-SCR-F51 VALUE 1051. 78 COB-SCR-F52 VALUE 1052. 78 COB-SCR-F53 VALUE 1053. 78 COB-SCR-F54 VALUE 1054. 78 COB-SCR-F55 VALUE 1055. 78 COB-SCR-F56 VALUE 1056. 78 COB-SCR-F57 VALUE 1057. 78 COB-SCR-F58 VALUE 1058. 78 COB-SCR-F59 VALUE 1059. 78 COB-SCR-F60 VALUE 1060. 78 COB-SCR-F61 VALUE 1061. 78 COB-SCR-F62 VALUE 1062. 78 COB-SCR-F63 VALUE 1063. 78 COB-SCR-F64 VALUE 1064. *> Exception keys - Values 2xxx 78 COB-SCR-PAGE_UP VALUE 2001. 78 COB-SCR-PAGE_DOWN VALUE 2002. 78 COB-SCR-KEY-UP VALUE 2003. 78 COB-SCR-KEY-DOWN VALUE 2004. 78 COB-SCR-ESC VALUE 2005. 78 COB-SCR-PRINT VALUE 2006. *> Input validation - Values 8xxx 78 COB-SCR-NO-FIELD VALUE 8000. *> Other errors - Values 9xxx 78 COB-SCR-FATAL VALUE 9000. open-cobol-1.1/copy/ChangeLog0000644000000000000000000000057011070703215011561 2008-08-09 Roger While * Add color definitions to screenio.cpy 2008-07-05 Roger While * Extend screenio.cpy 2008-06-24 Roger While * Add screenio.cpy 2008-04-16 Roger While * New directory "copy" for OC supplied COPY elements * Add Makefile*, ChangeLog, sqlca.cpy, sqlda.cpy open-cobol-1.1/texi/0000777000000000000000000000000011143001517010065 5open-cobol-1.1/texi/open-cobol.info0000644000000000000000000005265011140121416012721 This is open-cobol.info, produced by makeinfo version 4.8 from open-cobol.texi. INFO-DIR-SECTION COBOL START-INFO-DIR-ENTRY * OpenCOBOL: (open-cobol). A COBOL compiler END-INFO-DIR-ENTRY This file documents OpenCOBOL, a COBOL compiler Copyright (C) 2002-2008 Keisuke Nishida Copyright (C) 2007-2008 Roger While Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  File: open-cobol.info, Node: Top, Next: Getting Started, Prev: (dir), Up: (dir) OpenCOBOL Manual **************** OpenCOBOL is an open-source COBOL compiler, which translates COBOL programs to C code and compiles it using GCC. This manual corresponds to OpenCOBOL 1.1. * Menu: * Getting Started:: Introduction to OpenCOBOL * Compile:: Compiling COBOL programs * Customize:: Customizing the compiler * Optimize:: Optimizing your program * Debug:: Debugging your program --- The Detailed Node Listing --- Getting Started * Hello World!:: Hello World! Compile * Compiler Options:: Compiler options * Multiple Sources:: Compiling multiple source files * C Interface:: Dealing with C files Compiler Options * Built Target:: Built Target * Source Format:: Source Format * Warning Options:: Warning Options Multiple Sources * Static Linking:: Compiling into a single executable * Dynamic Linking:: A main program and separate modules * Building Library:: Building a shared library * Using Library:: Using external libraries C Interface * Main C Program:: Writing Main Program in C * Static C to COBOL:: * Dynamic C to COBOL:: * Static COBOL to C:: * Dynamic COBOL to C:: Customize * Customizing Compiler:: Customizing Compiler * Customizing Library:: Customizing Library Optimize * Optimize Options:: How to enable optimization * Optimize Call:: Call subroutines efficiently * Optimize Binary:: Use efficient binary representation Debug * Debug Options:: Debug options  File: open-cobol.info, Node: Getting Started, Next: Compile, Prev: Top, Up: Top 1 Getting Started ***************** * Menu: * Hello World!:: Hello World!  File: open-cobol.info, Node: Hello World!, Prev: Getting Started, Up: Getting Started 1.1 Hello World! ================ This is a sample program that displays "Hello World": ---- hello.cob ------------------------- * Sample COBOL program IDENTIFICATION DIVISION. PROGRAM-ID. hello. PROCEDURE DIVISION. DISPLAY "Hello World!". STOP RUN. ---------------------------------------- The compiler is `cobc', which is executed as follows: $ cobc -x hello.cob $ ./hello Hello World! The executable file name (i.e., `hello' in this case) is determined by removing the extension from the source file name. You can specify the executable file name by specifying the compiler option `-o' as follows: $ cobc -x -o hello-world hello.cob $ ./hello-world Hello World!  File: open-cobol.info, Node: Compile, Next: Customize, Prev: Getting Started, Up: Top 2 Compile ********* This chapter describes how to compile COBOL programs using OpenCOBOL. * Menu: * Compiler Options:: Compiler options * Multiple Sources:: Compiling multiple source files * C Interface:: Dealing with C files  File: open-cobol.info, Node: Compiler Options, Next: Multiple Sources, Prev: Compile, Up: Compile 2.1 Compiler Options ==================== The compiler `cobc' accepts the options described in this section. * Menu: * Built Target:: Built Target * Source Format:: Source Format * Warning Options:: Warning Options  File: open-cobol.info, Node: Built Target, Next: Source Format, Prev: Compiler Options, Up: Compiler Options 2.1.1 Built Target ------------------ The following options specify the target type produced by the compiler: `-E' Preprocess only. Compiler directives are executed. Comment lines are removed. COPY statements are expanded. The output goes to the standard-out. `-C' Translation only. COBOL source files are translated into C files. The output is saved in file `*.c'. `-S' Compile only. Translated C files are compiled by cc. The output is saved in file `*.s'. `-c' Compile and assemble. This is equivalent to `cc -c'. The output is saved in file `*.o'. `-m' Compile, assemble, and build a dynamically loadable module (i.e., a shared library). The output is saved in file `*.so'. (1). `-x' Include the main function in the output. This option takes effect at the translation stage. If you give this option with `-C', you will see the main function at the end of the generated C file. Without any options above, the compiler tries to build a dynamically loadable module. ---------- Footnotes ---------- (1) The extension varies depending on your host.  File: open-cobol.info, Node: Source Format, Next: Warning Options, Prev: Built Target, Up: Compiler Options 2.1.2 Source Format ------------------- OpenCOBOL supports both fixed and free source format. The default format is the fixed format. This can be explicitly overwritten by one of the following options: `-free' Free format. `-fixed' Fixed format.  File: open-cobol.info, Node: Warning Options, Prev: Source Format, Up: Compiler Options 2.1.3 Warning Options --------------------- `-Wall' Enable all warnings `-Wcolumn-overflow' Warn any text after column 72 `-Wend-evaluate' Warn lacks of END-EVALUATE `-Wend-if' Warn lacks of END-IF `-Wparentheses' Warn lacks of parentheses around AND within OR  File: open-cobol.info, Node: Multiple Sources, Next: C Interface, Prev: Compiler Options, Up: Compile 2.2 Multiple Sources ==================== A program often consists of multiple source files. This section describes how to compile multiple source files. This section also describes how to build a shared library that can be used by any COBOL programs and how to use external libraries from COBOL programs. * Menu: * Static Linking:: Compiling into a single executable * Dynamic Linking:: A main program and separate modules * Building Library:: Building a shared library * Using Library:: Using external libraries  File: open-cobol.info, Node: Static Linking, Next: Dynamic Linking, Prev: Multiple Sources, Up: Multiple Sources 2.2.1 Static Linking -------------------- The easiest way of combining multiple files is to compile them into a single executable. One way is to specify all files on the command line: $ cobc -x -o prog main.cob subr1.cob subr2.cob Another way is to compile each file with the option `-c', and link them at the end. The top-level program must be compiled with the option `-x': $ cobc -c subr1.cob $ cobc -c subr2.cob $ cobc -c -x main.cob $ cobc -x -o prog main.o subr1.o subr2.o You can link C routines as well using either method: Method 1: $ cobc -o prog main.cob subrs.c Method 2: $ cc -c subrs.c $ cobc -c -x main.cob $ cobc -x -o prog main.o subrs.o Any number of functions can be contained in a single C file. The linked programs will be called dynamically; that is, the symbol will be resolved at run time. For example, the following COBOL statement CALL "subr" USING X. will be converted into an equivalent C code like this: int (*func)() = cob_resolve("subr"); if (func != NULL) func (X); With the compiler options `-fstatic-call', more efficient code will be generated like this: subr(X); Note that this option is effective only when the called program name is a literal (like `CALL "subr".'). With a data name (like `CALL SUBR.'), the program is still called dynamically.  File: open-cobol.info, Node: Dynamic Linking, Next: Building Library, Prev: Static Linking, Up: Multiple Sources 2.2.2 Dynamic Linking --------------------- There are two methods to achieve this. Method 1 (Using driver program). Compile all programs with the option `-m': $ cobc -m main.cob subr.cob This creates shared object files `main.so subr.so' (1). Before running the main program, install the module files in your library directory: $ cp subr.so /your/cobol/lib Set the environment variable `COB_LIBRARY_PATH' to your library directory, and run the main program: $ export COB_LIBRARY_PATH=/your/cobol/lib Note: You may set the variable to directly point to the directory where you compiled the sources. Now execute your program: $ cobcrun main Method 2. The main program and subprograms can be compiled separately. The main program is compiled as usual: $ cobc -x -o main main.cob Subprograms are compiled with the option `-m': $ cobc -m subr.cob This creates a module file `subr.so' (2). Before running the main program, install the module files in your library directory: $ cp subr.so /your/cobol/lib Now, set the environment variable `COB_LIBRARY_PATH' to your library directory, and run the main program: $ export COB_LIBRARY_PATH=/your/cobol/lib $ ./main ---------- Footnotes ---------- (1) The extension varies depending on your host. (2) The extension varies depending on your host.  File: open-cobol.info, Node: Building Library, Next: Using Library, Prev: Dynamic Linking, Up: Multiple Sources 2.2.3 Building Library ---------------------- You can build a shared library by combining multiple COBOL programs and even C routines: $ cobc -c subr1.cob $ cobc -c subr2.cob $ cc -c subr3.c $ cc -shared -o libsubrs.so subr1.o subr2.o subr3.o  File: open-cobol.info, Node: Using Library, Prev: Building Library, Up: Multiple Sources 2.2.4 Using Library ------------------- You can use a shared library by linking it with your main program. Before linking the library, install it in your system library directory: $ cp libsubrs.so /usr/lib or install it somewhere else and set `LD_LIBRARY_PATH': $ cp libsubrs.so /your/cobol/lib $ export LD_LIBRARY_PATH=/your/cobol/lib Then, compile the main program, linking the library as follows: $ cobc -x main.cob -L/your/cobol/lib -lsubrs  File: open-cobol.info, Node: C Interface, Prev: Multiple Sources, Up: Compile 2.3 C Interface =============== This chapter describes how to combine C programs with COBOL programs. * Menu: * Main C Program:: Writing Main Program in C * Static C to COBOL:: * Dynamic C to COBOL:: * Static COBOL to C:: * Dynamic COBOL to C::  File: open-cobol.info, Node: Main C Program, Next: Static C to COBOL, Prev: C Interface, Up: C Interface 2.3.1 Writing Main Program in C ------------------------------- Include `libcob.h' in your C program. Call `cob_init' before using any COBOL module: #include int main (int argc, char **argv) { /* initialize your program */ ... /* initialize the COBOL run-time library */ cob_init (argc, argv); /* rest of your program */ ... /* Clean up and terminate - This does not return */ cob_stop_run (return_status); } You can write `cobc_init(0, NULL);' if you do not want to pass command line arguments to COBOL. You can compile your C program as follows: cc -c `cob-config --cflags` main.c The compiled object must be linked with libcob as follows: cc -o main main.o `cob-config --libs`  File: open-cobol.info, Node: Static C to COBOL, Next: Dynamic C to COBOL, Prev: Main C Program, Up: C Interface 2.3.2 Static linking with COBOL programs ---------------------------------------- Let's call the following COBOL module from a C program: ---- say.cob --------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. say. ENVIRONMENT DIVISION. DATA DIVISION. LINKAGE SECTION. 01 HELLO PIC X(6). 01 WORLD PIC X(6). PROCEDURE DIVISION USING HELLO WORLD. DISPLAY HELLO WORLD. EXIT PROGRAM. ---------------------------------------- This program accepts two arguments, displays them, and exit. From the viewpoint of C, this is equivalent to a function having the following prototype: extern int say(char *hello, char *world); So, your main program will look like as follows: ---- hello.c --------------------------- #include extern int say(char *hello, char *world); int main() { int ret; char hello[7] = "Hello "; char world[7] = "World!"; cob_init(0, NULL); ret = say(hello, world); return ret; } ---------------------------------------- Compile these programs as follows: $ cc -c `cob-config --cflags` hello.c $ cobc -c -static say.cob $ cobc -x -o hello hello.o say.o $ ./hello Hello World!  File: open-cobol.info, Node: Dynamic C to COBOL, Next: Static COBOL to C, Prev: Static C to COBOL, Up: C Interface 2.3.3 Dynamic linking with COBOL programs ----------------------------------------- You can find a COBOL module having a specific PROGRAM-ID by using a C function `cob_resolve', which takes the module name as a string and returns a pointer to the module function. `cob_resolve' returns NULL if there is no module. In this case, the function `cob_resolve_error' returns the error message. Let's see an example: ---- hello-dynamic.c ------------------- #include static int (*say)(char *hello, char *world); int main() { int ret; char hello[7] = "Hello "; char world[7] = "World!"; cob_init(0, NULL); /* find the module with PROGRAM-ID "say". */ say = cob_resolve("say"); /* if there is no such module, show error and exit */ if (say == NULL) { fprintf(stderr, "%s\n", cob_resolve_error ()); exit(1); } /* call the module found and exit with the return code */ ret = say(hello, world); return ret; } ---------------------------------------- Compile these programs as follows: $ cc -c `cob-config --cflags` hello-dynamic.c $ cobc -x -o hello hello-dynamic.o $ cobc -m say.cob $ export COB_LIBRARY_PATH=. $ ./hello Hello World!  File: open-cobol.info, Node: Static COBOL to C, Next: Dynamic COBOL to C, Prev: Dynamic C to COBOL, Up: C Interface 2.3.4 Static linking with C programs ------------------------------------ Let's call the following C function from COBOL: ---- say.c ----------------------------- int say(char *hello, char *world) { int i; for (i = 0; i < 6; i++) putchar(hello[i]); for (i = 0; i < 6; i++) putchar(world[i]); putchar('\n'); return 0; } ---------------------------------------- This program is equivalent to the foregoing `say.cob'. Note that, unlike C, the arguments passed from COBOL programs are not terminated by the null character (i.e., `\0'). You can call this function in the same way you call COBOL programs: ---- hello.cob ------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. hello. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 HELLO PIC X(6) VALUE "Hello ". 01 WORLD PIC X(6) VALUE "World!". PROCEDURE DIVISION. CALL "say" USING HELLO WORLD. STOP RUN. ---------------------------------------- Compile these programs as follows: $ cc -c say.c $ cobc -c -static -x hello.cob $ cobc -x -o hello hello.o say.o $ ./hello Hello World!  File: open-cobol.info, Node: Dynamic COBOL to C, Prev: Static COBOL to C, Up: C Interface 2.3.5 Dynamic linking with C programs ------------------------------------- You can create a dynamic-linking module from a C program by passing an option `-shared' to the C compiler: $ cc -shared -o say.so say.c $ cobc -x hello.cob $ export COB_LIBRARY_PATH=. $ ./hello Hello World!  File: open-cobol.info, Node: Customize, Next: Optimize, Prev: Compile, Up: Top 3 Customize *********** * Menu: * Customizing Compiler:: Customizing Compiler * Customizing Library:: Customizing Library  File: open-cobol.info, Node: Customizing Compiler, Next: Customizing Library, Prev: Customize, Up: Customize 3.1 Customizing Compiler ======================== These settings are effective at compile-time. Environment variables (default value): `COB_CC' C compiler ("gcc") `COB_CFLAGS' Flags passed to the C compiler ("-I$(PREFIX)/include") `COB_LDFLAGS' Flags passed to the C compiler ("") `COB_LIBS' Standard libraries linked with the program ("-L$(PREFIX)/lib -lcob") `COB_LDADD' Additional libraries linked with the program ("")  File: open-cobol.info, Node: Customizing Library, Prev: Customizing Compiler, Up: Customize 3.2 Customizing Library ======================= These settings are effective at run-time. Environment variables (default value): `COB_LIBRARY_PATH' Dynamic-linking module path (".:$(PREFIX)/lib/open-cobol") `COB_DYNAMIC_RELOADING' Set to "yes" if modules must be reloaded when they are replaced ("no")  File: open-cobol.info, Node: Optimize, Next: Debug, Prev: Customize, Up: Top 4 Optimize ********** * Menu: * Optimize Options:: How to enable optimization * Optimize Call:: Call subroutines efficiently * Optimize Binary:: Use efficient binary representation  File: open-cobol.info, Node: Optimize Options, Next: Optimize Call, Prev: Optimize, Up: Optimize 4.1 Optimize Options ==================== There are three compiler options for optimization: `-O', `-Os' and `-O2'. These options enable optimization at both translation (from COBOL to C) and compilation (C to assembly) levels. Currently, there is no difference between these optimization options at the translation level. The option `-O', `-Os' or `-O2' is passed to the C compiler as it is and used for C level optimization.  File: open-cobol.info, Node: Optimize Call, Next: Optimize Binary, Prev: Optimize Options, Up: Optimize 4.2 Optimize Call ================= When a CALL statement is executed, the called program is linked at run time. By specifying the compiler option `-fstatic-call', you can statically link the program at compile time and call it efficiently. (*note Static Linking::)  File: open-cobol.info, Node: Optimize Binary, Prev: Optimize Call, Up: Optimize 4.3 Optimize Binary =================== By default, data items of usage binary or comp are stored in the big-endian form. On those machines whose native byte order is little-endian, this is not quite efficient. If you prefer, you can store binary items in the native form of your machine. Set the config option `binary-byteorder' to `native' in your config file (*note Customize::). In addition, setting the option `binary-size' to `2-4-8' or `1-2-4-8' is more efficient than others.  File: open-cobol.info, Node: Debug, Prev: Optimize, Up: Top 5 Debug ******* * Menu: * Debug Options:: Debug options  File: open-cobol.info, Node: Debug Options, Prev: Debug, Up: Debug 5.1 Debug Options ================= The compiler option `-debug' can be used during the development of your programs. It enables all run-time error checking, such as subscript boundary checks and numeric data checks, and displays run-time errors with source locations. The compiler option `-g' includes line directives in the output. This helps debugging your COBOL programs using GDB, but this feature is not complete and not very useful yet.  Tag Table: Node: Top1000 Node: Getting Started2809 Node: Hello World!2988 Node: Compile3873 Node: Compiler Options4234 Node: Built Target4599 Ref: Built Target-Footnote-15820 Node: Source Format5873 Node: Warning Options6253 Node: Multiple Sources6639 Node: Static Linking7321 Node: Dynamic Linking8846 Ref: Dynamic Linking-Footnote-110246 Ref: Dynamic Linking-Footnote-210299 Node: Building Library10352 Node: Using Library10737 Node: C Interface11310 Node: Main C Program11656 Node: Static C to COBOL12573 Node: Dynamic C to COBOL14061 Node: Static COBOL to C15513 Node: Dynamic COBOL to C16947 Node: Customize17354 Node: Customizing Compiler17580 Node: Customizing Library18160 Node: Optimize18583 Node: Optimize Options18888 Node: Optimize Call19430 Node: Optimize Binary19810 Node: Debug20392 Node: Debug Options20531  End Tag Table open-cobol-1.1/texi/open-cobol.texi0000644000000000000000000005124211070703215012740 \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename open-cobol.info @settitle OpenCOBOL Manual @footnotestyle end @setchapternewpage odd @c %**end of header @include version.texi @ifinfo @dircategory COBOL @direntry * OpenCOBOL: (open-cobol). A COBOL compiler @end direntry This file documents OpenCOBOL, a COBOL compiler Copyright @copyright{} 2002-2008 Keisuke Nishida Copyright @copyright{} 2007-2008 Roger While Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title OpenCOBOL Manual @subtitle for OpenCOBOL @value{VERSION} @author Keisuke Nishida / Roger While @page @vskip 0pt plus 1filll Edition @value{EDITION} @* Updated for OpenCOBOL @value{VERSION} @* @value{UPDATED} @* Copyright @copyright{} 2002-2008 Keisuke Nishida Copyright @copyright{} 2007-2008 Roger While Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @contents @node Top, Getting Started, (dir), (dir) @top OpenCOBOL Manual OpenCOBOL is an open-source COBOL compiler, which translates COBOL programs to C code and compiles it using GCC. This manual corresponds to OpenCOBOL @value{VERSION}. @menu * Getting Started:: Introduction to OpenCOBOL * Compile:: Compiling COBOL programs * Customize:: Customizing the compiler * Optimize:: Optimizing your program * Debug:: Debugging your program @detailmenu --- The Detailed Node Listing --- Getting Started * Hello World!:: Hello World! Compile * Compiler Options:: Compiler options * Multiple Sources:: Compiling multiple source files * C Interface:: Dealing with C files Compiler Options * Built Target:: Built Target * Source Format:: Source Format * Warning Options:: Warning Options Multiple Sources * Static Linking:: Compiling into a single executable * Dynamic Linking:: A main program and separate modules * Building Library:: Building a shared library * Using Library:: Using external libraries C Interface * Main C Program:: Writing Main Program in C * Static C to COBOL:: * Dynamic C to COBOL:: * Static COBOL to C:: * Dynamic COBOL to C:: Customize * Customizing Compiler:: Customizing Compiler * Customizing Library:: Customizing Library Optimize * Optimize Options:: How to enable optimization * Optimize Call:: Call subroutines efficiently * Optimize Binary:: Use efficient binary representation Debug * Debug Options:: Debug options @end detailmenu @end menu @node Getting Started, Compile, Top, Top @chapter Getting Started @menu * Hello World!:: Hello World! @end menu @node Hello World!, , Getting Started, Getting Started @section Hello World! This is a sample program that displays ``Hello World'': @example ---- hello.cob ------------------------- * Sample COBOL program IDENTIFICATION DIVISION. PROGRAM-ID. hello. PROCEDURE DIVISION. DISPLAY "Hello World!". STOP RUN. ---------------------------------------- @end example The compiler is @code{cobc}, which is executed as follows: @example $ cobc -x hello.cob $ ./hello Hello World! @end example The executable file name (i.e., @file{hello} in this case) is determined by removing the extension from the source file name. You can specify the executable file name by specifying the compiler option @code{-o} as follows: @example $ cobc -x -o hello-world hello.cob $ ./hello-world Hello World! @end example @node Compile, Customize, Getting Started, Top @chapter Compile This chapter describes how to compile COBOL programs using OpenCOBOL. @menu * Compiler Options:: Compiler options * Multiple Sources:: Compiling multiple source files * C Interface:: Dealing with C files @end menu @node Compiler Options, Multiple Sources, Compile, Compile @section Compiler Options The compiler @code{cobc} accepts the options described in this section. @menu * Built Target:: Built Target * Source Format:: Source Format * Warning Options:: Warning Options @end menu @node Built Target, Source Format, Compiler Options, Compiler Options @subsection Built Target The following options specify the target type produced by the compiler: @table @code @item -E Preprocess only. Compiler directives are executed. Comment lines are removed. COPY statements are expanded. The output goes to the standard-out. @item -C Translation only. COBOL source files are translated into C files. The output is saved in file @file{*.c}. @item -S Compile only. Translated C files are compiled by cc. The output is saved in file @file{*.s}. @item -c Compile and assemble. This is equivalent to @code{cc -c}. The output is saved in file @file{*.o}. @item -m Compile, assemble, and build a dynamically loadable module (i.e., a shared library). The output is saved in file @file{*.so}. @footnote{The extension varies depending on your host.}. @item -x Include the main function in the output. This option takes effect at the translation stage. If you give this option with @code{-C}, you will see the main function at the end of the generated C file. @end table Without any options above, the compiler tries to build a dynamically loadable module. @node Source Format, Warning Options, Built Target, Compiler Options @subsection Source Format OpenCOBOL supports both fixed and free source format. The default format is the fixed format. This can be explicitly overwritten by one of the following options: @table @code @item -free Free format. @item -fixed Fixed format. @end table @node Warning Options, , Source Format, Compiler Options @subsection Warning Options @table @code @item -Wall Enable all warnings @item -Wcolumn-overflow Warn any text after column 72 @item -Wend-evaluate Warn lacks of END-EVALUATE @item -Wend-if Warn lacks of END-IF @item -Wparentheses Warn lacks of parentheses around AND within OR @end table @node Multiple Sources, C Interface, Compiler Options, Compile @section Multiple Sources A program often consists of multiple source files. This section describes how to compile multiple source files. This section also describes how to build a shared library that can be used by any COBOL programs and how to use external libraries from COBOL programs. @menu * Static Linking:: Compiling into a single executable * Dynamic Linking:: A main program and separate modules * Building Library:: Building a shared library * Using Library:: Using external libraries @end menu @node Static Linking, Dynamic Linking, Multiple Sources, Multiple Sources @subsection Static Linking The easiest way of combining multiple files is to compile them into a single executable. One way is to specify all files on the command line: @example $ cobc -x -o prog main.cob subr1.cob subr2.cob @end example Another way is to compile each file with the option @code{-c}, and link them at the end. The top-level program must be compiled with the option @code{-x}: @example $ cobc -c subr1.cob $ cobc -c subr2.cob $ cobc -c -x main.cob $ cobc -x -o prog main.o subr1.o subr2.o @end example You can link C routines as well using either method: Method 1: @example $ cobc -o prog main.cob subrs.c @end example Method 2: @example $ cc -c subrs.c $ cobc -c -x main.cob $ cobc -x -o prog main.o subrs.o @end example Any number of functions can be contained in a single C file. The linked programs will be called dynamically; that is, the symbol will be resolved at run time. For example, the following COBOL statement @example CALL "subr" USING X. @end example will be converted into an equivalent C code like this: @example int (*func)() = cob_resolve("subr"); if (func != NULL) func (X); @end example With the compiler options @code{-fstatic-call}, more efficient code will be generated like this: @example subr(X); @end example Note that this option is effective only when the called program name is a literal (like @code{CALL "subr".}). With a data name (like @code{CALL SUBR.}), the program is still called dynamically. @node Dynamic Linking, Building Library, Static Linking, Multiple Sources @subsection Dynamic Linking There are two methods to achieve this. Method 1 (Using driver program). Compile all programs with the option @code{-m}: @example $ cobc -m main.cob subr.cob @end example This creates shared object files @file{main.so subr.so} @footnote{The extension varies depending on your host.}. Before running the main program, install the module files in your library directory: @example $ cp subr.so /your/cobol/lib @end example Set the environment variable @code{COB_LIBRARY_PATH} to your library directory, and run the main program: @example $ export COB_LIBRARY_PATH=/your/cobol/lib @end example Note: You may set the variable to directly point to the directory where you compiled the sources. Now execute your program: @example $ cobcrun main @end example Method 2. The main program and subprograms can be compiled separately. The main program is compiled as usual: @example $ cobc -x -o main main.cob @end example Subprograms are compiled with the option @code{-m}: @example $ cobc -m subr.cob @end example This creates a module file @file{subr.so} @footnote{The extension varies depending on your host.}. Before running the main program, install the module files in your library directory: @example $ cp subr.so /your/cobol/lib @end example Now, set the environment variable @code{COB_LIBRARY_PATH} to your library directory, and run the main program: @example $ export COB_LIBRARY_PATH=/your/cobol/lib $ ./main @end example @node Building Library, Using Library, Dynamic Linking, Multiple Sources @subsection Building Library You can build a shared library by combining multiple COBOL programs and even C routines: @example $ cobc -c subr1.cob $ cobc -c subr2.cob $ cc -c subr3.c $ cc -shared -o libsubrs.so subr1.o subr2.o subr3.o @end example @node Using Library, , Building Library, Multiple Sources @subsection Using Library You can use a shared library by linking it with your main program. Before linking the library, install it in your system library directory: @example $ cp libsubrs.so /usr/lib @end example or install it somewhere else and set @code{LD_LIBRARY_PATH}: @example $ cp libsubrs.so /your/cobol/lib $ export LD_LIBRARY_PATH=/your/cobol/lib @end example Then, compile the main program, linking the library as follows: @example $ cobc -x main.cob -L/your/cobol/lib -lsubrs @end example @node C Interface, , Multiple Sources, Compile @section C Interface This chapter describes how to combine C programs with COBOL programs. @menu * Main C Program:: Writing Main Program in C * Static C to COBOL:: * Dynamic C to COBOL:: * Static COBOL to C:: * Dynamic COBOL to C:: @end menu @node Main C Program, Static C to COBOL, C Interface, C Interface @subsection Writing Main Program in C Include @file{libcob.h} in your C program. Call @code{cob_init} before using any COBOL module: @example #include int main (int argc, char **argv) @{ /* initialize your program */ ... /* initialize the COBOL run-time library */ cob_init (argc, argv); /* rest of your program */ ... /* Clean up and terminate - This does not return */ cob_stop_run (return_status); @} @end example You can write @code{cobc_init(0, NULL);} if you do not want to pass command line arguments to COBOL. You can compile your C program as follows: @example cc -c `cob-config --cflags` main.c @end example The compiled object must be linked with libcob as follows: @example cc -o main main.o `cob-config --libs` @end example @node Static C to COBOL, Dynamic C to COBOL, Main C Program, C Interface @subsection Static linking with COBOL programs Let's call the following COBOL module from a C program: @example ---- say.cob --------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. say. ENVIRONMENT DIVISION. DATA DIVISION. LINKAGE SECTION. 01 HELLO PIC X(6). 01 WORLD PIC X(6). PROCEDURE DIVISION USING HELLO WORLD. DISPLAY HELLO WORLD. EXIT PROGRAM. ---------------------------------------- @end example This program accepts two arguments, displays them, and exit. From the viewpoint of C, this is equivalent to a function having the following prototype: @example extern int say(char *hello, char *world); @end example So, your main program will look like as follows: @example ---- hello.c --------------------------- #include extern int say(char *hello, char *world); int main() @{ int ret; char hello[7] = "Hello "; char world[7] = "World!"; cob_init(0, NULL); ret = say(hello, world); return ret; @} ---------------------------------------- @end example Compile these programs as follows: @example $ cc -c `cob-config --cflags` hello.c $ cobc -c -static say.cob $ cobc -x -o hello hello.o say.o $ ./hello Hello World! @end example @node Dynamic C to COBOL, Static COBOL to C, Static C to COBOL, C Interface @subsection Dynamic linking with COBOL programs You can find a COBOL module having a specific PROGRAM-ID by using a C function @code{cob_resolve}, which takes the module name as a string and returns a pointer to the module function. @code{cob_resolve} returns NULL if there is no module. In this case, the function @code{cob_resolve_error} returns the error message. Let's see an example: @example ---- hello-dynamic.c ------------------- #include static int (*say)(char *hello, char *world); int main() @{ int ret; char hello[7] = "Hello "; char world[7] = "World!"; cob_init(0, NULL); /* find the module with PROGRAM-ID "say". */ say = cob_resolve("say"); /* if there is no such module, show error and exit */ if (say == NULL) @{ fprintf(stderr, "%s\n", cob_resolve_error ()); exit(1); @} /* call the module found and exit with the return code */ ret = say(hello, world); return ret; @} ---------------------------------------- @end example Compile these programs as follows: @example $ cc -c `cob-config --cflags` hello-dynamic.c $ cobc -x -o hello hello-dynamic.o $ cobc -m say.cob $ export COB_LIBRARY_PATH=. $ ./hello Hello World! @end example @node Static COBOL to C, Dynamic COBOL to C, Dynamic C to COBOL, C Interface @subsection Static linking with C programs Let's call the following C function from COBOL: @example ---- say.c ----------------------------- int say(char *hello, char *world) @{ int i; for (i = 0; i < 6; i++) putchar(hello[i]); for (i = 0; i < 6; i++) putchar(world[i]); putchar('\n'); return 0; @} ---------------------------------------- @end example This program is equivalent to the foregoing @file{say.cob}. Note that, unlike C, the arguments passed from COBOL programs are not terminated by the null character (i.e., @code{\0}). You can call this function in the same way you call COBOL programs: @example ---- hello.cob ------------------------- IDENTIFICATION DIVISION. PROGRAM-ID. hello. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 HELLO PIC X(6) VALUE "Hello ". 01 WORLD PIC X(6) VALUE "World!". PROCEDURE DIVISION. CALL "say" USING HELLO WORLD. STOP RUN. ---------------------------------------- @end example Compile these programs as follows: @example $ cc -c say.c $ cobc -c -static -x hello.cob $ cobc -x -o hello hello.o say.o $ ./hello Hello World! @end example @node Dynamic COBOL to C, , Static COBOL to C, C Interface @subsection Dynamic linking with C programs You can create a dynamic-linking module from a C program by passing an option @code{-shared} to the C compiler: @example $ cc -shared -o say.so say.c $ cobc -x hello.cob $ export COB_LIBRARY_PATH=. $ ./hello Hello World! @end example @node Customize, Optimize, Compile, Top @chapter Customize @menu * Customizing Compiler:: Customizing Compiler * Customizing Library:: Customizing Library @end menu @node Customizing Compiler, Customizing Library, Customize, Customize @section Customizing Compiler These settings are effective at compile-time. Environment variables (default value): @table @code @item COB_CC C compiler ("gcc") @item COB_CFLAGS Flags passed to the C compiler ("-I$(PREFIX)/include") @item COB_LDFLAGS Flags passed to the C compiler ("") @item COB_LIBS Standard libraries linked with the program ("-L$(PREFIX)/lib -lcob") @item COB_LDADD Additional libraries linked with the program ("") @end table @node Customizing Library, , Customizing Compiler, Customize @section Customizing Library These settings are effective at run-time. Environment variables (default value): @table @code @item COB_LIBRARY_PATH Dynamic-linking module path (".:$(PREFIX)/lib/open-cobol") @item COB_DYNAMIC_RELOADING Set to ``yes'' if modules must be reloaded when they are replaced (``no'') @end table @node Optimize, Debug, Customize, Top @chapter Optimize @menu * Optimize Options:: How to enable optimization * Optimize Call:: Call subroutines efficiently * Optimize Binary:: Use efficient binary representation @end menu @node Optimize Options, Optimize Call, Optimize, Optimize @section Optimize Options There are three compiler options for optimization: @code{-O}, @code{-Os} and @code{-O2}. These options enable optimization at both translation (from COBOL to C) and compilation (C to assembly) levels. Currently, there is no difference between these optimization options at the translation level. The option @code{-O}, @code{-Os} or @code{-O2} is passed to the C compiler as it is and used for C level optimization. @node Optimize Call, Optimize Binary, Optimize Options, Optimize @section Optimize Call When a CALL statement is executed, the called program is linked at run time. By specifying the compiler option @code{-fstatic-call}, you can statically link the program at compile time and call it efficiently. (@pxref{Static Linking}) @node Optimize Binary, , Optimize Call, Optimize @section Optimize Binary By default, data items of usage binary or comp are stored in the big-endian form. On those machines whose native byte order is little-endian, this is not quite efficient. If you prefer, you can store binary items in the native form of your machine. Set the config option @code{binary-byteorder} to @code{native} in your config file (@pxref{Customize}). In addition, setting the option @code{binary-size} to @code{2-4-8} or @code{1-2-4-8} is more efficient than others. @node Debug, , Optimize, Top @chapter Debug @menu * Debug Options:: Debug options @end menu @node Debug Options, , Debug, Debug @section Debug Options The compiler option @code{-debug} can be used during the development of your programs. It enables all run-time error checking, such as subscript boundary checks and numeric data checks, and displays run-time errors with source locations. The compiler option @code{-g} includes line directives in the output. This helps debugging your COBOL programs using GDB, but this feature is not complete and not very useful yet. @bye @c Local Variables: @c mode:outline-minor @c outline-regexp:"@\\(ch\\|sec\\|subs\\)" @c End: open-cobol-1.1/texi/version.texi0000644000000000000000000000013611070704676012400 @set UPDATED 1 October 2008 @set UPDATED-MONTH October 2008 @set EDITION 1.1 @set VERSION 1.1 open-cobol-1.1/texi/Makefile.am0000644000000000000000000000026311130701401012031 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## info_TEXINFOS = open-cobol.texi open-cobol-1.1/texi/Makefile.in0000644000000000000000000003766111130703171012064 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = texi DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/stamp-vti $(srcdir)/version.texi ChangeLog mdate-sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/open-cobol.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = open-cobol.dvi PDFS = open-cobol.pdf PSS = open-cobol.ps HTMLS = open-cobol.html TEXINFOS = open-cobol.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = "$(DESTDIR)$(infodir)" DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ info_TEXINFOS = open-cobol.texi all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu texi/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu texi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ cd $(srcdir); \ else \ rc=$$?; \ cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $< .texi.html: rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ else \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi $(srcdir)/open-cobol.info: open-cobol.texi $(srcdir)/version.texi open-cobol.dvi: open-cobol.texi $(srcdir)/version.texi open-cobol.pdf: open-cobol.texi $(srcdir)/version.texi open-cobol.html: open-cobol.texi $(srcdir)/version.texi $(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti $(srcdir)/stamp-vti: open-cobol.texi $(top_srcdir)/configure @(dir=.; test -f ./open-cobol.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/open-cobol.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: @MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-info-am: @$(PRE_UNINSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: -rm -rf open-cobol.aux open-cobol.cp open-cobol.cps open-cobol.fn \ open-cobol.fns open-cobol.ky open-cobol.kys open-cobol.log \ open-cobol.pg open-cobol.pgs open-cobol.tmp open-cobol.toc \ open-cobol.tp open-cobol.tps open-cobol.vr open-cobol.vrs \ open-cobol.dvi open-cobol.pdf open-cobol.ps open-cobol.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-exec-am: install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ dist-info distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \ mostlyclean-vti pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/texi/mdate-sh0000755000000000000000000001255310357272637011462 #!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2005-06-29.22 # Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software # Foundation, Inc. # written by Ulrich Drepper , June 1995 # # 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, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No file. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification time of FILE. Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume `unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # A `ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named `Jan', or `Feb', etc. However, it's unlikely that `/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`ls -l -d /` # Find which argument is the month. month= command= until test $month do shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # 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-end: "$" # End: open-cobol-1.1/texi/stamp-vti0000644000000000000000000000013611140136202011645 @set UPDATED 1 October 2008 @set UPDATED-MONTH October 2008 @set EDITION 1.1 @set VERSION 1.1 open-cobol-1.1/texi/ChangeLog0000644000000000000000000000066710243632603011572 2005-05-21 Roger While * open-cobol.texi : Revise 2005-05-13 Roger While * open-cobol.texi : Revise 2005-03-03 Roger While * open-cobol.texi : update for -Os 2002-06-11 Keisuke Nishida * open-cobol.texi: Revise for 0.9.6. 2002-06-03 Keisuke Nishida * open-cobol.texi (Customize): Add COB_LDADD, COB_CONFIG_FILE. open-cobol-1.1/compile0000755000000000000000000000717310703447606010434 #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . 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 $? ;; esac ofile= cfile= eat= 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 -e 's|^.*/||' -e '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 mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # 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-end: "$" # End: open-cobol-1.1/depcomp0000755000000000000000000003710010357272635010427 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by 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 outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac 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 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. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 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 ' ' ' ' < "$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. ## 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" ;; 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 ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$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" ;; 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. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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 understands `-MD -MF file'. However on # icc -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 ... \ # ... "$@" -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 "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; 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 mecanism 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 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" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #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 $1 != '--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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$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 $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac 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. -*|$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" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## 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 $1 != '--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, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; 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-end: "$" # End: open-cobol-1.1/aclocal.m40000644000000000000000000101152111130703160010670 # generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 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. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 51 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH 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 "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [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 avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # 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 case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # 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 ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl 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* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl 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 conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && 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 which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file 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* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|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*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) 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" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # 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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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*) # Under GNU Hurd, 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*) # 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; ;; 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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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 ;; 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"; 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 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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 ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { 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; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; 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* | pw32*) 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && 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" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $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 .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [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]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) 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" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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` 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" else 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; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) 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 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' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi shlibpath_var=LIBPATH fi ;; amigaos*) 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $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' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux 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* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # 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~ chmod a+x \$dldir/$dlname' 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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}${versuffix}$shared_ext ${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`' m4_if([$1], [],[ 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 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # 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[[123]]*) 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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 ;; 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 hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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' ;; interix[[3-9]]*) 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' 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 "$lt_cv_prog_gnu_ld" = yes; then version_type=linux 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 ;; # This must be Linux ELF. linux* | k*bsd*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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 # Append ld.so.conf contents 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;/^$/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' ;; 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 ;; newsos6) version_type=linux 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=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=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; solaris*) 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=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 "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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 export_dynamic_flag_spec='${wl}-Blargedynsym' 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 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=freebsd-elf 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 hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes 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' ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognize shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [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 dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" 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 <&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 EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognize a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # 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 "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [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 &1 /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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) 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=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file 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]) 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 Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 ;; solaris*) 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) 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 ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$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(){return(0);}' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$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(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 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 # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; 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. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; 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 _LT_AC_TAGVAR(hardcode_direct, $1)=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 _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=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'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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. # 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. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # 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. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\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 "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # 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" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # 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]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; 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 # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && 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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) 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 AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # 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'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; 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 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$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)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$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 (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** 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 ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; 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 _LT_AC_TAGVAR(hardcode_direct, $1)=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 _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$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)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=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. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=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*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=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 "$GCC" = yes; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) 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. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005 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. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 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], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # 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. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) 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, 2000, 2001, 2002, 2003, 2004, 2005 # 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. # serial 8 # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$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'. 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 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 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 thusly: # 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, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # 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. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _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. FIXME. This creates each `.P' file that we will # 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" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # 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. # serial 12 # 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. # 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.58])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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 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], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])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) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. 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)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # 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_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 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 install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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. # serial 2 # 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])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # 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. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 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. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # 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. # serial 4 # 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 supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 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_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 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. # serial 3 # _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], [AC_FOREACH([_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])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # 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. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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). 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 rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # 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". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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. # serial 2 # _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. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. 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 m4_include([m4/codeset.m4]) m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) open-cobol-1.1/tests/0000777000000000000000000000000011143001517010256 5open-cobol-1.1/tests/run0000755000000000000000000166140111143001517010735 #! /bin/sh ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Load the config file. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 { (exit 1); exit 1; }; } done # atconfig delivers paths relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir in srcdir top_srcdir top_builddir do at_val=`eval echo '${'at_$at_dir'}'` eval "$at_dir=\$at_val/../.." done fi # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? at_verbose=: at_quiet=echo # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # List test groups? at_list_p=false # Test groups to run at_groups= # The directory we are in. at_dir=`pwd` # The directory the whole suite works in. # Should be absolutely to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite. at_suite_log=$at_dir/$as_me.log # The file containing the location of the last AT_CHECK. at_check_line_file=$at_suite_dir/at-check-line # The file containing the exit status of the last command. at_status_file=$at_suite_dir/at-status # The files containing the output of the tested commands. at_stdout=$at_suite_dir/at-stdout at_stder1=$at_suite_dir/at-stder1 at_stderr=$at_suite_dir/at-stderr # The file containing dates. at_times_file=$at_suite_dir/at-times # List of the tested programs. at_tested='cobc' # List of the all the test groups. at_groups_all=' 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 189 190 191 192 193 194' # As many dots as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='...' # Description of all the test groups. at_help_all='1;fundamental.at:23;DISPLAY literals;; 2;fundamental.at:60;DISPLAY literals, DECIMAL-POINT is COMMA;; 3;fundamental.at:88;Hexadecimal literal;; 4;fundamental.at:124;DISPLAY data items with VALUE clause;; 5;fundamental.at:169;DISPLAY data items with MOVE statement;; 6;fundamental.at:215;GLOBAL at same level;; 7;fundamental.at:263;GLOBAL at lower level;; 8;subscripts.at:28;non-numeric subscript;; 9;subscripts.at:56;The range of subscripts;; 10;subscripts.at:96;Subscript out of bounds (1);; 11;subscripts.at:120;Subscript out of bounds (2);; 12;subscripts.at:144;Value of DEPENDING ON N out of bounds (lower);; 13;subscripts.at:168;Value of DEPENDING ON N out of bounds (upper);; 14;subscripts.at:192;Subscript bounds with ODO (lower);; 15;subscripts.at:215;Subscript bounds with ODO (upper);; 16;subscripts.at:238;Subscript bounds with ODO;; 17;subscripts.at:264;Subscript by arithmetic expression;; 18;ref-mod.at:35;Separate sign positions;; 19;ref-mod.at:60;Static reference modification;; 20;ref-mod.at:90;Dynamic reference modification;; 21;ref-mod.at:121;Static out of bounds;; 22;ref-mod.at:150;Offset underflow;; 23;ref-mod.at:172;Offset overflow;; 24;ref-mod.at:194;Length underflow;; 25;ref-mod.at:216;Length overflow;; 26;accept.at:23;ACCEPT;; 27;initialize.at:27;INITIALIZE group entry with OCCURS;; 28;initialize.at:52;INITIALIZE OCCURS with numeric edited;; 29;initialize.at:75;INITIALIZE complex group (1);; 30;initialize.at:99;INITIALIZE complex group (2);; 31;initialize.at:123;INITIALIZE with REDEFINES;; 32;misc.at:21;Source file not found;; 33;misc.at:30;Comma separator without space;; 34;misc.at:47;LOCAL-STORAGE;; 35;misc.at:89;EXTERNAL data item;; 36;misc.at:131;EXTERNAL AS data item;; 37;misc.at:177;cobcrun validation;; 38;misc.at:221;MOVE to itself;; 39;misc.at:241;MOVE with refmod;; 40;misc.at:261;MOVE with refmod (variable);; 41;misc.at:283;MOVE with group refmod;; 42;misc.at:304;MOVE indexes;; 43;misc.at:326;MOVE X'00';; 44;misc.at:361;Level 01 subscripts;; 45;misc.at:382;Class check with reference modification;; 46;misc.at:403;Index and parenthesized expression;; 47;misc.at:423;Alphanumeric and binary numeric;; 48;misc.at:447;Dynamic call with static linking;; 49;misc.at:472;CALL m1. CALL m2. CALL m1.;; 50;misc.at:525;CALL binary literal parameter/LENGTH OF;; 51;misc.at:580;INSPECT REPLACING LEADING ZEROS BY SPACES;; 52;misc.at:600;INSPECT: No repeat conversion check;; 53;misc.at:621;INSPECT: REPLACING figurative constant;; 54;misc.at:642;INSPECT: TALLYING BEFORE;; 55;misc.at:672;INSPECT: TALLYING AFTER;; 56;misc.at:701;INSPECT REPLACING TRAILING ZEROS BY SPACES;; 57;misc.at:721;INSPECT REPLACING complex;; 58;misc.at:743;SWITCHES;; 59;misc.at:801;Nested PERFORM;; 60;misc.at:826;EXIT PERFORM;; 61;misc.at:850;EXIT PERFORM CYCLE;; 62;misc.at:874;EXIT PARAGRAPH;; 63;misc.at:905;EXIT SECTION;; 64;misc.at:939;88 with FILLER;; 65;misc.at:966;Non-overflow after overflow;; 66;misc.at:993;PERFORM ... CONTINUE;; 67;misc.at:1009;STRING with subscript reference;; 68;misc.at:1032;UNSTRING DELIMITED ALL LOW-VALUE;; 69;misc.at:1065;READ INTO AT-END sequence;; 70;misc.at:1099;First READ on empty SEQUENTIAL INDEXED file;; 71;misc.at:1134;REWRITE a RELATIVE file with RANDOM access;; 72;misc.at:1188;SORT: table sort;; 73;misc.at:1225;SORT: EBCDIC table sort;; 74;misc.at:1269;SORT nonexistent file;; 75;misc.at:1303;PIC ZZZ-, ZZZ+;; 76;misc.at:1341;Larger REDEFINES lengths;; 77;misc.at:1381;PERFORM type OSVS;; 78;misc.at:1422;Sticky LINKAGE;; 79;misc.at:1472;COB_PRE_LOAD test;; 80;misc.at:1496;COB_LOAD_CASE=UPPER test;; 81;misc.at:1520;88 level with FALSE IS clause;; 82;misc.at:1545;ALLOCATE/FREE with BASED item;; 83;misc.at:1569;INITIZIALIZE with reference modification;; 84;misc.at:1592;CALL with OMITTED parameter;; 85;misc.at:1630;ANY LENGTH;; 86;misc.at:1670;BASED item non-ALLOCATED (debug);; 87;extensions.at:24;COMP-5;; 88;extensions.at:71;Hexadecimal numeric literal;; 89;extensions.at:99;Semi-parenthesized condition;; 90;extensions.at:120;ADDRESS OF;; 91;extensions.at:183;LENGTH OF;; 92;extensions.at:217;WHEN-COMPILED;; 93;extensions.at:240;Complex OCCURS DEPENDING ON;; 94;extensions.at:268;MOVE NON-INTEGER TO ALPHA-NUMERIC;; 95;extensions.at:359;CALL USING file-name;; 96;extensions.at:401;CALL unusual PROGRAM-ID.;; 97;extensions.at:464;Case independent PROGRAM-ID;; 98;extensions.at:487;PROGRAM-ID AS clause;; 99;extensions.at:510;Quoted PROGRAM-ID;; 100;extensions.at:535;ASSIGN MF;; 101;extensions.at:567;ASSIGN IBM;; 102;extensions.at:597;ASSIGN mapping;; 103;extensions.at:633;ASSIGN expansion;; 104;extensions.at:663;ASSIGN with COB_FILE_PATH;; 105;extensions.at:696;NUMBER-OF-CALL-PARAMETERS;; 106;extensions.at:752;PROCEDURE DIVISION USING BY ...;; 107;extensions.at:801;PROCEDURE DIVISION CHAINING ...;; 108;extensions.at:829;STOP RUN RETURNING;; 109;extensions.at:846;ENTRY;; 110;extensions.at:892;LINE SEQUENTIAL write;; 111;extensions.at:932;LINE SEQUENTIAL read;; 112;extensions.at:992;ASSIGN to KEYBOARD/DISPLAY;; 113;extensions.at:1048;Environment/Argument variable;; 114;extensions.at:1093;DECIMAL-POINT is COMMA (1);; 115;extensions.at:1119;DECIMAL-POINT is COMMA (2);; 116;extensions.at:1145;DECIMAL-POINT is COMMA (3);; 117;extensions.at:1171;DECIMAL-POINT is COMMA (4);; 118;extensions.at:1197;DECIMAL-POINT is COMMA (5);; 119;extensions.at:1229;78 Level (1);; 120;extensions.at:1250;78 Level (2);; 121;extensions.at:1274;78 Level (3);; 122;extensions.at:1296;Unreachable statement;; 123;return-code.at:23;RETURN-CODE moving;; 124;return-code.at:46;RETURN-CODE passing;; 125;return-code.at:89;RETURN-CODE nested;; 126;functions.at:22;FUNCTION ABS;; 127;functions.at:43;FUNCTION ACOS;; 128;functions.at:72;FUNCTION ANNUITY;; 129;functions.at:102;FUNCTION ASIN;; 130;functions.at:131;FUNCTION ATAN;; 131;functions.at:160;FUNCTION CHAR;; 132;functions.at:181;FUNCTION COMBINED-DATETIME;; 133;functions.at:201;FUNCTION CONCATENATE;; 134;functions.at:223;FUNCTION CONCATENATE with reference modding;; 135;functions.at:246;FUNCTION COS;; 136;functions.at:275;FUNCTION DATE-OF-INTEGER;; 137;functions.at:295;FUNCTION DATE-TO-YYYYMMDD;; 138;functions.at:315;FUNCTION DAY-OF-INTEGER;; 139;functions.at:335;FUNCTION DAY-TO-YYYYDDD;; 140;functions.at:355;FUNCTION E;; 141;functions.at:375;FUNCTION EXCEPTION-FILE;; 142;functions.at:405;FUNCTION EXCEPTION-LOCATION;; 143;functions.at:439;FUNCTION EXCEPTION-STATEMENT;; 144;functions.at:469;FUNCTION EXCEPTION-STATUS;; 145;functions.at:499;FUNCTION EXP;; 146;functions.at:527;FUNCTION FACTORIAL;; 147;functions.at:547;FUNCTION FRACTION-PART;; 148;functions.at:570;FUNCTION INTEGER;; 149;functions.at:591;FUNCTION INTEGER-OF-DATE;; 150;functions.at:611;FUNCTION INTEGER-OF-DAY;; 151;functions.at:631;FUNCTION INTEGER-PART;; 152;functions.at:652;FUNCTION LENGTH;; 153;functions.at:673;FUNCTION LOCALE-DATE;; 154;functions.at:697;FUNCTION LOCALE-TIME;; 155;functions.at:721;FUNCTION LOCALE-TIME-FROM-SECONDS;; 156;functions.at:745;FUNCTION LOG;; 157;functions.at:774;FUNCTION LOG10;; 158;functions.at:803;FUNCTION LOWER-CASE;; 159;functions.at:824;FUNCTION LOWER-CASE with reference modding;; 160;functions.at:845;FUNCTION MAX;; 161;functions.at:865;FUNCTION MEAN;; 162;functions.at:885;FUNCTION MEDIAN;; 163;functions.at:905;FUNCTION MIDRANGE;; 164;functions.at:925;FUNCTION MIN;; 165;functions.at:945;FUNCTION MOD;; 166;functions.at:965;FUNCTION NUMVAL;; 167;functions.at:986;FUNCTION NUMVAL-C;; 168;functions.at:1007;FUNCTION ORD;; 169;functions.at:1027;FUNCTION ORD-MAX;; 170;functions.at:1047;FUNCTION ORD-MIN;; 171;functions.at:1067;FUNCTION PI;; 172;functions.at:1087;FUNCTION PRESENT-VALUE;; 173;functions.at:1107;FUNCTION RANGE;; 174;functions.at:1127;FUNCTION REM;; 175;functions.at:1147;FUNCTION REVERSE;; 176;functions.at:1168;FUNCTION REVERSE with reference modding;; 177;functions.at:1189;FUNCTION SECONDS-FROM-FORMATTED-TIME;; 178;functions.at:1218;FUNCTION SECONDS-PAST-MIDNIGHT;; 179;functions.at:1245;FUNCTION SIGN;; 180;functions.at:1274;FUNCTION SIN;; 181;functions.at:1303;FUNCTION SQRT;; 182;functions.at:1332;FUNCTION STANDARD-DEVIATION;; 183;functions.at:1360;FUNCTION STORED-CHAR-LENGTH;; 184;functions.at:1382;FUNCTION SUBSTITUTE;; 185;functions.at:1404;FUNCTION SUBSTITUTE with reference modding;; 186;functions.at:1427;FUNCTION SUBSTITUTE-CASE;; 187;functions.at:1449;FUNCTION SUBSTITUTE-CASE with reference mod;; 188;functions.at:1472;FUNCTION TAN;; 189;functions.at:1501;FUNCTION TRIM;; 190;functions.at:1525;FUNCTION TRIM with reference modding;; 191;functions.at:1549;FUNCTION UPPER-CASE;; 192;functions.at:1570;FUNCTION UPPER-CASE with reference modding;; 193;functions.at:1591;FUNCTION VARIANCE;; 194;functions.at:1611;FUNCTION WHEN-COMPILED;; ' at_keywords= at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) echo "$as_me (OpenCOBOL 1.1)" exit 0 ;; --clean | -c ) rm -rf $at_suite_dir $at_suite_log exit 0 ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=echo; at_quiet=: ;; --trace | -x ) at_traceon='set -vx'; at_traceoff='set +vx' ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_groups="$at_groups$at_option " ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` at_groups="$at_groups$at_range " ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`echo $at_option |sed 's,-.*,,'` at_range_end=`echo $at_option |sed 's,.*-,,'` # FIXME: Maybe test to make sure start <= end? at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_keywords="$at_keywords,$at_optarg" ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $at_envvar" >&2 { (exit 1); exit 1; }; } at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$at_envvar='$at_value'" export $at_envvar # Propagate to debug scripts. at_debug_args="$at_debug_args $at_option" ;; *) echo "$as_me: invalid option: $at_option" >&2 echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Process the --keywords if test -n "$at_keywords"; then at_groups_selected=$at_help_all for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}` do # It is on purpose that we match the test group titles too. at_groups_selected=`echo "$at_groups_selected" | grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"` done at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` # Smash the end of lines. at_groups_selected=`echo $at_groups_selected` at_groups="$at_groups$at_groups_selected " fi # Selected test groups. test -z "$at_groups" && at_groups=$at_groups_all # Help message. if $at_help_p; then cat <<_ATEOF Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, and save a detailed log file. Upon failure, create debugging scripts. You should not change environment variables unless explicitly passed as command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relatively to the top level of this distribution. E.g., $ $0 AUTOTEST_PATH=bin possibly amounts into PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH _ATEOF cat <<_ATEOF Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF Execution tuning: -k, --keywords=KEYWORDS select the tests matching all the comma separated KEYWORDS accumulates -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and debug script creation default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF Report bugs to . _ATEOF exit 0 fi # List of tests. if $at_list_p; then cat <<_ATEOF OpenCOBOL 1.1 test suite: Run Tests test groups: NUM: FILENAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # " 1 42 45 " => "^(1|42|45);". at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` echo "$at_help_all" | awk 'BEGIN { FS = ";" } { if ($1 !~ /^('"$at_groups_pattern"')$/) next } { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3 if ($4) printf " %s\n", $4 } ' exit 0 fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites, AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in [\\/]* | ?:[\\/]* ) at_path=$at_path$PATH_SEPARATOR$as_dir ;; * ) if test -z "$at_top_builddir"; then # Stand-alone test suite. at_path=$at_path$PATH_SEPARATOR$as_dir else # Embedded test suite. at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir fi ;; esac done # Now build and simplify PATH. PATH= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` test -d "$as_dir" || continue case $PATH in $as_dir | \ $as_dir$PATH_SEPARATOR* | \ *$PATH_SEPARATOR$as_dir | \ *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; '') PATH=$as_dir ;; *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; esac done export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. $at_debug_p && at_suite_log=/dev/null exec 5>$at_suite_log # Banners and logs. cat <<\_ASBOX ## ------------------------------------ ## ## OpenCOBOL 1.1 test suite: Run Tests. ## ## ------------------------------------ ## _ASBOX { cat <<\_ASBOX ## ------------------------------------ ## ## OpenCOBOL 1.1 test suite: Run Tests. ## ## ------------------------------------ ## _ASBOX echo echo "$as_me: command line was:" echo " $ $0 $at_cli_args" echo # Try to find a few ChangeLogs in case it might help determining the # exact version. Use the relative dir: if the top dir is a symlink, # find will not follow it (and options to follow the links are not # portable), which would result in no output here. if test -n "$at_top_srcdir"; then cat <<\_ASBOX ## ----------- ## ## ChangeLogs. ## ## ----------- ## _ASBOX echo for at_file in `find "$at_top_srcdir" -name ChangeLog -print` do echo "$as_me: $at_file:" sed 's/^/| /;10q' $at_file echo done { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } echo fi # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done cat <<\_ASBOX ## ---------------- ## ## Tested programs. ## ## ---------------- ## _ASBOX echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f $as_dir/$at_program && break done if test -f $as_dir/$at_program; then { echo "run.at:21: $as_dir/$at_program --version" $as_dir/$at_program --version echo } >&5 2>&1 else { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 echo "$as_me: error: cannot find $at_program" >&2;} { (exit 1); exit 1; }; } fi done { cat <<\_ASBOX ## ------------------ ## ## Running the tests. ## ## ------------------ ## _ASBOX } >&5 at_start_date=`date` at_start_time=`(date +%s) 2>/dev/null` echo "$as_me: starting at: $at_start_date" >&5 at_xpass_list= at_xfail_list= at_pass_list= at_fail_list= at_skip_list= at_group_count=0 # Create the master directory if it doesn't already exist. test -d $at_suite_dir || mkdir $at_suite_dir || { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5 echo "$as_me: error: cannot create $at_suite_dir" >&2;} { (exit 1); exit 1; }; } # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull cp /dev/null $at_devnull fi # Use `diff -u' when possible. if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then at_diff='diff -u' else at_diff=diff fi for at_group in $at_groups do # Be sure to come back to the top test directory. cd $at_suite_dir case $at_group in banner-*) at_group_log=$at_suite_log ;; *) # Skip tests we already run (using --keywords makes it easy to get # duplication). case " $at_pass_test $at_skip_test $at_fail_test " in *" $at_group "* ) continue;; esac # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log rm -rf $at_group_dir mkdir $at_group_dir || { { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5 echo "$as_me: error: cannot create $at_group_dir" >&2;} { (exit 1); exit 1; }; } cd $at_group_dir ;; esac echo 0 > $at_status_file # Clearly separate the test groups when verbose. test $at_group_count != 0 && $at_verbose # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log if test $at_verbose = echo; then at_tee_pipe="tee -a $at_group_log" else at_tee_pipe="cat >> $at_group_log" fi case $at_group in 1 ) # 1. fundamental.at:23: DISPLAY literals at_setup_line='fundamental.at:23' at_desc='DISPLAY literals' $at_quiet $ECHO_N " 1: DISPLAY literals $ECHO_C" at_xfail=no ( echo "1. fundamental.at:23: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY "abc" END-DISPLAY. DISPLAY 123 END-DISPLAY. DISPLAY +123 END-DISPLAY. DISPLAY -123 END-DISPLAY. DISPLAY 12.3 END-DISPLAY. DISPLAY +12.3 END-DISPLAY. DISPLAY -12.3 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "fundamental.at:46: \${COMPILE} prog.cob" echo fundamental.at:46 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:46: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:55: ./prog" echo fundamental.at:55 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "abc 123 +123 -123 12.3 +12.3 -12.3 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:55: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 2 ) # 2. fundamental.at:60: DISPLAY literals, DECIMAL-POINT is COMMA at_setup_line='fundamental.at:60' at_desc='DISPLAY literals, DECIMAL-POINT is COMMA' $at_quiet $ECHO_N " 2: DISPLAY literals, DECIMAL-POINT is COMMA $ECHO_C" at_xfail=no ( echo "2. fundamental.at:60: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. PROCEDURE DIVISION. DISPLAY 12,3 END-DISPLAY. DISPLAY +12,3 END-DISPLAY. DISPLAY -12,3 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "fundamental.at:79: \${COMPILE} prog.cob" echo fundamental.at:79 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:79: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:84: ./prog" echo fundamental.at:84 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "12,3 +12,3 -12,3 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:84: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 3 ) # 3. fundamental.at:88: Hexadecimal literal at_setup_line='fundamental.at:88' at_desc='Hexadecimal literal' $at_quiet $ECHO_N " 3: Hexadecimal literal $ECHO_C" at_xfail=no ( echo "3. fundamental.at:88: testing ..." $at_traceon cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 4; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "fundamental.at:103: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo fundamental.at:103 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:103: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY X"313233" END-DISPLAY. CALL "dump" USING X"000102" END-CALL. STOP RUN. _ATEOF $at_traceoff echo "fundamental.at:116: \${COMPILE} prog.cob" echo fundamental.at:116 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:116: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:120: ./prog" echo fundamental.at:120 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "123 00010200 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:120: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 4 ) # 4. fundamental.at:124: DISPLAY data items with VALUE clause at_setup_line='fundamental.at:124' at_desc='DISPLAY data items with VALUE clause' $at_quiet $ECHO_N " 4: DISPLAY data items with VALUE clause $ECHO_C" at_xfail=no ( echo "4. fundamental.at:124: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ABC PIC XXX VALUE "abc". 01 X-123 PIC 999 VALUE 123. 01 X-P123 PIC S999 VALUE +123. 01 X-N123 PIC S999 VALUE -123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-P12-3 PIC S99V9 VALUE +12.3. 01 X-N12-3 PIC S99V9 VALUE -12.3. PROCEDURE DIVISION. DISPLAY X-ABC END-DISPLAY. DISPLAY X-123 END-DISPLAY. DISPLAY X-P123 END-DISPLAY. DISPLAY X-N123 END-DISPLAY. DISPLAY X-12-3 END-DISPLAY. DISPLAY X-P12-3 END-DISPLAY. DISPLAY X-N12-3 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "fundamental.at:156: \${COMPILE} prog.cob" echo fundamental.at:156 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:156: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:165: ./prog" echo fundamental.at:165 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "abc 123 +123 -123 12.3 +12.3 -12.3 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:165: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 5 ) # 5. fundamental.at:169: DISPLAY data items with MOVE statement at_setup_line='fundamental.at:169' at_desc='DISPLAY data items with MOVE statement' $at_quiet $ECHO_N " 5: DISPLAY data items with MOVE statement $ECHO_C" at_xfail=no ( echo "5. fundamental.at:169: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ABC PIC XXX VALUE "abc". 01 X-123 PIC 999 VALUE 123. 01 X-P123 PIC S999 VALUE +123. 01 X-N123 PIC S999 VALUE -123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-P12-3 PIC S99V9 VALUE +12.3. 01 X-N12-3 PIC S99V9 VALUE -12.3. PROCEDURE DIVISION. MOVE "abc" TO X-ABC. DISPLAY X-ABC END-DISPLAY. MOVE 123 TO X-123. DISPLAY X-123 END-DISPLAY. MOVE +123 TO X-P123. DISPLAY X-P123 END-DISPLAY. MOVE -123 TO X-N123. DISPLAY X-N123 END-DISPLAY. MOVE 12.3 TO X-12-3. DISPLAY X-12-3 END-DISPLAY. MOVE +12.3 TO X-P12-3. DISPLAY X-P12-3 END-DISPLAY. MOVE -12.3 TO X-N12-3. DISPLAY X-N12-3 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "fundamental.at:201: \${COMPILE} prog.cob" echo fundamental.at:201 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:201: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:210: ./prog" echo fundamental.at:210 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "abc 123 +123 -123 12.3 +12.3 -12.3 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:210: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 6 ) # 6. fundamental.at:215: GLOBAL at same level at_setup_line='fundamental.at:215' at_desc='GLOBAL at same level' $at_quiet $ECHO_N " 6: GLOBAL at same level $ECHO_C" at_xfail=no ( echo "6. fundamental.at:215: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog1". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. CALL "prog2" END-CALL CALL "prog3" END-CALL STOP RUN. IDENTIFICATION DIVISION. PROGRAM-ID. prog2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog2". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog2. IDENTIFICATION DIVISION. PROGRAM-ID. prog3. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog3. END PROGRAM prog. _ATEOF $at_traceoff echo "fundamental.at:253: \${COMPILE} prog.cob" echo fundamental.at:253 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:253: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:258: ./prog" echo fundamental.at:258 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "prog1 prog2 prog1 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:258: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 7 ) # 7. fundamental.at:263: GLOBAL at lower level at_setup_line='fundamental.at:263' at_desc='GLOBAL at lower level' $at_quiet $ECHO_N " 7: GLOBAL at lower level $ECHO_C" at_xfail=no ( echo "7. fundamental.at:263: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog1". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. CALL "prog2" END-CALL CALL "prog3" END-CALL STOP RUN. IDENTIFICATION DIVISION. PROGRAM-ID. prog2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog2". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. IDENTIFICATION DIVISION. PROGRAM-ID. prog3. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog3. END PROGRAM prog2. END PROGRAM prog. _ATEOF $at_traceoff echo "fundamental.at:301: \${COMPILE} prog.cob" echo fundamental.at:301 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:301: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "fundamental.at:306: ./prog" echo fundamental.at:306 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "prog1 prog2 prog2 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "fundamental.at:306: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 8 ) # 8. subscripts.at:28: non-numeric subscript at_setup_line='subscripts.at:28' at_desc='non-numeric subscript' $at_quiet $ECHO_N " 8: non-numeric subscript $ECHO_C" at_xfail=no ( echo "8. subscripts.at:28: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X OCCURS 10. 01 I PIC X. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. DISPLAY X(I + 1) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:49: \${COMPILE_ONLY} prog.cob" echo subscripts.at:49 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'I' is not an integer value prog.cob:12: Error: 'I' is not a numeric value " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:49: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 9 ) # 9. subscripts.at:56: The range of subscripts at_setup_line='subscripts.at:56' at_desc='The range of subscripts' $at_quiet $ECHO_N " 9: The range of subscripts $ECHO_C" at_xfail=no ( echo "9. subscripts.at:56: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X OCCURS 2. 03 Y PIC X OCCURS 3. PROCEDURE DIVISION. DISPLAY X(0) END-DISPLAY. DISPLAY X(1) END-DISPLAY. DISPLAY X(2) END-DISPLAY. DISPLAY X(3) END-DISPLAY. DISPLAY Y(1, 0) END-DISPLAY. DISPLAY Y(1, 1) END-DISPLAY. DISPLAY Y(1, 3) END-DISPLAY. DISPLAY Y(1, 4) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:91: \${COMPILE_ONLY} prog.cob" echo subscripts.at:91 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: Subscript of 'X' out of bounds: 0 prog.cob:16: Error: Subscript of 'X' out of bounds: 3 prog.cob:18: Error: Subscript of 'Y' out of bounds: 0 prog.cob:24: Error: Subscript of 'Y' out of bounds: 4 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:91: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 10 ) # 10. subscripts.at:96: Subscript out of bounds (1) at_setup_line='subscripts.at:96' at_desc='Subscript out of bounds (1)' $at_quiet $ECHO_N " 10: Subscript out of bounds (1) $ECHO_C" at_xfail=no ( echo "10. subscripts.at:96: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10. 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:112: \${COMPILE} -o prog prog.cob" echo subscripts.at:112 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:112: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:115: ./prog" echo subscripts.at:115 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: libcob: Subscript of 'X' out of bounds: 0 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:115: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 11 ) # 11. subscripts.at:120: Subscript out of bounds (2) at_setup_line='subscripts.at:120' at_desc='Subscript out of bounds (2)' $at_quiet $ECHO_N " 11: Subscript out of bounds (2) $ECHO_C" at_xfail=no ( echo "11. subscripts.at:120: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10. 01 I PIC 99 VALUE 11. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:136: \${COMPILE} -o prog prog.cob" echo subscripts.at:136 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:136: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:139: ./prog" echo subscripts.at:139 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: libcob: Subscript of 'X' out of bounds: 11 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:139: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 12 ) # 12. subscripts.at:144: Value of DEPENDING ON N out of bounds (lower) at_setup_line='subscripts.at:144' at_desc='Value of DEPENDING ON N out of bounds (lower)' $at_quiet $ECHO_N " 12: Value of DEPENDING ON N out of bounds (lower)$ECHO_C" at_xfail=no ( echo "12. subscripts.at:144: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 3. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:160: \${COMPILE} -o prog prog.cob" echo subscripts.at:160 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:160: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:163: ./prog" echo subscripts.at:163 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: libcob: OCCURS DEPENDING ON 'N' out of bounds: 3 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:163: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 13 ) # 13. subscripts.at:168: Value of DEPENDING ON N out of bounds (upper) at_setup_line='subscripts.at:168' at_desc='Value of DEPENDING ON N out of bounds (upper)' $at_quiet $ECHO_N " 13: Value of DEPENDING ON N out of bounds (upper)$ECHO_C" at_xfail=no ( echo "13. subscripts.at:168: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 7. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:184: \${COMPILE} -o prog prog.cob" echo subscripts.at:184 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:184: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:187: ./prog" echo subscripts.at:187 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: libcob: OCCURS DEPENDING ON 'N' out of bounds: 7 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:187: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 14 ) # 14. subscripts.at:192: Subscript bounds with ODO (lower) at_setup_line='subscripts.at:192' at_desc='Subscript bounds with ODO (lower)' $at_quiet $ECHO_N " 14: Subscript bounds with ODO (lower) $ECHO_C" at_xfail=no ( echo "14. subscripts.at:192: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(0) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:210: \${COMPILE} -o prog prog.cob" echo subscripts.at:210 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: Subscript of 'X' out of bounds: 0 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:210: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 15 ) # 15. subscripts.at:215: Subscript bounds with ODO (upper) at_setup_line='subscripts.at:215' at_desc='Subscript bounds with ODO (upper)' $at_quiet $ECHO_N " 15: Subscript bounds with ODO (upper) $ECHO_C" at_xfail=no ( echo "15. subscripts.at:215: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(7) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:233: \${COMPILE} -o prog prog.cob" echo subscripts.at:233 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: Subscript of 'X' out of bounds: 7 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:233: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 16 ) # 16. subscripts.at:238: Subscript bounds with ODO at_setup_line='subscripts.at:238' at_desc='Subscript bounds with ODO' $at_quiet $ECHO_N " 16: Subscript bounds with ODO $ECHO_C" at_xfail=no ( echo "16. subscripts.at:238: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:254: \${COMPILE} -o prog prog.cob" echo subscripts.at:254 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:254: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:257: ./prog" echo subscripts.at:257 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: libcob: Subscript of 'X' out of bounds: 5 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:257: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 17 ) # 17. subscripts.at:264: Subscript by arithmetic expression at_setup_line='subscripts.at:264' at_desc='Subscript by arithmetic expression' $at_quiet $ECHO_N " 17: Subscript by arithmetic expression $ECHO_C" at_xfail=no ( echo "17. subscripts.at:264: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G VALUE "1234". 02 X PIC X OCCURS 4. PROCEDURE DIVISION. DISPLAY X((3 + 1) / 2) NO ADVANCING END-DISPLAY. DISPLAY X(2 ** 2) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:281: \${COMPILE} -o prog prog.cob" echo subscripts.at:281 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:281: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "subscripts.at:282: ./prog" echo subscripts.at:282 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "24" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "subscripts.at:282: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 18 ) # 18. ref-mod.at:35: Separate sign positions at_setup_line='ref-mod.at:35' at_desc='Separate sign positions' $at_quiet $ECHO_N " 18: Separate sign positions $ECHO_C" at_xfail=no ( echo "18. ref-mod.at:35: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9 VALUE -1 SIGN LEADING SEPARATE. 01 Y PIC S9 VALUE -1 SIGN TRAILING SEPARATE. PROCEDURE DIVISION. DISPLAY X(1:1) X(2:1) NO ADVANCING END-DISPLAY. DISPLAY Y(1:1) Y(2:1) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:52: \${COMPILE} -o prog prog.cob" echo ref-mod.at:52 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:52: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:53: ./prog" echo ref-mod.at:53 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-11-" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:53: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 19 ) # 19. ref-mod.at:60: Static reference modification at_setup_line='ref-mod.at:60' at_desc='Static reference modification' $at_quiet $ECHO_N " 19: Static reference modification $ECHO_C" at_xfail=no ( echo "19. ref-mod.at:60: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". PROCEDURE DIVISION. DISPLAY X(1:1) ":" X(1:2) ":" X(1:3) ":" X(1:4) ":" X(1:) END-DISPLAY. DISPLAY X(2:1) ":" X(2:2) ":" X(2:3) ":" X(2:) END-DISPLAY. DISPLAY X(3:1) ":" X(3:2) ":" X(3:) END-DISPLAY. DISPLAY X(4:1) ":" X(4:) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:80: \${COMPILE} -o prog prog.cob" echo ref-mod.at:80 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:80: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:86: ./prog" echo ref-mod.at:86 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a:ab:abc:abcd:abcd b:bc:bcd:bcd c:cd:cd d:d " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:86: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 20 ) # 20. ref-mod.at:90: Dynamic reference modification at_setup_line='ref-mod.at:90' at_desc='Dynamic reference modification' $at_quiet $ECHO_N " 20: Dynamic reference modification $ECHO_C" at_xfail=no ( echo "20. ref-mod.at:90: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9. PROCEDURE DIVISION. MOVE 1 TO I. DISPLAY X(I:1) END-DISPLAY. MOVE 4 TO I. DISPLAY X(I:1) END-DISPLAY. MOVE 1 TO I. DISPLAY X(1:I) END-DISPLAY. MOVE 4 TO I. DISPLAY X(1:I) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:111: \${COMPILE} -o prog prog.cob" echo ref-mod.at:111 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:111: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:117: ./prog" echo ref-mod.at:117 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a d a abcd " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:117: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 21 ) # 21. ref-mod.at:121: Static out of bounds at_setup_line='ref-mod.at:121' at_desc='Static out of bounds' $at_quiet $ECHO_N " 21: Static out of bounds $ECHO_C" at_xfail=no ( echo "21. ref-mod.at:121: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4). PROCEDURE DIVISION. DISPLAY X(0:1) END-DISPLAY. DISPLAY X(5:1) END-DISPLAY. DISPLAY X(1:0) END-DISPLAY. DISPLAY X(1:5) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:146: \${COMPILE_ONLY} prog.cob" echo ref-mod.at:146 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: Offset of 'X' out of bounds: 0 prog.cob:10: Error: Offset of 'X' out of bounds: 5 prog.cob:12: Error: Length of 'X' out of bounds: 0 prog.cob:14: Error: Length of 'X' out of bounds: 5 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "ref-mod.at:146: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 22 ) # 22. ref-mod.at:150: Offset underflow at_setup_line='ref-mod.at:150' at_desc='Offset underflow' $at_quiet $ECHO_N " 22: Offset underflow $ECHO_C" at_xfail=no ( echo "22. ref-mod.at:150: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(I:1) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:165: \${COMPILE} -o prog prog.cob" echo ref-mod.at:165 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:165: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:168: ./prog" echo ref-mod.at:168 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: libcob: Offset of 'X' out of bounds: 0 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "ref-mod.at:168: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 23 ) # 23. ref-mod.at:172: Offset overflow at_setup_line='ref-mod.at:172' at_desc='Offset overflow' $at_quiet $ECHO_N " 23: Offset overflow $ECHO_C" at_xfail=no ( echo "23. ref-mod.at:172: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 5. PROCEDURE DIVISION. DISPLAY X(I:1) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:187: \${COMPILE} -o prog prog.cob" echo ref-mod.at:187 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:187: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:190: ./prog" echo ref-mod.at:190 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: libcob: Offset of 'X' out of bounds: 5 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "ref-mod.at:190: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 24 ) # 24. ref-mod.at:194: Length underflow at_setup_line='ref-mod.at:194' at_desc='Length underflow' $at_quiet $ECHO_N " 24: Length underflow $ECHO_C" at_xfail=no ( echo "24. ref-mod.at:194: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(1:I) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:209: \${COMPILE} -o prog prog.cob" echo ref-mod.at:209 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:209: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:212: ./prog" echo ref-mod.at:212 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: libcob: Length of 'X' out of bounds: 0 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "ref-mod.at:212: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 25 ) # 25. ref-mod.at:216: Length overflow at_setup_line='ref-mod.at:216' at_desc='Length overflow' $at_quiet $ECHO_N " 25: Length overflow $ECHO_C" at_xfail=no ( echo "25. ref-mod.at:216: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 5. PROCEDURE DIVISION. DISPLAY X(1:I) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "ref-mod.at:231: \${COMPILE} -o prog prog.cob" echo ref-mod.at:231 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "ref-mod.at:231: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "ref-mod.at:234: ./prog" echo ref-mod.at:234 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: libcob: Length of 'X' out of bounds: 5 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "ref-mod.at:234: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 26 ) # 26. accept.at:23: ACCEPT at_setup_line='accept.at:23' at_desc='ACCEPT' $at_quiet $ECHO_N " 26: ACCEPT $ECHO_C" at_xfail=no ( echo "26. accept.at:23: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(8). PROCEDURE DIVISION. ACCEPT X FROM DATE END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DATE YYYYMMDD END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DAY END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DAY YYYYDDD END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "accept.at:55: \${COMPILE} -o prog prog.cob" echo accept.at:55 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "accept.at:55: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "accept.at:61: ./prog" echo accept.at:61 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "(999999 ) (99999999) (99999 ) (9999999 ) " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "accept.at:61: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 27 ) # 27. initialize.at:27: INITIALIZE group entry with OCCURS at_setup_line='initialize.at:27' at_desc='INITIALIZE group entry with OCCURS' $at_quiet $ECHO_N " 27: INITIALIZE group entry with OCCURS $ECHO_C" at_xfail=no ( echo "27. initialize.at:27: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X1 PIC X. 03 X2 PIC 9. PROCEDURE DIVISION. MOVE SPACE TO G1. INITIALIZE G2 (2). DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "initialize.at:46: \${COMPILE} -o prog prog.cob" echo initialize.at:46 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:46: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "initialize.at:47: ./prog" echo initialize.at:47 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " 0" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:47: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 28 ) # 28. initialize.at:52: INITIALIZE OCCURS with numeric edited at_setup_line='initialize.at:52' at_desc='INITIALIZE OCCURS with numeric edited' $at_quiet $ECHO_N " 28: INITIALIZE OCCURS with numeric edited $ECHO_C" at_xfail=no ( echo "28. initialize.at:52: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 5. 03 X PIC Z9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "initialize.at:69: \${COMPILE} -o prog prog.cob" echo initialize.at:69 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:69: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "initialize.at:70: ./prog" echo initialize.at:70 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " 0 0 0 0 0" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:70: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 29 ) # 29. initialize.at:75: INITIALIZE complex group (1) at_setup_line='initialize.at:75' at_desc='INITIALIZE complex group (1)' $at_quiet $ECHO_N " 29: INITIALIZE complex group (1) $ECHO_C" at_xfail=no ( echo "29. initialize.at:75: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 G2 OCCURS 2. 03 Y PIC 9. 02 Z PIC 9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "initialize.at:94: \${COMPILE} -o prog prog.cob" echo initialize.at:94 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:94: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "initialize.at:95: ./prog" echo initialize.at:95 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " 000" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:95: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 30 ) # 30. initialize.at:99: INITIALIZE complex group (2) at_setup_line='initialize.at:99' at_desc='INITIALIZE complex group (2)' $at_quiet $ECHO_N " 30: INITIALIZE complex group (2) $ECHO_C" at_xfail=no ( echo "30. initialize.at:99: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X PIC 9. 03 Y PIC X OCCURS 2. 03 Z PIC X. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "initialize.at:118: \${COMPILE} -o prog prog.cob" echo initialize.at:118 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:118: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "initialize.at:119: ./prog" echo initialize.at:119 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0 0 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:119: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 31 ) # 31. initialize.at:123: INITIALIZE with REDEFINES at_setup_line='initialize.at:123' at_desc='INITIALIZE with REDEFINES' $at_quiet $ECHO_N " 31: INITIALIZE with REDEFINES $ECHO_C" at_xfail=no ( echo "31. initialize.at:123: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 Y REDEFINES X PIC 9. 02 Z PIC 9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "initialize.at:141: \${COMPILE} -o prog prog.cob" echo initialize.at:141 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:141: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "initialize.at:142: ./prog" echo initialize.at:142 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " 0" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "initialize.at:142: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 32 ) # 32. misc.at:21: Source file not found at_setup_line='misc.at:21' at_desc='Source file not found' $at_quiet $ECHO_N " 32: Source file not found $ECHO_C" at_xfail=no ( echo "32. misc.at:21: testing ..." $at_traceon $at_traceoff echo "misc.at:25: \${COMPILE_ONLY} prog.cob" echo misc.at:25 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "cobc: prog.cob: No such file or directory " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "misc.at:25: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 33 ) # 33. misc.at:30: Comma separator without space at_setup_line='misc.at:30' at_desc='Comma separator without space' $at_quiet $ECHO_N " 33: Comma separator without space $ECHO_C" at_xfail=no ( echo "33. misc.at:30: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY 1,1,1 NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:41: \${COMPILE} -o prog prog.cob" echo misc.at:41 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:41: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:42: ./prog" echo misc.at:42 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "111" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:42: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 34 ) # 34. misc.at:47: LOCAL-STORAGE at_setup_line='misc.at:47' at_desc='LOCAL-STORAGE' $at_quiet $ECHO_N " 34: LOCAL-STORAGE $ECHO_C" at_xfail=no ( echo "34. misc.at:47: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-X PIC XXX VALUE "abc". LOCAL-STORAGE SECTION. 01 LCL-X PIC XXX VALUE "abc". PROCEDURE DIVISION. DISPLAY "WRK-X = " WRK-X END-DISPLAY. DISPLAY "LCL-X = " LCL-X END-DISPLAY. MOVE ZERO TO WRK-X LCL-X. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. CALL "callee" END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:77: \${COMPILE_MODULE} callee.cob" echo misc.at:77 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:77: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:78: \${COMPILE} -o prog caller.cob" echo misc.at:78 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:78: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:84: ./prog" echo misc.at:84 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "WRK-X = abc LCL-X = abc WRK-X = 000 LCL-X = abc " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:84: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 35 ) # 35. misc.at:89: EXTERNAL data item at_setup_line='misc.at:89' at_desc='EXTERNAL data item' $at_quiet $ECHO_N " 35: EXTERNAL data item $ECHO_C" at_xfail=no ( echo "35. misc.at:89: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-VAR PIC X(5). 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 EXT-VAR PIC X(5) EXTERNAL. 01 WRK-VAR PIC X(5). PROCEDURE DIVISION. MOVE "Hello" TO EXT-VAR. CALL "callee" END-CALL. DISPLAY EXT-VAR END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:121: \${COMPILE_MODULE} callee.cob" echo misc.at:121 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:121: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:122: \${COMPILE} -o prog caller.cob" echo misc.at:122 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:122: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:126: ./prog" echo misc.at:126 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "Hello World " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:126: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 36 ) # 36. misc.at:131: EXTERNAL AS data item at_setup_line='misc.at:131' at_desc='EXTERNAL AS data item' $at_quiet $ECHO_N " 36: EXTERNAL AS data item $ECHO_C" at_xfail=no ( echo "36. misc.at:131: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 PRG-VAR PIC X(5) EXTERNAL AS "WRK-VAR". 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY PRG-VAR END-DISPLAY. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYVAR PIC X(5) EXTERNAL AS "EXT-VAR". 01 WRK-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. MOVE "Extrn" TO WRK-VAR. MOVE "Hello" TO MYVAR. CALL "callee" END-CALL. DISPLAY MYVAR END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:166: \${COMPILE_MODULE} callee.cob" echo misc.at:166 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:166: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:167: \${COMPILE} -o prog caller.cob" echo misc.at:167 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:167: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:172: ./prog" echo misc.at:172 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "Extrn Hello World " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:172: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 37 ) # 37. misc.at:177: cobcrun validation at_setup_line='misc.at:177' at_desc='cobcrun validation' $at_quiet $ECHO_N " 37: cobcrun validation $ECHO_C" at_xfail=no ( echo "37. misc.at:177: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-VAR PIC X(5). 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 EXT-VAR PIC X(5) EXTERNAL. 01 WRK-VAR PIC X(5). PROCEDURE DIVISION. MOVE "Hello" TO EXT-VAR. CALL "callee" END-CALL. DISPLAY EXT-VAR END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:209: \${COMPILE_MODULE} callee.cob" echo misc.at:209 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:209: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:210: \${COMPILE_MODULE} caller.cob" echo misc.at:210 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:210: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:214: \${COBCRUN} caller" echo misc.at:214 >$at_check_line_file ( $at_traceon; ${COBCRUN} caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "Hello World " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:214: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 38 ) # 38. misc.at:221: MOVE to itself at_setup_line='misc.at:221' at_desc='MOVE to itself' $at_quiet $ECHO_N " 38: MOVE to itself $ECHO_C" at_xfail=no ( echo "38. misc.at:221: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99 VALUE 12. PROCEDURE DIVISION. MOVE X TO X. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:236: \${COMPILE} -o prog prog.cob" echo misc.at:236 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:236: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:237: ./prog" echo misc.at:237 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "12" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:237: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 39 ) # 39. misc.at:241: MOVE with refmod at_setup_line='misc.at:241' at_desc='MOVE with refmod' $at_quiet $ECHO_N " 39: MOVE with refmod $ECHO_C" at_xfail=no ( echo "39. misc.at:241: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4) VALUE 0. PROCEDURE DIVISION. MOVE "1" TO X(1:1). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:256: \${COMPILE} -o prog prog.cob" echo misc.at:256 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:256: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:257: ./prog" echo misc.at:257 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1000" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:257: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 40 ) # 40. misc.at:261: MOVE with refmod (variable) at_setup_line='misc.at:261' at_desc='MOVE with refmod (variable)' $at_quiet $ECHO_N " 40: MOVE with refmod (variable) $ECHO_C" at_xfail=no ( echo "40. misc.at:261: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "1234". 01 Y PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 1. PROCEDURE DIVISION. MOVE X(1:I) TO Y. DISPLAY Y NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:278: \${COMPILE} -o prog prog.cob" echo misc.at:278 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:278: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:279: ./prog" echo misc.at:279 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:279: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 41 ) # 41. misc.at:283: MOVE with group refmod at_setup_line='misc.at:283' at_desc='MOVE with group refmod' $at_quiet $ECHO_N " 41: MOVE with group refmod $ECHO_C" at_xfail=no ( echo "41. misc.at:283: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC 9999 VALUE 1234. PROCEDURE DIVISION. MOVE "99" TO G(3:2). DISPLAY G NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:299: \${COMPILE} -o prog prog.cob" echo misc.at:299 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:299: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:300: ./prog" echo misc.at:300 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1299" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:300: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 42 ) # 42. misc.at:304: MOVE indexes at_setup_line='misc.at:304' at_desc='MOVE indexes' $at_quiet $ECHO_N " 42: MOVE indexes $ECHO_C" at_xfail=no ( echo "42. misc.at:304: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10 INDEXED I. PROCEDURE DIVISION. SET I TO ZERO. MOVE I TO X(1). DISPLAY X(1) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:321: \${COMPILE} -o prog prog.cob" echo misc.at:321 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:321: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:322: ./prog" echo misc.at:322 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:322: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 43 ) # 43. misc.at:326: MOVE X'00' at_setup_line='misc.at:326' at_desc='MOVE X'00'' $at_quiet $ECHO_N " 43: MOVE X'00' $ECHO_C" at_xfail=no ( echo "43. misc.at:326: testing ..." $at_traceon cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { printf ("%02x%02x%02x", data[0], data[1], data[2]); return 0; } _ATEOF $at_traceoff echo "misc.at:338: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo misc.at:338 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:338: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC XXX. PROCEDURE DIVISION. MOVE X"000102" TO X. CALL "dump" USING X END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:353: \${COMPILE} -o prog prog.cob" echo misc.at:353 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:353: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:354: ./prog" echo misc.at:354 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "000102" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:354: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 44 ) # 44. misc.at:361: Level 01 subscripts at_setup_line='misc.at:361' at_desc='Level 01 subscripts' $at_quiet $ECHO_N " 44: Level 01 subscripts $ECHO_C" at_xfail=no ( echo "44. misc.at:361: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X OCCURS 10. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "misc.at:375: \${COMPILE_ONLY} prog.cob" echo misc.at:375 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: Level 01 item 'X' cannot have OCCURS clause " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "misc.at:375: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 45 ) # 45. misc.at:382: Class check with reference modification at_setup_line='misc.at:382' at_desc='Class check with reference modification' $at_quiet $ECHO_N " 45: Class check with reference modification $ECHO_C" at_xfail=no ( echo "45. misc.at:382: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(6) VALUE "123 ". PROCEDURE DIVISION. IF X(1:3) NUMERIC DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "misc.at:398: \${COMPILE} -o prog prog.cob" echo misc.at:398 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:398: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:399: ./prog" echo misc.at:399 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:399: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 46 ) # 46. misc.at:403: Index and parenthesized expression at_setup_line='misc.at:403' at_desc='Index and parenthesized expression' $at_quiet $ECHO_N " 46: Index and parenthesized expression $ECHO_C" at_xfail=no ( echo "46. misc.at:403: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 1 INDEXED BY I. PROCEDURE DIVISION. IF I < (I + 2) DISPLAY "OK" END-DISPLAY END-IF. _ATEOF $at_traceoff echo "misc.at:419: \${COMPILE_ONLY} -o prog prog.cob" echo misc.at:419 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:419: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 47 ) # 47. misc.at:423: Alphanumeric and binary numeric at_setup_line='misc.at:423' at_desc='Alphanumeric and binary numeric' $at_quiet $ECHO_N " 47: Alphanumeric and binary numeric $ECHO_C" at_xfail=no ( echo "47. misc.at:423: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC XXXX VALUE "0001". 01 X-9 PIC 9999 COMP VALUE 1. PROCEDURE DIVISION. IF X-X = X-9 DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. _ATEOF $at_traceoff echo "misc.at:439: \${COMPILE} -o prog prog.cob" echo misc.at:439 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:439: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:440: ./prog" echo misc.at:440 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:440: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 48 ) # 48. misc.at:447: Dynamic call with static linking at_setup_line='misc.at:447' at_desc='Dynamic call with static linking' $at_quiet $ECHO_N " 48: Dynamic call with static linking $ECHO_C" at_xfail=no ( echo "48. misc.at:447: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. _ATEOF $at_traceoff echo "misc.at:465: \${COMPILE_MODULE} -c callee.cob" echo misc.at:465 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} -c callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:465: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:466: \${COMPILE} -c caller.cob" echo misc.at:466 >$at_check_line_file ( $at_traceon; ${COMPILE} -c caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:466: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:467: \${COMPILE} -o prog caller.o callee.o" echo misc.at:467 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog caller.o callee.o ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:467: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:468: ./prog" echo misc.at:468 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:468: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 49 ) # 49. misc.at:472: CALL m1. CALL m2. CALL m1. at_setup_line='misc.at:472' at_desc='CALL m1. CALL m2. CALL m1.' $at_quiet $ECHO_N " 49: CALL m1. CALL m2. CALL m1. $ECHO_C" at_xfail=no ( echo "49. misc.at:472: testing ..." $at_traceon cat >m1.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. m1. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4). PROCEDURE DIVISION. COMPUTE X = 1 + 2 END-COMPUTE. DISPLAY X END-DISPLAY. _ATEOF cat >m2.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. m2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4). PROCEDURE DIVISION. COMPUTE X = 3 + 4 END-COMPUTE. DISPLAY X END-DISPLAY. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "m1" END-CALL. CALL "m2" END-CALL. CALL "m1" END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:513: \${COMPILE_MODULE} m1.cob" echo misc.at:513 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} m1.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:513: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:514: \${COMPILE_MODULE} m2.cob" echo misc.at:514 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} m2.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:514: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:515: \${COMPILE} -o caller caller.cob" echo misc.at:515 >$at_check_line_file ( $at_traceon; ${COMPILE} -o caller caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:515: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:521: ./caller" echo misc.at:521 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0003 0007 0003 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:521: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 50 ) # 50. misc.at:525: CALL binary literal parameter/LENGTH OF at_setup_line='misc.at:525' at_desc='CALL binary literal parameter/LENGTH OF' $at_quiet $ECHO_N " 50: CALL binary literal parameter/LENGTH OF $ECHO_C" at_xfail=no ( echo "50. misc.at:525: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "default.conf" binary-byteorder: native _ATEOF cat >dump.c <<'_ATEOF' #include int dump (int *p) { printf ("%8.8d\n", *p); return 0; } _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYOCC PIC 9(8) COMP. 01 MYTAB. 03 MYBYTE PIC X OCCURS 1 TO 20 DEPENDING ON MYOCC. PROCEDURE DIVISION. MOVE 9 TO MYOCC. CALL "dump" USING BY CONTENT 1 END-CALL. CALL "dump" USING BY CONTENT LENGTH OF MYTAB END-CALL. CALL "dump" USING BY CONTENT LENGTH OF MYOCC END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:561: \${COMPILE_MODULE} dump.c" echo misc.at:561 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:561: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:562: \${COMPILE} -o prog prog.cob" echo misc.at:562 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:562: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:567: ./prog" echo misc.at:567 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000001 00000009 00000004 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:567: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:568: \${COMPILE} -conf=test.conf -o prog prog.cob" echo misc.at:568 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:568: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:573: ./prog" echo misc.at:573 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000001 00000009 00000004 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:573: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 51 ) # 51. misc.at:580: INSPECT REPLACING LEADING ZEROS BY SPACES at_setup_line='misc.at:580' at_desc='INSPECT REPLACING LEADING ZEROS BY SPACES' $at_quiet $ECHO_N " 51: INSPECT REPLACING LEADING ZEROS BY SPACES $ECHO_C" at_xfail=no ( echo "51. misc.at:580: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "0001". PROCEDURE DIVISION. INSPECT X REPLACING LEADING ZEROS BY SPACES. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:595: \${COMPILE} prog.cob" echo misc.at:595 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:595: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:596: ./prog" echo misc.at:596 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " 1" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:596: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 52 ) # 52. misc.at:600: INSPECT: No repeat conversion check at_setup_line='misc.at:600' at_desc='INSPECT: No repeat conversion check' $at_quiet $ECHO_N " 52: INSPECT: No repeat conversion check $ECHO_C" at_xfail=no ( echo "52. misc.at:600: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(3) VALUE "BCA". PROCEDURE DIVISION. INSPECT X CONVERTING "ABC" TO "BCD". DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:615: \${COMPILE} prog.cob" echo misc.at:615 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:615: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:616: ./prog" echo misc.at:616 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "CDB" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:616: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 53 ) # 53. misc.at:621: INSPECT: REPLACING figurative constant at_setup_line='misc.at:621' at_desc='INSPECT: REPLACING figurative constant' $at_quiet $ECHO_N " 53: INSPECT: REPLACING figurative constant $ECHO_C" at_xfail=no ( echo "53. misc.at:621: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(3) VALUE "BCA". PROCEDURE DIVISION. INSPECT X REPLACING ALL "BC" BY SPACE. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:636: \${COMPILE} prog.cob" echo misc.at:636 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:636: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:637: ./prog" echo misc.at:637 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " A" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:637: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 54 ) # 54. misc.at:642: INSPECT: TALLYING BEFORE at_setup_line='misc.at:642' at_desc='INSPECT: TALLYING BEFORE' $at_quiet $ECHO_N " 54: INSPECT: TALLYING BEFORE $ECHO_C" at_xfail=no ( echo "54. misc.at:642: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "ABC ". 01 TAL PIC 999 VALUE 0. PROCEDURE DIVISION. MOVE 0 TO TAL. INSPECT X TALLYING TAL FOR CHARACTERS BEFORE INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. MOVE 0 TO TAL. MOVE " ABC" TO X. INSPECT X TALLYING TAL FOR CHARACTERS BEFORE INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:666: \${COMPILE} prog.cob" echo misc.at:666 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:666: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:667: ./prog" echo misc.at:667 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "003000" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:667: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 55 ) # 55. misc.at:672: INSPECT: TALLYING AFTER at_setup_line='misc.at:672' at_desc='INSPECT: TALLYING AFTER' $at_quiet $ECHO_N " 55: INSPECT: TALLYING AFTER $ECHO_C" at_xfail=no ( echo "55. misc.at:672: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "ABC ". 01 TAL PIC 999 VALUE 0. PROCEDURE DIVISION. MOVE 0 TO TAL. INSPECT X TALLYING TAL FOR CHARACTERS AFTER INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. MOVE 0 TO TAL. MOVE " ABC" TO X. INSPECT X TALLYING TAL FOR CHARACTERS AFTER INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:696: \${COMPILE} prog.cob" echo misc.at:696 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:696: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:697: ./prog" echo misc.at:697 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "000003" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:697: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 56 ) # 56. misc.at:701: INSPECT REPLACING TRAILING ZEROS BY SPACES at_setup_line='misc.at:701' at_desc='INSPECT REPLACING TRAILING ZEROS BY SPACES' $at_quiet $ECHO_N " 56: INSPECT REPLACING TRAILING ZEROS BY SPACES $ECHO_C" at_xfail=no ( echo "56. misc.at:701: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "1000". PROCEDURE DIVISION. INSPECT X REPLACING TRAILING ZEROS BY SPACES. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:716: \${COMPILE} prog.cob" echo misc.at:716 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:716: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:717: ./prog" echo misc.at:717 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:717: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 57 ) # 57. misc.at:721: INSPECT REPLACING complex at_setup_line='misc.at:721' at_desc='INSPECT REPLACING complex' $at_quiet $ECHO_N " 57: INSPECT REPLACING complex $ECHO_C" at_xfail=no ( echo "57. misc.at:721: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE "AAABBCDCCCCC". PROCEDURE DIVISION. INSPECT X REPLACING ALL "A" BY "Z" "B" BY "Y" TRAILING "C" BY "X". DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:739: \${COMPILE} prog.cob" echo misc.at:739 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:739: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:740: ./prog" echo misc.at:740 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "ZZZYYCDXXXXX" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:740: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 58 ) # 58. misc.at:743: SWITCHES at_setup_line='misc.at:743' at_desc='SWITCHES' $at_quiet $ECHO_N " 58: SWITCHES $ECHO_C" at_xfail=no ( echo "58. misc.at:743: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. SWITCH-1 IS SWIT1 ON IS SWIT1-ON OFF IS SWIT1-OFF SWITCH-2 IS SWIT2 ON IS SWIT2-ON OFF IS SWIT2-OFF. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. IF SWIT1-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. IF SWIT2-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. SET SWIT1 TO OFF. SET SWIT2 TO ON. IF SWIT1-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. IF SWIT2-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "misc.at:793: \${COMPILE} prog.cob" echo misc.at:793 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:793: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:794: COB_SWITCH_1=ON COB_SWITCH_2=OFF ./prog" echo misc.at:794 >$at_check_line_file ( $at_traceon; COB_SWITCH_1=ON COB_SWITCH_2=OFF ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "ONOFFOFFON" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:794: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 59 ) # 59. misc.at:801: Nested PERFORM at_setup_line='misc.at:801' at_desc='Nested PERFORM' $at_quiet $ECHO_N " 59: Nested PERFORM $ECHO_C" at_xfail=no ( echo "59. misc.at:801: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. PROCEDURE DIVISION. PERFORM 2 TIMES PERFORM 2 TIMES DISPLAY "X" NO ADVANCING END-DISPLAY END-PERFORM END-PERFORM. STOP RUN. _ATEOF $at_traceoff echo "misc.at:817: \${COMPILE} -o prog prog.cob" echo misc.at:817 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:817: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:818: ./prog" echo misc.at:818 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "XXXX" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:818: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 60 ) # 60. misc.at:826: EXIT PERFORM at_setup_line='misc.at:826' at_desc='EXIT PERFORM' $at_quiet $ECHO_N " 60: EXIT PERFORM $ECHO_C" at_xfail=no ( echo "60. misc.at:826: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES DISPLAY "OK" NO ADVANCING END-DISPLAY EXIT PERFORM DISPLAY "NOT REACHED" END-DISPLAY END-PERFORM STOP RUN. _ATEOF $at_traceoff echo "misc.at:842: \${COMPILE} -o prog prog.cob" echo misc.at:842 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:842: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:843: ./prog" echo misc.at:843 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:843: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 61 ) # 61. misc.at:850: EXIT PERFORM CYCLE at_setup_line='misc.at:850' at_desc='EXIT PERFORM CYCLE' $at_quiet $ECHO_N " 61: EXIT PERFORM CYCLE $ECHO_C" at_xfail=no ( echo "61. misc.at:850: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES DISPLAY "OK" NO ADVANCING END-DISPLAY EXIT PERFORM CYCLE DISPLAY "NOT REACHED" END-DISPLAY END-PERFORM STOP RUN. _ATEOF $at_traceoff echo "misc.at:866: \${COMPILE} -o prog prog.cob" echo misc.at:866 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:866: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:867: ./prog" echo misc.at:867 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:867: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 62 ) # 62. misc.at:874: EXIT PARAGRAPH at_setup_line='misc.at:874' at_desc='EXIT PARAGRAPH' $at_quiet $ECHO_N " 62: EXIT PARAGRAPH $ECHO_C" at_xfail=no ( echo "62. misc.at:874: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INDVAL PIC 9(4). PROCEDURE DIVISION. A01. PERFORM VARYING INDVAL FROM 1 BY 1 UNTIL INDVAL > 10 IF INDVAL > 2 EXIT PARAGRAPH END-IF END-PERFORM . A02. DISPLAY INDVAL NO ADVANCING END-DISPLAY STOP RUN . _ATEOF $at_traceoff echo "misc.at:897: \${COMPILE} -o prog prog.cob" echo misc.at:897 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:897: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:898: ./prog" echo misc.at:898 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0003" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:898: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 63 ) # 63. misc.at:905: EXIT SECTION at_setup_line='misc.at:905' at_desc='EXIT SECTION' $at_quiet $ECHO_N " 63: EXIT SECTION $ECHO_C" at_xfail=no ( echo "63. misc.at:905: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INDVAL PIC 9(4). PROCEDURE DIVISION. A01 SECTION. A011. PERFORM VARYING INDVAL FROM 1 BY 1 UNTIL INDVAL > 10 IF INDVAL > 2 EXIT SECTION END-IF END-PERFORM . A012. DISPLAY INDVAL NO ADVANCING END-DISPLAY . A02 SECTION. DISPLAY INDVAL NO ADVANCING END-DISPLAY STOP RUN . _ATEOF $at_traceoff echo "misc.at:933: \${COMPILE} -o prog prog.cob" echo misc.at:933 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:933: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:934: ./prog" echo misc.at:934 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0003" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:934: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 64 ) # 64. misc.at:939: 88 with FILLER at_setup_line='misc.at:939' at_desc='88 with FILLER' $at_quiet $ECHO_N " 64: 88 with FILLER $ECHO_C" at_xfail=no ( echo "64. misc.at:939: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 FILLER PIC X VALUE SPACE. 88 X VALUE "X". PROCEDURE DIVISION. IF X DISPLAY "NO" NO ADVANCING END-DISPLAY END-IF. SET X TO TRUE. IF X DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "misc.at:961: \${COMPILE} -o prog prog.cob" echo misc.at:961 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:961: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:962: ./prog" echo misc.at:962 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:962: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 65 ) # 65. misc.at:966: Non-overflow after overflow at_setup_line='misc.at:966' at_desc='Non-overflow after overflow' $at_quiet $ECHO_N " 65: Non-overflow after overflow $ECHO_C" at_xfail=no ( echo "65. misc.at:966: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(2) VALUE 0. 01 Y PIC 9(2) VALUE 0. PROCEDURE DIVISION. COMPUTE X = 100 END-COMPUTE. COMPUTE Y = 99 END-COMPUTE. DISPLAY Y NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:985: \${COMPILE} -o prog prog.cob" echo misc.at:985 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:985: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:986: ./prog" echo misc.at:986 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "99" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:986: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 66 ) # 66. misc.at:993: PERFORM ... CONTINUE at_setup_line='misc.at:993' at_desc='PERFORM ... CONTINUE' $at_quiet $ECHO_N " 66: PERFORM ... CONTINUE $ECHO_C" at_xfail=no ( echo "66. misc.at:993: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES CONTINUE END-PERFORM. _ATEOF $at_traceoff echo "misc.at:1004: \${COMPILE_ONLY} prog.cob" echo misc.at:1004 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1004: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 67 ) # 67. misc.at:1009: STRING with subscript reference at_setup_line='misc.at:1009' at_desc='STRING with subscript reference' $at_quiet $ECHO_N " 67: STRING with subscript reference $ECHO_C" at_xfail=no ( echo "67. misc.at:1009: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(3) OCCURS 3. PROCEDURE DIVISION. STRING "abc" INTO X(1) END-STRING. DISPLAY X(1) NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1026: \${COMPILE} -o prog prog.cob" echo misc.at:1026 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1026: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1027: ./prog" echo misc.at:1027 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "abc" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1027: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 68 ) # 68. misc.at:1032: UNSTRING DELIMITED ALL LOW-VALUE at_setup_line='misc.at:1032' at_desc='UNSTRING DELIMITED ALL LOW-VALUE' $at_quiet $ECHO_N " 68: UNSTRING DELIMITED ALL LOW-VALUE $ECHO_C" at_xfail=no ( echo "68. misc.at:1032: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 03 FILLER PIC XXX VALUE "ABC". 03 FILLER PIC XX VALUE LOW-VALUES. 03 FILLER PIC XXX VALUE "DEF". 01 A PIC XXX. 01 B PIC XXX. PROCEDURE DIVISION. UNSTRING G DELIMITED BY ALL LOW-VALUES INTO A B END-UNSTRING. DISPLAY A END-DISPLAY. DISPLAY B END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1056: \${COMPILE} -o prog prog.cob" echo misc.at:1056 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1056: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1060: ./prog" echo misc.at:1060 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "ABC DEF " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1060: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 69 ) # 69. misc.at:1065: READ INTO AT-END sequence at_setup_line='misc.at:1065' at_desc='READ INTO AT-END sequence' $at_quiet $ECHO_N " 69: READ INTO AT-END sequence $ECHO_C" at_xfail=no ( echo "69. misc.at:1065: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(10). WORKING-STORAGE SECTION. 01 X PIC X(10). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. OPEN INPUT TEST-FILE. READ TEST-FILE INTO X AT END MOVE ZERO TO X END-READ. CLOSE TEST-FILE. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1093: \${COMPILE} -o prog prog.cob" echo misc.at:1093 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1093: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1094: ./prog" echo misc.at:1094 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0000000000" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1094: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 70 ) # 70. misc.at:1099: First READ on empty SEQUENTIAL INDEXED file at_setup_line='misc.at:1099' at_desc='First READ on empty SEQUENTIAL INDEXED file' $at_quiet $ECHO_N " 70: First READ on empty SEQUENTIAL INDEXED file $ECHO_C" at_xfail=no ( echo "70. misc.at:1099: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS INDEXED ACCESS MODE IS SEQUENTIAL RECORD KEY IS TEST-KEY. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-KEY PIC X(10). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. OPEN INPUT TEST-FILE. READ TEST-FILE AT END DISPLAY "OK" NO ADVANCING END-DISPLAY END-READ. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1128: \${COMPILE} -o prog prog.cob" echo misc.at:1128 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1128: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1129: ./prog" echo misc.at:1129 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1129: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 71 ) # 71. misc.at:1134: REWRITE a RELATIVE file with RANDOM access at_setup_line='misc.at:1134' at_desc='REWRITE a RELATIVE file with RANDOM access' $at_quiet $ECHO_N " 71: REWRITE a RELATIVE file with RANDOM access $ECHO_C" at_xfail=no ( echo "71. misc.at:1134: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS RELATIVE ACCESS MODE IS RANDOM RELATIVE KEY IS TEST-KEY. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X. WORKING-STORAGE SECTION. 01 TEST-KEY PIC 9. PROCEDURE DIVISION. * OPEN OUTPUT TEST-FILE. MOVE 1 TO TEST-KEY. MOVE "A" TO TEST-REC. WRITE TEST-REC END-WRITE. MOVE 2 TO TEST-KEY. MOVE "B" TO TEST-REC. WRITE TEST-REC END-WRITE. CLOSE TEST-FILE. * OPEN I-O TEST-FILE. MOVE 1 TO TEST-KEY. READ TEST-FILE END-READ. MOVE 2 TO TEST-KEY. MOVE "C" TO TEST-REC. REWRITE TEST-REC END-REWRITE. CLOSE TEST-FILE. * OPEN INPUT TEST-FILE. MOVE 1 TO TEST-KEY. READ TEST-FILE END-READ. DISPLAY TEST-REC END-DISPLAY. MOVE 2 TO TEST-KEY. READ TEST-FILE END-READ. DISPLAY TEST-REC END-DISPLAY. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1179: \${COMPILE} -o prog prog.cob" echo misc.at:1179 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1179: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1183: ./prog" echo misc.at:1183 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "A C " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1183: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 72 ) # 72. misc.at:1188: SORT: table sort at_setup_line='misc.at:1188' at_desc='SORT: table sort' $at_quiet $ECHO_N " 72: SORT: table sort $ECHO_C" at_xfail=no ( echo "72. misc.at:1188: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G VALUE "d4b2e1a3c5". 02 TBL OCCURS 5. 03 X PIC X. 03 Y PIC 9. PROCEDURE DIVISION. SORT TBL ASCENDING KEY X. DISPLAY G END-DISPLAY. SORT TBL DESCENDING KEY Y. DISPLAY G END-DISPLAY. SORT TBL ASCENDING KEY TBL. DISPLAY G END-DISPLAY. SORT TBL DESCENDING KEY. DISPLAY G END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1215: \${COMPILE} -o prog prog.cob" echo misc.at:1215 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1215: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1221: ./prog" echo misc.at:1221 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a3b2c5d4e1 c5d4a3b2e1 a3b2c5d4e1 e1d4c5b2a3 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1221: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 73 ) # 73. misc.at:1225: SORT: EBCDIC table sort at_setup_line='misc.at:1225' at_desc='SORT: EBCDIC table sort' $at_quiet $ECHO_N " 73: SORT: EBCDIC table sort $ECHO_C" at_xfail=no ( echo "73. misc.at:1225: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. ALPHABET ALPHA IS EBCDIC. DATA DIVISION. WORKING-STORAGE SECTION. 01 Z PIC X(10) VALUE "d4b2e1a3c5". 01 G VALUE "d4b2e1a3c5". 02 TBL OCCURS 10. 03 X PIC X. PROCEDURE DIVISION. SORT TBL ASCENDING KEY X. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL DESCENDING KEY X. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL ASCENDING KEY X SEQUENCE ALPHA. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL DESCENDING KEY X SEQUENCE ALPHA. DISPLAY G END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1259: \${COMPILE} -o prog prog.cob" echo misc.at:1259 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1259: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1265: ./prog" echo misc.at:1265 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "12345abcde edcba54321 abcde12345 54321edcba " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1265: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 74 ) # 74. misc.at:1269: SORT nonexistent file at_setup_line='misc.at:1269' at_desc='SORT nonexistent file' $at_quiet $ECHO_N " 74: SORT nonexistent file $ECHO_C" at_xfail=no ( echo "74. misc.at:1269: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SORT-IN ASSIGN "SORT-IN". SELECT SORT-OUT ASSIGN "SORT-OUT". SELECT SORT-WRK ASSIGN "SORT-WRK". DATA DIVISION. FILE SECTION. FD SORT-IN. 01 IN-REC PIC X(100). FD SORT-OUT. 01 OUT-REC PIC X(100). SD SORT-WRK. 01 WRK-REC PIC X(100). PROCEDURE DIVISION. SORT SORT-WRK ASCENDING KEY WRK-REC USING SORT-IN GIVING SORT-OUT. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1296: \${COMPILE} -o prog prog.cob" echo misc.at:1296 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1296: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1297: ./prog" echo misc.at:1297 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1297: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1298: cat SORT-OUT" echo misc.at:1298 >$at_check_line_file ( $at_traceon; cat SORT-OUT ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1298: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 75 ) # 75. misc.at:1303: PIC ZZZ-, ZZZ+ at_setup_line='misc.at:1303' at_desc='PIC ZZZ-, ZZZ+' $at_quiet $ECHO_N " 75: PIC ZZZ-, ZZZ+ $ECHO_C" at_xfail=no ( echo "75. misc.at:1303: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ZZZN PIC ZZZ-. 01 X-ZZZP PIC ZZZ+. PROCEDURE DIVISION. MOVE -1 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE 0 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE +1 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE -1 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. MOVE 0 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. MOVE +1 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1328: \${COMPILE} -o prog prog.cob" echo misc.at:1328 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1328: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1336: ./prog" echo misc.at:1336 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "( 1-) ( ) ( 1 ) ( 1-) ( ) ( 1+) " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1336: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 76 ) # 76. misc.at:1341: Larger REDEFINES lengths at_setup_line='misc.at:1341' at_desc='Larger REDEFINES lengths' $at_quiet $ECHO_N " 76: Larger REDEFINES lengths $ECHO_C" at_xfail=no ( echo "76. misc.at:1341: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 XMAIN PIC X(8). 01 XMAINRED REDEFINES XMAIN. 03 FILLER PIC X(4). 03 XMAIN03. 05 XMAIN0501 PIC X(4). 05 XMAIN0502 REDEFINES XMAIN0501 PIC X(5). PROCEDURE DIVISION. DISPLAY LENGTH OF XMAIN END-DISPLAY. DISPLAY LENGTH OF XMAINRED END-DISPLAY. DISPLAY LENGTH OF XMAIN03 END-DISPLAY. DISPLAY LENGTH OF XMAIN0501 END-DISPLAY. DISPLAY LENGTH OF XMAIN0502 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1370: \${COMPILE} -std=mf -o prog prog.cob" echo misc.at:1370 >$at_check_line_file ( $at_traceon; ${COMPILE} -std=mf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:11: Warning: Size of 'XMAIN0502' larger than size of 'XMAIN0501' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1370: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1377: ./prog" echo misc.at:1377 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "8 9 5 4 5 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1377: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 77 ) # 77. misc.at:1381: PERFORM type OSVS at_setup_line='misc.at:1381' at_desc='PERFORM type OSVS' $at_quiet $ECHO_N " 77: PERFORM type OSVS $ECHO_C" at_xfail=no ( echo "77. misc.at:1381: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "default.conf" perform-osvs: yes _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYOCC PIC 9(8) COMP VALUE 0. PROCEDURE DIVISION. ASTART SECTION. A01. PERFORM BTEST. DISPLAY "OK" END-DISPLAY. STOP RUN. BTEST SECTION. B01. PERFORM B02 VARYING MYOCC FROM 1 BY 1 UNTIL MYOCC > 5. GO TO B99. B02. IF MYOCC > 1 GO TO B99 END-IF. B99. EXIT. _ATEOF $at_traceoff echo "misc.at:1414: \${COMPILE} -conf=test.conf -o prog prog.cob" echo misc.at:1414 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1414: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1417: ./prog" echo misc.at:1417 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1417: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 78 ) # 78. misc.at:1422: Sticky LINKAGE at_setup_line='misc.at:1422' at_desc='Sticky LINKAGE' $at_quiet $ECHO_N " 78: Sticky LINKAGE $ECHO_C" at_xfail=no ( echo "78. misc.at:1422: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "default.conf" sticky-linkage: yes _ATEOF cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 P1 PIC X. 01 P2 PIC X(6). 01 P3 PIC X(6). PROCEDURE DIVISION USING P1 P2. IF P1 = "A" SET ADDRESS OF P3 TO ADDRESS OF P2 ELSE DISPLAY P3 END-DISPLAY END-IF. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X VALUE "A". 01 P2 PIC X(6) VALUE "NOT OK". PROCEDURE DIVISION. CALL "callee" USING P1 P2 END-CALL. MOVE "B" TO P1. MOVE "OKOKOK" TO P2. CALL "callee" USING P1 END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1464: \${COMPILE_MODULE} -conf=test.conf callee.cob" echo misc.at:1464 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} -conf=test.conf callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1464: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1465: \${COMPILE} -conf=test.conf -o caller caller.cob" echo misc.at:1465 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o caller caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1465: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1468: ./caller" echo misc.at:1468 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1468: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 79 ) # 79. misc.at:1472: COB_PRE_LOAD test at_setup_line='misc.at:1472' at_desc='COB_PRE_LOAD test' $at_quiet $ECHO_N " 79: COB_PRE_LOAD test $ECHO_C" at_xfail=no ( echo "79. misc.at:1472: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee2. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee2" END-CALL. _ATEOF $at_traceoff echo "misc.at:1490: \${COMPILE_MODULE} callee.cob" echo misc.at:1490 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1490: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1491: \${COMPILE} caller.cob" echo misc.at:1491 >$at_check_line_file ( $at_traceon; ${COMPILE} caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1491: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1492: export COB_PRE_LOAD=callee; ./caller" echo misc.at:1492 >$at_check_line_file ( $at_traceon; export COB_PRE_LOAD=callee; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1492: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 80 ) # 80. misc.at:1496: COB_LOAD_CASE=UPPER test at_setup_line='misc.at:1496' at_desc='COB_LOAD_CASE=UPPER test' $at_quiet $ECHO_N " 80: COB_LOAD_CASE=UPPER test $ECHO_C" at_xfail=no ( echo "80. misc.at:1496: testing ..." $at_traceon cat >CALLEE.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. _ATEOF $at_traceoff echo "misc.at:1514: \${COMPILE_MODULE} CALLEE.cob" echo misc.at:1514 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} CALLEE.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1514: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1515: \${COMPILE} caller.cob" echo misc.at:1515 >$at_check_line_file ( $at_traceon; ${COMPILE} caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1515: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1516: export COB_LOAD_CASE=UPPER; ./caller" echo misc.at:1516 >$at_check_line_file ( $at_traceon; export COB_LOAD_CASE=UPPER; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1516: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 81 ) # 81. misc.at:1520: 88 level with FALSE IS clause at_setup_line='misc.at:1520' at_desc='88 level with FALSE IS clause' $at_quiet $ECHO_N " 81: 88 level with FALSE IS clause $ECHO_C" at_xfail=no ( echo "81. misc.at:1520: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYFLD PIC X(6) VALUE "ABCDEF". 88 MYFLD88 VALUE "ABCDEF" FALSE IS "OKOKOK". PROCEDURE DIVISION. ASTART SECTION. A01. SET MYFLD88 TO FALSE. DISPLAY MYFLD END-DISPLAY. _ATEOF $at_traceoff echo "misc.at:1538: \${COMPILE} prog.cob" echo misc.at:1538 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1538: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1541: ./prog" echo misc.at:1541 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1541: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 82 ) # 82. misc.at:1545: ALLOCATE/FREE with BASED item at_setup_line='misc.at:1545' at_desc='ALLOCATE/FREE with BASED item' $at_quiet $ECHO_N " 82: ALLOCATE/FREE with BASED item $ECHO_C" at_xfail=no ( echo "82. misc.at:1545: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. LINKAGE SECTION. 01 MYFLD PIC X(6) BASED VALUE "ABCDEF". PROCEDURE DIVISION. ASTART SECTION. A01. ALLOCATE MYFLD INITIALIZED. DISPLAY MYFLD END-DISPLAY. FREE ADDRESS OF MYFLD. _ATEOF $at_traceoff echo "misc.at:1562: \${COMPILE} prog.cob" echo misc.at:1562 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1562: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1565: ./prog" echo misc.at:1565 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "ABCDEF " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1565: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 83 ) # 83. misc.at:1569: INITIZIALIZE with reference modification at_setup_line='misc.at:1569' at_desc='INITIZIALIZE with reference modification' $at_quiet $ECHO_N " 83: INITIZIALIZE with reference modification $ECHO_C" at_xfail=no ( echo "83. misc.at:1569: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYFLD PIC X(6) VALUE "ABCDEF". PROCEDURE DIVISION. ASTART SECTION. A01. INITIALIZE MYFLD (1:2). DISPLAY MYFLD END-DISPLAY. _ATEOF $at_traceoff echo "misc.at:1585: \${COMPILE} prog.cob" echo misc.at:1585 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1585: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1588: ./prog" echo misc.at:1588 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo " CDEF " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1588: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 84 ) # 84. misc.at:1592: CALL with OMITTED parameter at_setup_line='misc.at:1592' at_desc='CALL with OMITTED parameter' $at_quiet $ECHO_N " 84: CALL with OMITTED parameter $ECHO_C" at_xfail=no ( echo "84. misc.at:1592: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 P1 PIC X. 01 P2 PIC X(6). PROCEDURE DIVISION USING P1 P2. IF P2 OMITTED DISPLAY "OKOKOK" END-DISPLAY END-IF. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X VALUE "A". 01 P2 PIC X(6) VALUE "NOT OK". PROCEDURE DIVISION. CALL "callee" USING P1 OMITTED END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1622: \${COMPILE_MODULE} callee.cob" echo misc.at:1622 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1622: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1623: \${COMPILE} -o caller caller.cob" echo misc.at:1623 >$at_check_line_file ( $at_traceon; ${COMPILE} -o caller caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1623: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1626: ./caller" echo misc.at:1626 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1626: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 85 ) # 85. misc.at:1630: ANY LENGTH at_setup_line='misc.at:1630' at_desc='ANY LENGTH' $at_quiet $ECHO_N " 85: ANY LENGTH $ECHO_C" at_xfail=no ( echo "85. misc.at:1630: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 P2 PIC 99. LINKAGE SECTION. 01 P1 PIC X ANY LENGTH. PROCEDURE DIVISION USING P1. MOVE LENGTH OF P1 TO P2. DISPLAY P2 END-DISPLAY. DISPLAY P1 END-DISPLAY. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X(6) VALUE "OKOKOK". PROCEDURE DIVISION. CALL "callee" USING P1 END-CALL. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1661: \${COMPILE_MODULE} callee.cob" echo misc.at:1661 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1661: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1662: \${COMPILE} -o caller caller.cob" echo misc.at:1662 >$at_check_line_file ( $at_traceon; ${COMPILE} -o caller caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1662: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1666: ./caller" echo misc.at:1666 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "06 OKOKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1666: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 86 ) # 86. misc.at:1670: BASED item non-ALLOCATED (debug) at_setup_line='misc.at:1670' at_desc='BASED item non-ALLOCATED (debug)' $at_quiet $ECHO_N " 86: BASED item non-ALLOCATED (debug) $ECHO_C" at_xfail=no ( echo "86. misc.at:1670: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) BASED. PROCEDURE DIVISION. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "misc.at:1684: \${COMPILE} -debug -o prog prog.cob" echo misc.at:1684 >$at_check_line_file ( $at_traceon; ${COMPILE} -debug -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "misc.at:1684: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "misc.at:1687: ./prog" echo misc.at:1687 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: libcob: BASED/LINKAGE item 'X' has NULL address " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "misc.at:1687: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 87 ) # 87. extensions.at:24: COMP-5 at_setup_line='extensions.at:24' at_desc='COMP-5' $at_quiet $ECHO_N " 87: COMP-5 $ECHO_C" at_xfail=no ( echo "87. extensions.at:24: testing ..." $at_traceon cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data, int *p); int dump (unsigned char *data, int *p) { int i; if ( *p == 1 ) { for (i = 0; i < 4; i++) printf ("%02x", data[i]); } else { printf ("%8.8d", *((int *)data)); } puts (""); return 0; } _ATEOF $at_traceoff echo "extensions.at:43: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo extensions.at:43 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:43: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC 9(9) VALUE 4660 COMP. 01 X-2 PIC 9(9) VALUE 4660 COMP-5. PROCEDURE DIVISION. CALL "dump" USING X-1 BY CONTENT 1 END-CALL. CALL "dump" USING X-2 BY CONTENT 2 END-CALL. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:60: \${COMPILE} -o prog prog.cob" echo extensions.at:60 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:60: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:64: ./prog" echo extensions.at:64 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00001234 00004660 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:64: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 88 ) # 88. extensions.at:71: Hexadecimal numeric literal at_setup_line='extensions.at:71' at_desc='Hexadecimal numeric literal' $at_quiet $ECHO_N " 88: Hexadecimal numeric literal $ECHO_C" at_xfail=no ( echo "88. extensions.at:71: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC 9(8) VALUE H"012345". 01 X-2 PIC 9(8) VALUE H"FFFFFF". PROCEDURE DIVISION. DISPLAY X-1 END-DISPLAY. DISPLAY X-2 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:88: \${COMPILE} -o prog prog.cob" echo extensions.at:88 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:88: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:92: ./prog" echo extensions.at:92 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00074565 16777215 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:92: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 89 ) # 89. extensions.at:99: Semi-parenthesized condition at_setup_line='extensions.at:99' at_desc='Semi-parenthesized condition' $at_quiet $ECHO_N " 89: Semi-parenthesized condition $ECHO_C" at_xfail=no ( echo "89. extensions.at:99: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. IF 1 = (1 OR 2) DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:112: \${COMPILE} -o prog prog.cob" echo extensions.at:112 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:112: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:113: ./prog" echo extensions.at:113 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:113: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 90 ) # 90. extensions.at:120: ADDRESS OF at_setup_line='extensions.at:120' at_desc='ADDRESS OF' $at_quiet $ECHO_N " 90: ADDRESS OF $ECHO_C" at_xfail=no ( echo "90. extensions.at:120: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC X(3) VALUE "X-1". 01 X-2 PIC X(3) VALUE "X-2". 01 G. 02 PTR-1 USAGE POINTER VALUE NULL. 02 PTR-2 USAGE POINTER VALUE NULL. LINKAGE SECTION. 01 Y PIC X(3). PROCEDURE DIVISION. SET ADDRESS OF Y TO ADDRESS OF X-1. DISPLAY Y END-DISPLAY. SET PTR-1 TO ADDRESS OF X-2. SET PTR-2 TO PTR-1 SET ADDRESS OF Y TO PTR-2. DISPLAY Y END-DISPLAY. INITIALIZE PTR-1. IF PTR-1 = NULL DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. SET ADDRESS OF Y TO NULL. IF PTR-1 = ADDRESS OF Y DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF ADDRESS OF Y = PTR-1 DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. _ATEOF $at_traceoff echo "extensions.at:168: \${COMPILE} -o prog prog.cob" echo extensions.at:168 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:168: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:175: ./prog" echo extensions.at:175 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "X-1 X-2 OK OK OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:175: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 91 ) # 91. extensions.at:183: LENGTH OF at_setup_line='extensions.at:183' at_desc='LENGTH OF' $at_quiet $ECHO_N " 91: LENGTH OF $ECHO_C" at_xfail=no ( echo "91. extensions.at:183: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(2). 01 G. 02 Y PIC X(2) OCCURS 10. 01 L PIC 9(4). 01 I PIC 9(2) VALUE 10. PROCEDURE DIVISION. MOVE LENGTH OF X TO L. DISPLAY L END-DISPLAY. MOVE LENGTH OF Y TO L. DISPLAY L END-DISPLAY. MOVE LENGTH OF Y(1) TO L. DISPLAY L END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:205: \${COMPILE} -o prog prog.cob" echo extensions.at:205 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:205: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:210: ./prog" echo extensions.at:210 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0002 0002 0002 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:210: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 92 ) # 92. extensions.at:217: WHEN-COMPILED at_setup_line='extensions.at:217' at_desc='WHEN-COMPILED' $at_quiet $ECHO_N " 92: WHEN-COMPILED $ECHO_C" at_xfail=no ( echo "92. extensions.at:217: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(20). PROCEDURE DIVISION. MOVE WHEN-COMPILED TO X. INSPECT X CONVERTING "0123456789" TO "9999999999". DISPLAY X NO ADVANCING END-DISPLAY. _ATEOF $at_traceoff echo "extensions.at:232: \${COMPILE} -o prog prog.cob" echo extensions.at:232 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:232: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:233: ./prog" echo extensions.at:233 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "99/99/9999.99.99 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:233: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 93 ) # 93. extensions.at:240: Complex OCCURS DEPENDING ON at_setup_line='extensions.at:240' at_desc='Complex OCCURS DEPENDING ON' $at_quiet $ECHO_N " 93: Complex OCCURS DEPENDING ON $ECHO_C" at_xfail=no ( echo "93. extensions.at:240: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 I PIC 9. 01 G-1 VALUE "123456789". 02 G-2. 03 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 G-3. 03 G-4. 04 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 03 G-5. 04 X PIC X OCCURS 1 TO 3 DEPENDING ON I. PROCEDURE DIVISION. MOVE 2 TO I. DISPLAY G-1 ":" G-4 ":" G-5 NO ADVANCING END-DISPLAY. _ATEOF $at_traceoff echo "extensions.at:262: \${COMPILE} -std=mvs -o prog prog.cob" echo extensions.at:262 >$at_check_line_file ( $at_traceon; ${COMPILE} -std=mvs -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:262: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:263: ./prog" echo extensions.at:263 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "123456:34:56" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:263: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 94 ) # 94. extensions.at:268: MOVE NON-INTEGER TO ALPHA-NUMERIC at_setup_line='extensions.at:268' at_desc='MOVE NON-INTEGER TO ALPHA-NUMERIC' $at_quiet $ECHO_N " 94: MOVE NON-INTEGER TO ALPHA-NUMERIC $ECHO_C" at_xfail=no ( echo "94. extensions.at:268: testing ..." $at_traceon # see MF - COBOL Error Messages 1029-E ... cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INTEGER PIC 9(4) VALUE 1289 . 01 SIGNED-INTEGER PIC S9(4) VALUE -1289 . 01 ALPHA-FIELD PIC X(4). 01 NON-INTEGER PIC 9(2)V99 VALUE 12.89 . 01 NON-INTEGER-2 PIC 9(2)V99 USAGE BINARY VALUE 12.89 . 01 NON-INTEGER-3 PIC 9(2)V99 USAGE PACKED-DECIMAL VALUE 12.89 . 01 SIGNED-NON-INTEGER PIC S9(2)V99 VALUE -12.89 . 01 SIGNED-NON-INTEGER-2 PIC S9(2)V99 USAGE BINARY VALUE -12.89 . 01 SIGNED-NON-INTEGER-3 PIC S9(2)V99 USAGE PACKED-DECIMAL VALUE -12.89 . PROCEDURE DIVISION. * * 1029-E : MF-COBOL Extension see ERROR-Messages (2-77) ! * * MOVE NON-INTEGER TO ALPHA-NUMERIC --> ignore Decimal Point! S-01. MOVE SPACES TO ALPHA-FIELD. MOVE INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-02. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-03. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-10. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER-2 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-20. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER-3 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-30. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-40. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER-2 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-50. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER-3 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:351: \${COMPILE} -std=mf -o prog prog.cob" echo extensions.at:351 >$at_check_line_file ( $at_traceon; ${COMPILE} -std=mf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob: In paragraph 'S-03': prog.cob:37: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-10': prog.cob:42: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-20': prog.cob:47: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-30': prog.cob:52: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-40': prog.cob:57: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-50': prog.cob:62: Warning: Move non-integer to alphanumeric " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:351: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:352: ./prog" echo extensions.at:352 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "12891289128912891289128912891289" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:352: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 95 ) # 95. extensions.at:359: CALL USING file-name at_setup_line='extensions.at:359' at_desc='CALL USING file-name' $at_quiet $ECHO_N " 95: CALL USING file-name $ECHO_C" at_xfail=no ( echo "95. extensions.at:359: testing ..." $at_traceon cat >setfilename.c <<'_ATEOF' #include #include #include int setfilename (cob_file *f, unsigned char *name) { memcpy (f->assign->data, name, strlen ((char *)name)); return 0; } _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 FILENAME PIC X(8). PROCEDURE DIVISION. INITIALIZE FILENAME. CALL "setfilename" USING TEST-FILE "TESTFILE" END-CALL. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:394: \${COMPILE_MODULE} setfilename.c" echo extensions.at:394 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} setfilename.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:394: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:395: \${COMPILE} -o prog prog.cob" echo extensions.at:395 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:395: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:396: ./prog" echo extensions.at:396 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:396: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:397: test -e TESTFILE" echo extensions.at:397 >$at_check_line_file ( $at_traceon; test -e TESTFILE ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:397: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 96 ) # 96. extensions.at:401: CALL unusual PROGRAM-ID. at_setup_line='extensions.at:401' at_desc='CALL unusual PROGRAM-ID.' $at_quiet $ECHO_N " 96: CALL unusual PROGRAM-ID. $ECHO_C" at_xfail=no ( echo "96. extensions.at:401: testing ..." $at_traceon cat >A@B.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. "A@B". PROCEDURE DIVISION. DISPLAY "P1" NO ADVANCING END-DISPLAY. EXIT PROGRAM. _ATEOF cat >A#B.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. "A#B". PROCEDURE DIVISION. DISPLAY "P2" NO ADVANCING END-DISPLAY. EXIT PROGRAM. _ATEOF cat >A-B.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. "A-B". PROCEDURE DIVISION. DISPLAY "P3" NO ADVANCING END-DISPLAY. EXIT PROGRAM. _ATEOF cat >A_B.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. "A_B". PROCEDURE DIVISION. DISPLAY "P4" NO ADVANCING END-DISPLAY. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "A@B" END-CALL. CALL "A#B" END-CALL. CALL "A-B" END-CALL. CALL "A_B" END-CALL. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:454: \${COMPILE_MODULE} A@B.cob" echo extensions.at:454 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} A@B.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:454: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:455: \${COMPILE_MODULE} A#B.cob" echo extensions.at:455 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} A#B.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:455: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:456: \${COMPILE_MODULE} A-B.cob" echo extensions.at:456 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} A-B.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:456: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:457: \${COMPILE_MODULE} A_B.cob" echo extensions.at:457 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} A_B.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:457: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:458: \${COMPILE} -o caller caller.cob" echo extensions.at:458 >$at_check_line_file ( $at_traceon; ${COMPILE} -o caller caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:458: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:460: ./caller" echo extensions.at:460 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "P1P2P3P4" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:460: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 97 ) # 97. extensions.at:464: Case independent PROGRAM-ID at_setup_line='extensions.at:464' at_desc='Case independent PROGRAM-ID' $at_quiet $ECHO_N " 97: Case independent PROGRAM-ID $ECHO_C" at_xfail=no ( echo "97. extensions.at:464: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. PROG. PROCEDURE DIVISION. CALL "prog" END-CALL. STOP RUN. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM prog. END PROGRAM PROG. _ATEOF $at_traceoff echo "extensions.at:482: \${COMPILE} -o prog prog.cob" echo extensions.at:482 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:482: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:483: ./prog" echo extensions.at:483 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:483: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 98 ) # 98. extensions.at:487: PROGRAM-ID AS clause at_setup_line='extensions.at:487' at_desc='PROGRAM-ID AS clause' $at_quiet $ECHO_N " 98: PROGRAM-ID AS clause $ECHO_C" at_xfail=no ( echo "98. extensions.at:487: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller AS "PROG". PROCEDURE DIVISION. CALL "prog" END-CALL. STOP RUN. PROGRAM-ID. callee AS "prog". PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM callee. END PROGRAM caller. _ATEOF $at_traceoff echo "extensions.at:505: \${COMPILE} -o prog prog.cob" echo extensions.at:505 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:505: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:506: ./prog" echo extensions.at:506 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:506: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 99 ) # 99. extensions.at:510: Quoted PROGRAM-ID at_setup_line='extensions.at:510' at_desc='Quoted PROGRAM-ID' $at_quiet $ECHO_N " 99: Quoted PROGRAM-ID $ECHO_C" at_xfail=no ( echo "99. extensions.at:510: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. "caller". PROCEDURE DIVISION. CALL "callee" END-CALL. STOP RUN. PROGRAM-ID. "callee". PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM callee. END PROGRAM caller. _ATEOF $at_traceoff echo "extensions.at:528: \${COMPILE} -o prog prog.cob" echo extensions.at:528 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:528: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:529: ./prog" echo extensions.at:529 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:529: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 100 ) # 100. extensions.at:535: ASSIGN MF at_setup_line='extensions.at:535' at_desc='ASSIGN MF' $at_quiet $ECHO_N "100: ASSIGN MF $ECHO_C" at_xfail=no ( echo "100. extensions.at:535: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" assign-clause: mf _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. MOVE "TEST-FILE" TO FILENAME. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:562: \${COMPILE} -conf=test.conf -o prog prog.cob" echo extensions.at:562 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:12: Warning: 'FILENAME' will be implicitly defined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:562: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:563: ./prog" echo extensions.at:563 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:563: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 101 ) # 101. extensions.at:567: ASSIGN IBM at_setup_line='extensions.at:567' at_desc='ASSIGN IBM' $at_quiet $ECHO_N "101: ASSIGN IBM $ECHO_C" at_xfail=no ( echo "101. extensions.at:567: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" assign-clause: ibm _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN DA-S-FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:591: \${COMPILE} -conf=test.conf -o prog prog.cob" echo extensions.at:591 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:591: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:592: ./prog" echo extensions.at:592 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:592: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:593: test -f FILENAME" echo extensions.at:593 >$at_check_line_file ( $at_traceon; test -f FILENAME ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:593: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 102 ) # 102. extensions.at:597: ASSIGN mapping at_setup_line='extensions.at:597' at_desc='ASSIGN mapping' $at_quiet $ECHO_N "102: ASSIGN mapping $ECHO_C" at_xfail=no ( echo "102. extensions.at:597: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" filename-mapping: yes _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "FILENAME". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:621: \${COMPILE} -conf=test.conf -o prog prog.cob" echo extensions.at:621 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:621: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:622: DD_FILENAME=\"x\" ./prog" echo extensions.at:622 >$at_check_line_file ( $at_traceon; DD_FILENAME="x" ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:622: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:623: test -f \"x\"" echo extensions.at:623 >$at_check_line_file ( $at_traceon; test -f "x" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:623: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:624: dd_FILENAME=\"y\" ./prog" echo extensions.at:624 >$at_check_line_file ( $at_traceon; dd_FILENAME="y" ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:624: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:625: test -f \"y\"" echo extensions.at:625 >$at_check_line_file ( $at_traceon; test -f "y" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:625: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:626: FILENAME=\"z\" ./prog" echo extensions.at:626 >$at_check_line_file ( $at_traceon; FILENAME="z" ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:626: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:627: test -f \"z\"" echo extensions.at:627 >$at_check_line_file ( $at_traceon; test -f "z" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:627: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:628: ./prog" echo extensions.at:628 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:628: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:629: test -f \"FILENAME\"" echo extensions.at:629 >$at_check_line_file ( $at_traceon; test -f "FILENAME" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:629: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 103 ) # 103. extensions.at:633: ASSIGN expansion at_setup_line='extensions.at:633' at_desc='ASSIGN expansion' $at_quiet $ECHO_N "103: ASSIGN expansion $ECHO_C" at_xfail=no ( echo "103. extensions.at:633: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" filename-mapping: yes _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "$DIR/FILENAME". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:657: \${COMPILE} -conf=test.conf -o prog prog.cob" echo extensions.at:657 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:657: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:658: DIR=\".\" ./prog" echo extensions.at:658 >$at_check_line_file ( $at_traceon; DIR="." ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:658: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:659: test -f \"./FILENAME\" && rm -f \"./FILENAME\"" echo extensions.at:659 >$at_check_line_file ( $at_traceon; test -f "./FILENAME" && rm -f "./FILENAME" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:659: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 104 ) # 104. extensions.at:663: ASSIGN with COB_FILE_PATH at_setup_line='extensions.at:663' at_desc='ASSIGN with COB_FILE_PATH' $at_quiet $ECHO_N "104: ASSIGN with COB_FILE_PATH $ECHO_C" at_xfail=no ( echo "104. extensions.at:663: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" filename-mapping: yes _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "FILENAMEX". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:687: \${COMPILE} -conf=test.conf -o prog prog.cob" echo extensions.at:687 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:687: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:688: COB_FILE_PATH=\"..\" ./prog" echo extensions.at:688 >$at_check_line_file ( $at_traceon; COB_FILE_PATH=".." ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:688: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:689: test -f \"../FILENAMEX\" && rm -f \"../FILENAMEX\"" echo extensions.at:689 >$at_check_line_file ( $at_traceon; test -f "../FILENAMEX" && rm -f "../FILENAMEX" ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:689: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 105 ) # 105. extensions.at:696: NUMBER-OF-CALL-PARAMETERS at_setup_line='extensions.at:696' at_desc='NUMBER-OF-CALL-PARAMETERS' $at_quiet $ECHO_N "105: NUMBER-OF-CALL-PARAMETERS $ECHO_C" at_xfail=no ( echo "105. extensions.at:696: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 W PIC X. 01 X PIC X. 01 Y PIC X. 01 Z PIC X. PROCEDURE DIVISION USING W X Y Z. DISPLAY NUMBER-OF-CALL-PARAMETERS END-DISPLAY. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 W PIC X. 01 X PIC X. 01 Y PIC X. 01 Z PIC X. PROCEDURE DIVISION. CALL "callee" END-CALL. CALL "callee" USING W END-CALL. CALL "callee" USING W X END-CALL. CALL "callee" USING W X Y END-CALL. CALL "callee" USING W X Y Z END-CALL. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:737: \${COMPILE} caller.cob" echo extensions.at:737 >$at_check_line_file ( $at_traceon; ${COMPILE} caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:737: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:738: \${COMPILE_MODULE} callee.cob" echo extensions.at:738 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:738: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:745: ./caller" echo extensions.at:745 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+000000000 +000000001 +000000002 +000000003 +000000004 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:745: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 106 ) # 106. extensions.at:752: PROCEDURE DIVISION USING BY ... at_setup_line='extensions.at:752' at_desc='PROCEDURE DIVISION USING BY ...' $at_quiet $ECHO_N "106: PROCEDURE DIVISION USING BY ... $ECHO_C" at_xfail=no ( echo "106. extensions.at:752: testing ..." $at_traceon cat >callee.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 X PIC X. 01 Y PIC 99. 01 Z PIC 99 USAGE COMP. PROCEDURE DIVISION USING BY VALUE X BY REFERENCE Y Z. DISPLAY "X = " X " Y = " Y " Z = " Z END-DISPLAY. MOVE "Z" TO X. MOVE 56 TO Y. MOVE 78 TO Z. EXIT PROGRAM. _ATEOF cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC 99. 01 Z PIC 99 USAGE COMP. PROCEDURE DIVISION. MOVE "X" TO X. MOVE 12 TO Y. MOVE 34 TO Z. CALL "callee" USING BY CONTENT X BY REFERENCE Y BY CONTENT Z END-CALL. DISPLAY "X = " X " Y = " Y " Z = " Z END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:792: \${COMPILE} caller.cob" echo extensions.at:792 >$at_check_line_file ( $at_traceon; ${COMPILE} caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:792: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:793: \${COMPILE_MODULE} callee.cob" echo extensions.at:793 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} callee.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:793: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:797: ./caller" echo extensions.at:797 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "X = X Y = 12 Z = 34 X = X Y = 56 Z = 34 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:797: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 107 ) # 107. extensions.at:801: PROCEDURE DIVISION CHAINING ... at_setup_line='extensions.at:801' at_desc='PROCEDURE DIVISION CHAINING ...' $at_quiet $ECHO_N "107: PROCEDURE DIVISION CHAINING ... $ECHO_C" at_xfail=no ( echo "107. extensions.at:801: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 ABCD PIC X(4). PROCEDURE DIVISION CHAINING X ABCD. DISPLAY X END-DISPLAY. DISPLAY ABCD END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:819: \${COMPILE} prog.cob" echo extensions.at:819 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:819: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:824: ./prog X ABCD" echo extensions.at:824 >$at_check_line_file ( $at_traceon; ./prog X ABCD ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "X ABCD " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:824: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 108 ) # 108. extensions.at:829: STOP RUN RETURNING at_setup_line='extensions.at:829' at_desc='STOP RUN RETURNING' $at_quiet $ECHO_N "108: STOP RUN RETURNING $ECHO_C" at_xfail=no ( echo "108. extensions.at:829: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN RETURNING 1. _ATEOF $at_traceoff echo "extensions.at:838: \${COMPILE} -o prog prog.cob" echo extensions.at:838 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:838: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:839: ./prog" echo extensions.at:839 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "extensions.at:839: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 109 ) # 109. extensions.at:846: ENTRY at_setup_line='extensions.at:846' at_desc='ENTRY' $at_quiet $ECHO_N "109: ENTRY $ECHO_C" at_xfail=no ( echo "109. extensions.at:846: testing ..." $at_traceon cat >caller.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. CALL "hello" USING "COBOL" END-CALL. CALL "bye" USING "COBOL" END-CALL. STOP RUN. _ATEOF cat >hello.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. hello. DATA DIVISION. WORKING-STORAGE SECTION. 01 MSG-HELLO PIC X(7) VALUE "Hello, ". 01 MSG-BYE PIC X(5) VALUE "Bye, ". LINKAGE SECTION. 01 X PIC X(5). 01 Y PIC X(5). PROCEDURE DIVISION USING X. DISPLAY MSG-HELLO X "!" END-DISPLAY. EXIT PROGRAM. ENTRY "bye" USING Y. DISPLAY MSG-BYE Y "!" END-DISPLAY. EXIT PROGRAM. _ATEOF $at_traceoff echo "extensions.at:880: \${COMPILE} -std=mvs caller.cob" echo extensions.at:880 >$at_check_line_file ( $at_traceon; ${COMPILE} -std=mvs caller.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:880: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:881: \${COMPILE_MODULE} -std=mvs hello.cob" echo extensions.at:881 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} -std=mvs hello.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:881: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:885: ./caller" echo extensions.at:885 >$at_check_line_file ( $at_traceon; ./caller ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "Hello, COBOL! Bye, COBOL! " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:885: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 110 ) # 110. extensions.at:892: LINE SEQUENTIAL write at_setup_line='extensions.at:892' at_desc='LINE SEQUENTIAL write' $at_quiet $ECHO_N "110: LINE SEQUENTIAL write $ECHO_C" at_xfail=no ( echo "110. extensions.at:892: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. MOVE "a" TO TEST-REC. WRITE TEST-REC END-WRITE. MOVE "ab" TO TEST-REC. WRITE TEST-REC AFTER 1 LINES END-WRITE. MOVE "abc" TO TEST-REC. WRITE TEST-REC BEFORE 2 LINES END-WRITE. MOVE "abcd" TO TEST-REC. WRITE TEST-REC END-WRITE. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:920: \${COMPILE} -o prog prog.cob" echo extensions.at:920 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:920: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:921: ./prog" echo extensions.at:921 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:921: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:928: cat TEST-FILE" echo extensions.at:928 >$at_check_line_file ( $at_traceon; cat TEST-FILE ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a ababc abcd " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:928: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 111 ) # 111. extensions.at:932: LINE SEQUENTIAL read at_setup_line='extensions.at:932' at_desc='LINE SEQUENTIAL read' $at_quiet $ECHO_N "111: LINE SEQUENTIAL read $ECHO_C" at_xfail=no ( echo "111. extensions.at:932: testing ..." $at_traceon cat >TEST-FILE <<'_ATEOF' a ab abc abcd abcde abcdef _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN INPUT TEST-FILE. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:979: \${COMPILE} -o prog prog.cob" echo extensions.at:979 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:979: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:987: ./prog" echo extensions.at:987 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "(a ) (ab ) (abc ) (abcd) (abcd) (abcd) " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:987: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 112 ) # 112. extensions.at:992: ASSIGN to KEYBOARD/DISPLAY at_setup_line='extensions.at:992' at_desc='ASSIGN to KEYBOARD/DISPLAY' $at_quiet $ECHO_N "112: ASSIGN to KEYBOARD/DISPLAY $ECHO_C" at_xfail=no ( echo "112. extensions.at:992: testing ..." $at_traceon cat >TEST-FILE <<'_ATEOF' a ab abc abcd abcde abcdef _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN KEYBOARD ORGANIZATION IS LINE SEQUENTIAL. SELECT TEST-OUT ASSIGN DISPLAY ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(80). FD TEST-OUT. 01 TEST-REC-OUT PIC X(80). PROCEDURE DIVISION. A00. OPEN INPUT TEST-FILE. OPEN OUTPUT TEST-OUT. A01. READ TEST-FILE AT END GO TO Z99 END-READ. WRITE TEST-REC-OUT FROM TEST-REC END-WRITE. GO TO A01. Z99. CLOSE TEST-FILE. CLOSE TEST-OUT. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1036: \${COMPILE} -o prog prog.cob" echo extensions.at:1036 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1036: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1044: cat TEST-FILE | ./prog" echo extensions.at:1044 >$at_check_line_file ( $at_traceon; cat TEST-FILE | ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a ab abc abcd abcde abcdef " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1044: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 113 ) # 113. extensions.at:1048: Environment/Argument variable at_setup_line='extensions.at:1048' at_desc='Environment/Argument variable' $at_quiet $ECHO_N "113: Environment/Argument variable $ECHO_C" at_xfail=no ( echo "113. extensions.at:1048: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4). 01 Y PIC X(8). 01 Z PIC 9(4). PROCEDURE DIVISION. DISPLAY "TEST_ENV" UPON ENVIRONMENT-NAME END-DISPLAY. ACCEPT X FROM ENVIRONMENT-VALUE END-ACCEPT. DISPLAY "(" X ")" END-DISPLAY. DISPLAY "RXW" UPON ENVIRONMENT-VALUE END-DISPLAY. ACCEPT X FROM ENVIRONMENT-VALUE END-ACCEPT. DISPLAY "(" X ")" END-DISPLAY. ACCEPT Y FROM ARGUMENT-VALUE END-ACCEPT. DISPLAY "(" Y ")" END-DISPLAY. ACCEPT Z FROM ARGUMENT-NUMBER END-ACCEPT. DISPLAY "(" Z ")" END-DISPLAY. STOP RUN. _ATEOF export TEST_ENV=OK $at_traceoff echo "extensions.at:1083: \${COMPILE} -o prog prog.cob" echo extensions.at:1083 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1083: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1089: ./prog CHECKPAR" echo extensions.at:1089 >$at_check_line_file ( $at_traceon; ./prog CHECKPAR ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "(OK ) (RXW ) (CHECKPAR) (0001) " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1089: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 114 ) # 114. extensions.at:1093: DECIMAL-POINT is COMMA (1) at_setup_line='extensions.at:1093' at_desc='DECIMAL-POINT is COMMA (1)' $at_quiet $ECHO_N "114: DECIMAL-POINT is COMMA (1) $ECHO_C" at_xfail=no ( echo "114. extensions.at:1093: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1112: \${COMPILE} prog.cob" echo extensions.at:1112 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1112: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1115: ./prog" echo extensions.at:1115 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00,50 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1115: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 115 ) # 115. extensions.at:1119: DECIMAL-POINT is COMMA (2) at_setup_line='extensions.at:1119' at_desc='DECIMAL-POINT is COMMA (2)' $at_quiet $ECHO_N "115: DECIMAL-POINT is COMMA (2) $ECHO_C" at_xfail=no ( echo "115. extensions.at:1119: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,, 5) TO X. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1138: \${COMPILE} prog.cob" echo extensions.at:1138 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1138: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1141: ./prog" echo extensions.at:1141 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "03,00 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1141: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 116 ) # 116. extensions.at:1145: DECIMAL-POINT is COMMA (3) at_setup_line='extensions.at:1145' at_desc='DECIMAL-POINT is COMMA (3)' $at_quiet $ECHO_N "116: DECIMAL-POINT is COMMA (3) $ECHO_C" at_xfail=no ( echo "116. extensions.at:1145: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,, 1,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1164: \${COMPILE} prog.cob" echo extensions.at:1164 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1164: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1167: ./prog" echo extensions.at:1167 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "01,50 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1167: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 117 ) # 117. extensions.at:1171: DECIMAL-POINT is COMMA (4) at_setup_line='extensions.at:1171' at_desc='DECIMAL-POINT is COMMA (4)' $at_quiet $ECHO_N "117: DECIMAL-POINT is COMMA (4) $ECHO_C" at_xfail=no ( echo "117. extensions.at:1171: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,,1,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1190: \${COMPILE} prog.cob" echo extensions.at:1190 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1190: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1193: ./prog" echo extensions.at:1193 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00,10 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1193: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 118 ) # 118. extensions.at:1197: DECIMAL-POINT is COMMA (5) at_setup_line='extensions.at:1197' at_desc='DECIMAL-POINT is COMMA (5)' $at_quiet $ECHO_N "118: DECIMAL-POINT is COMMA (5) $ECHO_C" at_xfail=no ( echo "118. extensions.at:1197: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. COMPUTE X=1 + ,1 END-COMPUTE DISPLAY X END-DISPLAY. COMPUTE X=1*,1 END-COMPUTE DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1221: \${COMPILE} prog.cob" echo extensions.at:1221 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1221: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1225: ./prog" echo extensions.at:1225 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "01,10 00,10 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1225: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 119 ) # 119. extensions.at:1229: 78 Level (1) at_setup_line='extensions.at:1229' at_desc='78 Level (1)' $at_quiet $ECHO_N "119: 78 Level (1) $ECHO_C" at_xfail=no ( echo "119. extensions.at:1229: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 78 X VALUE "OK". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1243: \${COMPILE} prog.cob" echo extensions.at:1243 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1243: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1246: ./prog" echo extensions.at:1246 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1246: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 120 ) # 120. extensions.at:1250: 78 Level (2) at_setup_line='extensions.at:1250' at_desc='78 Level (2)' $at_quiet $ECHO_N "120: 78 Level (2) $ECHO_C" at_xfail=no ( echo "120. extensions.at:1250: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Z. 78 X VALUE "OK". 78 Y VALUE "OK". 03 FILLER PIC XX VALUE "OK". PROCEDURE DIVISION. DISPLAY X Z Y END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1267: \${COMPILE} prog.cob" echo extensions.at:1267 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1267: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1270: ./prog" echo extensions.at:1270 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1270: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 121 ) # 121. extensions.at:1274: 78 Level (3) at_setup_line='extensions.at:1274' at_desc='78 Level (3)' $at_quiet $ECHO_N "121: 78 Level (3) $ECHO_C" at_xfail=no ( echo "121. extensions.at:1274: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 78 X VALUE "OK". 01 Z PIC XX VALUE "OK". PROCEDURE DIVISION. DISPLAY Z X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1289: \${COMPILE} prog.cob" echo extensions.at:1289 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1289: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "extensions.at:1292: ./prog" echo extensions.at:1292 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1292: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 122 ) # 122. extensions.at:1296: Unreachable statement at_setup_line='extensions.at:1296' at_desc='Unreachable statement' $at_quiet $ECHO_N "122: Unreachable statement $ECHO_C" at_xfail=no ( echo "122. extensions.at:1296: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. P01. GO TO P02. DISPLAY "INVALID" END-DISPLAY. P02. STOP RUN. _ATEOF $at_traceoff echo "extensions.at:1315: \${COMPILE} -Wunreachable prog.cob" echo extensions.at:1315 >$at_check_line_file ( $at_traceon; ${COMPILE} -Wunreachable prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob: In paragraph 'P01': prog.cob:9: Warning: Unreachable statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "extensions.at:1315: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 123 ) # 123. return-code.at:23: RETURN-CODE moving at_setup_line='return-code.at:23' at_desc='RETURN-CODE moving' $at_quiet $ECHO_N "123: RETURN-CODE moving $ECHO_C" at_xfail=no ( echo "123. return-code.at:23: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 I PIC 99 COMP. PROCEDURE DIVISION. INITIALIZE RETURN-CODE. MOVE ZERO TO RETURN-CODE. MOVE 1 TO RETURN-CODE. MOVE RETURN-CODE TO I. DISPLAY I NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "return-code.at:41: \${COMPILE} -o prog prog.cob" echo return-code.at:41 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:41: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "return-code.at:42: ./prog" echo return-code.at:42 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "01" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "return-code.at:42: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 124 ) # 124. return-code.at:46: RETURN-CODE passing at_setup_line='return-code.at:46' at_desc='RETURN-CODE passing' $at_quiet $ECHO_N "124: RETURN-CODE passing $ECHO_C" at_xfail=no ( echo "124. return-code.at:46: testing ..." $at_traceon cat >mod1.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. mod1. PROCEDURE DIVISION. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE 1 TO RETURN-CODE. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. EXIT PROGRAM. _ATEOF cat >mod2.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. mod2. PROCEDURE DIVISION. EXIT PROGRAM. _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. CALL "mod1" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. CALL "mod2" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "return-code.at:82: \${COMPILE_MODULE} mod1.cob" echo return-code.at:82 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} mod1.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:82: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "return-code.at:83: \${COMPILE_MODULE} mod2.cob" echo return-code.at:83 >$at_check_line_file ( $at_traceon; ${COMPILE_MODULE} mod2.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:83: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "return-code.at:84: \${COMPILE} -o prog prog.cob" echo return-code.at:84 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:84: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "return-code.at:85: ./prog" echo return-code.at:85 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+000000000+000000001+000000001+000000000" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:85: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 125 ) # 125. return-code.at:89: RETURN-CODE nested at_setup_line='return-code.at:89' at_desc='RETURN-CODE nested' $at_quiet $ECHO_N "125: RETURN-CODE nested $ECHO_C" at_xfail=no ( echo "125. return-code.at:89: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. MOVE 1 TO RETURN-CODE. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. CALL "mod1" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE ZERO TO RETURN-CODE. STOP RUN. PROGRAM-ID. mod1. PROCEDURE DIVISION. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE 2 TO RETURN-CODE. EXIT PROGRAM. END PROGRAM mod1. END PROGRAM prog. _ATEOF $at_traceoff echo "return-code.at:114: \${COMPILE} -o prog prog.cob" echo return-code.at:114 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:114: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "return-code.at:115: ./prog" echo return-code.at:115 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+000000001+000000001+000000002" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "return-code.at:115: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 126 ) # 126. functions.at:22: FUNCTION ABS at_setup_line='functions.at:22' at_desc='FUNCTION ABS' $at_quiet $ECHO_N "126: FUNCTION ABS $ECHO_C" at_xfail=no ( echo "126. functions.at:22: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.2345. PROCEDURE DIVISION. DISPLAY FUNCTION ABS ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:36: \${COMPILE} -o prog prog.cob" echo functions.at:36 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:36: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:39: ./prog" echo functions.at:39 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+0001.2345 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:39: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 127 ) # 127. functions.at:43: FUNCTION ACOS at_setup_line='functions.at:43' at_desc='FUNCTION ACOS' $at_quiet $ECHO_N "127: FUNCTION ACOS $ECHO_C" at_xfail=no ( echo "127. functions.at:43: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Z PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ACOS ( X ) TO Z. IF Z >= 1.80750052110824325 AND Z <= 1.80750052110824345 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Z END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:65: \${COMPILE} -o prog prog.cob" echo functions.at:65 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:65: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:68: ./prog" echo functions.at:68 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:68: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 128 ) # 128. functions.at:72: FUNCTION ANNUITY at_setup_line='functions.at:72' at_desc='FUNCTION ANNUITY' $at_quiet $ECHO_N "128: FUNCTION ANNUITY $ECHO_C" at_xfail=no ( echo "128. functions.at:72: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4) VALUE 3. 01 Y PIC S9(4) VALUE 5. 01 Z PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ANNUITY ( X, Y ) TO Z. IF Z >= 3.002932551319648080 AND Z <= 3.002932551319648110 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Z END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:95: \${COMPILE} -o prog prog.cob" echo functions.at:95 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:95: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:98: ./prog" echo functions.at:98 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:98: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 129 ) # 129. functions.at:102: FUNCTION ASIN at_setup_line='functions.at:102' at_desc='FUNCTION ASIN' $at_quiet $ECHO_N "129: FUNCTION ASIN $ECHO_C" at_xfail=no ( echo "129. functions.at:102: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ASIN ( X ) TO Y. IF Y >= -0.23670419431334685 AND Y <= -0.23670419431334675 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:124: \${COMPILE} -o prog prog.cob" echo functions.at:124 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:124: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:127: ./prog" echo functions.at:127 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:127: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 130 ) # 130. functions.at:131: FUNCTION ATAN at_setup_line='functions.at:131' at_desc='FUNCTION ATAN' $at_quiet $ECHO_N "130: FUNCTION ATAN $ECHO_C" at_xfail=no ( echo "130. functions.at:131: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ATAN ( X ) TO Y. IF Y >= 0.78539816339744825 AND Y <= 0.78539816339744835 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:153: \${COMPILE} -o prog prog.cob" echo functions.at:153 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:153: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:156: ./prog" echo functions.at:156 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:156: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 131 ) # 131. functions.at:160: FUNCTION CHAR at_setup_line='functions.at:160' at_desc='FUNCTION CHAR' $at_quiet $ECHO_N "131: FUNCTION CHAR $ECHO_C" at_xfail=no ( echo "131. functions.at:160: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 108. PROCEDURE DIVISION. DISPLAY FUNCTION CHAR ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:174: \${COMPILE} -o prog prog.cob" echo functions.at:174 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:174: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:177: ./prog" echo functions.at:177 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "k " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:177: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 132 ) # 132. functions.at:181: FUNCTION COMBINED-DATETIME at_setup_line='functions.at:181' at_desc='FUNCTION COMBINED-DATETIME' $at_quiet $ECHO_N "132: FUNCTION COMBINED-DATETIME $ECHO_C" at_xfail=no ( echo "132. functions.at:181: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION COMBINED-DATETIME ( 987, 345 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:194: \${COMPILE} -o prog prog.cob" echo functions.at:194 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:194: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:197: ./prog" echo functions.at:197 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0000987.00345 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:197: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 133 ) # 133. functions.at:201: FUNCTION CONCATENATE at_setup_line='functions.at:201' at_desc='FUNCTION CONCATENATE' $at_quiet $ECHO_N "133: FUNCTION CONCATENATE $ECHO_C" at_xfail=no ( echo "133. functions.at:201: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(4). PROCEDURE DIVISION. MOVE "defx" TO Y. DISPLAY FUNCTION CONCATENATE ( Y "abc" "zz" "55" "666" ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:216: \${COMPILE} -o prog prog.cob" echo functions.at:216 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:216: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:219: ./prog" echo functions.at:219 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "defxabczz55666 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:219: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 134 ) # 134. functions.at:223: FUNCTION CONCATENATE with reference modding at_setup_line='functions.at:223' at_desc='FUNCTION CONCATENATE with reference modding' $at_quiet $ECHO_N "134: FUNCTION CONCATENATE with reference modding $ECHO_C" at_xfail=no ( echo "134. functions.at:223: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(4). PROCEDURE DIVISION. MOVE "defx" TO Y. DISPLAY FUNCTION CONCATENATE ( Y "abc" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:239: \${COMPILE} -o prog prog.cob" echo functions.at:239 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:239: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:242: ./prog" echo functions.at:242 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "efxabczz5 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:242: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 135 ) # 135. functions.at:246: FUNCTION COS at_setup_line='functions.at:246' at_desc='FUNCTION COS' $at_quiet $ECHO_N "135: FUNCTION COS $ECHO_C" at_xfail=no ( echo "135. functions.at:246: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION COS ( X ) TO Y. IF Y >= 0.97263064125625815 AND Y <= 0.97263064125625825 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:268: \${COMPILE} -o prog prog.cob" echo functions.at:268 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:268: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:271: ./prog" echo functions.at:271 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:271: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 136 ) # 136. functions.at:275: FUNCTION DATE-OF-INTEGER at_setup_line='functions.at:275' at_desc='FUNCTION DATE-OF-INTEGER' $at_quiet $ECHO_N "136: FUNCTION DATE-OF-INTEGER $ECHO_C" at_xfail=no ( echo "136. functions.at:275: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DATE-OF-INTEGER ( 146000 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:288: \${COMPILE} -o prog prog.cob" echo functions.at:288 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:288: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:291: ./prog" echo functions.at:291 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "20000925 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:291: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 137 ) # 137. functions.at:295: FUNCTION DATE-TO-YYYYMMDD at_setup_line='functions.at:295' at_desc='FUNCTION DATE-TO-YYYYMMDD' $at_quiet $ECHO_N "137: FUNCTION DATE-TO-YYYYMMDD $ECHO_C" at_xfail=no ( echo "137. functions.at:295: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DATE-TO-YYYYMMDD ( 981002, -10, 1994 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:308: \${COMPILE} -o prog prog.cob" echo functions.at:308 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:308: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:311: ./prog" echo functions.at:311 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "18981002 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:311: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 138 ) # 138. functions.at:315: FUNCTION DAY-OF-INTEGER at_setup_line='functions.at:315' at_desc='FUNCTION DAY-OF-INTEGER' $at_quiet $ECHO_N "138: FUNCTION DAY-OF-INTEGER $ECHO_C" at_xfail=no ( echo "138. functions.at:315: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DAY-OF-INTEGER ( 146000 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:328: \${COMPILE} -o prog prog.cob" echo functions.at:328 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:328: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:331: ./prog" echo functions.at:331 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "2000269 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:331: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 139 ) # 139. functions.at:335: FUNCTION DAY-TO-YYYYDDD at_setup_line='functions.at:335' at_desc='FUNCTION DAY-TO-YYYYDDD' $at_quiet $ECHO_N "139: FUNCTION DAY-TO-YYYYDDD $ECHO_C" at_xfail=no ( echo "139. functions.at:335: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DAY-TO-YYYYDDD ( 95005, -10, 2013 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:348: \${COMPILE} -o prog prog.cob" echo functions.at:348 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:348: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:351: ./prog" echo functions.at:351 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "01995005 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:351: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 140 ) # 140. functions.at:355: FUNCTION E at_setup_line='functions.at:355' at_desc='FUNCTION E' $at_quiet $ECHO_N "140: FUNCTION E $ECHO_C" at_xfail=no ( echo "140. functions.at:355: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION E END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:368: \${COMPILE} -o prog prog.cob" echo functions.at:368 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:368: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:371: ./prog" echo functions.at:371 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "2.7182818284590452353602874713526625 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:371: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 141 ) # 141. functions.at:375: FUNCTION EXCEPTION-FILE at_setup_line='functions.at:375' at_desc='FUNCTION EXCEPTION-FILE' $at_quiet $ECHO_N "141: FUNCTION EXCEPTION-FILE $ECHO_C" at_xfail=no ( echo "141. functions.at:375: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-FILE END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:398: \${COMPILE} -o prog prog.cob" echo functions.at:398 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:398: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:401: ./prog" echo functions.at:401 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "35TEST-FILE " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:401: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 142 ) # 142. functions.at:405: FUNCTION EXCEPTION-LOCATION at_setup_line='functions.at:405' at_desc='FUNCTION EXCEPTION-LOCATION' $at_quiet $ECHO_N "142: FUNCTION EXCEPTION-LOCATION $ECHO_C" at_xfail=no ( echo "142. functions.at:405: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. A00-MAIN SECTION. A00. OPEN INPUT TEST-FILE. B00-MAIN SECTION. B00. DISPLAY FUNCTION EXCEPTION-LOCATION NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:433: \${COMPILE} -debug -o prog prog.cob" echo functions.at:433 >$at_check_line_file ( $at_traceon; ${COMPILE} -debug -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:433: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:435: ./prog" echo functions.at:435 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "prog; A00 OF A00-MAIN; 18" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:435: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 143 ) # 143. functions.at:439: FUNCTION EXCEPTION-STATEMENT at_setup_line='functions.at:439' at_desc='FUNCTION EXCEPTION-STATEMENT' $at_quiet $ECHO_N "143: FUNCTION EXCEPTION-STATEMENT $ECHO_C" at_xfail=no ( echo "143. functions.at:439: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-STATEMENT NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:463: \${COMPILE} -debug -o prog prog.cob" echo functions.at:463 >$at_check_line_file ( $at_traceon; ${COMPILE} -debug -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:463: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:465: ./prog" echo functions.at:465 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OPEN " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:465: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 144 ) # 144. functions.at:469: FUNCTION EXCEPTION-STATUS at_setup_line='functions.at:469' at_desc='FUNCTION EXCEPTION-STATUS' $at_quiet $ECHO_N "144: FUNCTION EXCEPTION-STATUS $ECHO_C" at_xfail=no ( echo "144. functions.at:469: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-STATUS NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:493: \${COMPILE} -o prog prog.cob" echo functions.at:493 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:493: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:495: ./prog" echo functions.at:495 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "EC-I-O-PERMANENT-ERROR " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:495: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 145 ) # 145. functions.at:499: FUNCTION EXP at_setup_line='functions.at:499' at_desc='FUNCTION EXP' $at_quiet $ECHO_N "145: FUNCTION EXP $ECHO_C" at_xfail=no ( echo "145. functions.at:499: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC S99V9(16) COMP. PROCEDURE DIVISION. MOVE FUNCTION EXP ( 3 ) TO Y. IF Y >= 20.0855369231876636 AND Y <= 20.0855369231876644 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:520: \${COMPILE} -o prog prog.cob" echo functions.at:520 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:520: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:523: ./prog" echo functions.at:523 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:523: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 146 ) # 146. functions.at:527: FUNCTION FACTORIAL at_setup_line='functions.at:527' at_desc='FUNCTION FACTORIAL' $at_quiet $ECHO_N "146: FUNCTION FACTORIAL $ECHO_C" at_xfail=no ( echo "146. functions.at:527: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION FACTORIAL ( 6 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:540: \${COMPILE} -o prog prog.cob" echo functions.at:540 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:540: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:543: ./prog" echo functions.at:543 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "000000000000000720 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:543: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 147 ) # 147. functions.at:547: FUNCTION FRACTION-PART at_setup_line='functions.at:547' at_desc='FUNCTION FRACTION-PART' $at_quiet $ECHO_N "147: FUNCTION FRACTION-PART $ECHO_C" at_xfail=no ( echo "147. functions.at:547: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION FRACTION-PART ( 3.12345 ) END-DISPLAY. DISPLAY FUNCTION FRACTION-PART ( -3.12345 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:562: \${COMPILE} -o prog prog.cob" echo functions.at:562 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:562: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:566: ./prog" echo functions.at:566 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+.123450000000000000 -.123450000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:566: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 148 ) # 148. functions.at:570: FUNCTION INTEGER at_setup_line='functions.at:570' at_desc='FUNCTION INTEGER' $at_quiet $ECHO_N "148: FUNCTION INTEGER $ECHO_C" at_xfail=no ( echo "148. functions.at:570: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:584: \${COMPILE} -o prog prog.cob" echo functions.at:584 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:584: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:587: ./prog" echo functions.at:587 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-000000000000000002 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:587: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 149 ) # 149. functions.at:591: FUNCTION INTEGER-OF-DATE at_setup_line='functions.at:591' at_desc='FUNCTION INTEGER-OF-DATE' $at_quiet $ECHO_N "149: FUNCTION INTEGER-OF-DATE $ECHO_C" at_xfail=no ( echo "149. functions.at:591: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-OF-DATE ( 20000925 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:604: \${COMPILE} -o prog prog.cob" echo functions.at:604 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:604: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:607: ./prog" echo functions.at:607 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00146000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:607: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 150 ) # 150. functions.at:611: FUNCTION INTEGER-OF-DAY at_setup_line='functions.at:611' at_desc='FUNCTION INTEGER-OF-DAY' $at_quiet $ECHO_N "150: FUNCTION INTEGER-OF-DAY $ECHO_C" at_xfail=no ( echo "150. functions.at:611: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-OF-DAY ( 2000269 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:624: \${COMPILE} -o prog prog.cob" echo functions.at:624 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:624: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:627: ./prog" echo functions.at:627 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00146000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:627: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 151 ) # 151. functions.at:631: FUNCTION INTEGER-PART at_setup_line='functions.at:631' at_desc='FUNCTION INTEGER-PART' $at_quiet $ECHO_N "151: FUNCTION INTEGER-PART $ECHO_C" at_xfail=no ( echo "151. functions.at:631: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-PART ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:645: \${COMPILE} -o prog prog.cob" echo functions.at:645 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:645: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:648: ./prog" echo functions.at:648 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-000000000000000001 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:648: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 152 ) # 152. functions.at:652: FUNCTION LENGTH at_setup_line='functions.at:652' at_desc='FUNCTION LENGTH' $at_quiet $ECHO_N "152: FUNCTION LENGTH $ECHO_C" at_xfail=no ( echo "152. functions.at:652: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION LENGTH ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:666: \${COMPILE} -o prog prog.cob" echo functions.at:666 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:666: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:669: ./prog" echo functions.at:669 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "8 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:669: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 153 ) # 153. functions.at:673: FUNCTION LOCALE-DATE at_setup_line='functions.at:673' at_desc='FUNCTION LOCALE-DATE' $at_quiet $ECHO_N "153: FUNCTION LOCALE-DATE $ECHO_C" at_xfail=no ( echo "153. functions.at:673: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-DATE ( "19630302" ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:690: \${COMPILE} -o prog prog.cob" echo functions.at:690 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:690: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:693: ./prog" echo functions.at:693 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:693: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 154 ) # 154. functions.at:697: FUNCTION LOCALE-TIME at_setup_line='functions.at:697' at_desc='FUNCTION LOCALE-TIME' $at_quiet $ECHO_N "154: FUNCTION LOCALE-TIME $ECHO_C" at_xfail=no ( echo "154. functions.at:697: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-TIME ( "233012" ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:714: \${COMPILE} -o prog prog.cob" echo functions.at:714 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:714: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:717: ./prog" echo functions.at:717 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:717: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 155 ) # 155. functions.at:721: FUNCTION LOCALE-TIME-FROM-SECONDS at_setup_line='functions.at:721' at_desc='FUNCTION LOCALE-TIME-FROM-SECONDS' $at_quiet $ECHO_N "155: FUNCTION LOCALE-TIME-FROM-SECONDS $ECHO_C" at_xfail=no ( echo "155. functions.at:721: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-TIME-FROM-SECONDS ( 33012 ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:738: \${COMPILE} -o prog prog.cob" echo functions.at:738 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:738: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:741: ./prog" echo functions.at:741 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:741: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 156 ) # 156. functions.at:745: FUNCTION LOG at_setup_line='functions.at:745' at_desc='FUNCTION LOG' $at_quiet $ECHO_N "156: FUNCTION LOG $ECHO_C" at_xfail=no ( echo "156. functions.at:745: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION LOG ( X ) TO Y. IF Y >= 0.40546510810816435 AND Y <= 0.40546510810816445 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:767: \${COMPILE} -o prog prog.cob" echo functions.at:767 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:767: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:770: ./prog" echo functions.at:770 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:770: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 157 ) # 157. functions.at:774: FUNCTION LOG10 at_setup_line='functions.at:774' at_desc='FUNCTION LOG10' $at_quiet $ECHO_N "157: FUNCTION LOG10 $ECHO_C" at_xfail=no ( echo "157. functions.at:774: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION LOG10 ( X ) TO Y. IF Y >= 0.17609125905568120 AND Y <= 0.17609125905568128 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:796: \${COMPILE} -o prog prog.cob" echo functions.at:796 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:796: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:799: ./prog" echo functions.at:799 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:799: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 158 ) # 158. functions.at:803: FUNCTION LOWER-CASE at_setup_line='functions.at:803' at_desc='FUNCTION LOWER-CASE' $at_quiet $ECHO_N "158: FUNCTION LOWER-CASE $ECHO_C" at_xfail=no ( echo "158. functions.at:803: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION LOWER-CASE ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:817: \${COMPILE} -o prog prog.cob" echo functions.at:817 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:817: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:820: ./prog" echo functions.at:820 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a#b.c%d+e\$ " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:820: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 159 ) # 159. functions.at:824: FUNCTION LOWER-CASE with reference modding at_setup_line='functions.at:824' at_desc='FUNCTION LOWER-CASE with reference modding' $at_quiet $ECHO_N "159: FUNCTION LOWER-CASE with reference modding $ECHO_C" at_xfail=no ( echo "159. functions.at:824: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION LOWER-CASE ( X ) (1 : 3) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:838: \${COMPILE} -o prog prog.cob" echo functions.at:838 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:838: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:841: ./prog" echo functions.at:841 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a#b " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:841: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 160 ) # 160. functions.at:845: FUNCTION MAX at_setup_line='functions.at:845' at_desc='FUNCTION MAX' $at_quiet $ECHO_N "160: FUNCTION MAX $ECHO_C" at_xfail=no ( echo "160. functions.at:845: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MAX ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:858: \${COMPILE} -o prog prog.cob" echo functions.at:858 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:858: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:861: ./prog" echo functions.at:861 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "8 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:861: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 161 ) # 161. functions.at:865: FUNCTION MEAN at_setup_line='functions.at:865' at_desc='FUNCTION MEAN' $at_quiet $ECHO_N "161: FUNCTION MEAN $ECHO_C" at_xfail=no ( echo "161. functions.at:865: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MEAN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:878: \${COMPILE} -o prog prog.cob" echo functions.at:878 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:878: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:881: ./prog" echo functions.at:881 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-1.20000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:881: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 162 ) # 162. functions.at:885: FUNCTION MEDIAN at_setup_line='functions.at:885' at_desc='FUNCTION MEDIAN' $at_quiet $ECHO_N "162: FUNCTION MEDIAN $ECHO_C" at_xfail=no ( echo "162. functions.at:885: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MEDIAN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:898: \${COMPILE} -o prog prog.cob" echo functions.at:898 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:898: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:901: ./prog" echo functions.at:901 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:901: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 163 ) # 163. functions.at:905: FUNCTION MIDRANGE at_setup_line='functions.at:905' at_desc='FUNCTION MIDRANGE' $at_quiet $ECHO_N "163: FUNCTION MIDRANGE $ECHO_C" at_xfail=no ( echo "163. functions.at:905: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MIDRANGE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:918: \${COMPILE} -o prog prog.cob" echo functions.at:918 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:918: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:921: ./prog" echo functions.at:921 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-3.000000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:921: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 164 ) # 164. functions.at:925: FUNCTION MIN at_setup_line='functions.at:925' at_desc='FUNCTION MIN' $at_quiet $ECHO_N "164: FUNCTION MIN $ECHO_C" at_xfail=no ( echo "164. functions.at:925: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MIN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:938: \${COMPILE} -o prog prog.cob" echo functions.at:938 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:938: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:941: ./prog" echo functions.at:941 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-14 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:941: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 165 ) # 165. functions.at:945: FUNCTION MOD at_setup_line='functions.at:945' at_desc='FUNCTION MOD' $at_quiet $ECHO_N "165: FUNCTION MOD $ECHO_C" at_xfail=no ( echo "165. functions.at:945: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MOD ( -11 5 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:958: \${COMPILE} -o prog prog.cob" echo functions.at:958 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:958: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:961: ./prog" echo functions.at:961 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+000000000000000004 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:961: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 166 ) # 166. functions.at:965: FUNCTION NUMVAL at_setup_line='functions.at:965' at_desc='FUNCTION NUMVAL' $at_quiet $ECHO_N "166: FUNCTION NUMVAL $ECHO_C" at_xfail=no ( echo "166. functions.at:965: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " -9876.1234 ". PROCEDURE DIVISION. DISPLAY FUNCTION NUMVAL ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:979: \${COMPILE} -o prog prog.cob" echo functions.at:979 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:979: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:982: ./prog" echo functions.at:982 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-00000000009876.1234 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:982: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 167 ) # 167. functions.at:986: FUNCTION NUMVAL-C at_setup_line='functions.at:986' at_desc='FUNCTION NUMVAL-C' $at_quiet $ECHO_N "167: FUNCTION NUMVAL-C $ECHO_C" at_xfail=no ( echo "167. functions.at:986: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(14) VALUE " % -9876.1234 ". PROCEDURE DIVISION. DISPLAY FUNCTION NUMVAL-C ( X , "%" ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1000: \${COMPILE} -o prog prog.cob" echo functions.at:1000 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1000: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1003: ./prog" echo functions.at:1003 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-00000000009876.1234 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1003: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 168 ) # 168. functions.at:1007: FUNCTION ORD at_setup_line='functions.at:1007' at_desc='FUNCTION ORD' $at_quiet $ECHO_N "168: FUNCTION ORD $ECHO_C" at_xfail=no ( echo "168. functions.at:1007: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD ( "k" ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1020: \${COMPILE} -o prog prog.cob" echo functions.at:1020 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1020: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1023: ./prog" echo functions.at:1023 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000108 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1023: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 169 ) # 169. functions.at:1027: FUNCTION ORD-MAX at_setup_line='functions.at:1027' at_desc='FUNCTION ORD-MAX' $at_quiet $ECHO_N "169: FUNCTION ORD-MAX $ECHO_C" at_xfail=no ( echo "169. functions.at:1027: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD-MAX ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1040: \${COMPILE} -o prog prog.cob" echo functions.at:1040 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1040: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1043: ./prog" echo functions.at:1043 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000004 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1043: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 170 ) # 170. functions.at:1047: FUNCTION ORD-MIN at_setup_line='functions.at:1047' at_desc='FUNCTION ORD-MIN' $at_quiet $ECHO_N "170: FUNCTION ORD-MIN $ECHO_C" at_xfail=no ( echo "170. functions.at:1047: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD-MIN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1060: \${COMPILE} -o prog prog.cob" echo functions.at:1060 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1060: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1063: ./prog" echo functions.at:1063 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000002 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1063: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 171 ) # 171. functions.at:1067: FUNCTION PI at_setup_line='functions.at:1067' at_desc='FUNCTION PI' $at_quiet $ECHO_N "171: FUNCTION PI $ECHO_C" at_xfail=no ( echo "171. functions.at:1067: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION PI END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1080: \${COMPILE} -o prog prog.cob" echo functions.at:1080 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1080: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1083: ./prog" echo functions.at:1083 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "3.1415926535897932384626433832795029 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1083: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 172 ) # 172. functions.at:1087: FUNCTION PRESENT-VALUE at_setup_line='functions.at:1087' at_desc='FUNCTION PRESENT-VALUE' $at_quiet $ECHO_N "172: FUNCTION PRESENT-VALUE $ECHO_C" at_xfail=no ( echo "172. functions.at:1087: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION PRESENT-VALUE ( 3 2 1 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1100: \${COMPILE} -o prog prog.cob" echo functions.at:1100 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1100: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1103: ./prog" echo functions.at:1103 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0.562500000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1103: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 173 ) # 173. functions.at:1107: FUNCTION RANGE at_setup_line='functions.at:1107' at_desc='FUNCTION RANGE' $at_quiet $ECHO_N "173: FUNCTION RANGE $ECHO_C" at_xfail=no ( echo "173. functions.at:1107: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION RANGE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1120: \${COMPILE} -o prog prog.cob" echo functions.at:1120 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1120: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1123: ./prog" echo functions.at:1123 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+000000000000000022 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1123: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 174 ) # 174. functions.at:1127: FUNCTION REM at_setup_line='functions.at:1127' at_desc='FUNCTION REM' $at_quiet $ECHO_N "174: FUNCTION REM $ECHO_C" at_xfail=no ( echo "174. functions.at:1127: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION REM ( -11 5 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1140: \${COMPILE} -o prog prog.cob" echo functions.at:1140 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1140: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1143: ./prog" echo functions.at:1143 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "-000000000000000001 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1143: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 175 ) # 175. functions.at:1147: FUNCTION REVERSE at_setup_line='functions.at:1147' at_desc='FUNCTION REVERSE' $at_quiet $ECHO_N "175: FUNCTION REVERSE $ECHO_C" at_xfail=no ( echo "175. functions.at:1147: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION REVERSE ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1161: \${COMPILE} -o prog prog.cob" echo functions.at:1161 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1161: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1164: ./prog" echo functions.at:1164 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "\$E+D%C.B#A " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1164: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 176 ) # 176. functions.at:1168: FUNCTION REVERSE with reference modding at_setup_line='functions.at:1168' at_desc='FUNCTION REVERSE with reference modding' $at_quiet $ECHO_N "176: FUNCTION REVERSE with reference modding $ECHO_C" at_xfail=no ( echo "176. functions.at:1168: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION REVERSE ( X ) (1 : 4) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1182: \${COMPILE} -o prog prog.cob" echo functions.at:1182 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1182: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1185: ./prog" echo functions.at:1185 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "\$E+D " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1185: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 177 ) # 177. functions.at:1189: FUNCTION SECONDS-FROM-FORMATTED-TIME at_setup_line='functions.at:1189' at_desc='FUNCTION SECONDS-FROM-FORMATTED-TIME' $at_quiet $ECHO_N "177: FUNCTION SECONDS-FROM-FORMATTED-TIME $ECHO_C" at_xfail=no ( echo "177. functions.at:1189: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(6) VALUE "hhmmss". 01 Y PIC 9(8) COMP-5. 01 Z PIC X(6) VALUE "010203". PROCEDURE DIVISION. MOVE FUNCTION SECONDS-FROM-FORMATTED-TIME (X, Z) TO Y. IF Y = 3723 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1211: \${COMPILE} -o prog prog.cob" echo functions.at:1211 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1211: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1214: ./prog" echo functions.at:1214 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1214: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 178 ) # 178. functions.at:1218: FUNCTION SECONDS-PAST-MIDNIGHT at_setup_line='functions.at:1218' at_desc='FUNCTION SECONDS-PAST-MIDNIGHT' $at_quiet $ECHO_N "178: FUNCTION SECONDS-PAST-MIDNIGHT $ECHO_C" at_xfail=no ( echo "178. functions.at:1218: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC 9(8) COMP-5. PROCEDURE DIVISION. MOVE FUNCTION SECONDS-PAST-MIDNIGHT TO Y. IF Y < 86402 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1238: \${COMPILE} -o prog prog.cob" echo functions.at:1238 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1238: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1241: ./prog" echo functions.at:1241 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1241: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 179 ) # 179. functions.at:1245: FUNCTION SIGN at_setup_line='functions.at:1245' at_desc='FUNCTION SIGN' $at_quiet $ECHO_N "179: FUNCTION SIGN $ECHO_C" at_xfail=no ( echo "179. functions.at:1245: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION SIGN ( 3.12345 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( -0.0 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( 0.0 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( -3.12345 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1264: \${COMPILE} -o prog prog.cob" echo functions.at:1264 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1264: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1270: ./prog" echo functions.at:1270 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+00000001 +00000000 +00000000 -00000001 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1270: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 180 ) # 180. functions.at:1274: FUNCTION SIN at_setup_line='functions.at:1274' at_desc='FUNCTION SIN' $at_quiet $ECHO_N "180: FUNCTION SIN $ECHO_C" at_xfail=no ( echo "180. functions.at:1274: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION SIN ( X ) TO Y. IF Y >= 0.99749498660405440 AND Y <= 0.99749498660405450 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1296: \${COMPILE} -o prog prog.cob" echo functions.at:1296 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1296: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1299: ./prog" echo functions.at:1299 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1299: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 181 ) # 181. functions.at:1303: FUNCTION SQRT at_setup_line='functions.at:1303' at_desc='FUNCTION SQRT' $at_quiet $ECHO_N "181: FUNCTION SQRT $ECHO_C" at_xfail=no ( echo "181. functions.at:1303: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION SQRT ( X ) TO Y. IF Y >= 1.22474487139158890 AND Y <= 1.22474487139158899 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1325: \${COMPILE} -o prog prog.cob" echo functions.at:1325 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1325: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1328: ./prog" echo functions.at:1328 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1328: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 182 ) # 182. functions.at:1332: FUNCTION STANDARD-DEVIATION at_setup_line='functions.at:1332' at_desc='FUNCTION STANDARD-DEVIATION' $at_quiet $ECHO_N "182: FUNCTION STANDARD-DEVIATION $ECHO_C" at_xfail=no ( echo "182. functions.at:1332: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION STANDARD-DEVIATION ( 3 -14 0 8 -3 ) TO Y. IF Y >= 7.35934779718963925 AND Y <= 7.35934779718964025 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1353: \${COMPILE} -o prog prog.cob" echo functions.at:1353 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1353: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1356: ./prog" echo functions.at:1356 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1356: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 183 ) # 183. functions.at:1360: FUNCTION STORED-CHAR-LENGTH at_setup_line='functions.at:1360' at_desc='FUNCTION STORED-CHAR-LENGTH' $at_quiet $ECHO_N "183: FUNCTION STORED-CHAR-LENGTH $ECHO_C" at_xfail=no ( echo "183. functions.at:1360: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(24). PROCEDURE DIVISION. MOVE "123456789012" TO Y. DISPLAY FUNCTION STORED-CHAR-LENGTH ( Y ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1375: \${COMPILE} -o prog prog.cob" echo functions.at:1375 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1375: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1378: ./prog" echo functions.at:1378 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00000012 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1378: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 184 ) # 184. functions.at:1382: FUNCTION SUBSTITUTE at_setup_line='functions.at:1382' at_desc='FUNCTION SUBSTITUTE' $at_quiet $ECHO_N "184: FUNCTION SUBSTITUTE $ECHO_C" at_xfail=no ( echo "184. functions.at:1382: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE ( Y "abc" "zz" "55" "666" ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1397: \${COMPILE} -o prog prog.cob" echo functions.at:1397 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1397: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1400: ./prog" echo functions.at:1400 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "zz1114446665defxxzz " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1400: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 185 ) # 185. functions.at:1404: FUNCTION SUBSTITUTE with reference modding at_setup_line='functions.at:1404' at_desc='FUNCTION SUBSTITUTE with reference modding' $at_quiet $ECHO_N "185: FUNCTION SUBSTITUTE with reference modding $ECHO_C" at_xfail=no ( echo "185. functions.at:1404: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE ( Y "abc" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1420: \${COMPILE} -o prog prog.cob" echo functions.at:1420 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1420: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1423: ./prog" echo functions.at:1423 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "z11144466 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1423: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 186 ) # 186. functions.at:1427: FUNCTION SUBSTITUTE-CASE at_setup_line='functions.at:1427' at_desc='FUNCTION SUBSTITUTE-CASE' $at_quiet $ECHO_N "186: FUNCTION SUBSTITUTE-CASE $ECHO_C" at_xfail=no ( echo "186. functions.at:1427: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "ABC111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE-CASE (Y "abc" "zz" "55" "666") END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1442: \${COMPILE} -o prog prog.cob" echo functions.at:1442 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1442: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1445: ./prog" echo functions.at:1445 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "zz1114446665defxxzz " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1445: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 187 ) # 187. functions.at:1449: FUNCTION SUBSTITUTE-CASE with reference mod at_setup_line='functions.at:1449' at_desc='FUNCTION SUBSTITUTE-CASE with reference mod' $at_quiet $ECHO_N "187: FUNCTION SUBSTITUTE-CASE with reference mod $ECHO_C" at_xfail=no ( echo "187. functions.at:1449: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE-CASE ( Y "ABC" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1465: \${COMPILE} -o prog prog.cob" echo functions.at:1465 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1465: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1468: ./prog" echo functions.at:1468 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "z11144466 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1468: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 188 ) # 188. functions.at:1472: FUNCTION TAN at_setup_line='functions.at:1472' at_desc='FUNCTION TAN' $at_quiet $ECHO_N "188: FUNCTION TAN $ECHO_C" at_xfail=no ( echo "188. functions.at:1472: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S99V9(16) COMP. PROCEDURE DIVISION. MOVE FUNCTION TAN ( X ) TO Y. IF Y >= 14.1014199471717185 AND Y <= 14.1014199471717205 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1494: \${COMPILE} -o prog prog.cob" echo functions.at:1494 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1494: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1497: ./prog" echo functions.at:1497 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1497: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 189 ) # 189. functions.at:1501: FUNCTION TRIM at_setup_line='functions.at:1501' at_desc='FUNCTION TRIM' $at_quiet $ECHO_N "189: FUNCTION TRIM $ECHO_C" at_xfail=no ( echo "189. functions.at:1501: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " a#b.c%d+e$ ". PROCEDURE DIVISION. DISPLAY FUNCTION TRIM ( X ) END-DISPLAY. DISPLAY FUNCTION TRIM ( X TRAILING ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1517: \${COMPILE} -o prog prog.cob" echo functions.at:1517 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1517: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1521: ./prog" echo functions.at:1521 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "a#b.c%d+e\$ a#b.c%d+e\$ " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1521: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 190 ) # 190. functions.at:1525: FUNCTION TRIM with reference modding at_setup_line='functions.at:1525' at_desc='FUNCTION TRIM with reference modding' $at_quiet $ECHO_N "190: FUNCTION TRIM with reference modding $ECHO_C" at_xfail=no ( echo "190. functions.at:1525: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " a#b.c%d+e$ ". PROCEDURE DIVISION. DISPLAY FUNCTION TRIM ( X ) (2 : 3) END-DISPLAY. DISPLAY FUNCTION TRIM ( X TRAILING ) (2 : 3) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1541: \${COMPILE} -o prog prog.cob" echo functions.at:1541 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1541: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1545: ./prog" echo functions.at:1545 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "#b. a#b " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1545: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 191 ) # 191. functions.at:1549: FUNCTION UPPER-CASE at_setup_line='functions.at:1549' at_desc='FUNCTION UPPER-CASE' $at_quiet $ECHO_N "191: FUNCTION UPPER-CASE $ECHO_C" at_xfail=no ( echo "191. functions.at:1549: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "a#b.c%d+e$". PROCEDURE DIVISION. DISPLAY FUNCTION UPPER-CASE ( X ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1563: \${COMPILE} -o prog prog.cob" echo functions.at:1563 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1563: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1566: ./prog" echo functions.at:1566 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "A#B.C%D+E\$ " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1566: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 192 ) # 192. functions.at:1570: FUNCTION UPPER-CASE with reference modding at_setup_line='functions.at:1570' at_desc='FUNCTION UPPER-CASE with reference modding' $at_quiet $ECHO_N "192: FUNCTION UPPER-CASE with reference modding $ECHO_C" at_xfail=no ( echo "192. functions.at:1570: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "a#b.c%d+e$". PROCEDURE DIVISION. DISPLAY FUNCTION UPPER-CASE ( X ) (1 : 3) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1584: \${COMPILE} -o prog prog.cob" echo functions.at:1584 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1584: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1587: ./prog" echo functions.at:1587 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "A#B " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1587: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 193 ) # 193. functions.at:1591: FUNCTION VARIANCE at_setup_line='functions.at:1591' at_desc='FUNCTION VARIANCE' $at_quiet $ECHO_N "193: FUNCTION VARIANCE $ECHO_C" at_xfail=no ( echo "193. functions.at:1591: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION VARIANCE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1604: \${COMPILE} -o prog prog.cob" echo functions.at:1604 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1604: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1607: ./prog" echo functions.at:1607 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "+54.1600000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1607: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 194 ) # 194. functions.at:1611: FUNCTION WHEN-COMPILED at_setup_line='functions.at:1611' at_desc='FUNCTION WHEN-COMPILED' $at_quiet $ECHO_N "194: FUNCTION WHEN-COMPILED $ECHO_C" at_xfail=no ( echo "194. functions.at:1611: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 XYZ. 03 X PIC X. 03 FILLER PIC X(20). PROCEDURE DIVISION. MOVE FUNCTION WHEN-COMPILED TO XYZ. IF X = "2" DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NOT OK" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "functions.at:1633: \${COMPILE} -o prog prog.cob" echo functions.at:1633 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1633: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "functions.at:1636: ./prog" echo functions.at:1636 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "functions.at:1636: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; * ) echo "$as_me: no such test group: $at_group" >&2 continue ;; esac # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd $at_suite_dir case $at_group in banner-*) ;; *) if test ! -f $at_check_line_file; then sed "s/^ */$as_me: warning: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF echo "$at_setup_line" >$at_check_line_file fi at_group_count=`expr 1 + $at_group_count` $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> $at_group_log case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_xpass_list="$at_xpass_list $at_group" at_errexit=$at_errexit_p ;; no:0) at_msg="ok" at_pass_list="$at_pass_list $at_group" at_errexit=false ;; *:77) at_msg="skipped (`cat $at_check_line_file`)" at_skip_list="$at_skip_list $at_group" at_errexit=false ;; yes:*) at_msg="expected failure (`cat $at_check_line_file`)" at_xfail_list="$at_xfail_list $at_group" at_errexit=false ;; no:*) at_msg="FAILED (`cat $at_check_line_file`)" at_fail_list="$at_fail_list $at_group" at_errexit=$at_errexit_p ;; esac echo $at_msg at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f $at_times_file; then at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" rm -f $at_times_file fi echo "$at_log_msg" >> $at_group_log echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files. $at_debug_p || rm -rf $at_group_dir ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. echo "$at_log_msg" >> $at_group_log # Upon failure, keep the group directory for autopsy, and # create the debugging script. { echo "#! /bin/sh" echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' echo "cd $at_dir" echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' echo 'exit 1' } >$at_group_dir/run chmod +x $at_group_dir/run $at_errexit && break ;; esac ;; esac done # Back to the top directory. cd $at_dir # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`(date +%s) 2>/dev/null` echo "$as_me: ending at: $at_stop_date" >&5 at_duration_s=`(expr $at_stop_time - $at_start_time) 2>/dev/null` at_duration_m=`(expr $at_duration_s / 60) 2>/dev/null` at_duration_h=`(expr $at_duration_m / 60) 2>/dev/null` at_duration_s=`(expr $at_duration_s % 60) 2>/dev/null` at_duration_m=`(expr $at_duration_m % 60) 2>/dev/null` at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" if test "$at_duration" != "h m s"; then echo "$as_me: test suite duration: $at_duration" >&5 fi # Wrap up the test suite with summary statistics. at_skip_count=`set dummy $at_skip_list; shift; echo $#` at_fail_count=`set dummy $at_fail_list; shift; echo $#` at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` at_run_count=`expr $at_group_count - $at_skip_count` at_unexpected_count=`expr $at_xpass_count + $at_fail_count` at_total_fail_count=`expr $at_xfail_count + $at_fail_count` echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo { echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." else # Don't you just love exponential explosion of the number of cases? case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." ;; 0:0:*) at_result="$at_result behaved as expected." ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_result" echo "$at_result" >&5 else echo "ERROR: $at_result" >&2 echo "ERROR: $at_result" >&5 { echo cat <<\_ASBOX ## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ## _ASBOX # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL $0 $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL $0 $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL $0 $at_xpass_list --list echo fi if test $at_fail_count != 0; then cat <<\_ASBOX ## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ## _ASBOX echo for at_group in $at_fail_list do # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log cat $at_group_log echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $at_top_builddir/config.log ## _ASBOX sed 's/^/| /' $at_top_builddir/config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo echo "Please send \`$as_me.log' and all information you think might help:" echo echo " To: " echo " Subject: [OpenCOBOL 1.1] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" echo if test $at_debug_p = false; then echo echo 'You may investigate any problem if you feel able to do so, in which' echo 'case the test suite provides a good starting point.' echo fi exit 1 fi exit 0 open-cobol-1.1/tests/cobol85/0000777000000000000000000000000011143001517011531 5open-cobol-1.1/tests/cobol85/IC.txt0000644000000000000000000000276011114026426012512 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- IC101A.CBL 5 5 0 0 0 OK IC103A.CBL 10 10 0 0 0 OK IC106A.CBL 14 14 0 0 0 OK IC108A.CBL 9 9 0 0 0 OK IC112A.CBL 3 3 0 0 0 OK IC114A.CBL 3 3 0 0 0 OK IC116M.CBL 1 1 0 0 0 OK IC201A.CBL 11 11 0 0 0 OK IC203A.CBL 21 21 0 0 0 OK IC207A.CBL 11 11 0 0 0 OK IC209A.CBL 4 4 0 0 0 OK IC213A.CBL 3 3 0 0 0 OK IC216A.CBL 2 2 0 0 0 OK IC222A.CBL 16 16 0 0 0 OK IC223A.CBL 11 11 0 0 0 OK IC224A.CBL 44 44 0 0 0 OK IC225A.CBL 36 36 0 0 0 OK IC226A.CBL 4 4 0 0 0 OK IC227A.CBL 23 19 0 4 0 OK IC228A.CBL 4 4 0 0 0 OK IC233A.CBL 1 1 0 0 0 OK IC234A.CBL 1 1 0 0 0 OK IC235A.CBL 12 12 0 0 0 OK IC237A.CBL 1 1 0 0 0 OK IC401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 250 246 0 4 0 % 100.0 98.4 0.0 1.6 0.0 Number of programs: 24 Successfully executed: 24 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/IF.txt0000644000000000000000000000461510260245717012525 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- IF101A.CBL 26 26 0 0 0 OK IF102A.CBL 13 13 0 0 0 OK IF103A.CBL 23 23 0 0 0 OK IF104A.CBL 27 27 0 0 0 OK IF105A.CBL 8 8 0 0 0 OK IF106A.CBL 30 30 0 0 0 OK IF107A.CBL 2 2 0 0 0 OK IF108A.CBL 10 10 0 0 0 OK IF109A.CBL 8 8 0 0 0 OK IF110A.CBL 9 9 0 0 0 OK IF111A.CBL 23 23 0 0 0 OK IF112A.CBL 8 8 0 0 0 OK IF113A.CBL 8 8 0 0 0 OK IF114A.CBL 23 23 0 0 0 OK IF115A.CBL 8 8 0 0 0 OK IF116A.CBL 25 25 0 0 0 OK IF117A.CBL 32 32 0 0 0 OK IF118A.CBL 13 13 0 0 0 OK IF119A.CBL 23 23 0 0 0 OK IF120A.CBL 17 17 0 0 0 OK IF121A.CBL 17 17 0 0 0 OK IF122A.CBL 17 17 0 0 0 OK IF123A.CBL 23 23 0 0 0 OK IF124A.CBL 21 21 0 0 0 OK IF125A.CBL 20 20 0 0 0 OK IF126A.CBL 30 30 0 0 0 OK IF127A.CBL 9 9 0 0 0 OK IF128A.CBL 16 16 0 0 0 OK IF129A.CBL 17 17 0 0 0 OK IF130A.CBL 21 21 0 0 0 OK IF131A.CBL 8 8 0 0 0 OK IF132A.CBL 15 15 0 0 0 OK IF133A.CBL 17 17 0 0 0 OK IF134A.CBL 13 13 0 0 0 OK IF135A.CBL 32 32 0 0 0 OK IF136A.CBL 26 26 0 0 0 OK IF137A.CBL 17 17 0 0 0 OK IF138A.CBL 16 16 0 0 0 OK IF139A.CBL 30 30 0 0 0 OK IF140A.CBL 13 13 0 0 0 OK IF141A.CBL 16 16 0 0 0 OK IF142A.CBL 2 2 0 0 0 OK IF401M.CBL ----- test skipped ----- IF402M.CBL ----- test skipped ----- IF403M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 732 732 0 0 0 % 100.0 100.0 0.0 0.0 0.0 Number of programs: 42 Successfully executed: 42 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/expand.pl0000755000000000000000000000354411130701401013265 # # Copyright (C) 2001-2009 Keisuke Nishida # Copyright (C) 2007-2009 Roger While # # 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 software; see the file COPYING. If not, write to # the Free Software Foundation, 51 Franklin Street, Fifth Floor # Boston, MA 02110-1301 USA open (IN, shift) or die; while () { s/\x0d\x0a|\x0d|\x0a//g; if (/^ \*HEADER,([^,]*),([^, ]*)(,([^,]*),([^, ]*))?/) { my ($type, $prog, $subt, $subr) = ($1, $2, $4, $5); my $module = substr($prog, 0, 2); my $name = ''; if ($subt) { if ($subt eq "SUBPRG") { $name = "$subr.SUB"; } elsif ($subt eq "SUBRTN") { $name = "lib/$subr.CBL"; mkdir "$module/lib",0755 unless (-e "$module/lib"); } } elsif ($type eq "COBOL") { $name = "$prog.CBL"; } elsif ($type eq "DATA*") { $name = "$prog.DAT"; } elsif ($type eq "CLBRY") { if ($prog eq "ALTL1") { $module = "copyalt"; $name = "ALTLB"; } else { $module = "copy"; $name = "$prog"; } } if ($name) { mkdir $module,0755 unless (-e $module); open (OUT, "> $module/$name") or die; while () { last if /^ \*END/; s/\x0d\x0a|\x0d|\x0a//g if ($type eq "DATA*" and length >= 80); s/REC-FILLER/FILLER /; print OUT; } } else { while () { last if /^ \*END/; } } } } open-cobol-1.1/tests/cobol85/IX.txt0000644000000000000000000000437710335201452012543 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- IX101A.CBL 2 2 0 0 0 OK IX102A.SUB 11 11 0 0 0 OK IX103A.SUB 12 12 0 0 0 OK IX104A.CBL 13 13 0 0 0 OK IX105A.CBL 9 9 0 0 0 OK IX106A.CBL 10 10 0 0 0 OK IX107A.CBL 14 14 0 0 0 OK IX108A.CBL 32 32 0 0 0 OK IX109A.CBL 13 13 0 0 0 OK IX110A.SUB 4 4 0 0 0 OK IX111A.SUB 1 1 0 0 0 OK IX112A.CBL 7 7 0 0 0 OK IX113A.CBL 4 4 0 0 0 OK IX114A.SUB 3 3 0 0 0 OK IX115A.SUB 3 3 0 0 0 OK IX116A.SUB 3 3 0 0 0 OK IX117A.SUB 3 3 0 0 0 OK IX118A.SUB 3 3 0 0 0 OK IX119A.SUB 3 3 0 0 0 OK IX120A.SUB 2 2 0 0 0 OK IX121A.CBL 3 3 0 0 0 OK IX201A.CBL 2 2 0 0 0 OK IX202A.SUB 11 11 0 0 0 OK IX203A.SUB 12 12 0 0 0 OK IX204A.CBL 13 13 0 0 0 OK IX205A.CBL 12 12 0 0 0 OK IX206A.CBL 10 10 0 0 0 OK IX207A.CBL 8 8 0 0 0 OK IX208A.CBL 29 29 0 0 0 OK IX209A.CBL 56 56 0 0 0 OK IX210A.CBL 39 39 0 0 0 OK IX211A.CBL 17 17 0 0 0 OK IX212A.CBL 24 24 0 0 0 OK IX213A.CBL 21 21 0 0 0 OK IX214A.CBL 39 39 0 0 0 OK IX215A.CBL 33 33 0 0 0 OK IX216A.CBL 15 14 0 1 0 OK IX217A.CBL 6 6 0 0 0 OK IX218A.CBL 6 6 0 0 0 OK IX301M.CBL ----- test skipped ----- IX302M.CBL ----- test skipped ----- IX401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 508 507 0 1 0 % 100.0 99.8 0.0 0.2 0.0 Number of programs: 39 Successfully executed: 39 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/NC.txt0000644000000000000000000001127207670522412012525 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- NC101A.CBL 93 93 0 0 0 OK NC102A.CBL 42 42 0 0 0 OK NC103A.CBL 102 102 0 0 0 OK NC104A.CBL 141 141 0 0 0 OK NC105A.CBL 132 129 0 3 0 OK NC106A.CBL 126 126 0 0 0 OK NC107A.CBL 177 172 0 0 5 OK NC108M.CBL 14 14 0 0 0 OK NC109M.CBL 11 11 0 0 0 OK NC110M.CBL 0 0 0 0 0 OK NC111A.CBL 7 7 0 0 0 OK NC112A.CBL 32 32 0 0 0 OK NC113M.CBL 0 0 0 0 0 OK NC114M.CBL 6 5 0 0 1 OK NC115A.CBL 31 31 0 0 0 OK NC116A.CBL 66 66 0 0 0 OK NC117A.CBL 40 40 0 0 0 OK NC118A.CBL 29 29 0 0 0 OK NC119A.CBL 36 36 0 0 0 OK NC120A.CBL 39 39 0 0 0 OK NC121M.CBL 41 39 0 0 2 OK NC122A.CBL 24 24 0 0 0 OK NC123A.CBL 34 34 0 0 0 OK NC124A.CBL 169 169 0 0 0 OK NC125A.CBL 110 110 0 0 0 OK NC126A.CBL 145 145 0 0 0 OK NC127A.CBL 2 2 0 0 0 OK NC131A.CBL 10 10 0 0 0 OK NC132A.CBL 25 25 0 0 0 OK NC133A.CBL 25 25 0 0 0 OK NC134A.CBL 20 20 0 0 0 OK NC135A.CBL 8 7 0 0 1 OK NC136A.CBL 8 8 0 0 0 OK NC137A.CBL 8 8 0 0 0 OK NC138A.CBL 36 36 0 0 0 OK NC139A.CBL 41 41 0 0 0 OK NC140A.CBL 70 70 0 0 0 OK NC141A.CBL 9 9 0 0 0 OK NC170A.CBL 96 96 0 0 0 OK NC171A.CBL 108 108 0 0 0 OK NC172A.CBL 101 101 0 0 0 OK NC173A.CBL 102 102 0 0 0 OK NC174A.CBL 77 76 0 1 0 OK NC175A.CBL 97 97 0 0 0 OK NC176A.CBL 124 124 0 0 0 OK NC177A.CBL 108 108 0 0 0 OK NC201A.CBL 59 59 0 0 0 OK NC202A.CBL 77 77 0 0 0 OK NC203A.CBL 57 57 0 0 0 OK NC204M.CBL 15 15 0 0 0 OK NC205A.CBL 10 10 0 0 0 OK NC206A.CBL 53 53 0 0 0 OK NC207A.CBL 85 85 0 0 0 OK NC208A.CBL 24 24 0 0 0 OK NC209A.CBL 32 32 0 0 0 OK NC210A.CBL 85 85 0 0 0 OK NC211A.CBL 51 51 0 0 0 OK NC214M.CBL 0 0 0 0 0 OK NC215A.CBL 7 7 0 0 0 OK NC216A.CBL 57 57 0 0 0 OK NC217A.CBL 81 80 0 1 0 OK NC218A.CBL 125 125 0 0 0 OK NC219A.CBL 9 9 0 0 0 OK NC220M.CBL 25 23 0 0 2 OK NC221A.CBL 17 17 0 0 0 OK NC222A.CBL 8 8 0 0 0 OK NC223A.CBL 94 94 0 0 0 OK NC224A.CBL 14 14 0 0 0 OK NC225A.CBL 63 63 0 0 0 OK NC231A.CBL 24 24 0 0 0 OK NC232A.CBL 17 17 0 0 0 OK NC233A.CBL 14 14 0 0 0 OK NC234A.CBL 17 17 0 0 0 OK NC235A.CBL 13 13 0 0 0 OK NC236A.CBL 10 10 0 0 0 OK NC237A.CBL 13 13 0 0 0 OK NC238A.CBL 10 10 0 0 0 OK NC239A.CBL 8 8 0 0 0 OK NC240A.CBL 11 11 0 0 0 OK NC241A.CBL 11 11 0 0 0 OK NC242A.CBL 12 12 0 0 0 OK NC243A.CBL 16 16 0 0 0 OK NC244A.CBL 6 6 0 0 0 OK NC245A.CBL 28 28 0 0 0 OK NC246A.CBL 49 49 0 0 0 OK NC247A.CBL 21 20 0 1 0 OK NC248A.CBL 11 11 0 0 0 OK NC250A.CBL 115 115 0 0 0 OK NC251A.CBL 59 59 0 0 0 OK NC252A.CBL 75 75 0 0 0 OK NC253A.CBL 61 61 0 0 0 OK NC254A.CBL 9 9 0 0 0 OK NC302M.CBL ----- test skipped ----- NC303M.CBL ----- test skipped ----- NC401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 4380 4363 0 6 11 % 100.0 99.6 0.0 0.1 0.3 Number of programs: 92 Successfully executed: 92 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/OB.txt0000644000000000000000000000123311115305541012510 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- OBIC1A.CBL 1 1 0 0 0 OK OBNC1M.CBL ----- test skipped ----- OBNC2M.CBL ----- test skipped ----- OBSQ1A.CBL 6 6 0 0 0 OK OBSQ3A.CBL 0 0 0 0 0 OK OBSQ4A.SUB 4 4 0 0 0 OK OBSQ5A.SUB 5 5 0 0 0 OK -------- ----- ---- ---- ------- ------- Total 16 16 0 0 0 % 100.0 100.0 0.0 0.0 0.0 Number of programs: 5 Successfully executed: 5 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/README0000644000000000000000000000360411116003717012334 How to run the NIST CCVS85 (aka. ANSI85) Test Suite ===================================== *NOTE* It is expected that WARNING messages appear when running the test. *NOTE* The language interpreter "perl" is required to run these tests. The final command of the the test is a diff between expected results and actual results. ie. diff summary.txt summary.log If there is any output from this command, please tar and compress the complete cobol85 directory and report this to the OC list. You will receive further instructions where to send this. *NOTE* This test can take a long time depending on your hardware. 1. EITHER - a) Download the test archive from - http://www.sim-basis.de/newcob.val.gz Uncompress it - gunzip newcob.val.gz (alternatively gzip -d newcob.val.gz) OR b) Download the test archive `newcob.val.Z' from http://www.itl.nist.gov/div897/ctg/cobol_form.htm Uncompress it: uncompress newcob.val.Z 2. Move the file newcob.val to the tests/cobol85 directory 3. Run the test suite: cd tests/cobol85 make test 4. Test report summary will be put in summary.log. 5. When rerunning test as a result of a change, always do a "make clean" before "make test" 6. The default OC configuration tests are NC SM IC SQ RL IX ST SG OB IF Make Options ------------ - make test run the test suite - make save save test reports in *.txt - make diff diff from *.txt to the last reports - make clean remove built files Test Modules ------------ Core tests: NC - COBOL nucleus tests SM - COPY sentence tests IC - CALL sentence tests File I-O tests: SQ - Sequential file I-O tests RL - Relative file I-O tests IX - Indexed file I-O tests ST - SORT sentence tests Advanced facilities: RW - REPORT SECTION tests CM - COMMUNICATION SECTION tests IF - Intrinsic Function tests SG - Segment tests DB - Debugging facilities tests OB - Obsolete facilities tests open-cobol-1.1/tests/cobol85/RL.txt0000644000000000000000000000366607670522412012552 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- RL101A.CBL 1 1 0 0 0 OK RL102A.SUB 11 11 0 0 0 OK RL103A.SUB 11 11 0 0 0 OK RL104A.CBL 12 12 0 0 0 OK RL105A.CBL 4 4 0 0 0 OK RL106A.CBL 4 4 0 0 0 OK RL107A.CBL 19 19 0 0 0 OK RL108A.CBL 1 1 0 0 0 OK RL109A.SUB 11 11 0 0 0 OK RL110A.SUB 10 10 0 0 0 OK RL111A.CBL 24 24 0 0 0 OK RL112A.CBL 12 12 0 0 0 OK RL113A.CBL 11 11 0 0 0 OK RL114A.CBL 13 13 0 0 0 OK RL115A.CBL 13 13 0 0 0 OK RL116A.CBL 3 3 0 0 0 OK RL117A.CBL 8 6 0 2 0 OK RL118A.CBL 4 2 0 2 0 OK RL119A.CBL 1 1 0 0 0 OK RL201A.CBL 1 1 0 0 0 OK RL202A.SUB 11 11 0 0 0 OK RL203A.SUB 11 11 0 0 0 OK RL204A.CBL 12 12 0 0 0 OK RL205A.CBL 67 66 0 1 0 OK RL206A.CBL 501 501 0 0 0 OK RL207A.SUB 20 20 0 0 0 OK RL208A.SUB 11 11 0 0 0 OK RL209A.CBL 1 1 0 0 0 OK RL210A.CBL 1 1 0 0 0 OK RL211A.CBL 501 501 0 0 0 OK RL212A.CBL 1 1 0 0 0 OK RL213A.SUB 521 521 0 0 0 OK RL301M.CBL ----- test skipped ----- RL302M.CBL ----- test skipped ----- RL401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 1832 1827 0 5 0 % 100.0 99.7 0.0 0.3 0.0 Number of programs: 32 Successfully executed: 32 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/SG.txt0000644000000000000000000000160511115301226012520 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- SG101A.CBL 151 151 0 0 0 OK SG102A.CBL ----- test skipped ----- SG103A.CBL ----- test skipped ----- SG104A.CBL 9 9 0 0 0 OK SG105A.CBL 9 9 0 0 0 OK SG106A.CBL 9 9 0 0 0 OK SG201A.CBL ----- test skipped ----- SG202A.CBL ----- test skipped ----- SG203A.CBL ----- test skipped ----- SG204A.CBL 15 15 0 0 0 OK SG302M.CBL ----- test skipped ----- SG303M.CBL ----- test skipped ----- SG401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 193 193 0 0 0 % 100.0 100.0 0.0 0.0 0.0 Number of programs: 5 Successfully executed: 5 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/SM.txt0000644000000000000000000000216011114465335012536 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- SM101A.CBL 8 8 0 0 0 OK SM102A.SUB 4 4 0 0 0 OK SM103A.CBL 6 6 0 0 0 OK SM104A.SUB 7 7 0 0 0 OK SM105A.CBL 9 9 0 0 0 OK SM106A.CBL 1 0 0 0 1 OK SM107A.CBL 200 200 0 0 0 OK SM201A.CBL 11 11 0 0 0 OK SM202A.SUB 7 7 0 0 0 OK SM203A.CBL 1 1 0 0 0 OK SM204A.SUB 4 4 0 0 0 OK SM205A.CBL 9 9 0 0 0 OK SM206A.CBL 16 14 0 2 0 OK SM207A.CBL 2 2 0 0 0 OK SM208A.CBL 9 8 0 1 0 OK SM301M.CBL ----- test skipped ----- SM401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 294 290 0 3 1 % 100.0 98.6 0.0 1.0 0.3 Number of programs: 15 Successfully executed: 15 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/SQ.txt0000644000000000000000000001033410211676166012547 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- SQ101M.CBL 57 0 0 0 57 OK SQ102A.CBL 11 11 0 0 0 OK SQ103A.CBL 30 30 0 0 0 OK SQ104A.CBL 11 11 0 0 0 OK SQ105A.CBL 22 22 0 0 0 OK SQ106A.CBL 75 69 0 6 0 OK SQ107A.CBL 6 6 0 0 0 OK SQ108A.CBL 8 8 0 0 0 OK SQ109M.CBL 6 6 0 0 0 OK SQ110M.CBL 6 6 0 0 0 OK SQ111A.CBL 1 1 0 0 0 OK SQ112A.CBL 7 7 0 0 0 OK SQ113A.CBL 22 22 0 0 0 OK SQ114A.CBL 15 15 0 0 0 OK SQ115A.CBL 3 3 0 0 0 OK SQ116A.CBL 10 10 0 0 0 OK SQ117A.CBL 8 8 0 0 0 OK SQ121A.CBL 3 3 0 0 0 OK SQ122A.CBL 7 7 0 0 0 OK SQ123A.CBL 9 9 0 0 0 OK SQ124A.CBL 19 19 0 0 0 OK SQ125A.CBL 2 2 0 0 0 OK SQ126A.CBL 7 7 0 0 0 OK SQ127A.CBL 6 6 0 0 0 OK SQ128A.CBL 9 9 0 0 0 OK SQ129A.CBL 1 1 0 0 0 OK SQ130A.CBL 1 1 0 0 0 OK SQ131A.CBL 2 2 0 0 0 OK SQ132A.CBL 1 1 0 0 0 OK SQ133A.CBL 15 15 0 0 0 OK SQ134A.CBL 15 15 0 0 0 OK SQ135A.CBL 1 1 0 0 0 OK SQ136A.CBL 1 1 0 0 0 OK SQ137A.CBL 1 1 0 0 0 OK SQ138A.CBL 1 1 0 0 0 OK SQ139A.CBL 1 1 0 0 0 OK SQ140A.CBL 1 1 0 0 0 OK SQ141A.CBL 1 1 0 0 0 OK SQ142A.CBL 1 1 0 0 0 OK SQ143A.CBL 1 1 0 0 0 OK SQ144A.CBL 1 1 0 0 0 OK SQ146A.CBL 1 1 0 0 0 OK SQ147A.CBL 1 1 0 0 0 OK SQ148A.CBL 2 2 0 0 0 OK SQ149A.CBL 1 1 0 0 0 OK SQ150A.CBL 1 1 0 0 0 OK SQ151A.CBL 1 1 0 0 0 OK SQ152A.CBL 1 1 0 0 0 OK SQ153A.CBL 1 1 0 0 0 OK SQ154A.CBL 1 1 0 0 0 OK SQ155A.CBL 1 1 0 0 0 OK SQ156A.CBL 1 1 0 0 0 OK SQ201M.CBL 23 12 0 0 11 OK SQ202A.CBL 1 1 0 0 0 OK SQ203A.SUB 4 4 0 0 0 OK SQ204A.CBL 2 2 0 0 0 OK SQ205A.CBL 2 2 0 0 0 OK SQ206A.CBL 4 4 0 0 0 OK SQ207M.CBL ----- test skipped ----- SQ208M.CBL 7 0 0 0 7 OK SQ209M.CBL 3 0 0 0 3 OK SQ210M.CBL 3 0 0 0 3 OK SQ211A.CBL 4 4 0 0 0 OK SQ212A.CBL 1 1 0 0 0 OK SQ213A.CBL 7 7 0 0 0 OK SQ214A.CBL 5 5 0 0 0 OK SQ215A.CBL 4 4 0 0 0 OK SQ216A.CBL 7 7 0 0 0 OK SQ217A.CBL 7 7 0 0 0 OK SQ218A.CBL 6 6 0 0 0 OK SQ219A.CBL 6 6 0 0 0 OK SQ220A.CBL 6 6 0 0 0 OK SQ221A.CBL 6 6 0 0 0 OK SQ222A.CBL 6 6 0 0 0 OK SQ223A.CBL 6 6 0 0 0 OK SQ224A.CBL 3 3 0 0 0 OK SQ225A.CBL 3 3 0 0 0 OK SQ226A.CBL 37 37 0 0 0 OK SQ227A.CBL 16 16 0 0 0 OK SQ228A.CBL 1 1 0 0 0 OK SQ229A.CBL 1 1 0 0 0 OK SQ230A.CBL 1 1 0 0 0 OK SQ302M.CBL ----- test skipped ----- SQ303M.CBL ----- test skipped ----- SQ401M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 599 512 0 6 81 % 100.0 85.5 0.0 1.0 13.5 Number of programs: 81 Successfully executed: 81 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/ST.txt0000644000000000000000000000426210335201452012542 Filename total pass fail deleted inspect -------- ----- ---- ---- ------- ------- ST101A.CBL 9 9 0 0 0 OK ST102A.SUB 0 0 0 0 0 OK ST103A.SUB 9 9 0 0 0 OK ST104A.CBL 1 1 0 0 0 OK ST105A.SUB 2 2 0 0 0 OK ST106A.CBL 1 1 0 0 0 OK ST107A.SUB 6 6 0 0 0 OK ST108A.CBL 9 9 0 0 0 OK ST109A.CBL 0 0 0 0 0 OK ST110A.SUB 0 0 0 0 0 OK ST111A.SUB 7 7 0 0 0 OK ST112M.CBL 0 0 0 0 0 OK ST113M.SUB 0 0 0 0 0 OK ST114M.SUB 10 10 0 0 0 OK ST115A.CBL 0 0 0 0 0 OK ST116A.SUB 0 0 0 0 0 OK ST117A.SUB 1 1 0 0 0 OK ST118A.CBL 9 9 0 0 0 OK ST119A.CBL 27 27 0 0 0 OK ST120A.SUB 0 0 0 0 0 OK ST121A.SUB 9 9 0 0 0 OK ST122A.CBL 0 0 0 0 0 OK ST123A.SUB 0 0 0 0 0 OK ST124A.SUB 7 7 0 0 0 OK ST125A.CBL 1 1 0 0 0 OK ST126A.SUB 18 18 0 0 0 OK ST127A.CBL 27 27 0 0 0 OK ST131A.CBL 15 15 0 0 0 OK ST132A.CBL 6 6 0 0 0 OK ST133A.CBL 18 18 0 0 0 OK ST134A.CBL 4 4 0 0 0 OK ST135A.CBL 9 9 0 0 0 OK ST136A.CBL 5 5 0 0 0 OK ST137A.CBL 6 6 0 0 0 OK ST139A.CBL 10 10 0 0 0 OK ST140A.CBL 11 11 0 0 0 OK ST144A.CBL 11 11 0 0 0 OK ST146A.CBL 4 4 0 0 0 OK ST147A.CBL 26 26 0 0 0 OK ST301M.CBL ----- test skipped ----- -------- ----- ---- ---- ------- ------- Total 278 278 0 0 0 % 100.0 100.0 0.0 0.0 0.0 Number of programs: 39 Successfully executed: 39 (100.00%) Compile error: 0 ( 0.00%) Execute error: 0 ( 0.00%) open-cobol-1.1/tests/cobol85/report.pl0000644000000000000000000001047511130701401013317 # # Copyright (C) 2001-2009 Keisuke Nishida # Copyright (C) 2007-2009 Roger While # # 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 software; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA my $opt = shift; my $compile; my $compile_module; if ($opt) { $compile = "cobc -std=cobol85 -x $opt"; $compile_module = "cobc -std=cobol85 -m $opt"; } else { $compile = "cobc -std=cobol85 -x"; $compile_module = "cobc -std=cobol85 -m"; } my $num_progs = 0; my $test_skipped = 0; my $compile_error = 0; my $execute_error = 0; my $total_all = 0; my $total_pass = 0; my $total_fail = 0; my $total_deleted = 0; my $total_inspect = 0; my $total_ok = 0; my $ret = 0; $ENV{"COB_SWITCH_1"} = "ON"; $ENV{"COB_SWITCH_2"} = "OFF"; $skip{SQ207M} = 1; $skip{SG102A} = 1; $skip{SG103A} = 1; $skip{SG201A} = 1; $skip{SG202A} = 1; $skip{SG203A} = 1; $skip{OBNC1M} = 1; $skip{OBNC2M} = 1; open (LOG, "> report.txt") or die; print LOG "Filename total pass fail deleted inspect\n"; print LOG "-------- ----- ---- ---- ------- -------\n"; foreach $in (glob("lib/*.CBL")) { print "$compile_module $in\n"; system ("$compile_module $in"); } foreach $in (sort (glob("*.{CBL,SUB}"))) { my $exe = $in; my $cmd; $exe =~ s/\.CBL//; $exe =~ s/\.SUB//; $cmd = "./$exe"; if (-e "./$exe.DAT") { $cmd = "./$exe < $exe.DAT"; } printf LOG "%-12s", $in; if ($skip{$exe} || $exe =~ /^..[34]0/) { $test_skipped++; print LOG " ----- test skipped -----\n"; } else { $num_progs++; $copy = ($exe =~ /^SM/) ? "-I ../copy" : ""; print "$compile $copy $in && $cmd\n"; if ($in eq "SM206A.CBL") { $ret = system ("$compile -fdebugging-line $copy $in"); } else { $ret = system ("$compile $copy $in"); } if ($ret != 0) { $compile_error++; print LOG " ===== compile error =====\n"; } else { if ($in =~ /\.CBL/) { if ($ENV{'DB_HOME'}) { system ("rm -f XXXXX*; rm -f $ENV{'DB_HOME'}/XXXXX*"); } else { system ("rm -f XXXXX*"); } } if (system ("$cmd > $exe.out") != 0) { $execute_error++; print LOG " ***** execute error *****\n"; } else { my $total = 0; my $pass = 0; my $fail = 0; my $deleted = 0; my $inspect = 0; if (open (PRT, "report.log")) { while () { if (/^ *([0-9]+) *OF *([0-9]+) *TESTS WERE/) { $total += $2; $pass += $1; } elsif (/^ *([0-9NO]+) *TEST\(S\) ([A-Z]+)/) { my $num = $1 eq "NO" ? 0 : $1; if ($2 eq "FAILED") { $fail += $num; } elsif ($2 eq "DELETED") { $deleted += $num; } elsif ($2 eq "REQUIRE") { $inspect += $num; } } } } printf LOG ("%5s %4s %4s %7s %7s %s\n", $total, $pass, $fail, $deleted, $inspect, $fail == 0 ? "OK" : ""); $total_all += $total; $total_pass += $pass; $total_fail += $fail; $total_deleted += $deleted; $total_inspect += $inspect; $total_ok++ if $fail == 0; rename ("report.log", "$exe.log"); unlink "$exe.out" if (-s "$exe.out" == 0); } } } } print LOG "-------- ----- ---- ---- ------- -------\n"; printf LOG ("Total %5s %4s %4s %7s %7s\n", $total_all, $total_pass, $total_fail, $total_deleted, $total_inspect); printf LOG ("%% 100.0 %4.1f %4.1f %4.1f %4.1f\n\n", 100 * $total_pass / $total_all, 100 * $total_fail / $total_all, 100 * $total_deleted / $total_all, 100 * $total_inspect / $total_all) if $total_all; printf LOG ("Number of programs: %2s\n", $num_progs); printf LOG ("Successfully executed: %2s (%5.2f%%)\n", $total_ok, 100 * $total_ok / $num_progs); printf LOG ("Compile error: %2s (%5.2f%%)\n", $compile_error, 100 * $compile_error / $num_progs); printf LOG ("Execute error: %2s (%5.2f%%)\n", $execute_error, 100 * $execute_error / $num_progs); open-cobol-1.1/tests/cobol85/summary.pl0000644000000000000000000000447011130701401013477 # # Copyright (C) 2002-2009 Keisuke Nishida # Copyright (C) 2007-2009 Roger While # # 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 software; see the file COPYING. If not, write to # the Free Software Foundation, 51 Franklin Street, Fifth Floor # Boston, MA 02110-1301 USA my $total_progs = 0; my $total_executed = 0; my $total_error = 0; my $total_crash = 0; my $total_pass = 0; my $total_fail = 0; my $total_del = 0; my $total_insp = 0; my $total_total = 0; print ("------ Directory Information ------- --- Total Tests Information ---\n"); print ("Module Programs Executed Error Crash Pass Fail Deleted Inspect Total\n"); print ("------ -------- -------- ----- ----- ----- ---- ------- ------- -----\n"); while ($module = shift) { open(IN, "$module/report.txt") or die; while () { if (/^Total *(\d+) *(\d+) *(\d+) *(\d+) *(\d+)/) { ($test, $pass, $fail, $delete, $inspect) = ($1, $2, $3, $4, $5); } elsif (/^Number of programs: *(\d+)/) { $progs = $1; } elsif (/^Successfully executed: *(\d+)/) { $executed = $1; } elsif (/^Compile error: *(\d+)/) { $error = $1; } elsif (/^Execute error: *(\d+)/) { $crash = $1; } } printf "%-6s %8d %8d %5d %5d %4d %4d %7d %7d %5d\n", $module, $progs, $executed, $error, $crash, $pass, $fail, $delete, $inspect, $test; $total_progs += $progs; $total_executed += $executed; $total_error += $error; $total_crash += $crash; $total_pass += $pass; $total_fail += $fail; $total_del += $delete; $total_insp += $inspect; $total_total += $test; } print ("------ -------- -------- ----- ----- ----- ---- ------- ------- -----\n"); printf "Total %8d %8d %5d %5d %5d %4d %7d %7d %5d\n", $total_progs, $total_executed, $total_error, $total_crash, $total_pass, $total_fail, $total_del, $total_insp, $total_total; open-cobol-1.1/tests/cobol85/summary.txt0000644000000000000000000000205111115305554013710 ------ Directory Information ------- --- Total Tests Information --- Module Programs Executed Error Crash Pass Fail Deleted Inspect Total ------ -------- -------- ----- ----- ----- ---- ------- ------- ----- NC 92 92 0 0 4363 0 6 11 4380 SM 15 15 0 0 290 0 3 1 294 IC 24 24 0 0 246 0 4 0 250 SQ 81 81 0 0 512 0 6 81 599 RL 32 32 0 0 1827 0 5 0 1832 IX 39 39 0 0 507 0 1 0 508 ST 39 39 0 0 278 0 0 0 278 SG 5 5 0 0 193 0 0 0 193 OB 5 5 0 0 16 0 0 0 16 IF 42 42 0 0 732 0 0 0 732 ------ -------- -------- ----- ----- ----- ---- ------- ------- ----- Total 374 374 0 0 8964 0 25 93 9082 open-cobol-1.1/tests/cobol85/EXEC85.conf.in0000644000000000000000000000226511115515075013637 *SELECT-MODULE @MODULE@ X-00173 "XXXXX001" X-00273 "XXXXX002" X-00373 "XXXXX003" X-00473 "XXXXX004" X-00573 "XXXXX005" X-00673 "XXXXX006" X-00773 "XXXXX007" X-00873 "XXXXX008" X-00973 "XXXXX009" X-01073 "XXXXX010" X-01173 "XXXXX011" X-01273 "XXXXX012" X-01373 "XXXXX013" X-01473 "XXXXX014" X-01573 "XXXXX015" X-01673 "XXXXX016" X-01773 "XXXXX017" X-01873 "XXXXX018" X-01973 "XXXXX019" X-02073 "XXXXX020" X-02173 "XXXXX021" X-02273 "XXXXX022" X-02373 "XXXXX023" X-02473 "XXXXX024" X-02573 "XXXXX025" X-02673 "XXXXX026" X-02773 "XXXXX027" X-02873 "XXXXX028" X-02973 "XXXXX029" X-04773 "." X-04873 "../copyalt" X-04973 "XXXXX049" X-05173 SWITCH-1 X-05273 SWITCH-2 X-05373 XXXXX053 X-05573 "report.log" X-05673 SYSOUT X-05773 SYSIN X-06073 "XXXXX060" X-06173 "XXXXX061" X-06273 "XXXXX062" X-06373 " $$()*+,-./0123456789;<=>ABCDEFGHIJKLMNOPQRSTUVWXYZ" X-06473 "ZYXWVUTSRQPONMLKJIHGFEDCBA>=<;9876543210/.-,+*)($$ " X-06573 1000 X-06773 1000 X-06873 64000 X-06973 SYSIN X-07073 STANDARD-1 X-07373 SYSOUT X-07473 OCLABELID X-07573 "OCDUMMY" X-07673 "OCDUMMY" X-07773 "OCDUMMY" X-08173 "12345678" X-08273 Linux X-08373 Linux X-09073 "A" X-09173 "D" X-09273 "XXXXX092" *END-MONITOR *BEGIN-UPDATE *END-UPDATE *START open-cobol-1.1/tests/cobol85/Makefile.am0000644000000000000000000000420711130701401013477 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## #MODULES = CM DB IC IF IX NC OB RL RW SG SM SQ ST MODULES = NC SM IC SQ RL IX ST SG OB IF EXTRA_DIST = EXEC85.conf.in expand.pl report.pl summary.pl summary.txt \ NC.txt SM.txt IC.txt SQ.txt RL.txt IX.txt ST.txt SG.txt OB.txt IF.txt ifedit.sh CLEANFILES = EXEC85 summary.log COBOL = cobc -std=cobol85 COB85DIR = "`cd $(srcdir) && pwd`" test: $(MODULES) @for m in $(MODULES); do \ (cd $$m && make test) \ done perl $(srcdir)/summary.pl $(MODULES) > summary.log test -e $(srcdir)/summary.txt && diff $(srcdir)/summary.txt summary.log save: @for m in $(MODULES); do \ (cp $$m/report.txt $$m.txt) \ done cp summary.log summary.txt diff: @for m in $(MODULES); do \ (diff $$m.txt $$m/report.txt) \ done diff summary.txt summary.log clean-local: rm -rf copy copyalt $(MODULES) $(MODULES): newcob.val EXEC85 $(srcdir)/EXEC85.conf.in @echo -n "Building module $@..." @sed 's/@MODULE@/$@/' $(srcdir)/EXEC85.conf.in > EXEC85.conf @. ../atconfig; . ../atlocal; export PATH; ./EXEC85 @$(srcdir)/ifedit.sh @perl $(srcdir)/expand.pl newcob.tmp @rm -f newcob.tmp newcob.log EXEC85.conf @echo "test:" > $@/Makefile @echo " . ../../atconfig; . ../../atlocal; export PATH; perl $(COB85DIR)/report.pl" >> $@/Makefile @echo " diff $(COB85DIR)/$@.txt report.txt" >> $@/Makefile @echo " . ../../atconfig; . ../../atlocal; export PATH; perl $(COB85DIR)/report.pl -O" >> $@/Makefile @echo " diff $(COB85DIR)/$@.txt report.txt" >> $@/Makefile @echo "done" EXEC85: newcob.val @perl -pe 'BEGIN{<>; <>;} exit if /^\*END/;' newcob.val \ | sed -e 's/XXXXX001.*/"newcob.val" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/XXXXX002.*/"newcob.tmp" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/XXXXX003.*/"unused"./' \ -e 's/XXXXX055.*/"newcob.log"./' \ -e 's/XXXXX058.*/"EXEC85.conf" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/ORGANIZATION SEQUENTIAL.*//' \ > EXEC85.cob . ../atconfig; . ../atlocal; export PATH; $(COBOL) -x EXEC85.cob @rm -f EXEC85.cob open-cobol-1.1/tests/cobol85/Makefile.in0000644000000000000000000002662711130703171013530 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests/cobol85 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ #MODULES = CM DB IC IF IX NC OB RL RW SG SM SQ ST MODULES = NC SM IC SQ RL IX ST SG OB IF EXTRA_DIST = EXEC85.conf.in expand.pl report.pl summary.pl summary.txt \ NC.txt SM.txt IC.txt SQ.txt RL.txt IX.txt ST.txt SG.txt OB.txt IF.txt ifedit.sh CLEANFILES = EXEC85 summary.log COBOL = cobc -std=cobol85 COB85DIR = "`cd $(srcdir) && pwd`" all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/cobol85/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/cobol85/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-info-am test: $(MODULES) @for m in $(MODULES); do \ (cd $$m && make test) \ done perl $(srcdir)/summary.pl $(MODULES) > summary.log test -e $(srcdir)/summary.txt && diff $(srcdir)/summary.txt summary.log save: @for m in $(MODULES); do \ (cp $$m/report.txt $$m.txt) \ done cp summary.log summary.txt diff: @for m in $(MODULES); do \ (diff $$m.txt $$m/report.txt) \ done diff summary.txt summary.log clean-local: rm -rf copy copyalt $(MODULES) $(MODULES): newcob.val EXEC85 $(srcdir)/EXEC85.conf.in @echo -n "Building module $@..." @sed 's/@MODULE@/$@/' $(srcdir)/EXEC85.conf.in > EXEC85.conf @. ../atconfig; . ../atlocal; export PATH; ./EXEC85 @$(srcdir)/ifedit.sh @perl $(srcdir)/expand.pl newcob.tmp @rm -f newcob.tmp newcob.log EXEC85.conf @echo "test:" > $@/Makefile @echo " . ../../atconfig; . ../../atlocal; export PATH; perl $(COB85DIR)/report.pl" >> $@/Makefile @echo " diff $(COB85DIR)/$@.txt report.txt" >> $@/Makefile @echo " . ../../atconfig; . ../../atlocal; export PATH; perl $(COB85DIR)/report.pl -O" >> $@/Makefile @echo " diff $(COB85DIR)/$@.txt report.txt" >> $@/Makefile @echo "done" EXEC85: newcob.val @perl -pe 'BEGIN{<>; <>;} exit if /^\*END/;' newcob.val \ | sed -e 's/XXXXX001.*/"newcob.val" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/XXXXX002.*/"newcob.tmp" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/XXXXX003.*/"unused"./' \ -e 's/XXXXX055.*/"newcob.log"./' \ -e 's/XXXXX058.*/"EXEC85.conf" ORGANIZATION LINE SEQUENTIAL./' \ -e 's/ORGANIZATION SEQUENTIAL.*//' \ > EXEC85.cob . ../atconfig; . ../atlocal; export PATH; $(COBOL) -x EXEC85.cob @rm -f EXEC85.cob # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/tests/cobol85/ifedit.sh0000755000000000000000000000243110737200403013253 mv newcob.tmp newcob.tmp2 sed -e 's/^061200.*IF1194.*/rogerw COMPUTE WS-NUM = FUNCTION MAX (4 0 5 3 7)\./ s/^050300.*IF1204.*/rogerw COMPUTE WS-NUM = FUNCTION MEAN (4 0 5 3 7)\./ s/^050000.*IF1214.*/rogerw COMPUTE WS-NUM = FUNCTION MEDIAN (4 0 5 3 7)\./ s/^052200.*IF1224.*/rogerw COMPUTE WS-NUM = FUNCTION MIDRANGE (4 0 5 3 7)\./ s/^061500.*IF1234.*/rogerw COMPUTE WS-NUM = FUNCTION MIN (4 0 5 3 7)\./ s/^054900.*IF1284.*/rogerw COMPUTE WS-INT = FUNCTION ORD-MAX (4 0 5 3 7)\./ s/^055200.*IF1294.*/rogerw COMPUTE WS-INT = FUNCTION ORD-MIN (4 0 5 3 7)\./ s/^049800.*IF1324.*/rogerw COMPUTE WS-NUM = FUNCTION RANGE (4 0 5 3 7)\./ s/^053100.*IF1374.*/rogerw COMPUTE WS-NUM = FUNCTION STANDARD-DEVIATION (4 0 5 3 7)\./ s/^049800.*IF1384.*/rogerw COMPUTE WS-NUM = FUNCTION SUM (4 0 5 3 7)\./ s/^012250.*IX1104.*/rogerw 01 STATUS-TEST-10 PIC 9 VALUE ZERO\./ s/^000200.*K2SEA4.*/rogerw GO TO PARA-4\./ s/^052500.*IF1414.*/rogerw COMPUTE WS-NUM = FUNCTION VARIANCE (4 0 5 3 7)\./' newcob.tmp rm -f newcob.tmp2 # # Following no longer necessary # s/^065100.*IF1194.*/rogerw COMPUTE WS-NUM = FUNCTION MAX((A * B) ((C + 1) \/ 2) (3 + 4))\./ # s/^065400.*IF1234.*/rogerw COMPUTE WS-NUM = FUNCTION MIN((A * B) ((3 + 1) \/ 2) (3 + 4))\./ open-cobol-1.1/tests/data-rep0000755000000000000000000030607511143001517011630 #! /bin/sh ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Load the config file. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 { (exit 1); exit 1; }; } done # atconfig delivers paths relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir in srcdir top_srcdir top_builddir do at_val=`eval echo '${'at_$at_dir'}'` eval "$at_dir=\$at_val/../.." done fi # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? at_verbose=: at_quiet=echo # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # List test groups? at_list_p=false # Test groups to run at_groups= # The directory we are in. at_dir=`pwd` # The directory the whole suite works in. # Should be absolutely to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite. at_suite_log=$at_dir/$as_me.log # The file containing the location of the last AT_CHECK. at_check_line_file=$at_suite_dir/at-check-line # The file containing the exit status of the last command. at_status_file=$at_suite_dir/at-status # The files containing the output of the tested commands. at_stdout=$at_suite_dir/at-stdout at_stder1=$at_suite_dir/at-stder1 at_stderr=$at_suite_dir/at-stderr # The file containing dates. at_times_file=$at_suite_dir/at-times # List of the tested programs. at_tested='cobc' # List of the all the test groups. at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17' # As many dots as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='..' # Description of all the test groups. at_help_all='1;binary.at:23;BINARY: 2-4-8 big-endian;; 2;binary.at:207;BINARY: 2-4-8 native;; 3;binary.at:396;BINARY: 1-2-4-8 big-endian;; 4;binary.at:580;BINARY: 1-2-4-8 native;; 5;binary.at:770;BINARY: 1--8 big-endian;; 6;binary.at:954;BINARY: 1--8 native;; 7;binary.at:1144;BINARY: full-print;; 8;display.at:22;DISPLAY: Sign ASCII;; 9;display.at:80;DISPLAY: Sign ASCII (2);; 10;display.at:125;DISPLAY: Sign EBCDIC;; 11;packed.at:25;PACKED-DECIMAL dump;; 12;packed.at:160;PACKED-DECIMAL display;; 13;packed.at:207;PACKED-DECIMAL move;; 14;packed.at:256;PACKED-DECIMAL arithmetic (1);; 15;packed.at:291;PACKED-DECIMAL arithmetic (2);; 16;packed.at:324;PACKED-DECIMAL numeric test;; 17;pointer.at:22;POINTER: display;; ' at_keywords= at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) echo "$as_me (OpenCOBOL 1.1)" exit 0 ;; --clean | -c ) rm -rf $at_suite_dir $at_suite_log exit 0 ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=echo; at_quiet=: ;; --trace | -x ) at_traceon='set -vx'; at_traceoff='set +vx' ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_groups="$at_groups$at_option " ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` at_groups="$at_groups$at_range " ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`echo $at_option |sed 's,-.*,,'` at_range_end=`echo $at_option |sed 's,.*-,,'` # FIXME: Maybe test to make sure start <= end? at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_keywords="$at_keywords,$at_optarg" ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $at_envvar" >&2 { (exit 1); exit 1; }; } at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$at_envvar='$at_value'" export $at_envvar # Propagate to debug scripts. at_debug_args="$at_debug_args $at_option" ;; *) echo "$as_me: invalid option: $at_option" >&2 echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Process the --keywords if test -n "$at_keywords"; then at_groups_selected=$at_help_all for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}` do # It is on purpose that we match the test group titles too. at_groups_selected=`echo "$at_groups_selected" | grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"` done at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` # Smash the end of lines. at_groups_selected=`echo $at_groups_selected` at_groups="$at_groups$at_groups_selected " fi # Selected test groups. test -z "$at_groups" && at_groups=$at_groups_all # Help message. if $at_help_p; then cat <<_ATEOF Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, and save a detailed log file. Upon failure, create debugging scripts. You should not change environment variables unless explicitly passed as command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relatively to the top level of this distribution. E.g., $ $0 AUTOTEST_PATH=bin possibly amounts into PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH _ATEOF cat <<_ATEOF Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF Execution tuning: -k, --keywords=KEYWORDS select the tests matching all the comma separated KEYWORDS accumulates -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and debug script creation default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF Report bugs to . _ATEOF exit 0 fi # List of tests. if $at_list_p; then cat <<_ATEOF OpenCOBOL 1.1 test suite: Data Representation test groups: NUM: FILENAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # " 1 42 45 " => "^(1|42|45);". at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` echo "$at_help_all" | awk 'BEGIN { FS = ";" } { if ($1 !~ /^('"$at_groups_pattern"')$/) next } { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3 if ($4) printf " %s\n", $4 } ' exit 0 fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites, AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in [\\/]* | ?:[\\/]* ) at_path=$at_path$PATH_SEPARATOR$as_dir ;; * ) if test -z "$at_top_builddir"; then # Stand-alone test suite. at_path=$at_path$PATH_SEPARATOR$as_dir else # Embedded test suite. at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir fi ;; esac done # Now build and simplify PATH. PATH= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` test -d "$as_dir" || continue case $PATH in $as_dir | \ $as_dir$PATH_SEPARATOR* | \ *$PATH_SEPARATOR$as_dir | \ *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; '') PATH=$as_dir ;; *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; esac done export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. $at_debug_p && at_suite_log=/dev/null exec 5>$at_suite_log # Banners and logs. cat <<\_ASBOX ## ---------------------------------------------- ## ## OpenCOBOL 1.1 test suite: Data Representation. ## ## ---------------------------------------------- ## _ASBOX { cat <<\_ASBOX ## ---------------------------------------------- ## ## OpenCOBOL 1.1 test suite: Data Representation. ## ## ---------------------------------------------- ## _ASBOX echo echo "$as_me: command line was:" echo " $ $0 $at_cli_args" echo # Try to find a few ChangeLogs in case it might help determining the # exact version. Use the relative dir: if the top dir is a symlink, # find will not follow it (and options to follow the links are not # portable), which would result in no output here. if test -n "$at_top_srcdir"; then cat <<\_ASBOX ## ----------- ## ## ChangeLogs. ## ## ----------- ## _ASBOX echo for at_file in `find "$at_top_srcdir" -name ChangeLog -print` do echo "$as_me: $at_file:" sed 's/^/| /;10q' $at_file echo done { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } echo fi # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done cat <<\_ASBOX ## ---------------- ## ## Tested programs. ## ## ---------------- ## _ASBOX echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f $as_dir/$at_program && break done if test -f $as_dir/$at_program; then { echo "data-rep.at:21: $as_dir/$at_program --version" $as_dir/$at_program --version echo } >&5 2>&1 else { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 echo "$as_me: error: cannot find $at_program" >&2;} { (exit 1); exit 1; }; } fi done { cat <<\_ASBOX ## ------------------ ## ## Running the tests. ## ## ------------------ ## _ASBOX } >&5 at_start_date=`date` at_start_time=`(date +%s) 2>/dev/null` echo "$as_me: starting at: $at_start_date" >&5 at_xpass_list= at_xfail_list= at_pass_list= at_fail_list= at_skip_list= at_group_count=0 # Create the master directory if it doesn't already exist. test -d $at_suite_dir || mkdir $at_suite_dir || { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5 echo "$as_me: error: cannot create $at_suite_dir" >&2;} { (exit 1); exit 1; }; } # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull cp /dev/null $at_devnull fi # Use `diff -u' when possible. if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then at_diff='diff -u' else at_diff=diff fi for at_group in $at_groups do # Be sure to come back to the top test directory. cd $at_suite_dir case $at_group in banner-*) at_group_log=$at_suite_log ;; *) # Skip tests we already run (using --keywords makes it easy to get # duplication). case " $at_pass_test $at_skip_test $at_fail_test " in *" $at_group "* ) continue;; esac # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log rm -rf $at_group_dir mkdir $at_group_dir || { { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5 echo "$as_me: error: cannot create $at_group_dir" >&2;} { (exit 1); exit 1; }; } cd $at_group_dir ;; esac echo 0 > $at_status_file # Clearly separate the test groups when verbose. test $at_group_count != 0 && $at_verbose # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log if test $at_verbose = echo; then at_tee_pipe="tee -a $at_group_log" else at_tee_pipe="cat >> $at_group_log" fi case $at_group in 1 ) # 1. binary.at:23: BINARY: 2-4-8 big-endian at_setup_line='binary.at:23' at_desc='BINARY: 2-4-8 big-endian' $at_quiet $ECHO_N " 1: BINARY: 2-4-8 big-endian $ECHO_C" at_xfail=no ( echo "1. binary.at:23: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 2-4-8 binary-byteorder: big-endian _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:44: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:44 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:44: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:48: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:48 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:48: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:158: ./prog" echo binary.at:158 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0001202020202020 000c202020202020 007b202020202020 04d2202020202020 0000303920202020 0001e24020202020 0012d68720202020 00bc614e20202020 075bcd1520202020 00000000499602d2 00000002dfdc1c35 0000001cbe991a14 0000011f71fb04cb 00000b3a73ce2ff2 00007048860ddf79 000462d53c8abac0 002bdc545d6b4b87 01b69b4ba630f34e ffff202020202020 fff4202020202020 ff85202020202020 fb2e202020202020 ffffcfc720202020 fffe1dc020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffffffffb669fd2e fffffffd2023e3cb ffffffe34166e5ec fffffee08e04fb35 fffff4c58c31d00e ffff8fb779f22087 fffb9d2ac3754540 ffd423aba294b479 fe4964b459cf0cb2 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:158: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:162: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:162 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:162: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:200: ./prog" echo binary.at:200 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:200: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 2 ) # 2. binary.at:207: BINARY: 2-4-8 native at_setup_line='binary.at:207' at_desc='BINARY: 2-4-8 native' $at_quiet $ECHO_N " 2: BINARY: 2-4-8 native $ECHO_C" at_xfail=no ( echo "2. binary.at:207: testing ..." $at_traceon if test "x$COB_BIGENDIAN" = "xyes"; then $at_traceoff echo "binary.at:210: true" echo binary.at:210 >$at_check_line_file ( $at_traceon; true ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:210: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon else cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 2-4-8 binary-byteorder: native _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:232: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:232 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:232: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:236: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:236 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:236: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:346: ./prog" echo binary.at:346 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0100202020202020 0c00202020202020 7b00202020202020 d204202020202020 3930000020202020 40e2010020202020 87d6120020202020 4e61bc0020202020 15cd5b0720202020 d202964900000000 351cdcdf02000000 141a99be1c000000 cb04fb711f010000 f22fce733a0b0000 79df0d8648700000 c0ba8a3cd5620400 874b6b5d54dc2b00 4ef330a64b9bb601 ffff202020202020 f4ff202020202020 85ff202020202020 2efb202020202020 c7cfffff20202020 c01dfeff20202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ffffffff cbe32320fdffffff ece56641e3ffffff 35fb048ee0feffff 0ed0318cc5f4ffff 8720f279b78fffff 404575c32a9dfbff 79b494a2ab23d4ff b20ccf59b46449fe 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:346: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:350: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:350 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:350: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:388: ./prog" echo binary.at:388 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:388: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 3 ) # 3. binary.at:396: BINARY: 1-2-4-8 big-endian at_setup_line='binary.at:396' at_desc='BINARY: 1-2-4-8 big-endian' $at_quiet $ECHO_N " 3: BINARY: 1-2-4-8 big-endian $ECHO_C" at_xfail=no ( echo "3. binary.at:396: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 1-2-4-8 binary-byteorder: big-endian _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:417: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:417 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:417: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:421: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:421 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:421: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:531: ./prog" echo binary.at:531 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0120202020202020 0c20202020202020 007b202020202020 04d2202020202020 0000303920202020 0001e24020202020 0012d68720202020 00bc614e20202020 075bcd1520202020 00000000499602d2 00000002dfdc1c35 0000001cbe991a14 0000011f71fb04cb 00000b3a73ce2ff2 00007048860ddf79 000462d53c8abac0 002bdc545d6b4b87 01b69b4ba630f34e ff20202020202020 f420202020202020 ff85202020202020 fb2e202020202020 ffffcfc720202020 fffe1dc020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffffffffb669fd2e fffffffd2023e3cb ffffffe34166e5ec fffffee08e04fb35 fffff4c58c31d00e ffff8fb779f22087 fffb9d2ac3754540 ffd423aba294b479 fe4964b459cf0cb2 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:531: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:535: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:535 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:535: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:573: ./prog" echo binary.at:573 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:573: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 4 ) # 4. binary.at:580: BINARY: 1-2-4-8 native at_setup_line='binary.at:580' at_desc='BINARY: 1-2-4-8 native' $at_quiet $ECHO_N " 4: BINARY: 1-2-4-8 native $ECHO_C" at_xfail=no ( echo "4. binary.at:580: testing ..." $at_traceon if test "x$COB_BIGENDIAN" = "xyes"; then $at_traceoff echo "binary.at:583: true" echo binary.at:583 >$at_check_line_file ( $at_traceon; true ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:583: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon else cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 1-2-4-8 binary-byteorder: native _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:605: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:605 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:605: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:609: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:609 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:609: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:719: ./prog" echo binary.at:719 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0120202020202020 0c20202020202020 7b00202020202020 d204202020202020 3930000020202020 40e2010020202020 87d6120020202020 4e61bc0020202020 15cd5b0720202020 d202964900000000 351cdcdf02000000 141a99be1c000000 cb04fb711f010000 f22fce733a0b0000 79df0d8648700000 c0ba8a3cd5620400 874b6b5d54dc2b00 4ef330a64b9bb601 ff20202020202020 f420202020202020 85ff202020202020 2efb202020202020 c7cfffff20202020 c01dfeff20202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ffffffff cbe32320fdffffff ece56641e3ffffff 35fb048ee0feffff 0ed0318cc5f4ffff 8720f279b78fffff 404575c32a9dfbff 79b494a2ab23d4ff b20ccf59b46449fe 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:719: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:723: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:723 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:723: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:761: ./prog" echo binary.at:761 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:761: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 5 ) # 5. binary.at:770: BINARY: 1--8 big-endian at_setup_line='binary.at:770' at_desc='BINARY: 1--8 big-endian' $at_quiet $ECHO_N " 5: BINARY: 1--8 big-endian $ECHO_C" at_xfail=no ( echo "5. binary.at:770: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 1--8 binary-byteorder: big-endian _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:791: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:791 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:791: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:795: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:795 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:795: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:905: ./prog" echo binary.at:905 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0120202020202020 0c20202020202020 007b202020202020 04d2202020202020 0030392020202020 01e2402020202020 12d6872020202020 00bc614e20202020 075bcd1520202020 00499602d2202020 02dfdc1c35202020 1cbe991a14202020 011f71fb04cb2020 0b3a73ce2ff22020 007048860ddf7920 0462d53c8abac020 002bdc545d6b4b87 01b69b4ba630f34e ff20202020202020 f420202020202020 ff85202020202020 fb2e202020202020 ffcfc72020202020 fe1dc02020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffb669fd2e202020 fd2023e3cb202020 ffe34166e5ec2020 fee08e04fb352020 f4c58c31d00e2020 ff8fb779f2208720 fb9d2ac375454020 ffd423aba294b479 fe4964b459cf0cb2 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:905: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:909: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:909 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:909: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:947: ./prog" echo binary.at:947 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:947: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 6 ) # 6. binary.at:954: BINARY: 1--8 native at_setup_line='binary.at:954' at_desc='BINARY: 1--8 native' $at_quiet $ECHO_N " 6: BINARY: 1--8 native $ECHO_C" at_xfail=no ( echo "6. binary.at:954: testing ..." $at_traceon if test "x$COB_BIGENDIAN" = "xyes"; then $at_traceoff echo "binary.at:957: true" echo binary.at:957 >$at_check_line_file ( $at_traceon; true ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:957: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon else cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 1--8 binary-byteorder: native _ATEOF cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "binary.at:979: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo binary.at:979 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:979: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "binary.at:983: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:983 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:983: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:1093: ./prog" echo binary.at:1093 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0120202020202020 0c20202020202020 7b00202020202020 d204202020202020 3930002020202020 40e2012020202020 87d6122020202020 4e61bc0020202020 15cd5b0720202020 d202964900202020 351cdcdf02202020 141a99be1c202020 cb04fb711f012020 f22fce733a0b2020 79df0d8648700020 c0ba8a3cd5620420 874b6b5d54dc2b00 4ef330a64b9bb601 ff20202020202020 f420202020202020 85ff202020202020 2efb202020202020 c7cfff2020202020 c01dfe2020202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ff202020 cbe32320fd202020 ece56641e3ff2020 35fb048ee0fe2020 0ed0318cc5f42020 8720f279b78fff20 404575c32a9dfb20 79b494a2ab23d4ff b20ccf59b46449fe 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:1093: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:1097: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:1097 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:1097: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:1135: ./prog" echo binary.at:1135 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:1135: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon fi $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 7 ) # 7. binary.at:1144: BINARY: full-print at_setup_line='binary.at:1144' at_desc='BINARY: full-print' $at_quiet $ECHO_N " 7: BINARY: full-print $ECHO_C" at_xfail=no ( echo "7. binary.at:1144: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "cobol2002.conf" binary-size: 1--8 pretty-display: no _ATEOF sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob $at_traceoff echo "binary.at:1154: \${COMPILE} -conf=test.conf -o prog prog.cob" echo binary.at:1154 >$at_check_line_file ( $at_traceon; ${COMPILE} -conf=test.conf -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:1154: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "binary.at:1192: ./prog" echo binary.at:1192 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "001 012 00123 01234 00012345 00123456 01234567 0012345678 0123456789 0001234567890 0012345678901 0123456789012 001234567890123 012345678901234 00123456789012345 01234567890123456 00012345678901234567 00123456789012345678 -001 -012 -00123 -01234 -00012345 -00123456 -0001234567 -0012345678 -0123456789 -0001234567890 -0012345678901 -000123456789012 -001234567890123 -012345678901234 -00123456789012345 -01234567890123456 -00012345678901234567 -00123456789012345678 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "binary.at:1192: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 8 ) # 8. display.at:22: DISPLAY: Sign ASCII at_setup_line='display.at:22' at_desc='DISPLAY: Sign ASCII' $at_quiet $ECHO_N " 8: DISPLAY: Sign ASCII $ECHO_C" at_xfail=no ( echo "8. display.at:22: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(5). 02 X-9 REDEFINES X PIC 9(4). 02 X-S9 REDEFINES X PIC S9(4). 02 X-S9-L REDEFINES X PIC S9(4) LEADING. 02 X-S9-LS REDEFINES X PIC S9(4) LEADING SEPARATE. 02 X-S9-T REDEFINES X PIC S9(4) TRAILING. 02 X-S9-TS REDEFINES X PIC S9(4) TRAILING SEPARATE. PROCEDURE DIVISION. MOVE ZERO TO X. MOVE 1234 TO X-9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-L. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-L. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-LS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-LS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-T. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-T. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-TS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-TS. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "display.at:63: \${COMPILE} -fsign-ascii -o prog prog.cob" echo display.at:63 >$at_check_line_file ( $at_traceon; ${COMPILE} -fsign-ascii -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:63: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "display.at:76: ./prog" echo display.at:76 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "12340 12340 123t0 12340 q2340 +1234 -1234 12340 123t0 1234+ 1234- " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:76: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 9 ) # 9. display.at:80: DISPLAY: Sign ASCII (2) at_setup_line='display.at:80' at_desc='DISPLAY: Sign ASCII (2)' $at_quiet $ECHO_N " 9: DISPLAY: Sign ASCII (2) $ECHO_C" at_xfail=no ( echo "9. display.at:80: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(10). 02 X-S99 REDEFINES X PIC S99. 02 X-S9 REDEFINES X PIC S9 OCCURS 10. PROCEDURE DIVISION. MOVE 0 TO X-S9(1). MOVE 1 TO X-S9(2). MOVE 2 TO X-S9(3). MOVE 3 TO X-S9(4). MOVE 4 TO X-S9(5). MOVE 5 TO X-S9(6). MOVE 6 TO X-S9(7). MOVE 7 TO X-S9(8). MOVE 8 TO X-S9(9). MOVE 9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. MOVE -10 TO X-S99. MOVE X(2:1) TO X(1:1). MOVE -1 TO X-S9(2). MOVE -2 TO X-S9(3). MOVE -3 TO X-S9(4). MOVE -4 TO X-S9(5). MOVE -5 TO X-S9(6). MOVE -6 TO X-S9(7). MOVE -7 TO X-S9(8). MOVE -8 TO X-S9(9). MOVE -9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "display.at:119: \${COMPILE} -fsign-ascii -o prog prog.cob" echo display.at:119 >$at_check_line_file ( $at_traceon; ${COMPILE} -fsign-ascii -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:119: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "display.at:120: ./prog" echo display.at:120 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "0123456789pqrstuvwxy" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:120: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 10 ) # 10. display.at:125: DISPLAY: Sign EBCDIC at_setup_line='display.at:125' at_desc='DISPLAY: Sign EBCDIC' $at_quiet $ECHO_N " 10: DISPLAY: Sign EBCDIC $ECHO_C" at_xfail=no ( echo "10. display.at:125: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(10). 02 X-S99 REDEFINES X PIC S99. 02 X-S9 REDEFINES X PIC S9 OCCURS 10. PROCEDURE DIVISION. MOVE 0 TO X-S9(1). MOVE 1 TO X-S9(2). MOVE 2 TO X-S9(3). MOVE 3 TO X-S9(4). MOVE 4 TO X-S9(5). MOVE 5 TO X-S9(6). MOVE 6 TO X-S9(7). MOVE 7 TO X-S9(8). MOVE 8 TO X-S9(9). MOVE 9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. MOVE -10 TO X-S99. MOVE X(2:1) TO X(1:1). MOVE -1 TO X-S9(2). MOVE -2 TO X-S9(3). MOVE -3 TO X-S9(4). MOVE -4 TO X-S9(5). MOVE -5 TO X-S9(6). MOVE -6 TO X-S9(7). MOVE -7 TO X-S9(8). MOVE -8 TO X-S9(9). MOVE -9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "display.at:164: \${COMPILE} -fsign-ebcdic -o prog prog.cob" echo display.at:164 >$at_check_line_file ( $at_traceon; ${COMPILE} -fsign-ebcdic -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:164: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "display.at:165: ./prog" echo display.at:165 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "{ABCDEFGHI}JKLMNOPQR" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "display.at:165: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 11 ) # 11. packed.at:25: PACKED-DECIMAL dump at_setup_line='packed.at:25' at_desc='PACKED-DECIMAL dump' $at_quiet $ECHO_N " 11: PACKED-DECIMAL dump $ECHO_C" at_xfail=no ( echo "11. packed.at:25: testing ..." $at_traceon cat >dump.c <<'_ATEOF' #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 10; i++) printf ("%02x", data[i]); puts (""); return 0; } _ATEOF $at_traceoff echo "packed.at:40: \${CC} \${SHROPT} -o dump.\${SHREXT} dump.c" echo packed.at:40 >$at_check_line_file ( $at_traceon; ${CC} ${SHROPT} -o dump.${SHREXT} dump.c ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:40: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon sed -e 's/@USAGE@/PACKED-DECIMAL/' ${TEMPLATE}/numeric-dump.cob > prog.cob $at_traceoff echo "packed.at:44: \${COMPILE} prog.cob" echo packed.at:44 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:44: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:154: ./prog" echo packed.at:154 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "1f202020202020202020 012f2020202020202020 123f2020202020202020 01234f20202020202020 12345f20202020202020 0123456f202020202020 1234567f202020202020 012345678f2020202020 123456789f2020202020 01234567890f20202020 12345678901f20202020 0123456789012f202020 1234567890123f202020 012345678901234f2020 123456789012345f2020 01234567890123456f20 12345678901234567f20 0123456789012345678f 1d202020202020202020 012d2020202020202020 123d2020202020202020 01234d20202020202020 12345d20202020202020 0123456d202020202020 1234567d202020202020 012345678d2020202020 123456789d2020202020 01234567890d20202020 12345678901d20202020 0123456789012d202020 1234567890123d202020 012345678901234d2020 123456789012345d2020 01234567890123456d20 12345678901234567d20 0123456789012345678d 0f202020202020202020 000f2020202020202020 000f2020202020202020 00000f20202020202020 00000f20202020202020 0000000f202020202020 0000000f202020202020 000000000f2020202020 000000000f2020202020 00000000000f20202020 00000000000f20202020 0000000000000f202020 0000000000000f202020 000000000000000f2020 000000000000000f2020 00000000000000000f20 00000000000000000f20 0000000000000000000f 0c202020202020202020 000c2020202020202020 000c2020202020202020 00000c20202020202020 00000c20202020202020 0000000c202020202020 0000000c202020202020 000000000c2020202020 000000000c2020202020 00000000000c20202020 00000000000c20202020 0000000000000c202020 0000000000000c202020 000000000000000c2020 000000000000000c2020 00000000000000000c20 00000000000000000c20 0000000000000000000c 0f202020202020202020 000f2020202020202020 000f2020202020202020 00000f20202020202020 00000f20202020202020 0000000f202020202020 0000000f202020202020 000000000f2020202020 000000000f2020202020 00000000000f20202020 00000000000f20202020 0000000000000f202020 0000000000000f202020 000000000000000f2020 000000000000000f2020 00000000000000000f20 00000000000000000f20 0000000000000000000f 0c202020202020202020 000c2020202020202020 000c2020202020202020 00000c20202020202020 00000c20202020202020 0000000c202020202020 0000000c202020202020 000000000c2020202020 000000000c2020202020 00000000000c20202020 00000000000c20202020 0000000000000c202020 0000000000000c202020 000000000000000c2020 000000000000000c2020 00000000000000000c20 00000000000000000c20 0000000000000000000c " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:154: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 12 ) # 12. packed.at:160: PACKED-DECIMAL display at_setup_line='packed.at:160' at_desc='PACKED-DECIMAL display' $at_quiet $ECHO_N " 12: PACKED-DECIMAL display $ECHO_C" at_xfail=no ( echo "12. packed.at:160: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. MOVE 0 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE 99 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE 0 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE -1 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE 0 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE 123 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE 0 TO X-S999. DISPLAY X-S999 END-DISPLAY. MOVE -123 TO X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "packed.at:191: \${COMPILE} prog.cob" echo packed.at:191 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:191: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:201: ./prog" echo packed.at:201 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00 99 +00 -01 000 123 +000 -123 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:201: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 13 ) # 13. packed.at:207: PACKED-DECIMAL move at_setup_line='packed.at:207' at_desc='PACKED-DECIMAL move' $at_quiet $ECHO_N " 13: PACKED-DECIMAL move $ECHO_C" at_xfail=no ( echo "13. packed.at:207: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. 01 C-P1234 PIC 9999 VALUE 1234. 01 C-N1234 PIC S9999 VALUE -1234. PROCEDURE DIVISION. MOVE C-P1234 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE C-P1234 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE C-P1234 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE C-P1234 TO X-S999. DISPLAY X-S999 END-DISPLAY. MOVE C-N1234 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE C-N1234 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE C-N1234 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE C-N1234 TO X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "packed.at:240: \${COMPILE} prog.cob" echo packed.at:240 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:240: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:250: ./prog" echo packed.at:250 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "34 +34 234 +234 34 -34 234 -234 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:250: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 14 ) # 14. packed.at:256: PACKED-DECIMAL arithmetic (1) at_setup_line='packed.at:256' at_desc='PACKED-DECIMAL arithmetic (1)' $at_quiet $ECHO_N " 14: PACKED-DECIMAL arithmetic (1) $ECHO_C" at_xfail=no ( echo "14. packed.at:256: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. INITIALIZE X-99. DISPLAY X-99 END-DISPLAY. INITIALIZE X-S99. DISPLAY X-S99 END-DISPLAY. INITIALIZE X-999. DISPLAY X-999 END-DISPLAY. INITIALIZE X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "packed.at:279: \${COMPILE} prog.cob" echo packed.at:279 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:279: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:285: ./prog" echo packed.at:285 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "00 +00 000 +000 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:285: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 15 ) # 15. packed.at:291: PACKED-DECIMAL arithmetic (2) at_setup_line='packed.at:291' at_desc='PACKED-DECIMAL arithmetic (2)' $at_quiet $ECHO_N " 15: PACKED-DECIMAL arithmetic (2) $ECHO_C" at_xfail=no ( echo "15. packed.at:291: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99 USAGE PACKED-DECIMAL VALUE 0. 01 Y PIC 99 USAGE PACKED-DECIMAL VALUE 9. PROCEDURE DIVISION. COMPUTE X = 1 END-COMPUTE. DISPLAY X END-DISPLAY. COMPUTE X = Y END-COMPUTE. DISPLAY X END-DISPLAY. COMPUTE X = X + Y END-COMPUTE. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "packed.at:313: \${COMPILE} prog.cob" echo packed.at:313 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:313: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:318: ./prog" echo packed.at:318 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "01 09 18 " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:318: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 16 ) # 16. packed.at:324: PACKED-DECIMAL numeric test at_setup_line='packed.at:324' at_desc='PACKED-DECIMAL numeric test' $at_quiet $ECHO_N " 16: PACKED-DECIMAL numeric test $ECHO_C" at_xfail=no ( echo "16. packed.at:324: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X-2 PIC X(2). 02 N-2 REDEFINES X-2 PIC 99 USAGE PACKED-DECIMAL. 02 N-S2 REDEFINES X-2 PIC S99 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. MOVE X"0000" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. MOVE X"000c" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"000d" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"000f" TO X-2. IF N-2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"1234" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. MOVE X"999f" TO X-2. IF N-2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"ffff" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "packed.at:444: \${COMPILE} prog.cob" echo packed.at:444 >$at_check_line_file ( $at_traceon; ${COMPILE} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:444: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "packed.at:460: ./prog" echo packed.at:460 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK OK OK OK OK OK OK OK OK OK OK OK OK OK " | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "packed.at:460: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 17 ) # 17. pointer.at:22: POINTER: display at_setup_line='pointer.at:22' at_desc='POINTER: display' $at_quiet $ECHO_N " 17: POINTER: display $ECHO_C" at_xfail=no ( echo "17. pointer.at:22: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 PTR USAGE POINTER VALUE NULL. PROCEDURE DIVISION. DISPLAY PTR END-DISPLAY. SET PTR UP BY 1 DISPLAY PTR END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "pointer.at:39: \${COMPILE} -o prog prog.cob" echo pointer.at:39 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pointer.at:39: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "pointer.at:40: ./prog" echo pointer.at:40 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo stdout:; cat $at_stdout case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "pointer.at:40: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; * ) echo "$as_me: no such test group: $at_group" >&2 continue ;; esac # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd $at_suite_dir case $at_group in banner-*) ;; *) if test ! -f $at_check_line_file; then sed "s/^ */$as_me: warning: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF echo "$at_setup_line" >$at_check_line_file fi at_group_count=`expr 1 + $at_group_count` $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> $at_group_log case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_xpass_list="$at_xpass_list $at_group" at_errexit=$at_errexit_p ;; no:0) at_msg="ok" at_pass_list="$at_pass_list $at_group" at_errexit=false ;; *:77) at_msg="skipped (`cat $at_check_line_file`)" at_skip_list="$at_skip_list $at_group" at_errexit=false ;; yes:*) at_msg="expected failure (`cat $at_check_line_file`)" at_xfail_list="$at_xfail_list $at_group" at_errexit=false ;; no:*) at_msg="FAILED (`cat $at_check_line_file`)" at_fail_list="$at_fail_list $at_group" at_errexit=$at_errexit_p ;; esac echo $at_msg at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f $at_times_file; then at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" rm -f $at_times_file fi echo "$at_log_msg" >> $at_group_log echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files. $at_debug_p || rm -rf $at_group_dir ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. echo "$at_log_msg" >> $at_group_log # Upon failure, keep the group directory for autopsy, and # create the debugging script. { echo "#! /bin/sh" echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' echo "cd $at_dir" echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' echo 'exit 1' } >$at_group_dir/run chmod +x $at_group_dir/run $at_errexit && break ;; esac ;; esac done # Back to the top directory. cd $at_dir # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`(date +%s) 2>/dev/null` echo "$as_me: ending at: $at_stop_date" >&5 at_duration_s=`(expr $at_stop_time - $at_start_time) 2>/dev/null` at_duration_m=`(expr $at_duration_s / 60) 2>/dev/null` at_duration_h=`(expr $at_duration_m / 60) 2>/dev/null` at_duration_s=`(expr $at_duration_s % 60) 2>/dev/null` at_duration_m=`(expr $at_duration_m % 60) 2>/dev/null` at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" if test "$at_duration" != "h m s"; then echo "$as_me: test suite duration: $at_duration" >&5 fi # Wrap up the test suite with summary statistics. at_skip_count=`set dummy $at_skip_list; shift; echo $#` at_fail_count=`set dummy $at_fail_list; shift; echo $#` at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` at_run_count=`expr $at_group_count - $at_skip_count` at_unexpected_count=`expr $at_xpass_count + $at_fail_count` at_total_fail_count=`expr $at_xfail_count + $at_fail_count` echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo { echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." else # Don't you just love exponential explosion of the number of cases? case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." ;; 0:0:*) at_result="$at_result behaved as expected." ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_result" echo "$at_result" >&5 else echo "ERROR: $at_result" >&2 echo "ERROR: $at_result" >&5 { echo cat <<\_ASBOX ## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ## _ASBOX # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL $0 $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL $0 $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL $0 $at_xpass_list --list echo fi if test $at_fail_count != 0; then cat <<\_ASBOX ## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ## _ASBOX echo for at_group in $at_fail_list do # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log cat $at_group_log echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $at_top_builddir/config.log ## _ASBOX sed 's/^/| /' $at_top_builddir/config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo echo "Please send \`$as_me.log' and all information you think might help:" echo echo " To: " echo " Subject: [OpenCOBOL 1.1] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" echo if test $at_debug_p = false; then echo echo 'You may investigate any problem if you feel able to do so, in which' echo 'case the test suite provides a good starting point.' echo fi exit 1 fi exit 0 open-cobol-1.1/tests/run-O0000755000000000000000000000016010261563034011124 #!/bin/sh echo echo "## Run time tests with -O option ##" echo . ./atconfig COBOL_FLAGS='-O' ${abs_srcdir}/run open-cobol-1.1/tests/syntax.src/0000777000000000000000000000000011143001517012372 5open-cobol-1.1/tests/syntax.src/multiply.at0000644000000000000000000000761211130701401014514 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 14.8.25 MULTIPLY statement ## 14.8.25.2 Syntax rules # 1) DONE AT_SETUP([Category check of Format 1]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC X. 01 X-9 PIC 9. 01 X-09 PIC 09. PROCEDURE DIVISION. MULTIPLY 123 BY 456 END-MULTIPLY. MULTIPLY "a" BY "b" END-MULTIPLY. MULTIPLY X-X BY X-9 END-MULTIPLY. MULTIPLY X-9 BY X-09 END-MULTIPLY. MULTIPLY X-09 BY X-X END-MULTIPLY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: '456' is not a numeric name prog.cob:12: Error: '"a"' is not a numeric value prog.cob:12: Error: '"b"' is not a numeric name prog.cob:14: Error: 'X-X' is not a numeric value prog.cob:16: Error: 'X-09' is not a numeric name prog.cob:18: Error: 'X-09' is not a numeric value prog.cob:18: Error: 'X-X' is not a numeric name ]) AT_CLEANUP # 2) DONE AT_SETUP([Category check of Format 2]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC X. 01 X-9 PIC 9. 01 X-09 PIC 09. PROCEDURE DIVISION. MULTIPLY 123 BY 456 GIVING 789 END-MULTIPLY. MULTIPLY "a" BY "b" GIVING "c" END-MULTIPLY. MULTIPLY X-X BY X-9 GIVING X-09 END-MULTIPLY. MULTIPLY X-9 BY X-09 GIVING X-X END-MULTIPLY. MULTIPLY X-09 BY X-X GIVING X-9 END-MULTIPLY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: '789' is not numeric or numeric-edited name prog.cob:12: Error: '"a"' is not a numeric value prog.cob:12: Error: '"b"' is not a numeric value prog.cob:12: Error: '"c"' is not numeric or numeric-edited name prog.cob:14: Error: 'X-X' is not a numeric value prog.cob:16: Error: 'X-09' is not a numeric value prog.cob:16: Error: 'X-X' is not numeric or numeric-edited name prog.cob:18: Error: 'X-09' is not a numeric value prog.cob:18: Error: 'X-X' is not a numeric value ]) AT_CLEANUP # 3) DONE AT_SETUP([Category check of literals]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. PROCEDURE DIVISION. MULTIPLY 123 BY X END-MULTIPLY. MULTIPLY "a" BY X END-MULTIPLY. MULTIPLY 123 BY 456 GIVING X END-MULTIPLY. MULTIPLY "a" BY "b" GIVING X END-MULTIPLY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: '"a"' is not a numeric value prog.cob:14: Error: '"a"' is not a numeric value prog.cob:14: Error: '"b"' is not a numeric value ]) AT_CLEANUP # 4) TODO open-cobol-1.1/tests/syntax.src/copy.at0000644000000000000000000000751511130701401013611 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2004-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_SETUP([COPY: file not found]) AT_KEYWORDS([copy]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: copy.inc: No such file or directory ]) AT_CLEANUP AT_SETUP([COPY: replacement order]) AT_KEYWORDS([copy]) AT_DATA([copy.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==TEST-VAR== BY ==FIRST-MATCH== ==TEST-VAR== BY ==SECOND-MATCH==. PROCEDURE DIVISION. DISPLAY FIRST-MATCH NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([COPY: separators]) AT_KEYWORDS([copy]) AT_DATA([copy.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==TEST-VAR==, BY ==FIRST-MATCH==, , ==TEST-VAR==; BY ==SECOND-MATCH==; ; ==TEST-VAR== , BY ==THIRD-MATCH== ==TEST-VAR== ; BY ==FOURTH-MATCH==. PROCEDURE DIVISION. DISPLAY FIRST-MATCH NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([COPY: partial replacement]) AT_KEYWORDS([copy]) AT_DATA([copy.inc], [ 01 :TEST:-VAR PIC X(2) VALUE "OK". 01 (TEST)-VAR PIC X(2) VALUE "OK". ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==:TEST:== BY ==COLON== ==(TEST)== BY ==PAREN==. PROCEDURE DIVISION. DISPLAY COLON-VAR NO ADVANCING END-DISPLAY. DISPLAY PAREN-VAR NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OKOK]) AT_CLEANUP AT_SETUP([COPY: recursive replacement]) AT_KEYWORDS([copy]) AT_DATA([copy-2.inc], [ 01 TEST-VAR PIC X(2) VALUE "OK". ]) AT_DATA([copy-1.inc], [ COPY "copy-2.inc". ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy-1.inc" REPLACING ==TEST-VAR== BY ==COPY-VAR==. PROCEDURE DIVISION. DISPLAY COPY-VAR NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP open-cobol-1.1/tests/syntax.src/definition.at0000644000000000000000000002724011140315525014775 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ### Invalid PROGRAM-ID ### AT_SETUP([Invalid PROGRAM-ID]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. short. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:3: Error: PROGRAM-ID 'short' invalid ]) AT_CLEANUP AT_SETUP([Invalid PROGRAM-ID type clause (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog IS COMMON. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:3: Error: COMMON may only be used in a nested program ]) AT_CLEANUP AT_SETUP([Invalid PROGRAM-ID type clause (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog IS INITIAL RECURSIVE. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:3: Error: syntax error, unexpected RECURSIVE, expecting '.' ]) AT_CLEANUP ### ### Data name ### ## Undefined AT_SETUP([Undefined data name]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:5: Error: 'X' undefined ]) AT_CLEANUP AT_SETUP([Undefined group name]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. DISPLAY X IN G END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: 'X' in 'G' undefined ]) AT_CLEANUP AT_SETUP([Undefined data name in group]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 01 Y PIC X. PROCEDURE DIVISION. DISPLAY Y IN G END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'Y' in 'G' undefined ]) AT_CLEANUP AT_SETUP([Reference not a group name]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. DISPLAY X IN X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: 'X' in 'X' undefined ]) AT_CLEANUP ## Incomplete AT_SETUP([Incomplete 01 definition]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: PICTURE clause required for 'X' ]) AT_CLEANUP ## Same labels in different sections AT_SETUP([Same labels in different sections]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. S-1 SECTION. L. S-2 SECTION. L. S-3 SECTION. GO TO L. L. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP ## Redefinition AT_SETUP([Redefinition of 01 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of 01 and 02 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X. 02 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of 02 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 02 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:8: Warning: Redefinition of 'X' prog.cob:7: Warning: 'X' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of 77 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 77 X PIC X. 77 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of 01 and 77 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 77 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of 88 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 88 A VALUE "A". 88 A VALUE "B". ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:8: Warning: Redefinition of 'A' prog.cob:7: Warning: 'A' previously defined here ]) AT_CLEANUP AT_SETUP([Ambiguous reference to 02 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 01 G2. 02 X PIC X. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:11: Error: 'X' ambiguous; need qualification prog.cob:7: Error: 'X' in 'G1' defined here prog.cob:9: Error: 'X' in 'G2' defined here ]) AT_CLEANUP AT_SETUP([Ambiguous reference to 02 and 03 items]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X. 03 X PIC X. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'X' ambiguous; need qualification prog.cob:7: Error: 'X' in 'G' defined here prog.cob:8: Error: 'X' in 'X' in 'G' defined here ]) AT_CLEANUP AT_SETUP([Ambiguous reference with qualification]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X. 03 Y PIC X. 01 G2. 02 X. 03 Y PIC X. PROCEDURE DIVISION. DISPLAY Y OF X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:13: Error: 'Y' in 'X' ambiguous; need qualification prog.cob:8: Error: 'Y' in 'X' in 'G1' defined here prog.cob:11: Error: 'Y' in 'X' in 'G2' defined here ]) AT_CLEANUP AT_SETUP([Unique reference with ambiguous qualifiers]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X. 03 Y PIC X VALUE "Y". 01 G2. 02 X. 03 Z PIC X VALUE "Z". PROCEDURE DIVISION. DISPLAY Z OF X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP ### ### File name ### ### ### Label name ### ## Undefined AT_SETUP([Undefined procedure name]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. GO TO END-OF-PROGRAM. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:5: Error: 'END-OF-PROGRAM' undefined ]) AT_CLEANUP ## Redefinition AT_SETUP([Redefinition of section names]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L SECTION. L SECTION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob: In section 'L': prog.cob:6: Error: Redefinition of 'L' prog.cob:5: Error: 'L' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of section and paragraph names]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L SECTION. L. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob: In section 'L': prog.cob:6: Error: Redefinition of 'L' prog.cob:5: Error: 'L' previously defined here ]) AT_CLEANUP AT_SETUP([Redefinition of paragraph names]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L. L. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , []) ## Change when we DON'T allow this ## AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , ## [prog.cob: In paragraph 'L': ## prog.cob:6: Error: redefinition of 'L' ## prog.cob:5: Error: 'L' previously defined here ## ]) AT_CLEANUP AT_SETUP([Ambiguous reference to paragraph name]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. S-1 SECTION. L. S-2 SECTION. L. S-3 SECTION. GO TO L. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob: In section 'S-3': prog.cob:10: Error: 'L' ambiguous; need qualification prog.cob:6: Error: 'L' in 'S-1' defined here prog.cob:8: Error: 'L' in 'S-2' defined here ]) AT_CLEANUP AT_SETUP([Non-matching level numbers (extension)]) AT_DATA([test.conf], [ include "default.conf" relax-level-hierarchy: yes ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 A. 05 B. 10 C PIC X. 04 D. 05 E PIC X. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} -conf=test.conf prog.cob], [0], , [prog.cob:9: Warning: No previous data item of level 04 ]) AT_CLEANUP ### ### Special name ### open-cobol-1.1/tests/syntax.src/redefines.at0000644000000000000000000002327311130701401014602 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 13.16.42 REDEFINES clause ## 13.16.42.2 Syntax rules # 1) DONE AT_SETUP([REDEFINES: not following entry-name]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC 9 REDEFINES X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:7: Error: REDEFINES clause must follow entry-name ]) AT_CLEANUP # 2) DONE AT_SETUP([REDEFINES: level 02 by 01]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 01 Y REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: Level number of REDEFINES entries must be identical ]) AT_CLEANUP AT_SETUP([REDEFINES: level 03 by 02]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2. 03 X PIC X. 02 Y REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:9: Error: 'X' undefined in 'G1' ]) AT_CLEANUP AT_SETUP([REDEFINES: level 66]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 66 A RENAMES X. 66 B REDEFINES A PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:9: Error: Level number of REDEFINES entry cannot be 66 or 88 ]) AT_CLEANUP AT_SETUP([REDEFINES: level 88]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 88 A VALUE "A". 88 B REDEFINES A VALUE "B". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: Level number of REDEFINES entry cannot be 66 or 88 ]) AT_CLEANUP # 3) TODO # 4) TODO # 5) DONE AT_SETUP([REDEFINES: lower level number]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2. 03 X PIC X. 02 G3. 03 A REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'X' undefined in 'G3' ]) AT_CLEANUP # 6) DONE AT_SETUP([REDEFINES: with OCCURS]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 2. 02 Y REDEFINES X PIC XX. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:8: Warning: The original definition 'X' should not have OCCURS ]) AT_CLEANUP AT_SETUP([REDEFINES: with subscript]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X PIC X. 03 Y REDEFINES X(1) PIC X. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:9: Error: 'X' cannot be subscripted here ]) AT_CLEANUP AT_SETUP([REDEFINES: with variable occurrence]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC XX. 02 Y REDEFINES X PIC X OCCURS 1 TO 2 DEPENDING ON I. 01 G2. 02 X PIC XX. 02 Y REDEFINES X. 03 A PIC X OCCURS 1 TO 2 DEPENDING ON I. 01 G3. 02 X. 03 A PIC X OCCURS 1 TO 2 DEPENDING ON I. 02 Y REDEFINES X PIC X. 01 I PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: 'Y' cannot be variable length prog.cob:11: Error: 'Y' cannot be variable length prog.cob:16: Error: The original definition 'X' cannot be variable length ]) AT_CLEANUP # 7) DONE AT_SETUP([REDEFINES: with qualification]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 01 G2. 02 X PIC X. 02 A REDEFINES X IN G1. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'X' cannot be qualified here ]) AT_CLEANUP # 8) DONE AT_SETUP([REDEFINES: multiple redefinition]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 A REDEFINES X PIC 9. 02 B REDEFINES X PIC 9. 02 C REDEFINES B PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'B' not the original definition ]) AT_CHECK([${COMPILE_ONLY} -std=mvs prog.cob], [0]) AT_CLEANUP # 9) DONE AT_SETUP([REDEFINES: size exceeds]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 A REDEFINES X PIC 99. 01 G2. 02 X PIC X. 02 A REDEFINES X PIC 9 OCCURS 2. 01 WRK-X PIC X. 01 WRK-X-REDEF REDEFINES WRK-X PIC 99. 01 EXT-X PIC X EXTERNAL. 01 EXT-X-REDEF REDEFINES EXT-X PIC 99. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: Size of 'A' larger than size of 'X' prog.cob:11: Error: Size of 'A' larger than size of 'X' prog.cob:15: Error: Size of 'EXT-X-REDEF' larger than size of 'EXT-X' ]) AT_CLEANUP # 10) DONE AT_SETUP([REDEFINES: with VALUE]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 A REDEFINES X PIC X VALUE "A". 01 G REDEFINES X. 02 B PIC X VALUE "A". 01 Y REDEFINES X PIC X. 88 C VALUE "A". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:7: Error: Entries under REDEFINES cannot have VALUE clause prog.cob:9: Error: Entries under REDEFINES cannot have VALUE clause ]) AT_CLEANUP # 11) DONE AT_SETUP([REDEFINES: with intervention]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC X. 01 A REDEFINES X PIC X. 01 G. 02 G-X PIC X. 02 G-Y PIC X. 02 G-A REDEFINES G-X PIC X. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: REDEFINES must follow the original definition prog.cob:12: Error: REDEFINES must follow the original definition ]) AT_CLEANUP # 12) DONE AT_SETUP([REDEFINES: within REDEFINES]) AT_KEYWORDS([redefines]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 G REDEFINES X. 02 A PIC X. 02 B REDEFINES A PIC 9. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP # 13) TODO # 14) TODO # 15) TODO # 16) TODO open-cobol-1.1/tests/syntax.src/expression.at0000644000000000000000000000417111130701401015031 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2004-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_SETUP([Ambiguous AND/OR]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. IF 3 = 1 AND 2 OR 3 DISPLAY "OK" END-DISPLAY END-IF. IF 3 = 1 OR 2 AND 3 DISPLAY "NO" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:6: Warning: Suggest parentheses around AND within OR prog.cob:10: Warning: Suggest parentheses around AND within OR ]) AT_CLEANUP AT_SETUP([START on SEQUENTIAL file]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN INPUT TEST-FILE. START TEST-FILE KEY EQUAL TEST-REC END-START. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:16: Error: START not allowed on SEQUENTIAL files ]) AT_CLEANUP open-cobol-1.1/tests/syntax.src/subscripts.at0000644000000000000000000000461411130701401015035 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 8.4.1.2 Subscripts ## 8.4.1.2.2 Syntax rules # 1) DONE # 2) DONE AT_SETUP([Subscripted item requires OCCURS clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. PROCEDURE DIVISION. DISPLAY G(1) END-DISPLAY. DISPLAY X(1) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:9: Error: 'G' cannot be subscripted prog.cob:11: Error: 'X' cannot be subscripted ]) AT_CLEANUP # 3) DONE AT_SETUP([The number of subscripts]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X OCCURS 2. 03 Y PIC X OCCURS 3. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. DISPLAY X(1) END-DISPLAY. DISPLAY X(1, 2) END-DISPLAY. DISPLAY Y(1) END-DISPLAY. DISPLAY Y(1, 2) END-DISPLAY. DISPLAY Y(1, 2, 3) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'X' requires 1 subscript prog.cob:14: Error: 'X' requires 1 subscript prog.cob:16: Error: 'Y' requires 2 subscripts prog.cob:20: Error: 'Y' requires 2 subscripts ]) AT_CLEANUP # 4) TODO # 5) TODO # 6) TODO # 7) TODO # 8) TODO open-cobol-1.1/tests/syntax.src/occurs.at0000644000000000000000000001037411130701401014132 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 13.16.36 OCCURS clause ## 13.16.36.2 Syntax rules # 1) DONE AT_SETUP([OCCURS with level 01, 66, 77, and 88]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-01 PIC X OCCURS 10. 01 G OCCURS 10. 02 X-02 PIC X OCCURS 10. 66 X-66 RENAMES X-02 OCCURS 10. 77 X-77 PIC X OCCURS 10. 88 X-88 VALUE "X" OCCURS 10. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:11: Error: Level 88 item 'X-88' cannot have other than VALUE clause prog.cob:6: Error: Level 01 item 'X-01' cannot have OCCURS clause prog.cob:7: Error: Level 01 item 'G' cannot have OCCURS clause prog.cob:9: Error: Level 66 item 'X-66' cannot have other than RENAMES clause prog.cob:10: Error: Level 77 item 'X-77' cannot have OCCURS clause ]) AT_CLEANUP AT_SETUP([OCCURS with variable-occurrence data item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 G-2 OCCURS 10. 03 X PIC X(10) OCCURS 1 TO 4 DEPENDING ON I. 77 I PIC 9. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:7: Error: 'G-2' cannot have the OCCURS clause due to 'X' ]) AT_CLEANUP # 2) TODO # 3) TODO # 4) TODO # 5) TODO # 6) TODO # 7) TODO # 8) TODO # 9) DONE AT_SETUP([Nested OCCURS clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 G-2 OCCURS 2. 03 G-3 OCCURS 2. 04 G-4 OCCURS 2. 05 G-5 OCCURS 2. 06 G-6 OCCURS 2. 07 G-7 OCCURS 2. 08 G-8 OCCURS 2. 09 X PIC X. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP # 10) TODO # 11) TODO # 12) TODO # 13) TODO # 14) TODO # 15) TODO # 16) TODO # 17) TODO # 18) TODO # 19) TODO # 20) DONE AT_SETUP([OCCURS DEPENDING followed by another field]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 Y PIC X. 01 G-2. 02 G-3 OCCURS 1 TO 3 DEPENDING ON I. 03 X PIC X. 02 Y PIC X. 01 G-4. 02 G-5. 03 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 Y PIC X. 01 I PIC 9. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:7: Error: 'X' cannot have OCCURS DEPENDING prog.cob:10: Error: 'G-3' cannot have OCCURS DEPENDING prog.cob:15: Error: 'X' cannot have OCCURS DEPENDING ]) AT_CLEANUP # 21) TODO # 22) TODO # 23) TODO # 24) TODO AT_SETUP([OCCURS DEPENDING without TO clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC 9. 01 XX. 03 X PIC X OCCURS 10 DEPENDING ON Y. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: ODO without TO clause does not conform to COBOL 2002 ]) AT_CLEANUP open-cobol-1.1/tests/syntax.src/move.at0000644000000000000000000001634011130701401013601 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 14.8.24 MOVE statement ## 14.8.24.2 Syntax rules # 1) TODO # 2) TODO # 3) DONE # 4) DONE # 5) DONE AT_SETUP([MOVE SPACE TO numeric or numeric-edited item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. 01 Y PIC 09. PROCEDURE DIVISION. MOVE SPACE TO X. MOVE SPACE TO Y. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:9: Error: Invalid MOVE statement prog.cob:10: Error: Invalid MOVE statement ]) AT_CLEANUP # 6) DONE AT_SETUP([MOVE ZERO TO alphabetic item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC A. PROCEDURE DIVISION. MOVE ZERO TO A. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: Invalid MOVE statement ]) AT_CLEANUP # 7) TODO # 8) TODO AT_SETUP([MOVE alphabetic TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC A. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:16: Error: Invalid MOVE statement prog.cob:17: Error: Invalid MOVE statement ]) AT_CLEANUP AT_SETUP([MOVE alphanumeric TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP AT_SETUP([MOVE alphanumeric-edited TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC BX. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:16: Error: Invalid MOVE statement prog.cob:17: Error: Invalid MOVE statement ]) AT_CLEANUP AT_SETUP([MOVE numeric (integer) TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:13: Error: Invalid MOVE statement ]) AT_CLEANUP AT_SETUP([MOVE numeric (non-integer) TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9V9. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:13: Error: Invalid MOVE statement prog.cob:14: Error: Invalid MOVE statement prog.cob:15: Error: Invalid MOVE statement ]) AT_CLEANUP AT_SETUP([MOVE numeric-edited TO x]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 09. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:13: Error: Invalid MOVE statement ]) AT_CLEANUP # 9) DONE # 10) DONE AT_SETUP([Operands must be groups]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 X PIC X. 01 G-2. 02 Y PIC X. PROCEDURE DIVISION. MOVE CORR X TO G-1. MOVE CORR G-1 TO X. MOVE CORR G-1(1:1) TO G-2. MOVE CORR G-1 TO G-2(1:1). STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:11: Error: 'X' is not group name prog.cob:12: Error: 'X' is not group name prog.cob:13: Error: 'G-1 (1:1)' is not group name prog.cob:14: Error: 'G-2 (1:1)' is not group name ]) AT_CLEANUP # 11) DONE AT_SETUP([MOVE: misc]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INVALID-ITEM. 01 I PIC 9(3). PROCEDURE DIVISION. MOVE 1 TO INVALID-ITEM. MOVE SPACE TO I(1:2). STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: PICTURE clause required for 'INVALID-ITEM' ]) AT_CLEANUP open-cobol-1.1/tests/syntax.src/set.at0000644000000000000000000000244211130701401013424 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2004-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 14.8.35 SET statement AT_SETUP([SET: misc]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. SET ADDRESS OF X TO NULL. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: The address of 'X' cannot be changed ]) AT_CLEANUP open-cobol-1.1/tests/syntax.src/value.at0000644000000000000000000001633711130701401013755 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 13.16.61 VALUE clause ## 13.16.61.1 General format # Format 1 (data-item): DONE # Format 2 (table): TODO # Format 3 (condition-name): TODO # Format 4 (report-section): TODO # Format 5 (content-validation-entry): TODO ## 13.16.61.2 Syntax rules # 1) TODO # 2) TODO AT_SETUP([Numeric item (integer)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-SPACE PIC 999 VALUE SPACE. 01 X-ABC PIC 999 VALUE "abc". 01 X-12-3 PIC 999 VALUE 12.3. 01 X-123 PIC 999 VALUE 123. 01 X-1234 PIC 999 VALUE 1234. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: Invalid VALUE clause prog.cob:7: Warning: Numeric value is expected prog.cob:8: Warning: Value size exceeds data size prog.cob:10: Warning: Value size exceeds data size ]) AT_CLEANUP AT_SETUP([Numeric item (non-integer)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-12 PIC 99V9 VALUE 12. 01 X-123 PIC 99V9 VALUE 123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-12-34 PIC 99V9 VALUE 12.34. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Value size exceeds data size prog.cob:9: Warning: Value size exceeds data size ]) AT_CLEANUP AT_SETUP([Numeric item with picture P]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99PP-0 PIC 99PP VALUE 0. 01 X-99PP-1200 PIC 99PP VALUE 1200. 01 X-99PP-1230 PIC 99PP VALUE 1230. 01 X-99PP-10000 PIC 99PP VALUE 10000. 01 X-PP99--0 PIC PP99 VALUE .0. 01 X-PP99--0012 PIC PP99 VALUE .0012. 01 X-PP99--0123 PIC PP99 VALUE .0123. 01 X-PP99--00001 PIC PP99 VALUE .00001. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:8: Warning: Value does not fit the picture string prog.cob:9: Warning: Value size exceeds data size prog.cob:12: Warning: Value does not fit the picture string prog.cob:13: Warning: Value size exceeds data size ]) AT_CLEANUP # 3) DONE AT_SETUP([Signed numeric literal]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-9P PIC 9 VALUE +1. 01 X-9N PIC 9 VALUE -1. 01 X-S9P PIC S9 VALUE +1. 01 X-S9N PIC S9 VALUE -1. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: Data item not signed prog.cob:7: Error: Data item not signed ]) AT_CLEANUP # 4) DONE AT_SETUP([Alphabetic item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC AAA VALUE 123. 01 X-ZERO PIC AAA VALUE ZERO. 01 X-AB1 PIC AAA VALUE "ab1". 01 X-ABC PIC AAA VALUE "abc". 01 X-ABCD PIC AAA VALUE "abcd". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Warning: Alphanumeric value is expected prog.cob:7: Error: Invalid VALUE clause prog.cob:8: Warning: Value does not fit the picture string prog.cob:10: Warning: Value size exceeds data size ]) AT_CLEANUP AT_SETUP([Alphanumeric item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC XXX VALUE 123. 01 X-ABC PIC XXX VALUE "abc". 01 X-ABCD PIC XXX VALUE "abcd". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:6: Warning: Alphanumeric value is expected prog.cob:8: Warning: Value size exceeds data size ]) AT_CLEANUP AT_SETUP([Alphanumeric group item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1 VALUE 123. 02 X PIC XXX. 01 G-2 VALUE "abc". 02 X PIC XXX. 01 G-3 VALUE "abcd". 02 X PIC XXX. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:6: Warning: Alphanumeric value is expected prog.cob:10: Warning: Value size exceeds data size ]) AT_CLEANUP # 5) TODO # 6) TODO # 7) DONE # 8) DONE AT_SETUP([Numeric-edited item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-SPACE PIC **99.00 VALUE SPACE. 01 X-123 PIC **99.00 VALUE 123. 01 X-ABC PIC **99.00 VALUE "abc". 01 X-MATCH PIC **99.00 VALUE "*123.00". 01 X-OVERFLOW PIC **99.00 VALUE "*123.000". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:7: Warning: Alphanumeric value is expected prog.cob:10: Warning: Value size exceeds data size ]) AT_CLEANUP AT_SETUP([Alphanumeric-edited item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC BXX VALUE 123. 01 X-ABC PIC BXX VALUE "abc". 01 X-MATCH PIC BXX VALUE " ab". 01 X-OVERFLOW PIC BXX VALUE " abc". PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0], , [prog.cob:6: Warning: Alphanumeric value is expected prog.cob:9: Warning: Value size exceeds data size ]) AT_CLEANUP # 9) TODO # 10) DONE (tested in redefines.at) # 11) TODO # 12) TODO # 13) TODO # 14) TODO # 15) TODO # 16) TODO # 17) TODO # 18) TODO # 19) TODO # 20) DONE # 21) TODO # 22) TODO # 23) TODO # 24) TODO # 25) TODO # 26) TODO # 27) TODO # 28) TODO # 29) TODO open-cobol-1.1/tests/run.src/0000777000000000000000000000000011143001517011650 5open-cobol-1.1/tests/run.src/functions.at0000644000000000000000000011050211136151342014125 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2005-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 15 Intrinsic Functions AT_SETUP([FUNCTION ABS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.2345. PROCEDURE DIVISION. DISPLAY FUNCTION ABS ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+0001.2345 ]) AT_CLEANUP AT_SETUP([FUNCTION ACOS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Z PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ACOS ( X ) TO Z. IF Z >= 1.80750052110824325 AND Z <= 1.80750052110824345 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Z END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION ANNUITY]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4) VALUE 3. 01 Y PIC S9(4) VALUE 5. 01 Z PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ANNUITY ( X, Y ) TO Z. IF Z >= 3.002932551319648080 AND Z <= 3.002932551319648110 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Z END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION ASIN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ASIN ( X ) TO Y. IF Y >= -0.23670419431334685 AND Y <= -0.23670419431334675 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION ATAN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION ATAN ( X ) TO Y. IF Y >= 0.78539816339744825 AND Y <= 0.78539816339744835 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION CHAR]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 108. PROCEDURE DIVISION. DISPLAY FUNCTION CHAR ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [k ]) AT_CLEANUP AT_SETUP([FUNCTION COMBINED-DATETIME]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION COMBINED-DATETIME ( 987, 345 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0000987.00345 ]) AT_CLEANUP AT_SETUP([FUNCTION CONCATENATE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(4). PROCEDURE DIVISION. MOVE "defx" TO Y. DISPLAY FUNCTION CONCATENATE ( Y "abc" "zz" "55" "666" ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [defxabczz55666 ]) AT_CLEANUP AT_SETUP([FUNCTION CONCATENATE with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(4). PROCEDURE DIVISION. MOVE "defx" TO Y. DISPLAY FUNCTION CONCATENATE ( Y "abc" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [efxabczz5 ]) AT_CLEANUP AT_SETUP([FUNCTION COS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -0.2345. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION COS ( X ) TO Y. IF Y >= 0.97263064125625815 AND Y <= 0.97263064125625825 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION DATE-OF-INTEGER]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DATE-OF-INTEGER ( 146000 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [20000925 ]) AT_CLEANUP AT_SETUP([FUNCTION DATE-TO-YYYYMMDD]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DATE-TO-YYYYMMDD ( 981002, -10, 1994 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [18981002 ]) AT_CLEANUP AT_SETUP([FUNCTION DAY-OF-INTEGER]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DAY-OF-INTEGER ( 146000 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [2000269 ]) AT_CLEANUP AT_SETUP([FUNCTION DAY-TO-YYYYDDD]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION DAY-TO-YYYYDDD ( 95005, -10, 2013 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [01995005 ]) AT_CLEANUP AT_SETUP([FUNCTION E]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION E END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [2.7182818284590452353602874713526625 ]) AT_CLEANUP AT_SETUP([FUNCTION EXCEPTION-FILE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-FILE END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [35TEST-FILE ]) AT_CLEANUP AT_SETUP([FUNCTION EXCEPTION-LOCATION]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. A00-MAIN SECTION. A00. OPEN INPUT TEST-FILE. B00-MAIN SECTION. B00. DISPLAY FUNCTION EXCEPTION-LOCATION NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -debug -o prog prog.cob]) AT_CHECK([./prog], [0], [prog; A00 OF A00-MAIN; 18]) AT_CLEANUP AT_SETUP([FUNCTION EXCEPTION-STATEMENT]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-STATEMENT NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -debug -o prog prog.cob]) AT_CHECK([./prog], [0], [OPEN ]) AT_CLEANUP AT_SETUP([FUNCTION EXCEPTION-STATUS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "NOTEXIST" FILE STATUS IS TEST-STATUS. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 TEST-STATUS PIC XX. PROCEDURE DIVISION. OPEN INPUT TEST-FILE. DISPLAY FUNCTION EXCEPTION-STATUS NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [EC-I-O-PERMANENT-ERROR ]) AT_CLEANUP AT_SETUP([FUNCTION EXP]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC S99V9(16) COMP. PROCEDURE DIVISION. MOVE FUNCTION EXP ( 3 ) TO Y. IF Y >= 20.0855369231876636 AND Y <= 20.0855369231876644 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION FACTORIAL]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION FACTORIAL ( 6 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [000000000000000720 ]) AT_CLEANUP AT_SETUP([FUNCTION FRACTION-PART]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION FRACTION-PART ( 3.12345 ) END-DISPLAY. DISPLAY FUNCTION FRACTION-PART ( -3.12345 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+.123450000000000000 -.123450000000000000 ]) AT_CLEANUP AT_SETUP([FUNCTION INTEGER]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-000000000000000002 ]) AT_CLEANUP AT_SETUP([FUNCTION INTEGER-OF-DATE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-OF-DATE ( 20000925 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00146000 ]) AT_CLEANUP AT_SETUP([FUNCTION INTEGER-OF-DAY]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-OF-DAY ( 2000269 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00146000 ]) AT_CLEANUP AT_SETUP([FUNCTION INTEGER-PART]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION INTEGER-PART ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-000000000000000001 ]) AT_CLEANUP AT_SETUP([FUNCTION LENGTH]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE -1.5. PROCEDURE DIVISION. DISPLAY FUNCTION LENGTH ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [8 ]) AT_CLEANUP AT_SETUP([FUNCTION LOCALE-DATE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-DATE ( "19630302" ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION LOCALE-TIME]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-TIME ( "233012" ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION LOCALE-TIME-FROM-SECONDS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(32) VALUE SPACES. PROCEDURE DIVISION. MOVE FUNCTION LOCALE-TIME-FROM-SECONDS ( 33012 ) TO X. IF X NOT = SPACES DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION LOG]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION LOG ( X ) TO Y. IF Y >= 0.40546510810816435 AND Y <= 0.40546510810816445 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION LOG10]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION LOG10 ( X ) TO Y. IF Y >= 0.17609125905568120 AND Y <= 0.17609125905568128 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION LOWER-CASE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION LOWER-CASE ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a#b.c%d+e$ ]) AT_CLEANUP AT_SETUP([FUNCTION LOWER-CASE with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION LOWER-CASE ( X ) (1 : 3) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a#b ]) AT_CLEANUP AT_SETUP([FUNCTION MAX]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MAX ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [8 ]) AT_CLEANUP AT_SETUP([FUNCTION MEAN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MEAN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-1.20000000000000000 ]) AT_CLEANUP AT_SETUP([FUNCTION MEDIAN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MEDIAN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0 ]) AT_CLEANUP AT_SETUP([FUNCTION MIDRANGE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MIDRANGE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-3.000000000000000000 ]) AT_CLEANUP AT_SETUP([FUNCTION MIN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MIN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-14 ]) AT_CLEANUP AT_SETUP([FUNCTION MOD]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION MOD ( -11 5 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+000000000000000004 ]) AT_CLEANUP AT_SETUP([FUNCTION NUMVAL]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " -9876.1234 ". PROCEDURE DIVISION. DISPLAY FUNCTION NUMVAL ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-00000000009876.1234 ]) AT_CLEANUP AT_SETUP([FUNCTION NUMVAL-C]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(14) VALUE " % -9876.1234 ". PROCEDURE DIVISION. DISPLAY FUNCTION NUMVAL-C ( X , "%" ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-00000000009876.1234 ]) AT_CLEANUP AT_SETUP([FUNCTION ORD]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD ( "k" ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00000108 ]) AT_CLEANUP AT_SETUP([FUNCTION ORD-MAX]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD-MAX ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00000004 ]) AT_CLEANUP AT_SETUP([FUNCTION ORD-MIN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION ORD-MIN ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00000002 ]) AT_CLEANUP AT_SETUP([FUNCTION PI]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION PI END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [3.1415926535897932384626433832795029 ]) AT_CLEANUP AT_SETUP([FUNCTION PRESENT-VALUE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION PRESENT-VALUE ( 3 2 1 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0.562500000000000000 ]) AT_CLEANUP AT_SETUP([FUNCTION RANGE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION RANGE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+000000000000000022 ]) AT_CLEANUP AT_SETUP([FUNCTION REM]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION REM ( -11 5 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-000000000000000001 ]) AT_CLEANUP AT_SETUP([FUNCTION REVERSE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION REVERSE ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [$E+D%C.B#A ]) AT_CLEANUP AT_SETUP([FUNCTION REVERSE with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "A#B.C%D+E$". PROCEDURE DIVISION. DISPLAY FUNCTION REVERSE ( X ) (1 : 4) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [$E+D ]) AT_CLEANUP AT_SETUP([FUNCTION SECONDS-FROM-FORMATTED-TIME]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(6) VALUE "hhmmss". 01 Y PIC 9(8) COMP-5. 01 Z PIC X(6) VALUE "010203". PROCEDURE DIVISION. MOVE FUNCTION SECONDS-FROM-FORMATTED-TIME (X, Z) TO Y. IF Y = 3723 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION SECONDS-PAST-MIDNIGHT]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC 9(8) COMP-5. PROCEDURE DIVISION. MOVE FUNCTION SECONDS-PAST-MIDNIGHT TO Y. IF Y < 86402 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION SIGN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION SIGN ( 3.12345 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( -0.0 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( 0.0 ) END-DISPLAY. DISPLAY FUNCTION SIGN ( -3.12345 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+00000001 +00000000 +00000000 -00000001 ]) AT_CLEANUP AT_SETUP([FUNCTION SIN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION SIN ( X ) TO Y. IF Y >= 0.99749498660405440 AND Y <= 0.99749498660405450 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION SQRT]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION SQRT ( X ) TO Y. IF Y >= 1.22474487139158890 AND Y <= 1.22474487139158899 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION STANDARD-DEVIATION]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC S9V9(17) COMP. PROCEDURE DIVISION. MOVE FUNCTION STANDARD-DEVIATION ( 3 -14 0 8 -3 ) TO Y. IF Y >= 7.35934779718963925 AND Y <= 7.35934779718964025 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION STORED-CHAR-LENGTH]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(24). PROCEDURE DIVISION. MOVE "123456789012" TO Y. DISPLAY FUNCTION STORED-CHAR-LENGTH ( Y ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00000012 ]) AT_CLEANUP AT_SETUP([FUNCTION SUBSTITUTE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE ( Y "abc" "zz" "55" "666" ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [zz1114446665defxxzz ]) AT_CLEANUP AT_SETUP([FUNCTION SUBSTITUTE with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE ( Y "abc" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [z11144466 ]) AT_CLEANUP AT_SETUP([FUNCTION SUBSTITUTE-CASE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "ABC111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE-CASE (Y "abc" "zz" "55" "666") END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [zz1114446665defxxzz ]) AT_CLEANUP AT_SETUP([FUNCTION SUBSTITUTE-CASE with reference mod]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(20). PROCEDURE DIVISION. MOVE "abc111444555defxxabc" TO Y. DISPLAY FUNCTION SUBSTITUTE-CASE ( Y "ABC" "zz" "55" "666" ) (2 : 9) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [z11144466 ]) AT_CLEANUP AT_SETUP([FUNCTION TAN]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9(4)V9(4) VALUE 1.5. 01 Y PIC S99V9(16) COMP. PROCEDURE DIVISION. MOVE FUNCTION TAN ( X ) TO Y. IF Y >= 14.1014199471717185 AND Y <= 14.1014199471717205 DISPLAY "OK" END-DISPLAY ELSE DISPLAY Y END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([FUNCTION TRIM]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " a#b.c%d+e$ ". PROCEDURE DIVISION. DISPLAY FUNCTION TRIM ( X ) END-DISPLAY. DISPLAY FUNCTION TRIM ( X TRAILING ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a#b.c%d+e$ a#b.c%d+e$ ]) AT_CLEANUP AT_SETUP([FUNCTION TRIM with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE " a#b.c%d+e$ ". PROCEDURE DIVISION. DISPLAY FUNCTION TRIM ( X ) (2 : 3) END-DISPLAY. DISPLAY FUNCTION TRIM ( X TRAILING ) (2 : 3) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [#b. a#b ]) AT_CLEANUP AT_SETUP([FUNCTION UPPER-CASE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "a#b.c%d+e$". PROCEDURE DIVISION. DISPLAY FUNCTION UPPER-CASE ( X ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [A#B.C%D+E$ ]) AT_CLEANUP AT_SETUP([FUNCTION UPPER-CASE with reference modding]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(10) VALUE "a#b.c%d+e$". PROCEDURE DIVISION. DISPLAY FUNCTION UPPER-CASE ( X ) (1 : 3) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [A#B ]) AT_CLEANUP AT_SETUP([FUNCTION VARIANCE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY FUNCTION VARIANCE ( 3 -14 0 8 -3 ) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+54.1600000000000000 ]) AT_CLEANUP AT_SETUP([FUNCTION WHEN-COMPILED]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 XYZ. 03 X PIC X. 03 FILLER PIC X(20). PROCEDURE DIVISION. MOVE FUNCTION WHEN-COMPILED TO XYZ. IF X = "2" DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NOT OK" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP open-cobol-1.1/tests/run.src/accept.at0000644000000000000000000000365511130701401013355 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2004-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 14.8.1 ACCEPT statement AT_SETUP([ACCEPT]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(8). PROCEDURE DIVISION. ACCEPT X FROM DATE END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DATE YYYYMMDD END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DAY END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. ACCEPT X FROM DAY YYYYDDD END-ACCEPT. INSPECT X CONVERTING "012345678" TO "999999999". DISPLAY "(" X ")" END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [(999999 ) (99999999) (99999 ) (9999999 ) ]) AT_CLEANUP open-cobol-1.1/tests/run.src/return-code.at0000644000000000000000000000633011136343111014344 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### Non-standard extensions AT_SETUP([RETURN-CODE moving]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 I PIC 99 COMP. PROCEDURE DIVISION. INITIALIZE RETURN-CODE. MOVE ZERO TO RETURN-CODE. MOVE 1 TO RETURN-CODE. MOVE RETURN-CODE TO I. DISPLAY I NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], [01]) AT_CLEANUP AT_SETUP([RETURN-CODE passing]) AT_DATA([mod1.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. mod1. PROCEDURE DIVISION. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE 1 TO RETURN-CODE. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([mod2.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. mod2. PROCEDURE DIVISION. EXIT PROGRAM. ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. CALL "mod1" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. CALL "mod2" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} mod1.cob]) AT_CHECK([${COMPILE_MODULE} mod2.cob]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+000000000+000000001+000000001+000000000]) AT_CLEANUP AT_SETUP([RETURN-CODE nested]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. MOVE 1 TO RETURN-CODE. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. CALL "mod1" END-CALL. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE ZERO TO RETURN-CODE. STOP RUN. PROGRAM-ID. mod1. PROCEDURE DIVISION. DISPLAY RETURN-CODE NO ADVANCING END-DISPLAY. MOVE 2 TO RETURN-CODE. EXIT PROGRAM. END PROGRAM mod1. END PROGRAM prog. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [+000000001+000000001+000000002]) AT_CLEANUP open-cobol-1.1/tests/run.src/misc.at0000644000000000000000000011574311130701401013053 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_SETUP([Source file not found]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [cobc: prog.cob: No such file or directory ]) AT_CLEANUP AT_SETUP([Comma separator without space]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY 1,1,1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [111]) AT_CLEANUP AT_SETUP([LOCAL-STORAGE]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-X PIC XXX VALUE "abc". LOCAL-STORAGE SECTION. 01 LCL-X PIC XXX VALUE "abc". PROCEDURE DIVISION. DISPLAY "WRK-X = " WRK-X END-DISPLAY. DISPLAY "LCL-X = " LCL-X END-DISPLAY. MOVE ZERO TO WRK-X LCL-X. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. CALL "callee" END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} -o prog caller.cob]) AT_CHECK([./prog], [0], [WRK-X = abc LCL-X = abc WRK-X = 000 LCL-X = abc ]) AT_CLEANUP AT_SETUP([EXTERNAL data item]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-VAR PIC X(5). 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 EXT-VAR PIC X(5) EXTERNAL. 01 WRK-VAR PIC X(5). PROCEDURE DIVISION. MOVE "Hello" TO EXT-VAR. CALL "callee" END-CALL. DISPLAY EXT-VAR END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} -o prog caller.cob]) AT_CHECK([./prog], [0], [Hello World ]) AT_CLEANUP AT_SETUP([EXTERNAL AS data item]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 PRG-VAR PIC X(5) EXTERNAL AS "WRK-VAR". 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY PRG-VAR END-DISPLAY. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYVAR PIC X(5) EXTERNAL AS "EXT-VAR". 01 WRK-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. MOVE "Extrn" TO WRK-VAR. MOVE "Hello" TO MYVAR. CALL "callee" END-CALL. DISPLAY MYVAR END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} -o prog caller.cob]) AT_CHECK([./prog], [0], [Extrn Hello World ]) AT_CLEANUP AT_SETUP([cobcrun validation]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 WRK-VAR PIC X(5). 01 EXT-VAR PIC X(5) EXTERNAL. PROCEDURE DIVISION. DISPLAY EXT-VAR END-DISPLAY. MOVE "World" TO EXT-VAR. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 EXT-VAR PIC X(5) EXTERNAL. 01 WRK-VAR PIC X(5). PROCEDURE DIVISION. MOVE "Hello" TO EXT-VAR. CALL "callee" END-CALL. DISPLAY EXT-VAR END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE_MODULE} caller.cob]) AT_CHECK([${COBCRUN} caller], [0], [Hello World ]) AT_CLEANUP ## MOVE statement AT_SETUP([MOVE to itself]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99 VALUE 12. PROCEDURE DIVISION. MOVE X TO X. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [12]) AT_CLEANUP AT_SETUP([MOVE with refmod]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4) VALUE 0. PROCEDURE DIVISION. MOVE "1" TO X(1:1). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [1000]) AT_CLEANUP AT_SETUP([MOVE with refmod (variable)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "1234". 01 Y PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 1. PROCEDURE DIVISION. MOVE X(1:I) TO Y. DISPLAY Y NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [1 ]) AT_CLEANUP AT_SETUP([MOVE with group refmod]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC 9999 VALUE 1234. PROCEDURE DIVISION. MOVE "99" TO G(3:2). DISPLAY G NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [1299]) AT_CLEANUP AT_SETUP([MOVE indexes]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10 INDEXED I. PROCEDURE DIVISION. SET I TO ZERO. MOVE I TO X(1). DISPLAY X(1) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0]) AT_CLEANUP AT_SETUP([MOVE X'00']) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { printf ("%02x%02x%02x", data[[0]], data[[1]], data[[2]]); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC XXX. PROCEDURE DIVISION. MOVE X"000102" TO X. CALL "dump" USING X END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [000102]) AT_CLEANUP ## OCCURS clause AT_SETUP([Level 01 subscripts]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X OCCURS 10. PROCEDURE DIVISION. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:6: Error: Level 01 item 'X' cannot have OCCURS clause ]) AT_CLEANUP ## Expressions AT_SETUP([Class check with reference modification]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(6) VALUE "123 ". PROCEDURE DIVISION. IF X(1:3) NUMERIC DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([Index and parenthesized expression]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 1 INDEXED BY I. PROCEDURE DIVISION. IF I < (I + 2) DISPLAY "OK" END-DISPLAY END-IF. ]) AT_CHECK([${COMPILE_ONLY} -o prog prog.cob]) AT_CLEANUP AT_SETUP([Alphanumeric and binary numeric]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC XXXX VALUE "0001". 01 X-9 PIC 9999 COMP VALUE 1. PROCEDURE DIVISION. IF X-X = X-9 DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP ## CALL statement AT_SETUP([Dynamic call with static linking]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. ]) AT_CHECK([${COMPILE_MODULE} -c callee.cob]) AT_CHECK([${COMPILE} -c caller.cob]) AT_CHECK([${COMPILE} -o prog caller.o callee.o]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([CALL m1. CALL m2. CALL m1.]) AT_DATA([m1.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. m1. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4). PROCEDURE DIVISION. COMPUTE X = 1 + 2 END-COMPUTE. DISPLAY X END-DISPLAY. ]) AT_DATA([m2.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. m2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(4). PROCEDURE DIVISION. COMPUTE X = 3 + 4 END-COMPUTE. DISPLAY X END-DISPLAY. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "m1" END-CALL. CALL "m2" END-CALL. CALL "m1" END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} m1.cob]) AT_CHECK([${COMPILE_MODULE} m2.cob]) AT_CHECK([${COMPILE} -o caller caller.cob]) AT_CHECK([./caller], [0], [0003 0007 0003 ]) AT_CLEANUP AT_SETUP([CALL binary literal parameter/LENGTH OF]) AT_DATA([test.conf], [ include "default.conf" binary-byteorder: native ]) AT_DATA([dump.c], [ #include int dump (int *p) { printf ("%8.8d\n", *p); return 0; } ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYOCC PIC 9(8) COMP. 01 MYTAB. 03 MYBYTE PIC X OCCURS 1 TO 20 DEPENDING ON MYOCC. PROCEDURE DIVISION. MOVE 9 TO MYOCC. CALL "dump" USING BY CONTENT 1 END-CALL. CALL "dump" USING BY CONTENT LENGTH OF MYTAB END-CALL. CALL "dump" USING BY CONTENT LENGTH OF MYOCC END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} dump.c]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00000001 00000009 00000004 ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [00000001 00000009 00000004 ]) AT_CLEANUP ## INSPECT AT_SETUP([INSPECT REPLACING LEADING ZEROS BY SPACES]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "0001". PROCEDURE DIVISION. INSPECT X REPLACING LEADING ZEROS BY SPACES. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [ 1]) AT_CLEANUP AT_SETUP([INSPECT: No repeat conversion check]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(3) VALUE "BCA". PROCEDURE DIVISION. INSPECT X CONVERTING "ABC" TO "BCD". DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [CDB]) AT_CLEANUP AT_SETUP([INSPECT: REPLACING figurative constant]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(3) VALUE "BCA". PROCEDURE DIVISION. INSPECT X REPLACING ALL "BC" BY SPACE. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [ A]) AT_CLEANUP AT_SETUP([INSPECT: TALLYING BEFORE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "ABC ". 01 TAL PIC 999 VALUE 0. PROCEDURE DIVISION. MOVE 0 TO TAL. INSPECT X TALLYING TAL FOR CHARACTERS BEFORE INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. MOVE 0 TO TAL. MOVE " ABC" TO X. INSPECT X TALLYING TAL FOR CHARACTERS BEFORE INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [003000]) AT_CLEANUP AT_SETUP([INSPECT: TALLYING AFTER]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "ABC ". 01 TAL PIC 999 VALUE 0. PROCEDURE DIVISION. MOVE 0 TO TAL. INSPECT X TALLYING TAL FOR CHARACTERS AFTER INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. MOVE 0 TO TAL. MOVE " ABC" TO X. INSPECT X TALLYING TAL FOR CHARACTERS AFTER INITIAL " ". DISPLAY TAL NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [000003]) AT_CLEANUP AT_SETUP([INSPECT REPLACING TRAILING ZEROS BY SPACES]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "1000". PROCEDURE DIVISION. INSPECT X REPLACING TRAILING ZEROS BY SPACES. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [1 ]) AT_CLEANUP AT_SETUP([INSPECT REPLACING complex]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(12) VALUE "AAABBCDCCCCC". PROCEDURE DIVISION. INSPECT X REPLACING ALL "A" BY "Z" "B" BY "Y" TRAILING "C" BY "X". DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [ZZZYYCDXXXXX]) AT_CLEANUP AT_SETUP([SWITCHES]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. SWITCH-1 IS SWIT1 ON IS SWIT1-ON OFF IS SWIT1-OFF SWITCH-2 IS SWIT2 ON IS SWIT2-ON OFF IS SWIT2-OFF. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. IF SWIT1-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. IF SWIT2-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. SET SWIT1 TO OFF. SET SWIT2 TO ON. IF SWIT1-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. IF SWIT2-ON DISPLAY "ON" NO ADVANCING END-DISPLAY ELSE DISPLAY "OFF" NO ADVANCING END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([COB_SWITCH_1=ON COB_SWITCH_2=OFF ./prog], [0], [ONOFFOFFON]) AT_CLEANUP ## PERFORM AT_SETUP([Nested PERFORM]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. PROCEDURE DIVISION. PERFORM 2 TIMES PERFORM 2 TIMES DISPLAY "X" NO ADVANCING END-DISPLAY END-PERFORM END-PERFORM. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [XXXX]) AT_CLEANUP ## EXIT PERFORM see ISO/IEC 1989:2002(E) 14.8.13 Format 5 ## (= the same as in MF-LRM "EXIT" FORMAT 2 ... ) AT_SETUP([EXIT PERFORM]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES DISPLAY "OK" NO ADVANCING END-DISPLAY EXIT PERFORM DISPLAY "NOT REACHED" END-DISPLAY END-PERFORM STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP ## EXIT PERFORM see ISO/IEC 1989:2002(E) 14.8.13 Format 5 ## (= the same as in MF-LRM "EXIT" FORMAT 2 ... ) AT_SETUP([EXIT PERFORM CYCLE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES DISPLAY "OK" NO ADVANCING END-DISPLAY EXIT PERFORM CYCLE DISPLAY "NOT REACHED" END-DISPLAY END-PERFORM STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OKOK]) AT_CLEANUP ## EXIT PARAGRAPH see ISO/IEC 1989:2002(E) 14.8.13 Format 6 AT_SETUP([EXIT PARAGRAPH]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INDVAL PIC 9(4). PROCEDURE DIVISION. A01. PERFORM VARYING INDVAL FROM 1 BY 1 UNTIL INDVAL > 10 IF INDVAL > 2 EXIT PARAGRAPH END-IF END-PERFORM . A02. DISPLAY INDVAL NO ADVANCING END-DISPLAY STOP RUN . ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0003]) AT_CLEANUP ## EXIT SECTION see ISO/IEC 1989:2002(E) 14.8.13 Format 6 AT_SETUP([EXIT SECTION]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INDVAL PIC 9(4). PROCEDURE DIVISION. A01 SECTION. A011. PERFORM VARYING INDVAL FROM 1 BY 1 UNTIL INDVAL > 10 IF INDVAL > 2 EXIT SECTION END-IF END-PERFORM . A012. DISPLAY INDVAL NO ADVANCING END-DISPLAY . A02 SECTION. DISPLAY INDVAL NO ADVANCING END-DISPLAY STOP RUN . ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0003]) AT_CLEANUP AT_SETUP([88 with FILLER]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 FILLER PIC X VALUE SPACE. 88 X VALUE "X". PROCEDURE DIVISION. IF X DISPLAY "NO" NO ADVANCING END-DISPLAY END-IF. SET X TO TRUE. IF X DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([Non-overflow after overflow]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9(2) VALUE 0. 01 Y PIC 9(2) VALUE 0. PROCEDURE DIVISION. COMPUTE X = 100 END-COMPUTE. COMPUTE Y = 99 END-COMPUTE. DISPLAY Y NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [99]) AT_CLEANUP ## PERFORM statement AT_SETUP([PERFORM ... CONTINUE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. PERFORM 2 TIMES CONTINUE END-PERFORM. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [0]) AT_CLEANUP AT_SETUP([STRING with subscript reference]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(3) OCCURS 3. PROCEDURE DIVISION. STRING "abc" INTO X(1) END-STRING. DISPLAY X(1) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [abc]) AT_CLEANUP AT_SETUP([UNSTRING DELIMITED ALL LOW-VALUE]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 03 FILLER PIC XXX VALUE "ABC". 03 FILLER PIC XX VALUE LOW-VALUES. 03 FILLER PIC XXX VALUE "DEF". 01 A PIC XXX. 01 B PIC XXX. PROCEDURE DIVISION. UNSTRING G DELIMITED BY ALL LOW-VALUES INTO A B END-UNSTRING. DISPLAY A END-DISPLAY. DISPLAY B END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ABC DEF ]) AT_CLEANUP AT_SETUP([READ INTO AT-END sequence]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(10). WORKING-STORAGE SECTION. 01 X PIC X(10). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. OPEN INPUT TEST-FILE. READ TEST-FILE INTO X AT END MOVE ZERO TO X END-READ. CLOSE TEST-FILE. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0000000000]) AT_CLEANUP AT_SETUP([First READ on empty SEQUENTIAL INDEXED file]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS INDEXED ACCESS MODE IS SEQUENTIAL RECORD KEY IS TEST-KEY. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-KEY PIC X(10). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. OPEN INPUT TEST-FILE. READ TEST-FILE AT END DISPLAY "OK" NO ADVANCING END-DISPLAY END-READ. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([REWRITE a RELATIVE file with RANDOM access]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS RELATIVE ACCESS MODE IS RANDOM RELATIVE KEY IS TEST-KEY. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X. WORKING-STORAGE SECTION. 01 TEST-KEY PIC 9. PROCEDURE DIVISION. * OPEN OUTPUT TEST-FILE. MOVE 1 TO TEST-KEY. MOVE "A" TO TEST-REC. WRITE TEST-REC END-WRITE. MOVE 2 TO TEST-KEY. MOVE "B" TO TEST-REC. WRITE TEST-REC END-WRITE. CLOSE TEST-FILE. * OPEN I-O TEST-FILE. MOVE 1 TO TEST-KEY. READ TEST-FILE END-READ. MOVE 2 TO TEST-KEY. MOVE "C" TO TEST-REC. REWRITE TEST-REC END-REWRITE. CLOSE TEST-FILE. * OPEN INPUT TEST-FILE. MOVE 1 TO TEST-KEY. READ TEST-FILE END-READ. DISPLAY TEST-REC END-DISPLAY. MOVE 2 TO TEST-KEY. READ TEST-FILE END-READ. DISPLAY TEST-REC END-DISPLAY. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [A C ]) AT_CLEANUP AT_SETUP([SORT: table sort]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G VALUE "d4b2e1a3c5". 02 TBL OCCURS 5. 03 X PIC X. 03 Y PIC 9. PROCEDURE DIVISION. SORT TBL ASCENDING KEY X. DISPLAY G END-DISPLAY. SORT TBL DESCENDING KEY Y. DISPLAY G END-DISPLAY. SORT TBL ASCENDING KEY TBL. DISPLAY G END-DISPLAY. SORT TBL DESCENDING KEY. DISPLAY G END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a3b2c5d4e1 c5d4a3b2e1 a3b2c5d4e1 e1d4c5b2a3 ]) AT_CLEANUP AT_SETUP([SORT: EBCDIC table sort]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. ALPHABET ALPHA IS EBCDIC. DATA DIVISION. WORKING-STORAGE SECTION. 01 Z PIC X(10) VALUE "d4b2e1a3c5". 01 G VALUE "d4b2e1a3c5". 02 TBL OCCURS 10. 03 X PIC X. PROCEDURE DIVISION. SORT TBL ASCENDING KEY X. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL DESCENDING KEY X. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL ASCENDING KEY X SEQUENCE ALPHA. DISPLAY G END-DISPLAY. MOVE Z TO G. SORT TBL DESCENDING KEY X SEQUENCE ALPHA. DISPLAY G END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [12345abcde edcba54321 abcde12345 54321edcba ]) AT_CLEANUP AT_SETUP([SORT nonexistent file]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SORT-IN ASSIGN "SORT-IN". SELECT SORT-OUT ASSIGN "SORT-OUT". SELECT SORT-WRK ASSIGN "SORT-WRK". DATA DIVISION. FILE SECTION. FD SORT-IN. 01 IN-REC PIC X(100). FD SORT-OUT. 01 OUT-REC PIC X(100). SD SORT-WRK. 01 WRK-REC PIC X(100). PROCEDURE DIVISION. SORT SORT-WRK ASCENDING KEY WRK-REC USING SORT-IN GIVING SORT-OUT. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog]) AT_CHECK([cat SORT-OUT], [0], []) AT_CLEANUP AT_SETUP([PIC ZZZ-, ZZZ+]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ZZZN PIC ZZZ-. 01 X-ZZZP PIC ZZZ+. PROCEDURE DIVISION. MOVE -1 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE 0 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE +1 TO X-ZZZN. DISPLAY "(" X-ZZZN ")" END-DISPLAY. MOVE -1 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. MOVE 0 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. MOVE +1 TO X-ZZZP. DISPLAY "(" X-ZZZP ")" END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [( 1-) ( ) ( 1 ) ( 1-) ( ) ( 1+) ]) AT_CLEANUP AT_SETUP([Larger REDEFINES lengths]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 XMAIN PIC X(8). 01 XMAINRED REDEFINES XMAIN. 03 FILLER PIC X(4). 03 XMAIN03. 05 XMAIN0501 PIC X(4). 05 XMAIN0502 REDEFINES XMAIN0501 PIC X(5). PROCEDURE DIVISION. DISPLAY LENGTH OF XMAIN END-DISPLAY. DISPLAY LENGTH OF XMAINRED END-DISPLAY. DISPLAY LENGTH OF XMAIN03 END-DISPLAY. DISPLAY LENGTH OF XMAIN0501 END-DISPLAY. DISPLAY LENGTH OF XMAIN0502 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -std=mf -o prog prog.cob], [0], , [prog.cob:11: Warning: Size of 'XMAIN0502' larger than size of 'XMAIN0501' ]) AT_CHECK([./prog], [0], [8 9 5 4 5 ]) AT_CLEANUP AT_SETUP([PERFORM type OSVS]) AT_DATA([test.conf], [ include "default.conf" perform-osvs: yes ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYOCC PIC 9(8) COMP VALUE 0. PROCEDURE DIVISION. ASTART SECTION. A01. PERFORM BTEST. DISPLAY "OK" END-DISPLAY. STOP RUN. BTEST SECTION. B01. PERFORM B02 VARYING MYOCC FROM 1 BY 1 UNTIL MYOCC > 5. GO TO B99. B02. IF MYOCC > 1 GO TO B99 END-IF. B99. EXIT. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([Sticky LINKAGE]) AT_DATA([test.conf], [ include "default.conf" sticky-linkage: yes ]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 P1 PIC X. 01 P2 PIC X(6). 01 P3 PIC X(6). PROCEDURE DIVISION USING P1 P2. IF P1 = "A" SET ADDRESS OF P3 TO ADDRESS OF P2 ELSE DISPLAY P3 END-DISPLAY END-IF. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X VALUE "A". 01 P2 PIC X(6) VALUE "NOT OK". PROCEDURE DIVISION. CALL "callee" USING P1 P2 END-CALL. MOVE "B" TO P1. MOVE "OKOKOK" TO P2. CALL "callee" USING P1 END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} -conf=test.conf callee.cob]) AT_CHECK([${COMPILE} -conf=test.conf -o caller caller.cob]) AT_CHECK([./caller], [0], [OKOKOK ]) AT_CLEANUP AT_SETUP([COB_PRE_LOAD test]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee2. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee2" END-CALL. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} caller.cob]) AT_CHECK([export COB_PRE_LOAD=callee; ./caller], [0], [OK]) AT_CLEANUP AT_SETUP([COB_LOAD_CASE=UPPER test]) AT_DATA([CALLEE.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "callee" END-CALL. ]) AT_CHECK([${COMPILE_MODULE} CALLEE.cob]) AT_CHECK([${COMPILE} caller.cob]) AT_CHECK([export COB_LOAD_CASE=UPPER; ./caller], [0], [OK]) AT_CLEANUP AT_SETUP([88 level with FALSE IS clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYFLD PIC X(6) VALUE "ABCDEF". 88 MYFLD88 VALUE "ABCDEF" FALSE IS "OKOKOK". PROCEDURE DIVISION. ASTART SECTION. A01. SET MYFLD88 TO FALSE. DISPLAY MYFLD END-DISPLAY. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [OKOKOK ]) AT_CLEANUP AT_SETUP([ALLOCATE/FREE with BASED item]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. LINKAGE SECTION. 01 MYFLD PIC X(6) BASED VALUE "ABCDEF". PROCEDURE DIVISION. ASTART SECTION. A01. ALLOCATE MYFLD INITIALIZED. DISPLAY MYFLD END-DISPLAY. FREE ADDRESS OF MYFLD. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [ABCDEF ]) AT_CLEANUP AT_SETUP([INITIZIALIZE with reference modification]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 MYFLD PIC X(6) VALUE "ABCDEF". PROCEDURE DIVISION. ASTART SECTION. A01. INITIALIZE MYFLD (1:2). DISPLAY MYFLD END-DISPLAY. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [ CDEF ]) AT_CLEANUP AT_SETUP([CALL with OMITTED parameter]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 P1 PIC X. 01 P2 PIC X(6). PROCEDURE DIVISION USING P1 P2. IF P2 OMITTED DISPLAY "OKOKOK" END-DISPLAY END-IF. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X VALUE "A". 01 P2 PIC X(6) VALUE "NOT OK". PROCEDURE DIVISION. CALL "callee" USING P1 OMITTED END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} -o caller caller.cob]) AT_CHECK([./caller], [0], [OKOKOK ]) AT_CLEANUP AT_SETUP([ANY LENGTH]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. WORKING-STORAGE SECTION. 01 P2 PIC 99. LINKAGE SECTION. 01 P1 PIC X ANY LENGTH. PROCEDURE DIVISION USING P1. MOVE LENGTH OF P1 TO P2. DISPLAY P2 END-DISPLAY. DISPLAY P1 END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 P1 PIC X(6) VALUE "OKOKOK". PROCEDURE DIVISION. CALL "callee" USING P1 END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([${COMPILE} -o caller caller.cob]) AT_CHECK([./caller], [0], [06 OKOKOK ]) AT_CLEANUP AT_SETUP([BASED item non-ALLOCATED (debug)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) BASED. PROCEDURE DIVISION. DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -debug -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:8: libcob: BASED/LINKAGE item 'X' has NULL address ]) AT_CLEANUP open-cobol-1.1/tests/run.src/subscripts.at0000644000000000000000000001545111130701401014314 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 8.4.1.2 Subscripts ## 8.4.1.2.3 General rules # 1) TODO AT_SETUP([non-numeric subscript]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X OCCURS 10. 01 I PIC X. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. DISPLAY X(I + 1) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: 'I' is not an integer value prog.cob:12: Error: 'I' is not a numeric value ]) AT_CLEANUP # 2) DONE AT_SETUP([The range of subscripts]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X OCCURS 2. 03 Y PIC X OCCURS 3. PROCEDURE DIVISION. DISPLAY X(0) END-DISPLAY. DISPLAY X(1) END-DISPLAY. DISPLAY X(2) END-DISPLAY. DISPLAY X(3) END-DISPLAY. DISPLAY Y(1, 0) END-DISPLAY. DISPLAY Y(1, 1) END-DISPLAY. DISPLAY Y(1, 3) END-DISPLAY. DISPLAY Y(1, 4) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:10: Error: Subscript of 'X' out of bounds: 0 prog.cob:16: Error: Subscript of 'X' out of bounds: 3 prog.cob:18: Error: Subscript of 'Y' out of bounds: 0 prog.cob:24: Error: Subscript of 'Y' out of bounds: 4 ]) AT_CLEANUP AT_SETUP([Subscript out of bounds (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10. 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:10: libcob: Subscript of 'X' out of bounds: 0 ]) AT_CLEANUP AT_SETUP([Subscript out of bounds (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 10. 01 I PIC 99 VALUE 11. PROCEDURE DIVISION. DISPLAY X(I) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:10: libcob: Subscript of 'X' out of bounds: 11 ]) AT_CLEANUP AT_SETUP([Value of DEPENDING ON N out of bounds (lower)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 3. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:10: libcob: OCCURS DEPENDING ON 'N' out of bounds: 3 ]) AT_CLEANUP AT_SETUP([Value of DEPENDING ON N out of bounds (upper)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 7. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:10: libcob: OCCURS DEPENDING ON 'N' out of bounds: 7 ]) AT_CLEANUP AT_SETUP([Subscript bounds with ODO (lower)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(0) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob], [1], , [prog.cob:10: Error: Subscript of 'X' out of bounds: 0 ]) AT_CLEANUP AT_SETUP([Subscript bounds with ODO (upper)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(7) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob], [1], , [prog.cob:10: Error: Subscript of 'X' out of bounds: 7 ]) AT_CLEANUP AT_SETUP([Subscript bounds with ODO]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 4 TO 6 DEPENDING ON N. 01 N PIC 9 VALUE 4. PROCEDURE DIVISION. DISPLAY X(5) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:10: libcob: Subscript of 'X' out of bounds: 5 ]) AT_CLEANUP ## AT_SETUP([Subscript by arithmetic expression]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G VALUE "1234". 02 X PIC X OCCURS 4. PROCEDURE DIVISION. DISPLAY X((3 + 1) / 2) NO ADVANCING END-DISPLAY. DISPLAY X(2 ** 2) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [24]) AT_CLEANUP open-cobol-1.1/tests/run.src/ref-mod.at0000644000000000000000000001333611130701401013444 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 8.4.2.3 Reference-modification ## 8.4.2.3.3 General rules # 1) DONE # 2) DONE # 3) TODO # 4) DONE AT_SETUP([Separate sign positions]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC S9 VALUE -1 SIGN LEADING SEPARATE. 01 Y PIC S9 VALUE -1 SIGN TRAILING SEPARATE. PROCEDURE DIVISION. DISPLAY X(1:1) X(2:1) NO ADVANCING END-DISPLAY. DISPLAY Y(1:1) Y(2:1) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [-11-]) AT_CLEANUP # 5) TODO AT_SETUP([Static reference modification]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". PROCEDURE DIVISION. DISPLAY X(1:1) ":" X(1:2) ":" X(1:3) ":" X(1:4) ":" X(1:) END-DISPLAY. DISPLAY X(2:1) ":" X(2:2) ":" X(2:3) ":" X(2:) END-DISPLAY. DISPLAY X(3:1) ":" X(3:2) ":" X(3:) END-DISPLAY. DISPLAY X(4:1) ":" X(4:) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a:ab:abc:abcd:abcd b:bc:bcd:bcd c:cd:cd d:d ]) AT_CLEANUP AT_SETUP([Dynamic reference modification]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9. PROCEDURE DIVISION. MOVE 1 TO I. DISPLAY X(I:1) END-DISPLAY. MOVE 4 TO I. DISPLAY X(I:1) END-DISPLAY. MOVE 1 TO I. DISPLAY X(1:I) END-DISPLAY. MOVE 4 TO I. DISPLAY X(1:I) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [a d a abcd ]) AT_CLEANUP AT_SETUP([Static out of bounds]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4). PROCEDURE DIVISION. DISPLAY X(0:1) END-DISPLAY. DISPLAY X(5:1) END-DISPLAY. DISPLAY X(1:0) END-DISPLAY. DISPLAY X(1:5) END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , [prog.cob:8: Error: Offset of 'X' out of bounds: 0 prog.cob:10: Error: Offset of 'X' out of bounds: 5 prog.cob:12: Error: Length of 'X' out of bounds: 0 prog.cob:14: Error: Length of 'X' out of bounds: 5 ]) AT_CLEANUP AT_SETUP([Offset underflow]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(I:1) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:9: libcob: Offset of 'X' out of bounds: 0 ]) AT_CLEANUP AT_SETUP([Offset overflow]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 5. PROCEDURE DIVISION. DISPLAY X(I:1) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:9: libcob: Offset of 'X' out of bounds: 5 ]) AT_CLEANUP AT_SETUP([Length underflow]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 0. PROCEDURE DIVISION. DISPLAY X(1:I) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:9: libcob: Length of 'X' out of bounds: 0 ]) AT_CLEANUP AT_SETUP([Length overflow]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4) VALUE "abcd". 01 I PIC 9 VALUE 5. PROCEDURE DIVISION. DISPLAY X(1:I) NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1], , [prog.cob:9: libcob: Length of 'X' out of bounds: 5 ]) AT_CLEANUP # 6) TODO open-cobol-1.1/tests/run.src/fundamental.at0000644000000000000000000001575711135363177014445 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### Fundamental Tests AT_SETUP([DISPLAY literals]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY "abc" END-DISPLAY. DISPLAY 123 END-DISPLAY. DISPLAY +123 END-DISPLAY. DISPLAY -123 END-DISPLAY. DISPLAY 12.3 END-DISPLAY. DISPLAY +12.3 END-DISPLAY. DISPLAY -12.3 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [abc 123 +123 -123 12.3 +12.3 -12.3 ]) AT_CLEANUP AT_SETUP([DISPLAY literals, DECIMAL-POINT is COMMA]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. PROCEDURE DIVISION. DISPLAY 12,3 END-DISPLAY. DISPLAY +12,3 END-DISPLAY. DISPLAY -12,3 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [12,3 +12,3 -12,3 ]) AT_CLEANUP AT_SETUP([Hexadecimal literal]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 4; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY X"313233" END-DISPLAY. CALL "dump" USING X"000102" END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [123 00010200 ]) AT_CLEANUP AT_SETUP([DISPLAY data items with VALUE clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ABC PIC XXX VALUE "abc". 01 X-123 PIC 999 VALUE 123. 01 X-P123 PIC S999 VALUE +123. 01 X-N123 PIC S999 VALUE -123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-P12-3 PIC S99V9 VALUE +12.3. 01 X-N12-3 PIC S99V9 VALUE -12.3. PROCEDURE DIVISION. DISPLAY X-ABC END-DISPLAY. DISPLAY X-123 END-DISPLAY. DISPLAY X-P123 END-DISPLAY. DISPLAY X-N123 END-DISPLAY. DISPLAY X-12-3 END-DISPLAY. DISPLAY X-P12-3 END-DISPLAY. DISPLAY X-N12-3 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [abc 123 +123 -123 12.3 +12.3 -12.3 ]) AT_CLEANUP AT_SETUP([DISPLAY data items with MOVE statement]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-ABC PIC XXX VALUE "abc". 01 X-123 PIC 999 VALUE 123. 01 X-P123 PIC S999 VALUE +123. 01 X-N123 PIC S999 VALUE -123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-P12-3 PIC S99V9 VALUE +12.3. 01 X-N12-3 PIC S99V9 VALUE -12.3. PROCEDURE DIVISION. MOVE "abc" TO X-ABC. DISPLAY X-ABC END-DISPLAY. MOVE 123 TO X-123. DISPLAY X-123 END-DISPLAY. MOVE +123 TO X-P123. DISPLAY X-P123 END-DISPLAY. MOVE -123 TO X-N123. DISPLAY X-N123 END-DISPLAY. MOVE 12.3 TO X-12-3. DISPLAY X-12-3 END-DISPLAY. MOVE +12.3 TO X-P12-3. DISPLAY X-P12-3 END-DISPLAY. MOVE -12.3 TO X-N12-3. DISPLAY X-N12-3 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [abc 123 +123 -123 12.3 +12.3 -12.3 ]) AT_CLEANUP AT_SETUP([GLOBAL at same level]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog1". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. CALL "prog2" END-CALL CALL "prog3" END-CALL STOP RUN. IDENTIFICATION DIVISION. PROGRAM-ID. prog2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog2". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog2. IDENTIFICATION DIVISION. PROGRAM-ID. prog3. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog3. END PROGRAM prog. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [prog1 prog2 prog1 ]) AT_CLEANUP AT_SETUP([GLOBAL at lower level]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog1". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. CALL "prog2" END-CALL CALL "prog3" END-CALL STOP RUN. IDENTIFICATION DIVISION. PROGRAM-ID. prog2. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(5) GLOBAL VALUE "prog2". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. IDENTIFICATION DIVISION. PROGRAM-ID. prog3. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. EXIT PROGRAM. END PROGRAM prog3. END PROGRAM prog2. END PROGRAM prog. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [prog1 prog2 prog2 ]) AT_CLEANUP open-cobol-1.1/tests/run.src/initialize.at0000644000000000000000000000717111130701401014254 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### ISO+IEC+1989-2002 14.8.19 INITIALIZE statement ## 14.8.19.3 General rules AT_SETUP([INITIALIZE group entry with OCCURS]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X1 PIC X. 03 X2 PIC 9. PROCEDURE DIVISION. MOVE SPACE TO G1. INITIALIZE G2 (2). DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ 0]) AT_CLEANUP AT_SETUP([INITIALIZE OCCURS with numeric edited]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 5. 03 X PIC Z9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ 0 0 0 0 0]) AT_CLEANUP AT_SETUP([INITIALIZE complex group (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 G2 OCCURS 2. 03 Y PIC 9. 02 Z PIC 9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ 000]) AT_CLEANUP AT_SETUP([INITIALIZE complex group (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X PIC 9. 03 Y PIC X OCCURS 2. 03 Z PIC X. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0 0 ]) AT_CLEANUP AT_SETUP([INITIALIZE with REDEFINES]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 Y REDEFINES X PIC 9. 02 Z PIC 9. PROCEDURE DIVISION. INITIALIZE G1. DISPLAY G1 NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ 0]) AT_CLEANUP open-cobol-1.1/tests/run.src/extensions.at0000644000000000000000000007453411142024505014327 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### Non-standard extensions AT_SETUP([COMP-5]) AT_DATA([dump.c], [ #include int dump (unsigned char *data, int *p); int dump (unsigned char *data, int *p) { int i; if ( *p == 1 ) { for (i = 0; i < 4; i++) printf ("%02x", data[[i]]); } else { printf ("%8.8d", *((int *)data)); } puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC 9(9) VALUE 4660 COMP. 01 X-2 PIC 9(9) VALUE 4660 COMP-5. PROCEDURE DIVISION. CALL "dump" USING X-1 BY CONTENT 1 END-CALL. CALL "dump" USING X-2 BY CONTENT 2 END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00001234 00004660 ]) AT_CLEANUP ## H literal AT_SETUP([Hexadecimal numeric literal]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC 9(8) VALUE H"012345". 01 X-2 PIC 9(8) VALUE H"FFFFFF". PROCEDURE DIVISION. DISPLAY X-1 END-DISPLAY. DISPLAY X-2 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [00074565 16777215 ]) AT_CLEANUP ## Expression AT_SETUP([Semi-parenthesized condition]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. IF 1 = (1 OR 2) DISPLAY "OK" NO ADVANCING END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP ## ADDRESS OF AT_SETUP([ADDRESS OF]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-1 PIC X(3) VALUE "X-1". 01 X-2 PIC X(3) VALUE "X-2". 01 G. 02 PTR-1 USAGE POINTER VALUE NULL. 02 PTR-2 USAGE POINTER VALUE NULL. LINKAGE SECTION. 01 Y PIC X(3). PROCEDURE DIVISION. SET ADDRESS OF Y TO ADDRESS OF X-1. DISPLAY Y END-DISPLAY. SET PTR-1 TO ADDRESS OF X-2. SET PTR-2 TO PTR-1 SET ADDRESS OF Y TO PTR-2. DISPLAY Y END-DISPLAY. INITIALIZE PTR-1. IF PTR-1 = NULL DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. SET ADDRESS OF Y TO NULL. IF PTR-1 = ADDRESS OF Y DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF ADDRESS OF Y = PTR-1 DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [X-1 X-2 OK OK OK ]) AT_CLEANUP ## LENGTH OF AT_SETUP([LENGTH OF]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(2). 01 G. 02 Y PIC X(2) OCCURS 10. 01 L PIC 9(4). 01 I PIC 9(2) VALUE 10. PROCEDURE DIVISION. MOVE LENGTH OF X TO L. DISPLAY L END-DISPLAY. MOVE LENGTH OF Y TO L. DISPLAY L END-DISPLAY. MOVE LENGTH OF Y(1) TO L. DISPLAY L END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [0002 0002 0002 ]) AT_CLEANUP ## WHEN-COMPILED AT_SETUP([WHEN-COMPILED]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(20). PROCEDURE DIVISION. MOVE WHEN-COMPILED TO X. INSPECT X CONVERTING "0123456789" TO "9999999999". DISPLAY X NO ADVANCING END-DISPLAY. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [99/99/9999.99.99 ]) AT_CLEANUP ## OCCURS AT_SETUP([Complex OCCURS DEPENDING ON]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 I PIC 9. 01 G-1 VALUE "123456789". 02 G-2. 03 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 G-3. 03 G-4. 04 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 03 G-5. 04 X PIC X OCCURS 1 TO 3 DEPENDING ON I. PROCEDURE DIVISION. MOVE 2 TO I. DISPLAY G-1 ":" G-4 ":" G-5 NO ADVANCING END-DISPLAY. ]) AT_CHECK([${COMPILE} -std=mvs -o prog prog.cob]) AT_CHECK([./prog], [0], [123456:34:56]) AT_CLEANUP AT_SETUP([MOVE NON-INTEGER TO ALPHA-NUMERIC]) # see MF - COBOL Error Messages 1029-E ... AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INTEGER PIC 9(4) VALUE 1289 . 01 SIGNED-INTEGER PIC S9(4) VALUE -1289 . 01 ALPHA-FIELD PIC X(4). 01 NON-INTEGER PIC 9(2)V99 VALUE 12.89 . 01 NON-INTEGER-2 PIC 9(2)V99 USAGE BINARY VALUE 12.89 . 01 NON-INTEGER-3 PIC 9(2)V99 USAGE PACKED-DECIMAL VALUE 12.89 . 01 SIGNED-NON-INTEGER PIC S9(2)V99 VALUE -12.89 . 01 SIGNED-NON-INTEGER-2 PIC S9(2)V99 USAGE BINARY VALUE -12.89 . 01 SIGNED-NON-INTEGER-3 PIC S9(2)V99 USAGE PACKED-DECIMAL VALUE -12.89 . PROCEDURE DIVISION. * * 1029-E : MF-COBOL Extension see ERROR-Messages (2-77) ! * * MOVE NON-INTEGER TO ALPHA-NUMERIC --> ignore Decimal Point! S-01. MOVE SPACES TO ALPHA-FIELD. MOVE INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-02. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-03. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-10. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER-2 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-20. MOVE SPACES TO ALPHA-FIELD. MOVE NON-INTEGER-3 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-30. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-40. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER-2 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. S-50. MOVE SPACES TO ALPHA-FIELD. MOVE SIGNED-NON-INTEGER-3 TO ALPHA-FIELD. DISPLAY ALPHA-FIELD NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -std=mf -o prog prog.cob], [0], , [prog.cob: In paragraph 'S-03': prog.cob:37: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-10': prog.cob:42: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-20': prog.cob:47: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-30': prog.cob:52: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-40': prog.cob:57: Warning: Move non-integer to alphanumeric prog.cob: In paragraph 'S-50': prog.cob:62: Warning: Move non-integer to alphanumeric ]) AT_CHECK([./prog], [0], [12891289128912891289128912891289]) AT_CLEANUP ## CALL AT_SETUP([CALL USING file-name]) AT_DATA([setfilename.c], [ #include #include #include int setfilename (cob_file *f, unsigned char *name) { memcpy (f->assign->data, name, strlen ((char *)name)); return 0; } ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). WORKING-STORAGE SECTION. 01 FILENAME PIC X(8). PROCEDURE DIVISION. INITIALIZE FILENAME. CALL "setfilename" USING TEST-FILE "TESTFILE" END-CALL. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} setfilename.c]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0]) AT_CHECK([test -e TESTFILE], [0]) AT_CLEANUP AT_SETUP([CALL unusual PROGRAM-ID.]) AT_DATA([A@B.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. "A@B". PROCEDURE DIVISION. DISPLAY "P1" NO ADVANCING END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([A#B.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. "A#B". PROCEDURE DIVISION. DISPLAY "P2" NO ADVANCING END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([A-B.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. "A-B". PROCEDURE DIVISION. DISPLAY "P3" NO ADVANCING END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([A_B.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. "A_B". PROCEDURE DIVISION. DISPLAY "P4" NO ADVANCING END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. PROCEDURE DIVISION. CALL "A@B" END-CALL. CALL "A#B" END-CALL. CALL "A-B" END-CALL. CALL "A_B" END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE_MODULE} A@B.cob]) AT_CHECK([${COMPILE_MODULE} A#B.cob]) AT_CHECK([${COMPILE_MODULE} A-B.cob]) AT_CHECK([${COMPILE_MODULE} A_B.cob]) AT_CHECK([${COMPILE} -o caller caller.cob]) AT_CHECK([./caller], [0], [P1P2P3P4]) AT_CLEANUP AT_SETUP([Case independent PROGRAM-ID]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. PROG. PROCEDURE DIVISION. CALL "prog" END-CALL. STOP RUN. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM prog. END PROGRAM PROG. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([PROGRAM-ID AS clause]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller AS "PROG". PROCEDURE DIVISION. CALL "prog" END-CALL. STOP RUN. PROGRAM-ID. callee AS "prog". PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM callee. END PROGRAM caller. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP AT_SETUP([Quoted PROGRAM-ID]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. "caller". PROCEDURE DIVISION. CALL "callee" END-CALL. STOP RUN. PROGRAM-ID. "callee". PROCEDURE DIVISION. DISPLAY "OK" NO ADVANCING END-DISPLAY. EXIT PROGRAM. END PROGRAM callee. END PROGRAM caller. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [OK]) AT_CLEANUP ## ASSIGN AT_SETUP([ASSIGN MF]) AT_DATA([test.conf], [ include "cobol2002.conf" assign-clause: mf ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. MOVE "TEST-FILE" TO FILENAME. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob], [0], , [prog.cob:12: Warning: 'FILENAME' will be implicitly defined ]) AT_CHECK([./prog], [0]) AT_CLEANUP AT_SETUP([ASSIGN IBM]) AT_DATA([test.conf], [ include "cobol2002.conf" assign-clause: ibm ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN DA-S-FILENAME. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0]) AT_CHECK([test -f FILENAME], [0]) AT_CLEANUP AT_SETUP([ASSIGN mapping]) AT_DATA([test.conf], [ include "cobol2002.conf" filename-mapping: yes ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "FILENAME". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([DD_FILENAME="x" ./prog], [0]) AT_CHECK([test -f "x"], [0]) AT_CHECK([dd_FILENAME="y" ./prog], [0]) AT_CHECK([test -f "y"], [0]) AT_CHECK([FILENAME="z" ./prog], [0]) AT_CHECK([test -f "z"], [0]) AT_CHECK([./prog], [0]) AT_CHECK([test -f "FILENAME"], [0]) AT_CLEANUP AT_SETUP([ASSIGN expansion]) AT_DATA([test.conf], [ include "cobol2002.conf" filename-mapping: yes ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "$DIR/FILENAME". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([DIR="." ./prog], [0]) AT_CHECK([test -f "./FILENAME" && rm -f "./FILENAME"], [0]) AT_CLEANUP AT_SETUP([ASSIGN with COB_FILE_PATH]) AT_DATA([test.conf], [ include "cobol2002.conf" filename-mapping: yes ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "FILENAMEX". DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([COB_FILE_PATH=".." ./prog], [0]) AT_CHECK([test -f "../FILENAMEX" && rm -f "../FILENAMEX"], [0]) AT_CLEANUP # Number of call parameters AT_SETUP([NUMBER-OF-CALL-PARAMETERS]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 W PIC X. 01 X PIC X. 01 Y PIC X. 01 Z PIC X. PROCEDURE DIVISION USING W X Y Z. DISPLAY NUMBER-OF-CALL-PARAMETERS END-DISPLAY. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 W PIC X. 01 X PIC X. 01 Y PIC X. 01 Z PIC X. PROCEDURE DIVISION. CALL "callee" END-CALL. CALL "callee" USING W END-CALL. CALL "callee" USING W X END-CALL. CALL "callee" USING W X Y END-CALL. CALL "callee" USING W X Y Z END-CALL. STOP RUN. ]) AT_CHECK([${COMPILE} caller.cob]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([./caller], [0], [+000000000 +000000001 +000000002 +000000003 +000000004 ]) AT_CLEANUP # Program parameters AT_SETUP([PROCEDURE DIVISION USING BY ...]) AT_DATA([callee.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. callee. DATA DIVISION. LINKAGE SECTION. 01 X PIC X. 01 Y PIC 99. 01 Z PIC 99 USAGE COMP. PROCEDURE DIVISION USING BY VALUE X BY REFERENCE Y Z. DISPLAY "X = " X " Y = " Y " Z = " Z END-DISPLAY. MOVE "Z" TO X. MOVE 56 TO Y. MOVE 78 TO Z. EXIT PROGRAM. ]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. caller. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC 99. 01 Z PIC 99 USAGE COMP. PROCEDURE DIVISION. MOVE "X" TO X. MOVE 12 TO Y. MOVE 34 TO Z. CALL "callee" USING BY CONTENT X BY REFERENCE Y BY CONTENT Z END-CALL. DISPLAY "X = " X " Y = " Y " Z = " Z END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} caller.cob]) AT_CHECK([${COMPILE_MODULE} callee.cob]) AT_CHECK([./caller], [0], [X = X Y = 12 Z = 34 X = X Y = 56 Z = 34 ]) AT_CLEANUP AT_SETUP([PROCEDURE DIVISION CHAINING ...]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 ABCD PIC X(4). PROCEDURE DIVISION CHAINING X ABCD. DISPLAY X END-DISPLAY. DISPLAY ABCD END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog X ABCD], [0], [X ABCD ]) AT_CLEANUP AT_SETUP([STOP RUN RETURNING]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN RETURNING 1. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [1]) AT_CLEANUP # ENTRY AT_SETUP([ENTRY]) AT_DATA([caller.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. CALL "hello" USING "COBOL" END-CALL. CALL "bye" USING "COBOL" END-CALL. STOP RUN. ]) AT_DATA([hello.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. hello. DATA DIVISION. WORKING-STORAGE SECTION. 01 MSG-HELLO PIC X(7) VALUE "Hello, ". 01 MSG-BYE PIC X(5) VALUE "Bye, ". LINKAGE SECTION. 01 X PIC X(5). 01 Y PIC X(5). PROCEDURE DIVISION USING X. DISPLAY MSG-HELLO X "!" END-DISPLAY. EXIT PROGRAM. ENTRY "bye" USING Y. DISPLAY MSG-BYE Y "!" END-DISPLAY. EXIT PROGRAM. ]) AT_CHECK([${COMPILE} -std=mvs caller.cob]) AT_CHECK([${COMPILE_MODULE} -std=mvs hello.cob]) AT_CHECK([./caller], [0], [Hello, COBOL! Bye, COBOL! ]) AT_CLEANUP ## LINE SEQUENTIAL AT_SETUP([LINE SEQUENTIAL write]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN OUTPUT TEST-FILE. MOVE "a" TO TEST-REC. WRITE TEST-REC END-WRITE. MOVE "ab" TO TEST-REC. WRITE TEST-REC AFTER 1 LINES END-WRITE. MOVE "abc" TO TEST-REC. WRITE TEST-REC BEFORE 2 LINES END-WRITE. MOVE "abcd" TO TEST-REC. WRITE TEST-REC END-WRITE. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog]) AT_CHECK([cat TEST-FILE], [0], [a ababc abcd ]) AT_CLEANUP AT_SETUP([LINE SEQUENTIAL read]) AT_DATA([TEST-FILE], [a ab abc abcd abcde abcdef ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN INPUT TEST-FILE. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. READ TEST-FILE END-READ. DISPLAY "(" TEST-REC ")" END-DISPLAY. CLOSE TEST-FILE. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [(a ) (ab ) (abc ) (abcd) (abcd) (abcd) ]) AT_CLEANUP AT_SETUP([ASSIGN to KEYBOARD/DISPLAY]) AT_DATA([TEST-FILE], [a ab abc abcd abcde abcdef ]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN KEYBOARD ORGANIZATION IS LINE SEQUENTIAL. SELECT TEST-OUT ASSIGN DISPLAY ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(80). FD TEST-OUT. 01 TEST-REC-OUT PIC X(80). PROCEDURE DIVISION. A00. OPEN INPUT TEST-FILE. OPEN OUTPUT TEST-OUT. A01. READ TEST-FILE AT END GO TO Z99 END-READ. WRITE TEST-REC-OUT FROM TEST-REC END-WRITE. GO TO A01. Z99. CLOSE TEST-FILE. CLOSE TEST-OUT. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([cat TEST-FILE | ./prog], [0], [a ab abc abcd abcde abcdef ]) AT_CLEANUP AT_SETUP([Environment/Argument variable]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X(4). 01 Y PIC X(8). 01 Z PIC 9(4). PROCEDURE DIVISION. DISPLAY "TEST_ENV" UPON ENVIRONMENT-NAME END-DISPLAY. ACCEPT X FROM ENVIRONMENT-VALUE END-ACCEPT. DISPLAY "(" X ")" END-DISPLAY. DISPLAY "RXW" UPON ENVIRONMENT-VALUE END-DISPLAY. ACCEPT X FROM ENVIRONMENT-VALUE END-ACCEPT. DISPLAY "(" X ")" END-DISPLAY. ACCEPT Y FROM ARGUMENT-VALUE END-ACCEPT. DISPLAY "(" Y ")" END-DISPLAY. ACCEPT Z FROM ARGUMENT-NUMBER END-ACCEPT. DISPLAY "(" Z ")" END-DISPLAY. STOP RUN. ]) export TEST_ENV=OK AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog CHECKPAR], [0], [(OK ) (RXW ) (CHECKPAR) (0001) ]) AT_CLEANUP AT_SETUP([DECIMAL-POINT is COMMA (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [00,50 ]) AT_CLEANUP AT_SETUP([DECIMAL-POINT is COMMA (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,, 5) TO X. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [03,00 ]) AT_CLEANUP AT_SETUP([DECIMAL-POINT is COMMA (3)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,, 1,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [01,50 ]) AT_CLEANUP AT_SETUP([DECIMAL-POINT is COMMA (4)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. MOVE FUNCTION MIN (3,,,,,,1,5) TO X. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [00,10 ]) AT_CLEANUP AT_SETUP([DECIMAL-POINT is COMMA (5)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99V99. PROCEDURE DIVISION. COMPUTE X=1 + ,1 END-COMPUTE DISPLAY X END-DISPLAY. COMPUTE X=1*,1 END-COMPUTE DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [01,10 00,10 ]) AT_CLEANUP AT_SETUP([78 Level (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 78 X VALUE "OK". PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [OK ]) AT_CLEANUP AT_SETUP([78 Level (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Z. 78 X VALUE "OK". 78 Y VALUE "OK". 03 FILLER PIC XX VALUE "OK". PROCEDURE DIVISION. DISPLAY X Z Y END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [OKOKOK ]) AT_CLEANUP AT_SETUP([78 Level (3)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 78 X VALUE "OK". 01 Z PIC XX VALUE "OK". PROCEDURE DIVISION. DISPLAY Z X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [OKOK ]) AT_CLEANUP AT_SETUP([Unreachable statement]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. P01. GO TO P02. DISPLAY "INVALID" END-DISPLAY. P02. STOP RUN. ]) AT_CHECK([${COMPILE} -Wunreachable prog.cob], [0], , [prog.cob: In paragraph 'P01': prog.cob:9: Warning: Unreachable statement ]) AT_CLEANUP open-cobol-1.1/tests/Makefile.am0000644000000000000000000000370511130701401012226 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## SUBDIRS = cobol85 TESTS = $(srcdir)/syntax \ $(srcdir)/run \ $(srcdir)/run-O \ $(srcdir)/data-rep \ $(srcdir)/data-rep-O syntax_DEPENDENCIES = \ syntax.at \ syntax.src/copy.at \ syntax.src/definition.at \ syntax.src/expression.at \ syntax.src/multiply.at \ syntax.src/redefines.at \ syntax.src/value.at \ syntax.src/move.at \ syntax.src/set.at \ syntax.src/occurs.at \ syntax.src/subscripts.at run_DEPENDENCIES = \ run.at \ run.src/fundamental.at \ run.src/accept.at \ run.src/initialize.at \ run.src/misc.at \ run.src/ref-mod.at \ run.src/subscripts.at \ run.src/extensions.at \ run.src/return-code.at \ run.src/functions.at data_rep_DEPENDENCIES = \ data-rep.at \ data-rep.src/binary.at \ data-rep.src/display.at \ data-rep.src/packed.at \ data-rep.src/pointer.at \ data-rep.src/numeric-dump.cob \ data-rep.src/numeric-display.cob EXTRA_DIST = $(srcdir)/package.m4 $(TESTS) \ $(syntax_DEPENDENCIES) \ $(run_DEPENDENCIES) \ $(data_rep_DEPENDENCIES) DISTCLEANFILES = atconfig all: $(TESTS) clean-local: rm -rf *.dir *.log $(srcdir)/package.m4: $(top_srcdir)/configure.ac @echo "creating $(srcdir)/package.m4" @{ \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } > $(srcdir)/package.m4 $(srcdir)/%: $(srcdir)/%.at $(srcdir)/package.m4 autom4te --language=autotest -I $(srcdir) -I $@.src -o $@ $< chmod +x $@ $(srcdir)/syntax: $(syntax_DEPENDENCIES) $(srcdir)/run: $(run_DEPENDENCIES) $(srcdir)/data-rep: $(data_rep_DEPENDENCIES) open-cobol-1.1/tests/Makefile.in0000644000000000000000000004560211130703171012247 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/atlocal.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = atlocal SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = cobol85 TESTS = $(srcdir)/syntax \ $(srcdir)/run \ $(srcdir)/run-O \ $(srcdir)/data-rep \ $(srcdir)/data-rep-O syntax_DEPENDENCIES = \ syntax.at \ syntax.src/copy.at \ syntax.src/definition.at \ syntax.src/expression.at \ syntax.src/multiply.at \ syntax.src/redefines.at \ syntax.src/value.at \ syntax.src/move.at \ syntax.src/set.at \ syntax.src/occurs.at \ syntax.src/subscripts.at run_DEPENDENCIES = \ run.at \ run.src/fundamental.at \ run.src/accept.at \ run.src/initialize.at \ run.src/misc.at \ run.src/ref-mod.at \ run.src/subscripts.at \ run.src/extensions.at \ run.src/return-code.at \ run.src/functions.at data_rep_DEPENDENCIES = \ data-rep.at \ data-rep.src/binary.at \ data-rep.src/display.at \ data-rep.src/packed.at \ data-rep.src/pointer.at \ data-rep.src/numeric-dump.cob \ data-rep.src/numeric-display.cob EXTRA_DIST = $(srcdir)/package.m4 $(TESTS) \ $(syntax_DEPENDENCIES) \ $(run_DEPENDENCIES) \ $(data_rep_DEPENDENCIES) DISTCLEANFILES = atconfig all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh atlocal: $(top_builddir)/config.status $(srcdir)/atlocal.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) $(mkdir_p) $(distdir)/$(srcdir) $(distdir)/data-rep.src $(distdir)/run.src $(distdir)/syntax.src @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-TESTS \ check-am clean clean-generic clean-libtool clean-local \ clean-recursive ctags ctags-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am all: $(TESTS) clean-local: rm -rf *.dir *.log $(srcdir)/package.m4: $(top_srcdir)/configure.ac @echo "creating $(srcdir)/package.m4" @{ \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } > $(srcdir)/package.m4 $(srcdir)/%: $(srcdir)/%.at $(srcdir)/package.m4 autom4te --language=autotest -I $(srcdir) -I $@.src -o $@ $< chmod +x $@ $(srcdir)/syntax: $(syntax_DEPENDENCIES) $(srcdir)/run: $(run_DEPENDENCIES) $(srcdir)/data-rep: $(data_rep_DEPENDENCIES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/tests/syntax.at0000644000000000000000000000246311130701401012046 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_INIT([Syntax Tests]) AT_TESTED([cobc]) m4_include([copy.at]) m4_include([definition.at]) m4_include([expression.at]) m4_include([subscripts.at]) # 8.4.1.2 Subscripts m4_include([occurs.at]) # 13.16.36 OCCURS clause m4_include([redefines.at]) # 13.16.42 REDEFINES clause m4_include([value.at]) # 13.16.61 VALUE clause m4_include([move.at]) # 14.8.24 MOVE statement m4_include([multiply.at]) # 14.8.25 MULTIPLY statement m4_include([set.at]) # 14.8.35 MULTIPLY statement open-cobol-1.1/tests/run.at0000644000000000000000000000233611130701401011323 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_INIT([Run Tests]) AT_TESTED([cobc]) m4_include([fundamental.at]) m4_include([subscripts.at]) # 8.4.1.2 Subscripts m4_include([ref-mod.at]) # 8.4.2.3 Reference-modification m4_include([accept.at]) # 14.8.1 ACCEPT statement m4_include([initialize.at]) # 14.8.19 INITIALIZE statement m4_include([misc.at]) m4_include([extensions.at]) m4_include([return-code.at]) m4_include([functions.at]) open-cobol-1.1/tests/syntax0000755000000000000000000045700011143001517011454 #! /bin/sh ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Load the config file. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2 { (exit 1); exit 1; }; } done # atconfig delivers paths relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir in srcdir top_srcdir top_builddir do at_val=`eval echo '${'at_$at_dir'}'` eval "$at_dir=\$at_val/../.." done fi # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? at_verbose=: at_quiet=echo # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # List test groups? at_list_p=false # Test groups to run at_groups= # The directory we are in. at_dir=`pwd` # The directory the whole suite works in. # Should be absolutely to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite. at_suite_log=$at_dir/$as_me.log # The file containing the location of the last AT_CHECK. at_check_line_file=$at_suite_dir/at-check-line # The file containing the exit status of the last command. at_status_file=$at_suite_dir/at-status # The files containing the output of the tested commands. at_stdout=$at_suite_dir/at-stdout at_stder1=$at_suite_dir/at-stder1 at_stderr=$at_suite_dir/at-stderr # The file containing dates. at_times_file=$at_suite_dir/at-times # List of the tested programs. at_tested='cobc' # List of the all the test groups. at_groups_all=' 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' # As many dots as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='..' # Description of all the test groups. at_help_all='1;copy.at:22;COPY: file not found;copy; 2;copy.at:42;COPY: replacement order;copy; 3;copy.at:69;COPY: separators;copy; 4;copy.at:98;COPY: partial replacement;copy; 5;copy.at:128;COPY: recursive replacement;copy; 6;definition.at:25;Invalid PROGRAM-ID;; 7;definition.at:40;Invalid PROGRAM-ID type clause (1);; 8;definition.at:55;Invalid PROGRAM-ID type clause (2);; 9;definition.at:76;Undefined data name;; 10;definition.at:93;Undefined group name;; 11;definition.at:113;Undefined data name in group;; 12;definition.at:135;Reference not a group name;; 13;definition.at:158;Incomplete 01 definition;; 14;definition.at:177;Same labels in different sections;; 15;definition.at:201;Redefinition of 01 items;; 16;definition.at:219;Redefinition of 01 and 02 items;; 17;definition.at:237;Redefinition of 02 items;; 18;definition.at:256;Redefinition of 77 items;; 19;definition.at:274;Redefinition of 01 and 77 items;; 20;definition.at:292;Redefinition of 88 items;; 21;definition.at:311;Ambiguous reference to 02 items;; 22;definition.at:336;Ambiguous reference to 02 and 03 items;; 23;definition.at:360;Ambiguous reference with qualification;; 24;definition.at:389;Unique reference with ambiguous qualifiers;; 25;definition.at:424;Undefined procedure name;; 26;definition.at:443;Redefinition of section names;; 27;definition.at:462;Redefinition of section and paragraph names;; 28;definition.at:481;Redefinition of paragraph names;; 29;definition.at:504;Ambiguous reference to paragraph name;; 30;definition.at:528;Non-matching level numbers (extension);; 31;expression.at:21;Ambiguous AND/OR;; 32;expression.at:45;START on SEQUENTIAL file;; 33;subscripts.at:31;Subscripted item requires OCCURS clause;; 34;subscripts.at:58;The number of subscripts;; 35;occurs.at:28;OCCURS with level 01, 66, 77, and 88;; 36;occurs.at:53;OCCURS with variable-occurrence data item;; 37;occurs.at:90;Nested OCCURS clause;; 38;occurs.at:136;OCCURS DEPENDING followed by another field;; 39;occurs.at:174;OCCURS DEPENDING without TO clause;; 40;redefines.at:28;REDEFINES: not following entry-name;redefines; 41;redefines.at:49;REDEFINES: level 02 by 01;redefines; 42;redefines.at:70;REDEFINES: level 03 by 02;redefines; 43;redefines.at:92;REDEFINES: level 66;redefines; 44;redefines.at:114;REDEFINES: level 88;redefines; 45;redefines.at:143;REDEFINES: lower level number;redefines; 46;redefines.at:169;REDEFINES: with OCCURS;redefines; 47;redefines.at:190;REDEFINES: with subscript;redefines; 48;redefines.at:212;REDEFINES: with variable occurrence;redefines; 49;redefines.at:247;REDEFINES: with qualification;redefines; 50;redefines.at:273;REDEFINES: multiple redefinition;redefines; 51;redefines.at:301;REDEFINES: size exceeds;redefines; 52;redefines.at:334;REDEFINES: with VALUE;redefines; 53;redefines.at:362;REDEFINES: with intervention;redefines; 54;redefines.at:391;REDEFINES: within REDEFINES;redefines; 55;value.at:43;Numeric item (integer);; 56;value.at:68;Numeric item (non-integer);; 57;value.at:90;Numeric item with picture P;; 58;value.at:121;Signed numeric literal;; 59;value.at:146;Alphabetic item;; 60;value.at:171;Alphanumeric item;; 61;value.at:192;Alphanumeric group item;; 62;value.at:226;Numeric-edited item;; 63;value.at:249;Alphanumeric-edited item;; 64;move.at:37;MOVE SPACE TO numeric or numeric-edited item;; 65;move.at:62;MOVE ZERO TO alphabetic item;; 66;move.at:87;MOVE alphabetic TO x;; 67;move.at:116;MOVE alphanumeric TO x;; 68;move.at:142;MOVE alphanumeric-edited TO x;; 69;move.at:171;MOVE numeric (integer) TO x;; 70;move.at:199;MOVE numeric (non-integer) TO x;; 71;move.at:229;MOVE numeric-edited TO x;; 72;move.at:263;Operands must be groups;; 73;move.at:295;MOVE: misc;; 74;multiply.at:28;Category check of Format 1;; 75;multiply.at:66;Category check of Format 2;; 76;multiply.at:106;Category check of literals;; 77;set.at:24;SET: misc;; ' at_keywords= at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) echo "$as_me (OpenCOBOL 1.1)" exit 0 ;; --clean | -c ) rm -rf $at_suite_dir $at_suite_log exit 0 ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=echo; at_quiet=: ;; --trace | -x ) at_traceon='set -vx'; at_traceoff='set +vx' ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_groups="$at_groups$at_option " ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'` at_groups="$at_groups$at_range " ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d '-'` at_range=`echo " $at_groups_all " | \ sed -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`echo $at_option |sed 's,-.*,,'` at_range_end=`echo $at_option |sed 's,.*-,,'` # FIXME: Maybe test to make sure start <= end? at_range=`echo " $at_groups_all " | \ sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \ -e 's, '$at_range_end' .*$, '$at_range_end','` at_groups="$at_groups$at_range " ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_keywords="$at_keywords,$at_optarg" ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $at_envvar" >&2 { (exit 1); exit 1; }; } at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$at_envvar='$at_value'" export $at_envvar # Propagate to debug scripts. at_debug_args="$at_debug_args $at_option" ;; *) echo "$as_me: invalid option: $at_option" >&2 echo "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Process the --keywords if test -n "$at_keywords"; then at_groups_selected=$at_help_all for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}` do # It is on purpose that we match the test group titles too. at_groups_selected=`echo "$at_groups_selected" | grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"` done at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'` # Smash the end of lines. at_groups_selected=`echo $at_groups_selected` at_groups="$at_groups$at_groups_selected " fi # Selected test groups. test -z "$at_groups" && at_groups=$at_groups_all # Help message. if $at_help_p; then cat <<_ATEOF Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, and save a detailed log file. Upon failure, create debugging scripts. You should not change environment variables unless explicitly passed as command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relatively to the top level of this distribution. E.g., $ $0 AUTOTEST_PATH=bin possibly amounts into PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH _ATEOF cat <<_ATEOF Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF Execution tuning: -k, --keywords=KEYWORDS select the tests matching all the comma separated KEYWORDS accumulates -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and debug script creation default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF Report bugs to . _ATEOF exit 0 fi # List of tests. if $at_list_p; then cat <<_ATEOF OpenCOBOL 1.1 test suite: Syntax Tests test groups: NUM: FILENAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # " 1 42 45 " => "^(1|42|45);". at_groups_pattern=`echo "$at_groups" | sed 's/^ *//;s/ *$//;s/ */|/g'` echo "$at_help_all" | awk 'BEGIN { FS = ";" } { if ($1 !~ /^('"$at_groups_pattern"')$/) next } { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3 if ($4) printf " %s\n", $4 } ' exit 0 fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites, AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in [\\/]* | ?:[\\/]* ) at_path=$at_path$PATH_SEPARATOR$as_dir ;; * ) if test -z "$at_top_builddir"; then # Stand-alone test suite. at_path=$at_path$PATH_SEPARATOR$as_dir else # Embedded test suite. at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir fi ;; esac done # Now build and simplify PATH. PATH= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` test -d "$as_dir" || continue case $PATH in $as_dir | \ $as_dir$PATH_SEPARATOR* | \ *$PATH_SEPARATOR$as_dir | \ *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;; '') PATH=$as_dir ;; *) PATH=$PATH$PATH_SEPARATOR$as_dir ;; esac done export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. $at_debug_p && at_suite_log=/dev/null exec 5>$at_suite_log # Banners and logs. cat <<\_ASBOX ## --------------------------------------- ## ## OpenCOBOL 1.1 test suite: Syntax Tests. ## ## --------------------------------------- ## _ASBOX { cat <<\_ASBOX ## --------------------------------------- ## ## OpenCOBOL 1.1 test suite: Syntax Tests. ## ## --------------------------------------- ## _ASBOX echo echo "$as_me: command line was:" echo " $ $0 $at_cli_args" echo # Try to find a few ChangeLogs in case it might help determining the # exact version. Use the relative dir: if the top dir is a symlink, # find will not follow it (and options to follow the links are not # portable), which would result in no output here. if test -n "$at_top_srcdir"; then cat <<\_ASBOX ## ----------- ## ## ChangeLogs. ## ## ----------- ## _ASBOX echo for at_file in `find "$at_top_srcdir" -name ChangeLog -print` do echo "$as_me: $at_file:" sed 's/^/| /;10q' $at_file echo done { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } echo fi # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done cat <<\_ASBOX ## ---------------- ## ## Tested programs. ## ## ---------------- ## _ASBOX echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f $as_dir/$at_program && break done if test -f $as_dir/$at_program; then { echo "syntax.at:21: $as_dir/$at_program --version" $as_dir/$at_program --version echo } >&5 2>&1 else { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5 echo "$as_me: error: cannot find $at_program" >&2;} { (exit 1); exit 1; }; } fi done { cat <<\_ASBOX ## ------------------ ## ## Running the tests. ## ## ------------------ ## _ASBOX } >&5 at_start_date=`date` at_start_time=`(date +%s) 2>/dev/null` echo "$as_me: starting at: $at_start_date" >&5 at_xpass_list= at_xfail_list= at_pass_list= at_fail_list= at_skip_list= at_group_count=0 # Create the master directory if it doesn't already exist. test -d $at_suite_dir || mkdir $at_suite_dir || { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5 echo "$as_me: error: cannot create $at_suite_dir" >&2;} { (exit 1); exit 1; }; } # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull cp /dev/null $at_devnull fi # Use `diff -u' when possible. if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then at_diff='diff -u' else at_diff=diff fi for at_group in $at_groups do # Be sure to come back to the top test directory. cd $at_suite_dir case $at_group in banner-*) at_group_log=$at_suite_log ;; *) # Skip tests we already run (using --keywords makes it easy to get # duplication). case " $at_pass_test $at_skip_test $at_fail_test " in *" $at_group "* ) continue;; esac # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log rm -rf $at_group_dir mkdir $at_group_dir || { { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5 echo "$as_me: error: cannot create $at_group_dir" >&2;} { (exit 1); exit 1; }; } cd $at_group_dir ;; esac echo 0 > $at_status_file # Clearly separate the test groups when verbose. test $at_group_count != 0 && $at_verbose # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log if test $at_verbose = echo; then at_tee_pipe="tee -a $at_group_log" else at_tee_pipe="cat >> $at_group_log" fi case $at_group in 1 ) # 1. copy.at:22: COPY: file not found at_setup_line='copy.at:22' at_desc='COPY: file not found' $at_quiet $ECHO_N " 1: COPY: file not found $ECHO_C" at_xfail=no ( echo "1. copy.at:22: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "copy.at:37: \${COMPILE_ONLY} prog.cob" echo copy.at:37 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: copy.inc: No such file or directory " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "copy.at:37: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 2 ) # 2. copy.at:42: COPY: replacement order at_setup_line='copy.at:42' at_desc='COPY: replacement order' $at_quiet $ECHO_N " 2: COPY: replacement order $ECHO_C" at_xfail=no ( echo "2. copy.at:42: testing ..." $at_traceon cat >copy.inc <<'_ATEOF' 01 TEST-VAR PIC X(2) VALUE "OK". _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==TEST-VAR== BY ==FIRST-MATCH== ==TEST-VAR== BY ==SECOND-MATCH==. PROCEDURE DIVISION. DISPLAY FIRST-MATCH NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "copy.at:63: \${COMPILE} -o prog prog.cob" echo copy.at:63 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:63: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "copy.at:64: ./prog" echo copy.at:64 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:64: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 3 ) # 3. copy.at:69: COPY: separators at_setup_line='copy.at:69' at_desc='COPY: separators' $at_quiet $ECHO_N " 3: COPY: separators $ECHO_C" at_xfail=no ( echo "3. copy.at:69: testing ..." $at_traceon cat >copy.inc <<'_ATEOF' 01 TEST-VAR PIC X(2) VALUE "OK". _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==TEST-VAR==, BY ==FIRST-MATCH==, , ==TEST-VAR==; BY ==SECOND-MATCH==; ; ==TEST-VAR== , BY ==THIRD-MATCH== ==TEST-VAR== ; BY ==FOURTH-MATCH==. PROCEDURE DIVISION. DISPLAY FIRST-MATCH NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "copy.at:92: \${COMPILE} -o prog prog.cob" echo copy.at:92 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:92: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "copy.at:93: ./prog" echo copy.at:93 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:93: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 4 ) # 4. copy.at:98: COPY: partial replacement at_setup_line='copy.at:98' at_desc='COPY: partial replacement' $at_quiet $ECHO_N " 4: COPY: partial replacement $ECHO_C" at_xfail=no ( echo "4. copy.at:98: testing ..." $at_traceon cat >copy.inc <<'_ATEOF' 01 :TEST:-VAR PIC X(2) VALUE "OK". 01 (TEST)-VAR PIC X(2) VALUE "OK". _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy.inc" REPLACING ==:TEST:== BY ==COLON== ==(TEST)== BY ==PAREN==. PROCEDURE DIVISION. DISPLAY COLON-VAR NO ADVANCING END-DISPLAY. DISPLAY PAREN-VAR NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "copy.at:122: \${COMPILE} -o prog prog.cob" echo copy.at:122 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:122: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "copy.at:123: ./prog" echo copy.at:123 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OKOK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:123: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 5 ) # 5. copy.at:128: COPY: recursive replacement at_setup_line='copy.at:128' at_desc='COPY: recursive replacement' $at_quiet $ECHO_N " 5: COPY: recursive replacement $ECHO_C" at_xfail=no ( echo "5. copy.at:128: testing ..." $at_traceon cat >copy-2.inc <<'_ATEOF' 01 TEST-VAR PIC X(2) VALUE "OK". _ATEOF cat >copy-1.inc <<'_ATEOF' COPY "copy-2.inc". _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. COPY "copy-1.inc" REPLACING ==TEST-VAR== BY ==COPY-VAR==. PROCEDURE DIVISION. DISPLAY COPY-VAR NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "copy.at:152: \${COMPILE} -o prog prog.cob" echo copy.at:152 >$at_check_line_file ( $at_traceon; ${COMPILE} -o prog prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:152: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "copy.at:153: ./prog" echo copy.at:153 >$at_check_line_file ( $at_traceon; ./prog ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: echo >>$at_stdout; echo "OK" | $at_diff - $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "copy.at:153: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 6 ) # 6. definition.at:25: Invalid PROGRAM-ID at_setup_line='definition.at:25' at_desc='Invalid PROGRAM-ID' $at_quiet $ECHO_N " 6: Invalid PROGRAM-ID $ECHO_C" at_xfail=no ( echo "6. definition.at:25: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. short. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "definition.at:36: \${COMPILE_ONLY} prog.cob" echo definition.at:36 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:3: Error: PROGRAM-ID 'short' invalid " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:36: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 7 ) # 7. definition.at:40: Invalid PROGRAM-ID type clause (1) at_setup_line='definition.at:40' at_desc='Invalid PROGRAM-ID type clause (1)' $at_quiet $ECHO_N " 7: Invalid PROGRAM-ID type clause (1) $ECHO_C" at_xfail=no ( echo "7. definition.at:40: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog IS COMMON. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "definition.at:51: \${COMPILE_ONLY} prog.cob" echo definition.at:51 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:3: Error: COMMON may only be used in a nested program " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:51: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 8 ) # 8. definition.at:55: Invalid PROGRAM-ID type clause (2) at_setup_line='definition.at:55' at_desc='Invalid PROGRAM-ID type clause (2)' $at_quiet $ECHO_N " 8: Invalid PROGRAM-ID type clause (2) $ECHO_C" at_xfail=no ( echo "8. definition.at:55: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog IS INITIAL RECURSIVE. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "definition.at:66: \${COMPILE_ONLY} prog.cob" echo definition.at:66 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:3: Error: syntax error, unexpected RECURSIVE, expecting '.' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:66: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 9 ) # 9. definition.at:76: Undefined data name at_setup_line='definition.at:76' at_desc='Undefined data name' $at_quiet $ECHO_N " 9: Undefined data name $ECHO_C" at_xfail=no ( echo "9. definition.at:76: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:89: \${COMPILE_ONLY} prog.cob" echo definition.at:89 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:5: Error: 'X' undefined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:89: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 10 ) # 10. definition.at:93: Undefined group name at_setup_line='definition.at:93' at_desc='Undefined group name' $at_quiet $ECHO_N " 10: Undefined group name $ECHO_C" at_xfail=no ( echo "10. definition.at:93: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. DISPLAY X IN G END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:109: \${COMPILE_ONLY} prog.cob" echo definition.at:109 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: 'X' in 'G' undefined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:109: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 11 ) # 11. definition.at:113: Undefined data name in group at_setup_line='definition.at:113' at_desc='Undefined data name in group' $at_quiet $ECHO_N " 11: Undefined data name in group $ECHO_C" at_xfail=no ( echo "11. definition.at:113: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 01 Y PIC X. PROCEDURE DIVISION. DISPLAY Y IN G END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:131: \${COMPILE_ONLY} prog.cob" echo definition.at:131 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'Y' in 'G' undefined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:131: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 12 ) # 12. definition.at:135: Reference not a group name at_setup_line='definition.at:135' at_desc='Reference not a group name' $at_quiet $ECHO_N " 12: Reference not a group name $ECHO_C" at_xfail=no ( echo "12. definition.at:135: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. DISPLAY X IN X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:151: \${COMPILE_ONLY} prog.cob" echo definition.at:151 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: 'X' in 'X' undefined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:151: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 13 ) # 13. definition.at:158: Incomplete 01 definition at_setup_line='definition.at:158' at_desc='Incomplete 01 definition' $at_quiet $ECHO_N " 13: Incomplete 01 definition $ECHO_C" at_xfail=no ( echo "13. definition.at:158: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X. _ATEOF $at_traceoff echo "definition.at:170: \${COMPILE_ONLY} prog.cob" echo definition.at:170 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: PICTURE clause required for 'X' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:170: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 14 ) # 14. definition.at:177: Same labels in different sections at_setup_line='definition.at:177' at_desc='Same labels in different sections' $at_quiet $ECHO_N " 14: Same labels in different sections $ECHO_C" at_xfail=no ( echo "14. definition.at:177: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. S-1 SECTION. L. S-2 SECTION. L. S-3 SECTION. GO TO L. L. _ATEOF $at_traceoff echo "definition.at:194: \${COMPILE_ONLY} prog.cob" echo definition.at:194 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:194: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 15 ) # 15. definition.at:201: Redefinition of 01 items at_setup_line='definition.at:201' at_desc='Redefinition of 01 items' $at_quiet $ECHO_N " 15: Redefinition of 01 items $ECHO_C" at_xfail=no ( echo "15. definition.at:201: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 X PIC X. _ATEOF $at_traceoff echo "definition.at:215: \${COMPILE_ONLY} prog.cob" echo definition.at:215 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:215: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 16 ) # 16. definition.at:219: Redefinition of 01 and 02 items at_setup_line='definition.at:219' at_desc='Redefinition of 01 and 02 items' $at_quiet $ECHO_N " 16: Redefinition of 01 and 02 items $ECHO_C" at_xfail=no ( echo "16. definition.at:219: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X. 02 X PIC X. _ATEOF $at_traceoff echo "definition.at:233: \${COMPILE_ONLY} prog.cob" echo definition.at:233 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:233: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 17 ) # 17. definition.at:237: Redefinition of 02 items at_setup_line='definition.at:237' at_desc='Redefinition of 02 items' $at_quiet $ECHO_N " 17: Redefinition of 02 items $ECHO_C" at_xfail=no ( echo "17. definition.at:237: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 02 X PIC X. _ATEOF $at_traceoff echo "definition.at:252: \${COMPILE_ONLY} prog.cob" echo definition.at:252 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Warning: Redefinition of 'X' prog.cob:7: Warning: 'X' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:252: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 18 ) # 18. definition.at:256: Redefinition of 77 items at_setup_line='definition.at:256' at_desc='Redefinition of 77 items' $at_quiet $ECHO_N " 18: Redefinition of 77 items $ECHO_C" at_xfail=no ( echo "18. definition.at:256: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 77 X PIC X. 77 X PIC X. _ATEOF $at_traceoff echo "definition.at:270: \${COMPILE_ONLY} prog.cob" echo definition.at:270 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:270: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 19 ) # 19. definition.at:274: Redefinition of 01 and 77 items at_setup_line='definition.at:274' at_desc='Redefinition of 01 and 77 items' $at_quiet $ECHO_N " 19: Redefinition of 01 and 77 items $ECHO_C" at_xfail=no ( echo "19. definition.at:274: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 77 X PIC X. _ATEOF $at_traceoff echo "definition.at:288: \${COMPILE_ONLY} prog.cob" echo definition.at:288 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Redefinition of 'X' prog.cob:6: Warning: 'X' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:288: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 20 ) # 20. definition.at:292: Redefinition of 88 items at_setup_line='definition.at:292' at_desc='Redefinition of 88 items' $at_quiet $ECHO_N " 20: Redefinition of 88 items $ECHO_C" at_xfail=no ( echo "20. definition.at:292: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 88 A VALUE "A". 88 A VALUE "B". _ATEOF $at_traceoff echo "definition.at:307: \${COMPILE_ONLY} prog.cob" echo definition.at:307 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Warning: Redefinition of 'A' prog.cob:7: Warning: 'A' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:307: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 21 ) # 21. definition.at:311: Ambiguous reference to 02 items at_setup_line='definition.at:311' at_desc='Ambiguous reference to 02 items' $at_quiet $ECHO_N " 21: Ambiguous reference to 02 items $ECHO_C" at_xfail=no ( echo "21. definition.at:311: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 01 G2. 02 X PIC X. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:332: \${COMPILE_ONLY} prog.cob" echo definition.at:332 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:11: Error: 'X' ambiguous; need qualification prog.cob:7: Error: 'X' in 'G1' defined here prog.cob:9: Error: 'X' in 'G2' defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:332: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 22 ) # 22. definition.at:336: Ambiguous reference to 02 and 03 items at_setup_line='definition.at:336' at_desc='Ambiguous reference to 02 and 03 items' $at_quiet $ECHO_N " 22: Ambiguous reference to 02 and 03 items $ECHO_C" at_xfail=no ( echo "22. definition.at:336: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X. 03 X PIC X. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:356: \${COMPILE_ONLY} prog.cob" echo definition.at:356 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'X' ambiguous; need qualification prog.cob:7: Error: 'X' in 'G' defined here prog.cob:8: Error: 'X' in 'X' in 'G' defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:356: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 23 ) # 23. definition.at:360: Ambiguous reference with qualification at_setup_line='definition.at:360' at_desc='Ambiguous reference with qualification' $at_quiet $ECHO_N " 23: Ambiguous reference with qualification $ECHO_C" at_xfail=no ( echo "23. definition.at:360: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X. 03 Y PIC X. 01 G2. 02 X. 03 Y PIC X. PROCEDURE DIVISION. DISPLAY Y OF X END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:383: \${COMPILE_ONLY} prog.cob" echo definition.at:383 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:13: Error: 'Y' in 'X' ambiguous; need qualification prog.cob:8: Error: 'Y' in 'X' in 'G1' defined here prog.cob:11: Error: 'Y' in 'X' in 'G2' defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:383: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 24 ) # 24. definition.at:389: Unique reference with ambiguous qualifiers at_setup_line='definition.at:389' at_desc='Unique reference with ambiguous qualifiers' $at_quiet $ECHO_N " 24: Unique reference with ambiguous qualifiers $ECHO_C" at_xfail=no ( echo "24. definition.at:389: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X. 03 Y PIC X VALUE "Y". 01 G2. 02 X. 03 Z PIC X VALUE "Z". PROCEDURE DIVISION. DISPLAY Z OF X NO ADVANCING END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "definition.at:408: \${COMPILE_ONLY} prog.cob" echo definition.at:408 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:408: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 25 ) # 25. definition.at:424: Undefined procedure name at_setup_line='definition.at:424' at_desc='Undefined procedure name' $at_quiet $ECHO_N " 25: Undefined procedure name $ECHO_C" at_xfail=no ( echo "25. definition.at:424: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. GO TO END-OF-PROGRAM. STOP RUN. _ATEOF $at_traceoff echo "definition.at:436: \${COMPILE_ONLY} prog.cob" echo definition.at:436 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:5: Error: 'END-OF-PROGRAM' undefined " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:436: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 26 ) # 26. definition.at:443: Redefinition of section names at_setup_line='definition.at:443' at_desc='Redefinition of section names' $at_quiet $ECHO_N " 26: Redefinition of section names $ECHO_C" at_xfail=no ( echo "26. definition.at:443: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L SECTION. L SECTION. STOP RUN. _ATEOF $at_traceoff echo "definition.at:458: \${COMPILE_ONLY} prog.cob" echo definition.at:458 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob: In section 'L': prog.cob:6: Error: Redefinition of 'L' prog.cob:5: Error: 'L' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:458: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 27 ) # 27. definition.at:462: Redefinition of section and paragraph names at_setup_line='definition.at:462' at_desc='Redefinition of section and paragraph names' $at_quiet $ECHO_N " 27: Redefinition of section and paragraph names $ECHO_C" at_xfail=no ( echo "27. definition.at:462: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L SECTION. L. STOP RUN. _ATEOF $at_traceoff echo "definition.at:477: \${COMPILE_ONLY} prog.cob" echo definition.at:477 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob: In section 'L': prog.cob:6: Error: Redefinition of 'L' prog.cob:5: Error: 'L' previously defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:477: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 28 ) # 28. definition.at:481: Redefinition of paragraph names at_setup_line='definition.at:481' at_desc='Redefinition of paragraph names' $at_quiet $ECHO_N " 28: Redefinition of paragraph names $ECHO_C" at_xfail=no ( echo "28. definition.at:481: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. L. L. STOP RUN. _ATEOF $at_traceoff echo "definition.at:493: \${COMPILE_ONLY} prog.cob" echo definition.at:493 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:493: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon ## Change when we DON'T allow this ## AT_CHECK([${COMPILE_ONLY} prog.cob], [1], , ## [prog.cob: In paragraph 'L': ## prog.cob:6: Error: redefinition of 'L' ## prog.cob:5: Error: 'L' previously defined here ## ]) $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 29 ) # 29. definition.at:504: Ambiguous reference to paragraph name at_setup_line='definition.at:504' at_desc='Ambiguous reference to paragraph name' $at_quiet $ECHO_N " 29: Ambiguous reference to paragraph name $ECHO_C" at_xfail=no ( echo "29. definition.at:504: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. S-1 SECTION. L. S-2 SECTION. L. S-3 SECTION. GO TO L. STOP RUN. _ATEOF $at_traceoff echo "definition.at:524: \${COMPILE_ONLY} prog.cob" echo definition.at:524 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob: In section 'S-3': prog.cob:10: Error: 'L' ambiguous; need qualification prog.cob:6: Error: 'L' in 'S-1' defined here prog.cob:8: Error: 'L' in 'S-2' defined here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "definition.at:524: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 30 ) # 30. definition.at:528: Non-matching level numbers (extension) at_setup_line='definition.at:528' at_desc='Non-matching level numbers (extension)' $at_quiet $ECHO_N " 30: Non-matching level numbers (extension) $ECHO_C" at_xfail=no ( echo "30. definition.at:528: testing ..." $at_traceon cat >test.conf <<'_ATEOF' include "default.conf" relax-level-hierarchy: yes _ATEOF cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 A. 05 B. 10 C PIC X. 04 D. 05 E PIC X. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "definition.at:551: \${COMPILE_ONLY} -conf=test.conf prog.cob" echo definition.at:551 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} -conf=test.conf prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Warning: No previous data item of level 04 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "definition.at:551: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 31 ) # 31. expression.at:21: Ambiguous AND/OR at_setup_line='expression.at:21' at_desc='Ambiguous AND/OR' $at_quiet $ECHO_N " 31: Ambiguous AND/OR $ECHO_C" at_xfail=no ( echo "31. expression.at:21: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. PROCEDURE DIVISION. IF 3 = 1 AND 2 OR 3 DISPLAY "OK" END-DISPLAY END-IF. IF 3 = 1 OR 2 AND 3 DISPLAY "NO" END-DISPLAY END-IF. STOP RUN. _ATEOF $at_traceoff echo "expression.at:41: \${COMPILE_ONLY} prog.cob" echo expression.at:41 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Warning: Suggest parentheses around AND within OR prog.cob:10: Warning: Suggest parentheses around AND within OR " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "expression.at:41: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 32 ) # 32. expression.at:45: START on SEQUENTIAL file at_setup_line='expression.at:45' at_desc='START on SEQUENTIAL file' $at_quiet $ECHO_N " 32: START on SEQUENTIAL file $ECHO_C" at_xfail=no ( echo "32. expression.at:45: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT TEST-FILE ASSIGN "./TEST-FILE" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD TEST-FILE. 01 TEST-REC PIC X(4). PROCEDURE DIVISION. OPEN INPUT TEST-FILE. START TEST-FILE KEY EQUAL TEST-REC END-START. CLOSE TEST-FILE. STOP RUN. _ATEOF $at_traceoff echo "expression.at:69: \${COMPILE_ONLY} prog.cob" echo expression.at:69 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:16: Error: START not allowed on SEQUENTIAL files " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "expression.at:69: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 33 ) # 33. subscripts.at:31: Subscripted item requires OCCURS clause at_setup_line='subscripts.at:31' at_desc='Subscripted item requires OCCURS clause' $at_quiet $ECHO_N " 33: Subscripted item requires OCCURS clause $ECHO_C" at_xfail=no ( echo "33. subscripts.at:31: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. PROCEDURE DIVISION. DISPLAY G(1) END-DISPLAY. DISPLAY X(1) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:51: \${COMPILE_ONLY} prog.cob" echo subscripts.at:51 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Error: 'G' cannot be subscripted prog.cob:11: Error: 'X' cannot be subscripted " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:51: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 34 ) # 34. subscripts.at:58: The number of subscripts at_setup_line='subscripts.at:58' at_desc='The number of subscripts' $at_quiet $ECHO_N " 34: The number of subscripts $ECHO_C" at_xfail=no ( echo "34. subscripts.at:58: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X OCCURS 2. 03 Y PIC X OCCURS 3. PROCEDURE DIVISION. DISPLAY X END-DISPLAY. DISPLAY X(1) END-DISPLAY. DISPLAY X(1, 2) END-DISPLAY. DISPLAY Y(1) END-DISPLAY. DISPLAY Y(1, 2) END-DISPLAY. DISPLAY Y(1, 2, 3) END-DISPLAY. STOP RUN. _ATEOF $at_traceoff echo "subscripts.at:89: \${COMPILE_ONLY} prog.cob" echo subscripts.at:89 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'X' requires 1 subscript prog.cob:14: Error: 'X' requires 1 subscript prog.cob:16: Error: 'Y' requires 2 subscripts prog.cob:20: Error: 'Y' requires 2 subscripts " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "subscripts.at:89: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 35 ) # 35. occurs.at:28: OCCURS with level 01, 66, 77, and 88 at_setup_line='occurs.at:28' at_desc='OCCURS with level 01, 66, 77, and 88' $at_quiet $ECHO_N " 35: OCCURS with level 01, 66, 77, and 88 $ECHO_C" at_xfail=no ( echo "35. occurs.at:28: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-01 PIC X OCCURS 10. 01 G OCCURS 10. 02 X-02 PIC X OCCURS 10. 66 X-66 RENAMES X-02 OCCURS 10. 77 X-77 PIC X OCCURS 10. 88 X-88 VALUE "X" OCCURS 10. _ATEOF $at_traceoff echo "occurs.at:49: \${COMPILE_ONLY} prog.cob" echo occurs.at:49 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:11: Error: Level 88 item 'X-88' cannot have other than VALUE clause prog.cob:6: Error: Level 01 item 'X-01' cannot have OCCURS clause prog.cob:7: Error: Level 01 item 'G' cannot have OCCURS clause prog.cob:9: Error: Level 66 item 'X-66' cannot have other than RENAMES clause prog.cob:10: Error: Level 77 item 'X-77' cannot have OCCURS clause " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "occurs.at:49: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 36 ) # 36. occurs.at:53: OCCURS with variable-occurrence data item at_setup_line='occurs.at:53' at_desc='OCCURS with variable-occurrence data item' $at_quiet $ECHO_N " 36: OCCURS with variable-occurrence data item $ECHO_C" at_xfail=no ( echo "36. occurs.at:53: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 G-2 OCCURS 10. 03 X PIC X(10) OCCURS 1 TO 4 DEPENDING ON I. 77 I PIC 9. _ATEOF $at_traceoff echo "occurs.at:68: \${COMPILE_ONLY} prog.cob" echo occurs.at:68 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Error: 'G-2' cannot have the OCCURS clause due to 'X' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "occurs.at:68: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 37 ) # 37. occurs.at:90: Nested OCCURS clause at_setup_line='occurs.at:90' at_desc='Nested OCCURS clause' $at_quiet $ECHO_N " 37: Nested OCCURS clause $ECHO_C" at_xfail=no ( echo "37. occurs.at:90: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 G-2 OCCURS 2. 03 G-3 OCCURS 2. 04 G-4 OCCURS 2. 05 G-5 OCCURS 2. 06 G-6 OCCURS 2. 07 G-7 OCCURS 2. 08 G-8 OCCURS 2. 09 X PIC X. _ATEOF $at_traceoff echo "occurs.at:108: \${COMPILE_ONLY} prog.cob" echo occurs.at:108 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "occurs.at:108: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 38 ) # 38. occurs.at:136: OCCURS DEPENDING followed by another field at_setup_line='occurs.at:136' at_desc='OCCURS DEPENDING followed by another field' $at_quiet $ECHO_N " 38: OCCURS DEPENDING followed by another field $ECHO_C" at_xfail=no ( echo "38. occurs.at:136: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 Y PIC X. 01 G-2. 02 G-3 OCCURS 1 TO 3 DEPENDING ON I. 03 X PIC X. 02 Y PIC X. 01 G-4. 02 G-5. 03 X PIC X OCCURS 1 TO 3 DEPENDING ON I. 02 Y PIC X. 01 I PIC 9. _ATEOF $at_traceoff echo "occurs.at:161: \${COMPILE_ONLY} prog.cob" echo occurs.at:161 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Error: 'X' cannot have OCCURS DEPENDING prog.cob:10: Error: 'G-3' cannot have OCCURS DEPENDING prog.cob:15: Error: 'X' cannot have OCCURS DEPENDING " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "occurs.at:161: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 39 ) # 39. occurs.at:174: OCCURS DEPENDING without TO clause at_setup_line='occurs.at:174' at_desc='OCCURS DEPENDING without TO clause' $at_quiet $ECHO_N " 39: OCCURS DEPENDING without TO clause $ECHO_C" at_xfail=no ( echo "39. occurs.at:174: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC 9. 01 XX. 03 X PIC X OCCURS 10 DEPENDING ON Y. _ATEOF $at_traceoff echo "occurs.at:188: \${COMPILE_ONLY} prog.cob" echo occurs.at:188 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: ODO without TO clause does not conform to COBOL 2002 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "occurs.at:188: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 40 ) # 40. redefines.at:28: REDEFINES: not following entry-name at_setup_line='redefines.at:28' at_desc='REDEFINES: not following entry-name' $at_quiet $ECHO_N " 40: REDEFINES: not following entry-name $ECHO_C" at_xfail=no ( echo "40. redefines.at:28: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC 9 REDEFINES X. _ATEOF $at_traceoff echo "redefines.at:42: \${COMPILE_ONLY} prog.cob" echo redefines.at:42 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Error: REDEFINES clause must follow entry-name " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:42: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 41 ) # 41. redefines.at:49: REDEFINES: level 02 by 01 at_setup_line='redefines.at:49' at_desc='REDEFINES: level 02 by 01' $at_quiet $ECHO_N " 41: REDEFINES: level 02 by 01 $ECHO_C" at_xfail=no ( echo "41. redefines.at:49: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 01 Y REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:66: \${COMPILE_ONLY} prog.cob" echo redefines.at:66 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: Level number of REDEFINES entries must be identical " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:66: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 42 ) # 42. redefines.at:70: REDEFINES: level 03 by 02 at_setup_line='redefines.at:70' at_desc='REDEFINES: level 03 by 02' $at_quiet $ECHO_N " 42: REDEFINES: level 03 by 02 $ECHO_C" at_xfail=no ( echo "42. redefines.at:70: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2. 03 X PIC X. 02 Y REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:88: \${COMPILE_ONLY} prog.cob" echo redefines.at:88 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Error: 'X' undefined in 'G1' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:88: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 43 ) # 43. redefines.at:92: REDEFINES: level 66 at_setup_line='redefines.at:92' at_desc='REDEFINES: level 66' $at_quiet $ECHO_N " 43: REDEFINES: level 66 $ECHO_C" at_xfail=no ( echo "43. redefines.at:92: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X. 66 A RENAMES X. 66 B REDEFINES A PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:110: \${COMPILE_ONLY} prog.cob" echo redefines.at:110 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Error: Level number of REDEFINES entry cannot be 66 or 88 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:110: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 44 ) # 44. redefines.at:114: REDEFINES: level 88 at_setup_line='redefines.at:114' at_desc='REDEFINES: level 88' $at_quiet $ECHO_N " 44: REDEFINES: level 88 $ECHO_C" at_xfail=no ( echo "44. redefines.at:114: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 88 A VALUE "A". 88 B REDEFINES A VALUE "B". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:131: \${COMPILE_ONLY} prog.cob" echo redefines.at:131 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: Level number of REDEFINES entry cannot be 66 or 88 " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:131: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 45 ) # 45. redefines.at:143: REDEFINES: lower level number at_setup_line='redefines.at:143' at_desc='REDEFINES: lower level number' $at_quiet $ECHO_N " 45: REDEFINES: lower level number $ECHO_C" at_xfail=no ( echo "45. redefines.at:143: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2. 03 X PIC X. 02 G3. 03 A REDEFINES X PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:162: \${COMPILE_ONLY} prog.cob" echo redefines.at:162 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'X' undefined in 'G3' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:162: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 46 ) # 46. redefines.at:169: REDEFINES: with OCCURS at_setup_line='redefines.at:169' at_desc='REDEFINES: with OCCURS' $at_quiet $ECHO_N " 46: REDEFINES: with OCCURS $ECHO_C" at_xfail=no ( echo "46. redefines.at:169: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X OCCURS 2. 02 Y REDEFINES X PIC XX. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:186: \${COMPILE_ONLY} prog.cob" echo redefines.at:186 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Warning: The original definition 'X' should not have OCCURS " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "redefines.at:186: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 47 ) # 47. redefines.at:190: REDEFINES: with subscript at_setup_line='redefines.at:190' at_desc='REDEFINES: with subscript' $at_quiet $ECHO_N " 47: REDEFINES: with subscript $ECHO_C" at_xfail=no ( echo "47. redefines.at:190: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 G2 OCCURS 2. 03 X PIC X. 03 Y REDEFINES X(1) PIC X. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:208: \${COMPILE_ONLY} prog.cob" echo redefines.at:208 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Error: 'X' cannot be subscripted here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:208: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 48 ) # 48. redefines.at:212: REDEFINES: with variable occurrence at_setup_line='redefines.at:212' at_desc='REDEFINES: with variable occurrence' $at_quiet $ECHO_N " 48: REDEFINES: with variable occurrence $ECHO_C" at_xfail=no ( echo "48. redefines.at:212: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC XX. 02 Y REDEFINES X PIC X OCCURS 1 TO 2 DEPENDING ON I. 01 G2. 02 X PIC XX. 02 Y REDEFINES X. 03 A PIC X OCCURS 1 TO 2 DEPENDING ON I. 01 G3. 02 X. 03 A PIC X OCCURS 1 TO 2 DEPENDING ON I. 02 Y REDEFINES X PIC X. 01 I PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:240: \${COMPILE_ONLY} prog.cob" echo redefines.at:240 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: 'Y' cannot be variable length prog.cob:11: Error: 'Y' cannot be variable length prog.cob:16: Error: The original definition 'X' cannot be variable length " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:240: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 49 ) # 49. redefines.at:247: REDEFINES: with qualification at_setup_line='redefines.at:247' at_desc='REDEFINES: with qualification' $at_quiet $ECHO_N " 49: REDEFINES: with qualification $ECHO_C" at_xfail=no ( echo "49. redefines.at:247: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 01 G2. 02 X PIC X. 02 A REDEFINES X IN G1. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:266: \${COMPILE_ONLY} prog.cob" echo redefines.at:266 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'X' cannot be qualified here " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:266: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 50 ) # 50. redefines.at:273: REDEFINES: multiple redefinition at_setup_line='redefines.at:273' at_desc='REDEFINES: multiple redefinition' $at_quiet $ECHO_N " 50: REDEFINES: multiple redefinition $ECHO_C" at_xfail=no ( echo "50. redefines.at:273: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 A REDEFINES X PIC 9. 02 B REDEFINES X PIC 9. 02 C REDEFINES B PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:292: \${COMPILE_ONLY} prog.cob" echo redefines.at:292 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: 'B' not the original definition " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:292: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff echo "redefines.at:294: \${COMPILE_ONLY} -std=mvs prog.cob" echo redefines.at:294 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} -std=mvs prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "redefines.at:294: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 51 ) # 51. redefines.at:301: REDEFINES: size exceeds at_setup_line='redefines.at:301' at_desc='REDEFINES: size exceeds' $at_quiet $ECHO_N " 51: REDEFINES: size exceeds $ECHO_C" at_xfail=no ( echo "51. redefines.at:301: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G1. 02 X PIC X. 02 A REDEFINES X PIC 99. 01 G2. 02 X PIC X. 02 A REDEFINES X PIC 9 OCCURS 2. 01 WRK-X PIC X. 01 WRK-X-REDEF REDEFINES WRK-X PIC 99. 01 EXT-X PIC X EXTERNAL. 01 EXT-X-REDEF REDEFINES EXT-X PIC 99. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:327: \${COMPILE_ONLY} prog.cob" echo redefines.at:327 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: Size of 'A' larger than size of 'X' prog.cob:11: Error: Size of 'A' larger than size of 'X' prog.cob:15: Error: Size of 'EXT-X-REDEF' larger than size of 'EXT-X' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:327: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 52 ) # 52. redefines.at:334: REDEFINES: with VALUE at_setup_line='redefines.at:334' at_desc='REDEFINES: with VALUE' $at_quiet $ECHO_N " 52: REDEFINES: with VALUE $ECHO_C" at_xfail=no ( echo "52. redefines.at:334: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 A REDEFINES X PIC X VALUE "A". 01 G REDEFINES X. 02 B PIC X VALUE "A". 01 Y REDEFINES X PIC X. 88 C VALUE "A". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:355: \${COMPILE_ONLY} prog.cob" echo redefines.at:355 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Error: Entries under REDEFINES cannot have VALUE clause prog.cob:9: Error: Entries under REDEFINES cannot have VALUE clause " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:355: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 53 ) # 53. redefines.at:362: REDEFINES: with intervention at_setup_line='redefines.at:362' at_desc='REDEFINES: with intervention' $at_quiet $ECHO_N " 53: REDEFINES: with intervention $ECHO_C" at_xfail=no ( echo "53. redefines.at:362: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y PIC X. 01 A REDEFINES X PIC X. 01 G. 02 G-X PIC X. 02 G-Y PIC X. 02 G-A REDEFINES G-X PIC X. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:384: \${COMPILE_ONLY} prog.cob" echo redefines.at:384 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: REDEFINES must follow the original definition prog.cob:12: Error: REDEFINES must follow the original definition " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "redefines.at:384: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 54 ) # 54. redefines.at:391: REDEFINES: within REDEFINES at_setup_line='redefines.at:391' at_desc='REDEFINES: within REDEFINES' $at_quiet $ECHO_N " 54: REDEFINES: within REDEFINES $ECHO_C" at_xfail=no ( echo "54. redefines.at:391: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 G REDEFINES X. 02 A PIC X. 02 B REDEFINES A PIC 9. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "redefines.at:407: \${COMPILE_ONLY} prog.cob" echo redefines.at:407 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "redefines.at:407: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 55 ) # 55. value.at:43: Numeric item (integer) at_setup_line='value.at:43' at_desc='Numeric item (integer)' $at_quiet $ECHO_N " 55: Numeric item (integer) $ECHO_C" at_xfail=no ( echo "55. value.at:43: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-SPACE PIC 999 VALUE SPACE. 01 X-ABC PIC 999 VALUE "abc". 01 X-12-3 PIC 999 VALUE 12.3. 01 X-123 PIC 999 VALUE 123. 01 X-1234 PIC 999 VALUE 1234. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:64: \${COMPILE_ONLY} prog.cob" echo value.at:64 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: Invalid VALUE clause prog.cob:7: Warning: Numeric value is expected prog.cob:8: Warning: Value size exceeds data size prog.cob:10: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "value.at:64: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 56 ) # 56. value.at:68: Numeric item (non-integer) at_setup_line='value.at:68' at_desc='Numeric item (non-integer)' $at_quiet $ECHO_N " 56: Numeric item (non-integer) $ECHO_C" at_xfail=no ( echo "56. value.at:68: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-12 PIC 99V9 VALUE 12. 01 X-123 PIC 99V9 VALUE 123. 01 X-12-3 PIC 99V9 VALUE 12.3. 01 X-12-34 PIC 99V9 VALUE 12.34. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:86: \${COMPILE_ONLY} prog.cob" echo value.at:86 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Value size exceeds data size prog.cob:9: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:86: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 57 ) # 57. value.at:90: Numeric item with picture P at_setup_line='value.at:90' at_desc='Numeric item with picture P' $at_quiet $ECHO_N " 57: Numeric item with picture P $ECHO_C" at_xfail=no ( echo "57. value.at:90: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99PP-0 PIC 99PP VALUE 0. 01 X-99PP-1200 PIC 99PP VALUE 1200. 01 X-99PP-1230 PIC 99PP VALUE 1230. 01 X-99PP-10000 PIC 99PP VALUE 10000. 01 X-PP99--0 PIC PP99 VALUE .0. 01 X-PP99--0012 PIC PP99 VALUE .0012. 01 X-PP99--0123 PIC PP99 VALUE .0123. 01 X-PP99--00001 PIC PP99 VALUE .00001. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:114: \${COMPILE_ONLY} prog.cob" echo value.at:114 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Warning: Value does not fit the picture string prog.cob:9: Warning: Value size exceeds data size prog.cob:12: Warning: Value does not fit the picture string prog.cob:13: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:114: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 58 ) # 58. value.at:121: Signed numeric literal at_setup_line='value.at:121' at_desc='Signed numeric literal' $at_quiet $ECHO_N " 58: Signed numeric literal $ECHO_C" at_xfail=no ( echo "58. value.at:121: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-9P PIC 9 VALUE +1. 01 X-9N PIC 9 VALUE -1. 01 X-S9P PIC S9 VALUE +1. 01 X-S9N PIC S9 VALUE -1. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:139: \${COMPILE_ONLY} prog.cob" echo value.at:139 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: Data item not signed prog.cob:7: Error: Data item not signed " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "value.at:139: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 59 ) # 59. value.at:146: Alphabetic item at_setup_line='value.at:146' at_desc='Alphabetic item' $at_quiet $ECHO_N " 59: Alphabetic item $ECHO_C" at_xfail=no ( echo "59. value.at:146: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC AAA VALUE 123. 01 X-ZERO PIC AAA VALUE ZERO. 01 X-AB1 PIC AAA VALUE "ab1". 01 X-ABC PIC AAA VALUE "abc". 01 X-ABCD PIC AAA VALUE "abcd". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:167: \${COMPILE_ONLY} prog.cob" echo value.at:167 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Warning: Alphanumeric value is expected prog.cob:7: Error: Invalid VALUE clause prog.cob:8: Warning: Value does not fit the picture string prog.cob:10: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "value.at:167: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 60 ) # 60. value.at:171: Alphanumeric item at_setup_line='value.at:171' at_desc='Alphanumeric item' $at_quiet $ECHO_N " 60: Alphanumeric item $ECHO_C" at_xfail=no ( echo "60. value.at:171: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC XXX VALUE 123. 01 X-ABC PIC XXX VALUE "abc". 01 X-ABCD PIC XXX VALUE "abcd". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:188: \${COMPILE_ONLY} prog.cob" echo value.at:188 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Warning: Alphanumeric value is expected prog.cob:8: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:188: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 61 ) # 61. value.at:192: Alphanumeric group item at_setup_line='value.at:192' at_desc='Alphanumeric group item' $at_quiet $ECHO_N " 61: Alphanumeric group item $ECHO_C" at_xfail=no ( echo "61. value.at:192: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1 VALUE 123. 02 X PIC XXX. 01 G-2 VALUE "abc". 02 X PIC XXX. 01 G-3 VALUE "abcd". 02 X PIC XXX. PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:212: \${COMPILE_ONLY} prog.cob" echo value.at:212 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Warning: Alphanumeric value is expected prog.cob:10: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:212: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 62 ) # 62. value.at:226: Numeric-edited item at_setup_line='value.at:226' at_desc='Numeric-edited item' $at_quiet $ECHO_N " 62: Numeric-edited item $ECHO_C" at_xfail=no ( echo "62. value.at:226: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-SPACE PIC **99.00 VALUE SPACE. 01 X-123 PIC **99.00 VALUE 123. 01 X-ABC PIC **99.00 VALUE "abc". 01 X-MATCH PIC **99.00 VALUE "*123.00". 01 X-OVERFLOW PIC **99.00 VALUE "*123.000". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:245: \${COMPILE_ONLY} prog.cob" echo value.at:245 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:7: Warning: Alphanumeric value is expected prog.cob:10: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:245: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 63 ) # 63. value.at:249: Alphanumeric-edited item at_setup_line='value.at:249' at_desc='Alphanumeric-edited item' $at_quiet $ECHO_N " 63: Alphanumeric-edited item $ECHO_C" at_xfail=no ( echo "63. value.at:249: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-123 PIC BXX VALUE 123. 01 X-ABC PIC BXX VALUE "abc". 01 X-MATCH PIC BXX VALUE " ab". 01 X-OVERFLOW PIC BXX VALUE " abc". PROCEDURE DIVISION. STOP RUN. _ATEOF $at_traceoff echo "value.at:267: \${COMPILE_ONLY} prog.cob" echo value.at:267 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Warning: Alphanumeric value is expected prog.cob:9: Warning: Value size exceeds data size " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "value.at:267: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 64 ) # 64. move.at:37: MOVE SPACE TO numeric or numeric-edited item at_setup_line='move.at:37' at_desc='MOVE SPACE TO numeric or numeric-edited item' $at_quiet $ECHO_N " 64: MOVE SPACE TO numeric or numeric-edited item $ECHO_C" at_xfail=no ( echo "64. move.at:37: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. 01 Y PIC 09. PROCEDURE DIVISION. MOVE SPACE TO X. MOVE SPACE TO Y. STOP RUN. _ATEOF $at_traceoff echo "move.at:55: \${COMPILE_ONLY} prog.cob" echo move.at:55 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:9: Error: Invalid MOVE statement prog.cob:10: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:55: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 65 ) # 65. move.at:62: MOVE ZERO TO alphabetic item at_setup_line='move.at:62' at_desc='MOVE ZERO TO alphabetic item' $at_quiet $ECHO_N " 65: MOVE ZERO TO alphabetic item $ECHO_C" at_xfail=no ( echo "65. move.at:62: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC A. PROCEDURE DIVISION. MOVE ZERO TO A. STOP RUN. _ATEOF $at_traceoff echo "move.at:77: \${COMPILE_ONLY} prog.cob" echo move.at:77 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:77: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 66 ) # 66. move.at:87: MOVE alphabetic TO x at_setup_line='move.at:87' at_desc='MOVE alphabetic TO x' $at_quiet $ECHO_N " 66: MOVE alphabetic TO x $ECHO_C" at_xfail=no ( echo "66. move.at:87: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC A. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:112: \${COMPILE_ONLY} prog.cob" echo move.at:112 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:16: Error: Invalid MOVE statement prog.cob:17: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:112: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 67 ) # 67. move.at:116: MOVE alphanumeric TO x at_setup_line='move.at:116' at_desc='MOVE alphanumeric TO x' $at_quiet $ECHO_N " 67: MOVE alphanumeric TO x $ECHO_C" at_xfail=no ( echo "67. move.at:116: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:138: \${COMPILE_ONLY} prog.cob" echo move.at:138 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false $at_diff $at_devnull $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 0) ;; *) echo "move.at:138: exit code was $at_status, expected 0" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 68 ) # 68. move.at:142: MOVE alphanumeric-edited TO x at_setup_line='move.at:142' at_desc='MOVE alphanumeric-edited TO x' $at_quiet $ECHO_N " 68: MOVE alphanumeric-edited TO x $ECHO_C" at_xfail=no ( echo "68. move.at:142: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC BX. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:167: \${COMPILE_ONLY} prog.cob" echo move.at:167 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:16: Error: Invalid MOVE statement prog.cob:17: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:167: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 69 ) # 69. move.at:171: MOVE numeric (integer) TO x at_setup_line='move.at:171' at_desc='MOVE numeric (integer) TO x' $at_quiet $ECHO_N " 69: MOVE numeric (integer) TO x $ECHO_C" at_xfail=no ( echo "69. move.at:171: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:195: \${COMPILE_ONLY} prog.cob" echo move.at:195 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:13: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:195: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 70 ) # 70. move.at:199: MOVE numeric (non-integer) TO x at_setup_line='move.at:199' at_desc='MOVE numeric (non-integer) TO x' $at_quiet $ECHO_N " 70: MOVE numeric (non-integer) TO x $ECHO_C" at_xfail=no ( echo "70. move.at:199: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9V9. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:225: \${COMPILE_ONLY} prog.cob" echo move.at:225 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:13: Error: Invalid MOVE statement prog.cob:14: Error: Invalid MOVE statement prog.cob:15: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:225: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 71 ) # 71. move.at:229: MOVE numeric-edited TO x at_setup_line='move.at:229' at_desc='MOVE numeric-edited TO x' $at_quiet $ECHO_N " 71: MOVE numeric-edited TO x $ECHO_C" at_xfail=no ( echo "71. move.at:229: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 09. 01 Y-A PIC A. 01 Y-X PIC X. 01 Y-BX PIC BX. 01 Y-9 PIC 9. 01 Y-09 PIC 09. PROCEDURE DIVISION. MOVE X TO Y-A. MOVE X TO Y-X. MOVE X TO Y-BX. MOVE X TO Y-9. MOVE X TO Y-09. STOP RUN. _ATEOF $at_traceoff echo "move.at:253: \${COMPILE_ONLY} prog.cob" echo move.at:253 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:13: Error: Invalid MOVE statement " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:253: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 72 ) # 72. move.at:263: Operands must be groups at_setup_line='move.at:263' at_desc='Operands must be groups' $at_quiet $ECHO_N " 72: Operands must be groups $ECHO_C" at_xfail=no ( echo "72. move.at:263: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 X PIC X. 01 G-2. 02 Y PIC X. PROCEDURE DIVISION. MOVE CORR X TO G-1. MOVE CORR G-1 TO X. MOVE CORR G-1(1:1) TO G-2. MOVE CORR G-1 TO G-2(1:1). STOP RUN. _ATEOF $at_traceoff echo "move.at:287: \${COMPILE_ONLY} prog.cob" echo move.at:287 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:11: Error: 'X' is not group name prog.cob:12: Error: 'X' is not group name prog.cob:13: Error: 'G-1 (1:1)' is not group name prog.cob:14: Error: 'G-2 (1:1)' is not group name " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:287: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 73 ) # 73. move.at:295: MOVE: misc at_setup_line='move.at:295' at_desc='MOVE: misc' $at_quiet $ECHO_N " 73: MOVE: misc $ECHO_C" at_xfail=no ( echo "73. move.at:295: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 INVALID-ITEM. 01 I PIC 9(3). PROCEDURE DIVISION. MOVE 1 TO INVALID-ITEM. MOVE SPACE TO I(1:2). STOP RUN. _ATEOF $at_traceoff echo "move.at:312: \${COMPILE_ONLY} prog.cob" echo move.at:312 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:6: Error: PICTURE clause required for 'INVALID-ITEM' " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "move.at:312: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 74 ) # 74. multiply.at:28: Category check of Format 1 at_setup_line='multiply.at:28' at_desc='Category check of Format 1' $at_quiet $ECHO_N " 74: Category check of Format 1 $ECHO_C" at_xfail=no ( echo "74. multiply.at:28: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC X. 01 X-9 PIC 9. 01 X-09 PIC 09. PROCEDURE DIVISION. MULTIPLY 123 BY 456 END-MULTIPLY. MULTIPLY "a" BY "b" END-MULTIPLY. MULTIPLY X-X BY X-9 END-MULTIPLY. MULTIPLY X-9 BY X-09 END-MULTIPLY. MULTIPLY X-09 BY X-X END-MULTIPLY. STOP RUN. _ATEOF $at_traceoff echo "multiply.at:60: \${COMPILE_ONLY} prog.cob" echo multiply.at:60 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: '456' is not a numeric name prog.cob:12: Error: '\"a\"' is not a numeric value prog.cob:12: Error: '\"b\"' is not a numeric name prog.cob:14: Error: 'X-X' is not a numeric value prog.cob:16: Error: 'X-09' is not a numeric name prog.cob:18: Error: 'X-09' is not a numeric value prog.cob:18: Error: 'X-X' is not a numeric name " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "multiply.at:60: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 75 ) # 75. multiply.at:66: Category check of Format 2 at_setup_line='multiply.at:66' at_desc='Category check of Format 2' $at_quiet $ECHO_N " 75: Category check of Format 2 $ECHO_C" at_xfail=no ( echo "75. multiply.at:66: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-X PIC X. 01 X-9 PIC 9. 01 X-09 PIC 09. PROCEDURE DIVISION. MULTIPLY 123 BY 456 GIVING 789 END-MULTIPLY. MULTIPLY "a" BY "b" GIVING "c" END-MULTIPLY. MULTIPLY X-X BY X-9 GIVING X-09 END-MULTIPLY. MULTIPLY X-9 BY X-09 GIVING X-X END-MULTIPLY. MULTIPLY X-09 BY X-X GIVING X-9 END-MULTIPLY. STOP RUN. _ATEOF $at_traceoff echo "multiply.at:100: \${COMPILE_ONLY} prog.cob" echo multiply.at:100 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: '789' is not numeric or numeric-edited name prog.cob:12: Error: '\"a\"' is not a numeric value prog.cob:12: Error: '\"b\"' is not a numeric value prog.cob:12: Error: '\"c\"' is not numeric or numeric-edited name prog.cob:14: Error: 'X-X' is not a numeric value prog.cob:16: Error: 'X-09' is not a numeric value prog.cob:16: Error: 'X-X' is not numeric or numeric-edited name prog.cob:18: Error: 'X-09' is not a numeric value prog.cob:18: Error: 'X-X' is not a numeric value " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "multiply.at:100: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 76 ) # 76. multiply.at:106: Category check of literals at_setup_line='multiply.at:106' at_desc='Category check of literals' $at_quiet $ECHO_N " 76: Category check of literals $ECHO_C" at_xfail=no ( echo "76. multiply.at:106: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 9. PROCEDURE DIVISION. MULTIPLY 123 BY X END-MULTIPLY. MULTIPLY "a" BY X END-MULTIPLY. MULTIPLY 123 BY 456 GIVING X END-MULTIPLY. MULTIPLY "a" BY "b" GIVING X END-MULTIPLY. STOP RUN. _ATEOF $at_traceoff echo "multiply.at:130: \${COMPILE_ONLY} prog.cob" echo multiply.at:130 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:10: Error: '\"a\"' is not a numeric value prog.cob:14: Error: '\"a\"' is not a numeric value prog.cob:14: Error: '\"b\"' is not a numeric value " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "multiply.at:130: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; 77 ) # 77. set.at:24: SET: misc at_setup_line='set.at:24' at_desc='SET: misc' $at_quiet $ECHO_N " 77: SET: misc $ECHO_C" at_xfail=no ( echo "77. set.at:24: testing ..." $at_traceon cat >prog.cob <<'_ATEOF' IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC X. PROCEDURE DIVISION. SET ADDRESS OF X TO NULL. STOP RUN. _ATEOF $at_traceoff echo "set.at:39: \${COMPILE_ONLY} prog.cob" echo set.at:39 >$at_check_line_file ( $at_traceon; ${COMPILE_ONLY} prog.cob ) >$at_stdout 2>$at_stder1 at_status=$? grep '^ *+' $at_stder1 >&2 grep -v '^ *+' $at_stder1 >$at_stderr at_failed=false echo >>$at_stderr; echo "prog.cob:8: Error: The address of 'X' cannot be changed " | $at_diff - $at_stderr || at_failed=: $at_diff $at_devnull $at_stdout || at_failed=: case $at_status in 77) echo 77 > $at_status_file exit 77;; 1) ;; *) echo "set.at:39: exit code was $at_status, expected 1" at_failed=:;; esac if $at_failed; then echo 1 > $at_status_file exit 1 fi $at_traceon $at_traceoff $at_times_p && times >$at_times_file ) 5>&1 2>&1 | eval $at_tee_pipe at_status=`cat $at_status_file` ;; * ) echo "$as_me: no such test group: $at_group" >&2 continue ;; esac # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd $at_suite_dir case $at_group in banner-*) ;; *) if test ! -f $at_check_line_file; then sed "s/^ */$as_me: warning: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF echo "$at_setup_line" >$at_check_line_file fi at_group_count=`expr 1 + $at_group_count` $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C" echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> $at_group_log case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_xpass_list="$at_xpass_list $at_group" at_errexit=$at_errexit_p ;; no:0) at_msg="ok" at_pass_list="$at_pass_list $at_group" at_errexit=false ;; *:77) at_msg="skipped (`cat $at_check_line_file`)" at_skip_list="$at_skip_list $at_group" at_errexit=false ;; yes:*) at_msg="expected failure (`cat $at_check_line_file`)" at_xfail_list="$at_xfail_list $at_group" at_errexit=false ;; no:*) at_msg="FAILED (`cat $at_check_line_file`)" at_fail_list="$at_fail_list $at_group" at_errexit=$at_errexit_p ;; esac echo $at_msg at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f $at_times_file; then at_log_msg="$at_log_msg (`sed 1d $at_times_file`)" rm -f $at_times_file fi echo "$at_log_msg" >> $at_group_log echo "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files. $at_debug_p || rm -rf $at_group_dir ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. echo "$at_log_msg" >> $at_group_log # Upon failure, keep the group directory for autopsy, and # create the debugging script. { echo "#! /bin/sh" echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' echo "cd $at_dir" echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$0" \ '-v -d' "$at_debug_args" "$at_group" '${1+"$@"}' echo 'exit 1' } >$at_group_dir/run chmod +x $at_group_dir/run $at_errexit && break ;; esac ;; esac done # Back to the top directory. cd $at_dir # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`(date +%s) 2>/dev/null` echo "$as_me: ending at: $at_stop_date" >&5 at_duration_s=`(expr $at_stop_time - $at_start_time) 2>/dev/null` at_duration_m=`(expr $at_duration_s / 60) 2>/dev/null` at_duration_h=`(expr $at_duration_m / 60) 2>/dev/null` at_duration_s=`(expr $at_duration_s % 60) 2>/dev/null` at_duration_m=`(expr $at_duration_m % 60) 2>/dev/null` at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" if test "$at_duration" != "h m s"; then echo "$as_me: test suite duration: $at_duration" >&5 fi # Wrap up the test suite with summary statistics. at_skip_count=`set dummy $at_skip_list; shift; echo $#` at_fail_count=`set dummy $at_fail_list; shift; echo $#` at_xpass_count=`set dummy $at_xpass_list; shift; echo $#` at_xfail_count=`set dummy $at_xfail_list; shift; echo $#` at_run_count=`expr $at_group_count - $at_skip_count` at_unexpected_count=`expr $at_xpass_count + $at_fail_count` at_total_fail_count=`expr $at_xfail_count + $at_fail_count` echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo { echo cat <<\_ASBOX ## ------------- ## ## Test results. ## ## ------------- ## _ASBOX echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." else # Don't you just love exponential explosion of the number of cases? case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." ;; 0:0:*) at_result="$at_result behaved as expected." ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_result" echo "$at_result" >&5 else echo "ERROR: $at_result" >&2 echo "ERROR: $at_result" >&5 { echo cat <<\_ASBOX ## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ## _ASBOX # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL $0 $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL $0 $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL $0 $at_xpass_list --list echo fi if test $at_fail_count != 0; then cat <<\_ASBOX ## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ## _ASBOX echo for at_group in $at_fail_list do # Normalize the test group number. at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"` # Create a fresh directory for the next test group, and enter. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log cat $at_group_log echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $at_top_builddir/config.log ## _ASBOX sed 's/^/| /' $at_top_builddir/config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo echo "Please send \`$as_me.log' and all information you think might help:" echo echo " To: " echo " Subject: [OpenCOBOL 1.1] $as_me:$at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}$at_xpass_list${at_xpass_list:+ passed unexpectedly}" echo if test $at_debug_p = false; then echo echo 'You may investigate any problem if you feel able to do so, in which' echo 'case the test suite provides a good starting point.' echo fi exit 1 fi exit 0 open-cobol-1.1/tests/data-rep.at0000644000000000000000000000205611130701401012213 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_INIT([Data Representation]) AT_TESTED([cobc]) m4_include([binary.at]) # USAGE BINARY m4_include([display.at]) # USAGE DISPLAY m4_include([packed.at]) # USAGE PACKED-DECIMAL m4_include([pointer.at]) # USAGE POINTER open-cobol-1.1/tests/package.m40000644000000000000000000000044611130703347012041 # Signature of the current package. m4_define([AT_PACKAGE_NAME], [OpenCOBOL]) m4_define([AT_PACKAGE_TARNAME], [open-cobol]) m4_define([AT_PACKAGE_VERSION], [1.1]) m4_define([AT_PACKAGE_STRING], [OpenCOBOL 1.1]) m4_define([AT_PACKAGE_BUGREPORT], [open-cobol-list@lists.sourceforge.net]) open-cobol-1.1/tests/ChangeLog0000644000000000000000000002377311135417624011773 2009-01-20 Roger While * OC tests for DPC and 78 levels 2008-12-02 Roger While * Activate some more ANSI85 tests 2008-11-28 Roger While * Adjust ANSI85 results; USE GLOBAL tests now run * Adjust ANSI85 report output 2008-11-25 Roger While * cobol85/*.pl : Fix warning when running perl with -w 2008-11-07 Roger While * Adjust ANSI85 results; we successfully execute one of the GLOBAL tests 2008-10-17 Roger While * Add test for non-ALLOCATED BASED item 2008-10-11 Roger While * cobol85/Makefile.am : Refix out of source directory builds 2008-09-30 Roger While * Makefile.am : Fix out of source directory builds * cobol85/Makefile.am : Ditto 2008-08-09 Roger While * Change ENTRY test so as not to use obscure/obsoleted options 2008-07-02 Roger While * General for all OC tests - Cater for activated END-xxx checking 2008-05-23 Roger While * Due to display POINTER changes, ignore output from POINTER datarep test 2008-03-25 Roger While * Add OC tests for reference modification of FUNCTIONS * Add OC test for COB_LOAD_CASE 2008-02-18 Roger While * Add OC test for ANY LENGTH 2008-02-14 Roger While * atlocal.in : Fix up library search order 2008-01-09 Roger While * BY CONTENT not allowed in PROCEDURE header 2008-01-02 Roger While * Cobol85 tests rechanged to cater for unsupported ALTER 2007-12-27 Roger While ** Mark 1.0 RELEASE 2007-12-27 Roger While * Add OC test for WHEN-COMPILED 2007-12-21 Roger While * Cobol85 tests changed to cater for unsupported ALTER 2007-10-27 Roger While * OC test for INSPECT with figurative constant 2007-05-11 Roger While * Adjust OC test result to agree with tightened input file presence check 2007-03-05 Roger While * OC tests for LOCALE-DATE, LOCALE-TIME 2007-01-29 Roger While * OC test for ODO without TO clause 2007-01-16 Roger While * OC test for ASSIGN [TO] KEYBOARD/DISPLAY 2006-12-17 Roger While * OC test for NUMVAL-C 2006-12-14 Roger While * OC tests for TRIM, UPPER-CASE 2006-10-23 Roger While * Change C code in the tests to prototype functions 2006-07-23 Roger While * run.src, atlocal.in, cobol85/report.pl : Remove SWITCH settings from atlocal and insert directly into the tests 2006-07-19 Roger While * syntax.src, run.src : Change tests to accomodate revised messages 2006-07-06 Roger While cobol85/report.pl : Cater for DB_HOME (BDB >= 4.1) 2006-05-18 Roger While * OC tests for FUNCTION's EXCEPTION-FILE, EXCEPTION-LOCATION, EXCEPTION-STATEMENT, EXCEPTION-STATUS 2006-05-08 Roger While * OC test for PROCEDURE DIVISION CHAINING * OC test for INSPECT REPLACING TRAILING 2006-03-22 Roger While * OC test for EBCDIC table SORT 2006-03-04 Roger While * OC test for 88 level FALSE IS clause and SET TO FALSE. 2006-02-08 Roger While * Adjust results for cobol85 suite. We now pass some nested program tests. 2006-01-29 Roger While * OC test for COB_PRE_LOAD 2006-01-26 Roger While * OC test for UNSTRING DELIMITED LOW-VALUE 2006-01-21 Roger While * tests/syntax.src/definition.at : Test mismatched levels 2006-01-05 Roger While * General : Bootstrap up to new libtool / automake atlocal.in : More fixes for HP/IBM/Sun cobol85/ifedit.sh : Fix up test IX110A - This has an incorrect PIC clause in the compressed file newcob.val.Z. 2005-12-30 Roger While * Relax LOG10 test Fix big endian shell test atlocal.in : Insert SHLIB_PATH/LIBPATH for AIX/HP-UX 2005-12-28 Roger While * run.src/extensions.at : Remove A\$B (MingW) 2005-12-09 Roger While * atlocal.in, run.src/*, cobol85/report.pl, cobol85/Makefile.am : Changes for '-x' option 2005-12-05 Roger While * atlocal.in : Include libcob/.libs in PATH Needed for Win * cobol85/report.pl, cobol85/Makefile.am : Fix perl usage 2005-12-04 Roger While * Relax EXP test for MingW 2005-11-25 Roger While * New OC test for sticky-linkage 2005-11-09 Roger While * Adjust Cobol85 test results for SAME RECORD implementation. 2005-11-07 Roger While * New test for PERFORM type OSVS. * Get the FUNCTION tests in alphabetical order. 2005-11-01 Roger While * Relax TAN test. 2005-10-28 Roger While * Relax the range check for STANDARD-DEVIATION Don't do native binary tests when native = big-endian 2005-10-27 Roger While * Fixes all over for MAC (Darwin) We had "-shared" hard-coded in several places. Pick up the real value from the configure. 2005-10-14 Roger While * Fix a typo 2005-10-13 Roger While * Fix various tests for GCC 4 2005-10-01 Roger While * cobol85/Makefile.am : Include IF.txt, ifedit.sh 2005-07-31 Roger While * Tests for SIGN, FRACTION-PART. * Tweak the tests a bit more to cater for the abysmal precision of MingW. 2005-07-14 Roger While * New test for START of SEQ file. * Tweak the IF tests a bit. This should cater for the precison vagueries of doubles. 2005-07-02 Roger While * run.src/functions.at : New Intrinsic Function tests 2005-06-13 Roger While * atlocal.in : Export COB_SWITCH_1/2 for OC and Cobol85 tests. run, run.src/misc.at : Test for SWITCH. 2005-06-11 Roger While * Add in INSPECT BEFORE/AFTER tests 2005-05-28 Roger While * Use absolute path for cobcrun; seems that some environments do not propogate the path correctly. 2005-05-15 Roger While * Adjust tests for "Warning" and "Error". 2005-05-12 Roger While * Adjust tests for larger redefines (not allowed for cobol2002) 2005-05-03 Roger While * tests/cobol85/* : Allow to run without a "make install". Update expected results. EXEC85.conf.in - Change 2 params. Makexx : Due to autoreconf. run-O, data-rep-O : Use -O instead of -fruntime-inlining run.src,syntax.src : Add tests for duplicate paras and larger redefines. Adjust for endianness. 2005-04-15 Keisuke Nishida * atlocal.in (BIGENDIAN): New variable. * data-rep.src/binary.at: Don't test native binary on big-endian machines. (COMP-5): Moved from run.src/extensions.at. 2005-04-13 Keisuke Nishida * atlocal.in (CC): Set -fPIC when necessary. 2005-03-03 Roger While * cobol85/SQ.txt, cobol85/summary.txt : We now pass the LINAGE tests * run.src/extensions.at : Fix a dangling file in /tmp Small cleanups in other files 2005-02-22 Roger While * run, run.src/misc.at : Fix REF/CONTENT/VALUE test 2005-02-12 Roger While * run.src/misc.at : .. BY CONTENT LENGTH OF .. run.src/subscripts.at : Clean up a little run.src/return-code.at : Clean up a little 2005-02-11 Roger While * Dummy entry 2005-02-11 Roger While * run.src/extensions.at : Fix ARGUMENT check 2005-02-08 Roger While * run.src/misc.at, run : Add EXTERNAL as Literal check 2005-02-08 Roger While * run.src/misc.at, run : Add cobcrun check 2005-02-04 Roger While * run.src/extensions.at : MF extensions 2004-03-06 Keisuke Nishida * data-rep.src/pointer.at: New file. 2004-03-01 Keisuke Nishida * Reorganized tests into run.src, syntax.src, and data-rep.src. 2003-11-26 Keisuke Nishida * cobol2002-run.src, cobol2002-syntax.src, data-rep.src, extension.src: New subdirectories. 2003-08-21 Keisuke Nishida * display.at, packed.at: New files. 2003-08-10 Keisuke Nishida * binary.at: New file. 2003-05-30 Keisuke Nishida * occurs.at: New file. 2003-05-21 Keisuke Nishida * multiply.at: New file. * extension.at: New file. 2003-04-29 Keisuke Nishida * fundamental.at, entry.at: New files. 2003-04-26 Keisuke Nishida * subscripts.at, ref-mod.at: Divided from reference.at. * value.at: Renamed from constant.at. * usage.at: Renamed from packed.at. * initialize.at: New file. 2003-04-10 Keisuke Nishida * constant.at, move.at: New files. 2003-04-04 Keisuke Nishida * packed.at: New file. 2003-03-08 Keisuke Nishida * testsuite.at: Include all *.at files. * Makefile.am: Build only a single testsuite script. 2003-02-28 Keisuke Nishida * reference.at: Combine runtime.at and subref.at. 2003-02-25 Keisuke Nishida * definition.at, misc.at: New files. * redef.at: Removed. 2002-12-12 Keisuke Nishida * redefines.at: New file. 2002-12-10 Keisuke Nishida * Makefile.am, atlocal.in: New files. * redef.at, subref.at, runtime.at: New files. open-cobol-1.1/tests/atlocal.in0000644000000000000000000000221711130701401012136 ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## CC="@CC@" SHREXT="@COB_MODULE_EXT@" SHROPT="@COB_SHARED_OPT@ @COB_PIC_FLAGS@ @CFLAGS@ @LDFLAGS@" COB_BIGENDIAN="@COB_BIGENDIAN@" PATH="${abs_top_builddir}/cobc:${abs_top_builddir}/bin:${abs_top_builddir}/libcob/.libs:${PATH}" COBC="${abs_top_builddir}/cobc/cobc" COBCRUN="${abs_top_builddir}/bin/cobcrun" TEMPLATE="${abs_srcdir}/data-rep.src" FLAGS="-std=cobol2002 -debug -Wall ${COBOL_FLAGS}" COMPILE="${COBC} -x ${FLAGS}" COMPILE_ONLY="${COBC} -fsyntax-only ${FLAGS}" COMPILE_MODULE="${COBC} -m ${FLAGS}" export COB_CFLAGS="-I${abs_top_srcdir} @COB_CFLAGS@" export COB_LDFLAGS="-L${abs_top_builddir}/libcob/.libs @COB_LDFLAGS@" export COB_LIBS="-L${abs_top_builddir}/libcob/.libs -lcob @LIBCOB_LIBS@" export COB_CONFIG_DIR="${abs_top_srcdir}/config" export COB_COPY_DIR="${abs_top_srcdir}/copy" export LD_LIBRARY_PATH="${abs_top_builddir}/libcob/.libs:$LD_LIBRARY_PATH" export DYLD_LIBRARY_PATH="${abs_top_builddir}/libcob/.libs:$DYLD_LIBRARY_PATH" export SHLIB_PATH="${abs_top_builddir}/libcob/.libs:$SHLIB_PATH" export LIBPATH="${abs_top_builddir}/libcob/.libs:$LIBPATH" open-cobol-1.1/tests/data-rep-O0000755000000000000000000000020010261563033012007 #!/bin/sh echo echo "## Data representation tests with -O option ##" echo . ./atconfig COBOL_FLAGS='-O' ${abs_srcdir}/data-rep open-cobol-1.1/tests/data-rep.src/0000777000000000000000000000000011143001517012541 5open-cobol-1.1/tests/data-rep.src/binary.at0000644000000000000000000004621211130701401014267 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA # 2-4-8 big-endian AT_SETUP([BINARY: 2-4-8 big-endian]) AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 2-4-8 binary-byteorder: big-endian ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0001202020202020 000c202020202020 007b202020202020 04d2202020202020 0000303920202020 0001e24020202020 0012d68720202020 00bc614e20202020 075bcd1520202020 00000000499602d2 00000002dfdc1c35 0000001cbe991a14 0000011f71fb04cb 00000b3a73ce2ff2 00007048860ddf79 000462d53c8abac0 002bdc545d6b4b87 01b69b4ba630f34e ffff202020202020 fff4202020202020 ff85202020202020 fb2e202020202020 ffffcfc720202020 fffe1dc020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffffffffb669fd2e fffffffd2023e3cb ffffffe34166e5ec fffffee08e04fb35 fffff4c58c31d00e ffff8fb779f22087 fffb9d2ac3754540 ffd423aba294b479 fe4964b459cf0cb2 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) AT_CLEANUP # 2-4-8 native AT_SETUP([BINARY: 2-4-8 native]) if test "x$COB_BIGENDIAN" = "xyes"; then AT_CHECK([true]) else AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 2-4-8 binary-byteorder: native ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0100202020202020 0c00202020202020 7b00202020202020 d204202020202020 3930000020202020 40e2010020202020 87d6120020202020 4e61bc0020202020 15cd5b0720202020 d202964900000000 351cdcdf02000000 141a99be1c000000 cb04fb711f010000 f22fce733a0b0000 79df0d8648700000 c0ba8a3cd5620400 874b6b5d54dc2b00 4ef330a64b9bb601 ffff202020202020 f4ff202020202020 85ff202020202020 2efb202020202020 c7cfffff20202020 c01dfeff20202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ffffffff cbe32320fdffffff ece56641e3ffffff 35fb048ee0feffff 0ed0318cc5f4ffff 8720f279b78fffff 404575c32a9dfbff 79b494a2ab23d4ff b20ccf59b46449fe 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000202020202020 0000202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) fi AT_CLEANUP # 1-2-4-8 big-endian AT_SETUP([BINARY: 1-2-4-8 big-endian]) AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 1-2-4-8 binary-byteorder: big-endian ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0120202020202020 0c20202020202020 007b202020202020 04d2202020202020 0000303920202020 0001e24020202020 0012d68720202020 00bc614e20202020 075bcd1520202020 00000000499602d2 00000002dfdc1c35 0000001cbe991a14 0000011f71fb04cb 00000b3a73ce2ff2 00007048860ddf79 000462d53c8abac0 002bdc545d6b4b87 01b69b4ba630f34e ff20202020202020 f420202020202020 ff85202020202020 fb2e202020202020 ffffcfc720202020 fffe1dc020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffffffffb669fd2e fffffffd2023e3cb ffffffe34166e5ec fffffee08e04fb35 fffff4c58c31d00e ffff8fb779f22087 fffb9d2ac3754540 ffd423aba294b479 fe4964b459cf0cb2 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) AT_CLEANUP # 1-2-4-8 native AT_SETUP([BINARY: 1-2-4-8 native]) if test "x$COB_BIGENDIAN" = "xyes"; then AT_CHECK([true]) else AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 1-2-4-8 binary-byteorder: native ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0120202020202020 0c20202020202020 7b00202020202020 d204202020202020 3930000020202020 40e2010020202020 87d6120020202020 4e61bc0020202020 15cd5b0720202020 d202964900000000 351cdcdf02000000 141a99be1c000000 cb04fb711f010000 f22fce733a0b0000 79df0d8648700000 c0ba8a3cd5620400 874b6b5d54dc2b00 4ef330a64b9bb601 ff20202020202020 f420202020202020 85ff202020202020 2efb202020202020 c7cfffff20202020 c01dfeff20202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ffffffff cbe32320fdffffff ece56641e3ffffff 35fb048ee0feffff 0ed0318cc5f4ffff 8720f279b78fffff 404575c32a9dfbff 79b494a2ab23d4ff b20ccf59b46449fe 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000020202020 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) fi AT_CLEANUP # 1--8 big-endian AT_SETUP([BINARY: 1--8 big-endian]) AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 1--8 binary-byteorder: big-endian ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0120202020202020 0c20202020202020 007b202020202020 04d2202020202020 0030392020202020 01e2402020202020 12d6872020202020 00bc614e20202020 075bcd1520202020 00499602d2202020 02dfdc1c35202020 1cbe991a14202020 011f71fb04cb2020 0b3a73ce2ff22020 007048860ddf7920 0462d53c8abac020 002bdc545d6b4b87 01b69b4ba630f34e ff20202020202020 f420202020202020 ff85202020202020 fb2e202020202020 ffcfc72020202020 fe1dc02020202020 ffed297920202020 ff439eb220202020 f8a432eb20202020 ffb669fd2e202020 fd2023e3cb202020 ffe34166e5ec2020 fee08e04fb352020 f4c58c31d00e2020 ff8fb779f2208720 fb9d2ac375454020 ffd423aba294b479 fe4964b459cf0cb2 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) AT_CLEANUP # 1--8 native AT_SETUP([BINARY: 1--8 native]) if test "x$COB_BIGENDIAN" = "xyes"; then AT_CHECK([true]) else AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 1--8 binary-byteorder: native ]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 8; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [0120202020202020 0c20202020202020 7b00202020202020 d204202020202020 3930002020202020 40e2012020202020 87d6122020202020 4e61bc0020202020 15cd5b0720202020 d202964900202020 351cdcdf02202020 141a99be1c202020 cb04fb711f012020 f22fce733a0b2020 79df0d8648700020 c0ba8a3cd5620420 874b6b5d54dc2b00 4ef330a64b9bb601 ff20202020202020 f420202020202020 85ff202020202020 2efb202020202020 c7cfff2020202020 c01dfe2020202020 7929edff20202020 b29e43ff20202020 eb32a4f820202020 2efd69b6ff202020 cbe32320fd202020 ece56641e3ff2020 35fb048ee0fe2020 0ed0318cc5f42020 8720f279b78fff20 404575c32a9dfb20 79b494a2ab23d4ff b20ccf59b46449fe 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 0020202020202020 0020202020202020 0000202020202020 0000202020202020 0000002020202020 0000002020202020 0000000020202020 0000000020202020 0000000020202020 0000000000202020 0000000000202020 0000000000002020 0000000000002020 0000000000002020 0000000000000020 0000000000000020 0000000000000000 0000000000000000 ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345 1234567890123456 12345678901234567 123456789012345678 -1 -12 -123 -1234 -12345 -123456 -1234567 -12345678 -123456789 -1234567890 -12345678901 -123456789012 -1234567890123 -12345678901234 -123456789012345 -1234567890123456 -12345678901234567 -123456789012345678 ]) fi AT_CLEANUP # full-print AT_SETUP([BINARY: full-print]) AT_DATA([test.conf], [ include "cobol2002.conf" binary-size: 1--8 pretty-display: no ]) sed -e 's/@USAGE@/BINARY/' ${TEMPLATE}/numeric-display.cob > prog.cob AT_CHECK([${COMPILE} -conf=test.conf -o prog prog.cob]) AT_CHECK([./prog], [0], [001 012 00123 01234 00012345 00123456 01234567 0012345678 0123456789 0001234567890 0012345678901 0123456789012 001234567890123 012345678901234 00123456789012345 01234567890123456 00012345678901234567 00123456789012345678 -001 -012 -00123 -01234 -00012345 -00123456 -0001234567 -0012345678 -0123456789 -0001234567890 -0012345678901 -000123456789012 -001234567890123 -012345678901234 -00123456789012345 -01234567890123456 -00012345678901234567 -00123456789012345678 ]) AT_CLEANUP open-cobol-1.1/tests/data-rep.src/pointer.at0000644000000000000000000000250311130701401014456 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2004-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_SETUP([POINTER: display]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 PTR USAGE POINTER VALUE NULL. PROCEDURE DIVISION. DISPLAY PTR END-DISPLAY. SET PTR UP BY 1 DISPLAY PTR END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -o prog prog.cob]) AT_CHECK([./prog], [0], [ignore]) AT_CLEANUP open-cobol-1.1/tests/data-rep.src/numeric-display.cob0000644000000000000000000000777411043353100016263 IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-P1 PIC 9(1) VALUE 1 @USAGE@. 01 X-P2 PIC 9(2) VALUE 12 @USAGE@. 01 X-P3 PIC 9(3) VALUE 123 @USAGE@. 01 X-P4 PIC 9(4) VALUE 1234 @USAGE@. 01 X-P5 PIC 9(5) VALUE 12345 @USAGE@. 01 X-P6 PIC 9(6) VALUE 123456 @USAGE@. 01 X-P7 PIC 9(7) VALUE 1234567 @USAGE@. 01 X-P8 PIC 9(8) VALUE 12345678 @USAGE@. 01 X-P9 PIC 9(9) VALUE 123456789 @USAGE@. 01 X-P10 PIC 9(10) VALUE 1234567890 @USAGE@. 01 X-P11 PIC 9(11) VALUE 12345678901 @USAGE@. 01 X-P12 PIC 9(12) VALUE 123456789012 @USAGE@. 01 X-P13 PIC 9(13) VALUE 1234567890123 @USAGE@. 01 X-P14 PIC 9(14) VALUE 12345678901234 @USAGE@. 01 X-P15 PIC 9(15) VALUE 123456789012345 @USAGE@. 01 X-P16 PIC 9(16) VALUE 1234567890123456 @USAGE@. 01 X-P17 PIC 9(17) VALUE 12345678901234567 @USAGE@. 01 X-P18 PIC 9(18) VALUE 123456789012345678 @USAGE@. 01 X-N1 PIC S9(1) VALUE -1 @USAGE@. 01 X-N2 PIC S9(2) VALUE -12 @USAGE@. 01 X-N3 PIC S9(3) VALUE -123 @USAGE@. 01 X-N4 PIC S9(4) VALUE -1234 @USAGE@. 01 X-N5 PIC S9(5) VALUE -12345 @USAGE@. 01 X-N6 PIC S9(6) VALUE -123456 @USAGE@. 01 X-N7 PIC S9(7) VALUE -1234567 @USAGE@. 01 X-N8 PIC S9(8) VALUE -12345678 @USAGE@. 01 X-N9 PIC S9(9) VALUE -123456789 @USAGE@. 01 X-N10 PIC S9(10) VALUE -1234567890 @USAGE@. 01 X-N11 PIC S9(11) VALUE -12345678901 @USAGE@. 01 X-N12 PIC S9(12) VALUE -123456789012 @USAGE@. 01 X-N13 PIC S9(13) VALUE -1234567890123 @USAGE@. 01 X-N14 PIC S9(14) VALUE -12345678901234 @USAGE@. 01 X-N15 PIC S9(15) VALUE -123456789012345 @USAGE@. 01 X-N16 PIC S9(16) VALUE -1234567890123456 @USAGE@. 01 X-N17 PIC S9(17) VALUE -12345678901234567 @USAGE@. 01 X-N18 PIC S9(18) VALUE -123456789012345678 @USAGE@. PROCEDURE DIVISION. DISPLAY X-P1 END-DISPLAY. DISPLAY X-P2 END-DISPLAY. DISPLAY X-P3 END-DISPLAY. DISPLAY X-P4 END-DISPLAY. DISPLAY X-P5 END-DISPLAY. DISPLAY X-P6 END-DISPLAY. DISPLAY X-P7 END-DISPLAY. DISPLAY X-P8 END-DISPLAY. DISPLAY X-P9 END-DISPLAY. DISPLAY X-P10 END-DISPLAY. DISPLAY X-P11 END-DISPLAY. DISPLAY X-P12 END-DISPLAY. DISPLAY X-P13 END-DISPLAY. DISPLAY X-P14 END-DISPLAY. DISPLAY X-P15 END-DISPLAY. DISPLAY X-P16 END-DISPLAY. DISPLAY X-P17 END-DISPLAY. DISPLAY X-P18 END-DISPLAY. DISPLAY X-N1 END-DISPLAY. DISPLAY X-N2 END-DISPLAY. DISPLAY X-N3 END-DISPLAY. DISPLAY X-N4 END-DISPLAY. DISPLAY X-N5 END-DISPLAY. DISPLAY X-N6 END-DISPLAY. DISPLAY X-N7 END-DISPLAY. DISPLAY X-N8 END-DISPLAY. DISPLAY X-N9 END-DISPLAY. DISPLAY X-N10 END-DISPLAY. DISPLAY X-N11 END-DISPLAY. DISPLAY X-N12 END-DISPLAY. DISPLAY X-N13 END-DISPLAY. DISPLAY X-N14 END-DISPLAY. DISPLAY X-N15 END-DISPLAY. DISPLAY X-N16 END-DISPLAY. DISPLAY X-N17 END-DISPLAY. DISPLAY X-N18 END-DISPLAY. STOP RUN. open-cobol-1.1/tests/data-rep.src/packed.at0000644000000000000000000002461611130701401014236 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA ### PACKED-DECIMAL # dump AT_SETUP([PACKED-DECIMAL dump]) AT_DATA([dump.c], [ #include int dump (unsigned char *data); int dump (unsigned char *data) { int i; for (i = 0; i < 10; i++) printf ("%02x", data[[i]]); puts (""); return 0; } ]) AT_CHECK([${CC} ${SHROPT} -o dump.${SHREXT} dump.c]) sed -e 's/@USAGE@/PACKED-DECIMAL/' ${TEMPLATE}/numeric-dump.cob > prog.cob AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [1f202020202020202020 012f2020202020202020 123f2020202020202020 01234f20202020202020 12345f20202020202020 0123456f202020202020 1234567f202020202020 012345678f2020202020 123456789f2020202020 01234567890f20202020 12345678901f20202020 0123456789012f202020 1234567890123f202020 012345678901234f2020 123456789012345f2020 01234567890123456f20 12345678901234567f20 0123456789012345678f 1d202020202020202020 012d2020202020202020 123d2020202020202020 01234d20202020202020 12345d20202020202020 0123456d202020202020 1234567d202020202020 012345678d2020202020 123456789d2020202020 01234567890d20202020 12345678901d20202020 0123456789012d202020 1234567890123d202020 012345678901234d2020 123456789012345d2020 01234567890123456d20 12345678901234567d20 0123456789012345678d 0f202020202020202020 000f2020202020202020 000f2020202020202020 00000f20202020202020 00000f20202020202020 0000000f202020202020 0000000f202020202020 000000000f2020202020 000000000f2020202020 00000000000f20202020 00000000000f20202020 0000000000000f202020 0000000000000f202020 000000000000000f2020 000000000000000f2020 00000000000000000f20 00000000000000000f20 0000000000000000000f 0c202020202020202020 000c2020202020202020 000c2020202020202020 00000c20202020202020 00000c20202020202020 0000000c202020202020 0000000c202020202020 000000000c2020202020 000000000c2020202020 00000000000c20202020 00000000000c20202020 0000000000000c202020 0000000000000c202020 000000000000000c2020 000000000000000c2020 00000000000000000c20 00000000000000000c20 0000000000000000000c 0f202020202020202020 000f2020202020202020 000f2020202020202020 00000f20202020202020 00000f20202020202020 0000000f202020202020 0000000f202020202020 000000000f2020202020 000000000f2020202020 00000000000f20202020 00000000000f20202020 0000000000000f202020 0000000000000f202020 000000000000000f2020 000000000000000f2020 00000000000000000f20 00000000000000000f20 0000000000000000000f 0c202020202020202020 000c2020202020202020 000c2020202020202020 00000c20202020202020 00000c20202020202020 0000000c202020202020 0000000c202020202020 000000000c2020202020 000000000c2020202020 00000000000c20202020 00000000000c20202020 0000000000000c202020 0000000000000c202020 000000000000000c2020 000000000000000c2020 00000000000000000c20 00000000000000000c20 0000000000000000000c ]) AT_CLEANUP # display AT_SETUP([PACKED-DECIMAL display]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. MOVE 0 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE 99 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE 0 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE -1 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE 0 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE 123 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE 0 TO X-S999. DISPLAY X-S999 END-DISPLAY. MOVE -123 TO X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [00 99 +00 -01 000 123 +000 -123 ]) AT_CLEANUP # move AT_SETUP([PACKED-DECIMAL move]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. 01 C-P1234 PIC 9999 VALUE 1234. 01 C-N1234 PIC S9999 VALUE -1234. PROCEDURE DIVISION. MOVE C-P1234 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE C-P1234 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE C-P1234 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE C-P1234 TO X-S999. DISPLAY X-S999 END-DISPLAY. MOVE C-N1234 TO X-99. DISPLAY X-99 END-DISPLAY. MOVE C-N1234 TO X-S99. DISPLAY X-S99 END-DISPLAY. MOVE C-N1234 TO X-999. DISPLAY X-999 END-DISPLAY. MOVE C-N1234 TO X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [34 +34 234 +234 34 -34 234 -234 ]) AT_CLEANUP # initialize AT_SETUP([PACKED-DECIMAL arithmetic (1)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X-99 PIC 99 USAGE PACKED-DECIMAL. 01 X-S99 PIC S99 USAGE PACKED-DECIMAL. 01 X-999 PIC 999 USAGE PACKED-DECIMAL. 01 X-S999 PIC S999 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. INITIALIZE X-99. DISPLAY X-99 END-DISPLAY. INITIALIZE X-S99. DISPLAY X-S99 END-DISPLAY. INITIALIZE X-999. DISPLAY X-999 END-DISPLAY. INITIALIZE X-S999. DISPLAY X-S999 END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [00 +00 000 +000 ]) AT_CLEANUP # arithmetic AT_SETUP([PACKED-DECIMAL arithmetic (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 X PIC 99 USAGE PACKED-DECIMAL VALUE 0. 01 Y PIC 99 USAGE PACKED-DECIMAL VALUE 9. PROCEDURE DIVISION. COMPUTE X = 1 END-COMPUTE. DISPLAY X END-DISPLAY. COMPUTE X = Y END-COMPUTE. DISPLAY X END-DISPLAY. COMPUTE X = X + Y END-COMPUTE. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [01 09 18 ]) AT_CLEANUP # numeric test AT_SETUP([PACKED-DECIMAL numeric test]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X-2 PIC X(2). 02 N-2 REDEFINES X-2 PIC 99 USAGE PACKED-DECIMAL. 02 N-S2 REDEFINES X-2 PIC S99 USAGE PACKED-DECIMAL. PROCEDURE DIVISION. MOVE X"0000" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. MOVE X"000c" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"000d" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"000f" TO X-2. IF N-2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"1234" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. MOVE X"999f" TO X-2. IF N-2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "OK" END-DISPLAY ELSE DISPLAY "NG" END-DISPLAY END-IF. MOVE X"ffff" TO X-2. IF N-2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. IF N-S2 IS NUMERIC DISPLAY "NG" END-DISPLAY ELSE DISPLAY "OK" END-DISPLAY END-IF. STOP RUN. ]) AT_CHECK([${COMPILE} prog.cob]) AT_CHECK([./prog], [0], [OK OK OK OK OK OK OK OK OK OK OK OK OK OK ]) AT_CLEANUP open-cobol-1.1/tests/data-rep.src/display.at0000644000000000000000000001172411135362306014464 ### OpenCOBOL Test Suite -*- m4 -*- ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2007-2009 Roger While ## ## 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 software; see the file COPYING. If not, write to ## the Free Software Foundation, 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301 USA AT_SETUP([DISPLAY: Sign ASCII]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(5). 02 X-9 REDEFINES X PIC 9(4). 02 X-S9 REDEFINES X PIC S9(4). 02 X-S9-L REDEFINES X PIC S9(4) LEADING. 02 X-S9-LS REDEFINES X PIC S9(4) LEADING SEPARATE. 02 X-S9-T REDEFINES X PIC S9(4) TRAILING. 02 X-S9-TS REDEFINES X PIC S9(4) TRAILING SEPARATE. PROCEDURE DIVISION. MOVE ZERO TO X. MOVE 1234 TO X-9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-L. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-L. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-LS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-LS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-T. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-T. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE 1234 TO X-S9-TS. DISPLAY X END-DISPLAY. MOVE ZERO TO X. MOVE -1234 TO X-S9-TS. DISPLAY X END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -fsign-ascii -o prog prog.cob]) AT_CHECK([./prog], [0], [12340 12340 123t0 12340 q2340 +1234 -1234 12340 123t0 1234+ 1234- ]) AT_CLEANUP AT_SETUP([DISPLAY: Sign ASCII (2)]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(10). 02 X-S99 REDEFINES X PIC S99. 02 X-S9 REDEFINES X PIC S9 OCCURS 10. PROCEDURE DIVISION. MOVE 0 TO X-S9(1). MOVE 1 TO X-S9(2). MOVE 2 TO X-S9(3). MOVE 3 TO X-S9(4). MOVE 4 TO X-S9(5). MOVE 5 TO X-S9(6). MOVE 6 TO X-S9(7). MOVE 7 TO X-S9(8). MOVE 8 TO X-S9(9). MOVE 9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. MOVE -10 TO X-S99. MOVE X(2:1) TO X(1:1). MOVE -1 TO X-S9(2). MOVE -2 TO X-S9(3). MOVE -3 TO X-S9(4). MOVE -4 TO X-S9(5). MOVE -5 TO X-S9(6). MOVE -6 TO X-S9(7). MOVE -7 TO X-S9(8). MOVE -8 TO X-S9(9). MOVE -9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -fsign-ascii -o prog prog.cob]) AT_CHECK([./prog], [0], [0123456789pqrstuvwxy]) AT_CLEANUP AT_SETUP([DISPLAY: Sign EBCDIC]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G. 02 X PIC X(10). 02 X-S99 REDEFINES X PIC S99. 02 X-S9 REDEFINES X PIC S9 OCCURS 10. PROCEDURE DIVISION. MOVE 0 TO X-S9(1). MOVE 1 TO X-S9(2). MOVE 2 TO X-S9(3). MOVE 3 TO X-S9(4). MOVE 4 TO X-S9(5). MOVE 5 TO X-S9(6). MOVE 6 TO X-S9(7). MOVE 7 TO X-S9(8). MOVE 8 TO X-S9(9). MOVE 9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. MOVE -10 TO X-S99. MOVE X(2:1) TO X(1:1). MOVE -1 TO X-S9(2). MOVE -2 TO X-S9(3). MOVE -3 TO X-S9(4). MOVE -4 TO X-S9(5). MOVE -5 TO X-S9(6). MOVE -6 TO X-S9(7). MOVE -7 TO X-S9(8). MOVE -8 TO X-S9(9). MOVE -9 TO X-S9(10). DISPLAY X NO ADVANCING END-DISPLAY. STOP RUN. ]) AT_CHECK([${COMPILE} -fsign-ebcdic -o prog prog.cob]) AT_CHECK([./prog], [0], [{ABCDEFGHI}JKLMNOPQR]) AT_CLEANUP open-cobol-1.1/tests/data-rep.src/numeric-dump.cob0000644000000000000000000003112311043353100015544 IDENTIFICATION DIVISION. PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. 01 G-1. 02 X-1 PIC 9(1) VALUE 1 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-2. 02 X-2 PIC 9(2) VALUE 12 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-3. 02 X-3 PIC 9(3) VALUE 123 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-4. 02 X-4 PIC 9(4) VALUE 1234 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-5. 02 X-5 PIC 9(5) VALUE 12345 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-6. 02 X-6 PIC 9(6) VALUE 123456 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-7. 02 X-7 PIC 9(7) VALUE 1234567 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-8. 02 X-8 PIC 9(8) VALUE 12345678 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-9. 02 X-9 PIC 9(9) VALUE 123456789 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-10. 02 X-10 PIC 9(10) VALUE 1234567890 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-11. 02 X-11 PIC 9(11) VALUE 12345678901 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-12. 02 X-12 PIC 9(12) VALUE 123456789012 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-13. 02 X-13 PIC 9(13) VALUE 1234567890123 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-14. 02 X-14 PIC 9(14) VALUE 12345678901234 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-15. 02 X-15 PIC 9(15) VALUE 123456789012345 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-16. 02 X-16 PIC 9(16) VALUE 1234567890123456 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-17. 02 X-17 PIC 9(17) VALUE 12345678901234567 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-18. 02 X-18 PIC 9(18) VALUE 123456789012345678 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S1. 02 X-S1 PIC S9(1) VALUE -1 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S2. 02 X-S2 PIC S9(2) VALUE -12 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S3. 02 X-S3 PIC S9(3) VALUE -123 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S4. 02 X-S4 PIC S9(4) VALUE -1234 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S5. 02 X-S5 PIC S9(5) VALUE -12345 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S6. 02 X-S6 PIC S9(6) VALUE -123456 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S7. 02 X-S7 PIC S9(7) VALUE -1234567 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S8. 02 X-S8 PIC S9(8) VALUE -12345678 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S9. 02 X-S9 PIC S9(9) VALUE -123456789 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S10. 02 X-S10 PIC S9(10) VALUE -1234567890 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S11. 02 X-S11 PIC S9(11) VALUE -12345678901 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S12. 02 X-S12 PIC S9(12) VALUE -123456789012 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S13. 02 X-S13 PIC S9(13) VALUE -1234567890123 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S14. 02 X-S14 PIC S9(14) VALUE -12345678901234 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S15. 02 X-S15 PIC S9(15) VALUE -123456789012345 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S16. 02 X-S16 PIC S9(16) VALUE -1234567890123456 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S17. 02 X-S17 PIC S9(17) VALUE -12345678901234567 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. 01 G-S18. 02 X-S18 PIC S9(18) VALUE -123456789012345678 @USAGE@. 02 FILLER PIC X(18) VALUE SPACE. PROCEDURE DIVISION. * dump each values CALL "dump" USING G-1 END-CALL. CALL "dump" USING G-2 END-CALL. CALL "dump" USING G-3 END-CALL. CALL "dump" USING G-4 END-CALL. CALL "dump" USING G-5 END-CALL. CALL "dump" USING G-6 END-CALL. CALL "dump" USING G-7 END-CALL. CALL "dump" USING G-8 END-CALL. CALL "dump" USING G-9 END-CALL. CALL "dump" USING G-10 END-CALL. CALL "dump" USING G-11 END-CALL. CALL "dump" USING G-12 END-CALL. CALL "dump" USING G-13 END-CALL. CALL "dump" USING G-14 END-CALL. CALL "dump" USING G-15 END-CALL. CALL "dump" USING G-16 END-CALL. CALL "dump" USING G-17 END-CALL. CALL "dump" USING G-18 END-CALL. CALL "dump" USING G-S1 END-CALL. CALL "dump" USING G-S2 END-CALL. CALL "dump" USING G-S3 END-CALL. CALL "dump" USING G-S4 END-CALL. CALL "dump" USING G-S5 END-CALL. CALL "dump" USING G-S6 END-CALL. CALL "dump" USING G-S7 END-CALL. CALL "dump" USING G-S8 END-CALL. CALL "dump" USING G-S9 END-CALL. CALL "dump" USING G-S10 END-CALL. CALL "dump" USING G-S11 END-CALL. CALL "dump" USING G-S12 END-CALL. CALL "dump" USING G-S13 END-CALL. CALL "dump" USING G-S14 END-CALL. CALL "dump" USING G-S15 END-CALL. CALL "dump" USING G-S16 END-CALL. CALL "dump" USING G-S17 END-CALL. CALL "dump" USING G-S18 END-CALL. INITIALIZE X-1. CALL "dump" USING G-1 END-CALL. INITIALIZE X-2. CALL "dump" USING G-2 END-CALL. INITIALIZE X-3. CALL "dump" USING G-3 END-CALL. INITIALIZE X-4. CALL "dump" USING G-4 END-CALL. INITIALIZE X-5. CALL "dump" USING G-5 END-CALL. INITIALIZE X-6. CALL "dump" USING G-6 END-CALL. INITIALIZE X-7. CALL "dump" USING G-7 END-CALL. INITIALIZE X-8. CALL "dump" USING G-8 END-CALL. INITIALIZE X-9. CALL "dump" USING G-9 END-CALL. INITIALIZE X-10. CALL "dump" USING G-10 END-CALL. INITIALIZE X-11. CALL "dump" USING G-11 END-CALL. INITIALIZE X-12. CALL "dump" USING G-12 END-CALL. INITIALIZE X-13. CALL "dump" USING G-13 END-CALL. INITIALIZE X-14. CALL "dump" USING G-14 END-CALL. INITIALIZE X-15. CALL "dump" USING G-15 END-CALL. INITIALIZE X-16. CALL "dump" USING G-16 END-CALL. INITIALIZE X-17. CALL "dump" USING G-17 END-CALL. INITIALIZE X-18. CALL "dump" USING G-18 END-CALL. INITIALIZE X-S1. CALL "dump" USING G-S1 END-CALL. INITIALIZE X-S2. CALL "dump" USING G-S2 END-CALL. INITIALIZE X-S3. CALL "dump" USING G-S3 END-CALL. INITIALIZE X-S4. CALL "dump" USING G-S4 END-CALL. INITIALIZE X-S5. CALL "dump" USING G-S5 END-CALL. INITIALIZE X-S6. CALL "dump" USING G-S6 END-CALL. INITIALIZE X-S7. CALL "dump" USING G-S7 END-CALL. INITIALIZE X-S8. CALL "dump" USING G-S8 END-CALL. INITIALIZE X-S9. CALL "dump" USING G-S9 END-CALL. INITIALIZE X-S10. CALL "dump" USING G-S10 END-CALL. INITIALIZE X-S11. CALL "dump" USING G-S11 END-CALL. INITIALIZE X-S12. CALL "dump" USING G-S12 END-CALL. INITIALIZE X-S13. CALL "dump" USING G-S13 END-CALL. INITIALIZE X-S14. CALL "dump" USING G-S14 END-CALL. INITIALIZE X-S15. CALL "dump" USING G-S15 END-CALL. INITIALIZE X-S16. CALL "dump" USING G-S16 END-CALL. INITIALIZE X-S17. CALL "dump" USING G-S17 END-CALL. INITIALIZE X-S18. CALL "dump" USING G-S18 END-CALL. MOVE ZERO TO X-1. CALL "dump" USING G-1 END-CALL. MOVE ZERO TO X-2. CALL "dump" USING G-2 END-CALL. MOVE ZERO TO X-3. CALL "dump" USING G-3 END-CALL. MOVE ZERO TO X-4. CALL "dump" USING G-4 END-CALL. MOVE ZERO TO X-5. CALL "dump" USING G-5 END-CALL. MOVE ZERO TO X-6. CALL "dump" USING G-6 END-CALL. MOVE ZERO TO X-7. CALL "dump" USING G-7 END-CALL. MOVE ZERO TO X-8. CALL "dump" USING G-8 END-CALL. MOVE ZERO TO X-9. CALL "dump" USING G-9 END-CALL. MOVE ZERO TO X-10. CALL "dump" USING G-10 END-CALL. MOVE ZERO TO X-11. CALL "dump" USING G-11 END-CALL. MOVE ZERO TO X-12. CALL "dump" USING G-12 END-CALL. MOVE ZERO TO X-13. CALL "dump" USING G-13 END-CALL. MOVE ZERO TO X-14. CALL "dump" USING G-14 END-CALL. MOVE ZERO TO X-15. CALL "dump" USING G-15 END-CALL. MOVE ZERO TO X-16. CALL "dump" USING G-16 END-CALL. MOVE ZERO TO X-17. CALL "dump" USING G-17 END-CALL. MOVE ZERO TO X-18. CALL "dump" USING G-18 END-CALL. MOVE ZERO TO X-S1. CALL "dump" USING G-S1 END-CALL. MOVE ZERO TO X-S2. CALL "dump" USING G-S2 END-CALL. MOVE ZERO TO X-S3. CALL "dump" USING G-S3 END-CALL. MOVE ZERO TO X-S4. CALL "dump" USING G-S4 END-CALL. MOVE ZERO TO X-S5. CALL "dump" USING G-S5 END-CALL. MOVE ZERO TO X-S6. CALL "dump" USING G-S6 END-CALL. MOVE ZERO TO X-S7. CALL "dump" USING G-S7 END-CALL. MOVE ZERO TO X-S8. CALL "dump" USING G-S8 END-CALL. MOVE ZERO TO X-S9. CALL "dump" USING G-S9 END-CALL. MOVE ZERO TO X-S10. CALL "dump" USING G-S10 END-CALL. MOVE ZERO TO X-S11. CALL "dump" USING G-S11 END-CALL. MOVE ZERO TO X-S12. CALL "dump" USING G-S12 END-CALL. MOVE ZERO TO X-S13. CALL "dump" USING G-S13 END-CALL. MOVE ZERO TO X-S14. CALL "dump" USING G-S14 END-CALL. MOVE ZERO TO X-S15. CALL "dump" USING G-S15 END-CALL. MOVE ZERO TO X-S16. CALL "dump" USING G-S16 END-CALL. MOVE ZERO TO X-S17. CALL "dump" USING G-S17 END-CALL. MOVE ZERO TO X-S18. CALL "dump" USING G-S18 END-CALL. STOP RUN. open-cobol-1.1/COPYING.DOC0000644000000000000000000004766311047246727010530 GNU Free Documentation License Version 1.2, November 2002 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. open-cobol-1.1/COPYING.LIB0000644000000000000000000006350410476501574010520 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-cobol-1.1/README0000644000000000000000000001655211112774404007731 OpenCOBOL http://www.opencobol.org/ http://sourceforge.net/projects/open-cobol/ OpenCOBOL is an open-source COBOL compiler, which translates COBOL programs to C code and compiles it using GCC. This package contains the following subdirectories: cobc COBOL compiler libcob COBOL run-time library bin COBOL driver program lib static library and common headers config configuration files po international messages texi Texinfo files tests Test suite All programs except those in lib and libcob are distributed under the GNU General Public License. See COPYING for details. Programs in lib and libcob are distributed under the GNU Lesser General Public License. See COPYING.LIB for details. See AUTHORS for the author of each file. ============ Requirements ============ *** NOTE For all the following packages (required or optional), BOTH runtime AND development components are necessary. *** *** NOTE All the following packages are normally part of a Linux distribution. Cygwin also has these as installable packages ALWAYS install the distro packages when available !! *** OpenCOBOL requires the following external libraries to be installed: o GNU MP (libgmp) 4.1.2 or later http://gmplib.org BOTH runtime AND development components required. libgmp is used to implement decimal arithmetic. GNU MP is distributed under GNU Lesser General Public License. o GNU Libtool (libltdl) http://www.gnu.org/software/libtool/libtool.html *** NOTE - libltdl is NOT needed when installing on Linux or Windows (including Cygwin and MingW). *** libltdl is used to implement dynamic CALL statements. GNU Libtool is distributed under GNU Lesser General Public License. ** The following libraries ARE required WHEN : 1) Indexed-Sequential file I/O is used o Berkeley DB (libdb) 1.85 or later http://www.oracle.com/ BOTH runtime AND development components required. Recommended is version 4.x as 1.85 is known to have problems. * NOTE * The following NOTE(S) ONLY apply to DB <= 4.1 * NOTE * The BDB version 4.0 was never officially supported from sleepycat but, unfortunately, found it's way into Linux releases. Install a newer version. * NOTE * If you are generating BDB yourself and the BDB version is <= 4 (and version < 1), you need to specify --enable-compat185 as a minimum to the BDB configure. BDB does NOT have the usual install path of either /usr or /usr/local. Therefore, it is recommended to specify --prefix=/usr/local to the configure. libdb is used to implement indexed file I/O and SORT/MERGE. Berkeley DB is distributed under the original BSD License (1.85) or their own open-source license (2.x or later). Note that, as of 2.x, if you linked your software with Berkeley DB, you must distribute the source code of your software along with your software, or you have to pay royalty to Oracle. 2) SCREEN I/O is used or extended ACCEPT/DISPLAY is used BOTH runtime AND development components required. o Ncurses (ncurses) 5.2 or later http://www.gnu.org/software/ncurses/ncurses.html libncurses is used to implement SCREEN SECTION and extended ACCEPT/DISPLAY. Ncurses is distributed under a BSD style license. o Unix curses o PDCurses (pdcurses) for MinGW ports http://pdcurses.sourceforge.net ============ ============ Installation ============ ** NOTE Due to deficiencies in the tools used to prepare OpenCOBOL (autoconf/automake/libtool), it is NOT generally possible to use path names with spaces embedded within them (Mainly Cygwin/MingW/Windows ports). ** To generate/install OpenCOBOL : ************************************** ./configure make Here you may run make check to run a series of OpenCOBOL test programs (must do!) This MUST succeed - If not, please report. make install ** NOTE ** On Linux systems, if you are installing for the -first- time, you may need to run "ldconfig" (as root). In fact, it does not hurt if you always do this. ** NOTE ** On some Red Hat (Fedora) installations and possibly other Linux distros, /usr/local/lib is NOT automatically searched at runtime. Edit /etc/ld.so.conf and add /usr/local/lib to the file. Rerun "ldconfig". You may optionally perform a series of COBOL85 tests. See tests/cobol85/README It is recommended that you perform this test. ************************************** If you think you have a problem or just want to record the make output, just redirect the output thus : make 1>mymake.log 2>&1 make install 1>myinstall.log 2>&1 ************************************** You can get back to a clean installation status by running : make distclean ************************************** The "make install" will default to "/usr/local" as the install path. You may override this by specifying "--prefix=" to the "./configure" command. *********************************************************** ============ The following is only interesting for advanced use. A normal user should not have recourse to use these options. There are the following configure options: --with-cc= Specify C compiler command used by cobc Do not specify this unless you know what you are doing! --with-db1 Use Berkeley DB 1.85 (libdb1/libdb-1.85) This overrides --with-db/--without-db --with-db Use Berkeley DB 3.0 or later (libdb) This is the default --without-db Do not use Berkeley DB You will not be able to use SORT/indexed I/O --with-dl Use the system dynamic linker instead of ltdl This is the default (Note on Windows, native loading is used) --without-dl Use ltdl for dynamic program loading --with-patch-level= Set internal patch level to n (default 0) --with-varseq= Define the format for variable length sequential files. For values of 0, 1 and 2, four bytes are written preceeding each record. The format of these four bytes for values of 0, 1, 2 is as follows : n = 0 (default) The first 2 bytes are the record length in big-endian order. This is compatible with mainframe. Bytes 3 and 4 are set to binary 0. n = 1 The 4 bytes are the record length in big-endian order. n = 2 The 4 bytes are the record length in native machine order (int). (This was previously the default) For the value of 3, two bytes are written preceeding each record : n = 3 The first 2 bytes are the record length in big-endian order. The record follows immediately after beginning at byte 3. --enable-debug Add '-g' debug option to make ============ ============ Development ============ If you wish to hack the OpenCOBOL source code, proceed as follows. You need to install the following extra packages with specified minimum version before changing/building OpenCOBOL: For compiling : o Bison 1.875 o Flex 2.5.4 If you reconfigure and/or prepare a distribution o Autoconf 2.59 o Automake 1.9.6 o Libtool 1.5.24 o m4 1.4.2 o Gettext 0.14.1 o Texinfo 4.6 (For makeinfo) If you modify top-level configure.ac, Makefile.am in any directory, or any of the standard OC tests then you will need to run "autoreconf -I m4" to regenerate the necessary files. open-cobol-1.1/ltmain.sh0000755000000000000000000060446511047246727010713 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # 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. basename="s,^.*/,,g" # 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 $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.24 TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)" # Be Bourne compatible (taken from Autoconf:_AS_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 # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # 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. func_win32_libid () { 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 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{ / I /{ s,.*,import, p q } }'` 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_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 () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # 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. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # 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 $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi 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 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` 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" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do 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 have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "\ $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP Copyright (C) 2007 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." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # 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= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # 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= 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) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$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,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$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. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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 "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 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 "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; 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." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </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." $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 $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." $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 $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 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 case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$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 "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; 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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= 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 compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes 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 $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" 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*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # 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$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$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 "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; 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" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then major=`expr $current - $age` else major=`expr $current - $age + 1` fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then case $archive_cmds in *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # 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/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= 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*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; 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 "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #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 # 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 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ 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]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); 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 = 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 ("getcwd failed"); 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 ("getcwd failed"); 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 * 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 (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # 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. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_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 variable: 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 echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ 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 >> $output "\ # 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 $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE 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 $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; 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. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # 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. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run 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 if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$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 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run 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 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 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 file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo 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. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "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) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $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" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 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 -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG 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 fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # 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 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information 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. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [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: $modename [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 -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking 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: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [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 -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 -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 -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] 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: $modename [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." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: open-cobol-1.1/THANKS0000644000000000000000000000233710730717247007767 Alain Lucari David Korn Keiichi Takahashi Peg Richard Smith Roger While Thomas Biehler William M. Klein Yoshiki Kusumoto Also to the many people that have helped out in testing this product. We hope that everybody will continue to provide feedback. This is invaluable to the continuing development process. A special mention here of people who have provided exceptional support in terms of time and resources on hardware that was not available to the developers : Oleg Philon - For his work on the Powerpc David Wilson - For his work on the MAC (Darwin) Sergey Kashyrin - For his work on : SUN Solaris IBM AIX HP-UX And continuing this amazing support : Hans-Martin Rasch - Work on compiler syntax Michel Gouget - Work on syntax - IS Bill Klein - The mainstay for Cobol questions Frank Swarbrick - Work on compiler syntax Warren Gay - For testing systems that we did known that we even support! (eg. Old DEC Alpha sytems) Ron Norman - Work on C/D/VB-ISAM handler Fabrizio Calabretta - Work on the EXTFH interface open-cobol-1.1/configure0000755000000000000000000336736611140121164010765 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for OpenCOBOL 1.1. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='OpenCOBOL' PACKAGE_TARNAME='open-cobol' PACKAGE_VERSION='1.1' PACKAGE_STRING='OpenCOBOL 1.1' PACKAGE_BUGREPORT='open-cobol-list@lists.sourceforge.net' ac_unique_file="libcob.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LN_S build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CXXCPP LIBTOOL ALLOCA LIBICONV LTLIBICONV LIBOBJS MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE INTLLIBS LIBINTL LTLIBINTL POSUB COB_CC COB_CFLAGS COB_LDFLAGS COB_LIBS COB_CONFIG_DIR COB_COPY_DIR COB_LIBRARY_PATH COB_MODULE_EXT COBC_LIBS LIBCOB_CFLAGS LIBCOB_LIBS COB_EXPORT_DYN COB_PIC_FLAGS COB_SHARED_OPT COB_BIGENDIAN COB_FIX_LIB COB_HAS_INLINE LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # 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 OpenCOBOL 1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF 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 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 OpenCOBOL 1.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug (OpenCOBOL) enable -g C compiler debug option --enable-experimental (OpenCOBOL) enable experimental code (Developers only!) --enable-param-check (OpenCOBOL) enable CALL parameter checking --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath do not hardcode runtime library paths --disable-nls do not use Native Language Support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-cc= (OpenCOBOL) specify the C compiler used by cobc --with-seqra-extfh (OpenCOBOL) Use external SEQ/RAN file handler --with-cisam (OpenCOBOL) Use CISAM for ISAM I/O --with-disam (OpenCOBOL) Use DISAM for ISAM I/O --with-vbisam (OpenCOBOL) Use VBISAM for ISAM I/O --with-index-extfh (OpenCOBOL) Use external ISAM file handler --with-db1 (OpenCOBOL) use Berkeley DB 1.85 (libdb-1.85) --with-db (OpenCOBOL) use Berkeley DB 3.0 or later (libdb)(default) --with-dl (OpenCOBOL) use system dynamic loader (default) --with-patch-level (OpenCOBOL) define a patch level (default 0) --with-varseq (OpenCOBOL) define variable sequential format (default 0) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir 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 CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF OpenCOBOL configure 1.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by OpenCOBOL $as_me 1.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_config_commands="$ac_config_commands tests/atconfig" case m4 in [\\/]* | ?:[\\/]* ) ac_macro_dir=m4 ;; *) ac_macro_dir=$srcdir/m4 ;; esac if test -d "$ac_macro_dir"; then : else { { echo "$as_me:$LINENO: error: cannot find macro directory \`m4'" >&5 echo "$as_me: error: cannot find macro directory \`m4'" >&2;} { (exit 1); exit 1; }; } fi # Note for SUN Solaris (gcc) # export/setenv CFLAGS "-m64 -mptr64" # export/setenv LDFLAGS "-m64 -mptr64 -L/usr/local/lib/sparcv9" # ./configure --libdir=/usr/local/lib/sparcv9 # # Hack for AIX 64 bit (gcc) # Required - # export/setenv CFLAGS=-maix64 # export/setenv LDFLAGS=-maix64 if echo $CFLAGS | grep 'aix64' 1>/dev/null 2>&1 then if test -f /usr/ccs/bin/ar then AR="/usr/ccs/bin/ar -X64" else AR="ar -X64" fi NM="/usr/ccs/bin/nm -X64 -B" fi am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/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_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # 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). 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 rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } 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='open-cobol' VERSION='1.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # 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"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Autoheader templates # AH_TEMPLATE([WITH_LFS64], [Compile with large file system 64]) # AH_TEMPLATE([DLLHIDDEN], [Has visibility attribute]) cat >>confdefs.h <<\_ACEOF #define __USE_STRING_INLINES 1 _ACEOF LIBCOB_LIBS="-lm" LIBCOB_CFLAGS="$lt_prog_compiler_pic" save_libs="$LIBS" 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 for ac_prog in gcc xlc cc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in gcc xlc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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'. 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 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 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 thusly: # 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 fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Configure options. COB_CC="" # Check whether --with-cc or --without-cc was given. if test "${with_cc+set}" = set; then withval="$with_cc" COB_CC=$withval else COB_CC=$CC fi; # Check whether --with-seqra-extfh or --without-seqra-extfh was given. if test "${with_seqra_extfh+set}" = set; then withval="$with_seqra_extfh" if test "$with_seqra_extfh" = "yes" then cat >>confdefs.h <<\_ACEOF #define WITH_SEQRA_EXTFH 1 _ACEOF fi fi; echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-cisam or --without-cisam was given. if test "${with_cisam+set}" = set; then withval="$with_cisam" if test "$with_cisam" = "yes" then for ac_header in isam.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: isam.h is required for CISAM" >&5 echo "$as_me: error: isam.h is required for CISAM" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for isopen in -lifisam" >&5 echo $ECHO_N "checking for isopen in -lifisam... $ECHO_C" >&6 if test "${ac_cv_lib_ifisam_isopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lifisam ifisamx $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char isopen (); int main () { isopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ifisam_isopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ifisam_isopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ifisam_isopen" >&5 echo "${ECHO_T}$ac_cv_lib_ifisam_isopen" >&6 if test $ac_cv_lib_ifisam_isopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIFISAM 1 _ACEOF LIBS="-lifisam $LIBS" else { { echo "$as_me:$LINENO: error: libifisam is required for CISAM" >&5 echo "$as_me: error: libifisam is required for CISAM" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<\_ACEOF #define WITH_CISAM 1 _ACEOF LIBCOB_LIBS="$LIBCOB_LIBS -lifisam -lifisamx" fi fi; if test "$with_cisam" != "yes" then # Check whether --with-disam or --without-disam was given. if test "${with_disam+set}" = set; then withval="$with_disam" if test "$with_disam" = "yes" then for ac_header in disam.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: disam.h is required for DISAM" >&5 echo "$as_me: error: disam.h is required for DISAM" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for isopen in -ldisam" >&5 echo $ECHO_N "checking for isopen in -ldisam... $ECHO_C" >&6 if test "${ac_cv_lib_disam_isopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldisam $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char isopen (); int main () { isopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_disam_isopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_disam_isopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_disam_isopen" >&5 echo "${ECHO_T}$ac_cv_lib_disam_isopen" >&6 if test $ac_cv_lib_disam_isopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDISAM 1 _ACEOF LIBS="-ldisam $LIBS" else { { echo "$as_me:$LINENO: error: libdisam is required for DISAM" >&5 echo "$as_me: error: libdisam is required for DISAM" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<\_ACEOF #define WITH_DISAM 1 _ACEOF LIBCOB_LIBS="$LIBCOB_LIBS -ldisam" fi fi; fi if test "$with_cisam" != "yes" -a "$with_disam" != "yes" then # Check whether --with-vbisam or --without-vbisam was given. if test "${with_vbisam+set}" = set; then withval="$with_vbisam" if test "$with_vbisam" = "yes" then for ac_header in vbisam.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: vbisam.h is required for VBISAM" >&5 echo "$as_me: error: vbisam.h is required for VBISAM" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for isopen in -lvbisam" >&5 echo $ECHO_N "checking for isopen in -lvbisam... $ECHO_C" >&6 if test "${ac_cv_lib_vbisam_isopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lvbisam $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char isopen (); int main () { isopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_vbisam_isopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_vbisam_isopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_vbisam_isopen" >&5 echo "${ECHO_T}$ac_cv_lib_vbisam_isopen" >&6 if test $ac_cv_lib_vbisam_isopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBVBISAM 1 _ACEOF LIBS="-lvbisam $LIBS" else { { echo "$as_me:$LINENO: error: libvbisam is required for VBISAM" >&5 echo "$as_me: error: libvbisam is required for VBISAM" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<\_ACEOF #define WITH_VBISAM 1 _ACEOF LIBCOB_LIBS="$LIBCOB_LIBS -lvbisam" fi fi; fi LIBDB="" if test "$with_cisam" != "yes" -a "$with_disam" != "yes" -a "$with_vbisam" != "yes" then # Check whether --with-index-extfh or --without-index-extfh was given. if test "${with_index_extfh+set}" = set; then withval="$with_index_extfh" if test "$with_index_extfh" = "yes" then cat >>confdefs.h <<\_ACEOF #define WITH_INDEX_EXTFH 1 _ACEOF fi else # Check whether --with-db1 or --without-db1 was given. if test "${with_db1+set}" = set; then withval="$with_db1" LIBDB="1" cat >>confdefs.h <<\_ACEOF #define WITH_DB 1 _ACEOF else # Check whether --with-db or --without-db was given. if test "${with_db+set}" = set; then withval="$with_db" if test "$with_db" = "yes" then LIBDB="3" cat >>confdefs.h <<\_ACEOF #define WITH_DB 3 _ACEOF fi else LIBDB="3" cat >>confdefs.h <<\_ACEOF #define WITH_DB 3 _ACEOF fi; fi; fi; fi #AC_ARG_WITH(lfs64, # [ --with-lfs64 (OpenCOBOL) use large file system for file I/O (default)], # [ if test "$with_lfs64" = "yes" # then # AC_DEFINE(WITH_LFS64) # fi ], # [ AC_DEFINE(WITH_LFS64) ]) DEFINE_DL="no" COB_TRY_DL="yes" # Check whether --with-dl or --without-dl was given. if test "${with_dl+set}" = set; then withval="$with_dl" case $with_dl in yes) COB_TRY_DL="yes" ;; no) COB_TRY_DL="no" ;; *) { { echo "$as_me:$LINENO: error: \"--with/without-dl can not have a value\"" >&5 echo "$as_me: error: \"--with/without-dl can not have a value\"" >&2;} { (exit 1); exit 1; }; } ;; esac fi; GEN_DEBUG_OPT="no" # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" if test "$enable_debug" = "yes" then GEN_DEBUG_OPT="yes" fi fi; # Check whether --enable-experimental or --disable-experimental was given. if test "${enable_experimental+set}" = set; then enableval="$enable_experimental" if test "$enable_experimental" = "yes" then cat >>confdefs.h <<\_ACEOF #define COB_EXPERIMENTAL 1 _ACEOF fi fi; # Check whether --enable-param-check or --disable-param-check was given. if test "${enable_param_check+set}" = set; then enableval="$enable_param_check" if test "$enable_param_check" = "yes" then cat >>confdefs.h <<\_ACEOF #define COB_PARAM_CHECK 1 _ACEOF fi fi; PATCH_LEVEL=0 # Check whether --with-patch-level or --without-patch-level was given. if test "${with_patch_level+set}" = set; then withval="$with_patch_level" case $with_patch_level in yes) { { echo "$as_me:$LINENO: error: \"You must give --with-patch-level an argument.\"" >&5 echo "$as_me: error: \"You must give --with-patch-level an argument.\"" >&2;} { (exit 1); exit 1; }; } ;; no) { { echo "$as_me:$LINENO: error: \"--without-patch-level not supported.\"" >&5 echo "$as_me: error: \"--without-patch-level not supported.\"" >&2;} { (exit 1); exit 1; }; } ;; [0-9]*) PATCH_LEVEL=$with_patch_level ;; *) { { echo "$as_me:$LINENO: error: \"You must use a numeric patch level\"" >&5 echo "$as_me: error: \"You must use a numeric patch level\"" >&2;} { (exit 1); exit 1; }; } ;; esac fi; cat >>confdefs.h <<_ACEOF #define PATCH_LEVEL $PATCH_LEVEL _ACEOF WITH_VARSEQ=0 # Check whether --with-varseq or --without-varseq was given. if test "${with_varseq+set}" = set; then withval="$with_varseq" case $with_varseq in yes) { { echo "$as_me:$LINENO: error: \"You must give --with-varseq an argument.\"" >&5 echo "$as_me: error: \"You must give --with-varseq an argument.\"" >&2;} { (exit 1); exit 1; }; } ;; no) { { echo "$as_me:$LINENO: error: \"--without-varseq not supported.\"" >&5 echo "$as_me: error: \"--without-varseq not supported.\"" >&2;} { (exit 1); exit 1; }; } ;; [0-3]) WITH_VARSEQ=$with_varseq ;; *) { { echo "$as_me:$LINENO: error: \"Invalid --with-varseq argument\"" >&5 echo "$as_me: error: \"Invalid --with-varseq argument\"" >&2;} { (exit 1); exit 1; }; } ;; esac fi; cat >>confdefs.h <<_ACEOF #define WITH_VARSEQ $WITH_VARSEQ _ACEOF # Checks for programs. # Stop the stupid tests for C++ and Fortran with_tags= echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/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_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; 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 enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; 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 enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; 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 enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # 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 "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$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 darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which 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 aix4* | aix5*) 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='/usr/bin/file -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* | 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 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) 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=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file 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]) 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 Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 ;; solaris*) 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 ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 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 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 whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && 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 which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5098 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file 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* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|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*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) 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" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ 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 fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; *-*-cygwin* | *-*-mingw* | *-*-pw32*) 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false" fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi DLLTOOL=$ac_ct_DLLTOOL else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then echo "$as_me:$LINENO: result: $AS" >&5 echo "${ECHO_T}$AS" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false" fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 echo "${ECHO_T}$ac_ct_AS" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AS=$ac_ct_AS else AS="$ac_cv_prog_AS" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false" fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi OBJDUMP=$ac_ct_OBJDUMP else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac need_locks="$enable_libtool_lock" for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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*) # Under GNU Hurd, 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*) # 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; ;; 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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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 ;; 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"; 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 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done 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 fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # 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]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; 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 # Try without a prefix undercore, 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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 < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_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 -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done 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 echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir 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 "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' 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 avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # 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 case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 <&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 EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 <&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 EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=yes enable_win32_dll=yes # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= 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(){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 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 conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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" # 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:6840: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6844: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; 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= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # 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' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; 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 ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # 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='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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' ;; 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' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # 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' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # 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='' ;; esac ;; esac ;; 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' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) 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 echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_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" # 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:7130: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7134: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; 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 case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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:7234: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7238: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$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 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # 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_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; 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 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) 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 # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; 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* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' 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/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' 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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 ;; 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* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; 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 else ld_shlibs=no fi ;; netbsd*) 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 $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' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 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 ;; 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 can not *** 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 ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 if test "$ld_shlibs" = no; 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 "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU 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")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; 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 "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # 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_use_runtimelinking" = yes; 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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) 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 # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. 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 `echo "$deplibs" | $SED -e '\''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' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=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*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${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 "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=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 "$GCC" = yes -a "$with_gnu_ld" = no; 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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${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' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=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 "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) 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 ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else 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' 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; 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 "$GCC" = yes; 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 can NOT 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='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # 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 "$enable_shared" = yes && test "$GCC" = yes; 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. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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:$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=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 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" if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # 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 -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # 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` 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" else 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; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi 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 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' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi shlibpath_var=LIBPATH fi ;; amigaos*) 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # 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~ chmod a+x \$dldir/$dlname' 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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}${versuffix}$shared_ext ${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 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # 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[123]*) 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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 ;; 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 hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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' ;; interix[3-9]*) 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' 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 "$lt_cv_prog_gnu_ld" = yes; then version_type=linux 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 ;; # This must be Linux ELF. linux* | k*bsd*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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 # Append ld.so.conf contents 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;/^$/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' ;; 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 ;; newsos6) version_type=linux 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=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=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; solaris*) 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=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 "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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 export_dynamic_flag_spec='${wl}-Blargedynsym' 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 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=freebsd-elf 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 hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes 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' ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; 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 echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; 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* | pw32*) 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 echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && 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" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; 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 < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { 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; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; 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 < #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 #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { 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; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && 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* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$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 # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # 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. # 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//" # 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 # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # 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 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # 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 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # 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 and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # 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 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 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # 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 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_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 # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\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 "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # 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" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" 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 CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$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(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 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 conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # 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 "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; 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_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; 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_CXX=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_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # 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_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=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'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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. # 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. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # 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_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # 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_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # 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*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # 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:12144: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12148: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=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:12248: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12252: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$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 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX 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. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 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 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' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi shlibpath_var=LIBPATH fi ;; amigaos*) 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # 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~ chmod a+x \$dldir/$dlname' 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # 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[123]*) 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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 ;; 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 hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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' ;; interix[3-9]*) 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' 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 "$lt_cv_prog_gnu_ld" = yes; then version_type=linux 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 ;; # This must be Linux ELF. linux* | k*bsd*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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 # Append ld.so.conf contents 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;/^$/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' ;; 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 ;; newsos6) version_type=linux 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=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=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; solaris*) 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=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 "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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 export_dynamic_flag_spec='${wl}-Blargedynsym' 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 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=freebsd-elf 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 hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes 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' ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # 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_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" 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 CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 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 conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # 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_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; 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_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # 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_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-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_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # 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:13810: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13814: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=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:13914: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13918: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$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 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # 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_F77="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; 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_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${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_F77='$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_F77='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* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$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 else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $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_F77=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** 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 ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$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_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; 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_F77=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_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # 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_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$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. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$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_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$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' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=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 "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 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. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 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 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' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi shlibpath_var=LIBPATH fi ;; amigaos*) 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # 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~ chmod a+x \$dldir/$dlname' 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # 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[123]*) 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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 ;; 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 hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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' ;; interix[3-9]*) 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' 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 "$lt_cv_prog_gnu_ld" = yes; then version_type=linux 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 ;; # This must be Linux ELF. linux* | k*bsd*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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 # Append ld.so.conf contents 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;/^$/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' ;; 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 ;; newsos6) version_type=linux 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=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=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; solaris*) 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=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 "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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 export_dynamic_flag_spec='${wl}-Blargedynsym' 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 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=freebsd-elf 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 hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes 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' ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # 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_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" 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 CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 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 conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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" # 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:16106: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16110: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # 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_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # 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_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; 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_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # 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_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # 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_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # 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:16396: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16400: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=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:16500: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16504: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$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 echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # 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_GCJ="_GLOBAL_OFFSET_TABLE_" # 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. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; 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_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [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 aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$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 else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no cat <&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. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** 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 ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$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_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; 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_GCJ=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_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # 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_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$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. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' 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 "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$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_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$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' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=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 "$GCC" = yes; then whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT 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_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ 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. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 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 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' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi shlibpath_var=LIBPATH fi ;; amigaos*) 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=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $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' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # 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~ chmod a+x \$dldir/$dlname' 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="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. 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 ;; 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 ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # 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}${versuffix}$shared_ext ${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_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # 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[123]*) 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} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH 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 ;; 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 hardcode_into_libs=yes ;; 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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' ;; interix[3-9]*) 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' 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 "$lt_cv_prog_gnu_ld" = yes; then version_type=linux 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 ;; # This must be Linux ELF. linux* | k*bsd*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # 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 # Append ld.so.conf contents 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;/^$/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' ;; 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 ;; newsos6) version_type=linux 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=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=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 ;; solaris*) 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=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 "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux 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 export_dynamic_flag_spec='${wl}-Blargedynsym' 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 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=freebsd-elf 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 hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes 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' ;; uts4*) version_type=linux 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 ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # 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 "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # 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_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" 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 CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # 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 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 conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # 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 # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # 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 # 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 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # 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 # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # 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 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # 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 in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # 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_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # 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_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" 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 CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # Checks for header files. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in stdint.h sys/types.h signal.h fcntl.h malloc.h locale.h \ stddef.h wchar.h dlfcn.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi # AX_C___ATTRIBUTE__ echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac if test "$ac_cv_c_inline" != no then cat >>confdefs.h <<\_ACEOF #define COB_HAS_INLINE 1 _ACEOF fi # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF 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=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in memmove memset setlocale fcntl strerror \ strcasecmp strchr strrchr strdup strstr strtol gettimeofday do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check for timezone cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { timezone = 3600; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_TIMEZONE 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Checks for internationalization stuff if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # 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. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path 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 "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 with_gnu_ld=$acl_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6 wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" : else enable_rpath=yes fi; use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi; LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6 else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6 cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi # Checks for getopt_long. # Cygwin has getopt_long_only prototype in kpathsea/getopt.h # FreeBSD has gnugetopt library - needs checking echo "$as_me:$LINENO: checking for getopt_long_only" >&5 echo $ECHO_N "checking for getopt_long_only... $ECHO_C" >&6 if test "${ac_cv_func_getopt_long_only+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getopt_long_only to an innocuous variant, in case declares getopt_long_only. For example, HP-UX 11i declares gettimeofday. */ #define getopt_long_only innocuous_getopt_long_only /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getopt_long_only (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getopt_long_only /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getopt_long_only (); /* 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_getopt_long_only) || defined (__stub___getopt_long_only) choke me #else char (*f) () = getopt_long_only; #endif #ifdef __cplusplus } #endif int main () { return f != getopt_long_only; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getopt_long_only=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getopt_long_only=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long_only" >&5 echo "${ECHO_T}$ac_cv_func_getopt_long_only" >&6 if test $ac_cv_func_getopt_long_only = yes; then for ac_header in kpathsea/getopt.h getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else case $LIBOBJS in "getopt.$ac_objext" | \ *" getopt.$ac_objext" | \ "getopt.$ac_objext "* | \ *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac case $LIBOBJS in "getopt1.$ac_objext" | \ *" getopt1.$ac_objext" | \ "getopt1.$ac_objext "* | \ *" getopt1.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt1.$ac_objext" ;; esac fi # Checks for gmp. for ac_header in gmp.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: gmp.h is required" >&5 echo "$as_me: error: gmp.h is required" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for __gmp_randinit in -lgmp" >&5 echo $ECHO_N "checking for __gmp_randinit in -lgmp... $ECHO_C" >&6 if test "${ac_cv_lib_gmp___gmp_randinit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgmp $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __gmp_randinit (); int main () { __gmp_randinit (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gmp___gmp_randinit=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gmp___gmp_randinit=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmp_randinit" >&5 echo "${ECHO_T}$ac_cv_lib_gmp___gmp_randinit" >&6 if test $ac_cv_lib_gmp___gmp_randinit = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGMP 1 _ACEOF LIBS="-lgmp $LIBS" else { { echo "$as_me:$LINENO: error: GMP 3 or later is required" >&5 echo "$as_me: error: GMP 3 or later is required" >&2;} { (exit 1); exit 1; }; } fi LIBCOB_LIBS="$LIBCOB_LIBS -lgmp" # Solaris has nanosleep in other libraries cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { nanosleep (NULL, NULL); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: checking for nanosleep in -lrt" >&5 echo $ECHO_N "checking for nanosleep in -lrt... $ECHO_C" >&6 if test "${ac_cv_lib_rt_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char nanosleep (); int main () { nanosleep (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_rt_nanosleep=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rt_nanosleep=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_rt_nanosleep" >&5 echo "${ECHO_T}$ac_cv_lib_rt_nanosleep" >&6 if test $ac_cv_lib_rt_nanosleep = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi if test "x$ac_cv_lib_rt_nanosleep" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lrt" else echo "$as_me:$LINENO: checking for nanosleep in -lposix4" >&5 echo $ECHO_N "checking for nanosleep in -lposix4... $ECHO_C" >&6 if test "${ac_cv_lib_posix4_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix4 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char nanosleep (); int main () { nanosleep (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_posix4_nanosleep=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix4_nanosleep=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_posix4_nanosleep" >&5 echo "${ECHO_T}$ac_cv_lib_posix4_nanosleep" >&6 if test $ac_cv_lib_posix4_nanosleep = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPOSIX4 1 _ACEOF LIBS="-lposix4 $LIBS" fi if test "x$ac_cv_lib_posix4_nanosleep" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lposix4" fi fi fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Checks for gettext. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f messages.po # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-1" echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 if test "$gt_cv_func_gnugettext1_libc" != "yes"; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6 else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix or --without-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval="$with_libintl_prefix" if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi; LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (); int main () { bindtextdomain ("", ""); return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 if test "$USE_NLS" = "yes"; then echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6 fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6 for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi INTLLIBS="$LIBINTL" if test "x$LTLIBINTL" != "x" then COBC_LIBS="$COBC_LIBS $LTLIBINTL" LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL" fi # Checks for ncurses/pdcurses/curses. USE_NCURSES="no" echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6 if test "${ac_cv_lib_ncurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ncurses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_initscr=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6 if test $ac_cv_lib_ncurses_initscr = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNCURSES 1 _ACEOF LIBS="-lncurses $LIBS" fi if test "x$ac_cv_lib_ncurses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lncurses" for ac_header in ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF USE_NCURSES="yes" else for ac_header in ncurses/ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF USE_NCURSES="ncurses" fi done fi done else echo "$as_me:$LINENO: checking for initscr in -lpdcurses" >&5 echo $ECHO_N "checking for initscr in -lpdcurses... $ECHO_C" >&6 if test "${ac_cv_lib_pdcurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpdcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pdcurses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pdcurses_initscr=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pdcurses_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_pdcurses_initscr" >&6 if test $ac_cv_lib_pdcurses_initscr = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPDCURSES 1 _ACEOF LIBS="-lpdcurses $LIBS" fi if test "x$ac_cv_lib_pdcurses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lpdcurses" for ac_header in pdcurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF USE_NCURSES="pdcurses" fi done else echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6 if test "${ac_cv_lib_curses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_curses_initscr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_initscr=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6 if test $ac_cv_lib_curses_initscr = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCURSES 1 _ACEOF LIBS="-lcurses $LIBS" fi if test "x$ac_cv_lib_curses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lcurses" for ac_header in curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF USE_NCURSES="curses" fi done fi fi fi if test "$USE_NCURSES" != "no" then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_NCURSES_H #include #elif defined (HAVE_NCURSES_NCURSES_H) #include #elif defined (HAVE_PDCURSES_H) #include #elif defined (HAVE_CURSES_H) #include #endif int main () { color_set (0, NULL); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_COLOR_SET 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Checks for db. USE_DB="no" HAS_DB41="no" if test "$LIBDB" = "1" then for ac_header in db1/db.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DB1_DB_H 1 _ACEOF else { { echo "$as_me:$LINENO: error: db1/db.h is required" >&5 echo "$as_me: error: db1/db.h is required" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for dbopen in -ldb1" >&5 echo $ECHO_N "checking for dbopen in -ldb1... $ECHO_C" >&6 if test "${ac_cv_lib_db1_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb1 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db1_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db1_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db1_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db1_dbopen" >&6 if test $ac_cv_lib_db1_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb1" else { { echo "$as_me:$LINENO: error: libdb1 is required" >&5 echo "$as_me: error: libdb1 is required" >&2;} { (exit 1); exit 1; }; } fi elif test "$LIBDB" = "3" then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { printf("checking for BDB db.h version >= 4.1 ... "); #if (DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR > 0)) printf("yes (%d.%d)\n", DB_VERSION_MAJOR, DB_VERSION_MINOR); return 0; #else printf("no (%d.%d)\n", DB_VERSION_MAJOR, DB_VERSION_MINOR); return 1; #endif ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then HAS_DB41="yes" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$HAS_DB41" = "yes" then cat >>confdefs.h <<\_ACEOF #define USE_DB41 1 _ACEOF MYOLDLIBS="$LIBS" export MYOCLIBS for MYOCLIBS in db db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 do LIBS="$MYOLDLIBS -l$MYOCLIBS" if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int major, minor, patch; printf("checking for BDB 4.1 compatibility in %s ... ", getenv("MYOCLIBS")); db_version (&major, &minor, &patch); if (major == DB_VERSION_MAJOR && minor == DB_VERSION_MINOR) { printf("yes\n"); return 0; } printf("no\n"); return 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then USE_DB="yes" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$USE_DB" != "no" then LIBCOB_LIBS="$LIBCOB_LIBS -l$MYOCLIBS" break fi done LIBS="$MYOLDLIBS" if test "$USE_DB" != "yes" then { { echo "$as_me:$LINENO: error: Include file db.h implies version >=4.1 but no library found" >&5 echo "$as_me: error: Include file db.h implies version >=4.1 but no library found" >&2;} { (exit 1); exit 1; }; } fi else for ac_header in db.h db_185.h db3/db_185.h db4/db_185.h db4.1/db_185.h db4.2/db_185.h db4.3/db_185.h db4.4/db_185.h db4.5/db_185.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for __db_open in -ldb-4.5" >&5 echo $ECHO_N "checking for __db_open in -ldb-4.5... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_5___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.5 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_5___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_5___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_5___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_5___db_open" >&6 if test $ac_cv_lib_db_4_5___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.5" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4.5" >&5 echo $ECHO_N "checking for dbopen in -ldb-4.5... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_5_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.5 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_5_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_5_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_5_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_5_dbopen" >&6 if test $ac_cv_lib_db_4_5_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.5" fi fi if test "$USE_DB" != "yes" then echo "$as_me:$LINENO: checking for __db_open in -ldb-4.4" >&5 echo $ECHO_N "checking for __db_open in -ldb-4.4... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_4___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.4 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_4___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_4___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_4___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_4___db_open" >&6 if test $ac_cv_lib_db_4_4___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.4" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4.4" >&5 echo $ECHO_N "checking for dbopen in -ldb-4.4... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_4_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.4 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_4_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_4_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_4_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_4_dbopen" >&6 if test $ac_cv_lib_db_4_4_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.4" fi fi fi if test "$USE_DB" != "yes" then echo "$as_me:$LINENO: checking for __db_open in -ldb-4.3" >&5 echo $ECHO_N "checking for __db_open in -ldb-4.3... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_3___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.3 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_3___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_3___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_3___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_3___db_open" >&6 if test $ac_cv_lib_db_4_3___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.3" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4.3" >&5 echo $ECHO_N "checking for dbopen in -ldb-4.3... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_3_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.3 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_3_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_3_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_3_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_3_dbopen" >&6 if test $ac_cv_lib_db_4_3_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.3" fi fi fi if test "$USE_DB" != "yes" then echo "$as_me:$LINENO: checking for __db_open in -ldb-4.2" >&5 echo $ECHO_N "checking for __db_open in -ldb-4.2... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_2___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_2___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_2___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_2___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_2___db_open" >&6 if test $ac_cv_lib_db_4_2___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.2" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4.2" >&5 echo $ECHO_N "checking for dbopen in -ldb-4.2... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_2_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.2 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_2_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_2_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_2_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_2_dbopen" >&6 if test $ac_cv_lib_db_4_2_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.2" fi fi fi if test "$USE_DB" != "yes" then echo "$as_me:$LINENO: checking for __db_open in -ldb-4.1" >&5 echo $ECHO_N "checking for __db_open in -ldb-4.1... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_1___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.1 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_1___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_1___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_1___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_1___db_open" >&6 if test $ac_cv_lib_db_4_1___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.1" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4.1" >&5 echo $ECHO_N "checking for dbopen in -ldb-4.1... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_1_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4.1 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_1_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_1_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_1_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_1_dbopen" >&6 if test $ac_cv_lib_db_4_1_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.1" fi fi fi if test "$USE_DB" != "yes" then # if test "$HAS_DB41" != "no" # then # AC_MSG_ERROR(Include file db.h implies version >=4.1 but no library found) # fi echo "$as_me:$LINENO: checking for __db_open in -ldb-4" >&5 echo $ECHO_N "checking for __db_open in -ldb-4... $ECHO_C" >&6 if test "${ac_cv_lib_db_4___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db_4___db_open" >&6 if test $ac_cv_lib_db_4___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4" else echo "$as_me:$LINENO: checking for dbopen in -ldb-4" >&5 echo $ECHO_N "checking for dbopen in -ldb-4... $ECHO_C" >&6 if test "${ac_cv_lib_db_4_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb-4 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_4_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_4_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_4_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_4_dbopen" >&6 if test $ac_cv_lib_db_4_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4" fi fi fi if test "$USE_DB" != "yes" then echo "$as_me:$LINENO: checking for __db_open in -ldb" >&5 echo $ECHO_N "checking for __db_open in -ldb... $ECHO_C" >&6 if test "${ac_cv_lib_db___db_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __db_open (); int main () { __db_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db___db_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db___db_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db___db_open" >&5 echo "${ECHO_T}$ac_cv_lib_db___db_open" >&6 if test $ac_cv_lib_db___db_open = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb" else echo "$as_me:$LINENO: checking for dbopen in -ldb" >&5 echo $ECHO_N "checking for dbopen in -ldb... $ECHO_C" >&6 if test "${ac_cv_lib_db_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db_dbopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_db_dbopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db_dbopen" >&6 if test $ac_cv_lib_db_dbopen = yes; then USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb" else { { echo "$as_me:$LINENO: error: libdb is required" >&5 echo "$as_me: error: libdb is required" >&2;} { (exit 1); exit 1; }; } fi fi fi fi fi # Checks for dl/ltdl. if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifdef _WIN32 return 0; #else return 1; #endif ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then DEFINE_DL="yes" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$DEFINE_DL" = "no" -a "$COB_TRY_DL" = "yes" then if test "x$ac_cv_header_dlfcn_h" = "xyes" then echo "$as_me:$LINENO: checking for dlopen in -lc" >&5 echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_c_dlopen" >&6 if test $ac_cv_lib_c_dlopen = yes; then DEFINE_DL="yes" fi if test "$DEFINE_DL" = "no" then echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then DEFINE_DL="yes" fi if test "$DEFINE_DL" = "yes" then cat >>confdefs.h <<\_ACEOF #define USE_LIBDL 1 _ACEOF LIBCOB_LIBS="$LIBCOB_LIBS -ldl" fi else cat >>confdefs.h <<\_ACEOF #define USE_LIBDL 1 _ACEOF fi fi fi if test "$DEFINE_DL" = "no" then for ac_header in ltdl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------------------- ## ## Report this to open-cobol-list@lists.sourceforge.net ## ## ---------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: ltdl.h is required" >&5 echo "$as_me: error: ltdl.h is required" >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:$LINENO: checking for lt_dlopen in -lltdl" >&5 echo $ECHO_N "checking for lt_dlopen in -lltdl... $ECHO_C" >&6 if test "${ac_cv_lib_ltdl_lt_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char lt_dlopen (); int main () { lt_dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ltdl_lt_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ltdl_lt_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ltdl_lt_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_ltdl_lt_dlopen" >&6 if test $ac_cv_lib_ltdl_lt_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLTDL 1 _ACEOF LIBS="-lltdl $LIBS" else { { echo "$as_me:$LINENO: error: libltdl is required" >&5 echo "$as_me: error: libltdl is required" >&2;} { (exit 1); exit 1; }; } fi LIBCOB_LIBS="$LIBCOB_LIBS -lltdl" fi # Checks for workable strftime if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { time_t ticks; int ret; char buff[16]; ticks = time(NULL); ret = strftime(buff, 15, "%z", localtime(&ticks)); if (ret != 5) { return 1; } if (buff[0] != '+' && buff[0] != '-') { return 1; } return 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define COB_STRFTIME 1 _ACEOF else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # Checks for size of long if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { if (sizeof(long int) == sizeof(long long)) return 0; return 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define COB_LI_IS_LL 1 _ACEOF else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # OpenCOBOL Configuration if test "x$prefix" = "xNONE" then if test "x$includedir" = "x\${prefix}/include" then COB_CFLAGS="-I${ac_default_prefix}/include" else COB_CFLAGS="-I${includedir}" fi else if test "x$includedir" = "x\${prefix}/include" then if test "x$prefix" = "x/usr" then COB_CFLAGS="" else COB_CFLAGS="-I${prefix}/include" fi else COB_CFLAGS="-I${includedir}" fi fi if test "x$CPPFLAGS" != "x" then COB_CFLAGS="$COB_CFLAGS $CPPFLAGS" fi COB_LIBS="-L$libdir -lcob ${LIBCOB_LIBS}" COB_LDFLAGS="" if test "x$LDFLAGS" != "x" then COB_LIBS="$LDFLAGS $COB_LIBS" COB_LDFLAGS="$LDFLAGS" fi COB_CONFIG_DIR="$datadir/$PACKAGE_TARNAME/config" COB_COPY_DIR="$datadir/$PACKAGE_TARNAME/copy" COB_LIBRARY_PATH="$libdir/$PACKAGE_TARNAME" COB_MODULE_EXT=`echo "$shlibext" | sed -e 's/dll\.a/dll/'` LIBS="$save_libs" COB_EXPORT_DYN="`eval echo $export_dynamic_flag_spec`" COB_PIC_FLAGS=`echo "$lt_prog_compiler_pic" | sed -e 's/^ //'` COB_SHARED_OPT="-shared" COB_EXEEXT="$EXEEXT" COB_EXTRA_FLAGS="" if test "$GEN_DEBUG_OPT" = "no" then CFLAGS=`echo "$CFLAGS" | sed -e 's/^-g//' -e 's/-g$//' -e 's/-g / /'` fi # Include CFLAGS in COB_CFLAGS without optimization/debug options cob_temp_flags=`echo "$CFLAGS" | sed -e 's/^[+-]O[0-9s]//' -e 's/[+-]O[0-9s]$//' -e 's/[+-]O[0-9s] / /'` cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/^-O//' -e 's/-O$//' -e 's/-O / /' -e 's/^-g//' -e 's/-g$//' -e 's/-g / /'` COB_CFLAGS="$COB_CFLAGS $cob_temp_flags" if test "`basename $COB_CC`" = "gcc" then cob_temp_flags="`${COB_CC} ${srcdir}/cpucheck.c -o cpucheck 1>/dev/null 2>&1 && ./cpucheck 2>/dev/null`" rm -f cpucheck${EXEEXT} if test "x$cob_temp_flags" != "x" then CFLAGS="$CFLAGS $cob_temp_flags -finline-functions" COB_EXTRA_FLAGS="$cob_temp_flags" else CFLAGS="$CFLAGS -finline-functions" fi fi # Check gcc 4 option MYOLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int testint; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_PSIGN_OPT 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$MYOLDCFLAGS" # Check if aligned attribute works cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { char testchar[4] __attribute__((aligned)); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_ATTRIBUTE_ALIGNED 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Special stuff COB_FIX_LIB="$COB_EXPORT_DYN" case $host_os in mingw*) if test "$prefix" = "NONE" then COB_CONFIG_DIR="`cd /usr && pwd -W`/local/share/$PACKAGE_TARNAME/config" COB_COPY_DIR="`cd /usr && pwd -W`/local/share/$PACKAGE_TARNAME/copy" fi COB_EXPORT_DYN="-Wl,--export-all-symbols -Wl,--enable-auto-import" COB_FIX_LIB="$COB_EXPORT_DYN" ;; cygwin*) COB_EXPORT_DYN="-Wl,--export-all-symbols -Wl,--enable-auto-import" COB_FIX_LIB="$COB_EXPORT_DYN" ;; darwin* | rhapsody*) COB_SHARED_OPT="-bundle -flat_namespace -undefined suppress" ;; hpux*) if test "`basename $CC`" != "gcc" then COB_SHARED_OPT="-b" cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF rm -f hptest* echo 'int main() { return 0; }' > hptest.c ${CC} ${CFLAGS} +Olit=all -o hptest hptest.c > hptest.out 2>&1 if test $? -ne 0 -o -s hptest.out then CFLAGS="$CFLAGS +ESlit" COB_CFLAGS="$COB_CFLAGS +ESlit -w" else CFLAGS="$CFLAGS +Olit=all" COB_CFLAGS="$COB_CFLAGS +Olit=all -w" fi rm -f hptest* fi ;; aix*) COB_EXPORT_DYN="-Wl,-bexpfull" if test "`basename $CC`" != "gcc" then CFLAGS="$CFLAGS -O2 -Q -qro -qroconst" COB_SHARED_OPT="-G" COB_FIX_LIB="" # COB_FIX_LIB="-Wc,-G $COB_EXPORT_DYN" # COB_CFLAGS="$COB_CFLAGS -qchars=signed" else COB_FIX_LIB="$COB_EXPORT_DYN" fi ;; solaris*) if test "`basename $CC`" != "gcc" then COB_SHARED_OPT="-G" fi ;; esac if test "`basename $CC`" = "gcc" then CFLAGS="$CFLAGS -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k" fi if test "x$lt_cv_dlopen_self" != "xyes" then cat >>confdefs.h <<\_ACEOF #define COB_NO_SELFOPEN 1 _ACEOF fi # Generate the output cat >>confdefs.h <<_ACEOF #define COB_EXPORT_DYN "$COB_EXPORT_DYN" _ACEOF cat >>confdefs.h <<_ACEOF #define COB_PIC_FLAGS "$COB_PIC_FLAGS" _ACEOF cat >>confdefs.h <<_ACEOF #define COB_SHARED_OPT "$COB_SHARED_OPT" _ACEOF cat >>confdefs.h <<_ACEOF #define COB_EXEEXT "$COB_EXEEXT" _ACEOF cat >>confdefs.h <<_ACEOF #define COB_EXTRA_FLAGS "$COB_EXTRA_FLAGS" _ACEOF if test "x$striplib" != "x" then cat >>confdefs.h <<_ACEOF #define COB_STRIP_CMD "$striplib" _ACEOF # AC_SUBST(COB_STRIP_CMD) fi COB_BIGENDIAN="$ac_cv_c_bigendian" ac_config_files="$ac_config_files cob-config Makefile lib/Makefile libcob/Makefile cobc/Makefile bin/Makefile po/Makefile.in texi/Makefile config/Makefile copy/Makefile tests/atlocal tests/Makefile tests/cobol85/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by OpenCOBOL $as_me 1.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ OpenCOBOL config.status 1.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "cob-config" ) CONFIG_FILES="$CONFIG_FILES cob-config" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "libcob/Makefile" ) CONFIG_FILES="$CONFIG_FILES libcob/Makefile" ;; "cobc/Makefile" ) CONFIG_FILES="$CONFIG_FILES cobc/Makefile" ;; "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "texi/Makefile" ) CONFIG_FILES="$CONFIG_FILES texi/Makefile" ;; "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "copy/Makefile" ) CONFIG_FILES="$CONFIG_FILES copy/Makefile" ;; "tests/atlocal" ) CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/cobol85/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/cobol85/Makefile" ;; "tests/atconfig" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@SED@,$SED,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@DLLTOOL@,$DLLTOOL,;t t s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t s,@AS@,$AS,;t t s,@ac_ct_AS@,$ac_ct_AS,;t t s,@OBJDUMP@,$OBJDUMP,;t t s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t s,@CXXCPP@,$CXXCPP,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIBICONV@,$LIBICONV,;t t s,@LTLIBICONV@,$LTLIBICONV,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t s,@USE_NLS@,$USE_NLS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@XGETTEXT@,$XGETTEXT,;t t s,@MSGMERGE@,$MSGMERGE,;t t s,@INTLLIBS@,$INTLLIBS,;t t s,@LIBINTL@,$LIBINTL,;t t s,@LTLIBINTL@,$LTLIBINTL,;t t s,@POSUB@,$POSUB,;t t s,@COB_CC@,$COB_CC,;t t s,@COB_CFLAGS@,$COB_CFLAGS,;t t s,@COB_LDFLAGS@,$COB_LDFLAGS,;t t s,@COB_LIBS@,$COB_LIBS,;t t s,@COB_CONFIG_DIR@,$COB_CONFIG_DIR,;t t s,@COB_COPY_DIR@,$COB_COPY_DIR,;t t s,@COB_LIBRARY_PATH@,$COB_LIBRARY_PATH,;t t s,@COB_MODULE_EXT@,$COB_MODULE_EXT,;t t s,@COBC_LIBS@,$COBC_LIBS,;t t s,@LIBCOB_CFLAGS@,$LIBCOB_CFLAGS,;t t s,@LIBCOB_LIBS@,$LIBCOB_LIBS,;t t s,@COB_EXPORT_DYN@,$COB_EXPORT_DYN,;t t s,@COB_PIC_FLAGS@,$COB_PIC_FLAGS,;t t s,@COB_SHARED_OPT@,$COB_SHARED_OPT,;t t s,@COB_BIGENDIAN@,$COB_BIGENDIAN,;t t s,@COB_FIX_LIB@,$COB_FIX_LIB,;t t s,@COB_HAS_INLINE@,$COB_HAS_INLINE,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in tests/atconfig ) cat >tests/atconfig < /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; default-1 ) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo "" echo "OpenCOBOL Configuration:" echo "" echo " CC ${CC}" echo " COB_CC ${COB_CC}" echo " CFLAGS ${CFLAGS}" echo " COB_CFLAGS ${COB_CFLAGS}" echo " COB_EXTRA_FLAGS ${COB_EXTRA_FLAGS}" echo " LDFLAGS ${LDFLAGS}" echo " COB_LDFLAGS ${COB_LDFLAGS}" if test "x$COBC_LIBS" != "x" then echo " COBC_LIBS ${COBC_LIBS}" fi echo " COB_LIBS ${COB_LIBS}" echo " COB_CONFIG_DIR ${COB_CONFIG_DIR}" echo " COB_COPY_DIR ${COB_COPY_DIR}" echo " COB_LIBRARY_PATH ${COB_LIBRARY_PATH}" echo " COB_MODULE_EXT ${COB_MODULE_EXT}" echo " COB_SHARED_OPT ${COB_SHARED_OPT}" echo " COB_PIC_FLAGS ${COB_PIC_FLAGS}" echo " COB_EXPORT_DYN ${COB_EXPORT_DYN}" if test "x$striplib" != "x" then echo " COB_STRIP_CMD ${striplib}" fi if test "${DEFINE_DL}" = "yes" then echo " Dynamic loading System" else echo " Dynamic loading Libtool" fi echo "" echo " Use gettext for international messages: ${USE_NLS}" if test "$with_seqra_extfh" = "yes" then echo " Use external SEQ/RAN file handler yes" fi if test "$with_index_extfh" = "yes" then echo " Use external ISAM file handler yes" elif test "$with_cisam" = "yes" then echo " Use CISAM for file I/O yes" elif test "$with_disam" = "yes" then echo " Use DISAM for file I/O yes" elif test "$with_vbisam" = "yes" then echo " Use VBISAM for file I/O yes" else echo " Use Berkeley DB for file I/O: ${USE_DB}" echo " Use enhanced Berkeley DB (>= 4.1) ${HAS_DB41}" fi echo " Use fcntl for file locking: ${ac_cv_func_fcntl}" echo " Use ncurses/pdcurses/curses for screen I/O: ${USE_NCURSES}" echo "" open-cobol-1.1/tarstamp.h0000644000000000000000000000006611143001517011036 static char octardate[] = "Feb 06 2009 10:30:55 CET"; open-cobol-1.1/cob-config.in0000644000000000000000000000244211130701401011363 #!/bin/sh # # Copyright (C) 2003-2009 Keisuke Nishida # Copyright (C) 2008-2009 Roger While # prefix=@prefix@ exec_prefix=${prefix} exec_prefix_set=no libdir=@libdir@ includedir=@includedir@ version="@VERSION@" cflags="@COB_CFLAGS@" libs="@COB_LIBS@" usage() { cat <&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo_prefix=yes ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo_exec_prefix=yes ;; --version) echo $version ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_prefix" = "yes"; then echo $prefix fi if test "$echo_exec_prefix" = "yes"; then echo $exec_prefix fi if test "$echo_cflags" = "yes"; then echo $cflags fi if test "$echo_libs" = "yes"; then echo $libs fi open-cobol-1.1/configure.ac0000644000000000000000000005466711130701401011333 # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # Copyright (C) 2001-2009 Keisuke Nishida # Copyright (C) 2007-2009 Roger While # # 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, write to # the Free Software Foundation, 51 Franklin Street, Fifth Floor # Boston, MA 02110-1301 USA AC_PREREQ(2.59) AC_INIT([OpenCOBOL],[1.1],[open-cobol-list@lists.sourceforge.net],[open-cobol]) AC_CONFIG_SRCDIR([libcob.h]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_TESTDIR([tests]) AC_CONFIG_MACRO_DIR([m4]) # Note for SUN Solaris (gcc) # export/setenv CFLAGS "-m64 -mptr64" # export/setenv LDFLAGS "-m64 -mptr64 -L/usr/local/lib/sparcv9" # ./configure --libdir=/usr/local/lib/sparcv9 # # Hack for AIX 64 bit (gcc) # Required - # export/setenv CFLAGS=-maix64 # export/setenv LDFLAGS=-maix64 if echo $CFLAGS | grep 'aix64' 1>/dev/null 2>&1 then if test -f /usr/ccs/bin/ar then AR="/usr/ccs/bin/ar -X64" else AR="ar -X64" fi NM="/usr/ccs/bin/nm -X64 -B" fi AM_INIT_AUTOMAKE([gnu no-texinfo.tex]) AM_MAINTAINER_MODE # Autoheader templates AH_TEMPLATE([WITH_DB], [Compile with the Berkeley DB library]) AH_TEMPLATE([USE_DB41], [Use Berkeley DB library new features]) AH_TEMPLATE([WITH_INDEX_EXTFH], [Compile with an external ISAM handler]) AH_TEMPLATE([WITH_SEQRA_EXTFH], [Compile with an external SEQ/RAN handler]) AH_TEMPLATE([WITH_CISAM], [Use CISAM as ISAM handler]) AH_TEMPLATE([WITH_DISAM], [Use DISAM as ISAM handler]) AH_TEMPLATE([WITH_VBISAM], [Use VBISAM as ISAM handler]) # AH_TEMPLATE([WITH_LFS64], [Compile with large file system 64]) AH_TEMPLATE([COB_EXPERIMENTAL], [Enable experimemental code (Developers only!)]) AH_TEMPLATE([COB_PARAM_CHECK], [Enable CALL parameter checking]) AH_TEMPLATE([COB_EXPORT_DYN], [Compile/link option for exporting symbols]) AH_TEMPLATE([COB_PIC_FLAGS], [Compile/link option for PIC code]) AH_TEMPLATE([COB_SHARED_OPT], [Compile/link option for shared code]) AH_TEMPLATE([COB_STRIP_CMD], [Strip command]) AH_TEMPLATE([USE_LIBDL], [Use system dynamic loader]) AH_TEMPLATE([PATCH_LEVEL], [Define a patch level]) AH_TEMPLATE([WITH_VARSEQ], [Define variable sequential file format]) # AH_TEMPLATE([DLLHIDDEN], [Has visibility attribute]) AH_TEMPLATE([HAVE_PSIGN_OPT], [Has -Wno-pointer-sign]) AH_TEMPLATE([HAVE_ATTRIBUTE_ALIGNED], [Has __attribute__((aligned))]) AH_TEMPLATE([HAVE_TIMEZONE], [Has timezone variable]) AH_TEMPLATE([COB_EXEEXT], [Executable extension]) AH_TEMPLATE([COB_EXTRA_FLAGS], [Extra Compiler Flags]) AH_TEMPLATE([__USE_STRING_INLINES], [Compiler optimization]) AH_TEMPLATE([COB_HAS_INLINE], [Can use inline keyword]) AH_TEMPLATE([COB_NO_SELFOPEN], [Can not dlopen self]) AH_TEMPLATE([COB_STRFTIME], [Can use strftime for timezone]) AH_TEMPLATE([COB_LI_IS_LL], [long int is long long]) AH_TEMPLATE([HAVE_COLOR_SET], [curses has color_set function]) AC_DEFINE(__USE_STRING_INLINES) LIBCOB_LIBS="-lm" LIBCOB_CFLAGS="$lt_prog_compiler_pic" save_libs="$LIBS" AC_PROG_CC(gcc xlc cc) AC_PROG_CPP AC_PROG_EGREP # Configure options. COB_CC="" AC_ARG_WITH(cc, [ --with-cc= (OpenCOBOL) specify the C compiler used by cobc], [ COB_CC=$withval ], [ COB_CC=$CC] ) AC_ARG_WITH(seqra-extfh, [ --with-seqra-extfh (OpenCOBOL) Use external SEQ/RAN file handler], [ if test "$with_seqra_extfh" = "yes" then AC_DEFINE(WITH_SEQRA_EXTFH) fi ], []) AC_ARG_WITH(cisam, [ --with-cisam (OpenCOBOL) Use CISAM for ISAM I/O], [ if test "$with_cisam" = "yes" then AC_CHECK_HEADERS([isam.h], , AC_MSG_ERROR(isam.h is required for CISAM)) AC_CHECK_LIB([ifisam], [isopen], , AC_MSG_ERROR(libifisam is required for CISAM), [ifisamx]) AC_DEFINE(WITH_CISAM) LIBCOB_LIBS="$LIBCOB_LIBS -lifisam -lifisamx" fi ], []) if test "$with_cisam" != "yes" then AC_ARG_WITH(disam, [ --with-disam (OpenCOBOL) Use DISAM for ISAM I/O], [ if test "$with_disam" = "yes" then AC_CHECK_HEADERS([disam.h], , AC_MSG_ERROR(disam.h is required for DISAM)) AC_CHECK_LIB([disam], [isopen], , AC_MSG_ERROR(libdisam is required for DISAM)) AC_DEFINE(WITH_DISAM) LIBCOB_LIBS="$LIBCOB_LIBS -ldisam" fi ], []) fi if test "$with_cisam" != "yes" -a "$with_disam" != "yes" then AC_ARG_WITH(vbisam, [ --with-vbisam (OpenCOBOL) Use VBISAM for ISAM I/O], [ if test "$with_vbisam" = "yes" then AC_CHECK_HEADERS([vbisam.h], , AC_MSG_ERROR(vbisam.h is required for VBISAM)) AC_CHECK_LIB([vbisam], [isopen], , AC_MSG_ERROR(libvbisam is required for VBISAM)) AC_DEFINE(WITH_VBISAM) LIBCOB_LIBS="$LIBCOB_LIBS -lvbisam" fi ], []) fi LIBDB="" if test "$with_cisam" != "yes" -a "$with_disam" != "yes" -a "$with_vbisam" != "yes" then AC_ARG_WITH(index-extfh, [ --with-index-extfh (OpenCOBOL) Use external ISAM file handler], [ if test "$with_index_extfh" = "yes" then AC_DEFINE(WITH_INDEX_EXTFH) fi ], [ AC_ARG_WITH(db1, [ --with-db1 (OpenCOBOL) use Berkeley DB 1.85 (libdb-1.85)], [ LIBDB="1" AC_DEFINE(WITH_DB, 1) ], [ AC_ARG_WITH(db, [ --with-db (OpenCOBOL) use Berkeley DB 3.0 or later (libdb)(default)], [ if test "$with_db" = "yes" then LIBDB="3" AC_DEFINE(WITH_DB, 3) fi ], [ LIBDB="3" AC_DEFINE(WITH_DB, 3) ]) ]) ]) fi #AC_ARG_WITH(lfs64, # [ --with-lfs64 (OpenCOBOL) use large file system for file I/O (default)], # [ if test "$with_lfs64" = "yes" # then # AC_DEFINE(WITH_LFS64) # fi ], # [ AC_DEFINE(WITH_LFS64) ]) DEFINE_DL="no" COB_TRY_DL="yes" AC_ARG_WITH(dl, [ --with-dl (OpenCOBOL) use system dynamic loader (default)], [case $with_dl in yes) COB_TRY_DL="yes" ;; no) COB_TRY_DL="no" ;; *) AC_MSG_ERROR(["--with/without-dl can not have a value"]) ;; esac]) GEN_DEBUG_OPT="no" AC_ARG_ENABLE(debug, [ --enable-debug (OpenCOBOL) enable -g C compiler debug option], [if test "$enable_debug" = "yes" then GEN_DEBUG_OPT="yes" fi]) AC_ARG_ENABLE(experimental, [ --enable-experimental (OpenCOBOL) enable experimental code (Developers only!)], [if test "$enable_experimental" = "yes" then AC_DEFINE(COB_EXPERIMENTAL) fi]) AC_ARG_ENABLE(param-check, [ --enable-param-check (OpenCOBOL) enable CALL parameter checking], [if test "$enable_param_check" = "yes" then AC_DEFINE(COB_PARAM_CHECK) fi]) PATCH_LEVEL=0 AC_ARG_WITH(patch-level, [ --with-patch-level (OpenCOBOL) define a patch level (default 0)], [case $with_patch_level in yes) AC_MSG_ERROR(["You must give --with-patch-level an argument."]) ;; no) AC_MSG_ERROR(["--without-patch-level not supported."]) ;; [[0-9]]*) PATCH_LEVEL=$with_patch_level ;; *) AC_MSG_ERROR(["You must use a numeric patch level"]) ;; esac]) AC_DEFINE_UNQUOTED(PATCH_LEVEL, $PATCH_LEVEL) WITH_VARSEQ=0 AC_ARG_WITH(varseq, [ --with-varseq (OpenCOBOL) define variable sequential format (default 0)], [case $with_varseq in yes) AC_MSG_ERROR(["You must give --with-varseq an argument."]) ;; no) AC_MSG_ERROR(["--without-varseq not supported."]) ;; [[0-3]]) WITH_VARSEQ=$with_varseq ;; *) AC_MSG_ERROR(["Invalid --with-varseq argument"]) ;; esac]) AC_DEFINE_UNQUOTED(WITH_VARSEQ, $WITH_VARSEQ) # Checks for programs. # Stop the stupid tests for C++ and Fortran AC_PROVIDE([AC_PROG_F77]) AC_PROVIDE([AC_PROG_CXX]) with_tags= AC_PROG_LN_S AC_PROG_INSTALL AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_PROG_MAKE_SET # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdint.h sys/types.h signal.h fcntl.h malloc.h locale.h \ stddef.h wchar.h dlfcn.h sys/time.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_STRUCT_TM # AX_C___ATTRIBUTE__ AC_C_INLINE if test "$ac_cv_c_inline" != no then AC_DEFINE(COB_HAS_INLINE, 1) fi # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_VPRINTF AC_CHECK_FUNCS([memmove memset setlocale fcntl strerror \ strcasecmp strchr strrchr strdup strstr strtol gettimeofday]) # Check for timezone AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[timezone = 3600;]])], [AC_DEFINE(HAVE_TIMEZONE, 1)], []) # Checks for internationalization stuff AM_ICONV AM_LANGINFO_CODESET # Checks for getopt_long. # Cygwin has getopt_long_only prototype in kpathsea/getopt.h # FreeBSD has gnugetopt library - needs checking AC_CHECK_FUNC([getopt_long_only], [AC_CHECK_HEADERS([kpathsea/getopt.h getopt.h], [], [])], [AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) AC_LIBSOURCE(getopt.h)]) # Checks for gmp. AC_CHECK_HEADERS([gmp.h], , AC_MSG_ERROR(gmp.h is required)) AC_CHECK_LIB([gmp], [__gmp_randinit], , AC_MSG_ERROR(GMP 3 or later is required)) LIBCOB_LIBS="$LIBCOB_LIBS -lgmp" # Solaris has nanosleep in other libraries AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nanosleep (NULL, NULL);]])], [], [AC_CHECK_LIB([rt], [nanosleep]) if test "x$ac_cv_lib_rt_nanosleep" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lrt" else AC_CHECK_LIB([posix4], [nanosleep]) if test "x$ac_cv_lib_posix4_nanosleep" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lposix4" fi fi]) # Checks for gettext. AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION(0.13) if test "x$LTLIBINTL" != "x" then COBC_LIBS="$COBC_LIBS $LTLIBINTL" LIBCOB_LIBS="$LIBCOB_LIBS $LTLIBINTL" fi # Checks for ncurses/pdcurses/curses. USE_NCURSES="no" AC_CHECK_LIB([ncurses], [initscr]) if test "x$ac_cv_lib_ncurses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lncurses" AC_CHECK_HEADERS([ncurses.h], [USE_NCURSES="yes"], [AC_CHECK_HEADERS([ncurses/ncurses.h], [USE_NCURSES="ncurses"], [], [])], []) else AC_CHECK_LIB([pdcurses], [initscr]) if test "x$ac_cv_lib_pdcurses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lpdcurses" AC_CHECK_HEADERS([pdcurses.h], [USE_NCURSES="pdcurses"], [], []) else AC_CHECK_LIB([curses], [initscr]) if test "x$ac_cv_lib_curses_initscr" = "xyes" then LIBCOB_LIBS="$LIBCOB_LIBS -lcurses" AC_CHECK_HEADERS([curses.h], [USE_NCURSES="curses"], [], []) fi fi fi if test "$USE_NCURSES" != "no" then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_NCURSES_H #include #elif defined (HAVE_NCURSES_NCURSES_H) #include #elif defined (HAVE_PDCURSES_H) #include #elif defined (HAVE_CURSES_H) #include #endif]], [[ color_set (0, NULL);]])], [AC_DEFINE(HAVE_COLOR_SET)], [], []) fi # Checks for db. USE_DB="no" HAS_DB41="no" if test "$LIBDB" = "1" then AC_CHECK_HEADERS([db1/db.h], [AC_DEFINE(HAVE_DB1_DB_H)], [AC_MSG_ERROR([db1/db.h is required])]) AC_CHECK_LIB([db1], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb1"], [AC_MSG_ERROR(libdb1 is required)]) elif test "$LIBDB" = "3" then AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include #include #include ]], [[ printf("checking for BDB db.h version >= 4.1 ... "); #if (DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR > 0)) printf("yes (%d.%d)\n", DB_VERSION_MAJOR, DB_VERSION_MINOR); return 0; #else printf("no (%d.%d)\n", DB_VERSION_MAJOR, DB_VERSION_MINOR); return 1; #endif]])], [HAS_DB41="yes"], [], []) if test "$HAS_DB41" = "yes" then AC_DEFINE(USE_DB41) MYOLDLIBS="$LIBS" export MYOCLIBS for MYOCLIBS in db db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 do LIBS="$MYOLDLIBS -l$MYOCLIBS" AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include #include #include ]], [[ int major, minor, patch; printf("checking for BDB 4.1 compatibility in %s ... ", getenv("MYOCLIBS")); db_version (&major, &minor, &patch); if (major == DB_VERSION_MAJOR && minor == DB_VERSION_MINOR) { printf("yes\n"); return 0; } printf("no\n"); return 1;]])], [USE_DB="yes"], [], []) if test "$USE_DB" != "no" then LIBCOB_LIBS="$LIBCOB_LIBS -l$MYOCLIBS" break fi done LIBS="$MYOLDLIBS" if test "$USE_DB" != "yes" then AC_MSG_ERROR(Include file db.h implies version >=4.1 but no library found) fi else AC_CHECK_HEADERS([db.h db_185.h db3/db_185.h db4/db_185.h db4.1/db_185.h db4.2/db_185.h db4.3/db_185.h db4.4/db_185.h db4.5/db_185.h]) AC_CHECK_LIB([db-4.5], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.5"], [AC_CHECK_LIB([db-4.5], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.5"], [])]) if test "$USE_DB" != "yes" then AC_CHECK_LIB([db-4.4], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.4"], [AC_CHECK_LIB([db-4.4], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.4"], [])]) fi if test "$USE_DB" != "yes" then AC_CHECK_LIB([db-4.3], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.3"], [AC_CHECK_LIB([db-4.3], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.3"], [])]) fi if test "$USE_DB" != "yes" then AC_CHECK_LIB([db-4.2], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.2"], [AC_CHECK_LIB([db-4.2], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.2"], [])]) fi if test "$USE_DB" != "yes" then AC_CHECK_LIB([db-4.1], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.1"], [AC_CHECK_LIB([db-4.1], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4.1"], [])]) fi if test "$USE_DB" != "yes" then # if test "$HAS_DB41" != "no" # then # AC_MSG_ERROR(Include file db.h implies version >=4.1 but no library found) # fi AC_CHECK_LIB([db-4], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4"], [AC_CHECK_LIB([db-4], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb-4"], [])]) fi if test "$USE_DB" != "yes" then AC_CHECK_LIB([db], [__db_open], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb"], [AC_CHECK_LIB([db], [dbopen], [USE_DB="yes" LIBCOB_LIBS="$LIBCOB_LIBS -ldb"], [AC_MSG_ERROR(libdb is required)])]) fi fi fi # Checks for dl/ltdl. AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[ #ifdef _WIN32 return 0; #else return 1; #endif]])], [DEFINE_DL="yes"], [], []) if test "$DEFINE_DL" = "no" -a "$COB_TRY_DL" = "yes" then if test "x$ac_cv_header_dlfcn_h" = "xyes" then AC_CHECK_LIB([c], [dlopen], [DEFINE_DL="yes"], []) if test "$DEFINE_DL" = "no" then AC_CHECK_LIB([dl], [dlopen], [DEFINE_DL="yes"], []) if test "$DEFINE_DL" = "yes" then AC_DEFINE(USE_LIBDL) LIBCOB_LIBS="$LIBCOB_LIBS -ldl" fi else AC_DEFINE(USE_LIBDL) fi fi fi if test "$DEFINE_DL" = "no" then AC_CHECK_HEADERS([ltdl.h], , AC_MSG_ERROR(ltdl.h is required)) AC_CHECK_LIB([ltdl], [lt_dlopen], , AC_MSG_ERROR(libltdl is required)) LIBCOB_LIBS="$LIBCOB_LIBS -lltdl" fi # Checks for workable strftime AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[ time_t ticks; int ret; char buff[16]; ticks = time(NULL); ret = strftime(buff, 15, "%z", localtime(&ticks)); if (ret != 5) { return 1; } if (buff[0] != '+' && buff[0] != '-') { return 1; } return 0;]])], [AC_DEFINE(COB_STRFTIME)], [], []) # Checks for size of long AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[ if (sizeof(long int) == sizeof(long long)) return 0; return 1; ]])], [AC_DEFINE(COB_LI_IS_LL)], [], []) # OpenCOBOL Configuration if test "x$prefix" = "xNONE" then if test "x$includedir" = "x\${prefix}/include" then COB_CFLAGS="-I${ac_default_prefix}/include" else COB_CFLAGS="-I${includedir}" fi else if test "x$includedir" = "x\${prefix}/include" then if test "x$prefix" = "x/usr" then COB_CFLAGS="" else COB_CFLAGS="-I${prefix}/include" fi else COB_CFLAGS="-I${includedir}" fi fi if test "x$CPPFLAGS" != "x" then COB_CFLAGS="$COB_CFLAGS $CPPFLAGS" fi COB_LIBS="-L$libdir -lcob ${LIBCOB_LIBS}" COB_LDFLAGS="" if test "x$LDFLAGS" != "x" then COB_LIBS="$LDFLAGS $COB_LIBS" COB_LDFLAGS="$LDFLAGS" fi COB_CONFIG_DIR="$datadir/$PACKAGE_TARNAME/config" COB_COPY_DIR="$datadir/$PACKAGE_TARNAME/copy" COB_LIBRARY_PATH="$libdir/$PACKAGE_TARNAME" COB_MODULE_EXT=`echo "$shlibext" | sed -e 's/dll\.a/dll/'` LIBS="$save_libs" COB_EXPORT_DYN="`eval echo $export_dynamic_flag_spec`" COB_PIC_FLAGS=`echo "$lt_prog_compiler_pic" | sed -e 's/^ //'` COB_SHARED_OPT="-shared" COB_EXEEXT="$EXEEXT" COB_EXTRA_FLAGS="" if test "$GEN_DEBUG_OPT" = "no" then CFLAGS=`echo "$CFLAGS" | sed -e 's/^-g//' -e 's/-g$//' -e 's/-g / /'` fi # Include CFLAGS in COB_CFLAGS without optimization/debug options cob_temp_flags=`echo "$CFLAGS" | sed -e 's/^@<:@+-@:>@O@<:@0-9s@:>@//' -e 's/@<:@+-@:>@O@<:@0-9s@:>@$//' -e 's/@<:@+-@:>@O@<:@0-9s@:>@ / /'` cob_temp_flags=`echo "$cob_temp_flags" | sed -e 's/^-O//' -e 's/-O$//' -e 's/-O / /' -e 's/^-g//' -e 's/-g$//' -e 's/-g / /'` COB_CFLAGS="$COB_CFLAGS $cob_temp_flags" if test "`basename $COB_CC`" = "gcc" then cob_temp_flags="`${COB_CC} ${srcdir}/cpucheck.c -o cpucheck 1>/dev/null 2>&1 && ./cpucheck 2>/dev/null`" rm -f cpucheck${EXEEXT} if test "x$cob_temp_flags" != "x" then CFLAGS="$CFLAGS $cob_temp_flags -finline-functions" COB_EXTRA_FLAGS="$cob_temp_flags" else CFLAGS="$CFLAGS -finline-functions" fi fi # Check gcc 4 option MYOLDCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int testint;]])], [AC_DEFINE(HAVE_PSIGN_OPT, 1)], []) CFLAGS="$MYOLDCFLAGS" # Check if aligned attribute works AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[char testchar[4] __attribute__((aligned));]])], [AC_DEFINE(HAVE_ATTRIBUTE_ALIGNED, 1)], []) # Special stuff AH_VERBATIM([_XOPEN_SOURCE_EXTENDED], [/* Define to 1 if on HPUX. */ #ifndef _XOPEN_SOURCE_EXTENDED # undef _XOPEN_SOURCE_EXTENDED #endif])dnl COB_FIX_LIB="$COB_EXPORT_DYN" case $host_os in mingw*) if test "$prefix" = "NONE" then COB_CONFIG_DIR="`cd /usr && pwd -W`/local/share/$PACKAGE_TARNAME/config" COB_COPY_DIR="`cd /usr && pwd -W`/local/share/$PACKAGE_TARNAME/copy" fi COB_EXPORT_DYN="-Wl,--export-all-symbols -Wl,--enable-auto-import" COB_FIX_LIB="$COB_EXPORT_DYN" ;; cygwin*) COB_EXPORT_DYN="-Wl,--export-all-symbols -Wl,--enable-auto-import" COB_FIX_LIB="$COB_EXPORT_DYN" ;; darwin* | rhapsody*) COB_SHARED_OPT="-bundle -flat_namespace -undefined suppress" ;; hpux*) if test "`basename $CC`" != "gcc" then COB_SHARED_OPT="-b" AC_DEFINE([_XOPEN_SOURCE_EXTENDED],1) rm -f hptest* echo 'int main() { return 0; }' > hptest.c ${CC} ${CFLAGS} +Olit=all -o hptest hptest.c > hptest.out 2>&1 if test $? -ne 0 -o -s hptest.out then CFLAGS="$CFLAGS +ESlit" COB_CFLAGS="$COB_CFLAGS +ESlit -w" else CFLAGS="$CFLAGS +Olit=all" COB_CFLAGS="$COB_CFLAGS +Olit=all -w" fi rm -f hptest* fi ;; aix*) COB_EXPORT_DYN="-Wl,-bexpfull" if test "`basename $CC`" != "gcc" then CFLAGS="$CFLAGS -O2 -Q -qro -qroconst" COB_SHARED_OPT="-G" COB_FIX_LIB="" # COB_FIX_LIB="-Wc,-G $COB_EXPORT_DYN" # COB_CFLAGS="$COB_CFLAGS -qchars=signed" else COB_FIX_LIB="$COB_EXPORT_DYN" fi ;; solaris*) if test "`basename $CC`" != "gcc" then COB_SHARED_OPT="-G" fi ;; esac if test "`basename $CC`" = "gcc" then CFLAGS="$CFLAGS -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k" fi if test "x$lt_cv_dlopen_self" != "xyes" then AC_DEFINE(COB_NO_SELFOPEN,1) fi # Generate the output AC_DEFINE_UNQUOTED(COB_EXPORT_DYN, "$COB_EXPORT_DYN") AC_DEFINE_UNQUOTED(COB_PIC_FLAGS, "$COB_PIC_FLAGS") AC_DEFINE_UNQUOTED(COB_SHARED_OPT, "$COB_SHARED_OPT") AC_DEFINE_UNQUOTED(COB_EXEEXT, "$COB_EXEEXT") AC_DEFINE_UNQUOTED(COB_EXTRA_FLAGS, "$COB_EXTRA_FLAGS") if test "x$striplib" != "x" then AC_DEFINE_UNQUOTED(COB_STRIP_CMD, "$striplib") # AC_SUBST(COB_STRIP_CMD) fi AC_SUBST(COB_CC) AC_SUBST(COB_CFLAGS) AC_SUBST(COB_LDFLAGS) AC_SUBST(COB_LIBS) AC_SUBST(COB_CONFIG_DIR) AC_SUBST(COB_COPY_DIR) AC_SUBST(COB_LIBRARY_PATH) AC_SUBST(COB_MODULE_EXT) AC_SUBST(COBC_LIBS) AC_SUBST(LIBCOB_CFLAGS) AC_SUBST(LIBCOB_LIBS) AC_SUBST(COB_EXPORT_DYN) AC_SUBST(COB_PIC_FLAGS) AC_SUBST(COB_SHARED_OPT) COB_BIGENDIAN="$ac_cv_c_bigendian" AC_SUBST(COB_BIGENDIAN) AC_SUBST(COB_FIX_LIB) AC_SUBST(COB_HAS_INLINE) AC_CONFIG_FILES([cob-config Makefile lib/Makefile libcob/Makefile cobc/Makefile bin/Makefile po/Makefile.in texi/Makefile config/Makefile copy/Makefile tests/atlocal tests/Makefile tests/cobol85/Makefile]) AC_OUTPUT echo "" echo "OpenCOBOL Configuration:" echo "" echo " CC ${CC}" echo " COB_CC ${COB_CC}" echo " CFLAGS ${CFLAGS}" echo " COB_CFLAGS ${COB_CFLAGS}" echo " COB_EXTRA_FLAGS ${COB_EXTRA_FLAGS}" echo " LDFLAGS ${LDFLAGS}" echo " COB_LDFLAGS ${COB_LDFLAGS}" if test "x$COBC_LIBS" != "x" then echo " COBC_LIBS ${COBC_LIBS}" fi echo " COB_LIBS ${COB_LIBS}" echo " COB_CONFIG_DIR ${COB_CONFIG_DIR}" echo " COB_COPY_DIR ${COB_COPY_DIR}" echo " COB_LIBRARY_PATH ${COB_LIBRARY_PATH}" echo " COB_MODULE_EXT ${COB_MODULE_EXT}" echo " COB_SHARED_OPT ${COB_SHARED_OPT}" echo " COB_PIC_FLAGS ${COB_PIC_FLAGS}" echo " COB_EXPORT_DYN ${COB_EXPORT_DYN}" if test "x$striplib" != "x" then echo " COB_STRIP_CMD ${striplib}" fi if test "${DEFINE_DL}" = "yes" then echo " Dynamic loading System" else echo " Dynamic loading Libtool" fi echo "" echo " Use gettext for international messages: ${USE_NLS}" if test "$with_seqra_extfh" = "yes" then echo " Use external SEQ/RAN file handler yes" fi if test "$with_index_extfh" = "yes" then echo " Use external ISAM file handler yes" elif test "$with_cisam" = "yes" then echo " Use CISAM for file I/O yes" elif test "$with_disam" = "yes" then echo " Use DISAM for file I/O yes" elif test "$with_vbisam" = "yes" then echo " Use VBISAM for file I/O yes" else echo " Use Berkeley DB for file I/O: ${USE_DB}" echo " Use enhanced Berkeley DB (>= 4.1) ${HAS_DB41}" fi echo " Use fcntl for file locking: ${ac_cv_func_fcntl}" echo " Use ncurses/pdcurses/curses for screen I/O: ${USE_NCURSES}" echo "" open-cobol-1.1/config.guess0000755000000000000000000012706110703447606011375 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; 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 __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo 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'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-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 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; 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 case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: open-cobol-1.1/config.rpath0000755000000000000000000003502510360207575011361 #! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2005 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # 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. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case "$cc_basename" in xlc*) wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case "$cc_basename" in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | kfreebsd*-gnu | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) 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 ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) 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 ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi 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 "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # 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 -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # 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 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $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 "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: open-cobol-1.1/config.sub0000755000000000000000000007772410703447606011052 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | 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 | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | 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-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; 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 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; 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 ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; 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 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | 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. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; 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 ;; -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: open-cobol-1.1/missing0000755000000000000000000002540610357272635010457 #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: open-cobol-1.1/config/0000777000000000000000000000000011143001516010360 5open-cobol-1.1/config/ibm.conf0000644000000000000000000000053010703447610011722 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "IBM COBOL" assign-clause: ibm pretty-display: no complex-odo: yes indirect-redefines: yes binary-size: 2-4-8 binary-truncate: no perform-osvs: yes sticky-linkage: yes top-level-occurs-clause: ok eject-statement: ok entry-statement: ok relax-level-hierarchy: yes open-cobol-1.1/config/default.conf0000644000000000000000000000543011120223733012573 # COBOL compiler configuration -*- sh -*- # Value: any string name: "OpenCOBOL" # Value: int tab-width: 8 text-column: 72 # Value: 'cobol2002', 'mf', 'ibm' # assign-clause: mf # If yes, file names are resolved at run time using environment variables. # For example, given ASSIGN TO "DATAFILE", the actual file name will be # 1. the value of environment variable 'DD_DATAFILE' or # 2. the value of environment variable 'dd_DATAFILE' or # 3. the value of environment variable 'DATAFILE' or # 4. the literal "DATAFILE" # If no, the value of the assign clause is the file name. # # Value: 'yes', 'no' filename-mapping: yes # Value: 'yes', 'no' pretty-display: yes # Value: 'yes', 'no' auto-initialize: yes # Value: 'yes', 'no' complex-odo: no # Value: 'yes', 'no' indirect-redefines: no # Binary byte size - defines the allocated bytes according to PIC # Value: signed unsigned bytes # ------ -------- ----- # '2-4-8' 1 - 4 2 # 5 - 9 4 # 10 - 18 8 # # '1-2-4-8' 1 - 2 1 # 3 - 4 2 # 5 - 9 4 # 10 - 18 8 # # '1--8' 1 - 2 1 - 2 1 # 3 - 4 3 - 4 2 # 5 - 6 5 - 7 3 # 7 - 9 8 - 9 4 # 10 - 11 10 - 12 5 # 12 - 14 13 - 14 6 # 15 - 16 15 - 16 7 # 17 - 18 17 - 18 8 binary-size: 1-2-4-8 # Value: 'yes', 'no' binary-truncate: yes # Value: 'native', 'big-endian' binary-byteorder: big-endian # Value: 'yes', 'no' larger-redefines-ok: no # Value: 'yes', 'no' relaxed-syntax-check: no # Perform type OSVS - If yes, the exit point of any currently executing perform # is recognized if reached. # Value: 'yes', 'no' perform-osvs: no # If yes, linkage-section items remain allocated # between invocations. # Value: 'yes', 'no' sticky-linkage: no # If yes, allow non-matching level numbers # Value: 'yes', 'no' relax-level-hierarchy: no # not-reserved: # Value: Word to be taken out of the reserved words list # (case independent) # Dialect features # Value: 'ok', 'archaic', 'obsolete', 'skip', 'ignore', 'unconformable' author-paragraph: obsolete memory-size-clause: obsolete multiple-file-tape-clause: obsolete label-records-clause: obsolete value-of-clause: obsolete data-records-clause: obsolete top-level-occurs-clause: skip synchronized-clause: ok goto-statement-without-name: obsolete stop-literal-statement: obsolete debugging-line: obsolete padding-character-clause: obsolete next-sentence-phrase: archaic eject-statement: skip entry-statement: obsolete move-noninteger-to-alphanumeric: error odo-without-to: ok open-cobol-1.1/config/mf.conf0000644000000000000000000000065710703447610011567 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "Micro Focus COBOL" assign-clause: mf synchronized-clause: skip pretty-display: no complex-odo: yes indirect-redefines: yes binary-truncate: no binary-size: 1--8 top-level-occurs-clause: ok eject-statement: ok entry-statement: ok larger-redefines-ok: yes relaxed-syntax-check: yes relax-level-hierarchy: yes move-noninteger-to-alphanumeric: warning open-cobol-1.1/config/cobol85.conf0000644000000000000000000000111011120223733012411 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "COBOL 85" # Value: 'ok', 'archaic', 'obsolete', 'ignore', 'unconformable' author-paragraph: obsolete memory-size-clause: obsolete multiple-file-tape-clause: obsolete label-records-clause: obsolete value-of-clause: obsolete data-records-clause: obsolete top-level-occurs-clause: skip goto-statement-without-name: obsolete stop-literal-statement: obsolete debugging-line: ok padding-character-clause: ok next-sentence-phrase: archaic entry-statement: unconformable odo-without-to: unconformable open-cobol-1.1/config/mvs.conf0000644000000000000000000000061710703447610011766 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "IBM COBOL for MVS & VM" assign-clause: ibm pretty-display: no complex-odo: yes indirect-redefines: yes binary-size: 2-4-8 binary-truncate: no perform-osvs: yes sticky-linkage: yes top-level-occurs-clause: ok eject-statement: ok entry-statement: ok relax-level-hierarchy: yes not-reserved: CYCLE not-reserved: NORMAL open-cobol-1.1/config/Makefile.am0000644000000000000000000000045511130701401012330 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## configdir = @COB_CONFIG_DIR@ config_DATA = default.conf cobol85.conf cobol2002.conf \ mf.conf ibm.conf mvs.conf bs2000.conf EXTRA_DIST = $(config_DATA) open-cobol-1.1/config/Makefile.in0000644000000000000000000002510511130703170012345 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(configdir)" configDATA_INSTALL = $(INSTALL_DATA) DATA = $(config_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ configdir = @COB_CONFIG_DIR@ config_DATA = default.conf cobol85.conf cobol2002.conf \ mf.conf ibm.conf mvs.conf bs2000.conf EXTRA_DIST = $(config_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-configDATA: $(config_DATA) @$(NORMAL_INSTALL) test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)" @list='$(config_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \ $(configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) @list='$(config_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \ rm -f "$(DESTDIR)$(configdir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(configdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-configDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-configDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-configDATA install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-configDATA uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/config/cobol2002.conf0000644000000000000000000000117611120223733012554 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "COBOL 2002" # Value: 'ok', 'archaic', 'obsolete', 'ignore', 'unconformable' author-paragraph: unconformable memory-size-clause: unconformable multiple-file-tape-clause: unconformable label-records-clause: unconformable value-of-clause: unconformable data-records-clause: unconformable top-level-occurs-clause: skip goto-statement-without-name: unconformable stop-literal-statement: unconformable debugging-line: obsolete padding-character-clause: obsolete next-sentence-phrase: archaic entry-statement: unconformable odo-without-to: unconformable open-cobol-1.1/config/ChangeLog0000644000000000000000000000350411001667760012064 2007-12-27 Roger While ** Mark 1.0 RELEASE 2007-08-23 Roger While * Remove deprecated v023.conf Remove display-sign 2007-01-29 Roger While * Add odo-without-to, default OK, set to unconformable for 85/2002 2006-09-30 Roger While * All conf's : Make filename-mapping default 2006-02-02 Roger While * Add relax-level-hierarchy to ibm.conf, mvs.conf, mf.conf, bs2000.conf 2006-01-20 Roger While * Add relax-level-hierarchy to default.conf Allows mismatched level numbers 2005-12-18 Roger While * Add perform-osvs, sticky-linkage to ibm.conf, mvs.conf 2005-11-25 Roger While * New variable - sticky-linkage New config file - bs2000.conf 2005-11-05 Roger While * New variable - perform-osvs 2005-05-15 Roger While * Do not nest includes. All config files include default.conf. We will need this for individual "not-resrved" words. 2005-05-12 Roger While * Revert cobol2002.conf 2005-05-03 Roger While * default.conf, cobol2002.conf, mf.conf New variable - larger-redefines-ok New variable - relaxed-syntax-check 2005-03-07 Roger While * default.conf, mvs.conf : New variable - not-reserved Document in default.conf CYCLE as not reserved in mvs.conf 2003-08-30 Keisuke Nishida * gnu.conf: Removed. * default.conf: Renamed from default.inc. 2003-08-28 Keisuke Nishida * v023.conf: New file. 2003-08-09 Keisuke Nishida * gnu.conf, cobol85.conf, cobol2002.conf, mf.conf, mvs.conf: New files. * default.inc, Makefile.am: New files. open-cobol-1.1/config/bs2000.conf0000644000000000000000000000046410703447610012067 # COBOL compiler configuration -*- sh -*- include "default.conf" name: "BS2000 COBOL" assign-clause: mf pretty-display: no complex-odo: yes indirect-redefines: yes binary-size: 2-4-8 binary-truncate: no top-level-occurs-clause: ok eject-statement: ok entry-statement: ok relax-level-hierarchy: yes open-cobol-1.1/mkinstalldirs0000755000000000000000000000662210357272635011665 #! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2005-06-29.22 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # 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-end: "$" # End: open-cobol-1.1/Makefile.am0000644000000000000000000000364711130701401011071 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## bin_SCRIPTS=cob-config include_HEADERS = libcob.h SUBDIRS = lib libcob cobc bin config copy po texi tests ACLOCAL_AMFLAGS = -I m4 BUILT_SOURCES = defaults.h DISTCLEANFILES = $(BUILT_SOURCES) cpucheck EXTRA_DIST = cpucheck.c COPYING.DOC dist-hook: echo "static char octardate[] = \"`date +'%b %d %Y %T %Z'`\";" > $(distdir)/tarstamp.h find $(distdir) -type d -print | xargs chmod 777 chmod 644 $(distdir)/cpucheck.c chmod 644 $(distdir)/cob-config.in chmod 644 $(distdir)/ABOUT-NLS chmod 644 $(distdir)/AUTHORS chmod 644 $(distdir)/COPYING chmod 644 $(distdir)/COPYING.DOC chmod 644 $(distdir)/COPYING.LIB chmod 644 $(distdir)/INSTALL chmod 644 $(distdir)/NEWS chmod 644 $(distdir)/README chmod 644 $(distdir)/THANKS chmod 644 $(distdir)/TODO chmod 755 $(distdir)/ltmain.sh chmod 755 $(distdir)/missing chmod 755 $(distdir)/install-sh chmod 755 $(distdir)/config.guess chmod 755 $(distdir)/config.sub chmod 755 $(distdir)/config.rpath chmod 755 $(distdir)/depcomp chmod 755 $(distdir)/mkinstalldirs touch $(distdir)/tests/run touch $(distdir)/tests/syntax touch $(distdir)/tests/data-rep defaults.h: Makefile.am $(top_builddir)/config.status @echo "Creating defaults.h..." @{ \ echo "/* Automatically generated by Makefile */"; \ echo "#define COB_CC \"$(COB_CC)\""; \ echo "#define COB_CFLAGS \"$(COB_CFLAGS)\""; \ echo "#define COB_LDFLAGS \"$(COB_LDFLAGS)\""; \ echo "#define COB_LIBS \"$(COB_LIBS)\""; \ echo "#define COB_CONFIG_DIR \"$(COB_CONFIG_DIR)\""; \ echo "#define COB_COPY_DIR \"$(COB_COPY_DIR)\""; \ echo "#define COB_LIBRARY_PATH \"$(COB_LIBRARY_PATH)\""; \ echo "#define COB_MODULE_EXT \"$(COB_MODULE_EXT)\""; \ echo "#define LOCALEDIR \"$(datadir)/locale\""; \ } > defaults.h open-cobol-1.1/Makefile.in0000644000000000000000000006000011130703171011072 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/cob-config.in $(srcdir)/config.h.in \ $(top_srcdir)/configure ABOUT-NLS AUTHORS COPYING COPYING.DOC \ COPYING.LIB ChangeLog INSTALL NEWS THANKS TODO compile \ config.guess config.rpath config.sub depcomp install-sh \ ltmain.sh missing mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = cob-config am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ bin_SCRIPTS = cob-config include_HEADERS = libcob.h SUBDIRS = lib libcob cobc bin config copy po texi tests ACLOCAL_AMFLAGS = -I m4 BUILT_SOURCES = defaults.h DISTCLEANFILES = $(BUILT_SOURCES) cpucheck EXTRA_DIST = cpucheck.c COPYING.DOC all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 cob-config: $(top_builddir)/config.status $(srcdir)/cob-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. $(distdir)/m4 $(distdir)/po $(distdir)/tests @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(SCRIPTS) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-includeHEADERS install-exec-am: install-binSCRIPTS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \ uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-exec install-exec-am \ install-includeHEADERS install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-includeHEADERS uninstall-info-am dist-hook: echo "static char octardate[] = \"`date +'%b %d %Y %T %Z'`\";" > $(distdir)/tarstamp.h find $(distdir) -type d -print | xargs chmod 777 chmod 644 $(distdir)/cpucheck.c chmod 644 $(distdir)/cob-config.in chmod 644 $(distdir)/ABOUT-NLS chmod 644 $(distdir)/AUTHORS chmod 644 $(distdir)/COPYING chmod 644 $(distdir)/COPYING.DOC chmod 644 $(distdir)/COPYING.LIB chmod 644 $(distdir)/INSTALL chmod 644 $(distdir)/NEWS chmod 644 $(distdir)/README chmod 644 $(distdir)/THANKS chmod 644 $(distdir)/TODO chmod 755 $(distdir)/ltmain.sh chmod 755 $(distdir)/missing chmod 755 $(distdir)/install-sh chmod 755 $(distdir)/config.guess chmod 755 $(distdir)/config.sub chmod 755 $(distdir)/config.rpath chmod 755 $(distdir)/depcomp chmod 755 $(distdir)/mkinstalldirs touch $(distdir)/tests/run touch $(distdir)/tests/syntax touch $(distdir)/tests/data-rep defaults.h: Makefile.am $(top_builddir)/config.status @echo "Creating defaults.h..." @{ \ echo "/* Automatically generated by Makefile */"; \ echo "#define COB_CC \"$(COB_CC)\""; \ echo "#define COB_CFLAGS \"$(COB_CFLAGS)\""; \ echo "#define COB_LDFLAGS \"$(COB_LDFLAGS)\""; \ echo "#define COB_LIBS \"$(COB_LIBS)\""; \ echo "#define COB_CONFIG_DIR \"$(COB_CONFIG_DIR)\""; \ echo "#define COB_COPY_DIR \"$(COB_COPY_DIR)\""; \ echo "#define COB_LIBRARY_PATH \"$(COB_LIBRARY_PATH)\""; \ echo "#define COB_MODULE_EXT \"$(COB_MODULE_EXT)\""; \ echo "#define LOCALEDIR \"$(datadir)/locale\""; \ } > defaults.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/libcob/0000777000000000000000000000000011143001516010345 5open-cobol-1.1/libcob/numeric.c0000644000000000000000000010144711136614062012106 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include "common.h" #include "coblocal.h" #include "move.h" #include "numeric.h" #include "byteswap.h" #define COB_LIB_INCLUDE #include "codegen.h" #define DECIMAL_NAN -128 #define DECIMAL_CHECK(d1,d2) \ if (unlikely(d1->scale == DECIMAL_NAN || d2->scale == DECIMAL_NAN)) { \ d1->scale = DECIMAL_NAN; \ return; \ } #define COB_MAX_BINARY 36 static const unsigned char packed_bytes[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99 }; static unsigned char *num_buff_ptr; static cob_decimal cob_d1; static cob_decimal cob_d2; static cob_decimal cob_d3; static cob_decimal cob_d4; static mpz_t cob_mexp; static mpz_t cob_mpzt; static mpz_t cob_mpze10[COB_MAX_BINARY]; static unsigned char packed_value[20]; #ifdef COB_EXPERIMENTAL #if GMP_NAIL_BITS != 0 #error NAILS not supported #endif #define COB_MAX_LL 9223372036854775807LL static void mpz_set_ull (mpz_ptr dest, const unsigned long long val) { size_t size; size = (val != 0); dest->_mp_d[0] = val & GMP_NUMB_MASK; #if GMP_LIMB_BITS < 64 if (val > GMP_NUMB_MAX) { dest->_mp_d[1] = val >> GMP_NUMB_BITS; size = 2; } #endif dest->_mp_size = size; } static void mpz_set_sll (mpz_ptr dest, const signed long long val) { unsigned long long vtmp; size_t size; vtmp = (unsigned long long)(val >= 0 ? val : -val); size = (vtmp != 0); dest->_mp_d[0] = vtmp & GMP_NUMB_MASK; #if GMP_LIMB_BITS < 64 if (vtmp > GMP_NUMB_MAX) { dest->_mp_d[1] = vtmp >> GMP_NUMB_BITS; size = 2; } #endif dest->_mp_size = (val >= 0) ? size : -size; } static unsigned long long mpz_get_ull (const mpz_ptr src) { size_t size; size = mpz_size (src); if (!size) { return 0; } #if GMP_LIMB_BITS > 32 return (unsigned long long)src->_mp_d[0]; #else if (size < 2) { return (unsigned long long)src->_mp_d[0]; } return (unsigned long long)src->_mp_d[0] | ((unsigned long long)src->_mp_d[1] << GMP_NUMB_BITS); #endif } static signed long long mpz_get_sll (const mpz_ptr src) { int size; unsigned long long vtmp; size = src->_mp_size; if (!size) { return 0; } vtmp = (unsigned long long)src->_mp_d[0]; #if GMP_LIMB_BITS < 64 if (mpz_size (src) > 1) { vtmp |= (unsigned long long)src->_mp_d[1] << GMP_NUMB_BITS; } #endif if (size > 0) { return (signed long long) vtmp & COB_MAX_LL; } return ~(((signed long long) vtmp - 1LL) & COB_MAX_LL); } #endif /* COB_EXPERIMENTAL */ static COB_INLINE void num_byte_memcpy (unsigned char *s1, const unsigned char *s2, size_t size) { do { *s1++ = *s2++; } while (--size); } static long long cob_binary_get_int64 (const cob_field * const f) { long long n = 0; size_t fsiz = 8 - f->size; /* Experimental code - not activated */ #if 0 unsigned char *s; if ((COB_FIELD_BINARY_SWAP (f) && !COB_FIELD_HAVE_SIGN (f)) || (!COB_FIELD_BINARY_SWAP (f) && COB_FIELD_HAVE_SIGN (f))) { s = (unsigned char *)&n + fsiz; } else { s = (unsigned char *)&n; } num_byte_memcpy (s, f->data, f->size); if (COB_FIELD_BINARY_SWAP (f)) { n = COB_BSWAP_64 (n); } if (COB_FIELD_HAVE_SIGN (f)) { n >>= 8 * fsiz; /* shift with sign */ } #endif #ifndef WORDS_BIGENDIAN if (COB_FIELD_BINARY_SWAP (f)) { if (COB_FIELD_HAVE_SIGN (f)) { num_byte_memcpy ((unsigned char *)&n, f->data, f->size); n = COB_BSWAP_64 (n); n >>= 8 * fsiz; /* shift with sign */ } else { num_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); n = COB_BSWAP_64 (n); } } else { if (COB_FIELD_HAVE_SIGN (f)) { num_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); n >>= 8 * fsiz; /* shift with sign */ } else { num_byte_memcpy ((unsigned char *)&n, f->data, f->size); } } #else /* WORDS_BIGENDIAN */ if (COB_FIELD_HAVE_SIGN (f)) { num_byte_memcpy ((unsigned char *)&n, f->data, f->size); n >>= 8 * fsiz; /* shift with sign */ } else { num_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); } #endif /* WORDS_BIGENDIAN */ return n; } static unsigned long long cob_binary_get_uint64 (const cob_field * const f) { unsigned long long n = 0; size_t fsiz = 8 - f->size; #ifndef WORDS_BIGENDIAN if (COB_FIELD_BINARY_SWAP (f)) { num_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); n = COB_BSWAP_64 (n); } else { num_byte_memcpy ((unsigned char *)&n, f->data, f->size); } #else /* WORDS_BIGENDIAN */ num_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); #endif /* WORDS_BIGENDIAN */ return n; } static void cob_binary_set_uint64 (cob_field *f, unsigned long long n) { #ifndef WORDS_BIGENDIAN unsigned char *s; if (COB_FIELD_BINARY_SWAP (f)) { n = COB_BSWAP_64 (n); s = ((unsigned char *)&n) + 8 - f->size; } else { s = (unsigned char *)&n; } num_byte_memcpy (f->data, s, f->size); #else /* WORDS_BIGENDIAN */ num_byte_memcpy (f->data, ((unsigned char *)&n) + 8 - f->size, f->size); #endif /* WORDS_BIGENDIAN */ } static void cob_binary_set_int64 (cob_field *f, long long n) { #ifndef WORDS_BIGENDIAN unsigned char *s; if (COB_FIELD_BINARY_SWAP (f)) { n = COB_BSWAP_64 (n); s = ((unsigned char *)&n) + 8 - f->size; } else { s = (unsigned char *)&n; } num_byte_memcpy (f->data, s, f->size); #else /* WORDS_BIGENDIAN */ num_byte_memcpy (f->data, ((unsigned char *)&n) + 8 - f->size, f->size); #endif /* WORDS_BIGENDIAN */ } /* * Decimal number */ void cob_decimal_init (cob_decimal *d) { mpz_init2 (d->value, 256); d->scale = 0; } /* Not used - comment out void cob_decimal_print (cob_decimal *d) { mpz_out_str (stdout, 10, d->value); if (d->scale) { fprintf (stdout, " * 10^%d", -d->scale); } fputs ("\n", stdout); } end comment out */ /* d->value *= 10^n, d->scale += n */ static void shift_decimal (cob_decimal *d, const int n) { if (n == 0) { return; } if (n > 0) { mpz_ui_pow_ui (cob_mexp, 10, n); mpz_mul (d->value, d->value, cob_mexp); } else { mpz_ui_pow_ui (cob_mexp, 10, -n); mpz_tdiv_q (d->value, d->value, cob_mexp); } d->scale += n; } static void align_decimal (cob_decimal *d1, cob_decimal *d2) { if (d1->scale < d2->scale) { shift_decimal (d1, d2->scale - d1->scale); } else if (d1->scale > d2->scale) { shift_decimal (d2, d1->scale - d2->scale); } } /* * Decimal set/get */ static void cob_decimal_set (cob_decimal *dst, const cob_decimal *src) { mpz_set (dst->value, src->value); dst->scale = src->scale; } /* double */ static void cob_decimal_set_double (cob_decimal *d, const double v) { mpz_set_d (d->value, v * 1.0e9); d->scale = 9; } static double cob_decimal_get_double (cob_decimal *d) { double v; int n; v = mpz_get_d (d->value); n = d->scale; for (; n > 0; n--) { v /= 10; } for (; n < 0; n++) { v *= 10; } return v; } /* DISPLAY */ static void cob_decimal_set_display (cob_decimal *d, cob_field *f) { unsigned char *data; size_t size; int sign; unsigned int n; data = COB_FIELD_DATA (f); size = COB_FIELD_SIZE (f); if (unlikely(*data == 255)) { mpz_ui_pow_ui (d->value, 10, size); d->scale = COB_FIELD_SCALE(f); return; } if (unlikely(*data == 0)) { mpz_ui_pow_ui (d->value, 10, size); mpz_neg (d->value, d->value); d->scale = COB_FIELD_SCALE(f); return; } sign = cob_get_sign (f); /* skip leading zeros */ while (size > 1 && *data == '0') { size--; data++; } /* set value */ if (size < 10) { n = 0; while (size--) { n = n * 10 + cob_d2i (*data++); } mpz_set_ui (d->value, n); } else { memcpy (num_buff_ptr, data, size); num_buff_ptr[size] = 0; mpz_set_str (d->value, (char *)num_buff_ptr, 10); } /* set sign and scale */ if (sign < 0) { mpz_neg (d->value, d->value); } d->scale = COB_FIELD_SCALE(f); cob_put_sign (f, sign); } static int cob_decimal_get_display (cob_decimal *d, cob_field *f, const int opt) { unsigned char *data; size_t size; int diff; int sign; /* build string */ sign = mpz_sgn (d->value); mpz_abs (d->value, d->value); mpz_get_str ((char *)num_buff_ptr, 10, d->value); size = strlen ((char *)num_buff_ptr); /* store number */ data = COB_FIELD_DATA (f); diff = (int)(COB_FIELD_SIZE (f) - size); if (unlikely(diff < 0)) { /* overflow */ cob_set_exception (COB_EC_SIZE_OVERFLOW); /* if the statement has ON SIZE ERROR or NOT ON SIZE ERROR, then throw an exception */ if (opt & COB_STORE_KEEP_ON_OVERFLOW) { return cob_exception_code; } /* othersize, truncate digits */ memcpy (data, num_buff_ptr - diff, COB_FIELD_SIZE (f)); } else { /* no overflow */ memset (data, '0', (size_t)diff); memcpy (data + diff, num_buff_ptr, size); } cob_put_sign (f, sign); return 0; } /* BINARY */ static void cob_decimal_set_binary (cob_decimal *d, cob_field *f) { #ifdef COB_LI_IS_LL if (COB_FIELD_HAVE_SIGN (f)) { mpz_set_si (d->value, cob_binary_get_int64 (f)); } else { mpz_set_ui (d->value, cob_binary_get_uint64 (f)); } #elif defined(COB_EXPERIMENTAL) if (COB_FIELD_HAVE_SIGN (f)) { mpz_set_sll (d->value, cob_binary_get_int64 (f)); } else { mpz_set_ull (d->value, cob_binary_get_uint64 (f)); } #else size_t negative = 0; unsigned long long uval; long long val; if (f->size <= 4) { if (COB_FIELD_HAVE_SIGN (f)) { mpz_set_si (d->value, (int)cob_binary_get_int64 (f)); } else { mpz_set_ui (d->value, (unsigned int) cob_binary_get_uint64 (f)); } } else { if (COB_FIELD_HAVE_SIGN (f)) { val = cob_binary_get_int64 (f); if (val < 0) { negative = 1; val = -val; } mpz_set_ui (d->value, (unsigned int)((val & 0x7FFFFFFF00000000LL)>> 32)); mpz_mul_2exp (d->value, d->value, 32); mpz_add_ui (d->value, d->value, (unsigned int)(val & 0xffffffff)); if (negative) { mpz_neg (d->value, d->value); } } else { uval = cob_binary_get_uint64 (f); mpz_set_ui (d->value, (unsigned int)(uval >> 32)); mpz_mul_2exp (d->value, d->value, 32); mpz_add_ui (d->value, d->value, (unsigned int)(uval & 0xffffffff)); } } #endif d->scale = COB_FIELD_SCALE(f); } static int cob_decimal_get_binary (cob_decimal *d, cob_field *f, const int opt) { size_t overflow; size_t digits; size_t sign; size_t bitnum; #if !defined(COB_EXPERIMENTAL) && !defined(COB_LI_IS_LL) long long llval; unsigned long long ullval; unsigned int lo; #endif if (unlikely(mpz_size (d->value) == 0)) { memset (f->data, 0, f->size); return 0; } overflow = 0; digits = COB_FIELD_DIGITS(f); if (COB_FIELD_HAVE_SIGN (f)) { sign = 1; } else { sign = 0; if (mpz_sgn (d->value) < 0) { mpz_abs (d->value, d->value); } } bitnum = (f->size * 8) - sign; if (unlikely(mpz_sizeinbase (d->value, 2) > bitnum)) { if (opt & COB_STORE_KEEP_ON_OVERFLOW) { goto overflow; } overflow = 1; /* TRUNC_ON_OVERFLOW is only set for binary_truncate */ if (opt & COB_STORE_TRUNC_ON_OVERFLOW) { mpz_tdiv_r (d->value, d->value, cob_mpze10[digits]); /* } */ /* RXW */ } else { mpz_fdiv_r_2exp (d->value, d->value, (f->size * 8)); } } else if (opt && cob_current_module->flag_binary_truncate) { if (mpz_cmpabs (d->value, cob_mpze10[digits]) >= 0) { /* overflow */ if (opt & COB_STORE_KEEP_ON_OVERFLOW) { goto overflow; } overflow = 1; /* TRUNC_ON_OVERFLOW is only set for binary_truncate */ if (opt & COB_STORE_TRUNC_ON_OVERFLOW) { mpz_tdiv_r (d->value, d->value, cob_mpze10[digits]); /* } */ /* RXW */ } else { mpz_fdiv_r_2exp (d->value, d->value, (f->size * 8)); } } } #ifdef COB_LI_IS_LL if (!sign || overflow) { cob_binary_set_uint64 (f, mpz_get_ui (d->value)); } else { cob_binary_set_int64 (f, mpz_get_si (d->value)); } #elif defined(COB_EXPERIMENTAL) if (!sign || overflow) { cob_binary_set_uint64 (f, mpz_get_ull (d->value)); } else { cob_binary_set_int64 (f, mpz_get_sll (d->value)); } #else if (f->size <= 4) { if (!sign || overflow) { cob_binary_set_uint64 (f, (unsigned long long)mpz_get_ui (d->value)); } else { cob_binary_set_int64 (f, (long long)mpz_get_si (d->value)); } } else { mpz_fdiv_r_2exp (cob_mpzt, d->value, 32); mpz_fdiv_q_2exp (d->value, d->value, 32); lo = mpz_get_ui (cob_mpzt); if (!sign || overflow) { ullval = mpz_get_ui (d->value); ullval = (ullval << 32) | lo; cob_binary_set_uint64 (f, ullval); } else { llval = mpz_get_si (d->value); llval = (llval << 32) | lo; cob_binary_set_int64 (f, llval); } } #endif if (!overflow) { return 0; } overflow: cob_set_exception (COB_EC_SIZE_OVERFLOW); return cob_exception_code; } /* PACKED-DECIMAL */ static int cob_packed_get_sign (const cob_field *f) { unsigned char *p; if (!COB_FIELD_HAVE_SIGN (f)) { return 0; } p = f->data + f->size - 1; return ((*p & 0x0f) == 0x0d) ? -1 : 1; } static void cob_add_packed (cob_field *f, int val) { unsigned char *p; int sign; int ndigs; int tval; int carry = 0; unsigned int msn; unsigned int subtr = 0; unsigned int zeroes = 0; unsigned int origdigs; ndigs = COB_FIELD_DIGITS(f) - COB_FIELD_SCALE(f); if (ndigs <= 0) { return; } sign = cob_packed_get_sign (f); msn = 1 - (COB_FIELD_SCALE(f) % 2); /* -x +v = -(x - v), -x -v = -(x + v) */ if (sign < 0) { val = -val; } if (val < 0) { val = -val; subtr = 1; } p = f->data + (ndigs / 2) - (1 - msn); origdigs = ndigs; while (ndigs--) { if (!msn) { tval = *p & 0x0f; } else { tval = (*p & 0xf0) >> 4; } if (val) { carry += (val % 10); val /= 10; } if (subtr) { tval -= carry; if (tval < 0) { tval += 10; carry = 1; } else { carry = 0; } } else { tval += carry; if (tval > 9) { tval %= 10; carry = 1; } else { carry = 0; } } if (tval == 0) { zeroes++; } if (!msn) { *p = (*p & 0xf0) | tval; msn = 1; } else { *p = (*p & 0x0f) | (tval << 4); msn = 0; p--; } } if (sign) { p = f->data + f->size - 1; if (origdigs == zeroes) { *p = (*p & 0xf0) | 0x0c; } else if (subtr && carry) { sign = -sign; if (sign < 0) { *p = (*p & 0xf0) | 0x0d; } else { *p = (*p & 0xf0) | 0x0c; } } } } static void cob_decimal_set_packed (cob_decimal *d, cob_field *f) { unsigned char *p; int digits; int sign; unsigned int val; unsigned int valseen; p = f->data; /* Fixme */ digits = COB_FIELD_DIGITS (f); sign = cob_packed_get_sign (f); if (digits % 2 == 0) { val = *p & 0x0f; digits--; p++; } else { val = 0; } if (COB_FIELD_DIGITS(f) < 10) { while (digits > 1) { if (val) { val *= 100; } if (*p) { val += ((*p >> 4) * 10) + (*p & 0x0f); } digits -= 2; p++; } if (val) { val *= 10; } val += *p >> 4; mpz_set_ui (d->value, val); } else { valseen = 0; mpz_set_ui (d->value, val); if (val) { valseen = 1; } while (digits > 1) { if (valseen) { mpz_mul_ui (d->value, d->value, 100); } if (*p) { mpz_add_ui (d->value, d->value, (*p >> 4) * 10 + (*p & 0x0f)); valseen = 1; } digits -= 2; p++; } if (valseen) { mpz_mul_ui (d->value, d->value, 10); } mpz_add_ui (d->value, d->value, (*p >> 4)); } if (sign < 0) { mpz_neg (d->value, d->value); } d->scale = COB_FIELD_SCALE(f); } static int cob_decimal_get_packed (cob_decimal *d, cob_field *f, const int opt) { unsigned char *data; unsigned char *p; unsigned char *q; size_t size; size_t n; size_t i; int diff; int sign; int digits; unsigned char x; /* build string */ sign = mpz_sgn (d->value); mpz_abs (d->value, d->value); mpz_get_str ((char *)num_buff_ptr, 10, d->value); size = strlen ((char *)num_buff_ptr); /* store number */ data = f->data; /* Fixme */ digits = COB_FIELD_DIGITS(f); q = num_buff_ptr; diff = (int)(digits - size); if (diff < 0) { /* overflow */ cob_set_exception (COB_EC_SIZE_OVERFLOW); /* if the statement has ON SIZE ERROR or NOT ON SIZE ERROR, then throw an exception */ if (opt & COB_STORE_KEEP_ON_OVERFLOW) { return cob_exception_code; } q += size - digits; size = digits; } memset (data, 0, f->size); p = data + (digits / 2) - (size / 2); diff = 1 - (int)(size % 2); for (i = diff, n = 0; i < size + diff; i++, n++) { x = cob_d2i (q[n]); if (i % 2 == 0) { *p = x << 4; } else { *p++ |= x; } } p = f->data + f->size - 1; if (!COB_FIELD_HAVE_SIGN (f)) { *p = (*p & 0xf0) | 0x0f; } else if (sign < 0) { *p = (*p & 0xf0) | 0x0d; } else { *p = (*p & 0xf0) | 0x0c; } return 0; } void cob_set_packed_zero (cob_field *f) { memset (f->data, 0, f->size); if (!COB_FIELD_HAVE_SIGN (f)) { *(f->data + f->size - 1) = 0x0f; } else { *(f->data + f->size - 1) = 0x0c; } } void cob_set_packed_int (cob_field *f, const int val) { unsigned char *p; size_t sign = 0; int n; if (val < 0) { n = -val; sign = 1; } else { n = val; } memset (f->data, 0, f->size); p = f->data + f->size - 1; *p = (n % 10) << 4; if (!COB_FIELD_HAVE_SIGN (f)) { *p |= 0x0f; } else if (sign) { *p |= 0x0d; } else { *p |= 0x0c; } n /= 10; p--; for (; n && p >= f->data; n /= 100, p--) { *p = packed_bytes[n % 100]; } /* Fixme */ if ((COB_FIELD_DIGITS(f) % 2) == 0) { *(f->data) &= 0x0f; } } /* General field */ void cob_decimal_set_field (cob_decimal *d, cob_field *f) { double dval; float fval; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_BINARY: cob_decimal_set_binary (d, f); break; case COB_TYPE_NUMERIC_PACKED: cob_decimal_set_packed (d, f); break; case COB_TYPE_NUMERIC_FLOAT: memcpy ((ucharptr)&fval, f->data, sizeof(float)); cob_decimal_set_double (d, (double)fval); break; case COB_TYPE_NUMERIC_DOUBLE: memcpy ((ucharptr)&dval, f->data, sizeof(double)); cob_decimal_set_double (d, dval); break; default: cob_decimal_set_display (d, f); break; } } int cob_decimal_get_field (cob_decimal *d, cob_field *f, const int opt) { cob_field temp; cob_field_attr attr; double val; float fval; int sign; unsigned char data[64]; if (unlikely(d->scale == DECIMAL_NAN)) { cob_set_exception (COB_EC_SIZE_OVERFLOW); return cob_exception_code; } /* work copy */ if (d != &cob_d1) { cob_decimal_set (&cob_d1, d); d = &cob_d1; } /* rounding */ if (opt & COB_STORE_ROUND) { if (COB_FIELD_SCALE(f) < d->scale) { sign = mpz_sgn (d->value); if (sign != 0) { shift_decimal (d, COB_FIELD_SCALE(f) - d->scale + 1); if (sign > 0) { mpz_add_ui (d->value, d->value, 5); } else { mpz_sub_ui (d->value, d->value, 5); } } } } /* append or truncate decimal digits */ shift_decimal (d, COB_FIELD_SCALE(f) - d->scale); /* store number */ switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_BINARY: return cob_decimal_get_binary (d, f, opt); case COB_TYPE_NUMERIC_PACKED: return cob_decimal_get_packed (d, f, opt); case COB_TYPE_NUMERIC_DISPLAY: return cob_decimal_get_display (d, f, opt); case COB_TYPE_NUMERIC_FLOAT: fval = (float) cob_decimal_get_double (d); memcpy (f->data, (ucharptr)&fval, sizeof (float)); return 0; case COB_TYPE_NUMERIC_DOUBLE: val = cob_decimal_get_double (d); memcpy (f->data, (ucharptr)&val, sizeof (double)); return 0; default: COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, COB_FIELD_DIGITS(f), COB_FIELD_SCALE(f), COB_FLAG_HAVE_SIGN, NULL); temp.size = COB_FIELD_DIGITS(f); temp.data = data; temp.attr = &attr; if (cob_decimal_get_display (d, &temp, opt) == 0) { cob_move (&temp, f); } return cob_exception_code; } } /* * Decimal arithmetic */ void cob_decimal_add (cob_decimal *d1, cob_decimal *d2) { DECIMAL_CHECK (d1, d2); align_decimal (d1, d2); mpz_add (d1->value, d1->value, d2->value); } void cob_decimal_sub (cob_decimal *d1, cob_decimal *d2) { DECIMAL_CHECK (d1, d2); align_decimal (d1, d2); mpz_sub (d1->value, d1->value, d2->value); } void cob_decimal_mul (cob_decimal *d1, cob_decimal *d2) { DECIMAL_CHECK (d1, d2); d1->scale += d2->scale; mpz_mul (d1->value, d1->value, d2->value); } void cob_decimal_div (cob_decimal *d1, cob_decimal *d2) { DECIMAL_CHECK (d1, d2); /* check for division by zero */ if (unlikely(mpz_sgn (d2->value) == 0)) { d1->scale = DECIMAL_NAN; cob_set_exception (COB_EC_SIZE_ZERO_DIVIDE); return; } if (unlikely(mpz_sgn (d1->value) == 0)) { d1->scale = 0; return; } d1->scale -= d2->scale; shift_decimal (d1, 37 + ((d1->scale < 0) ? -d1->scale : 0)); mpz_tdiv_q (d1->value, d1->value, d2->value); } void cob_decimal_pow (cob_decimal *d1, cob_decimal *d2) { unsigned int n; DECIMAL_CHECK (d1, d2); if (d2->scale == 0 && mpz_fits_ulong_p (d2->value)) { n = mpz_get_ui (d2->value); mpz_pow_ui (d1->value, d1->value, n); d1->scale *= n; } else { cob_decimal_set_double (d1, pow (cob_decimal_get_double (d1), cob_decimal_get_double (d2))); } } int cob_decimal_cmp (cob_decimal *d1, cob_decimal *d2) { align_decimal (d1, d2); return mpz_cmp (d1->value, d2->value); } /* * Optimized arithmetic for DISPLAY */ static int display_add_int (unsigned char *data, const size_t size, unsigned int n) { unsigned char *sp; size_t carry = 0; int i; int is; sp = data + size; while (n > 0) { i = n % 10; n /= 10; /* check for overflow */ if (unlikely(--sp < data)) { if (!cob_current_module->flag_binary_truncate) { return 0; } return 1; } /* perform addition */ is = (*sp & 0x0F) + i + carry; if (is > 9) { carry = 1; *sp = '0' + (is % 10); } else { carry = 0; *sp = '0' + is; } } if (carry == 0) { return 0; } /* carry up */ while (--sp >= data) { if ((*sp += 1) <= '9') { return 0; } *sp = '0'; } if (!cob_current_module->flag_binary_truncate) { return 0; } return 1; } static int display_sub_int (unsigned char *data, const size_t size, unsigned int n) { unsigned char *sp; size_t carry = 0; int i; sp = data + size; while (n > 0) { i = n % 10; n /= 10; /* check for overflow */ if (unlikely(--sp < data)) { return 1; } /* perform subtraction */ if ((*sp -= i + carry) < '0') { carry = 1; *sp += 10; } else { carry = 0; } } if (carry == 0) { return 0; } /* carry up */ while (--sp >= data) { if ((*sp -= 1) >= '0') { return 0; } *sp = '9'; } return 1; } static int cob_display_add_int (cob_field *f, int n) { unsigned char *data; size_t osize; size_t i; size_t size; int scale; int sign; unsigned char tfield[64]; data = COB_FIELD_DATA (f); size = COB_FIELD_SIZE (f); scale = COB_FIELD_SCALE (f); sign = cob_get_sign (f); osize = size; memcpy (tfield, data, osize); /* -x + n = -(x - n) */ if (sign < 0) { n = -n; } if (unlikely(scale < 0)) { /* PIC 9(n)P(m) */ if (-scale < 10) { while (scale++) { n /= 10; } } else { n = 0; } } else { /* PIC 9(n)V9(m) */ size -= scale; /* Following can never be true as size is unsigned ?? */ /* Comment out if (size < 0) { cob_put_sign (f, sign); goto overflow; } */ } if (n > 0) { /* add n to the field */ if (display_add_int (data, size, n) != 0) { /* if there was an overflow, recover the last value */ memcpy (data, tfield, osize); goto overflow; } } else if (n < 0) { /* subtract n from the field */ if (display_sub_int (data, size, -n) != 0) { for (i = 0; i < size; i++) { data[i] = cob_i2d (9 - cob_d2i (data[i])); } display_add_int (data, size, 1); sign = -sign; } } cob_put_sign (f, sign); return 0; overflow: cob_put_sign (f, sign); cob_set_exception (COB_EC_SIZE_OVERFLOW); return cob_exception_code; } /* * Convenience functions */ int cob_add (cob_field *f1, cob_field *f2, const int opt) { cob_decimal_set_field (&cob_d1, f1); cob_decimal_set_field (&cob_d2, f2); cob_decimal_add (&cob_d1, &cob_d2); return cob_decimal_get_field (&cob_d1, f1, opt); } int cob_sub (cob_field *f1, cob_field *f2, const int opt) { cob_decimal_set_field (&cob_d1, f1); cob_decimal_set_field (&cob_d2, f2); cob_decimal_sub (&cob_d1, &cob_d2); return cob_decimal_get_field (&cob_d1, f1, opt); } int cob_add_int (cob_field *f, const int n) { if (unlikely(n == 0)) { return 0; } switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_DISPLAY: return cob_display_add_int (f, n); case COB_TYPE_NUMERIC_PACKED: cob_add_packed (f, n); return 0; default: /* not optimized */ cob_decimal_set_field (&cob_d1, f); mpz_set_si (cob_d2.value, n); cob_d2.scale = 0; if (cob_d1.scale) { mpz_ui_pow_ui (cob_mexp, 10, (unsigned int)cob_d1.scale); mpz_mul (cob_d2.value, cob_d2.value, cob_mexp); cob_d2.scale = cob_d1.scale; } mpz_add (cob_d1.value, cob_d1.value, cob_d2.value); return cob_decimal_get_field (&cob_d1, f, 0); } } int cob_sub_int (cob_field *f, const int n) { if (unlikely(n == 0)) { return 0; } return cob_add_int (f, -n); } int cob_div_quotient (cob_field *dividend, cob_field *divisor, cob_field *quotient, const int opt) { int ret; cob_decimal_set_field (&cob_d1, dividend); cob_decimal_set_field (&cob_d2, divisor); cob_decimal_set (&cob_d3, &cob_d1); /* compute quotient */ cob_decimal_div (&cob_d1, &cob_d2); if (cob_d1.scale == DECIMAL_NAN) { cob_d3.scale = DECIMAL_NAN; return cob_exception_code; } /* set quotient */ cob_decimal_set (&cob_d4, &cob_d1); ret = cob_decimal_get_field (&cob_d1, quotient, opt); /* truncate digits from the quotient */ shift_decimal (&cob_d4, COB_FIELD_SCALE(quotient) - cob_d4.scale); /* compute remainder */ cob_decimal_mul (&cob_d4, &cob_d2); cob_decimal_sub (&cob_d3, &cob_d4); return ret; } int cob_div_remainder (cob_field *fld_remainder, const int opt) { return cob_decimal_get_field (&cob_d3, fld_remainder, opt); } int cob_cmp_int (cob_field *f1, const int n) { cob_decimal_set_field (&cob_d1, f1); mpz_set_si (cob_d2.value, n); cob_d2.scale = 0; return cob_decimal_cmp (&cob_d1, &cob_d2); } int cob_cmp_uint (cob_field *f1, const unsigned int n) { cob_decimal_set_field (&cob_d1, f1); mpz_set_ui (cob_d2.value, n); cob_d2.scale = 0; return cob_decimal_cmp (&cob_d1, &cob_d2); } int cob_numeric_cmp (cob_field *f1, cob_field *f2) { cob_decimal_set_field (&cob_d1, f1); cob_decimal_set_field (&cob_d2, f2); return cob_decimal_cmp (&cob_d1, &cob_d2); } int cob_cmp_packed (cob_field *f, int n) { static int lastval = 0; unsigned char *p; size_t size; size_t inc = 0; int sign; unsigned char val1[20]; sign = cob_packed_get_sign (f); /* Field positive, value negative */ if (sign >= 0 && n < 0) { return 1; } /* Field negative, value positive */ if (sign < 0 && n >= 0) { return -1; } /* Both positive or both negative */ p = f->data; for (size = 0; size < 20; size++) { if (size < 20 - f->size) { val1[size] = 0; } else { val1[size] = p[inc++]; } } val1[19] &= 0xf0; if ((COB_FIELD_DIGITS(f) % 2) == 0) { val1[20 - f->size] &= 0x0f; } if (n != lastval) { lastval = n; if (n < 0) { n = -n; } memset (&packed_value[14], 0, 6); if (n) { p = &packed_value[19]; *p = (n % 10) << 4; p--; n /= 10; for (; n;) { size = n % 100; *p = (unsigned char)((size % 10) | ((size / 10) << 4)); n /= 100; p--; } } } for (size = 0; size < 20; size++) { if (val1[size] != packed_value[size]) { if (sign < 0) { return packed_value[size] - val1[size]; } else { return val1[size] - packed_value[size]; } } } return 0; } void cob_init_numeric (void) { size_t i; cob_decimal_init (&cob_d1); cob_decimal_init (&cob_d2); cob_decimal_init (&cob_d3); cob_decimal_init (&cob_d4); mpz_init2 (cob_mpzt, 256); mpz_init2 (cob_mexp, 512); for (i = 0; i < COB_MAX_BINARY; i++) { mpz_init (cob_mpze10[i]); mpz_ui_pow_ui (cob_mpze10[i], 10, i); } num_buff_ptr = cob_malloc (2048); memset (packed_value, 0, sizeof(packed_value)); } /* Numeric Display compares */ int cob_cmp_numdisp (const unsigned char *data, const size_t size, const int n) { const unsigned char *p; size_t inc; int val = 0; p = data; for (inc = 0; inc < size; inc++, p++) { val = (val * 10) + (*p - (unsigned char)'0'); } return (val < n) ? -1 : (val > n); } int cob_cmp_long_numdisp (const unsigned char *data, const size_t size, const int n) { const unsigned char *p; long long val = 0; size_t inc; p = data; for (inc = 0; inc < size; inc++, p++) { val = (val * 10) + (*p - (unsigned char)'0'); } return (val < n) ? -1 : (val > n); } #ifdef COB_EBCDIC_MACHINE static void cob_get_ascii_sign (const unsigned char *p, int *val) { switch (*p) { case 'p': return; case 'q': *val += 1; return; case 'r': *val += 2; return; case 's': *val += 3; return; case 't': *val += 4; return; case 'u': *val += 5; return; case 'v': *val += 6; return; case 'w': *val += 7; return; case 'x': *val += 8; return; case 'y': *val += 9; return; } } static void cob_get_long_ascii_sign (const unsigned char *p, long long *val) { switch (*p) { case 'p': return; case 'q': *val += 1; return; case 'r': *val += 2; return; case 's': *val += 3; return; case 't': *val += 4; return; case 'u': *val += 5; return; case 'v': *val += 6; return; case 'w': *val += 7; return; case 'x': *val += 8; return; case 'y': *val += 9; return; } } #endif static int cob_get_ebcdic_sign (const unsigned char *p, int *val) { switch (*p) { case '{': return 0; case 'A': *val += 1; return 0; case 'B': *val += 2; return 0; case 'C': *val += 3; return 0; case 'D': *val += 4; return 0; case 'E': *val += 5; return 0; case 'F': *val += 6; return 0; case 'G': *val += 7; return 0; case 'H': *val += 8; return 0; case 'I': *val += 9; return 0; case '}': return 1; case 'J': *val += 1; return 1; case 'K': *val += 2; return 1; case 'L': *val += 3; return 1; case 'M': *val += 4; return 1; case 'N': *val += 5; return 1; case 'O': *val += 6; return 1; case 'P': *val += 7; return 1; case 'Q': *val += 8; return 1; case 'R': *val += 9; return 1; } return 0; } static int cob_get_long_ebcdic_sign (const unsigned char *p, long long *val) { switch (*p) { case '{': return 0; case 'A': *val += 1; return 0; case 'B': *val += 2; return 0; case 'C': *val += 3; return 0; case 'D': *val += 4; return 0; case 'E': *val += 5; return 0; case 'F': *val += 6; return 0; case 'G': *val += 7; return 0; case 'H': *val += 8; return 0; case 'I': *val += 9; return 0; case '}': return 1; case 'J': *val += 1; return 1; case 'K': *val += 2; return 1; case 'L': *val += 3; return 1; case 'M': *val += 4; return 1; case 'N': *val += 5; return 1; case 'O': *val += 6; return 1; case 'P': *val += 7; return 1; case 'Q': *val += 8; return 1; case 'R': *val += 9; return 1; } return 0; } int cob_cmp_sign_numdisp (const unsigned char *data, const size_t size, const int n) { const unsigned char *p; int val = 0; size_t inc; p = data; for (inc = 0; inc < size - 1; inc++, p++) { val = (val * 10) + (*p - (unsigned char)'0'); } val *= 10; if (*p >= '0' && *p <= '9') { val += (*p - (unsigned char)'0'); } else { if (unlikely(cob_current_module->display_sign)) { if (cob_get_ebcdic_sign (p, &val)) { val = -val; } } else { #ifdef COB_EBCDIC_MACHINE cob_get_ascii_sign (p, &val); #else val += (*p - (unsigned char)'p'); #endif val = -val; } } return (val < n) ? -1 : (val > n); } int cob_cmp_long_sign_numdisp (const unsigned char *data, const size_t size, const int n) { const unsigned char *p; long long val = 0; size_t inc; p = data; for (inc = 0; inc < size - 1; inc++, p++) { val = (val * 10) + (*p - (unsigned char)'0'); } val *= 10; if (*p >= '0' && *p <= '9') { val += (*p - (unsigned char)'0'); } else { if (unlikely(cob_current_module->display_sign)) { if (cob_get_long_ebcdic_sign (p, &val)) { val = -val; } } else { #ifdef COB_EBCDIC_MACHINE cob_get_long_ascii_sign (p, &val); #else val += (*p - (unsigned char)'p'); #endif val = -val; } } return (val < n) ? -1 : (val > n); } open-cobol-1.1/libcob/numeric.h0000644000000000000000000000526511134603751012115 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_NUMERIC_H #define COB_NUMERIC_H #include #include #define COB_STORE_ROUND 0x01 #define COB_STORE_KEEP_ON_OVERFLOW 0x02 #define COB_STORE_TRUNC_ON_OVERFLOW 0x04 /* * Internal representation of decimal numbers. * * n = value / 10^scale */ typedef struct { mpz_t value; int scale; } cob_decimal; extern void cob_decimal_init (cob_decimal *); extern void cob_decimal_set_field (cob_decimal *, cob_field *); extern int cob_decimal_get_field (cob_decimal *, cob_field *, const int); extern void cob_decimal_add (cob_decimal *, cob_decimal *); extern void cob_decimal_sub (cob_decimal *, cob_decimal *); extern void cob_decimal_mul (cob_decimal *, cob_decimal *); extern void cob_decimal_div (cob_decimal *, cob_decimal *); extern void cob_decimal_pow (cob_decimal *, cob_decimal *); extern int cob_decimal_cmp (cob_decimal *, cob_decimal *); extern int cob_add (cob_field *, cob_field *, const int); extern int cob_sub (cob_field *, cob_field *, const int); extern int cob_add_int (cob_field *, const int); extern int cob_sub_int (cob_field *, const int); extern int cob_div_quotient (cob_field *, cob_field *, cob_field *, const int); extern int cob_div_remainder (cob_field *, const int); extern int cob_cmp_int (cob_field *, const int); extern int cob_cmp_uint (cob_field *, const unsigned int); extern int cob_cmp_packed (cob_field *, int); extern int cob_cmp_numdisp (const unsigned char *, const size_t, const int); extern int cob_cmp_sign_numdisp (const unsigned char *, const size_t, const int); extern int cob_cmp_long_numdisp (const unsigned char *, const size_t, const int); extern void cob_set_packed_zero (cob_field *); extern void cob_set_packed_int (cob_field *, const int); extern int cob_cmp_long_sign_numdisp (const unsigned char *, const size_t, const int); #endif /* COB_NUMERIC_H */ open-cobol-1.1/libcob/strings.c0000644000000000000000000003030411136614062012126 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include "move.h" #include "coblocal.h" #include "numeric.h" #include "strings.h" #define INSPECT_ALL 0 #define INSPECT_LEADING 1 #define INSPECT_FIRST 2 #define INSPECT_TRAILING 3 #define DLM_DEFAULT_NUM 8 struct dlm_struct { cob_field *uns_dlm; int uns_all; }; static cob_field *inspect_var; static unsigned char *inspect_data; static unsigned char *inspect_start; static unsigned char *inspect_end; static int *inspect_mark = NULL; static size_t lastsize = 0; static size_t inspect_size; static int inspect_replacing; static int inspect_sign; static cob_field inspect_var_copy; static cob_field *string_dst; static cob_field *string_ptr; static cob_field *string_dlm; static cob_field string_dst_copy; static cob_field string_ptr_copy; static cob_field string_dlm_copy; static int string_offset; static struct dlm_struct *dlm_list = NULL; static cob_field *unstring_src; static cob_field *unstring_ptr; static cob_field unstring_src_copy; static cob_field unstring_ptr_copy; static int unstring_offset; static int unstring_count; static int unstring_ndlms; static cob_field_attr alpha_attr; static cob_field alpha_fld; static COB_INLINE int cob_min_int (const int x, const int y) { if (x < y) { return x; } return y; } static void alloc_figurative (const cob_field *f1, const cob_field *f2) { static unsigned char *figptr = NULL; static size_t figsize = 0; unsigned char *s; size_t size1; size_t size2; size_t n; size2 = f2->size; if (size2 > figsize) { if (figptr) { free (figptr); } figptr = cob_malloc (size2); figsize = size2; } size1 = 0; s = figptr; for (n = 0; n < size2; n++, s++) { *s = f1->data[size1]; size1++; if (size1 >= f1->size) { size1 = 0; } } alpha_fld.size = size2; alpha_fld.data = figptr; } static void inspect_common (cob_field *f1, cob_field *f2, const int type) { int *mark; size_t n = 0; size_t j; int i; int len; if (unlikely(!f1)) { f1 = &cob_low; } if (unlikely(!f2)) { f2 = &cob_low; } if (inspect_replacing && f1->size != f2->size) { if (COB_FIELD_TYPE (f1) == COB_TYPE_ALPHANUMERIC_ALL) { alloc_figurative (f1, f2); f1 = &alpha_fld; } else { cob_set_exception (COB_EC_RANGE_INSPECT_SIZE); return; } } mark = &inspect_mark[inspect_start - inspect_data]; len = (int)(inspect_end - inspect_start); if (type == INSPECT_TRAILING) { for (i = len - f2->size; i >= 0; i--) { /* find matching substring */ if (memcmp (inspect_start + i, f2->data, f2->size) == 0) { /* check if it is already marked */ for (j = 0; j < f2->size; j++) { if (mark[i + j] != -1) { break; } } /* if not, mark and count it */ if (j == f2->size) { for (j = 0; j < f2->size; j++) { mark[i + j] = inspect_replacing ? f1->data[j] : 1; } i -= f2->size - 1; n++; } } else { break; } } } else { for (i = 0; i < (int)(len - f2->size + 1); i++) { /* find matching substring */ if (memcmp (inspect_start + i, f2->data, f2->size) == 0) { /* check if it is already marked */ for (j = 0; j < f2->size; j++) { if (mark[i + j] != -1) { break; } } /* if not, mark and count it */ if (j == f2->size) { for (j = 0; j < f2->size; j++) { mark[i + j] = inspect_replacing ? f1->data[j] : 1; } i += f2->size - 1; n++; if (type == INSPECT_FIRST) { break; } } } else if (type == INSPECT_LEADING) { break; } } } if (n > 0 && !inspect_replacing) { cob_add_int (f1, (int) n); } } /* * INSPECT */ void cob_inspect_init (cob_field *var, const int replacing) { size_t i; size_t digcount; inspect_var_copy = *var; inspect_var = &inspect_var_copy; inspect_replacing = replacing; inspect_sign = cob_get_sign (var); inspect_size = COB_FIELD_SIZE (var); inspect_data = COB_FIELD_DATA (var); inspect_start = NULL; inspect_end = NULL; digcount = inspect_size * sizeof (int); if (digcount > lastsize) { free (inspect_mark); inspect_mark = cob_malloc (digcount); lastsize = digcount; } for (i = 0; i < inspect_size; i++) { inspect_mark[i] = -1; } cob_exception_code = 0; } void cob_inspect_start (void) { inspect_start = inspect_data; inspect_end = inspect_data + inspect_size; } void cob_inspect_before (const cob_field *str) { unsigned char *p; for (p = inspect_start; p < inspect_end - str->size + 1; p++) { if (memcmp (p, str->data, str->size) == 0) { inspect_end = p; return; } } } void cob_inspect_after (const cob_field *str) { unsigned char *p; for (p = inspect_start; p < inspect_end - str->size + 1; p++) { if (memcmp (p, str->data, str->size) == 0) { inspect_start = p + str->size; return; } } inspect_start = inspect_end; } void cob_inspect_characters (cob_field *f1) { int *mark; int i; int n; int len; mark = &inspect_mark[inspect_start - inspect_data]; len = (int)(inspect_end - inspect_start); if (inspect_replacing) { /* INSPECT REPLACING CHARACTERS f1 */ for (i = 0; i < len; i++) { if (mark[i] == -1) { mark[i] = f1->data[0]; } } } else { /* INSPECT TALLYING f1 CHARACTERS */ n = 0; for (i = 0; i < len; i++) { if (mark[i] == -1) { mark[i] = 1; n++; } } if (n > 0) { cob_add_int (f1, n); } } } void cob_inspect_all (cob_field *f1, cob_field *f2) { inspect_common (f1, f2, INSPECT_ALL); } void cob_inspect_leading (cob_field *f1, cob_field *f2) { inspect_common (f1, f2, INSPECT_LEADING); } void cob_inspect_first (cob_field *f1, cob_field *f2) { inspect_common (f1, f2, INSPECT_FIRST); } void cob_inspect_trailing (cob_field *f1, cob_field *f2) { inspect_common (f1, f2, INSPECT_TRAILING); } void cob_inspect_converting (cob_field *f1, cob_field *f2) { size_t i; size_t j; size_t len; len = (size_t)(inspect_end - inspect_start); for (j = 0; j < f1->size; j++) { for (i = 0; i < len; i++) { if (inspect_mark[i] == -1 && inspect_start[i] == f1->data[j]) { inspect_start[i] = f2->data[j]; inspect_mark[i] = 1; } } } } void cob_inspect_finish (void) { size_t i; if (inspect_replacing) { for (i = 0; i < inspect_size; i++) { if (inspect_mark[i] != -1) { inspect_data[i] = inspect_mark[i]; } } } cob_put_sign (inspect_var, inspect_sign); } /* * STRING */ void cob_string_init (cob_field *dst, cob_field *ptr) { string_dst_copy = *dst; string_dst = &string_dst_copy; string_ptr = NULL; if (ptr) { string_ptr_copy = *ptr; string_ptr = &string_ptr_copy; } string_offset = 0; cob_exception_code = 0; if (string_ptr) { string_offset = cob_get_int (string_ptr) - 1; if (string_offset < 0 || string_offset >= (int)string_dst->size) { cob_set_exception (COB_EC_OVERFLOW_STRING); } } } void cob_string_delimited (cob_field *dlm) { string_dlm = NULL; if (dlm) { string_dlm_copy = *dlm; string_dlm = &string_dlm_copy; } } void cob_string_append (cob_field *src) { size_t src_size; int i; int size; if (cob_exception_code) { return; } src_size = src->size; if (string_dlm) { size = (int)(src_size - string_dlm->size + 1); for (i = 0; i < size; i++) { if (memcmp (src->data + i, string_dlm->data, string_dlm->size) == 0) { src_size = i; break; } } } if (src_size <= string_dst->size - string_offset) { memcpy (string_dst->data + string_offset, src->data, src_size); string_offset += (int) src_size; } else { size = (int)(string_dst->size - string_offset); memcpy (string_dst->data + string_offset, src->data, (size_t)size); string_offset += size; cob_set_exception (COB_EC_OVERFLOW_STRING); } } void cob_string_finish (void) { if (string_ptr) { cob_set_int (string_ptr, string_offset + 1); } } /* * UNSTRING */ void cob_unstring_init (cob_field *src, cob_field *ptr, const size_t num_dlm) { static size_t udlmcount = 0; unstring_src_copy = *src; unstring_src = &unstring_src_copy; unstring_ptr = NULL; if (ptr) { unstring_ptr_copy = *ptr; unstring_ptr = &unstring_ptr_copy; } unstring_offset = 0; unstring_count = 0; unstring_ndlms = 0; cob_exception_code = 0; if (!dlm_list) { if (num_dlm <= DLM_DEFAULT_NUM) { dlm_list = cob_malloc (DLM_DEFAULT_NUM * sizeof(struct dlm_struct)); udlmcount = DLM_DEFAULT_NUM; } else { dlm_list = cob_malloc (num_dlm * sizeof(struct dlm_struct)); udlmcount = num_dlm; } } else { if (num_dlm > udlmcount) { free (dlm_list); dlm_list = cob_malloc (num_dlm * sizeof(struct dlm_struct)); udlmcount = num_dlm; } } if (unstring_ptr) { unstring_offset = cob_get_int (unstring_ptr) - 1; if (unstring_offset < 0 || unstring_offset >= (int)unstring_src->size) { cob_set_exception (COB_EC_OVERFLOW_UNSTRING); } } } void cob_unstring_delimited (cob_field *dlm, const int all) { dlm_list[unstring_ndlms].uns_dlm = dlm; dlm_list[unstring_ndlms].uns_all = all; unstring_ndlms++; } void cob_unstring_into (cob_field *dst, cob_field *dlm, cob_field *cnt) { unsigned char *p; unsigned char *dp; unsigned char *s; unsigned char *dlm_data; unsigned char *start; size_t dlm_size = 0; int i; int srsize; int dlsize; int match_size = 0; int brkpt = 0; if (cob_exception_code) { return; } if (unstring_offset >= (int)unstring_src->size) { return; } start = unstring_src->data + unstring_offset; dlm_data = NULL; if (unstring_ndlms == 0) { match_size = cob_min_int ((int)COB_FIELD_SIZE (dst), (int)unstring_src->size - unstring_offset); cob_memcpy (dst, start, match_size); unstring_offset += match_size; } else { srsize = (int) unstring_src->size; s = unstring_src->data + srsize; for (p = start; p < s; p++) { for (i = 0; i < unstring_ndlms; i++) { dlsize = (int) dlm_list[i].uns_dlm->size; dp = dlm_list[i].uns_dlm->data; if (p + dlsize > s) { break; } if (!memcmp (p, dp, (size_t)dlsize)) { match_size = (int)(p - start); cob_memcpy (dst, start, match_size); unstring_offset += match_size + dlsize; dlm_data = dp; dlm_size = dlsize; if (dlm_list[i].uns_all) { for (p++ ; p < s; p++) { if (p + dlsize > s) { break; } if (memcmp (p, dp, (size_t)dlsize)) { break; } unstring_offset += dlsize; } } brkpt = 1; break; } } if (brkpt) { break; } } if (!brkpt) { /* no match */ match_size = (int)(unstring_src->size - unstring_offset); cob_memcpy (dst, start, match_size); unstring_offset = (int) unstring_src->size; dlm_data = NULL; } } unstring_count++; if (dlm) { if (dlm_data) { cob_memcpy (dlm, dlm_data, (int) dlm_size); } else if (COB_FIELD_IS_NUMERIC (dlm)) { cob_move (&cob_zero, dlm); } else { cob_move (&cob_space, dlm); } } if (cnt) { cob_set_int (cnt, match_size); } } void cob_unstring_tallying (cob_field *f) { cob_add_int (f, unstring_count); } void cob_unstring_finish (void) { if (unstring_offset < (int)unstring_src->size) { cob_set_exception (COB_EC_OVERFLOW_UNSTRING); } if (unstring_ptr) { cob_set_int (unstring_ptr, unstring_offset + 1); } } /* Initialization */ void cob_init_strings (void) { inspect_mark = cob_malloc (COB_MEDIUM_BUFF); lastsize = COB_MEDIUM_BUFF; alpha_attr.type = COB_TYPE_ALPHANUMERIC; alpha_attr.digits = 0; alpha_attr.scale = 0; alpha_attr.flags = 0; alpha_attr.pic = NULL; alpha_fld.size = 0; alpha_fld.data = NULL; alpha_fld.attr = &alpha_attr; } open-cobol-1.1/libcob/strings.h0000644000000000000000000000374411134601310012131 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_STRINGS_H #define COB_STRINGS_H #include extern void cob_inspect_init (cob_field *, const int); extern void cob_inspect_start (void); extern void cob_inspect_before (const cob_field *); extern void cob_inspect_after (const cob_field *); extern void cob_inspect_characters (cob_field *); extern void cob_inspect_all (cob_field *, cob_field *); extern void cob_inspect_leading (cob_field *, cob_field *); extern void cob_inspect_first (cob_field *, cob_field *); extern void cob_inspect_trailing (cob_field *, cob_field *); extern void cob_inspect_converting (cob_field *, cob_field *); extern void cob_inspect_finish (void); extern void cob_string_init (cob_field *, cob_field *); extern void cob_string_delimited (cob_field *); extern void cob_string_append (cob_field *); extern void cob_string_finish (void); extern void cob_unstring_init (cob_field *, cob_field *, const size_t); extern void cob_unstring_delimited (cob_field *, const int); extern void cob_unstring_into (cob_field *, cob_field *, cob_field *); extern void cob_unstring_tallying (cob_field *); extern void cob_unstring_finish (void); #endif /* COB_STRINGS_H */ open-cobol-1.1/libcob/coblocal.h0000644000000000000000000000521511134602112012212 /* * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_LOCAL_H #define COB_LOCAL_H /* We use this file to prototype things that should not be exported to user space */ #if defined(__GNUC__) && defined(linux) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) #define COB_HIDDEN __attribute__ ((visibility("hidden"))) #else #define COB_HIDDEN #endif #define COB_ATTR_INIT(v,w,x,y,z) do { \ attr.type = v; \ attr.digits = w; \ attr.scale = x; \ attr.flags = y; \ attr.pic = z; \ } while (0) #ifdef COB_PARAM_CHECK #define COB_CHK_PARMS(x, z) \ do { \ if (cob_call_params < z) { \ cob_runtime_error (parm_msg, #x, z); \ cob_stop_run (1); \ } \ } while (0) #else #define COB_CHK_PARMS(x, z) #endif COB_HIDDEN extern int cob_screen_initialized; COB_HIDDEN extern int cob_got_exception; COB_HIDDEN extern unsigned int cob_orig_line; COB_HIDDEN extern const char *cob_orig_statement; COB_HIDDEN extern const char *cob_orig_program_id; COB_HIDDEN extern const char *cob_orig_section; COB_HIDDEN extern const char *cob_orig_paragraph; COB_HIDDEN extern void cob_memcpy (cob_field *, unsigned char *, const int); COB_HIDDEN extern void cob_exit_fileio (void); COB_HIDDEN extern void cob_field_to_string (const cob_field *, char *); COB_HIDDEN extern void cob_init_numeric (void); COB_HIDDEN extern void cob_init_termio (void); COB_HIDDEN extern void cob_init_fileio (void); COB_HIDDEN extern void cob_init_call (void); COB_HIDDEN extern void cob_init_intrinsic (void); COB_HIDDEN extern void cob_init_strings (void); COB_HIDDEN extern void cob_init_move (void); COB_HIDDEN extern void cob_screen_terminate (void); COB_HIDDEN extern void cob_screen_set_mode (size_t); COB_HIDDEN extern int cob_real_get_sign (cob_field *); COB_HIDDEN extern void cob_real_put_sign (cob_field *, const int); COB_HIDDEN extern long long cob_get_long_long (cob_field *); #endif /* COB_LOCAL_H */ open-cobol-1.1/libcob/exception.def0000644000000000000000000004075611130701401012747 /* -*- c -*- * Copyright (C) 2003-2009 Keisuke Nishida * Copyright (C) 2007, 2008 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ /* COB_EXCEPTION (code, tag, name, critical) */ /* All exception */ COB_EXCEPTION (FFFF, COB_EC_ALL, "EC-ALL", 0) /* Argument error */ COB_EXCEPTION (0100, COB_EC_ARGUMENT, "EC-ARGUMENT", 0) /* Function argument error */ COB_EXCEPTION (0101, COB_EC_ARGUMENT_FUNCTION, "EC-ARGUMENT-FUNCTION", 1) /* Implementation-defined argument error */ COB_EXCEPTION (0102, COB_EC_ARGUMENT_IMP, "EC-ARGUMENT-IMP", 0) /* Boundary violation */ COB_EXCEPTION (0200, COB_EC_BOUND, "EC-BOUND", 0) /* Implementation-defined boundary violation*/ COB_EXCEPTION (0201, COB_EC_BOUND_IMP, "EC-BOUND-IMP", 0) /* OCCURS ... DEPENDING ON data item out of bounds */ COB_EXCEPTION (0202, COB_EC_BOUND_ODO, "EC-BOUND-ODO", 1) /* Dynamic table capacity exceeded expected value */ COB_EXCEPTION (0203, COB_EC_BOUND_OVERFLOW, "EC-BOUND-OVERFLOW", 1) /* Data-pointer contains an address that is out of bounds */ COB_EXCEPTION (0204, COB_EC_BOUND_PTR, "EC-BOUND-PTR", 1) /* Reference modifier out of bounds */ COB_EXCEPTION (0205, COB_EC_BOUND_REF_MOD, "EC-BOUND-REF-MOD", 1) /* Invalid SET of dynamic table capacity */ COB_EXCEPTION (0206, COB_EC_BOUND_SET, "EC-BOUND-SET", 1) /* Subscript out of bounds */ COB_EXCEPTION (0207, COB_EC_BOUND_SUBSCRIPT, "EC-BOUND-SUBSCRIPT", 1) /* Dynamic table capacity exceeded maximum size */ COB_EXCEPTION (0208, COB_EC_BOUND_TABLE_LIMIT, "EC-BOUND-TABLE-LIMIT", 1) /* Data exception */ COB_EXCEPTION (0300, COB_EC_DATA, "EC-DATA", 0) /* Conversion failed because of incomplete character correspondence */ COB_EXCEPTION (0301, COB_EC_DATA_CONVERSION, "EC-DATA-CONVERSION", 0) /* Implementation-defined data exception */ COB_EXCEPTION (0302, COB_EC_DATA_IMP, "EC-DATA-IMP", 0) /* Incompatible data exception */ COB_EXCEPTION (0303, COB_EC_DATA_INCOMPATIBLE, "EC-DATA-INCOMPATIBLE", 1) /* Variable length internal format is corrupt */ COB_EXCEPTION (0304, COB_EC_DATA_INTEGRITY, "EC-DATA-INTEGRITY", 1) /* Based item data-pointer is set to NULL when referenced */ COB_EXCEPTION (0305, COB_EC_DATA_PTR_NULL, "EC-DATA-PTR-NULL", 1) /* INF (infinity) cannot be assigned to the receiving data item */ COB_EXCEPTION (0306, COB_EC_DATA_INFINITY, "EC-DATA-INFINITY", 1) /* INF (negative infinity) cannot be assigned to the receiving data item */ COB_EXCEPTION (0307, COB_EC_DATA_NEGATIVE_INFINITY, "EC-DATA-NEGATIVE-INFINITY", 1) /* NaN (not a number) cannot be assigned to the receiving data item */ COB_EXCEPTION (0308, COB_EC_DATA_NOT_A_NUMBER, "EC-DATA-NOT_A_NUMBER", 1) /* Execution control flow violation */ COB_EXCEPTION (0400, COB_EC_FLOW, "EC-FLOW", 0) /* EXIT PROGRAM in a global declarative */ COB_EXCEPTION (0401, COB_EC_FLOW_GLOBAL_EXIT, "EC-FLOW-GLOBAL-EXIT", 1) /* GOBACK in a global declarative */ COB_EXCEPTION (0402, COB_EC_FLOW_GLOBAL_GOBACK, "EC-FLOW-GLOBAL-GOBACK", 1) /* Implementation-defined control flow violation */ COB_EXCEPTION (0403, COB_EC_FLOW_IMP, "EC-FLOW-IMP", 0) /* RELEASE not in range of SORT */ COB_EXCEPTION (0404, COB_EC_FLOW_RELEASE, "EC-FLOW-RELEASE", 1) /* GENERATE, INITIATE, or TERMINATE during USE BEFORE REPORTING declarative */ COB_EXCEPTION (0405, COB_EC_FLOW_REPORT, "EC-FLOW-REPORT", 1) /* RETURN not in range of MERGE or SORT */ COB_EXCEPTION (0406, COB_EC_FLOW_RETURN, "EC-FLOW-RETURN", 1) /* Invalid use of SET for dynamic table */ COB_EXCEPTION (0407, COB_EC_FLOW_SEARCH, "EC-FLOW-SEARCH", 1) /* A USE statement caused another to be executed */ COB_EXCEPTION (0408, COB_EC_FLOW_USE, "EC-FLOW-USE", 1) /* input-output exception */ COB_EXCEPTION (0500, COB_EC_I_O, "EC-I-O", 0) /* I-O status "1x" */ COB_EXCEPTION (0501, COB_EC_I_O_AT_END, "EC-I-O-AT-END", 0) /* An end of page condition occurred */ COB_EXCEPTION (0502, COB_EC_I_O_EOP, "EC-I-O-EOP", 0) /* A page overflow condition occurred */ COB_EXCEPTION (0503, COB_EC_I_O_EOP_OVERFLOW, "EC-I-O-EOP-OVERFLOW", 0) /* I-O status "6x" */ COB_EXCEPTION (0504, COB_EC_I_O_FILE_SHARING, "EC-I-O-FILE-SHARING", 0) /* I-O status "9x" */ COB_EXCEPTION (0505, COB_EC_I_O_IMP, "EC-I-O-IMP", 0) /* I-O status "2x" */ COB_EXCEPTION (0506, COB_EC_I_O_INVALID_KEY, "EC-I-O-INVALID-KEY", 0) /* The value of a LINAGE data-item is not within the required range */ COB_EXCEPTION (0507, COB_EC_I_O_LINAGE, "EC-I-O-LINAGE", 1) /* I-O status "4x" */ COB_EXCEPTION (0508, COB_EC_I_O_LOGIC_ERROR, "EC-I-O-LOGIC-ERROR", 1) /* I-O status "3x" */ COB_EXCEPTION (0509, COB_EC_I_O_PERMANENT_ERROR, "EC-I-O-PERMANENT-ERROR", 1) /* I-O status "5x" */ COB_EXCEPTION (050A, COB_EC_I_O_RECORD_OPERATION, "EC-I-O-RECORD-OPERATION", 0) /* Implementation-defined exception condition */ COB_EXCEPTION (0600, COB_EC_IMP, "EC-IMP", 0) /* Implementation-defined accept condition */ COB_EXCEPTION (0601, COB_EC_IMP_ACCEPT, "EC-IMP-ACCEPT", 0) /* Implementation-defined display condition */ COB_EXCEPTION (0602, COB_EC_IMP_DISPLAY, "EC-IMP-DISPLAY", 0) /* Any locale related exception */ COB_EXCEPTION (0700, COB_EC_LOCALE, "EC-LOCALE", 0) /* Implementation-defined locale related exception */ COB_EXCEPTION (0701, COB_EC_LOCALE_IMP, "EC-LOCALE-IMP", 0) /* The referenced locale does not specify the expected characters in LC_COLLATE */ COB_EXCEPTION (0702, COB_EC_LOCALE_INCOMPATIBLE, "EC-LOCALE-INCOMPATIBLE", 0) /* Locale content is invalid or incomplete */ COB_EXCEPTION (0703, COB_EC_LOCALE_INVALID, "EC-LOCALE-INVALID", 1) /* Pointer does not reference a saved locale */ COB_EXCEPTION (0704, COB_EC_LOCALE_INVALID_PTR, "EC-LOCALE-INVALID-PTR", 1) /* The specified locale is not available */ COB_EXCEPTION (0705, COB_EC_LOCALE_MISSING, "EC-LOCALE-MISSING", 1) /* Digits were truncated in locale editing */ COB_EXCEPTION (0706, COB_EC_LOCALE_SIZE, "EC-LOCALE-SIZE", 1) /* Any predefined OO related exception */ COB_EXCEPTION (0800, COB_EC_OO, "EC-OO", 0) /* Failure for an object-view */ COB_EXCEPTION (0801, COB_EC_OO_CONFORMANCE, "EC-OO-CONFORMANCE", 1) /* An exception object was not handled */ COB_EXCEPTION (0802, COB_EC_OO_EXCEPTION, "EC-OO-EXCEPTION", 1) /* Implementation-defined OO exception */ COB_EXCEPTION (0803, COB_EC_OO_IMP, "EC-OO-IMP", 0) /* Requested method is not available */ COB_EXCEPTION (0804, COB_EC_OO_METHOD, "EC-OO-METHOD", 1) /* Method invocation was attempted with a null object reference */ COB_EXCEPTION (0805, COB_EC_OO_NULL, "EC-OO-NULL", 1) /* Insufficient system resources to create the object or expand the object */ COB_EXCEPTION (0806, COB_EC_OO_RESOURCE, "EC-OO-RESOURCE", 1) /* A runtime type check failed */ COB_EXCEPTION (0807, COB_EC_OO_UNIVERSAL, "EC-OO-UNIVERSAL", 1) /* Ordering exception */ COB_EXCEPTION (0900, COB_EC_ORDER, "EC-ORDER", 0) /* Implementation-defined ordering exception */ COB_EXCEPTION (0901, COB_EC_ORDER_IMP, "EC-ORDER-IMP", 0) /* ISO/IEC 14651:2001 ordering table or ordering level not supported */ COB_EXCEPTION (0902, COB_EC_ORDER_NOT_SUPPORTED, "EC-ORDER-NOT-SUPPORTED", 1) /* Overflow condition */ COB_EXCEPTION (0A00, COB_EC_OVERFLOW, "EC-OVERFLOW", 0) /* Implementation-defined overflow condition */ COB_EXCEPTION (0A01, COB_EC_OVERFLOW_IMP, "EC-OVERFLOW-IMP", 0) /* STRING overflow condition */ COB_EXCEPTION (0A02, COB_EC_OVERFLOW_STRING, "EC-OVERFLOW-STRING", 0) /* UNSTRING overflow condition */ COB_EXCEPTION (0A03, COB_EC_OVERFLOW_UNSTRING, "EC-OVERFLOW-UNSTRING", 0) /* Inter-program communication exception */ COB_EXCEPTION (0B00, COB_EC_PROGRAM, "EC-PROGRAM", 0) /* Parameter mismatch */ COB_EXCEPTION (0B01, COB_EC_PROGRAM_ARG_MISMATCH, "EC-PROGRAM-ARG-MISMATCH", 1) /* A reference to an omitted argument */ COB_EXCEPTION (0B02, COB_EC_PROGRAM_ARG_OMITTED, "EC-PROGRAM-ARG-OMITTED", 1) /* Canceled program active */ COB_EXCEPTION (0B03, COB_EC_PROGRAM_CANCEL_ACTIVE, "EC-PROGRAM-CANCEL-ACTIVE", 1) /* Implementation-defined inter-program communication exception */ COB_EXCEPTION (0B04, COB_EC_PROGRAM_IMP, "EC-PROGRAM-IMP", 0) /* Called program not found */ COB_EXCEPTION (0B05, COB_EC_PROGRAM_NOT_FOUND, "EC-PROGRAM-NOT-FOUND", 1) /* Program-pointer used in CALL is set to NULL */ COB_EXCEPTION (0B06, COB_EC_PROGRAM_PTR_NULL, "EC-PROGRAM-PTR-NULL", 1) /* Called program active */ COB_EXCEPTION (0B07, COB_EC_PROGRAM_RECURSIVE_CALL, "EC-PROGRAM-RECURSIVE-CALL", 1) /* Resources not available for called program */ COB_EXCEPTION (0B08, COB_EC_PROGRAM_RESOURCES, "EC-PROGRAM-RESOURCES", 1) /* EXIT ... RAISING or GOBACK RAISING exception */ COB_EXCEPTION (0C00, COB_EC_RAISING, "EC-RAISING", 0) /* Implementation-defined EXIT ... RAISING or GOBACK RAISING exception */ COB_EXCEPTION (0C01, COB_EC_RAISING_IMP, "EC-RAISING-IMP", 0) /* EXIT ... RAISING or GOBACK RAISING an EC-IMP or EC-USER exception condition not specified in RAISING phrase of procedure division header*/ COB_EXCEPTION (0C02, COB_EC_RAISING_NOT_SPECIFIED, "EC-RAISING-NOT-SPECIFIED", 1) /* Range exception */ COB_EXCEPTION (0D00, COB_EC_RANGE, "EC-RANGE", 0) /* Implementation-defined range exception */ COB_EXCEPTION (0D01, COB_EC_RANGE_IMP, "EC-RANGE-IMP", 0) /* Index made negative or too large for container */ COB_EXCEPTION (0D02, COB_EC_RANGE_INDEX, "EC-RANGE-INDEX", 1) /* Size of replace item in inspect differs */ COB_EXCEPTION (0D03, COB_EC_RANGE_INSPECT_SIZE, "EC-RANGE-INSPECT-SIZE", 1) /* Starting value of THROUGH range greater than ending value */ COB_EXCEPTION (0D04, COB_EC_RANGE_INVALID, "EC-RANGE-INVALID", 0) /* Setting of varied item in PERFORM is negative */ COB_EXCEPTION (0D05, COB_EC_RANGE_PERFORM_VARYING, "EC-RANGE-PERFORM-VARYING", 1) /* Pointer SET UP or DOWN is outsize range */ COB_EXCEPTION (0D06, COB_EC_RANGE_PTR, "EC-RANGE-PTR", 1) /* No table entry found in SEARCH because initial index out of range */ COB_EXCEPTION (0D07, COB_EC_RANGE_SEARCH_INDEX, "EC-RANGE-SEARCH-INDEX", 0) /* No table entry found in SEARCH because no entry matched criteria */ COB_EXCEPTION (0D08, COB_EC_RANGE_SEARCH_NO_MATCH, "EC-RANGE-SEARCH-NO-MATCH", 0) /* Report write exception */ COB_EXCEPTION (0E00, COB_EC_REPORT, "EC-REPORT", 0) /* INITIATE on an active report */ COB_EXCEPTION (0E01, COB_EC_REPORT_ACTIVE, "EC-REPORT-ACTIVE", 1) /* Overlapping report items */ COB_EXCEPTION (0E02, COB_EC_REPORT_COLUMN_OVERLAP, "EC-REPORT-COLUMN-OVERLAP", 1) /* An INITIATE statement was executed for file connector that was not open in the extent or output mode */ COB_EXCEPTION (0E03, COB_EC_REPORT_FILE_MODE, "EC-REPORT-FILE-MODE", 1) /* Implementation-defined report write exception */ COB_EXCEPTION (0E04, COB_EC_REPORT_IMP, "EC-REPORT-IMP", 0) /* GENERATE or TERMINATE on an inactive report */ COB_EXCEPTION (0E05, COB_EC_REPORT_INACTIVE, "EC-REPORT-INACTIVE", 1) /* Overlapping report lines */ COB_EXCEPTION (0E06, COB_EC_REPORT_LINE_OVERLAP, "EC-REPORT-LINE-OVERLAP", 0) /* Report file closed with active report */ COB_EXCEPTION (0E08, COB_EC_REPORT_NOT_TERMINATED, "EC-REPORT-NOT-TERMINATED", 0) /* Vertical page limit exceeded */ COB_EXCEPTION (0E09, COB_EC_REPORT_PAGE_LIMIT, "EC-REPORT-PAGE-LIMIT", 0) /* Page width exceeded */ COB_EXCEPTION (0E0A, COB_EC_REPORT_PAGE_WIDTH, "EC-REPORT-PAGE-WIDTH", 0) /* Overflow of sum counter */ COB_EXCEPTION (0E0B, COB_EC_REPORT_SUM_SIZE, "EC-REPORT-SUM-SIZE", 1) /* VARYING clause expression non-integer */ COB_EXCEPTION (0E0C, COB_EC_REPORT_VARYING, "EC-REPORT-VARYING", 1) /* Screen handling exception */ COB_EXCEPTION (0F00, COB_EC_SCREEN, "EC-SCREEN", 0) /* Screen fields overlap */ COB_EXCEPTION (0F01, COB_EC_SCREEN_FIELD_OVERLAP, "EC-SCREEN-FIELD-OVERLAP", 0) /* Implementation-defined screen handling exception */ COB_EXCEPTION (0F02, COB_EC_SCREEN_IMP, "EC-SCREEN-IMP", 0) /* Screen field too long for line */ COB_EXCEPTION (0F03, COB_EC_SCREEN_ITEM_TRUNCATED, "EC-SCREEN-ITEM-TRUNCATED", 0) /* Screen item line number exceeds terminal size */ COB_EXCEPTION (0F04, COB_EC_SCREEN_LINE_NUMBER, "EC-SCREEN-LINE-NUMBER", 0) /* Screen item starting column exceeds line size */ COB_EXCEPTION (0F05, COB_EC_SCREEN_STARTING_COLUMN, "EC-SCREEN-STARTING-COLUMN", 0) /* Size error exception */ COB_EXCEPTION (1000, COB_EC_SIZE, "EC-SIZE", 0) /* Invalid pointer arithmetic */ COB_EXCEPTION (1001, COB_EC_SIZE_ADDRESS, "EC-SIZE-ADDRESS", 1) /* Exponentiation rules violated */ COB_EXCEPTION (1002, COB_EC_SIZE_EXPONENTIATION, "EC-SIZE-EXPONENTIATION", 1) /* Implementation-defined size error exception */ COB_EXCEPTION (1003, COB_EC_SIZE_IMP, "EC-SIZE-IMP", 0) /* Arithmetic overflow in calculation */ COB_EXCEPTION (1004, COB_EC_SIZE_OVERFLOW, "EC-SIZE-OVERFLOW", 1) /* Significant digits truncated in store */ COB_EXCEPTION (1005, COB_EC_SIZE_TRUNCATION, "EC-SIZE-TRUNCATION", 1) /* Floating-point underflow */ COB_EXCEPTION (1006, COB_EC_SIZE_UNDERFLOW, "EC-SIZE-UNDERFLOW", 1) /* Division by zero */ COB_EXCEPTION (1007, COB_EC_SIZE_ZERO_DIVIDE, "EC-SIZE-ZERO-DIVIDE", 1) /* SORT or MERGE exception */ COB_EXCEPTION (1100, COB_EC_SORT_MERGE, "EC-SORT-MERGE", 0) /* File SORT or MERGE executed when one is already active */ COB_EXCEPTION (1101, COB_EC_SORT_MERGE_ACTIVE, "EC-SORT-MERGE-ACTIVE", 1) /* A USING or GIVING file is open upon execution of a SORT or MERGE */ COB_EXCEPTION (1102, COB_EC_SORT_MERGE_FILE_OPEN, "EC-SORT-MERGE-FILE-OPEN", 1) /* Implementation-defined SORT or MERGE exception */ COB_EXCEPTION (1103, COB_EC_SORT_MERGE_IMP, "EC-SORT-MERGE-IMP", 0) /* RELEASE record too long or too short */ COB_EXCEPTION (1104, COB_EC_SORT_MERGE_RELEASE, "EC-SORT-MERGE-RELEASE", 1) /* RETURN executed when at end condition exists */ COB_EXCEPTION (1105, COB_EC_SORT_MERGE_RETURN, "EC-SORT-MERGE-RETURN", 1) /* Sequence error on MERGE USING file */ COB_EXCEPTION (1106, COB_EC_SORT_MERGE_SEQUENCE, "EC-SORT-MERGE-SEQUENCE", 1) /* Storage allocation exception */ COB_EXCEPTION (1200, COB_EC_STORAGE, "EC-STORAGE", 0) /* Implementation-defined storage allocation exception */ COB_EXCEPTION (1201, COB_EC_STORAGE_IMP, "EC-STORAGE-IMP", 0) /* The data-pointer specified in a FREE statement does not identify currently allocated storage */ COB_EXCEPTION (1202, COB_EC_STORAGE_NOT_ALLOC, "EC-STORAGE-NOT-ALLOC", 0) /* The amount of storage requested by an ALLOCATE statement is not available */ COB_EXCEPTION (1203, COB_EC_STORAGE_NOT_AVAIL, "EC-STORAGE-NOT-AVAIL", 0) /* User-defined exception condition */ COB_EXCEPTION (1300, COB_EC_USER, "EC-USER", 0) /* VALIDATE exception */ COB_EXCEPTION (1400, COB_EC_VALIDATE, "EC-VALIDATE", 0) /* VALIDATE content error */ COB_EXCEPTION (1401, COB_EC_VALIDATE_CONTENT, "EC-VALIDATE-CONTENT", 0) /* VALIDATE format error */ COB_EXCEPTION (1402, COB_EC_VALIDATE_FORMAT, "EC-VALIDATE-FORMAT", 0) /* Implementation-defined VALIDATE exception */ COB_EXCEPTION (1403, COB_EC_VALIDATE_IMP, "EC-VALIDATE-IMP", 0) /* VALIDATE relation error */ COB_EXCEPTION (1404, COB_EC_VALIDATE_RELATION, "EC-VALIDATE-RELATION", 0) /* VARYING clause expression non-integer */ COB_EXCEPTION (1405, COB_EC_VALIDATE_VARYING, "EC-VALIDATE-VARYING", 1) /* FUNCTION exception */ COB_EXCEPTION (1500, COB_EC_FUNCTION, "EC-FUNCTION", 0) /* FUNCTION pointer invalid */ COB_EXCEPTION (1501, COB_EC_FUNCTION_NOT_FOUND, "EC-FUNCTION-NOT-FOUND", 1) /* FUNCTION signature mismatch */ COB_EXCEPTION (1502, COB_EC_FUNCTION_PTR_INVALID, "EC-FUNCTION-PTR-INVALID", 1) /* FUNCTION pointer is NULL */ COB_EXCEPTION (1503, COB_EC_FUNCTION_PTR_NULL, "EC-FUNCTION-PTR-NULL", 1) /* XML exception */ COB_EXCEPTION (1600, COB_EC_XML, "EC-XML", 0) /* XML encoding mismatch with CODE-SET */ COB_EXCEPTION (1601, COB_EC_XML_CODESET, "EC-XML-CODESET", 1) /* XML character cannot be encoded according to CODE-SET */ COB_EXCEPTION (1602, COB_EC_XML_CODESET_CONVERSION, "EC-XML-CODESET-CONVERSION", 1) /* XML */ COB_EXCEPTION (1603, COB_EC_XML_COUNT, "EC-XML-COUNT", 1) /* XML */ COB_EXCEPTION (1604, COB_EC_XML_DOCUMENT_TYPE, "EC-XML-DOCUMENT-TYPE", 1) /* XML */ COB_EXCEPTION (1605, COB_EC_XML_IMPLICIT_CLOSE, "EC-XML-IMPLICIT-CLOSE", 1) /* XML */ COB_EXCEPTION (1606, COB_EC_XML_INVALID, "EC-XML-INVALID", 1) /* XML */ COB_EXCEPTION (1607, COB_EC_XML_NAMESPACE, "EC-XML-NAMESPACE", 1) /* XML */ COB_EXCEPTION (1608, COB_EC_XML_STACKED_OPEN, "EC-XML-STACKED-OPEN", 1) /* XML */ COB_EXCEPTION (1609, COB_EC_XML_RANGE, "EC-XML-RANGE", 1) open-cobol-1.1/libcob/termio.c0000644000000000000000000001375711136614062011751 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include "move.h" #include "coblocal.h" #include "termio.h" #include "screenio.h" static unsigned char *term_buff; static const int bin_digits[] = { 1, 3, 5, 8, 10, 13, 15, 17, 20 }; /* * DISPLAY */ static void display_numeric (cob_field *f, FILE *fp) { int i; int digits; int scale; int size; cob_field_attr attr; cob_field temp; unsigned char data[128]; if (f->size == 0) { return; } digits = COB_FIELD_DIGITS (f); scale = COB_FIELD_SCALE (f); size = digits + (COB_FIELD_HAVE_SIGN (f) ? 1 : 0); COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, digits, scale, 0, NULL); temp.size = size; temp.data = data; temp.attr = &attr; if (COB_FIELD_HAVE_SIGN (f)) { attr.flags = COB_FLAG_HAVE_SIGN | COB_FLAG_SIGN_SEPARATE; if (COB_FIELD_SIGN_LEADING (f) || COB_FIELD_TYPE (f) == COB_TYPE_NUMERIC_BINARY) { attr.flags |= COB_FLAG_SIGN_LEADING; } } cob_move (f, &temp); for (i = 0; i < size; ++i) { putc (data[i], fp); } } static void pretty_display_numeric (cob_field *f, FILE *fp) { unsigned char *p; int i; int digits; int scale; int size; cob_field_attr attr; cob_field temp; unsigned char pic[64]; unsigned char data[256]; if (f->size == 0) { return; } /* RXW if (COB_FIELD_TYPE(f) == COB_TYPE_NUMERIC_BINARY) { digits = bin_digits[f->size]; } else { */ digits = COB_FIELD_DIGITS (f); /* RXW } */ scale = COB_FIELD_SCALE (f); size = (digits + (COB_FIELD_HAVE_SIGN (f) ? 1 : 0) + (scale > 0 ? 1 : 0)); p = pic; temp.size = size; temp.data = data; temp.attr = &attr; COB_ATTR_INIT (COB_TYPE_NUMERIC_EDITED, digits, scale, 0, (char *)pic); memset (pic, 0, sizeof (pic)); memset (data, 0, sizeof (data)); if (COB_FIELD_HAVE_SIGN (f)) { *p++ = '+'; i = 1; memcpy (p, (unsigned char *)&i, sizeof(int)); p += sizeof(int); } if (scale > 0) { *p++ = '9'; i = digits - scale; memcpy (p, (unsigned char *)&i, sizeof(int)); p += sizeof(int); *p++ = cob_current_module->decimal_point; i = 1; memcpy (p, (unsigned char *)&i, sizeof(int)); p += sizeof(int); *p++ = '9'; i = scale; memcpy (p, (unsigned char *)&i, sizeof(int)); p += sizeof(int); } else { *p++ = '9'; i = digits; memcpy (p, (unsigned char *)&i, sizeof(int)); p += sizeof(int); } cob_move (f, &temp); for (i = 0; i < size; ++i) { putc (data[i], fp); } } static void display_alnum (cob_field *f, FILE *fp) { size_t i; for (i = 0; i < f->size; ++i) { putc (f->data[i], fp); } } static void display (cob_field *f, FILE *fp) { unsigned char *p; int n; cob_field temp; cob_field_attr attr; if (COB_FIELD_TYPE (f) == COB_TYPE_NUMERIC_DOUBLE) { double f1doub; memcpy ((char *)&f1doub, f->data, sizeof (double)); fprintf (fp, "%-.18lf", f1doub); } else if (COB_FIELD_TYPE (f) == COB_TYPE_NUMERIC_FLOAT) { float f1float; memcpy ((char *)&f1float, f->data, sizeof (float)); fprintf (fp, "%-.18lf", (double)f1float); } else if (COB_FIELD_IS_POINTER (f)) { fprintf (fp, "0x"); #ifdef WORDS_BIGENDIAN p = f->data; for (n = 0; n < sizeof(void *); ++n, ++p) { #else p = f->data + sizeof(void *) - 1; for (n = sizeof(void *) - 1; n >= 0; --n, --p) { #endif fprintf (fp, "%x%x", *p >> 4, *p & 0xF); } } else if (COB_FIELD_REAL_BINARY(f) || (COB_FIELD_TYPE(f) == COB_TYPE_NUMERIC_BINARY && !cob_current_module->flag_pretty_display)) { attr = *f->attr; temp = *f; attr.digits = bin_digits[f->size]; temp.attr = &attr; display_numeric (&temp, fp); } else if (COB_FIELD_IS_NUMERIC (f)) { if (cob_current_module->flag_pretty_display) { pretty_display_numeric (f, fp); } else { display_numeric (f, fp); } } else { display_alnum (f, fp); } } void cob_display (const int outorerr, const int newline, const int varcnt, ...) { FILE *fp; cob_field *f; int i; va_list args; if (!outorerr && !cob_screen_initialized) { fp = stdout; } else { fp = stderr; } va_start (args, varcnt); for (i = 0; i < varcnt; ++i) { f = va_arg (args, cob_field *); display (f, fp); } va_end (args); if (newline) { putc ('\n', fp); fflush (fp); } } /* * ACCEPT */ void cob_accept (cob_field *f) { /* RXW size_t size; */ cob_field_attr attr; cob_field temp; if (cob_screen_initialized) { cob_field_accept (f, NULL, NULL, NULL, NULL, NULL, 0); return; } temp.data = term_buff; temp.attr = &attr; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); /* read a line */ if (fgets ((char *)term_buff, COB_MEDIUM_BUFF, stdin) == NULL) { temp.size = 1; term_buff[0] = ' '; term_buff[1] = 0; } else { temp.size = strlen ((char *)term_buff) - 1; } if (COB_FIELD_TYPE(f) == COB_TYPE_NUMERIC_DISPLAY) { if (temp.size > f->size) { temp.size = f->size; } } cob_move (&temp, f); /* RXW if (isatty (fileno (stdin))) { temp.size = strlen ((char *)term_buff) - 1; cob_move (&temp, f); } else { size = strlen ((char *)term_buff) - 1; if (size > f->size) { size = f->size; } memcpy (f->data, term_buff, size); memset (f->data + size, ' ', f->size - size); } */ } void cob_init_termio (void) { term_buff = cob_malloc (COB_MEDIUM_BUFF); } open-cobol-1.1/libcob/termio.h0000644000000000000000000000202011134620615011732 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_TERMIO_H #define COB_TERMIO_H #include extern void cob_display (const int, const int, const int, ...); extern void cob_accept (cob_field *); #endif /* COB_TERMIO_H */ open-cobol-1.1/libcob/system.def0000644000000000000000000000552011130701401012263 /* -*- c -*- * Copyright (C) 2006-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ /* COB_SYSTEM_GEN (external name, number of parameters, internal name) */ COB_SYSTEM_GEN ("SYSTEM", 1, SYSTEM) COB_SYSTEM_GEN ("CBL_ERROR_PROC", 2, CBL_ERROR_PROC) COB_SYSTEM_GEN ("CBL_EXIT_PROC", 2, CBL_EXIT_PROC) COB_SYSTEM_GEN ("CBL_OPEN_FILE", 5, CBL_OPEN_FILE) COB_SYSTEM_GEN ("CBL_CREATE_FILE", 5, CBL_CREATE_FILE) COB_SYSTEM_GEN ("CBL_READ_FILE", 5, CBL_READ_FILE) COB_SYSTEM_GEN ("CBL_WRITE_FILE", 5, CBL_WRITE_FILE) COB_SYSTEM_GEN ("CBL_CLOSE_FILE", 1, CBL_CLOSE_FILE) COB_SYSTEM_GEN ("CBL_FLUSH_FILE", 1, CBL_FLUSH_FILE) COB_SYSTEM_GEN ("CBL_DELETE_FILE", 1, CBL_DELETE_FILE) COB_SYSTEM_GEN ("CBL_COPY_FILE", 2, CBL_COPY_FILE) COB_SYSTEM_GEN ("CBL_CHECK_FILE_EXIST", 2, CBL_CHECK_FILE_EXIST) COB_SYSTEM_GEN ("CBL_RENAME_FILE", 2, CBL_RENAME_FILE) COB_SYSTEM_GEN ("CBL_GET_CURRENT_DIR", 3, CBL_GET_CURRENT_DIR) COB_SYSTEM_GEN ("CBL_CHANGE_DIR", 1, CBL_CHANGE_DIR) COB_SYSTEM_GEN ("CBL_CREATE_DIR", 1, CBL_CREATE_DIR) COB_SYSTEM_GEN ("CBL_DELETE_DIR", 1, CBL_DELETE_DIR) COB_SYSTEM_GEN ("CBL_AND", 3, CBL_AND) COB_SYSTEM_GEN ("CBL_OR", 3, CBL_OR) COB_SYSTEM_GEN ("CBL_NOR", 3, CBL_NOR) COB_SYSTEM_GEN ("CBL_XOR", 3, CBL_XOR) COB_SYSTEM_GEN ("CBL_IMP", 3, CBL_IMP) COB_SYSTEM_GEN ("CBL_NIMP", 3, CBL_NIMP) COB_SYSTEM_GEN ("CBL_EQ", 3, CBL_EQ) COB_SYSTEM_GEN ("CBL_NOT", 2, CBL_NOT) COB_SYSTEM_GEN ("CBL_TOUPPER", 2, CBL_TOUPPER) COB_SYSTEM_GEN ("CBL_TOLOWER", 2, CBL_TOLOWER) COB_SYSTEM_GEN ("\364", 2, CBL_XF4) COB_SYSTEM_GEN ("\365", 2, CBL_XF5) COB_SYSTEM_GEN ("\221", 2, CBL_X91) COB_SYSTEM_GEN ("C$NARG", 1, cob_return_args) COB_SYSTEM_GEN ("C$PARAMSIZE", 1, cob_parameter_size) COB_SYSTEM_GEN ("C$MAKEDIR", 1, cob_acuw_mkdir) COB_SYSTEM_GEN ("C$CHDIR", 2, cob_acuw_chdir) COB_SYSTEM_GEN ("C$SLEEP", 1, cob_acuw_sleep) COB_SYSTEM_GEN ("C$COPY", 3, cob_acuw_copyfile) COB_SYSTEM_GEN ("C$FILEINFO", 2, cob_acuw_file_info) COB_SYSTEM_GEN ("C$DELETE", 2, cob_acuw_file_delete) COB_SYSTEM_GEN ("C$TOUPPER", 2, CBL_TOUPPER) COB_SYSTEM_GEN ("C$TOLOWER", 2, CBL_TOLOWER) COB_SYSTEM_GEN ("C$JUSTIFY", 1, cob_acuw_justify) COB_SYSTEM_GEN ("CBL_OC_NANOSLEEP", 1, CBL_OC_NANOSLEEP) open-cobol-1.1/libcob/fileio.c0000644000000000000000000041021511136614062011707 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 #define _FILE_OFFSET_BITS 64 #define _LARGEFILE64_SOURCE 1 #ifdef _AIX #define _LARGE_FILES 1 #endif /* _AIX */ #if defined(__hpux__) && !defined(__LP64__) #define _APP32_64BIT_OFF_T 1 #endif #ifdef __MINGW32__ #define __USE_MINGW_FSEEK 1 #endif /* __MINGW32__ */ #include #include #include #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #ifdef _WIN32 #define WINDOWS_LEAN_AND_MEAN #include /* for GetTempPath, GetTempFileName */ #include #define fsync _commit #define getcwd _getcwd #define chdir _chdir #define mkdir _mkdir #define rmdir _rmdir #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef WITH_DB #ifdef USE_DB41 #include #else #if HAVE_DB1_DB_H #include #elif HAVE_DB_185_H #include #elif HAVE_DB3_DB_185_H #include #elif HAVE_DB4_DB_185_H #include #elif HAVE_DB4_1_DB_185_H #include #elif HAVE_DB4_2_DB_185_H #include #elif HAVE_DB4_3_DB_185_H #include #elif HAVE_DB4_4_DB_185_H #include #elif HAVE_DB4_5_DB_185_H #include #elif HAVE_DB_H #include #endif #endif /* USE_DB41 */ #endif /* WITH_DB */ #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) #include #endif #ifdef WITH_CISAM #include #endif #ifdef WITH_DISAM #include #endif #ifdef WITH_VBISAM #include #endif #if defined(__hpux__) || defined(_AIX) || defined(__sparc) #define fseek fseeko #define ftell ftello #endif #ifdef _MSC_VER #define fseek _fseeki64 #define ftell _ftelli64 #define lseek _lseeki64 #define off_t __int64 #endif #include "common.h" #include "coblocal.h" #include "move.h" #include "numeric.h" #include "fileio.h" #include "byteswap.h" #if !defined(__linux__) #define SEEK_INIT(f) fseek ((FILE *)f->file, (off_t)0, SEEK_CUR) #else #define SEEK_INIT(f) #endif #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_LARGEFILE #define O_LARGEFILE 0 #endif #ifdef _WIN32 #define INITIAL_FLAGS O_BINARY #else #define INITIAL_FLAGS 0 #endif /* SORT definitions */ #define COBSORTEND 1 #define COBSORTABORT 2 #define COBSORTFILEERR 3 #define COBSORTNOTOPEN 4 struct cobitem { struct cobitem *next; size_t end_of_block; unsigned char block_byte; unsigned char unique[sizeof(size_t)]; unsigned char item[1]; }; struct memory_struct { struct cobitem *first; struct cobitem *last; size_t count; }; struct file_struct { FILE *fp; size_t count; /* count of items in temporary files */ }; struct cobsort { void *pointer; struct cobitem *empty; void *sort_return; cob_field *fnstatus; size_t unique; size_t retrieving; size_t files_used; size_t size; size_t r_size; size_t w_size; size_t memory; int destination_file; int retrieval_queue; struct memory_struct queue[4]; struct file_struct file[4]; }; /* End SORT definitions */ cob_file *cob_error_file; #ifndef _WIN32 static int cob_iteration = 0; static pid_t cob_process_id = 0; #endif static size_t eop_status = 0; static int cob_do_sync = 0; static int cob_sort_memory = 128*1024*1024; #ifdef USE_DB41 static DB_ENV *bdb_env = NULL; static char *bdb_home; static char *bdb_buff; static const char **bdb_data_dir = NULL; static void *record_lock_object; static size_t rlo_size = 0; static unsigned int bdb_lock_id; #endif static struct file_list { struct file_list *next; cob_file *file; } *file_cache = NULL; static char *cob_file_path = NULL; static char *cob_ls_nulls = NULL; static char *cob_ls_fixed = NULL; static char *file_open_env; static char *file_open_name; static char *file_open_buff; /* Emergence buffer in case of malloc fail */ static char runtime_buffer[COB_SMALL_BUFF]; #define RETURN_STATUS(x) do { save_status (f, x, fnstatus); return; } while (0) static const int status_exception[] = { 0, /* 0x */ COB_EC_I_O_AT_END, /* 1x */ COB_EC_I_O_INVALID_KEY, /* 2x */ COB_EC_I_O_PERMANENT_ERROR, /* 3x */ COB_EC_I_O_LOGIC_ERROR, /* 4x */ COB_EC_I_O_RECORD_OPERATION, /* 5x */ COB_EC_I_O_FILE_SHARING, /* 6x */ COB_EC_I_O, /* unused */ COB_EC_I_O, /* unused */ COB_EC_I_O_IMP /* 9x */ }; static const char * const prefix[] = { "DD_", "dd_", "" }; #define NUM_PREFIX sizeof(prefix) / sizeof(char *) #ifdef COB_PARAM_CHECK static const char parm_msg[] = "CALL to %s requires %d parameters"; #endif static int dummy_rnxt_del (cob_file *f); static int dummy_rewrite (cob_file *f, const int opt); static int dummy_read (cob_file *f, cob_field *key, const int read_opts); static int dummy_start (cob_file *f, const int cond, cob_field *key); static int cob_file_open (cob_file *f, char *filename, const int mode, const int sharing); static int cob_file_close (cob_file *f, const int opt); static int cob_file_write_opt (cob_file *f, const int opt); static int sequential_read (cob_file *f, const int read_opts); static int sequential_write (cob_file *f, const int opt); static int sequential_rewrite (cob_file *f, const int opt); static int lineseq_read (cob_file *f, const int read_opts); static int lineseq_write (cob_file *f, const int opt); static int relative_start (cob_file *f, const int cond, cob_field *k); static int relative_read (cob_file *f, cob_field *k, const int read_opts); static int relative_read_next (cob_file *f, const int read_opts); static int relative_write (cob_file *f, const int opt); static int relative_rewrite (cob_file *f, const int opt); static int relative_delete (cob_file *f); #if defined(WITH_DB) || defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) || defined(WITH_INDEX_EXTFH) #ifdef WITH_DB #ifdef USE_DB41 #define DB_PUT(db,flags) db->put (db, NULL, &p->key, &p->data, flags) #define DB_GET(db,flags) db->get (db, NULL, &p->key, &p->data, flags) #define DB_SEQ(db,flags) db->c_get (db, &p->key, &p->data, flags) #define DB_DEL(db,key,flags) db->del (db, NULL, key, flags) #define DB_CLOSE(db) db->close (db, 0) #define DB_SYNC(db) db->sync (db, 0) #define cob_dbtsize_t u_int32_t #else #define DB_PUT(db,flags) db->put (db, &p->key, &p->data, flags) #define DB_GET(db,flags) db->get (db, &p->key, &p->data, flags) #define DB_SEQ(db,flags) db->seq (db, &p->key, &p->data, flags) #define DB_DEL(db,key,flags) db->del (db, key, flags) #define DB_CLOSE(db) db->close (db) #define DB_SYNC(db) db->sync (db, 0) #define DB_FIRST R_FIRST #define DB_LAST R_LAST #define DB_NEXT R_NEXT #define DB_PREV R_PREV #define cob_dbtsize_t size_t #endif #define DBT_SET(key,fld) \ key.data = fld->data; \ key.size = (cob_dbtsize_t) fld->size struct indexed_file { size_t key_index; unsigned char *last_key; /* the last key written */ unsigned char *temp_key; /* used for temporary storage */ DB **db; /* database handlers */ DBT key; DBT data; unsigned char **last_readkey; /* the last key read */ unsigned int *last_dupno; /* the last number of duplicates read */ int *rewrite_sec_key; #ifdef USE_DB41 DBC **cursor; DB_LOCK bdb_file_lock; char *filename; /*needed for record locks*/ DB_LOCK bdb_record_lock; int write_cursor_open; unsigned int bdb_lock_id; int record_locked; int filenamelen; #endif }; #endif /* WITH_DB */ static int indexed_open (cob_file *f, char *filename, const int mode, const int sharing); static int indexed_close (cob_file *f, const int opt); static int indexed_start (cob_file *f, const int cond, cob_field *key); static int indexed_read (cob_file *f, cob_field *key, const int read_opts); static int indexed_read_next (cob_file *f, const int read_opts); static int indexed_write (cob_file *f, const int opt); static int indexed_delete (cob_file *f); static int indexed_rewrite (cob_file *f, const int opt); #if !defined(WITH_INDEX_EXTFH) && !defined(WITH_CISAM) && !defined(WITH_DISAM) && !defined(WITH_VBISAM) static int indexed_write_internal (cob_file *f, const int rewrite, const int opt); static int indexed_delete_internal (cob_file *f, const int rewrite); #endif /* WITH_INDEX_EXTFH */ static const struct cob_fileio_funcs indexed_funcs = { indexed_open, indexed_close, indexed_start, indexed_read, indexed_read_next, indexed_write, indexed_rewrite, indexed_delete }; #else /* WITH_DB || WITH_CISAM || WITH_DISAM || WITH_VBISAM || WITH_INDEX_EXTFH */ static int dummy_open (cob_file *f, char *filename, const int mode, const int sharing) { return COB_STATUS_91_NOT_AVAILABLE; } static int dummy_write_close (cob_file *f, const int opt) { return COB_STATUS_91_NOT_AVAILABLE; } static struct cob_fileio_funcs indexed_funcs = { dummy_open, dummy_write_close, dummy_start, dummy_read, dummy_rnxt_del, dummy_write_close, dummy_rewrite, dummy_rnxt_del }; #endif /* WITH_DB || WITH_CISAM || WITH_DISAM || WITH_VBISAM || WITH_INDEX_EXTFH */ static const struct cob_fileio_funcs sequential_funcs = { cob_file_open, cob_file_close, dummy_start, dummy_read, sequential_read, sequential_write, sequential_rewrite, dummy_rnxt_del }; static const struct cob_fileio_funcs lineseq_funcs = { cob_file_open, cob_file_close, dummy_start, dummy_read, lineseq_read, lineseq_write, dummy_rewrite, dummy_rnxt_del }; static const struct cob_fileio_funcs relative_funcs = { cob_file_open, cob_file_close, relative_start, relative_read, relative_read_next, relative_write, relative_rewrite, relative_delete }; static const struct cob_fileio_funcs *fileio_funcs[COB_ORG_MAX] = { &sequential_funcs, &lineseq_funcs, &relative_funcs, &indexed_funcs, NULL }; #if defined(WITH_INDEX_EXTFH) || defined(WITH_SEQRA_EXTFH) extern void extfh_cob_init_fileio (const struct cob_fileio_funcs *, const struct cob_fileio_funcs *, const struct cob_fileio_funcs *, int (*)(cob_file *, const int)); extern void extfh_cob_exit_fileio (void); #endif #ifdef WITH_INDEX_EXTFH extern void extfh_indexed_unlock (cob_file *); extern int extfh_indexed_locate (cob_file *, char *); extern int extfh_indexed_open (cob_file *, char *, int, int); extern int extfh_indexed_close (cob_file *, int); extern int extfh_indexed_start (cob_file *, int, cob_field *); extern int extfh_indexed_read (cob_file *, cob_field *, int); extern int extfh_indexed_read_next (cob_file *, int); extern int extfh_indexed_write (cob_file *, int); extern int extfh_indexed_delete (cob_file *); extern int extfh_indexed_rewrite (cob_file *, int); #endif #ifdef WITH_SEQRA_EXTFH extern void extfh_seqra_unlock (cob_file *); extern int extfh_seqra_locate (cob_file *, char *); extern int extfh_cob_file_open (cob_file *, char *, int, int); extern int extfh_cob_file_close (cob_file *, int); extern int extfh_sequential_read (cob_file *, int); extern int extfh_sequential_write (cob_file *, int); extern int extfh_sequential_rewrite (cob_file *, int); extern int extfh_relative_start (cob_file *, int, cob_field *); extern int extfh_relative_read (cob_file *, cob_field *, int); extern int extfh_relative_read_next (cob_file *, int); extern int extfh_relative_write (cob_file *, int); extern int extfh_relative_rewrite (cob_file *, int); extern int extfh_relative_delete (cob_file *); #endif #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) /* Isam File handler packet */ struct indexfile { char *filename; /* ISAM data file name */ char *savekey; /* Area to save last Prime Key read */ char *recwrk; /* Record work/save area */ int isfd; /* ISAM file number */ int recnum; /* last record number read */ int saverecnum; /* isrecnum of next record to process */ int saveerrno; /* savefileposition errno */ int lmode; /* File lock mode for 'isread' */ int curkey; /* Current active index */ int startcond; /* Previous 'start' condition value */ int readdir; /* read direction: ISPREV or ISNEXT */ int nkeys; /* Actual keys in file */ int lenkey; /* Length of savekey area */ int eofpending; /* end of file pending */ int readdone; /* A 'read' has been succesfully done */ int startiscur; /* The 'start' record is current */ int keyhasdups; /* 'curkey' has dups */ int wrkhasrec; /* 'recwrk' buffer holds the next|prev record */ struct keydesc key[1]; /* Table of key information */ /* keydesc is defined in (d|c|vb)isam.h */ }; /* Translate ISAM status to COBOL status and return */ static int COB_NOINLINE isretsts (int dfltsts) { switch (iserrno) { case 0: dfltsts = COB_STATUS_00_SUCCESS; break; case ENOREC: dfltsts = COB_STATUS_23_KEY_NOT_EXISTS; break; case EENDFILE: dfltsts = COB_STATUS_10_END_OF_FILE; break; case EPERM: dfltsts = COB_STATUS_37_PERMISSION_DENIED; break; case EACCES: dfltsts = COB_STATUS_37_PERMISSION_DENIED; break; case EISDIR: dfltsts = COB_STATUS_37_PERMISSION_DENIED; break; case EDUPL: dfltsts = COB_STATUS_22_KEY_EXISTS; break; case EKEXISTS: dfltsts = COB_STATUS_22_KEY_EXISTS; break; case ENOENT: dfltsts = COB_STATUS_35_NOT_EXISTS; break; case ENOCURR: if (dfltsts != COB_STATUS_10_END_OF_FILE) { dfltsts = COB_STATUS_21_KEY_INVALID; } break; case ELOCKED: dfltsts = COB_STATUS_51_RECORD_LOCKED; break; case EFLOCKED: dfltsts = COB_STATUS_61_FILE_SHARING; break; } return dfltsts; } /* Free memory for indexfile packet */ static void COB_NOINLINE freefh (struct indexfile *fh) { if (fh == NULL) { return; } if (fh->filename) { free ((void *)fh->filename); } if (fh->savekey) { free ((void *)fh->savekey); } if (fh->recwrk) { free ((void *)fh->recwrk); } free ((void *)fh); } /* Restore ISAM file positioning */ static void restorefileposition (cob_file *f) { struct indexfile *fh = f->file; struct keydesc k0; memset ((void *)&k0, 0, sizeof(k0)); if (fh->saverecnum >= 0) { /* Switch back to index */ isrecnum = fh->saverecnum; isstart (fh->isfd, &k0, 0, fh->recwrk, ISEQUAL); /* Switch to recnum mode */ isread (fh->isfd, fh->recwrk, ISEQUAL); /* Read by record number */ isstart (fh->isfd, &fh->key[fh->curkey], fh->key[fh->curkey].k_leng, fh->recwrk, ISEQUAL); isread (fh->isfd, fh->recwrk, ISEQUAL); while (isrecnum != fh->saverecnum) { /* Read back into position */ if (isread (fh->isfd, fh->recwrk, fh->readdir) == -1) { break; } } if (isrecnum == fh->saverecnum) { if (fh->readdir == ISNEXT) { /* Back off by one so next read gets this */ isread (fh->isfd, fh->recwrk, ISPREV); } else { isread (fh->isfd, fh->recwrk, ISNEXT); } } } else if (fh->readdone && fh->curkey == 0) { memcpy (fh->recwrk + fh->key[0].k_start, fh->savekey, fh->key[0].k_leng); isstart (fh->isfd, &fh->key[fh->curkey], fh->key[fh->curkey].k_leng, fh->recwrk, ISGTEQ); } } /* Save ISAM file positioning information for later 'restorefileposition' */ static void savefileposition (cob_file *f) { struct indexfile *fh = f->file; if (fh->curkey >= 0 && fh->readdir != -1) { /* Switch back to index */ if (fh->wrkhasrec != fh->readdir) { fh->eofpending = 0; fh->wrkhasrec = 0; if (isread (fh->isfd, fh->recwrk, fh->readdir) == -1) { /* Read next record in file */ fh->saverecnum = -1; fh->saveerrno = iserrno; if (fh->saveerrno == EENDFILE || fh->saveerrno == ENOREC) { fh->eofpending = fh->readdir; } } else { fh->saverecnum = isrecnum; fh->saveerrno = 0; } memcpy (fh->recwrk, f->record->data, f->record_max); /* Restore saved record data */ } } else { fh->saverecnum = -1; } } #endif /* WITH_CISAM || WITH_DISAM || WITH_VBISAM */ static void COB_NOINLINE cob_sync (cob_file *f, const int mode) { #ifdef WITH_DB struct indexed_file *p; size_t i; #ifdef USE_DB41 int n; #endif #endif #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; #endif if (f->organization == COB_ORG_INDEXED) { #ifdef WITH_DB p = f->file; for (i = 0; i < f->nkeys; i++) { if (p->db[i]) { DB_SYNC (p->db[i]); } } if (mode == 2) { for (i = 0; i < f->nkeys; i++) { if (p->db[i]) { #ifdef USE_DB41 fsync (p->db[i]->fd (p->db[i], &n)); #else fsync (p->db[i]->fd (p->db[i])); #endif } } } #endif /* WITH_DB */ #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) if (fh) { isflush (fh->isfd); } #endif return; } if (f->organization != COB_ORG_SORT) { fflush ((FILE *)f->file); if (mode == 2) { fsync (fileno ((FILE *)f->file)); } } } static void cob_cache_file (cob_file *f) { struct file_list *l; for (l = file_cache; l; l = l->next) { if (f == l->file) { return; } } l = cob_malloc (sizeof (struct file_list)); l->file = f; l->next = file_cache; file_cache = l; } static void save_status (cob_file *f, const int status, cob_field *fnstatus) { cob_error_file = f; if (likely(status == 0)) { f->file_status[0] = (unsigned char)'0'; f->file_status[1] = (unsigned char)'0'; if (fnstatus) { fnstatus->data[0] = (unsigned char)'0'; fnstatus->data[1] = (unsigned char)'0'; } cob_exception_code = 0; return; } if (likely(status != COB_STATUS_52_EOP)) { cob_set_exception (status_exception[status / 10]); } f->file_status[0] = cob_i2d (status / 10); f->file_status[1] = cob_i2d (status % 10); if (fnstatus) { fnstatus->data[0] = f->file_status[0]; fnstatus->data[1] = f->file_status[1]; } } /* * Regular file */ static size_t COB_NOINLINE file_linage_check (cob_file *f) { struct linage_struct *lingptr; lingptr = (struct linage_struct *)(f->linorkeyptr); lingptr->lin_lines = cob_get_int (lingptr->linage); if (lingptr->lin_lines < 1) { goto linerr; } if (lingptr->latfoot) { lingptr->lin_foot = cob_get_int (lingptr->latfoot); if (lingptr->lin_foot < 1 || lingptr->lin_foot > lingptr->lin_lines) { goto linerr; } } else { lingptr->lin_foot = 0; } if (lingptr->lattop) { lingptr->lin_top = cob_get_int (lingptr->lattop); if (lingptr->lin_top < 0) { goto linerr; } } else { lingptr->lin_top = 0; } if (lingptr->latbot) { lingptr->lin_bot = cob_get_int (lingptr->latbot); if (lingptr->lin_bot < 0) { goto linerr; } } else { lingptr->lin_bot = 0; } return 0; linerr: cob_set_int (lingptr->linage_ctr, 0); return 1; } static int dummy_rnxt_del (cob_file *f) { return COB_STATUS_91_NOT_AVAILABLE; } static int dummy_rewrite (cob_file *f, const int opt) { return COB_STATUS_91_NOT_AVAILABLE; } static int dummy_read (cob_file *f, cob_field *key, const int read_opts) { return COB_STATUS_91_NOT_AVAILABLE; } static int dummy_start (cob_file *f, const int cond, cob_field *key) { return COB_STATUS_91_NOT_AVAILABLE; } static int COB_NOINLINE cob_file_open (cob_file *f, char *filename, const int mode, const int sharing) { FILE *fp = NULL; struct linage_struct *lingptr; #ifdef HAVE_FCNTL int ret; struct flock lock; #endif /* open the file */ switch (mode) { case COB_OPEN_INPUT: #if !defined(_WIN32) || defined(_MSC_VER) if (f->organization == COB_ORG_LINE_SEQUENTIAL) fp = fopen (filename, "r"); else #endif fp = fopen (filename, "rb"); break; case COB_OPEN_OUTPUT: if (f->organization == COB_ORG_RELATIVE) fp = fopen (filename, "wb+"); #if !defined(_WIN32) || defined(_MSC_VER) else if (f->organization == COB_ORG_LINE_SEQUENTIAL) fp = fopen (filename, "w"); #endif else fp = fopen (filename, "wb"); break; case COB_OPEN_I_O: #if !defined(_WIN32) || defined(_MSC_VER) if (f->organization == COB_ORG_LINE_SEQUENTIAL) fp = fopen (filename, "r+"); else #endif fp = fopen (filename, "rb+"); break; case COB_OPEN_EXTEND: #if !defined(_WIN32) || defined(_MSC_VER) if (f->organization == COB_ORG_LINE_SEQUENTIAL) fp = fopen (filename, "a+"); else #endif fp = fopen (filename, "ab+"); break; } if (fp == NULL) { return errno; } if (mode == COB_OPEN_EXTEND) { fseek (fp, (off_t) 0, SEEK_END); } #ifdef HAVE_FCNTL /* lock the file */ if (memcmp (filename, "/dev/", 5)) { memset ((unsigned char *)&lock, 0, sizeof (struct flock)); lock.l_type = (sharing || mode == COB_OPEN_OUTPUT) ? F_WRLCK : F_RDLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; if (fcntl (fileno (fp), F_SETLK, &lock) < 0) { ret = errno; fclose (fp); return ret; } } #endif f->file = fp; if (unlikely(f->flag_select_features & COB_SELECT_LINAGE)) { if (file_linage_check (f)) { return COB_LINAGE_INVALID; } f->flag_needs_top = 1; lingptr = (struct linage_struct *)(f->linorkeyptr); cob_set_int (lingptr->linage_ctr, 1); } return 0; } static int COB_NOINLINE cob_file_close (cob_file *f, const int opt) { #ifdef HAVE_FCNTL struct flock lock; #endif switch (opt) { case COB_CLOSE_NORMAL: case COB_CLOSE_LOCK: case COB_CLOSE_NO_REWIND: if (f->organization == COB_ORG_LINE_SEQUENTIAL) { if (f->flag_needs_nl && !(f->flag_select_features & COB_SELECT_LINAGE)) { f->flag_needs_nl = 0; putc ('\n', (FILE *)f->file); } } #ifdef HAVE_FCNTL /* unlock the file */ memset ((unsigned char *)&lock, 0, sizeof (struct flock)); lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; fcntl (fileno ((FILE *)f->file), F_SETLK, &lock); #endif /* close the file */ fclose ((FILE *)f->file); if (opt == COB_CLOSE_NO_REWIND) { f->open_mode = COB_OPEN_CLOSED; return COB_STATUS_07_SUCCESS_NO_UNIT; } return COB_STATUS_00_SUCCESS; default: fflush ((FILE *)f->file); return COB_STATUS_07_SUCCESS_NO_UNIT; } } static int COB_NOINLINE cob_linage_write_opt (cob_file *f, const int opt) { struct linage_struct *lingptr; int i, n; lingptr = (struct linage_struct *)(f->linorkeyptr); if (unlikely(opt & COB_WRITE_PAGE)) { i = cob_get_int (lingptr->linage_ctr); if (i == 0) { return COB_STATUS_57_I_O_LINAGE; } n = lingptr->lin_lines; for (; i < n; i++) { putc ('\n', (FILE *)f->file); } for (i = 0; i < lingptr->lin_bot; i++) { putc ('\n', (FILE *)f->file); } if (file_linage_check (f)) { return COB_STATUS_57_I_O_LINAGE; } for (i = 0; i < lingptr->lin_top; i++) { putc ('\n', (FILE *)f->file); } cob_set_int (lingptr->linage_ctr, 1); } else if (opt & COB_WRITE_LINES) { n = cob_get_int (lingptr->linage_ctr); if (n == 0) { return COB_STATUS_57_I_O_LINAGE; } cob_add_int (lingptr->linage_ctr, opt & COB_WRITE_MASK); i = cob_get_int (lingptr->linage_ctr); if ((opt & COB_WRITE_EOP) && lingptr->lin_foot) { if (i >= lingptr->lin_foot) { eop_status = 1; } } if (i > lingptr->lin_lines) { if (opt & COB_WRITE_EOP) { eop_status = 1; } for (; n < lingptr->lin_lines; n++) { putc ('\n', (FILE *)f->file); } for (i = 0; i < lingptr->lin_bot; i++) { putc ('\n', (FILE *)f->file); } if (file_linage_check (f)) { return COB_STATUS_57_I_O_LINAGE; } cob_set_int (lingptr->linage_ctr, 1); for (i = 0; i < lingptr->lin_top; i++) { putc ('\n', (FILE *)f->file); } } else { for (i = (opt & COB_WRITE_MASK) - 1; i > 0; i--) putc ('\n', (FILE *)f->file); } } return 0; } static int cob_file_write_opt (cob_file *f, const int opt) { int i; if (unlikely(f->flag_select_features & COB_SELECT_LINAGE)) { return cob_linage_write_opt (f, opt); } if (opt & COB_WRITE_LINES) { for (i = opt & COB_WRITE_MASK; i > 0; i--) putc ('\n', (FILE *)f->file); } else if (opt & COB_WRITE_PAGE) { putc ('\f', (FILE *)f->file); } return 0; } /* * SEQUENTIAL */ static int sequential_read (cob_file *f, const int read_opts) { size_t bytesread; #if WITH_VARSEQ == 0 || WITH_VARSEQ == 1 || WITH_VARSEQ == 3 union { unsigned char sbuff[4]; unsigned short sshort[2]; unsigned int sint; } recsize; #endif #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_sequential_read (f, read_opts); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ SEEK_INIT (f); /* read the record size */ if (f->record_min != f->record_max) { #if WITH_VARSEQ == 2 if (unlikely(fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1)) { #elif WITH_VARSEQ == 3 if (unlikely(fread (recsize.sbuff, 2, 1, (FILE *)f->file) != 1)) { #else if (unlikely(fread (recsize.sbuff, 4, 1, (FILE *)f->file) != 1)) { #endif if (ferror ((FILE *)f->file)) { return COB_STATUS_30_PERMANENT_ERROR; } else { return COB_STATUS_10_END_OF_FILE; } } #if WITH_VARSEQ == 0 || WITH_VARSEQ == 3 #ifdef WORDS_BIGENDIAN f->record->size = recsize.sshort[0]; #else f->record->size = COB_BSWAP_16 (recsize.sshort[0]); #endif #elif WITH_VARSEQ == 1 #ifdef WORDS_BIGENDIAN f->record->size = recsize.sint; #else f->record->size = COB_BSWAP_32 (recsize.sint); #endif #endif } /* read the record */ bytesread = fread (f->record->data, 1, f->record->size, (FILE *)f->file); if (unlikely(bytesread != f->record->size)) { if (ferror ((FILE *)f->file)) { return COB_STATUS_30_PERMANENT_ERROR; } else if (bytesread == 0) { return COB_STATUS_10_END_OF_FILE; } else { return COB_STATUS_04_SUCCESS_INCOMPLETE; } } return COB_STATUS_00_SUCCESS; } static int sequential_write (cob_file *f, const int opt) { int ret; #if WITH_VARSEQ == 0 || WITH_VARSEQ == 1 || WITH_VARSEQ == 3 union { unsigned char sbuff[4]; unsigned short sshort[2]; unsigned int sint; } recsize; #endif #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_sequential_write (f, opt); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ SEEK_INIT (f); /* WRITE AFTER */ if (opt & COB_WRITE_AFTER) { ret = cob_file_write_opt (f, opt); if (ret) { return ret; } f->flag_needs_nl = 1; } /* write the record size */ if (f->record_min != f->record_max) { #if WITH_VARSEQ == 2 if (unlikely(fwrite (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1)) { #else /* VARSEQ 0, 1, 3 */ #if WITH_VARSEQ == 1 #ifdef WORDS_BIGENDIAN recsize.sint = f->record->size; #else recsize.sint = COB_BSWAP_32 ((unsigned int)f->record->size); #endif #else /* VARSEQ 0, 3 */ recsize.sint = 0; #ifdef WORDS_BIGENDIAN recsize.sshort[0] = f->record->size; #else recsize.sshort[0] = COB_BSWAP_16 ((unsigned short)f->record->size); #endif #endif /* VARSEQ 0, 3 */ #if WITH_VARSEQ == 3 if (unlikely(fwrite (recsize.sbuff, 2, 1, (FILE *)f->file) != 1)) { #else if (unlikely(fwrite (recsize.sbuff, 4, 1, (FILE *)f->file) != 1)) { #endif /* VARSEQ 3 */ #endif /* VARSEQ 0, 1, 3 */ return COB_STATUS_30_PERMANENT_ERROR; } } /* write the record */ if (unlikely(fwrite (f->record->data, f->record->size, 1, (FILE *)f->file) != 1)) { return COB_STATUS_30_PERMANENT_ERROR; } /* WRITE BEFORE */ if (opt & COB_WRITE_BEFORE) { ret = cob_file_write_opt (f, opt); if (ret) { return ret; } f->flag_needs_nl = 0; } return COB_STATUS_00_SUCCESS; } static int sequential_rewrite (cob_file *f, const int opt) { #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_sequential_rewrite (f, opt); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ if (fseek ((FILE *)f->file, -(off_t) f->record->size, SEEK_CUR)) { return COB_STATUS_30_PERMANENT_ERROR; } if (fwrite (f->record->data, f->record->size, 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } return COB_STATUS_00_SUCCESS; } /* * LINE SEQUENTIAL */ static int lineseq_read (cob_file *f, const int read_opts) { unsigned char *dataptr; size_t i = 0; int n; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_sequential_read (f, read_opts); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ dataptr = f->record->data; for (; ;) { n = getc ((FILE *)f->file); if (unlikely(n == EOF)) { if (!i) { return COB_STATUS_10_END_OF_FILE; } else { break; } } if (unlikely(n == 0 && cob_ls_nulls != NULL)) { n = getc ((FILE *)f->file); if (n == EOF) { return COB_STATUS_30_PERMANENT_ERROR; } } else { if (n == '\r') { continue; } if (n == '\n') { break; } } if (likely(i < f->record->size)) { *dataptr++ = n; i++; } } if (i < f->record->size) { /* fill the record with spaces */ memset ((unsigned char *)f->record->data + i, ' ', f->record->size - i); } if (f->record_size) { cob_set_int (f->record_size, (int)i); } return COB_STATUS_00_SUCCESS; } static int lineseq_write (cob_file *f, const int opt) { unsigned char *p; struct linage_struct *lingptr; size_t size; int i; int ret; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_sequential_write (f, opt); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ /* RXW if (opt == 0) { opt = COB_WRITE_BEFORE | COB_WRITE_LINES | 1; } */ /* determine the size to be written */ if (unlikely(cob_ls_fixed != NULL)) { size = f->record->size; } else { for (i = (int)f->record->size - 1; i >= 0; i--) { if (f->record->data[i] != ' ') { break; } } size = i + 1; } if (unlikely(f->flag_select_features & COB_SELECT_LINAGE)) { if (f->flag_needs_top) { f->flag_needs_top = 0; lingptr = (struct linage_struct *)(f->linorkeyptr); for (i = 0; i < lingptr->lin_top; i++) { putc ('\n', (FILE *)f->file); } } } /* WRITE AFTER */ if (opt & COB_WRITE_AFTER) { ret = cob_file_write_opt (f, opt); if (ret) { return ret; } f->flag_needs_nl = 1; } /* write to the file */ if (size) { if (unlikely(cob_ls_nulls != NULL)) { p = f->record->data; for (i = 0; i < (int)size; i++, p++) { if (*p < ' ') { putc (0, (FILE *)f->file); } putc ((int)(*p), (FILE *)f->file); } } else { if (unlikely(fwrite (f->record->data, size, 1, (FILE *)f->file) != 1)) { return COB_STATUS_30_PERMANENT_ERROR; } } } if (unlikely(f->flag_select_features & COB_SELECT_LINAGE)) { putc ('\n', (FILE *)f->file); } /* WRITE BEFORE */ if (opt & COB_WRITE_BEFORE) { ret = cob_file_write_opt (f, opt); if (ret) { return ret; } f->flag_needs_nl = 0; } if (unlikely(eop_status)) { eop_status = 0; cob_exception_code = 0x0502; return COB_STATUS_52_EOP; } return COB_STATUS_00_SUCCESS; } /* * RELATIVE */ static int relative_start (cob_file *f, const int cond, cob_field *k) { int kindex; size_t relsize; off_t off; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_start (f, cond, k); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ /* get the index */ kindex = cob_get_int (k) - 1; relsize = f->record_max + sizeof (f->record->size); if (cond == COB_LT) { kindex--; } else if (cond == COB_GT) { kindex++; } /* seek the index */ while (1) { off = kindex * relsize; if (fseek ((FILE *)f->file, off, SEEK_SET) != 0 || fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_23_KEY_NOT_EXISTS; } /* check if a valid record */ if (f->record->size > 0) { cob_set_int (k, kindex + 1); fseek ((FILE *)f->file, - (off_t) sizeof (f->record->size), SEEK_CUR); return COB_STATUS_00_SUCCESS; } /* continue */ switch (cond) { case COB_EQ: return COB_STATUS_23_KEY_NOT_EXISTS; case COB_LT: case COB_LE: kindex--; break; case COB_GT: case COB_GE: kindex++; break; } } } static int relative_read (cob_file *f, cob_field *k, const int read_opts) { int relnum; size_t relsize; off_t off; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_read (f, k, read_opts); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ SEEK_INIT (f); relnum = cob_get_int (k) - 1; relsize = f->record_max + sizeof (f->record->size); off = relnum * relsize; if (fseek ((FILE *)f->file, off, SEEK_SET) != 0 || fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_23_KEY_NOT_EXISTS; } if (f->record->size == 0) { fseek ((FILE *)f->file, - (off_t) sizeof (f->record->size), SEEK_CUR); return COB_STATUS_23_KEY_NOT_EXISTS; } if (fread (f->record->data, f->record_max, 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } return COB_STATUS_00_SUCCESS; } static int relative_read_next (cob_file *f, const int read_opts) { off_t off; size_t relsize; int relnum; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_read_next (f, read_opts); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ SEEK_INIT (f); relsize = f->record_max + sizeof (f->record->size); while (1) { if (fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { if (ferror ((FILE *)f->file)) { return COB_STATUS_30_PERMANENT_ERROR; } else { return COB_STATUS_10_END_OF_FILE; } } if (f->keys[0].field) { if (f->flag_first_read) { cob_set_int (f->keys[0].field, 1); f->flag_first_read = 0; } else { off = ftell ((FILE *)f->file); relnum = (int)((off / relsize) + 1); cob_set_int (f->keys[0].field, 0); if (cob_add_int (f->keys[0].field, relnum) != 0) { fseek ((FILE *)f->file, -(off_t) sizeof (f->record->size), SEEK_CUR); return COB_STATUS_14_OUT_OF_KEY_RANGE; } } } if (f->record->size > 0) { if (fread (f->record->data, f->record_max, 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } return COB_STATUS_00_SUCCESS; } fseek ((FILE *)f->file, (off_t) f->record_max, SEEK_CUR); } } static int relative_write (cob_file *f, const int opt) { size_t size; size_t relsize; int i; int kindex; off_t off; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_write (f, opt); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ SEEK_INIT (f); relsize = f->record_max + sizeof (f->record->size); if (f->access_mode != COB_ACCESS_SEQUENTIAL) { kindex = cob_get_int (f->keys[0].field) - 1; if (kindex < 0) { return COB_STATUS_21_KEY_INVALID; } off = (off_t) (relsize * kindex); if (fseek ((FILE *)f->file, off, SEEK_SET) != 0) { return COB_STATUS_21_KEY_INVALID; } } else { off = ftell ((FILE *)f->file); } if (fread (&size, sizeof (size), 1, (FILE *)f->file) > 0) { fseek ((FILE *)f->file, -(off_t) sizeof (size), SEEK_CUR); if (size > 0) { return COB_STATUS_22_KEY_EXISTS; } } else { fseek ((FILE *)f->file, off, SEEK_SET); } if (fwrite (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } if (fwrite (f->record->data, f->record_max, 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } /* update RELATIVE KEY */ if (f->access_mode == COB_ACCESS_SEQUENTIAL) { if (f->keys[0].field) { /* off = ftell ((FILE *)f->file); */ off += relsize; i = (int)(off / relsize); cob_set_int (f->keys[0].field, i); } } return COB_STATUS_00_SUCCESS; } static int relative_rewrite (cob_file *f, const int opt) { size_t relsize; int relnum; off_t off; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_rewrite (f, opt); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ if (f->access_mode == COB_ACCESS_SEQUENTIAL) { fseek ((FILE *)f->file, -(off_t) f->record_max, SEEK_CUR); } else { relsize = f->record_max + sizeof (f->record->size); relnum = cob_get_int (f->keys[0].field) - 1; off = relnum * relsize; if (fseek ((FILE *)f->file, off, SEEK_SET) != 0 || fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_23_KEY_NOT_EXISTS; } SEEK_INIT (f); } if (fwrite (f->record->data, f->record_max, 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } return COB_STATUS_00_SUCCESS; } static int relative_delete (cob_file *f) { size_t relsize; int relnum; off_t off; #ifdef WITH_SEQRA_EXTFH int extfh_ret; extfh_ret = extfh_relative_delete (f); if (extfh_ret != COB_NOT_CONFIGURED) { return extfh_ret; } #endif /* WITH_SEQRA_EXTFH */ relnum = cob_get_int (f->keys[0].field) - 1; relsize = f->record_max + sizeof (f->record->size); off = relnum * relsize; if (fseek ((FILE *)f->file, off, SEEK_SET) != 0 || fread (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_23_KEY_NOT_EXISTS; } fseek ((FILE *)f->file, - (off_t) sizeof (f->record->size), SEEK_CUR); f->record->size = 0; if (fwrite (&f->record->size, sizeof (f->record->size), 1, (FILE *)f->file) != 1) { return COB_STATUS_30_PERMANENT_ERROR; } fseek ((FILE *)f->file, (off_t) f->record_max, SEEK_CUR); return COB_STATUS_00_SUCCESS; } /* * INDEXED */ #if defined(WITH_DB) || defined(WITH_INDEX_EXTFH) || defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) #ifdef USE_DB41 static void join_environment (void) { int flags, ret; if (bdb_home == NULL) { return; } ret = db_env_create (&bdb_env, 0); if (ret) { cob_runtime_error ("Can't join BDB environment, env_create: %d %s\n", ret, db_strerror (ret)); cob_stop_run (1); } bdb_env->set_errfile (bdb_env, stderr); #if (DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR > 2)) bdb_env->set_msgfile (bdb_env, stderr); #endif bdb_env->set_cachesize (bdb_env, 0, 2*1024*1024, 0); bdb_env->set_alloc (bdb_env, cob_malloc, realloc, free); flags = DB_CREATE | DB_INIT_MPOOL | DB_INIT_CDB; ret = bdb_env->open (bdb_env, bdb_home, flags, 0); if (ret) { cob_runtime_error ("Can't join BDB environment, env_open: %d %s\n", ret, db_strerror (ret)); bdb_env->close (bdb_env, 0); bdb_env = NULL; cob_stop_run (1); } #if (DB_VERSION_MAJOR > 4) || ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR > 1)) bdb_env->get_data_dirs (bdb_env, &bdb_data_dir); #endif bdb_env->lock_id (bdb_env, &bdb_lock_id); } static int lock_record (cob_file *f, char *key, const unsigned int keylen) { struct indexed_file *p = f->file; size_t len; int ret; DBT dbt; len = keylen + p->filenamelen + 1; if (len > rlo_size) { free (record_lock_object); record_lock_object = cob_malloc (len); rlo_size = len; } memcpy ((char *)record_lock_object, p->filename, (size_t)(p->filenamelen + 1)); memcpy ((char *)record_lock_object + p->filenamelen + 1, key, (size_t)keylen); dbt.size = (cob_dbtsize_t) len; dbt.data = record_lock_object; ret = bdb_env->lock_get (bdb_env, p->bdb_lock_id, DB_LOCK_NOWAIT, &dbt, DB_LOCK_WRITE, &p->bdb_record_lock); if (!ret) { p->record_locked = 1; } return ret; } static int test_record_lock (cob_file *f, char *key, const unsigned int keylen) { struct indexed_file *p = f->file; size_t len; int ret; DBT dbt; DB_LOCK test_lock; len = keylen + p->filenamelen + 1; if (len > rlo_size) { free (record_lock_object); record_lock_object = cob_malloc (len); rlo_size = len; } memcpy ((char *)record_lock_object, p->filename, (size_t)(p->filenamelen + 1)); memcpy ((char *)record_lock_object + p->filenamelen + 1, key, (size_t)keylen); dbt.size = (cob_dbtsize_t) len; dbt.data = record_lock_object; ret = bdb_env->lock_get (bdb_env, p->bdb_lock_id, DB_LOCK_NOWAIT, &dbt, DB_LOCK_WRITE, &test_lock); if (!ret) { bdb_env->lock_put (bdb_env, &test_lock); } return ret; } static int unlock_record (cob_file *f) { struct indexed_file *p = f->file; int ret; if (p->record_locked == 0) { return 0; } ret = bdb_env->lock_put (bdb_env, &p->bdb_record_lock); p->record_locked = 0; return ret; } #endif /* USE_DB41 */ /* OPEN the INDEXED file */ static int indexed_open (cob_file *f, char *filename, const int mode, const int sharing) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_open (f, filename, mode, sharing); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh; int ret = COB_STATUS_00_SUCCESS; int omode = 0; int lmode = 0; int vmode = 0; int dobld = 0; int isfd = -1; int k; struct dictinfo di; /* defined in (c|d|vb)isam.h */ #if defined(ISVARLEN) if (f->record_min != f->record_max) { vmode = ISVARLEN; isreclen = f->record_min; } #endif if (!f->lock_mode) { if (mode != COB_OPEN_INPUT) { lmode = ISEXCLLOCK; } else { lmode = ISMANULOCK; } } else if ((f->lock_mode & COB_LOCK_EXCLUSIVE)) { lmode = ISEXCLLOCK; } else if ((f->lock_mode & COB_LOCK_AUTOMATIC) && mode != COB_OPEN_INPUT) { lmode = ISAUTOLOCK; } else { lmode = ISMANULOCK; } switch (mode) { case COB_OPEN_INPUT: omode = ISINPUT; break; case COB_OPEN_OUTPUT: lmode = ISEXCLLOCK; omode = ISOUTPUT; iserrno = 0; isfd = isopen (filename, ISINPUT | ISEXCLLOCK | vmode); if (iserrno == EFLOCKED) { #ifdef WITH_VBISAM isfullclose (isfd); #else isclose (isfd); #endif return COB_STATUS_61_FILE_SHARING; } else { if (isfd >= 0) { #ifdef WITH_VBISAM isfullclose (isfd); #else isclose (isfd); #endif } iserase (filename); } iserrno = 0; dobld = 1; break; case COB_OPEN_I_O: omode = ISINOUT; break; case COB_OPEN_EXTEND: lmode = ISEXCLLOCK; omode = ISINOUT; break; case COB_OPEN_LOCKED: lmode = ISEXCLLOCK; omode = ISINOUT; break; } fh = cob_malloc (sizeof(struct indexfile) + ((sizeof (struct keydesc)) * (f->nkeys + 1))); /* Copy index information */ for (k = 0; k < f->nkeys; k++) { memset (&fh->key[k], 0, sizeof(struct keydesc)); fh->key[k].k_flags = f->keys[k].flag ? ISDUPS : ISNODUPS; fh->key[k].k_nparts = 1; /* Single field key */ fh->key[k].k_start = f->keys[k].offset; fh->key[k].k_leng = f->keys[k].field->size; if (fh->lenkey < fh->key[k].k_leng) { fh->lenkey = fh->key[k].k_leng; } fh->key[k].k_type = CHARTYPE; } iserrno = 0; fh->lmode = 0; if (dobld) { dobuild: isfd = isbuild (filename, f->record_max, &fh->key[0], ISINOUT | ISEXCLLOCK | vmode); } else { if (lmode == ISAUTOLOCK) { fh->lmode = ISLOCK; lmode = ISMANULOCK; } isfd = isopen (filename, omode | lmode | vmode); if (isfd == -1) { if (f->flag_optional) { if (mode == COB_OPEN_EXTEND || mode == COB_OPEN_I_O) { dobld = 1; ret = COB_STATUS_05_SUCCESS_OPTIONAL; goto dobuild; } f->file = fh; f->open_mode = mode; fh->isfd = isfd; fh->filename = strdup (filename); /* Active index is unknown at this time */ fh->curkey = -1; f->flag_end_of_file = 1; f->flag_begin_of_file = 1; if (f->flag_nonexistent) { return COB_STATUS_00_SUCCESS; } f->flag_nonexistent = 1; return COB_STATUS_05_SUCCESS_OPTIONAL; } } else { memset(&di, 0, sizeof(di)); isindexinfo (isfd, (void *)&di, 0); fh->nkeys = di.di_nkeys & 0x7F; /* Mask off ISVARLEN */ if (fh->nkeys > f->nkeys) { fh = realloc (fh, sizeof(struct indexfile) + ((sizeof (struct keydesc)) * (fh->nkeys + 1))); } for (k = 0; k < fh->nkeys; k++) { memset (&fh->key[k], 0, sizeof(struct keydesc)); isindexinfo (isfd, &fh->key[k], k+1); if (fh->lenkey < fh->key[k].k_leng) { fh->lenkey = fh->key[k].k_leng; } /* Verify that COBOL definition matches the real ISAM file */ if (f->keys[k].flag) { if (!(fh->key[k].k_flags & ISDUPS)) { ret = COB_STATUS_39_CONFLICT_ATTRIBUTE; } } else { if (fh->key[k].k_flags & ISDUPS) { ret = COB_STATUS_39_CONFLICT_ATTRIBUTE; } } if (fh->key[k].k_nparts != 1 || fh->key[k].k_start != f->keys[k].offset || fh->key[k].k_leng != f->keys[k].field->size) { ret = COB_STATUS_39_CONFLICT_ATTRIBUTE; } } } } if (isfd == -1) { ret = isretsts (COB_STATUS_35_NOT_EXISTS); freefh (fh); return ret; } if (ret > 9) { #ifdef WITH_VBISAM isfullclose (isfd); #else isclose (isfd); #endif freefh (fh); return ret; } if (dobld) { for (k = 1; k < f->nkeys; k++) { iserrno = 0; if (isaddindex (isfd, &fh->key[k]) == -1) { ret = COB_STATUS_39_CONFLICT_ATTRIBUTE; } } if (ret > 9) { #ifdef WITH_VBISAM isfullclose (isfd); #else isclose (isfd); #endif iserase (filename); freefh (fh); return ret; } } f->file = fh; f->open_mode = mode; fh->isfd = isfd; fh->filename = strdup (filename); fh->savekey = cob_malloc (fh->lenkey + 1); fh->recwrk = cob_malloc (f->record_max + 1); fh->curkey = -1; /* Active index is unknown at this time */ f->flag_nonexistent = 0; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; return ret; #else /* WITH_INDEX_EXTFH */ size_t i, j; #ifdef USE_DB41 int flags = 0; int lock_mode; int handle_created; #else int flags = INITIAL_FLAGS; BTREEINFO info; #endif int ret = 0; struct indexed_file *p; size_t maxsize; p = cob_malloc (sizeof (struct indexed_file)); #ifdef USE_DB41 if (bdb_env != NULL) { if (mode == COB_OPEN_OUTPUT || mode == COB_OPEN_EXTEND || (f->lock_mode & COB_LOCK_EXCLUSIVE) || (mode == COB_OPEN_I_O && !f->lock_mode)) { lock_mode = DB_LOCK_WRITE; } else { lock_mode = DB_LOCK_READ; } p->key.size = (cob_dbtsize_t) strlen (filename); p->key.data = filename; ret = bdb_env->lock_get (bdb_env, bdb_lock_id, DB_LOCK_NOWAIT, &p->key, lock_mode, &p->bdb_file_lock); if (ret) { free (p); if (ret == DB_LOCK_NOTGRANTED) { ret = COB_STATUS_61_FILE_SHARING; } return ret; } } #endif switch (mode) { case COB_OPEN_INPUT: #ifdef USE_DB41 flags |= DB_RDONLY; #else flags |= O_RDONLY; #endif break; case COB_OPEN_OUTPUT: #ifdef USE_DB41 flags |= DB_CREATE; #else flags |= O_RDWR | O_CREAT | O_TRUNC; #endif break; case COB_OPEN_I_O: case COB_OPEN_EXTEND: #ifdef USE_DB41 flags |= DB_CREATE; #else flags |= O_RDWR | O_CREAT; #endif break; } p->db = cob_malloc (sizeof (DB *) * f->nkeys); #ifdef USE_DB41 p->cursor = cob_malloc (sizeof (DBC *) * f->nkeys); p->filenamelen = (int) strlen (filename); #endif p->last_readkey = cob_malloc (sizeof (unsigned char *) * 2 * f->nkeys); p->last_dupno = cob_malloc (sizeof (unsigned int) * f->nkeys); p->rewrite_sec_key = cob_malloc (sizeof (int) * f->nkeys); maxsize = 0; for (i = 0; i < f->nkeys; i++) { if (f->keys[i].field->size > maxsize) { maxsize = f->keys[i].field->size; } } for (i = 0; i < f->nkeys; i++) { /* file name */ memset (runtime_buffer, 0, COB_SMALL_BUFF); if (i == 0) { strncpy (runtime_buffer, filename, COB_SMALL_MAX); } else { snprintf (runtime_buffer, COB_SMALL_MAX, "%s.%d", filename, (int)i); } /* btree info */ #ifdef USE_DB41 ret = db_create (&p->db[i], bdb_env, 0); if (!ret) { handle_created = 1; if (mode == COB_OPEN_OUTPUT) { if (bdb_env) { bdb_env->dbremove (bdb_env, NULL, runtime_buffer, NULL, 0); } else { p->db[i]->remove (p->db[i], runtime_buffer, NULL, 0); ret = db_create (&p->db[i], bdb_env, 0); } } if (!ret) { if (f->keys[i].flag) { p->db[i]->set_flags (p->db[i], DB_DUP); } } } else { handle_created = 0; } #else memset ((unsigned char *)&info, 0, sizeof (info)); if (f->keys[i].flag) { info.flags = R_DUP; } #endif /* open db */ #ifdef USE_DB41 if (!ret) { ret = p->db[i]->open (p->db[i], NULL, runtime_buffer, NULL, DB_BTREE, flags, COB_FILE_MODE); } #else p->db[i] = dbopen (runtime_buffer, flags, COB_FILE_MODE, DB_BTREE, &info); if (p->db[i] == 0) { ret = errno; } #endif if (ret) { for (j = 0; j < i; j++) { DB_CLOSE (p->db[j]); } #ifdef USE_DB41 if (handle_created) { DB_CLOSE (p->db[i]); } #endif free (p->db); free (p->last_readkey); free (p->last_dupno); #ifdef USE_DB41 free (p->cursor); if (bdb_env != NULL) { bdb_env->lock_put (bdb_env, &p->bdb_file_lock); } #endif free (p); return ret; } p->last_readkey[i] = cob_malloc (maxsize); p->last_readkey[f->nkeys + i] = cob_malloc (maxsize); } p->temp_key = cob_malloc (maxsize + sizeof(unsigned int)); f->file = p; p->key_index = 0; p->last_key = NULL; memset ((unsigned char *)&p->key, 0, sizeof (DBT)); memset ((unsigned char *)&p->data, 0, sizeof (DBT)); #ifdef USE_DB41 p->filename = cob_malloc (strlen (filename) + 1); strcpy (p->filename, filename); p->write_cursor_open = 0; p->record_locked = 0; if (bdb_env != NULL) { bdb_env->lock_id (bdb_env, &p->bdb_lock_id); } DBT_SET (p->key, f->keys[0].field); p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], 0); ret = DB_SEQ (p->cursor[0], DB_FIRST); p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; #else ret = DB_SEQ (p->db[p->key_index], R_FIRST); #endif if (!ret) { memcpy (p->last_readkey[0], p->key.data, p->key.size); } else { p->data.data = NULL; } return 0; #endif /* WITH_INDEX_EXTFH */ } /* Close the INDEXED file */ static int indexed_close (cob_file *f, const int opt) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_close (f, opt); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; if (fh == NULL) { return COB_STATUS_00_SUCCESS; } if (fh->isfd >= 0) { #ifdef WITH_VBISAM isfullclose (fh->isfd); #else isclose (fh->isfd); #endif } freefh (fh); f->file = NULL; return COB_STATUS_00_SUCCESS; #else /* WITH_INDEX_EXTFH */ struct indexed_file *p = f->file; int i; /* close DB's */ #ifdef USE_DB41 for (i = 0; i < (int)f->nkeys; i++) { if (p->cursor[i]) { p->cursor[i]->c_close (p->cursor[i]); } } #endif for (i = f->nkeys - 1; i >= 0; i--) { if (p->db[i]) { DB_CLOSE (p->db[i]); } free (p->last_readkey[i]); free (p->last_readkey[f->nkeys + i]); } if (p->last_key) { free (p->last_key); } free (p->temp_key); free (p->db); free (p->last_readkey); free (p->last_dupno); free (p->rewrite_sec_key); #ifdef USE_DB41 free (p->filename); free (p->cursor); if (bdb_env != NULL) { unlock_record (f); bdb_env->lock_put (bdb_env, &p->bdb_file_lock); bdb_env->lock_id_free (bdb_env, p->bdb_lock_id); } #endif free (p); return COB_STATUS_00_SUCCESS; #endif /* WITH_INDEX_EXTFH */ } #if !defined(WITH_INDEX_EXTFH) && !defined(WITH_CISAM) && !defined(WITH_DISAM) && !defined(WITH_VBISAM) static int indexed_start_internal (cob_file *f, const int cond, cob_field *key, const int read_opts, const int test_lock) { int ret; unsigned int dupno; struct indexed_file *p = f->file; /* look up for the key */ for (p->key_index = 0; p->key_index < f->nkeys; p->key_index++) { if (f->keys[p->key_index].field->data == key->data) { break; } } /* RXW - Removed if (unlikely(p->key_index == f->nkeys)) { cob_runtime_error ("cob_start_indexed: key not found " "(should have been detected by cobc)"); return 99; } */ /* search */ DBT_SET (p->key, key); #ifdef USE_DB41 /* the open cursor makes this function atomic */ if (p->key_index != 0) { p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], 0); } p->db[p->key_index]->cursor (p->db[p->key_index], NULL, &p->cursor[p->key_index], 0); ret = DB_SEQ (p->cursor[p->key_index], DB_SET_RANGE); #else ret = DB_SEQ (p->db[p->key_index], R_CURSOR); #endif switch (cond) { case COB_EQ: if (ret == 0) { ret = memcmp (p->key.data, key->data, key->size); } break; case COB_LT: if (ret != 0) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_LAST); #else ret = DB_SEQ (p->db[p->key_index], R_LAST); #endif } else { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_PREV); #else ret = DB_SEQ (p->db[p->key_index], R_PREV); #endif } break; case COB_LE: if (ret != 0) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_LAST); #else ret = DB_SEQ (p->db[p->key_index], R_LAST); #endif } else if (memcmp (p->key.data, key->data, key->size) != 0) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_PREV); #else ret = DB_SEQ (p->db[p->key_index], R_PREV); #endif } else if (f->keys[p->key_index].flag) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_NEXT_NODUP); #else while (!ret && memcmp (p->key.data, key->data, key->size) == 0) { ret = DB_SEQ (p->db[p->key_index], R_NEXT); } #endif if (ret != 0) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_LAST); #else ret = DB_SEQ (p->db[p->key_index], R_LAST); #endif } else { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_PREV); #else ret = DB_SEQ (p->db[p->key_index], R_PREV); #endif } } break; case COB_GT: while (ret == 0 && memcmp (p->key.data, key->data, key->size) == 0) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_NEXT); #else ret = DB_SEQ (p->db[p->key_index], R_NEXT); #endif } break; case COB_GE: /* nothing */ break; } if (ret == 0 && p->key_index > 0) { /* temporarily save alternate key */ memcpy (p->temp_key, p->key.data, f->keys[p->key_index].field->size); if (f->keys[p->key_index].flag) { memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); } p->key.data = p->data.data; p->key.size = f->keys[0].field->size; ret = DB_GET (p->db[0], 0); } #ifdef USE_DB41 if (ret == 0 && test_lock) { if (!(read_opts & COB_READ_IGNORE_LOCK)) { ret = test_record_lock (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } if (read_opts & COB_READ_LOCK) { ret = lock_record (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } } #endif if (ret == 0) { if (p->key_index == 0) { memcpy (p->last_readkey[0], p->key.data, f->keys[0].field->size); } else { memcpy (p->last_readkey[p->key_index], p->temp_key, f->keys[p->key_index].field->size); memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.data, f->keys[0].field->size); if (f->keys[p->key_index].flag) { p->last_dupno[p->key_index] = dupno; } } } #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif return (ret == 0) ? COB_STATUS_00_SUCCESS : COB_STATUS_23_KEY_NOT_EXISTS; } #endif /* WITH_INDEX_EXTFH */ /* START the INDEXED file with positioning */ static int indexed_start (cob_file *f, const int cond, cob_field *key) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_start (f, cond, key); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int k; int mode; int klen; int ret = COB_STATUS_00_SUCCESS; f->flag_read_done = 0; f->flag_first_read = 0; fh->readdone = 0; fh->eofpending = 0; fh->startiscur = 0; fh->wrkhasrec = 0; fh->keyhasdups = 0; if (f->flag_nonexistent) { return COB_STATUS_23_KEY_NOT_EXISTS; } for (k = 0; k < f->nkeys; k++) { if (f->keys[k].field->data == key->data) { if (fh->key[k].k_flags & ISDUPS) { fh->keyhasdups = 1; } break; } } /* Use size of data field; This may indicate a partial key */ klen = key->size; if (klen < 1 || klen > fh->key[k].k_leng) { klen = fh->key[k].k_leng; /* Max key length for this index */ } mode = ISGTEQ; fh->startiscur = 1; switch (cond) { case COB_EQ: mode = ISEQUAL; fh->readdir = ISNEXT; break; case COB_GE: mode = ISGTEQ; fh->readdir = ISNEXT; break; case COB_GT: mode = ISGREAT; fh->readdir = ISNEXT; break; case COB_LE: fh->readdir = ISPREV; mode = ISGTEQ; break; case COB_LT: fh->readdir = ISPREV; mode = ISGTEQ; break; default: return COB_STATUS_21_KEY_INVALID; break; } if ((isstart (fh->isfd, &fh->key[k], klen, (void *)f->record->data, mode)) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); fh->curkey = -1; fh->keyhasdups = 0; fh->startcond = -1; fh->readdir = -1; fh->startiscur = 0; } else { if (ret == COB_STATUS_00_SUCCESS) { fh->startcond = cond; memcpy (fh->savekey, f->record->data + fh->key[k].k_start, fh->key[k].k_leng); fh->curkey = k; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; f->flag_first_read = 1; } else { fh->curkey = -1; fh->keyhasdups = 0; fh->startcond = -1; fh->readdir = -1; } } return ret; #else /* WITH_INDEX_EXTFH */ return indexed_start_internal (f, cond, key, 0, 0); #endif /* WITH_INDEX_EXTFH */ } /* Random READ of the INDEXED file */ static int indexed_read (cob_file *f, cob_field *key, const int read_opts) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_read (f, key, read_opts); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int k; int ret = COB_STATUS_00_SUCCESS; int lmode = 0; fh->eofpending = 0; fh->startiscur = 0; fh->wrkhasrec = 0; if (f->flag_nonexistent) { return COB_STATUS_23_KEY_NOT_EXISTS; } for (k = 0; k < f->nkeys; k++) { if (f->keys[k].field->data == key->data) { break; } } if (fh->curkey != k) { /* Switch to this index */ isstart (fh->isfd, &fh->key[k], fh->key[0].k_leng, (void *)f->record->data, ISEQUAL); fh->curkey = k; fh->wrkhasrec = 0; if (fh->key[k].k_flags & ISDUPS) { fh->keyhasdups = 1; } else { fh->keyhasdups = 0; } } fh->startcond = -1; if (read_opts & COB_READ_LOCK) { lmode = ISLOCK; } else if (read_opts & COB_READ_WAIT_LOCK) { lmode = ISLCKW; } else if ((f->lock_mode & COB_LOCK_AUTOMATIC)) { if (f->open_mode != COB_OPEN_INPUT) { if (!(read_opts & COB_READ_IGNORE_LOCK)) { lmode = ISLOCK; } } } #ifdef ISSKIPLOCK if (read_opts & COB_READ_IGNORE_LOCK) { lmode = ISSKIPLOCK; } #endif iserrno = 0; if ((fh->lmode & ISLOCK) && !(f->lock_mode & COB_LOCK_MULTIPLE)) { isrelease (fh->isfd); } switch (read_opts & 0x0F) { case COB_READ_NEXT: fh->readdir = ISNEXT; if (isread (fh->isfd, (void *)f->record->data, ISNEXT | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); f->flag_end_of_file = 1; } break; case COB_READ_PREVIOUS: fh->readdir = ISPREV; if (isread (fh->isfd, (void *)f->record->data, ISPREV | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); f->flag_begin_of_file = 1; } break; case COB_READ_FIRST: fh->readdir = ISNEXT; if (isread (fh->isfd, (void *)f->record->data, ISFIRST | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } break; case COB_READ_LAST: fh->readdir = ISPREV; if (isread (fh->isfd, (void *)f->record->data, ISLAST | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } break; default: fh->readdir = -1; if (isread (fh->isfd, (void *)f->record->data, ISEQUAL | lmode) == -1) { ret = isretsts (COB_STATUS_21_KEY_INVALID); } break; } if (ret == 0) { f->flag_first_read = 0; f->flag_read_done = 1; fh->readdone = 1; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; memcpy (fh->savekey, f->record->data + fh->key[0].k_start, fh->key[0].k_leng); fh->recnum = isrecnum; #if defined(ISVARLEN) if (f->record_min != f->record_max) { f->record->size = isreclen; } #endif } else { memset (fh->savekey, 0, fh->key[0].k_leng); fh->recnum = 0; fh->readdone = 0; } return ret; #else /* WITH_INDEX_EXTFH */ struct indexed_file *p = f->file; int ret; int test_lock = 0; #ifdef USE_DB41 if (bdb_env != NULL) { unlock_record (f); test_lock = 1; } #endif ret = indexed_start_internal (f, COB_EQ, key, read_opts, test_lock); if (ret != COB_STATUS_00_SUCCESS) { return ret; } f->record->size = p->data.size; memcpy (f->record->data, p->data.data, p->data.size); return COB_STATUS_00_SUCCESS; #endif /* WITH_INDEX_EXTFH */ } /* Sequential READ of the INDEXED file */ static int indexed_read_next (cob_file *f, const int read_opts) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_read_next (f, read_opts); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int ret = COB_STATUS_00_SUCCESS; int lmode = 0; int domoveback; if (f->flag_nonexistent) { if (f->flag_first_read == 0) { return COB_STATUS_23_KEY_NOT_EXISTS; } f->flag_first_read = 0; return COB_STATUS_10_END_OF_FILE; } if (fh->curkey == -1) { /* Switch to this index */ isstart (fh->isfd, &fh->key[0], 0, (void *)f->record->data, ISFIRST); fh->curkey = 0; fh->readdir = ISNEXT; fh->startcond = -1; fh->startiscur = 0; fh->wrkhasrec = 0; fh->keyhasdups = 0; } if (read_opts & COB_READ_LOCK) { lmode = ISLOCK; } else if (read_opts & COB_READ_WAIT_LOCK) { lmode = ISLCKW; } else if ((f->lock_mode & COB_LOCK_AUTOMATIC) && f->open_mode != COB_OPEN_INPUT) { if (!(read_opts & COB_READ_IGNORE_LOCK)) { lmode = ISLOCK; } } #ifdef ISSKIPLOCK if (read_opts & COB_READ_IGNORE_LOCK) { lmode |= ISSKIPLOCK; } #endif if ((fh->lmode & ISLOCK) && !(f->lock_mode & COB_LOCK_MULTIPLE)) { isrelease (fh->isfd); } iserrno = 0; switch (read_opts & 0x0F) { case COB_READ_NEXT: fh->readdir = ISNEXT; if (fh->eofpending == ISNEXT) { fh->eofpending = 0; fh->wrkhasrec = 0; return COB_STATUS_10_END_OF_FILE; } if (fh->startiscur) { if (isread (fh->isfd, (void *)f->record->data, ISCURR) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } else { switch (fh->startcond) { case COB_GE: domoveback = 0; while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) == 0) { isread (fh->isfd, (void *)f->record->data, ISPREV); domoveback = 1; } if (domoveback) { isread (fh->isfd, (void *)f->record->data, iserrno == 0 ? ISNEXT : ISFIRST); } break; case COB_LE: domoveback = 0; while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) == 0) { isread (fh->isfd, (void *)f->record->data, ISNEXT); domoveback = 1; } if (domoveback) { isread (fh->isfd, (void *)f->record->data, iserrno == 0 ? ISPREV : ISLAST); } break; case COB_LT: while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) >= 0) { isread (fh->isfd, (void *)f->record->data, ISPREV); } break; case COB_GT: while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng)<=0) { isread (fh->isfd, (void *)f->record->data, ISNEXT); } break; } if (isread (fh->isfd, (void *)f->record->data, ISCURR | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } fh->startcond = -1; fh->startiscur = 0; } else if (fh->wrkhasrec == ISNEXT) { memcpy (f->record->data, fh->recwrk, f->record_max); if (fh->lmode & ISLOCK) { /* now lock 'peek ahead' record */ if (isread (fh->isfd, (void *)f->record->data, ISCURR | fh->lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } } else { if (fh->wrkhasrec == ISPREV) { isread (fh->isfd, (void *)f->record->data, ISNEXT); fh->wrkhasrec = 0; } if (isread (fh->isfd, (void *)f->record->data, ISNEXT | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } break; case COB_READ_PREVIOUS: fh->readdir = ISPREV; if (fh->eofpending == ISPREV) { fh->eofpending = 0; fh->wrkhasrec = 0; return COB_STATUS_10_END_OF_FILE; } if (fh->startiscur) { if (isread (fh->isfd, (void *)f->record->data, ISCURR | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } else { switch (fh->startcond) { case COB_LE: domoveback = 0; while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) == 0) { isread (fh->isfd, (void *)f->record->data, ISNEXT); domoveback = 1; } if (domoveback) { isread (fh->isfd, (void *)f->record->data, ISPREV); } break; case COB_LT: while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) >= 0) { isread (fh->isfd, (void *)f->record->data, ISPREV); } break; case COB_GT: while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) <= 0) { isread (fh->isfd, (void *)f->record->data, ISNEXT); } break; case COB_GE: while (iserrno == 0 && memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->savekey, fh->key[fh->curkey].k_leng) < 0) { isread (fh->isfd, (void *)f->record->data, ISNEXT); } break; } if (isread (fh->isfd, (void *)f->record->data, ISCURR | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } fh->startcond = -1; fh->startiscur = 0; } else if (fh->wrkhasrec == ISPREV) { memcpy (f->record->data, fh->recwrk, f->record_max); if (fh->lmode & ISLOCK) { /* now lock 'peek ahead' record */ if (isread (fh->isfd, (void *)f->record->data, ISCURR | fh->lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } } else { if (fh->wrkhasrec == ISNEXT) { isread (fh->isfd, (void *)f->record->data, ISPREV); fh->wrkhasrec = 0; } if (isread (fh->isfd, (void *)f->record->data, ISPREV | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } } break; case COB_READ_FIRST: fh->readdir = ISNEXT; if (isread (fh->isfd, (void *)f->record->data, ISFIRST | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } break; case COB_READ_LAST: fh->readdir = ISPREV; if (isread (fh->isfd, (void *)f->record->data, ISLAST | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } break; default: fh->readdir = ISNEXT; if (isread (fh->isfd, (void *)f->record->data, ISNEXT | lmode) == -1) { ret = isretsts (COB_STATUS_10_END_OF_FILE); } break; } if (ret == 0) { fh->eofpending = 0; f->flag_first_read = 0; f->flag_read_done = 1; fh->readdone = 1; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; memcpy (fh->savekey, f->record->data + fh->key[0].k_start, fh->key[0].k_leng); fh->recnum = isrecnum; #if defined(ISVARLEN) if (f->record_min != f->record_max) { f->record->size = isreclen; } #endif #if defined(WITH_COBSTATUS02) if (fh->keyhasdups) { if (isread (fh->isfd, (void *)fh->recwrk, fh->readdir) == -1) { fh->eofpending = fh->readdir; fh->wrkhasrec = 0; fh->saverecnum = -1; } else { fh->wrkhasrec = fh->readdir; fh->saverecnum = isrecnum; if (memcmp (f->record->data + fh->key[fh->curkey].k_start, fh->recwrk + fh->key[fh->curkey].k_start, fh->key[fh->curkey].k_leng) == 0) { ret = COB_STATUS_02_SUCCESS_DUPLICATE; } } } #elif defined(WITH_DISAM) if((isstat1 == '0') && (isstat2 == '2')) { ret = COB_STATUS_02_SUCCESS_DUPLICATE; } #endif } else { memset (fh->savekey, 0, fh->key[0].k_leng); fh->recnum = 0; fh->readdone = 0; fh->wrkhasrec = 0; } return ret; #else /* WITH_INDEX_EXTFH */ struct indexed_file *p = f->file; int ret; int read_nextprev; int nextprev = DB_NEXT; int file_changed = 0; unsigned int dupno; #ifdef USE_DB41 if (bdb_env != NULL) { unlock_record (f); } #endif if (unlikely(read_opts & COB_READ_PREVIOUS)) { if (f->flag_end_of_file) { nextprev = DB_LAST; } else { nextprev = DB_PREV; } } else if (f->flag_begin_of_file) { nextprev = DB_FIRST; } #ifdef USE_DB41 /* the open cursor makes this function atomic */ if (p->key_index != 0) { p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], 0); } p->db[p->key_index]->cursor (p->db[p->key_index], NULL, &p->cursor[p->key_index], 0); #endif if (f->flag_first_read) { /* data is read in indexed_open or indexed_start */ if (p->data.data == NULL || (f->flag_first_read == 2 && nextprev == DB_PREV)) { #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif return COB_STATUS_10_END_OF_FILE; } /* check if previously read data still exists */ p->key.size = (cob_dbtsize_t) f->keys[p->key_index].field->size; p->key.data = p->last_readkey[p->key_index]; #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_SET); #else ret = DB_GET (p->db[p->key_index], 0); #endif if (!ret && p->key_index > 0) { if (f->keys[p->key_index].flag) { memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); while (ret == 0 && memcmp (p->key.data, p->last_readkey[p->key_index], p->key.size) == 0 && dupno < p->last_dupno[p->key_index]) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_NEXT); #else ret = DB_SEQ (p->db[p->key_index], R_NEXT); #endif memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); } if (ret == 0 && memcmp (p->key.data, p->last_readkey[p->key_index], p->key.size) == 0 && dupno == p->last_dupno[p->key_index]) { ret = memcmp (p->last_readkey[p->key_index + f->nkeys], p->data.data, f->keys[0].field->size); } else { ret = 1; } } else { ret = memcmp (p->last_readkey[p->key_index + f->nkeys], p->data.data, f->keys[0].field->size); } if (!ret) { p->key.size = (cob_dbtsize_t) f->keys[0].field->size; p->key.data = p->last_readkey[p->key_index + f->nkeys]; ret = DB_GET (p->db[0], 0); } } file_changed = ret; #ifdef USE_DB41 if (bdb_env != NULL && !file_changed) { if (!(read_opts & COB_READ_IGNORE_LOCK)) { ret = test_record_lock (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } if (read_opts & COB_READ_LOCK) { ret = lock_record (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } } #endif } if (!f->flag_first_read || file_changed) { if (nextprev == DB_FIRST || nextprev == DB_LAST) { read_nextprev = 1; } else { p->key.size = (cob_dbtsize_t) f->keys[p->key_index].field->size; p->key.data = p->last_readkey[p->key_index]; #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_SET_RANGE); #else ret = DB_SEQ (p->db[p->key_index], R_CURSOR); #endif /* ret != 0 possible, records may be deleted since last read */ if (ret != 0) { if (nextprev == DB_PREV) { nextprev = DB_LAST; read_nextprev = 1; } else { #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif return COB_STATUS_10_END_OF_FILE; } } else { if (memcmp (p->key.data, p->last_readkey[p->key_index], p->key.size) == 0) { if (p->key_index > 0 && f->keys[p->key_index].flag) { memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); while (ret == 0 && memcmp (p->key.data, p->last_readkey[p->key_index], p->key.size) == 0 && dupno < p->last_dupno[p->key_index]) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], DB_NEXT); #else ret = DB_SEQ (p->db[p->key_index], R_NEXT); #endif memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); } if (ret != 0) { if (nextprev == DB_PREV) { nextprev = DB_LAST; read_nextprev = 1; } else { #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif return COB_STATUS_10_END_OF_FILE; } } else { if (memcmp (p->key.data, p->last_readkey[p->key_index], p->key.size) == 0 && dupno == p->last_dupno[p->key_index]) { read_nextprev = 1; } else { if (nextprev == DB_PREV) { read_nextprev = 1; } else { read_nextprev = 0; } } } } else { read_nextprev = 1; } } else { if (nextprev == DB_PREV) { read_nextprev = 1; } else { read_nextprev = 0; } } } } if (read_nextprev) { #ifdef USE_DB41 ret = DB_SEQ (p->cursor[p->key_index], nextprev); #else ret = DB_SEQ (p->db[p->key_index], nextprev); #endif if (ret != 0) { #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif return COB_STATUS_10_END_OF_FILE; } } if (p->key_index > 0) { /* temporarily save alternate key */ memcpy (p->temp_key, p->key.data, p->key.size); if (f->keys[p->key_index].flag) { memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); } p->key.data = p->data.data; p->key.size = f->keys[0].field->size; if (DB_GET (p->db[0], 0) != 0) { #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; #endif return COB_STATUS_23_KEY_NOT_EXISTS; } } #ifdef USE_DB41 if (bdb_env != NULL) { if (!(read_opts & COB_READ_IGNORE_LOCK)) { ret = test_record_lock (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } if (read_opts & COB_READ_LOCK) { ret = lock_record (f, p->key.data, p->key.size); if (ret) { p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } return COB_STATUS_51_RECORD_LOCKED; } } } #endif if (p->key_index == 0) { memcpy (p->last_readkey[0], p->key.data, p->key.size); } else { memcpy (p->last_readkey[p->key_index], p->temp_key, f->keys[p->key_index].field->size); memcpy (p->last_readkey[p->key_index + f->nkeys], p->key.data, f->keys[0].field->size); if (f->keys[p->key_index].flag) { p->last_dupno[p->key_index] = dupno; } } } #ifdef USE_DB41 p->cursor[p->key_index]->c_close (p->cursor[p->key_index]); p->cursor[p->key_index] = NULL; if (p->key_index != 0) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; } #endif f->record->size = p->data.size; memcpy (f->record->data, p->data.data, p->data.size); return COB_STATUS_00_SUCCESS; #endif /* WITH_INDEX_EXTFH */ } #if !defined(WITH_INDEX_EXTFH) && !defined(WITH_CISAM) && !defined(WITH_DISAM) && !defined(WITH_VBISAM) /* get the next number in a set of duplicates */ static unsigned int get_dupno (cob_file *f, const int i) { int ret; unsigned int dupno = 0; struct indexed_file *p = f->file; DBT_SET (p->key, f->keys[i].field); memcpy (p->temp_key, p->key.data, p->key.size); #ifdef USE_DB41 p->db[i]->cursor (p->db[i], NULL, &p->cursor[i], 0); ret = DB_SEQ (p->cursor[i], DB_SET_RANGE); #else ret = DB_SEQ (p->db[i], R_CURSOR); #endif while (ret == 0 && memcmp (p->key.data, p->temp_key, p->key.size) == 0) { memcpy (&dupno, (ucharptr)p->data.data + f->keys[0].field->size, sizeof(unsigned int)); #ifdef USE_DB41 ret = DB_SEQ (p->cursor[i], DB_NEXT); #else ret = DB_SEQ (p->db[i], R_NEXT); #endif } #ifdef USE_DB41 p->cursor[i]->c_close (p->cursor[i]); p->cursor[i] = NULL; #endif return ++dupno; } static int check_alt_keys (cob_file *f, const int rewrite) { size_t i; int ret; struct indexed_file *p = f->file; for (i = 1; i < f->nkeys; i++) { if (!f->keys[i].flag) { DBT_SET (p->key, f->keys[i].field); ret = DB_GET (p->db[i], 0); if (ret == 0) { if (rewrite) { if (memcmp (p->data.data, f->keys[0].field->data, f->keys[0].field->size)) { return 1; } } else { return 1; } } } } return 0; } static int indexed_write_internal (cob_file *f, const int rewrite, const int opt) { size_t i; struct indexed_file *p = f->file; int flags; unsigned int dupno; #ifdef USE_DB41 int close_cursor; if (bdb_env) { flags = DB_WRITECURSOR; } else { flags = 0; } if (p->write_cursor_open) { close_cursor = 0; } else { p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], flags); p->write_cursor_open = 1; close_cursor = 1; } #endif /* check duplicate alternate keys */ if (f->nkeys > 1 && !rewrite) { if (check_alt_keys (f, 0)) { #ifdef USE_DB41 if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } #endif return COB_STATUS_22_KEY_EXISTS; } DBT_SET (p->key, f->keys[0].field); } /* write data */ #ifdef USE_DB41 if (p->cursor[0]->c_get (p->cursor[0], &p->key, &p->data, DB_SET) == 0) { if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } return COB_STATUS_22_KEY_EXISTS; } p->data.data = f->record->data; p->data.size = (cob_dbtsize_t) f->record->size; p->cursor[0]->c_put (p->cursor[0], &p->key, &p->data, DB_KEYFIRST); #else p->data.data = f->record->data; p->data.size = (cob_dbtsize_t) f->record->size; if (DB_PUT (p->db[0], R_NOOVERWRITE) != 0) { return COB_STATUS_22_KEY_EXISTS; } #endif /* write secondary keys */ p->data = p->key; for (i = 1; i < f->nkeys; i++) { if (rewrite && ! p->rewrite_sec_key[i]) { continue; } if (f->keys[i].flag) { flags = 0; dupno = get_dupno(f, i); memcpy (p->temp_key, f->keys[0].field->data, f->keys[0].field->size); memcpy (p->temp_key + f->keys[0].field->size, &dupno, sizeof(unsigned int)); p->data.data = p->temp_key; p->data.size = f->keys[0].field->size + sizeof(unsigned int);; } else { #ifdef USE_DB41 flags = DB_NOOVERWRITE; #else flags = R_NOOVERWRITE; #endif } DBT_SET (p->key, f->keys[i].field); if (DB_PUT (p->db[i], flags) != 0) { #ifdef USE_DB41 if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } #endif return COB_STATUS_22_KEY_EXISTS; } } #ifdef USE_DB41 if (opt & COB_WRITE_LOCK) { if (bdb_env != NULL) { DBT_SET (p->key, f->keys[0].field); if (lock_record (f, p->key.data, p->key.size)) { if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } return COB_STATUS_51_RECORD_LOCKED; } } } if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } #endif return COB_STATUS_00_SUCCESS; } #endif /* WITH_INDEX_EXTFH */ /* WRITE to the INDEXED file */ static int indexed_write (cob_file *f, const int opt) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_write (f, opt); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int ret = COB_STATUS_00_SUCCESS; if (f->flag_nonexistent) { return COB_STATUS_30_PERMANENT_ERROR; } #if defined(ISVARLEN) if (f->record_min != f->record_max) { isreclen = f->record->size; } #endif if (iswrite (fh->isfd, (void *)f->record->data) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); if (iserrno == EDUPL) { if (f->open_mode == COB_OPEN_OUTPUT) { ret = COB_STATUS_21_KEY_INVALID; } } } else { memcpy (fh->savekey, f->record->data + fh->key[0].k_start, fh->key[0].k_leng); } return ret; #else /* WITH_INDEX_EXTFH */ struct indexed_file *p = f->file; #ifdef USE_DB41 if (bdb_env != NULL) { unlock_record (f); } #endif /* check record key */ DBT_SET (p->key, f->keys[0].field); if (!p->last_key) { p->last_key = cob_malloc (p->key.size); } else if (f->access_mode == COB_ACCESS_SEQUENTIAL && memcmp (p->last_key, p->key.data, p->key.size) > 0) { return COB_STATUS_21_KEY_INVALID; } memcpy (p->last_key, p->key.data, p->key.size); return indexed_write_internal (f, 0, opt); #endif /* WITH_INDEX_EXTFH */ } #if !defined(WITH_INDEX_EXTFH) && !defined(WITH_CISAM) && !defined(WITH_DISAM) && !defined(WITH_VBISAM) static int indexed_delete_internal (cob_file *f, const int rewrite) { size_t i; size_t offset; struct indexed_file *p = f->file; DBT prim_key; #ifdef USE_DB41 int ret, flags, close_cursor; if (bdb_env) { flags = DB_WRITECURSOR; } else { flags = 0; } if (p->write_cursor_open) { close_cursor = 0; } else { p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], flags); p->write_cursor_open = 1; close_cursor = 1; } if (bdb_env != NULL) { unlock_record (f); } #endif /* find the primary key */ #ifdef USE_DB41 if (f->access_mode != COB_ACCESS_SEQUENTIAL) { DBT_SET (p->key, f->keys[0].field); } ret = DB_SEQ (p->cursor[0], DB_SET); if (ret != 0 && f->access_mode != COB_ACCESS_SEQUENTIAL) { if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } return COB_STATUS_23_KEY_NOT_EXISTS; } if (bdb_env != NULL) { ret = test_record_lock (f, p->key.data, p->key.size); if (ret) { if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } return COB_STATUS_51_RECORD_LOCKED; } } #else if (f->access_mode != COB_ACCESS_SEQUENTIAL) { DBT_SET (p->key, f->keys[0].field); if (DB_GET (p->db[0], 0) != 0) { return COB_STATUS_23_KEY_NOT_EXISTS; } } #endif prim_key = p->key; /* delete the secondary keys */ offset = (char *) p->data.data - (char *) f->record->data; for (i = 1; i < f->nkeys; i++) { DBT_SET (p->key, f->keys[i].field); p->key.data = (char *)p->key.data + offset; /* rewrite: no delete if secondary key is unchanged */ if (rewrite) { p->rewrite_sec_key[i] = memcmp (p->key.data, f->keys[i].field->data, p->key.size); if (!p->rewrite_sec_key[i]) { continue; } } if (!f->keys[i].flag) { DB_DEL (p->db[i], &p->key, 0); } else { DBT sec_key = p->key; #ifdef USE_DB41 p->db[i]->cursor (p->db[i], NULL, &p->cursor[i], flags); if (DB_SEQ (p->cursor[i], DB_SET_RANGE) == 0) { #else if (DB_SEQ (p->db[i], R_CURSOR) == 0) { #endif while (sec_key.size == p->key.size && memcmp (p->key.data, sec_key.data, sec_key.size) == 0) { if (memcmp (p->data.data, prim_key.data, prim_key.size) == 0) { #ifdef USE_DB41 p->cursor[i]->c_del (p->cursor[i], 0); #else DB_DEL (p->db[i], &p->key, R_CURSOR); #endif } #ifdef USE_DB41 if (DB_SEQ (p->cursor[i], DB_NEXT) != 0) { #else if (DB_SEQ (p->db[i], R_NEXT) != 0) { #endif break; } } } #ifdef USE_DB41 p->cursor[i]->c_close (p->cursor[i]); p->cursor[i] = NULL; #endif } } /* delete the record */ #ifdef USE_DB41 p->cursor[0]->c_del (p->cursor[0], 0); #else DB_DEL (p->db[0], &prim_key, 0); #endif #ifdef USE_DB41 if (close_cursor) { p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; } #endif return COB_STATUS_00_SUCCESS; } #endif /* !WITH_INDEX_EXTFH && !WITH_CISAM && !WITH_DISAM && !WITH_VBISAM */ /* DELETE record from the INDEXED file */ static int indexed_delete (cob_file *f) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_delete (f); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int ret = COB_STATUS_00_SUCCESS; if (f->flag_nonexistent) { return COB_STATUS_30_PERMANENT_ERROR; } if (fh->curkey == -1) { /* Switch to prime index */ isstart (fh->isfd, &fh->key[0], fh->key[0].k_leng, (void *)f->record->data, ISEQUAL); fh->curkey = 0; fh->readdir = ISNEXT; } else { savefileposition (f); if (fh->curkey != 0) { /* Switch to prime index */ isstart (fh->isfd, &fh->key[0], fh->key[0].k_leng, (void *)f->record->data, ISEQUAL); } } if (isread (fh->isfd, (void *)f->record->data, ISEQUAL | ISLOCK) == -1) { ret = isretsts (COB_STATUS_21_KEY_INVALID); } else if (isdelete (fh->isfd, (void *)f->record->data) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); } restorefileposition (f); return ret; #else /* WITH_INDEX_EXTFH */ return indexed_delete_internal (f, 0); #endif /* WITH_INDEX_EXTFH */ } /* REWRITE record to the INDEXED file */ static int indexed_rewrite (cob_file *f, const int opt) { #ifdef WITH_INDEX_EXTFH return extfh_indexed_rewrite (f, opt); #elif defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh = f->file; int ret = COB_STATUS_00_SUCCESS; int k; if (f->flag_nonexistent) { return COB_STATUS_30_PERMANENT_ERROR; } if (f->access_mode == COB_ACCESS_SEQUENTIAL && memcmp (fh->savekey, f->record->data + fh->key[0].k_start, fh->key[0].k_leng) != 0) { return COB_STATUS_21_KEY_INVALID; } if (fh->curkey >= 0) { /* Index is active */ /* Save record data */ memcpy (fh->recwrk, f->record->data, f->record_max); savefileposition (f); memcpy (fh->recwrk, f->record->data, f->record_max); if (fh->curkey != 0) { /* Activate Prime index */ isstart (fh->isfd, &fh->key[0], 0, (void *)fh->recwrk, ISEQUAL); } /* Verify record exists */ if (isread (fh->isfd, fh->recwrk, ISEQUAL) == -1) { restorefileposition (f); return COB_STATUS_21_KEY_INVALID; } for (k = 1; k < f->nkeys && ret == COB_STATUS_00_SUCCESS; k++) { if (fh->key[k].k_flags & ISDUPS) { continue; } memcpy (fh->recwrk, f->record->data, f->record_max); isstart (fh->isfd, &fh->key[k], fh->key[k].k_leng, (void *)fh->recwrk, ISEQUAL); if (isread (fh->isfd, (void *)fh->recwrk, ISEQUAL) != -1 && isrecnum != fh->recnum) { ret = COB_STATUS_22_KEY_EXISTS; break; } } if (ret == COB_STATUS_00_SUCCESS) { memcpy (fh->recwrk, f->record->data, f->record_max); isstart (fh->isfd, &fh->key[0], 0, (void *)fh->recwrk, ISEQUAL); if (isread (fh->isfd, (void *)fh->recwrk, ISEQUAL | ISLOCK) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); } else if (isrewcurr (fh->isfd, (void *)f->record->data) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); } } restorefileposition (f); return ret; } memcpy (fh->recwrk, f->record->data, f->record_max); if (isread (fh->isfd, (void *)fh->recwrk, ISEQUAL | ISLOCK) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); } else if (isrewrite (fh->isfd, (void *)f->record->data) == -1) { ret = isretsts (COB_STATUS_49_I_O_DENIED); } /* RXW */ if (!ret) { if ((f->lock_mode & COB_LOCK_AUTOMATIC) && !(f->lock_mode & COB_LOCK_MULTIPLE)) { isrelease (fh->isfd); } } return ret; #else /* WITH_INDEX_EXTFH */ struct indexed_file *p = f->file; int ret; #ifdef USE_DB41 int flags; if (bdb_env) { flags = DB_WRITECURSOR; } else { flags = 0; } p->db[0]->cursor (p->db[0], NULL, &p->cursor[0], flags); p->write_cursor_open = 1; if (bdb_env != NULL) { unlock_record (f); } #endif /* check duplicate alternate keys */ if (check_alt_keys (f, 1)) { #ifdef USE_DB41 p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; #endif return COB_STATUS_22_KEY_EXISTS; } /* delete the current record */ ret = indexed_delete_internal (f, 1); if (ret != COB_STATUS_00_SUCCESS) { #ifdef USE_DB41 p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; #endif return ret; } /* write data */ DBT_SET (p->key, f->keys[0].field); ret = indexed_write_internal (f, 1, opt); #ifdef USE_DB41 p->cursor[0]->c_close (p->cursor[0]); p->cursor[0] = NULL; p->write_cursor_open = 0; #endif return ret; #endif /* WITH_INDEX_EXTFH */ } #ifdef USE_DB41 /* * check if a file exists in bdb data dirs */ static int is_absolute (const char *filename) { #ifdef _WIN32 if (filename[0] == '/' || filename[0] == '\\') { return 1; } else { if (isalpha (filename[0]) && filename[1] == ':' && (filename[2] == '/' || filename[2] == '\\')) { return 1; } else { return 0; } } #else if (filename[0] == '/') { return 1; } else { return 0; } #endif } static int bdb_nofile (char *filename) { int i; struct stat st; if (is_absolute (filename)) { if (stat (filename, &st) == -1 && errno == ENOENT) { return 1; } else { return 0; } } for (i = 0; bdb_data_dir && bdb_data_dir[i]; ++i) { bdb_buff[COB_SMALL_MAX] = 0; if (is_absolute (bdb_data_dir[i])) { snprintf (bdb_buff, COB_SMALL_MAX, "%s/%s", bdb_data_dir[i], filename); } else { snprintf (bdb_buff, COB_SMALL_MAX, "%s/%s/%s", bdb_home, bdb_data_dir[i], filename); } if (stat (bdb_buff, &st) == 0 || errno != ENOENT) { return 0; } } if (i == 0) { bdb_buff[COB_SMALL_MAX] = 0; snprintf (bdb_buff, COB_SMALL_MAX, "%s/%s", bdb_home, filename); if (stat (bdb_buff, &st) == 0 || errno != ENOENT) { return 0; } } return 1; } #endif #endif /* WITH_DB */ static void COB_NOINLINE cob_file_unlock (cob_file *f) { #ifdef WITH_DB #ifdef USE_DB41 struct indexed_file *p; #endif #endif #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) struct indexfile *fh; #endif #ifdef HAVE_FCNTL struct flock lock; #endif if (f->open_mode != COB_OPEN_CLOSED && f->open_mode != COB_OPEN_LOCKED) { if (f->organization == COB_ORG_SORT) { return; } if (f->organization != COB_ORG_INDEXED) { #ifdef WITH_SEQRA_EXTFH #else /* WITH_SEQRA_EXTFH */ fflush ((FILE *)f->file); fsync (fileno ((FILE *)f->file)); #ifdef HAVE_FCNTL if (!(f->lock_mode & COB_LOCK_EXCLUSIVE)) { /* unlock the file */ memset ((unsigned char *)&lock, 0, sizeof (struct flock)); lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; fcntl (fileno ((FILE *)f->file), F_SETLK, &lock); } #endif #endif /* WITH_SEQRA_EXTFH */ } else { #ifdef WITH_INDEX_EXTFH extfh_indexed_unlock (f); #else /* WITH_INDEX_EXTFH */ #ifdef WITH_DB #ifdef USE_DB41 p = f->file; if (bdb_env != NULL) { unlock_record (f); bdb_env->lock_put (bdb_env, &p->bdb_file_lock); } #endif #endif #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) fh = f->file; isrelease (fh->isfd); #endif #endif /* WITH_INDEX_EXTFH */ } } } /* * Public interface */ void cob_unlock_file (cob_file *f, cob_field *fnstatus) { cob_file_unlock (f); RETURN_STATUS (COB_STATUS_00_SUCCESS); } void cob_open (cob_file *f, const int mode, const int sharing, cob_field *fnstatus) { char *p; char *src; char *dst; size_t i; size_t simple; int was_not_exist = 0; struct stat st; f->flag_read_done = 0; /* file was previously closed with lock */ if (f->open_mode == COB_OPEN_LOCKED) { RETURN_STATUS (COB_STATUS_38_CLOSED_WITH_LOCK); } /* file is already open */ if (f->open_mode != COB_OPEN_CLOSED) { RETURN_STATUS (COB_STATUS_41_ALREADY_OPEN); } f->last_open_mode = mode; f->flag_nonexistent = 0; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; f->flag_first_read = 2; if (f->special) { if (f->special == 1) { if (mode != COB_OPEN_INPUT) { RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); } f->file = stdin; f->open_mode = mode; RETURN_STATUS (COB_STATUS_00_SUCCESS); } else { if (mode != COB_OPEN_OUTPUT) { RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); } f->file = stdout; f->open_mode = mode; RETURN_STATUS (COB_STATUS_00_SUCCESS); } } /* obtain the file name */ cob_field_to_string (f->assign, file_open_name); #ifdef WITH_INDEX_EXTFH if (f->organization == COB_ORG_INDEXED) { int ret; ret = extfh_indexed_locate (f, file_open_name); switch (ret) { case COB_NOT_CONFIGURED: /* EXTFH requires OC to process the filename */ break; case COB_STATUS_00_SUCCESS: /* EXTFH recognized the file */ goto file_available; default: /* EXTFH detected an error */ RETURN_STATUS (ret); } } #endif /* WITH_INDEX_EXTFH */ #ifdef WITH_SEQRA_EXTFH if (f->organization != COB_ORG_INDEXED) { int ret; ret = extfh_seqra_locate (f, file_open_name); switch (ret) { case COB_NOT_CONFIGURED: /* EXTFH requires OC to process the filename */ break; case COB_STATUS_00_SUCCESS: /* EXTFH recognized the file */ goto file_available; default: /* EXTFH detected an error */ RETURN_STATUS (ret); } } #endif /* WITH_SEQRA_EXTFH */ if (cob_current_module->flag_filename_mapping) { src = file_open_name; dst = file_open_buff; simple = 1; /* expand envoronment variables */ /* ex. "$TMPDIR/foo" -> "/tmp/foo" */ while (*src) { if (!isalnum (*src) && *src != '_' && *src != '-') { simple = 0; } if (*src == '$') { for (i = 1; ; i++) { if (!isalnum (src[i]) && src[i] != '_' && *src != '-') { break; } } memcpy (file_open_env, src + 1, i - 1); file_open_env[i - 1] = 0; if ((p = getenv (file_open_env)) != NULL) { strcpy (dst, p); dst += strlen (p); } src += i; } else { *dst++ = *src++; } } *dst = 0; strncpy (file_open_name, file_open_buff, COB_SMALL_MAX); /* resolve by environment variables */ /* ex. "TMPFILE" -> DD_TMPFILE, dd_TMPFILE, or TMPFILE */ if (simple) { for (i = 0; i < NUM_PREFIX; i++) { snprintf (file_open_buff, COB_SMALL_MAX, "%s%s", prefix[i], file_open_name); if ((p = getenv (file_open_buff)) != NULL) { strncpy (file_open_name, p, COB_SMALL_MAX); break; } } if (i == NUM_PREFIX && cob_file_path) { snprintf (file_open_buff, COB_SMALL_MAX, "%s/%s", cob_file_path, file_open_name); strncpy (file_open_name, file_open_buff, COB_SMALL_MAX); } } } /* check if the file exists */ #ifdef USE_DB41 if (f->organization == COB_ORG_INDEXED) { if ((bdb_env && bdb_nofile (file_open_name)) || (!bdb_env && stat (file_open_name, &st) == -1 && errno == ENOENT)) { was_not_exist = 1; if (mode != COB_OPEN_OUTPUT && f->flag_optional == 0) { RETURN_STATUS (COB_STATUS_35_NOT_EXISTS); } } } else if (stat (file_open_name, &st) == -1 && errno == ENOENT) { #else /* USE_DB41 */ #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) if (f->organization == COB_ORG_INDEXED) { strncpy (file_open_buff, file_open_name, COB_SMALL_MAX); strcat (file_open_buff, ".idx"); if (stat (file_open_buff, &st) == -1 && errno == ENOENT) { was_not_exist = 1; if (mode != COB_OPEN_OUTPUT && f->flag_optional == 0) { RETURN_STATUS (COB_STATUS_35_NOT_EXISTS); } } strncpy (file_open_buff, file_open_name, COB_SMALL_MAX); strcat (file_open_buff, ".dat"); if (stat (file_open_buff, &st) == -1 && errno == ENOENT) { was_not_exist = 1; if (mode != COB_OPEN_OUTPUT && f->flag_optional == 0) { RETURN_STATUS (COB_STATUS_35_NOT_EXISTS); } } } else if (stat (file_open_name, &st) == -1 && errno == ENOENT) { #else /* WITH_CISAM || WITH_DISAM || WITH_VBISAM */ if (stat (file_open_name, &st) == -1 && errno == ENOENT) { #endif /* WITH_CISAM || WITH_DISAM || WITH_VBISAM */ #endif /* USE_DB41 */ was_not_exist = 1; if (mode != COB_OPEN_OUTPUT && f->flag_optional == 0) { RETURN_STATUS (COB_STATUS_35_NOT_EXISTS); } } #if defined(WITH_INDEX_EXTFH) || defined(WITH_SEQRA_EXTFH) file_available: #endif /* WITH_INDEX_EXTFH || WITH_SEQRA_EXTFH */ cob_cache_file (f); /* open the file */ #ifdef WITH_SEQRA_EXTFH if (f->organization != COB_ORG_INDEXED) { int ret; ret = extfh_cob_file_open (f, file_open_name, mode, sharing); switch (ret) { case COB_STATUS_00_SUCCESS: f->open_mode = mode; break; case COB_STATUS_35_NOT_EXISTS: if (f->flag_optional) { f->open_mode = mode; f->flag_nonexistent = 1; f->flag_end_of_file = 1; f->flag_begin_of_file = 1; RETURN_STATUS (COB_STATUS_05_SUCCESS_OPTIONAL); } break; } RETURN_STATUS (ret); } #endif #if defined(WITH_CISAM) || defined(WITH_DISAM) || defined(WITH_VBISAM) if (f->organization == COB_ORG_INDEXED) { /* Do this here to avoid mangling of the status in the 'switch' below */ RETURN_STATUS (fileio_funcs[(int)f->organization]->open (f, file_open_name, mode, sharing)); } #endif switch (fileio_funcs[(int)f->organization]->open (f, file_open_name, mode, sharing)) { case 0: f->open_mode = mode; if (f->flag_optional && was_not_exist) { RETURN_STATUS (COB_STATUS_05_SUCCESS_OPTIONAL); } else { RETURN_STATUS (COB_STATUS_00_SUCCESS); } case ENOENT: if (mode == COB_OPEN_EXTEND || mode == COB_OPEN_OUTPUT) { RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); } if (f->flag_optional) { f->open_mode = mode; f->flag_nonexistent = 1; f->flag_end_of_file = 1; f->flag_begin_of_file = 1; RETURN_STATUS (COB_STATUS_05_SUCCESS_OPTIONAL); } else { RETURN_STATUS (COB_STATUS_35_NOT_EXISTS); } case EACCES: case EISDIR: case EROFS: RETURN_STATUS (COB_STATUS_37_PERMISSION_DENIED); case EAGAIN: case COB_STATUS_61_FILE_SHARING: RETURN_STATUS (COB_STATUS_61_FILE_SHARING); case COB_STATUS_91_NOT_AVAILABLE: RETURN_STATUS (COB_STATUS_91_NOT_AVAILABLE); case COB_LINAGE_INVALID: RETURN_STATUS (COB_STATUS_57_I_O_LINAGE); default: RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); } } void cob_close (cob_file *f, const int opt, cob_field *fnstatus) { int ret; f->flag_read_done = 0; if (f->special) { f->open_mode = COB_OPEN_CLOSED; RETURN_STATUS (COB_STATUS_00_SUCCESS); } if (f->open_mode == COB_OPEN_CLOSED) { RETURN_STATUS (COB_STATUS_42_NOT_OPEN); } if (f->flag_nonexistent) { ret = COB_STATUS_00_SUCCESS; } else { #ifdef WITH_SEQRA_EXTFH if (f->organization != COB_ORG_INDEXED) { ret = extfh_cob_file_close (f, opt); } else { #endif ret = fileio_funcs[(int)f->organization]->close (f, opt); #ifdef WITH_SEQRA_EXTFH } #endif } if (ret == COB_STATUS_00_SUCCESS) { switch (opt) { case COB_CLOSE_LOCK: f->open_mode = COB_OPEN_LOCKED; break; default: f->open_mode = COB_OPEN_CLOSED; break; } } RETURN_STATUS (ret); } #if 0 void cob_unlock (cob_file *f) { int ret; f->flag_read_done = 0; if (f->open_mode == COB_OPEN_CLOSED) { RETURN_STATUS (COB_STATUS_42_NOT_OPEN); } if (f->flag_nonexistent) { ret = COB_STATUS_00_SUCCESS; } else { ret = fileio_funcs[(int)f->organization]->close (f, opt); } RETURN_STATUS (ret); } #endif void cob_start (cob_file *f, const int cond, cob_field *key, cob_field *fnstatus) { int ret; f->flag_read_done = 0; f->flag_first_read = 0; if (f->flag_nonexistent) { RETURN_STATUS (COB_STATUS_23_KEY_NOT_EXISTS); } if (f->open_mode == COB_OPEN_CLOSED || f->open_mode == COB_OPEN_OUTPUT || f->open_mode == COB_OPEN_EXTEND || f->access_mode == COB_ACCESS_RANDOM) { RETURN_STATUS (COB_STATUS_47_INPUT_DENIED); } ret = fileio_funcs[(int)f->organization]->start (f, cond, key); if (ret == COB_STATUS_00_SUCCESS) { f->flag_end_of_file = 0; f->flag_begin_of_file = 0; f->flag_first_read = 1; } RETURN_STATUS (ret); } void cob_read (cob_file *f, cob_field *key, cob_field *fnstatus, int read_opts) { int ret; f->flag_read_done = 0; if (unlikely(f->flag_nonexistent)) { if (f->flag_first_read == 0) { RETURN_STATUS (COB_STATUS_23_KEY_NOT_EXISTS); } f->flag_first_read = 0; RETURN_STATUS (COB_STATUS_10_END_OF_FILE); } /* sequential read at the end of file is an error */ if (key == NULL) { if (f->flag_end_of_file && !(read_opts & COB_READ_PREVIOUS)) { RETURN_STATUS (COB_STATUS_46_READ_ERROR); } if (f->flag_begin_of_file && (read_opts & COB_READ_PREVIOUS)) { RETURN_STATUS (COB_STATUS_46_READ_ERROR); } } if (unlikely(f->open_mode == COB_OPEN_CLOSED || f->open_mode == COB_OPEN_OUTPUT || f->open_mode == COB_OPEN_EXTEND)) { RETURN_STATUS (COB_STATUS_47_INPUT_DENIED); } #ifdef USE_DB41 if (f->organization == COB_ORG_INDEXED && bdb_env != NULL) { if (f->open_mode != COB_OPEN_I_O || (f->lock_mode & COB_LOCK_EXCLUSIVE)) { read_opts &= ~COB_READ_LOCK; } else if ((f->lock_mode & COB_LOCK_AUTOMATIC) && !(read_opts & COB_READ_NO_LOCK)) { read_opts |= COB_READ_LOCK; } } else { read_opts &= ~COB_READ_LOCK; } #endif if (key) { ret = fileio_funcs[(int)f->organization]->read (f, key, read_opts); } else { ret = fileio_funcs[(int)f->organization]->read_next (f, read_opts); } switch (ret) { case COB_STATUS_00_SUCCESS: f->flag_first_read = 0; f->flag_read_done = 1; f->flag_end_of_file = 0; f->flag_begin_of_file = 0; if (f->record_size && f->organization != COB_ORG_LINE_SEQUENTIAL) { cob_set_int (f->record_size, (int) f->record->size); } break; case COB_STATUS_10_END_OF_FILE: if (read_opts & COB_READ_PREVIOUS) { f->flag_begin_of_file = 1; } else { f->flag_end_of_file = 1; } break; } RETURN_STATUS (ret); } void cob_write (cob_file *f, cob_field *rec, const int opt, cob_field *fnstatus) { int ret; f->flag_read_done = 0; if (f->access_mode == COB_ACCESS_SEQUENTIAL) { if (f->open_mode == COB_OPEN_CLOSED || f->open_mode == COB_OPEN_INPUT || f->open_mode == COB_OPEN_I_O) { RETURN_STATUS (COB_STATUS_48_OUTPUT_DENIED); } } else { if (f->open_mode == COB_OPEN_CLOSED || f->open_mode == COB_OPEN_INPUT || f->open_mode == COB_OPEN_EXTEND) { RETURN_STATUS (COB_STATUS_48_OUTPUT_DENIED); } } if (f->record_size) { f->record->size = cob_get_int (f->record_size); } else { f->record->size = rec->size; } if (f->record->size < f->record_min || f->record_max < f->record->size) { RETURN_STATUS (COB_STATUS_44_RECORD_OVERFLOW); } /* RXW #ifdef USE_DB41 if (f->organization != COB_ORG_INDEXED || bdb_env == NULL) { opt &= ~COB_WRITE_LOCK; } #endif */ ret = fileio_funcs[(int)f->organization]->write (f, opt); if (unlikely(cob_do_sync && ret == 0)) { cob_sync (f, cob_do_sync); } RETURN_STATUS (ret); } void cob_rewrite (cob_file *f, cob_field *rec, const int opt, cob_field *fnstatus) { int ret; int read_done = f->flag_read_done; f->flag_read_done = 0; if (unlikely(f->open_mode == COB_OPEN_CLOSED || f->open_mode != COB_OPEN_I_O)) { RETURN_STATUS (COB_STATUS_49_I_O_DENIED); } if (f->access_mode == COB_ACCESS_SEQUENTIAL && !read_done) { RETURN_STATUS (COB_STATUS_43_READ_NOT_DONE); } if (f->organization == COB_ORG_SEQUENTIAL) { if (f->record->size != rec->size) { RETURN_STATUS (COB_STATUS_44_RECORD_OVERFLOW); } if (f->record_size) { if (f->record->size != (size_t)cob_get_int (f->record_size)) { RETURN_STATUS (COB_STATUS_44_RECORD_OVERFLOW); } } } /* RXW #ifdef USE_DB41 if (f->organization != COB_ORG_INDEXED || bdb_env == NULL) { opt &= ~COB_WRITE_LOCK; } #endif */ ret = fileio_funcs[(int)f->organization]->rewrite (f, opt); if (unlikely(cob_do_sync && ret == 0)) { cob_sync (f, cob_do_sync); } RETURN_STATUS (ret); } void cob_delete (cob_file *f, cob_field *fnstatus) { int ret; int read_done = f->flag_read_done; f->flag_read_done = 0; if (unlikely(f->open_mode == COB_OPEN_CLOSED || f->open_mode != COB_OPEN_I_O)) { RETURN_STATUS (COB_STATUS_49_I_O_DENIED); } if (f->access_mode == COB_ACCESS_SEQUENTIAL && !read_done) { RETURN_STATUS (COB_STATUS_43_READ_NOT_DONE); } ret = fileio_funcs[(int)f->organization]->fdelete (f); if (unlikely(cob_do_sync && ret == 0)) { cob_sync (f, cob_do_sync); } RETURN_STATUS (ret); } void cob_commit (void) { struct file_list *l; for (l = file_cache; l; l = l->next) { cob_file_unlock (l->file); } } void cob_rollback (void) { struct file_list *l; for (l = file_cache; l; l = l->next) { cob_file_unlock (l->file); } } void cob_default_error_handle (void) { const char *msg; unsigned char *file_status; char *filename; int status; file_status = cob_error_file->file_status; status = cob_d2i(file_status[0]) * 10 + cob_d2i(file_status[1]); switch (status) { case COB_STATUS_10_END_OF_FILE: msg = "End of file"; break; case COB_STATUS_14_OUT_OF_KEY_RANGE: msg = "Key out of range"; break; case COB_STATUS_21_KEY_INVALID: msg = "Key order not ascending"; break; case COB_STATUS_22_KEY_EXISTS: msg = "Record key already exists"; break; case COB_STATUS_23_KEY_NOT_EXISTS: msg = "Record key does not exist"; break; case COB_STATUS_30_PERMANENT_ERROR: msg = "Permanent file error"; break; case COB_STATUS_35_NOT_EXISTS: msg = "File does not exist"; break; case COB_STATUS_37_PERMISSION_DENIED: msg = "Permission denied"; break; case COB_STATUS_41_ALREADY_OPEN: msg = "File already open"; break; case COB_STATUS_42_NOT_OPEN: msg = "File not open"; break; case COB_STATUS_43_READ_NOT_DONE: msg = "READ must be executed first"; break; case COB_STATUS_44_RECORD_OVERFLOW: msg = "Record overflow"; break; case COB_STATUS_46_READ_ERROR: msg = "Failed to read"; break; case COB_STATUS_47_INPUT_DENIED: msg = "READ/START not allowed"; break; case COB_STATUS_48_OUTPUT_DENIED: msg = "WRITE not allowed"; break; case COB_STATUS_49_I_O_DENIED: msg = "DELETE/REWRITE not allowed"; break; case COB_STATUS_51_RECORD_LOCKED: msg = "Record locked by another file connector"; break; case COB_STATUS_52_EOP: msg = "A page overflow condition occurred"; break; case COB_STATUS_57_I_O_LINAGE: msg = "LINAGE values invalid"; break; case COB_STATUS_61_FILE_SHARING: msg = "File sharing conflict"; break; case COB_STATUS_91_NOT_AVAILABLE: msg = "Runtime library is not configured for this operation"; break; default: msg = "Unknown file error"; break; } filename = cob_malloc (COB_MEDIUM_BUFF); cob_field_to_string (cob_error_file->assign, filename); cob_runtime_error ("%s (STATUS = %02d) File : '%s'", msg, status, filename); free (filename); } void cob_init_fileio (void) { char *s; int n; if ((s = getenv ("COB_SYNC")) != NULL) { if (*s == 'Y' || *s == 'y') { cob_do_sync = 1; } if (*s == 'P' || *s == 'p') { cob_do_sync = 2; } } if ((s = getenv ("COB_SORT_MEMORY")) != NULL) { n = atoi (s); if (n >= 1024*1024) { cob_sort_memory = n; } } cob_file_path = getenv ("COB_FILE_PATH"); if (cob_file_path) { if (!*cob_file_path || *cob_file_path == ' ') { cob_file_path = NULL; } } cob_ls_nulls = getenv ("COB_LS_NULLS"); cob_ls_fixed = getenv ("COB_LS_FIXED"); file_open_env = cob_malloc (COB_SMALL_BUFF); file_open_name = cob_malloc (COB_SMALL_BUFF); file_open_buff = cob_malloc (COB_SMALL_BUFF); #ifdef USE_DB41 bdb_home = getenv ("DB_HOME"); join_environment (); record_lock_object = cob_malloc (1024); bdb_buff = cob_malloc (COB_SMALL_BUFF); rlo_size = 1024; #endif #if defined(WITH_INDEX_EXTFH) || defined(WITH_SEQRA_EXTFH) extfh_cob_init_fileio (&sequential_funcs, &lineseq_funcs, &relative_funcs, &cob_file_write_opt); #endif } void cob_exit_fileio (void) { struct file_list *l; for (l = file_cache; l; l = l->next) { if (l->file->open_mode != COB_OPEN_CLOSED && l->file->open_mode != COB_OPEN_LOCKED) { cob_field_to_string (l->file->assign, runtime_buffer); cob_close (l->file, 0, NULL); fprintf (stderr, "WARNING - Implicit CLOSE of %s (\"%s\")\n", l->file->select_name, runtime_buffer); fflush (stderr); } } #ifdef USE_DB41 free (record_lock_object); if (bdb_env) { bdb_env->lock_id_free (bdb_env, bdb_lock_id); bdb_env->close (bdb_env, 0); } #endif #if defined(WITH_INDEX_EXTFH) || defined(WITH_SEQRA_EXTFH) extfh_cob_exit_fileio (); #endif } /* System routines */ static void * COB_NOINLINE cob_str_from_fld (const cob_field *f) { void *mptr; unsigned char *s; int i; int n; int quote_switch; if (!f) { return cob_malloc (1); } for (i = (int) f->size - 1; i >= 0; i--) { if (f->data[i] != ' ' && f->data[i] != 0) { break; } } i++; /* i is 0 or > 0 */ mptr = cob_malloc ((size_t)(i + 1)); quote_switch = 0; s = mptr; for (n = 0; n < i; n++) { if (f->data[n] == '"') { quote_switch = !quote_switch; continue; } s[n] = f->data[n]; if (quote_switch) { continue; } if (s[n] == ' ' || s[n] == 0) { s[n] = 0; break; } } return mptr; } static int COB_NOINLINE open_cbl_file (unsigned char *file_name, unsigned char *file_access, unsigned char *file_handle, const int file_flags) { char *fn; #ifdef O_BINARY int flag = O_BINARY; #else int flag = 0; #endif int fd; if (!cob_current_module->cob_procedure_parameters[0]) { memset (file_handle, -1, 4); return -1; } flag |= file_flags; switch (*file_access & 0x3f) { case 1: flag |= O_RDONLY; break; case 2: flag |= O_CREAT | O_TRUNC | O_WRONLY; break; case 3: flag |= O_RDWR; break; default: memset (file_handle, -1, 4); return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); fd = open (fn, flag, 0660); if (fd < 0) { free (fn); memset (file_handle, -1, 4); return 35; } free (fn); memcpy (file_handle, &fd, 4); return 0; } int CBL_OPEN_FILE (unsigned char *file_name, unsigned char *file_access, unsigned char *file_lock, unsigned char *file_dev, unsigned char *file_handle) { COB_CHK_PARMS (CBL_OPEN_FILE, 5); return open_cbl_file (file_name, file_access, file_handle, 0); } int CBL_CREATE_FILE (unsigned char *file_name, unsigned char *file_access, unsigned char *file_lock, unsigned char *file_dev, unsigned char *file_handle) { COB_CHK_PARMS (CBL_CREATE_FILE, 5); return open_cbl_file (file_name, file_access, file_handle, O_CREAT | O_TRUNC); } int CBL_READ_FILE (unsigned char *file_handle, unsigned char *file_offset, unsigned char *file_len, unsigned char *flags, unsigned char *buf) { long long off; int fd; int len; int rc = 0; struct stat st; COB_CHK_PARMS (CBL_READ_FILE, 5); memcpy (&fd, file_handle, 4); memcpy (&off, file_offset, 8); memcpy (&len, file_len, 4); #ifndef WORDS_BIGENDIAN off = COB_BSWAP_64 (off); len = COB_BSWAP_32 (len); #endif if (lseek (fd, (off_t)off, SEEK_SET) < 0) { return -1; } if (len > 0) { rc = read (fd, buf, (size_t)len); if (rc < 0) { rc = -1; } else if (rc == 0) { rc = 10; } else { rc = 0; } } if ((*flags & 0x80) != 0) { if (fstat (fd, &st) < 0) { return -1; } off = st.st_size; #ifndef WORDS_BIGENDIAN off = COB_BSWAP_64 (off); #endif memcpy (file_offset, &off, 8); } return rc; } int CBL_WRITE_FILE (unsigned char *file_handle, unsigned char *file_offset, unsigned char *file_len, unsigned char *flags, unsigned char *buf) { long long off; int fd; int len; int rc; COB_CHK_PARMS (CBL_WRITE_FILE, 5); memcpy (&fd, file_handle, 4); memcpy (&off, file_offset, 8); memcpy (&len, file_len, 4); #ifndef WORDS_BIGENDIAN off = COB_BSWAP_64 (off); len = COB_BSWAP_32 (len); #endif if (lseek (fd, (off_t)off, SEEK_SET) < 0) { return -1; } rc = write (fd, buf, (size_t)len); if (rc < 0) { return 30; } return 0; } int CBL_CLOSE_FILE (unsigned char *file_handle) { int fd; COB_CHK_PARMS (CBL_CLOSE_FILE, 1); memcpy (&fd, file_handle, 4); return close (fd); } int CBL_FLUSH_FILE (unsigned char *file_handle) { COB_CHK_PARMS (CBL_FLUSH_FILE, 1); return 0; } int CBL_DELETE_FILE (unsigned char *file_name) { char *fn; int ret; COB_CHK_PARMS (CBL_DELETE_FILE, 1); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); ret = unlink (fn); free (fn); if (ret) { return 128; } return 0; } int CBL_COPY_FILE (unsigned char *fname1, unsigned char *fname2) { char *fn1; char *fn2; #ifdef O_BINARY int flag = O_BINARY; #else int flag = 0; #endif int ret; int i; int fd1, fd2; COB_CHK_PARMS (CBL_COPY_FILE, 2); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } if (!cob_current_module->cob_procedure_parameters[1]) { return -1; } fn1 = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); flag |= O_RDONLY; fd1 = open (fn1, flag, 0); if (fd1 < 0) { free (fn1); return -1; } free (fn1); fn2 = cob_str_from_fld (cob_current_module->cob_procedure_parameters[1]); flag &= ~O_RDONLY; flag |= O_CREAT | O_TRUNC | O_WRONLY; fd2 = open (fn2, flag, 0660); if (fd2 < 0) { close (fd1); free (fn2); return -1; } free (fn2); ret = 0; while ((i = read (fd1, fn1, sizeof(fn1))) > 0) { if (write (fd2, fn1, (size_t)i) < 0) { ret = -1; break; } } close (fd1); close (fd2); return ret; } int CBL_CHECK_FILE_EXIST (unsigned char *file_name, unsigned char *file_info) { char *fn; struct tm *tm; long long sz; struct stat st; short y; char d, m, hh, mm, ss; COB_CHK_PARMS (CBL_CHECK_FILE_EXIST, 2); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); if (stat (fn, &st) < 0) { free (fn); return 35; } free (fn); sz = st.st_size; tm = localtime (&st.st_mtime); d = (char) tm->tm_mday; m = (char) tm->tm_mon + 1; y = tm->tm_year + 1900; hh = (char) tm->tm_hour; mm = (char) tm->tm_min; ss = (char) tm->tm_sec; #ifndef WORDS_BIGENDIAN sz = COB_BSWAP_64 (sz); y = COB_BSWAP_16 (y); #endif memcpy (file_info, &sz, 8); file_info[8] = d; file_info[9] = m; memcpy (file_info+10, &y, 2); file_info[12] = hh; file_info[13] = mm; file_info[14] = ss; file_info[15] = 0; return 0; } int CBL_RENAME_FILE (unsigned char *fname1, unsigned char *fname2) { char *fn1; char *fn2; int ret; COB_CHK_PARMS (CBL_RENAME_FILE, 2); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } if (!cob_current_module->cob_procedure_parameters[1]) { return -1; } fn1 = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); fn2 = cob_str_from_fld (cob_current_module->cob_procedure_parameters[1]); ret = rename (fn1, fn2); free (fn1); free (fn2); if (ret) { return 128; } return 0; } int CBL_GET_CURRENT_DIR (const int flags, const int dir_length, unsigned char *dir) { char *dirname; int dir_size; int has_space; COB_CHK_PARMS (CBL_GET_CURRENT_DIR, 3); if (dir_length < 1) { return 128; } if (flags) { return 129; } memset (dir, ' ', (size_t)dir_length); dirname = getcwd (NULL, 0); if (dirname == NULL) { return 128; } dir_size = (int) strlen (dirname); has_space = 0; if (strchr (dirname, ' ')) { has_space = 2; } if (dir_size + has_space > dir_length) { free (dirname); return 128; } if (has_space) { *dir = '"'; memcpy (&dir[1], dirname, (size_t)dir_size); dir[dir_size + 1] = '"'; } else { memcpy (dir, dirname, (size_t)dir_size); } free (dirname); return 0; } int CBL_CREATE_DIR (unsigned char *dir) { char *fn; int ret; COB_CHK_PARMS (CBL_CREATE_DIR, 1); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); #ifdef _WIN32 ret = mkdir (fn); #else ret = mkdir (fn, 0770); #endif free (fn); if (ret) { return 128; } return 0; } int CBL_CHANGE_DIR (unsigned char *dir) { char *fn; int ret; COB_CHK_PARMS (CBL_CHANGE_DIR, 1); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); ret = chdir (fn); free (fn); if (ret) { return 128; } return 0; } int CBL_DELETE_DIR (unsigned char *dir) { char *fn; int ret; COB_CHK_PARMS (CBL_DELETE_DIR, 1); if (!cob_current_module->cob_procedure_parameters[0]) { return -1; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); ret = rmdir (fn); free (fn); if (ret) { return 128; } return 0; } int cob_acuw_mkdir (unsigned char *dir) { int ret; COB_CHK_PARMS (C$MAKEDIR, 1); ret = CBL_CREATE_DIR (dir); if (ret < 0) { ret = 128; } return ret; } int cob_acuw_chdir (unsigned char *dir, unsigned char *status) { int ret; COB_CHK_PARMS (C$CHDIR, 2); ret = CBL_CHANGE_DIR (dir); if (ret < 0) { ret = 128; } cob_set_int (cob_current_module->cob_procedure_parameters[1], ret); return ret; } int cob_acuw_copyfile (unsigned char *fname1, unsigned char *fname2, unsigned char *file_type) { int ret = 128; /* RXW - Type is not yet evaluated */ COB_CHK_PARMS (C$COPY, 3); if (cob_call_params < 3) { return 128; } ret = CBL_COPY_FILE (fname1, fname2); if (ret < 0) { ret = 128; } return ret; } int cob_acuw_file_info (unsigned char *file_name, unsigned char *file_info) { char *fn; struct tm *tm; unsigned long long sz; unsigned int dt; short y; short d, m, hh, mm, ss; struct stat st; COB_CHK_PARMS (C$FILEINFO, 2); if (cob_call_params < 2 || !cob_current_module->cob_procedure_parameters[0]) { return 128; } fn = cob_str_from_fld (cob_current_module->cob_procedure_parameters[0]); if (stat (fn, &st) < 0) { free (fn); return 35; } free (fn); sz = st.st_size; tm = localtime (&st.st_mtime); d = tm->tm_mday; m = tm->tm_mon + 1; y = tm->tm_year + 1900; hh = tm->tm_hour; mm = tm->tm_min; ss = tm->tm_sec; #ifndef WORDS_BIGENDIAN sz = COB_BSWAP_64 (sz); #endif memcpy (file_info, &sz, 8); dt = (y * 10000) + (m * 100) + d; #ifndef WORDS_BIGENDIAN dt = COB_BSWAP_32 (dt); #endif memcpy (file_info + 8, &dt, 4); dt = (hh * 1000000) + (mm * 10000) + (ss * 100); #ifndef WORDS_BIGENDIAN dt = COB_BSWAP_32 (dt); #endif memcpy (file_info + 12, &dt, 4); return 0; } int cob_acuw_file_delete (unsigned char *file_name, unsigned char *file_type) { int ret; /* RXW - Type is not yet evaluated */ COB_CHK_PARMS (C$DELETE, 2); if (cob_call_params < 2 || !cob_current_module->cob_procedure_parameters[0]) { return 128; } ret = CBL_DELETE_FILE (file_name); if (ret < 0) { ret = 128; } return ret; } /* SORT */ static int sort_cmps (const unsigned char *s1, const unsigned char *s2, const size_t size, const unsigned char *col) { size_t i; int ret; if (unlikely(col)) { for (i = 0; i < size; i++) { if ((ret = col[s1[i]] - col[s2[i]]) != 0) { return ret; } } } else { for (i = 0; i < size; i++) { if ((ret = s1[i] - s2[i]) != 0) { return ret; } } } return 0; } static COB_INLINE void unique_copy (unsigned char *s1, unsigned char *s2) { size_t size = sizeof(size_t); do { *s1++ = *s2++; } while (--size); } static int cob_file_sort_compare (struct cobitem *k1, struct cobitem *k2, void *pointer) { cob_file *f; size_t i; int cmp; size_t u1; size_t u2; cob_field f1; cob_field f2; f = pointer; for (i = 0; i < f->nkeys; i++) { f1 = f2 = *(f->keys[i].field); f1.data = k1->item + f->keys[i].offset; f2.data = k2->item + f->keys[i].offset; if (COB_FIELD_IS_NUMERIC(&f1)) { cmp = cob_numeric_cmp (&f1, &f2); } else { cmp = sort_cmps (f1.data, f2.data, f1.size, f->sort_collating); } if (cmp != 0) { return (f->keys[i].flag == COB_ASCENDING) ? cmp : -cmp; } } unique_copy ((unsigned char *)&u1, k1->unique); unique_copy ((unsigned char *)&u2, k2->unique); if (u1 < u2) { return -1; } return 1; } static void cob_free_list (struct cobitem *q) { struct cobitem *next; while (q != NULL) { next = q->next; free (q); q = next; } } static struct cobitem * cob_new_item (struct cobsort *hp, size_t size) { struct cobitem *q; if (hp->empty != NULL) { q = hp->empty; hp->empty = q->next; } else { q = cob_malloc (size); } return q; } static FILE * COB_NOINLINE cob_tmpfile (void) { FILE *fp; const char *s; int fd; char *filename; #ifdef _WIN32 char *tmpdir; #endif filename = cob_malloc (COB_MEDIUM_BUFF); #ifdef _WIN32 /* get temporary directory */ tmpdir = cob_malloc (COB_MEDIUM_BUFF); if ((s = getenv ("TMPDIR")) != NULL || (s = getenv ("TMP")) != NULL || (s = getenv ("TEMP")) != NULL) { strncpy (tmpdir, s, COB_MEDIUM_MAX); } else { GetTempPath (COB_MEDIUM_BUFF, tmpdir); } /* get temporary file name */ GetTempFileName (tmpdir, "cob", 0, filename); DeleteFile (filename); free (tmpdir); fd = _open (filename, _O_CREAT | _O_TRUNC | _O_RDWR | _O_BINARY, 0660); #else if ((s = getenv ("TMPDIR")) == NULL && (s = getenv ("TMP")) == NULL && (s = getenv ("TEMP")) == NULL) { s = "/tmp"; } if (cob_process_id == 0) { cob_process_id = getpid (); } snprintf (filename, COB_MEDIUM_MAX, "%s/cobsort%d_%d", s, cob_process_id, cob_iteration); cob_iteration++; fd = open (filename, O_CREAT | O_TRUNC | O_RDWR | O_BINARY | O_LARGEFILE, 0660); #endif if (fd < 0) { free (filename); return NULL; } #ifdef _WIN32 _unlink (filename); fp = _fdopen (fd, "w+b"); if (!fp) { _close (fd); } #else unlink (filename); fp = fdopen (fd, "w+b"); if (!fp) { close (fd); } #endif free (filename); return fp; } static int COB_NOINLINE cob_get_temp_file (struct cobsort *hp, const int n) { if (hp->file[n].fp == NULL) { hp->file[n].fp = cob_tmpfile (); if (hp->file[n].fp == NULL) { cob_runtime_error ("SORT is unable to acquire temporary file"); cob_stop_run (1); } } else { rewind (hp->file[n].fp); } hp->file[n].count = 0; return hp->file[n].fp == NULL; } static int cob_sort_queues (struct cobsort *hp) { struct cobitem *q; int source = 0; int destination; int move; int n; int end_of_block[2]; while (hp->queue[source + 1].count != 0) { destination = source ^ 2; hp->queue[destination].count = hp->queue[destination + 1].count = 0; hp->queue[destination].first = hp->queue[destination + 1].first = NULL; while (1) { end_of_block[0] = hp->queue[source].count == 0; end_of_block[1] = hp->queue[source + 1].count == 0; if (end_of_block[0] && end_of_block[1]) { break; } while (!end_of_block[0] || !end_of_block[1]) { if (end_of_block[0]) { move = 1; } else if (end_of_block[1]) { move = 0; } else { n = cob_file_sort_compare (hp->queue[source].first, hp->queue[source + 1].first, hp->pointer); move = n < 0 ? 0 : 1; } q = hp->queue[source + move].first; if (q->end_of_block) { end_of_block[move] = 1; } hp->queue[source + move].first = q->next; if (hp->queue[destination].first == NULL) { hp->queue[destination].first = q; } else { hp->queue[destination].last->next = q; } hp->queue[destination].last = q; hp->queue[source + move].count--; hp->queue[destination].count++; q->next = NULL; q->end_of_block = 0; } hp->queue[destination].last->end_of_block = 1; destination ^= 1; } source = destination & 2; } return source; } static int cob_read_item (struct cobsort *hp, const int n) { FILE *fp = hp->file[n].fp; if (getc (fp) != 0) { hp->queue[n].first->end_of_block = 1; } else { hp->queue[n].first->end_of_block = 0; if (unlikely(fread (hp->queue[n].first->unique, hp->r_size, 1, fp) != 1)) { return 1; } } return 0; } static int cob_write_block (struct cobsort *hp, const int n) { struct cobitem *q; FILE *fp = hp->file[hp->destination_file].fp; while (1) { q = hp->queue[n].first; if (q == NULL) { break; } if (unlikely(fwrite (&(q->block_byte), hp->w_size, 1, fp) != 1)) { return 1; } hp->queue[n].first = q->next; q->next = hp->empty; hp->empty = q; } hp->queue[n].count = 0; hp->file[hp->destination_file].count++; if (putc (1, fp) != 1) { return 1; } return 0; } static void cob_copy_check (cob_file *to, cob_file *from) { unsigned char *toptr; unsigned char *fromptr; size_t tosize; size_t fromsize; toptr = to->record->data; fromptr = from->record->data; tosize = to->record->size; fromsize = from->record->size; if (unlikely(tosize > fromsize)) { memcpy (toptr, fromptr, fromsize); memset (toptr + fromsize, ' ', tosize - fromsize); } else { memcpy (toptr, fromptr, tosize); } } static int cob_file_sort_process (struct cobsort *hp) { int i; int source; int destination; int n; int move; int res; hp->retrieving = 1; n = cob_sort_queues (hp); /* RXW - Cannot be true if (unlikely(n < 0)) { return COBSORTABORT; } */ if (likely(!hp->files_used)) { hp->retrieval_queue = n; return 0; } if (unlikely(cob_write_block (hp, n))) { return COBSORTFILEERR; } for (i = 0; i < 4; i++) { hp->queue[i].first = hp->empty; hp->empty = hp->empty->next; hp->queue[i].first->next = NULL; } rewind (hp->file[0].fp); rewind (hp->file[1].fp); if (unlikely(cob_get_temp_file (hp, 2))) { return COBSORTFILEERR; } if (unlikely(cob_get_temp_file (hp, 3))) { return COBSORTFILEERR; } source = 0; while (hp->file[source].count > 1) { destination = source ^ 2; hp->file[destination].count = 0; hp->file[destination + 1].count = 0; while (hp->file[source].count > 0) { if (unlikely(cob_read_item (hp, source))) { return COBSORTFILEERR; } if (hp->file[source + 1].count > 0) { if (unlikely(cob_read_item (hp, source + 1))) { return COBSORTFILEERR; } } else { hp->queue[source + 1].first->end_of_block = 1; } while (!hp->queue[source].first->end_of_block || !hp->queue[source + 1].first->end_of_block) { if (hp->queue[source].first->end_of_block) { move = 1; } else if (hp->queue[source + 1].first->end_of_block) { move = 0; } else { res = cob_file_sort_compare (hp->queue[source].first, hp->queue[source + 1].first, hp->pointer); move = res < 0 ? 0 : 1; } if (unlikely(fwrite ( &(hp->queue[source + move].first->block_byte), hp->w_size, 1, hp->file[destination].fp) != 1)) { return COBSORTFILEERR; } if (unlikely(cob_read_item (hp, source + move))) { return COBSORTFILEERR; } } hp->file[destination].count++; if (unlikely(putc (1, hp->file[destination].fp) != 1)) { return COBSORTFILEERR; } hp->file[source].count--; hp->file[source + 1].count--; destination ^= 1; } source = destination & 2; rewind (hp->file[0].fp); rewind (hp->file[1].fp); rewind (hp->file[2].fp); rewind (hp->file[3].fp); } hp->retrieval_queue = source; if (unlikely(cob_read_item (hp, source))) { return COBSORTFILEERR; } if (unlikely(cob_read_item (hp, source + 1))) { return COBSORTFILEERR; } return 0; } static int cob_file_sort_submit (cob_file *f, const unsigned char *p) { struct cobsort *hp; /* RXW - See comment lines below size_t i; */ struct cobitem *q; struct memory_struct *z; int n; hp = f->file; if (unlikely(!hp)) { return COBSORTNOTOPEN; } if (unlikely(hp->retrieving)) { return COBSORTABORT; /* RXW - This was a facility to submit new items after retrieval had begun for (i = 0; i < 4; i++) { if (hp->queue[i].first != NULL) { hp->queue[i].last->next = hp->empty; hp->empty = hp->queue[i].first; hp->queue[i].first = NULL; } } hp->queue[0].count = hp->queue[1].count = 0; hp->destination_file = -1; hp->retrieving = 0; hp->files_used = 0; */ } if (hp->queue[0].count + hp->queue[1].count >= hp->memory) { if (!hp->files_used) { if (unlikely(cob_get_temp_file (hp, 0))) { return COBSORTFILEERR; } if (unlikely(cob_get_temp_file (hp, 1))) { return COBSORTFILEERR; } hp->files_used = 1; hp->destination_file = 0; } n = cob_sort_queues (hp); /* RXW - Cannot be true if (unlikely(n < 0)) { return COBSORTABORT; } */ if (unlikely(cob_write_block (hp, n))) { return COBSORTFILEERR; } hp->destination_file ^= 1; } q = cob_new_item (hp, sizeof (struct cobitem) + hp->size); q->end_of_block = 1; unique_copy (q->unique, (unsigned char *)&(hp->unique)); hp->unique++; memcpy (q->item, p, hp->size); if (hp->queue[0].count <= hp->queue[1].count) { z = &hp->queue[0]; } else { z = &hp->queue[1]; } q->next = z->first; z->first = q; z->count++; return 0; } static int cob_file_sort_retrieve (cob_file *f, unsigned char *p) { struct cobsort *hp; struct cobitem *next; struct memory_struct *z; int move; int source; int res; hp = f->file; if (unlikely(!hp)) { return COBSORTNOTOPEN; } if (unlikely(!hp->retrieving)) { res = cob_file_sort_process (hp); if (res) { return res; } } if (unlikely(hp->files_used)) { source = hp->retrieval_queue; if (hp->queue[source].first->end_of_block) { if (hp->queue[source + 1].first->end_of_block) { return COBSORTEND; } move = 1; } else if (hp->queue[source + 1].first->end_of_block) { move = 0; } else { res = cob_file_sort_compare (hp->queue[source].first, hp->queue[source + 1].first, hp->pointer); move = res < 0 ? 0 : 1; } memcpy (p, hp->queue[source + move].first->item, hp->size); if (unlikely(cob_read_item (hp, source + move))) { return COBSORTFILEERR; } } else { z = &hp->queue[hp->retrieval_queue]; if (z->first == NULL) { return COBSORTEND; } memcpy (p, z->first->item, hp->size); next = z->first->next; z->first->next = hp->empty; hp->empty = z->first; z->first = next; } return 0; } void cob_file_sort_using (cob_file *sort_file, cob_file *data_file) { int ret; cob_open (data_file, COB_OPEN_INPUT, 0, NULL); while (1) { cob_read (data_file, NULL, NULL, COB_READ_NEXT); if (data_file->file_status[0] != '0') { break; } cob_copy_check (sort_file, data_file); ret = cob_file_sort_submit (sort_file, sort_file->record->data); if (ret) { break; } } cob_close (data_file, COB_CLOSE_NORMAL, NULL); } void cob_file_sort_giving (cob_file *sort_file, const size_t varcnt, ...) { cob_file **fbase; struct cobsort *hp; size_t i; int ret; int opt; va_list args; fbase = cob_malloc (varcnt * sizeof(cob_file *)); va_start (args, varcnt); for (i = 0; i < varcnt; i++) { fbase[i] = va_arg (args, cob_file *); } va_end (args); for (i = 0; i < varcnt; i++) { cob_open (fbase[i], COB_OPEN_OUTPUT, 0, NULL); } while (1) { ret = cob_file_sort_retrieve (sort_file, sort_file->record->data); if (ret) { if (ret == COBSORTEND) { sort_file->file_status[0] = '1'; sort_file->file_status[1] = '0'; } else { hp = sort_file->file; *(int *)(hp->sort_return) = 16; sort_file->file_status[0] = '3'; sort_file->file_status[1] = '0'; } break; } for (i = 0; i < varcnt; i++) { if (fbase[i]->special || fbase[i]->organization == COB_ORG_LINE_SEQUENTIAL) { opt = COB_WRITE_BEFORE | COB_WRITE_LINES | 1; } else { opt = 0; } cob_copy_check (fbase[i], sort_file); cob_write (fbase[i], fbase[i]->record, opt, NULL); } } for (i = 0; i < varcnt; i++) { cob_close (fbase[i], COB_CLOSE_NORMAL, NULL); } free (fbase); } void cob_file_sort_init (cob_file *f, const int nkeys, const unsigned char *collating_sequence, void *sort_return, cob_field *fnstatus) { struct cobsort *p; p = cob_malloc (sizeof (struct cobsort)); p->fnstatus = fnstatus; p->size = f->record_max; p->r_size = f->record_max + sizeof(size_t); p->w_size = f->record_max + sizeof(size_t) + 1; p->pointer = f; p->sort_return = sort_return; *(int *)sort_return = 0; p->memory = (size_t)cob_sort_memory / (p->size + sizeof(struct cobitem)); f->file = p; f->keys = cob_malloc (sizeof (struct cob_file_key) * nkeys); f->nkeys = 0; if (collating_sequence) { f->sort_collating = collating_sequence; } else { f->sort_collating = cob_current_module->collating_sequence; } RETURN_STATUS (COB_STATUS_00_SUCCESS); } void cob_file_sort_init_key (cob_file *f, const int flag, cob_field *field, size_t offset) { f->keys[f->nkeys].flag = flag; f->keys[f->nkeys].field = field; f->keys[f->nkeys].offset = offset; f->nkeys++; } void cob_file_sort_close (cob_file *f) { struct cobsort *hp; cob_field *fnstatus = NULL; size_t i; hp = f->file; if (likely(hp)) { fnstatus = hp->fnstatus; cob_free_list (hp->empty); for (i = 0; i < 4; i++) { cob_free_list (hp->queue[i].first); if (hp->file[i].fp != NULL) { fclose (hp->file[i].fp); } } free (hp); } f->file = NULL; RETURN_STATUS (COB_STATUS_00_SUCCESS); } void cob_file_release (cob_file *f) { struct cobsort *hp; cob_field *fnstatus = NULL; int ret; hp = f->file; if (likely(hp)) { fnstatus = hp->fnstatus; } ret = cob_file_sort_submit (f, f->record->data); switch (ret) { case 0: RETURN_STATUS (COB_STATUS_00_SUCCESS); break; default: if (likely(hp)) { *(int *)(hp->sort_return) = 16; } RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); break; } } void cob_file_return (cob_file *f) { struct cobsort *hp; cob_field *fnstatus = NULL; int ret; hp = f->file; if (likely(hp)) { fnstatus = hp->fnstatus; } ret = cob_file_sort_retrieve (f, f->record->data); switch (ret) { case 0: RETURN_STATUS (COB_STATUS_00_SUCCESS); break; case COBSORTEND: RETURN_STATUS (COB_STATUS_10_END_OF_FILE); break; default: if (likely(hp)) { *(int *)(hp->sort_return) = 16; } RETURN_STATUS (COB_STATUS_30_PERMANENT_ERROR); break; } } open-cobol-1.1/libcob/fileio.h0000644000000000000000000002244011134620304011705 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_FILEIO_H #define COB_FILEIO_H #include /* File version */ #define COB_FILE_VERSION 0 #define COB_EQ 1 /* x == y */ #define COB_LT 2 /* x < y */ #define COB_LE 3 /* x <= y */ #define COB_GT 4 /* x > y */ #define COB_GE 5 /* x >= y */ #define COB_NE 6 /* x != y */ #define COB_ASCENDING 0 #define COB_DESCENDING 1 #define COB_FILE_MODE 0644 /* Organization */ #define COB_ORG_SEQUENTIAL 0 #define COB_ORG_LINE_SEQUENTIAL 1 #define COB_ORG_RELATIVE 2 #define COB_ORG_INDEXED 3 #define COB_ORG_SORT 4 #define COB_ORG_MAX 5 /* Access mode */ #define COB_ACCESS_SEQUENTIAL 1 #define COB_ACCESS_DYNAMIC 2 #define COB_ACCESS_RANDOM 3 /* SELECT features */ #define COB_SELECT_FILE_STATUS 0x01 #define COB_SELECT_EXTERNAL 0x02 #define COB_SELECT_LINAGE 0x04 #define COB_SELECT_SPLITKEY 0x08 /* Lock mode */ #define COB_LOCK_EXCLUSIVE 1 #define COB_LOCK_MANUAL 2 #define COB_LOCK_AUTOMATIC 4 #define COB_LOCK_MULTIPLE 8 #define COB_LOCK_MASK 0x7 /* Open mode */ #define COB_OPEN_CLOSED 0 #define COB_OPEN_INPUT 1 #define COB_OPEN_OUTPUT 2 #define COB_OPEN_I_O 3 #define COB_OPEN_EXTEND 4 #define COB_OPEN_LOCKED 5 /* Close options */ #define COB_CLOSE_NORMAL 0 #define COB_CLOSE_LOCK 1 #define COB_CLOSE_NO_REWIND 2 #define COB_CLOSE_UNIT 3 #define COB_CLOSE_UNIT_REMOVAL 4 /* Write options */ #define COB_WRITE_MASK 0x0000ffff #define COB_WRITE_LINES 0x00010000 #define COB_WRITE_PAGE 0x00020000 #define COB_WRITE_CHANNEL 0x00040000 #define COB_WRITE_AFTER 0x00100000 #define COB_WRITE_BEFORE 0x00200000 #define COB_WRITE_EOP 0x00400000 #define COB_WRITE_LOCK 0x00800000 /* Read options */ #define COB_READ_NEXT 0x01 #define COB_READ_PREVIOUS 0x02 #define COB_READ_FIRST 0x04 #define COB_READ_LAST 0x08 #define COB_READ_LOCK 0x10 #define COB_READ_NO_LOCK 0x20 #define COB_READ_KEPT_LOCK 0x40 #define COB_READ_WAIT_LOCK 0x80 #define COB_READ_IGNORE_LOCK 0x100 /* I-O status */ #define COB_STATUS_00_SUCCESS 00 #define COB_STATUS_02_SUCCESS_DUPLICATE 02 #define COB_STATUS_04_SUCCESS_INCOMPLETE 04 #define COB_STATUS_05_SUCCESS_OPTIONAL 05 #define COB_STATUS_07_SUCCESS_NO_UNIT 07 #define COB_STATUS_10_END_OF_FILE 10 #define COB_STATUS_14_OUT_OF_KEY_RANGE 14 #define COB_STATUS_21_KEY_INVALID 21 #define COB_STATUS_22_KEY_EXISTS 22 #define COB_STATUS_23_KEY_NOT_EXISTS 23 #define COB_STATUS_30_PERMANENT_ERROR 30 #define COB_STATUS_31_INCONSISTENT_FILENAME 31 #define COB_STATUS_34_BOUNDARY_VIOLATION 34 #define COB_STATUS_35_NOT_EXISTS 35 #define COB_STATUS_37_PERMISSION_DENIED 37 #define COB_STATUS_38_CLOSED_WITH_LOCK 38 #define COB_STATUS_39_CONFLICT_ATTRIBUTE 39 #define COB_STATUS_41_ALREADY_OPEN 41 #define COB_STATUS_42_NOT_OPEN 42 #define COB_STATUS_43_READ_NOT_DONE 43 #define COB_STATUS_44_RECORD_OVERFLOW 44 #define COB_STATUS_46_READ_ERROR 46 #define COB_STATUS_47_INPUT_DENIED 47 #define COB_STATUS_48_OUTPUT_DENIED 48 #define COB_STATUS_49_I_O_DENIED 49 #define COB_STATUS_51_RECORD_LOCKED 51 #define COB_STATUS_52_EOP 52 #define COB_STATUS_57_I_O_LINAGE 57 #define COB_STATUS_61_FILE_SHARING 61 #define COB_STATUS_91_NOT_AVAILABLE 91 /* Special status */ /* Need some value that does not conflict with errno for OPEN/LINAGE */ #define COB_LINAGE_INVALID 16384 /* Need value that does not conflict with errno 30 (EROFS) for OPEN */ #define COB_NOT_CONFIGURED 32768 /* File connector */ struct cob_file_key { cob_field *field; /* key field */ int flag; /* WITH DUPLICATES (for RELATIVE/INDEXED) */ /* ASCENDING/DESCENDING (for SORT) */ size_t offset; /* Offset of field */ }; struct linage_struct { cob_field *linage; /* LINAGE */ cob_field *linage_ctr; /* LINAGE-COUNTER */ cob_field *latfoot; /* LINAGE FOOTING */ cob_field *lattop; /* LINAGE AT TOP */ cob_field *latbot; /* LINAGE AT BOTTOM */ int lin_lines; /* Current Linage */ int lin_foot; /* Current Footage */ int lin_top; /* Current Top */ int lin_bot; /* Current Bottom */ }; typedef struct { const char *select_name; /* Name in SELECT */ unsigned char *file_status; /* FILE STATUS */ cob_field *assign; /* ASSIGN TO */ cob_field *record; /* record area */ cob_field *record_size; /* record size depending on */ struct cob_file_key *keys; /* RELATIVE/RECORD/SORT keys */ void *file; /* file specific data pointer */ void *linorkeyptr; /* LINAGE pointer or SPLIT KEY */ const unsigned char *sort_collating; /* SORT collating */ void *extfh_ptr; /* For EXTFH usage */ size_t record_min; /* record min size */ size_t record_max; /* record max size */ size_t nkeys; /* the number of keys */ char organization; /* ORGANIZATION */ char access_mode; /* ACCESS MODE */ char lock_mode; /* LOCKMODE */ char open_mode; /* OPEN MODE */ char flag_optional; /* OPTIONAL */ char last_open_mode; /* open mode given by OPEN */ char special; /* Special file */ char flag_nonexistent; /* nonexistent file */ char flag_end_of_file; /* reached the end of file */ char flag_begin_of_file; /* reached beginning of file */ char flag_first_read; /* first READ after OPEN/START */ char flag_read_done; /* last READ successfully done */ char flag_select_features; /* SELECT features */ char flag_needs_nl; /* LS file needs NL at close */ char flag_needs_top; /* Linage needs top */ char file_version; /* File I/O version */ } cob_file; /* File I-O functions */ /* Struct cob_fileio_funcs (*open) (file, filename, mode, sharing); (*close) (file, opt); (*start) (file, cond, key); (*read) (file, key, read_opts); (*read next) (file, read_opts); (*write) (file, opt); (*rewrite) (file, opt); (*delete) (file); */ struct cob_fileio_funcs { int (*open) (cob_file *, char *, const int, const int); int (*close) (cob_file *, const int); int (*start) (cob_file *, const int, cob_field *); int (*read) (cob_file *, cob_field *, int); int (*read_next) (cob_file *, int); int (*write) (cob_file *, const int); int (*rewrite) (cob_file *, const int); int (*fdelete) (cob_file *); }; DLL_EXPIMP extern cob_file *cob_error_file; extern void cob_default_error_handle (void); extern void cob_open (cob_file *, const int, const int, cob_field *); extern void cob_close (cob_file *, const int, cob_field *); extern void cob_read (cob_file *, cob_field *, cob_field *, int); extern void cob_write (cob_file *, cob_field *, const int, cob_field *); extern void cob_rewrite (cob_file *, cob_field *, const int, cob_field *); extern void cob_delete (cob_file *, cob_field *); extern void cob_start (cob_file *, const int, cob_field *, cob_field *); extern void cob_unlock_file (cob_file *, cob_field *); extern void cob_commit (void); extern void cob_rollback (void); /* System routines */ extern int CBL_OPEN_FILE (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); extern int CBL_CREATE_FILE (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); extern int CBL_READ_FILE (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); extern int CBL_WRITE_FILE (unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); extern int CBL_CLOSE_FILE (unsigned char *); extern int CBL_FLUSH_FILE (unsigned char *); extern int CBL_DELETE_FILE (unsigned char *); extern int CBL_COPY_FILE (unsigned char *, unsigned char *); extern int CBL_CHECK_FILE_EXIST (unsigned char *, unsigned char *); extern int CBL_RENAME_FILE (unsigned char *, unsigned char *); extern int CBL_GET_CURRENT_DIR (const int, const int, unsigned char *); extern int CBL_CHANGE_DIR (unsigned char *); extern int CBL_CREATE_DIR (unsigned char *); extern int CBL_DELETE_DIR (unsigned char *); extern int cob_acuw_chdir (unsigned char *, unsigned char *); extern int cob_acuw_mkdir (unsigned char *); extern int cob_acuw_copyfile (unsigned char *, unsigned char *, unsigned char *); extern int cob_acuw_file_info (unsigned char *, unsigned char *); extern int cob_acuw_file_delete (unsigned char *, unsigned char *); /* SORT */ extern void cob_file_sort_init (cob_file *, const int, const unsigned char *, void *, cob_field *); extern void cob_file_sort_init_key (cob_file *, const int, cob_field *, size_t); extern void cob_file_sort_close (cob_file *); extern void cob_file_sort_using (cob_file *, cob_file *); extern void cob_file_sort_giving (cob_file *, const size_t, ...); extern void cob_file_release (cob_file *); extern void cob_file_return (cob_file *); #endif /* COB_FILEIO_H */ open-cobol-1.1/libcob/call.c0000644000000000000000000003465411137664206011372 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If not write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include "defaults.h" #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include /* NOTE - The following variable should be uncommented when it is known that dlopen(NULL) is borked. This is known to be true for some PA-RISC HP-UX 11.11 systems. This is fixed with HP patch PHSS_28871. (There are newer but this fixes dlopen/dlsym problems) */ /* #define COB_BORKED_DLOPEN */ #ifdef USE_LIBDL #define __USE_GNU 1 #include #define lt_dlopen(x) dlopen(x, RTLD_LAZY | RTLD_GLOBAL) #define lt_dlsym(x, y) dlsym(x, y) #define lt_dlclose(x) dlclose(x) #define lt_dlerror() dlerror() #define lt_dlhandle void * #elif defined(_WIN32) #define WINDOWS_LEAN_AND_MEAN #include /* Prototype */ static char * lt_dlerror (void); static HMODULE lt_dlopen (const char *x) { if (x == NULL) { return GetModuleHandle (NULL); } return LoadLibrary(x); } #define lt_dlsym(x, y) GetProcAddress(x, y) #define lt_dlclose(x) FreeLibrary(x) static char errbuf[64]; static char * lt_dlerror () { sprintf(errbuf, "LoadLibrary/GetProcAddress error %d", (int)GetLastError()); return errbuf; } #define lt_dlinit() #define lt_dlhandle HMODULE #else #define LT_NON_POSIX_NAMESPACE 1 #include #endif #include "call.h" #include "common.h" #include "coblocal.h" #include "fileio.h" #ifdef _MSC_VER #define PATHSEPC ';' #define PATHSEPS ";" #else #define PATHSEPC ':' #define PATHSEPS ":" #endif #define COB_MAX_COBCALL_PARMS 16 #define CALL_BUFF_SIZE 256 #define CALL_FILEBUFF_SIZE 2048 /* Local variables */ static char **resolve_path = NULL; static char *resolve_error = NULL; static char *resolve_error_buff = NULL; static lt_dlhandle mainhandle = NULL; static size_t name_convert = 0; static size_t resolve_size = 0; static size_t cobjmp_primed = 0; static void *call_buffer; static char *call_filename_buff; static char *call_entry_buff; static unsigned char *call_entry2_buff; static size_t call_lastsize; #if defined (_WIN32) || !defined (RTLD_DEFAULT) struct struct_handle { struct struct_handle *next; lt_dlhandle preload_handle; }; static struct struct_handle *pre_handle = NULL; #endif /* * Call table */ #define HASH_SIZE 131 struct call_hash { struct call_hash *next; const char *name; void *func; void *cancel; size_t flag_is_active; }; #ifdef COB_ALT_HASH static struct call_hash *call_table = NULL; #else static struct call_hash **call_table = NULL; #endif struct system_table { const char *syst_name; void *syst_call; }; #undef COB_SYSTEM_GEN #define COB_SYSTEM_GEN(x, y, z) { x, (void *)z }, static const struct system_table system_tab[] = { #include "system.def" { NULL, NULL } }; #undef COB_SYSTEM_GEN /* Local functions */ static void * COB_NOINLINE cob_strdup (const void *stptr) { void *mptr; size_t len; len = strlen (stptr) + 1; mptr = cob_malloc (len); memcpy (mptr, stptr, len); return mptr; } static void cob_set_library_path (const char *path) { char *p; size_t i; /* clear the previous path */ if (resolve_path) { free (resolve_path[0]); free (resolve_path); } /* count the number of separators */ resolve_size = 1; for (p = strchr (path, PATHSEPC); p; p = strchr (p + 1, PATHSEPC)) { resolve_size++; } /* build path array */ p = cob_strdup (path); resolve_path = cob_malloc (sizeof (char *) * resolve_size); resolve_path[0] = strtok (p, PATHSEPS); for (i = 1; i < resolve_size; ++i) { resolve_path[i] = strtok (NULL, PATHSEPS); } } static void * cob_get_buff (const size_t buffsize) { if (buffsize > call_lastsize) { call_lastsize = buffsize; free (call_buffer); call_buffer = cob_malloc (buffsize); } return call_buffer; } #if defined (_WIN32) || !defined (RTLD_DEFAULT) static void cache_handle (lt_dlhandle libhandle) { struct struct_handle *newhandle; newhandle = cob_malloc (sizeof (struct struct_handle)); newhandle->preload_handle = libhandle; newhandle->next = pre_handle; pre_handle = newhandle; } #endif #ifndef COB_ALT_HASH static COB_INLINE size_t hash (const unsigned char *s) { size_t val = 0; while (*s) { val += *s++; } return val % HASH_SIZE; } #endif static void insert (const char *name, void *func, void *cancel) { struct call_hash *p; #ifndef COB_ALT_HASH size_t val; #endif p = cob_malloc (sizeof (struct call_hash)); p->name = cob_strdup (name); p->func = func; p->cancel = cancel; #ifdef COB_ALT_HASH p->next = call_table; call_table = p; #else val = hash ((const unsigned char *)name); p->next = call_table[val]; call_table[val] = p; #endif } static void * lookup (const char *name) { struct call_hash *p; #ifdef COB_ALT_HASH for (p = call_table; p; p = p->next) { #else for (p = call_table[hash ((const unsigned char *)name)]; p; p = p->next) { #endif if (strcmp (name, p->name) == 0) { return p->func; } } return NULL; } const char * cob_resolve_error (void) { const char *p = resolve_error; resolve_error = NULL; return p; } void cob_call_error (void) { const char *s; s = cob_resolve_error (); if (!s) { s = "Unknown error"; } cob_runtime_error ("%s", s); cob_stop_run (1); } void cob_set_cancel (const char *name, void *entry, void *cancel) { struct call_hash *p; #ifdef COB_ALT_HASH for (p = call_table; p; p = p->next) { #else for (p = call_table[hash ((const unsigned char *)name)]; p; p = p->next) { #endif if (strcmp (name, p->name) == 0) { p->cancel = cancel; return; } } insert (name, entry, cancel); } void * cob_resolve (const char *name) { unsigned char *p; const unsigned char *s; void *func; #if defined (_WIN32) || !defined (RTLD_DEFAULT) struct struct_handle *chkhandle; #endif lt_dlhandle handle; size_t i; struct stat st; /* Checked in generated code if (!cob_initialized) { fputs ("cob_init() must be called before cob_resolve()", stderr); cob_stop_run (1); } */ /* search the cache */ cob_exception_code = 0; func = lookup (name); if (func) { return func; } /* encode program name */ p = (unsigned char *)call_entry_buff; s = (const unsigned char *)name; if (unlikely(isdigit (*s))) { p += sprintf ((char *)p, "_%02X", *s++); } for (; *s; ++s) { if (likely(isalnum (*s) || *s == '_')) { *p++ = *s; } else if (*s == '-') { *p++ = '_'; *p++ = '_'; } else { p += sprintf ((char *)p, "_%02X", *s); } } *p = 0; /* search the main program */ if (mainhandle != NULL && (func = lt_dlsym (mainhandle, call_entry_buff)) != NULL) { insert (name, func, NULL); resolve_error = NULL; return func; } /* Search preloaded modules */ #if defined (_WIN32) || !defined (RTLD_DEFAULT) for (chkhandle = pre_handle; chkhandle; chkhandle = chkhandle->next) { if ((func = lt_dlsym (chkhandle->preload_handle, call_entry_buff)) != NULL) { insert (name, func, NULL); resolve_error = NULL; return func; } } #endif #if defined(USE_LIBDL) && defined (RTLD_DEFAULT) if ((func = lt_dlsym (RTLD_DEFAULT, call_entry_buff)) != NULL) { insert (name, func, NULL); resolve_error = NULL; return func; } #endif s = (const unsigned char *)name; if (unlikely(name_convert != 0)) { s = (const unsigned char *)name; p = call_entry2_buff; for (; *s; ++s) { if (name_convert == 1 && isupper (*s)) { *p++ = tolower (*s); } else if (name_convert == 2 && islower (*s)) { *p++ = toupper (*s); } else { *p++ = *s; } } *p = 0; s = (const unsigned char *)call_entry2_buff; } /* search external modules */ for (i = 0; i < resolve_size; ++i) { call_filename_buff[CALL_FILEBUFF_SIZE - 1] = 0; if (resolve_path[i] == NULL) { snprintf (call_filename_buff, CALL_FILEBUFF_SIZE - 1, "%s.%s", s, COB_MODULE_EXT); } else { snprintf (call_filename_buff, CALL_FILEBUFF_SIZE - 1, "%s/%s.%s", resolve_path[i], s, COB_MODULE_EXT); } if (stat (call_filename_buff, &st) == 0) { if ((handle = lt_dlopen (call_filename_buff)) != NULL) { #if defined (_WIN32) || !defined (RTLD_DEFAULT) /* Candidate for future calls */ cache_handle (handle); #endif if ((func = lt_dlsym (handle, call_entry_buff)) != NULL) { insert (name, func, NULL); resolve_error = NULL; return func; } } resolve_error_buff[CALL_BUFF_SIZE - 1] = 0; strncpy (resolve_error_buff, lt_dlerror (), CALL_BUFF_SIZE - 1); resolve_error = resolve_error_buff; cob_set_exception (COB_EC_PROGRAM_NOT_FOUND); return NULL; } } resolve_error_buff[CALL_BUFF_SIZE - 1] = 0; snprintf (resolve_error_buff, CALL_BUFF_SIZE - 1, "Cannot find module '%s'", name); resolve_error = resolve_error_buff; cob_set_exception (COB_EC_PROGRAM_NOT_FOUND); return NULL; } void * cob_resolve_1 (const char *name) { void *p; p = cob_resolve (name); if (unlikely(!p)) { cob_call_error (); } return p; } void * cob_call_resolve (const cob_field *f) { char *buff; buff = cob_get_buff (f->size + 1); cob_field_to_string (f, buff); return cob_resolve (buff); } void * cob_call_resolve_1 (const cob_field *f) { void *p; p = cob_call_resolve (f); if (unlikely(!p)) { cob_call_error (); } return p; } void cobcancel (const char *name) { struct call_hash *p; union { int (*cancel_func)(int, ...); void *cancel_void; } unicanc; if (unlikely(!name)) { cob_runtime_error ("NULL name parameter passed to 'cobcancel'"); cob_stop_run (1); } #ifdef COB_ALT_HASH for (p = call_table; p; p = p->next) { #else for (p = call_table[hash ((const unsigned char *)name)]; p; p = p->next) { #endif if (strcmp (name, p->name) == 0) { if (p->cancel && !p->flag_is_active) { unicanc.cancel_void = p->cancel; unicanc.cancel_func (-1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } } } } void cob_field_cancel (const cob_field *f) { char *name; name = cob_get_buff (f->size + 1); cob_field_to_string (f, name); cobcancel (name); } void cob_init_call (void) { char *buff; char *s; char *p; const struct system_table *psyst; #if defined (_WIN32) || !defined (RTLD_DEFAULT) lt_dlhandle libhandle; #endif size_t i; struct stat st; #ifndef USE_LIBDL lt_dlinit (); #endif /* big enough for anything from libdl/libltdl */ resolve_error_buff = cob_malloc (CALL_BUFF_SIZE); #ifndef COB_ALT_HASH call_table = cob_malloc (sizeof (struct call_hash *) * HASH_SIZE); #endif call_filename_buff = cob_malloc (CALL_FILEBUFF_SIZE); call_entry_buff = cob_malloc (COB_SMALL_BUFF); call_entry2_buff = cob_malloc (COB_SMALL_BUFF); s = getenv ("COB_LOAD_CASE"); if (s != NULL) { if (strcasecmp (s, "LOWER") == 0) { name_convert = 1; } else if (strcasecmp (s, "UPPER") == 0) { name_convert = 2; } } buff = cob_malloc (COB_MEDIUM_BUFF); s = getenv ("COB_LIBRARY_PATH"); if (s == NULL) { snprintf (buff, COB_MEDIUM_MAX, ".%s%s", PATHSEPS, COB_LIBRARY_PATH); } else { snprintf (buff, COB_MEDIUM_MAX, "%s%s.%s%s", s, PATHSEPS, PATHSEPS, COB_LIBRARY_PATH); } cob_set_library_path (buff); #ifndef COB_BORKED_DLOPEN mainhandle = lt_dlopen (NULL); #endif s = getenv ("COB_PRE_LOAD"); if (s != NULL) { p = cob_strdup (s); s = strtok (p, PATHSEPS); for (; s; s = strtok (NULL, PATHSEPS)) { for (i = 0; i < resolve_size; ++i) { buff[COB_MEDIUM_MAX] = 0; snprintf (buff, COB_MEDIUM_MAX, "%s/%s.%s", resolve_path[i], s, COB_MODULE_EXT); if (stat (buff, &st) == 0) { #if defined (_WIN32) || !defined (RTLD_DEFAULT) if ((libhandle = lt_dlopen (buff)) != NULL) { cache_handle (libhandle); #else if (lt_dlopen (buff) != NULL) { #endif break; } } } } free (p); } free (buff); call_buffer = cob_malloc (CALL_BUFF_SIZE); call_lastsize = CALL_BUFF_SIZE; for (psyst = (struct system_table *)&system_tab[0]; psyst->syst_name; ++psyst) { insert (psyst->syst_name, psyst->syst_call, NULL); } } int cobcall (const char *name, const int argc, void **argv) { int i; union { void *(*funcptr)(); int (*funcint)(); void *func_void; } unifunc; void *pargv[16]; if (unlikely(!cob_initialized)) { cob_runtime_error ("'cobcall' - Runtime has not been initialized"); cob_stop_run (1); } if (argc < 0 || argc > 16) { cob_runtime_error ("Invalid number of arguments to 'cobcall'"); cob_stop_run (1); } if (unlikely(!name)) { cob_runtime_error ("NULL name parameter passed to 'cobcall'"); cob_stop_run (1); } unifunc.func_void = cob_resolve_1 (name); memset (pargv, 0, sizeof(pargv)); /* Set number of parameters */ cob_call_params = argc; for (i = 0; i < argc; ++i) { pargv[i] = argv[i]; } return unifunc.funcint (pargv[0], pargv[1], pargv[2], pargv[3], pargv[4], pargv[5], pargv[6], pargv[7], pargv[8], pargv[9], pargv[10], pargv[11], pargv[12], pargv[13], pargv[14], pargv[15]); } int cobfunc (const char *name, const int argc, void **argv) { int ret; if (unlikely(!cob_initialized)) { cob_runtime_error ("'cobfunc' - Runtime has not been initialized"); cob_stop_run (1); } ret = cobcall (name, argc, argv); cobcancel (name); return ret; } void * cobsavenv (struct cobjmp_buf *jbuf) { if (unlikely(!jbuf)) { cob_runtime_error ("NULL name parameter passed to 'cobsavenv'"); cob_stop_run (1); } if (cobjmp_primed) { cob_runtime_error ("Multiple call to 'cobsetjmp'"); cob_stop_run (1); } cobjmp_primed = 1; return jbuf->cbj_jmp_buf; } void * cobsavenv2 (struct cobjmp_buf *jbuf, const int jsize) { int jtemp; /* Shut up compiler */ jtemp = jsize; return cobsavenv (jbuf); } void coblongjmp (struct cobjmp_buf *jbuf) { if (unlikely(!jbuf)) { cob_runtime_error ("NULL name parameter passed to 'coblongjmp'"); cob_stop_run (1); } if (!cobjmp_primed) { cob_runtime_error ("Call to 'coblongjmp' with no prior 'cobsetjmp'"); cob_stop_run (1); } cobjmp_primed = 0; longjmp (jbuf->cbj_jmp_buf, 1); } open-cobol-1.1/libcob/call.h0000644000000000000000000000354711134601516011364 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If not write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_CALL_H #define COB_CALL_H #include #include struct cobjmp_buf { int cbj_int[4]; void *cbj_ptr[4]; jmp_buf cbj_jmp_buf; void *cbj_ptr_rest[2]; }; extern void cob_set_cancel (const char *, void *, void *); extern void *cob_resolve (const char *); extern void *cob_resolve_1 (const char *); extern const char *cob_resolve_error (void); extern void *cob_call_resolve (const cob_field *); extern void *cob_call_resolve_1 (const cob_field *); extern void cob_field_cancel (const cob_field *); extern void cobcancel (const char *); extern int cobcall (const char *, const int, void **); extern int cobfunc (const char *, const int, void **); extern void *cobsavenv (struct cobjmp_buf *); extern void *cobsavenv2 (struct cobjmp_buf *, const int); extern void coblongjmp (struct cobjmp_buf *); #define cobsetjmp(x) setjmp (cobsavenv (x)) #ifdef __GNUC__ extern void cob_call_error (void) __attribute__ ((noreturn)); #else extern void cob_call_error (void); #endif #endif /* COB_CALL_H */ open-cobol-1.1/libcob/common.c0000644000000000000000000012413211137355732011737 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include "defaults.h" #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef _WIN32 #define WINDOWS_LEAN_AND_MEAN #include #include #include #undef HAVE_SIGNAL_H #endif #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_LOCALE_H #include #endif #include "common.h" #include "coblocal.h" #include "move.h" #include "numeric.h" #include "termio.h" #include "fileio.h" #include "call.h" #include "screenio.h" #include "intrinsic.h" #include "lib/gettext.h" struct cob_exception { const char *name; const int code; const int critical; }; struct cob_alloc_cache { struct cob_alloc_cache *next; void *cob_pointer; size_t size; }; #define COB_ERRBUF_SIZE 256 /* Local variables */ static int cob_argc = 0; static char **cob_argv = NULL; static struct cob_alloc_cache *cob_alloc_base = NULL; static char *cob_local_env = NULL; static int current_arg = 1; static unsigned char *commlnptr = NULL; static size_t commlncnt = 0; static char *locale_save = NULL; static size_t sort_nkeys; static struct cob_file_key *sort_keys; static const unsigned char *sort_collate; static const char *cob_current_program_id = NULL; static const char *cob_current_section = NULL; static const char *cob_current_paragraph = NULL; static const char *cob_source_file = NULL; static const char *cob_source_statement = NULL; static unsigned int cob_source_line = 0; static size_t cob_line_trace = 0; #ifdef HAVE_SIGNAL_H typedef void (*cob_sighandler_t) (int); static cob_sighandler_t hupsig = NULL; static cob_sighandler_t intsig = NULL; static cob_sighandler_t qutsig = NULL; #endif #ifdef COB_PARAM_CHECK static const char parm_msg[] = "CALL to %s requires %d parameters"; #endif #undef COB_EXCEPTION #define COB_EXCEPTION(code,tag,name,critical) name, static const char * const cob_exception_tab_name[] = { NULL, /* COB_EC_ZERO */ #include "exception.def" NULL /* COB_EC_MAX */ }; #undef COB_EXCEPTION #define COB_EXCEPTION(code,tag,name,critical) 0x##code, static const int cob_exception_tab_code[] = { 0, /* COB_EC_ZERO */ #include "exception.def" 0 /* COB_EC_MAX */ }; #undef COB_EXCEPTION #define EXCEPTION_TAB_SIZE sizeof(cob_exception_tab_code) / sizeof(int) /* #define EXCEPTION_TAB_SIZE sizeof(cob_exception_table) / sizeof(struct cob_exception) */ static int cob_switch[8]; /* Runtime exit handling */ static struct exit_handlerlist { struct exit_handlerlist *next; int (*proc)(void); } *exit_hdlrs = NULL; /* Runtime error handling */ static struct handlerlist { struct handlerlist *next; int (*proc)(char *s); } *hdlrs = NULL; static char *runtime_err_str; static cob_field_attr all_attr = { COB_TYPE_ALPHANUMERIC_ALL, 0, 0, 0, NULL }; static cob_field_attr one_attr = { COB_TYPE_NUMERIC, 1, 0, 0, NULL }; /* Global variables */ struct cob_module *cob_current_module = NULL; int cob_initialized = 0; int cob_exception_code = 0; int cob_call_params = 0; int cob_save_call_params = 0; int cob_initial_external = 0; int cob_got_exception = 0; const char *cob_orig_statement = NULL; const char *cob_orig_program_id = NULL; const char *cob_orig_section = NULL; const char *cob_orig_paragraph = NULL; unsigned int cob_orig_line = 0; cob_field cob_zero = { 1, (ucharptr)"0", &all_attr }; cob_field cob_space = { 1, (ucharptr)" ", &all_attr }; cob_field cob_high = { 1, (ucharptr)"\xff", &all_attr }; cob_field cob_low = { 1, (ucharptr)"\0", &all_attr }; cob_field cob_quote = { 1, (ucharptr)"\"", &all_attr }; cob_field cob_one = { 1, (ucharptr)"1", &one_attr }; /* Local functions */ #ifdef HAVE_SIGNAL_H static void COB_NOINLINE cob_sig_handler (int sig) { #ifdef SIGSEGV if (sig == SIGSEGV) { if (cob_source_file) { fprintf (stderr, "%s:%d: ", cob_source_file, cob_source_line); } fprintf (stderr, "Attempt to reference unallocated memory (Signal SIGSEGV)\n"); fprintf (stderr, "Abnormal termination - File contents may be incorrect\n"); fflush (stderr); exit (SIGSEGV); } #endif if (cob_initialized) { cob_screen_terminate (); cob_exit_fileio (); fprintf (stderr, "Abnormal termination - File contents may not be correct\n"); fflush (stderr); } switch (sig) { #ifdef SIGHUP case SIGHUP: if ((hupsig != SIG_IGN) && (hupsig != SIG_DFL)) { (*hupsig) (SIGHUP); } break; #endif #ifdef SIGINT case SIGINT: if ((intsig != SIG_IGN) && (intsig != SIG_DFL)) { (*intsig) (SIGINT); } break; #endif #ifdef SIGQUIT case SIGQUIT: if ((qutsig != SIG_IGN) && (qutsig != SIG_DFL)) { (*qutsig) (SIGQUIT); } break; } #endif exit (sig); } #endif static void cob_set_signal (void) { #ifdef HAVE_SIGNAL_H #ifdef SIGINT if ((intsig = signal (SIGINT, cob_sig_handler)) == SIG_IGN) { (void)signal (SIGINT, SIG_IGN); } #endif #ifdef SIGHUP if ((hupsig = signal (SIGHUP, cob_sig_handler)) == SIG_IGN) { (void)signal (SIGHUP, SIG_IGN); } #endif #ifdef SIGQUIT if ((qutsig = signal (SIGQUIT, cob_sig_handler)) == SIG_IGN) { (void)signal (SIGQUIT, SIG_IGN); } #endif /* Take direct control of segementation violation */ #ifdef SIGSEGV (void)signal (SIGSEGV, cob_sig_handler); #endif #endif } #ifdef COB_EBCDIC_MACHINE static void cob_get_sign_ascii (unsigned char *p) { switch (*p) { case 'p': *p = (unsigned char)'0'; return; case 'q': *p = (unsigned char)'1'; return; case 'r': *p = (unsigned char)'2'; return; case 's': *p = (unsigned char)'3'; return; case 't': *p = (unsigned char)'4'; return; case 'u': *p = (unsigned char)'5'; return; case 'v': *p = (unsigned char)'6'; return; case 'w': *p = (unsigned char)'7'; return; case 'x': *p = (unsigned char)'8'; return; case 'y': *p = (unsigned char)'9'; return; } } #endif static int COB_NOINLINE cob_get_sign_ebcdic (unsigned char *p) { switch (*p) { case '{': *p = (unsigned char)'0'; return 1; case 'A': *p = (unsigned char)'1'; return 1; case 'B': *p = (unsigned char)'2'; return 1; case 'C': *p = (unsigned char)'3'; return 1; case 'D': *p = (unsigned char)'4'; return 1; case 'E': *p = (unsigned char)'5'; return 1; case 'F': *p = (unsigned char)'6'; return 1; case 'G': *p = (unsigned char)'7'; return 1; case 'H': *p = (unsigned char)'8'; return 1; case 'I': *p = (unsigned char)'9'; return 1; case '}': *p = (unsigned char)'0'; return -1; case 'J': *p = (unsigned char)'1'; return -1; case 'K': *p = (unsigned char)'2'; return -1; case 'L': *p = (unsigned char)'3'; return -1; case 'M': *p = (unsigned char)'4'; return -1; case 'N': *p = (unsigned char)'5'; return -1; case 'O': *p = (unsigned char)'6'; return -1; case 'P': *p = (unsigned char)'7'; return -1; case 'Q': *p = (unsigned char)'8'; return -1; case 'R': *p = (unsigned char)'9'; return -1; default: /* What to do here */ *p = (unsigned char)'0'; return 1; } /* NOT REACHED */ return 1; } static void COB_NOINLINE cob_put_sign_ebcdic (unsigned char *p, const int sign) { if (sign < 0) { switch (*p) { case '0': *p = (unsigned char)'}'; return; case '1': *p = (unsigned char)'J'; return; case '2': *p = (unsigned char)'K'; return; case '3': *p = (unsigned char)'L'; return; case '4': *p = (unsigned char)'M'; return; case '5': *p = (unsigned char)'N'; return; case '6': *p = (unsigned char)'O'; return; case '7': *p = (unsigned char)'P'; return; case '8': *p = (unsigned char)'Q'; return; case '9': *p = (unsigned char)'R'; return; default: /* What to do here */ *p = (unsigned char)'}'; return; } } switch (*p) { case '0': *p = (unsigned char)'{'; return; case '1': *p = (unsigned char)'A'; return; case '2': *p = (unsigned char)'B'; return; case '3': *p = (unsigned char)'C'; return; case '4': *p = (unsigned char)'D'; return; case '5': *p = (unsigned char)'E'; return; case '6': *p = (unsigned char)'F'; return; case '7': *p = (unsigned char)'G'; return; case '8': *p = (unsigned char)'H'; return; case '9': *p = (unsigned char)'I'; return; default: /* What to do here */ *p = (unsigned char)'{'; return; } /* NOT REACHED */ } static int common_cmpc (const unsigned char *s1, const unsigned int c, const size_t size) { const unsigned char *s; size_t i; int ret; s = cob_current_module->collating_sequence; if (unlikely(s)) { for (i = 0; i < size; ++i) { if ((ret = s[s1[i]] - s[c]) != 0) { return ret; } } } else { for (i = 0; i < size; ++i) { if ((ret = s1[i] - c) != 0) { return ret; } } } return 0; } static int common_cmps (const unsigned char *s1, const unsigned char *s2, const size_t size, const unsigned char *col) { size_t i; int ret; if (unlikely(col)) { for (i = 0; i < size; ++i) { if ((ret = col[s1[i]] - col[s2[i]]) != 0) { return ret; } } } else { for (i = 0; i < size; ++i) { if ((ret = s1[i] - s2[i]) != 0) { return ret; } } } return 0; } static int cob_cmp_char (cob_field *f, const unsigned int c) { int sign; int ret; sign = cob_get_sign (f); ret = common_cmpc (f->data, c, f->size); if (COB_FIELD_TYPE (f) != COB_TYPE_NUMERIC_PACKED) { cob_put_sign (f, sign); } return ret; } static int cob_cmp_all (cob_field *f1, cob_field *f2) { unsigned char *data; const unsigned char *s; size_t size; int ret; int sign; size = f1->size; data = f1->data; sign = cob_get_sign (f1); ret = 0; s = cob_current_module->collating_sequence; while (size >= f2->size) { if ((ret = common_cmps (data, f2->data, f2->size, s)) != 0) { goto end; } size -= f2->size; data += f2->size; } if (size > 0) { ret = common_cmps (data, f2->data, size, s); } end: if (COB_FIELD_TYPE (f1) != COB_TYPE_NUMERIC_PACKED) { cob_put_sign (f1, sign); } return ret; } static int cob_cmp_alnum (cob_field *f1, cob_field *f2) { const unsigned char *s; size_t min; int ret; int sign1; int sign2; sign1 = cob_get_sign (f1); sign2 = cob_get_sign (f2); min = (f1->size < f2->size) ? f1->size : f2->size; s = cob_current_module->collating_sequence; /* compare common substring */ if ((ret = common_cmps (f1->data, f2->data, min, s)) != 0) { goto end; } /* compare the rest (if any) with spaces */ if (f1->size > f2->size) { ret = common_cmpc (f1->data + min, ' ', f1->size - min); } else if (f1->size < f2->size) { ret = -common_cmpc (f2->data + min, ' ', f2->size - min); } end: if (COB_FIELD_TYPE (f1) != COB_TYPE_NUMERIC_PACKED) { cob_put_sign (f1, sign1); } if (COB_FIELD_TYPE (f2) != COB_TYPE_NUMERIC_PACKED) { cob_put_sign (f2, sign2); } return ret; } static int sort_compare (const void *data1, const void *data2) { size_t i; int cmp; cob_field f1; cob_field f2; for (i = 0; i < sort_nkeys; ++i) { f1 = f2 = *sort_keys[i].field; f1.data = (unsigned char *)data1 + sort_keys[i].offset; f2.data = (unsigned char *)data2 + sort_keys[i].offset; if (COB_FIELD_IS_NUMERIC(&f1)) { cmp = cob_numeric_cmp (&f1, &f2); } else { cmp = common_cmps (f1.data, f2.data, f1.size, sort_collate); } if (cmp != 0) { return (sort_keys[i].flag == COB_ASCENDING) ? cmp : -cmp; } } return 0; } /* * Global functions */ void * cob_malloc (const size_t size) { void *mptr; mptr = calloc (1, size); if (unlikely(!mptr)) { cob_runtime_error ("Cannot acquire %d bytes of memory - Aborting", size); cob_stop_run (1); } return mptr; } void cob_set_location (const char *progid, const char *sfile, const unsigned int sline, const char *csect, const char *cpara, const char *cstatement) { cob_current_program_id = progid; cob_source_file = sfile; cob_source_line = sline; cob_current_section = csect; cob_current_paragraph = cpara; if (cstatement) { cob_source_statement = cstatement; } if (cob_line_trace) { fprintf (stderr, "PROGRAM-ID: %s \tLine: %d \tStatement: %s\n", (char *)progid, sline, cstatement ? (char *)cstatement : "Unknown"); fflush (stderr); } } void cob_ready_trace (void) { cob_line_trace = 1; } void cob_reset_trace (void) { cob_line_trace = 0; } unsigned char * cob_get_pointer (const unsigned char *srcptr) { unsigned char *tmptr; memcpy (&tmptr, srcptr, sizeof (void *)); return tmptr; } void * cob_get_prog_pointer (const unsigned char *srcptr) { void *tmptr; memcpy (&tmptr, srcptr, sizeof (void *)); return tmptr; } void cob_memcpy (cob_field *dst, unsigned char *src, const int size) { cob_field temp; cob_field_attr attr; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); temp.size = size; temp.data = src; temp.attr = &attr; cob_move (&temp, dst); } const char * cob_get_exception_name (const int exception_code) { size_t n; for (n = 0; n < EXCEPTION_TAB_SIZE; ++n) { if (exception_code == cob_exception_tab_code[n]) { return cob_exception_tab_name[n]; } } return NULL; } void cob_set_exception (const int id) { cob_exception_code = cob_exception_tab_code[id]; if (cob_exception_code) { cob_got_exception = 1; cob_orig_statement = cob_source_statement; cob_orig_line = cob_source_line; cob_orig_program_id = cob_current_program_id; cob_orig_section = cob_current_section; cob_orig_paragraph = cob_current_paragraph; } } void cob_init (int argc, char **argv) { char *s; size_t i; char buff[32]; if (!cob_initialized) { cob_set_signal (); cob_argc = argc; cob_argv = argv; /* Get emergency buffer */ runtime_err_str = cob_malloc (COB_ERRBUF_SIZE); #ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); setlocale (LC_NUMERIC, "C"); s = setlocale (LC_ALL, NULL); if (s) { locale_save = strdup (s); } #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); #endif /* Dirty hack until we implement something better */ #if defined(_WIN32) && !defined(_MSC_VER) _setmode (_fileno (stdin), _O_BINARY); _setmode (_fileno (stdout), _O_BINARY); _setmode (_fileno (stderr), _O_BINARY); #endif cob_init_numeric (); cob_init_strings (); cob_init_move (); cob_init_intrinsic (); cob_init_fileio (); cob_init_termio (); cob_init_call (); for (i = 0; i < 8; ++i) { memset (buff, 0, sizeof (buff)); snprintf (buff, 31, "COB_SWITCH_%d", (int)(i + 1)); s = getenv (buff); if (s && strcasecmp (s, "ON") == 0) { cob_switch[i] = 1; } else { cob_switch[i] = 0; } } s = getenv ("COB_LINE_TRACE"); if (s && (*s == 'Y' || *s == 'y')) { cob_line_trace = 1; } cob_initialized = 1; } } void cob_module_enter (struct cob_module *module) { if (unlikely(!cob_initialized)) { fputs ("Warning: cob_init expected in the main program\n", stderr); cob_init (0, NULL); } module->next = cob_current_module; cob_current_module = module; } void cob_module_leave (struct cob_module *module) { cob_current_module = cob_current_module->next; } void cob_stop_run (const int status) { struct exit_handlerlist *h; if (exit_hdlrs != NULL) { h = exit_hdlrs; while (h != NULL) { h->proc (); h = h->next; } } cob_screen_terminate (); cob_exit_fileio (); exit (status); } void COB_NOINLINE cob_runtime_error (const char *fmt, ...) { struct handlerlist *h; char *p; va_list ap; if (hdlrs != NULL) { h = hdlrs; if (runtime_err_str) { p = runtime_err_str; if (cob_source_file) { sprintf (runtime_err_str, "%s:%d: ", cob_source_file, cob_source_line); p = runtime_err_str + strlen (runtime_err_str); } va_start (ap, fmt); vsprintf (p, fmt, ap); va_end (ap); } while (h != NULL) { if (runtime_err_str) { h->proc (runtime_err_str); } else { h->proc ((char *)"Malloc error"); } h = h->next; } hdlrs = NULL; } /* prefix */ if (cob_source_file) { fprintf (stderr, "%s:%d: ", cob_source_file, cob_source_line); } fputs ("libcob: ", stderr); /* body */ va_start (ap, fmt); vfprintf (stderr, fmt, ap); va_end (ap); /* postfix */ fputs ("\n", stderr); fflush (stderr); } void cob_fatal_error (const unsigned int fatal_error) { switch (fatal_error) { case COB_FERROR_INITIALIZED: cob_runtime_error ("cob_init() has not been called"); break; case COB_FERROR_CODEGEN: cob_runtime_error ("Codegen error - Please report this"); break; case COB_FERROR_CHAINING: cob_runtime_error ("ERROR - Recursive call of chained program"); break; case COB_FERROR_STACK: cob_runtime_error ("Stack overflow, possible PERFORM depth exceeded"); break; default: cob_runtime_error ("Unknown failure : %d", (int)fatal_error); break; } cob_stop_run (1); } void cob_check_version (const char *prog, const char *packver, const int patchlev) { if (strcmp (packver, PACKAGE_VERSION) || patchlev > PATCH_LEVEL) { cob_runtime_error ("Error - Version mismatch"); cob_runtime_error ("%s has version/patch level %s/%d", prog, packver, patchlev); cob_runtime_error ("Library has version/patch level %s/%d", PACKAGE_VERSION, PATCH_LEVEL); cob_stop_run (1); } } /* * Sign */ int cob_real_get_sign (cob_field *f) { unsigned char *p; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_DISPLAY: /* locate sign */ if (unlikely(COB_FIELD_SIGN_LEADING (f))) { p = f->data; } else { p = f->data + f->size - 1; } /* get sign */ if (unlikely(COB_FIELD_SIGN_SEPARATE (f))) { return (*p == '+') ? 1 : -1; } else { if (*p >= '0' && *p <= '9') { return 1; } if (*p == ' ') { *p = (unsigned char)'0'; return 1; } if (unlikely(cob_current_module->display_sign)) { return cob_get_sign_ebcdic (p); } else { #ifdef COB_EBCDIC_MACHINE cob_get_sign_ascii (p); #else GET_SIGN_ASCII (*p); #endif return -1; } } case COB_TYPE_NUMERIC_PACKED: p = f->data + f->size - 1; return ((*p & 0x0f) == 0x0d) ? -1 : 1; default: return 0; } } void cob_real_put_sign (cob_field *f, const int sign) { unsigned char *p; int c; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_DISPLAY: /* locate sign */ if (unlikely(COB_FIELD_SIGN_LEADING (f))) { p = f->data; } else { p = f->data + f->size - 1; } /* put sign */ if (unlikely(COB_FIELD_SIGN_SEPARATE (f))) { c = (sign < 0) ? '-' : '+'; if (*p != c) { *p = c; } } else if (unlikely(cob_current_module->display_sign)) { cob_put_sign_ebcdic (p, sign); } else if (sign < 0) { #ifdef COB_EBCDIC_MACHINE cob_put_sign_ascii (p); #else PUT_SIGN_ASCII (*p); #endif } return; case COB_TYPE_NUMERIC_PACKED: p = f->data + f->size - 1; if (sign < 0) { *p = (*p & 0xf0) | 0x0d; } else { *p = (*p & 0xf0) | 0x0c; } return; default: return; } } void cob_field_to_string (const cob_field *f, char *s) { int i; memcpy (s, f->data, f->size); for (i = (int) f->size - 1; i >= 0; i--) { if (s[i] != ' ' && s[i] != 0) { break; } } s[i + 1] = '\0'; } /* * Switch */ int cob_get_switch (const int n) { return cob_switch[n]; } void cob_set_switch (const int n, const int flag) { if (flag == 0) { cob_switch[n] = 0; } else if (flag == 1) { cob_switch[n] = 1; } } int cob_cmp (cob_field *f1, cob_field *f2) { cob_field temp; cob_field_attr attr; unsigned char buff[48]; if (COB_FIELD_IS_NUMERIC (f1) && COB_FIELD_IS_NUMERIC (f2)) { return cob_numeric_cmp (f1, f2); } if (COB_FIELD_TYPE (f2) == COB_TYPE_ALPHANUMERIC_ALL) { if (f2 == &cob_zero && COB_FIELD_IS_NUMERIC (f1)) { return cob_cmp_int (f1, 0); } else if (f2->size == 1) { return cob_cmp_char (f1, f2->data[0]); } else { return cob_cmp_all (f1, f2); } } else if (COB_FIELD_TYPE (f1) == COB_TYPE_ALPHANUMERIC_ALL) { if (f1 == &cob_zero && COB_FIELD_IS_NUMERIC (f2)) { return -cob_cmp_int (f2, 0); } else if (f1->size == 1) { return -cob_cmp_char (f2, f1->data[0]); } else { return -cob_cmp_all (f2, f1); } } else { if (COB_FIELD_IS_NUMERIC (f1) && COB_FIELD_TYPE (f1) != COB_TYPE_NUMERIC_DISPLAY) { temp.size = COB_FIELD_DIGITS(f1); temp.data = buff; temp.attr = &attr; attr = *f1->attr; attr.type = COB_TYPE_NUMERIC_DISPLAY; attr.flags &= ~COB_FLAG_HAVE_SIGN; cob_move (f1, &temp); f1 = &temp; } if (COB_FIELD_IS_NUMERIC (f2) && COB_FIELD_TYPE (f2) != COB_TYPE_NUMERIC_DISPLAY) { temp.size = COB_FIELD_DIGITS(f2); temp.data = buff; temp.attr = &attr; attr = *f2->attr; attr.type = COB_TYPE_NUMERIC_DISPLAY; attr.flags &= ~COB_FLAG_HAVE_SIGN; cob_move (f2, &temp); f2 = &temp; } return cob_cmp_alnum (f1, f2); } } /* * Class check */ int cob_is_omitted (const cob_field *f) { return f->data == NULL; } int cob_is_numeric (cob_field *f) { unsigned char *data; size_t size; size_t i; int sign; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_BINARY: case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: return 1; case COB_TYPE_NUMERIC_PACKED: /* check digits */ for (i = 0; i < f->size - 1; ++i) { if ((f->data[i] & 0xf0) > 0x90 || (f->data[i] & 0x0f) > 0x09) { return 0; } } if ((f->data[i] & 0xf0) > 0x90) { return 0; } /* check sign */ sign = f->data[i] & 0x0f; if (sign == 0x0f) { return 1; } if (COB_FIELD_HAVE_SIGN (f)) { if (sign == 0x0c || sign == 0x0d) { return 1; } } return 0; case COB_TYPE_NUMERIC_DISPLAY: data = COB_FIELD_DATA (f); size = COB_FIELD_SIZE (f); sign = cob_get_sign (f); for (i = 0; i < size; ++i) { if (!isdigit (data[i])) { cob_put_sign (f, sign); return 0; } } cob_put_sign (f, sign); return 1; default: for (i = 0; i < f->size; ++i) { if (!isdigit (f->data[i])) { return 0; } } return 1; } } int cob_is_alpha (const cob_field *f) { size_t i; for (i = 0; i < f->size; ++i) { if (!isspace (f->data[i]) && !isalpha (f->data[i])) { return 0; } } return 1; } int cob_is_upper (const cob_field *f) { size_t i; for (i = 0; i < f->size; ++i) { if (!isspace (f->data[i]) && !isupper (f->data[i])) { return 0; } } return 1; } int cob_is_lower (const cob_field *f) { size_t i; for (i = 0; i < f->size; ++i) { if (!isspace (f->data[i]) && !islower (f->data[i])) { return 0; } } return 1; } /* * Table sort */ void cob_table_sort_init (const int nkeys, const unsigned char *collating_sequence) { sort_nkeys = 0; sort_keys = cob_malloc (nkeys * sizeof (struct cob_file_key)); if (collating_sequence) { sort_collate = collating_sequence; } else { sort_collate = cob_current_module->collating_sequence; } } void cob_table_sort_init_key (const int flag, cob_field *field, size_t offset) { sort_keys[sort_nkeys].flag = flag; sort_keys[sort_nkeys].field = field; sort_keys[sort_nkeys].offset = offset; sort_nkeys++; } void cob_table_sort (cob_field *f, const int n) { qsort (f->data, (size_t) n, f->size, sort_compare); free (sort_keys); } /* * Run-time error checking */ void cob_check_based (const unsigned char *x, const char *name) { if (!x) { cob_runtime_error ("BASED/LINKAGE item '%s' has NULL address", name); cob_stop_run (1); } } void cob_check_numeric (cob_field *f, const char *name) { unsigned char *data; char *p; char *buff; size_t i; if (!cob_is_numeric (f)) { buff = cob_malloc (COB_SMALL_BUFF); p = buff; data = f->data; for (i = 0; i < f->size; ++i) { if (isprint (data[i])) { *p++ = data[i]; } else { p += sprintf (p, "\\%03o", data[i]); } } *p = '\0'; cob_runtime_error ("'%s' not numeric: '%s'", name, buff); cob_stop_run (1); } } void cob_check_odo (const int i, const int min, const int max, const char *name) { /* check the OCCURS DEPENDING ON item */ if (i < min || max < i) { cob_set_exception (COB_EC_BOUND_ODO); cob_runtime_error ("OCCURS DEPENDING ON '%s' out of bounds: %d", name, i); cob_stop_run (1); } } void cob_check_subscript (const int i, const int min, const int max, const char *name) { /* check the subscript */ if (i < min || max < i) { cob_set_exception (COB_EC_BOUND_SUBSCRIPT); cob_runtime_error ("Subscript of '%s' out of bounds: %d", name, i); cob_stop_run (1); } } void cob_check_ref_mod (const int offset, const int length, const int size, const char *name) { /* check the offset */ if (offset < 1 || offset > size) { cob_set_exception (COB_EC_BOUND_REF_MOD); cob_runtime_error ("Offset of '%s' out of bounds: %d", name, offset); cob_stop_run (1); } /* check the length */ if (length < 1 || offset + length - 1 > size) { cob_set_exception (COB_EC_BOUND_REF_MOD); cob_runtime_error ("Length of '%s' out of bounds: %d", name, length); cob_stop_run (1); } } unsigned char * cob_external_addr (const char *exname, const int exlength) { static struct cob_external *basext = NULL; struct cob_external *eptr; for (eptr = basext; eptr; eptr = eptr->next) { if (!strcmp (exname, eptr->ename)) { if (exlength > eptr->esize) { cob_runtime_error ("EXTERNAL item '%s' has size > %d", exname, exlength); cob_stop_run (1); } cob_initial_external = 0; return (ucharptr)eptr->ext_alloc; } } eptr = cob_malloc (sizeof (struct cob_external)); eptr->next = basext; eptr->esize = exlength; eptr->ename = cob_malloc (strlen (exname) + 1); strcpy (eptr->ename, exname); eptr->ext_alloc = cob_malloc ((size_t)exlength); basext = eptr; cob_initial_external = 1; return (ucharptr)eptr->ext_alloc; } /* Extended ACCEPT/DISPLAY */ void cob_accept_date (cob_field *f) { time_t t; char s[8]; t = time (NULL); strftime (s, 7, "%y%m%d", localtime (&t)); cob_memcpy (f, (ucharptr)s, 6); } void cob_accept_date_yyyymmdd (cob_field *f) { time_t t; char s[12]; t = time (NULL); strftime (s, 9, "%Y%m%d", localtime (&t)); cob_memcpy (f, (ucharptr)s, 8); } void cob_accept_day (cob_field *f) { time_t t; char s[8]; t = time (NULL); strftime (s, 6, "%y%j", localtime (&t)); cob_memcpy (f, (ucharptr)s, 5); } void cob_accept_day_yyyyddd (cob_field *f) { time_t t; char s[12]; t = time (NULL); strftime (s, 8, "%Y%j", localtime (&t)); cob_memcpy (f, (ucharptr)s, 7); } void cob_accept_day_of_week (cob_field *f) { time_t t; char s[4]; t = time (NULL); #if defined(_MSC_VER) sprintf(s, "%d", localtime(&t)->tm_wday + 1); #else strftime (s, 2, "%u", localtime (&t)); #endif cob_memcpy (f, (ucharptr)s, 1); } void cob_accept_time (cob_field *f) { #ifdef _WIN32 SYSTEMTIME syst; #else time_t t; #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) struct timeval tmv; char buff2[8]; #endif #endif char s[12]; #ifdef _WIN32 GetLocalTime (&syst); sprintf (s, "%2.2d%2.2d%2.2d%2.2d", syst.wHour, syst.wMinute, syst.wSecond, syst.wMilliseconds / 10); #else #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) gettimeofday (&tmv, NULL); t = tmv.tv_sec; #else t = time (NULL); #endif strftime (s, 9, "%H%M%S00", localtime (&t)); #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) sprintf(buff2, "%2.2ld", tmv.tv_usec / 10000); memcpy (&s[6], buff2, 2); #endif #endif cob_memcpy (f, (ucharptr)s, 8); } void cob_display_command_line (cob_field *f) { if (commlnptr) { free (commlnptr); } commlnptr = cob_malloc (f->size); commlncnt = f->size; memcpy (commlnptr, f->data, commlncnt); } void cob_accept_command_line (cob_field *f) { char *buff; size_t i; size_t size; size_t len; if (commlncnt) { cob_memcpy (f, commlnptr, (int)commlncnt); return; } buff = cob_malloc (COB_MEDIUM_BUFF); size = 0; for (i = 1; i < (size_t)cob_argc; ++i) { len = strlen (cob_argv[i]); if (size + len >= COB_MEDIUM_BUFF) { /* overflow */ break; } memcpy (buff + size, cob_argv[i], len); size += len; buff[size++] = ' '; } cob_memcpy (f, (ucharptr)buff, (int)size); free (buff); } /* * Argument number */ void cob_display_arg_number (cob_field *f) { int n; cob_field_attr attr; cob_field temp; temp.size = 4; temp.data = (unsigned char *)&n; temp.attr = &attr; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 9, 0, 0, NULL); cob_move (f, &temp); if (n < 0 || n >= cob_argc) { cob_set_exception (COB_EC_IMP_DISPLAY); return; } current_arg = n; } void cob_accept_arg_number (cob_field *f) { int n = cob_argc - 1; cob_field_attr attr; cob_field temp; temp.size = 4; temp.data = (unsigned char *)&n; temp.attr = &attr; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 9, 0, 0, NULL); cob_move (&temp, f); } void cob_accept_arg_value (cob_field *f) { if (current_arg >= cob_argc) { cob_set_exception (COB_EC_IMP_ACCEPT); return; } cob_memcpy (f, (ucharptr)cob_argv[current_arg], (int) strlen (cob_argv[current_arg])); current_arg++; } /* * Environment variable */ void cob_display_environment (cob_field *f) { if (!cob_local_env) { cob_local_env = cob_malloc (COB_SMALL_BUFF); } if (f->size > COB_SMALL_MAX) { cob_set_exception (COB_EC_IMP_DISPLAY); return; } cob_field_to_string (f, cob_local_env); } void cob_display_env_value (cob_field *f) { char *p; char *env2; size_t len; if (!cob_local_env) { cob_set_exception (COB_EC_IMP_DISPLAY); return; } if (!*cob_local_env) { cob_set_exception (COB_EC_IMP_DISPLAY); return; } env2 = cob_malloc (f->size + 1); cob_field_to_string (f, env2); len = strlen (cob_local_env) + strlen (env2) + 3; p = cob_malloc (len); sprintf (p, "%s=%s", cob_local_env, env2); if (putenv (p) != 0) { cob_set_exception (COB_EC_IMP_DISPLAY); } free (env2); } void cob_set_environment (cob_field *f1, cob_field *f2) { cob_display_environment (f1); cob_display_env_value (f2); } void cob_get_environment (cob_field *envname, cob_field *envval) { const char *p; char *buff; if (envname->size < COB_SMALL_BUFF) { buff = cob_malloc (COB_SMALL_BUFF); cob_field_to_string (envname, buff); p = getenv (buff); if (!p) { cob_set_exception (COB_EC_IMP_ACCEPT); p = " "; } cob_memcpy (envval, (ucharptr)p, (int) strlen (p)); free (buff); } else { cob_set_exception (COB_EC_IMP_ACCEPT); p = " "; cob_memcpy (envval, (ucharptr)p, (int) strlen (p)); } } void cob_accept_environment (cob_field *f) { const char *p = NULL; if (cob_local_env) { p = getenv (cob_local_env); } if (!p) { cob_set_exception (COB_EC_IMP_ACCEPT); p = " "; } cob_memcpy (f, (ucharptr)p, (int) strlen (p)); } void cob_chain_setup (void *data, const size_t parm, const size_t size) { size_t len; memset (data, ' ', size); if (parm <= (size_t)cob_argc - 1) { len = strlen (cob_argv[parm]); if (len <= size) { memcpy (data, cob_argv[parm], len); } else { memcpy (data, cob_argv[parm], size); } } else { memset (data, ' ', size); } cob_call_params = cob_argc - 1; } void cob_allocate (unsigned char **dataptr, cob_field *retptr, cob_field *sizefld) { void *mptr = NULL; struct cob_alloc_cache *cache_ptr; int fsize; cob_exception_code = 0; fsize = cob_get_int (sizefld); if (fsize > 0) { cache_ptr = cob_malloc (sizeof (struct cob_alloc_cache)); mptr = malloc ((size_t)fsize); if (!mptr) { cob_set_exception (COB_EC_STORAGE_NOT_AVAIL); free (cache_ptr); } else { memset (mptr, 0, (size_t)fsize); cache_ptr->cob_pointer = mptr; cache_ptr->size = (size_t)fsize; cache_ptr->next = cob_alloc_base; cob_alloc_base = cache_ptr; } } if (dataptr) { *dataptr = (unsigned char *)mptr; } if (retptr) { *(void **)(retptr->data) = mptr; } } void cob_free_alloc (unsigned char **ptr1, unsigned char *ptr2) { struct cob_alloc_cache *cache_ptr; cob_exception_code = 0; if (ptr1 && *ptr1) { for (cache_ptr = cob_alloc_base; cache_ptr; cache_ptr = cache_ptr->next) { if (*(void **)ptr1 == cache_ptr->cob_pointer) { cache_ptr->cob_pointer = NULL; free (*ptr1); *ptr1 = NULL; return; } } cob_set_exception (COB_EC_STORAGE_NOT_ALLOC); return; } if (ptr2 && *(void **)ptr2) { for (cache_ptr = cob_alloc_base; cache_ptr; cache_ptr = cache_ptr->next) { if (*(void **)ptr2 == cache_ptr->cob_pointer) { cache_ptr->cob_pointer = NULL; free (*(void **)ptr2); *(void **)ptr2 = NULL; return; } } cob_set_exception (COB_EC_STORAGE_NOT_ALLOC); return; } } char * cobgetenv (const char *name) { if (name) { return getenv (name); } return NULL; } int cobputenv (char *name) { if (name) { return putenv (name); } return -1; } int cobinit (void) { cob_init (0, NULL); return 0; } void * cobcommandline (int flags, int *pargc, char ***pargv, char ***penvp, char **pname) { char **spenvp; char *spname; int sflags; if (!cob_initialized) { cob_runtime_error ("'cobcommandline' - Runtime has not been initialized"); cob_stop_run (1); } if (pargc && pargv) { cob_argc = *pargc; cob_argv = *pargv; } /* Shut up the compiler */ sflags = flags; if (penvp) { spenvp = *penvp; } if (pname) { spname = *pname; } /* What are we supposed to return here? */ return NULL; } void cobexit (const int status) { cob_stop_run (status); } int cobtidy (void) { struct exit_handlerlist *h; if (exit_hdlrs != NULL) { h = exit_hdlrs; while (h != NULL) { h->proc (); h = h->next; } } cob_screen_terminate (); cob_exit_fileio (); return 0; } /* System routines */ int CBL_EXIT_PROC (unsigned char *x, unsigned char *pptr) { struct exit_handlerlist *hp = NULL; struct exit_handlerlist *h = exit_hdlrs; int (**p)(void) = NULL; COB_CHK_PARMS (CBL_EXIT_PROC, 2); memcpy (&p, &pptr, sizeof (void *)); if (!p || !*p) { return -1; } /* remove handler anyway */ while (h != NULL) { if (h->proc == *p) { if (hp != NULL) { hp->next = h->next; } else { exit_hdlrs = h->next; } if (hp) { free (hp); } break; } hp = h; h = h->next; } if (*x != 0 && *x != 2 && *x != 3) { /* remove handler */ return 0; } h = cob_malloc (sizeof(struct exit_handlerlist)); h->next = exit_hdlrs; h->proc = *p; exit_hdlrs = h; return 0; } int CBL_ERROR_PROC (unsigned char *x, unsigned char *pptr) { struct handlerlist *hp = NULL; struct handlerlist *h = hdlrs; int (**p)(char *s) = NULL; COB_CHK_PARMS (CBL_ERROR_PROC, 2); memcpy (&p, &pptr, sizeof (void *)); if (!p || !*p) { return -1; } /* remove handler anyway */ while (h != NULL) { if (h->proc == *p) { if (hp != NULL) { hp->next = h->next; } else { hdlrs = h->next; } if (hp) { free (hp); } break; } hp = h; h = h->next; } if (*x != 0) { /* remove handler */ return 0; } h = cob_malloc (sizeof(struct handlerlist)); h->next = hdlrs; h->proc = *p; hdlrs = h; return 0; } int SYSTEM (const unsigned char *cmd) { char *buff; int i; COB_CHK_PARMS (SYSTEM, 1); if (cob_current_module->cob_procedure_parameters[0]) { i = (int)cob_current_module->cob_procedure_parameters[0]->size; if (i > COB_MEDIUM_MAX) { cob_runtime_error ("Parameter to SYSTEM call is larger than 8192 characters"); cob_stop_run (1); } i--; for (; i >= 0; i--) { if (cmd[i] != ' ' && cmd[i] != 0) { break; } } if (i >= 0) { buff = cob_malloc ((size_t)(i + 2)); memcpy (buff, cmd, (size_t)(i + 1)); if (cob_screen_initialized) { cob_screen_set_mode (0); } i = system (buff); free (buff); if (cob_screen_initialized) { cob_screen_set_mode (1); } return i; } } return 1; } int CBL_AND (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_AND, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] &= data_1[n]; } return 0; } int CBL_OR (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_OR, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] |= data_1[n]; } return 0; } int CBL_NOR (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_NOR, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] = ~(data_1[n] | data_2[n]); } return 0; } int CBL_XOR (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_XOR, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] ^= data_1[n]; } return 0; } int CBL_IMP (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_IMP, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] = (~data_1[n]) | data_2[n]; } return 0; } int CBL_NIMP (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_NIMP, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] = data_1[n] & (~data_2[n]); } return 0; } int CBL_EQ (unsigned char *data_1, unsigned char *data_2, const int length) { size_t n; COB_CHK_PARMS (CBL_EQ, 3); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_2[n] = ~(data_1[n] ^ data_2[n]); } return 0; } int CBL_NOT (unsigned char *data_1, const int length) { size_t n; COB_CHK_PARMS (CBL_NOT, 2); if (length <= 0) { return 0; } for (n = 0; n < (size_t)length; ++n) { data_1[n] = ~data_1[n]; } return 0; } int CBL_XF4 (unsigned char *data_1, unsigned char *data_2) { size_t n; COB_CHK_PARMS (CBL_XF4, 2); *data_1 = 0; for (n = 0; n < 8; ++n) { *data_1 |= (data_2[n] & 1) << (7 - n); } return 0; } int CBL_XF5 (unsigned char *data_1, unsigned char *data_2) { size_t n; COB_CHK_PARMS (CBL_XF5, 2); for (n = 0; n < 8; ++n) { data_2[n] = (*data_1 & (1 << (7 - n))) ? 1 : 0; } return 0; } int CBL_X91 (unsigned char *result, const unsigned char *func, unsigned char *parm) { unsigned char *p; size_t i; switch (*func) { case 11: /* Set switches */ p = parm; for (i = 0; i < 8; ++i, ++p) { if (*p == 0) { cob_switch[i] = 0; } else if (*p == 1) { cob_switch[i] = 1; } } *result = 0; break; case 12: /* Get switches */ p = parm; for (i = 0; i < 8; ++i, ++p) { *p = cob_switch[i]; } *result = 0; break; case 16: /* Return number of call parameters */ *parm = cob_save_call_params; *result = 0; break; default: *result = 1; break; } return 0; } int CBL_TOUPPER (unsigned char *data, const int length) { size_t n; COB_CHK_PARMS (CBL_TOUPPER, 2); if (length > 0) { for (n = 0; n < (size_t)length; ++n) { if (islower (data[n])) { data[n] = toupper (data[n]); } } } return 0; } int CBL_TOLOWER (unsigned char *data, const int length) { size_t n; COB_CHK_PARMS (CBL_TOLOWER, 2); if (length > 0) { for (n = 0; n < (size_t)length; ++n) { if (isupper (data[n])) { data[n] = tolower (data[n]); } } } return 0; } int CBL_OC_NANOSLEEP (unsigned char *data) { long long nsecs; #ifdef _WIN32 #if 0 struct timeval tv; #else unsigned int msecs; #endif #else struct timespec tsec; #endif COB_CHK_PARMS (CBL_OC_NANOSLEEP, 1); if (cob_current_module->cob_procedure_parameters[0]) { nsecs = cob_get_long_long (cob_current_module->cob_procedure_parameters[0]); if (nsecs > 0) { #ifdef _WIN32 #if 0 nsecs /= 1000; if (nsecs > 0) { tv.tv_sec = (long)(nsecs / 1000000); tv.tv_usec = (long)(nsecs % 1000000); select (0, (void *)0, (void *)0, (void *)0, &tv); } #else msecs = (unsigned int)(nsecs / 1000000); if (msecs > 0) { Sleep (msecs); } #endif #else tsec.tv_sec = nsecs / 1000000000; tsec.tv_nsec = nsecs % 1000000000; nanosleep (&tsec, NULL); #endif } } return 0; } int cob_return_args (unsigned char *data) { COB_CHK_PARMS (C$NARG, 1); if (cob_current_module->cob_procedure_parameters[0]) { cob_set_int (cob_current_module->cob_procedure_parameters[0], cob_save_call_params); } return 0; } int cob_parameter_size (unsigned char *data) { int n; COB_CHK_PARMS (C$PARAMSIZE, 1); if (cob_current_module->cob_procedure_parameters[0]) { n = cob_get_int (cob_current_module->cob_procedure_parameters[0]); if (n > 0 && n <= cob_save_call_params) { n--; if (cob_current_module->next && cob_current_module->next->cob_procedure_parameters[n]) { return cob_current_module->next->cob_procedure_parameters[n]->size; } } } return 0; } int cob_acuw_sleep (unsigned char *data) { int n; COB_CHK_PARMS (C$SLEEP, 1); if (cob_current_module->cob_procedure_parameters[0]) { n = cob_get_int (cob_current_module->cob_procedure_parameters[0]); if (n > 0 && n < 3600*24*7) { #ifdef _WIN32 Sleep (n*1000); #else sleep ((unsigned int)n); #endif } } return 0; } int cob_acuw_justify (unsigned char *data, ...) { unsigned char *direction; size_t datalen; int n; int shifting = 0; size_t left = 0; size_t right = 0; size_t movelen; size_t centrelen; va_list args; COB_CHK_PARMS (C$JUSTIFY, 1); datalen = cob_current_module->cob_procedure_parameters[0]->size; if (datalen < 2) { return 0; } if (data[0] != ' ' && data[datalen - 1] != ' ') { return 0; } for (n = 0; n < (int)datalen; ++n, ++left) { if (data[n] != ' ') { break; } } if (n == (int)datalen) { return 0; } left = n; for (n = (int)datalen - 1; n >= 0; --n, ++right) { if (data[n] != ' ') { break; } } movelen = datalen - left - right; if (cob_call_params > 1) { va_start (args, data); direction = va_arg (args, unsigned char *); va_end (args); if (*direction == 'L') { shifting = 1; } else if (*direction == 'C') { shifting = 2; } } switch (shifting) { case 1: memmove (data, &data[left], movelen); memset (&data[movelen], ' ', datalen - movelen); break; case 2: centrelen = (left + right) / 2; memmove (&data[centrelen], &data[left], movelen); memset (data, ' ', centrelen); if ((left + right) % 2) { memset (&data[centrelen + movelen], ' ', centrelen + 1); } else { memset (&data[centrelen + movelen], ' ', centrelen); } break; default: memmove (&data[left + right], &data[left], movelen); memset (data, ' ', datalen - movelen); break; } return 0; } open-cobol-1.1/libcob/common.h0000644000000000000000000002727511134611421011741 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_COMMON_H #define COB_COMMON_H #ifdef _MSC_VER #define _CRT_SECURE_NO_DEPRECATE 1 #define inline _inline #define COB_INLINE _inline #include #include #include #pragma warning(disable: 4996) #define strncasecmp _strnicmp #define strcasecmp _stricmp #define __attribute__(x) #define __i386__ #ifdef LIBCOB_EXPORTS #define DLL_EXPIMP __declspec(dllexport) #else /* LIBCOB_EXPORTS */ #define DLL_EXPIMP __declspec(dllimport) #endif /* LIBCOB_EXPORTS */ #else /* _MSC_VER */ #define DLL_EXPIMP #ifdef __370__ #define inline __inline #define COB_INLINE __inline #elif defined(COB_HAS_INLINE) #define COB_INLINE inline #else #define COB_INLINE #endif #endif /* _MSC_VER */ #if defined(__GNUC__) && (__GNUC__ >= 3) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) #define COB_NOINLINE __attribute__((noinline)) #else #define COB_NOINLINE #endif #else #define likely(x) (x) #define unlikely(x) (x) #define COB_NOINLINE #endif #if ' ' == 0x40 #define COB_EBCDIC_MACHINE #endif typedef unsigned char * ucharptr; #define COB_MINI_BUFF 256 #define COB_SMALL_BUFF 1024 #define COB_NORMAL_BUFF 2048 #define COB_MEDIUM_BUFF 8192 #define COB_LARGE_BUFF 16384 #define COB_MINI_MAX (COB_MINI_BUFF - 1) #define COB_SMALL_MAX (COB_SMALL_BUFF - 1) #define COB_NORMAL_MAX (COB_NORMAL_BUFF - 1) #define COB_MEDIUM_MAX (COB_MEDIUM_BUFF - 1) #define COB_LARGE_MAX (COB_LARGE_BUFF - 1) #define COB_STACK_SIZE 255 #define COB_MAX_FIELD_PARAMS 64 /* * External */ struct cob_external { struct cob_external *next; char *ext_alloc; char *ename; int esize; }; /* * Field */ /* field types */ #define COB_TYPE_UNKNOWN 0x00 #define COB_TYPE_GROUP 0x01 #define COB_TYPE_BOOLEAN 0x02 #define COB_TYPE_NUMERIC 0x10 #define COB_TYPE_NUMERIC_DISPLAY 0x10 #define COB_TYPE_NUMERIC_BINARY 0x11 #define COB_TYPE_NUMERIC_PACKED 0x12 #define COB_TYPE_NUMERIC_FLOAT 0x13 #define COB_TYPE_NUMERIC_DOUBLE 0x14 #define COB_TYPE_NUMERIC_EDITED 0x24 #define COB_TYPE_ALPHANUMERIC 0x21 #define COB_TYPE_ALPHANUMERIC_ALL 0x22 #define COB_TYPE_ALPHANUMERIC_EDITED 0x23 #define COB_TYPE_NATIONAL 0x40 #define COB_TYPE_NATIONAL_EDITED 0x41 /* field flags */ #define COB_FLAG_HAVE_SIGN 0x01 #define COB_FLAG_SIGN_SEPARATE 0x02 #define COB_FLAG_SIGN_LEADING 0x04 #define COB_FLAG_BLANK_ZERO 0x08 #define COB_FLAG_JUSTIFIED 0x10 #define COB_FLAG_BINARY_SWAP 0x20 #define COB_FLAG_REAL_BINARY 0x40 #define COB_FLAG_IS_POINTER 0x80 #define COB_FIELD_HAVE_SIGN(f) ((f)->attr->flags & COB_FLAG_HAVE_SIGN) #define COB_FIELD_SIGN_SEPARATE(f) ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE) #define COB_FIELD_SIGN_LEADING(f) ((f)->attr->flags & COB_FLAG_SIGN_LEADING) #define COB_FIELD_BLANK_ZERO(f) ((f)->attr->flags & COB_FLAG_BLANK_ZERO) #define COB_FIELD_JUSTIFIED(f) ((f)->attr->flags & COB_FLAG_JUSTIFIED) #define COB_FIELD_BINARY_SWAP(f) ((f)->attr->flags & COB_FLAG_BINARY_SWAP) #define COB_FIELD_REAL_BINARY(f) ((f)->attr->flags & COB_FLAG_REAL_BINARY) #define COB_FIELD_IS_POINTER(f) ((f)->attr->flags & COB_FLAG_IS_POINTER) #define cob_get_sign(f) (COB_FIELD_HAVE_SIGN (f) ? cob_real_get_sign (f) : 0) #define cob_put_sign(f,s) if (COB_FIELD_HAVE_SIGN (f)) cob_real_put_sign (f, s) /* field attributes */ typedef struct { unsigned char type; unsigned char digits; signed char scale; unsigned char flags; const char *pic; } cob_field_attr; /* field structure */ typedef struct { size_t size; unsigned char *data; const cob_field_attr *attr; } cob_field; #define COB_FIELD_TYPE(f) ((f)->attr->type) #define COB_FIELD_DIGITS(f) ((f)->attr->digits) #define COB_FIELD_SCALE(f) ((f)->attr->scale) #define COB_FIELD_FLAGS(f) ((f)->attr->flags) #define COB_FIELD_PIC(f) ((f)->attr->pic) #define COB_FIELD_DATA(f) \ ((f)->data + \ ((COB_FIELD_SIGN_SEPARATE (f) && COB_FIELD_SIGN_LEADING (f)) ? 1 : 0)) #define COB_FIELD_SIZE(f) \ ((f)->size - (COB_FIELD_SIGN_SEPARATE (f) ? 1 : 0)) #define COB_FIELD_IS_NUMERIC(f) (COB_FIELD_TYPE (f) & COB_TYPE_NUMERIC) /* SIGN */ /* * positive: 0123456789 * negative: pqrstuvwxy */ #define GET_SIGN_ASCII(x) x -= 0x40 #define PUT_SIGN_ASCII(x) x += 0x40 #define COB_DISPLAY_SIGN_ASCII 0 #define COB_DISPLAY_SIGN_EBCDIC 1 /* * Module */ struct cob_module { struct cob_module *next; const unsigned char *collating_sequence; cob_field *crt_status; cob_field *cursor_pos; cob_field **cob_procedure_parameters; const unsigned char display_sign; const unsigned char decimal_point; const unsigned char currency_symbol; const unsigned char numeric_separator; const unsigned char flag_filename_mapping; const unsigned char flag_binary_truncate; const unsigned char flag_pretty_display; const unsigned char spare8; }; /* * Exception */ /* Exception identifier */ #undef COB_EXCEPTION #define COB_EXCEPTION(code,tag,name,critical) tag, enum cob_exception_id { COB_EC_ZERO, #include COB_EC_MAX }; #undef COB_EXCEPTION /* * Fatal error */ #define COB_FERROR_INITIALIZED 0 #define COB_FERROR_CODEGEN 1 #define COB_FERROR_CHAINING 2 #define COB_FERROR_STACK 3 /* * Global variables */ DLL_EXPIMP extern int cob_initialized; DLL_EXPIMP extern int cob_exception_code; DLL_EXPIMP extern struct cob_module *cob_current_module; DLL_EXPIMP extern int cob_call_params; DLL_EXPIMP extern int cob_save_call_params; DLL_EXPIMP extern int cob_initial_external; DLL_EXPIMP extern cob_field cob_zero; /* ZERO */ DLL_EXPIMP extern cob_field cob_space; /* SPACE */ DLL_EXPIMP extern cob_field cob_high; /* HIGH-VALUE */ DLL_EXPIMP extern cob_field cob_low; /* LOW-VALUE */ DLL_EXPIMP extern cob_field cob_quote; /* QUOTE */ DLL_EXPIMP extern cob_field cob_one; /* Numeric ONE */ /* convert a digit (e.g., '0') into an integer (e.g., 0) */ #define cob_d2i(x) ((x) - '0') /* convert an integer (e.g., 0) into a digit (e.g., '0') */ #define cob_i2d(x) ((x) + '0') /* * Function declaration */ /* General functions */ extern void cob_init (int, char **); extern void cob_module_enter (struct cob_module *); extern void cob_module_leave (struct cob_module *); #ifdef __GNUC__ extern void cobexit (int) __attribute__ ((noreturn)); extern void cob_stop_run (const int) __attribute__ ((noreturn)); extern void cob_fatal_error (const unsigned int) __attribute__ ((noreturn)); extern void cob_runtime_error (const char *, ...) __attribute__ ((format (printf, 1, 0))); extern void *cob_malloc (const size_t) __attribute__ ((malloc)); #else extern void cobexit (int); extern void cob_stop_run (const int); extern void cob_fatal_error (const unsigned int); extern void cob_runtime_error (const char *, ...); extern void *cob_malloc (const size_t); #endif extern const char *cob_get_exception_name (const int); extern void cob_set_exception (const int); extern void cob_check_version (const char *, const char *, const int); extern void cob_accept_date (cob_field *); extern void cob_accept_date_yyyymmdd (cob_field *); extern void cob_accept_day (cob_field *); extern void cob_accept_day_yyyyddd (cob_field *); extern void cob_accept_day_of_week (cob_field *); extern void cob_accept_time (cob_field *); extern void cob_display_command_line (cob_field *); extern void cob_accept_command_line (cob_field *); extern void cob_set_environment (cob_field *, cob_field *); extern void cob_display_environment (cob_field *); extern void cob_get_environment (cob_field *, cob_field *); extern void cob_accept_environment (cob_field *); extern void cob_display_env_value (cob_field *); extern void cob_display_arg_number (cob_field *); extern void cob_accept_arg_number (cob_field *); extern void cob_accept_arg_value (cob_field *); extern void cob_chain_setup (void *, const size_t, const size_t); extern void cob_allocate (unsigned char **, cob_field *, cob_field *); extern void cob_free_alloc (unsigned char **, unsigned char *); extern int cobinit (void); extern int cobtidy (void); extern void *cobcommandline (int, int *, char ***, char ***, char **); extern char *cobgetenv (const char *); extern int cobputenv (char *); /* System routines */ extern int CBL_ERROR_PROC (unsigned char *, unsigned char *); extern int CBL_EXIT_PROC (unsigned char *, unsigned char *); extern int SYSTEM (const unsigned char *); extern int CBL_AND (unsigned char *, unsigned char *, const int); extern int CBL_OR (unsigned char *, unsigned char *, const int); extern int CBL_NOR (unsigned char *, unsigned char *, const int); extern int CBL_XOR (unsigned char *, unsigned char *, const int); extern int CBL_IMP (unsigned char *, unsigned char *, const int); extern int CBL_NIMP (unsigned char *, unsigned char *, const int); extern int CBL_EQ (unsigned char *, unsigned char *, const int); extern int CBL_NOT (unsigned char *, const int); extern int CBL_XF4 (unsigned char *, unsigned char *); extern int CBL_XF5 (unsigned char *, unsigned char *); extern int CBL_X91 (unsigned char *, const unsigned char *, unsigned char *); extern int CBL_TOUPPER (unsigned char *, const int); extern int CBL_TOLOWER (unsigned char *, const int); extern int CBL_OC_NANOSLEEP (unsigned char *); extern int cob_return_args (unsigned char *); extern int cob_parameter_size (unsigned char *); extern int cob_acuw_sleep (unsigned char *); extern int cob_acuw_justify (unsigned char *, ...); /* Utilities */ extern unsigned char *cob_external_addr (const char *, const int); extern unsigned char *cob_get_pointer (const unsigned char *); extern void *cob_get_prog_pointer (const unsigned char *); extern void cob_set_location (const char *, const char *, const unsigned int, const char *, const char *, const char *); extern void cob_ready_trace (void); extern void cob_reset_trace (void); /* Switch */ extern int cob_get_switch (const int); extern void cob_set_switch (const int, const int); /* Comparison */ extern int cob_cmp (cob_field *, cob_field *); /* Class check */ extern int cob_is_omitted (const cob_field *); extern int cob_is_numeric (cob_field *); extern int cob_is_alpha (const cob_field *); extern int cob_is_upper (const cob_field *); extern int cob_is_lower (const cob_field *); /* Table sort */ extern void cob_table_sort_init (const int, const unsigned char *); extern void cob_table_sort_init_key (const int, cob_field *, size_t); extern void cob_table_sort (cob_field *, const int); /* Run-time error checking */ extern void cob_check_numeric (cob_field *, const char *); extern void cob_check_based (const unsigned char *, const char *); extern void cob_check_odo (const int, const int, const int, const char *); extern void cob_check_subscript (const int, const int, const int, const char *); extern void cob_check_ref_mod (const int, const int, const int, const char *); /* Comparison functions */ extern int cob_numeric_cmp (cob_field *, cob_field *); #endif /* COB_COMMON_H */ open-cobol-1.1/libcob/Makefile.am0000644000000000000000000000125311130701401012312 ## Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003-2009 Keisuke Nishida ## Copyright (C) 2008-2009 Roger While ## lib_LTLIBRARIES = libcob.la libcob_la_SOURCES = common.c call.c strings.c move.c numeric.c \ intrinsic.c fileio.c termio.c screenio.c libcob_la_CFLAGS = $(AM_CFLAGS) $(LIBCOB_CFLAGS) -I$(top_srcdir) libcob_la_LIBADD = $(LIBCOB_LIBS) libcob_la_LDFLAGS = -version-info 1:0:0 -no-undefined AM_LDFLAGS = $(COB_FIX_LIB) EXTRA_DIST = coblocal.h pkgincludedir = $(includedir)/libcob pkginclude_HEADERS = byteswap.h common.h move.h numeric.h exception.def \ termio.h fileio.h screenio.h strings.h call.h intrinsic.h \ codegen.h system.def open-cobol-1.1/libcob/Makefile.in0000644000000000000000000006263211130703171012341 # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in 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. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libcob DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libcob_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libcob_la_OBJECTS = libcob_la-common.lo libcob_la-call.lo \ libcob_la-strings.lo libcob_la-move.lo libcob_la-numeric.lo \ libcob_la-intrinsic.lo libcob_la-fileio.lo libcob_la-termio.lo \ libcob_la-screenio.lo libcob_la_OBJECTS = $(am_libcob_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libcob_la_SOURCES) DIST_SOURCES = $(libcob_la_SOURCES) pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgincludedir = $(includedir)/libcob ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COBC_LIBS = @COBC_LIBS@ COB_BIGENDIAN = @COB_BIGENDIAN@ COB_CC = @COB_CC@ COB_CFLAGS = @COB_CFLAGS@ COB_CONFIG_DIR = @COB_CONFIG_DIR@ COB_COPY_DIR = @COB_COPY_DIR@ COB_EXPORT_DYN = @COB_EXPORT_DYN@ COB_FIX_LIB = @COB_FIX_LIB@ COB_HAS_INLINE = @COB_HAS_INLINE@ COB_LDFLAGS = @COB_LDFLAGS@ COB_LIBRARY_PATH = @COB_LIBRARY_PATH@ COB_LIBS = @COB_LIBS@ COB_MODULE_EXT = @COB_MODULE_EXT@ COB_PIC_FLAGS = @COB_PIC_FLAGS@ COB_SHARED_OPT = @COB_SHARED_OPT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXXCPP = @CXXCPP@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GMSGFMT = @GMSGFMT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBCOB_CFLAGS = @LIBCOB_CFLAGS@ LIBCOB_LIBS = @LIBCOB_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LTLIBRARIES = libcob.la libcob_la_SOURCES = common.c call.c strings.c move.c numeric.c \ intrinsic.c fileio.c termio.c screenio.c libcob_la_CFLAGS = $(AM_CFLAGS) $(LIBCOB_CFLAGS) -I$(top_srcdir) libcob_la_LIBADD = $(LIBCOB_LIBS) libcob_la_LDFLAGS = -version-info 1:0:0 -no-undefined AM_LDFLAGS = $(COB_FIX_LIB) EXTRA_DIST = coblocal.h pkginclude_HEADERS = byteswap.h common.h move.h numeric.h exception.def \ termio.h fileio.h screenio.h strings.h call.h intrinsic.h \ codegen.h system.def all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libcob/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libcob/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libcob.la: $(libcob_la_OBJECTS) $(libcob_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libcob_la_LDFLAGS) $(libcob_la_OBJECTS) $(libcob_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-call.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-fileio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-intrinsic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-move.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-numeric.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-screenio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-strings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcob_la-termio.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libcob_la-common.lo: common.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-common.lo -MD -MP -MF "$(DEPDIR)/libcob_la-common.Tpo" -c -o libcob_la-common.lo `test -f 'common.c' || echo '$(srcdir)/'`common.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-common.Tpo" "$(DEPDIR)/libcob_la-common.Plo"; else rm -f "$(DEPDIR)/libcob_la-common.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='common.c' object='libcob_la-common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-common.lo `test -f 'common.c' || echo '$(srcdir)/'`common.c libcob_la-call.lo: call.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-call.lo -MD -MP -MF "$(DEPDIR)/libcob_la-call.Tpo" -c -o libcob_la-call.lo `test -f 'call.c' || echo '$(srcdir)/'`call.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-call.Tpo" "$(DEPDIR)/libcob_la-call.Plo"; else rm -f "$(DEPDIR)/libcob_la-call.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='call.c' object='libcob_la-call.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-call.lo `test -f 'call.c' || echo '$(srcdir)/'`call.c libcob_la-strings.lo: strings.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-strings.lo -MD -MP -MF "$(DEPDIR)/libcob_la-strings.Tpo" -c -o libcob_la-strings.lo `test -f 'strings.c' || echo '$(srcdir)/'`strings.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-strings.Tpo" "$(DEPDIR)/libcob_la-strings.Plo"; else rm -f "$(DEPDIR)/libcob_la-strings.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='strings.c' object='libcob_la-strings.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-strings.lo `test -f 'strings.c' || echo '$(srcdir)/'`strings.c libcob_la-move.lo: move.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-move.lo -MD -MP -MF "$(DEPDIR)/libcob_la-move.Tpo" -c -o libcob_la-move.lo `test -f 'move.c' || echo '$(srcdir)/'`move.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-move.Tpo" "$(DEPDIR)/libcob_la-move.Plo"; else rm -f "$(DEPDIR)/libcob_la-move.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='move.c' object='libcob_la-move.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-move.lo `test -f 'move.c' || echo '$(srcdir)/'`move.c libcob_la-numeric.lo: numeric.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-numeric.lo -MD -MP -MF "$(DEPDIR)/libcob_la-numeric.Tpo" -c -o libcob_la-numeric.lo `test -f 'numeric.c' || echo '$(srcdir)/'`numeric.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-numeric.Tpo" "$(DEPDIR)/libcob_la-numeric.Plo"; else rm -f "$(DEPDIR)/libcob_la-numeric.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='numeric.c' object='libcob_la-numeric.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-numeric.lo `test -f 'numeric.c' || echo '$(srcdir)/'`numeric.c libcob_la-intrinsic.lo: intrinsic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-intrinsic.lo -MD -MP -MF "$(DEPDIR)/libcob_la-intrinsic.Tpo" -c -o libcob_la-intrinsic.lo `test -f 'intrinsic.c' || echo '$(srcdir)/'`intrinsic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-intrinsic.Tpo" "$(DEPDIR)/libcob_la-intrinsic.Plo"; else rm -f "$(DEPDIR)/libcob_la-intrinsic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='intrinsic.c' object='libcob_la-intrinsic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-intrinsic.lo `test -f 'intrinsic.c' || echo '$(srcdir)/'`intrinsic.c libcob_la-fileio.lo: fileio.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-fileio.lo -MD -MP -MF "$(DEPDIR)/libcob_la-fileio.Tpo" -c -o libcob_la-fileio.lo `test -f 'fileio.c' || echo '$(srcdir)/'`fileio.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-fileio.Tpo" "$(DEPDIR)/libcob_la-fileio.Plo"; else rm -f "$(DEPDIR)/libcob_la-fileio.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fileio.c' object='libcob_la-fileio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-fileio.lo `test -f 'fileio.c' || echo '$(srcdir)/'`fileio.c libcob_la-termio.lo: termio.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-termio.lo -MD -MP -MF "$(DEPDIR)/libcob_la-termio.Tpo" -c -o libcob_la-termio.lo `test -f 'termio.c' || echo '$(srcdir)/'`termio.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-termio.Tpo" "$(DEPDIR)/libcob_la-termio.Plo"; else rm -f "$(DEPDIR)/libcob_la-termio.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='termio.c' object='libcob_la-termio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-termio.lo `test -f 'termio.c' || echo '$(srcdir)/'`termio.c libcob_la-screenio.lo: screenio.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -MT libcob_la-screenio.lo -MD -MP -MF "$(DEPDIR)/libcob_la-screenio.Tpo" -c -o libcob_la-screenio.lo `test -f 'screenio.c' || echo '$(srcdir)/'`screenio.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libcob_la-screenio.Tpo" "$(DEPDIR)/libcob_la-screenio.Plo"; else rm -f "$(DEPDIR)/libcob_la-screenio.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='screenio.c' object='libcob_la-screenio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcob_la_CFLAGS) $(CFLAGS) -c -o libcob_la-screenio.lo `test -f 'screenio.c' || echo '$(srcdir)/'`screenio.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)" @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pkgincludeHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: open-cobol-1.1/libcob/move.c0000644000000000000000000006704411136614062011416 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include "move.h" #include "coblocal.h" #include "byteswap.h" static size_t lastsize = 0; static unsigned char *lastdata = NULL; static const int cob_exp10[10] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; static const long long cob_exp10LL[19] = { 1LL, 10LL, 100LL, 1000LL, 10000LL, 100000LL, 1000000LL, 10000000LL, 100000000LL, 1000000000LL, 10000000000LL, 100000000000LL, 1000000000000LL, 10000000000000LL, 100000000000000LL, 1000000000000000LL, 10000000000000000LL, 100000000000000000LL, 1000000000000000000LL }; static COB_INLINE int cob_min_int (const int x, const int y) { if (x < y) { return x; } return y; } static COB_INLINE int cob_max_int (const int x, const int y) { if (x > y) { return x; } return y; } static COB_INLINE void own_byte_memcpy (unsigned char *s1, const unsigned char *s2, size_t size) { do { *s1++ = *s2++; } while (--size); } static void store_common_region (cob_field *f, const unsigned char *data, const size_t size, const int scale) { const unsigned char *p; unsigned char *q; size_t csize; size_t cinc; int lf1 = -scale; int lf2 = -COB_FIELD_SCALE (f); int hf1 = (int) size + lf1; int hf2 = (int) COB_FIELD_SIZE (f) + lf2; int lcf; int gcf; lcf = cob_max_int (lf1, lf2); gcf = cob_min_int (hf1, hf2); memset (COB_FIELD_DATA (f), '0', COB_FIELD_SIZE (f)); if (gcf > lcf) { csize = (size_t)(gcf - lcf); p = data + hf1 - gcf; q = COB_FIELD_DATA (f) + hf2 - gcf; for (cinc = 0; cinc < csize; ++cinc, ++p, ++q) { if (unlikely(*p == ' ')) { *q = (unsigned char)'0'; } else { *q = *p; } } } } static long long cob_binary_mget_int64 (const cob_field * const f) { long long n = 0; size_t fsiz = 8 - f->size; /* Experimental code - not activated */ #if 0 unsigned char *s; if ((COB_FIELD_BINARY_SWAP (f) && !COB_FIELD_HAVE_SIGN (f)) || (!COB_FIELD_BINARY_SWAP (f) && COB_FIELD_HAVE_SIGN (f))) { s = (unsigned char *)&n + fsiz; } else { s = (unsigned char *)&n; } own_byte_memcpy (s, f->data, f->size); if (COB_FIELD_BINARY_SWAP (f)) { n = COB_BSWAP_64 (n); } if (COB_FIELD_HAVE_SIGN (f)) { n >>= 8 * fsiz; /* shift with sign */ } #endif #ifndef WORDS_BIGENDIAN if (COB_FIELD_BINARY_SWAP (f)) { if (COB_FIELD_HAVE_SIGN (f)) { own_byte_memcpy ((unsigned char *)&n, f->data, f->size); n = COB_BSWAP_64 (n); n >>= 8 * fsiz; /* shift with sign */ } else { own_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); n = COB_BSWAP_64 (n); } } else { if (COB_FIELD_HAVE_SIGN (f)) { own_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); n >>= 8 * fsiz; /* shift with sign */ } else { own_byte_memcpy ((unsigned char *)&n, f->data, f->size); } } #else /* WORDS_BIGENDIAN */ if (COB_FIELD_HAVE_SIGN (f)) { own_byte_memcpy ((unsigned char *)&n, f->data, f->size); n >>= 8 * fsiz; /* shift with sign */ } else { own_byte_memcpy (((unsigned char *)&n) + fsiz, f->data, f->size); } #endif /* WORDS_BIGENDIAN */ return n; } static void cob_binary_mset_int64 (cob_field *f, long long n) { #ifndef WORDS_BIGENDIAN unsigned char *s; if (COB_FIELD_BINARY_SWAP (f)) { n = COB_BSWAP_64 (n); s = ((unsigned char *)&n) + 8 - f->size; } else { s = (unsigned char *)&n; } own_byte_memcpy (f->data, s, f->size); #else /* WORDS_BIGENDIAN */ own_byte_memcpy (f->data, ((unsigned char *)&n) + 8 - f->size, f->size); #endif /* WORDS_BIGENDIAN */ } /* * Display */ static void cob_move_alphanum_to_display (cob_field *f1, cob_field *f2) { unsigned char *p; unsigned char *s1; unsigned char *s2; unsigned char *e1; unsigned char *e2; int sign, count, size; unsigned char c; /* initialize */ s1 = f1->data; e1 = s1 + f1->size; s2 = COB_FIELD_DATA (f2); e2 = s2 + COB_FIELD_SIZE (f2); memset (f2->data, '0', f2->size); /* skip white spaces */ for (; s1 < e1; ++s1) { if (!isspace (*s1)) { break; } } /* check for sign */ sign = 0; if (s1 != e1) { if (*s1 == '+' || *s1 == '-') { sign = (*s1++ == '+') ? 1 : -1; } } /* count the number of digits before decimal point */ count = 0; for (p = s1; p < e1 && *p != cob_current_module->decimal_point; ++p) { if (isdigit (*p)) { ++count; } } /* find the start position */ size = (int) COB_FIELD_SIZE (f2) - COB_FIELD_SCALE(f2); if (count < size) { s2 += size - count; } else { while (count-- > size) { while (!isdigit (*s1++)) { ; } } } /* move */ count = 0; for (; s1 < e1 && s2 < e2; ++s1) { c = *s1; if (isdigit (c)) { *s2++ = c; } else if (c == cob_current_module->decimal_point) { if (count++ > 0) { goto error; } } else if (!(isspace (c) || c == cob_current_module->numeric_separator)) { goto error; } } cob_put_sign (f2, sign); return; error: memset (f2->data, '0', f2->size); cob_put_sign (f2, 0); } static void cob_move_display_to_display (cob_field *f1, cob_field *f2) { int sign; sign = cob_get_sign (f1); store_common_region (f2, COB_FIELD_DATA (f1), COB_FIELD_SIZE (f1), COB_FIELD_SCALE (f1)); cob_put_sign (f1, sign); cob_put_sign (f2, sign); } static void cob_move_display_to_alphanum (cob_field *f1, cob_field *f2) { unsigned char *data1; unsigned char *data2; size_t size1; size_t size2; int sign; int diff; int zero_size; data1 = COB_FIELD_DATA (f1); size1 = COB_FIELD_SIZE (f1); sign = cob_get_sign (f1); data2 = f2->data; size2 = f2->size; if (size1 >= size2) { memcpy (data2, data1, size2); } else { diff = (int)(size2 - size1); zero_size = 0; /* move */ memcpy (data2, data1, size1); /* implied 0 ('P's) */ if (COB_FIELD_SCALE(f1) < 0) { zero_size = cob_min_int ((int)-COB_FIELD_SCALE(f1), diff); memset (data2 + size1, '0', (size_t)zero_size); } /* padding */ if (diff - zero_size > 0) { memset (data2 + size1 + zero_size, ' ', (size_t)(diff - zero_size)); } } cob_put_sign (f1, sign); } static void cob_move_alphanum_to_alphanum (cob_field *f1, cob_field *f2) { unsigned char *data1; unsigned char *data2; size_t size1; size_t size2; data1 = f1->data; size1 = f1->size; data2 = f2->data; size2 = f2->size; if (size1 >= size2) { /* move string with truncation */ if (COB_FIELD_JUSTIFIED (f2)) { memcpy (data2, data1 + size1 - size2, size2); } else { memcpy (data2, data1, size2); } } else { /* move string with padding */ if (COB_FIELD_JUSTIFIED (f2)) { memset (data2, ' ', size2 - size1); memcpy (data2 + size2 - size1, data1, size1); } else { memcpy (data2, data1, size1); memset (data2 + size1, ' ', size2 - size1); } } } /* * Packed decimal */ static void cob_move_display_to_packed (cob_field *f1, cob_field *f2) { unsigned char *data1; unsigned char *data2; unsigned char *p; size_t digits1; size_t digits2; size_t i; size_t offset; int sign; int scale1; int scale2; unsigned char n; sign = cob_get_sign (f1); data1 = COB_FIELD_DATA (f1); digits1 = COB_FIELD_DIGITS (f1); scale1 = COB_FIELD_SCALE (f1); data2 = f2->data; digits2 = COB_FIELD_DIGITS (f2); scale2 = COB_FIELD_SCALE (f2); /* pack string */ memset (f2->data, 0, f2->size); offset = 1 - (digits2 % 2); p = data1 + (digits1 - scale1) - (digits2 - scale2); for (i = offset; i < digits2 + offset; ++i, ++p) { if (*p == ' ') { n = 0; } else { n = (data1 <= p && p < data1 + digits1) ? cob_d2i (*p) : 0; } if (i % 2 == 0) { data2[i / 2] = n << 4; } else { data2[i / 2] |= n; } } cob_put_sign (f1, sign); p = f2->data + f2->size - 1; if (!COB_FIELD_HAVE_SIGN (f2)) { *p = (*p & 0xf0) | 0x0f; } else if (sign < 0) { *p = (*p & 0xf0) | 0x0d; } else { *p = (*p & 0xf0) | 0x0c; } } static void cob_move_packed_to_display (cob_field *f1, cob_field *f2) { unsigned char *data; size_t i; size_t offset; int sign; unsigned char buff[64]; /* unpack string */ data = f1->data; sign = cob_get_sign (f1); offset = 1 - (COB_FIELD_DIGITS(f1) % 2); for (i = offset; i < COB_FIELD_DIGITS(f1) + offset; ++i) { if (i % 2 == 0) { buff[i - offset] = cob_i2d (data[i / 2] >> 4); } else { buff[i - offset] = cob_i2d (data[i / 2] & 0x0f); } } /* store */ store_common_region (f2, buff, COB_FIELD_DIGITS (f1), COB_FIELD_SCALE (f1)); cob_put_sign (f2, sign); } /* * Floating point */ static void cob_move_display_to_fp (cob_field *f1, cob_field *f2) { double val; size_t size; int sign = cob_get_sign (f1); size_t size1 = COB_FIELD_SIZE (f1); char *data1; char buff2[64]; memset ((ucharptr)buff2, 0, sizeof (buff2)); size = size1 - COB_FIELD_SCALE(f1); if (sign < 0) { buff2[0] = '-'; data1 = &buff2[1]; } else { data1 = buff2; } if (COB_FIELD_SCALE(f1) <= 0) { snprintf (data1, 63, "%*.*s.0", (int)size, (int)size, f1->data); } else { snprintf (data1, 63, "%*.*s.%*.*s", (int)size, (int)size, f1->data, COB_FIELD_SCALE(f1), COB_FIELD_SCALE(f1), f1->data + size); } sscanf (buff2, "%lf", &val); if (COB_FIELD_TYPE (f2) == COB_TYPE_NUMERIC_FLOAT) { float flval = (float) val; memcpy (f2->data, (ucharptr)&flval, sizeof(float)); } else { memcpy (f2->data, (ucharptr)&val, sizeof(double)); } } static void cob_move_fp_to_display (cob_field *f1, cob_field *f2) { double val; double frac; double intgr; int sign; int decs; long long res; char *x, *y; char buff[64]; char buff2[64]; memset ((ucharptr)buff, 0, sizeof (buff)); memset ((ucharptr)buff2, 0, sizeof (buff2)); if (COB_FIELD_TYPE (f1) == COB_TYPE_NUMERIC_FLOAT) { float flval; memcpy ((ucharptr)&flval, f1->data, sizeof (float)); val = flval; } else { memcpy ((ucharptr)&val, f1->data, sizeof (double)); } sign = 1; if (val < 0) { sign = -1; val = -val; } frac = modf (val, &intgr); res = (long long) intgr; decs = 0; for (; res; res /= 10) { ++decs; } snprintf (buff2, 63, "%-18.*lf", 18 - decs, val); y = buff; for (x = buff2; *x; ++x) { if (*x == '.') { continue; } if (*x == ' ') { continue; } *y++ = *x; } store_common_region (f2, (ucharptr)buff, strlen (buff), 18 - decs); cob_put_sign (f2, sign); } /* * Binary integer */ static void cob_move_display_to_binary (cob_field *f1, cob_field *f2) { unsigned char *data1; size_t i, size; size_t size1; long long val = 0; int sign; size1 = COB_FIELD_SIZE (f1); data1 = COB_FIELD_DATA (f1); sign = cob_get_sign (f1); /* get value */ size = size1 - COB_FIELD_SCALE(f1) + COB_FIELD_SCALE(f2); for (i = 0; i < size; ++i) { if (i < size1) { val = val * 10 + cob_d2i (data1[i]); } else { val = val * 10; } } if (sign < 0 && COB_FIELD_HAVE_SIGN (f2)) { val = -val; } if (cob_current_module->flag_binary_truncate && !COB_FIELD_REAL_BINARY(f2)) { val %= cob_exp10LL[(int)COB_FIELD_DIGITS(f2)]; } /* store */ cob_binary_mset_int64 (f2, val); cob_put_sign (f1, sign); } static void cob_move_binary_to_display (cob_field *f1, cob_field *f2) { int i, sign; unsigned long long val; long long val2; char buff[64]; /* long long is at most 20 digits */ sign = 1; /* get value */ if (COB_FIELD_HAVE_SIGN (f1)) { val2 = cob_binary_mget_int64 (f1); if (val2 < 0) { sign = -1; val = -val2; } else { val = val2; } } else { val = cob_binary_mget_int64 (f1); } /* convert to string */ i = 20; while (val > 0) { buff[--i] = (char) cob_i2d (val % 10); val /= 10; } /* store */ store_common_region (f2, (ucharptr)buff + i, (size_t)(20 - i), COB_FIELD_SCALE(f1)); cob_put_sign (f2, sign); } /* * Edited */ static void cob_move_display_to_edited (cob_field *f1, cob_field *f2) { const char *p; unsigned char *min, *max, *src, *dst, *end; unsigned char *decimal_point; int sign; int neg; int count = 0; int count_sign = 1; int count_curr = 1; int trailing_sign = 0; int trailing_curr = 0; int is_zero = 1; int suppress_zero = 1; int sign_first = 0; int p_is_left = 0; int repeat; int n; unsigned char pad = ' '; unsigned char x; unsigned char c; unsigned char sign_symbol = 0; unsigned char curr_symbol = 0; decimal_point = NULL; sign = cob_get_sign (f1); neg = (sign < 0) ? 1 : 0; /* count the number of digit places before decimal point */ for (p = COB_FIELD_PIC (f2); *p; p += 5) { c = p[0]; memcpy ((unsigned char *)&repeat, p + 1, sizeof(int)); if (c == '9' || c == 'Z' || c == '*') { count += repeat; count_sign = 0; count_curr = 0; } else if (count_curr && c == cob_current_module->currency_symbol) { count += repeat; } else if (count_sign && (c == '+' || c == '-')) { count += repeat; } else if (c == 'P') { if (count == 0) { p_is_left = 1; break; } else { count += repeat; count_sign = 0; count_curr = 0; } } else if (c == 'V' || c == cob_current_module->decimal_point) { break; } } min = COB_FIELD_DATA (f1); max = min + COB_FIELD_SIZE (f1); src = max - COB_FIELD_SCALE(f1) - count; dst = f2->data; end = f2->data + f2->size; for (p = COB_FIELD_PIC (f2); *p;) { c = *p++; /* PIC char */ memcpy ((unsigned char *)&n, p, sizeof(int)); /* PIC char count */ p += sizeof(int); for (; n > 0; n--, ++dst) { switch (c) { case '0': case '/': *dst = c; break; case 'B': *dst = suppress_zero ? pad : 'B'; break; case 'P': if (p_is_left) { ++src; --dst; } break; case '9': *dst = (min <= src && src < max) ? *src++ : (src++, '0'); if (*dst != '0') { is_zero = suppress_zero = 0; } suppress_zero = 0; trailing_sign = 1; trailing_curr = 1; break; case 'V': --dst; decimal_point = dst; break; case '.': case ',': if (c == cob_current_module->decimal_point) { *dst = cob_current_module->decimal_point; decimal_point = dst; } else { *dst = suppress_zero ? pad : c; } break; case 'C': case 'D': end = dst; memcpy (dst++, neg ? (c == 'C' ? "CR" : "DB") : " ", 2); break; case 'Z': case '*': x = (min <= src && src < max) ? *src++ : (src++, '0'); if (x != '0') { is_zero = suppress_zero = 0; } pad = (c == '*') ? '*' : ' '; *dst = suppress_zero ? pad : x; trailing_sign = 1; trailing_curr = 1; break; case '+': case '-': x = (min <= src && src < max) ? *src++ : (src++, '0'); if (x != '0') { is_zero = suppress_zero = 0; } if (trailing_sign) { *dst = neg ? '-' : (c == '+') ? '+' : ' '; --end; } else if (dst == f2->data || suppress_zero) { *dst = pad; sign_symbol = neg ? '-' : (c == '+') ? '+' : ' '; if (!curr_symbol) { ++sign_first; } } else { *dst = x; } break; default: if (c == cob_current_module->currency_symbol) { x = (min <= src && src < max) ? *src++ : (src++, '0'); if (x != '0') { is_zero = suppress_zero = 0; } if (trailing_curr) { *dst = cob_current_module->currency_symbol; --end; } else if (dst == f2->data || suppress_zero) { *dst = pad; curr_symbol = cob_current_module->currency_symbol; } else { *dst = x; } break; } *dst = '?'; /* invalid PIC */ } } } if (suppress_zero || (is_zero && COB_FIELD_BLANK_ZERO (f2))) { /* all digits are zeros */ if (pad == ' ' || COB_FIELD_BLANK_ZERO (f2)) { memset (f2->data, ' ', f2->size); } else { for (dst = f2->data; dst < f2->data + f2->size; ++dst) { if (*dst != cob_current_module->decimal_point) { *dst = pad; } } } } else { /* put zero after the decimal point if necessary */ if (decimal_point) { for (dst = decimal_point + 1; dst < end; ++dst) { if (!isdigit (*dst) && !strchr (",+-/B", *dst)) { *dst = '0'; } } } /* put sign or currency symbol at the beginning */ if (sign_symbol || curr_symbol) { for (dst = end - 1; dst > f2->data; --dst) { if (*dst == ' ') { break; } } if (sign_symbol && curr_symbol) { if (sign_first) { *dst = curr_symbol; --dst; if (dst >= f2->data) { *dst = sign_symbol; } } else { *dst = sign_symbol; --dst; if (dst >= f2->data) { *dst = curr_symbol; } } } else if (sign_symbol) { *dst = sign_symbol; } else { *dst = curr_symbol; } } /* replace all 'B's by pad */ count = 0; for (dst = f2->data; dst < end; ++dst) { if (*dst == 'B') { if (count == 0) { *dst = pad; } else { *dst = ' '; } } else { ++count; } } } cob_put_sign (f1, sign); } static void cob_move_edited_to_display (cob_field *f1, cob_field *f2) { unsigned char *p; const char *p1; size_t i; int sign = 0; int scale = 0; int count = 0; int have_point = 0; int cp; int n; unsigned char c; unsigned char buff[64]; p = buff; /* de-edit */ for (i = 0; i < f1->size; ++i) { cp = f1->data[i]; switch (cp) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': *p++ = cp; if (have_point) { ++scale; } break; case '.': case ',': if (cp == cob_current_module->decimal_point) { have_point = 1; } break; case '-': case 'C': sign = -1; break; } } /* count the number of digit places after decimal point in case of 'V', 'P' */ if (scale == 0) { for (p1 = COB_FIELD_PIC (f1); *p1; p1 += 5) { c = p1[0]; memcpy ((unsigned char *)&n, p1 + 1, sizeof(int)); if (c == '9' || c == '0' || c == 'Z' || c == '*') { if (have_point) { scale += n; } else { count += n; } } else if (c == 'P') { if (count == 0) { have_point = 1; scale += n; } else { scale -= n; } } else if (c == 'V') { have_point = 1; } } } /* store */ store_common_region (f2, buff, (size_t)(p - buff), scale); cob_put_sign (f2, sign); } static void cob_move_alphanum_to_edited (cob_field *f1, cob_field *f2) { const char *p; unsigned char *max, *src, *dst; int sign = cob_get_sign (f1); int n; unsigned char c; src = COB_FIELD_DATA (f1); max = src + COB_FIELD_SIZE (f1); dst = f2->data; for (p = COB_FIELD_PIC (f2); *p;) { c = *p++; /* PIC char */ memcpy ((unsigned char *)&n, p, sizeof(int)); /* PIC char count */ p += sizeof(int); for (; n > 0; --n) { switch (c) { case 'A': case 'X': case '9': *dst++ = (src < max) ? *src++ : ' '; break; case '0': case '/': *dst++ = c; break; case 'B': *dst++ = ' '; break; default: *dst++ = '?'; /* invalid PIC */ } } } cob_put_sign (f1, sign); } /* * MOVE dispatcher */ static void indirect_move (void (*func) (cob_field *src, cob_field *dst), cob_field *src, cob_field *dst, size_t size, int scale) { cob_field temp; cob_field_attr attr; unsigned char data[64]; COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, size, scale, COB_FLAG_HAVE_SIGN, NULL); temp.size = size; temp.data = data; temp.attr = &attr; func (src, &temp); cob_move (&temp, dst); } static void cob_move_all (cob_field *src, cob_field *dst) { size_t i; size_t digcount; cob_field temp; cob_field_attr attr; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); if (COB_FIELD_IS_NUMERIC(dst)) { digcount = 18; attr.type = COB_TYPE_NUMERIC_DISPLAY; attr.digits = 18; /* if (COB_FIELD_TYPE(dst) & COB_TYPE_NUMERIC_EDITED) { digcount = dst->size; } else { digcount = COB_FIELD_DIGITS(dst); } */ } else { digcount = dst->size; } if (digcount > lastsize) { free (lastdata); lastdata = cob_malloc (digcount); lastsize = digcount; } temp.size = digcount; temp.data = lastdata; temp.attr = &attr; if (likely(src->size == 1)) { memset (lastdata, src->data[0], digcount); } else { for (i = 0; i < digcount; ++i) { lastdata[i] = src->data[i % src->size]; } } cob_move (&temp, dst); } void cob_move (cob_field *src, cob_field *dst) { if (COB_FIELD_TYPE (src) == COB_TYPE_ALPHANUMERIC_ALL) { cob_move_all (src, dst); return; } if (dst->size == 0) { return; } if (src->size == 0) { src = &cob_space; } /* non-elementary move */ if (COB_FIELD_TYPE (src) == COB_TYPE_GROUP || COB_FIELD_TYPE (dst) == COB_TYPE_GROUP) { cob_move_alphanum_to_alphanum (src, dst); return; } /* elementary move */ switch (COB_FIELD_TYPE (src)) { case COB_TYPE_NUMERIC_DISPLAY: switch (COB_FIELD_TYPE (dst)) { case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: cob_move_display_to_fp (src, dst); return; case COB_TYPE_NUMERIC_DISPLAY: cob_move_display_to_display (src, dst); return; case COB_TYPE_NUMERIC_PACKED: cob_move_display_to_packed (src, dst); return; case COB_TYPE_NUMERIC_BINARY: cob_move_display_to_binary (src, dst); return; case COB_TYPE_NUMERIC_EDITED: cob_move_display_to_edited (src, dst); return; case COB_TYPE_ALPHANUMERIC_EDITED: if (COB_FIELD_SCALE(src) < 0 || COB_FIELD_SCALE(src) > COB_FIELD_DIGITS(src)) { /* expand P's */ indirect_move (cob_move_display_to_display, src, dst, (size_t)cob_max_int ((int)COB_FIELD_DIGITS(src), (int)COB_FIELD_SCALE(src)), cob_max_int (0, (int)COB_FIELD_SCALE(src))); return; } else { cob_move_alphanum_to_edited (src, dst); return; } default: cob_move_display_to_alphanum (src, dst); return; } case COB_TYPE_NUMERIC_PACKED: switch (COB_FIELD_TYPE (dst)) { case COB_TYPE_NUMERIC_DISPLAY: cob_move_packed_to_display (src, dst); return; default: indirect_move (cob_move_packed_to_display, src, dst, COB_FIELD_DIGITS(src), COB_FIELD_SCALE(src)); return; } case COB_TYPE_NUMERIC_BINARY: switch (COB_FIELD_TYPE (dst)) { case COB_TYPE_NUMERIC_DISPLAY: cob_move_binary_to_display (src, dst); return; case COB_TYPE_NUMERIC_BINARY: case COB_TYPE_NUMERIC_PACKED: case COB_TYPE_NUMERIC_EDITED: case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: indirect_move (cob_move_binary_to_display, src, dst, 20, COB_FIELD_SCALE(src)); return; default: indirect_move (cob_move_binary_to_display, src, dst, COB_FIELD_DIGITS(src), COB_FIELD_SCALE(src)); return; } case COB_TYPE_NUMERIC_EDITED: switch (COB_FIELD_TYPE (dst)) { case COB_TYPE_NUMERIC_DISPLAY: cob_move_edited_to_display (src, dst); return; case COB_TYPE_NUMERIC_PACKED: case COB_TYPE_NUMERIC_BINARY: case COB_TYPE_NUMERIC_EDITED: case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: indirect_move (cob_move_edited_to_display, src, dst, 36, 18); return; case COB_TYPE_ALPHANUMERIC_EDITED: cob_move_alphanum_to_edited (src, dst); return; default: cob_move_alphanum_to_alphanum (src, dst); return; } case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: indirect_move (cob_move_fp_to_display, src, dst, 40, 20); return; default: switch (COB_FIELD_TYPE (dst)) { case COB_TYPE_NUMERIC_DISPLAY: cob_move_alphanum_to_display (src, dst); return; case COB_TYPE_NUMERIC_PACKED: case COB_TYPE_NUMERIC_BINARY: case COB_TYPE_NUMERIC_EDITED: case COB_TYPE_NUMERIC_FLOAT: case COB_TYPE_NUMERIC_DOUBLE: indirect_move (cob_move_alphanum_to_display, src, dst, 36, 18); return; case COB_TYPE_ALPHANUMERIC_EDITED: cob_move_alphanum_to_edited (src, dst); return; default: cob_move_alphanum_to_alphanum (src, dst); return; } } } /* * Convenience functions */ static int cob_packed_get_int (cob_field *f1) { unsigned char *data; size_t i; size_t offset; int val = 0; int sign; data = f1->data; sign = cob_get_sign (f1); offset = 1 - (COB_FIELD_DIGITS(f1) % 2); for (i = offset; i < COB_FIELD_DIGITS(f1) - COB_FIELD_SCALE(f1) + offset; ++i) { val *= 10; if (i % 2 == 0) { val += data[i / 2] >> 4; } else { val += data[i / 2] & 0x0f; } } if (sign < 0) { val = -val; } return val; } static long long cob_packed_get_long_long (cob_field *f1) { unsigned char *data; size_t i; size_t offset; long long val = 0; int sign; data = f1->data; sign = cob_get_sign (f1); offset = 1 - (COB_FIELD_DIGITS(f1) % 2); for (i = offset; i < COB_FIELD_DIGITS(f1) - COB_FIELD_SCALE(f1) + offset; ++i) { val *= 10; if (i % 2 == 0) { val += data[i / 2] >> 4; } else { val += data[i / 2] & 0x0f; } } if (sign < 0) { val = -val; } return val; } static int cob_display_get_int (cob_field *f) { unsigned char *data; size_t size; size_t i; int val = 0; int sign; size = COB_FIELD_SIZE (f); data = COB_FIELD_DATA (f); sign = cob_get_sign (f); /* skip preceding zeros */ for (i = 0; i < size; ++i) { if (cob_d2i (data[i]) != 0) { break; } } /* get value */ if (COB_FIELD_SCALE(f) < 0) { for (; i < size; ++i) { val = val * 10 + cob_d2i (data[i]); } val *= cob_exp10[(int)-COB_FIELD_SCALE(f)]; } else { size -= COB_FIELD_SCALE(f); for (; i < size; ++i) { val = val * 10 + cob_d2i (data[i]); } } if (sign < 0) { val = -val; } cob_put_sign (f, sign); return val; } static long long cob_display_get_long_long (cob_field *f) { unsigned char *data; size_t size; size_t i; long long val = 0; int sign; size = COB_FIELD_SIZE (f); data = COB_FIELD_DATA (f); sign = cob_get_sign (f); /* skip preceding zeros */ for (i = 0; i < size; ++i) { if (cob_d2i (data[i]) != 0) { break; } } /* get value */ if (COB_FIELD_SCALE(f) < 0) { for (; i < size; ++i) { val = val * 10 + cob_d2i (data[i]); } val *= cob_exp10LL[(int)-COB_FIELD_SCALE(f)]; } else { size -= COB_FIELD_SCALE(f); for (; i < size; ++i) { val = val * 10 + cob_d2i (data[i]); } } if (sign < 0) { val = -val; } cob_put_sign (f, sign); return val; } void cob_set_int (cob_field *f, int n) { cob_field temp; cob_field_attr attr; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 9, 0, COB_FLAG_HAVE_SIGN, NULL); temp.size = 4; temp.data = (unsigned char *)&n; temp.attr = &attr; cob_move (&temp, f); } int cob_get_int (cob_field *f) { int n; cob_field temp; cob_field_attr attr; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_DISPLAY: return cob_display_get_int (f); case COB_TYPE_NUMERIC_BINARY: return (int)cob_binary_mget_int64 (f); case COB_TYPE_NUMERIC_PACKED: return cob_packed_get_int (f); default: COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 9, 0, COB_FLAG_HAVE_SIGN, NULL); temp.size = 4; temp.data = (unsigned char *)&n; temp.attr = &attr; cob_move (f, &temp); return n; } } long long cob_get_long_long (cob_field *f) { long long n; cob_field temp; cob_field_attr attr; switch (COB_FIELD_TYPE (f)) { case COB_TYPE_NUMERIC_DISPLAY: return cob_display_get_long_long (f); case COB_TYPE_NUMERIC_BINARY: return cob_binary_mget_int64 (f); case COB_TYPE_NUMERIC_PACKED: return cob_packed_get_long_long (f); default: COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); temp.size = 8; temp.data = (unsigned char *)&n; temp.attr = &attr; cob_move (f, &temp); return n; } } void cob_init_move (void) { lastdata = cob_malloc (COB_SMALL_BUFF); lastsize = COB_SMALL_BUFF; } open-cobol-1.1/libcob/move.h0000644000000000000000000000205211134603027011404 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_MOVE_H #define COB_MOVE_H #include extern void cob_move (cob_field *, cob_field *); extern void cob_set_int (cob_field *, int); extern int cob_get_int (cob_field *); #endif /* COB_MOVE_H */ open-cobol-1.1/libcob/byteswap.h0000644000000000000000000001560611134576112012311 /* * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ /* * Extracted from glib/gtypes.h in GLIB-2.2.2. * Modified by Roger While * Copyright (C) 2005-2009 Roger While */ #ifndef COB_BYTESWAP_H #define COB_BYTESWAP_H /* Basic bit swapping functions */ #define COB_BSWAP_16_CONSTANT(val) ((unsigned short) ( \ (unsigned short) ((unsigned short) (val) >> 8) | \ (unsigned short) ((unsigned short) (val) << 8))) #define COB_BSWAP_32_CONSTANT(val) ((unsigned int) ( \ (((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \ (((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \ (((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \ (((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24))) #define COB_BSWAP_64_CONSTANT(val) ((unsigned long long) ( \ (((unsigned long long) (val) & \ (unsigned long long) 0x00000000000000ffULL) << 56) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x000000000000ff00ULL) << 40) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x0000000000ff0000ULL) << 24) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x00000000ff000000ULL) << 8) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x000000ff00000000ULL) >> 8) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x0000ff0000000000ULL) >> 24) | \ (((unsigned long long) (val) & \ (unsigned long long) 0x00ff000000000000ULL) >> 40) | \ (((unsigned long long) (val) & \ (unsigned long long) 0xff00000000000000ULL) >> 56))) /* Arch specific stuff for speed */ #if defined (__GNUC__) && (__GNUC__ >= 2) # if defined (__i386__) # define COB_BSWAP_16_IA32(val) \ (__extension__ \ ({ register unsigned short int __v, __x = ((unsigned short) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_16_CONSTANT (__x); \ else \ __asm__ ("rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # define COB_BSWAP_32_IA32(val) \ (__extension__ \ ({ register unsigned int __v, __x = ((unsigned int) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_32_CONSTANT (__x); \ else \ __asm__ ("bswap %0" \ : "=r" (__v) \ : "0" (__x)); \ __v; })) # define COB_BSWAP_64_IA32(val) \ (__extension__ \ ({ union { unsigned long long __ll; \ unsigned int __l[2]; } __w, __r; \ __w.__ll = ((unsigned long long) (val)); \ if (__builtin_constant_p (__w.__ll)) \ __r.__ll = COB_BSWAP_64_CONSTANT (__w.__ll); \ else \ { \ __r.__l[0] = COB_BSWAP_32 (__w.__l[1]); \ __r.__l[1] = COB_BSWAP_32 (__w.__l[0]); \ } \ __r.__ll; })) # define COB_BSWAP_16(val) (COB_BSWAP_16_IA32 (val)) # define COB_BSWAP_32(val) (COB_BSWAP_32_IA32 (val)) # define COB_BSWAP_64(val) (COB_BSWAP_64_IA32 (val)) # elif defined (__ia64__) # define COB_BSWAP_16_IA64(val) \ (__extension__ \ ({ register unsigned short __v, __x = ((unsigned short) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_16_CONSTANT (__x); \ else \ __asm__ __volatile__ ("shl %0 = %1, 48 ;;" \ "mux1 %0 = %0, @rev ;;" \ : "=r" (__v) \ : "r" (__x)); \ __v; })) # define COB_BSWAP_32_IA64(val) \ (__extension__ \ ({ register unsigned int __v, __x = ((unsigned int) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_32_CONSTANT (__x); \ else \ __asm__ __volatile__ ("shl %0 = %1, 32 ;;" \ "mux1 %0 = %0, @rev ;;" \ : "=r" (__v) \ : "r" (__x)); \ __v; })) # define COB_BSWAP_64_IA64(val) \ (__extension__ \ ({ register unsigned long long __v, \ __x = ((unsigned long long) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_64_CONSTANT (__x); \ else \ __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \ : "=r" (__v) \ : "r" (__x)); \ __v; })) # define COB_BSWAP_16(val) (COB_BSWAP_16_IA64 (val)) # define COB_BSWAP_32(val) (COB_BSWAP_32_IA64 (val)) # define COB_BSWAP_64(val) (COB_BSWAP_64_IA64 (val)) # elif defined (__x86_64__) # define COB_BSWAP_16_X86_64(val) \ (__extension__ \ ({ register unsigned short int __v, __x = ((unsigned short) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_16_CONSTANT (__x); \ else \ __asm__ ("rorw $8, %w0" \ : "=r" (__v) \ : "0" (__x) \ : "cc"); \ __v; })) # define COB_BSWAP_32_X86_64(val) \ (__extension__ \ ({ register unsigned int __v, __x = ((unsigned int) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_32_CONSTANT (__x); \ else \ __asm__ ("bswapl %0" \ : "=r" (__v) \ : "0" (__x)); \ __v; })) # define COB_BSWAP_64_X86_64(val) \ (__extension__ \ ({ register unsigned long long __v, __x = ((unsigned long long) (val)); \ if (__builtin_constant_p (__x)) \ __v = COB_BSWAP_64_CONSTANT (__x); \ else \ __asm__ ("bswapq %0" \ : "=r" (__v) \ : "0" (__x)); \ __v; })) # define COB_BSWAP_16(val) (COB_BSWAP_16_X86_64 (val)) # define COB_BSWAP_32(val) (COB_BSWAP_32_X86_64 (val)) # define COB_BSWAP_64(val) (COB_BSWAP_64_X86_64 (val)) # else /* generic gcc */ # define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) # define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val)) # define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val)) # endif # elif defined (_MSC_VER) # define COB_BSWAP_16(val) (_byteswap_ushort (val)) # define COB_BSWAP_32(val) (_byteswap_ulong (val)) # define COB_BSWAP_64(val) (_byteswap_uint64 (val)) #else /* generic */ # define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) # define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val)) # define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val)) #endif /* generic */ #endif /* COB_BYTESWAP_H */ open-cobol-1.1/libcob/intrinsic.c0000644000000000000000000021433211142341406012440 /* * Copyright (C) 2005-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include #if defined(_WIN32) || defined(__CYGWIN__) #undef HAVE_LANGINFO_CODESET #define WINDOWS_LEAN_AND_MEAN #include #endif #ifdef HAVE_LANGINFO_CODESET #include #endif #ifdef HAVE_LOCALE_H #include #endif #ifdef _WIN32 #include #endif #include "byteswap.h" #include "common.h" #include "coblocal.h" #include "move.h" #include "numeric.h" #include "fileio.h" #include "intrinsic.h" /* Stacked field level */ #define DEPTH_LEVEL 8 #define COB_FIELD_INIT(x,y,z) do { \ field.size = x; \ field.data = y; \ field.attr = z; \ } while (0) static char *locale_buff; /* Working fields */ static cob_decimal d1, d2, d3, d4, d5; /* Stack definitions for created fields */ static int curr_entry = 0; static cob_field *curr_field = NULL; static cob_field_attr *curr_attr = NULL; static cob_field calc_field[DEPTH_LEVEL]; static cob_field_attr calc_attr[DEPTH_LEVEL]; static size_t calc_size[DEPTH_LEVEL]; /* Constants for date/day calculations */ static const int normal_days[] = {0,31,59,90,120,151,181,212,243,273,304,334,365}; static const int leap_days[] = {0,31,60,91,121,152,182,213,244,274,305,335,366}; static const int normal_month_days[] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; static const int leap_month_days[] = {0,31,29,31,30,31,30,31,31,30,31,30,31}; /* Locale name to Locale ID table */ #if defined(_WIN32) || defined(__CYGWIN__) struct winlocale { const char *winlocalename; const int winlocaleid; }; static const struct winlocale wintable[] = { { "af_ZA", 0x0436 }, { "am_ET", 0x045e }, { "ar_AE", 0x3801 }, { "ar_BH", 0x3c01 }, { "ar_DZ", 0x1401 }, { "ar_EG", 0x0c01 }, { "ar_IQ", 0x0801 }, { "ar_JO", 0x2c01 }, { "ar_KW", 0x3401 }, { "ar_LB", 0x3001 }, { "ar_LY", 0x1001 }, { "ar_MA", 0x1801 }, { "ar_OM", 0x2001 }, { "ar_QA", 0x4001 }, { "ar_SA", 0x0401 }, { "ar_SY", 0x2801 }, { "ar_TN", 0x1c01 }, { "ar_YE", 0x2401 }, { "arn_CL", 0x047a }, { "as_IN", 0x044d }, { "az_Cyrl_AZ", 0x082c }, { "az_Latn_AZ", 0x042c }, { "ba_RU", 0x046d }, { "be_BY", 0x0423 }, { "bg_BG", 0x0402 }, { "bn_IN", 0x0445 }, { "bo_BT", 0x0851 }, { "bo_CN", 0x0451 }, { "br_FR", 0x047e }, { "bs_Cyrl_BA", 0x201a }, { "bs_Latn_BA", 0x141a }, { "ca_ES", 0x0403 }, { "cs_CZ", 0x0405 }, { "cy_GB", 0x0452 }, { "da_DK", 0x0406 }, { "de_AT", 0x0c07 }, { "de_CH", 0x0807 }, { "de_DE", 0x0407 }, { "de_LI", 0x1407 }, { "de_LU", 0x1007 }, { "dsb_DE", 0x082e }, { "dv_MV", 0x0465 }, { "el_GR", 0x0408 }, { "en_029", 0x2409 }, { "en_AU", 0x0c09 }, { "en_BZ", 0x2809 }, { "en_CA", 0x1009 }, { "en_GB", 0x0809 }, { "en_IE", 0x1809 }, { "en_IN", 0x4009 }, { "en_JM", 0x2009 }, { "en_MY", 0x4409 }, { "en_NZ", 0x1409 }, { "en_PH", 0x3409 }, { "en_SG", 0x4809 }, { "en_TT", 0x2c09 }, { "en_US", 0x0409 }, { "en_ZA", 0x1c09 }, { "en_ZW", 0x3009 }, { "es_AR", 0x2c0a }, { "es_BO", 0x400a }, { "es_CL", 0x340a }, { "es_CO", 0x240a }, { "es_CR", 0x140a }, { "es_DO", 0x1c0a }, { "es_EC", 0x300a }, { "es_ES", 0x0c0a }, { "es_GT", 0x100a }, { "es_HN", 0x480a }, { "es_MX", 0x080a }, { "es_NI", 0x4c0a }, { "es_PA", 0x180a }, { "es_PE", 0x280a }, { "es_PR", 0x500a }, { "es_PY", 0x3c0a }, { "es_SV", 0x440a }, { "es_US", 0x540a }, { "es_UY", 0x380a }, { "es_VE", 0x200a }, { "et_EE", 0x0425 }, { "eu_ES", 0x042d }, { "fa_IR", 0x0429 }, { "fi_FI", 0x040b }, { "fil_PH", 0x0464 }, { "fo_FO", 0x0438 }, { "fr_BE", 0x080c }, { "fr_CA", 0x0c0c }, { "fr_CH", 0x100c }, { "fr_FR", 0x040c }, { "fr_LU", 0x140c }, { "fr_MC", 0x180c }, { "fy_NL", 0x0462 }, { "ga_IE", 0x083c }, { "gbz_AF", 0x048c }, { "gl_ES", 0x0456 }, { "gsw_FR", 0x0484 }, { "gu_IN", 0x0447 }, { "ha_Latn_NG", 0x0468 }, { "he_IL", 0x040d }, { "hi_IN", 0x0439 }, { "hr_BA", 0x101a }, { "hr_HR", 0x041a }, { "hu_HU", 0x040e }, { "hy_AM", 0x042b }, { "id_ID", 0x0421 }, { "ig_NG", 0x0470 }, { "ii_CN", 0x0478 }, { "is_IS", 0x040f }, { "it_CH", 0x0810 }, { "it_IT", 0x0410 }, { "iu_Cans_CA", 0x045d }, { "iu_Latn_CA", 0x085d }, { "ja_JP", 0x0411 }, { "ka_GE", 0x0437 }, { "kh_KH", 0x0453 }, { "kk_KZ", 0x043f }, { "kl_GL", 0x046f }, { "kn_IN", 0x044b }, { "ko_KR", 0x0412 }, { "kok_IN", 0x0457 }, { "ky_KG", 0x0440 }, { "lb_LU", 0x046e }, { "lo_LA", 0x0454 }, { "lt_LT", 0x0427 }, { "lv_LV", 0x0426 }, { "mi_NZ", 0x0481 }, { "mk_MK", 0x042f }, { "ml_IN", 0x044c }, { "mn_Cyrl_MN", 0x0450 }, { "mn_Mong_CN", 0x0850 }, { "moh_CA", 0x047c }, { "mr_IN", 0x044e }, { "ms_BN", 0x083e }, { "ms_MY", 0x043e }, { "mt_MT", 0x043a }, { "nb_NO", 0x0414 }, { "ne_NP", 0x0461 }, { "nl_BE", 0x0813 }, { "nl_NL", 0x0413 }, { "nn_NO", 0x0814 }, { "ns_ZA", 0x046c }, { "oc_FR", 0x0482 }, { "or_IN", 0x0448 }, { "pa_IN", 0x0446 }, { "pl_PL", 0x0415 }, { "ps_AF", 0x0463 }, { "pt_BR", 0x0416 }, { "pt_PT", 0x0816 }, { "qut_GT", 0x0486 }, { "quz_BO", 0x046b }, { "quz_EC", 0x086b }, { "quz_PE", 0x0c6b }, { "rm_CH", 0x0417 }, { "ro_RO", 0x0418 }, { "ru_RU", 0x0419 }, { "rw_RW", 0x0487 }, { "sa_IN", 0x044f }, { "sah_RU", 0x0485 }, { "se_FI", 0x0c3b }, { "se_NO", 0x043b }, { "se_SE", 0x083b }, { "si_LK", 0x045b }, { "sk_SK", 0x041b }, { "sl_SI", 0x0424 }, { "sma_NO", 0x183b }, { "sma_SE", 0x1c3b }, { "smj_NO", 0x103b }, { "smj_SE", 0x143b }, { "smn_FI", 0x243b }, { "sms_FI", 0x203b }, { "sq_AL", 0x041c }, { "sr_Cyrl_BA", 0x1c1a }, { "sr_Cyrl_CS", 0x0c1a }, { "sr_Latn_BA", 0x181a }, { "sr_Latn_CS", 0x081a }, { "sv_FI", 0x081d }, { "sv_SE", 0x041d }, { "sw_KE", 0x0441 }, { "syr_SY", 0x045a }, { "ta_IN", 0x0449 }, { "te_IN", 0x044a }, { "tg_Cyrl_TJ", 0x0428 }, { "th_TH", 0x041e }, { "tk_TM", 0x0442 }, { "tmz_Latn_DZ", 0x085f }, { "tn_ZA", 0x0432 }, { "tr_IN", 0x0820 }, { "tr_TR", 0x041f }, { "tt_RU", 0x0444 }, { "ug_CN", 0x0480 }, { "uk_UA", 0x0422 }, { "ur_PK", 0x0420 }, { "uz_Cyrl_UZ", 0x0843 }, { "uz_Latn_UZ", 0x0443 }, { "vi_VN", 0x042a }, { "wen_DE", 0x042e }, { "wo_SN", 0x0488 }, { "xh_ZA", 0x0434 }, { "yo_NG", 0x046a }, { "zh_CN", 0x0804 }, { "zh_HK", 0x0c04 }, { "zh_MO", 0x1404 }, { "zh_SG", 0x1004 }, { "zh_TW", 0x0404 }, { "zu_ZA", 0x0435 } }; #define WINLOCSIZE sizeof(wintable) / sizeof(struct winlocale) #endif /* Local functions */ static void COB_NOINLINE make_double_entry (void) { unsigned char *s; curr_field = &calc_field[curr_entry]; curr_attr = &calc_attr[curr_entry]; if (calc_size[curr_entry] < sizeof (double)) { calc_size[curr_entry] = sizeof (double) + 1; if (curr_field->data) { free (curr_field->data); } s = cob_malloc (sizeof (double) + 1); } else { s = curr_field->data; memset (s, 0, sizeof (double)); } curr_attr->type = COB_TYPE_NUMERIC_DOUBLE; curr_attr->digits = 18; curr_attr->scale = 9; curr_attr->flags = COB_FLAG_HAVE_SIGN; curr_attr->pic = NULL; curr_field->size = sizeof (double); curr_field->data = s; curr_field->attr = curr_attr; if (++curr_entry >= DEPTH_LEVEL) { curr_entry = 0; } } static void COB_NOINLINE make_field_entry (cob_field *f) { unsigned char *s; curr_field = &calc_field[curr_entry]; curr_attr = &calc_attr[curr_entry]; if (f->size > calc_size[curr_entry]) { calc_size[curr_entry] = f->size + 1; if (curr_field->data) { free (curr_field->data); } s = cob_malloc (f->size + 1); } else { s = curr_field->data; memset (s, 0, f->size); } *curr_field = *f; *curr_attr = *(f->attr); curr_field->data = s; curr_field->attr = curr_attr; if (++curr_entry >= DEPTH_LEVEL) { curr_entry = 0; } } static int leap_year (const int year) { return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 1 : 0; } /* Leave in static void intr_set_double (cob_decimal *d, double v) { mpz_set_d (d->value, v * 1.0e9); d->scale = 9; } */ static double COB_NOINLINE intr_get_double (cob_decimal *d) { double v; int n; v = mpz_get_d (d->value); n = d->scale; for (; n > 0; --n) v /= 10; for (; n < 0; ++n) v *= 10; return v; } static int comp_field (const void *m1, const void *m2) { cob_field *f1; cob_field *f2; f1 = *(cob_field **) m1; f2 = *(cob_field **) m2; return cob_cmp (f1, f2); } static void COB_NOINLINE calc_ref_mod (cob_field *f, const int offset, const int length) { size_t calcoff; size_t size; if ((size_t)offset <= f->size) { calcoff = (size_t)offset - 1; size = f->size - calcoff; if (length > 0 && (size_t)length < size) { size = (size_t)length; } f->size = size; if (calcoff > 0) { memmove (f->data, f->data + calcoff, size); } } } /* Global functions */ /* Numeric expressions */ cob_field * cob_intr_binop (cob_field *f1, int op, cob_field *f2) { /* RXW size_t bitnum; size_t sign; size_t attrsign; cob_field_attr attr; cob_field field; */ cob_decimal_set_field (&d1, f1); cob_decimal_set_field (&d2, f2); switch (op) { case '+': cob_decimal_add (&d1, &d2); break; case '-': cob_decimal_sub (&d1, &d2); break; case '*': cob_decimal_mul (&d1, &d2); break; case '/': cob_decimal_div (&d1, &d2); break; case '^': cob_decimal_pow (&d1, &d2); break; default: break; } /* RXW if (mpz_sgn (d1.value) < 0) { attrsign = COB_FLAG_HAVE_SIGN; sign = 1; } else { attrsign = 0; sign = 0; } bitnum = mpz_sizeinbase (d1.value, 2); if (bitnum < 33 - sign) { COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, attrsign, NULL); COB_FIELD_INIT (4, NULL, &attr); attr.scale = d1.scale; make_field_entry (&field); } else if (bitnum < 65 - sign) { COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, attrsign, NULL); COB_FIELD_INIT (8, NULL, &attr); attr.scale = d1.scale; make_field_entry (&field); } else { */ make_double_entry (); /* RXW } */ cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } /* Intrinsics */ cob_field * cob_intr_length (cob_field *srcfield) { cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_set_int (curr_field, (int)srcfield->size); return curr_field; } cob_field * cob_intr_integer (cob_field *srcfield) { int i, scale; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); cob_decimal_set_field (&d1, srcfield); if (mpz_sgn (d1.value) >= 0) { cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } scale = 1; for (i = 0; i < d1.scale; ++i) { scale *= 10; } if (mpz_fdiv_ui (d1.value, (unsigned int)scale)) { mpz_sub_ui (d1.value, d1.value, (unsigned int)scale); } cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_integer_part (cob_field *srcfield) { cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); cob_move (srcfield, curr_field); return curr_field; } cob_field * cob_intr_fraction_part (cob_field *srcfield) { cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 18, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); cob_move (srcfield, curr_field); return curr_field; } cob_field * cob_intr_sign (cob_field *srcfield) { int n; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_set_int (curr_field, 0); n = cob_cmp (srcfield, curr_field); if (n < 0) { cob_set_int (curr_field, -1); } else if (n > 0) { cob_set_int (curr_field, 1); } return curr_field; } cob_field * cob_intr_upper_case (const int offset, const int length, cob_field *srcfield) { size_t i, size; make_field_entry (srcfield); size = srcfield->size; for (i = 0; i < size; ++i) { curr_field->data[i] = toupper (srcfield->data[i]); } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_lower_case (const int offset, const int length, cob_field *srcfield) { size_t i, size; make_field_entry (srcfield); size = srcfield->size; for (i = 0; i < size; ++i) { curr_field->data[i] = tolower (srcfield->data[i]); } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_reverse (const int offset, const int length, cob_field *srcfield) { size_t i, size; make_field_entry (srcfield); size = srcfield->size; for (i = 0; i < size; ++i) { curr_field->data[i] = srcfield->data[srcfield->size - i - 1]; } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_concatenate (const int offset, const int length, const int params, ...) { cob_field **f; unsigned char *p; size_t calcsize; int i; cob_field_attr attr; cob_field field; va_list args; f = cob_malloc (params * sizeof (cob_field *)); va_start (args, params); /* Extract args / calculate size */ calcsize = 0; for (i = 0; i < params; ++i) { f[i] = va_arg (args, cob_field *); calcsize += f[i]->size; } COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (calcsize, NULL, &attr); make_field_entry (&field); p = curr_field->data; for (i = 0; i < params; ++i) { memcpy (p, f[i]->data, f[i]->size); p += f[i]->size; } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } free (f); return curr_field; } cob_field * cob_intr_substitute (const int offset, const int length, const int params, ...) { cob_field *var; cob_field **f1; cob_field **f2; unsigned char *p1; unsigned char *p2; size_t varsize; size_t calcsize; size_t n; size_t found; int numreps; int i; cob_field_attr attr; cob_field field; va_list args; numreps = params / 2; f1 = cob_malloc (numreps * sizeof (cob_field *)); f2 = cob_malloc (numreps * sizeof (cob_field *)); va_start (args, params); var = va_arg (args, cob_field *); varsize = var->size; /* Extract args */ for (i = 0; i < params - 1; ++i) { if ((i % 2) == 0) { f1[i / 2] = va_arg (args, cob_field *); } else { f2[i / 2] = va_arg (args, cob_field *); } } /* Calculate required size */ calcsize = 0; found = 0; p1 = var->data; for (n = 0; n < varsize; ) { for (i = 0; i < numreps; ++i) { if (n + f1[i]->size <= varsize) { if (!memcmp (p1, f1[i]->data, f1[i]->size)) { p1 += f1[i]->size; n += f1[i]->size; calcsize += f2[i]->size; found = 1; break; } } } if (found) { found = 0; continue; } ++n; ++p1; ++calcsize; } COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); field.size = calcsize; make_field_entry (&field); found = 0; p1 = var->data; p2 = curr_field->data; for (n = 0; n < varsize; ) { for (i = 0; i < numreps; ++i) { if (n + f1[i]->size <= varsize) { if (!memcmp (p1, f1[i]->data, f1[i]->size)) { memcpy (p2, f2[i]->data, f2[i]->size); p1 += f1[i]->size; p2 += f2[i]->size; n += f1[i]->size; found = 1; break; } } } if (found) { found = 0; continue; } ++n; *p2++ = *p1++; } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } free (f1); free (f2); return curr_field; } cob_field * cob_intr_substitute_case (const int offset, const int length, const int params, ...) { cob_field *var; cob_field **f1; cob_field **f2; unsigned char *p1; unsigned char *p2; size_t varsize; size_t calcsize; size_t n; size_t found; int numreps; int i; cob_field_attr attr; cob_field field; va_list args; numreps = params / 2; f1 = cob_malloc (numreps * sizeof (cob_field *)); f2 = cob_malloc (numreps * sizeof (cob_field *)); va_start (args, params); var = va_arg (args, cob_field *); varsize = var->size; /* Extract args */ for (i = 0; i < params - 1; ++i) { if ((i % 2) == 0) { f1[i / 2] = va_arg (args, cob_field *); } else { f2[i / 2] = va_arg (args, cob_field *); } } /* Calculate required size */ calcsize = 0; found = 0; p1 = var->data; for (n = 0; n < varsize; ) { for (i = 0; i < numreps; ++i) { if (n + f1[i]->size <= varsize) { if (!strncasecmp ((const char *)p1, (const char *)(f1[i]->data), f1[i]->size)) { p1 += f1[i]->size; n += f1[i]->size; calcsize += f2[i]->size; found = 1; break; } } } if (found) { found = 0; continue; } ++n; ++p1; ++calcsize; } COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); field.size = calcsize; make_field_entry (&field); found = 0; p1 = var->data; p2 = curr_field->data; for (n = 0; n < varsize; ) { for (i = 0; i < numreps; ++i) { if (n + f1[i]->size <= varsize) { if (!strncasecmp ((const char *)p1, (const char *)(f1[i]->data), f1[i]->size)) { memcpy (p2, f2[i]->data, f2[i]->size); p1 += f1[i]->size; p2 += f2[i]->size; n += f1[i]->size; found = 1; break; } } } if (found) { found = 0; continue; } ++n; *p2++ = *p1++; } if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } free (f1); free (f2); return curr_field; } cob_field * cob_intr_trim (const int offset, const int length, cob_field *srcfield, const int direction) { unsigned char *begin; unsigned char *end; size_t i; size_t size = 0; make_field_entry (srcfield); for (i = 0; i < srcfield->size; ++i) { if (srcfield->data[i] != ' ') { break; } } if (i == srcfield->size) { curr_field->size = 1; curr_field->data[0] = ' '; return curr_field; } begin = srcfield->data; if (direction != 2) { for (; *begin == ' '; ++begin) ; } end = srcfield->data + srcfield->size - 1; if (direction != 1) { for (; *end == ' '; end--) ; } for (i = 0; begin <= end; ++begin, ++i) { curr_field->data[i] = *begin; ++size; } curr_field->size = size; if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_exception_file (void) { size_t flen; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); if (cob_exception_code == 0 || !cob_error_file || (cob_exception_code & 0x0500) != 0x0500) { field.size = 2; make_field_entry (&field); memcpy (curr_field->data, "00", 2); } else { flen = strlen (cob_error_file->select_name); field.size = flen + 2; make_field_entry (&field); memcpy (curr_field->data, cob_error_file->file_status, 2); memcpy (&(curr_field->data[2]), cob_error_file->select_name, flen); } return curr_field; } cob_field * cob_intr_exception_location (void) { cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); if (!cob_got_exception || !cob_orig_program_id) { field.size = 1; make_field_entry (&field); *(curr_field->data) = ' '; return curr_field; } memset (locale_buff, 0, COB_SMALL_BUFF); if (cob_orig_section && cob_orig_paragraph) { snprintf (locale_buff, COB_SMALL_MAX, "%s; %s OF %s; %d", cob_orig_program_id, cob_orig_paragraph, cob_orig_section, cob_orig_line); } else if (cob_orig_section) { snprintf (locale_buff, COB_SMALL_MAX, "%s; %s; %d", cob_orig_program_id, cob_orig_section, cob_orig_line); } else if (cob_orig_paragraph) { snprintf (locale_buff, COB_SMALL_MAX, "%s; %s; %d", cob_orig_program_id, cob_orig_paragraph, cob_orig_line); } else { snprintf (locale_buff, COB_SMALL_MAX, "%s; ; %d", cob_orig_program_id, cob_orig_line); } field.size = strlen (locale_buff); make_field_entry (&field); memcpy (curr_field->data, locale_buff, field.size); return curr_field; } cob_field * cob_intr_exception_status (void) { const char *except_name; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (31, NULL, &attr); make_field_entry (&field); memset (curr_field->data, ' ', 31); if (cob_exception_code) { except_name = cob_get_exception_name (cob_exception_code); if (except_name == NULL) { except_name = "EXCEPTION-OBJECT"; } memcpy (curr_field->data, except_name, strlen (except_name)); } return curr_field; } cob_field * cob_intr_exception_statement (void) { size_t flen; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (31, NULL, &attr); make_field_entry (&field); memset (curr_field->data, ' ', 31); if (cob_exception_code && cob_orig_statement) { flen = strlen (cob_orig_statement); if (flen > 31) { memcpy (curr_field->data, cob_orig_statement, 31); } else { memcpy (curr_field->data, cob_orig_statement, flen); } } return curr_field; } cob_field * cob_intr_when_compiled (const int offset, const int length, cob_field *f) { make_field_entry (f); memcpy (curr_field->data, f->data, f->size); if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_current_date (const int offset, const int length) { #if defined(_WIN32) && !defined(__CYGWIN__) long contz; struct tm *tmptr; struct _timeb tmb; cob_field_attr attr; cob_field field; #else #if !defined(__linux__) && !defined(__CYGWIN__) && !defined(COB_STRFTIME) && defined(HAVE_TIMEZONE) struct tm *tmptr; long contz; #endif time_t curtime; cob_field_attr attr; cob_field field; #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) struct timeval tmv; char buff2[8]; #endif #endif /* _WIN32 */ char buff[24]; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (21, NULL, &attr); make_field_entry (&field); memset (buff, 0, sizeof(buff)); #if defined(_WIN32) && !defined(__CYGWIN__) _ftime (&tmb); tmptr = localtime (&(tmb.time)); if (tmb.timezone <= 0) { contz = -tmb.timezone; snprintf (buff, 23, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d%2.2d+%2.2ld%2.2ld", tmptr->tm_year + 1900, tmptr->tm_mon + 1, tmptr->tm_mday, tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, tmb.millitm / 100, contz / 60, contz % 60); } else { contz = tmb.timezone; snprintf (buff, 23, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d%2.2d-%2.2ld%2.2ld", tmptr->tm_year + 1900, tmptr->tm_mon + 1, tmptr->tm_mday, tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, tmb.millitm / 100, contz / 60, contz % 60); } #else #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) gettimeofday (&tmv, NULL); curtime = tmv.tv_sec; #else curtime = time (NULL); #endif #if defined(__linux__) || defined(__CYGWIN__) || defined(COB_STRFTIME) strftime (buff, 22, "%Y%m%d%H%M%S00%z", localtime (&curtime)); #elif defined(HAVE_TIMEZONE) tmptr = localtime (&curtime); strftime (buff, 17, "%Y%m%d%H%M%S00", tmptr); /* RXW - Hack for DST - Need something better */ if (tmptr->tm_isdst > 0) { timezone -= 3600; } if (timezone <= 0) { contz = -timezone; buff[16] = '+'; } else { contz = timezone; buff[16] = '-'; } sprintf(&buff[17], "%2.2ld%2.2ld", contz / 3600, (contz % 3600) / 60); #else strftime (buff, 22, "%Y%m%d%H%M%S0000000", localtime (&curtime)); #endif #if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY) snprintf(buff2, 7, "%2.2ld", tmv.tv_usec / 10000); memcpy (&buff[14], buff2, 2); #endif #endif /* _WIN32 */ memcpy (curr_field->data, buff, 21); if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; } cob_field * cob_intr_char (cob_field *srcfield) { int i; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (1, NULL, &attr); make_field_entry (&field); i = cob_get_int (srcfield); if (i < 1 || i > 256) { *curr_field->data = 0; } else { *curr_field->data = i - 1; } return curr_field; } cob_field * cob_intr_ord (cob_field *srcfield) { cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_set_int (curr_field, (int)(*srcfield->data + 1)); return curr_field; } cob_field * cob_intr_stored_char_length (cob_field *srcfield) { unsigned char *p; int count; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); count = srcfield->size; p = srcfield->data + srcfield->size - 1; for (; count > 0; count--, p--) { if (*p != ' ') { break; } } cob_set_int (curr_field, count); return curr_field; } cob_field * cob_intr_combined_datetime (cob_field *srcdays, cob_field *srctime) { int srdays; int srtime; cob_field_attr attr; cob_field field; char buff[16]; COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, 12, 5, 0, NULL); COB_FIELD_INIT (12, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; srdays = cob_get_int (srcdays); if (srdays < 1 || srdays > 3067671) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); memset (curr_field->data, '0', 12); return curr_field; } srtime = cob_get_int (srctime); if (srtime < 1 || srtime > 86400) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); memset (curr_field->data, '0', 12); return curr_field; } snprintf (buff, 15, "%7.7d%5.5d", srdays, srtime); memcpy (curr_field->data, buff, 12); return curr_field; } cob_field * cob_intr_date_of_integer (cob_field *srcdays) { int i; int days; int baseyear = 1601; int leapyear = 365; cob_field_attr attr; cob_field field; char buff[16]; COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, 8, 0, 0, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; /* Base 1601-01-01 */ days = cob_get_int (srcdays); if (days < 1 || days > 3067671) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); memset (curr_field->data, '0', 8); return curr_field; } while (days > leapyear) { days -= leapyear; ++baseyear; if (leap_year (baseyear)) { leapyear = 366; } else { leapyear = 365; } } for (i = 0; i < 13; ++i) { if (leap_year (baseyear)) { if (days <= leap_days[i]) { days -= leap_days[i-1]; break; } } else { if (days <= normal_days[i]) { days -= normal_days[i-1]; break; } } } snprintf (buff, 15, "%4.4d%2.2d%2.2d", baseyear, i, days); memcpy (curr_field->data, buff, 8); return curr_field; } cob_field * cob_intr_day_of_integer (cob_field *srcdays) { int days; int baseyear = 1601; int leapyear = 365; cob_field_attr attr; cob_field field; char buff[16]; COB_ATTR_INIT (COB_TYPE_NUMERIC_DISPLAY, 7, 0, 0, NULL); COB_FIELD_INIT (7, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; /* Base 1601-01-01 */ days = cob_get_int (srcdays); if (days < 1 || days > 3067671) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); memset (curr_field->data, '0', 7); return curr_field; } while (days > leapyear) { days -= leapyear; ++baseyear; if (leap_year (baseyear)) { leapyear = 366; } else { leapyear = 365; } } snprintf (buff, 15, "%4.4d%3.3d", baseyear, days); memcpy (curr_field->data, buff, 7); return curr_field; } cob_field * cob_intr_integer_of_date (cob_field *srcfield) { int indate; int days; int totaldays; int month; int year; int baseyear = 1601; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; /* Base 1601-01-01 */ indate = cob_get_int (srcfield); year = indate / 10000; if (year < 1601 || year > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } indate %= 10000; month = indate / 100; if (month < 1 || month > 12) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } days = indate % 100; if (days < 1 || days > 31) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (leap_year (year)) { if (days > leap_month_days[month]) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } } else { if (days > normal_month_days[month]) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } } totaldays = 0; while (baseyear != year) { if (leap_year (baseyear)) { totaldays += 366; } else { totaldays += 365; } ++baseyear; } if (leap_year (baseyear)) { totaldays += leap_days[month - 1]; } else { totaldays += normal_days[month - 1]; } totaldays += days; cob_set_int (curr_field, totaldays); return curr_field; } cob_field * cob_intr_integer_of_day (cob_field *srcfield) { int indate; int days; int totaldays; int year; int baseyear = 1601; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; /* Base 1601-01-01 */ indate = cob_get_int (srcfield); year = indate / 1000; if (year < 1601 || year > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } days = indate % 1000; if (days < 1 || days > 365 + leap_year (year)) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } totaldays = 0; while (baseyear != year) { if (leap_year (baseyear)) { totaldays += 366; } else { totaldays += 365; } ++baseyear; } totaldays += days; cob_set_int (curr_field, totaldays); return curr_field; } cob_field * cob_intr_test_date_yyyymmdd (cob_field *srcfield) { int indate; int days; int month; int year; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); /* Base 1601-01-01 */ indate = cob_get_int (srcfield); year = indate / 10000; if (year < 1601 || year > 9999) { cob_set_int (curr_field, 1); return curr_field; } indate %= 10000; month = indate / 100; if (month < 1 || month > 12) { cob_set_int (curr_field, 2); return curr_field; } days = indate % 100; if (days < 1 || days > 31) { cob_set_int (curr_field, 3); return curr_field; } if (leap_year (year)) { if (days > leap_month_days[month]) { cob_set_int (curr_field, 3); return curr_field; } } else { if (days > normal_month_days[month]) { cob_set_int (curr_field, 3); return curr_field; } } cob_set_int (curr_field, 0); return curr_field; } cob_field * cob_intr_test_day_yyyyddd (cob_field *srcfield) { int indate; int days; int year; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); /* Base 1601-01-01 */ indate = cob_get_int (srcfield); year = indate / 1000; if (year < 1601 || year > 9999) { cob_set_int (curr_field, 1); return curr_field; } days = indate % 1000; if (days < 1 || days > 365 + leap_year (year)) { cob_set_int (curr_field, 2); return curr_field; } cob_set_int (curr_field, 0); return curr_field; } cob_field * cob_intr_factorial (cob_field *srcfield) { int srcval; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, 0, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; srcval = cob_get_int (srcfield); if (srcval < 0) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } d1.scale = 0; mpz_fac_ui (d1.value, (unsigned int)srcval); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_exp (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = pow (2.7182818284590452354, intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_exp10 (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = pow (10.0, intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_abs (cob_field *srcfield) { make_field_entry (srcfield); cob_decimal_set_field (&d1, srcfield); mpz_abs (d1.value, d1.value); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_acos (cob_field *srcfield) { unsigned long long result; double mathd2; int i, tempres; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 17, 0, NULL); COB_FIELD_INIT (8, NULL, &attr); cob_decimal_set_field (&d1, srcfield); make_field_entry (&field); errno = 0; mathd2 = acos (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } result = (unsigned long long) mathd2; mathd2 -= result; for (i = 0; i < 17; ++i) { mathd2 *= 10; tempres = (int) mathd2; result *= 10; result += tempres; mathd2 -= tempres; } memcpy (curr_field->data, (char *)&result, 8); return curr_field; } cob_field * cob_intr_asin (cob_field *srcfield) { long long result; double mathd2; int i, tempres; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 17, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); cob_decimal_set_field (&d1, srcfield); make_field_entry (&field); errno = 0; mathd2 = asin (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } result = (long long) mathd2; mathd2 -= result; for (i = 0; i < 17; ++i) { mathd2 *= 10; tempres = (int) mathd2; result *= 10; result += tempres; mathd2 -= tempres; } memcpy (curr_field->data, (char *)&result, 8); return curr_field; } cob_field * cob_intr_atan (cob_field *srcfield) { long long result; double mathd2; int i, tempres; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 17, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); cob_decimal_set_field (&d1, srcfield); make_field_entry (&field); errno = 0; mathd2 = atan (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } result = (long long) mathd2; mathd2 -= result; for (i = 0; i < 17; ++i) { mathd2 *= 10; tempres = (int) mathd2; result *= 10; result += tempres; mathd2 -= tempres; } memcpy (curr_field->data, (char *)&result, 8); return curr_field; } cob_field * cob_intr_cos (cob_field *srcfield) { long long result; double mathd2; int i, tempres; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 17, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); cob_decimal_set_field (&d1, srcfield); make_field_entry (&field); errno = 0; mathd2 = cos (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } result = (long long) mathd2; mathd2 -= result; for (i = 0; i < 17; ++i) { mathd2 *= 10; tempres = (int) mathd2; result *= 10; result += tempres; mathd2 -= tempres; } memcpy (curr_field->data, (char *)&result, 8); return curr_field; } cob_field * cob_intr_log (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = log (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_log10 (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = log10 (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_sin (cob_field *srcfield) { long long result; double mathd2; int i, tempres; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 17, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); cob_decimal_set_field (&d1, srcfield); make_field_entry (&field); errno = 0; mathd2 = sin (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } result = (long long) mathd2; mathd2 -= result; for (i = 0; i < 17; ++i) { mathd2 *= 10; tempres = (int) mathd2; result *= 10; result += tempres; mathd2 -= tempres; } memcpy (curr_field->data, (char *)&result, 8); return curr_field; } cob_field * cob_intr_sqrt (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = sqrt (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_tan (cob_field *srcfield) { double mathd2; cob_decimal_set_field (&d1, srcfield); make_double_entry (); errno = 0; mathd2 = tan (intr_get_double (&d1)); if (errno) { cob_set_int (curr_field, 0); return curr_field; } memcpy (curr_field->data, (char *)&mathd2, 8); return curr_field; } cob_field * cob_intr_numval (cob_field *srcfield) { long long llval = 0; double val; size_t i; int integer_digits = 0; int decimal_digits = 0; int sign = 0; int decimal_seen = 0; cob_field_attr attr; cob_field field; unsigned char integer_buff[64]; unsigned char decimal_buff[64]; unsigned char final_buff[64]; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); memset (integer_buff, 0, sizeof (integer_buff)); memset (decimal_buff, 0, sizeof (decimal_buff)); memset (final_buff, 0, sizeof (final_buff)); for (i = 0; i < srcfield->size; ++i) { if (i < (srcfield->size - 2)) { if (strcasecmp ((char *)&srcfield->data[i], "CR") == 0 || strcasecmp ((char *)&srcfield->data[i], "DB") == 0) { sign = 1; break; } } if (srcfield->data[i] == ' ') { continue; } if (srcfield->data[i] == '+') { continue; } if (srcfield->data[i] == '-') { sign = 1; continue; } if (srcfield->data[i] == cob_current_module->decimal_point) { decimal_seen = 1; continue; } if (srcfield->data[i] >= '0' && srcfield->data[i] <= '9') { llval *= 10; llval += srcfield->data[i] - '0'; if (decimal_seen) { decimal_buff[decimal_digits++] = srcfield->data[i]; } else { integer_buff[integer_digits++] = srcfield->data[i]; } } if ((integer_digits + decimal_digits) > 30) { break; } } if (!integer_digits) { integer_buff[0] = '0'; } if (!decimal_digits) { decimal_buff[0] = '0'; } if (sign) { llval = -llval; } if ((integer_digits + decimal_digits) <= 18) { attr.scale = decimal_digits; make_field_entry (&field); memcpy (curr_field->data, (char *)&llval, 8); } else { snprintf ((char *)final_buff, 63, "%s%s.%s", sign ? "-" : "", integer_buff, decimal_buff); sscanf ((char *)final_buff, "%lf", &val); make_double_entry (); memcpy (curr_field->data, (char *)&val, sizeof (double)); } return curr_field; } cob_field * cob_intr_numval_c (cob_field *srcfield, cob_field *currency) { unsigned char *currency_data; long long llval = 0; double val; size_t i; int integer_digits = 0; int decimal_digits = 0; int sign = 0; int decimal_seen = 0; cob_field_attr attr; cob_field field; unsigned char integer_buff[64]; unsigned char decimal_buff[64]; unsigned char final_buff[64]; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); memset (integer_buff, 0, sizeof (integer_buff)); memset (decimal_buff, 0, sizeof (decimal_buff)); memset (final_buff, 0, sizeof (final_buff)); currency_data = NULL; if (currency) { if (currency->size < srcfield->size) { currency_data = currency->data; } } for (i = 0; i < srcfield->size; ++i) { if (i < (srcfield->size - 2)) { if (strcasecmp ((char *)&srcfield->data[i], "CR") == 0 || strcasecmp ((char *)&srcfield->data[i], "DB") == 0) { sign = 1; break; } } if (currency_data) { if (i < (srcfield->size - currency->size)) { if (memcmp ((char *)&srcfield->data[i], currency_data, currency->size) == 0) { i += (currency->size - 1); continue; } } } if (srcfield->data[i] == ' ') { continue; } if (srcfield->data[i] == '+') { continue; } if (srcfield->data[i] == '-') { sign = 1; continue; } if (srcfield->data[i] == cob_current_module->decimal_point) { decimal_seen = 1; continue; } if (srcfield->data[i] == cob_current_module->currency_symbol) { continue; } if (srcfield->data[i] >= '0' && srcfield->data[i] <= '9') { llval *= 10; llval += srcfield->data[i] - '0'; if (decimal_seen) { decimal_buff[decimal_digits++] = srcfield->data[i]; } else { integer_buff[integer_digits++] = srcfield->data[i]; } } if ((integer_digits + decimal_digits) > 30) { break; } } if (!integer_digits) { integer_buff[0] = '0'; } if (!decimal_digits) { decimal_buff[0] = '0'; } if (sign) { llval = -llval; } if ((integer_digits + decimal_digits) <= 18) { attr.scale = decimal_digits; make_field_entry (&field); memcpy (curr_field->data, (char *)&llval, 8); } else { snprintf ((char *)final_buff, 63, "%s%s.%s", sign ? "-" : "", integer_buff, decimal_buff); sscanf ((char *)final_buff, "%lf", &val); make_double_entry (); memcpy (curr_field->data, (char *)&val, sizeof (double)); } return curr_field; } cob_field * cob_intr_annuity (cob_field *srcfield1, cob_field *srcfield2) { double mathd1, mathd2; make_double_entry (); cob_decimal_set_field (&d1, srcfield1); cob_decimal_set_field (&d2, srcfield2); mathd1 = intr_get_double (&d1); mathd2 = intr_get_double (&d2); if (mathd1 == 0) { mathd1 = 1.0 / mathd2; memcpy (curr_field->data, (char *)&mathd1, sizeof (double)); return curr_field; } mathd1 /= (1.0 - pow (mathd1 + 1.0, 0.0 - mathd2)); memcpy (curr_field->data, (char *)&mathd1, sizeof (double)); return curr_field; } cob_field * cob_intr_sum (const int params, ...) { cob_field *f; va_list args; int i; int digits = 0; int scale = 0; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); mpz_set_ui (d1.value, 0); d1.scale = 0; va_start (args, params); for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); if ((COB_FIELD_DIGITS(f) - COB_FIELD_SCALE(f)) > digits) { digits = COB_FIELD_DIGITS(f) - COB_FIELD_SCALE(f); } if (COB_FIELD_SCALE(f) > scale) { scale = COB_FIELD_SCALE(f); } cob_decimal_set_field (&d2, f); cob_decimal_add (&d1, &d2); } va_end (args); attr.scale = scale; make_field_entry (&field); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_ord_min (const int params, ...) { cob_field *f, *basef; int i; int ordmin = 0; va_list args; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); if (params <= 1) { cob_set_int (curr_field, 0); return curr_field; } va_start (args, params); basef = va_arg (args, cob_field *); for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basef) < 0) { basef = f; ordmin = i; } } va_end (args); cob_set_int (curr_field, ordmin + 1); return curr_field; } cob_field * cob_intr_ord_max (const int params, ...) { cob_field *f, *basef; int ordmin = 0; int i; va_list args; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); if (params <= 1) { cob_set_int (curr_field, 0); return curr_field; } va_start (args, params); basef = va_arg (args, cob_field *); for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basef) > 0) { basef = f; ordmin = i; } } va_end (args); cob_set_int (curr_field, ordmin + 1); return curr_field; } cob_field * cob_intr_min (const int params, ...) { cob_field *f, *basef; va_list args; int i; va_start (args, params); basef = va_arg (args, cob_field *); for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basef) < 0) { basef = f; } } va_end (args); return basef; } cob_field * cob_intr_max (const int params, ...) { cob_field *f, *basef; va_list args; int i; va_start (args, params); basef = va_arg (args, cob_field *); for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basef) > 0) { basef = f; } } va_end (args); return basef; } cob_field * cob_intr_midrange (const int params, ...) { cob_field *f, *basemin, *basemax; va_list args; int i; make_double_entry (); va_start (args, params); basemin = va_arg (args, cob_field *); basemax = basemin; for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basemin) < 0) { basemin = f; } if (cob_cmp (f, basemax) > 0) { basemax = f; } } va_end (args); cob_decimal_set_field (&d1, basemin); cob_decimal_set_field (&d2, basemax); cob_decimal_add (&d1, &d2); mpz_set_ui (d2.value, 2); d2.scale = 0; cob_decimal_div (&d1, &d2); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_median (const int params, ...) { cob_field *f; cob_field **field_alloc; va_list args; int i; va_start (args, params); f = va_arg (args, cob_field *); if (params == 1) { va_end (args); return f; } field_alloc = cob_malloc (params * sizeof (cob_field *)); field_alloc[0] = f; for (i = 1; i < params; ++i) { field_alloc[i] = va_arg (args, cob_field *); } va_end (args); qsort (field_alloc, (size_t)params, (size_t)sizeof (cob_field *), comp_field); i = params / 2; if (params % 2) { f = field_alloc[i]; } else { make_double_entry (); cob_decimal_set_field (&d1, field_alloc[i-1]); cob_decimal_set_field (&d2, field_alloc[i]); cob_decimal_add (&d1, &d2); mpz_set_ui (d2.value, 2); d2.scale = 0; cob_decimal_div (&d1, &d2); cob_decimal_get_field (&d1, curr_field, 0); f = curr_field; } free (field_alloc); return f; } cob_field * cob_intr_mean (const int params, ...) { cob_field *f; va_list args; long long n; union { unsigned char data[8]; long long datall; } datun; int i; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); mpz_set_ui (d1.value, 0); d1.scale = 0; va_start (args, params); for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); cob_decimal_add (&d1, &d2); } va_end (args); mpz_set_ui (d2.value, (unsigned int)params); d2.scale = 0; cob_decimal_div (&d1, &d2); field.data = datun.data; cob_decimal_get_field (&d1, &field, 0); n = datun.datall; for (i = 0; n; n /= 10, ++i) ; field.data = NULL; if (i <= 18) { attr.scale = 18 - i; } make_field_entry (&field); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_mod (cob_field *srcfield1, cob_field *srcfield2) { cob_field *f1; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); make_field_entry (&field); f1 = cob_intr_integer (cob_intr_binop (srcfield1, '/', srcfield2)); cob_decimal_set_field (&d1, srcfield2); cob_decimal_set_field (&d2, f1); cob_decimal_mul (&d2, &d1); cob_decimal_set_field (&d1, srcfield1); cob_decimal_sub (&d1, &d2); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_range (const int params, ...) { cob_field *f, *basemin, *basemax; va_list args; int i; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); va_start (args, params); basemin = va_arg (args, cob_field *); basemax = basemin; for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); if (cob_cmp (f, basemin) < 0) { basemin = f; } if (cob_cmp (f, basemax) > 0) { basemax = f; } } va_end (args); attr.scale = COB_FIELD_SCALE(basemin); if (COB_FIELD_SCALE(basemax) > attr.scale) { attr.scale = COB_FIELD_SCALE(basemax); } make_field_entry (&field); cob_decimal_set_field (&d1, basemax); cob_decimal_set_field (&d2, basemin); cob_decimal_sub (&d1, &d2); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_rem (cob_field *srcfield1, cob_field *srcfield2) { cob_field *f1; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); f1 = cob_intr_integer_part (cob_intr_binop (srcfield1, '/', srcfield2)); cob_decimal_set_field (&d1, srcfield2); cob_decimal_set_field (&d2, f1); cob_decimal_mul (&d2, &d1); cob_decimal_set_field (&d1, srcfield1); cob_decimal_sub (&d1, &d2); attr.scale = COB_FIELD_SCALE(srcfield1); if (COB_FIELD_SCALE(srcfield2) > attr.scale) { attr.scale = COB_FIELD_SCALE(srcfield2); } make_field_entry (&field); cob_decimal_get_field (&d1, curr_field, 0); return curr_field; } cob_field * cob_intr_random (const int params, ...) { cob_field *f; va_list args; int seed = 1; int randnum; int i; int exp10; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 9, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); va_start (args, params); if (params) { f = va_arg (args, cob_field *); seed = cob_get_int (f); if (seed < 0) { seed = 0; } #ifdef __CYGWIN__ srandom ((unsigned int)seed); #else srand ((unsigned int)seed); #endif } va_end (args); #ifdef __CYGWIN__ randnum = (int)random (); #else randnum = rand (); #endif exp10 = 1; for (i = 0; i < 10; ++i) { if ((randnum / exp10) == 0) { break; } exp10 *= 10; } if (i == 0) { i = 1; } attr.scale = i; make_field_entry (&field); *(long long *)curr_field->data = (long long)randnum; return curr_field; } cob_field * cob_intr_variance (const int params, ...) { cob_field *f; va_list args; long long n; union { unsigned char data[8]; long long datall; } datun; int i; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 18, 0, COB_FLAG_HAVE_SIGN, NULL); COB_FIELD_INIT (8, NULL, &attr); if (params == 1) { make_field_entry (&field); cob_set_int (curr_field, 0); return curr_field; } /* MEAN for all params */ mpz_set_ui (d1.value, 0); d1.scale = 0; va_start (args, params); for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); cob_decimal_add (&d1, &d2); } va_end (args); mpz_set_ui (d2.value, (unsigned int)params); d2.scale = 0; cob_decimal_div (&d1, &d2); /* Got the MEAN in d1, iterate again */ mpz_set_ui (d4.value, 0); d4.scale = 0; va_start (args, params); for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); cob_decimal_sub (&d2, &d1); cob_decimal_mul (&d2, &d2); cob_decimal_add (&d4, &d2); } va_end (args); mpz_set_ui (d3.value, (unsigned int)params); d3.scale = 0; cob_decimal_div (&d4, &d3); field.data = datun.data; cob_decimal_get_field (&d4, &field, 0); n = datun.datall; for (i = 0; n; n /= 10, ++i) ; field.data = NULL; if (i <= 18) { attr.scale = 18 - i; } make_field_entry (&field); cob_decimal_get_field (&d4, curr_field, 0); return curr_field; } cob_field * cob_intr_standard_deviation (const int params, ...) { cob_field *f; va_list args; int i; va_start (args, params); make_double_entry (); if (params == 1) { va_end (args); cob_set_int (curr_field, 0); return curr_field; } /* MEAN for all params */ mpz_set_ui (d1.value, 0); d1.scale = 0; for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); cob_decimal_add (&d1, &d2); } va_end (args); mpz_set_ui (d2.value, (unsigned int)params); d2.scale = 0; cob_decimal_div (&d1, &d2); /* Got the MEAN in d1, iterate again */ mpz_set_ui (d4.value, 0); d4.scale = 0; va_start (args, params); for (i = 0; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); cob_decimal_sub (&d2, &d1); cob_decimal_mul (&d2, &d2); cob_decimal_add (&d4, &d2); } va_end (args); mpz_set_ui (d3.value, (unsigned int)params); d3.scale = 0; cob_decimal_div (&d4, &d3); /* We have the VARIANCE in d4, sqrt = STANDARD-DEVIATION */ /* Do not know why this does not work d5.scale = d4.scale; mpz_mul_ui (d5.value, d4.value, 1000000000); mpz_mul_ui (d4.value, d5.value, 1000000000); mpz_sqrt (d5.value, d4.value); mpz_div_ui (d4.value, d5.value, 1000000000); cob_decimal_get_field (&d4, curr_field, 0); return curr_field; */ cob_decimal_get_field (&d4, curr_field, 0); f = cob_intr_sqrt (curr_field); return f; } cob_field * cob_intr_present_value (const int params, ...) { cob_field *f; va_list args; int i; va_start (args, params); make_double_entry (); if (params < 2) { va_end (args); fprintf (stderr, "Wrong number of parameters for FUNCTION PRESENT-VALUE\n"); fflush (stderr); cob_set_int (curr_field, 0); return curr_field; } f = va_arg (args, cob_field *); cob_decimal_set_field (&d1, f); mpz_set_ui (d2.value, 1); d2.scale = 0; cob_decimal_add (&d1, &d2); mpz_set_ui (d4.value, 0); d4.scale = 0; for (i = 1; i < params; ++i) { f = va_arg (args, cob_field *); cob_decimal_set_field (&d2, f); mpz_set (d3.value, d1.value); d3.scale = d1.scale; if (i > 1) { mpz_set_ui (d5.value, (unsigned int)i); d5.scale = 0; cob_decimal_pow (&d3, &d5); } cob_decimal_div (&d2, &d3); cob_decimal_add (&d4, &d2); } va_end (args); cob_decimal_get_field (&d4, curr_field, 0); return curr_field; } cob_field * cob_intr_year_to_yyyy (const int params, ...) { cob_field *f; struct tm *timeptr; va_list args; time_t t; int year; int interval; int xqtyear; int maxyear; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; va_start (args, params); f = va_arg (args, cob_field *); year = cob_get_int (f); if (params > 1) { f = va_arg (args, cob_field *); interval = cob_get_int (f); } else { interval = 50; } if (params > 2) { f = va_arg (args, cob_field *); xqtyear = cob_get_int (f); } else { t = time (NULL); timeptr = localtime (&t); xqtyear = 1900 + timeptr->tm_year; } va_end (args); if (year < 0 || year > 99) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (xqtyear < 1601 || xqtyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } maxyear = xqtyear + interval; if (maxyear < 1700 || maxyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (maxyear % 100 >= year) { year += 100 * (maxyear / 100); } else { year += 100 * ((maxyear / 100) - 1); } cob_set_int (curr_field, year); return curr_field; } cob_field * cob_intr_date_to_yyyymmdd (const int params, ...) { cob_field *f; struct tm *timeptr; va_list args; time_t t; int year; int mmdd; int interval; int xqtyear; int maxyear; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; va_start (args, params); f = va_arg (args, cob_field *); year = cob_get_int (f); mmdd = year % 10000; year /= 10000; if (params > 1) { f = va_arg (args, cob_field *); interval = cob_get_int (f); } else { interval = 50; } if (params > 2) { f = va_arg (args, cob_field *); xqtyear = cob_get_int (f); } else { t = time (NULL); timeptr = localtime (&t); xqtyear = 1900 + timeptr->tm_year; } va_end (args); if (year < 0 || year > 999999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (xqtyear < 1601 || xqtyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } maxyear = xqtyear + interval; if (maxyear < 1700 || maxyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (maxyear % 100 >= year) { year += 100 * (maxyear / 100); } else { year += 100 * ((maxyear / 100) - 1); } year *= 10000; year += mmdd; cob_set_int (curr_field, year); return curr_field; } cob_field * cob_intr_day_to_yyyyddd (const int params, ...) { cob_field *f; struct tm *timeptr; va_list args; time_t t; int year; int days; int interval; int xqtyear; int maxyear; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; va_start (args, params); f = va_arg (args, cob_field *); year = cob_get_int (f); days = year % 1000; year /= 1000; if (params > 1) { f = va_arg (args, cob_field *); interval = cob_get_int (f); } else { interval = 50; } if (params > 2) { f = va_arg (args, cob_field *); xqtyear = cob_get_int (f); } else { t = time (NULL); timeptr = localtime (&t); xqtyear = 1900 + timeptr->tm_year; } va_end (args); if (year < 0 || year > 999999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (xqtyear < 1601 || xqtyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } maxyear = xqtyear + interval; if (maxyear < 1700 || maxyear > 9999) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } if (maxyear % 100 >= year) { year += 100 * (maxyear / 100); } else { year += 100 * ((maxyear / 100) - 1); } year *= 1000; year += days; cob_set_int (curr_field, year); return curr_field; } cob_field * cob_intr_seconds_past_midnight (void) { struct tm *timeptr; time_t t; int seconds; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); t = time (NULL); timeptr = localtime (&t); seconds = (timeptr->tm_hour * 3600) + (timeptr->tm_min * 60) + timeptr->tm_sec; cob_set_int (curr_field, seconds); return curr_field; } cob_field * cob_intr_seconds_from_formatted_time (cob_field *format, cob_field *value) { unsigned char *p1; unsigned char *p2; size_t n; int seconds = 0; int minutes = 0; int hours = 0; int seconds_seen = 0; int minutes_seen = 0; int hours_seen = 0; cob_field_attr attr; cob_field field; COB_ATTR_INIT (COB_TYPE_NUMERIC_BINARY, 8, 0, 0, NULL); COB_FIELD_INIT (4, NULL, &attr); make_field_entry (&field); cob_exception_code = 0; if (value->size < format->size) { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); cob_set_int (curr_field, 0); return curr_field; } p1 = format->data; p2 = value->data; for (n = 0; n < format->size - 1; ++n, ++p1, ++p2) { if (!memcmp (p1, "hh", 2) && !hours_seen) { if (*p2 >= '0' && *p2 <= '9' && *(p2 + 1) >= '0' && *(p2 + 1) <= '9') { hours = ((*p2 - '0') * 10) + (*(p2 + 1) - '0'); hours_seen = 1; continue; } } if (!memcmp (p1, "mm", 2) && !minutes_seen) { if (*p2 >= '0' && *p2 <= '9' && *(p2 + 1) >= '0' && *(p2 + 1) <= '9') { minutes = ((*p2 - '0') * 10) + (*(p2 + 1) - '0'); minutes_seen = 1; continue; } } if (!memcmp (p1, "ss", 2) && !seconds_seen) { if (*p2 >= '0' && *p2 <= '9' && *(p2 + 1) >= '0' && *(p2 + 1) <= '9') { seconds = ((*p2 - '0') * 10) + (*(p2 + 1) - '0'); seconds_seen = 1; continue; } } } if (hours_seen && minutes_seen && seconds_seen) { seconds += (hours * 3600) + (minutes * 60); } else { cob_set_exception (COB_EC_ARGUMENT_FUNCTION); seconds = 0; } cob_set_int (curr_field, seconds); return curr_field; } cob_field * cob_intr_locale_date (const int offset, const int length, cob_field *srcfield, cob_field *locale_field) { cob_field_attr attr; cob_field field; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) size_t len; int indate; int days; int month; int year; #ifdef HAVE_LANGINFO_CODESET unsigned char *p; char *deflocale = NULL; char *localep = NULL; char *localep2; struct tm tstruct; char buff2[128]; #else char *p; LCID localeid = LOCALE_USER_DEFAULT; SYSTEMTIME syst; #endif char buff[128]; #endif COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); cob_exception_code = 0; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) if (COB_FIELD_IS_NUMERIC (srcfield)) { indate = cob_get_int (srcfield); } else { if (srcfield->size < 8) { goto derror; } p = srcfield->data; indate = 0; for (len = 0; len < 8; ++len, ++p) { if (isdigit (*p)) { indate *= 10; indate += (*p - '0'); } else { goto derror; } } } year = indate / 10000; if (year < 1601 || year > 9999) { goto derror; } indate %= 10000; month = indate / 100; if (month < 1 || month > 12) { goto derror; } days = indate % 100; if (days < 1 || days > 31) { goto derror; } if (leap_year (year)) { if (days > leap_month_days[month]) { goto derror; } } else { if (days > normal_month_days[month]) { goto derror; } } #ifdef HAVE_LANGINFO_CODESET month--; memset ((void *)&tstruct, 0, sizeof(struct tm)); tstruct.tm_year = year - 1900; tstruct.tm_mon = month; tstruct.tm_mday = days; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); deflocale = locale_buff; localep2 = setlocale (LC_TIME, NULL); if (localep2) { localep = strdup (localep2); } (void) setlocale (LC_TIME, deflocale); } memset (buff2, 0, sizeof(buff2)); snprintf(buff2, sizeof(buff2) - 1, "%s", nl_langinfo(D_FMT)); if (deflocale) { if (localep) { (void) setlocale (LC_TIME, localep); } } strftime (buff, sizeof(buff), buff2, &tstruct); #else memset ((void *)&syst, 0, sizeof(syst)); syst.wYear = year; syst.wMonth = month; syst.wDay = days; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); for (p = locale_buff; *p; ++p) { if (isalnum(*p) || *p == '_') { continue; } break; } *p = 0; for (len = 0; len < WINLOCSIZE; ++len) { if (!strcmp(locale_buff, wintable[len].winlocalename)) { localeid = wintable[len].winlocaleid; break; } } if (len == WINLOCSIZE) { goto derror; } } if (!GetDateFormat (localeid, DATE_SHORTDATE, &syst, NULL, buff, sizeof(buff))) { goto derror; } #endif len = strlen (buff); field.size = len; make_field_entry (&field); memcpy (curr_field->data, buff, len); if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; derror: #endif field.size = 10; make_field_entry (&field); memset (curr_field->data, ' ', 10); cob_set_exception (COB_EC_ARGUMENT_FUNCTION); return curr_field; } cob_field * cob_intr_locale_time (const int offset, const int length, cob_field *srcfield, cob_field *locale_field) { cob_field_attr attr; cob_field field; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) size_t len; int indate; int hours; int minutes; int seconds; #ifdef HAVE_LANGINFO_CODESET unsigned char *p; char *deflocale = NULL; char *localep = NULL; char *localep2; struct tm tstruct; char buff2[128]; #else char *p; LCID localeid = LOCALE_USER_DEFAULT; SYSTEMTIME syst; #endif char buff[128]; #endif COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); cob_exception_code = 0; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) if (COB_FIELD_IS_NUMERIC (srcfield)) { indate = cob_get_int (srcfield); } else { if (srcfield->size < 6) { goto derror; } p = srcfield->data; indate = 0; for (len = 0; len < 6; ++len, ++p) { if (isdigit (*p)) { indate *= 10; indate += (*p - '0'); } else { goto derror; } } } hours = indate / 10000; if (hours < 0 || hours > 24) { goto derror; } indate %= 10000; minutes = indate / 100; if (minutes < 0 || minutes > 59) { goto derror; } seconds = indate % 100; if (seconds < 0 || seconds > 59) { goto derror; } #ifdef HAVE_LANGINFO_CODESET memset ((void *)&tstruct, 0, sizeof(struct tm)); tstruct.tm_hour = hours; tstruct.tm_min = minutes; tstruct.tm_sec = seconds; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); deflocale = locale_buff; localep2 = setlocale (LC_TIME, NULL); if (localep2) { localep = strdup (localep2); } (void) setlocale (LC_TIME, deflocale); } memset (buff2, 0, sizeof(buff2)); snprintf(buff2, sizeof(buff2) - 1, "%s", nl_langinfo(T_FMT)); if (deflocale) { if (localep) { (void) setlocale (LC_TIME, localep); } } strftime (buff, sizeof(buff), buff2, &tstruct); #else memset ((void *)&syst, 0, sizeof(syst)); syst.wHour = hours; syst.wMinute = minutes; syst.wSecond = seconds; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); for (p = locale_buff; *p; ++p) { if (isalnum(*p) || *p == '_') { continue; } break; } *p = 0; for (len = 0; len < WINLOCSIZE; ++len) { if (!strcmp(locale_buff, wintable[len].winlocalename)) { localeid = wintable[len].winlocaleid; break; } } if (len == WINLOCSIZE) { goto derror; } } if (!GetTimeFormat (localeid, LOCALE_NOUSEROVERRIDE, &syst, NULL, buff, sizeof(buff))) { goto derror; } #endif len = strlen (buff); field.size = len; make_field_entry (&field); memcpy (curr_field->data, buff, len); if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; derror: #endif field.size = 10; make_field_entry (&field); memset (curr_field->data, ' ', 10); cob_set_exception (COB_EC_ARGUMENT_FUNCTION); return curr_field; } cob_field * cob_intr_lcl_time_from_secs (const int offset, const int length, cob_field *srcfield, cob_field *locale_field) { cob_field_attr attr; cob_field field; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) size_t len; int indate; int hours; int minutes; int seconds; #ifdef HAVE_LANGINFO_CODESET char *deflocale = NULL; char *localep = NULL; char *localep2; struct tm tstruct; char buff2[128]; #else char *p; LCID localeid = LOCALE_USER_DEFAULT; SYSTEMTIME syst; #endif char buff[128]; #endif COB_ATTR_INIT (COB_TYPE_ALPHANUMERIC, 0, 0, 0, NULL); COB_FIELD_INIT (0, NULL, &attr); cob_exception_code = 0; #if defined(_WIN32) || defined(__CYGWIN__) || defined(HAVE_LANGINFO_CODESET) if (COB_FIELD_IS_NUMERIC (srcfield)) { indate = cob_get_int (srcfield); } else { goto derror; } if (indate > 86400) { goto derror; } hours = indate / 3600; indate %= 3600; minutes = indate / 60; seconds = indate % 60; #ifdef HAVE_LANGINFO_CODESET memset ((void *)&tstruct, 0, sizeof(struct tm)); tstruct.tm_hour = hours; tstruct.tm_min = minutes; tstruct.tm_sec = seconds; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); deflocale = locale_buff; localep2 = setlocale (LC_TIME, NULL); if (localep2) { localep = strdup (localep2); } (void) setlocale (LC_TIME, deflocale); } memset (buff2, 0, sizeof(buff2)); snprintf(buff2, sizeof(buff2) - 1, "%s", nl_langinfo(T_FMT)); if (deflocale) { if (localep) { (void) setlocale (LC_TIME, localep); } } strftime (buff, sizeof(buff), buff2, &tstruct); #else memset ((void *)&syst, 0, sizeof(syst)); syst.wHour = hours; syst.wMinute = minutes; syst.wSecond = seconds; if (locale_field) { if (locale_field->size >= COB_SMALL_BUFF) { goto derror; } cob_field_to_string (locale_field, locale_buff); for (p = locale_buff; *p; ++p) { if (isalnum(*p) || *p == '_') { continue; } break; } *p = 0; for (len = 0; len < WINLOCSIZE; ++len) { if (!strcmp(locale_buff, wintable[len].winlocalename)) { localeid = wintable[len].winlocaleid; break; } } if (len == WINLOCSIZE) { goto derror; } } if (!GetTimeFormat (localeid, LOCALE_NOUSEROVERRIDE, &syst, NULL, buff, sizeof(buff))) { goto derror; } #endif len = strlen (buff); field.size = len; make_field_entry (&field); memcpy (curr_field->data, buff, len); if (unlikely(offset > 0)) { calc_ref_mod (curr_field, offset, length); } return curr_field; derror: #endif field.size = 10; make_field_entry (&field); memset (curr_field->data, ' ', 10); cob_set_exception (COB_EC_ARGUMENT_FUNCTION); return curr_field; } /* Initialization routine */ void cob_init_intrinsic (void) { size_t i; cob_decimal_init (&d1); cob_decimal_init (&d2); cob_decimal_init (&d3); cob_decimal_init (&d4); cob_decimal_init (&d5); /* mpz_init2 (mp, 256); */ memset ((char *)&calc_field[0], 0, sizeof (calc_field)); memset ((char *)&calc_attr[0], 0, sizeof (calc_attr)); for (i = 0; i < DEPTH_LEVEL; ++i) { calc_field[i].data = cob_malloc (256); calc_field[i].size = 256; calc_size[i] = 256; } locale_buff = cob_malloc (COB_SMALL_BUFF); } open-cobol-1.1/libcob/intrinsic.h0000644000000000000000000001161611136150275012452 /* * Copyright (C) 2005-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_INTRINSIC_H #define COB_INTRINSIC_H #include extern cob_field *cob_intr_binop (cob_field *, int, cob_field *); extern cob_field *cob_intr_current_date (const int, const int); extern cob_field *cob_intr_when_compiled (const int, const int, cob_field *); extern cob_field *cob_intr_exception_file (void); extern cob_field *cob_intr_exception_location (void); extern cob_field *cob_intr_exception_status (void); extern cob_field *cob_intr_exception_statement (void); extern cob_field *cob_intr_char (cob_field *); extern cob_field *cob_intr_ord (cob_field *); extern cob_field *cob_intr_stored_char_length (cob_field *); extern cob_field *cob_intr_combined_datetime (cob_field *, cob_field *); extern cob_field *cob_intr_date_of_integer (cob_field *); extern cob_field *cob_intr_day_of_integer (cob_field *); extern cob_field *cob_intr_integer_of_date (cob_field *); extern cob_field *cob_intr_integer_of_day (cob_field *); extern cob_field *cob_intr_test_date_yyyymmdd (cob_field *); extern cob_field *cob_intr_test_day_yyyyddd (cob_field *); extern cob_field *cob_intr_factorial (cob_field *); extern cob_field *cob_intr_exp (cob_field *); extern cob_field *cob_intr_exp10 (cob_field *); extern cob_field *cob_intr_abs (cob_field *); extern cob_field *cob_intr_acos (cob_field *); extern cob_field *cob_intr_asin (cob_field *); extern cob_field *cob_intr_atan (cob_field *); extern cob_field *cob_intr_cos (cob_field *); extern cob_field *cob_intr_log (cob_field *); extern cob_field *cob_intr_log10 (cob_field *); extern cob_field *cob_intr_sin (cob_field *); extern cob_field *cob_intr_sqrt (cob_field *); extern cob_field *cob_intr_tan (cob_field *); extern cob_field *cob_intr_upper_case (const int, const int, cob_field *); extern cob_field *cob_intr_lower_case (const int, const int, cob_field *); extern cob_field *cob_intr_reverse (const int, const int, cob_field *); extern cob_field *cob_intr_concatenate (const int, const int, const int, ...); extern cob_field *cob_intr_substitute (const int, const int, const int, ...); extern cob_field *cob_intr_substitute_case (const int, const int, const int, ...); extern cob_field *cob_intr_trim (const int, const int, cob_field *, const int); extern cob_field *cob_intr_length (cob_field *); extern cob_field *cob_intr_integer (cob_field *); extern cob_field *cob_intr_integer_part (cob_field *); extern cob_field *cob_intr_fraction_part (cob_field *); extern cob_field *cob_intr_sign (cob_field *); extern cob_field *cob_intr_numval (cob_field *); extern cob_field *cob_intr_numval_c (cob_field *, cob_field *); extern cob_field *cob_intr_annuity (cob_field *, cob_field *); extern cob_field *cob_intr_mod (cob_field *, cob_field *); extern cob_field *cob_intr_rem (cob_field *, cob_field *); extern cob_field *cob_intr_sum (const int, ...); extern cob_field *cob_intr_ord_min (const int, ...); extern cob_field *cob_intr_ord_max (const int, ...); extern cob_field *cob_intr_min (const int, ...); extern cob_field *cob_intr_max (const int, ...); extern cob_field *cob_intr_midrange (const int, ...); extern cob_field *cob_intr_median (const int, ...); extern cob_field *cob_intr_mean (const int, ...); extern cob_field *cob_intr_range (const int, ...); extern cob_field *cob_intr_random (const int, ...); extern cob_field *cob_intr_variance (const int, ...); extern cob_field *cob_intr_standard_deviation (const int, ...); extern cob_field *cob_intr_present_value (const int, ...); extern cob_field *cob_intr_year_to_yyyy (const int, ...); extern cob_field *cob_intr_date_to_yyyymmdd (const int, ...); extern cob_field *cob_intr_day_to_yyyyddd (const int, ...); extern cob_field *cob_intr_locale_date (const int, const int, cob_field *, cob_field *); extern cob_field *cob_intr_locale_time (const int, const int, cob_field *, cob_field *); extern cob_field *cob_intr_seconds_past_midnight (void); extern cob_field *cob_intr_lcl_time_from_secs (const int, const int, cob_field *, cob_field *); extern cob_field *cob_intr_seconds_from_formatted_time (cob_field *, cob_field *); #endif /* COB_INTRINSIC_H */ open-cobol-1.1/libcob/codegen.h0000644000000000000000000015332011134601703012046 /* * Copyright (C) 2006-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If not write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_CODEGEN_H #define COB_CODEGEN_H #ifdef COB_LOCAL_INLINE #define COB_STATIC static #else #define COB_STATIC extern int cob_get_numdisp (const unsigned char *, const size_t); extern int cob_cmp_packed_int (const cob_field *, const int); extern int cob_get_packed_int (const cob_field *); extern int cob_add_packed_int (cob_field *, const int); extern int cob_cmp_u8_binary (const unsigned char *, const int); extern int cob_cmp_s8_binary (const unsigned char *, const int); extern int cob_cmp_u16_binary (const unsigned char *, const int); extern int cob_cmp_s16_binary (const unsigned char *, const int); extern int cob_cmp_u24_binary (const unsigned char *, const int); extern int cob_cmp_s24_binary (const unsigned char *, const int); extern int cob_cmp_u32_binary (const unsigned char *, const int); extern int cob_cmp_s32_binary (const unsigned char *, const int); extern int cob_cmp_u40_binary (const unsigned char *, const int); extern int cob_cmp_s40_binary (const unsigned char *, const int); extern int cob_cmp_u48_binary (const unsigned char *, const int); extern int cob_cmp_s48_binary (const unsigned char *, const int); extern int cob_cmp_u56_binary (const unsigned char *, const int); extern int cob_cmp_s56_binary (const unsigned char *, const int); extern int cob_cmp_u64_binary (const unsigned char *, const int); extern int cob_cmp_s64_binary (const unsigned char *, const int); extern int cob_cmp_align_u16_binary (const unsigned char *, const int); extern int cob_cmp_align_s16_binary (const unsigned char *, const int); extern int cob_cmp_align_u32_binary (const unsigned char *, const int); extern int cob_cmp_align_s32_binary (const unsigned char *, const int); extern int cob_cmp_align_u64_binary (const unsigned char *, const int); extern int cob_cmp_align_s64_binary (const unsigned char *, const int); extern void cob_add_u8_binary (unsigned char *, const int); extern void cob_add_s8_binary (unsigned char *, const int); extern void cob_add_u16_binary (unsigned char *, const int); extern void cob_add_s16_binary (unsigned char *, const int); extern void cob_add_u24_binary (unsigned char *, const int); extern void cob_add_s24_binary (unsigned char *, const int); extern void cob_add_u32_binary (unsigned char *, const int); extern void cob_add_s32_binary (unsigned char *, const int); extern void cob_add_u40_binary (unsigned char *, const int); extern void cob_add_s40_binary (unsigned char *, const int); extern void cob_add_u48_binary (unsigned char *, const int); extern void cob_add_s48_binary (unsigned char *, const int); extern void cob_add_u56_binary (unsigned char *, const int); extern void cob_add_s56_binary (unsigned char *, const int); extern void cob_add_u64_binary (unsigned char *, const int); extern void cob_add_s64_binary (unsigned char *, const int); extern void cob_add_align_u16_binary (unsigned char *, const int); extern void cob_add_align_s16_binary (unsigned char *, const int); extern void cob_add_align_u32_binary (unsigned char *, const int); extern void cob_add_align_s32_binary (unsigned char *, const int); extern void cob_add_align_u64_binary (unsigned char *, const int); extern void cob_add_align_s64_binary (unsigned char *, const int); extern void cob_sub_u8_binary (unsigned char *, const int); extern void cob_sub_s8_binary (unsigned char *, const int); extern void cob_sub_u16_binary (unsigned char *, const int); extern void cob_sub_s16_binary (unsigned char *, const int); extern void cob_sub_u24_binary (unsigned char *, const int); extern void cob_sub_s24_binary (unsigned char *, const int); extern void cob_sub_u32_binary (unsigned char *, const int); extern void cob_sub_s32_binary (unsigned char *, const int); extern void cob_sub_u40_binary (unsigned char *, const int); extern void cob_sub_s40_binary (unsigned char *, const int); extern void cob_sub_u48_binary (unsigned char *, const int); extern void cob_sub_s48_binary (unsigned char *, const int); extern void cob_sub_u56_binary (unsigned char *, const int); extern void cob_sub_s56_binary (unsigned char *, const int); extern void cob_sub_u64_binary (unsigned char *, const int); extern void cob_sub_s64_binary (unsigned char *, const int); extern void cob_sub_align_u16_binary (unsigned char *, const int); extern void cob_sub_align_s16_binary (unsigned char *, const int); extern void cob_sub_align_u32_binary (unsigned char *, const int); extern void cob_sub_align_s32_binary (unsigned char *, const int); extern void cob_sub_align_u64_binary (unsigned char *, const int); extern void cob_sub_align_s64_binary (unsigned char *, const int); #ifndef WORDS_BIGENDIAN extern int cob_cmpswp_u16_binary (const unsigned char *, const int); extern int cob_cmpswp_s16_binary (const unsigned char *, const int); extern int cob_cmpswp_u24_binary (const unsigned char *, const int); extern int cob_cmpswp_s24_binary (const unsigned char *, const int); extern int cob_cmpswp_u32_binary (const unsigned char *, const int); extern int cob_cmpswp_s32_binary (const unsigned char *, const int); extern int cob_cmpswp_u40_binary (const unsigned char *, const int); extern int cob_cmpswp_s40_binary (const unsigned char *, const int); extern int cob_cmpswp_u48_binary (const unsigned char *, const int); extern int cob_cmpswp_s48_binary (const unsigned char *, const int); extern int cob_cmpswp_u56_binary (const unsigned char *, const int); extern int cob_cmpswp_s56_binary (const unsigned char *, const int); extern int cob_cmpswp_u64_binary (const unsigned char *, const int); extern int cob_cmpswp_s64_binary (const unsigned char *, const int); extern int cob_cmpswp_align_u16_binary (const unsigned char *, const int); extern int cob_cmpswp_align_s16_binary (const unsigned char *, const int); extern int cob_cmpswp_align_u32_binary (const unsigned char *, const int); extern int cob_cmpswp_align_s32_binary (const unsigned char *, const int); extern int cob_cmpswp_align_u64_binary (const unsigned char *, const int); extern int cob_cmpswp_align_s64_binary (const unsigned char *, const int); extern void cob_addswp_u16_binary (unsigned char *, const int); extern void cob_addswp_s16_binary (unsigned char *, const int); extern void cob_addswp_u24_binary (unsigned char *, const int); extern void cob_addswp_s24_binary (unsigned char *, const int); extern void cob_addswp_u32_binary (unsigned char *, const int); extern void cob_addswp_s32_binary (unsigned char *, const int); extern void cob_addswp_u40_binary (unsigned char *, const int); extern void cob_addswp_s40_binary (unsigned char *, const int); extern void cob_addswp_u48_binary (unsigned char *, const int); extern void cob_addswp_s48_binary (unsigned char *, const int); extern void cob_addswp_u56_binary (unsigned char *, const int); extern void cob_addswp_s56_binary (unsigned char *, const int); extern void cob_addswp_u64_binary (unsigned char *, const int); extern void cob_addswp_s64_binary (unsigned char *, const int); extern void cob_subswp_u16_binary (unsigned char *, const int); extern void cob_subswp_s16_binary (unsigned char *, const int); extern void cob_subswp_u24_binary (unsigned char *, const int); extern void cob_subswp_s24_binary (unsigned char *, const int); extern void cob_subswp_u32_binary (unsigned char *, const int); extern void cob_subswp_s32_binary (unsigned char *, const int); extern void cob_subswp_u40_binary (unsigned char *, const int); extern void cob_subswp_s40_binary (unsigned char *, const int); extern void cob_subswp_u48_binary (unsigned char *, const int); extern void cob_subswp_s48_binary (unsigned char *, const int); extern void cob_subswp_u56_binary (unsigned char *, const int); extern void cob_subswp_s56_binary (unsigned char *, const int); extern void cob_subswp_u64_binary (unsigned char *, const int); extern void cob_subswp_s64_binary (unsigned char *, const int); extern void cob_setswp_u16_binary (unsigned char *, const int); extern void cob_setswp_s16_binary (unsigned char *, const int); extern void cob_setswp_u24_binary (unsigned char *, const int); extern void cob_setswp_s24_binary (unsigned char *, const int); extern void cob_setswp_u32_binary (unsigned char *, const int); extern void cob_setswp_s32_binary (unsigned char *, const int); extern void cob_setswp_u40_binary (unsigned char *, const int); extern void cob_setswp_s40_binary (unsigned char *, const int); extern void cob_setswp_u48_binary (unsigned char *, const int); extern void cob_setswp_s48_binary (unsigned char *, const int); extern void cob_setswp_u56_binary (unsigned char *, const int); extern void cob_setswp_s56_binary (unsigned char *, const int); extern void cob_setswp_u64_binary (unsigned char *, const int); extern void cob_setswp_s64_binary (unsigned char *, const int); #endif #endif #if defined(COB_LOCAL_INLINE) || defined(COB_LIB_INCLUDE) #if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__amd64__) #if defined(_MSC_VER) #define ALLOW_MISALIGNED #define MISALIGNED __unaligned #else #define MISALIGNED #endif #else #define ALLOW_MISALIGNED #define MISALIGNED #endif COB_STATIC int cob_get_numdisp (const unsigned char *data, const size_t size) { int retval = 0; size_t n; for (n = 0; n < size; ++n, ++data) { retval *= 10; if (*data > '9') { retval += 10; } else { retval += (*data - (unsigned char)'0'); } } return retval; } COB_STATIC int cob_cmp_packed_int (const cob_field *f, const int n) { unsigned char *p; size_t size; int val = 0; p = f->data; for (size = 0; size < f->size - 1; ++size, ++p) { val *= 10; val += *p >> 4; val *= 10; val += *p & 0x0f; } val *= 10; val += *p >> 4; if ((*p & 0x0f) == 0x0d) { val = -val; } return (val < n) ? -1 : (val > n); } COB_STATIC int cob_get_packed_int (const cob_field *f) { unsigned char *p; size_t size; int val = 0; p = f->data; for (size = 0; size < f->size - 1; ++size, ++p) { val *= 10; val += *p >> 4; val *= 10; val += *p & 0x0f; } val *= 10; val += *p >> 4; if ((*p & 0x0f) == 0x0d) { val = -val; } return val; } COB_STATIC int cob_add_packed_int (cob_field *f, const int val) { unsigned char *p; size_t size; int carry = 0; int n; int inc; if (val == 0) { return 0; } p = f->data + f->size - 1; if ((*p & 0x0f) == 0x0d) { if (val > 0) { return cob_add_int (f, val); } n = -val; } else { if (val < 0) { return cob_add_int (f, val); } n = val; } inc = (*p >> 4) + (n % 10); n /= 10; carry = inc / 10; *p = ((inc % 10) << 4) | (*p & 0x0f); p--; for (size = 0; size < f->size - 1; ++size, --p) { if (!carry && !n) { break; } inc = ((*p >> 4) * 10) + (*p & 0x0f) + carry + (n % 100); carry = inc / 100; n /= 100; inc %= 100; *p = ((inc / 10) << 4) | (inc % 10); } return 0; } /* Aligned variants */ #ifndef ALLOW_MISALIGNED /* Aligned compares */ COB_STATIC int cob_cmp_align_u16_binary (const unsigned char *p, const int n) { unsigned short val; if (n < 0) { return 1; } val = *(unsigned short MISALIGNED *)p; return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_align_s16_binary (const unsigned char *p, const int n) { short val; val = *(short MISALIGNED *)p; return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_align_u32_binary (const unsigned char *p, const int n) { unsigned int val; if (n < 0) { return 1; } val = *(unsigned int MISALIGNED *)p; return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_align_s32_binary (const unsigned char *p, const int n) { int val; val = *(int MISALIGNED *)p; return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_align_u64_binary (const unsigned char *p, const int n) { unsigned long long val; if (n < 0) { return 1; } val = *(unsigned long long MISALIGNED *)p; return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_align_s64_binary (const unsigned char *p, const int n) { long long val; val = *(long long MISALIGNED *)p; return (val < n) ? -1 : (val > n); } /* Aligned adds */ COB_STATIC void cob_add_align_u16_binary (unsigned char *p, const int val) { *(unsigned short MISALIGNED *)p += val; } COB_STATIC void cob_add_align_s16_binary (unsigned char *p, const int val) { *(short MISALIGNED *)p += val; } COB_STATIC void cob_add_align_u32_binary (unsigned char *p, const int val) { *(unsigned int MISALIGNED *)p += val; } COB_STATIC void cob_add_align_s32_binary (unsigned char *p, const int val) { *(int MISALIGNED *)p += val; } COB_STATIC void cob_add_align_u64_binary (unsigned char *p, const int val) { *(unsigned long long MISALIGNED *)p += val; } COB_STATIC void cob_add_align_s64_binary (unsigned char *p, const int val) { *(long long MISALIGNED *)p += val; } /* Aligned subtracts */ COB_STATIC void cob_sub_align_u16_binary (unsigned char *p, const int val) { *(unsigned short MISALIGNED *)p -= val; } COB_STATIC void cob_sub_align_s16_binary (unsigned char *p, const int val) { *(short MISALIGNED *)p -= val; } COB_STATIC void cob_sub_align_u32_binary (unsigned char *p, const int val) { *(unsigned int MISALIGNED *)p -= val; } COB_STATIC void cob_sub_align_s32_binary (unsigned char *p, const int val) { *(int MISALIGNED *)p -= val; } COB_STATIC void cob_sub_align_u64_binary (unsigned char *p, const int val) { *(unsigned long long MISALIGNED *)p -= val; } COB_STATIC void cob_sub_align_s64_binary (unsigned char *p, const int val) { *(long long MISALIGNED *)p -= val; } #ifndef WORDS_BIGENDIAN COB_STATIC int cob_cmpswp_align_u16_binary (const unsigned char *p, const int n) { unsigned short val; if (n < 0) { return 1; } val = COB_BSWAP_16 (*(unsigned short MISALIGNED *)p); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_align_s16_binary (const unsigned char *p, const int n) { short val; val = COB_BSWAP_16 (*(short MISALIGNED *)p); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_align_u32_binary (const unsigned char *p, const int n) { unsigned int val; if (n < 0) { return 1; } val = COB_BSWAP_32 (*(unsigned int MISALIGNED *)p); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_align_s32_binary (const unsigned char *p, const int n) { int val; val = COB_BSWAP_32 (*(int MISALIGNED *)p); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_align_u64_binary (const unsigned char *p, const int n) { unsigned long long val; if (n < 0) { return 1; } val = COB_BSWAP_64 (*(unsigned long long MISALIGNED *)p); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_align_s64_binary (const unsigned char *p, const int n) { long long val; val = COB_BSWAP_64 (*(long long MISALIGNED *)p); return (val < n) ? -1 : (val > n); } #endif /* WORDS_BIGENDIAN */ #endif /* ALLOW_MISALIGNED */ /* Binary compare */ COB_STATIC int cob_cmp_u8_binary (const unsigned char *p, const int n) { if (n < 0) { return 1; } return (*p < n) ? -1 : (*p > n); } COB_STATIC int cob_cmp_s8_binary (const unsigned char *p, const int n) { return (*(const signed char *)p < n) ? -1 : (*(const signed char *)p > n); } COB_STATIC int cob_cmp_u16_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned short val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = *(const unsigned short MISALIGNED *)p; #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s16_binary (const unsigned char *p, const int n) { short val; #ifdef ALLOW_MISALIGNED val = *(const short MISALIGNED *)p; #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u24_binary (const unsigned char *p, const int n) { unsigned char *x; unsigned int val = 0; if (n < 0) { return 1; } #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&val) + 1; #else x = (unsigned char *)&val; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s24_binary (const unsigned char *p, const int n) { unsigned char *x; int val = 0; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&val; #else x = ((unsigned char *)&val) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); val >>= 8; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u32_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned int val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = *(const unsigned int MISALIGNED *)p; #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s32_binary (const unsigned char *p, const int n) { int val; #ifdef ALLOW_MISALIGNED val = *(const int MISALIGNED *)p; #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u40_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&val) + 3; #else x = (unsigned char *)&val; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s40_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&val; #else x = ((unsigned char *)&val) + 3; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); val >>= 24; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u48_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&val) + 2; #else x = (unsigned char *)&val; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s48_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&val; #else x = ((unsigned char *)&val) + 2; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); val >>= 16; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u56_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&val) + 1; #else x = (unsigned char *)&val; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s56_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&val; #else x = ((unsigned char *)&val) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); val >>= 8; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_u64_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned long long val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = *(const unsigned long long MISALIGNED *)p; #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmp_s64_binary (const unsigned char *p, const int n) { long long val; #ifdef ALLOW_MISALIGNED val = *(const long long MISALIGNED *)p; #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); #endif return (val < n) ? -1 : (val > n); } /* Add/Subtract */ COB_STATIC void cob_add_u8_binary (unsigned char *p, const int val) { *p += val; } COB_STATIC void cob_add_s8_binary (unsigned char *p, const int val) { *(signed char *)p += val; } COB_STATIC void cob_add_u16_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned short MISALIGNED *)p += val; #else unsigned char *x; unsigned short n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); n += val; *p = *x; *(p + 1) = *(x + 1); #endif } COB_STATIC void cob_add_s16_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(short MISALIGNED *)p += val; #else unsigned char *x; short n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); n += val; *p = *x; *(p + 1) = *(x + 1); #endif } COB_STATIC void cob_add_u24_binary (unsigned char *p, const int val) { unsigned char *x; unsigned int n = 0; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); } COB_STATIC void cob_add_s24_binary (unsigned char *p, const int val) { unsigned char *x; int n = 0; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); n >>= 8; /* shift with sign */ n += val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); } COB_STATIC void cob_add_u32_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned int MISALIGNED *)p += val; #else unsigned char *x; unsigned int n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); #endif } COB_STATIC void cob_add_s32_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(int MISALIGNED *)p += val; #else unsigned char *x; int n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); #endif } COB_STATIC void cob_add_u40_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 3; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); } COB_STATIC void cob_add_s40_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 3; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); n >>= 24; /* shift with sign */ n += val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 3; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); } COB_STATIC void cob_add_u48_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 2; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); } COB_STATIC void cob_add_s48_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 2; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); n >>= 16; /* shift with sign */ n += val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 2; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); } COB_STATIC void cob_add_u56_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); } COB_STATIC void cob_add_s56_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); n >>= 8; /* shift with sign */ n += val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); } COB_STATIC void cob_add_u64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned long long MISALIGNED *)p += val; #else unsigned char *x; unsigned long long n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); *(p + 7) = *(x + 7); #endif } COB_STATIC void cob_add_s64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(long long MISALIGNED *)p += val; #else unsigned char *x; long long n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); n += val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); *(p + 7) = *(x + 7); #endif } COB_STATIC void cob_sub_u8_binary (unsigned char *p, const int val) { *p -= val; } COB_STATIC void cob_sub_s8_binary (unsigned char *p, const int val) { *(signed char *)p -= val; } COB_STATIC void cob_sub_u16_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned short MISALIGNED *)p -= val; #else unsigned char *x; unsigned short n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); n -= val; *p = *x; *(p + 1) = *(x + 1); #endif } COB_STATIC void cob_sub_s16_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(short MISALIGNED *)p -= val; #else unsigned char *x; short n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); n -= val; *p = *x; *(p + 1) = *(x + 1); #endif } COB_STATIC void cob_sub_u24_binary (unsigned char *p, const int val) { unsigned char *x; unsigned int n = 0; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); } COB_STATIC void cob_sub_s24_binary (unsigned char *p, const int val) { unsigned char *x; int n = 0; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); n >>= 8; /* shift with sign */ n -= val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); } COB_STATIC void cob_sub_u32_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned int MISALIGNED *)p -= val; #else unsigned char *x; unsigned int n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); #endif } COB_STATIC void cob_sub_s32_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(int MISALIGNED *)p -= val; #else unsigned char *x; int n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); #endif } COB_STATIC void cob_sub_u40_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 3; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); } COB_STATIC void cob_sub_s40_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 3; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); n >>= 24; /* shift with sign */ n -= val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 3; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); } COB_STATIC void cob_sub_u48_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 2; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); } COB_STATIC void cob_sub_s48_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 2; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); n >>= 16; /* shift with sign */ n -= val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 2; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); } COB_STATIC void cob_sub_u56_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); } COB_STATIC void cob_sub_s56_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; #ifdef WORDS_BIGENDIAN x = (unsigned char *)&n; #else x = ((unsigned char *)&n) + 1; #endif *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); n >>= 8; /* shift with sign */ n -= val; #ifdef WORDS_BIGENDIAN x = ((unsigned char *)&n) + 1; #else x = (unsigned char *)&n; #endif *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); } COB_STATIC void cob_sub_u64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(unsigned long long MISALIGNED *)p -= val; #else unsigned char *x; unsigned long long n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); *(p + 7) = *(x + 7); #endif } COB_STATIC void cob_sub_s64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED *(long long MISALIGNED *)p -= val; #else unsigned char *x; long long n; x = (unsigned char *)&n; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); n -= val; *p = *x; *(p + 1) = *(x + 1); *(p + 2) = *(x + 2); *(p + 3) = *(x + 3); *(p + 4) = *(x + 4); *(p + 5) = *(x + 5); *(p + 6) = *(x + 6); *(p + 7) = *(x + 7); #endif } #ifndef WORDS_BIGENDIAN /* Binary swapped compare */ COB_STATIC int cob_cmpswp_u16_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned short val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = COB_BSWAP_16 (*(unsigned short MISALIGNED *)p); #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); val = COB_BSWAP_16 (val); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s16_binary (const unsigned char *p, const int n) { short val; #ifdef ALLOW_MISALIGNED val = COB_BSWAP_16 (*(short MISALIGNED *)p); #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); val = COB_BSWAP_16 (val); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u24_binary (const unsigned char *p, const int n) { unsigned char *x; unsigned int val = 0; if (n < 0) { return 1; } x = ((unsigned char *)&val) + 1; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); val = COB_BSWAP_32 (val); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s24_binary (const unsigned char *p, const int n) { unsigned char *x; int val = 0; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); val = COB_BSWAP_32 (val); val >>= 8; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u32_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned int val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = COB_BSWAP_32 (*(const unsigned int MISALIGNED *)p); #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); val = COB_BSWAP_32 (val); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s32_binary (const unsigned char *p, const int n) { int val; #ifdef ALLOW_MISALIGNED val = COB_BSWAP_32 (*(const int MISALIGNED *)p); #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); val = COB_BSWAP_32 (val); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u40_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } x = ((unsigned char *)&val) + 3; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); val = COB_BSWAP_64 (val); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s40_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); val = COB_BSWAP_64 (val); val >>= 24; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u48_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } x = ((unsigned char *)&val) + 2; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); val = COB_BSWAP_64 (val); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s48_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); val = COB_BSWAP_64 (val); val >>= 16; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u56_binary (const unsigned char *p, const int n) { unsigned long long val = 0; unsigned char *x; if (n < 0) { return 1; } x = ((unsigned char *)&val) + 1; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); val = COB_BSWAP_64 (val); return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s56_binary (const unsigned char *p, const int n) { long long val = 0; unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); val = COB_BSWAP_64 (val); val >>= 8; /* shift with sign */ return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_u64_binary (const unsigned char *p, const int n) { #ifndef ALLOW_MISALIGNED unsigned char *x; #endif unsigned long long val; if (n < 0) { return 1; } #ifdef ALLOW_MISALIGNED val = COB_BSWAP_64 (*(const unsigned long long MISALIGNED *)p); #else x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); val = COB_BSWAP_64 (val); #endif return (val < n) ? -1 : (val > n); } COB_STATIC int cob_cmpswp_s64_binary (const unsigned char *p, const int n) { long long val; #ifdef ALLOW_MISALIGNED val = COB_BSWAP_64 (*(const long long MISALIGNED *)p); #else unsigned char *x; x = (unsigned char *)&val; *x = *p; *(x + 1) = *(p + 1); *(x + 2) = *(p + 2); *(x + 3) = *(p + 3); *(x + 4) = *(p + 4); *(x + 5) = *(p + 5); *(x + 6) = *(p + 6); *(x + 7) = *(p + 7); val = COB_BSWAP_64 (val); #endif return (val < n) ? -1 : (val > n); } /* Binary swapped add */ COB_STATIC void cob_addswp_u16_binary (unsigned char *p, const int val) { unsigned short n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_16 (*(unsigned short MISALIGNED *)p); n += val; *(unsigned short MISALIGNED *)p = COB_BSWAP_16(n); #else n = (unsigned short)((p[0] << 8) | p[1]); n += val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_addswp_s16_binary (unsigned char *p, const int val) { short n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_16 (*(short MISALIGNED *)p); n += val; *(short MISALIGNED *)p = COB_BSWAP_16(n); #else n = (short)((p[0] << 8) | p[1]); n += val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_addswp_u24_binary (unsigned char *p, const int val) { unsigned char *x; unsigned int n = 0; x = (unsigned char *)&n; *x = *(p + 2); *(x + 1) = *(p + 1); *(x + 2) = *p; n += val; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_addswp_s24_binary (unsigned char *p, const int val) { unsigned char *x; int n = 0; x = ((unsigned char *)&n) + 1; *x = *(p + 2); *(x + 1) = *(p + 1); *(x + 2) = *p; n >>= 8; /* shift with sign */ n += val; x = (unsigned char *)&n; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_addswp_u32_binary (unsigned char *p, const int val) { unsigned int n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_32 (*(unsigned int MISALIGNED *)p); n += val; *(unsigned int MISALIGNED *)p = COB_BSWAP_32(n); #else n = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; n += val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_addswp_s32_binary (unsigned char *p, const int val) { int n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_32 (*(int MISALIGNED *)p); n += val; *(int MISALIGNED *)p = COB_BSWAP_32(n); #else n = (int)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); n += val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_addswp_u40_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 4); *(x + 1) = *(p + 3); *(x + 2) = *(p + 2); *(x + 3) = *(p + 1); *(x + 4) = *p; n += val; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_addswp_s40_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 3; *x = *(p + 4); *(x + 1) = *(p + 3); *(x + 2) = *(p + 2); *(x + 3) = *(p + 1); *(x + 4) = *p; n >>= 24; /* shift with sign */ n += val; x = (unsigned char *)&n; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_addswp_u48_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 5); *(x + 1) = *(p + 4); *(x + 2) = *(p + 3); *(x + 3) = *(p + 2); *(x + 4) = *(p + 1); *(x + 5) = *p; n += val; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_addswp_s48_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 2; *x = *(p + 5); *(x + 1) = *(p + 4); *(x + 2) = *(p + 3); *(x + 3) = *(p + 2); *(x + 4) = *(p + 1); *(x + 5) = *p; n >>= 16; /* shift with sign */ n += val; x = (unsigned char *)&n; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_addswp_u56_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 6); *(x + 1) = *(p + 5); *(x + 2) = *(p + 4); *(x + 3) = *(p + 3); *(x + 4) = *(p + 2); *(x + 5) = *(p + 1); *(x + 6) = *p; n += val; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_addswp_s56_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 1; *x = *(p + 6); *(x + 1) = *(p + 5); *(x + 2) = *(p + 4); *(x + 3) = *(p + 3); *(x + 4) = *(p + 2); *(x + 5) = *(p + 1); *(x + 6) = *p; n >>= 8; /* shift with sign */ n += val; x = (unsigned char *)&n; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_addswp_u64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED unsigned long long n; n = COB_BSWAP_64 (*(unsigned long long MISALIGNED *)p); n += val; *(unsigned long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { unsigned long long n; unsigned char c[8]; } u; for (i = 0; i < 8; ++i) { u.c[7-i] = p[i]; } u.n += val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } COB_STATIC void cob_addswp_s64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED long long n; n = COB_BSWAP_64 (*(long long MISALIGNED *)p); n += val; *(long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { long long n; unsigned char c[8]; } u; for (i = 0; i < 8; ++i) { u.c[7-i] = p[i]; } u.n += val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } /* Binary swapped subtract */ COB_STATIC void cob_subswp_u16_binary (unsigned char *p, const int val) { unsigned short n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_16 (*(unsigned short MISALIGNED *)p); n -= val; *(unsigned short MISALIGNED *)p = COB_BSWAP_16(n); #else n = (unsigned short)((p[0] << 8) | p[1]); n -= val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_subswp_s16_binary (unsigned char *p, const int val) { short n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_16 (*(short MISALIGNED *)p); n -= val; *(short MISALIGNED *)p = COB_BSWAP_16(n); #else n = (short)((p[0] << 8) | p[1]); n -= val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_subswp_u24_binary (unsigned char *p, const int val) { unsigned char *x; unsigned int n = 0; x = (unsigned char *)&n; *x = *(p + 2); *(x + 1) = *(p + 1); *(x + 2) = *p; n -= val; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_subswp_s24_binary (unsigned char *p, const int val) { unsigned char *x; int n = 0; x = ((unsigned char *)&n) + 1; *x = *(p + 2); *(x + 1) = *(p + 1); *(x + 2) = *p; n >>= 8; /* shift with sign */ n -= val; x = (unsigned char *)&n; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_subswp_u32_binary (unsigned char *p, const int val) { unsigned int n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_32 (*(unsigned int MISALIGNED *)p); n -= val; *(unsigned int MISALIGNED *)p = COB_BSWAP_32(n); #else n = (unsigned int)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); n -= val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_subswp_s32_binary (unsigned char *p, const int val) { int n; #ifdef ALLOW_MISALIGNED n = COB_BSWAP_32 (*(int MISALIGNED *)p); n -= val; *(int MISALIGNED *)p = COB_BSWAP_32(n); #else n = (int)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); n -= val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_subswp_u40_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 4); *(x + 1) = *(p + 3); *(x + 2) = *(p + 2); *(x + 3) = *(p + 1); *(x + 4) = *p; n -= val; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_subswp_s40_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 3; *x = *(p + 4); *(x + 1) = *(p + 3); *(x + 2) = *(p + 2); *(x + 3) = *(p + 1); *(x + 4) = *p; n >>= 24; /* shift with sign */ n -= val; x = (unsigned char *)&n; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_subswp_u48_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 5); *(x + 1) = *(p + 4); *(x + 2) = *(p + 3); *(x + 3) = *(p + 2); *(x + 4) = *(p + 1); *(x + 5) = *p; n -= val; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_subswp_s48_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 2; *x = *(p + 5); *(x + 1) = *(p + 4); *(x + 2) = *(p + 3); *(x + 3) = *(p + 2); *(x + 4) = *(p + 1); *(x + 5) = *p; n >>= 16; /* shift with sign */ n -= val; x = (unsigned char *)&n; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_subswp_u56_binary (unsigned char *p, const int val) { unsigned long long n = 0; unsigned char *x; x = (unsigned char *)&n; *x = *(p + 6); *(x + 1) = *(p + 5); *(x + 2) = *(p + 4); *(x + 3) = *(p + 3); *(x + 4) = *(p + 2); *(x + 5) = *(p + 1); *(x + 6) = *p; n -= val; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_subswp_s56_binary (unsigned char *p, const int val) { long long n = 0; unsigned char *x; x = ((unsigned char *)&n) + 1; *x = *(p + 6); *(x + 1) = *(p + 5); *(x + 2) = *(p + 4); *(x + 3) = *(p + 3); *(x + 4) = *(p + 2); *(x + 5) = *(p + 1); *(x + 6) = *p; n >>= 8; /* shift with sign */ n -= val; x = (unsigned char *)&n; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_subswp_u64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED unsigned long long n; n = COB_BSWAP_64 (*(unsigned long long MISALIGNED *)p); n -= val; *(unsigned long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { unsigned long long n; unsigned char c[8]; } u; for (i = 0; i < 8; ++i) { u.c[7-i] = p[i]; } u.n -= val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } COB_STATIC void cob_subswp_s64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED long long n; n = COB_BSWAP_64 (*(long long MISALIGNED *)p); n -= val; *(long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { long long n; unsigned char c[8]; } u; for (i = 0; i < 8; ++i) { u.c[7-i] = p[i]; } u.n -= val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } COB_STATIC void cob_setswp_u16_binary (unsigned char *p, const int val) { unsigned short n; #ifdef ALLOW_MISALIGNED n = val; *(unsigned short MISALIGNED *)p = COB_BSWAP_16(n); #else n = val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_setswp_s16_binary (unsigned char *p, const int val) { short n; #ifdef ALLOW_MISALIGNED n = val; *(short MISALIGNED *)p = COB_BSWAP_16(n); #else n = val; p[0] = (unsigned char)(n >> 8); p[1] = (unsigned char)n; #endif } COB_STATIC void cob_setswp_u24_binary (unsigned char *p, const int val) { unsigned char *x; unsigned int n; n = val; x = (unsigned char *)&n; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_setswp_s24_binary (unsigned char *p, const int val) { unsigned char *x; int n; n = val; x = (unsigned char *)&n; *p = *(x + 2); *(p + 1) = *(x + 1); *(p + 2) = *x; } COB_STATIC void cob_setswp_u32_binary (unsigned char *p, const int val) { unsigned int n; #ifdef ALLOW_MISALIGNED n = val; *(unsigned int MISALIGNED *)p = COB_BSWAP_32(n); #else n = val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_setswp_s32_binary (unsigned char *p, const int val) { int n; #ifdef ALLOW_MISALIGNED n = val; *(int MISALIGNED *)p = COB_BSWAP_32(n); #else n = val; *p++ = (unsigned char)(n >> 24); *p++ = (unsigned char)(n >> 16); *p++ = (unsigned char)(n >> 8); *p = (unsigned char)n; #endif } COB_STATIC void cob_setswp_u40_binary (unsigned char *p, const int val) { unsigned long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_setswp_s40_binary (unsigned char *p, const int val) { long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 4); *(p + 1) = *(x + 3); *(p + 2) = *(x + 2); *(p + 3) = *(x + 1); *(p + 4) = *x; } COB_STATIC void cob_setswp_u48_binary (unsigned char *p, const int val) { unsigned long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_setswp_s48_binary (unsigned char *p, const int val) { long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 5); *(p + 1) = *(x + 4); *(p + 2) = *(x + 3); *(p + 3) = *(x + 2); *(p + 4) = *(x + 1); *(p + 5) = *x; } COB_STATIC void cob_setswp_u56_binary (unsigned char *p, const int val) { unsigned long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_setswp_s56_binary (unsigned char *p, const int val) { long long n; unsigned char *x; n = val; x = (unsigned char *)&n; *p = *(x + 6); *(p + 1) = *(x + 5); *(p + 2) = *(x + 4); *(p + 3) = *(x + 3); *(p + 4) = *(x + 2); *(p + 5) = *(x + 1); *(p + 6) = *x; } COB_STATIC void cob_setswp_u64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED unsigned long long n; n = val; *(unsigned long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { unsigned long long n; unsigned char c[8]; } u; u.n = val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } COB_STATIC void cob_setswp_s64_binary (unsigned char *p, const int val) { #ifdef ALLOW_MISALIGNED long long n; n = val; *(long long MISALIGNED *)p = COB_BSWAP_64(n); #else size_t i; union { long long n; unsigned char c[8]; } u; u.n = val; for (i = 0; i < 8; ++i) { p[i] = u.c[7-i]; } #endif } #endif /* WORDS_BIGENDIAN */ #endif /* COB_LOCAL_INLINE || COB_LIB_INCLUDE */ #endif /* COB_CODEGEN_H */ open-cobol-1.1/libcob/ChangeLog0000644000000000000000000015674311142341516012061 2009-02-03 Roger While * intrinsic.c : Fix Cygwins busted rand function 2009-01-27 Roger While * call.c : Change hyphen interpretation 2009-01-22 Roger While * intrinsic.[ch] : Functions CONCATENATE and SUBSTITUTE-CASE 2009-01-20 Roger While * screenio.[ch] : Minimal support for value occurs 2009-01-17 Roger While * common.c, screenio.[ch] : Save/restore screen over SYSTEM call * General : Sanitize headers. Do not use names in prototypes 2009-01-15 Roger While * screenio.[ch], termio.c - SCROLL for ACCEPT/DISPLAY 2009-01-14 Roger While * screenio.[ch] - ACCEPT ... FROM LINES/COLUMNS 2008-12-20 Roger While * intrinsic.[ch] : Implement SUBSTITUTE function 2008-12-10 Roger While * screenio.c : Add inter-field cursor movement for screen input 2008-12-08 Roger While * General : More stack reducing * common.h : Constify attribute pointer in cob_field 2008-12-03 Roger While * General : More stack reducing Clean up dangling varargs 2008-11-20 Roger While * General : Reduce stack usage 2008-11-15 Roger While * fileio.c : Fix SORT GIVING when output is line sequential * common.[ch], call.[ch] : C routines for calling Cobol 2008-11-14 Roger While * common.c : Always activate SIGSEGV handler 2008-10-17 Roger While * common.[ch] : cob_check_based - Check BASED items 2008-09-22 Roger While * fileio.[ch] : Evaluate FILE STATUS for SORT files * General : More constification 2008-08-20 Roger While * common.h : Change macro for __builtin_expect 2008-08-16 Roger While * coblocal.h, termio.c, screenio.c : Change global name screen_initialized 2008-08-01 Roger While * byteswap.h : Do not rely on gcc doing the right thing for short 2008-07-21 Roger While * screenio.c : Do not display SECURE items * General : Cleanup, do early malloc initializations 2008-07-19 Roger While * General : Tidy up syntax * intrinsic.c : Optimize field generation 2008-07-18 Roger While * common.c : Win does not have nanosleep 2008-07-14 Roger While * termio.c, move.c : Preliminary changes for zero-length fields 2008-07-11 Roger While * strings.c : Handle special replacement correctly 2008-07-09 Roger While * screenio.[ch] : Fix up SCREEN handling 2008-07-05 Roger While * screenio.c : Extend SCREEN processing 2008-07-01 Roger While * termio.c : Revert '.' display of non-displayable characters 2008-06-29 Roger While * common.[ch], system.def : Implement CBL_OC_NANOSLEEP * coblocal.h, move.c : support routines for the above 2008-06-25 Roger While * screenio.[ch] : Define input fields for SCREEN section 2008-06-23 Roger While * screenio.c : New env COB_SCREEN_EXCEPTIONS to retrun extended exception codes on ACCEPT 2008-06-17 Roger While * fileio.c : Fix return from ISAM (not BDB) from OPEN * common.c : redirect to stderr when necessary * screenio.c : More support 2008-06-10 Roger While * screenio.[ch], termio.c : More Screen changes 2008-06-05 Roger While * coblocal.h, common.c, fileio.[ch] : Cleanup, prepare for linptr reuse 2008-06-04 Roger While * fileio.c : Cleanup /simplification 2008-06-03 Roger While * fileio.[ch] : Support UNLOCK statement 2008-06-01 Roger While * coblocal.h, move.c, numeric.c : Localize cob_binary_get/set routines * common.c, move.c : Cater for spaces in numeric fields * termio.c : Display '.' for invalid characters 2008-05-31 Roger While * fileio.c : Allow VARYING on LINE SEQUENTIAL 2008-05-23 Roger While * common.h, termio.c : Better display of POINTER items 2008-05-19 Roger While * screenio.[ch] : More support for SCREEN 2008-05-14 Roger While * common.c : Fix C$NARG for chaining syntax * common.[ch] : Simplify accept from environment 2008-05-12 Roger While * screenio.c : Fix some screen displays 2008-04-17 Roger While * common.[ch], system.def : Implement MF call X"91", subfunctions 11, 12, 16 2008-04-02 Roger While * intrinsic.[ch] : Implement FUNCTION COMBINED-DATETIME 2008-03-31 Roger While * intrinsic:[ch] : Implement LOCALE-TIME-FROM-SECONDS More refmodding for functions 2008-03-29 Roger While * General : Fix up sparse warnings 2008-03-24 Roger While * intrinsic.[ch] : Refmodding for some FUNCTIONS 2008-03-11 Roger While * call.c : New environment variable to control case conversion on dynamic program loads. COB_LOAD_CASE=UPPER|LOWER 2008-03-05 Roger While * fileio.c : New environment variables to control LINE SEQUENTIAL files. COB_LS_NULLS - Equivalent to MF's -N switch. Bytes less than ASCII space are preceded by a null byte on write. COB_LS_FIXED - Write the record without trailing space removal. 2008-03-01 Roger While * fileio.c : BDB CLOSE must close secondary files first 2008-02-19 Roger While * fileio.c : Clean up and comment 2008-02-14 Roger While * fileio.c : Fix ifdef's for variable sequential files 2008-02-12 Roger While * common.[ch] : Rationalize some previously exported variables New function - cob_set_location for line debugging 2008-01-07 Roger While * common.[ch] : DISPLAY .. UPON COMMAND-LINE 2008-01-03 Roger While * move.h : Remove own_memxxx routines * General : Remove references to own_memxxx routines 2007-12-27 Roger While ** Mark 1.0 RELEASE 2007-12-15 Roger While * common.c : Change exception structure definition to optimize 64 bit allocation 2007-11-21 Roger While * fileio.c : Add C/D/VB-ISAM code 2007-11-20 Roger While * fileio.c : Cater for 02 return status Put in hooks for C/D/VB-ISAM 2007-11-09 Roger While * numeric.c : Use 64-bit when available 2007-11-01 Roger While * numeric.c : Fix 64-bit unsigned problem 2007-10-27 Roger While * strings.c : Fix figurative constant handling in INSPECT 2007-10-24 Roger While * numeric.[ch] : New routine cob_cmp_uint 2007-10-22 Roger While * numeric.c : Fix 36 digit numerics 2007-10-20 Roger While * call.c : Clean up * codegen.h : Fix up signed/unsigned comparison 2007-10-17 Roger While * common.c : User defined exit routines must be called before the OC clean up routines. Fix missing call to user defined error routines. 2007-10-10 Roger While * fileio.[ch] : Change delete to fdelete (C++) 2007-09-18 Roger While * screenio.c : Check for mvgetnstr in curses lib 2007-09-12 Roger While * fileio.h : Add in CHANNEL definition 2007-09-07 Roger While * General : unistd.h is not availiable on native Win * move.c, termio.c : Cater for changed pic string representation 2007-08-31 Roger While * fileio.[ch] : Move defines, change EXTFH interface Linage is reduced to a pointer in the fileio struct 2 local defines moved from fileio.c to fileio.h for EXTFH 2007-08-23 Roger While * General : Remove ASCII 10/20, fix up ascii/ebcdic on target Note changes to module and file structures 2007-08-14 Roger While * fileio.c : Implement method to use an external SEQ/RAN file handler * fileio.h : Use spare byte in file struct as file version 2007-08-12 Roger While * numeric.c : Fix for EBCDIC machines 2007-08-09 Roger While * fileio.c : Implement method to use an external ISAM file handler 2007-08-01 Roger While * call.c : Implement cob_c_cancel * General : More constification 2007-07-26 Roger While * common.c, fileio.c : (un)likely optimizations * byteswap.h : For i386, let gcc work out the 2 byte case 2007-07-24 Roger While * fileio.c : Do not use locks if filename begins with "/dev/" 2007-07-21 Roger While * common.c : Use calloc instead of malloc 2007-07-11 Roger While * fileio.c : Fix a memory leak in the I/S close code 2007-07-02 Roger While * call.c : Previously we were trying to detect if dlopen(NULL) works in configure and ifdef'ing in call.c This does not work in all circumstances. For borked systems this now has to be changed by hand in call.c. The comments at the top of call.c - /* NOTE - The following variable should be uncommented when it is known that dlopen(NULL) is borked. This is known to be true for some PA-RISC HP-UX 11.11 systems. This is fixed with HP patch PHSS_28871. (There are newer but this fixes dlopen/dlsym problems) */ /* #define COB_BORKED_DLOPEN */ 2007-07-01 Roger While * codegen.h : Further optimizations 2007-06-28 Roger While * codegen.h : Tweak for non-alignment-tolerant architectures * intrinsic.c : DST hack for ports that do not have "%z" Note - This needs to be properly fixed 2007-06-26 Roger While * intrinsic.c : For specific ports, fix TZ in CURRENT-DATE Add use of strftime for timezone if configure detected 2007-06-06 Roger While * fileio.[ch] : LOCK on WRITE/REWRITE 2007-05-22 Roger While * fileio.[hc] : Implement IGNORING LOCK. Fix a WRITE/REWRITE problem with duplicate keys. 2007-05-17 Roger While * screenio.c : Use normal curses when available 2007-05-10 Roger While * fileio.c : Fix positioning with START,READ NEXT/PREVIOUS on duplicate records. 2007-05-08 Roger While * common.[ch] : Fix incompatible param definitions on CBL_EXIT_PROC and CBL_ERROR_PROC 2007-05-04 Roger While * fileio.[ch] : Preliminary support for record locking 2007-04-28 Roger While * numeric.c : Remove duplicated code. Set up variables for binary > 64 bits 2007-04-26 Roger While * numeric.c : Fix incorrect value when signed bit set in an eight byte binary value. * numeric.[ch] : Remove unused routine. Make 2 routines static. 2007-04-17 Roger While * intrinsic.c : Fix a Cygwin compile failure 2007-04-11 Roger While * common.[ch] : Define cob_one for screen display 2007-04-10 Roger While * strings.[ch] : Dynamically allocate for unstring 2007-03-27 Roger While * common.c : Fix 64-bit warning 2007-03-16 Roger While * common.c, intrinsic.c : Provide fractional seconds on Win platform 2007-03-13 Roger While * intrinsic.c : Provide fractional seconds for CURRENT-DATE if supported on the platform * common.c : Provide fractional seconds for ACCEPT .. FROM TIME if supported on the platform * fileio.h : Align file structure * fileio.c : When filename mapping, allow underline in varibale name 2007-03-05 Roger While * intrinsic.c : Windows/Cygwin implementation of LOCALE-DATE/TIME 2007-03-03 Roger While * General : Use COB_FIELD_xxx macros 2007-03-01 Roger While * intrinsic.[ch] : Change params for LOCALE-DATE/TIME 2007-02-26 Roger While * intrinsic.c : Fix for not defined LANGINFO 2007-02-25 Roger While * fileio.c : Fix Indexed-Sequential rewrite 2007-02-13 Roger While * All : Change initialization of fields/attributes 2007-02-11 Roger While * coblocal.h : New file, contains prototypes that should only be known to the library * All : Implement above header file 2007-02-09 Roger While * fileio.[ch] : Implement SORT-RETURN 2007-02-07 Roger While * intrinsic.[ch] : Implement LOCALE-DATE, LOCALE-TIME * fileio.[hc] : Fix a READ PREVIOUS problem 2007-01-24 Roger While * fileio.[ch] : Implement new SORT routines Note these do not need the ISAM handler 2007-01-17 Roger While * common.[ch] : Add cob_is_omitted, check for null parameter 2007-01-16 Roger While * intrinsic.[ch] : Implement FUNCTION's SECONDS-PAST-MIDNIGHT, SECONDS-FROM-FORMATTED-TIME * All : Remove COB_SET_EXCEPTION define * intrinsic.c : Set COB_EC_ARGUMENT_FUNCTION exception code where appropiate 2007-01-15 Roger While * common.[ch], fileio.[ch] : Change sort comparison routines to not overwrite collating sequence. Also optimize. Note, this fixes a problem with a (file) SORT with COLLATING and INPUT and/or OUPUT procedures. Previously, this would incorrectly change alphanumeric tests in the INPUT/OUTPUT procedures. * fileio.[ch] : Allow special ASSIGN [TO] DISPLAY processing 2007-01-12 Roger While * fileio.c : Fix miscompile on WIN64 2007-01-10 Roger While * fileio.[ch] : Allow special ASSIGN [TO] KEYBOARD processing 2007-01-08 Roger While * call.[ch] : Implement new CANCEL processing 2006-12-17 Roger While * intrinsic.[ch] : Correct the NUMVAL-C function 2006-12-12 Roger While * fileio.c : Fix secondary key access 2006-12-07 Roger While * intrinsic.[ch] : Implement TRIM function 2006-11-28 Roger While * move.c : Small optimization * numeric.c : New routines cob_cmp_long_numdisp, cob_cmp_long_signed_numdisp 2006-11-12 Roger While * codegen.h : Remaining integer cmp/add/sub optimizations 2006-10-23 Roger While * Makefile.am : Remove gcc options General : Constify some stuff 2006-10-16 Roger While * codegen.h : Fix 3 byte compare 2006-10-15 Roger While * codegen.h : This is now the place for optimization Duplication in numeric.c is not necessary Add in optimization for 3/5/6/7 byte compares Add in 3 byte add optimization * numeric.c : Delete duplicated code from codegen.h Constify 2006-10-14 Roger While * common.c, fileio.[ch], move.[ch] : const defintions 2006-09-30 Roger While * common.[ch] : Implement CBL_EXIT_PROC * General : tidy up 2006-08-31 Roger While * call.c : Alternate ifdef'd algo for call list 2006-08-28 Roger While * General : Check for COB_PARAM_CHECK * numeric.c : Experimental code 2006-08-26 Roger While * fileio.c : Implement COB_FILE_PATH variable for default path prefix on files that do not have any other assignment 2006-08-09 Roger While * system.def, common.[ch] : More MF/ACU system routines 2006-08-01 Roger While * common.[ch], call.c : Change cob_field_to_string to type void 2006-07-31 Roger While * system.def, fileio.[ch], call.c, common.[ch] : New MF system routines - see system.def 2006-07-26 Roger While * All : General clean up and fix gcc 4 warnings * New file system.def * call.c, common.[ch] : System routines 2006-07-19 Roger While * All : General clean up 2006-07-14 Roger While * codegen.h, numeric.c : Fix optimization for HP compiler * intrinsic.c : Fix bug in NUMVAL routines 2006-07-12 Roger While * common.[ch] : Implement ALLOCATE/FREE * strings.c : Clean up 2006-07-07 Roger While * codegen.h, numeric.c : More optimizations * fileio.c : Further BDB fixes 2006-07-06 Roger While * fileio.c : BDB >= 4.1 fixes 2006-07-04 Roger While * fileio.c : BDB >= 4.1 fixes 2006-06-22 Roger While * call.c : Set cob_exception_code for not found calls 2006-06-21 Roger While * fileio.c : Fix typo for cob_sort_output_cache 2006-06-06 Roger While * move.h : Remove generic memcpy/memset for non (GNUC && i386) 2006-06-05 Roger While * fileio.[ch] : Implement PREVIOUS for IS files 2006-05-27 Roger While * common.[ch] : Implement cob_fatal_error 2006-05-20 Roger While * Fixes for extended ACCEPT/DISPLAY 2006-05-18 Roger While * common.[ch], intrinsic.[ch] : Implement FUNCTION's EXCEPTION-FILE, EXCEPTION-STATEMENT, EXCEPTION-LOCATION and EXCEPTION-STATUS 2006-05-12 Roger While * common.c, exception.def : Exceptions for ACCEPT/DISPLAY 2006-05-10 Roger While * common.h : Preliminary support for CURSOR IS and CRT STATUS IS * intrinsic.[ch] : Implement STORED-CHAR-LENGTH (Fujitsu) 2006-05-08 Roger While * common.[ch] : cob_chain_setup - Setp CHAINING params from command line * string.[ch] : Implement TRAILING syntax in INSPECT clause 2006-05-05 Roger While * strings.c : Avoid memory bloat with INSPECT 2006-05-04 Roger While * common.h : Define likely/unlikely macros * call.c, move.c : Use above macros 2006-05-03 Roger While * screenio.[ch] : Change strucrures 2006-05-01 Roger While * General : Changes for native EBCDIC machines * codegen.h, numeric.c : Further optimization for cob_cmp_xxx, cob_add_xxx, cob_sub_xxx * common.[ch]: Support for sign-ebcdic and sign-ascii20 (Note ascii20 is not correct) Implement SET ENVIRONMENT (ACU) 2006-04-17 Roger While * codegen.h, numeric.c : Optimized cob_cmp_xxx, cob_add_xxx, cob_sub_xxx 2006-04-06 Roger While * common.h, common.c : Define new function cob_strdup common.c, call.c, fileio.c : Use cob_strdup fileio.c : Fix size_t mistake 2006-04-02 Roger While * codegen.h : Fix up a bunch of mistakes 2006-03-25 Roger While * common.c : Although not currently used, update the ASCII/EBCDIC tables 2006-03-23 Roger While * numeric.c : Fix a stack corruption in the fast C-3 compare 2006-03-22 Roger While * common.[hc] : Implement COLLATING SEQUENCE for table SORT 2006-03-21 Roger While * move.c : More edited field fixes from Hans Martin Rasch 2006-03-16 Roger While * move.c : Fix edited field with +/- and currency 2006-03-10 Roger While * All : Reduce compile warnings under Win * common.c : setlocale depends on HAVE_SETLOCALE We must do a setlocale for LC_NUMERIC as languages with a comma seperator change the operation of string functions which bork specfically FP operations 2006-03-09 Roger While * numeric.c : Fix remainder problem Fix returning functions which return void 2006-03-04 Roger While * common.c : Don't do cob_put_sign for PACKED fields in the cob_cmp_xxx routines 2006-02-21 Roger While * new include : codegen.h This contains inlines that only relate to code generation Implemented are cob_cmp_xxx_binary and cob_addsub_xxx_binary where xxx is u8, s8, u16, s16 etc. * call.c : Fix a preload problem under Cygwin 2006-02-18 Roger While * move.h : Take out x86 memcpy optimization 2006-02-08 Roger While * common.c/h, numeric.c/h : Optimize COMP/COMP-3 2006-02-01 Roger While * fileio.h, fileio.c : Changes for FILE STATUS We have to pass the FILE STATUS as a parameter to the I/O call. This is required for EXTERNAL FD's. 2006-01-29 Roger While * call.c : Implement COB_PRE_LOAD 2006-01-27 Roger While * Tweak COMP-3 2006-01-26 Roger While * strings.c : Rip out regex use. It cannot handle a low-value (null byte) in RE. call.c : Native WIN MSC needs path seperator of ';' common.h, common.c : Implement CBL_ERROR_PROC 2006-01-25 Roger While * fileio.h, fileio.c : signed to unsigned for file_status 2006-01-17 Roger While * fileio.c : Print assign name when erroring 2006-01-07 Roger While * fileio.c : 64-bit fixes 2006-01-05 Roger While * General : Bootstrap up to new libtool / automake MS VS/VC changes fileio.c : Fix relative postioning and incorrectly returned relative record number 2005-12-30 Roger While * Change ifdef's on MINGW to WIN32 (Also defined on 64-bit Win) intrinsic.c : ifdef's for strftime (CURRENT-DATE) fileio.c : Basic platform changes 2005-12-28 Roger While * General : Further fixes for non-gcc 2005-12-27 Roger While * General : Change occurrences of "char[variable]" move.c : Change code for "MOVE ALL '98' TO binary/packed/edited" This is still not completely correct 2005-12-23 Roger While * termio.c, common.c : Move extended accept/display from termio to common. Define cobc_argc/argv as static. 2005-12-21 Roger While * fileio.c - Cater for various format of the record length field in variable length sequential files (WITH_VARSEQ) 2005-12-18 Roger While * All : Cleanup "shadowed" variables Start generalizing code for large numbers common.c : Take out Ebcdic table, now genned by codegen 2005-12-09 Roger While * move.c : Fix display of large unsigned numbers. termio.c : Change number of displayed digits. 2005-12-08 Roger While * common.h : New defines - COB_SMALL_BUFF, COB_MEDIUM_BUFF, COB_LARGE_BUFF. Replace all occurrences of FILENAME_MAX/BUFSIZ. 2005-12-04 Roger While * intrinsic.c : Fix strftime for MingW 2005-12-04 Roger While * byteswap.h : Take out typedefs. They are likely to clash with standard includes. 2005-12-03 Roger While * common.c : Do not gen signals for Ming * fileio.c : Ming / typing changes 2005-11-25 Roger While * common.c : Extended signal handling fileio.c : Don't use mkstemp on non-Win 2005-11-16 Roger While * call.c : Fix wrong cached handle fileio.c : Fix spacing in LS read 2005-11-15 Roger While * fileio.c : Allow COB_SYNC=P (Paranoid) This will try even harder to sync. 2005-11-15 Roger While * common.c, fileio.h, fileio.c : Check open files at run-unit termination. Implement sync'ing with enviroment variable COB_SYNC=Y. Catch signals QUIT, INT and HUP. 2005-11-08 Roger While * fileio.c : Tweaks for LS files 2005-11-04 Roger While * call.c : Don't repeatedly call (lt_)dlopen on NULL (main program); Do it once at startup. 2005-11-01 Roger While * screenio.c : Cater for include in ncurses/ncurses.h * fileio.c : ferror under Cygwin doesn't like a void * parameter - Cast it. Fix line-sequential reads when input has carriage-returns. 2005-10-26 Roger While * fileio.c : Remove HAVE_DB ifdef, fix warnings * move.c : Fix warnings 2005-10-25 Roger While * move.h, move.c, numeric.c, fileio.c, strings.c memcpy/memset optimizations move.c : Fix a mpz_ call (optimization) 2005-10-14 Roger While * All : More GCC 4 fixes 2005-10-13 Roger While * common.h, common.c : Fix function type (GCC 4) 2005-08-07 Roger While * All .c : indent, braces * call.c : Dynamically allocate areas, const allocation 2005-08-04 Roger While * fileio.c : Harden I/O error checking Replace fputc with putc * screenio.c,h : Rename cob_screen_clear to cob_screen_terminate * common.c,h : Call cob_screen_terminate in cob_stop_run Define cob_stop_run as noreturn (gnuc) * All : Change occurrences of exit to cob_stop_run 2005-07-31 Roger While * intrinsic.c, intrinsic.h : Add SIGN, FRACTION-PART, clean up * common.c, common.h : cob_check_version - Program versioning * move.c, numeric.c : Some preliminary assembler stuff 2005-07-14 Roger While * fileio.c : Dummy routines for read,write, etc. Always generate the function jump table, even if DB not configured. Jumps to the dummy routines result in status 30. * All : Do malloc's through own new routine cob_malloc This will produce an error and terminate if memory can not be acquired. 2005-07-02 Roger While * common.h : cob_module bit fields to char * intrinsic.c : Clean up and fixes * move.c, numeric.c : Experiment with own_mem(cpy,set) * fileio.c : Cast fseek offsets to off_t Return correctly if DB not defined 2005-06-28 Roger While * New files : intrinsic.h, intrinsic.c * Fix cob_add/sub_int 2005-06-13 Roger While * common.c : Handle new COB_SWITCH_n=ON/OFF screenio.c : Handle pdcurses 2005-06-11 Roger While * strings.c : Fix INSPECT fileio.c : Mistake in LINAGE 2005-06-09 Roger While * call.c : Fix memory leak in drop function. 2005-06-01 Roger While * Makefile*, fileio.c, common.c : Hacks for MinGW move.c : Include math.h 2005-05-31 Roger While * common.h, common.c, numeric.c, move.c, termio.c : Rough implementation of COMP-1/2 fields. 2005-05-27 Roger While * byteswap.h : u_int16_t etc. are not necessarily defined in sys/types.h (eg. MinGW). So ifndef on __BIT_TYPES_DEFINED__ and typedef them. fileio.c : Cater for extended DB headers db4/ db4.1/ db4.2/ db4.3/ 2005-05-23 Roger While * call.h, call.c : New functions cob_resolve_1 cob_call_resolve_1. These are wrappers for optimized dynamic calls. 2005-05-21 Roger While * call.h, call.c : Cater for call.def Cater for --with-dl Restructure code slightly Take out check for cob_initialized 2005-05-03 Roger While * Mak* : Due to autoreconf common.c : Slight restructure. cob_exp10 must be int not long. common.h : extern definitions. fileio.c : Force SORT to put duplicates in order. move.c : Performance. numeric.c : Remove unused function. Change long to int (64-bitters where long = 8 bytes). 2005-04-15 Keisuke Nishida * Makefile.am (libcob_la_CFLAGS): Add -fsigned-char. 2005-04-13 Keisuke Nishida * byteswap.h: #include . Use u_int16_t, u_int32_t, and u_int64_t instead of unsigned short, etc. 2005-03-03 Roger While * fileio.h, fileio.c : LINAGE 2005-02-11 Roger While * common.h, common.c, termio.c : Reorder struct cob_module. Fixes for ARGUMENT-VALUE/NUMBER - discovered by Franklin Ankum. Fix possible too small buffer. 2005-02-09 Roger While * I must be going senile. Finally fix cob_external_addr. 2005-02-08 Roger While * Fix my cob_external_addr routine 2005-02-07 Roger While * common.h, common.c : new routine cob_external_addr Dynamically cater for EXTERNAL items at runtime 2005-02-04 Roger While * termio.h, termio.c : implement DISPLAY .. UPON ENVIRONMENT-VALUE implement DISPLAY .. UPON ARGUMENT-NUMBER implement ACCEPT .. FROM ARGUMENT-NUMBER implement ACCEPT .. FROM ARGUMENT-VALUE 2005-01-07 Roger While * move.c : Fix incorrect truncation when !binary_trunc and moving binary to packed or edited fields * numeric.c : Fix arithmetic with numeric display fields when !binary_trunc 2004-11-19 Roger While * move.c : Fix incorrect truncation when !binary_trunc 2004-11-05 Roger While * numeric.c : Handle arithmetic for !binary_trunc. 2004-11-04 Roger While * move.c : Fix regression for NIST suite 2004-11-04 Bernard Giroud * numeric.c (cob_decimal_get_binary) : reverted: NIST test suite is no mre working. 2004-11-02 Bernard Giroud * numeric.c (cob_decimal_get_binary) : Worked around what I consider a bug in Gmp for getting a long signed value. * Added checks for option binary-truncate from a suggestion of Roger While. 2004-10-31 Roger While * fileio.h : For I/O exceptions, has_status flag and slight rearrangement of fields in cob_file structure. 2004-10-30 Roger While * call.c, common.c, move.c : Replace back-tick "'" with quote "'" * move.c : Fix to handle PIC ***B***B**9. * byteswap.h : Always generate optimum code, not just with -O * fileio.c : Tidy up file error messages. In the ENOENT return for OPEN OUTPUT/EXTEND, return status 30. Note this will not have any effect until we activate error handling for the OPEN. (Coming up soon) 2004-09-17 Keisuke Nishida * numeric.h (COB_STORE_TRUNC_ON_OVERFLOW): Define as 0x04, not 0x02. (Thanks to Roger While) 2004-07-06 Keisuke Nishida * numeric.h (COB_STORE_ROUND, COB_STORE_KEEP_ON_OVERFLOW) (COB_STORE_TRUNC_ON_OVERFLOW): New macros. * numeric.h, numeric.c (cob_decimal_get_display) (cob_decimal_get_binary, cob_decimal_get_field, cob_add, cob_sub) (cob_div_quotient, cob_div_remainder): New arg 'opt'. * numeric.c (cob_decimal_get_field_round): Removed. Integrated into 'cob_decimal_get_field'. (cob_display_add_int): Renamed from cob_add_int_to_display. (cob_add_round, cob_sub_round): Removed. 2004-07-05 Keisuke Nishida * fileio.c (sort_read): Set field size for varying records. (Thanks to Roger While!) 2004-06-12 Keisuke Nishida * termio.c (display): Display full digits of binary item when pretty-display is off, not when binary-truncate is off. 2004-05-21 Keisuke Nishida * move.c (cob_binary_get_int64): Reimplemented using memcpy. (cob_binary_get_int): Call cob_binary_get_int64. (cob_binary_set_int): Call cob_binary_set_int64. 2004-05-16 Keisuke Nishida * common.c (cob_cmp): Compare non-display numeric and alphanumeric correctly. 2004-05-04 Keisuke Nishida * termio.c (display_numeric): Leading sign for binary. 2004-05-04 Keisuke Nishida * byteswap.h (COB_BSWAP_32_IA32): Always use bswap. (We no longer support i386.) 2004-05-04 Keisuke Nishida * fileio.c (cob_default_error_handle): Set error for status 35. 2004-05-04 Keisuke Nishida * common.c (cob_runtime_error): Flush buffer at the end. 2004-04-07 Keisuke Nishida * common.h, common.c (cob_table_sort_init, cob_table_sort_init_key) (cob_table_sort): New functions. 2004-04-07 Keisuke Nishida * strings.c (cob_inspect_converting): Do not convert repeatedly. (Thanks to Richard Smith ) 2004-03-12 Keisuke Nishida * screenio.c: #include 2004-03-12 Keisuke Nishida * fileio.c (file_close): FILE *fp = f->file; 2004-03-10 Keisuke Nishida * fileio.c (cob_sort_init): Use temporary sort file. (cob_sort_finish): Delete sort file. (cob_open): No filename mapping for SORT files. 2004-03-09 Keisuke Nishida * move.c (cob_binary_set_int, cob_binary_set_int64): Reimplemented. (Thanks to Roger While) 2004-03-06 Keisuke Nishida * fileio.c (file_open): Open files in the text mode for line sequential files. 2004-03-06 Keisuke Nishida * fileio.c (file_open, file_close): Use fcntl for file locking. 2003-10-01 Keisuke Nishida * common.h (cob_module): New member 'flag_pretty_display'. * termio.c (display): Updated. 2003-09-29 Keisuke Nishida * common.c (cob_is_numeric): Test packed decimal. 2003-08-30 Keisuke Nishida * common.h (cob_module): Replace 'flag_binary_print_full' by 'flag_binary_truncate'. Related functions updated. 2003-08-29 Keisuke Nishida * termio.h (COB_SYSIN, COB_SYSOUT, COB_SYSERR): Removed. * termio.h, termio.c (cob_display_error): New function. (cob_newline_error): New function. 2003-08-27 Keisuke Nishida * fileio.c: Compile indexed and sort i/o only when either of HAVE_DBOPEN or WITH_DB is defined. 2003-08-26 Keisuke Nishida * common.h (cob_module): New member 'flag_filename_mapping'. * fileio.c (cob_open): filename mapping. 2003-08-26 Keisuke Nishida * common.h, common.c (cob_a2e, cob_e2a): New variables. 2003-08-25 Keisuke Nishida * fileio.c (sort_read): Bug fix of first read. 2003-08-25 Keisuke Nishida * fileio.h, fileio.c (cob_sort_init): 3rd argument 'sequence'. (cob_sort_finish): New function. 2003-08-22 Keisuke Nishida * Don't use run-time config file. * common.h, common.c (cob_config_lookup, cob_config_compare): Removed. * call.c (cob_init_call): Handle env "COB_DYNAMIC_RELOADING". 2003-08-21 Keisuke Nishida * common.h (cob_module): New member 'flag_binary_print_full'. * termio.c (cob_display): Binary full print. 2003-08-21 Keisuke Nishida * common.h (cob_display_sign): New enum. (cob_module): New entry 'display_sign'. * common.c (cob_real_get_sign, cob_real_put_sign): Check display_sign. 2003-08-19 Keisuke Nishida * termio.c (cob_accept_command_line): Omit the program name (argv[0]). 2003-08-17 Keisuke Nishida * termio.h, termio.c (cob_display_environment): New function. (cob_accept_environment): Remove the second argument. 2003-08-12 Keisuke Nishida * byteswap.h: New file. * byteorder.h: Removed. 2003-08-12 Keisuke Nishida * common.h, common.c (cob_return_code): Removed. 2003-08-10 Keisuke Nishida * common.h (COB_FLAG_BINARY_SWAP): New macro. * move.h, move.c (cob_binary_get_int): New function. (cob_binary_get_int64): New function. (cob_binary_set_int): New function. (cob_binary_set_int64): New function. * common.h (COB_TYPE_NUMERIC_NATIVE): Removed. * common.h, common.c (cob_binary_convert): Removed. * move.c (cob_move_display_to_native): Removed. (cob_move_native_to_display): Removed. * numeric.c (cob_decimal_set_native): Removed. (cob_decimal_get_native): Removed. 2003-08-09 Keisuke Nishida * call.c (cob_call_error): Exit with status 1. 2003-08-07 Keisuke Nishida * byteorder.h: New file. * common.h (COB_TYPE_NUMERIC_NATIVE): New macro. * common.h, common.c (cob_binary_convert): New function. * move.c (cob_move_display_to_native): New function. (cob_move_native_to_display): New function. * numeric.c (cob_decimal_set_native): New function. (cob_decimal_get_native): New function. 2003-08-05 Keisuke Nishida * fileio.h (COB_WRITE_MASK, COB_WRITE_LINES, COB_WRITE_PAGE) (COB_WRITE_AFTER, COB_WRITE_BEFORE): New macros. * fileio.h, fileio.c (cob_write_page, cob_write_lines): Removed. (cob_write): Take third argument. * fileio.c (file_write_opt): New function. (FILE_WRITE_AFTER, FILE_WRITE_BEFORE): New macros. 2003-07-28 Keisuke Nishida * common.h, common.c (cob_exception): Removed. 2003-06-29 Keisuke Nishida * fileio.h, fileio.c (cob_sort_init): Removed the 3rd argument. (cob_sort_init_key): New function. 2003-06-28 Keisuke Nishida * common.h, common.c (cob_cmp_result): Removed. 2003-06-25 Keisuke Nishida * termio.c (cob_accept): Do not use readline. 2003-06-19 Keisuke Nishida * common.c, common.h (cob_check_odo): New function. (cob_check_subscript_depending): Removed. 2003-06-18 Keisuke Nishida * fileio.c (relative_rewrite): Refer to the relative key unless the access mode is sequential. 2003-06-12 Keisuke Nishida * fileio.c (SEEK_INIT): New macro. 2003-06-07 Keisuke Nishida * numeric.c, numeric.h: No longer use gmp. (cob_decimal_init, cob_decimal_clear): Removed. 2003-06-07 Keisuke Nishida * common.h (cob_module): New member 'collating_sequence'. * common.c (CMP): New macro. (cmp_char, cmp_all, cmp_alnum): Use CMP. 2003-05-29 Keisuke Nishida * common.h (cob_switch): Removed. * common.c (cob_set_switch, cob_get_switch): New function. 2003-05-27 Keisuke Nishida * common.h (cob_module): Renamed from cob_environment. (cob_current_module): Renamed from cob_env. (cob_module_enter): Renamed from cob_push_environment. (cob_module_leave): Renamed from cob_pop_environment. (cob_module_init): Removed. * call.c (cob_resolve): Do not call cob_module_init. 2003-05-20 Keisuke Nishida * strings.c (cob_string_delimited): New function. (cob_string_append): Take only one argument. 2003-05-18 Keisuke Nishida * common.c (ding_on_error): Removed. 2003-05-18 Keisuke Nishida * fileio.c: Large file system support. (_LFS64_LARGEFILE) [WITH_LFS64]: Defined. (_LFS64_STDIO) [WITH_LFS64]: Defined. (_FILE_OFFSET_BITS) [WITH_LFS64]: Defined. (_LARGEFILE64_SOURCE) [WITH_LFS64]: Defined. 2003-05-18 Keisuke Nishida * common.h (cob_d2i, cob_i2d): New macros. 2003-05-15 Keisuke Nishida * move.c (COPY_COMMON_REGION): Removed. (store_common_region): New function. (cob_display_to_int): New function. (cob_binary_to_int): New function. (cob_get_int): Optimized. 2003-05-13 Keisuke Nishida * fileio.c (INITIAL_FLAGS): Set to O_BINARY when _WIN32 is defined rather than __MINGW32__. (file_open): Open in binary mode. (cob_open): Make sure that errno == ENOENT after stat. 2003-05-06 Keisuke Nishida * exception.def (COB_EC_ALL): Added. * common.h (COB_SET_EXCEPTION): New macro. (cob_exception_table): New variable. (cob_exception_id): New enum. (cob_exception_code): Removed. 2003-05-04 Keisuke Nishida * numeric.c: Optimized cob_add_int/cob_sub_int for DISPLAY. (digit_table): New variable. (init_digit_table): New function. (display_add_int, display_sub_int): New functions. (cob_add_int_to_display): New function. (cob_add_int): Call 'cob_add_int_to_display'. (cob_sub_int): Call 'cob_add_int'. (Thanks to David Korn ) 2003-05-04 Keisuke Nishida * common.h (cob_get_sign, cob_put_sign): Redefined as macros. * common.c (cob_real_get_sign, cob_real_put_sign): Called from the above macros. 2003-05-03 Keisuke Nishida * fileio.h (COB_OPEN_NONE, COB_OPEN_LOCKED): New macros. (COB_CLOSE_REEL, COB_CLOSE_REEL_REMOVAL): Removed. (COB_FILE_CLOSED_WITH_LOCK): New macro. * fileio.c (sequential_close): Close with lock. (sequential_open): Seek to the end for extend file. (cob_open): Return COB_FILE_CLOSED_WITH_LOCK when file is locked. 2003-05-03 Keisuke Nishida * common.h, common.c (cob_linage_counter): New variable. 2003-04-26 Keisuke Nishida * common.h, common.c (cob_uint_attr, cob_sint_attr): Removed. (cob_ubin_attr, cob_sbin_attr): Removed. * move.c: Do not use them. 2003-04-03 Keisuke Nishida * move.c (cob_get_int): Renamed from cob_to_int. 2003-03-30 Keisuke Nishida * numeric.c (cob_decimal_set_int): Remove the 3rd argument 'decimals'. (cob_decimal_set_int64): Removed. 2003-03-25 Keisuke Nishida * exception.def: New file. 2003-03-06 Keisuke Nishida * common.c (cob_field_to_string): Search for ' ' from backward. 2003-02-25 Keisuke Nishida * common.c (cob_push_environment, cob_pop_environment): New functions. 2003-01-23 Keisuke Nishida * fileio.h (cob_file): Break out flags. * fileio.c: Updated. * fileio.h, fileio.c (cob_dummy_status): Removed. * fileio.c (save_status): Check file_status before setting status. 2003-01-20 Keisuke Nishida * common.h (COB_FLAG_HAVE_SIGN): New macro. (COB_FLAG_SIGN_SEPARATE): New macro. (COB_FLAG_SIGN_LEADING): New macro. (COB_FLAG_BLANK_ZERO): New macro. (COB_FLAG_JUSTFIED): New macro. (COB_FIELD_HAVE_SIGN): New macro. (COB_FIELD_SIGN_SEPARATE): New macro. (COB_FIELD_SIGN_LEADING): New macro. (COB_FIELD_BLANK_ZERO): New macro. (COB_FIELD_JUSTIFIED): New macro. (cob_field_attr): Remove members 'have_sign', 'sign_separate', 'sign_leading', 'blank_zero', and 'justified'. New member 'flags'. All files updated. 2003-01-20 Keisuke Nishida * numeric.h (cob_decimal): Rename 'number' to 'data'. 2003-01-15 Keisuke Nishida * move.c (cob_move_all): New function. (cob_move): Call cob_move_all. 2002-12-10 Keisuke Nishida * common.h (cob_environment, cob_env): New. (cob_decimal_point, cob_currency_symbol, cob_numeric_separator): Replaced by cob_env. All files updated. * common.c (cob_decimal_point, cob_currency_symbol): Removed. 2002-12-05 Keisuke Nishida * common.c (cob_index, cob_index_depending): Exit when index is out of range. 2002-11-25 Keisuke Nishida * numeric.c (cob_decimal_get, cob_decimal_get_r): Copy decimal before modifying it. 2002-11-25 Keisuke Nishida * strings.h (cob_inspect_init): Take second argument 'replacing'. (cob_inspect_characters): New function. (cob_inspect_all): New function. (cob_inspect_leading): New function. (cob_inspect_first): New function. 2002-11-25 Keisuke Nishida * common.h, common.c (cob_cmp_int): New function. 2002-11-24 Keisuke Nishida * move.h, move.c (cob_memcpy): Renamed from cob_mem_move. * fileio.h (COB_ASCENDING, COB_DESCENDING): Moved from common.h. * common.h (cob_field_attr): Remove member 'all'. (COB_TYPE_*): New macros. (COB_FIELD_IS_NUMERIC): New macro. * numeric.h (cob_d1, cob_d2, cob_d3, cob_d4, cob_dt): Removed. (cob_decimal_set_int64): Removed. * numeric.h, numeric.c (cob_numeric_cmp): New function. * common.c (cob_cmp): Call 'cob_numeric_cmp' for numeric comparison. * fileio.c (sort_compare): Always call cob_cmp. 2002-11-23 Keisuke Nishida * numeric.h, numeric.c (cob_add_r, cob_sub_r): New functions. (cob_decimal_get_r): Renamed from 'cob_decimal_get_rounded'. 2002-11-22 Keisuke Nishida * fileio.h, fileio.c (cob_sort_init): Take 3 arguments. 2002-11-22 Keisuke Nishida * common.h, common.c (cob_uint_attr, cob_sint_attr): New constants. * common.h, common.c (cob_ubin_attr, cob_sbin_attr): New constants. 2002-11-21 Keisuke Nishida * numeric.h, numeric.c (cob_add, cob_sub, cob_add_int, cob_sub_int): Don't take parameter 'round'. All caller updated. 2002-11-19 Keisuke Nishida * fileio.c (lineseq_read): Not do anything special with '\0'. 2002-11-19 Keisuke Nishida * strings.h, strings.c: Divide string functions. (cob_inspect, cob_string, cob_unstring): Removed. (cob_inspect_init): New function. (cob_inspect_start): New function. (cob_inspect_before): New function. (cob_inspect_after): New function. (cob_inspect_tallying_characters): New function. (cob_inspect_tallying_all): New function. (cob_inspect_tallying_leading): New function. (cob_inspect_replacing_characters): New function. (cob_inspect_replacing_all): New function. (cob_inspect_replacing_leading): New function. (cob_inspect_replacing_first): New function. (cob_inspect_converting): New function. (cob_inspect_finish): New function. (cob_string_init): New function. (cob_string_append): New function. (cob_string_finish): New function. (cob_unstring_init): New function. (cob_unstring_delimited): New function. (cob_unstring_init): New function. (cob_unstring_tallying): New function. (cob_unstring_finish): New function. * strings.h (COB_INSPECT_*, COB_STRING_*, COB_UNSTRING_*): Removed. 2002-11-13 Keisuke Nishida * common.h, common.c (cob_all_attr): New variable. (cob_just_attr): Renamed from 'cob_alnum_justified_attr'. (cob_cmp): New function. (cob_cmp_zero, cob_cmp_space, cob_cmp_low): Removed. (cob_cmp_high, cob_cmp_quote, cob_cmp_field): Removed. * common.c (cmp_char): Renamed from 'cmp_figurative'. (cob_cmp_alnum): Renamed from 'cmp_field'. * fileio.c (sort_compare): Updated. 2002-11-13 Keisuke Nishida * common.h (cob_status): Removed. (cob_error_code): New variable. (COB_STATUS_SUCCESS, COB_STATUS_OVERFLOW): Removed. (COB_EC_*): New macros. All files updated. * strings.h (COB_STRING_WITH_POINTER): Removed. (COB_UNSTRING_WITH_POINTER): Removed. * strings.h, strings.c (cob_string, cob_unstring): Take second argument 'ptr'. * strings.c (set_int, add_int): Removed. 2002-11-11 Keisuke Nishida * fileio.h (COB_FILE_OUT_OF_KEY_RANGE): New macro. * fileio.c (relative_read_next): Use COB_FILE_OUT_OF_KEY_RANGE. (cob_default_error_handle): Add COB_FILE_OUT_OF_KEY_RANGE. 2002-11-08 Keisuke Nishida * common.h (cob_field_attr): New member 'all'. * common.c, common.h (cob_cmp_str, cob_cmp_all): Removed. * common.c (cob_cmp_field): Integrate comparison functions. 2002-11-08 Keisuke Nishida * support.h: Removed. * Makefile.am: Remove support.h. 2002-11-07 Keisuke Nishida * numeric.c, numeric.h (cob_add_int, cob_sub_int): Do not take argument 'decimals'. All callers updated. 2002-10-21 Keisuke Nishida * common.c (cmp_figurative): New function. * common.c, common.h (cob_cmp_zero, cob_cmp_space): New functions. (cob_cmp_low, cob_cmp_high, cob_cmp_quote): New functions. 2002-10-18 Keisuke Nishida * numeric.h, numeric.c (cob_add_int64, cob_sub_int64): Removed. 2002-10-13 Keisuke Nishida * fileio.h (cob_file): New member 'record', replacing 'record_size' and 'record_data'. (cob_file): Rename 'record_depending' to 'record_size'. * fileio.c: Updated. 2002-10-13 Keisuke Nishida * common.h (cob_field_attr, cob_field): New typedef. * fileio.h (cob_file_key, cob_file, cob_fileio_funcs): New typedef. * numeric.h (cob_decimal): New typedef. * screenio.h (cob_screen): New typedef. (cob_screen_type, cob_screen_data, cob_screen_position): New typedef. * support.h (cob_frame): New typedef. 2002-10-08 Keisuke Nishida * Use 'struct cob_field *' instead of 'struct cob_field' for all function prototypes. All files updated. * common.h (COB_FIELD_IS_VALID): Removed. * common.h (cob_field_attr): Renamed from cob_field_desc. All files updated. * common.c, common.h (cob_group_attr): New variable. (cob_alnum_justified_attr): New variable. * support.h (cob_ref, cob_ref_rest): Removed. 2002-09-30 Keisuke Nishida * cobconfig.h.in: Removed. 2002-09-29 Keisuke Nishida * fileio.h (cob_file): Restructured. * fileio.c: Updated for new cob_file scheme. * fileio.h, fileio.c (cob_sort_init): Renamed from cob_sort_keys. * cobconfig.h.in (HAVE_DB1_DB_H, HAVE_DB_H): Removed. 2002-09-24 Keisuke Nishida * support.h: Do not support non-computed-goto jump. * cobconfig.h.in: Use AM_CONFIG_HEADER scheme. (COB_HAVE_COMPUTED_GOTO): Removed. (HAVE_DB1_DB_H, HAVE_DB_H): Added. * fileio.h: #include Include or which exists. 2002-09-23 Keisuke Nishida * strings.c (cob_unstring): Don't use alloca. 2002-09-12 Keisuke Nishida * numeric.h (cob_decimal): Use exponent instead of decimals. * numeric.c: Related functions updated. 2002-09-12 Keisuke Nishida * fileio.c (sequential_open): Set f->file.fd to 0 on error. 2002-09-06 Keisuke Nishida * fileio.h, fileio.c: INDEXED files has been reimplemented using db1. 2002-08-05 Keisuke Nishida * fileio.c (sort_compare): Prototype for db-3.1.x. 2002-08-02 Keisuke Nishida * common.h, common.c (cob_cmp_all): Unify the former cob_cmp_all and cob_cmp_all_str. * common.c (cmp_internal): New function. (cob_cmp_str, cob_cmp_field): Use it. 2002-08-01 Keisuke Nishida * fileio.h (COB_ORG_SORT, COB_ORG_MAX): New macros. (cob_file): New member 'sort_nkeys' and 'sort_keys'. * fileio.c (sort_file): New variable. (sort_compare, sort_open, sort_close, sort_read, sort_write): New functions. (sort_funcs): New variable. (cob_sort_keys, cob_sort_using, cob_sort_giving): New functions. (cob_init_fileio): Init sort functions. 2002-08-01 Keisuke Nishida * common.h (COB_ASCENDING, COB_DESCENDING): New macros. 2002-07-31 Keisuke Nishida * common.c (cob_init_config): New function. (cob_init): Updated. Load the config file first. 2002-07-30 Keisuke Nishida * fileio.c (indexed_write_internal): New function. (indexed_write, indexed_rewrite): Updated. 2002-07-30 Keisuke Nishida * fileio.c (lineseq_read): Check for EOF. 2002-07-30 Keisuke Nishida * fileio.h (cob_fileio_funcs): 'write' takes only one argument. (sequential_write, lineseq_write, relative_write, indexed_write):Ditto. (cob_write): Updated. 2002-07-30 Keisuke Nishida * screenio.c: Check configuration. 2002-07-24 Keisuke Nishida * numeric.h (cob_decimal): Removed. * numeric.c, numeric.h: Relace 'cob_decimal' by 'struct cob_decimal *'. 2002-07-14 Keisuke Nishida * move.c (cob_set_int): Moved from numeric.c. Reimplemented using 'cob_move'. 2002-07-13 Keisuke Nishida * numeric.c (cob_decimal_get_double): Bug fix in calculation. (cob_decimal_set_double): Take effect of decimal figures. 2002-07-08 Keisuke Nishida * fileio.h (cob_file): New field 'assign'. * fileio.c, fileio.h (cob_open): Do not take file name. Use 'assign'. 2002-07-05 Keisuke Nishida * screenio.c, screenio.h (cob_screen_attr): New function. * screenio.h (COB_SCREEN_TYPE_ATTRIBUTE): New type. (cob_screen_data): New entry 'dummy'. 2002-07-05 Keisuke Nishida * fileio.h (cob_file): Renamed from cob_file_desc. * fileio.c: Updated. 2002-07-01 Keisuke Nishida * screenio.c, screenio.h: New files. * Makefile.am: Add them. 2002-06-17 Keisuke Nishida * call.c (cob_call_resolve): Don't set cob_status. 2002-06-11 Keisuke Nishida * call.c (cob_resolve): Use COB_MODULE_EXT. 2002-06-11 Keisuke Nishida * common.c, common.h (cob_alnum_desc): New variable. * common.c (cob_zero, cob_space, cob_high, cob_low, cob_quote): Use it. * move.c (cob_mem_move): Use it. 2002-06-11 Keisuke Nishida * Allow cob_field.desc to be NULL. * common.h, common.c, move.c, numeric.c: Updated. 2002-06-11 Keisuke Nishida * common.h (COB_FIELD_IS_VALID): New macro. * fileio.c, strings.c: Use 'COB_FIELD_IS_VALID'. 2002-06-11 Keisuke Nishida * common.h (cob_field): Field 'size' moved from 'cob_field_desc'. (COB_FIELD_SIZE, COB_FIELD_DATA): Removed. * common.c, fileio.c, move.c, numeric.c, strings.c, termio.c: Updated. 2002-06-04 Keisuke Nishida * common.c, common.h (cob_config_compare): New function. * call.c (cob_init_call): Use 'cob_config_compare'. * common.c (ding_on_error): New variable. (cob_init): Set ding_on_error from option "ding-on-error". (cob_runtime_error): Ring a bell only when "ding-on-error" is "yes". 2002-06-04 Keisuke Nishida * support.h (cob_perform): Enclosed by do ... while (0). 2002-06-04 Keisuke Nishida * Makefile.am (libcob_la_CFLAGS): -I$(top_srcdir). * call.c, common.c, fileio.c, move.c: Updated. 2002-05-31 Keisuke Nishida * numeric.c, numeric.h (cob_div_remainder): Renamed from 'cob_div_reminder' (typo fix). 2002-05-31 Keisuke Nishida * common.c, common.h (cob_index, cob_index_depending): Take 'name'. Display index name with the error message. * support.h (COB_INDEX, COB_INDEX_DEPENDING): Take 'name'. 2002-05-31 Keisuke Nishida * Makefile.am (libcob_la_DEPENDENCIES): Removed. 2002-05-30 Keisuke Nishida * common.c (cob_check_numeric): Takes the field name as an argument. * common.h (cob_field_desc): Remove member 'name'. 2002-05-30 Keisuke Nishida * numeric.c (cob_decimal_pow): Handle decimals. (cob_decimal_set_double, cob_decimal_get_double): New functions. * numeric.h (cob_decimal_set_double, cob_decimal_get_double): Exported. 2002-05-29 Keisuke Nishida * Keep field names at run-time. * common.h (cob_field_desc): New member 'name'. * common.c (cob_check_numeric): Display filed name on error. * Makefile.am (libcob_la_DEPENDENCIES): Add defaults.h. 2002-05-29 Keisuke Nishida * termio.c (cob_init_termio): #include 2002-05-29 Keisuke Nishida * Support run-time config file: libcob.conf. * common.c (config_load, config_insert, cob_config_lookup): New functions. (cob_init): Call 'config_load'. * common.h (cob_config_lookup): Declared. * call.c (dynamic_reloading): Renamed from cob_dynamic_reloading. (cob_init_call): Initialize 'dynamic_reloading'. open-cobol-1.1/libcob/screenio.c0000644000000000000000000005231211141076556012255 /* * Copyright (C) 2001-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_NCURSES_H #include #define COB_GEN_SCREENIO #elif defined(HAVE_NCURSES_NCURSES_H) #include #define COB_GEN_SCREENIO #elif defined(HAVE_PDCURSES_H) #include #define COB_GEN_SCREENIO #elif defined(HAVE_CURSES_H) #include #define COB_GEN_SCREENIO #endif #include "move.h" #include "coblocal.h" #include "screenio.h" /* Global variables */ int cob_screen_initialized = 0; int cob_screen_mode = 0; #ifdef COB_GEN_SCREENIO struct cob_inp_struct { cob_screen *scr; size_t up_index; size_t down_index; int this_y; int this_x; }; #define COB_INP_SIZE 1920 * sizeof(struct cob_inp_struct) /* Local variables */ static struct cob_inp_struct *cob_base_inp = NULL; static size_t curr_index = 0; static size_t totl_index = 0; static size_t cob_has_color = 0; static size_t cob_extended_status = 0; static size_t cob_use_esc = 0; static int global_return; static int cob_current_y = 0; static int cob_current_x = 0; static int cob_max_y = 0; static int cob_max_x = 0; static short fore_color; static short back_color; /* Local functions */ static void get_line_column (cob_field *fline, cob_field *fcol, int *line, int *col) { int l; int c; int p; if (fline == NULL) { *line = 0; *col = 0; return; } p = cob_get_int (fline); if (fcol == NULL) { if (fline->size == 4) { l = p / 100; c = p % 100; } else { l = p / 1000; c = p % 1000; } } else { l = p; c = cob_get_int (fcol); } if (l > 0) { l--; } if (c > 0) { c--; } *line = l; *col = c; } static void cob_screen_attr (cob_field *fgc, cob_field *bgc, const int attr) { size_t i; int styles = 0; int line; int column; short fgcolor; short bgcolor; short fgdef; short bgdef; attrset (A_NORMAL); if (attr & COB_SCREEN_REVERSE) { styles |= A_REVERSE; } if (attr & COB_SCREEN_HIGHLIGHT) { styles |= A_BOLD; } if (attr & COB_SCREEN_BLINK) { styles |= A_BLINK; } if (attr & COB_SCREEN_UNDERLINE) { styles |= A_UNDERLINE; } if (styles) { attron (styles); } if (cob_has_color) { fgcolor = fore_color; bgcolor = back_color; if (fgc) { switch (cob_get_int (fgc)) { case COB_SCREEN_BLACK: fgcolor = COLOR_BLACK; break; case COB_SCREEN_BLUE: fgcolor = COLOR_BLUE; break; case COB_SCREEN_GREEN: fgcolor = COLOR_GREEN; break; case COB_SCREEN_CYAN: fgcolor = COLOR_CYAN; break; case COB_SCREEN_RED: fgcolor = COLOR_RED; break; case COB_SCREEN_MAGENTA: fgcolor = COLOR_MAGENTA; break; case COB_SCREEN_YELLOW: fgcolor = COLOR_YELLOW; break; case COB_SCREEN_WHITE: fgcolor = COLOR_WHITE; break; default: break; } } if (bgc) { switch (cob_get_int (bgc)) { case COB_SCREEN_BLACK: bgcolor = COLOR_BLACK; break; case COB_SCREEN_BLUE: bgcolor = COLOR_BLUE; break; case COB_SCREEN_GREEN: bgcolor = COLOR_GREEN; break; case COB_SCREEN_CYAN: bgcolor = COLOR_CYAN; break; case COB_SCREEN_RED: bgcolor = COLOR_RED; break; case COB_SCREEN_MAGENTA: bgcolor = COLOR_MAGENTA; break; case COB_SCREEN_YELLOW: bgcolor = COLOR_YELLOW; break; case COB_SCREEN_WHITE: bgcolor = COLOR_WHITE; break; default: break; } } for (i = 0; i < (size_t)COLOR_PAIRS; i++) { pair_content ((short)i, &fgdef, &bgdef); if (fgdef == fgcolor && bgdef == bgcolor) { break; } if (fgdef == 0 && bgdef == 0) { init_pair ((short)i, fgcolor, bgcolor); break; } } if (i != (size_t)COLOR_PAIRS) { #ifdef HAVE_COLOR_SET color_set (COLOR_PAIR(i), (void *)0); #else attrset (COLOR_PAIR(i)); #endif bkgdset (COLOR_PAIR(i)); } else { attrset (A_NORMAL); } } if (attr & COB_SCREEN_BLANK_SCREEN) { getyx (stdscr, line, column); clear (); move (line, column); } if (attr & COB_SCREEN_BLANK_LINE) { getyx (stdscr, line, column); move (line, 0); clrtoeol (); move (line, column); } if (attr & COB_SCREEN_ERASE_EOL) { clrtoeol (); } if (attr & COB_SCREEN_ERASE_EOS) { clrtobot (); } if (attr & COB_SCREEN_BELL) { beep (); } } static void COB_NOINLINE cob_screen_init (void) { char *s; if (!cob_screen_initialized) { s = getenv ("COB_SCREEN_EXCEPTIONS"); if (s) { if (*s == 'Y' || *s == 'y') { cob_extended_status = 1; s = getenv ("COB_SCREEN_ESC"); if (s) { if (*s == 'Y' || *s == 'y') { cob_use_esc = 1; } } } } fflush (stdout); fflush (stderr); if (!initscr ()) { cob_runtime_error ("Failed to initialize curses"); cob_stop_run (1); } cbreak (); keypad (stdscr, 1); nl (); noecho (); if (has_colors ()) { start_color (); pair_content ((short)0, &fore_color, &back_color); if (COLOR_PAIRS) { cob_has_color = 1; } } attrset (A_NORMAL); getmaxyx (stdscr, cob_max_y, cob_max_x); cob_screen_initialized = 1; } } void cob_screen_terminate (void) { if (cob_screen_initialized) { cob_screen_initialized = 0; endwin (); } } static void COB_NOINLINE cob_check_pos_status (int fret) { cob_field *f; int sline; int scolumn; char datbuf[8]; if (fret) { cob_set_exception (COB_EC_IMP_ACCEPT); } if (cob_current_module->crt_status) { if (COB_FIELD_IS_NUMERIC (cob_current_module->crt_status)) { cob_set_int (cob_current_module->crt_status, fret); } else { sprintf(datbuf, "%4.4d", fret); memcpy (cob_current_module->crt_status->data, datbuf, 4); } } if (cob_current_module->cursor_pos) { getyx (stdscr, sline, scolumn); f = cob_current_module->cursor_pos; if (COB_FIELD_IS_NUMERIC (f) && COB_FIELD_TYPE (f) != COB_TYPE_NUMERIC_DISPLAY) { sline *= 1000; sline += scolumn; cob_set_int (f, sline); } else { if (f->size < 6) { sline *= 100; sline += scolumn; sprintf(datbuf, "%4.4d", sline); memcpy (f->data, datbuf, 4); } else { sline *= 1000; sline += scolumn; sprintf(datbuf, "%6.6d", sline); memcpy (f->data, datbuf, 6); } } } } static void cob_screen_puts (cob_screen *s, cob_field *f) { unsigned char *p; size_t size; int y; int x; int line; int column; getyx (stdscr, y, x); if (!s->line) { line = y; } else { line = cob_get_int (s->line) - 1; if (line < 0) { line = y; } } if (!s->column) { column = x; } else { column = cob_get_int (s->column) - 1; if (column < 0) { column = x; } } if (s->attr & COB_SCREEN_LINE_PLUS) { line = y + line + 1; } else if (s->attr & COB_SCREEN_LINE_MINUS) { line = y - line + 1; } if (s->attr & COB_SCREEN_COLUMN_PLUS) { column = x + column + 1; } else if (s->attr & COB_SCREEN_COLUMN_MINUS) { column = x - column + 1; } move (line, column); cob_current_y = line; cob_current_x = column; cob_screen_attr (s->foreg, s->backg, s->attr); if (s->attr & COB_SCREEN_INPUT) { p = f->data; for (size = 0; size < f->size; size++, p++) { if (s->attr & COB_SCREEN_SECURE) { addch ('*'); } else if (*p <= ' ') { addch ('_'); } else { addch (*p); } } } else { addnstr ((char *)f->data, (int)f->size); } refresh (); } static void cob_screen_get_all (void) { struct cob_inp_struct *sptr; cob_screen *s; unsigned char *p; int keyp; int sline; int scolumn; int cline; int ccolumn; int rightpos; int ateof; int gotbacksp; int ungetched; sptr = cob_base_inp; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); /* RXW p = s->field->data; for (count = 0; count < s->field->size; count++) { if (s->attr & COB_SCREEN_UPDATE) { keyp = *p++; addch (keyp); } else if (s->attr & COB_SCREEN_PROMPT) { addch ('_'); } else { addch (' '); } } move (sline, scolumn); */ ateof = 0; gotbacksp = 0; ungetched = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; for (; ;) { refresh (); keyp = getch (); if (keyp == KEY_ENTER || keyp == '\n') { break; } if (keyp > KEY_F0 && keyp < KEY_F(65)) { global_return = 1000 + keyp - KEY_F0; break; } if (cob_extended_status) { if (keyp == KEY_PPAGE) { global_return = 2001; break; } if (keyp == KEY_NPAGE) { global_return = 2002; break; } if (keyp == KEY_PRINT) { global_return = 2006; break; } if (cob_use_esc) { if (keyp == 033) { global_return = 2005; break; } } } if (keyp == 011) { if (curr_index < totl_index - 1) { curr_index++; } else { curr_index = 0; } sptr = cob_base_inp + curr_index; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); continue; } if (keyp == KEY_BTAB) { if (curr_index > 0) { curr_index--; } else { curr_index = totl_index - 1; } sptr = cob_base_inp + curr_index; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; if (ungetched) { ungetched = 0; p = s->field->data + rightpos; move (sline, rightpos); } else { p = s->field->data; move (sline, scolumn); } cob_screen_attr (s->foreg, s->backg, s->attr); continue; } if (keyp == KEY_UP) { curr_index = sptr->up_index; sptr = cob_base_inp + curr_index; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); continue; } if (keyp == KEY_DOWN) { curr_index = sptr->down_index; sptr = cob_base_inp + curr_index; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); continue; } if (keyp == KEY_HOME) { curr_index = 0; sptr = cob_base_inp; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); continue; } if (keyp == KEY_END) { curr_index = totl_index - 1; sptr = cob_base_inp + curr_index; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->this_x; ateof = 0; gotbacksp = 0; rightpos = scolumn + s->field->size - 1; p = s->field->data; move (sline, scolumn); cob_screen_attr (s->foreg, s->backg, s->attr); continue; } getyx (stdscr, cline, ccolumn); if (keyp == KEY_BACKSPACE || keyp == ('H' & 037) || keyp == 0177) { if (ccolumn > scolumn) { if (gotbacksp || ccolumn != rightpos) { ccolumn--; } else { ateof = 0; } gotbacksp = 1; move (cline, ccolumn); if (s->attr & COB_SCREEN_SECURE) { addch ('*'); } else { addch ('_'); } move (cline, ccolumn); p = s->field->data + ccolumn - scolumn; *p = ' '; } else { ungetched = 1; gotbacksp = 0; ungetch (KEY_BACKSPACE); ungetch (KEY_BTAB); } continue; } if (keyp == KEY_LEFT) { gotbacksp = 0; if (ccolumn > scolumn) { ccolumn--; move (cline, ccolumn); p = s->field->data + ccolumn - scolumn; } else { ungetched = 1; ungetch (KEY_BTAB); } continue; } if (keyp == KEY_RIGHT) { gotbacksp = 0; if (ccolumn < rightpos) { ccolumn++; move (cline, ccolumn); p = s->field->data + ccolumn - scolumn; } else { ungetch (011); } continue; } if (keyp > 037 && keyp < (int)A_CHARTEXT) { if (COB_FIELD_IS_NUMERIC (s->field)) { if (keyp < '0' || keyp > '9') { beep (); continue; } } gotbacksp = 0; *p = keyp; if (s->attr & COB_SCREEN_SECURE) { addch ('*'); } else { addch ((unsigned int)keyp); } if (ccolumn == rightpos) { if (s->attr & COB_SCREEN_AUTO) { if (curr_index == totl_index - 1) { break; } else { ungetch (011); } } move (cline, ccolumn); if (ateof) { beep (); } else { ateof = 1; } } else { p++; } continue; } gotbacksp = 0; beep (); } refresh (); } static int compare_yx (const void *m1, const void *m2) { const struct cob_inp_struct *s1; const struct cob_inp_struct *s2; s1 = m1; s2 = m2; if (s1->this_y < s2->this_y) { return -1; } if (s1->this_y > s2->this_y) { return 1; } if (s1->this_x < s2->this_x) { return -1; } if (s1->this_x > s2->this_x) { return 1; } return 0; } static void cob_prep_input (cob_screen *s) { struct cob_inp_struct *sptr; int n; switch (s->type) { case COB_SCREEN_TYPE_GROUP: for (s = s->child; s; s = s->next) { cob_prep_input (s); } break; case COB_SCREEN_TYPE_FIELD: cob_screen_puts (s, s->field); if (s->attr & COB_SCREEN_INPUT) { sptr = cob_base_inp + totl_index; sptr->scr = s; sptr->this_y = cob_current_y; sptr->this_x = cob_current_x; totl_index++; } break; case COB_SCREEN_TYPE_VALUE: cob_screen_puts (s, s->value); if (s->occurs) { for (n = 1; n < s->occurs; ++n) { cob_screen_puts (s, s->value); } } break; case COB_SCREEN_TYPE_ATTRIBUTE: cob_screen_attr (s->foreg, s->backg, s->attr); break; } } /* Global functions */ void cob_screen_display (cob_screen *s, cob_field *line, cob_field *column) { int n; if (!cob_screen_initialized) { cob_screen_init (); } switch (s->type) { case COB_SCREEN_TYPE_GROUP: for (s = s->child; s; s = s->next) { cob_screen_display (s, line, column); } break; case COB_SCREEN_TYPE_FIELD: cob_screen_puts (s, s->field); break; case COB_SCREEN_TYPE_VALUE: cob_screen_puts (s, s->value); if (s->occurs) { for (n = 1; n < s->occurs; ++n) { cob_screen_puts (s, s->value); } } break; case COB_SCREEN_TYPE_ATTRIBUTE: cob_screen_attr (s->foreg, s->backg, s->attr); break; } refresh (); } void cob_screen_accept (cob_screen *s, cob_field *line, cob_field *column) { struct cob_inp_struct *sptr; struct cob_inp_struct *sptr2; size_t idx; size_t n; size_t posu; size_t posd; size_t prevy; size_t firsty; int starty; if (!cob_screen_initialized) { cob_screen_init (); } if (!cob_base_inp) { cob_base_inp = cob_malloc (COB_INP_SIZE); } else { memset (cob_base_inp, 0, COB_INP_SIZE); } cob_exception_code = 0; cob_current_y = 0; cob_current_x = 0; totl_index = 0; move (0, 0); cob_prep_input (s); /* No input fields is an error */ if (!totl_index) { cob_check_pos_status (8000); return; } qsort (cob_base_inp, totl_index, sizeof(struct cob_inp_struct), compare_yx); sptr = cob_base_inp; starty = sptr->this_y; posu = 0; posd = 0; prevy = 0; firsty = 0; /* Set up array for Cursor UP/DOWN */ for (n = 0; n < totl_index; n++) { sptr = cob_base_inp + n; if (sptr->this_y > starty) { if (!firsty) { firsty = n; } starty = sptr->this_y; sptr2 = cob_base_inp + posd; for (idx = posd; idx < n; idx++, sptr2++) { sptr2->down_index = n; } posu = prevy; prevy = n; posd = n; } sptr->up_index = posu; } sptr = cob_base_inp; for (n = 0; n < firsty; n++, sptr++) { sptr->up_index = posd; } curr_index = 0; global_return = 0; cob_screen_get_all (); cob_check_pos_status (global_return); } void cob_field_display (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, cob_field *scroll, const int attr) { int sline; int scolumn; if (!cob_screen_initialized) { cob_screen_init (); } if (scroll) { sline = cob_get_int (scroll); if (attr & COB_SCREEN_SCROLL_DOWN) { sline = -sline; } scrollok (stdscr, 1); scrl (sline); scrollok (stdscr, 0); refresh (); } get_line_column (line, column, &sline, &scolumn); move (sline, scolumn); cob_screen_attr (fgc, bgc, attr); addnstr ((char *)f->data, (int)f->size); refresh (); } void cob_field_accept (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, cob_field *scroll, const int attr) { unsigned char *p; size_t count; int keyp; int fret; int sline; int scolumn; int cline; int ccolumn; int rightpos; int ateof; int gotbacksp; if (!cob_screen_initialized) { cob_screen_init (); } if (scroll) { keyp = cob_get_int (scroll); if (attr & COB_SCREEN_SCROLL_DOWN) { keyp = -keyp; } scrollok (stdscr, 1); scrl (keyp); scrollok (stdscr, 0); refresh (); } cob_exception_code = 0; get_line_column (line, column, &sline, &scolumn); move (sline, scolumn); cob_screen_attr (fgc, bgc, attr); p = f->data; for (count = 0; count < f->size; count++) { if (attr & COB_SCREEN_SECURE) { addch ('*'); } else if (attr & COB_SCREEN_UPDATE) { fret = *p++; addch ((unsigned int)fret); } else if (attr & COB_SCREEN_PROMPT) { addch ('_'); } else { addch (' '); } } move (sline, scolumn); if (!(attr & COB_SCREEN_UPDATE)) { if (COB_FIELD_IS_NUMERIC (f)) { cob_move (&cob_zero, f); } else { memset (f->data, ' ', f->size); } } fret = 0; ateof = 0; gotbacksp = 0; rightpos = scolumn + f->size - 1; p = f->data; for (; ;) { refresh (); keyp = getch (); if (keyp == KEY_ENTER || keyp == '\n') { break; } if (keyp > KEY_F0 && keyp < KEY_F(65)) { fret = 1000 + keyp - KEY_F0; break; } if (cob_extended_status) { if (keyp == KEY_PPAGE) { fret = 2001; break; } if (keyp == KEY_NPAGE) { fret = 2002; break; } if (keyp == KEY_UP) { fret = 2003; break; } if (keyp == KEY_DOWN) { fret = 2004; break; } if (keyp == KEY_PRINT) { fret = 2006; break; } if (cob_use_esc) { if (keyp == 033) { fret = 2005; break; } } } getyx (stdscr, cline, ccolumn); if (keyp == KEY_BACKSPACE || keyp == ('H' & 037) || keyp == 0177) { if (ccolumn > scolumn) { if (gotbacksp || ccolumn != rightpos) { ccolumn--; } else { ateof = 0; } gotbacksp = 1; move (cline, ccolumn); if (attr & COB_SCREEN_SECURE) { addch ('*'); } else { addch ('_'); } move (cline, ccolumn); p = f->data + ccolumn - scolumn; *p = ' '; continue; } } if (keyp == KEY_HOME) { move (sline, scolumn); p = f->data; ateof = 0; gotbacksp = 0; continue; } if (keyp == KEY_END) { move (sline, rightpos); p = f->data + f->size - 1; ateof = 0; gotbacksp = 0; continue; } if (keyp == KEY_LEFT) { if (ccolumn > scolumn) { ccolumn--; move (cline, ccolumn); p = f->data + ccolumn - scolumn; continue; } gotbacksp = 0; } if (keyp == KEY_RIGHT) { if (ccolumn < rightpos) { ccolumn++; move (cline, ccolumn); p = f->data + ccolumn - scolumn; continue; } gotbacksp = 0; } if (keyp > 037 && keyp < (int)A_CHARTEXT) { if (COB_FIELD_IS_NUMERIC (f)) { if (keyp < '0' || keyp > '9') { beep (); continue; } } gotbacksp = 0; *p = keyp; if (attr & COB_SCREEN_SECURE) { addch ('*'); } else { addch ((unsigned int)keyp); } if (ccolumn == rightpos) { if (attr & COB_SCREEN_AUTO) { break; } move (cline, ccolumn); if (ateof) { beep (); } else { ateof = 1; } } else { p++; } continue; } gotbacksp = 0; beep (); } cob_check_pos_status (fret); refresh (); } void cob_screen_line_col (cob_field *f, const int l_or_c) { if (!cob_screen_initialized) { cob_screen_init (); } if (!l_or_c) { cob_set_int (f, (int)LINES); } else { cob_set_int (f, (int)COLS); } } void cob_screen_set_mode (const size_t smode) { if (!smode) { refresh (); def_prog_mode (); endwin (); } else { reset_prog_mode (); refresh (); } } #else void cob_screen_terminate (void) { } void cob_field_display (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, const int attr) { } void cob_field_accept (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, const int attr) { } void cob_screen_display (cob_screen *s, cob_field *line, cob_field *column) { } void cob_screen_accept (cob_screen *s, cob_field *line, cob_field *column) { } void cob_screen_line_col (cob_field *f, const int l_or_c) { } void cob_screen_set_mode (const size_t smode) { } #endif open-cobol-1.1/libcob/screenio.h0000644000000000000000000000604411135417401012252 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_SCREENIO_H #define COB_SCREENIO_H #include #define COB_SCREEN_BLACK 0 #define COB_SCREEN_BLUE 1 #define COB_SCREEN_GREEN 2 #define COB_SCREEN_CYAN 3 #define COB_SCREEN_RED 4 #define COB_SCREEN_MAGENTA 5 #define COB_SCREEN_YELLOW 6 #define COB_SCREEN_WHITE 7 #define COB_SCREEN_LINE_PLUS 0x00000001 #define COB_SCREEN_LINE_MINUS 0x00000002 #define COB_SCREEN_COLUMN_PLUS 0x00000004 #define COB_SCREEN_COLUMN_MINUS 0x00000008 #define COB_SCREEN_AUTO 0x00000010 #define COB_SCREEN_BELL 0x00000020 #define COB_SCREEN_BLANK_LINE 0x00000040 #define COB_SCREEN_BLANK_SCREEN 0x00000080 #define COB_SCREEN_BLINK 0x00000100 #define COB_SCREEN_ERASE_EOL 0x00000200 #define COB_SCREEN_ERASE_EOS 0x00000400 #define COB_SCREEN_FULL 0x00000800 #define COB_SCREEN_HIGHLIGHT 0x00001000 #define COB_SCREEN_LOWLIGHT 0x00002000 #define COB_SCREEN_REQUIRED 0x00004000 #define COB_SCREEN_REVERSE 0x00008000 #define COB_SCREEN_SECURE 0x00010000 #define COB_SCREEN_UNDERLINE 0x00020000 #define COB_SCREEN_OVERLINE 0x00040000 #define COB_SCREEN_PROMPT 0x00080000 #define COB_SCREEN_UPDATE 0x00100000 #define COB_SCREEN_INPUT 0x00200000 #define COB_SCREEN_SCROLL_DOWN 0x00400000 #define COB_SCREEN_TYPE_GROUP 0 #define COB_SCREEN_TYPE_FIELD 1 #define COB_SCREEN_TYPE_VALUE 2 #define COB_SCREEN_TYPE_ATTRIBUTE 3 typedef struct __cob_screen cob_screen; struct __cob_screen { cob_screen *next; cob_screen *child; /* for COB_SCREEN_TYPE_GROUP */ cob_field *field; /* for COB_SCREEN_TYPE_FIELD */ cob_field *value; /* for COB_SCREEN_TYPE_VALUE */ cob_field *line; cob_field *column; cob_field *foreg; cob_field *backg; int type; int occurs; int attr; /* for COB_SCREEN_TYPE_ATTRIBUTE */ }; DLL_EXPIMP extern int cob_screen_mode; extern void cob_screen_line_col (cob_field *, const int); extern void cob_screen_display (cob_screen *, cob_field *, cob_field *); extern void cob_screen_accept (cob_screen *, cob_field *, cob_field *); extern void cob_field_display (cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, const int); extern void cob_field_accept (cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, const int); #endif /* COB_SCREENIO_H */ open-cobol-1.1/config.h.in0000644000000000000000000002207711115540310011061 /* config.h.in. Generated from configure.ac by autoheader. */ /* Executable extension */ #undef COB_EXEEXT /* Enable experimemental code (Developers only!) */ #undef COB_EXPERIMENTAL /* Compile/link option for exporting symbols */ #undef COB_EXPORT_DYN /* Extra Compiler Flags */ #undef COB_EXTRA_FLAGS /* Can use inline keyword */ #undef COB_HAS_INLINE /* long int is long long */ #undef COB_LI_IS_LL /* Can not dlopen self */ #undef COB_NO_SELFOPEN /* Enable CALL parameter checking */ #undef COB_PARAM_CHECK /* Compile/link option for PIC code */ #undef COB_PIC_FLAGS /* Compile/link option for shared code */ #undef COB_SHARED_OPT /* Can use strftime for timezone */ #undef COB_STRFTIME /* Strip command */ #undef COB_STRIP_CMD /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Has __attribute__((aligned)) */ #undef HAVE_ATTRIBUTE_ALIGNED /* curses has color_set function */ #undef HAVE_COLOR_SET /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_DB1_DB_H /* Define to 1 if you have the header file. */ #undef HAVE_DB3_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_1_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_2_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_3_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_4_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_5_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB4_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB_185_H /* Define to 1 if you have the header file. */ #undef HAVE_DB_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DISAM_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_GMP_H /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_ISAM_H /* Define to 1 if you have the header file. */ #undef HAVE_KPATHSEA_GETOPT_H /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the `curses' library (-lcurses). */ #undef HAVE_LIBCURSES /* Define to 1 if you have the `disam' library (-ldisam). */ #undef HAVE_LIBDISAM /* Define to 1 if you have the `gmp' library (-lgmp). */ #undef HAVE_LIBGMP /* Define to 1 if you have the `ifisam' library (-lifisam). */ #undef HAVE_LIBIFISAM /* Define to 1 if you have the `ltdl' library (-lltdl). */ #undef HAVE_LIBLTDL /* Define to 1 if you have the `ncurses' library (-lncurses). */ #undef HAVE_LIBNCURSES /* Define to 1 if you have the `pdcurses' library (-lpdcurses). */ #undef HAVE_LIBPDCURSES /* Define to 1 if you have the `posix4' library (-lposix4). */ #undef HAVE_LIBPOSIX4 /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `vbisam' library (-lvbisam). */ #undef HAVE_LIBVBISAM /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_LTDL_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_PDCURSES_H /* Has -Wno-pointer-sign */ #undef HAVE_PSIGN_OPT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_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_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* 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 `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* 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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Has timezone variable */ #undef HAVE_TIMEZONE /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VBISAM_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define a patch level */ #undef PATCH_LEVEL /* 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 run-time. 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 you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Use Berkeley DB library new features */ #undef USE_DB41 /* Use system dynamic loader */ #undef USE_LIBDL /* Version number of package */ #undef VERSION /* Use CISAM as ISAM handler */ #undef WITH_CISAM /* Compile with the Berkeley DB library */ #undef WITH_DB /* Use DISAM as ISAM handler */ #undef WITH_DISAM /* Compile with an external ISAM handler */ #undef WITH_INDEX_EXTFH /* Compile with an external SEQ/RAN handler */ #undef WITH_SEQRA_EXTFH /* Define variable sequential file format */ #undef WITH_VARSEQ /* Use VBISAM as ISAM handler */ #undef WITH_VBISAM /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Define to 1 if on HPUX. */ #ifndef _XOPEN_SOURCE_EXTENDED # undef _XOPEN_SOURCE_EXTENDED #endif /* Compiler optimization */ #undef __USE_STRING_INLINES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned' if does not define. */ #undef size_t open-cobol-1.1/AUTHORS0000644000000000000000000000066407723721246010127 * Keisuke Nishida wrote cobc/*, libcob/*, libcob.h, libcob.conf, cob-config.in, and po/ja.po. * lib/getopt1.c, lib/getopt.h, lib/getopt1.c were extracted from the GNU C Library 2.3.2. Distributed under GNU LGPL. * lib/gettext.h was extracted from the GNU gettext 0.11.2. Distributed under GNU LGPL. * libcob/byteswap.h was extracted from GLIB 2.2.2 and modified by Keisuke Nishida. Distributed under GNU LGPL. open-cobol-1.1/INSTALL0000644000000000000000000002243210357272633010103 Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. open-cobol-1.1/libcob.h0000644000000000000000000000242511130701401010431 /* * Copyright (C) 2002-2009 Keisuke Nishida * Copyright (C) 2007-2009 Roger While * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1, * or (at your option) any later version. * * This library 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ #ifndef COB_LIBCOB_H #define COB_LIBCOB_H #include #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus } #endif #endif /* COB_LIBCOB_H_ */ open-cobol-1.1/ABOUT-NLS0000644000000000000000000012652507764237164010321 Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of November 2003. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files am az be bg ca cs da de el en en_GB eo es +-------------------------------------------+ a2ps | [] [] [] [] | aegis | () | ant-phone | () | anubis | | ap-utils | | bash | [] [] [] [] | batchelor | | bfd | [] [] | binutils | [] [] | bison | [] [] [] | bluez-pin | [] [] | clisp | [] [] [] | clisp | | coreutils | [] [] [] [] | cpio | [] [] [] | darkstat | [] () [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | error | [] [] [] [] [] | fetchmail | [] () [] [] [] [] | fileutils | [] [] [] | findutils | [] [] [] [] [] [] [] | flex | [] [] [] [] | fslint | | gas | [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | [] [] | gettext | [] [] [] [] [] | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] [] [] [] | gliv | | glunarclock | [] [] [] | gnubiff | [] | gnucash | [] () [] [] | gnucash-glossary | [] () [] | gnupg | [] () [] [] [] [] | gpe-aerial | [] | gpe-beam | [] [] | gpe-calendar | [] [] | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | () () () | gramadoir | [] | grep | [] [] [] [] [] [] | gretl | [] | gtick | () | hello | [] [] [] [] [] [] | id-utils | [] [] | indent | [] [] [] [] | jpilot | [] [] [] | jtag | | jwhois | [] | kbd | [] [] [] [] [] | latrine | () | ld | [] [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] | libiconv | [] [] [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lingoteach_lessons | () () | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] | man-db | [] () [] [] () | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] () [] [] [] | nano_1_0 | [] () [] [] [] | opcodes | [] | parted | [] [] [] [] [] | ptx | [] [] [] [] [] | python | | radius | | recode | [] [] [] [] [] [] [] | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | | sharutils | [] [] [] [] [] [] | sketch | [] () [] | soundtracker | [] [] [] | sp | [] | tar | [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] | tin | () () | tuxpaint | [] [] [] [] [] [] [] | util-linux | [] [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] [] [] [] [] | xchat | [] [] [] [] | xfree86_xkb_xml | [] | xpad | [] | +-------------------------------------------+ am az be bg ca cs da de el en en_GB eo es 0 1 8 3 37 37 54 73 15 1 5 12 62 et fa fi fr ga gl he hr hu id is it ja +----------------------------------------+ a2ps | [] [] [] () | aegis | | ant-phone | | anubis | [] | ap-utils | [] | bash | [] [] | batchelor | [] | bfd | [] | binutils | [] [] | bison | [] [] [] [] | bluez-pin | [] [] [] [] [] | clisp | [] | clisp | | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | darkstat | () [] [] [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | | enscript | [] [] | error | [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] [] [] | flex | [] [] | fslint | | gas | [] | gawk | [] [] [] | gbiff | | gcal | [] | gcc | [] | gettext | [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] | gimp-print | [] [] | gliv | () | glunarclock | [] [] [] [] [] | gnubiff | | gnucash | () [] | gnucash-glossary | [] | gnupg | [] [] [] [] [] [] [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] [] [] | gpe-clock | [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] [] [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] | gprof | [] [] | gpsdrive | () [] () () | gramadoir | [] | grep | [] [] [] [] [] [] [] [] [] [] [] | gretl | [] | gtick | [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] | jpilot | [] () | jtag | | jwhois | [] [] [] [] | kbd | [] | latrine | | ld | [] | libc | [] [] [] [] [] | libgpewidget | [] [] [] [] | libiconv | [] [] [] [] [] [] [] [] [] | lifelines | () | lilypond | [] | lingoteach | [] [] | lingoteach_lessons | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | | make | [] [] [] [] [] | man-db | () () | minicom | [] [] [] [] | mysecretdiary | [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] | parted | [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | | recode | [] [] [] [] [] [] | screem | | scrollkeeper | [] | sed | [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] | sharutils | [] [] [] [] [] | sketch | [] | soundtracker | [] [] [] [] | sp | [] () | tar | [] [] [] [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] [] [] | tin | [] () | tuxpaint | [] [] [] [] [] [] [] [] | util-linux | [] [] [] [] () [] | vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | | xpad | [] | +----------------------------------------+ et fa fi fr ga gl he hr hu id is it ja 21 1 24 84 24 24 8 10 38 31 1 22 33 ko lg lt lv ms nb nl nn no pl pt pt_BR ro +-------------------------------------------+ a2ps | () [] [] () () [] [] | aegis | () () | ant-phone | [] [] | anubis | [] [] [] [] [] | ap-utils | [] () [] | bash | [] [] | batchelor | [] | bfd | [] | binutils | | bison | [] [] [] [] | bluez-pin | [] [] [] | clisp | [] | clisp | | coreutils | [] | cpio | [] [] [] [] [] | darkstat | [] [] [] [] | diffutils | [] [] [] [] | e2fsprogs | [] | enscript | [] [] [] | error | [] [] [] | fetchmail | [] [] () | fileutils | [] | findutils | [] [] [] [] [] | flex | [] [] [] [] | fslint | [] [] | gas | | gawk | [] [] [] | gbiff | [] [] | gcal | | gcc | | gettext | [] [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] [] | gimp-print | [] | gliv | [] [] [] | glunarclock | [] [] [] | gnubiff | | gnucash | [] [] () | gnucash-glossary | [] [] | gnupg | [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] | gpe-calendar | [] [] [] | gpe-clock | [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] [] | gpe-go | [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] [] [] | gpe-su | [] [] [] | gpe-taskmanager | [] [] [] | gpe-timesheet | [] [] [] | gpe-today | [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] | gprof | [] [] | gpsdrive | () () () [] | gramadoir | [] | grep | [] [] [] [] | gretl | | gtick | [] [] | hello | [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] | indent | [] [] [] | jpilot | () () | jtag | | jwhois | [] [] [] [] | kbd | [] [] [] | latrine | [] | ld | | libc | [] [] [] [] [] | libgpewidget | [] [] [] | libiconv | [] [] [] [] | lifelines | | lilypond | | lingoteach | | lingoteach_lessons | | lynx | [] [] | m4 | [] [] [] [] | mailutils | [] | make | [] [] [] [] | man-db | [] | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | [] | recode | [] [] [] | screem | | scrollkeeper | [] [] [] [] | sed | [] [] [] | sh-utils | [] | shared-mime-info | [] | sharutils | [] | sketch | [] [] | soundtracker | | sp | | tar | [] [] [] [] [] [] | texinfo | [] [] [] | textutils | [] [] | tin | | tuxpaint | [] [] [] [] [] [] [] [] [] | util-linux | [] [] | vorbis-tools | [] [] | wastesedge | | wdiff | [] [] [] [] | wget | [] [] | xchat | [] [] | xfree86_xkb_xml | [] | xpad | [] [] | +-------------------------------------------+ ko lg lt lv ms nb nl nn no pl pt pt_BR ro 11 0 1 2 12 10 60 4 4 38 23 34 74 ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW +-------------------------------------------+ a2ps | [] [] [] [] [] | 16 aegis | () | 0 ant-phone | | 2 anubis | [] [] [] | 9 ap-utils | () | 3 bash | [] | 9 batchelor | | 2 bfd | [] [] | 6 binutils | [] [] [] | 7 bison | [] [] [] | 14 bluez-pin | [] [] [] | 13 clisp | | 5 clisp | | 0 coreutils | [] [] [] [] [] | 16 cpio | [] [] [] | 14 darkstat | [] [] [] () () | 12 diffutils | [] [] [] [] | 22 e2fsprogs | [] [] | 5 enscript | [] [] [] | 12 error | [] [] [] | 15 fetchmail | [] [] [] | 11 fileutils | [] [] [] [] [] [] | 16 findutils | [] [] [] [] [] [] [] | 29 flex | [] [] [] | 13 fslint | | 2 gas | [] | 3 gawk | [] [] | 12 gbiff | | 3 gcal | [] [] | 4 gcc | [] | 4 gettext | [] [] [] [] [] [] | 16 gettext-examples | [] [] | 9 gettext-runtime | [] [] [] [] [] [] [] [] [] | 21 gettext-tools | [] [] [] [] [] [] | 14 gimp-print | [] [] | 10 gliv | | 3 glunarclock | [] [] [] [] | 15 gnubiff | | 1 gnucash | [] [] [] | 9 gnucash-glossary | [] [] [] | 8 gnupg | [] [] [] [] | 17 gpe-aerial | [] [] | 7 gpe-beam | [] [] | 8 gpe-calendar | [] [] [] [] [] | 13 gpe-clock | [] [] [] | 9 gpe-conf | [] [] [] | 9 gpe-contacts | [] [] [] [] | 11 gpe-edit | [] [] [] [] [] | 11 gpe-go | [] | 5 gpe-login | [] [] [] [] [] | 12 gpe-ownerinfo | [] [] [] [] | 12 gpe-sketchbook | [] [] [] | 9 gpe-su | [] [] [] | 9 gpe-taskmanager | [] [] [] | 9 gpe-timesheet | [] [] [] [] | 11 gpe-today | [] [] [] [] [] | 12 gpe-todo | [] [] [] [] [] | 12 gphoto2 | [] [] [] | 11 gprof | [] [] | 9 gpsdrive | [] [] | 4 gramadoir | | 3 grep | [] [] [] [] [] | 26 gretl | | 2 gtick | [] | 5 hello | [] [] [] [] [] | 33 id-utils | [] [] [] | 12 indent | [] [] [] [] [] | 21 jpilot | [] [] [] [] [] | 9 jtag | [] | 1 jwhois | () () [] [] | 11 kbd | [] [] | 11 latrine | | 1 ld | [] [] | 5 libc | [] [] [] [] | 20 libgpewidget | [] [] [] | 12 libiconv | [] [] [] [] [] [] [] [] [] | 27 lifelines | [] | 2 lilypond | [] | 3 lingoteach | | 2 lingoteach_lessons | () | 0 lynx | [] [] [] [] | 14 m4 | [] [] [] | 15 mailutils | [] | 4 make | [] [] [] [] | 16 man-db | [] | 5 minicom | [] | 11 mysecretdiary | [] [] | 10 nano | [] [] [] [] [] | 17 nano_1_0 | [] [] [] [] | 17 opcodes | [] [] | 6 parted | [] [] [] | 15 ptx | [] [] [] | 22 python | | 0 radius | [] | 2 recode | [] [] [] [] | 20 screem | [] [] | 2 scrollkeeper | [] [] [] [] | 15 sed | [] [] [] [] [] [] | 23 sh-utils | [] [] [] | 14 shared-mime-info | [] [] | 4 sharutils | [] [] [] [] [] | 17 sketch | [] | 6 soundtracker | [] [] | 9 sp | [] | 3 tar | [] [] [] [] [] | 24 texinfo | [] [] [] [] | 14 textutils | [] [] [] [] [] | 16 tin | | 1 tuxpaint | [] [] [] [] [] | 29 util-linux | [] [] [] | 15 vorbis-tools | [] | 8 wastesedge | | 0 wdiff | [] [] [] [] | 18 wget | [] [] [] [] [] [] [] [] | 23 xchat | [] [] [] [] [] | 14 xfree86_xkb_xml | [] [] [] [] | 6 xpad | | 4 +-------------------------------------------+ 51 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW 117 domains 58 41 16 16 78 0 53 12 1 10 21 22 1230 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If November 2003 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. open-cobol-1.1/ChangeLog0000644000000000000000000003577111120223733010620 2008-11-17 Roger While * configure.ac : Correct sed usage 2008-11-15 Roger While * configure.ac : Remove lfs64 option, reinstate --enable-debug 2008-11-01 Roger While * configure.ac : nanosleep on Solaris needs extra libs 2008-09-29 Roger While * Makefile.am : Revise format of tarstamp.h 2008-08-20 Roger While * configure.ac : Option changes for AIX 2008-08-16 Roger While * configure.ac : Fix AIX xlc 2008-08-08 Roger While * configure.ac : Take out --enable-debug * Makefile.am : Force permissions when making dist 2008-07-05 Roger While * configure.ac : No need to check for regex or mvgetnstr 2008-04-16 Roger While * configure.ac : Add in "copy" directory for OC supplied COPY elements 2008-01-03 Roger While * configure.ac : Fix invalid usage of square brackets 2007-12-29 Roger While * Bump version to 1.1 2007-12-27 Roger While * Release 1.0 2007-12-21 Roger While * configure.ac : Change order of checking various things 2007-12-18 Roger While * configure.ac : Fix WITH_VARSEQ setting 2007-12-03 Roger While * configure.ac : Add checks for headers/libraries when using CISAM/DISAM/VBISAM 2007-11-21 Roger While * configure.ac : Add --with-cisam, --with-disam, --with-vbisam 2007-11-09 Roger While * configure.ac : Check for sizeof long int == long long 2007-10-23 Roger While * configure.ac : Check for __attribute__((aligned)) 2007-10-14 Roger While * libcob.h : Add gmp include for C++ 2007-10-10 Roger While * General : bootstrap up to libtool 1.5.24 * configure.ac : HP specific options 2007-09-18 Roger While * configure.ac : Check for mvgetnstr in curses lib 2007-08-31 Roger While * configure.ac : Fix insufficient tests for enable/disable 2007-08-09 Roger While * configure.ac : Shared option for Solaris New configure option --with-index-extfh, allows usage of an external ISAM file handler 2007-07-14 Roger While * configure.ac : Changes for AIX 2007-06-27 Roger While * configure.ac : Check if we can use strftime to get timezone 2007-03-13 Roger While * configure.ac : Check for sys/time.h 2007-01-30 Roger While * configure.ac : Check for langinfo/iconv * README : Update 2007-01-25 Roger While * All : Update Coypright info on all files * README : Update - SORT does not require BDB; Fix typo * cpucheck.c : Uck, Intel, in their infinite wisdom, decided to assign the same family to Core 2 Duo as Pentium (pro/2/3). Check the model number. 2006-10-25 Roger While * README : Update 2006-10-23 Roger While * configure.ac : Remove gcc specific options from the Makefile templates and pull it back into configure. This should make building on non-gcc systems somewhat easier. 2006-08-29 Roger While * General : FSF address change * COPYING.DOC : New file, GNU Free Documentation license 2006-08-28 Roger While * configure.ac : Implement --disable-param-check and --enable-experimental 2006-08-22 Roger While * configure.ac : BDB neeeds stdlib.h for 64-bit build 2006-08-03 Roger While * README update 2006-07-06 Roger While * configure.ac : Revise BDB >= 4.1 checking 2006-06-29 Roger While * configure.ac : Revise BDB >= 4.1 checking 2006-06-25 Roger While * configure.ac : Check for BDB version major/minor in db.h, if >= 4.1 set extended BDB mode 2006-05-24 Roger While * configure.ac : Fix check for GMP 2006-05-05 Roger While * configure.ac : Fix default include in COB_CFLAGS 2006-03-31 Roger While * configure.ac : Fix AIX64 AR/NM 2006-02-18 Roger While * configure.ac : Define __USE_STRING_INLINES 2006-01-26 Roger While * configure.ac : Add (OpenCOBOL) to configure help text so that OC parameters can be easily seen 2006-01-17 Roger While * configure.ac : Minor fixes README : Put in a comment regarding spaces in path names 2006-01-05 Roger While * Bootstrap up to libtool 1.5.22 / automake 1.9.6 configure.ac : Changes for AIX/HP/Sun Default to using system dynamic loading Pass COB_LDFLAGS from LDFLAGS 2006-01-03 Roger While * configure.ac : Pass CFLAGS into COB_CFLAGS Default to using system dynamic loading 2005-12-31 Roger While * Remove COBCRUN SHARE variable 2005-12-30 Roger While * configure.ac : Check timezone/gettimeofday 2005-12-21 Roger While * configure.ac : WITH_VARSEQ - Define the format of variable length sequential files 2005-12-13 Roger While * cpucheck.c : Revert to i686 with -mcpu/tune= 2005-12-08 Roger While * configure.ac : Compile cpucheck with COB_CC. Pass extra compile options as own define. Put in a hack to stop CXX/F77 checking - Anybody know a better way ? 2005-12-05 Roger While * configure.ac : Pass down EXEEXT 2005-11-25 Roger While * configure.ac : Fix typos, cater for DB 4.4 and 4.5 Check for signal.h and sys/types.h Clean up getopt 2005-11-06 Roger While * configure.ac : minor help text cleanup 2005-11-04 Roger While * configure.ac : Fix COB_CC not equal CC 2005-11-01 Roger While * configure.ac : Fix missing EGREP Check for various libdb's individually as libdb may not be linked to newer version (or at all - Cygwin) Check for ncurses.h in include/ncurses/ncurses.h 2005-10-31 Roger While * configure.ac : Pick up -Wno-pointer-sign and the visibility attribute 2005-10-28 Roger While * configure.ac : Propagate endian value 2005-10-27 Roger While * configure.ac : MAC (Darwin) has different options when creating a shared library as opposed to creating a loadable module. Pick this up and export it to the Makefile's. 2005-10-26 Roger While * configure.ac : Fix DB checking again * README : Minor corrections/additions 2005-10-14 Roger While * configure.ac : Specify srcdir for cpucheck (make distcheck) 2005-10-13 Roger While * configure.ac : Use basename for gcc 2005-10-06 Roger While * README : Typo for Bison 2005-10-01 Roger While * cpucheck.c : Some versions of GCC generate wrong SSE code when compiling with P3/4 options. Stop this by also specifying -mno-sse. 2005-07-31 Roger While * Change configure default options for db, lfs64, ltdl Add --with-patch-level= * Add cpucheck.c to top level for configure 2005-06-28 Roger While * Finally FUNCTIONS 2005-06-13 Roger While * If ncurses not found, check for pdcurses 2005-06-11 Roger While * New m4 macro cattribute.m4, autoreconf run 2005-06-01 Roger While * configure.ac, configure : Change for MingW 2005-05-27 Roger While * DB headers can also be in db4/ db4.1/ db4.2/ db4.3/ 2005-05-21 Roger While * Allow configure option --with-dl for native dynamic linking instead of ltdl. This is a win eg. on Linux as native dl is anyway used. 2005-05-17 Roger While * configure, configure.ac, all Makefile.in Fix up COB_CFLAGS and COB_LIBS. Cater for defining CPPFLAGS and LDFLAGS. We have to propogate these to the compiler. 2005-05-13 Roger While * CVS Version bumped to 0.33 2005-05-12 Roger While * Version 0.32 released 2005-05-03 Roger While * configure.ac : Revert WORDS_BIGENDIAN. We do not need it. configure.ac, configure, Mak** : Fix missing variables. Run autoreconf 2005-04-15 Keisuke Nishida * configure.ac (WORDS_BIGENDIAN): New variable. 2005-04-13 Keisuke Nishida * configure.ac (LIBCOB_CFLAGS): Set -fPIC when necessary. 2005-03-03 Roger While * configure.ac, configure, config.h.in : Version to 0.32 Pull out the hard-coded -shared from cobc.c and define it in configure. Get the strip command and put into config.h * ltmain.sh : Latest version 2005-02-07 Roger While * configure.ac : Check for cygwin/mingw on cobcrun make 2005-02-01 Roger While * Version 0.31 released 2005-01-13 Roger While * configure.ac, configure, config.h.in * Generate compiler/linker options in config.h for exporting symbols and PIC code. Will eventually be used by cobc.c. 2004-11-29 Roger While * New directory bin for cobcrun driver program * configure.ac, Makefile.am 2004-10-30 Roger While * configure.ac, configure (over autoconf) : Change entry point name check from __db_dbopen to __db_open. This fixes configuring against the NPTL versions of DB (eg. Red Hat, Suse). 2004-08-02 Keisuke Nishida * Version 0.30 released. 2004-03-06 Keisuke Nishida * configure.ac: Checks for fcntl. 2003-08-22 Keisuke Nishida * libcob.conf: Removed. 2003-06-12 Keisuke Nishida * Version 0.23 released. 2003-06-08 Keisuke Nishida * Version 0.22 released. 2003-05-19 Keisuke Nishida * Version 0.21 released. 2003-04-26 Keisuke Nishida * Version 0.20 released. 2003-04-19 Keisuke Nishida * cob.pc.in: Removed. * cobpp: Removed. 2002-03-01 Keisuke Nishida * Version 0.12 released. 2002-01-31 Keisuke Nishida * Version 0.11 released. 2002-12-10 Keisuke Nishida * Version 0.10 released. * configure.ac: Updated for autoconf-2.57, and automake-1.7.2. 2002-12-01 Keisuke Nishida * configure.ac: Updated for autoconf-2.56, automake-1.7.1, and libtool-1.4.3. 2002-11-08 Keisuke Nishida * libcob.h: Don't include support.h. 2002-10-14 Keisuke Nishida * Makefile.am: Install libcob.conf in $(sysconfdir), not in $(sysconfdir)/open-cobol. * configure.ac (COB_CONFIG_FILE): Updated. 2002-09-30 Keisuke Nishida * configure.ac: Updated for autoconf-2.54 and automake-1.7. Do not generate libcob/cobconfig.h. 2002-09-24 Keisuke Nishida * configure.ac: Generate libcob/cobconfig.h using AM_CONFIG_HEADER. Check db.h as well as db1/db.h. 2002-09-12 Keisuke Nishida * configure.ac: Add check for regex. 2002-09-09 Keisuke Nishida * Makefile.am (deb, rpm): Removed. 2002-09-06 Keisuke Nishida * configure.ac: Check for db1 instead of db2/db3. 2002-09-05 Keisuke Nishida * Use pkg-config scheme. * cob.pc.in: New file. * cob.m4, cob-config.in: Removed. * Makefile.am, configure.ac: Add cob.pc. Remove cob-config and cob.m4. 2002-08-30 Keisuke Nishida * configure.ac (AM_INIT_AUTOMAKE): Option 'gnu' and 'no-texinfo.tex'. (AC_FUNC_STAT, AC_HEADER_STAT): Removed. (LTLIBINTL): Used instead of LIBINTL. * Makefile.am (EXTRA_DIST): Don't include 'redhat' and 'debian'. 2002-08-28 Keisuke Nishida * configure.ac: Use AC_LIBOBJ scheme. 2002-08-27 Keisuke Nishida * HACKING: Use automake-1.6.3 and gettext-0.11.5. * configure.ac (COB_COBPP): Don't set path. (AM_GNU_GETTEXT_VERSION): Use gettext-0.11.5. (AC_CONFIG_AUX_DIR): Set to 'config'. 2002-08-05 Keisuke Nishida * configure.ac (LIBCOB_LIBS): Add $LIBINTL. 2002-08-02 Keisuke Nishida * Version 0.9.7 released. 2002-07-30 Keisuke Nishida * configure.ac (LIBCOB_LIBS): Set one by one. 2002-07-29 Keisuke Nishida * configure.ac (COB_CONFIG_FILE): Use sysconfdir, not datadir. * Makefile.am (libcob.conf): Install into pkgconfdir, not pkgdatadir. 2002-07-01 Keisuke Nishida * configure.ac: Checks for ncurses. * libcob.h: #include 2002-06-18 Keisuke Nishida * configure.ac (COB_MODULE_EXT): Convert dll.a to dll. 2002-06-17 Keisuke Nishida * Makefile.am (EXTRA_DIST): Don't include config.rpath. 2002-06-12 Keisuke Nishida * Version 0.9.6 released. 2002-06-11 Keisuke Nishida * configure.ac (COB_MODULE_EXT): New variable. * Makefile.am (defaults.h): Output COB_MODULE_EXT. 2002-06-08 Keisuke Nishida * configure.ac: Check the existence of gcc (or cc). 2002-06-04 Keisuke Nishida * libcob.conf (ding-on-error): New option. 2002-06-02 Keisuke Nishida * testsuite: New directory. 2002-05-31 Keisuke Nishida * configure.ac (maintainer-mode): Do not define. (LIBCOB_LIBS): Include '-lm' * Makefile.am (DISTCLEANFILES): Renamed from CLEANFILES. 2002-05-29 Keisuke Nishida * README, AUTHORS: Add more information. * HACKING: Renamed from README.CVS. Add more information. * Makefile.am: Include HACKING in the distribution. 2002-05-29 Keisuke Nishida * configure.ac: Check readline only when --with-readline is given. 2002-05-29 Keisuke Nishida * libcob.conf: New file. * configure.ac, Makefile.am: Add 'COB_CONFIG_FILE'. 2002-05-29 Keisuke Nishida * configure.ac, Makefile.am: Rename 'COB_LDADD' to 'COB_LIBS' 2002-05-19 Keisuke Nishida * Version 0.9.5 released. 2002-05-08 Keisuke Nishida * Version 0.9.4 released. 2002-03-10 Keisuke Nishida * Version 0.9.3 released. 2002-02-26 Keisuke Nishida * Version 0.9.2 released. 2002-02-03 Keisuke Nishida * Version 0.9.1 released. 2002-01-25 Keisuke Nishida * Version 0.9 released. open-cobol-1.1/cpucheck.c0000644000000000000000000000275611047246727011014 #include #include int main () { #ifdef __i386__ #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 #if __GNUC__ > 3 || __GNUC_MINOR__ > 3 char *ctune = "-mtune="; #else char *ctune = "-mcpu="; #endif char vendor_string[16]; int eax, ebx, edx, ecx; int i, hv; int family, model, stepping; __asm__ (".byte 0x0f,0xa2" : "=a" (hv), "=b" (ebx), "=d" (edx), "=c" (ecx) : "0" (0)); *(int *) (vendor_string + 0) = ebx; *(int *) (vendor_string + 4) = edx; *(int *) (vendor_string + 8) = ecx; vendor_string[12] = 0; i = 1; __asm__ (".byte 0x0f,0xa2" : "=a" (eax), "=b" (ebx), "=d" (edx), "=c" (ecx) : "0" (i)); family = (eax >> 8) & 0xf; model = (eax >> 4) & 0xf; stepping = eax & 0xf; if (family == 0xf) { /* "extended" mode. */ family += (eax >> 20) & 0xff; model += (eax >> 12) & 0xf0; } if (strcmp (vendor_string, "GenuineIntel") == 0) { if (family == 5) { printf ("-march=i686 %spentium", ctune); } else if (family == 6) { if (model <= 2) { printf ("-march=i686 %spentiumpro",ctune); } else if (model >= 3 && model <= 6) { printf ("-march=i686 %spentium2",ctune); } else if (model <= 11) { printf ("-march=i686 %spentium3", ctune); } else { printf ("-march=i686 %spentium4", ctune); } } else if (family == 15) { printf ("-march=i686 %spentium4", ctune); } } else if (strcmp (vendor_string, "AuthenticAMD") == 0) { if (family == 6) { printf ("-march=i686 %sathlon", ctune); } } #endif #endif return 0; } open-cobol-1.1/COPYING0000644000000000000000000004310310476501574010104 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.