From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599908608985530368 X-Received: by 2002:a19:2013:: with SMTP id g19-v6mr1374766lfg.12.1537534545687; Fri, 21 Sep 2018 05:55:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:6802:: with SMTP id c2-v6ls193038lja.1.gmail; Fri, 21 Sep 2018 05:55:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZyLde4HpLUxh6gsWUqj2v7Ae5VUlbj3GrUl70TsqcYholg3irrmMzuovty4zCNRw8yVVJS X-Received: by 2002:a2e:6390:: with SMTP id s16-v6mr1191758lje.15.1537534545274; Fri, 21 Sep 2018 05:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537534545; cv=none; d=google.com; s=arc-20160816; b=VeF9ZNBBQiLo7mdzDJGzdVTRdUBdtOMfUeRCmtP/LYDYTcH9x1ec5lJ1RtZtSTG7sU GMiNebxUn+vbznId0Kcv60RUpouSY4L5Ow55f2801FD8903Um2g5lFxpCwSMb95viRwa TPyVSbRgdN9Y5x4rv+tg1mdQzyFrOaO9ozM2VpEMrpF87zjV01hGB58ddtYtvAw1J6sj N7zkexWDLS4Qf1XXgFLNr+DSywYKh1Jo0wgLKn06QxJmi6EwOu/1Xm6DRyp8vp3WZDmV KAdl009297nHi2gyty97BYtSmygoE6hasHkrAvekg5TwnEZMaYEtYmEgPoIoDytTdsvh 2t2w== 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:date:subject:cc:to:from; bh=/iIqUMZdrNy86a2tx+xmGCVRiEXo+Q5W4LgAkjPCHHo=; b=tZ1EH3/ta+zLBnzTJk/eQqbwVwBOldjmdUecDhR31rWUI9rg073U6tUyC0AmW5idPN /SMSogxLGnem3Adx4GSe88HuT8iBDEBFGy3LX9GJw3RhcGG7IFAgY2jesy4/QZflJCiP j87oNjeYW/A62rZhPIpPLZnOZ6pQd8VIclPcXwUk0iQSLUcwxuJvZTx42TrKA7QS9mpX 5zCWMkDvD3+v59KlxsRKjMwrMfcpGYhf1MGsB9QjGQcG3BzdRU0EuQjZ6Qh1bYuyhF62 eyVJ/4xhyxzYzGRmz9IB4UJX94i60wbUBof8nhCAtJFPYMiL3Opwd7RxjFtyh4W+WX0A Zi1Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id a25-v6si686710lfi.3.2018.09.21.05.55.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 05:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w8LCtiwO013706 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 21 Sep 2018 14:55:44 +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 ESMTP id w8LCtiBI031751; Fri, 21 Sep 2018 14:55:44 +0200 From: Henning Schild To: isar-users Cc: Henning Schild Subject: [PATCHv2 1/2] cross: use env variables instead of switches Date: Fri, 21 Sep 2018 14:55:42 +0200 Message-Id: <20180921125542.3026-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180911101605.21977-2-henning.schild@siemens.com> References: <20180911101605.21977-2-henning.schild@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: Roz3BvkHPFcA 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 --- 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