[DTrace-devel] [PATCH v2 1/2] build: add a mechanism to tell whether the tree is configured yet

Nick Alcock nick.alcock at oracle.com
Tue Nov 8 13:12:10 UTC 2022


This means that bits of makefiles that depend on configure symbols and
might emit noisy errors otherwise can be surrounded with ifdef
CONFIGURED to suppress their execution when the makefile is initially
run (when all it does is configure itself and restart parsing, resetting
all its variables to the configured values).

We fix another noisy error while we're here: the initial build routinely
displays

GNUmakefile:111: /home/oranix/oracle/private/dtrace/build/config.mk: No such file or directory

because the tree is not yet configured and config.mk hasn't been
created.

This buys us nothing and is just noisy: suppress it.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 GNUmakefile | 2 +-
 Makeconfig  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index fb587beb5a09..e26d4a866045 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -108,7 +108,7 @@ $(shell mkdir -p $(objdir))
 include Makeoptions
 include Makefunctions
 include Makeconfig
-include $(objdir)/config.mk
+-include $(objdir)/config.mk
 include Build $(sort $(wildcard */Build))
 -include $(objdir)/*.deps
 include Makerules
diff --git a/Makeconfig b/Makeconfig
index 15614384fd94..57d1d97988e6 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -89,6 +89,7 @@ $(CONFIG_H):
 
 $(CONFIG_MK):
 	echo '# This file is automatically generated.' > $(objdir)/config.mk
+	echo 'CONFIGURED := yes' >> $(objdir)/config.mk
 	cat $(objdir)/.config/*.mk >> $(objdir)/config.mk 2>/dev/null || true
 
 $(eval $(call check-symbol-rule,ELF_GETSHDRSTRNDX,elf_getshdrstrndx,elf))
-- 
2.38.0.266.g481848f278




More information about the DTrace-devel mailing list