2010-02-11 16:11:01 +00:00
|
|
|
# We want native packages to be relocatable
|
|
|
|
inherit relocatable
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
# Native packages are built indirectly via dependency,
|
|
|
|
# no need for them to be a direct target of 'world'
|
|
|
|
EXCLUDE_FROM_WORLD = "1"
|
|
|
|
|
|
|
|
PACKAGES = ""
|
2009-11-16 22:38:44 +00:00
|
|
|
PACKAGES_virtclass-native = ""
|
2011-03-15 14:37:47 +00:00
|
|
|
PACKAGES_DYNAMIC = ""
|
|
|
|
PACKAGES_DYNAMIC_virtclass-native = ""
|
2006-02-10 11:38:23 +00:00
|
|
|
PACKAGE_ARCH = "${BUILD_ARCH}"
|
|
|
|
|
2011-05-08 17:45:39 +00:00
|
|
|
# used by cmake class
|
|
|
|
OECMAKE_RPATH = "${libdir}"
|
|
|
|
OECMAKE_RPATH_virtclass-native = "${libdir}"
|
|
|
|
|
2006-02-10 11:38:23 +00:00
|
|
|
# When this class has packaging enabled, setting
|
|
|
|
# RPROVIDES becomes unnecessary.
|
|
|
|
RPROVIDES = "${PN}"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
TARGET_ARCH = "${BUILD_ARCH}"
|
|
|
|
TARGET_OS = "${BUILD_OS}"
|
|
|
|
TARGET_VENDOR = "${BUILD_VENDOR}"
|
|
|
|
TARGET_PREFIX = "${BUILD_PREFIX}"
|
|
|
|
TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
|
2011-07-27 22:31:28 +00:00
|
|
|
TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
|
|
|
|
TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
|
2011-04-05 01:13:45 +00:00
|
|
|
TARGET_FPU = ""
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
HOST_ARCH = "${BUILD_ARCH}"
|
|
|
|
HOST_OS = "${BUILD_OS}"
|
|
|
|
HOST_VENDOR = "${BUILD_VENDOR}"
|
|
|
|
HOST_PREFIX = "${BUILD_PREFIX}"
|
|
|
|
HOST_CC_ARCH = "${BUILD_CC_ARCH}"
|
2011-07-27 22:31:28 +00:00
|
|
|
HOST_LD_ARCH = "${BUILD_LD_ARCH}"
|
|
|
|
HOST_AS_ARCH = "${BUILD_AS_ARCH}"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
CPPFLAGS = "${BUILD_CPPFLAGS}"
|
|
|
|
CFLAGS = "${BUILD_CFLAGS}"
|
|
|
|
CXXFLAGS = "${BUILD_CFLAGS}"
|
|
|
|
LDFLAGS = "${BUILD_LDFLAGS}"
|
2007-11-12 11:25:30 +00:00
|
|
|
LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE} "
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2006-11-25 10:01:30 +00:00
|
|
|
STAGING_BINDIR = "${STAGING_BINDIR_NATIVE}"
|
2007-01-08 21:07:49 +00:00
|
|
|
STAGING_BINDIR_CROSS = "${STAGING_BINDIR_NATIVE}"
|
2006-05-27 21:49:50 +00:00
|
|
|
|
2012-03-15 13:50:59 +00:00
|
|
|
# native pkg doesn't need the TOOLCHAIN_OPTIONS.
|
|
|
|
TOOLCHAIN_OPTIONS = ""
|
|
|
|
|
2010-01-05 21:10:47 +00:00
|
|
|
DEPENDS_GETTEXT = "gettext-native"
|
|
|
|
|
2007-09-01 16:40:35 +00:00
|
|
|
# Don't use site files for native builds
|
|
|
|
export CONFIG_SITE = ""
|
|
|
|
|
2006-05-27 21:49:50 +00:00
|
|
|
# set the compiler as well. It could have been set to something else
|
|
|
|
export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
|
|
|
|
export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}"
|
|
|
|
export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}"
|
2011-07-27 22:31:28 +00:00
|
|
|
export CPP = "${HOST_PREFIX}gcc ${HOST_CC_ARCH} -E"
|
|
|
|
export LD = "${HOST_PREFIX}ld ${HOST_LD_ARCH} "
|
2006-05-27 21:49:50 +00:00
|
|
|
export CCLD = "${CC}"
|
|
|
|
export AR = "${HOST_PREFIX}ar"
|
2011-07-27 22:31:28 +00:00
|
|
|
export AS = "${HOST_PREFIX}as ${HOST_AS_ARCH}"
|
2006-05-27 21:49:50 +00:00
|
|
|
export RANLIB = "${HOST_PREFIX}ranlib"
|
|
|
|
export STRIP = "${HOST_PREFIX}strip"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
# Path prefixes
|
2009-09-16 22:09:44 +00:00
|
|
|
base_prefix = "${STAGING_DIR_NATIVE}"
|
2009-09-16 23:56:15 +00:00
|
|
|
prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
|
|
|
|
exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
|
2009-09-16 22:09:44 +00:00
|
|
|
|
2011-07-11 07:23:14 +00:00
|
|
|
libdir = "${STAGING_DIR_NATIVE}${libdir_native}"
|
|
|
|
|
2011-10-06 22:13:54 +00:00
|
|
|
baselib = "lib"
|
|
|
|
|
2011-09-23 07:57:31 +00:00
|
|
|
# Libtool's default paths are correct for the native machine
|
|
|
|
lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
|
|
|
|
|
2012-03-21 11:26:09 +00:00
|
|
|
NATIVE_PACKAGE_PATH_SUFFIX ?= ""
|
2011-05-31 07:07:35 +00:00
|
|
|
bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
|
|
|
|
libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
|
|
|
|
libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
|
|
|
|
|
2011-01-18 08:17:58 +00:00
|
|
|
do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}"
|
|
|
|
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_NATIVE}"
|
|
|
|
|
2009-09-16 22:09:44 +00:00
|
|
|
# Since we actually install these into situ there is no staging prefix
|
|
|
|
STAGING_DIR_HOST = ""
|
|
|
|
STAGING_DIR_TARGET = ""
|
|
|
|
SHLIBSDIR = "${STAGING_DIR_NATIVE}/shlibs"
|
|
|
|
PKG_CONFIG_DIR = "${libdir}/pkgconfig"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2010-08-16 20:38:31 +00:00
|
|
|
EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
|
2007-04-03 22:33:11 +00:00
|
|
|
PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
|
2007-11-12 11:30:16 +00:00
|
|
|
PKG_CONFIG_SYSROOT_DIR = ""
|
2009-01-03 11:27:13 +00:00
|
|
|
|
2011-12-01 03:07:07 +00:00
|
|
|
# we dont want libc-uclibc or libc-glibc to kick in for native recipes
|
|
|
|
LIBCOVERRIDE = ""
|
2012-02-11 02:58:28 +00:00
|
|
|
CLASSOVERRIDE = "class-native"
|
2011-12-01 03:07:07 +00:00
|
|
|
|
2012-06-26 17:53:54 +00:00
|
|
|
PATH_prepend = "${COREBASE}/scripts/native-intercept:"
|
2011-06-23 16:58:26 +00:00
|
|
|
|
2011-06-09 16:56:23 +00:00
|
|
|
python native_virtclass_handler () {
|
|
|
|
if not isinstance(e, bb.event.RecipePreFinalise):
|
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
|
2011-06-09 16:56:23 +00:00
|
|
|
if "native" not in classextend:
|
|
|
|
return
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
pn = e.data.getVar("PN", True)
|
2011-06-09 16:56:23 +00:00
|
|
|
if not pn.endswith("-native"):
|
|
|
|
return
|
|
|
|
|
|
|
|
def map_dependencies(varname, d, suffix = ""):
|
|
|
|
if suffix:
|
|
|
|
varname = varname + "_" + suffix
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
deps = d.getVar(varname, True)
|
2011-06-09 16:56:23 +00:00
|
|
|
if not deps:
|
|
|
|
return
|
|
|
|
deps = bb.utils.explode_deps(deps)
|
2009-11-09 16:04:51 +00:00
|
|
|
newdeps = []
|
|
|
|
for dep in deps:
|
|
|
|
if dep.endswith("-cross"):
|
2009-11-05 20:05:45 +00:00
|
|
|
newdeps.append(dep.replace("-cross", "-native"))
|
2009-11-09 16:04:51 +00:00
|
|
|
elif not dep.endswith("-native"):
|
2009-11-05 20:05:45 +00:00
|
|
|
newdeps.append(dep + "-native")
|
2009-01-03 11:27:13 +00:00
|
|
|
else:
|
2009-11-05 20:05:45 +00:00
|
|
|
newdeps.append(dep)
|
2011-11-25 14:25:16 +00:00
|
|
|
d.setVar(varname, " ".join(newdeps))
|
2011-06-09 16:56:23 +00:00
|
|
|
|
|
|
|
map_dependencies("DEPENDS", e.data)
|
2011-12-17 10:08:53 +00:00
|
|
|
for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
|
2011-06-09 16:56:23 +00:00
|
|
|
map_dependencies("RDEPENDS", e.data, pkg)
|
|
|
|
map_dependencies("RRECOMMENDS", e.data, pkg)
|
|
|
|
map_dependencies("RSUGGESTS", e.data, pkg)
|
|
|
|
map_dependencies("RPROVIDES", e.data, pkg)
|
|
|
|
map_dependencies("RREPLACES", e.data, pkg)
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
provides = e.data.getVar("PROVIDES", True)
|
2011-06-09 16:56:23 +00:00
|
|
|
for prov in provides.split():
|
|
|
|
if prov.find(pn) != -1:
|
|
|
|
continue
|
|
|
|
if not prov.endswith("-native"):
|
|
|
|
provides = provides.replace(prov, prov + "-native")
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
e.data.setVar("PROVIDES", provides)
|
2011-06-09 16:56:23 +00:00
|
|
|
|
2011-11-25 14:25:16 +00:00
|
|
|
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
|
2009-01-03 11:27:13 +00:00
|
|
|
}
|
|
|
|
|
2011-06-09 16:56:23 +00:00
|
|
|
addhandler native_virtclass_handler
|
|
|
|
|
2010-11-28 15:59:53 +00:00
|
|
|
do_package[noexec] = "1"
|
|
|
|
do_package_write_ipk[noexec] = "1"
|
|
|
|
do_package_write_deb[noexec] = "1"
|
|
|
|
do_package_write_rpm[noexec] = "1"
|
|
|
|
|
2011-01-18 08:18:42 +00:00
|
|
|
do_populate_sysroot[stamp-extra-info] = ""
|
|
|
|
do_package[stamp-extra-info] = ""
|