2022-01-11 08:31:48 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-01-12 00:05:32 -05:00
|
|
|
set -e
|
|
|
|
|
|
|
|
ARCH='x86_64'
|
|
|
|
HOST="$ARCH-elf"
|
2022-01-15 02:19:15 -05:00
|
|
|
REPO="$(realpath "$(dirname "$(realpath "$0")")/..")"
|
2022-01-12 00:05:32 -05:00
|
|
|
PREFIX="$REPO/vendor/cross"
|
|
|
|
BIN="$PREFIX/bin"
|
|
|
|
|
2022-01-15 02:32:37 -05:00
|
|
|
if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
|
|
|
|
|
2022-01-12 00:05:32 -05:00
|
|
|
export AR="$BIN/$HOST-ar"
|
|
|
|
export CC="$BIN/$HOST-gcc"
|
|
|
|
export RANLIB="$BIN/$HOST-ranlib"
|
|
|
|
|
|
|
|
export CFLAGS='-ffreestanding -nostdlib -fno-builtin -fno-stack-protector'
|
|
|
|
|
2022-01-15 02:19:15 -05:00
|
|
|
"$REPO/configure" --host="$HOST" --enable-assert --enable-guard --with-libc
|