From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599908608985530368 X-Received: by 2002:aa7:d5ca:: with SMTP id d10-v6mr5194967eds.2.1536660969198; Tue, 11 Sep 2018 03:16:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:c8c9:: with SMTP id k9-v6ls1311908edh.1.gmail; Tue, 11 Sep 2018 03:16:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYbnCM3WUbYXUwVKOVIv9Ob4PcO4mNWpHUl9ekgR+8ajW3QUHI7/p4X0DoNOVXJDVtDuj7V X-Received: by 2002:aa7:d5ca:: with SMTP id d10-v6mr5194958eds.2.1536660968841; Tue, 11 Sep 2018 03:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536660968; cv=none; d=google.com; s=arc-20160816; b=nxpEqZOAU4lwQx9940Og9rL1nQ4y5bvllDHMXHGvRLrXi1q5NusVkXXYR+pgkj4rIS XcnFIq+gHyBpecwSv/5cA3sbzy6GxvOUaVZUQch89q6PuQtOWJGWbj4ZFQjWTwIUKl6H ZK+gZx1nh+dB9LWnIcedFBvXw0bvM9GqJY4sXTOrp5aO8uya/Ds7Y5O2ppCwAbI3O7Af ln2Dyt35HpxPr5oRG8aJnLMIlViSuFklW5KrVSslOgO/VU2JyEs9JgeYEwy0854+bxxF tu6B7NbYZif3qmD/XufvUoAer9qTg+3aPRyxCdCvUN36S8zhtihrEFBIoJIDdIyFuCmd Kong== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=MR2dyfk94iiNfHMDg+nptUPuEpxnXfLtdMEcpdkhv/M=; b=URyKmG2odlZjGdTMbz6/nXHRTa6Km7WQIs/yBcJ5jdIf2OEnzh/kTLmMnv8cGAjxvq gbnGnsL2oahezoCT+yMxiZNO/mA+dchRvles2t5of0K/yakp1IlGb0QFjZpnGvaSZfA+ DfOMvoRqlHh5qCe4kUvSEuausM1PbRQKOSUlozEkCIB8UPuFvux5qRJPTcrPYVcy/zBr k2CnKKqv6mVR/3bt3uNUN0AyN8Q4wPWTzqZbMh53YQXyayZLkzgybe5GAYkdNpt1eQQ8 1PQAo+r/0Bszz3GACLd0X//WMKc2eeVYL5PVIjYXRdaNKvYh4gDcLAFpKsRroU0qaKxL Yv2w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id y4-v6si517963edp.2.2018.09.11.03.16.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 03:16:08 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w8BAG8Sx002914 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 Sep 2018 12:16:08 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w8BAG7Lk011543; Tue, 11 Sep 2018 12:16:08 +0200 From: Henning Schild To: isar-users Cc: Henning Schild Subject: [PATCH 1/2] cross: use env variables instead of switches Date: Tue, 11 Sep 2018 12:16:04 +0200 Message-Id: <20180911101605.21977-2-henning.schild@siemens.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180911101605.21977-1-henning.schild@siemens.com> References: <20180911101605.21977-1-henning.schild@siemens.com> X-TUID: WXvPiMhUoW8d 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 | 8 ++++++-- meta/recipes-devtools/buildchroot/files/build.sh | 2 +- meta/recipes-devtools/buildchroot/files/common.sh | 13 ------------- meta/recipes-devtools/buildchroot/files/deps.sh | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index 2e53c1b..4a04fc6 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -6,7 +6,9 @@ inherit dpkg-base # Install build dependencies for package dpkg_prepare() { E="${@ bb.utils.export_proxies(d)}" - sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH} + export DEB_HOST_ARCH="${DISTRO_ARCH}" + export DEB_BUILD_ARCH="${HOST_ARCH}" + sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} } # apt and reprepro may not run in parallel, acquire the Isar lock @@ -15,5 +17,7 @@ do_prepare[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock" # 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..5c247f0 100644 --- a/meta/recipes-devtools/buildchroot/files/deps.sh +++ b/meta/recipes-devtools/buildchroot/files/deps.sh @@ -24,4 +24,4 @@ apt-get update \ -o APT::Get::List-Cleanup="0" # Install all build deps -mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control +mk-build-deps -t "${install_cmd}" -i -r debian/control -- 2.16.4