aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Perl <m@thp.io>2023-02-02 08:24:12 +0100
committerZeranoe <zeranoe@gmail.com>2023-02-04 16:08:10 -0500
commit4925ef65d873165c9f5a8e94e6527883a73c1c98 (patch)
treee2710ba995f99cd7e1031c7161435585fcf4dcab
parent3a43e408f90fadb2ed5b8084e1bedd4ae6774125 (diff)
Add support for i586 builds
-rwxr-xr-xmingw-w64-build23
1 files changed, 18 insertions, 5 deletions
diff --git a/mingw-w64-build b/mingw-w64-build
index 36495dd..55a5315 100755
--- a/mingw-w64-build
+++ b/mingw-w64-build
@@ -26,6 +26,7 @@ ENABLE_THREADS="--enable-threads=posix"
JOB_COUNT=$(($(getconf _NPROCESSORS_ONLN) + 2))
+BUILD_I586=0
BUILD_I686=0
BUILD_X86_64=0
@@ -38,7 +39,8 @@ Usage:
$0 [options] <arch>...
Archs:
- i686 Windows 32-bit
+ i586 Windows 32-bit for old CPUs (Intel Pentium (MMX), AMD K5, K6, K6-2, K6-III)
+ i686 Windows 32-bit (Intel P6 [Pentium Pro], AMD K7 and newer)
x86_64 Windows 64-bit
Options:
@@ -161,10 +163,11 @@ build()
remove_path "$prefix"
fi
- if [ "$arch" = "i686" ]; then
- local i686_dwarf2="--disable-sjlj-exceptions --with-dwarf2"
+ if [ "$arch" = "i586" ] || [ "$arch" = "i686" ]; then
+ local x86_dwarf2="--disable-sjlj-exceptions --with-dwarf2"
local crt_lib="--enable-lib32 --disable-lib64"
else
+ local x86_dwarf2=""
local crt_lib="--enable-lib64 --disable-lib32"
fi
@@ -200,7 +203,7 @@ build()
"$SRC_PATH/gcc/configure" --target="$host" --disable-shared \
--enable-static --disable-multilib --prefix="$prefix" \
--enable-languages=c,c++ --disable-nls $ENABLE_THREADS \
- $i686_dwarf2
+ $x86_dwarf2
execute "($arch): building GCC (all-gcc)" "" \
make -j $JOB_COUNT all-gcc
@@ -352,6 +355,9 @@ while :; do
--mingw-w64-branch=)
arg_error "'--mingw-w64-branch' requires a non-empty option argument"
;;
+ i586)
+ BUILD_I586=1
+ ;;
i686)
BUILD_I686=1
;;
@@ -375,7 +381,7 @@ while :; do
shift
done
-NUM_BUILDS=$((BUILD_I686 + BUILD_X86_64))
+NUM_BUILDS=$((BUILD_I586 + BUILD_I686 + BUILD_X86_64))
if [ "$NUM_BUILDS" -eq 0 ]; then
arg_error "no ARCH was specified"
fi
@@ -420,9 +426,11 @@ BLD_PATH="$ROOT_PATH/bld"
LOG_FILE="$ROOT_PATH/build.log"
if [ "$PREFIX" ]; then
+ I586_PREFIX="$PREFIX"
I686_PREFIX="$PREFIX"
X86_64_PREFIX="$PREFIX"
else
+ I586_PREFIX="$ROOT_PATH/i586"
I686_PREFIX="$ROOT_PATH/i686"
X86_64_PREFIX="$ROOT_PATH/x86_64"
fi
@@ -455,6 +463,11 @@ export LDFLAGS="-s"
ADD_TO_PATH=()
+if [ "$BUILD_I586" ]; then
+ build i586 "$I586_PREFIX"
+ ADD_TO_PATH+=("'$I586_PREFIX/bin'")
+fi
+
if [ "$BUILD_I686" ]; then
build i686 "$I686_PREFIX"
ADD_TO_PATH+=("'$I686_PREFIX/bin'")