-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.sh
More file actions
executable file
·35 lines (28 loc) · 1.03 KB
/
config.sh
File metadata and controls
executable file
·35 lines (28 loc) · 1.03 KB
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
SYSTEM_HEADER_PROJECTS="libc kernel"
PROJECTS="libc kernel applications bootloader"
export MAKE=${MAKE:-make}
export HOST=${HOST:-$(./default-host.sh)}
export TAR=${TAR:-tar}
# Root of hosted tool chain
export PROJECT_ROOT="$(pwd)"
export TOOL_CHAIN_BUILD_DIR="$(pwd)/build-toolchain"
export TOOL_CHAIN_ROOT="$(pwd)/toolchain"
export CROSSCOMPILERBIN=$TOOL_CHAIN_ROOT/usr/bin
export AR=${CROSSCOMPILERBIN}/${HOST}-ar
export AS=${AS:-nasm}
export CC=${CROSSCOMPILERBIN}/${HOST}-gcc
export BOOTDIR=/boot
export PREFIX=/usr
export INCLUDEDIR=$PREFIX/include
export LIBDIR=$PREFIX/lib
export CFLAGS='-O0 -g'
export ASMFLAGS='-f elf32 -g -F dwarf'
export CPPFLAGS=''
# Configure the cross-compiler to use the desired system root.
export SYSROOT="$(pwd)/sysroot"
export CC="$CC --sysroot=$SYSROOT"
# Work around that the -elf gcc targets doesn't have a system include directory
# because it was configured with --without-headers rather than --with-sysroot.
if echo "$HOST" | grep -Eq -- '-elf($|-)'; then
export CC="$CC -isystem=$INCLUDEDIR"
fi