From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599908608985530368 X-Received: by 2002:a19:645b:: with SMTP id b27-v6mr1205991lfj.32.1537535323728; Fri, 21 Sep 2018 06:08:43 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:ec14:: with SMTP id b20-v6ls94672lfa.10.gmail; Fri, 21 Sep 2018 06:08:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZe8acZ1NwdcrYkL//33f8bZtGNkYXQJ0PjXvv3OIgCQgmu1jHaaGptfovHZc/kTglPwmTS X-Received: by 2002:a19:915c:: with SMTP id y28-v6mr1300211lfj.37.1537535322740; Fri, 21 Sep 2018 06:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537535322; cv=none; d=google.com; s=arc-20160816; b=u6ILBjiLYwpc29ciCcl7G8aFXfMVH2HQYifO3W9E1zl0paZRo4U1qFfBabhWacOVCz KAig4vKwP69j8aSLwcCjPGYyTljcqw7M6nEdT5tQFj9riufwrH0BQ1UN/W2vE8ik6ks8 1guQl8EsHjR/AFIfl2OM73RW5l+BuUoetMx1OHZ4FqhjK8KYdMLBj2rBgb81uqbXjo4g cn49s7X88G13/G+/QLg9qZ8gWzF30y56wPyzPgbFq1e4TbrvK7bBdW0YgdRc7ZPX5Ggo 9Jv34myfDNCSJccy+sttiTqe+W0NQ3b4EHv5QtcLviq0b6RQtKWIP9+Qlm51SYWEQIf4 53fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:to:from:date; bh=fZZZeH6SJFuqta/Q6oZ58RcA5+Eq/4Kst3YRMhw9rRU=; b=OJGJDwZaClJ532DZkSxUfd1TCn87JQPU+gn2jAcQ+zyMhBFZBBOX1C0GTZphjVpU1H qHOK3SroerhtelJXB5QN1umHJtZbhDaBbY/rrP9ZqJ8dbgSfbGP5PouaWNCPK3s//R2t 6u2MvUj4sxKRYxBEk/9oFuF5YKFhdYc/xZ9y0Yn+qXTVbH3J3cflptKyo0vVVOaGUoo8 is9dJmPKAYP1U/KnN0esFista5dylTT6wL+1XGyfAGZz5hs4Z0sXfEzXXEe2fDBjPeVZ Bvw0p0elIiNAvPyrpjseZBuNkv4iKzIM5Iz3iWDsAvDNvgSKw6uDgrKhylbijIhZGujh O2AQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id n1-v6si1135072ljg.0.2018.09.21.06.08.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 06:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id w8LD8fc4029377 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 21 Sep 2018 15:08:42 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTPS id w8LD8fTY009085 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 21 Sep 2018 15:08:41 +0200 Date: Fri, 21 Sep 2018 15:08:40 +0200 From: Henning Schild To: isar-users Subject: Re: [PATCHv2 1/2] cross: use env variables instead of switches Message-ID: <20180921150840.02e8bd55@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180921125542.3026-1-henning.schild@siemens.com> References: <20180911101605.21977-2-henning.schild@siemens.com> <20180921125542.3026-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: BnbWV2eYBuop Am Fri, 21 Sep 2018 14:55:42 +0200 schrieb Henning Schild : > 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. The change to v1 is that we call mk-build-deps still with --host-arch. And we provide the "default"-argument, according to the man-page. The tool does not do what its man-page says, or at least the man-page is very confusing. Henning > Signed-off-by: Henning Schild > --- > 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