From patchwork Thu Jul 30 11:12:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 502081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0F86A1402BB for ; Thu, 30 Jul 2015 21:12:27 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C51A328BCE5; Thu, 30 Jul 2015 13:11:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E631D280BD4 for ; Thu, 30 Jul 2015 13:11:40 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 HELO_IP_IN_CL_SUBNET=-1.2 (check from: .synopsys. - helo: .smtprelay.synopsys. - helo-domain: .synopsys.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7.7 Received: from smtprelay.synopsys.com (unknown [198.182.47.9]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 30 Jul 2015 13:11:39 +0200 (CEST) Received: from dc8secmta2.synopsys.com (dc8secmta2.synopsys.com [10.13.218.202]) by smtprelay.synopsys.com (Postfix) with ESMTP id B8A8324E0921; Thu, 30 Jul 2015 04:12:10 -0700 (PDT) Received: from dc8secmta2.internal.synopsys.com (dc8secmta2.internal.synopsys.com [127.0.0.1]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id ACD69A411B; Thu, 30 Jul 2015 04:12:10 -0700 (PDT) Received: from mailhost.synopsys.com (unknown [10.13.184.66]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 88776A411A; Thu, 30 Jul 2015 04:12:10 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 79A51B2E; Thu, 30 Jul 2015 04:12:10 -0700 (PDT) Received: from abrodkin-e7440l.internal.synopsys.com (unknown [10.121.8.78]) by mailhost.synopsys.com (Postfix) with ESMTP id 44B37B2D; Thu, 30 Jul 2015 04:12:09 -0700 (PDT) From: Alexey Brodkin To: openwrt-devel@lists.openwrt.org Date: Thu, 30 Jul 2015 14:12:05 +0300 Message-Id: <1438254725-2233-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.4.3 Cc: Alexey Brodkin Subject: [OpenWrt-Devel] [PATCH v2] include/kernel.mk - better search for ARCH X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" If "findstring" is used without leading and trailing spaces unexpected matches may happen. For example consider ARC=arc then "findstring $(ARCH)" will report a false match with "aarch64". But "findstring $ARCH " (note trailing space) will correctly skip matches for both "aarch64" and "aarch64_be". This patch is built-tested against NetGear WNDR3800. Signed-off-by: Alexey Brodkin Cc: Felix Fietkau Cc: Jo-Philipp Wich --- In v2 removed unncecessary space before findstring. include/kernel.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel.mk b/include/kernel.mk index 7a0a170..6a613fe 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -62,15 +62,15 @@ endif ifneq (,$(findstring uml,$(BOARD))) LINUX_KARCH=um -else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be)) +else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be )) LINUX_KARCH := arm64 -else ifneq (,$(findstring $(ARCH), armeb)) +else ifneq (,$(findstring $(ARCH) , armeb )) LINUX_KARCH := arm -else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el)) +else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el )) LINUX_KARCH := mips -else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4)) +else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 )) LINUX_KARCH := sh -else ifneq (,$(findstring $(ARCH), i386 x86_64)) +else ifneq (,$(findstring $(ARCH) , i386 x86_64 )) LINUX_KARCH := x86 else LINUX_KARCH := $(ARCH)