summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/multilib_script.bbclass32
-rw-r--r--meta/recipes-devtools/libtool/libtool_2.4.6.bb4
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/classes/multilib_script.bbclass b/meta/classes/multilib_script.bbclass
new file mode 100644
index 0000000000..a5a552b716
--- /dev/null
+++ b/meta/classes/multilib_script.bbclass
@@ -0,0 +1,32 @@
1#
2# Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
3# MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
4# to indicate which script files to process from which packages.
5#
6
7inherit update-alternatives
8
9MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
10
11PACKAGE_PREPROCESS_FUNCS += "multilibscript_rename"
12
13multilibscript_rename() {
14 :
15}
16
17python () {
18 # Do nothing if multilib isn't being used
19 if not d.getVar("MULTILIB_VARIANTS"):
20 return
21 # Do nothing for native/cross
22 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d):
23 return
24
25 for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split():
26 pkg, script = entry.split(":")
27 scriptname = os.path.basename(script)
28 d.setVar("ALTERNATIVE_" + pkg, scriptname)
29 d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script)
30 d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}")
31 d.appendVar("multilibscript_rename", "\n mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}")
32}
diff --git a/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
index b02620b4b4..b8a5240885 100644
--- a/meta/recipes-devtools/libtool/libtool_2.4.6.bb
+++ b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -26,3 +26,7 @@ do_install_append () {
26 -e "s@${HOSTTOOLS_DIR}/@@g" \ 26 -e "s@${HOSTTOOLS_DIR}/@@g" \
27 -i ${D}${bindir}/libtool 27 -i ${D}${bindir}/libtool
28} 28}
29
30inherit multilib_script
31
32MULTILIB_SCRIPTS = "${PN}:${bindir}/libtool"