[OE-core] how many ways can a recipe place content in its own ${STAGING_BINDIR_CROSS}?
Robert P. J. Day
rpjday at crashcourse.ca
Tue Feb 7 12:21:54 UTC 2017
looking at how a recipe builds its own recipe-sysroot and
recipe-sysroot-native based on build dependencies, so i need to back
up and look at how a recipe installs content under its own sysroot, so
i'll use apache2 as an example.
if i look at what is installed under
sysroots-components/ppc7400/apache2, i can see that this is the entire
contents further under usr/bin:
$ tree usr/bin
usr/bin
└── crossscripts
└── apxs
fair enough, so how did that "apxs" script come to be there? ah, in
the apache2_2.4.25.bb recipe file, it's simply done manually:
SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
apache_sysroot_preprocess () {
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
install -m 755 ${D}${bindir}/apxs ${SYSROOT_DESTDIR}${bindir_crossscripts}/
... snip ...
ok, that's easy enough, but let's look at "apr" now. if i look at what
apr installs under its sysroot and specifically under the same usr/bin
directory, i see:
$ tree usr/bin
usr/bin
└── crossscripts
└── apr-1-config
so how did *that* script come to be under there? if i look at the
apr_1.5.2.bb recipe, there's no manual installation of that script as
there was with apache2. rather, there's all this:
do_install_append_class-target() {
sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
sed -i -e 's,${STAGING_DIR_HOST},,g' \
-e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
-e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
}
SSTATE_SCAN_FILES += "apr_rules.mk libtool"
SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
apr_sysroot_preprocess () {
d=${SYSROOT_DESTDIR}${datadir}/apr
install -d $d/
cp ${S}/build/apr_rules.mk $d/
sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
cp ${S}/build/mkdir.sh $d/
cp ${S}/build/make_exports.awk $d/
cp ${S}/build/make_var_export.awk $d/
cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
so i can only assume that, somewhere in the middle of all that,
there is an implied installation of the "apr-1-config" script in the
crossscripts directory. is that what's happening?
i can see a number of recipes that install content under their
sysroot/usr/bin/crossscripts, i'm just trying to clarify the different
ways that that happens.
one more crossscripts question coming shortly.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the Openembedded-core
mailing list