octave-maintainers
[Top][All Lists]
Advanced

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

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


From: Thorsten Meyer
Subject: Re: [changeset] Re: When do I need autogen and configure?
Date: Sun, 22 Feb 2009 17:36:41 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Thorsten Meyer wrote:
Hi,

here is an updated Changeset.

John W. Eaton wrote:
|  - 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?
I have found a way: I have added AC_SUBST(ac_config_files) to configure.in. This
way I can access the list of configuration files with @ac_config_files@ in
octMakefile.in and Makefile.in.

In your patch, configfiles is not a file target, so shouldn't it be
tagged as .PHONY?
I tagged the configfiles target as .PHONY in octMakefile.in and
scripts/Makefile.in. I left it as it is in Makefile.in (consistent with the
other not-file targets there).

Also I have added a short description of the configfiles target to the help
string in Makefile.

Into the make targets I have coded the following dependencies:

configure depends on
        configure.in
        *.m4

config.status depends on
        configure

octMakefile, Makefile (and other configuration files in ac_config_files) depend
on their respective .in file and on config.status.

Is that correct?

Also, I use autoconf and autoheader directly in the Makefile rules for configure
instead of calling autogen.sh. This way, the configure scripts in root and
scripts can be updated independently.

Is it ok to push the changeset?

regards

As it has been mentioned in another thread: here is an update of my changeset to add make targets for the configuration (autogen, configure and Makefiles). Compared to the older version, I moved the new targets below the all: target in order to prevent unwanted making of these targets.

I have this patch in my patch queue for quite a while now and it has not caused a problem yet. However, I could not really test, if it does what it is indented for, namely, automatically rebuilding only those Makefiles etc. that need rebuilding: mercurial has the feature not to preserve timestamps, so with "hg qpush" after downloading new patches from the repository the timestamp of configure.in gets changed, and "make configfiles && make" will rebuild everything each time.

regards

Thorsten

# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1235319872 -3600
# Node ID 00e3a97e43234904f5f0f28233ffded7267fb866
# Parent  797202541cd655a04ae0deac6daade8dd0b78c9d
Add make target "configfiles" to automatically regenerate configuration files

diff -r 797202541cd6 -r 00e3a97e4323 ChangeLog
--- a/ChangeLog Sun Feb 08 18:48:31 2009 +0100
+++ b/ChangeLog Sun Feb 22 17:24:32 2009 +0100
@@ -0,0 +1,11 @@
+2009-02-08  Thorsten Meyer  <address@hidden>
+
+       * configure.in: AC_SUBST ac_config_files 
+
+       * Makeconf.in (config_opts): Define CONFIG_SUBDIRS variable.
+
+       * Makefile: Add make target for configuration files.
+
+       * octMakefile.in: Add make targets for configuration files,
+       config.status and configure.
+
diff -r 797202541cd6 -r 00e3a97e4323 Makeconf.in
--- a/Makeconf.in       Sun Feb 08 18:48:31 2009 +0100
+++ b/Makeconf.in       Sun Feb 22 17:24:32 2009 +0100
@@ -260,6 +260,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 797202541cd6 -r 00e3a97e4323 Makefile
--- a/Makefile  Sun Feb 08 18:48:31 2009 +0100
+++ b/Makefile  Sun Feb 22 17:24:32 2009 +0100
@@ -30,6 +30,9 @@
 all: header-msg config-check
        $(MAKE) -f octMakefile all
 
+configfiles: FORCE
+       $(MAKE) -f octMakefile configfiles
+
 $(TARGETS): FORCE
        $(MAKE) -f octMakefile $@
 
@@ -103,6 +106,8 @@
        @echo "  scripts              make all in subdirectory scripts"
        @echo "  src                  make all in subdirectory src"
        @echo ""
+       @echo "  configfiles          update the configuration files"
+       @echo ""
        @echo "  help                 print this message"
        @echo ""
 
diff -r 797202541cd6 -r 00e3a97e4323 configure.in
--- a/configure.in      Sun Feb 08 18:48:31 2009 +0100
+++ b/configure.in      Sun Feb 22 17:24:32 2009 +0100
@@ -2102,6 +2102,7 @@
 
 ### Do the substitutions in all the Makefiles.
 
+AC_SUBST(ac_config_files)
 AC_CONFIG_FILES([octMakefile Makeconf test/Makefile
   doc/Makefile doc/faq/Makefile doc/interpreter/Makefile
   doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile
diff -r 797202541cd6 -r 00e3a97e4323 octMakefile.in
--- a/octMakefile.in    Sun Feb 08 18:48:31 2009 +0100
+++ b/octMakefile.in    Sun Feb 22 17:24:32 2009 +0100
@@ -71,6 +71,10 @@
 
 SHELL_SCRIPTS = octave-bug octave-config mkoctfile run-octave
 
+CONFIG_FILES = @ac_config_files@
+
+M4_FILES = $(wildcard *.m4)
+
 all: $(SHELL_SCRIPTS) $(filter-out libcruft liboctave, $(SUBDIRS)) 
dist-info-files
        @echo ""
        @echo "Octave successfully built.  Now choose from the following:"
@@ -81,6 +85,22 @@
        @echo ""
 .PHONY: all
 
+configfiles: $(CONFIG_FILES)
+       for dir in $(CONFIG_SUBDIRS); do \
+         $(MAKE) -C $$dir configfiles; \
+       done
+.PHONY: configfiles
+
+$(CONFIG_FILES): %: %.in config.status
+       ./config.status $@
+
+config.status: configure
+       ./config.status --recheck
+
+configure: configure.in $(M4_FILES)
+       autoconf --force
+       autoheader --force
+
 src: liboctave
 
 liboctave: libcruft
diff -r 797202541cd6 -r 00e3a97e4323 scripts/ChangeLog
--- a/scripts/ChangeLog Sun Feb 08 18:48:31 2009 +0100
+++ b/scripts/ChangeLog Sun Feb 22 17:24:32 2009 +0100
@@ -0,0 +1,7 @@
+2009-02-08  Thorsten Meyer  <address@hidden>
+
+       * configure.in: AC_SUBST ac_config_files
+
+       * Makefile.in:  Add make targets for configuration files
+       and config.status.
+
diff -r 797202541cd6 -r 00e3a97e4323 scripts/Makefile.in
--- a/scripts/Makefile.in       Sun Feb 08 18:48:31 2009 +0100
+++ b/scripts/Makefile.in       Sun Feb 22 17:24:32 2009 +0100
@@ -52,9 +52,24 @@
 FCN_FILES = # $(wildcard $(srcdir)/*.m)
 FCN_FILES_NO_DIR = # $(notdir $(FCN_FILES))
 
+CONFIG_FILES = @ac_config_files@
+
 all: $(SUBDIRS) DOCSTRINGS
 .PHONY: all
 
+configfiles: $(CONFIG_FILES)
+.PHONY: configfiles
+
+$(CONFIG_FILES): %: %.in config.status
+       ./config.status $@
+
+config.status: configure
+       ./config.status --recheck
+
+configure: configure.in
+       if [ ! -f skip-autoconf ]; then autoconf --force; fi
+       if [ ! -f skip-autoheader ]; then autoheader --force; fi
+
 $(SUBDIRS):
        $(MAKE) -C $@ all
 .PHONY: $(SUBDIRS)
diff -r 797202541cd6 -r 00e3a97e4323 scripts/configure.in
--- a/scripts/configure.in      Sun Feb 08 18:48:31 2009 +0100
+++ b/scripts/configure.in      Sun Feb 22 17:24:32 2009 +0100
@@ -28,6 +28,7 @@
 
 AC_PROG_INSTALL
 
+AC_SUBST(ac_config_files)
 AC_CONFIG_FILES([Makefile audio/Makefile deprecated/Makefile elfun/Makefile \
          general/Makefile geometry/Makefile help/Makefile image/Makefile \
          io/Makefile linear-algebra/Makefile miscellaneous/Makefile \

reply via email to

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