diff --git a/GNUmakefile.in b/GNUmakefile.in index 92069a3d8d..d12d63bcec 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -27,6 +27,9 @@ GC_SOURCES = @GC_SOURCES@ COMPAT_MODE = @COMPAT_MODE@ GAPARCH = @GAPARCH@ +# maintainer mode +MAINTAINER_MODE = @MAINTAINER_MODE@ + # GAP version and release date GAP_VERSION = @GAP_VERSION@ GAP_RELEASEDAY = @GAP_RELEASEDAY@ diff --git a/Makefile.rules b/Makefile.rules index eab6f5f1ab..a618f176e5 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -1290,6 +1290,7 @@ configure_deps = $(srcdir)/configure.ac $(ACLOCAL_M4) config.status: $(srcdir)/configure $(SHELL) ./config.status --recheck +ifneq ($(MAINTAINER_MODE),no) $(srcdir)/configure: $(configure_deps) @if command -v autoconf >/dev/null 2>&1 ; then \ echo "running autoconf" ; \ @@ -1297,6 +1298,7 @@ $(srcdir)/configure: $(configure_deps) else \ echo "autoconf not available, proceeding with stale configure" ; \ fi +endif gen/config.h: gen/stamp-h @if test ! -f $@; then rm -f gen/stamp-h; else :; fi @@ -1307,6 +1309,7 @@ gen/stamp-h: $(srcdir)/src/config.h.in config.status $(SHELL) ./config.status gen/config.h echo > $@ +ifneq ($(MAINTAINER_MODE),no) $(srcdir)/src/config.h.in: $(configure_deps) @if command -v autoheader >/dev/null 2>&1 ; then \ echo "running autoheader" ; \ @@ -1316,6 +1319,7 @@ $(srcdir)/src/config.h.in: $(configure_deps) echo "autoheader not available, proceeding with stale config.h" ; \ fi touch $@ +endif doc/versiondata: $(srcdir)/doc/versiondata.in config.status @$(SHELL) ./config.status $@ diff --git a/configure.ac b/configure.ac index 2319cf8181..b89d769af1 100644 --- a/configure.ac +++ b/configure.ac @@ -386,6 +386,27 @@ AC_ARG_ENABLE([debug], AC_MSG_CHECKING([whether to enable debug mode]) AC_MSG_RESULT([$enable_debug]) +dnl +dnl Maintainer mode (on by default) controls whether our build system +dnl automatically regenerates `configure` if `configure.ac` or any of its +dnl other sources changes, by running `autoconf`. Similarly, it regenerates +dnl `src/config.h.in` if necessary by running `autoheader`. +dnl +dnl While this is very useful when developing GAP, it can be problematic if +dnl a user wants to compile a release version of GAP but does not have +dnl autoconf installed; or if for some reason the GAP source code is readonly +dnl and they want to run an out-of-tree build. Thus we allow turning this +dnl off. +AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--disable-maintainer-mode], [disable maintainer mode])], + [], + [enable_maintainer_mode=yes] + ) +AC_MSG_CHECKING([whether to enable maintainer-mode mode]) +AC_MSG_RESULT([$enable_maintainer_mode]) +AC_SUBST([MAINTAINER_MODE], [$enable_maintainer_mode]) + +dnl AC_ARG_ENABLE([memory-checking], [AS_HELP_STRING([--enable-memory-checking], [enable memory checking])], [AC_DEFINE([GAP_MEM_CHECK], [1], [define if building with memory checking])], @@ -394,6 +415,7 @@ AC_ARG_ENABLE([memory-checking], AC_MSG_CHECKING([whether to enable memory checking]) AC_MSG_RESULT([$enable_memory_checking]) +dnl AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--enable-valgrind], [enable valgrind extensions to GASMAN])], [AC_DEFINE([GAP_MEMORY_CANARY], [1], [define if building with valgrind extensions])],