blob: bcbcd61e035ed8b152ed4c12b93caa2a442d36b4 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# We want native packages to be relocatable
2inherit relocatable
3
4# Native packages are built indirectly via dependency,
5# no need for them to be a direct target of 'world'
6EXCLUDE_FROM_WORLD = "1"
7
8PACKAGES = ""
9PACKAGES_class-native = ""
10PACKAGES_DYNAMIC = ""
11PACKAGES_DYNAMIC_class-native = ""
12PACKAGE_ARCH = "${BUILD_ARCH}"
13
14# used by cmake class
15OECMAKE_RPATH = "${libdir}"
16OECMAKE_RPATH_class-native = "${libdir}"
17
18# When this class has packaging enabled, setting
19# RPROVIDES becomes unnecessary.
20RPROVIDES = "${PN}"
21
22TARGET_ARCH = "${BUILD_ARCH}"
23TARGET_OS = "${BUILD_OS}"
24TARGET_VENDOR = "${BUILD_VENDOR}"
25TARGET_PREFIX = "${BUILD_PREFIX}"
26TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
27TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
28TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
29TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
30TARGET_CFLAGS = "${BUILD_CFLAGS}"
31TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
32TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
33TARGET_FPU = ""
34
35HOST_ARCH = "${BUILD_ARCH}"
36HOST_OS = "${BUILD_OS}"
37HOST_VENDOR = "${BUILD_VENDOR}"
38HOST_PREFIX = "${BUILD_PREFIX}"
39HOST_CC_ARCH = "${BUILD_CC_ARCH}"
40HOST_LD_ARCH = "${BUILD_LD_ARCH}"
41HOST_AS_ARCH = "${BUILD_AS_ARCH}"
42
43CPPFLAGS = "${BUILD_CPPFLAGS}"
44CFLAGS = "${BUILD_CFLAGS}"
45CXXFLAGS = "${BUILD_CFLAGS}"
46LDFLAGS = "${BUILD_LDFLAGS}"
47LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE} "
48
49STAGING_BINDIR = "${STAGING_BINDIR_NATIVE}"
50STAGING_BINDIR_CROSS = "${STAGING_BINDIR_NATIVE}"
51
52# native pkg doesn't need the TOOLCHAIN_OPTIONS.
53TOOLCHAIN_OPTIONS = ""
54
55DEPENDS_GETTEXT = "gettext-native"
56
57# Don't build ptest natively
58PTEST_ENABLED = "0"
59
60# Don't use site files for native builds
61export CONFIG_SITE = "${COREBASE}/meta/site/native"
62
63# set the compiler as well. It could have been set to something else
64export CC = "${BUILD_CC}"
65export CXX = "${BUILD_CXX}"
66export FC = "${BUILD_FC}"
67export CPP = "${BUILD_CPP}"
68export LD = "${BUILD_LD}"
69export CCLD = "${BUILD_CCLD}"
70export AR = "${BUILD_AR}"
71export AS = "${BUILD_AS}"
72export RANLIB = "${BUILD_RANLIB}"
73export STRIP = "${BUILD_STRIP}"
74export NM = "${BUILD_NM}"
75
76# Path prefixes
77base_prefix = "${STAGING_DIR_NATIVE}"
78prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
79exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
80
81bindir = "${STAGING_BINDIR_NATIVE}"
82sbindir = "${STAGING_SBINDIR_NATIVE}"
83libdir = "${STAGING_LIBDIR_NATIVE}"
84includedir = "${STAGING_INCDIR_NATIVE}"
85sysconfdir = "${STAGING_ETCDIR_NATIVE}"
86datadir = "${STAGING_DATADIR_NATIVE}"
87
88baselib = "lib"
89
90# Libtool's default paths are correct for the native machine
91lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
92
93NATIVE_PACKAGE_PATH_SUFFIX ?= ""
94bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
95libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
96libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
97
98do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
99do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_NATIVE}/"
100
101# Since we actually install these into situ there is no staging prefix
102STAGING_DIR_HOST = ""
103STAGING_DIR_TARGET = ""
104PKG_CONFIG_DIR = "${libdir}/pkgconfig"
105
106EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
107PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
108PKG_CONFIG_SYSROOT_DIR = ""
109
110# we dont want libc-uclibc or libc-glibc to kick in for native recipes
111LIBCOVERRIDE = ""
112CLASSOVERRIDE = "class-native"
113MACHINEOVERRIDES = ""
114
115PATH_prepend = "${COREBASE}/scripts/native-intercept:"
116
117python native_virtclass_handler () {
118 classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
119 if "native" not in classextend:
120 return
121
122 pn = e.data.getVar("PN", True)
123 if not pn.endswith("-native"):
124 return
125
126 def map_dependencies(varname, d, suffix = ""):
127 if suffix:
128 varname = varname + "_" + suffix
129 deps = d.getVar(varname, True)
130 if not deps:
131 return
132 deps = bb.utils.explode_deps(deps)
133 newdeps = []
134 for dep in deps:
135 if dep == pn:
136 continue
137 elif "-cross-" in dep:
138 newdeps.append(dep.replace("-cross", "-native"))
139 elif not dep.endswith("-native"):
140 newdeps.append(dep + "-native")
141 else:
142 newdeps.append(dep)
143 d.setVar(varname, " ".join(newdeps))
144
145 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
146
147 map_dependencies("DEPENDS", e.data)
148 for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
149 map_dependencies("RDEPENDS", e.data, pkg)
150 map_dependencies("RRECOMMENDS", e.data, pkg)
151 map_dependencies("RSUGGESTS", e.data, pkg)
152 map_dependencies("RPROVIDES", e.data, pkg)
153 map_dependencies("RREPLACES", e.data, pkg)
154
155 provides = e.data.getVar("PROVIDES", True)
156 nprovides = []
157 for prov in provides.split():
158 if prov.find(pn) != -1:
159 nprovides.append(prov)
160 elif not prov.endswith("-native"):
161 nprovides.append(prov.replace(prov, prov + "-native"))
162 else:
163 nprovides.append(prov)
164 e.data.setVar("PROVIDES", ' '.join(nprovides))
165
166
167}
168
169addhandler native_virtclass_handler
170native_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
171
172deltask package
173deltask packagedata
174deltask package_qa
175deltask package_write_ipk
176deltask package_write_deb
177deltask package_write_rpm
178deltask package_write
179
180do_packagedata[stamp-extra-info] = ""
181do_populate_sysroot[stamp-extra-info] = ""
182
183USE_NLS = "no"