summaryrefslogtreecommitdiffstats
path: root/meta/classes/cross-canadian.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/cross-canadian.bbclass')
-rw-r--r--meta/classes/cross-canadian.bbclass102
1 files changed, 102 insertions, 0 deletions
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
new file mode 100644
index 0000000..7181c60
--- /dev/null
+++ b/meta/classes/cross-canadian.bbclass
@@ -0,0 +1,102 @@
1#
2# NOTE - When using this class the user is repsonsible for ensuring that
3# TRANSLATED_TARGET_ARCH is added into PN. This ensures that if the TARGET_ARCH
4# is changed, another nativesdk xxx-canadian-cross can be installed
5#
6
7
8# SDK packages are built either explicitly by the user,
9# or indirectly via dependency. No need to be in 'world'.
10EXCLUDE_FROM_WORLD = "1"
11CLASSOVERRIDE = "class-cross-canadian"
12STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
13
14#
15# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
16#
17PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
18python () {
19 archs = d.getVar('PACKAGE_ARCHS', True).split()
20 sdkarchs = []
21 for arch in archs:
22 sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
23 d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
24}
25MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
26
27INHIBIT_DEFAULT_DEPS = "1"
28
29STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
30
31TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
32
33PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
34PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
35
36HOST_ARCH = "${SDK_ARCH}"
37HOST_VENDOR = "${SDK_VENDOR}"
38HOST_OS = "${SDK_OS}"
39HOST_PREFIX = "${SDK_PREFIX}"
40HOST_CC_ARCH = "${SDK_CC_ARCH}"
41HOST_LD_ARCH = "${SDK_LD_ARCH}"
42HOST_AS_ARCH = "${SDK_AS_ARCH}"
43
44#assign DPKG_ARCH
45DPKG_ARCH = "${SDK_ARCH}"
46
47CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
48CFLAGS = "${BUILDSDK_CFLAGS}"
49CXXFLAGS = "${BUILDSDK_CFLAGS}"
50LDFLAGS = "${BUILDSDK_LDFLAGS} \
51 -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
52 -Wl,-rpath,${libdir}/.. "
53
54DEPENDS_GETTEXT = "gettext-native nativesdk-gettext"
55
56#
57# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
58# binaries
59#
60DEPENDS_append = " chrpath-replacement-native"
61EXTRANATIVEPATH += "chrpath-native"
62
63# Path mangling needed by the cross packaging
64# Note that we use := here to ensure that libdir and includedir are
65# target paths.
66target_libdir := "${libdir}"
67target_includedir := "${includedir}"
68target_base_libdir := "${base_libdir}"
69target_prefix := "${prefix}"
70target_exec_prefix := "${exec_prefix}"
71
72# Change to place files in SDKPATH
73base_prefix = "${SDKPATHNATIVE}"
74prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
75exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
76bindir = "${exec_prefix}/bin/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
77sbindir = "${bindir}"
78base_bindir = "${bindir}"
79base_sbindir = "${bindir}"
80libdir = "${exec_prefix}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
81libexecdir = "${exec_prefix}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
82
83FILES_${PN} = "${prefix}"
84FILES_${PN}-dbg += "${prefix}/.debug \
85 ${prefix}/bin/.debug \
86 "
87
88export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
89export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
90
91do_populate_sysroot[stamp-extra-info] = ""
92
93USE_NLS = "${SDKUSE_NLS}"
94
95# We have to us TARGET_ARCH but we care about the absolute value
96# and not any particular tune that is enabled.
97TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
98
99# If MLPREFIX is set by multilib code, shlibs
100# points to the wrong place so force it
101SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs"
102SHLIBSWORKDIR = "${PKGDATA_DIR}/nativesdk-shlibs"