-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.sh
executable file
·43 lines (32 loc) · 963 Bytes
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Provided by the OSDev Wiki.
SYSTEM_HEADER_PROJECTS="libc kernel"
PROJECTS="libc kernel"
export PATH="$HOME/opt/cross/bin:$PATH"
export MAKE=${MAKE:-make}
export HOST=${HOST:-i686-elf}
export AR=${HOST}-ar
export AS=${HOST}-as
export CC=${HOST}-gcc
export NASM="nasm -f elf"
export PREFIX=/usr
export EXEC_PREFIX=$PREFIX
export BOOTDIR=/boot
export LIBDIR=$EXEC_PREFIX/lib
export INCLUDEDIR=$PREFIX/include
export CFLAGS='-O2 -g'
export CPPFLAGS=''
export NASMFLAGS="$CFLAGS -Wall"
# Configure the cross-compiler to use the desired system root.
export CC="$CC --sysroot=$PWD/sysroot"
# Work around that the -elf gcc targets doesn't have a system include directory
# because configure received --without-headers rather than --with-sysroot.
if echo "$HOST" | grep -Eq -- '-elf($|-)'; then
export CC="$CC -isystem=$INCLUDEDIR"
fi
export HOSTARCH="i386"
if [ "$1" != "" ]; then
export HOSTARCH="$1"
fi
if [ "$2" != "" ]; then
export HOST="$2"
fi