diff --git a/GNUmakefile.in b/GNUmakefile.in index 37503548bb..7353286c9d 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 kernel version GAP_KERNEL_MINOR_VERSION = @gap_kernel_minor_version@ GAP_KERNEL_MAJOR_VERSION = @gap_kernel_major_version@ diff --git a/Makefile.rules b/Makefile.rules index 7e47576b55..e44bfd376f 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -1272,6 +1272,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" ; \ @@ -1279,6 +1280,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 @@ -1289,6 +1291,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" ; \ @@ -1298,6 +1301,7 @@ $(srcdir)/src/config.h.in: $(configure_deps) echo "autoheader not available, proceeding with stale config.h" ; \ fi touch $@ +endif GNUmakefile: $(srcdir)/GNUmakefile.in config.status $(SHELL) ./config.status $@ diff --git a/configure.ac b/configure.ac index 938fcd3945..958e031960 100644 --- a/configure.ac +++ b/configure.ac @@ -214,6 +214,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])], @@ -222,6 +243,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])],