2012-06-05 11:54:09 +00:00
|
|
|
FILES_${PN}-dev += "${bindir}/*-config"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
# The namespaces can clash here hence the two step replace
|
|
|
|
def get_binconfig_mangle(d):
|
2014-03-24 15:18:52 +00:00
|
|
|
s = "-e ''"
|
|
|
|
if not bb.data.inherits_class('native', d):
|
|
|
|
optional_quote = r"\(\"\?\)"
|
|
|
|
s += " -e 's:=%s${base_libdir}:=\\1OEBASELIBDIR:;'" % optional_quote
|
|
|
|
s += " -e 's:=%s${libdir}:=\\1OELIBDIR:;'" % optional_quote
|
|
|
|
s += " -e 's:=%s${includedir}:=\\1OEINCDIR:;'" % optional_quote
|
|
|
|
s += " -e 's:=%s${datadir}:=\\1OEDATADIR:'" % optional_quote
|
|
|
|
s += " -e 's:=%s${prefix}/:=\\1OEPREFIX/:'" % optional_quote
|
|
|
|
s += " -e 's:=%s${exec_prefix}/:=\\1OEEXECPREFIX/:'" % optional_quote
|
|
|
|
s += " -e 's:-L${libdir}:-LOELIBDIR:;'"
|
|
|
|
s += " -e 's:-I${includedir}:-IOEINCDIR:;'"
|
2017-02-13 06:33:31 +00:00
|
|
|
s += " -e 's:-L${WORKDIR}:-LOELIBDIR:'"
|
2017-04-13 09:57:23 +00:00
|
|
|
s += " -e 's:-I${WORKDIR}:-IOEINCDIR:'"
|
2014-03-24 15:18:52 +00:00
|
|
|
s += " -e 's:OEBASELIBDIR:${STAGING_BASELIBDIR}:;'"
|
|
|
|
s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
|
|
|
|
s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
|
|
|
|
s += " -e 's:OEDATADIR:${STAGING_DATADIR}:'"
|
|
|
|
s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${prefix}:'"
|
|
|
|
s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${exec_prefix}:'"
|
2016-11-16 11:18:00 +00:00
|
|
|
if d.getVar("OE_BINCONFIG_EXTRA_MANGLE", False):
|
2016-12-14 21:13:04 +00:00
|
|
|
s += d.getVar("OE_BINCONFIG_EXTRA_MANGLE")
|
2007-12-27 11:46:52 +00:00
|
|
|
|
2014-03-24 15:18:52 +00:00
|
|
|
return s
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2005-10-10 10:41:35 +00:00
|
|
|
BINCONFIG_GLOB ?= "*-config"
|
|
|
|
|
2009-10-30 00:33:24 +00:00
|
|
|
PACKAGE_PREPROCESS_FUNCS += "binconfig_package_preprocess"
|
2006-11-20 15:19:01 +00:00
|
|
|
|
2009-10-30 00:33:24 +00:00
|
|
|
binconfig_package_preprocess () {
|
|
|
|
for config in `find ${PKGD} -name '${BINCONFIG_GLOB}'`; do
|
|
|
|
sed -i \
|
2014-02-06 23:17:18 +00:00
|
|
|
-e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
|
|
|
|
-e 's:${STAGING_LIBDIR}:${libdir}:g;' \
|
2009-10-30 00:33:24 +00:00
|
|
|
-e 's:${STAGING_INCDIR}:${includedir}:g;' \
|
|
|
|
-e 's:${STAGING_DATADIR}:${datadir}:' \
|
|
|
|
-e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
|
|
|
|
$config
|
|
|
|
done
|
|
|
|
for lafile in `find ${PKGD} -name "*.la"` ; do
|
2006-11-20 15:19:01 +00:00
|
|
|
sed -i \
|
2014-02-06 23:17:18 +00:00
|
|
|
-e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
|
2006-11-20 15:19:01 +00:00
|
|
|
-e 's:${STAGING_LIBDIR}:${libdir}:g;' \
|
|
|
|
-e 's:${STAGING_INCDIR}:${includedir}:g;' \
|
|
|
|
-e 's:${STAGING_DATADIR}:${datadir}:' \
|
2009-09-16 22:09:44 +00:00
|
|
|
-e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
|
2006-11-20 15:19:01 +00:00
|
|
|
$lafile
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2009-11-02 17:27:05 +00:00
|
|
|
SYSROOT_PREPROCESS_FUNCS += "binconfig_sysroot_preprocess"
|
|
|
|
|
|
|
|
binconfig_sysroot_preprocess () {
|
2013-03-18 01:31:39 +00:00
|
|
|
for config in `find ${S} -name '${BINCONFIG_GLOB}'` `find ${B} -name '${BINCONFIG_GLOB}'`; do
|
2007-01-30 14:44:18 +00:00
|
|
|
configname=`basename $config`
|
2011-01-18 08:17:58 +00:00
|
|
|
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
|
2014-05-06 12:17:47 +00:00
|
|
|
sed ${@get_binconfig_mangle(d)} $config > ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
|
2011-01-18 08:17:58 +00:00
|
|
|
chmod u+x ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
|
2005-08-31 10:45:47 +00:00
|
|
|
done
|
|
|
|
}
|