From patchwork Mon Mar 1 16:13:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Kemper X-Patchwork-Id: 1445668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=oVkEPXvS; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=iFZOoS3N; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dq52R6YsGz9sRN for ; Tue, 2 Mar 2021 03:15:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=zxqxKSTo9o2+BIWJptkUn92Z3Cev6bN3SCXzQo/gy70=; b=oVkEPXvSWCqitdr1/kFheeRhWh 9BOh2K1hP1snoE5d4/IgcMqe7HOUbv1+tlKBpw3qUJ1UZAjGgypAtGR4m4zXrZMzgCYAK01U2YevZ MVCFXf/sXcY29fj04j2SWWKoe1xkdWnkOnIWKWmt2qKSzU71SBw4jGwyke3ODKXu9btha1Mw4TYFa ZNKbhiJ6LuSyADehGmCuWQqLhkOVozDICwOdUXjzRWI4GW+9wX9QIy9l0f41uJHLZUxAdamLg64Kk d8SavSZlRNglfiJT98j5LTSQVNTVfPD1ZougujM8IEzMYmTS+gEAqXMzxHGx6X8R07WLgkVhO6mBy iWh+jJWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGlAa-0000j2-LW; Mon, 01 Mar 2021 16:13:16 +0000 Received: from mout.gmx.net ([212.227.17.20]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGlAX-0000iW-Dt for openwrt-devel@lists.openwrt.org; Mon, 01 Mar 2021 16:13:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614615189; bh=lu9J3HnIOzP+aNyRTPfVa0/BqeDAavlc/6clJHizEaQ=; h=X-UI-Sender-Class:Date:From:To:Subject; b=iFZOoS3Nhbwe316rwzwT1UkT9Bns0OKAod4Tgu7IZeo2dBejxgE8sdLm0OPVStWPs 3StQgRxxDeYTSZBYVjc0f2vx0BPow52ulovGDoU6fOomWizokTVqyENMhfXsjZv3iL 9zHghjoA6Zm7kGZjAu79dkanVLybmYH8ttVgoT4I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from darth.lan ([37.135.106.23]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MirjY-1lka8X0z2a-00etXf for ; Mon, 01 Mar 2021 17:13:09 +0100 Date: Mon, 1 Mar 2021 17:13:07 +0100 From: Sebastian Kemper To: openwrt-devel@lists.openwrt.org Subject: [PATCH] build: prevent dupes in autotools.mk Message-ID: <20210301161305.GA953@darth.lan> Mail-Followup-To: openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:SicGcph3XfWwaVopOu+6EQgr7E32jNFL54b+0lF/wC6qABbePnE R8a/tywvwhowDg82hbJaI68DL4KtnoZMXztvdXqHqFJGl1KR+eNqlnHJcqNU5U1MOMy2vij Dp651uJqBeYN2qVXFUvQBwtEufrpoat6KqbQynT3lCFU7HHEdaBXC9Yk3HvfAZSyrdMU3NN Pwx5WKEm16iqgykyFx5JA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:WHF21xGw2YU=:5u272WE4nY+4ib8Q1jzfS8 v7rLE/2BQP62J19sCzMIQTdt7B8IE88JiP5UEfmePW74ZgyM8N0LkRy5cFB5CviaOV6edRkU4 okZejelWWKJuaGcTh9VN2plOJYnWil/3ZhFpfDBL2Z6iW0rdrTy5B9XAwq3V9vknxvDAxKtgO k793vekyFswS8K4TDVp9QUjORKC15i1ZO54cSTi8hRPiDGWl3Xajax7HYWmGbPpav17Hf0qBU hIJJoDWVl1fIUzbqZgzdtGAsbn9mB/+CvTOxlpc2cWhPvI8OzSJa+P434lG1sugQ+JNC0MaLQ YBmTzPQ257cSvyUX1rkmL+GBKdkHhxDGz8GVHXnl8olfgv2Kpu7f11kN6C8yaTGbd2KhkOwpi sIziwH6cHeZrRclRMiD/6lxofGwEsjex+eGGcZ0HRLUb0mSDDuDTyeDVg/PsT4kdF+lcRG8ur YgCJOU2V+TWSoEbC9/cwhACrZ1rGiF4EdmDcxB+iYJlICmlk/hFy9z1pmxsyc05eLUZPqztLc ALkmerEljlF/JYZgJb3bhzSLKBe+TNKJzhAwvOTfHCTWWSMITcTzTkUEVU3lxg2VJ7fXhcsnP COUF9MrykCq5+FSuEeu/P1upvjg9yU+98luS3t9d9pmNo+l+DTg5zXp9kSxm4Lvd0yjcGt4EP 8rlyS23ts4EQV9M6Y/PqhC+/hIh2PPKXAqpxYAhLuz1u+bbyj2/7Z5ykwgnjK5DaCpORWEBNp x4TH+u3lnbBQ0lrm6G/9l10Jc9FxkkeZ46M4I9XXflxfsVBc4I3DZPBvw1flVCiJDSS12ghCF ASUGVDQqW/Gf/1Gpe0FsJcqd7VlcyGTK+/BPAWw3C7KuNRbyXpSIIvEwLXMkeANSchbubk/hH VN3lCb5gNo2VsxMipL/w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210301_111313_680384_D0244D3A X-CRM114-Status: GOOD ( 11.91 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [sebastian_ml[at]gmx.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.17.20 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org autotools.mk does not have any protection currently that would prevent it from being sourced multiple times. Note that both package.mk and host-build.mk source autotools.mk. So any package Makefile that includes both will cause hooks to be added twice (at least twice). This is fixed by declaring a new variable, __autotools_inc, and only continuing if this variable doesn't equal 1. The same is done by rules.mk already. Also, this commit does away with an ifneq that checks PKG_FIXUP (instead of HOST_FIXUP) for patch-libtool before adding to the host pre-configure hook. This does not make sense. The second ifneq is amended. The current one manually does what the define patch_libtool_host is already doing. It can just use the define. Signed-off-by: Sebastian Kemper --- include/autotools.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/include/autotools.mk b/include/autotools.mk index 4b48b38992..3f029567e3 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -2,6 +2,9 @@ # # Copyright (C) 2007-2020 OpenWrt.org +ifneq ($(__autotools_inc),1) +__autotools_inc=1 + autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2)) # delete *.la-files from staging_dir - we can not yet remove respective lines within all package @@ -152,12 +155,8 @@ define patch_libtool_host $(HOST_BUILD_DIR))) endef -ifneq ($(filter patch-libtool,$(PKG_FIXUP)),) - Hooks/HostConfigure/Pre += patch_libtool_host -endif - ifneq ($(filter patch-libtool,$(HOST_FIXUP)),) - Hooks/HostConfigure/Pre += $(strip $(call patch_libtool,$(HOST_BUILD_DIR))) + Hooks/HostConfigure/Pre += patch_libtool_host endif ifneq ($(filter libtool,$(HOST_FIXUP)),) @@ -177,3 +176,5 @@ ifneq ($(filter autoreconf,$(HOST_FIXUP)),) Hooks/HostConfigure/Pre += autoreconf_host endif endif + +endif #__autotools_inc