xref: /openbmc/openbmc/poky/meta/conf/bitbake.conf (revision 5b659899)
1##################################################################
2# Standard target filesystem paths.
3##################################################################
4#
5# If changing these values, beware that native/cross/nativesdk bbclass
6# files may also need changes to keep in sync.
7#
8
9# Used by multilib code to change the library paths
10baselib = "${BASELIB}"
11baselib[vardepvalue] = "${baselib}"
12BASELIB = "lib"
13BASELIB:libc-glibc:powerpc64 = "lib64"
14BASELIB:libc-glibc:powerpc64le = "lib64"
15
16# Path prefixes
17export base_prefix = ""
18export prefix = "/usr"
19export exec_prefix = "${prefix}"
20
21root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
22
23# Base paths
24export base_bindir = "${root_prefix}/bin"
25export base_sbindir = "${root_prefix}/sbin"
26export base_libdir = "${root_prefix}/${baselib}"
27export nonarch_base_libdir = "${root_prefix}/lib"
28
29# Architecture independent paths
30export sysconfdir = "${base_prefix}/etc"
31export servicedir = "${base_prefix}/srv"
32export sharedstatedir = "${base_prefix}/com"
33export localstatedir = "${base_prefix}/var"
34export datadir = "${prefix}/share"
35export infodir = "${datadir}/info"
36export mandir = "${datadir}/man"
37export docdir = "${datadir}/doc"
38export systemd_unitdir = "${nonarch_base_libdir}/systemd"
39export systemd_system_unitdir = "${nonarch_base_libdir}/systemd/system"
40export nonarch_libdir = "${exec_prefix}/lib"
41export systemd_user_unitdir = "${nonarch_libdir}/systemd/user"
42
43# Architecture dependent paths
44export bindir = "${exec_prefix}/bin"
45export sbindir = "${exec_prefix}/sbin"
46export libdir = "${exec_prefix}/${baselib}"
47export libexecdir = "${exec_prefix}/libexec"
48export includedir = "${exec_prefix}/include"
49localedir = "${libdir}/locale"
50
51# Linkage between native/cross/nativesdk layouts
52base_bindir_native = "/bin"
53base_sbindir_native = "/sbin"
54sysconfdir_native = "/etc"
55prefix_native = "/usr"
56bindir_native = "${prefix_native}/bin"
57sbindir_native = "${prefix_native}/sbin"
58includedir_native = "${prefix_native}/include"
59libdir_native = "${prefix_native}/lib"
60libexecdir_native = "${prefix_native}/libexec"
61base_libdir_native = "/lib"
62datadir_native = "${prefix_native}/share"
63bindir_cross = "/bin"
64bindir_crossscripts = "${bindir}/crossscripts"
65prefix_nativesdk = "/usr"
66bindir_nativesdk = "${prefix_nativesdk}/bin"
67sbindir_nativesdk = "${prefix_nativesdk}/sbin"
68base_bindir_nativesdk = "/bin"
69base_sbindir_nativesdk = "/sbin"
70includedir_nativesdk = "${prefix_nativesdk}/include"
71libdir_nativesdk = "${prefix_nativesdk}/lib"
72base_libdir_nativesdk = "/lib"
73localstatedir_nativesdk = "/var"
74
75#
76# Cross recipes need to know about the target layout
77# := is used carefully here
78#
79target_datadir := "${datadir}"
80# Used to find env/perl/python
81USRBINPATH = "${bindir}"
82USRBINPATH:class-native = "/usr/bin"
83USRBINPATH:class-nativesdk = "/usr/bin"
84
85# Root home directory
86ROOT_HOME ??= "/home/root"
87
88# If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log.
89# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
90VOLATILE_LOG_DIR ?= "yes"
91
92# if set to 'yes': /tmp links to /var/tmp which links to /var/volatile/tmp
93# otherwise:       /tmp is on persistent storage
94VOLATILE_TMP_DIR ?= "yes"
95
96BB_RENAMED_VARIABLES[PNBLACKLIST] = "SKIP_RECIPE"
97BB_RENAMED_VARIABLES[CVE_CHECK_PN_WHITELIST] = "CVE_CHECK_SKIP_RECIPE"
98BB_RENAMED_VARIABLES[CVE_CHECK_WHITELIST] = "CVE_CHECK_IGNORE"
99BB_RENAMED_VARIABLES[MULTI_PROVIDER_WHITELIST] = "BB_MULTI_PROVIDER_ALLOWED"
100BB_RENAMED_VARIABLES[PNBLACKLIST] = "SKIP_RECIPE"
101BB_RENAMED_VARIABLES[SDK_LOCAL_CONF_BLACKLIST] = "ESDK_LOCALCONF_REMOVE"
102BB_RENAMED_VARIABLES[SDK_LOCAL_CONF_WHITELIST] = "ESDK_LOCALCONF_ALLOW"
103BB_RENAMED_VARIABLES[SDK_INHERIT_BLACKLIST] = "ESDK_CLASS_INHERIT_DISABLE"
104BB_RENAMED_VARIABLES[SSTATE_DUPWHITELIST] = "SSTATE_ALLOW_OVERLAP_FILES"
105BB_RENAMED_VARIABLES[SYSROOT_DIRS_BLACKLIST] = "SYSROOT_DIRS_IGNORE"
106BB_RENAMED_VARIABLES[UNKNOWN_CONFIGURE_WHITELIST] = "UNKNOWN_CONFIGURE_OPT_IGNORE"
107BB_RENAMED_VARIABLES[ICECC_USER_CLASS_BL] = "ICECC_CLASS_DISABLE"
108BB_RENAMED_VARIABLES[ICECC_SYSTEM_CLASS_BL] = "ICECC_CLASS_DISABLE"
109BB_RENAMED_VARIABLES[ICECC_USER_PACKAGE_WL] = "ICECC_RECIPE_ENABLE"
110BB_RENAMED_VARIABLES[ICECC_USER_PACKAGE_BL] = "ICECC_RECIPE_DISABLE"
111BB_RENAMED_VARIABLES[ICECC_SYSTEM_PACKAGE_BL] = "ICECC_RECIPE_DISABLE"
112BB_RENAMED_VARIABLES[INHERIT_BLACKLIST] = "is a deprecated variable and no longer needed"
113BB_RENAMED_VARIABLES[TUNEABI_WHITELIST] = "is a deprecated variable and support has been removed"
114BB_RENAMED_VARIABLES[LICENSE_FLAGS_WHITELIST] = "LICENSE_FLAGS_ACCEPTED"
115
116BB_RENAMED_VARIABLES[WHITELIST_GPL-3.0-only] = "INCOMPATIBLE_LICENSE_EXCEPTIONS"
117BB_RENAMED_VARIABLES[WHITELIST_GPL-3.0-or-later] = "INCOMPATIBLE_LICENSE_EXCEPTIONS"
118BB_RENAMED_VARIABLES[WHITELIST_LGPL-3.0-only] = "INCOMPATIBLE_LICENSE_EXCEPTIONS"
119BB_RENAMED_VARIABLES[WHITELIST_LGPL-3.0-or-later] = "INCOMPATIBLE_LICENSE_EXCEPTIONS"
120
121# These are deprecated version and should be updated to approved names
122BB_RENAMED_VARIABLES[WHITELIST_GPL-3.0] = "is deprecated, convert to INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:GPL-3.0-only'"
123BB_RENAMED_VARIABLES[WHITELIST_GPL-3.0+] = "is deprecated, convert to INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:GPL-3.0-or-later'"
124BB_RENAMED_VARIABLES[WHITELIST_LGPL-3.0] = "is deprecated, convert to INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:LGPL-3.0-only'"
125BB_RENAMED_VARIABLES[WHITELIST_LGPL-3.0+] = "is deprecated, convert to INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:LGPL-3.0-or-later'"
126
127##################################################################
128# Architecture-dependent build variables.
129##################################################################
130
131# Immediate expansion since there is no point in repeatedly calling
132# os.uname() throughout parsing
133BUILD_ARCH := "${@os.uname()[4]}"
134BUILD_OS := "${@os.uname()[0].lower()}"
135BUILD_VENDOR = ""
136BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
137BUILD_PREFIX = ""
138BUILD_CC_ARCH = ""
139BUILD_LD_ARCH = ""
140BUILD_AS_ARCH = ""
141BUILD_EXEEXT = ""
142
143HOST_ARCH = "${TARGET_ARCH}"
144HOST_OS = "${TARGET_OS}"
145HOST_VENDOR = "${TARGET_VENDOR}"
146HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
147HOST_PREFIX = "${TARGET_PREFIX}"
148HOST_CC_ARCH = "${TARGET_CC_ARCH}"
149HOST_LD_ARCH = "${TARGET_LD_ARCH}"
150HOST_AS_ARCH = "${TARGET_AS_ARCH}"
151HOST_EXEEXT = ""
152
153TUNE_ARCH ??= "INVALID"
154TUNE_CCARGS ??= ""
155TUNE_CCARGS[vardepvalue] = "${TUNE_CCARGS}"
156TUNE_LDARGS ??= ""
157TUNE_ASARGS ??= ""
158TUNE_FEATURES ??= "${TUNE_FEATURES:tune-${DEFAULTTUNE}}"
159LIBCEXTENSION ??= ""
160ABIEXTENSION ??= ""
161USE_NLS ??= "yes"
162SDKUSE_NLS ??= "yes"
163
164TARGET_ARCH = "${TUNE_ARCH}"
165TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
166TARGET_VENDOR = "-oe"
167TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
168TARGET_PREFIX = "${TARGET_SYS}-"
169TARGET_CC_ARCH = "${TUNE_CCARGS}"
170TARGET_LD_ARCH = "${TUNE_LDARGS}"
171TARGET_AS_ARCH = "${TUNE_ASARGS}"
172
173SDKMACHINE ??= "${BUILD_ARCH}"
174SDK_OS = "${BUILD_OS}"
175SDK_VENDOR = "-oesdk"
176SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
177SDK_PREFIX = "${SDK_SYS}-"
178SDK_CC_ARCH = "${BUILD_CC_ARCH}"
179SDKPKGSUFFIX = "nativesdk"
180SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
181SDK_LD_ARCH = "${BUILD_LD_ARCH}"
182SDK_AS_ARCH = "${BUILD_AS_ARCH}"
183
184TUNE_PKGARCH ??= ""
185PACKAGE_ARCH ??= "${TUNE_PKGARCH}"
186MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('MACHINE')][bool(d.getVar('MACHINE'))].replace('-', '_')}"
187PACKAGE_EXTRA_ARCHS ??= "${PACKAGE_EXTRA_ARCHS:tune-${DEFAULTTUNE}}"
188PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
189# MACHINE_ARCH shouldn't be included here as a variable dependency
190# since machine specific packages are handled using multimachine
191PACKAGE_ARCHS[vardepsexclude] = "MACHINE_ARCH"
192
193MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
194
195##################################################################
196# Date/time variables.
197##################################################################
198
199DATE := "${@time.strftime('%Y%m%d',time.gmtime())}"
200TIME := "${@time.strftime('%H%M%S',time.gmtime())}"
201DATETIME = "${DATE}${TIME}"
202
203##################################################################
204# Openembedded Software Prerequisites.
205##################################################################
206
207# python-native should be here but python relies on building
208# its own in staging
209ASSUME_PROVIDED = "\
210    bash-native \
211    bzip2-native \
212    chrpath-native \
213    diffstat-native \
214    file-native \
215    findutils-native \
216    gawk-native \
217    git-native \
218    grep-native \
219    hostperl-runtime-native \
220    hostpython-runtime-native \
221    libgcc-native \
222    patch-native \
223    sed-native \
224    tar-native \
225    texinfo-native \
226    virtual/crypt-native \
227    virtual/libiconv-native \
228    virtual/libintl-native \
229    wget-native \
230    "
231# gzip-native should be listed above?
232
233##################################################################
234# Package default variables.
235##################################################################
236
237PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
238PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
239PR = "r0"
240PE = ""
241PF = "${PN}-${EXTENDPE}${PV}-${PR}"
242EXTENDPE = "${@['','${PE}_'][int(d.getVar('PE') or 0) > 0]}"
243P = "${PN}-${PV}"
244
245PRSERV_PV_AUTOINC = "AUTOINC"
246PRAUTO = ""
247EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO')]}"
248PRAUTOINX = "${PF}"
249
250PKGV ?= "${PV}"
251PKGR ?= "${PR}${EXTENDPRAUTO}"
252PKGE ?= "${@['','${PE}'][int(d.getVar('PE') or 0) > 0]}"
253EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE').strip() != '']}"
254EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
255
256# Base package name
257# Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
258# otherwise it is the same as PN and P
259SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-canadian"
260BPN = "${@oe.utils.prune_suffix(d.getVar('PN'), d.getVar('SPECIAL_PKGSUFFIX').split(), d)}"
261BP = "${BPN}-${PV}"
262
263# Package info.
264
265SECTION = "base"
266PRIORITY = "optional"
267SUMMARY ?= "${PN} version ${PV}-${PR}"
268DESCRIPTION ?= "${SUMMARY}."
269
270# The following two are commented out because they result in a recursive
271# definition of the variable in some corner cases.  These are left in
272# to illustrate the intended behavior.
273#SUMMARY:${PN} ?= "${SUMMARY}"
274#DESCRIPTION:${PN} ?= "${DESCRIPTION}"
275
276SUMMARY:${PN}-src ?= "${SUMMARY} - Source files"
277DESCRIPTION:${PN}-src ?= "${DESCRIPTION}  \
278This package contains sources for debugging purposes."
279
280SUMMARY:${PN}-dbg ?= "${SUMMARY} - Debugging files"
281DESCRIPTION:${PN}-dbg ?= "${DESCRIPTION}  \
282This package contains ELF symbols and related sources for debugging purposes."
283
284SUMMARY:${PN}-dev ?= "${SUMMARY} - Development files"
285DESCRIPTION:${PN}-dev ?= "${DESCRIPTION}  \
286This package contains symbolic links, header files, and \
287related items necessary for software development."
288
289SUMMARY:${PN}-staticdev ?= "${SUMMARY} - Development files (Static Libraries)"
290DESCRIPTION:${PN}-staticdev ?= "${DESCRIPTION}  \
291This package contains static libraries for software development."
292
293SUMMARY:${PN}-doc ?= "${SUMMARY} - Documentation files"
294DESCRIPTION:${PN}-doc ?= "${DESCRIPTION}  \
295This package contains documentation."
296
297LICENSE ??= "INVALID"
298MAINTAINER = "OE-Core Developers <openembedded-core@lists.openembedded.org>"
299HOMEPAGE = ""
300
301# Package dependencies and provides.
302
303# Ensure that -dev packages recommend the corresponding -dev packages of their
304# deps, and the same for -dbg.
305DEPCHAIN_PRE = ""
306DEPCHAIN_POST = "-dev -dbg"
307
308DEPENDS = ""
309PROVIDES = ""
310PROVIDES:prepend = "${PN} "
311
312BB_MULTI_PROVIDER_ALLOWED = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
313
314SOLIBS = ".so.*"
315SOLIBS:darwin = ".dylib"
316
317SOLIBSDEV = ".so"
318# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
319# we can't make the symlinks end up in the -dev packages easily at this point. This hack
320# at least means builds aren't completely broken and symlinks don't take up much space.
321SOLIBSDEV:darwin = ".dylibbroken"
322
323PACKAGE_DEBUG_SPLIT_STYLE ?= "debug-with-srcpkg"
324
325PACKAGE_BEFORE_PN ?= ""
326PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
327PACKAGES_DYNAMIC = "^${PN}-locale-.*"
328FILES = ""
329
330FILES:${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
331            ${sysconfdir} ${sharedstatedir} ${localstatedir} \
332            ${base_bindir}/* ${base_sbindir}/* \
333            ${base_libdir}/*${SOLIBS} \
334            ${base_prefix}/lib/udev ${prefix}/lib/udev \
335            ${base_libdir}/udev ${libdir}/udev \
336            ${datadir}/${BPN} ${libdir}/${BPN}/* \
337            ${datadir}/pixmaps ${datadir}/applications \
338            ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
339            ${libdir}/bonobo/servers"
340
341FILES:${PN}-bin = "${bindir}/* ${sbindir}/*"
342
343FILES:${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
344            ${datadir}/gnome/help"
345SECTION:${PN}-doc = "doc"
346
347FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
348FILES:${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
349                ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
350                ${datadir}/aclocal ${base_libdir}/*.o \
351                ${libdir}/${BPN}/*.la ${base_libdir}/*.la \
352                ${libdir}/cmake ${datadir}/cmake"
353SECTION:${PN}-dev = "devel"
354ALLOW_EMPTY:${PN}-dev = "1"
355DEV_PKG_DEPENDENCY = "${PN} (= ${EXTENDPKGV})"
356RRECOMMENDS:${PN}-dev = "${DEV_PKG_DEPENDENCY}"
357
358FILES:${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
359SECTION:${PN}-staticdev = "devel"
360RDEPENDS:${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
361
362FILES:${PN}-dbg = "/usr/lib/debug /usr/lib/debug-static /usr/src/debug"
363SECTION:${PN}-dbg = "devel"
364ALLOW_EMPTY:${PN}-dbg = "1"
365
366# The files list for source packages are dynamically set based on
367# PACKAGE_DEBUG_SPLIT_STYLE
368FILES:${PN}-src = ""
369SECTION:${PN}-src = "devel"
370
371FILES:${PN}-locale = "${datadir}/locale"
372
373# File manifest
374
375FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}"
376# FILESPATH is set in base.bbclass
377#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
378# This default was only used for checking
379FILESEXTRAPATHS ?= "__default:"
380
381# The default list of fs-perms files to process.  If the list is empty only
382# the builtin definitions will be used.  Builtin definitions included:
383#  base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir,
384#  datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
385#  mandir, docdir, bindir, sbindir, libexecdir, libdir, includedir and
386#  oldincludedir
387FILESYSTEM_PERMS_TABLES ?= "${@'files/fs-perms.txt' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'files/fs-perms-persistent-log.txt'}"
388
389##################################################################
390# General work and output directories for the build system.
391##################################################################
392
393TCMODE ??= "default"
394TCLIBC ??= "glibc"
395TC_CXX_RUNTIME ??= "gnu"
396TMPDIR ?= "${TOPDIR}/tmp"
397
398CACHE = "${TMPDIR}/cache"
399# The persistent cache should be shared by all builds
400PERSISTENT_DIR = "${TOPDIR}/cache"
401LOG_DIR = "${TMPDIR}/log"
402
403STAMPS_DIR ?= "${TMPDIR}/stamps"
404STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
405STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
406BASE_WORKDIR ?= "${TMPDIR}/work"
407WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
408T = "${WORKDIR}/temp"
409D = "${WORKDIR}/image"
410S = "${WORKDIR}/${BP}"
411B = "${S}"
412
413STAGING_DIR = "${TMPDIR}/sysroots"
414COMPONENTS_DIR = "${STAGING_DIR}-components"
415RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
416RECIPE_SYSROOT_NATIVE = "${WORKDIR}/recipe-sysroot-native"
417
418STAGING_DIR_NATIVE = "${RECIPE_SYSROOT_NATIVE}"
419STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
420STAGING_BINDIR_CROSS = "${STAGING_BINDIR}/crossscripts"
421STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
422STAGING_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${libdir_native}"
423STAGING_LIBEXECDIR_NATIVE = "${STAGING_DIR_NATIVE}${libexecdir_native}"
424STAGING_BASE_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${base_libdir_native}"
425STAGING_SBINDIR_NATIVE = "${STAGING_DIR_NATIVE}${sbindir_native}"
426STAGING_INCDIR_NATIVE = "${STAGING_DIR_NATIVE}${includedir_native}"
427STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
428STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
429
430STAGING_DIR_HOST = "${RECIPE_SYSROOT}"
431STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"
432STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}"
433STAGING_LIBEXECDIR = "${STAGING_DIR_HOST}${libexecdir}"
434STAGING_BASELIBDIR = "${STAGING_DIR_HOST}${base_libdir}"
435STAGING_INCDIR = "${STAGING_DIR_HOST}${includedir}"
436STAGING_DATADIR = "${STAGING_DIR_HOST}${datadir}"
437STAGING_EXECPREFIXDIR = "${STAGING_DIR_HOST}${exec_prefix}"
438STAGING_LOADER_DIR = "${STAGING_DIR_HOST}/loader"
439STAGING_FIRMWARE_DIR = "${STAGING_DIR_HOST}/firmware"
440
441STAGING_DIR_TARGET = "${RECIPE_SYSROOT}"
442
443# Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using
444# packaged staging and/or multimachine.
445DEPLOY_DIR ?= "${TMPDIR}/deploy"
446DEPLOY_DIR_IPK = "${DEPLOY_DIR}/ipk"
447DEPLOY_DIR_RPM = "${DEPLOY_DIR}/rpm"
448DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
449DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
450DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
451
452PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}"
453PKGDATA_DIR_SDK = "${TMPDIR}/pkgdata/${SDK_SYS}"
454
455##################################################################
456# SDK variables.
457##################################################################
458
459SDK_NAME_PREFIX ?= "oecore"
460SDK_NAME = "${SDK_NAME_PREFIX}-${IMAGE_BASENAME}-${SDK_ARCH}-${TUNE_PKGARCH}-${MACHINE}"
461SDKPATH = "/usr/local/oe-sdk-hardcoded-buildpath"
462SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
463# The path to default to installing the SDK to
464SDKPATHINSTALL = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
465
466##################################################################
467# Kernel info.
468##################################################################
469
470OLDEST_KERNEL = "5.15"
471
472# SDK_OLDEST_KERNEL can't be set using overrides since there are
473# none for the SDK architecture. Best to set it from a machine-sdk
474# include file if you need an SDK arch-specific value
475SDK_OLDEST_KERNEL = "3.2.0"
476
477# Define where the kernel headers are installed on the target as well as where
478# they are staged.
479KERNEL_SRC_PATH = "/usr/src/kernel"
480
481STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-source"
482STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts"
483
484##################################################################
485# Specific image creation and rootfs population info.
486##################################################################
487
488IMAGE_ROOTFS = "${WORKDIR}/rootfs"
489
490# This option allows for a percentage overage of the actual image size rather than a
491# fixed extra space, this is space needed for initial startup and basic operations.
492IMAGE_OVERHEAD_FACTOR ?= "1.3"
493# This option allows for adding additional space in K above and beyond what the
494# IMAGE_OVERHEAD_FACTOR might add. This space is for additional packages, user data, ...
495# To set a fixed size then overriding IMAGE_ROOTFS_SIZE with the max size one wants
496# should do the trick
497IMAGE_ROOTFS_EXTRA_SPACE ?= "0"
498
499EXTRA_IMAGEDEPENDS = ""
500
501##################################################################
502# Toolchain info.
503##################################################################
504
505PATH:prepend = "${COREBASE}/scripts:${STAGING_BINDIR_TOOLCHAIN}:${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}${base_bindir_native}:"
506export PATH
507
508##################################################################
509# Build utility info.
510##################################################################
511
512# Directory with symlinks to host tools used by build
513HOSTTOOLS_DIR = "${TMPDIR}/hosttools"
514
515# Tools needed to run builds with OE-Core
516HOSTTOOLS += " \
517    [ ar as awk basename bash bunzip2 bzip2 cat chgrp chmod chown chrpath cmp comm cp cpio \
518    cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
519    fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
520    head hostname iconv id install ld ldd ln ls lz4c make md5sum mkdir mkfifo mknod \
521    mktemp mv nm objcopy objdump od patch perl pr printf pwd \
522    python3 pzstd ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh \
523    sha1sum sha224sum sha256sum sha384sum sha512sum \
524    sleep sort split stat strings strip tail tar tee test touch tr true uname \
525    uniq unzstd wc wget which xargs zstd \
526"
527
528# Tools needed to run testimage runtime image testing
529HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"])) else ''}"
530
531# Link to these if present
532HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo"
533
534# Temporary add few more detected in bitbake world
535HOSTTOOLS_NONFATAL += "join nl size yes zcat"
536
537# Used by bzr fetcher
538HOSTTOOLS_NONFATAL += "bzr"
539
540# Used by ssh fetcher
541HOSTTOOLS_NONFATAL += "scp"
542
543# Used by Mercurial fetcher
544HOSTTOOLS_NONFATAL += "hg"
545
546# Used by gcp fetcher
547HOSTTOOLS_NONFATAL += "gsutil"
548
549# Link to git-lfs if present
550HOSTTOOLS_NONFATAL += "git-lfs"
551
552CCACHE ??= ""
553
554TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
555
556export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
557export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
558export FC = "${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
559export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
560export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
561export CCLD = "${CC}"
562export AR = "${HOST_PREFIX}gcc-ar"
563export AS = "${HOST_PREFIX}as ${HOST_AS_ARCH}"
564export RANLIB = "${HOST_PREFIX}gcc-ranlib"
565export STRIP = "${HOST_PREFIX}strip"
566export OBJCOPY = "${HOST_PREFIX}objcopy"
567export OBJDUMP = "${HOST_PREFIX}objdump"
568export STRINGS = "${HOST_PREFIX}strings"
569export NM = "${HOST_PREFIX}gcc-nm"
570export READELF = "${HOST_PREFIX}readelf"
571PYTHON = "${@sys.executable}"
572
573export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
574export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"
575export BUILD_FC = "${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
576export BUILD_CPP = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH} -E"
577export BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
578export BUILD_CCLD = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
579export BUILD_AR = "${BUILD_PREFIX}ar"
580export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
581export BUILD_RANLIB = "${BUILD_PREFIX}ranlib -D"
582export BUILD_STRIP = "${BUILD_PREFIX}strip"
583BUILD_OBJCOPY = "${BUILD_PREFIX}objcopy"
584BUILD_OBJDUMP = "${BUILD_PREFIX}objdump"
585export BUILD_NM = "${BUILD_PREFIX}nm"
586BUILD_READELF = "${BUILD_PREFIX}readelf"
587
588export MAKE = "make"
589EXTRA_OEMAKE = ""
590EXTRA_OECONF = ""
591export LC_ALL = "en_US.UTF-8"
592export TZ = 'UTC'
593
594##################################################################
595# Patch handling.
596##################################################################
597PATCHTOOL = "quilt"
598PATCHRESOLVE = "noop"
599
600##################################################################
601# Build flags and options.
602##################################################################
603
604export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
605BUILDSDK_CPPFLAGS = ""
606export CPPFLAGS = "${TARGET_CPPFLAGS}"
607TARGET_CPPFLAGS = ""
608
609export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
610BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION} ${DEBUG_PREFIX_MAP}"
611export CFLAGS = "${TARGET_CFLAGS}"
612TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
613
614export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
615BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
616export CXXFLAGS = "${TARGET_CXXFLAGS}"
617TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
618
619export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
620                        -L${STAGING_BASE_LIBDIR_NATIVE} \
621                        -Wl,--enable-new-dtags \
622                        -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
623                        -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
624                        -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
625                        -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
626                        -Wl,-O1"
627
628BUILDSDK_LDFLAGS = "-Wl,-O1"
629
630LINKER_HASH_STYLE ??= "gnu"
631
632TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE') != 'gnu']}"
633
634ASNEEDED ?= "-Wl,--as-needed"
635
636export LDFLAGS = "${TARGET_LDFLAGS}"
637TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${DEBUG_PREFIX_MAP}"
638# mips does not support GNU hash style therefore we override
639LINKER_HASH_STYLE:mipsarch:libc-musl = "sysv"
640
641# Pass parallel make options to the compile task
642EXTRA_OEMAKE:prepend:task-compile = "${PARALLEL_MAKE} "
643PARALLEL_MAKEINST ??= "${PARALLEL_MAKE}"
644PARALLEL_MAKEINST[vardepvalue] = "1"
645# Pass parallel make options to the install task
646EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
647
648##################################################################
649# Optimization flags.
650##################################################################
651TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
652# Beware: applied last to first
653DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
654 -fmacro-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
655 -fdebug-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
656 -fmacro-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
657 -fdebug-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
658 -fdebug-prefix-map=${STAGING_DIR_HOST}= \
659 -fmacro-prefix-map=${STAGING_DIR_HOST}= \
660 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
661"
662DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
663
664# Disabled until the option works properly -feliminate-dwarf2-dups
665FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
666DEBUG_OPTIMIZATION = "-Og ${DEBUG_FLAGS} -pipe"
667SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
668SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
669BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g -feliminate-unused-debug-types', '-O2', d)} -pipe"
670BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
671
672##################################################################
673# Reproducibility
674##################################################################
675
676SDE_DIR = "${WORKDIR}/source-date-epoch"
677SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt"
678SDE_DEPLOYDIR = "${WORKDIR}/deploy-source-date-epoch"
679
680export PYTHONHASHSEED = "0"
681export PERL_HASH_SEED = "0"
682export SOURCE_DATE_EPOCH ?= "${@get_source_date_epoch_value(d)}"
683# A SOURCE_DATE_EPOCH of '0' might be misinterpreted as no SDE
684SOURCE_DATE_EPOCH_FALLBACK ??= "1302044400"
685REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
686
687##################################################################
688# Settings used by bitbake-layers.
689##################################################################
690BBLAYERS_LAYERINDEX_URL ??= "https://layers.openembedded.org/layerindex/"
691BBLAYERS_FETCH_DIR ??= "${COREBASE}"
692
693##################################################################
694# Download locations and utilities.
695##################################################################
696
697APACHE_MIRROR = "https://archive.apache.org/dist"
698CPAN_MIRROR = "https://search.cpan.org/CPAN"
699DEBIAN_MIRROR = "http://ftp.debian.org/debian/pool"
700GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
701GNOME_GIT = "git://gitlab.gnome.org/GNOME"
702GNOME_MIRROR = "https://download.gnome.org/sources/"
703GNU_MIRROR = "https://ftp.gnu.org/gnu"
704GNUPG_MIRROR = "https://www.gnupg.org/ftp/gcrypt"
705GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
706KERNELORG_MIRROR = "https://cdn.kernel.org/pub"
707SAMBA_MIRROR = "http://samba.org/samba/ftp"
708SAVANNAH_GNU_MIRROR = "https://download.savannah.gnu.org/releases"
709SAVANNAH_NONGNU_MIRROR = "https://download.savannah.nongnu.org/releases"
710SOURCEFORGE_MIRROR = "https://downloads.sourceforge.net"
711XLIBS_MIRROR = "https://xlibs.freedesktop.org/release"
712XORG_MIRROR = "https://www.x.org/releases/"
713
714SRC_URI[vardepsexclude] += "\
715    APACHE_MIRROR \
716    CPAN_MIRROR \
717    DEBIAN_MIRROR \
718    GENTOO_MIRROR \
719    GNOME_GIT \
720    GNOME_MIRROR \
721    GNU_MIRROR \
722    GNUPG_MIRROR \
723    GPE_MIRROR \
724    KERNELORG_MIRROR \
725    SAMBA_MIRROR \
726    SAVANNAH_GNU_MIRROR \
727    SAVANNAH_NONGNU_MIRROR \
728    SOURCEFORGE_MIRROR \
729    XLIBS_MIRROR \
730    XORG_MIRROR \
731"
732
733# You can use the mirror of your country to get faster downloads by putting
734#  export DEBIAN_MIRROR = "http://ftp.de.debian.org/debian/pool"
735#     into your local.conf
736
737SRCDATE = "${DATE}"
738SRCREV ??= "INVALID"
739AUTOREV = "${@bb.fetch2.get_autorev(d)}"
740SRCPV = ""
741
742SRC_URI = ""
743
744# Use pseudo as the fakeroot implementation
745PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
746PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
747PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
748PSEUDO_IGNORE_PATHS = "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR}"
749PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
750PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
751PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}"
752
753export PSEUDO_DISABLED = "1"
754#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
755#export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
756#export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
757FAKEROOTBASEENV = "PSEUDO_BINDIR=${PSEUDO_SYSROOT}${bindir_native} PSEUDO_LIBDIR=${PSEUDO_SYSROOT}${prefix_native}/lib/pseudo/lib PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_IGNORE_PATHS=${@oe.path.canonicalize(d.getVar('PSEUDO_IGNORE_PATHS'))} PSEUDO_DISABLED=1 PYTHONDONTWRITEBYTECODE=1"
758FAKEROOTCMD = "${PSEUDO_SYSROOT}${bindir_native}/pseudo"
759FAKEROOTENV = "PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_IGNORE_PATHS=${@oe.path.canonicalize(d.getVar('PSEUDO_IGNORE_PATHS'))} PSEUDO_DISABLED=0"
760FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
761FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
762FAKEROOTLOGS = "${WORKDIR}/pseudo/pseudo.log"
763PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
764
765##################################################################
766# Not sure about the rest of this yet.
767##################################################################
768
769# Pre-build configuration output
770BUILDCFG_HEADER = "Build Configuration${@" (mc:${BB_CURRENT_MC})" if d.getVar("BBMULTICONFIG") else ""}:"
771BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
772BUILDCFG_VARS[type] = "list"
773BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
774BUILDCFG_NEEDEDVARS[type] = "list"
775
776# Other
777
778export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
779export PKG_CONFIG_PATH = "${PKG_CONFIG_DIR}:${STAGING_DATADIR}/pkgconfig"
780export PKG_CONFIG_LIBDIR = "${PKG_CONFIG_DIR}"
781export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
782export PKG_CONFIG_DISABLE_UNINSTALLED = "yes"
783export PKG_CONFIG_SYSTEM_LIBRARY_PATH = "${base_libdir}:${libdir}"
784export PKG_CONFIG_SYSTEM_INCLUDE_PATH = "${includedir}"
785
786# Don't allow git to chdir up past WORKDIR so that it doesn't detect the OE
787# repository when building a recipe
788export GIT_CEILING_DIRECTORIES = "${WORKDIR}"
789
790###
791### Config file processing
792###
793
794# An empty distro leads to :: entries in OVERRIDES and FILEOVERRIDES which
795# is a bad idea. Setting a dummy value is better than a ton of anonymous python.
796DISTRO ??= "nodistro"
797DISTRO_NAME ??= "OpenEmbedded"
798
799# Overrides are processed left to right, so the ones that are named later take precedence.
800# You generally want them to go from least to most specific. This means that:
801# A variable '<foo>:arm' overrides a variable '<foo>' when ${TARGET_ARCH} is arm.
802# A variable '<foo>:qemuarm' overrides '<foo>' and overrides '<foo>:arm' when ${MACHINE} is 'qemuarm'.
803# If you use combination ie '<foo>:qemuarm:arm', then '<foo>:qemuarm:arm' will override
804# '<foo>:qemuarm' and then '<foo>' will be overriden with that value from '<foo>:qemuarm'.
805# And finally '<foo>:forcevariable' overrides any standard variable, with the highest priority.
806# This works for functions as well, they are really just variables.
807#
808OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:layer-${FILE_LAYERNAME}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable"
809FILE_LAYERNAME ??= "config"
810LIBCOVERRIDE ?= ""
811CLASSOVERRIDE ?= "class-target"
812DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}"
813MACHINEOVERRIDES ?= "${MACHINE}"
814
815FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
816
817##################################################################
818# Include the rest of the config files.
819##################################################################
820
821require conf/abi_version.conf
822include conf/site.conf
823include conf/auto.conf
824include conf/local.conf
825require conf/multiconfig/${BB_CURRENT_MC}.conf
826include conf/machine/${MACHINE}.conf
827include conf/machine-sdk/${SDKMACHINE}.conf
828include conf/distro/${DISTRO}.conf
829include conf/distro/defaultsetup.conf
830include conf/documentation.conf
831include conf/licenses.conf
832require conf/sanity.conf
833require conf/cve-check-map.conf
834include conf/bblock.conf
835
836##################################################################
837# Weak variables (usually to retain backwards compatibility)
838##################################################################
839
840DL_DIR ?= "${TOPDIR}/downloads"
841SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
842IMAGE_FSTYPES ?= "tar.gz"
843IMAGE_FSTYPES_DEBUGFS ?= "tar.gz"
844
845INITRAMFS_FSTYPES ?= "cpio.gz"
846# The maximum size in Kbytes for the generated initramfs image size.
847# Usually, it should be less than 1/2 of ram size, or you may fail to
848# boot it.
849INITRAMFS_MAXSIZE ??= "131072"
850
851DEFAULT_TASK_PROVIDER ?= "packagegroup-base"
852MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}"
853
854# The size in Kbytes for the generated image if it is larger than
855# the required size (du -ks IMAGE_ROOTFS * IMAGE_OVERHEAD_FACTOR),
856# and no effect if less than it.
857IMAGE_ROOTFS_SIZE ??= "65536"
858
859# Forcefully set CACHE now so future changes to things like
860# MACHINE don't change the path to the cache
861CACHE := "${CACHE}"
862
863# Default to setting automatically based on cpu count
864BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
865
866# Default to setting automatically based on cpu count
867PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
868
869# Default parallelism and resource usage for xz
870XZ_MEMLIMIT ?= "50%"
871XZ_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
872XZ_THREADS[vardepvalue] = "1"
873XZ_DEFAULTS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}"
874XZ_DEFAULTS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS"
875
876# Default parallelism for zstd
877ZSTD_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
878ZSTD_THREADS[vardepvalue] = "1"
879
880# Limit the number of threads that OpenMP libraries will use. Otherwise they
881# may fallback to using all CPUs
882export OMP_NUM_THREADS = "${BB_NUMBER_THREADS}"
883
884##################################################################
885# Magic Cookie for SANITY CHECK
886##################################################################
887OES_BITBAKE_CONF = "1"
888
889##################################################################
890# Machine properties and packagegroup-base stuff
891##################################################################
892
893MACHINE_FEATURES ?= ""
894DISTRO_FEATURES ?= ""
895
896DISTRO_EXTRA_RDEPENDS ?= ""
897DISTRO_EXTRA_RRECOMMENDS ?= ""
898MACHINE_EXTRA_RDEPENDS ?= ""
899MACHINE_EXTRA_RRECOMMENDS ?= ""
900MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
901MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
902
903EXTRA_IMAGE_FEATURES ??= ""
904IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
905
906# Native distro features (will always be used for -native, even if they
907# are not enabled for target)
908DISTRO_FEATURES_NATIVE ?= "acl x11 ipv6 xattr"
909DISTRO_FEATURES_NATIVESDK ?= "x11"
910
911# Normally target distro features will not be applied to native builds:
912# Native distro features on this list will use the target feature value
913DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
914DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
915
916DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
917MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
918
919COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
920COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
921
922SERIAL_CONSOLES ??= ""
923
924NO_RECOMMENDATIONS ??= ""
925BAD_RECOMMENDATIONS ?= ""
926
927# Make sure SHELL isn't exported
928# (can break any number of things if the user's shell isn't POSIX-compliant,
929# including the flock command). The user's shell shouldn't affect our builds.
930SHELL[unexport] = "1"
931
932# Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
933TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH').replace("_", "-")}"
934
935# Set a default umask to use for tasks for determinism
936BB_DEFAULT_UMASK ??= "022"
937
938# Complete output from bitbake
939BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
940BB_DEFAULT_EVENTLOG ?= "${LOG_DIR}/eventlog/${DATETIME}.json"
941
942# Setup our default hash policy
943BB_SIGNATURE_HANDLER ?= "OEBasicHash"
944BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DIR \
945    THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL \
946    USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
947    STAMPS_DIR PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
948    CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_NOHASHDIR LICENSE_PATH SDKPKGSUFFIX \
949    WARN_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH \
950    BB_WORKERCONTEXT BB_LIMITEDDEPS BB_UNIHASH extend_recipe_sysroot DEPLOY_DIR \
951    SSTATE_HASHEQUIV_METHOD SSTATE_HASHEQUIV_REPORT_TASKDATA \
952    SSTATE_HASHEQUIV_OWNER CCACHE_TOP_DIR BB_HASHSERVE GIT_CEILING_DIRECTORIES \
953    OMP_NUM_THREADS BB_CURRENTTASK"
954BB_BASEHASH_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} PSEUDO_IGNORE_PATHS BUILDHISTORY_DIR \
955    SSTATE_DIR SOURCE_DATE_EPOCH RUST_BUILD_SYS RUST_HOST_SYS RUST_TARGET_SYS"
956BB_HASHCONFIG_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME SSH_AGENT_PID \
957    SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_PASSTHROUGH_ADDITIONS DISABLE_SANITY_CHECKS \
958    PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
959    GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
960    HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
961    BB_SETSCENE_ENFORCE BB_CMDLINE BB_SERVER_TIMEOUT BB_NICE_LEVEL"
962BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
963    lockfiles vardepsexclude vardeps vardepvalue vardepvalueexclude \
964    file-checksums python task nostamp \
965    sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
966    recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno \
967    progress mcdepends number_threads"
968BB_HASH_CODEPARSER_VALS = "LOGFIFO=/ T=/ WORKDIR=/ DATE=1234 TIME=1234 PV=0.0-1 PN=no-pn METADATA_REVISION=1234 SRC_URI="
969
970MLPREFIX ??= ""
971MULTILIB_VARIANTS ??= ""
972
973# Older versions of bitbake (< 1.42) don't set BB_UNIHASH. For compatibility with these
974# versions, set BB_UNIHASH equivalent to BB_TASKHASH if unspecified, which is
975# what it would be anyway if the signature generator (e.g. OEEquivHash) doesn't
976# support unihashes.
977BB_UNIHASH ?= "${BB_TASKHASH}"
978
979oe.sstatesig.find_sstate_manifest[vardepsexclude] = "BBEXTENDCURR BBEXTENDVARIANT OVERRIDES PACKAGE_EXTRA_ARCHS"
980oe.utils.get_multilib_datastore[vardepsexclude] = "DEFAULTTUNE_MULTILIB_ORIGINAL OVERRIDES"
981oe.path.format_display[vardepsexclude] = "TOPDIR"
982oe.utils.get_bb_number_threads[vardepsexclude] = "BB_NUMBER_THREADS"
983oe.packagedata.emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS"
984oe.packagedata.read_subpkgdata_extended[vardepsexclude] = "BB_NUMBER_THREADS"
985