Commit af9f4b81 authored by rdubner's avatar rdubner
Browse files

Fixed merge conflicts; scripting for MSYS2 build

parents ac5287a3 f754769e
......@@ -62,6 +62,10 @@ if uname | grep -q MINGW64_NT ; then
os_name=MINGW64_NT
fi
if uname | grep -q MSYS_NT ; then
os_name=MSYS_NT
fi
# Courtesy of stackoverflow, a script to find the directory of the script
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do # resolve $SOURCE until the file is no longer a symlink
......@@ -431,7 +435,7 @@ if test X$result = X"0" ; then
fi
$GCC -shared -o $TARGET $BASENAME-2.o $BASENAME.sym.o -lcob $POSTOPTIONS
if test X$os_name = X"MINGW32_NT" || test X$os_name = X"MINGW64_NT" ; then
if test X$os_name = X"MINGW32_NT" || test X$os_name = X"MINGW64_NT" || test X$os_name = X"MSYS_NT" ; then
mv $TARGET $BASENAME.dll
fi
fi
......@@ -441,7 +445,7 @@ if test X$result = X"0" ; then
## if it is necessary:
if test X$result = X"0" ; then
if test X$os_name = X"MINGW32_NT" || test X$os_name = X"MINGW64_NT" ; then
if test X$os_name = X"MINGW32_NT" || test X$os_name = X"MINGW64_NT" || test X$os_name = X"MSYS_NT" ; then
if test -f $DIR/cprint.py ; then
cp $DIR/cprint.py ./$BASENAME-gdb.py
elif test -f $DIR/python/cprint.py ; then
......
......@@ -5,5 +5,5 @@ clean :
rm -fr gnucobol
rm -fr pkg
rm -fr src
rm *.log
rm *.zst
rm -fr *.log
rm -fr *.zst
......@@ -13,10 +13,10 @@
## and with nothing else, in order to keep the size down as much as
## possible.
##
echo "Remove old /c/msys64-clean...
echo "Remove old /c/msys64-clean..."
rm -fr /c/msys64-clean
copy /c/msys64 to /c/msys64-clean...
cp -r /c/msys64 /c/msys64-clean
echo "copy /c/msys64 to /c/msys64-clean..."
cp -rv /c/msys64 /c/msys64-clean
## Install the prerequisites for the GnuCOBOL package build
......@@ -49,7 +49,6 @@ export COB_CONFIG_DIR='C:\msys64\mingw32\share\gnucobol\config'
export COB_COPY_DIR='C:\msys64\mingw32\share\gnucobol\copy'
export COB_LIBRARY_PATH='C:\msys64\mingw32\lib\gnucobol'
## With the GnuCOBOL package installed, we can build the cbl-gdb toolchain
cd ..
make clean
......
#!/bin/sh
## This routine expects to be running in a folder named
##
## ~/builds/cblgdb/cblgdb-latest/msys2
##
## It also expects to be running in a brand-spanking new instance of
## c:\msys64, one that has been updated with
##
## pacman -Syu pacman
## pacman -Su
##
## and with nothing else, in order to keep the size down as much as
## possible.
##
## It's to be run after ./phase1 has executed, and immediately after
## that environment was renamed to c:\msys64-build
##
## We first install the GnuCOBOL i686 package here, and we tack on
## gdb.
##
## We then create a target folder c:\cblgdb and we copy a subset of
## files from here to there.
##
## Install the GnuCOBOL i686 package from the place where we just build it
##
pacman --noconfirm -U $(ls -t --color=never \
~/builds/cblgdb/cblgdb-latest/msys2/mingw-w64-i686-gnucobol*.zst | head -n 1)
##
## We also need the i686 gdb package:
##
pacman --noconfirm -S mingw-w64-i686-gdb
##
## Copy over the cbl-gdb executables and scripts from the place where
## we built them:
##
cp /c/msys64-build/usr/local/bin/cobcd /mingw32/bin
cp /c/msys64-build/usr/local/bin/cobcd.bat /mingw32/bin
cp /c/msys64-build/usr/local/bin/cobst.exe /mingw32/bin
cp /c/msys64-build/usr/local/bin/cprint.py /mingw32/bin
cp /c/msys64-build/usr/local/bin/sfix.exe /mingw32/bin
##
## This c:\msys64 now has everything it needs to run debuggable
## GnuCOBOL. We probably never will.
##
## It's time to spawn c:\cblgdb from us:
##
rm -fr /c/cblgdb
mkdir -p /c/cblgdb/share/gnucobol/
mkdir -p /c/cblgdb/lib/
cp -r /mingw32/bin/ /c/cblgdb/bin/
cp -r /mingw32/i686-w64-mingw32/ /c/cblgdb/i686-w64-mingw32/
cp -r /mingw32/share/gdb/ /c/cblgdb/share/gdb/
cp -r /mingw32/share/gnucobol/config/ /c/cblgdb/share/gnucobol/config/
cp -r /mingw32/share/gnucobol/copy/ /c/cblgdb/share/gnucobol/copy/
cp /mingw32/lib/* /c/cblgdb/lib/ 2>/dev/nul
cp -r /mingw32/lib/gcc/ /c/cblgdb/lib/gcc/
cp -r /mingw32/include/ /c/cblgdb/include/
cp -r ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/extras/ /c/cblgdb/extras/
cp -r /mingw32/lib/python3.8/ /c/cblgdb/lib/python3.8/
rm /c/cblgdb/include/autosp*
mkdir -p /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/AUTHORS /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/ChangeLog /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/COPYING /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/COPYING.DOC /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/COPYING.LESSER /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/README /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/src/gnucobol/THANKS /c/cblgdb/license/
cp ~/builds/cblgdb/cblgdb-latest/msys2/README.txt /c/cblgdb/
......@@ -24,6 +24,10 @@ cp -r $CWD/ cblgdb-$VERSION/
tar --exclude=.git --exclude=.legacy -czf cblgdb-$VERSION.tar.gz cblgdb-$VERSION
## Make a copy of the tarball, with "latest" in place of the version
cp cblgdb-$VERSION.tar.gz cblgdb-latest.tar.gz
## Make an "alpha" copy, which is used for internal builds that might
## not yet be releasable. This is used by the centos, debian, and arm
## packaging routines.
cp cblgdb-$VERSION.tar.gz cblgdb-latest-alpha.tar.gz
## Get rid of the extra directory
rm -fr cblgdb-$VERSION/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment