libkernaux/config/x86_64-stivale2

20 lines
559 B
Bash
Executable File

#!/bin/sh
set -e
ARCH='x86_64'
HOST="$ARCH-elf"
REPO="$(realpath "$(dirname "$(realpath "$0")")/..")"
PREFIX="$REPO/vendor/cross"
BIN="$PREFIX/bin"
if [ -f "$REPO/Makefile" ]; then make -C "$REPO" distclean; fi
export AR="$BIN/$HOST-ar"
export CC="$BIN/$HOST-gcc"
export RANLIB="$BIN/$HOST-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-builtin -fno-stack-protector -fno-pic -mabi=sysv -mno-80387 -mno-3dnow -mno-sse -mno-sse2 -mno-red-zone -mcmodel=kernel -MMD'
"$REPO/configure" --host="$HOST" --enable-assert --enable-guard --with-libc