changeset 8850:538184c540a9

Add make target "configfiles" to automatically regenerate configuration files
author Thorsten Meyer <thorsten.meyier@gmx.de>
date Tue, 24 Feb 2009 01:46:37 -0500
parents 8b7e448d989c
children d6de39523f03
files ChangeLog Makeconf.in Makefile configure.in octMakefile.in scripts/ChangeLog scripts/Makefile.in scripts/configure.in
diffstat 8 files changed, 68 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 24 00:57:01 2009 -0500
+++ b/ChangeLog	Tue Feb 24 01:46:37 2009 -0500
@@ -1,5 +1,16 @@
+2009-02-24  John W. Eaton  <jwe@octave.org>
+
+	* configure.in: Copy Makefile to build directory if not building
+	in srcdir.
+
 2009-02-24  Thorsten Meyer  <thorsten@hexe>
 
+	* 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.
+
 	* Makefile.in: Rename to Makefile.
 	* configure.in: Remove Makefile from list of autogenerated
 	configuration files.
--- a/Makeconf.in	Tue Feb 24 00:57:01 2009 -0500
+++ b/Makeconf.in	Tue Feb 24 01:46:37 2009 -0500
@@ -260,6 +260,8 @@
 # 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
--- a/Makefile	Tue Feb 24 00:57:01 2009 -0500
+++ b/Makefile	Tue Feb 24 01:46:37 2009 -0500
@@ -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 ""
 
--- a/configure.in	Tue Feb 24 00:57:01 2009 -0500
+++ b/configure.in	Tue Feb 24 01:46:37 2009 -0500
@@ -2102,6 +2102,12 @@
 
 ### Do the substitutions in all the Makefiles.
 
+AC_CONFIG_COMMANDS([Makefile], [if test "$ac_srcdir" != "."; then
+  cp $srcdir/Makefile .
+fi])
+
+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
@@ -2116,6 +2122,7 @@
   libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile
   libcruft/slatec-err/Makefile libcruft/villad/Makefile
   libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile])
+
 AC_OUTPUT
 
 ### Print a summary so that important information isn't missed.
--- a/octMakefile.in	Tue Feb 24 00:57:01 2009 -0500
+++ b/octMakefile.in	Tue Feb 24 01:46:37 2009 -0500
@@ -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)
+	(cd $(top_srcdir); autoconf --force)
+	(cd $(top_srcdir); autoheader --force)
+
 src: liboctave
 
 liboctave: libcruft
--- a/scripts/ChangeLog	Tue Feb 24 00:57:01 2009 -0500
+++ b/scripts/ChangeLog	Tue Feb 24 01:46:37 2009 -0500
@@ -1,3 +1,10 @@
+2009-02-08  Thorsten Meyer  <thorsten.meyier@gmx.de>
+
+	* configure.in: AC_SUBST ac_config_files
+
+	* Makefile.in:  Add make targets for configuration files
+	and config.status.
+
 2009-02-23  John W. Eaton  <jwe@octave.org>
 
 	* plot/fplot.m: Fix nargin check.
--- a/scripts/Makefile.in	Tue Feb 24 00:57:01 2009 -0500
+++ b/scripts/Makefile.in	Tue Feb 24 01:46:37 2009 -0500
@@ -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)
--- a/scripts/configure.in	Tue Feb 24 00:57:01 2009 -0500
+++ b/scripts/configure.in	Tue Feb 24 01:46:37 2009 -0500
@@ -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 \