summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2020-04-17 14:11:22 +0100
committerDavid Allsopp <david.allsopp@metastack.com>2020-04-17 14:11:22 +0100
commitac2a9dd188f0738a87018f5ee6e6b0b301bb1b63 (patch)
treeef3b5d03c80540cc5995a864f90cc95226ac93d8 /configure.ac
parentbe6eb2ccdabb957c4817b8a24280b2f4249ac87f (diff)
downloadocaml-ac2a9dd188f0738a87018f5ee6e6b0b301bb1b63.tar.gz
Cease committing C dependendency information
When building for the first time, the only requirement is that generated header files have been built (jumptbl.h, version.h and opnames.h). Detailed dependency information is only required when headers have been edited. COMPUTE_DEPS in Makefile.config controls whether C dependency information should be generated on a per-file basis. This variable is controlled by a new --disable-dependency-generation in configure which is enabled for Git checkouts and disabled for tarballs (i.e. releases). The Microsoft C compiler (cl) cannot generate dependencies in a consistent way which we can consume, so for a Git checkout configure searches for an additional C compiler in order to compute dependencies. This is obviously not required for a user-build. As a result, the MSVC port can now safely run make alldepend, since only OCaml dependency information is committed to the repo after this change. CI does not need to waste time testing the dependency information, because it only tests a single build. A single Travis job has been added which tests the build system code to generate the dependency information (and provides a single `make -j` run in CI, although Inria's CI also tests parallel building continuously).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7119d1b572..3fe9e480db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,6 +167,7 @@ AC_SUBST([flexdll_chain])
AC_SUBST([flexlink_flags])
AC_SUBST([PACKLD])
AC_SUBST([stdlib_manpages])
+AC_SUBST([compute_deps])
## Generated files
@@ -214,6 +215,12 @@ AC_ARG_ENABLE([debugger],
[],
[enable_debugger=auto])
+AC_ARG_ENABLE([dependency-generation],
+ [AS_HELP_STRING([--disable-dependency-generation],
+ [do not compute dependency information for C sources])],
+ [],
+ [enable_dependency_generation=auto])
+
AC_ARG_VAR([DLLIBS],
[which libraries to use (in addition to -ldl) to load dynamic libs])
@@ -414,6 +421,27 @@ AS_IF([test x"$host_os" = "xwindows"],[host_os=mingw])
LT_INIT
host_os=$old_host_os
+AS_CASE([$host],
+ [*-pc-windows],
+ [AC_CHECK_TOOLS(
+ [DEP_CC],
+ [$DEP_CC gcc cc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc],
+ [false])],
+ [DEP_CC="$CC"])
+
+AS_CASE([$enable_dependency_generation],
+ [yes],
+ [AS_IF([test "$DEP_CC" = "false"],
+ [AC_MSG_ERROR(m4_normalize([The MSVC ports cannot generate dependency
+ information. Install gcc (or another CC-like compiler)]))],
+ [compute_deps=true])],
+ [no], [compute_deps=false],
+ [AS_IF([test -e .git],
+ [AS_IF([test "$DEP_CC" = "false"],
+ [compute_deps=false],
+ [compute_deps=true])],
+ [compute_deps=false])])
+
# Extracting information from libtool's configuration
AS_IF([test -n "$RANLIB" ],
[RANLIBCMD="$RANLIB"],