This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathab3_defcfg.sh
189 lines (164 loc) · 5.03 KB
/
ab3_defcfg.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/bash-
##Autobuild default config file
##@copyright CC0
# Environmental Settings
# Avoid setting TMPDIR as tmpfs mount points.
TMPDIR="$SRCDIR"
# Misc building flags
ABARCHIVE=autobuild-aoscarchive # Archive program
ABSHADOW=yes # Shall shadow builds be performed by default?
NOLTO=no # Enable LTO by default.
USECLANG=no # Are we using clang?
NOSTATIC=yes # Want those big fat static libraries?
ABCLEAN=yes # Clean before build?
NOLIBTOOL=yes # Hug pkg-config and CMake configurations?
ABCONFIGHACK=yes # Use config.{sub,guess} replacement for newer architectures?
NOCARGOAUDIT=no # Audit Cargo (Rust) dependencies?
NONPMAUDIT=no # Audit NPM dependencies?
ABUSECMAKEBUILD=yes # Use cmake build for cmake* ABTYPEs?
ABSPLITDBG=yes # Split out debug package containing symbols (-dbg)?
ABBUILDDEPONLY=no # Avoid installing runtime dependencies when building?
# Strict Autotools option checking?
AUTOTOOLS_STRICT=yes
# Parallelism, the default value is an equation depending on the number of processors.
# $ABTHREADS will take any integer larger than 0.
ABTHREADS=$(( $(nproc) + 1))
ABMANCOMPRESS=1
ABINFOCOMPRESS=1
ABELFDEP=0 # Guess dependencies from ldd?
ABSTRIP=1 # Should ELF be stripped off debug and unneeded symbols?
# Use -O3 instead?
AB_FLAGS_O3=0
# Use -Os instead?
AB_FLAGS_OS=0
# PIC and PIE are enabled by GCC/LD specs.
AB_FLAGS_SSP=1
AB_FLAGS_SCP=1
AB_FLAGS_RRO=1
AB_FLAGS_NOW=1
AB_FLAGS_FTF=1
# Fallback for Clang which does not support specs.
AB_FLAGS_PIC=1
AB_FLAGS_PIE=1
# Hardening specs?
AB_FLAGS_SPECS=1
# Enable table-based thread cancellation.
AB_FLAGS_EXC=1
AB_SAN_ADD=0
AB_SAN_THR=0
AB_SAN_LEK=0
# Use BFD LD?
AB_LD_BFD=0
# Default testing flags
ABTESTS=""
ABTEST_AUTO_DETECT=yes
ABTEST_ABORT_BUILD=no
ABTEST_TESTEXEC=plain
ABTEST_AUTO_DETECT_STAGE=post-build
ABTESTTYPE_rust_STAGE=post-build
NOTEST=yes
##OS Directory Tree
# Built-in variables for AOSC OS directory tree.
# Will be updated. Therefore not part of conffiles.
#
PREFIX="/usr"
BINDIR="/usr/bin"
LIBDIR="/usr/lib"
SYSCONF="/etc"
CONFD="/etc/conf.d"
ETCDEF="/etc/default"
LDSOCONF="/etc/ld.so.conf.d"
FCCONF="/etc/fonts"
LOGROT="/etc/logrotate.d"
CROND="/etc/cron.d"
SKELDIR="/etc/skel"
BINFMTD="/usr/lib/binfmt.d"
X11CONF="/etc/X11/xorg.conf.d"
STATDIR="/var"
INCLUDE="/usr/include"
BOOTDIR="/boot"
LIBEXEC="/usr/libexec"
MANDIR="/usr/share/man"
FDOAPP="/usr/share/applications"
FDOICO="/usr/share/icons"
FONTDIR="/usr/share/fonts"
USRSRC="/usr/src"
VARLIB="/var/lib"
RUNDIR="/run"
DOCDIR="/usr/share/doc"
LICDIR="/usr/share/doc/licenses"
SYDDIR="/usr/lib/systemd/system"
SYDSCR="/usr/lib/systemd/scripts"
TMPFILE="/usr/lib/tmpfiles.d"
PAMDIR="/etc/pam.d"
JAVAMOD="/usr/share/java"
JAVAHOME="/usr/lib/java"
GTKDOC="/usr/share/gtk-doc"
GSCHEMAS="/usr/share/glib-2.0/schemas"
THEMES="/usr/share/themes"
BASHCOMP="/usr/share/bash-completion"
ZSHCOMP="/usr/share/zsh-completion"
PROFILED="/etc/profile.d"
LOCALES="/usr/share/locales"
VIMDIR="/usr/share/vim"
QT4DIR="/usr/lib/qt4"
QT5DIR="/usr/lib/qt5"
QT4BIN="/usr/lib/qt4/bin"
QT5BIN="/usr/lib/qt5/bin"
##OS basic configuration flags
AUTOTOOLS_DEF="""
--prefix=$PREFIX
--sysconfdir=$SYSCONF
--localstatedir=$STATDIR
--libdir=$LIBDIR
--bindir=$BINDIR
--sbindir=$BINDIR
--mandir=$MANDIR
"""
CMAKE_DEF="""
-DCMAKE_INSTALL_PREFIX=$PREFIX
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_LIBDIR=lib
-DLIB_INSTALL_DIR=lib
-DSYSCONF_INSTALL_DIR=$SYSCONF
-DCMAKE_INSTALL_SBINDIR=$BINDIR
-DCMAKE_SKIP_RPATH=ON
-DCMAKE_VERBOSE_MAKEFILE=ON
"""
MESON_DEF="--prefix=$PREFIX --sbindir=$BINDIR"
WAF_DEF="--prefix=$PREFIX --configdir=$SYSCONF --libdir=$LIBDIR"
QTPROJ_DEF="PREFIX=$PREFIX LIBDIR=/usr/lib CONFIG+=force_debug_info"
MAKE_INSTALL_DEF="PREFIX=$PREFIX BINDIR=$BINDIR \
SBINDIR=$BINDIR LIBDIR=$LIBDIR INCDIR=$INCLUDE MANDIR=$MANDIR \
prefix=$PREFIX bindir=$BINDIR sbindir=$BINDIR libdir=$LIBDIR \
incdir=$INCLUDE mandir=$MANDIR"
# AUTOTOOLS related
RECONF=yes
##Packaging info
ABQA=yes
ABINSTALL="dpkg"
# Golang default build flags | Adapted from Arch Linux's Go package guildline.
GOFLAGS+=" -mod=readonly" # Ensure module files are not updated during building process.
GOFLAGS+=" -trimpath" # Required for eproducible build.
GOFLAGS+=" -modcacherw" # Ensures that go modules creates a write-able path.
GOFLAGS+=" -buildmode=pie" # Hardening binary.
# Old, default.
[[ -d "$AB"/etc/autobuild/defaults ]] && recsr "$AB"/etc/autobuild/defaults/*!(.dpkg*|dist)
. "$AB"/etc/autobuild/ab3cfg.sh
[[ -d "$AB"/etc/autobuild/ab3cfg.d ]] && recsr "$AB"/etc/autobuild/ab3cfg.d/*!(.dpkg*|dist)
if bool $ABSTAGE2; then
abwarn "Autobuild3 running in stage2 mode ..."
NOCARGOAUDIT=yes
NONPMAUDIT=yes
ABSPLITDBG=no
fi
abdetectarch() {
type dpkg >/dev/null 2>&1 && dpkg --print-architecture || ( echo "[!!!] Cannot find dpkg executable, exiting ..." && exit 1 )
}
abassigngroup() {
basename -a $(grep -lr "$1" "$AB/sets/arch_groups/")
}
((AB_COMPAT > 1)) || : "${ABBUILD:=$ARCH}" "${ABHOST:=$CROSS}"
: "${ABBUILD:="$(abdetectarch)"}" "${ABHOST:=$ABBUILD}" "${ABTARGET:=$ABHOST}"
ABHOST_GROUP="$(abassigngroup $ABHOST)"
unset -f abdetectarch abassigngroup