summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-12-08 11:12:45 +0100
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-12-17 13:59:52 +0000
commit1c3c06842ac1b9c089d0a08e91c60f44e4844fac (patch)
tree21e97368be8f78a3e76b66dfda24c1d5e774519f /meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc
parentc1e048fc05542d859115990312e0753ce2dea72e (diff)
SPEC-3723: restructure meta-agl
Goal is to reach a minimal meta-agl-core as base for IVI and IC work at the same time. Trim dependencies and move most 'demo' related recipes to meta-agl-demo. v2: changed to bbapend + .inc , added description v3: testbuild of all images v4: restore -test packagegroup and -qa images, compare manifests and adapt packagegroups. v5: rebased v6: merged meta-agl-distro into meta-agl-core, due to dependency on meta-oe, moved -test packagegroup and -qa images to own layer meta-agl-core-test v7: Fixed comments from Paul Barker v8: Update the markdown files v9: restore wayland/weston/agl-compositor recipes/appends, reworked to move app f/w specific changes to bbappends in meta-app-framework and only demo specific weston-init changes to meta-agl-demo v10: fix s/agldemo/aglcore/ missed in weston-init.bbappend Description: This patch is part 1 out of 2 large patches that implement the layer rework discussed during the previous workshop. Essentially meta-agl-core is the small but versatile new core layer of AGL serving as basis for the work done by the IC and IVI EGs. All demo related work is moved to meta-agl-demo in the 2nd patchset. This should be applied together as atomic change. The resulting meta-agl/* follows these guidelines: - only bsp adaptations in meta-agl-bsp - remove the agl-profile-* layers for simplicity -- the packagegroup-agl(-profile)-graphical and so on have been kept in meta-agl-demo - meta-agl-profile-core is now meta-agl-core - meta-agl-core does pass yocto-check-layer -- therefore use the bbappend + conditional + .inc file construct found in meta-virtualization - meta-agl/meta-security has been merged into meta-agl/meta-app-framework - meta-netboot does pass yocto-check-layer - meta-pipewire does pass yocto-check-layer Migration: All packagegroups are preserved but they're now enabled by 'agl-demo'. Bug-AGL: SPEC-3723 Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ia6c6e5e6ce2b4ffa69ea94959cdc57c310ba7c53 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/25769
Diffstat (limited to 'meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc')
-rw-r--r--meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc157
1 files changed, 0 insertions, 157 deletions
diff --git a/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc b/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc
deleted file mode 100644
index 0fd55a638..000000000
--- a/meta-agl-profile-graphical-html5/recipes-wam/chromium/gn-utils.inc
+++ /dev/null
@@ -1,157 +0,0 @@
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-# GN host architecture helpers.
-#
-# BUILD_ARCH's value corresponds to what uname returns as the machine name.
-# The mapping in gn_host_arch_name() tries to match several possible values
-# returned by the Linux kernel in uname(2) into the corresponding values GN
-# understands.
-def gn_host_arch_name(d):
- """Returns a GN architecture name corresponding to the build host's machine
- architecture."""
- import re
- arch_translations = {
- r'aarch64.*': 'arm64',
- r'arm.*': 'arm',
- r'i[3456]86$': 'x86',
- r'x86_64$': 'x64',
- }
- build_arch = d.getVar("BUILD_ARCH")
- for arch_regexp, gn_arch_name in arch_translations.items():
- if re.match(arch_regexp, build_arch):
- return gn_arch_name
- bb.fatal('Unsuported BUILD_ARCH value: "%s"' % build_arch)
-
-# GN target architecture helpers.
-#
-# Determining the target architecture is more difficult, as there are many
-# different values we can use on the Yocto side (e.g. TUNE_ARCH, TARGET_ARCH,
-# MACHINEOVERRIDES etc). What we do is define the mapping with regular,
-# non-Python variables with overrides that are generic enough (i.e. "x86"
-# instead of "i586") and then use gn_target_arch_name() to return the right
-# value with some validation.
-GN_TARGET_ARCH_NAME_aarch64 = "arm64"
-GN_TARGET_ARCH_NAME_arm = "arm"
-GN_TARGET_ARCH_NAME_x86 = "x86"
-GN_TARGET_ARCH_NAME_x86-64 = "x64"
-
-BUILD_CC_toolchain-clang = "clang"
-BUILD_CXX_toolchain-clang = "clang++"
-BUILD_LD_toolchain-clang = "clang"
-
-# knob for clang, when using meta-clang to provide clang and case where
-# clang happens to be default compiler for OE we should let it use clang
-def is_default_cc_clang(d):
- """Return true if clang is default cross compiler."""
- toolchain = d.getVar("TOOLCHAIN")
- overrides = d.getVar("OVERRIDES")
- if toolchain == "clang" and "toolchain-clang" in overrides.split(":"):
- return "true"
- return "false"
-
-def clang_install_path(d):
- """Return clang compiler install path."""
- return d.getVar("STAGING_BINDIR_NATIVE")
-
-def gn_target_arch_name(d):
- """Returns a GN architecture name corresponding to the target machine's
- architecture."""
- name = d.getVar("GN_TARGET_ARCH_NAME")
- if name is None:
- bb.fatal('Unsupported target architecture. A valid override for the '
- 'GN_TARGET_ARCH_NAME variable could not be found.')
- return name
-
-def write_toolchain_file(d, file_path):
- """Creates a complete GN toolchain file in |file_path|."""
- import string
- gcc_toolchain_tmpl = string.Template(
- 'gcc_toolchain("${toolchain_name}") {\n'
- ' cc = "${cc}"\n'
- ' cxx = "${cxx}"\n'
- ' ar = "${ar}"\n'
- ' ld = cxx # GN expects a compiler, not a linker.\n'
- ' nm = "${nm}"\n'
- ' readelf = "${readelf}"\n'
- ' extra_cflags = "${extra_cflags}"\n'
- ' extra_cppflags = "${extra_cppflags}"\n'
- ' extra_cxxflags = "${extra_cxxflags}"\n'
- ' extra_ldflags = "${extra_ldflags}"\n'
- ' toolchain_args = {\n'
- ' current_cpu = "${current_cpu}"\n'
- ' current_os = "linux"\n'
- ' is_clang = false\n'
- ' }\n'
- '}\n'
- )
- clang_toolchain_tmpl = string.Template(
- 'clang_toolchain("clang_${toolchain_name}") {\n'
- ' extra_cflags = "${extra_cflags}"\n'
- ' extra_cppflags = "${extra_cppflags}"\n'
- ' extra_cxxflags = "${extra_cxxflags}"\n'
- ' extra_ldflags = "${extra_ldflags}"\n'
- ' toolchain_args = {\n'
- ' current_cpu = "${current_cpu}"\n'
- ' current_os = "linux"\n'
- ' is_clang = true\n'
- ' use_gold = true\n'
- ' }\n'
- '}\n'
- )
-
- native_toolchain = {
- 'toolchain_name': 'yocto_native',
- 'current_cpu': gn_host_arch_name(d),
- 'cc': d.expand('${BUILD_CC}'),
- 'cxx': d.expand('${BUILD_CXX}'),
- 'ar': d.expand('${BUILD_AR}'),
- 'nm': d.expand('${BUILD_NM}'),
- 'readelf': d.expand('${BUILD_PREFIX}readelf'),
- 'extra_cflags': d.expand('${BUILD_CFLAGS}'),
- 'extra_cppflags': d.expand('${BUILD_CPPFLAGS}'),
- 'extra_cxxflags': d.expand('${BUILD_CXXFLAGS}'),
- 'extra_ldflags': d.expand('${BUILD_LDFLAGS}'),
- }
- target_toolchain = {
- 'toolchain_name': 'yocto_target',
- 'current_cpu': gn_target_arch_name(d),
- 'cc': d.expand('${CC}'),
- 'cxx': d.expand('${CXX}'),
- 'ar': d.expand('${AR}'),
- 'nm': d.expand('${NM}'),
- 'readelf': d.expand('${TARGET_PREFIX}readelf'),
- 'extra_cflags': d.expand('${TARGET_CFLAGS}'),
- 'extra_cppflags': d.expand('${TARGET_CPPFLAGS}'),
- 'extra_cxxflags': d.expand('${TARGET_CXXFLAGS}'),
- 'extra_ldflags': d.expand('${TARGET_LDFLAGS}'),
- 'strip': '',
- }
-
- with open(file_path, 'w') as toolchain_file:
- toolchain_file.write(
- '# This file has been generated automatically.\n'
- '\n'
- 'import("//build/config/sysroot.gni")\n'
- 'import("//build/toolchain/gcc_toolchain.gni")\n'
- '\n'
- )
- toolchain_file.write(gcc_toolchain_tmpl.substitute(native_toolchain))
- toolchain_file.write(gcc_toolchain_tmpl.substitute(target_toolchain))
- toolchain_file.write(clang_toolchain_tmpl.substitute(native_toolchain))
- toolchain_file.write(clang_toolchain_tmpl.substitute(target_toolchain))