From patchwork Sun Apr 30 01:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1775314 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Arx0RFq0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q885l217Rz1ydX for ; Sun, 30 Apr 2023 11:34:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD8508628F; Sun, 30 Apr 2023 03:30:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Arx0RFq0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2037C8615D; Sun, 30 Apr 2023 03:30:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 193CF861A5 for ; Sun, 30 Apr 2023 03:30:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7696975338aso8693339f.1 for ; Sat, 29 Apr 2023 18:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1682818225; x=1685410225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yiz6AGFjc/vawfZCscWjXfmsbteRD7pMr+kPgwsRft0=; b=Arx0RFq0CGqTC09XNQmp31QvKSbMWABMnExStkIqhq/g/AELfD4vvU/kVQKHG2K9Xa lL0eJnNdZ6n/83gtIJyFULuEcmiKmjO9BpJmVg6t8Q+gevmxE/MQMlzKk5bLsVgeNC5N 508J2x9D3kltbF/Sm/jOLuC7tS+jN+JTHKmm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682818225; x=1685410225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yiz6AGFjc/vawfZCscWjXfmsbteRD7pMr+kPgwsRft0=; b=aC7CdGQ7LBmeWdooHFmTNVTaNR41gf3kXn9h1r9mmUeVE9tTFpD5A4h44DVUvdJFSu GzFdN2MLUyaPtXY6JcPKczHJZutuLeOeYEIH0FInqJlKvbBcTHMYvM0ZXTX1ZsWyBE1X Fxjnpr+cYrCROvHHfdq/b/AyrKxJw/f+ALsDS+1/TtagEmISwwkBCfKl4kztc4jMD/Fk PQTatipGzBD930ZEWk/TVOtbK1yTB99voJlNtANG4VX9NZeV2AUEr8xIMPK2RYOQgafv 2f086dDVCXsHpkCoLz2uNX5KClOaVMC5HTX/moMJvQFIaOMSjEtYl9Xr1CIxli5x4NUI KlZg== X-Gm-Message-State: AC+VfDx7WGwRuOq3HgssLc4SK3pkK0rAWdICqH2KVHajW8ejx4oRbGF7 l9wESY4mVciFRprx4ig96N3nFWMp9ZI5rOUkAmc= X-Google-Smtp-Source: ACHHUZ4G1bqcr8H+doNfsyqWrDfILtaGjuawhR4ojQWxUhBAAhLIjtbZ+pxD0XUABhs55NVwnIOg7w== X-Received: by 2002:a92:d6c9:0:b0:328:18af:df0 with SMTP id z9-20020a92d6c9000000b0032818af0df0mr6616883ilp.23.1682818225602; Sat, 29 Apr 2023 18:30:25 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id w4-20020a02cf84000000b0040f8ed3ab81sm7259429jar.129.2023.04.29.18.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Apr 2023 18:30:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH v2 17/30] Kbuild: Detect including an MSYS2 path Date: Sat, 29 Apr 2023 19:29:50 -0600 Message-ID: <20230430013003.1047454-18-sjg@chromium.org> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog In-Reply-To: <20230430013003.1047454-1-sjg@chromium.org> References: <20230430013003.1047454-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The source-tree directory is prepended to relative include paths, but this does not work on Windows, where a path may have a drive letter like C: at the start of it. This breaks SDL which includes an absolute path to the header directory to the C flags, e.g. -IC:/msys64/mingw64/include/SDL2 Add this as a special case to leave these absolute paths alone on Windows. Signed-off-by: Simon Glass --- (no changes since v1) scripts/Kbuild.include | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 62e0207f91b4..411a768a7767 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -205,9 +205,10 @@ clean := -f $(srctree)/scripts/Makefile.clean obj hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj # Prefix -I with $(srctree) if it is not an absolute path. +# Detect C: (C drive) with MSYS2 # skip if -I has no parameter addtree = $(if $(patsubst -I%,%,$(1)), \ -$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1)) +$(if $(filter-out -I/% -I./% -I../% -IC:%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1)) # Find all -I options and call addtree flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))