Support non-x86_64 targets for binutils

This commit is contained in:
Steven Fackler 2022-07-27 09:42:29 -04:00
parent 17bb5e2d0a
commit 543be5aeab
No known key found for this signature in database
GPG Key ID: 30A04EB23B15B465

View File

@ -25,6 +25,11 @@ if [ -z "$GDB_VERSION" ]; then
GDB_VERSION=8.3 GDB_VERSION=8.3
fi fi
# architecture to target
if [ -z "$TARGET_ARCH" ]; then
TARGET_ARCH=x86_64
fi
# mirror # mirror
MIRROR="https://ftp.gnu.org/gnu" MIRROR="https://ftp.gnu.org/gnu"
@ -37,7 +42,7 @@ function remove_locks()
function build_and_install() function build_and_install()
{ {
if [ ! -f "have_$1_$2_${TARGET}" ]; then if [ ! -f "have_$1_$2_${TARGET}_${TARGET_ARCH}" ]; then
pushd $TARBALL_DIR &>/dev/null pushd $TARBALL_DIR &>/dev/null
download "$MIRROR/$1/$1-$2.tar.gz" download "$MIRROR/$1/$1-$2.tar.gz"
popd &>/dev/null popd &>/dev/null
@ -52,8 +57,8 @@ function build_and_install()
pushd build &>/dev/null pushd build &>/dev/null
../configure \ ../configure \
--target=x86_64-apple-$TARGET \ --target=$TARGET_ARCH-apple-$TARGET \
--program-prefix=x86_64-apple-$TARGET- \ --program-prefix=$TARGET_ARCH-apple-$TARGET- \
--prefix=$TARGET_DIR/binutils \ --prefix=$TARGET_DIR/binutils \
--disable-nls \ --disable-nls \
--disable-werror --disable-werror
@ -63,7 +68,7 @@ function build_and_install()
popd &>/dev/null popd &>/dev/null
popd &>/dev/null popd &>/dev/null
touch "have_$1_$2_${TARGET}" touch "have_$1_$2_${TARGET}_${TARGET_ARCH}"
fi fi
} }