From 37133890321a57ee5622533ad8f7dada49aa4dfe Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 3 Oct 2005 01:29:52 +0200 Subject: [PATCH] Add support for rerunning the autotools Adaptation of automakes ... --- Makefile | 38 ++++++++++++++++++++++++++++++++++++-- configure.in | 4 ++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fda6ffcf..f21bfef4 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,45 @@ path_to_top = . -include $(path_to_top)/Makefile.config -# TODO: Automagically rerun autoconf. - SUBDIRS = doc po src CLEAN = features.log +all-recursive: config.h + +# Automagically rerun autotools +config.status: $(top_srcdir)/configure + $(SHELL) ./config.status --recheck + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +$(ACLOCAL_M4): configure.in acinclude.m4 + cd $(top_srcdir) && $(ACLOCAL) + +$(top_srcdir)/configure: $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOCONF) + +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi + +stamp-h: $(top_srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null + +$(top_srcdir)/config.h.in: $(top_srcdir)/stamp-h.in + @if test ! -f $@; then \ + rm -f $(top_srcdir)/stamp-h.in; \ + $(MAKE) $(top_srcdir)/stamp-h.in; \ + else :; fi + +$(top_srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(top_srcdir)/stamp-h.in 2> /dev/null + + ifeq ($(wildcard Makefile.config),) # Catch all $(MAKECMDGOALS) default: diff --git a/configure.in b/configure.in index 858c1e8c..24ac20fd 100644 --- a/configure.in +++ b/configure.in @@ -12,6 +12,10 @@ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package version]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version]) AC_CONFIG_HEADERS(config.h) +AC_CHECK_PROG(ACLOCAL,[aclocal],[aclocal],[config/missing aclocal]) +AC_CHECK_PROG(AUTOCONF,[autoconf],[autoconf],[config/missing autoconf]) +AC_CHECK_PROG(AUTOHEADER,[autoheader],[autoheader],[config/missing autoheader]) + AC_PROG_MAKE_SET builddir="`pwd`"