From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oRXK7-0006wg-4O for mharc-grub-devel@gnu.org; Fri, 26 Aug 2022 07:16:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRXK5-0006rl-D7 for grub-devel@gnu.org; Fri, 26 Aug 2022 07:16:25 -0400 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]:59750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRXJz-00067K-V4 for grub-devel@gnu.org; Fri, 26 Aug 2022 07:16:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:From:Date:Message-ID:Sender:Reply-To:To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=2xQZ2f+8aqZYZcfWZfCGfFu+4bBnBbGtG81JZLGn1yQ=; b=S90UsW2dQL4QujSxQIr3quNQm3 3ZktcXuPiTZ70T0BnaFKfvyjVKCDlAWlMUyhRyGzvkV8MU7ci6RcbsbzVz4eI2zcQORkKm4Qzpj5g pvXLR3gDYu1UjanKepAv2qHiRhEaIGjEut0nzFvgBBHV2NqTMp8iU1wzG9gRwWoKsSu/x9H6I7B7o Ua1J/KTq8/euPg3ylika2wTi48Yj66TLxhQbG6QebVYGUkRpN6SDoWrXySlxYCtFMrRKyKJNei9nH aru6XEhTbq7FeR6KDKRiV6TEK+V3LocHmJfTLsxY114pkA1eg/Kp6J/MoYa6GNWMQPNJpXCusCWsX C1VTFc5A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRXJu-006KER-RW; Fri, 26 Aug 2022 11:16:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (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) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 46663300750; Fri, 26 Aug 2022 13:16:13 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 1E2CE2010F9EB; Fri, 26 Aug 2022 13:16:13 +0200 (CEST) Message-ID: <20220826111358.296974956@alderlake.programming.kicks-ass.net> User-Agent: quilt/0.66 Date: Fri, 26 Aug 2022 13:01:43 +0200 From: peterz@infradead.org Cc: grub-devel@gnu.org, development@efficientek.com, dkiper@net-space.pl, peterz@infradead.org Subject: [PATCH v2 1/3] configure: Add -DGRUB_HAS_PCI when compiling C/C++ files on targets that support PCI References: <20220826110142.966628595@alderlake.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Received-SPF: none client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; envelope-from=peterz@infradead.org; helo=desiato.infradead.org X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MISSING_HEADERS=1.021, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2022 11:16:25 -0000 From: Glenn Washburn The list of targets that support PCI is in gentpl.py. However, there is no support for generating makefile script from a .def file that will apply globally to the makefile, but on a per target basis. So instead, use gentpl.py in configure to get the list of targets and check if the current build target is one of them. If it is, set the automake conditional COND_HAVE_PCI. Then in conf/Makefile.common add -DGRUB_HAS_PCI for the platform if COND_HAVE_PCI is true. Signed-off-by: Glenn Washburn Signed-off-by: Peter Zijlstra (Intel) --- conf/Makefile.common | 3 +++ configure.ac | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/conf/Makefile.common b/conf/Makefile.common index 2d8f1bf2e8..f8faa92e92 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -20,6 +20,9 @@ endif if COND_powerpc_ieee1275 CFLAGS_PLATFORM += -mcpu=powerpc endif +if COND_HAVE_PCI + CFLAGS_PLATFORM += -DGRUB_HAS_PCI +endif # Other options diff --git a/configure.ac b/configure.ac index 90f686f799..1348b06a98 100644 --- a/configure.ac +++ b/configure.ac @@ -375,6 +375,11 @@ AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.3]) AC_SYS_LARGEFILE +PLATFORMS_PCI=" $(PYTHONPATH="${srcdir}" $PYTHON -c 'import gentpl; print(" ".join(gentpl.GROUPS[["pci"]]))') " +if test x"${PLATFORMS_PCI##* ${target_cpu}_${platform} *}" = x ; then + have_pci=y +fi + # Identify characteristics of the host architecture. unset ac_cv_c_bigendian @@ -2042,6 +2047,7 @@ AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes]) AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1]) AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x]) AM_CONDITIONAL([COND_HAVE_EXEC], [test "x$have_exec" = xy]) +AM_CONDITIONAL([COND_HAVE_PCI], [test "x$have_pci" = xy]) test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" -- 2.34.1