Commit Graph

86 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
David Allsopp 9bc33d945a Add Ocamltest_stdlib.Unix.has_symlink
Replaces the duplicated C stub. Functions from Unix must be explictly
imported.
2020-07-23 14:55:36 +01:00
Sébastien Hinderer f3ff1337a1 Build system: honour the CFLAGS and CPPFLAGS build variables
With this commit, it becomes possible to provide C compiler and preprocessor
flags to use in addition to those defined by the build system.

As required by the GNU coding standards, the flags can be provided
either at configure or at make invocation.

The provided CFLAGS and CPPFLAGS will also be taken into account
when C code is compiled by ocamlc/ocamlopt.

This commit removes the explicit reference to CFLAGS in the
configuration for the xlc compiler, since it is not necessary any longer.
2020-08-06 14:30:50 +02:00
Xavier Leroy 133102cfc7 ocamltest: add the "naked_pointers" action
It succeeds if the runtime system supports naked pointers,
and fails otherwise (e.g. if configured with --disable-naked-pointers).
2020-06-22 19:37:15 +02:00
Sébastien Hinderer bdd9ca391e Add the $(EXE) suffix to all programs at build rather than install time
This commit touches neither boot/ocamlc nor boot/ocamllex

It has the side-effect of fixing the cleanup rules which did not use the
$(EXE) extension when removing a file although it was produced with the
$(EXE) extension.
2020-06-18 11:16:55 +02:00
Sébastien Hinderer a50d177c2a ocamltest: improve the way executable file extension is determined
Use the EXE build variable rather than OS type to determine the
extension of executable files
2020-06-18 11:07:43 +02:00
David Allsopp d192a2c284 Eliminate MKEXE_ANSI from build system 2020-06-06 13:36:15 +01:00
David Allsopp da943eac54 Share generation code between ocamltest and utils
ocamltest/ocamltest_config.ml now generated using same make macros as
utils/config.ml.
2020-06-06 13:36:00 +01:00
Gabriel Scherer 11c9d92732 ocamltest/Makefile: do not depend on UNIX_OR_WIN32 for 'clean'
Change suggested by David Allsopp.
2020-05-06 12:10:02 +02:00
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02:00
David Allsopp ac2a9dd188 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).
2020-04-17 14:11:22 +01:00
David Allsopp 3a40b2fd94 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.
2020-04-17 13:53:49 +01:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +01:00
David Allsopp d4a566573f Allow make to be invoked before configure
This should be improved to give better warnings for when Makefile.config
and Makefile.common are required.
2018-12-04 10:28:36 +00:00
Gabriel Scherer d45e39d1fd fix Makefile dependencies of ocamltest
The ocamltest modules depend on core-compiler modules and get linked
with compilerlibs archives, but those dependencies were not recorded
in the makefile, leading to incremental build errors.

(A particular error I encountered is that ocamltest/Ocaml_actions now
depends on Lambda through Cmo_format, but was not correctly rebuilt
after Lambda changes, leading to link-time failure when linking
ocaml_actions.cmo and ocamlcommon.cma together.)

This commit adds dependencies on the compilerlibs archives, as a proxy
for the corresponding compiler modules.
2020-01-06 12:30:48 +01:00
Sébastien Hinderer 1c0424c80e ocamltest: draft of reference manual (tutorial section) 2019-11-28 18:04:53 +01:00
Greta Yorsh 3f36ed3d74 Tests for -stop-after scheduling 2019-10-30 19:05:23 +00:00
Gabriel Scherer 56e57338f7 ocamltest Makefile: use ocaml{c,opt}.opt when available
On my machine the sequential build time goes from 7.5s to 3.5s.
2019-10-12 10:23:29 +02:00
Sébastien Hinderer c1d7b8f47f ocamltest: add support for using strace 2019-09-26 17:44:22 +02:00
Sébastien Hinderer 47c887584d ocamltest: take parsing of response files out of environments module
This commit is a follow-up to 123334881a.

Its purpose is to make the environments module abstract again,
by moving the parsing mechanism in its own module.
Consequently, the environments module can be linked earlier again (as
was the case before the commit mentionned above) and can thus be
used in other modules.
2019-09-26 17:44:22 +02:00
Sébastien Hinderer 5ec649f0cb
Build system: share rules to compile C files (#8930)
This commit deduplicates some of the Makefile rules used to compile C files.

Rather than having one such rule per Makefile for each directory
containing C files, the relevant rules are moved to Makefile.common.in.
2019-09-11 09:16:15 +02:00
Sébastien Hinderer db7fee200f ocamltest/Makefile: cosmetic changes to become closer to other makefiles
This commit modifies the rule that builds object files from C files in
ocamltest/Makefile. The -c option is made to appear as the first rather than
last command-line argument and the name of the output file is specified
explicitly.

This is to prepare a refactoring in the build system.
2019-09-04 18:25:19 +02:00
Greta Yorsh 63f62123df Improve test for function sections 2019-07-15 10:25:26 +01:00
David Allsopp 31f828a5f7 Use boot ocamllex when building ocamltest 2019-06-24 07:56:05 +01:00
Sébastien Hinderer a201ade7f3 Build system: make ocamllex silent by default (#8664)
This commit makes e.g. make -s world.opt completely
silent when everything works, in order to increase the visibility of
any unexpected message occurring during the build.
This will be useful for instance during CI, in particular it should
make it easier to catch undefined build variables.

The implementation is straightforward. The OCAMLLEX_FLAGS variable is
defined in Makefile.common.in and then used consistently by all
lexing recipes.

In addition, in tools/Makefile, the two rules producing the lexers
from cvt_emit.mll and make_opcodes.mll have been replaced by a
pattern-rule and the useless .SUFFIXES target has been removed.
2019-05-07 11:32:05 +02:00
Damien Doligez 123334881a Harden ocamltest against errors in scripts and hooks 2019-04-02 17:24:16 +02:00
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
Sébastien Hinderer b56c4ff3d0
Get rid of the direct call to the C preprocessor in the testsuite (#8528)
Call the C preprocessor through the C compiler rather than calling it
directly.

This required the definition of a new ocamltest variable,
ocaml_filetype_flag, which makes it possible to override the filetype
inferred by the compiler from the extnesion of the source file.
2019-03-21 18:12:43 +01:00
Sébastien Hinderer f48b107bc7 Clarify the invocation of the C preprocessor
Most of the time, the C preprocessor needs to be invoked through the C
compiler, e.g. so that the paths to the header files are resolved properly.
In some cases, though, we really need to be able to call the C
preprocessor directly, just to expand macros in .ml files (this only
happens in the testsuite, at the moment). In those cases, it is
simply impossible to call the C preprocessor through the compiler,
e.g. because this would require the input files to have a '.c'
extension, which the OCaml compiler would misinterprete as meaning this file
should be compiled with the C compiler.

Thus, this commit clarifies the distinction between CPP and DIRECT_CPP
and provides both variables to the build system. The ocamltest build system
is also updated to take advantage of this.

We rely on autoconf's macros to detect how to call the C preprocessor
via the C compiler, except for the MSVC port where its value is hard-coded
to guarantee backward compatibility.
2019-03-13 10:49:31 +00:00
David Allsopp 432fd739aa Missing dependency in ocamltest Makefile 2019-02-01 16:18:53 +01:00
David Allsopp a3172267c4 Fix using -custom with -no-shared-libs
ocamltest links bytecode executables in custom-runtime mode if they have
C files, but it should also do this for any .cma files which require C
stubs on platforms which don't support dynamic C libraries.
2019-02-01 16:18:53 +01:00
Nicolás Ojeda Bär ba8eeb36bc ocamltest: do not remove intermediate file to avoid unnecessary rebuilding (#2224) 2019-01-21 15:16:54 +01:00
David Allsopp a9a76b58a8 Add hasstr and hassysthreads ocamltest actions
Skipped if the given library hasn't been built.
2019-01-08 17:27:42 +01:00
David Allsopp d889a0279a Add hasunix ocamltest action
This test is skipped if *neither* unix nor win32unix have been built.
2019-01-08 17:27:42 +01:00
Sébastien Hinderer d258bb78ac Build system: use ocamlc -depend rather than ocamldep 2019-01-03 16:43:23 +01:00
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00
Gabriel Scherer 46ef054330 Makefiles: restructure CAMLDEP usage to easily add flags
This change should be a refactoring no-op.

Before, a DEPFLAGS variable existed in some makefiles to contain
include directories to be passed to ocamldep invocations, but no
support for easily adding command-line flags to ocamldep was available
(invocations would systematically use -slash, which was duplicated
across callsites).

With this PR, a new DEPINCLUDES variable contains the include
directories, and DEPFLAGS is repurposed to contain other command-line
flags for the tool -- currently "slash".
2018-12-12 09:30:55 +01:00
Sébastien Hinderer ba6362a07d Move config/Makefile to Makefile.config
In order to prepare the transition to autoconf, this commit moves the
configuration Makefile out of the config directory which will disappear
and gives it the name it will have once intstalled, namely Makefile.config.
2018-09-17 14:23:35 +02:00
David Allsopp b069f692b4 Remove space from end of FLEXLINK_ENV 2018-09-07 08:34:53 +02:00
David Allsopp ad07b6d9b5 Use $(addprefix ...) and spacing adjustments 2018-09-07 08:34:53 +02:00
David Allsopp 4756a576f0 Move FLEXLINK_ENV definition to Makefile.common 2018-09-07 08:34:53 +02:00
David Allsopp cec4beae58 Use ROOTDIR in ocamltest Makefile 2018-09-07 08:34:53 +02:00
David Allsopp c13c200f87 Standardise setting and use of OCAML_FLEXLINK
Some Makefiles were using export to set OCAML_FLEXLINK "globally" while
others set a variable FLEXLINK_ENV and set the environment explicitly.

All Makefiles now use FLEXLINK_ENV and also only invoke it on linking
commands (rather than, for example, all invocations of ocamlopt).
2018-09-07 08:34:53 +02:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Sébastien Hinderer fc835fe41e Remove the BYTECCCOMPOPTS build variable
This variable is actually never defined.
2018-06-25 07:07:40 +02:00
Gabriel Scherer f3aca2376f
Merge pull request #1821 from gasche/makefiles-consistent-opt-targets
Makefiles: consistently offer `allopt` and `opt.opt` targets
2018-06-24 00:46:50 +02:00
Sébastien Hinderer 85fa27f7e9 Rename C compiler related build variables
This commit renames a few C compiler related build variables so that
they are reserved for the build system. They will then be re-introduced,
but this time as user varialbes whose value can be freely customized
when compiling the package, without risking to conflict with those
command-line flags that are required by the build system itself.

Here are the variables this commit renames:

- CFLAGS -> OC_CFLAGS
- CPPFLAGS -> OC_CPPFLAGS
- LDFLAGS -> OC_LDFLAGS

Note: before this commit the compilation of scheduler.c in
otherlibs/threads was relying on make's implicit rule to compile C files.

Since this commit stops using the standard variables for flags,
it is necessary to introduce an explicit rule to compile C files
and that makes use of the newly introduced variables.
2018-06-20 14:01:42 +02:00
Sébastien Hinderer a10a3f5806 Rename build variable SHAREDCCCOMPOPTS to SHAREDLIB_CFLAGS 2018-06-20 14:01:42 +02:00
David Allsopp 3eae3b9525 Allow MKDLL to be passed to ocamltest
Used in the testsuite to override config/Makefile's setting of MKDLL.
2018-06-14 11:01:49 +01:00