6 Commits

Author SHA1 Message Date
Eremey Valetov
09cdc80986 ci: build the DOS (DJGPP) target and consolidate the toolchain file
A new Linux job installs the andrewwutw DJGPP v3.4 cross-toolchain
(gcc 12.2.0, sha256-pinned), cross-compiles uc2.exe with
cmake/djgpp.cmake, and verifies the result is a DJGPP go32 DOS
executable. The DOS build had no CI coverage and could regress
silently.

The repo carried two diverged DJGPP toolchain files. djgpp.cmake
(referenced by the build docs) forces -nostdinc with explicit DJGPP
include paths, so it builds cleanly even on hosts where /usr/include
would otherwise leak past the cross-compiler. djgpp-toolchain.cmake
(previously referenced by the README) relied on the cross-gcc finding
its own headers and broke in that case. Keep djgpp.cmake as the single
toolchain file, point the README and roadmap at it, and drop
djgpp-toolchain.cmake.
2026-06-13 07:53:46 -04:00
Eremey Valetov
bd0d1911b1 djgpp: DOSBox-X smoke test for the cross-compiled uc2.exe
tests/scripts/dos_smoke.sh runs the DJGPP-built uc2 inside DOSBox-X
via the flatpak and asserts:
- uc2 -h loads under a real DPMI host and prints the banner
- uc2 -l <archive> opens an existing UC2 archive and produces output

Skips cleanly when any of uc2.exe, CWSDPMI.EXE, or DOSBox-X are
missing.  CWSDPMI.EXE is the standard DJGPP DPMI extender from
csdpmi7b.zip; fetch recipe added to cmake/README-djgpp.md.

Verified locally against build-djgpp/cli/uc2.exe +
tests/archives/basic.uc2.

Closes 20019aa.  CI matrix entry (9379647) remains a separate
follow-up.
2026-05-05 03:00:23 -04:00
Eremey Valetov
779c8b1a28 djgpp: CMake toolchain file + setup notes
cmake/djgpp-toolchain.cmake builds uc2.exe against the andrewwutw/
build-djgpp prebuilt cross toolchain.  Verified with gcc 7.2.0 and
12.2.0; output is a 359 KB MZ + COFF + go32 DOS executable.

libuc2 (14 source files including the new uc2_ingest.c) compiles
unmodified.  CLI uses the existing cli/src/compat/compat_dos.c shim
for BSD err.h and POSIX fnmatch -- already in tree, just needed
the toolchain file to set DJGPP=TRUE so cli/CMakeLists.txt picks it
up.

Documented gotcha: GCC honours CPATH and CPLUS_INCLUDE_PATH from
the build shell regardless of -nostdinc.  On hosts that export them
(e.g. via Intel oneAPI's setvars.sh), host glibc headers end up first
in the cross-compiler's search path and the build fails on stdint.h.
The README walks through 'unset CPATH' as the remediation.

DOSBox-X end-to-end smoke test and CI matrix entry tracked as P2
follow-ups.  Closes 195be9a.
2026-05-04 19:01:01 -04:00
Eremey Valetov
40af7e877e Add Windows MSVC compilation target and CI
Restructure compat layer: #include_next headers moved to posix/ for
MinGW, new standalone headers in msvc/ for MSVC (unistd.h, utime.h,
getopt.h). Add getopt() implementation, chmod/unlink/chdir compat
functions, MSVC CRT initializer for UTF-8 console, _pgmptr fix.
2026-03-11 08:16:11 -04:00
Eremey Valetov
145c948804 Add DOS/DJGPP cross-compilation support and CI for Linux + macOS
Add a DJGPP CMake toolchain file and DOS compatibility layer (err.h,
fnmatch, getprogname/setprogname) so UC2 builds as a native DOS
executable via cross-compilation from Linux.  The toolchain works
around a baked-in /usr/include in the DJGPP GCC binary by using -I
instead of -isystem to ensure DJGPP headers take precedence.

Add GitHub Actions CI workflow that builds and smoke-tests on both
ubuntu-latest and macos-latest.
2026-03-08 08:23:09 -04:00
Eremey Valetov
9bb8153cef UC2 v3.0.0-alpha.1: cross-platform revival of UltraCompressor II
Decompression MVP based on Jan Bobrowski's portable unuc2/libunuc2.
CMake build system targeting Linux (GCC/Clang) with MSVC fallback.
Includes original UC2 source by Nico de Vries and unuc2-0.6 for reference.
2026-02-24 13:32:45 -05:00