-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.env
More file actions
69 lines (58 loc) · 2.1 KB
/
Copy pathbuild.env
File metadata and controls
69 lines (58 loc) · 2.1 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Sets up the environment for the MassOS build system (stage 2 and stage 3).
# shellcheck shell=bash
# shellcheck disable=SC2155
# Set up default umask, in case host umask differs.
umask 0022
# Naming conventions which differ based on architecture.
MBS_ARCH="$(uname -m)"
case "$MBS_ARCH" in
x86_64)
MBS_ARCH_EFI="x64"
MBS_ARCH_EFI_UPPER="X64"
MBS_ARCH_GRUB="x86_64"
MBS_ARCH_VENDOR="pc" #for x86_64-pc-linux-gnu
;;
aarch64)
MBS_ARCH_EFI="aa64"
MBS_ARCH_EFI_UPPER="AA64"
MBS_ARCH_GRUB="arm64"
MBS_ARCH_VENDOR="unknown" #for aarch64-unknown-linux-gnu
;;
*)
# The build system should've already caught invalid arch build attempts.
exit 1
;;
esac
export MBS_ARCH MBS_ARCH_EFI MBS_ARCH_GRUB MBS_ARCH_VENDOR
# Path, expanded to include extra build tools, needed to build some packages.
export PATH="/usr/local/bin:/usr/bin:/root/mbs/extras/rust/bin:/root/mbs/extras/go/bin:/root/mbs/extras/gyp:/root/mbs/extras/sphinx/bin"
# Locale - we use C.UTF-8 for building.
export LANG="C.UTF-8" LANGUAGE="C.UTF-8" LC_ALL="C.UTF-8" 2>/dev/null
# Enable multi-threaded Make (Ninja is automatically parallel).
export MAKEFLAGS="-j$(nproc)"
# Allow building some packages as root.
export FORCE_UNSAFE_CONFIGURE=1
# In case $SHELL is not set in the environment for some reason...
export SHELL=/usr/bin/bash
# Compiler optimisations used for MassOS.
CFLAGS="-Os"
CXXFLAGS="-Os"
CPPFLAGS=""
LDFLAGS="-Wl,-O1"
RUSTFLAGS=""
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
# Enable CGO and use the same compiler optimisations for Go.
CGO_ENABLED=1
CGO_CFLAGS="$CFLAGS"
CGO_CXXFLAGS="$CXXFLAGS"
CGO_CPPFLAGS="$CPPFLAGS"
CGO_LDFLAGS="$LDFLAGS"
export CGO_ENABLED CGO_CFLAGS CGO_CXXFLAGS CGO_CPPFLAGS CGO_LDFLAGS
# Set up default values for use by the MassOS Build System Utility (mbs).
# Note that they may go unused until mbs is fully incorporated into the build.
MBS_TARBALL_DIR=/root/mbs/sources
MBS_PATCH_DIR=/root/mbs/patches
MBS_ALLOW_SYSINST=YES
MBS_HUSH_SYSINST_WARNING=YES
MBS_ALLOW_CLEANUP=YES
export MBS_TARBALL_DIR MBS_PATCH_DIR MBS_ALLOW_SYSINST MBS_HUSH_SYSINST_WARNING MBS_ALLOW_CLEANUP