This commit builds the debug and instrumented runtimes by default.
For a user that discovers a use for either of those, not having built
by default makes the experience pretty bad: they have to recompile
their own OCaml compiler, possibly from a source checkout if the
option is not available on opam...
With this change the total compilation time only increased by
7 seconds on my machine, from 3m24s to 3m33s -- these are sequential
builds, with parallel builds the difference is lost in the noise.
We wish to make -with-instrumented-runtime the default, but not break
the build on systems that do not support it -- when clock_gettime is
missing. This is done by tracking whether -with-instrumented-runtime
was set explicitly or is the default value; in the latter case,
a missing clock_gettime defaults to no instrumented runtime, without
raising an error at configure-time.
Otherwise leftover .a files from an earlier compilation may contain
unwanted modules, as shown in MPR#7679.
However, ocamlmklib always erases the destination .a file before
calling the `mkdll` function defined in `#ml` blocks of the
configuration makefile. Hence there is no need for a `rm` (or `del`)
shell command in `mklib`.
Finally, in the config/Makefile.mingw* files, we can safely assume
"ar" supports the "s" option because this is "ar" from the GNU
binutils, so no need to call ranlib.
The terminfo C library was used for displaying error messages from the
toplevel. Instead, just use ANSI escape sequences to display, and a
ioctl() to get the number of lines of the terminal.
- Remove byterun/terminfo.c
- Add primitive to query number of lines to io.c
with OS-dependent code in unix.c (ioctl-based implementation)
and win32.c (no implementation yet)
- Add a Terminfo.num_lines function and simplify interface to Terminfo.setup
- Query num_lines every time an error message needs to be highlighted,
so as to react to windows resizing.
- Bootstrap to enable removal of old primitives.
Use the system-provided execvpe() if possible. Otherwise, use
a serious reimplementation written in OCaml and patterned after
the Glibc execvpe() implementation.
Added a test in tests/lib-unix/unix-execvpe.
Don't test Unix.execvpe if we are using the system-provided implementation.
The execvpe() functions provided by Win32 and Cygwin aren't quite to
our specs. At any rate, the test is there to find bugs in our
implementation of execvpe(), not in others's.
-(un)safe-string becomes -(no-)force-safe-string
-(un)safe-string-default becomes -default-unsafe-string
Config.safe_string (and Clflags.unsafe_string) keep their name for
backward-compatibility, as well as the C define CAML_SAFE_STRING
(which corresponds to -force-safe-string).
The CPP variable tells the build system how to invoke the C preprocessor.
Before this commit, this variable was defined by the Windows Makefiles
but not by the Makefile generated by configure. This commit fixes this.
This commit also fixes a few makefiles: to compute dependencies for C files,
they incorrectly called $(CPP) -MM instead of $(CC) -MM.
Continuing a general effort, this commit removes the "num" library for arbitrary-precision arithmetic from the core OCaml system. A standalone distribution of this library already exists and is hosted at https://github.com/ocaml/num
The opam-compiler-conf script will generate an opam switch name
(and thus a directory name) from the name of the current git
branch. Branches named 'PR#1234-foo-bar' would have the ./configure
script generate a config/Makefile with the lines
PREFIX=~/.opam/4.06.0+local-git-PR#1234-foo-bar
BINDIR=$(PREFIX)/bin
BYTERUN=$(BINDIR)/ocamlrun
LIBDIR=$(PREFIX)/lib/ocaml
The '#' in the first line parses as the start of a comment, so
the second part is ignored and the build system would then install
in ~/.opam/4.06.0+local-git-PR instead.
After this change, config/Makefile starts with:
# generated by ./configure --prefix ~/.opam/4.06.0+local-git-PR#1234-foo-bar
CONFIGURE_ARGS=--prefix ~/.opam/4.06.0+local-git-PR\#1234-foo-bar
PREFIX=~/.opam/4.06.0+local-git-PR\#1234-foo-bar
* Restrict Unix.environment to return an empty array in privileged environments.
* Add Unix.unsafe_environment.
Unix.unsafe_environment is an analogue of Unix.environment that
returns the process environment regardless of privileges.
* fall back to __secure_getenv when secure_getenv is not available
* use secure_getenv for instrumented runtimes
* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
* fall back to __secure_getenv when secure_getenv is not available
* use secure_getenv for instrumented runtimes
* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
This commit moves:
- config/m.h to byterun/caml/m.h
- config/s.h to byterun/caml/s.h
Consequently, m.h and s.h now get installed alongside other
OCaml header files.
This commit also updates the .depend files, introducing updates in the
dependencies which are not consequences of this commit itself.
This patch adds support for xlc (IBM C compiler, used on
Linux and AIX) in cckind.cc and enables shared libraries
support in bytecode compiled programs on AIX.
It was tested on Linux/gcc and AIX7.1/xlc 12. By default
configure script uses gcc compiler, so there should be no
impact on Linux/xlc systems. To use xlc one should run
configure with -cc xlc.
This commit is a follow-up to PR#1114. It ensures that C compilers
other than msvc are called with a space between the -o option and
its object or executabe file argument.
It contains the section for library function manual pages (3).
This will be useful to properly install the manual pages generated
by ocamldoc for the standard library.
Before this commit, auxiliary scripts were called before verbose
was exported, so they were not executed in verbose mode.
This commit fixes this and makes sure all the auxiliary scripts take
the verbose environment variable into acocunt.
Before this commit there was BYTECCRPATH and NATIVECCRPATH, but they
were actually identical to each other.
This commit gets rid of them and uses the RPATH variable.