Skip to content

Commit

Permalink
Merge branch 'gnucobol-3.x' into gcos4gnucobol-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nberth committed Dec 13, 2022
2 parents 5a1ed6f + 6a806d1 commit fe93f0d
Show file tree
Hide file tree
Showing 61 changed files with 2,081 additions and 868 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

2022-12-12 Simon Sobisch <[email protected]>

* configure.ac: check for and substitute PERL/perl

2022-12-02 Simon Sobisch <[email protected]>

* Makefile.am: tarstamp.h may now be created on base of VCSDATE or
Expand Down
50 changes: 29 additions & 21 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ NEWS - user visible changes -*- outline -*-

planned:
* configure: minor checking to set TIME_T_IS_NON_ARITHMETIC
* changes to CALL handling especially for BY VALUE and stdcall
* adjustments for registers and XML PARSE stubs
* investigation of code analysis tools and user feedback

Expand Down Expand Up @@ -288,15 +287,19 @@ NEWS - user visible changes -*- outline -*-
this has been fixed so that all modules compiled with GnuCOBOL 2.2 can be
executed with GnuCOBOL 3.2

** FUNCTION RANDOM could return 1 in rare cases (more often in win32), it now
returns, as defined, a value in the range 0 <= x < 1
** FUNCTION RANDOM could return 1 in rare cases (more likely on win32),
it now returns a value in the range 0 <= x < 1, as defined

** the internal signal handler could crash or deadlock the process on hard
errors (either in called library functions or when running COBOL without
runtime checks); the signal handling is now completely rewritten to fix
this issue and all executed code from the signal handler but the COBOL data
dump is now signal and thread safe

** TYPEDEF items got storage and attribute assigned, leading to bigger modules,
longer loading time and longer compile times; if you use those a recompile
is highly suggested

* Listing changes

** the timestamp in the header was changed from ANSI date format like
Expand Down Expand Up @@ -336,21 +339,25 @@ NEWS - user visible changes -*- outline -*-

** cobc's parsing time was significantly reduced for big programs

** execution times of INSPECT that use big COBOL fields (multiple KB) were
significantly reduced
** execution times were significantly reduced for the following:
INSPECT that use big COBOL fields (multiple KB)
CALL data-item, and first time for each CALL
ACCEPT DATE/TIME/DAY and datetime related FUNCTIONs
MOVE with enabled runtime checks (only with re-compile)

** execution times for programs that are new generated with -fsource-location
(implied with --debug/-fec) are cut down, especially when many "simple"
statements or lot of sections/paragraphs are used; also the runtime checks
for use of LINKAGE fields and/or subscripts/reference-modification will be
much faster
much faster

* New build features

** configure now honors BDB_LIBS and BDB_CFLAGS
** configure now honors MATH_LIBS
** configure now checks for XCurses and allows --with-curses=xcurses
(experimental)
** configure now checks for PERL and passes that as default to make test
** cobc handles SOURCE_DATE_EPOCH now, allowing to override timestamps in
generated code and listing files, allowing reproducible builds

Expand Down Expand Up @@ -409,10 +416,10 @@ NEWS - user visible changes -*- outline -*-

** JSON GENERATE statement
(note: runtime support needs additional library cJSON or JSON-C)

** CONTINUE AFTER statement (COBOL 2022) implemented, also handle fractions
of seconds in C$SLEEP now

** TYPEDEF and SAME AS (COBOL 2002) implemented, including the MicroFocus
and RM/COBOL variants

Expand Down Expand Up @@ -444,7 +451,7 @@ NEWS - user visible changes -*- outline -*-
still applied;
File name mapping now applies both to COBOL statements and CALLable
CBL_ and C$ file routines.

** Screen I/O: initial mouse support (for details see runtime.cfg),
use of CURSOR clause in SPECIAL-NAMES for positioning on ACCEPT

Expand All @@ -460,7 +467,7 @@ NEWS - user visible changes -*- outline -*-
extensions [as post-rc1-change this may be set to old behavior by
defining COB_MULTI_EXTENSION when building GnuCOBOL/cobc]
* library names are now tested for environment "COB_COPY_LIB_libname",
allowing the directory to specified externally (also as no-directory
allowing the directory to specified externally (also as no-directory
by exporting with empty value) and has a fallback (with a warning) to
be effectively ignored (as previous versions did this)

Expand Down Expand Up @@ -522,24 +529,25 @@ NEWS - user visible changes -*- outline -*-

* Changes in the COBOL runtime (libcob)

** Messages from the COBOL runtime are also translated now (if installed).
To prevent this disable translations in general with using the configure
option --disable-nls (or by deactivating ENABLE_NLS in config.h).
** messages from the COBOL runtime are also translated now (if installed);
to prevent this, disable translations in general with using the configure
option --disable-nls (or by deactivating ENABLE_NLS in config.h)

** first-time file-locking under Win32

** handle CRT STATUS either numerically, alphanumerically (4 digits) or as 3
bytes according to X/Open standard, depending on format and size

** execution times of INSPECT and INITIALIZE with OCCURS were heavily cut down,
to fully benefit from this a recompile is necessary

** libcob.h does no longer auto-include gmp.h (behavior since 2.x), if you link
against libcob and need cob_decimal include gmp.h/mpir.h yourself before;
otherwise you do not need it in your include path anymore

** execution times of INSPECT and INITIALIZE with OCCURS were heavily cut down

** convenience functions for direct C access to COBOL fields and for debugging
were added, see new C-API documentation

** first-time file-locking under Win32

** handle CRT STATUS either numerically, alphanumerically (4 digits) or as 3
bytes according to X/Open standard, depending on format and size

** Breaking change: previously the return-code of registered error handlers
(by CBL_ERROR_PROC) were ignored. This was changed according to the
documentation for CBL_ERROR_PROC -> a RETURN-VALUE of ZERO skips further
Expand Down Expand Up @@ -598,7 +606,7 @@ NEWS - user visible changes -*- outline -*-

* Too many bug fixes to list here (please check ChangeLogs for full details),
includes the following CVEs:

** compiler (may be triggered with special crafted source files)
CVE-2019-14468, CVE-2019-14486, CVE-2019-14528, CVE-2019-14541,
CVE-2019-16396, CVE-2019-16395
Expand Down
7 changes: 6 additions & 1 deletion build_aux/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

2022-12-09 Simon Sobisch <[email protected]>

* create_mingw_bindist.sh: optional installation of locales and manpages;
MSYS2 builds now working with use of previously added MINGWDIR

2022-12-01 Simon Sobisch <[email protected]>

* bootstrap: drop tarstamp.h generation, done via make
Expand All @@ -14,7 +19,7 @@
2022-05-30 Simon Sobisch <[email protected]>

* create_mingw_bindist.sh: explicit call cobc.exe in the generated
set_env.cmd to allowwrapper scripts cobc.cmd/cobc.bat to call it;
set_env.cmd to allow wrapper scripts cobc.cmd/cobc.bat to call it;
add (untested) option to use this in MSYS2 builds

2022-03-29 Simon Sobisch <[email protected]>
Expand Down
104 changes: 80 additions & 24 deletions build_aux/create_mingw_bindist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

# Check we're in a MinGW environment
if test -d "$MSYSTEM_PREFIX/bin"; then
MINGWDIR="$MSYSTEM_PREFIX/bin"
MINGWDIR="$MSYSTEM_PREFIX"
echo "generating binary ${MINGW_PREFIX:1} dist package..."
elif test -d "/mingw/bin"; then
MINGWDIR="/mingw/bin"
MINGWDIR="/mingw"
echo "generating binary mingw dist package..."
else
echo "binary mingw dist packages can only be created from MSYS/MinGW or MSYS2"
Expand Down Expand Up @@ -63,7 +63,7 @@ fi

# getting version information, testing the current build works
versinfo=$($EXTBUILDDIR/pre-inst-env cobcrun -v --version | tail -n2)
versinfo_cmds=$(echo "echo. $(echo "$versinfo" | sed -e 's/^/\&\& echo /')" | tr '\n' ' ')
versinfo_cmds=$(echo "echo. $(echo "$versinfo" | sed -e 's/^/\&\& echo /')" | tr '\n' ' ')

# Create folder
echo
Expand All @@ -83,23 +83,39 @@ fi
mkdir "$target_dir" || (echo "cannot create target directory" && exit 97)
pushd "$target_dir" 1>/dev/null
if test "$target_dir" != "$(pwd)"; then
target_dir="$(pwd)"
target_dir="$(pwd)"
echo "target (resolved): $target_dir"
fi
popd 1>/dev/null

echo && echo copying MinGW files...
echo " bin..."
cp -pr "/mingw/bin" "$target_dir/"
if test -f "$MINGWDIR/mingw32/bin"; then
cp -pr "$MINGWDIR/mingw32/bin" "$target_dir/"
fi
cp -pr "$MINGWDIR/bin" "$target_dir/"
echo " include..."
cp -pr "/mingw/include" "$target_dir/"
if test -f "$MINGWDIR/mingw32/include"; then
cp -pr "$MINGWDIR/mingw32/include" "$target_dir/"
fi
cp -pr "$MINGWDIR/include" "$target_dir/"
echo " lib..."
cp -pr "/mingw/lib" "$target_dir/"
if test -f "$MINGWDIR/mingw32/lib"; then
cp -pr "$MINGWDIR/mingw32/lib" "$target_dir/"
fi
cp -pr "$MINGWDIR/lib" "$target_dir/"
echo " libexec..."
cp -pr "/mingw/libexec" "$target_dir/"
echo " share/locale..."
cp -pr "$MINGWDIR/libexec" "$target_dir/"
echo " share... (locale and friends)"
# note: possible copying more of share later
cp -pr "/mingw/share/locale" "$target_dir/"
cp -pr "$MINGWDIR/share/locale" "$target_dir/"
mkdir -p "$target_dir/share"
cp -pr "$MINGWDIR/share/gdb" "$target_dir/share/"
cp -pr "$MINGWDIR/share/gcc"* "$target_dir/share/"
cp -pr "$MINGWDIR/share/man" "$target_dir/share/"
if test -f "$MINGWDIR/share/zoneinfo"; then
cp -pr "$MINGWDIR/share/zoneinfo" "$target_dir/share/"
fi

echo && echo copying GnuCOBOL files...
cp -pr "$EXTBUILDDIR/extras" "$target_dir/"
Expand All @@ -110,7 +126,7 @@ cp -p $EXTBUILDDIR/cobc/.libs/cobc.exe "$target_dir/bin/"
cp -p $EXTBUILDDIR/bin/.libs/cobcrun.exe "$target_dir/bin/"
cp -p $EXTBUILDDIR/libcob/.libs/libcob*.dll "$target_dir/bin/"
cp -p $EXTBUILDDIR/libcob/.libs/libcob.* "$target_dir/lib/"
mkdir "$target_dir/include/libcob"
mkdir -p "$target_dir/include/libcob"
cp -p $EXTSRCDIR/libcob.h "$target_dir/include/"
cp -p $EXTSRCDIR/libcob/*.h "$target_dir/include/libcob"
cp -p $EXTSRCDIR/libcob/*.def "$target_dir/include/libcob"
Expand All @@ -134,14 +150,22 @@ sed -e 's/\r*$/\r/' "bin/ChangeLog" > "$target_dir/ChangeLog_bin.txt"
sed -e 's/\r*$/\r/' "cobc/ChangeLog" > "$target_dir/ChangeLog_cobc.txt"
sed -e 's/\r*$/\r/' "libcob/ChangeLog" > "$target_dir/ChangeLog_libcob.txt"

# copy manpages (checkme) ...
#cp bin/cobcrun.1
#cp cobc/cobc.1
##cp libcob/libcob.3
# ... and locales
if test -f "$EXTBUILDDIR/cobc/cobc.1"; then
echo && echo installing manpages...
make -C "$EXTBUILDDIR/bin" install-man1 datarootdir="$target_dir/share"
make -C "$EXTBUILDDIR/cobc" install-man1 datarootdir="$target_dir/share"
#make -C "$EXTBUILDDIR/libcob" install-man3 datarootdir="$target_dir/share"
else
echo "WARNING: GnuCOBOL manpages not found!"
fi

echo && echo installing locales...
make -C "$EXTBUILDDIR/po" install-data-yes localedir="$target_dir/locale"
# note: locales are configured to be created in the srcdir
if test -f "$EXTSRCDIR/po/fr.po"; then
echo && echo installing locales...
make -C "$EXTBUILDDIR/po" install-data-yes datarootdir="$target_dir"
else
echo "WARNING: GnuCOBOL locales not found!"
fi

popd 1>/dev/null

Expand Down Expand Up @@ -191,7 +215,7 @@ cat > "$target_dir/set_env.cmd" << _FEOF
@echo off
:: Check if called already
:: if yes, check if called from here - exit, in any other case
:: if yes, check if called from here - exit, in any other case
:: raise warning and reset env vars
if not "%COB_MAIN_DIR%" == "" (
echo.
Expand All @@ -202,7 +226,7 @@ if not "%COB_MAIN_DIR%" == "" (
goto :cobcver
) else (
echo Warning: batch was called before from "%COB_MAIN_DIR%"
echo resetting COB_CFLAGS, COB_LDFLAGS
echo resetting COB_CFLAGS, COB_LDFLAGS
set "COB_CFLAGS="
set "COB_LDLAGS="
)
Expand All @@ -226,6 +250,11 @@ set "PATH=%COB_MAIN_DIR%bin;%PATH%"
:: Locales
set "LOCALEDIR=%COB_MAIN_DIR%locale"
:: Timezone database
if exist "%COB_MAIN_DIR%share\zoneinfo" (
set "TZDIR=%COB_MAIN_DIR%share\zoneinfo"
)
:: start executable as requested
:call_if_needed
if not [%1] == [] (
Expand All @@ -236,8 +265,8 @@ if not [%1] == [] (
goto :eof
)
:: new cmd to stay open if not started directly from cmd.exe window
echo %cmdcmdline% | find /i "%~0" >nul
:: new cmd to stay open if not started directly from cmd.exe window
echo %cmdcmdline% | %windir%\system32\find.exe /i "%~0" >nul
if %errorlevel% equ 0 (
cmd /k "cobc.exe --version && $versinfo_cmds"
goto :eof
Expand Down Expand Up @@ -280,14 +309,41 @@ same source tarball don't have.
Important: See BUGS.txt for possible known issues in this distribution!
For running GnuCOBOL simply double-click set_env.cmd found next to this file, or,
if already in cmd, call setenv.cmd once.
You can use cobc/cobcrun in the command prompt afterwards.
if already in cmd, call set_env.cmd once.
You can use cobc and cobcrun in the command prompt afterwards.
_FEOF
} >> "$target_dir/README.txt"
sed -i 's/$/\r/' "$target_dir/README.txt"


echo && echo removing some unneeded files
pushd "$target_dir/bin" 1>/dev/null
rm -rf auto*
rm -rf aclocal*

# Note: perl may be used in the distribution for
# test coverage via lcov, so leave in
#rm -rf *perl*
cd ../lib 1>/dev/null
#rm -rf *perl*

rm -rf *.la

rm -rf terminfo*

rm -rf tcl*
rm -rf tkl*
rm -rf tdbc*

rm -rf cmake*
rm -rf pkgconfig*

cd .. 1>/dev/null
rm -rf libexec/mingw-get
popd 1>/dev/null


echo && echo duplicating for debug version...
cp -rp "$target_dir" "$target_dir"_dbg

Expand Down
4 changes: 2 additions & 2 deletions build_windows/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ How to test the native builds:
* currently you will need a GNU/Linux-like environment for running the
testsuite (normally MinGW with MSYS, MSYS2 or Cygwin)
* if you want to run the NIST testsuite you need a perl binary installed and
in PATH
either as "perl" (.exe/.cmd/.bat) in PATH or specify it via PERL variable
* if you've set MAKE_DIST in config.h copy the dist package to the place
cobc --info says (for example to C:\GnuCOBOL_3.1)
cobc --info says (for example to C:\GnuCOBOL_3.x)
* start the VS command prompt that matches the version you want to test
* do the following commands:
set COB_UNIX_LF=YES
Expand Down
Loading

0 comments on commit fe93f0d

Please sign in to comment.