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.
For the verbose variable, use boolean values true and false rather
than yes and no.
Also fix indentation in scripts under config/auto-aux where appropriate.
Generally, OCaml creates dynamic libraries in three cases:
* when building bytecode stubs (dllX.so);
* when building a .cmxs plugin;
* when building a .native.so or even .byte.so.
Right now, this results in DLLs on Windows and ELF shared objects on Linux,
all of which can be dynamically loaded (with dlopen() or equivalent) or
linked against (with the -l linker flag or equivalent). However, on macOS,
this is not the case.
macOS has two kinds of dynamic libraries: "bundles" and "dylibs". Prior to
the version 10.4, there have been significant differences between these,
which I will not describe in this commit because 10.4 has long became
irrelevant. After 10.4, there are only two differences:
* rpath is handled slightly differently.
* dylibs can be linked against, with the -l linker flag;
Before this commit, ocamlc/ocamlopt on macOS produce bundles, when using
the .so extension for the output file. After this commit, OCaml on macOS
will produce dylibs, when using the same extension. The rationale is as
follows:
* For bytecode stubs and plugins, the exact structure of which is essentially
an implementation detail of the OCaml runtime, nothing will change because
they can still be dynamically loaded.
* For .native.so and .byte.so objects, there are two changes:
1. The objects can be linked against with the -l flag.
2. The objects can be linked with the -cclib -shared flag, which is
what ocamlbuild and perhaps other buildsystems pass when building
a shared object through -output-obj/-output-complete-obj.
These variables represent the C compilers ocamlc and ocamlopt should use
to compile a third-party C source file when no -cc command-line option
has been specified.
Thanks to these variables, the substitutions performed in Makefile and
Makefile.nt to generate utils/config.ml from utils/config.ml become
similar.
(The NATIVE_C_COMPILER variable is not really necessary but it has still
been introduced to preserve symetry.)
This variable is used to give a value to standard_runtime in
utils/config.ml.
Before this commit, its values were hard-coded in Makefile and
Makefile.nt, in the rules generating utils/config.ml from utils/config.mlp.
This commit gets rid of this hardcoding, to prepare the sharing of the
rules mentionned above.
* Merge Unix and Windows build systems in the asmrun directory
Changes in make variables:
- Removal of the SHARED make variable, which had the same
semantics than SUPPORTS_SHARED_LIBRARIES, the later having values true
and false while the former had values shared and noshared.
(SHARED was not defined on Windows)
- RUNTIMED now takes values true and false rather than runtimed and
noruntimed
* Do not use -O0 in asmrun's Makefile
* Add /asmrun/win32.c to .gitignore
* Build PIC libraries only under Unix
This makes things closer to what they were before, since PIC objects
were not built for Windows.