diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index a8851be51..966c40485 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -1,4 +1,4 @@
-name: MacOS
+name: MacOS Workflow
 
 on:
   pull_request:
@@ -12,28 +12,32 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os:
-          # - macos-latest-large  # macos 14, amd64
-          - macos-latest        # macos 14, arm64
         isam:
           - db
           - visam
-
-    runs-on: ${{ matrix.os }}
+    #runs-on: macos-latest-large  # macos 14, amd64
+    runs-on: macos-latest        # macos 14, arm64
+    timeout-minutes: 10
 
     steps:
 
-      - name: Configure git
-        run: git config --global core.symlinks false
-
       - name: Set git user
         run: |
           git config --global user.name github-actions
           git config --global user.email github-actions-bot@users.noreply.github.com
 
+      - name: Configure git
+        run: git config --global core.symlinks false
+
       - name: Checkout code
         uses: actions/checkout@v4
 
+      - name: Setup build environment
+        run: |
+          echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
+          export TERM="vt100"
+          echo "TERM=$TERM" >> $GITHUB_ENV
+
       - name: Install packages
         run: |
           brew install pkg-config automake libtool help2man texinfo bison berkeley-db@4 json-c
@@ -43,7 +47,7 @@ jobs:
           echo "LDFLAGS=-L$opt/berkeley-db@4/lib ${LDFLAGS}" >> $GITHUB_ENV
           echo "CPPFLAGS=-I$opt/berkeley-db@4/include ${CPPFLAGS}" >> $GITHUB_ENV
 
-      - name: Installing VISAM prerequisite
+      - name: Install VISAM prerequisite
         if: ${{ matrix.isam == 'visam' }}
         run: |
           wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
@@ -57,19 +61,13 @@ jobs:
           echo "LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
           echo "LD_LIBRARY_PATH=/usr/local/visam-2.2/lib" >> $GITHUB_ENV
 
-      - name: bootstrap
+      - name: Bootstrap
         run: |
           ./build_aux/bootstrap install
 
-      - name: Build environment setup
+      - name: Configure
         run: |
           mkdir _build
-          echo "NPROC=`sysctl -n hw.ncpu`" >> $GITHUB_ENV
-          export TERM="vt100"
-          echo "TERM=$TERM" >> $GITHUB_ENV
-
-      - name: configure
-        run: |
           cd _build
           export CPPFLAGS="-DREAD_WRITE_NEEDS_FLUSH $CPPFLAGS"
           export CFLAGS="-Wno-unused-command-line-argument -Wno-deprecated-non-prototype -Wno-parentheses-equality $CFLAGS"
@@ -77,34 +75,35 @@ jobs:
                        --with-indexed=${{ matrix.isam }} \
                        --enable-cobc-internal-checks \
                        --enable-hardening \
+                       --with-curses=ncurses \
                        --prefix /opt/cobol/gnucobol
 
-      - name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
-        uses: actions/upload-artifact@v4
+      - name: Build
+        run: |
+          make -C _build --jobs=$((${NPROC}+1))
+
+      - name: Upload config-${{ matrix.isam }}.log
         if: failure()
+        uses: actions/upload-artifact@v4
         with:
-          name: config-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: config-${{ matrix.isam }}.log
           path: _build/config.log
 
-      - name: make
-        run: |
-          make -C _build --jobs=$((${NPROC}+1))
-
-      # make install must be done before make check, otherwis
+      # make install must be done before make check, otherwise
       # execution of generated COBOL files fail for a missing
       # /usr/local/lib/libcob.dylib
-      - name: make install
+      - name: Install GnuCOBOL
         run: |
           sudo make -C _build install
           find /opt/cobol > _build/install.log
 
-      - name: Upload install-${{ matrix.os }}-${{ matrix.isam }}.log
+      - name: Upload install-${{ matrix.isam }}.log
         uses: actions/upload-artifact@v4
         with:
-          name: install-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: install-${{ matrix.isam }}.log
           path: _build/install.log
 
-      - name: check
+      - name: Run testsuite
         run: |
           sed -i '' '/AT_SETUP(\[INDEXED file SUPPRESS WHEN ALL \+ KEYCHECK\])/a\
           AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
@@ -116,14 +115,14 @@ jobs:
           AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
           sed -i '' '/AT_SETUP(\[trace feature with indexed EXTFH\])/a\
           AT_SKIP_IF(\[true\])' tests/testsuite.src/run_file.at
-          make -C _build check \
-                         TESTSUITEFLAGS="--jobs=$((${NPROC}+1))"
+          make -C _build check TESTSUITEFLAGS="--jobs=$((${NPROC}+1))" || \
+          make -C _build check TESTSUITEFLAGS="--recheck --verbose"
 
-      - name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+      - name: Upload testsuite-${{ matrix.isam }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
-        if: failure()
         with:
-          name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: testsuite-${{ matrix.isam }}.log
           path: _build/tests/testsuite.log
 
       - name: Cache newcob.val
@@ -131,10 +130,21 @@ jobs:
         with:
           path: _build/tests/cobol85/newcob.val
           key: newcob-val
-          save-always: true
           enableCrossOsArchive: true
 
-      - name: NIST85 Test Suite
+      - name: Run NIST85 testsuite
         run: |
-          make -C _build/tests/cobol85 EXEC85 test              \
-                         --jobs=$((${NPROC}+1))
+          make -C _build/tests test --jobs=$((${NPROC}+1))
+
+      - name: Upload NIST85 Test Suite results
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: NIST85 results on ${{ matrix.isam }}
+          path: |
+            _build/tests/cobol85/summary.*
+            _build/tests/cobol85/**/*.log
+            _build/tests/cobol85/**/*.out
+            _build/tests/cobol85/**/duration.txt
+
+# + add packaging
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 002f0a33c..53446521e 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -1,4 +1,4 @@
-name: Ubuntu
+name: Build, Test and provide Nightly (Ubuntu + MSYS1)
 
 on:
   pull_request:
@@ -13,13 +13,11 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os:
-          - ubuntu-latest
         isam:
           - db
           - visam
-
-    runs-on: ${{ matrix.os }}
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
 
     steps:
 
@@ -31,13 +29,32 @@ jobs:
       - name: Checkout code
         uses: actions/checkout@v4
 
+      # FIXME: With TERM="dumb" `make check` fails with:
+      # ...
+      # 571: ACCEPT OMITTED (SCREEN)                         FAILED (run_accept.at:307)
+      # ...
+      # 693: ON EXCEPTION clause of DISPLAY                  FAILED (run_misc.at:6335)
+      # 695: LINE/COLUMN 0 exceptions                        FAILED (run_misc.at:6414)
+      # 694: EC-SCREEN-LINE-NUMBER and -STARTING-COLUMN      FAILED (run_misc.at:6376)
+      # ...
+      # Failure cases read: "Error opening terminal: unknown." on
+      # stderr, and exit with code 1.
+      #
+      # Another alternative is passing `--with-curses=no` to the
+      # configure script, yet distcheck does call configure too...
+      #
+      - name: Setup build environment
+        run: |
+          export TERM="vt100"
+          echo "TERM=$TERM" >> $GITHUB_ENV
+
       - name: Install packages
         run: |
-          sudo apt-get update
-          sudo apt-get install automake libtool libdb5.3-dev libxml2-dev libcjson-dev \
-                               bison flex help2man gettext texlive autopoint
+          sudo apt -y update
+          sudo apt -y install automake autopoint libtool libdb5.3-dev libxml2-dev \
+                              libcjson-dev bison flex help2man gettext texlive
 
-      - name: Installing VISAM prerequisite
+      - name: Install VISAM prerequisite
         if: ${{ matrix.isam == 'visam' }}
         run: |
           wget http://inglenet.ca/Products/GnuCOBOL/visam-2.2.tar.Z
@@ -54,49 +71,27 @@ jobs:
         run: |
           ./build_aux/bootstrap install
 
-      # FIXME: With TERM="dumb" `make check` fails with:
-      # ...
-      # 571: ACCEPT OMITTED (SCREEN)                         FAILED (run_accept.at:307)
-      # ...
-      # 693: ON EXCEPTION clause of DISPLAY                  FAILED (run_misc.at:6335)
-      # 695: LINE/COLUMN 0 exceptions                        FAILED (run_misc.at:6414)
-      # 694: EC-SCREEN-LINE-NUMBER and -STARTING-COLUMN      FAILED (run_misc.at:6376)
-      # ...
-      # Failure cases read: "Error opening terminal: unknown." on
-      # stderr, and exit with code 1.
-      #
-      # Another alternative is passing `--with-curses=no` to the
-      # configure script, yet distcheck does call configure too...
-      #
-      - name: Build environment setup
-        run: |
-          mkdir _build
-          export TERM="vt100"
-          echo "TERM=$TERM" >> $GITHUB_ENV
-          echo "INSTALL_PATH=$(pwd)/_install" >> $GITHUB_ENV
-
       - name: Configure
         run: |
+          mkdir _build
           cd _build
           ../configure --with-${{ matrix.isam }} \
                        --with-indexed=${{ matrix.isam }} \
                        --enable-cobc-internal-checks \
-                       --enable-hardening \
-                       --prefix ${INSTALL_PATH}
-          echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" \
-            >> $GITHUB_ENV
-
-      - name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
-        uses: actions/upload-artifact@v4
-        if: failure()
-        with:
-          name: config-${{ matrix.os }}-${{ matrix.isam }}.log
-          path: _build/config.log
+                       --enable-hardening
+          echo "VERSION=PACKAGE_VERSION" | cpp -P -imacros config.h | tr -d \" >> $GITHUB_ENV
 
       - name: Build
         run: |
           make -C _build --jobs=$(($(nproc)+1))
 
+      - name: Upload config-${{ matrix.isam }}.log
+        if: failure()
+        uses: actions/upload-artifact@v4
+        with:
+          name: config-${{ matrix.isam }}.log
+          path: _build/config.log
+
       # note: distcheck also creates the dist tarball
       - name: Build distribution archive & run tests
         run: |
@@ -105,91 +100,209 @@ jobs:
                          --jobs=$(($(nproc)+1)) ||                \
           make -C _build/gnucobol-$VERSION/_build/sub/tests check \
                          TESTSUITEFLAGS="--recheck --verbose"
+          make -C _build --jobs=$(($(nproc)+1)) dist DIST_TARGETS="dist-gzip distwin-zip"
+          make -C _build --jobs=$(($(nproc)+1)) distbin DISTBIN_TARGETS="distbin-xz"
 
-      - name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+      - name: Upload testsuite-${{ matrix.isam }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
-        if: failure()
         with:
           # Assume there's only one directory matching `_build/gnucobol-*`:
-          name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: testsuite-${{ matrix.isam }}.log
           path: _build/gnucobol-${{ env.VERSION }}/_build/sub/tests/testsuite.log
 
       - name: Upload dist tarball
+        if: ${{ matrix.isam != 'visam' }}
         uses: actions/upload-artifact@v4
         with:
-          name: gnucobol-ci source distribution (${{ matrix.isam }})
-          path: _build/gnucobol*.tar*
+          name: gnucobol-ci source distribution
+          path: _build/gnucobol*.tar.gz
           if-no-files-found: error
           retention-days: 0
 
+      - name: Upload dist tarball (Windows)
+        if: ${{ matrix.isam != 'visam' }}
+        uses: actions/upload-artifact@v4
+        with:
+          name: gnucobol-ci windows source distribution
+          path: _build/gnucobol*.zip
+          if-no-files-found: error
+          retention-days: 0
+
+      - name: Upload test binaries
+        if: ${{ matrix.isam != 'visam' }}
+        uses: actions/upload-artifact@v4
+        with:
+          name: gnucobol-ci binary distribution
+          path: _build/gnucobol*.tar.xz
+          if-no-files-found: error
+          retention-days: 0
+
+      - name: Cache newcob.val
+        uses: actions/cache@v4
+        with:
+          path: _build/tests/cobol85/newcob.val
+          key: newcob-val
+          enableCrossOsArchive: true
+
+      - name: Run NIST85 testsuite
+        run: |
+          make -C _build/tests/cobol85 EXEC85 test --jobs=$(($(nproc)+1))
+
+#         make -C _build/tests test --jobs=$(($(nproc)+1))
+
+      - name: Upload NIST85 Test Suite results
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: NIST85 results on ${{ matrix.isam }}
+          path: |
+            _build/tests/cobol85/summary.*
+            _build/tests/cobol85/**/*.log
+            _build/tests/cobol85/**/*.out
+            _build/tests/cobol85/**/duration.txt
+
+
+  minmal_build:
+    name: Build and test with minimal dependencies
+    strategy:
+      fail-fast: true
+    needs: build
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+
+    steps:
+
+      - name: Get CI dist tarball
+        uses: actions/download-artifact@v4
+        with:
+          name: gnucobol-ci source distribution
+
+      - name: Extract CI dist tarball
+        run: |
+          tar -xvf gnucobol*.tar.* --strip-components=1
+
+      - name: Install packages
+        run: |
+          sudo apt -y update
+          sudo apt -y install build-essential libgmp-dev
+          sudo apt -y remove bison flex
+
+      - name: Configure
+        run: |
+          mkdir _build
+          cd _build
+          ../configure --disable-dependency-tracking \
+                       --without-db --without-curses \
+                       --without-xml2 --without-json \
+                       --without-iconv --disable-nls
+
+      - name: Build
+        run: |
+          make -C _build --jobs=$(($(nproc)+1))
+
+      - name: Upload config-minimal.log
+        if: failure()
+        uses: actions/upload-artifact@v4
+        with:
+          name: config-minimal.log
+          path: _build/config.log
+
+      - name: Run testsuite
+        run: |
+          make -C _build check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
+          make -C _build check TESTSUITEFLAGS="--recheck --verbose"
+
+      - name: Upload testsuite-minimal.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: testsuite-minimal.log
+          path: _build/tests/testsuite.log
+
       - name: Cache newcob.val
         uses: actions/cache@v4
         with:
           path: _build/tests/cobol85/newcob.val
           key: newcob-val
-          save-always: true
           enableCrossOsArchive: true
 
-      - name: NIST85 Test Suite
+      - name: Run NIST85 testsuite
         run: |
-          make -C _build/tests/cobol85 EXEC85 test \
-                                       --jobs=$(($(nproc)+1))
+          make -C _build/tests/cobol85 EXEC85 test --jobs=$(($(nproc)+1))
+
+#         make -C _build/tests test --jobs=$(($(nproc)+1))
 
       - name: Upload NIST85 Test Suite results
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
         with:
-          name: NIST85 results on ${{ matrix.os }} (${{ matrix.isam }})
+          name: NIST85 results on minimal
           path: |
+            _build/tests/cobol85/summary.*
             _build/tests/cobol85/**/*.log
             _build/tests/cobol85/**/*.out
+            _build/tests/cobol85/**/duration.txt
 
 
   coverage:
     name: Coverage and Warnings
+    needs: build
+# Since the latest Ubuntu image, lcov fails complaining about negative branch counts,
+# and using fprofile-update=atomic as suggested does not help, so use the previous image
+#    runs-on: ubuntu-latest
     runs-on: ubuntu-22.04
+    timeout-minutes: 10
 
     steps:
-      - name: Checkout code
-        uses: actions/checkout@v4
 
-      # note: less dependencies as we don't generate a dist tarball, one additional for lcov
-      - name: Install dependencies
-        run: |
-          sudo apt-get install automake libtool libdb5.3-dev libxml2-dev \
-                       libcjson-dev bison flex help2man gettext lcov autopoint
+      # - name: Checkout code
+      #   uses: actions/checkout@v4
 
-      - name: Bootstrap
+      - name: Get CI dist tarball
+        uses: actions/download-artifact@v4
+        with:
+          name: gnucobol-ci source distribution
+
+      - name: Extract CI dist tarball
         run: |
-          ./build_aux/bootstrap install
+          tar -xvf gnucobol*.tar.* --strip-components=1
 
-      - name: Build environment setup
+      - name: Setup build environment
         run: |
-          mkdir _build
           export TERM="vt100"
           echo "TERM=$TERM" >> $GITHUB_ENV
 
-      # note: w add additional C compiler syntax checks here to not need
+      # note: less dependencies as we don't generate a dist tarball, one additional for lcov
+      - name: Install dependencies
+        run: |
+          sudo apt -y install libtool libdb5.3-dev libxml2-dev \
+                      libcjson-dev lcov help2man gettext
+
+      # note: add additional C compiler syntax checks here to not need
       # _another_ CI run
       #
       # TODO: try and pass -pedantic via CPPFLAGS
       - name: Configure
         run: |
+          mkdir _build
           cd _build
           ../configure --enable-code-coverage \
+                       --with-db --with-xml2 --with-json=cjson --with-curses=ncursesw \
                        CPPFLAGS="-Werror=declaration-after-statement" \
                        CC="gcc -std=c89"
 
-      - name: Upload config-${{ matrix.os }}-${{ matrix.isam }}.log
-        uses: actions/upload-artifact@v4
-        if: failure()
-        with:
-          name: config-${{ matrix.os }}-${{ matrix.isam }}.log
-          path: _build/config.log
-
       - name: Build
         run: |
           make -C _build --jobs=$(($(nproc)+1))
 
+      - name: Upload config-coverage.log
+        if: failure()
+        uses: actions/upload-artifact@v4
+        with:
+          name: config-coverage.log
+          path: _build/config.log
+
       - name: Coverage
         run: |
           # make -C _build check-code-coverage # <- (ignores errors)
@@ -198,17 +311,17 @@ jobs:
           make -C _build code-coverage-capture \
                          CODE_COVERAGE_DIRECTORY="$(realpath .)/_build"
 
-      - name: Upload testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+      - name: Upload testsuite-coverage.log
+        if: ${{ ! cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
-        if: failure()
         with:
-          name: testsuite-${{ matrix.os }}-${{ matrix.isam }}.log
+          name: testsuite-coverage.log
           path: _build/tests/testsuite.log
 
       - name: Upload coverage report
         uses: actions/upload-artifact@v4
         with:
-          name: coverage-${{ matrix.os }}-${{ matrix.isam }}
+          name: coverage
           path: _build/GnuCOBOL-**-coverage/
 
       - name: Cache newcob.val
@@ -216,7 +329,6 @@ jobs:
         with:
           path: _build/tests/cobol85/newcob.val
           key: newcob-val
-          save-always: true
           enableCrossOsArchive: true
 
       - name: Extended coverage
@@ -232,7 +344,7 @@ jobs:
       - name: Upload extended coverage report
         uses: actions/upload-artifact@v4
         with:
-          name: extended-coverage-${{ matrix.os }}-${{ matrix.isam }}
+          name: extended-coverage
           path: _build/extended-coverage
 
       - name: Upload coverage to codecov
@@ -243,3 +355,324 @@ jobs:
           # Shall fail until we have a working account on codecov.io
           fail_ci_if_error: false # optional (default = false)
           verbose: true # optional (default = false)
+
+
+  msys_build_test_createdist:
+
+    needs: build
+    runs-on: windows-latest
+    timeout-minutes: 25
+
+    env:
+      MSYS_ROOT: C:\MinGW
+      MSYS_BIN: C:\MinGW\msys\1.0\bin
+      #BISON_PKGDATADIR: C:\MinGW\share\bison
+
+      #M4: m4
+
+      MSYSTEM: MINGW32
+      MSYSPKGS: msys-m4 msys-coreutils msys-patch
+      #MSYSPKGS: msys-m4 msys-flex msys-coreutils msys-help2man
+
+      #MINGW_BISON_VERS: bison-3.0.1
+      MINGW_GMP_VERS: gmp-6.3.0
+      MINGW_BDB_VERS: db-6.0.19.NC
+      MINGW_PDCM_VERS: 4.4.0
+      MINGW_CJSON_VERS: 1.7.18
+      MINGW_XML2_VERS: 2.8.0
+
+    defaults:
+      run:
+        shell: cmd
+
+    strategy:
+      fail-fast: false
+      matrix:
+        target:
+          - debug
+          - release
+
+    steps:
+
+      - name: Get CI dist tarball
+        uses: actions/download-artifact@v4
+        with:
+          name: gnucobol-ci source distribution
+
+      - name: Extract CI dist tarball
+        run: |
+          bash -lc "tar -xvf gnucobol*.tar.* --strip-components=1"
+
+      - name: Setup build environment
+        shell: pwsh
+        run: |
+          echo HOME=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV
+          echo PATH="$env:MSYS_BIN;$env:PATH" >> $env:GITHUB_ENV
+          If ("${{ matrix.target }}" -eq "release") {
+            echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV
+            echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS" >> $env:GITHUB_ENV
+          } Else {
+            echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV
+            echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
+          }
+
+      - name: Restore MSYS1 cache
+        id: restore-msys
+        uses: actions/cache/restore@v4
+        with:
+          key: cache-msys-${{ matrix.target }}
+          path: ${{ env.MSYS_ROOT }}
+
+      - name: Install MSYS1
+        if: steps.restore-msys.outputs.cache-hit != 'true'
+        run: |
+          curl -O https://www.arnoldtrembley.com/MinGW-bkup02.7z
+          7z x MinGW-bkup02.7z -o%MSYS_ROOT%\
+
+      - name: Install MSYS1 packages
+        if: steps.restore-msys.outputs.cache-hit != 'true'
+        run: |
+          where bash
+          bash -lc "env"
+          bash -lc "mingw-get install %MSYSPKGS%"
+
+      - name: Cleanup MSYS1 env
+        if: steps.restore-msys.outputs.cache-hit != 'true'
+        run: |
+          rmdir /Q /S %MSYS_ROOT%\docs
+          rmdir /Q /S %MSYS_ROOT%\var
+          del /Q %MSYS_ROOT%\bin\gdb.exe
+
+      - name: Save MSYS1 cache
+        if: steps.restore-msys.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: cache-msys-${{ matrix.target }}
+          path: ${{ env.MSYS_ROOT }}
+
+
+      - name: Restore GMP cache
+        id: restore-gmp
+        uses: actions/cache/restore@v4
+        with:
+          key: cache-msys-gmp-${{ matrix.target }}
+          path: ${{ env.MINGW_GMP_VERS }}
+
+      - name: Build GMP
+        if: steps.restore-gmp.outputs.cache-hit != 'true'
+        run: |
+          rem note: MSYS1 cannot connect to https://gmplib.org, so using GNU mirror side instead
+          curl -L https://ftp.gnu.org/gnu/gmp/%MINGW_GMP_VERS%.tar.xz -o %MINGW_GMP_VERS%.tar.xz
+          tar -xvf %MINGW_GMP_VERS%.tar.xz
+          bash -lc "cd %MINGW_GMP_VERS% && ./configure --prefix=/mingw --enable-fat --enable-shared --disable-static CFLAGS=\"-Wno-attributes -Wno-ignored-attributes\" ABI=32 && make --jobs=$(($(nproc)+1))"
+
+      - name: Install GMP
+        run: |
+          bash -lc "make -C %MINGW_GMP_VERS% install"
+
+      - name: Save GMP cache
+        if: steps.restore-gmp.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: cache-msys-gmp-${{ matrix.target }}
+          path: ${{ env.MINGW_GMP_VERS }}
+
+
+      - name: Restore BDB cache
+        id: restore-bdb
+        uses: actions/cache/restore@v4
+        with:
+          key: cache-msys-bdb-${{ matrix.target }}
+          path: ${{ env.MINGW_BDB_VERS }}
+
+      - name: Build BDB
+        if: steps.restore-bdb.outputs.cache-hit != 'true'
+        run: |
+          curl -L https://download.oracle.com/berkeley-db/%MINGW_BDB_VERS%.tar.gz -o %MINGW_BDB_VERS%.tar.gz
+          curl -L https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-db/0001-db-tls-m4-fix-pthread.patch -o db-tls-m4-fix-pthread.patch
+          curl -L https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-db/mingw.patch -o mingw.patch
+          curl -L https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-db/cclang_cxx_11.patch -o cx11.patch
+          tar -xvf %MINGW_BDB_VERS%.tar.gz
+          sed -i 's/_tcsclen/_mbslen/' %MINGW_BDB_VERS%\src\os_windows\os_stat.c
+          bash -lc "cd %MINGW_BDB_VERS% && /bin/patch -p1 -i ../db-tls-m4-fix-pthread.patch"
+          bash -lc "cd %MINGW_BDB_VERS% && /bin/patch -p1 -i ../mingw.patch"
+          bash -lc "cd %MINGW_BDB_VERS% && /bin/patch -p1 -i ../cx11.patch"
+          bash -lc "cd %MINGW_BDB_VERS%/build_unix && ../dist/configure --prefix=/mingw --enable-mingw --enable-debug --disable-static --disable-replication --disable-tcl --without-cryptography LIBCSO_LIBS=-lwsock32 && make  --jobs=$(($(nproc)+1))"
+
+# || make"
+
+      - name: Install BDB
+        run: |
+          bash -lc "make -C %MINGW_BDB_VERS%/build_unix install"
+
+      - name: Save BDB cache
+        if: steps.restore-bdb.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: cache-msys-bdb-${{ matrix.target }}
+          path: ${{ env.MINGW_BDB_VERS }}
+
+
+      - name: Restore LibXML2 cache
+        id: restore-xml2
+        uses: actions/cache/restore@v4
+        with:
+          key: cache-msys-xml2-${{ matrix.target }}
+          path: libxml2-${{ env.MINGW_XML2_VERS }}
+
+      - name: Build LibXML2
+        if: steps.restore-xml2.outputs.cache-hit != 'true'
+        run: |
+          curl -L https://github.com/GNOME/libxml2/archive/refs/tags/v%MINGW_XML2_VERS%.tar.gz -o libxml2-%MINGW_XML2_VERS%.tar.xz
+          tar -xvf libxml2-%MINGW_XML2_VERS%.tar.xz
+          bash -lc "cd libxml2-%MINGW_XML2_VERS% && ./autogen.sh"
+          bash -lc "cd libxml2-%MINGW_XML2_VERS% && ./configure --prefix=/mingw --enable-debug && make --jobs=$(($(nproc)+1))"
+
+      - name: Install LibXML2
+        run: |
+          bash -lc "cd libxml2-%MINGW_XML2_VERS% && make install"
+
+      - name: Save LibXML2 cache
+        if: steps.restore-xml2.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: cache-msys-xml2-${{ matrix.target }}
+          path: libxml2-${{ env.MINGW_XML2_VERS }}
+
+
+      - name: Restore PDCursesMod cache
+        id: restore-pdcm
+        uses: actions/cache/restore@v4
+        with:
+          key: cache-msys-pdcm-${{ matrix.target }}
+          path: PDCursesMod-${{ env.MINGW_PDCM_VERS }}
+
+      - name: Build PDCurses
+        if: steps.restore-pdcm.outputs.cache-hit != 'true'
+        run: |
+          curl -L https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v%MINGW_PDCM_VERS%.tar.gz -o "PDCursesMod-%MINGW_PDCM_VERS%.tar.xz"
+          tar -xvf PDCursesMod-%MINGW_PDCM_VERS%.tar.xz
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && make -C wincon --jobs=$(($(nproc)+1)) INFOEX=N CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && make -C wingui --jobs=$(($(nproc)+1)) CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && make -C vt     --jobs=$(($(nproc)+1)) CHTYPE_64=Y DEBUG=Y DLL=Y DLLNAME=libpdcurses LIBNAME=libpdcurses.dll CFLAGS=\"-Wall -Wextra -pedantic -g -DPDCDEBUG -fPIC -DPDC_DLL_BUILD\""
+          rem: only works this way on cmd
+          echo #define CHTYPE_64 > PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h
+          echo #define PDC_DLL_BUILD >> PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h
+          echo #include "pdcurses/curses.h" >> PDCursesMod-%MINGW_PDCM_VERS%\pdcurses.h
+
+      - name: Install PDCursesMod
+        run: |
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll.a /mingw/lib/"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll /mingw/bin/"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wincon/libpdcurses.dll /mingw/bin/libpdcurses-wincon.dll"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install wingui/libpdcurses.dll /mingw/bin/libpdcurses-wingui.dll"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install vt/libpdcurses.dll /mingw/bin/libpdcurses-vt.dll"
+          bash -lc "install -d /mingw/include/pdcurses"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install -m 0644 curses.h panel.h term.h /mingw/include/pdcurses/"
+          bash -lc "cd PDCursesMod-%MINGW_PDCM_VERS% && install -m 0644 pdcurses.h /mingw/include/"
+
+      - name: Save PDCursesMod cache
+        if: steps.restore-pdcm.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: cache-msys-pdcm-${{ matrix.target }}
+          path: PDCursesMod-${{ env.MINGW_PDCM_VERS }}
+
+
+      - name: Download cJSON
+        run: |
+          curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v%MINGW_CJSON_VERS%/cJSON.c -o .\libcob\cJSON.c
+          curl -L https://raw.githubusercontent.com/DaveGamble/cJSON/v%MINGW_CJSON_VERS%/cJSON.h -o .\libcob\cJSON.h
+
+          rem  to be dropped after merging the adjustment in configure.ac
+          rem mkdir _build\libcob
+          rem copy .\libcob\cJSON.* _build\libcob\
+
+
+      # - name: Bootstrap GnuCOBOL
+      #   run: |
+      #     sed -i 's/AM_PROG_AR/m4_ifdef\(\[AM_PROG_AR\], \[AM_PROG_AR\]\)/g' .\configure.ac
+      #     sed -i 's/po extras doc tests/po extras tests/g' .\Makefile.am
+      #     bash -lc "./autogen.sh"
+
+      # - name: Configure GnuCOBOL
+      #   run: |
+      #     mkdir _build
+      #     sed -i 'N;s/else/else :;/g' .\configure
+      #     sed -i 's/\} else \:;/} else/g' .\configure
+      #     sed -i 's/#else \:;/#else/g' .\configure
+      #     bash -lc "cd _build && CFLAGS=\"-I ../libcob\" ../configure %CFGOPT% --with-db --with-indexed=db --prefix=/opt/cobol/gnucobol"
+
+      - name: Configure GnuCOBOL
+        run: |
+          mkdir _build
+          bash -lc "cd _build && ../configure %CFGOPT% --with-db --with-indexed=db --with-xml2 --with-json=local --with-curses=pdcurses --prefix=/mingw""
+          rem  Note: GC4 may need CPPFLAGS="-I../libcob" for local cJSON
+
+# && CFLAGS=\"-I ../libcob\"
+
+      - name: Build GnuCOBOL
+        run: |
+          bash -lc "CPATH=$(pwd) make -C _build --jobs=$(($(nproc)+1))"
+          rem  Note: the extra CPATH above is only required in debug builds (otherwise gcc invoked from cobc does not find libcob.h [pre-inst-env]), for some reason...
+
+      - name: Upload config-msys-${{ matrix.target }}.log
+        if: failure()
+        uses: actions/upload-artifact@v4
+        with:
+          name: config-msys-${{ matrix.target }}.log
+          path: _build/config.log
+
+      - name: Cache newcob.val
+        uses: actions/cache@v4
+        with:
+          path: _build/tests/cobol85/newcob.val
+          key: newcob-val
+          enableCrossOsArchive: true
+
+      - name: Run NIST85 testsuite
+        # if we ever need to disable something in the tests: skip like here IF106A
+        # and later expect a failure
+        #   perl -pi -e 's/^# OBNC1M/\$skip{IF106A} = 1; # OBNC1M/' tests/cobol85/report.pl
+        #   bash -lc "CPATH=$(pwd) make -C _build/tests test --jobs=$(($(nproc)+1)) || echo \"WARNING: NIST85 did not pass!\""
+        run: |
+          bash -lc "CPATH=$(pwd) make -C _build/tests test --jobs=$(($(nproc)+1))"
+          rem  Note: the extra CPATH above is only required in debug builds (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
+
+      - name: Upload NIST85 Test Suite results
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: NIST85 results on msys-${{ matrix.target }}
+          path: |
+            _build/tests/cobol85/summary.*
+            _build/tests/cobol85/**/*.log
+            _build/tests/cobol85/**/*.out
+            _build/tests/cobol85/**/duration.txt
+
+      - name: Run testsuite
+        continue-on-error: true
+        run: |
+          sed -i '/AT_SETUP(\[temporary path invalid\])/a AT_SKIP_IF(\[true\])' tests/testsuite.src/used_binaries.at
+
+          rem to work around regular hangs we run NIST first, then the internal
+          rem and the later only with 2 jobs
+          bash -lc "CPATH=$(pwd) make -C _build/tests check TESTSUITEFLAGS=\"--jobs=2\""
+          rem  Note: the extra CPATH above is only required in debug builds (otherwise gcc invoked from cobc does not find libcob.h [atlocal]), for some reason...
+
+      - name: Upload testsuite-msys-${{ matrix.target }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: testsuite-msys-${{ matrix.target }}.log
+          path: _build/tests/testsuite.log
+
+      - name: Package GnuCOBOL MinGW nightly
+        run: |
+          bash -lc "make -C _build distmingw"
+
+      - name: Upload GnuCOBOL_mingw-${{ matrix.target }}
+        uses: actions/upload-artifact@v4
+        with:
+          name: GnuCOBOL_mingw-${{ matrix.target }}
+          path: _build/${{ env.DISTDIR }}
diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml
index 26e5dcf03..9719d8e63 100644
--- a/.github/workflows/windows-msvc.yml
+++ b/.github/workflows/windows-msvc.yml
@@ -1,4 +1,4 @@
-name: Windows MSVC (build only)
+name: Windows MSVC Workflow
 
 on:
   pull_request:
@@ -33,19 +33,14 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os:
-          - windows-latest
-        isam:
-          - db  # Purely informative
         arch:
           - x86
           - x64
         target:
           - Debug
           - Release
-
-    runs-on: ${{ matrix.os }}
-    timeout-minutes: 45
+    runs-on: windows-latest
+    timeout-minutes: 35
 
     steps:
 
@@ -57,7 +52,7 @@ jobs:
       - name: Checkout code
         uses: actions/checkout@v4
 
-      - name: Setup environment
+      - name: Setup build environment
         shell: pwsh
         run: |
           echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV
@@ -81,12 +76,11 @@ jobs:
             ${{ env.VCPKG_ROOT }}/packages
 
       - name: Bootstrap VCPKG
-        if: steps.restore-vcpkg.outputs.cache-hit != 'true'
         run: |
           cd /d %VCPKG_ROOT%
-          vcpkg update
           git pull
           cmd /C .\bootstrap-vcpkg.bat -disableMetrics
+          vcpkg update
 
       - name: Integrate VCPKG
         run: |
@@ -98,7 +92,6 @@ jobs:
           vcpkg install %VCPKGS%
 
       - name: Save VCPKG cache
-        if: steps.restore-vcpkg.outputs.cache-hit != 'true'
         uses: actions/cache/save@v4
         with:
           key: cache-vcpkg-${{ matrix.arch }}-${{ matrix.target }}
@@ -111,7 +104,7 @@ jobs:
         id: restore-flexbison
         with:
           key: cache-flexbison-${{ matrix.arch }}-${{ matrix.target }}
-          path: ${{ env.GITHUB_WORKSPACE }}/flexbison
+          path: flexbison
 
       - name: Install WinFlexBison
         if: steps.restore-flexbison.outputs.cache-hit != 'true'
@@ -125,30 +118,30 @@ jobs:
         uses: actions/cache/save@v4
         with:
           key: cache-flexbison-${{ matrix.arch }}-${{ matrix.target }}
-          path: ${{ env.GITHUB_WORKSPACE }}/flexbison
+          path: flexbison
 
       - name: Configure GnuCOBOL
         shell: pwsh
         run: |
           cd build_windows
-          Get-Content -Path 'config.h.in' | ForEach-Object { $_ `
+          (('#define COB_MAIN_DIR "' + $env:GITHUB_WORKSPACE + '"') -replace '\\', '\\') + "`r`n" +  `
+          ((Get-Content -Path 'config.h.in' | ForEach-Object { $_ `
               -replace '(#define\s+CONFIGURED_ISAM)\s.+$', '$1   BDB' `
               -replace '(#define\s+CONFIGURED_CURSES)\s.+$', '$1 PDCURSES' `
               -replace '(#define\s+CONFIGURED_XML)\s.+$', '$1    XML2' `
               -replace '(#define\s+CONFIGURED_JSON)\s.+$', '$1   CJSON_CJSON' `
-            } | Set-Content -Path 'config.h'
+              -replace '"\(" PACKAGE_NAME "\) "', '"(GnuCOBOL-CI ${{ matrix.target }}) "' `
+            }) -join "`r`n") | Set-Content -Path 'config.h'
           & .\maketarstamp.ps1 > tarstamp.h
 
       - name: Generate parser
         run: |
-          cd build_windows
           set PATH=%GITHUB_WORKSPACE%\flexbison;%PATH%
-          cmd /C .\makebisonflex.cmd <NUL
+          cmd /C .\build_windows\makebisonflex.cmd <NUL
 
       - name: Build GnuCOBOL
         run: |
           cd build_windows
-          set CL=/DCOB_MAIN_DIR=\"%GITHUB_WORKSPACE:\=\\%\"
           "%MSBUILD%" .\vs2019\GnuCOBOL.sln /m /p:Platform=${{ matrix.arch }} /p:Configuration=${{ matrix.target }}
 
       - name: Install MSYS2 packages
@@ -159,8 +152,8 @@ jobs:
       - name: Adjust testsuite
         shell: C:\shells\msys2bash.cmd {0}
         run: |
-          cd tests
-          sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' testsuite.src/run_misc.at
+          cd tests/testsuite.src
+          sed -i '/AT_SETUP(\[runtime check: write to internal storage (1)\])/a AT_SKIP_IF(\[true\])' run_misc.at
 
       - name: Build testsuite
         shell: C:\shells\msys2bash.cmd {0}
@@ -186,34 +179,45 @@ jobs:
       - name: Run testsuite
         continue-on-error: true
         run: |
-          cd tests
-          set PATH="%GITHUB_WORKSPACE%\build_windows\%ARCHDIR%\${{ matrix.target }}";"%GITHUB_WORKSPACE%\bin";%PATH%
-          set COB_CFLAGS=/I"%GITHUB_WORKSPACE%" /I"%GITHUB_WORKSPACE%\build_windows"
-          set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include"
+          set CL=
           call "%VCVARS%"
-          pushd ..\bin
-          cobc -x gcdiff.c
-          popd
           set MSYS2_PATH_TYPE=inherit
-          C:\shells\msys2bash.cmd -c "./testsuite || ./testsuite --recheck --verbose"
+          cd tests
+          set PATH=D:\a\gnucobol\gnucobol\build_windows\Win32\Debug;%PATH%
+          echo "ldd cobcrun"
+          rem C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && ldd /d/a/gnucobol/gnucobol/build_windows/Win32/Debug/cobcrun.exe || true"
+          echo "cobcrun 1"
+          C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && cobcrun.exe -info || true"
+          echo "cobcrun 2"
+          C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && cobcrun.exe -vV || true"
+          echo "cobc"
+          C:\shells\msys2bash.cmd -c ". atconfig && . atlocal && cd ../bin && cobc -vvv -x gcdiff.c"
+          C:\shells\msys2bash.cmd -c "./testsuite --jobs=2 || ./testsuite --recheck --verbose"
 
       - name: Upload testsuite-${{ matrix.arch }}-${{ matrix.target }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
         with:
           name: testsuite-${{ matrix.arch }}-${{ matrix.target }}.log
-          path: ${{ env.GITHUB_WORKSPACE }}/tests/testsuite.log
-
-      # - name: Package GnuCOBOL
-      #   run: |
-      #     cd build_windows
-      #     set PATH="%GITHUB_WORKSPACE%\build_windows\%ARCHDIR%\${{ matrix.target }}";"%GITHUB_WORKSPACE%\bin";%PATH%
-      #     set COB_CFLAGS=/I"%GITHUB_WORKSPACE%" /I"%GITHUB_WORKSPACE%\build_windows"
-      #     set CL=/I "%VCPKG_ROOT%\installed\${{ matrix.arch }}-windows\include"
-      #     call "%VCVARS%"
-      #     cmd /C .\makedist.cmd <NUL
-
-      # - name: Upload distribution
-      #   uses: actions/upload-artifact@v4
-      #   with:
-      #     name: GnuCOBOL_4.0-dev_${{ matrix.arch }}-${{ matrix.target }}.7z
-      #     path: ${{ env.GITHUB_WORKSPACE }}/GnuCOBOL_4.0-dev_vs_bin.7z
+          path: tests/testsuite.log
+
+      - name: Package GnuCOBOL and dependencies
+        run: |
+          echo Export VCPKG dependencies
+          vcpkg export %VCPKGS% --raw --output=export
+          echo Wrap up VCPKG dependencies for separate download
+          7z a -r -mx=9 dependencies-${{ matrix.arch }}-${{ matrix.target }}.7z "%VCPKG_ROOT%\export"
+          echo Wrap up GnuCOBOL binary package
+          cmd /C .\build_windows\makedist.cmd ${{ matrix.target }} <NUL
+
+      - name: Upload dependencies
+        uses: actions/upload-artifact@v4
+        with:
+          name: dependencies-${{ matrix.arch }}-${{ matrix.target }}.7z
+          path: dependencies-${{ matrix.arch }}-${{ matrix.target }}.7z
+
+      - name: Upload distribution
+        uses: actions/upload-artifact@v4
+        with:
+          name: GnuCOBOL-${{ matrix.arch }}-${{ matrix.target }}.7z
+          path: build_windows/GnuCOBOL_*.7z
diff --git a/.github/workflows/windows-msys2.yml b/.github/workflows/windows-msys2.yml
index 46688068e..b4ca3266d 100644
--- a/.github/workflows/windows-msys2.yml
+++ b/.github/workflows/windows-msys2.yml
@@ -1,4 +1,4 @@
-name: Windows MSYS2 (build only)
+name: Windows MSYS2 Workflow
 
 on:
   pull_request:
@@ -8,19 +8,9 @@ on:
   workflow_dispatch:
 
 jobs:
-  build:
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - { os: windows-latest, isam: db, target: release, sys: mingw64, env: x86_64       }
-          - { os: windows-latest, isam: db, target: debug,   sys: mingw64, env: x86_64       }
-          - { os: windows-latest, isam: db, target: debug,   sys: ucrt64,  env: ucrt-x86_64  }
-          - { os: windows-latest, isam: db, target: debug,   sys: clang64, env: clang-x86_64 }
-          # - { target: debug,   sys: mingw32, env: i686         }
-
-    runs-on: ${{ matrix.os }}
-    timeout-minutes: 45
+  prepare:
+    runs-on: windows-latest
+    timeout-minutes: 10
 
     steps:
 
@@ -32,30 +22,16 @@ jobs:
       - name: Checkout code
         uses: actions/checkout@v4
 
-      - name: Setup environment
-        run: |
-          echo GITHUB_WORKSPACE=$env:GITHUB_WORKSPACE >> $env:GITHUB_ENV
-          If ("${{ matrix.target }}" -eq "release") {
-            echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV
-            echo CFGOPT= >> $env:GITHUB_ENV
-          } Else {
-            echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV
-            echo CFGOPT="--enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
-          }
-
+# remove texinfo-tex & mingw-w64-x86_64-texlive-core ?
       - name: Install packages
         uses: msys2/setup-msys2@v2
         with:
           update: true
-          msystem: ${{matrix.sys}}
-          install: autoconf automake libtool make flex bison help2man texinfo
-                   mingw-w64-${{matrix.env}}-cc
-                   mingw-w64-${{matrix.env}}-gmp                 gmp-devel
-                   mingw-w64-${{matrix.env}}-gettext-runtime gettext-devel
-                   mingw-w64-${{matrix.env}}-ncurses
-                   mingw-w64-${{matrix.env}}-libxml2
-                   mingw-w64-${{matrix.env}}-cjson
-                   mingw-w64-${{matrix.env}}-db                libdb-devel
+          msystem: mingw64
+          install: autoconf automake make flex bison libtool help2man texinfo texinfo-tex
+                   mingw-w64-x86_64-cc
+                   mingw-w64-x86_64-gmp mingw-w64-x86_64-texlive-core
+                   mingw-w64-x86_64-gettext-runtime gettext-devel
 
       - name: Bootstrap GnuCOBOL
         shell: msys2 {0}
@@ -67,30 +43,138 @@ jobs:
         run: |
           mkdir _build
           cd _build
-          export CFLAGS="-Wno-unused-command-line-argument $CFLAGS"
-          ../configure $CFGOPT --with-db --with-indexed=db --prefix=/opt/cobol/gnucobol
+          ../configure --without-db --without-curses --without-xml2 --without-json
+
+      - name: Build GnuCOBOL source distribution
+        shell: msys2 {0}
+        run: |
+          make -C _build --jobs=$(($(nproc)+1))
+          make -C _build --jobs=$(($(nproc)+1)) dist
 
-      - name: Upload config-${{matrix.sys}}-${{matrix.target}}.log
+      - name: Upload config-dist.log
         uses: actions/upload-artifact@v4
-        if: failure()
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        with:
+          name: config-dist.log
+          path: _build/config.log
+
+      - name: Upload dist tarball
+        uses: actions/upload-artifact@v4
+        with:
+          name: gnucobol-ci source distribution msys2
+          path: _build/gnucobol*.tar.gz
+          if-no-files-found: error
+          retention-days: 1
+
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - { target: release, sys: mingw64, env: x86_64       }
+          - { target: debug,   sys: mingw64, env: x86_64       }
+          - { target: release, sys: ucrt64,  env: ucrt-x86_64  }
+          - { target: release, sys: clang64, env: clang-x86_64 }
+          - { target: release, sys: mingw32, env: i686         }
+
+    runs-on: windows-latest
+    needs: prepare
+    timeout-minutes: ${{ matrix.sys == 'clang64' && 35 || 20 }}
+
+    steps:
+
+      - name: Get CI dist tarball
+        uses: actions/download-artifact@v4
+        with:
+          name: gnucobol-ci source distribution msys2
+
+      - name: Extract CI dist tarball
+        shell: cmd
+        run: |
+          tar -xvf gnucobol*.tar.* --strip-components=1
+
+      - name: Setup build environment
+        run: |
+          If ("${{ matrix.target }}" -eq "release") {
+            echo DISTDIR=GnuCOBOL_mingw >> $env:GITHUB_ENV
+            echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS2" >> $env:GITHUB_ENV
+          } Else {
+            echo DISTDIR=GnuCOBOL_mingw_dbg >> $env:GITHUB_ENV
+            echo CFGOPT="--with-pkgversion=GnuCOBOL-CI-MSYS2-Debug --enable-debug --enable-cobc-internal-checks --enable-hardening" >> $env:GITHUB_ENV
+          }
+          # Common options (dependencies)
+          echo CFGOPT="$env:CFGOPT --with-math=gmp --with-curses=ncursesw --with-xml2 --with-json=json-c" >> $env:GITHUB_ENV
+          # Conditional inclusion of --with-db (MSYS2 does not provide 32bit builds for BDB any more)
+          If ("${{ matrix.sys }}" -ne "mingw32") {
+            echo CFGOPT="$env:CFGOPT --with-db" >> $env:GITHUB_ENV
+          } Else {
+            echo CFGOPT="$env:CFGOPT --without-db" >> $env:GITHUB_ENV
+          }
+
+      - name: Install packages
+        uses: msys2/setup-msys2@v2
+        with:
+          update: true
+          msystem: ${{ matrix.sys }}
+          install: autoconf automake make flex bison diffutils libtool help2man texinfo
+                   mingw-w64-${{ matrix.env }}-cc
+                   mingw-w64-${{ matrix.env }}-gmp                 gmp-devel
+                   mingw-w64-${{ matrix.env }}-gettext-runtime gettext-devel
+                   mingw-w64-${{ matrix.env }}-ncurses
+                   mingw-w64-${{ matrix.env }}-libxml2
+                   mingw-w64-${{ matrix.env }}-json-c
+
+      - name: Install BDB package
+        if: ${{ matrix.sys != 'mingw32' }}  # MSYS2 does not provide 32bit builds for it any more
+        uses: msys2/setup-msys2@v2
         with:
-          name: config-${{matrix.sys}}-${{matrix.target}}.log
-          path: ${{ env.GITHUB_WORKSPACE }}/_build/config.log
+          msystem: ${{ matrix.sys }}
+          install: mingw-w64-${{ matrix.env }}-db                libdb-devel
+
+      - name: Configure GnuCOBOL
+        shell: msys2 {0}
+        run: |
+          mkdir _build
+          cd _build
+          ../configure $CFGOPT
 
       - name: Build GnuCOBOL
         shell: msys2 {0}
         run: |
           make -C _build --jobs=$(($(nproc)+1))
 
+      - name: Upload config-${{ matrix.sys }}-${{ matrix.target }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: config-${{ matrix.sys }}-${{ matrix.target }}.log
+          path: _build/config.log
+
       - name: Cache newcob.val
         uses: actions/cache@v4
         with:
           path: _build/tests/cobol85/newcob.val
           key: newcob-val
-          save-always: true
           enableCrossOsArchive: true
 
-      - name: Run testuite
+      - name: Run NIST85 testsuite
+        continue-on-error: true
+        shell: msys2 {0}
+        run: |
+          make -C _build/tests test --jobs=$(($(nproc)+1))
+
+      - name: Upload NIST85 Test Suite results
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
+        uses: actions/upload-artifact@v4
+        with:
+          name: NIST85 results on ${{ matrix.sys }}-${{ matrix.target }}
+          path: |
+            _build/tests/cobol85/summary.*
+            _build/tests/cobol85/**/*.log
+            _build/tests/cobol85/**/*.out
+            _build/tests/cobol85/**/duration.txt
+
+      - name: Run testsuite
         continue-on-error: true
         shell: msys2 {0}
         run: |
@@ -98,32 +182,24 @@ jobs:
                 AT_SKIP_IF(\[true\])' -i tests/testsuite.src/used_binaries.at
           sed '/AT_SETUP(\[ACCEPT OMITTED (SCREEN)\])/a \
                 AT_SKIP_IF(\[true\])' -i tests/testsuite.src/run_accept.at
-          make -C _build/tests checkall \
-                               --jobs=$(($(nproc)+1)) \
-                               TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
-          make -C _build/tests check \
-                               TESTSUITEFLAGS="--recheck --verbose"
+          make -C _build/tests check TESTSUITEFLAGS="--jobs=$(($(nproc)+1))" || \
+          make -C _build/tests check TESTSUITEFLAGS="--recheck --verbose"
 
-      - name: Upload testsuite-${{matrix.sys}}-${{matrix.target}}.log
+      - name: Upload testsuite-${{ matrix.sys }}-${{ matrix.target }}.log
+        if: ${{ !cancelled() }}  #-> always upload as build result documentation
         uses: actions/upload-artifact@v4
         with:
-          name: testsuite-${{matrix.sys}}-${{matrix.target}}.log
-          path: ${{ env.GITHUB_WORKSPACE }}/_build/tests/testsuite.log
+          name: testsuite-${{ matrix.sys }}-${{ matrix.target }}.log
+          path: _build/tests/testsuite.log
 
-      - name: Package GnuCOBOL
+      - name: Package GnuCOBOL MinGW nightly
         shell: msys2 {0}
         run: |
           make -C _build distmingw
+          tar -cvf GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar _build/$DISTDIR
 
-      - name: Tar GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}
-        shell: msys2 {0}
-        run: |
-          cd _build
-          tar -cvf ../GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar \
-                   "${{ env.DISTDIR }}"
-
-      - name: Upload GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar
+      - name: Upload GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar
         uses: actions/upload-artifact@v4
         with:
-          name: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar
-          path: GnuCOBOL_mingw-${{matrix.sys}}-${{matrix.target}}.tar
+          name: GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar
+          path: GnuCOBOL_msys2-${{ matrix.sys }}-${{ matrix.target }}.tar
diff --git a/build_windows/makedist.cmd b/build_windows/makedist.cmd
index c62c44da5..29dbf4353 100644
--- a/build_windows/makedist.cmd
+++ b/build_windows/makedist.cmd
@@ -390,6 +390,12 @@ if not [%VCPKG_EXPORT_DIR%]==[] (
    set "extra_include=."
 )
 
+: remove this
+echo "----------------------"
+where cobcrun
+cobcrun -vV
+echo "----------------------"
+
 cobcrun -vV | findstr /c:"GnuCOBOL " > vers1
 cobcrun -vV | findstr /c:MPIR /c:GMP > vers2
 set /p vers1=<vers1