From patchwork Mon Aug 20 11:55:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher McCrory X-Patchwork-Id: 959634 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tNpx+Ej3"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vC2G51yPz9s3C for ; Mon, 20 Aug 2018 21:56:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 28EFA8681B; Mon, 20 Aug 2018 11:56:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QLGqh+46629V; Mon, 20 Aug 2018 11:56:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EEA1C86762; Mon, 20 Aug 2018 11:55:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3C9F11C0550 for ; Mon, 20 Aug 2018 11:55:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 39EB785B54 for ; Mon, 20 Aug 2018 11:55:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JldphNuCrJDR for ; Mon, 20 Aug 2018 11:55:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D37FF85B3B for ; Mon, 20 Aug 2018 11:55:49 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id i26-v6so6638818pfo.12 for ; Mon, 20 Aug 2018 04:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gThUaE2G+mRdhdmoYvV25Uwp9BCAbvULs20uPRDLeLA=; b=tNpx+Ej3VbL6fbrY3rbTM0yYvdcP+f3TuFG8kBxw2DB2Y/mgCCr/3s0InkD76sJYqT OgcZGY3J1bMis8wBB4cNcclD8iNRSZW882I1StPpobbtrTuc9yz3/Unp8ZKGq97VxloA CVykwhUE5ggoHmLaLqyVxSU1f9JVScuYHexcWIj9J+or/beC3r45zl5FjjQwsY+bUvIR +djAttjT1saresRNL49sybsTN/COD0r6WYuTnsNs1C4Rbbz4ayqR/cV10Ye2ZkKl/ha5 7fy3oVcYuj8xRpA5ho5ZnppREOVLbyVUk+TQN/4A4uqHwkgy42J9KinZBN5MNzYN/7u0 obUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gThUaE2G+mRdhdmoYvV25Uwp9BCAbvULs20uPRDLeLA=; b=H3pTG4oQ8uwuGi5AtcIPGUcCxVP2Ti2xCCKROxPf+hFxX3gGK04FXG3oYs5PD67KWi uQrHnMSaXas9RQLRPoBE/VEEkiWjDfTtvNa9JZpYkQfvi0DqND4p2VZxTdDVEU85mtMW dktu1gMKtOoBoQ8LY4eMUvp8p8T6xlBsCvD22wsQNMRy6D4pPjR0JAXFBkY2X9BLFQUs urmxtehJri5NQBT/EjMcFQ/VUuoQKxmYtduvJsj2DA3gqAeuCj2s7y7nkjURxc9a27j/ DOXSrRmsLC78Nu1jRLFDRfB4NkkLgFFMEiDIRsEFMSYbdH65EvFaOUqJ0jAFqfoYlqsb 7nAg== X-Gm-Message-State: AOUpUlHVzXr0iW6jppcZjyx+AFNCom+WsMKH0IJUA5T1ambFu2Qe64QN 2HRLYGDKsyEZ6nwhgvR2zUCqn+qY X-Google-Smtp-Source: AA+uWPzF1AcG2J/p+JJOxtJb8wIIMDjeXHzDeTzACxgzkOsemlEXruuRmVmM8zWsi+3P5auzGI+RQw== X-Received: by 2002:a63:41c1:: with SMTP id o184-v6mr10962699pga.297.1534766149215; Mon, 20 Aug 2018 04:55:49 -0700 (PDT) Received: from localhost.localdomain ([2600:1012:b06f:afd4:7dd8:b612:92b8:cc1f]) by smtp.gmail.com with ESMTPSA id n24-v6sm15112762pfi.161.2018.08.20.04.55.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Aug 2018 04:55:48 -0700 (PDT) From: Christopher McCrory To: buildroot@buildroot.org Date: Mon, 20 Aug 2018 04:55:16 -0700 Message-Id: <20180820115519.24046-16-chrismcc@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180820115519.24046-1-chrismcc@gmail.com> References: <20180820115519.24046-1-chrismcc@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 15/18] pkg-utils.mk: patch_sub_makefile X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christopher McCrory Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" suggested and written by François Fix incorrectly generated Makefiles in subdirectories, usually perl packages. Signed-off-by: Christopher McCrory --- package/pkg-utils.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index c3acc22b17..7dbdb427a6 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -95,3 +95,19 @@ define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-full } && \ cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4) endef + +# Used to fix makefiles in subdirectories, usually perl packages see +# perl-template-toolkit and perl-xml-parser +# use: $(call patch_sub_makefile,$(@D)/xs/Makefile) + +define patch_sub_makefile + $(SED) "s:^AR = .*:AR = $(TARGET_AR):g" $(1) + $(SED) "s:^FULL_AR = .*:FULL_AR = $(TARGET_AR):g" $(1) + $(SED) "s:^CC = .*:CC = $(TARGET_CC):g" $(1) + $(SED) "s:^CCFLAGS = .*:CCFLAGS = $(TARGET_CFLAGS):g" $(1) + $(SED) "s:^LD = .*:LD = $(TARGET_CC):g" $(1) + $(SED) "s:^LDDLFLAGS = .*:LDDLFLAGS = -shared $(TARGET_LDFLAGS):g" $(1) + $(SED) "s:^LDLFLAGS = .*:LDLFLAGS = $(TARGET_LDFLAGS):g" $(1) + $(SED) "s:^DESTDIR = .*:DESTDIR = $(TARGET_DIR):g" $(1) +endef +