From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCHv2 1/2] cross: use env variables instead of switches
Date: Fri, 21 Sep 2018 14:55:42 +0200 [thread overview]
Message-ID: <20180921125542.3026-1-henning.schild@siemens.com> (raw)
In-Reply-To: <20180911101605.21977-2-henning.schild@siemens.com>
Debian has environment variables to set the architectures to be used by
dpkg-buildpackage and mk-build-deps. Use those instead of adding
parameters to the tools.
This patch now also uses the debian names for cross building and we do
not have confusing statements like "--host-arch $target_arch" anymore.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg.bbclass | 6 +++++-
meta/recipes-devtools/buildchroot/files/build.sh | 2 +-
meta/recipes-devtools/buildchroot/files/common.sh | 13 -------------
meta/recipes-devtools/buildchroot/files/deps.sh | 4 ++++
4 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index da0b40d..959c041 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -7,6 +7,8 @@ inherit dpkg-base
do_install_builddeps() {
dpkg_do_mounts
E="${@ bb.utils.export_proxies(d)}"
+ export DEB_HOST_ARCH="${DISTRO_ARCH}"
+ export DEB_BUILD_ARCH="${HOST_ARCH}"
sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH}
dpkg_undo_mounts
}
@@ -19,5 +21,7 @@ do_install_builddeps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
# Build package from sources using build script
dpkg_runbuild() {
E="${@ bb.utils.export_proxies(d)}"
- sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH}
+ export DEB_HOST_ARCH="${DISTRO_ARCH}"
+ export DEB_BUILD_ARCH="${HOST_ARCH}"
+ sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS}
}
diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
index e74bc14..0458b1f 100644
--- a/meta/recipes-devtools/buildchroot/files/build.sh
+++ b/meta/recipes-devtools/buildchroot/files/build.sh
@@ -15,4 +15,4 @@ for i in configure aclocal.m4 Makefile.am Makefile.in; do
done
# Build the package
-dpkg-buildpackage -a$target_arch -d --source-option=-I
+dpkg-buildpackage -d --source-option=-I
diff --git a/meta/recipes-devtools/buildchroot/files/common.sh b/meta/recipes-devtools/buildchroot/files/common.sh
index b7551eb..61917b8 100644
--- a/meta/recipes-devtools/buildchroot/files/common.sh
+++ b/meta/recipes-devtools/buildchroot/files/common.sh
@@ -6,19 +6,6 @@
set -e
-# Create human-readable names
-target_arch=$2
-
-# Notes:
-# mk-build-deps for jessie and jtretch has different parameter name to specify
-# host architecture.
-debian_version=$(cut -c1 /etc/debian_version)
-if [ $(($debian_version)) -ge 9 ]; then
- set_arch="--host-arch $target_arch"
-else
- set_arch="-a $target_arch"
-fi
-
# Go to build directory
cd $1
diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh b/meta/recipes-devtools/buildchroot/files/deps.sh
index 4bd604f..cc34b2d 100644
--- a/meta/recipes-devtools/buildchroot/files/deps.sh
+++ b/meta/recipes-devtools/buildchroot/files/deps.sh
@@ -23,5 +23,9 @@ apt-get update \
-o Dir::Etc::sourceparts="-" \
-o APT::Get::List-Cleanup="0"
+# according to the man-page --host-arch should default to exactly what we say
+# here ... but it does not, so we have to provide this argument
+set_arch="--host-arch `dpkg-architecture -qDEB_HOST_ARCH`"
+
# Install all build deps
mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
--
2.19.0
next prev parent reply other threads:[~2018-09-21 12:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 10:16 [PATCH 0/2] Straighten cross names Henning Schild
2018-09-11 10:16 ` [PATCH 1/2] cross: use env variables instead of switches Henning Schild
2018-09-21 12:55 ` Henning Schild [this message]
2018-09-21 13:08 ` [PATCHv2 " Henning Schild
2018-09-27 7:12 ` Maxim Yu. Osipov
2018-09-27 7:15 ` Jan Kiszka
2018-09-28 10:47 ` Henning Schild
2018-09-11 10:16 ` [PATCH 2/2] build-kernel: fix the cross compile arch naming Henning Schild
2018-09-11 12:10 ` Jan Kiszka
2018-09-11 12:20 ` Henning Schild
2018-09-21 10:00 ` [PATCH 0/2] Straighten cross names Maxim Yu. Osipov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180921125542.3026-1-henning.schild@siemens.com \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox