octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[changeset] Re: When do I need autogen and configure?


From: Thorsten Meyer
Subject: [changeset] Re: When do I need autogen and configure?
Date: Fri, 30 Jan 2009 00:08:43 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

John W. Eaton wrote:
> On 25-Jan-2009, Thorsten Meyer wrote:
> 
> | It seems that configure always regenerates all Makefiles. I would like to 
> try
> | and change the part of configure that generates Makefiles out of 
> Makefiles.in
> | such that it only does so when the corresponding Makefile.in has changed. 
> Can
> | somebody point to the right place in the code?
> 
> AFAIK, there is no portable way to test file timestamps in a shell
> script, and anyway, the configure script is probably the wrong place
> for that logic.  It should probably go in the Makefiles.  But some of
> us don't want make to run autoconf/autoheader/configure automatically
> by default, so I would want a way to disable that feature if it were
> added to the build system.
> 
> If all that changes is a Makefile.in file, you can use a command like
> 
>   ./config.status src/Makefile
> 
> to update a single file.
> 
Attached is a changeset that adds make targets for automatic regeneration of the
appropriate configuration files (and the configure script if necessary).
I used the information I found here:
  http://www.gnu.org/prep/standards/html_node/Configuration.html#Configuration

http://www.gnu.org/software/autoconf/manual/html_node/Automatic-Remaking.html#Automatic-Remaking

With the patch you can do
        make configfiles
to regenerate the configuration files (including config.status and configure)
that need to be updated (At least it seems to work for me).

A few questions:
 - Would such a change to the build system be acceptable? Please note, that I
have not added the target "configfiles" to the dependencies of the target "all".
This way everybody can decide for himself if he wants to use this mechanism.

 - Have I got the dependencies right?

 - What I don't like yet about the patch is, that I hardcoded the list of
configuration files into the makefile sources (octMakefile.in and
scripts/Makefile.in). I would rather copy them automatically from their original
source in configure.in. Is there an easy way to do that?

Thorsten
# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1233268905 -3600
# Node ID 099438fe7f840e7d9b8a91f0a7ade2f997ed563e
# Parent  17a3a7bebac56df797d5cc10fe0a72131fabdec6
Add make target "configfiles" to automatically regenerate configuration files

diff -r 17a3a7bebac5 -r 099438fe7f84 ChangeLog
--- a/ChangeLog Thu Jan 29 12:57:59 2009 -0500
+++ b/ChangeLog Thu Jan 29 23:41:45 2009 +0100
@@ -0,0 +1,9 @@
+2009-01-29  Thorsten Meyer  <address@hidden>
+
+       * Makeconf.in (config_opts): Define CONFIG_SUBDIRS variable.
+
+       * Makefile.in: Add make target for configuration files.
+
+       * octMakefile.in: Add make targets for configuration files,
+       config.status and configure.
+
diff -r 17a3a7bebac5 -r 099438fe7f84 Makeconf.in
--- a/Makeconf.in       Thu Jan 29 12:57:59 2009 -0500
+++ b/Makeconf.in       Thu Jan 29 23:41:45 2009 +0100
@@ -258,6 +258,9 @@
 # The arguments passed to configure.
 config_opts = @config_opts@
 
+
+CONFIG_SUBDIRS = @subdirs@
+
 # ==================== Where To Install Things ====================
 
 # The default location for installation.  Everything is placed in
diff -r 17a3a7bebac5 -r 099438fe7f84 Makefile.in
--- a/Makefile.in       Thu Jan 29 12:57:59 2009 -0500
+++ b/Makefile.in       Thu Jan 29 23:41:45 2009 +0100
@@ -27,6 +27,9 @@
 
 NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean
 
+configfiles: FORCE
+       $(MAKE) -f octMakefile configfiles
+
 all: header-msg config-check
        $(MAKE) -f octMakefile all
 
diff -r 17a3a7bebac5 -r 099438fe7f84 octMakefile.in
--- a/octMakefile.in    Thu Jan 29 12:57:59 2009 -0500
+++ b/octMakefile.in    Thu Jan 29 23:41:45 2009 +0100
@@ -73,6 +73,24 @@
 
 SHELL_SCRIPTS = octave-bug octave-config mkoctfile run-octave
 
+# FIXME: how can I get this list from config.status to here automatically?
+CONFIG_FILES = Makefile octMakefile Makeconf test/Makefile doc/Makefile 
doc/faq/Makefile doc/interpreter/Makefile doc/liboctave/Makefile 
doc/refcard/Makefile emacs/Makefile examples/Makefile 
examples/@polynomial/Makefile liboctave/Makefile liboctave/oct-types.h 
src/Makefile src/mxarray.h libcruft/Makefile libcruft/Makerules 
libcruft/amos/Makefile libcruft/blas/Makefile libcruft/daspk/Makefile 
libcruft/dasrt/Makefile libcruft/dassl/Makefile libcruft/fftpack/Makefile 
libcruft/lapack/Makefile libcruft/misc/Makefile libcruft/odepack/Makefile 
libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile 
libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile 
libcruft/slatec-err/Makefile libcruft/villad/Makefile 
libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile
+
+configfiles: $(CONFIG_FILES)
+       for dir in $(CONFIG_SUBDIRS); do \
+         $(MAKE) -C $$dir configfiles; \
+       done
+
+$(CONFIG_FILES): %: %.in config.status
+       ./config.status $@
+
+config.status: configure
+       ./config.status --recheck
+
+configure: configure.in aclocal.m4 acx_blas_f77_func.m4 acx_blas.m4 \
+           acx_lapack.m4 autogen.sh
+       ./autogen.sh
+
 all: $(SHELL_SCRIPTS) $(filter-out libcruft liboctave, $(SUBDIRS)) 
dist-info-files
        @echo ""
        @echo "Octave successfully built.  Now choose from the following:"
diff -r 17a3a7bebac5 -r 099438fe7f84 scripts/ChangeLog
--- a/scripts/ChangeLog Thu Jan 29 12:57:59 2009 -0500
+++ b/scripts/ChangeLog Thu Jan 29 23:41:45 2009 +0100
@@ -0,0 +1,5 @@
+2009-01-29  Thorsten Meyer  <address@hidden>
+
+       * Makefile.in:  Add make targets for configuration files,
+       and config.status.
+
diff -r 17a3a7bebac5 -r 099438fe7f84 scripts/Makefile.in
--- a/scripts/Makefile.in       Thu Jan 29 12:57:59 2009 -0500
+++ b/scripts/Makefile.in       Thu Jan 29 23:41:45 2009 +0100
@@ -52,6 +52,17 @@
 FCN_FILES = # $(wildcard $(srcdir)/*.m)
 FCN_FILES_NO_DIR = # $(notdir $(FCN_FILES))
 
+# FIXME: how can I get the CONFIG_FILES from config.status in here 
automaticall7?
+CONFIG_FILES = Makefile audio/Makefile deprecated/Makefile elfun/Makefile 
general/Makefile geometry/Makefile help/Makefile image/Makefile io/Makefile 
linear-algebra/Makefile miscellaneous/Makefile optimization/Makefile 
path/Makefile pkg/Makefile plot/Makefile polynomial/Makefile set/Makefile 
signal/Makefile sparse/Makefile specfun/Makefile special-matrix/Makefile 
startup/Makefile statistics/Makefile statistics/base/Makefile 
statistics/distributions/Makefile statistics/models/Makefile 
statistics/tests/Makefile strings/Makefile time/Makefile testfun/Makefile
+
+configfiles: $(CONFIG_FILES)
+
+$(CONFIG_FILES): %: %.in config.status
+       ./config.status $@
+
+config.status: configure
+       ./config.status --recheck
+
 all: $(SUBDIRS) DOCSTRINGS
 .PHONY: all
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]