[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, 01 Feb 2009 12:43:35 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
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
Thorsten
# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1233488078 -3600
# Node ID 9d9b18e73f87efb1d022dbdceff3cada48ae481d
# Parent ff61b53eb294138add7d31365ac1444324e4dc04
Add make target "configfiles" to automatically regenerate configuration files
diff -r ff61b53eb294 -r 9d9b18e73f87 ChangeLog
--- a/ChangeLog Fri Jan 30 15:42:51 2009 -0500
+++ b/ChangeLog Sun Feb 01 12:34:38 2009 +0100
@@ -0,0 +1,11 @@
+2009-02-01 Thorsten Meyer <address@hidden>
+
+ * configure.in: AC_SUBST ac_config_files
+
+ * 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 ff61b53eb294 -r 9d9b18e73f87 Makeconf.in
--- a/Makeconf.in Fri Jan 30 15:42:51 2009 -0500
+++ b/Makeconf.in Sun Feb 01 12:34:38 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 ff61b53eb294 -r 9d9b18e73f87 Makefile.in
--- a/Makefile.in Fri Jan 30 15:42:51 2009 -0500
+++ b/Makefile.in Sun Feb 01 12:34:38 2009 +0100
@@ -27,6 +27,10 @@
NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean
+configfiles: FORCE
+ $(MAKE) -f octMakefile configfiles
+.PHONY: configfiles
+
all: header-msg config-check
$(MAKE) -f octMakefile all
@@ -103,6 +107,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 ff61b53eb294 -r 9d9b18e73f87 configure.in
--- a/configure.in Fri Jan 30 15:42:51 2009 -0500
+++ b/configure.in Sun Feb 01 12:34:38 2009 +0100
@@ -2056,6 +2056,7 @@
### Do the substitutions in all the Makefiles.
+AC_SUBST(ac_config_files)
AC_CONFIG_FILES([Makefile octMakefile Makeconf test/Makefile
doc/Makefile doc/faq/Makefile doc/interpreter/Makefile
doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile
diff -r ff61b53eb294 -r 9d9b18e73f87 octMakefile.in
--- a/octMakefile.in Fri Jan 30 15:42:51 2009 -0500
+++ b/octMakefile.in Sun Feb 01 12:34:38 2009 +0100
@@ -73,6 +73,26 @@
SHELL_SCRIPTS = octave-bug octave-config mkoctfile run-octave
+CONFIG_FILES = @ac_config_files@
+
+M4_FILES = $(wildcard *.m4)
+
+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
+
all: $(SHELL_SCRIPTS) $(filter-out libcruft liboctave, $(SUBDIRS))
dist-info-files
@echo ""
@echo "Octave successfully built. Now choose from the following:"
diff -r ff61b53eb294 -r 9d9b18e73f87 scripts/ChangeLog
--- a/scripts/ChangeLog Fri Jan 30 15:42:51 2009 -0500
+++ b/scripts/ChangeLog Sun Feb 01 12:34:38 2009 +0100
@@ -0,0 +1,7 @@
+2009-02-01 Thorsten Meyer <address@hidden>
+
+ * configure.in: AC_SUBST ac_config_files
+
+ * Makefile.in: Add make targets for configuration files
+ and config.status.
+
diff -r ff61b53eb294 -r 9d9b18e73f87 scripts/Makefile.in
--- a/scripts/Makefile.in Fri Jan 30 15:42:51 2009 -0500
+++ b/scripts/Makefile.in Sun Feb 01 12:34:38 2009 +0100
@@ -52,6 +52,21 @@
FCN_FILES = # $(wildcard $(srcdir)/*.m)
FCN_FILES_NO_DIR = # $(notdir $(FCN_FILES))
+CONFIG_FILES = @ac_config_files@
+
+configfiles: $(CONFIG_FILES)
+.PHONY: configfiles
+
+$(CONFIG_FILES): %: %.in config.status
+ ./config.status $@
+
+config.status: configure
+ ./config.status --recheck
+
+configure: configure.in
+ autoconf --force
+ autoheader --force
+
all: $(SUBDIRS) DOCSTRINGS
.PHONY: all
diff -r ff61b53eb294 -r 9d9b18e73f87 scripts/configure.in
--- a/scripts/configure.in Fri Jan 30 15:42:51 2009 -0500
+++ b/scripts/configure.in Sun Feb 01 12:34:38 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 \