Commit Graph

32 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Sébastien Hinderer 478127ff43 Build system: use OC_CFLAGS and CFLAGS even during the link stage 2020-08-10 13:52:47 +02: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
Fourchaux 44e6cf4e0f
typos (#9806) 2020-07-28 12:22:03 +01:00
Nicolás Ojeda Bär 0b6ebb3155 Remove integration with libbfd 2020-07-02 06:40:10 +02:00
Xavier Leroy 41227a1eba configure: add a NAKED_POINTERS parameter to Makefile.config
We have NAKED_POINTERS=false if configured with --disable-naked-pointers,
NAKED_POINTERS=true otherwise.
2020-06-22 14:20:05 +02:00
David Allsopp d192a2c284 Eliminate MKEXE_ANSI from build system 2020-06-06 13:36:15 +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 2b4fe09dc7 Eliminate Config.ocamlopt_c{,pp}flags
Config.ocamlopt_cflags and Config.ocamlopt_cppflags were solely used by
the driver when compiling .c files passed on the command line. The
behaviour of this should be the same as for `ocamlc -c` and the
inclusion of `-fPIC` in `ocamlc_cflags` only on some systems causes
problems for `ocamlmklib` which behaves as though the two drivers
compile C files identically.

This PR eliminates the separate settings in configure.ac and deprecates
the old variables in Config.
2019-04-20 13:00:30 +01:00
David Allsopp 998019d68b Update otherlibraries description 2018-12-04 11:02:41 +00:00
David Allsopp b03c1c78c7 Add --disable-ocamltest 2020-01-16 16:50:27 +00:00
Gabriel Scherer e232369580
Merge pull request #8835 from dra27/save-the-planet
New configure option to disable building and installing library manpages
2019-10-05 16:52:16 +02:00
Sébastien Hinderer 987b0814d7 Let make's default target build the compiler
This commit makes it possible to build the OCaml compiler according to
its configuration by simply runnning make. There is no need to specify
neither world nor world.opt explicitly, although the two targets
remain available.

This commit also introduces (and starts making use of) the
NATIVE_COMPILER build variable whosse value is true when the native
compiler is enabled and false otherwise.
2019-09-30 16:01:29 +02:00
David Allsopp 2d717cb71a Add --disable-stdlib-manpages to configure 2019-09-27 17:13:24 +01:00
Sébastien Hinderer e3b33a5750 Build system: introduce the BFD_LDFLAGS variable
This variable is not really used yet but will be used soon.
2019-09-23 14:45:54 +02:00
Sébastien Hinderer 4b1ca767cb Build system: reorder BFD-related variables in Makefile.config 2019-09-23 14:45:54 +02:00
Sébastien Hinderer 762fe0abaa Build system: rename the LIBBFD_INCLUDE variable to BFD_CPPFLAGS 2019-09-23 14:45:54 +02:00
Sébastien Hinderer d718cd9db3 Build system: rename the LIBBFD_LINK variable to BFD_LDFLAGS 2019-09-23 14:45:54 +02:00
Greta Yorsh 27a92a9445 Emit each function in a separate section (amd64,i386,arm,arm64)
Add --enable-function-sections option to configure. With this option,
the compiler will emit each function in a separate named text section,
on supported targets. This enables function reordering using a linker
script. With this option, the compiler also emits caml_hot__code_begin
and caml_hot__code_end sections. This allows a linker script to
move function sections outside of the segments they belong to,
without breaking caml_code_segments.
2019-07-15 10:25:26 +01:00
Sébastien Hinderer 6bb155f9bb build system: remove the config/ directory
None of the files in this directory is used any more.
2019-06-10 13:56:51 +01:00
Sébastien Hinderer de8168c303 Make sure the build variables are defined 2019-05-17 13:58:03 +02:00
David Allsopp 049f4e53ec config/Makefile.m* tidy (#8640)
* Make s-nt.h and m-nt.h more autoconf-like

* Add SIZEOF_LONGLONG to m-nt.h

It's not used, but autoconf will generate it.

* Sections of s-nt.h and m-nt moved to config.h

* Re-order lines of s-nt.h

Allows the output to be more readily compared with autoconf's generated
s.h. Lines are purely reordered so:

diff <(git cat-file --textconv HEAD~1:config/s-nt.h | sort) \
     <(git cat-file --textconv HEAD:config/s-nt.h | sort)

should return no differences.

* Add extra defines to s-nt.h for mingw32

These match up with facts determined by autoconf. The following
additional HAS_ defines are made:

- HAS_UNISTD
    Behaviour of otherlibs/unix/access.c and otherlibs/win32unix/lseek.c
    is affected but the effect is correct.
    Behaviour of runtime/fix_code.c affected, but unistd.h includes
    io.h, so there's no effective change.
    In other cases, unistd.h is simply included where before it wasn't.
- HAS_DIRENT
    Used in Unix-only closedir.c, opendir.c, readdir.c and rewinddir.c
    Used in runtime/unix.c, but that obviously won't affect Windows!
- HAS_REWINDDIR
    Used in Unix-only rewinddir.c
- HAS_TRUNCATE
    Used in Unix-only ftruncate.c, mmap.c and truncate.c
- HAS_NANOSLEEP
    Used in Unix-only sleep.c
- HAS_GETTIMEOFDAY
    Used in vmthreads and Unix-only gettimeofday.c
    Used in runtime/sys.c, but in a branch guarded by #ifndef _WIN32
- HAS_MKSTEMP
    Changes yacc/main.c to use the MinGW implementation of mkstemp
    (part of mingwex, which is linked by flexdll)

* Remove the old DISTRIB variable

This variable was originally added in 1973b55 and 1596174 and was always
specifically for Windows for installing the README files.

This should have been renamed to INSTALL_DISTRIB in de4f4cf (which was
part of MPR#6358/GPR#27). It should then have been removed in 13bb9d2
(GPR#1033).

May it forever rest in peace.

* Tweak the config/Makefile.m* to match autoconf

* Build debug runtime by default on Windows

* Build raw_spacetime_lib on msvc64 & mingw64

* Set ENABLE_CALL_COUNTS to true for Windows

No-op, since spacetime is not enabled by default, but easier comparison
with autoconf

* Remove X11 definitions from old Makefiles

win32graph removed in #2318

* mingw ports should use gcc for CPP

* Correct MKEXEDEBUGFLAG for mingw ports

-g is ignored by flexlink, -link -g is passed on to GCC.

* Correct SO to be dll not s.obj/s.o

Pedantic correction - $(SO) is not used by the Windows ports.

* Re-order lines of config/Makefile.m*
2019-05-14 15:03:43 +02:00
Sébastien Hinderer 17feab2a4f
configure: use variables rather than arguments for a few options (#8616)
This commit replaces a few configure command-line options by configuration
variables:

- "--with-dllibs" is replaced by DLLIBS
- "--with-reserved-header-bits" is replaced by RESERVED_HEADER_BITS
- "--with-default-string" is replaced by DEFAULT_STRING
2019-05-09 16:39:06 +02:00
David Allsopp 8838dc7527 Don't generate #! headers over 127 characters
A #! line should not exceed 128 characters (including the \0
terminator). This adds a test - both to the generation of the camlheader
files and also to the -use-runtime flag which falls back to #!/bin/sh
and uses exec to invoke the the interpreter.
2019-05-02 20:29:49 +02:00
David Allsopp 278e5abbc0 Merge the generation of stdlib/camlheader* (#2267)
Windows and Unix build instructions for the program versions of the
header stubs unified. For Cygwin, this also fixes the parallel build.
2019-04-10 00:52:48 +02: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
Jérémie Dimino c413136fa3 Delete otherlib/{graph,win32graph} (#2318)
The Graphics library is now distributed as a separate package.
The sources are at https://github.com/ocaml/graphics .

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-18 15:05:57 +01:00
Mark Shinwell 2cc1ea26b9 Remove gprof support (#2314)
This commit removes support for gprof-based profiling (the -p option to ocamlopt).  It follows a discussion on the core developers' list, which indicated that removing gprof support was a reasonable thing to do. The rationale is that there are better easy-to-use profilers out there now, such as perf for Linux and Instruments on macOS; and the gprof support has always been patchy across targets. We save a whole build of the runtime and simplify some other parts of the codebase by removing it.
2019-03-16 19:56:53 +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
Nicolás Ojeda Bär 612dbf1b74 Makefile: adapt to removal from vmthreads 2019-03-11 20:52:17 +01:00
David Allsopp 832db132d9 Make unix, vmthreads and str optional libraries
--disable-unix-lib, --disable-vmthreads and --disable-str-lib added to
prevent building these three libraries.

ocamldoc, the debugger and caml-tex are automatically disabled if their
prerequisites are not built. Using --enable-debugger and
--enable-ocamldoc will result in errors if these tools cannot be built.
2019-01-08 17:27:42 +01:00
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00