[PATCH 2/3] Makefile: Add update-configure target

Florian Weimer fweimer@redhat.com
Fri Nov 13 13:46:42 GMT 2026


This allows regeneration of autoconf files using

  make AUTOCONF=autoconf update-configure

from a build tree.  It replaces the instructions on the wiki:

  https://sourceware.org/glibc/wiki/Regeneration

This approach reuses the existing Makefile fragment that was only
partially working (it exited with an error after carrying out some
work).  The $(shell …) dependency seems acceptable here because
the default is AUTOCONF=no even if autoconf is installed.
---
 Makefile  | 17 -----------------
 Makerules | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index bef72da895..6448e9f423 100644
--- a/Makefile
+++ b/Makefile
@@ -37,23 +37,6 @@ minihelp:
 	@echo type \"make help\" for help with common glibc makefile targets
 	@echo
 
-

-ifneq ($(AUTOCONF),no)
-
-define autoconf-it
-@-rm -f $@.new
-$(AUTOCONF) $(ACFLAGS) $< > $@.new
-chmod a-w$(patsubst %,$(comma)a+x,$(filter .,$(@D))) $@.new
-mv -f $@.new $@
-endef
-
-configure: configure.ac aclocal.m4; $(autoconf-it)
-%/configure: %/configure.ac aclocal.m4; $(autoconf-it)
-%/preconfigure: %/preconfigure.ac aclocal.m4; $(autoconf-it)
-
-endif # $(AUTOCONF) = no
-
-
 # These are the targets that are made by making them in each subdirectory.
 +subdir_targets	:= subdir_lib objects objs others subdir_mostlyclean	\
 		   subdir_clean subdir_distclean subdir_realclean	\
diff --git a/Makerules b/Makerules
index 6f2c9088b1..242821f503 100644
--- a/Makerules
+++ b/Makerules
@@ -1381,6 +1381,23 @@ update-abi: subdir_update-abi
 update-all-abi: subdir_update-all-abi
 endif
 
+ifneq ($(AUTOCONF),no)
+define autoconf-it
+@-rm -f $@.new
+$(AUTOCONF) $(ACFLAGS) $< > $@.new
+chmod a-w$(patsubst %,$(comma)a+x,$(filter .,$(@D))) $@.new
+mv -f $@.new $@
+endef
+
+configure: configure.ac aclocal.m4; $(autoconf-it)
+%/configure: %/configure.ac aclocal.m4; $(autoconf-it)
+%/preconfigure: %/preconfigure.ac aclocal.m4; $(autoconf-it)
+
+# Use "touch aclocal.m4" to force execution of this rule.  Set
+# AUTOCONF=autoconf to activate it.
+update-configure: $(shell find -name configure -o -name preconfigure)
+endif # $(AUTOCONF) = no
+
 ifeq ($(subdir),elf)
 check-abi: $(objpfx)check-abi-libc.out
 tests-special += $(objpfx)check-abi-libc.out
-- 
2.56.0




More information about the Libc-alpha mailing list