commit 6a65b8acba6d8dc6aebdf08469f6b4729e0fcf77 from: jcfb via: GitHub date: Sun Sep 14 15:56:17 2025 UTC support 32-bit compilation on windows * Add support for 32 bit cross compile in mingw64 and windows 98 support * add check to error out on linux * update text * add instructions for 32-bit compilation on windows --------- Co-authored-by: p2r3 <41925384+p2r3@users.noreply.github.com> commit - 26f068bc094128a5aaa18b79538fb7297ee25ac3 commit + 6a65b8acba6d8dc6aebdf08469f6b4729e0fcf77 blob - e4b10c147dd047ac6ef5d0853bf3ab3f91f1fb7f blob + 4d3c7f19d381250c3ddba62ce7abd10541bc9217 --- README.md +++ README.md @@ -19,8 +19,9 @@ Before compiling, you'll need to dump registry data fr - To compile on Linux, install `gcc` and run `./build.sh`. - For compiling on Windows, there are a few options: - - To compile a native Windows binary: install [MSYS2](https://www.msys2.org/) and open the "MSYS2 MINGW64" shell. From there, run `pacman -Sy mingw-w64-x86_64-gcc`, navigate to this project's directory, and run `./build.sh`. - - To compile a MSYS2-linked binary: install [MSYS2](https://www.msys2.org/), and open the "MSYS2 MSYS" shell. From there, install `gcc` (run `pacman -Sy gcc`), navigate to this project's directory and run `./build.sh`. + - To compile a native Windows binary: install [MSYS2](https://www.msys2.org/) and open the "MSYS2 MINGW64" shell. From there, run `pacman -Sy mingw-w64-x86_64-gcc`, navigate to this project's directory, and run `./build.sh`. + - To compile a native 32-bit binary (compatible with Windows 95/98, but why would you ever want that), use the same steps above, except with `pacman -Sy mingw-w64-cross-gcc` and `./build.sh --9x`. + - To compile a MSYS2-linked binary: install [MSYS2](https://www.msys2.org/), and open the "MSYS2 MSYS" shell. From there, install `gcc` (run `pacman -Sy gcc`), navigate to this project's directory and run `./build.sh`. - To compile and run a Linux binary from Windows: install WSL, and from there install `gcc` and run `./build.sh` in this project's directory. - To target an ESP variant, set up a PlatformIO project (select the ESP-IDF framework, **not Arduino**) and clone this repository on top of it. See **Configuration** below for further steps. For better performance, consider changing the clock speed and enabling compiler optimizations. If you don't know how to do this, there are plenty of resources online. blob - 601c1906d4585a3fe6dbe466620164097126ce22 blob + 2fad5db43d358c1b9f622c2cdcc1a229a4e494a6 --- build.sh +++ build.sh @@ -22,6 +22,24 @@ case "$unameOut" in ;; esac +# Default compiler +compiler="gcc" + +# Handle arguments for windows 9x build +for arg in "$@"; do + case $arg in + --9x) + if [[ "$unameOut" == MINGW64_NT* ]]; then + compiler="/opt/bin/i686-w64-mingw32-gcc" + windows_linker="$windows_linker -Wl,--subsystem,console:4" + else + echo "Error: Compiling for Windows 9x is only supported when running under the MinGW64 shell." + exit 1 + fi + ;; + esac +done + rm -f "bareiron$exe" -gcc src/*.c -O3 -Iinclude -o "bareiron$exe" $windows_linker +$compiler src/*.c -O3 -Iinclude -o "bareiron$exe" $windows_linker "./bareiron$exe"