[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d63fc69 1/2: Pass options from make to configure through a variab
From: |
Lars Ingebrigtsen |
Subject: |
master d63fc69 1/2: Pass options from make to configure through a variable. |
Date: |
Wed, 24 Nov 2021 02:31:15 -0500 (EST) |
branch: master
commit d63fc69b192a608f98c15d6014430f28138fd82e
Author: Gregory Heytings <gregory@heytings.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Pass options from make to configure through a variable.
* GNUmakefile (configure): Use the variable.
* INSTALL.REPO: Document the variable (bug#51965).
---
GNUmakefile | 5 +++++
INSTALL.REPO | 23 +++++++++++++++++++----
Makefile.in | 13 +++++++++++--
3 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 5155487..76fd77b 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -104,8 +104,13 @@ configure:
Makefile: configure
@echo >&2 'There seems to be no Makefile in this directory.'
+ifeq ($(configure),default)
@echo >&2 'Running ./configure ...'
./configure
+else
+ @echo >&2 'Running ./configure '$(configure)'...'
+ ./configure $(configure)
+endif
@echo >&2 'Makefile built.'
# 'make bootstrap' in a fresh checkout needn't run 'configure' twice.
diff --git a/INSTALL.REPO b/INSTALL.REPO
index da56d76..182c2e9 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -8,9 +8,15 @@ directory on your local machine:
To build the repository code, simply run 'make' in the 'emacs'
directory. This should work if your files are freshly checked out
-from the repository, and if you have the proper tools installed. If
-it doesn't work, or if you have special build requirements, the
-following information may be helpful.
+from the repository, and if you have the proper tools installed; the
+default configuration options will be used. Other configuration
+options can be specified by setting a 'configure' variable, for
+example:
+
+ $ make configure="--prefix=/opt/emacs CFLAGS='-O0 -g3'"
+
+If the above doesn't work, or if you have special build requirements,
+the following information may be helpful.
Building Emacs from the source-code repository requires some tools
that are not needed when building from a release. You will need:
@@ -58,7 +64,16 @@ To update loaddefs.el (and similar files), do:
If either of the above partial procedures fails, try 'make bootstrap'.
If CPU time is not an issue, 'make bootstrap' is a more thorough way
-to rebuild, avoiding spurious problems.
+to rebuild, avoiding spurious problems. 'make bootstrap' rebuilds
+Emacs with the same configuration options as the previous build; it
+can also be used to rebuild Emacs with other configuration options by
+setting a 'configure' variable, for example:
+
+ $ make bootstrap configure="CFLAGS='-O0 -g3'"
+
+To rebuild Emacs with the default configuration options, you can use:
+
+ $ make bootstrap configure=default
Occasionally, there are changes that 'make bootstrap' won't be able to
handle. The most thorough cleaning can be achieved by 'git clean -fdx'
diff --git a/Makefile.in b/Makefile.in
index 3c092fa..4b40d87 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1145,14 +1145,23 @@ check-info: info
.PHONY: bootstrap
-# Bootstrapping does the following:
+# Without a 'configure' variable, bootstrapping does the following:
# * Remove files to start from a bootstrap-clean slate.
# * Run autogen.sh.
# * Rebuild Makefile, to update the build procedure itself.
# * Do the actual build.
-bootstrap: bootstrap-clean
+# With a 'configure' variable, bootstrapping does the following:
+# * Remove files to start from an extraclean slate.
+# * Do the actual build, during which the 'configure' variable is
+# used (see the Makefile goal in GNUmakefile).
+bootstrap:
+ifndef configure
+ $(MAKE) bootstrap-clean
cd $(srcdir) && ./autogen.sh autoconf
$(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
+else
+ $(MAKE) extraclean
+endif
$(MAKE) all
.PHONY: ChangeLog change-history change-history-commit change-history-nocommit