-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.def
183 lines (158 loc) · 9.85 KB
/
defaults.def
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
DEF_COMPLIANCE='^1.[0-9]+.[0-9]+$' # defines version of Sofin required for this defaults (egrep format)
DEF_LANG="en_US.UTF-8"
DEF_USE_TOOLS=YES
# unset DEF_UTILITY_BUNDLE # if set, bundle will be built as Sofin utility
unset DEF_CRITICAL # Set any value to mark definition "mission critical" (one that shouldn't be "easy removable")
unset DEF_TYPE # Set it to "meta" for meta bundles
unset DEF_DISABLE_ON # defines list of unames. For example DEF_DISABLE_ON="Linux Darwin" will disable definition for Linux and OSX hosts.
unset DEF_EXPORTS # defines list of binaries to be exported to user env into PATH
unset DEF_FULL_NAME
unset DEF_SOURCE_PATH # defines a path to source file (http, git, or any other supported by curl)
unset DEF_GIT_MODE # set to use git repository as code source
unset DEF_GIT_CHECKOUT # default git branch name if in git mode (master) or fallback to DEF_VERSION
unset DEF_NAME # this is software name, but also part of source dir name - used to determine build directory after unpack
unset DEF_SUFFIX # a postfix added to DEF_NAME if defined. Used in Sofin to do legacy versions of software.
unset DEF_VERSION # defines software version
unset DEF_REQUIREMENTS # list of definitions that given package is dependant on. Order is significant. Note that this is flat list.
unset DEF_COMPILER_FLAGS # additional special arguments for compiler(s) and preprocessor
unset DEF_LINKER_FLAGS # additional direct arguments to linker
DEF_CONFIGURE_METHOD="./configure" # default configure script name
unset DEF_CONFIGURE_ARGS # additional arguments to configuration script of software
DEF_MAKE_METHOD="make ${MAKE_OPTS}"
DEF_TEST_ENV="test_harness" # default TEST_ENV passed to test
unset DEF_TEST_METHOD # define to enable software internal testing
DEF_INSTALL_METHOD="make ${MAKE_OPTS} install"
unset DEF_BUILD_DIR_SUFFIX # special value required for software which delivers software sources in custom non standard directory.
unset DEF_AFTER_UNPACK_METHOD
unset DEF_AFTER_CONFIGURE_METHOD
unset DEF_AFTER_MAKE_METHOD
unset DEF_AFTER_TEST_METHOD
unset DEF_AFTER_INSTALL_METHOD
unset DEF_AFTER_PATCH_METHOD
unset DEF_AFTER_EXPORT_METHOD
# HardenedBSD hardening features:
unset DEF_NO_PIC
unset DEF_NO_PIE
unset DEF_NO_DISALLOW_MAP32BIT
unset DEF_NO_MPROTECT
unset DEF_NO_PAGEEXEC
unset DEF_NO_ASLR
unset DEF_NO_SEGVGUARD
unset DEF_NO_SHLIBRANDOM
DEF_NO_RETPOLINE=YES # don't use -mretpoline
unset DEF_NO_GOLDEN_LINKER # any value disables golden linker flags for configuration stage for current definition
unset DEF_NO_LLVM_LINKER
unset DEF_NO_LINKER_DTAGS # any value will cause omition of "-Wl,-rpath=${PREFIX}/lib,--enable-new-dtags" ld param.
unset DEF_NO_CCACHE # any value disables ccache usage for current definition
DEF_NO_FAST_MATH=YES # disables "-ffast-math" compiler option for current definition
DEF_NO_HARDEN_FLAGS=YES # causes performance penalty since enables -fstack-protector-all
unset DEF_NO_FORTIFY_SOURCE # buffer overflow checks
unset DEF_NO_SSP_BUFFER_OVERRIDE # stack protector checks
unset DEF_NO_TRAP_INT_OVERFLOW # if set, pass "-ftrapv" to compiler
unset DEF_APPLY_LOWER_SECURITY_ON # list of binaries/libraries to disable security bits on
unset DEF_SHA # sha1 of archive source, used to check file checksum after archive download. May be skipped when in git mode
unset DEF_USER_INFO # additional optional information from definition to user displayed after installation
unset DEF_CONFLICTS_WITH # defines list of definitions which are in conflict with software.
unset DEF_REQUIRE_ROOT_ACCESS # set, to disallow definition to be built as non root users.
unset DEF_APPLE_BUNDLE # set, to enable .app bundling for default (first) export.
unset DEF_ORIGIN # app origin location, to gather newer software version if available
unset DEF_STANDALONE # TODO: it's currently only a marker for standalone bundles
DEF_STRIP=ALL # set to "ALL" to strip bins and libs; set to "BINS", to strip binaries only; set to "LIBS", to strip libs only, "NO" to skip strip
#DEF_NO_GOLDEN_LINKER NOTE: since Sofin 0.92.x, golden linker is a default system linker. Unfortunatelly a few configuration scripts crases with explicit linker params set. In result - we explicitly unset golden linker specific arguments on configuration stage. Though under the hood - golden linker will be used anyway and will work just fine..
unset DEF_USE_CXX11 # use -std=c++11
unset DEF_USE_CXX14 # use -std=c++14
unset DEF_USE_CXX17 # use -std=c++17
unset DEF_USE_CXX20 # use -std=c++20
unset DEF_USE_LTO # Link time optimization feature
unset DEF_USE_CFI # Control Flow Integrity compiler feature
unset DEF_USE_SAFE_STACK # HardenedBSD specific feature for now, since it's the only open source system based on LLVM
unset DEF_KEEP_DEBUG_SYMBOLS # if set, Bundle debug symbols will be preserved
unset DEF_USELESS # list of patterns of files to be removed after build process. example: "lib/perl5 lib/python2.7 bin/perl bin/python"
unset DEF_USEFUL # list of patterns of files to be left intact. It doesn't apply on patterns present on DEF_USELESS list
DEF_DEFAULT_USELESS="info doc docs share/*-doc share/gtk-doc share/emacs share/common-lisp share/bison share/doc share/docs share/info"
DEF_DEFAULT_USEFUL="bin/*-config bin/*cfg" # TODO:
DEF_CLEAN_USELESS=YES # if YES, all NOT exported binaries will be removed from PREFIX/bin and PREFIX/sbin
DEF_USE_RAMDISK=YES # use RAMdisk for build
DEF_DEFAULT_CA_CERT_SOURCE="https://curl.se/ca/cacert.pem" # default source of ROOT-CA
DEF_DEFAULT_CA_CERT_SOURCE_ALT="${MAIN_SOURCE_REPOSITORY}cacert.pem" # # backup source of ROOT-CA
# DEF_DEFAULT_USED_ARCHITECTURE="x86_64" # deduplicated value of mainly used hw architecture
DEF_WORKSTATION_VERSION_FLAGS="-mmacosx-version-min=${MINIMAL_MAJOR_OS_VERSION}" # default major workstation system version used
DEF_VISIBILITY_FLAGS="-fvisibility=default"
# Explicit compiler optimisation options:
if [ -z "${DEBUGBUILD}" ]; then
BUILD_OPT_FLAGS="-w -O3"
fi
DEF_OPTFLAGS_ARM64="${BUILD_OPT_FLAGS}"
DEF_OPTFLAGS_X86_64="${BUILD_OPT_FLAGS} -march=ivybridge" # -mfpmath=sse -fno-signed-zeros -freciprocal-math -ffp-contract=fast # -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mfma -mavx -mtune=ivybridge
case "${SYSTEM_NAME}-${SYSTEM_ARCH}" in
FreeBSD-amd64)
DEF_COMPILER_FLAGS="${DEF_OPTFLAGS_X86_64} ${DEF_VISIBILITY_FLAGS}"
# DEF_USE_LTO=YES
;;
FreeBSD-a*64)
DEF_COMPILER_FLAGS="${DEF_OPTFLAGS_ARM64} ${DEF_VISIBILITY_FLAGS}"
DEF_USE_LTO=YES
unset DEF_USE_RAMDISK
;;
OpenBSD-arm64)
DEF_COMPILER_FLAGS="${DEF_OPTFLAGS_ARM64} ${DEF_VISIBILITY_FLAGS}"
DEF_NO_PIE=YES
unset DEF_USE_RAMDISK
;;
Darwin-arm64)
DEF_VISIBILITY_FLAGS="${DEF_VISIBILITY_FLAGS} -fvisibility-inlines-hidden" # explicit symbol visibility
DEF_COMPILER_FLAGS="-fPIC ${DEF_OPTFLAGS_ARM64} ${DEF_VISIBILITY_FLAGS}"
DEF_DEFAULT_USELESS="${DEF_DEFAULT_USELESS} share/acloc* share/automa* share/libtool share/bison share/readline"
# DEF_NO_LLVM_LINKER=YES
DEF_NO_LINKER_DTAGS=YES
DEF_NO_RETPOLINE=YES
DEF_NO_PIE=YES
DEF_USE_LTO=YES
DEF_MAKE_METHOD="make ${MAKE_OPTS} SHELL=${SOFIN_UTILS_DIR}/exports/bash"
DEF_INSTALL_METHOD="make ${MAKE_OPTS} install SHELL=${SOFIN_UTILS_DIR}/exports/bash"
unset DEF_USE_RAMDISK
;;
Darwin-x86_64)
DEF_VISIBILITY_FLAGS="${DEF_VISIBILITY_FLAGS} -fvisibility-inlines-hidden" # explicit symbol visibility
DEF_COMPILER_FLAGS="-fPIC ${DEF_OPTFLAGS_X86_64} ${DEF_WORKSTATION_VERSION_FLAGS} ${DEF_VISIBILITY_FLAGS}"
# DEF_LINKER_FLAGS="-arch=${DEF_DEFAULT_USED_ARCHITECTURE}"
DEF_DEFAULT_USELESS="${DEF_DEFAULT_USELESS} share/acloc* share/automa* share/libtool share/bison share/readline" # include
DEF_NO_LLVM_LINKER=YES
DEF_NO_LINKER_DTAGS=YES
DEF_NO_RETPOLINE=YES
DEF_NO_PIE=YES
DEF_USE_LTO=YES
;;
Minix-i386)
DEF_COMPILER_FLAGS="-arch=i686 ${DEF_OPTFLAGS_X86_64} -I/usr/pkg/include ${DEF_VISIBILITY_FLAGS}"
DEF_LINKER_FLAGS="-L/usr/pkg/lib"
DEF_NO_RETPOLINE=YES
DEF_NO_PIC=YES
DEF_NO_PIE=YES
;;
Linux-x86_64)
DEF_COMPILER_FLAGS="-mno-avx ${DEF_OPTFLAGS_X86_64} ${DEF_VISIBILITY_FLAGS}"
DEF_DEFAULT_USELESS="${DEF_DEFAULT_USELESS} share/acloc* share/automa*" # include
;;
Linux-aarch64|Linux-arm64)
DEF_COMPILER_FLAGS="${DEF_OPTFLAGS_ARM64} ${DEF_VISIBILITY_FLAGS}"
DEF_DEFAULT_USELESS="${DEF_DEFAULT_USELESS} share/acloc* share/automa*" # include
;;
esac
# # TODO: ideas:
# DEF_ENV=""
# DEF_REQUIREMENTS=""
# DEF_REQUIREMENTS_IMPORT="perl cmake" # => read perl.def, and include whole DEF_REQUIREMENTS value at once from each definition
# Common fixes and hacks:
# NOTE: to fix LIBTOOL missing --tag= when using custom ld configurations
fix_makefile_libtool_tag () {
for _makefile in $(${FIND_BIN} . -type f -name 'Makefile' 2>/dev/null); do
${SED_BIN} -i '' -e 's#LIBTOOL = .*$#LIBTOOL = $(SHELL) $(top_builddir)/libtool --tag=CC#' "${_makefile}"
done
return 0
}
patch_makefile_shell () {
for _mfile in $(find . -name Makefile); do
printf "\n%s\n" "SHELL = /bin/bash" >> "${_mfile}"
done
}