]> git.notmuchmail.org Git - notmuch/commitdiff
build: Save configure options and re-use them for automatic runs of configure
authorCarl Worth <cworth@cworth.org>
Thu, 10 Mar 2011 19:30:06 +0000 (11:30 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 10 Mar 2011 19:30:06 +0000 (11:30 -0800)
This supports the case of a user running "configure --prefix=/foo" then later
updating the soruce (including the configure script) and re-running make.

In this case, the make invocation will re-run configure. Before this change,
this run of configure would lose the user's carefully chosen prefix. This
is now fixed so that configrue is re-run with the user's options.

Makefile
configure

index ffee659b0eb5f4ccf2921647838a16a66c2f6c69..11e3a3d96293255e136ed3d06ab99557e7047340 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,13 +25,15 @@ srcdir ?= .
 
 include Makefile.config
 Makefile.config: $(srcdir)/configure
+ifeq ($(configure_options),)
        @echo ""
        @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
        @echo "      but if you want to specify any arguments (such as an alternate prefix"
        @echo "      into which to install), call ./configure explicitly and then make again."
        @echo "      See \"./configure --help\" for more details."
        @echo ""
-       ./configure
+endif
+       $(srcdir)/configure $(configure_options)
 
 # Finally, include all of the Makefile.local fragments where all the
 # real work is done.
index 157ecf39086b08a62fa55760fa964d44ad80574b..bbf30cd51c92ad0856a1e4eb5692500a973af5b0 100755 (executable)
--- a/configure
+++ b/configure
@@ -529,8 +529,13 @@ cat > Makefile.config <<EOF
 # changes, (and this could happen by simply calling "make" if the
 # configure script is updated).
 
+# The top-level directory for the source, (the directory containing
+# the configure script). This may be different than the build
+# directory (the current directory at the time configure was run).
 srcdir = ${srcdir}
 
+configure_options = $@
+
 # We use vpath directives (rather than the VPATH variable) since the
 # VPATH variable matches targets as well as prerequisites, (which is
 # not useful since then a target left-over from a srcdir build would