blob: d8a66f96cc812dd3b0cf603a63703b713500025a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001##################################################################
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_powerpc64 = "lib64"
14
15# Path prefixes
16export base_prefix = ""
17export prefix = "/usr"
18export exec_prefix = "/usr"
19
20# Base paths
21export base_bindir = "${base_prefix}/bin"
22export base_sbindir = "${base_prefix}/sbin"
23export base_libdir = "${base_prefix}/${baselib}"
24export nonarch_base_libdir = "${base_prefix}/lib"
25
26# Architecture independent paths
27export sysconfdir = "${base_prefix}/etc"
28export servicedir = "${base_prefix}/srv"
29export sharedstatedir = "${base_prefix}/com"
30export localstatedir = "${base_prefix}/var"
31export datadir = "${prefix}/share"
32export infodir = "${datadir}/info"
33export mandir = "${datadir}/man"
34export docdir = "${datadir}/doc"
35export systemd_unitdir = "${nonarch_base_libdir}/systemd"
36export systemd_system_unitdir = "${nonarch_base_libdir}/systemd/system"
37export nonarch_libdir = "${exec_prefix}/lib"
38export systemd_user_unitdir = "${nonarch_libdir}/systemd/user"
39
40# Architecture dependent paths
41export bindir = "${exec_prefix}/bin"
42export sbindir = "${exec_prefix}/sbin"
43export libdir = "${exec_prefix}/${baselib}"
44export libexecdir = "${libdir}/${BPN}"
45export includedir = "${exec_prefix}/include"
46export oldincludedir = "${exec_prefix}/include"
47localedir = "${libdir}/locale"
48
49# Linkage between native/cross/nativesdk layouts
50base_bindir_native = "/bin"
51base_sbindir_native = "/sbin"
52sysconfdir_native = "/etc"
53prefix_native = "/usr"
54bindir_native = "${prefix_native}/bin"
55sbindir_native = "${prefix_native}/sbin"
56includedir_native = "${prefix_native}/include"
57libdir_native = "${prefix_native}/lib"
58libexecdir_native = "${libdir_native}/${BPN}"
59base_libdir_native = "/lib"
60datadir_native = "${prefix_native}/share"
61bindir_cross = "/bin"
62bindir_crossscripts = "${bindir}/crossscripts"
63prefix_nativesdk = "/usr"
64bindir_nativesdk = "${prefix_nativesdk}/bin"
65includedir_nativesdk = "${prefix_nativesdk}/include"
66libdir_nativesdk = "${prefix_nativesdk}/lib"
67base_libdir_nativesdk = "/lib"
68localstatedir_nativesdk = "/var"
69
70#
71# Cross recipes need to know about the target layout
72# := is used carefully here
73#
74target_datadir := "${datadir}"
75# Used to find env/perl/python
76USRBINPATH = "${bindir}"
77USRBINPATH_class-native = "/usr/bin"
78USRBINPATH_class-nativesdk = "/usr/bin"
79
80# Root home directory
81ROOT_HOME ??= "/home/root"
82
83##################################################################
84# Architecture-dependent build variables.
85##################################################################
86
87# Immediate expansion since there is no point in reapeatedly calling
88# os.uname() throughout parsing
89BUILD_ARCH := "${@os.uname()[4]}"
90BUILD_OS := "${@os.uname()[0].lower()}"
91BUILD_VENDOR = ""
92BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
93BUILD_PREFIX = ""
94BUILD_CC_ARCH = ""
95BUILD_LD_ARCH = ""
96BUILD_AS_ARCH = ""
97BUILD_EXEEXT = ""
98
99HOST_ARCH = "${TARGET_ARCH}"
100HOST_OS = "${TARGET_OS}"
101HOST_VENDOR = "${TARGET_VENDOR}"
102HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
103HOST_PREFIX = "${TARGET_PREFIX}"
104HOST_CC_ARCH = "${TARGET_CC_ARCH}"
105HOST_LD_ARCH = "${TARGET_LD_ARCH}"
106HOST_AS_ARCH = "${TARGET_AS_ARCH}"
107HOST_EXEEXT = ""
108
109TUNE_ARCH ??= "INVALID"
110TUNE_CCARGS ??= ""
111TUNE_CCARGS[vardepvalue] = "${TUNE_CCARGS}"
112TUNE_LDARGS ??= ""
113TUNE_ASARGS ??= ""
114TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}"
115LIBCEXTENSION ??= ""
116ABIEXTENSION ??= ""
117USE_NLS ??= "${@bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', 'yes', 'no', d)}"
118SDKUSE_NLS ??= "yes"
119
120TARGET_ARCH = "${TUNE_ARCH}"
121TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
122TARGET_VENDOR = "-oe"
123TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS', True), ''][d.getVar('TARGET_OS', True) == ('' or 'custom')]}"
124TARGET_PREFIX = "${TARGET_SYS}-"
125TARGET_CC_ARCH = "${TUNE_CCARGS}"
126TARGET_LD_ARCH = "${TUNE_LDARGS}"
127TARGET_AS_ARCH = "${TUNE_ASARGS}"
128
129SDK_ARCH = "${BUILD_ARCH}"
130SDK_OS = "${BUILD_OS}"
131SDK_VENDOR = "-oesdk"
132SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}"
133SDK_PREFIX = "${SDK_SYS}-"
134SDK_CC_ARCH = "${BUILD_CC_ARCH}"
135SDKPKGSUFFIX = "nativesdk"
136SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
137SDK_LD_ARCH = "${BUILD_LD_ARCH}"
138SDK_AS_ARCH = "${BUILD_AS_ARCH}"
139
140TUNE_PKGARCH ??= ""
141PACKAGE_ARCH ??= "${TUNE_PKGARCH}"
142MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH', True), d.getVar('MACHINE', True)][bool(d.getVar('MACHINE', True))].replace('-', '_')}"
143PACKAGE_EXTRA_ARCHS ??= "${PACKAGE_EXTRA_ARCHS_tune-${DEFAULTTUNE}}"
144PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
145# MACHINE_ARCH shouldn't be included here as a variable dependency
146# since machine specific packages are handled using multimachine
147PACKAGE_ARCHS[vardepsexclude] = "MACHINE_ARCH"
148
149MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
150MULTIMACH_HOST_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
151
152##################################################################
153# Date/time variables.
154##################################################################
155
156DATE := "${@time.strftime('%Y%m%d',time.gmtime())}"
157TIME := "${@time.strftime('%H%M%S',time.gmtime())}"
158DATETIME = "${DATE}${TIME}"
159
160##################################################################
161# Openembedded Software Prerequisites.
162##################################################################
163
164# python-native should be here but python relies on building
165# its own in staging
166ASSUME_PROVIDED = "\
167 bzip2-native \
168 chrpath-native \
169 git-native \
170 grep-native \
171 diffstat-native \
172 patch-native \
173 perl-native-runtime \
174 python-native-runtime \
175 tar-native \
176 virtual/libintl-native \
177 texinfo-native \
178 bash-native \
179 sed-native \
180 "
181# gzip-native should be listed above?
182
183##################################################################
184# Package default variables.
185##################################################################
186
187PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
188PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
189PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
190PF = "${PN}-${EXTENDPE}${PV}-${PR}"
191EXTENDPE = "${@['','${PE\x7d_'][int(d.getVar('PE', True) or 0) > 0]}"
192P = "${PN}-${PV}"
193
194EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][d.getVar('PRAUTO', True) is None]}"
195PRAUTOINX = "${PF}"
196
197PKGV ?= "${PV}"
198PKGR ?= "${PR}${EXTENDPRAUTO}"
199PKGE ?= "${@['','${PE\x7d'][int(d.getVar('PE', True) or 0) > 0]}"
200EXTENDPKGEVER = "${@['','${PKGE\x7d:'][d.getVar('PKGE', True).strip() != '']}"
201EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
202
203# Base package name
204# Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
205# otherwise it is the same as PN and P
206SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-canadian"
207BPN = "${@base_prune_suffix(d.getVar('PN', True), d.getVar('SPECIAL_PKGSUFFIX', True).split(), d)}"
208BP = "${BPN}-${PV}"
209
210# Package info.
211
212SECTION = "base"
213PRIORITY = "optional"
214SUMMARY ?= "${PN} version ${PV}-${PR}"
215DESCRIPTION ?= "${SUMMARY}."
216
217# The following two are commented out because they result in a recursive
218# definition of the variable in some corner cases. These are left in
219# to illustrate the intended behavior.
220#SUMMARY_${PN} ?= "${SUMMARY}"
221#DESCRIPTION_${PN} ?= "${DESCRIPTION}"
222
223SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files"
224DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \
225This package contains ELF symbols and related sources for debugging purposes."
226
227SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
228DESCRIPTION_${PN}-dev ?= "${DESCRIPTION} \
229This package contains symbolic links, header files, and \
230related items necessary for software development."
231
232SUMMARY_${PN}-staticdev ?= "${SUMMARY} - Development files (Static Libraries)"
233DESCRIPTION_${PN}-staticdev?= "${DESCRIPTION} \
234This package contains static libraries for software development."
235
236SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
237DESCRIPTION_${PN}-doc ?= "${DESCRIPTION} \
238This package contains documentation."
239
240LICENSE = "INVALID"
241MAINTAINER = "OE-Core Developers <openembedded-core@lists.openembedded.org>"
242HOMEPAGE = ""
243
244# Package dependencies and provides.
245
246# Ensure that -dev packages recommend the corresponding -dev packages of their
247# deps, and the same for -dbg.
248DEPCHAIN_PRE = ""
249DEPCHAIN_POST = "-dev -dbg"
250
251DEPENDS = ""
252RDEPENDS = ""
253PROVIDES = ""
254PROVIDES_prepend = "${PN} "
255RPROVIDES = ""
256
257MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
258
259SOLIBS = ".so.*"
260SOLIBS_darwin = ".dylib"
261
262SOLIBSDEV = ".so"
263# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
264# we can't make the symlinks end up in the -dev packages easily at this point. This hack
265# at least means builds aren't completely broken and symlinks don't take up much space.
266SOLIBSDEV_darwin = ".dylibbroken"
267
268PACKAGE_BEFORE_PN ?= ""
269PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
270PACKAGES_DYNAMIC = "^${PN}-locale-.*"
271FILES = ""
272
273FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
274 ${sysconfdir} ${sharedstatedir} ${localstatedir} \
275 ${base_bindir}/* ${base_sbindir}/* \
276 ${base_libdir}/*${SOLIBS} \
277 ${base_prefix}/lib/udev/rules.d ${prefix}/lib/udev/rules.d \
278 ${datadir}/${BPN} ${libdir}/${BPN}/* \
279 ${datadir}/pixmaps ${datadir}/applications \
280 ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
281 ${libdir}/bonobo/servers"
282
283FILES_${PN}-bin = "${bindir}/* ${sbindir}/*"
284
285FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
286 ${datadir}/gnome/help"
287SECTION_${PN}-doc = "doc"
288
289FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
290FILES_${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
291 ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
292 ${datadir}/aclocal ${base_libdir}/*.o \
293 ${libdir}/${BPN}/*.la ${base_libdir}/*.la"
294SECTION_${PN}-dev = "devel"
295ALLOW_EMPTY_${PN}-dev = "1"
296RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
297
298FILES_${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
299SECTION_${PN}-staticdev = "devel"
300RDEPENDS_${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
301
302DOTDEBUG-dbg = "${bindir}/.debug ${sbindir}/.debug ${libexecdir}/.debug ${libdir}/.debug \
303 ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug ${libdir}/${BPN}/.debug \
304 ${libdir}/matchbox-panel/.debug ${libexecdir}/${BPN}/.debug /usr/src/debug"
305
306DEBUGFILEDIRECTORY-dbg = "/usr/lib/debug /usr/src/debug"
307
308FILES_${PN}-dbg = "${@d.getVar(['DOTDEBUG-dbg', 'DEBUGFILEDIRECTORY-dbg'][d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory'], True)}"
309
310SECTION_${PN}-dbg = "devel"
311ALLOW_EMPTY_${PN}-dbg = "1"
312
313FILES_${PN}-locale = "${datadir}/locale"
314
315# File manifest
316
317FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}"
318# FILESPATH is set in base.bbclass
319#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
320# This default was only used for checking
321FILESEXTRAPATHS ?= "__default:"
322
323##################################################################
324# General work and output directories for the build system.
325##################################################################
326
327TMPDIR ?= "${TOPDIR}/tmp"
328CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
329# The persistent cache should be shared by all builds
330PERSISTENT_DIR = "${TOPDIR}/cache"
331LOG_DIR = "${TMPDIR}/log"
332CO_DIR = "${DL_DIR}"
333CVSDIR = "${CO_DIR}/cvs"
334SVNDIR = "${CO_DIR}/svn"
335GITDIR = "${CO_DIR}/git2"
336BZRDIR = "${CO_DIR}/bzr"
337HGDIR = "${CO_DIR}/hg"
338
339STAMPS_DIR ?= "${TMPDIR}/stamps"
340STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
341STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
342BASE_WORKDIR ?= "${TMPDIR}/work"
343WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
344T = "${WORKDIR}/temp"
345D = "${WORKDIR}/image"
346S = "${WORKDIR}/${BP}"
347B = "${S}"
348
349STAGING_DIR = "${TMPDIR}/sysroots"
350
351STAGING_DIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}"
352STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
353STAGING_BINDIR_CROSS = "${STAGING_BINDIR}/crossscripts"
354STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
355STAGING_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${libdir_native}"
356STAGING_LIBEXECDIR_NATIVE = "${STAGING_DIR_NATIVE}${libexecdir_native}"
357STAGING_BASE_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${base_libdir_native}"
358STAGING_SBINDIR_NATIVE = "${STAGING_DIR_NATIVE}${sbindir_native}"
359STAGING_INCDIR_NATIVE = "${STAGING_DIR_NATIVE}${includedir_native}"
360STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
361STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
362
363STAGING_DIR_HOST = "${STAGING_DIR}/${MACHINE}"
364STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"
365STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}"
366STAGING_LIBEXECDIR = "${STAGING_DIR_HOST}${libexecdir}"
367STAGING_BASELIBDIR = "${STAGING_DIR_HOST}${base_libdir}"
368STAGING_INCDIR = "${STAGING_DIR_HOST}${includedir}"
369STAGING_DATADIR = "${STAGING_DIR_HOST}${datadir}"
370STAGING_EXECPREFIXDIR = "${STAGING_DIR_HOST}${exec_prefix}"
371STAGING_LOADER_DIR = "${STAGING_DIR_HOST}/loader"
372STAGING_FIRMWARE_DIR = "${STAGING_DIR_HOST}/firmware"
373
374STAGING_DIR_TARGET = "${STAGING_DIR}/${MACHINE}"
375STAGING_DIR_TCBOOTSTRAP = "${STAGING_DIR_TARGET}-tcbootstrap"
376
377# Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using
378# packaged staging and/or multimachine.
379DEPLOY_DIR ?= "${TMPDIR}/deploy"
380DEPLOY_DIR_TAR = "${DEPLOY_DIR}/tar"
381DEPLOY_DIR_IPK = "${DEPLOY_DIR}/ipk"
382DEPLOY_DIR_RPM = "${DEPLOY_DIR}/rpm"
383DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
384DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
385DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
386
387PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
388
389##################################################################
390# SDK variables.
391##################################################################
392
393SDK_NAME_PREFIX ?= "oecore"
394SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}"
395SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
396SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
397
398##################################################################
399# Kernel info.
400##################################################################
401
402OLDEST_KERNEL = "2.6.32"
403OLDEST_KERNEL_aarch64 = "3.14"
404STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-source"
405STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts"
406
407##################################################################
408# Specific image creation and rootfs population info.
409##################################################################
410
411IMAGE_ROOTFS = "${WORKDIR}/rootfs"
412IMAGE_BASENAME = "${PN}"
413IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
414IMAGE_NAME[vardepsexclude] += "DATETIME"
415IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
416
417# This option allows for a percentage overage of the actual image size rather than a
418# fixed extra space, this is space needed for initial startup and basic operations.
419IMAGE_OVERHEAD_FACTOR ?= "1.3"
420# This option allows for adding additional space in K above and beyond what the
421# IMAGE_OVERHEAD_FACTOR might add. This space is for additional packages, user data, ...
422# To set a fixed size then overriding IMAGE_ROOTFS_SIZE with the max size one wants
423# should do the trick
424IMAGE_ROOTFS_EXTRA_SPACE ?= "0"
425
426EXTRA_IMAGEDEPENDS = ""
427
428##################################################################
429# Toolchain info.
430##################################################################
431
432PATH_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}:"
433export PATH
434
435##################################################################
436# Build utility info.
437##################################################################
438
439CCACHE ??= ""
440# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
441# of ccache some distributions (e.g., Fedora 17).
442export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
443# Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
444# since it would always create CCACHE_DIR/.ccache even if
445# CCACHE_DISABLE = 1.
446export CCACHE_DIR ??= "${@os.getenv('HOME')}"
447
448TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
449
450export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
451export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
452export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
453export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
454export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
455export CCLD = "${CC}"
456export AR = "${HOST_PREFIX}ar"
457export AS = "${HOST_PREFIX}as ${HOST_AS_ARCH}"
458export RANLIB = "${HOST_PREFIX}ranlib"
459export STRIP = "${HOST_PREFIX}strip"
460export OBJCOPY = "${HOST_PREFIX}objcopy"
461export OBJDUMP = "${HOST_PREFIX}objdump"
462export STRINGS = "${HOST_PREFIX}strings"
463export NM = "${HOST_PREFIX}nm"
464PYTHON = "${@sys.executable}"
465
466export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
467export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"
468export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
469export BUILD_CPP = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH} -E"
470export BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
471export BUILD_CCLD = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
472export BUILD_AR = "${BUILD_PREFIX}ar"
473export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
474export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
475export BUILD_STRIP = "${BUILD_PREFIX}strip"
476export BUILD_NM = "${BUILD_PREFIX}nm"
477
478export MAKE = "make"
479EXTRA_OEMAKE = "-e MAKEFLAGS="
480EXTRA_OECONF = ""
481export LC_ALL = "C"
482
483##################################################################
484# Patch handling.
485##################################################################
486PATCHTOOL = "quilt"
487PATCHRESOLVE = "noop"
488
489##################################################################
490# Build flags and options.
491##################################################################
492
493export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
494BUILDSDK_CPPFLAGS = "-isystem${STAGING_INCDIR}"
495export CPPFLAGS = "${TARGET_CPPFLAGS}"
496export TARGET_CPPFLAGS = ""
497#export TARGET_CPPFLAGS = "-isystem${STAGING_DIR_TARGET}${includedir}"
498
499export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
500BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION}"
501export CFLAGS = "${TARGET_CFLAGS}"
502export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
503
504export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
505export CXXFLAGS = "${TARGET_CXXFLAGS}"
506export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
507
508export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
509 -L${STAGING_BASE_LIBDIR_NATIVE} \
510 -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
511 -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
512 -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
513 -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
514 -Wl,-O1"
515
516BUILDSDK_LDFLAGS = "-L${STAGING_LIBDIR} \
517 -Wl,-rpath-link,${STAGING_LIBDIR} \
518 -Wl,-rpath,${libdir} -Wl,-O1 \
519 -L${STAGING_DIR_HOST}${base_libdir} \
520 -Wl,-rpath-link,${STAGING_DIR_HOST}${base_libdir} \
521 -Wl,-rpath,${base_libdir} -Wl,-O1"
522
523LINKER_HASH_STYLE ??= "gnu"
524# mips does not support GNU hash style therefore we override
525LINKER_HASH_STYLE_mips = "sysv"
526LINKER_HASH_STYLE_mipsel = "sysv"
527LINKER_HASH_STYLE_mips64 = "sysv"
528LINKER_HASH_STYLE_mips64el = "sysv"
529LINKER_HASH_STYLE_mips64n32 = "sysv"
530LINKER_HASH_STYLE_mips64eln32 = "sysv"
531TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
532
533export LDFLAGS = "${TARGET_LDFLAGS}"
534export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
535#export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
536# -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
537# -Wl,-O1"
538
539# Which flags to leave by strip-flags() in bin/build/oebuild.sh ?
540ALLOWED_FLAGS = "-O -mcpu -march -pipe"
541
542# Pass parallel make options to the compile task
543EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
544PARALLEL_MAKEINST ??= "${PARALLEL_MAKE}"
545# Pass parallel make options to the install task
546EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} "
547
548##################################################################
549# Optimization flags.
550##################################################################
551DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types"
552# Disabled until the option works properly -feliminate-dwarf2-dups
553FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
554DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
555SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD', True) == '1'], True)}"
556SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
557BUILD_OPTIMIZATION = "-O2 -pipe"
558
559##################################################################
560# Settings used by bitbake-layers.
561##################################################################
562BBLAYERS_LAYERINDEX_URL ??= "http://layers.openembedded.org/layerindex/"
563BBLAYERS_FETCH_DIR ??= "${COREBASE}"
564
565##################################################################
566# Download locations and utilities.
567##################################################################
568
569APACHE_MIRROR = "http://www.apache.org/dist"
570DEBIAN_MIRROR = "ftp://ftp.debian.org/debian/pool"
571GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
572GNOME_GIT = "git://git.gnome.org"
573GNOME_MIRROR = "http://ftp.gnome.org/pub/GNOME/sources"
574GNU_MIRROR = "http://ftp.gnu.org/gnu"
575GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
576KERNELORG_MIRROR = "http://kernel.org/pub"
577SOURCEFORGE_MIRROR = "http://downloads.sourceforge.net"
578XLIBS_MIRROR = "http://xlibs.freedesktop.org/release"
579XORG_MIRROR = "http://xorg.freedesktop.org/releases"
580SAVANNAH_GNU_MIRROR = "http://download.savannah.gnu.org/releases"
581SAVANNAH_NONGNU_MIRROR = "http://download.savannah.nongnu.org/releases"
582CPAN_MIRROR = "http://search.cpan.org/CPAN"
583
584SRC_URI[vardepsexclude] += "\
585 APACHE_MIRROR \
586 CPAN_MIRROR \
587 DEBIAN_MIRROR \
588 GENTOO_MIRROR \
589 GNOME_GIT \
590 GNOME_MIRROR \
591 GNU_MIRROR \
592 GPE_MIRROR \
593 KERNELORG_MIRROR \
594 SAVANNAH_GNU_MIRROR \
595 SAVANNAH_NONGNU_MIRROR \
596 SOURCEFORGE_MIRROR \
597 XLIBS_MIRROR \
598 XORG_MIRROR \
599"
600
601# You can use the mirror of your country to get faster downloads by putting
602# export DEBIAN_MIRROR = "ftp://ftp.de.debian.org/debian/pool"
603# into your local.conf
604
605FETCHCMD_svn = "/usr/bin/env svn --non-interactive --trust-server-cert"
606FETCHCMD_cvs = "/usr/bin/env cvs"
607FETCHCMD_wget = "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
608FETCHCMD_bzr = "/usr/bin/env bzr"
609FETCHCMD_hg = "/usr/bin/env hg"
610
611SRCDATE = "${DATE}"
612SRCREV ??= "INVALID"
613AUTOREV = "${@bb.fetch2.get_autorev(d)}"
614SRCPV = "${@bb.fetch2.get_srcrev(d)}"
615SRCPV[vardepvalue] = "${SRCPV}"
616
617SRC_URI = ""
618
619# Use pseudo as the fakeroot implementation
620PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
621PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${STAGING_DIR_NATIVE}"
622export PSEUDO_DISABLED = "1"
623#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
624#export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
625#export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
626FAKEROOTBASEENV = "PSEUDO_BINDIR=${STAGING_BINDIR_NATIVE} PSEUDO_LIBDIR=${STAGING_BINDIR_NATIVE}/../lib/pseudo/lib PSEUDO_PREFIX=${STAGING_BINDIR_NATIVE}/../../ PSEUDO_DISABLED=1"
627FAKEROOTCMD = "${STAGING_BINDIR_NATIVE}/pseudo"
628FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
629FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
630FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
631PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
632
633##################################################################
634# Miscellaneous utilities.
635##################################################################
636
637# GNU patch tries to be intellgent about checking out read-only files from
638# a RCS, which freaks out those special folks with active Perforce clients
639# the following makes patch ignore RCS:
640
641export PATCH_GET="0"
642
643##################################################################
644# Not sure about the rest of this yet.
645##################################################################
646
647# Pre-build configuration output
648BUILDCFG_HEADER = "Build Configuration:"
649BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
650BUILDCFG_VARS[type] = "list"
651BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
652BUILDCFG_NEEDEDVARS[type] = "list"
653
654# Other
655
656export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
657export PKG_CONFIG_PATH = "${PKG_CONFIG_DIR}:${STAGING_DATADIR}/pkgconfig"
658export PKG_CONFIG_LIBDIR = "${PKG_CONFIG_DIR}"
659export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
660export PKG_CONFIG_DISABLE_UNINSTALLED = "yes"
661
662###
663### Config file processing
664###
665
666# An empty distro leads to :: entries in OVERRIDES and FILEOVERRIDES which
667# is a bad idea. Setting a dummy value is better than a ton of anonymous python.
668DISTRO ??= "nodistro"
669DISTRO_NAME ??= "OpenEmbedded"
670# Overrides are processed left to right, so the ones that are named later take precedence.
671# You generally want them to go from least to most specific.
672#
673# This means that an envionment variable named '<foo>_arm' overrides an
674# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
675# An environment variable '<foo>_qemuarm' overrides '<foo>' and overrides
676# '<foo>_arm' when ${MACHINE} is 'qemuarm'.
677# If you use combination ie '<foo>_qemuarm_arm', then '<foo>_qemuarm_arm' will override
678# '<foo>_qemuarm' and then '<foo>' will be overriden with that value from '<foo>_qemuarm'.
679# And finally '<foo>_forcevariable' overrides any standard variable, with the highest priority.
680#
681# This works for functions as well, they are really just environment variables.
682# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
683OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
684OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES"
685CLASSOVERRIDE ?= "class-target"
686DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"
687MACHINEOVERRIDES ?= "${MACHINE}"
688MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
689
690FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
691
692##################################################################
693# Include the rest of the config files.
694##################################################################
695
696require conf/abi_version.conf
697include conf/site.conf
698include conf/auto.conf
699include conf/local.conf
700include conf/build/${BUILD_SYS}.conf
701include conf/target/${TARGET_SYS}.conf
702include conf/machine/${MACHINE}.conf
703include conf/machine-sdk/${SDKMACHINE}.conf
704include conf/distro/${DISTRO}.conf
705include conf/distro/defaultsetup.conf
706include conf/documentation.conf
707include conf/licenses.conf
708require conf/sanity.conf
709
710##################################################################
711# Weak variables (usually to retain backwards compatibility)
712##################################################################
713
714DL_DIR ?= "${TOPDIR}/downloads"
715SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
716IMAGE_FSTYPES ?= "tar.gz"
717INITRAMFS_FSTYPES ?= "cpio.gz"
718DEFAULT_TASK_PROVIDER ?= "packagegroup-base"
719MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}"
720
721# The size in Kbytes for the generated image if it is larger than
722# the required size (du -ks IMAGE_ROOTFS * IMAGE_OVERHEAD_FACTOR),
723# and no effect if less than it.
724IMAGE_ROOTFS_SIZE ??= "65536"
725
726# Forcefully set CACHE now so future changes to things like
727# MACHINE don't change the path to the cache
728CACHE := "${CACHE}"
729
730# Default to setting automatically based on cpu count
731BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
732
733# Default to setting automatically based on cpu count
734PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
735
736##################################################################
737# Magic Cookie for SANITY CHECK
738##################################################################
739OES_BITBAKE_CONF = "1"
740
741##################################################################
742# Machine properties and packagegroup-base stuff
743##################################################################
744
745MACHINE_FEATURES ?= ""
746DISTRO_FEATURES ?= ""
747
748DISTRO_EXTRA_RDEPENDS ?= ""
749DISTRO_EXTRA_RRECOMMENDS ?= ""
750MACHINE_EXTRA_RDEPENDS ?= ""
751MACHINE_EXTRA_RRECOMMENDS ?= ""
752MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
753MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
754
755EXTRA_IMAGE_FEATURES ??= ""
756IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
757
758DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5"
759MACHINE_FEATURES_BACKFILL = "rtc"
760
761COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
762COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
763
764SERIAL_CONSOLE ??= ""
765SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
766
767NO_RECOMMENDATIONS ?= ""
768BAD_RECOMMENDATIONS ?= ""
769
770# Make sure MACHINE isn't exported
771# (breaks binutils at least)
772MACHINE[unexport] = "1"
773
774# Make sure TARGET_ARCH isn't exported
775# (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
776# in them, undocumented)
777TARGET_ARCH[unexport] = "1"
778
779# Make sure DISTRO isn't exported
780# (breaks sysvinit at least)
781DISTRO[unexport] = "1"
782
783# Make sure SHELL isn't exported
784# (can break any number of things if the user's shell isn't POSIX-compliant,
785# including the flock command). The user's shell shouldn't affect our builds.
786SHELL[unexport] = "1"
787
788# Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
789TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH', True).replace("_", "-")}"
790
791# Complete output from bitbake
792BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
793
794# Setup our default hash policy
795BB_SIGNATURE_HANDLER ?= "OEBasicHash"
796BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
797 SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
798 USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
799 PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
800 CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX \
801 WARN_QA ERROR_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH"
802BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
803 SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
804 PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED"
805BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
806 lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
807 file-checksums python func task export unexport noexec nostamp dirs cleandirs \
808 sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
809 recrdeptask nodeprrecs stamp-base stamp-extra-info"
810
811MLPREFIX ??= ""
812MULTILIB_VARIANTS ??= ""