From 3a40b2fd94a98bf69ce8a73c62edb0081ae3bc70 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 17 Apr 2020 13:53:49 +0100 Subject: Introduce Makefile.build_config.in This moves the configure-generated parts of Makefile.common to a separate (generated) Makefile, allowing Makefile.common to be a normal Makefile. OCaml's build system Makefile's now include Makefile.build_config (which itself includes Makefile.config) but Makefile.config is still installed as before. This allows configure to generate variables which are specific to the build process and are not intended to be exported to the installation. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ffa0435659..7119d1b572 100644 --- a/configure.ac +++ b/configure.ac @@ -170,7 +170,7 @@ AC_SUBST([stdlib_manpages]) ## Generated files -AC_CONFIG_FILES([Makefile.common]) +AC_CONFIG_FILES([Makefile.build_config]) AC_CONFIG_FILES([Makefile.config]) AC_CONFIG_FILES([tools/eventlog_metadata]) AC_CONFIG_HEADERS([runtime/caml/m.h]) -- cgit v1.2.1 From ac2a9dd188f0738a87018f5ee6e6b0b301bb1b63 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Fri, 17 Apr 2020 14:11:22 +0100 Subject: 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). --- configure.ac | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'configure.ac') 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"], -- cgit v1.2.1