Commit Graph

646 Commits (master)

Author SHA1 Message Date
Sébastien Hinderer bc5907724f Clarify the help text for the debugger-related configure option 2019-01-22 16:51:12 +01:00
Sébastien Hinderer 6defc420d2 Fix typo in configure's help 2019-01-22 13:50:03 +01:00
David Allsopp 1dcb9d618b Add --disable-bigarray-lib
Disables building the legacy bigarray library without also having to
disable the unix library.
2019-01-08 17:59:44 +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
David Allsopp 91611d0b77 Rename --enable-pthread to --enable-systhreads
Name better reflects the cross-platform nature of the library.
2019-01-08 17:27:37 +01:00
David Allsopp 8e504739f8 Fix --disable-pthread
$systhread_support must be a valid OCaml boolean, as it gets written to
tools/config.ml
2019-01-08 17:25:54 +01:00
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00
Laurent Thévenoux db99969bc8 Support FMA operation (#1354)
Adds a fused multiply-add operation to the Float module.

The following changes are made:
- configure: check math.h for the C99 fma() operation.
- fma declarations in float.ml[i] (stdlib/).
- C fma() call or emulation in runtime/floats.c.
- dedicated tests in testsuite/tests/fma.
2018-10-26 10:45:36 +02:00
Sébastien Hinderer 6eea292727
Remove the dl_needs_underscore feature (#2115)
This feature could not be enabled anyway
2018-10-25 15:12:22 +02:00
Sébastien Hinderer e473b67081 runtime: move the definition of INT64_LITERAL from m.h to config.h 2018-10-23 09:01:29 +02:00
Sébastien Hinderer b799715cae tools: move the definition of mklib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Sébastien Hinderer 04d24edec0 tools: move the definition of syslib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Sébastien Hinderer ccae1e2876
Define OCAML_STDLIB_DIR in runtime/Makefile rather than in s.h (#2059) 2018-09-25 16:04:11 +02:00
Sébastien Hinderer 132b3a151d
Get rid of the standard_runtime configuration variable (#2066)
This configuration variable was formerly used by the -make_runtime and
-use_runtime option but this is no longer the case.
2018-09-25 15:29:18 +02: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
Sébastien Hinderer 7b28143ecb Change the way ARCH_CODE32 is defined
Before this commit, this C preprocessor macro was defined in
byterun/caml/m.h by the configure script, but just on some architectures
and only in non-PIC mode.

This commit introduces the HAS_ARCH_CODE32 predicate which is inserted
in the m.h file when this is relevant, the ifdef block on PIC
being moved to config.h.

This is to prepare the switch to autoconf, since header files processed
by config.status are not allowed to contain ifdef blocks.
2018-09-17 14:23:35 +02:00
Sébastien Hinderer 6676d9544c
Stop supporting obsolete platforms (#2024)
This commit simplifies the configure script by removing the support
for obsolete platforms. The list of removed platforms is documented
in the associated Changes entry.
2018-09-06 15:52:01 +02:00
Xavier Clerc 7e29162582 Pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler (#1930) 2018-07-27 12:25:23 +02:00
Xavier Leroy 7e79186a12
Remove the C plugins mechanism (#1867)
The mechanism complicates the runtime system and is not very general
(only a few system functions are instrumented).  There are other ways
to intercept system calls that are more general and require no
modification to the source code of the runtime system.
2018-07-03 18:22:51 +01:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Xavier Clerc 9c182f7e24 Add -dcamlprimc + pass -fdebug-prefix-map when available (#1845)
- Introduce `-dcamlprimc`, to keep the generated C file containing the primitive list
- Use `-fdebug-prefix-map` for compiling temporary C files when this option is supported
2018-06-27 14:56:29 +01:00
Sébastien Hinderer fc835fe41e Remove the BYTECCCOMPOPTS build variable
This variable is actually never defined.
2018-06-25 07:07:40 +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 b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Sébastien Hinderer c226df2716 Remove the NATIVECCPROFOPTS build variable
This variable is actually always empty
2018-06-14 15:25:39 +02:00
David Allsopp 02a3091a7d Export ARCH64 to config/Makefile as well as m.h
Allows it to be used more easily in the build system.
2018-06-11 22:52:00 +01:00
ygrek 1739e4ee13 include xlocale.h if available (because OSX)
ref https://github.com/ocaml/ocaml/pull/1682#issuecomment-377524854
2018-06-01 21:05:10 +02:00
ygrek b8dde22c46 avoid duplocale due to different semantics on BSD
https://www.freebsd.org/cgi/man.cgi?query=newlocale&sektion=3
2018-06-01 21:05:10 +02:00
ygrek 36d142e058 make string_of_float and float_of_string locale-independent 2018-06-01 21:05:10 +02:00
Sébastien Hinderer 09bf2fae0e configure should remove hashbang4 2018-05-18 09:17:59 +02:00
Mark Shinwell 8054e4f819 Add configure option to not install ".byte" executables (#1776)
In environments where the executables compiled to native code,
such as ocamlopt.opt, are always used in preference to the bytecode
versions then space can be saved by not installing the latter.
This patch provides a configure option to do such. It is relatively lightly
engineered; in particular, it won't complain if the native code executables
aren't themselves being built; but given this is an option for knowledgeable
users we think that it is reasonable.
2018-05-14 10:44:01 +02:00
Mark Shinwell ea2d6a1e31
Add configure options to control installation of source artifacts (#1777) 2018-05-14 08:15:44 +01:00
Pierre Chambart 0a42259060 Turn flambda invariants checks off by default (#1686) 2018-04-06 09:49:57 +01:00
Gabriel Scherer 682aceb2a4 Revert "make string_of_float and float_of_string locale-independent (#1185)"
This reverts commit b0181bf8ba.

The revert comes from the fact that it breaks the build on OSX, see

  https://github.com/ocaml/ocaml/pull/1185#issuecomment-377098168
2018-03-29 07:09:09 +02:00
ygrek b0181bf8ba make string_of_float and float_of_string locale-independent (#1185)
notes:

* ifdef fest for MSVC
https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale

* avoid duplocale due to different semantics on BSD
https://www.freebsd.org/cgi/man.cgi?query=newlocale&sektion=3

* mingw links against old msvcrt and doesn't have _create_locale
2018-03-28 16:33:09 +02:00
David Allsopp f0ac94d0c3 Enhance X11 detection logic (#1584) 2018-03-15 11:13:23 +00:00
David Allsopp 4d79045d95 Use gawk on Windows in the build system
awk is symbolic link in Cygwin, which means it can't be used in -pp for
a native Windows build. Just use gawk instead, as no other package
provides the awk command on Cygwin.
2018-02-12 08:29:16 +00:00
Xavier Leroy e71f1021b8
ARM 32-bit port: add support for ARMv8 in 32-bit mode, a.k.a. AArch32 (#1486)
For ARMv8/AArch32, avoid ITE conditional instruction blocks and use
simpler IT blocks instead.
2017-12-28 19:21:50 +01:00
Gabriel Scherer dc3086f92c configure: build the debug and instrumented runtimes by default (#1526)
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.
2017-12-15 10:03:24 +01:00
Andrey Bergman 0892f934e6 Replace non-existent with_spacetime_call_counts with enable_call_counts in configure. 2017-12-03 16:02:46 -06:00
Andrey Bergman db89791565 Remove unused curseslibs in configure. 2017-12-03 16:02:36 -06:00
Andrey Bergman 75269642cc Remove unused dllccompopt from configure. 2017-12-03 16:02:26 -06:00
Andrey Bergman 91f4dcab85 Remove unused x11_libs from configure. 2017-12-03 16:02:11 -06:00
Xavier Leroy 13785c9276
MPR#7679: make sure `.a` files are erased before calling `ar rc` (#1494)
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.
2017-11-30 11:25:17 +01:00
Xavier Leroy 852b595ff3
Remove dependencies on curses/terminfo/termcap C library (#1431)
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.
2017-11-26 15:49:31 +01:00
he32 df44fa572a Fix NetBSD/powerpc to build and work (#1409) 2017-10-20 12:45:04 +01:00
Leo White 6d3a8b904e Merge pull request #1421 from lpw25/call-counts-by-default
Enable call counts in spacetime by default
2017-10-17 13:42:00 +01:00
Leo White 8f6c6aca92 Enable call counts in spacetime by default 2017-10-12 16:52:09 +01:00
Xavier Leroy 970eebe4be MPR#7640: reimplementation of Unix.execvpe (#1414)
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.
2017-10-10 14:12:19 +02:00
Gabriel Scherer a202aa032b rename the configure-time safe-string options for clarity
-(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).
2017-10-02 14:42:19 +02:00
Gabriel Scherer 6550a30719 safe-string: clarify the relation between configure- and compile-time options 2017-10-02 14:42:19 +02:00
Xavier Leroy 46899afd5e In Sys.getcwd, don't call getwd if HAS_GETWD is not set (follow-up to #1086) (#1335) 2017-09-28 12:25:11 +01:00
Mark Shinwell a90d8c3b40 Revised configuration test for int64 alignment (#1371)
MacOS High Sierra balks at the redefinition of `int64_t`.
2017-09-27 15:45:41 +02:00
Sébastien Hinderer 8b6df3a755 Fix build of ocamlrund and ocamlruni under Unix
Because of previous commits these programs were not using LDFLAGS
when built under Linux.

This commit fixes this.
2017-09-27 12:31:56 +02:00
Nicolás Ojeda Bär 9fe6d0e2c2 Unicode support for the Windows runtime (#1200)
* Add support code

* Explicitly reference ANSI Windows APIs

* Adapt Sys.is_directory

* Adapt ocamlrun

* Add Changes entry

* Add testsuite

* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}

* Adapt headernt.c

* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.

* Adapt Sys.file_exists

* Adapt Sys.remove

* Adapt Sys.chdir

* Adapt Sys.getcwd

* Adapt Sys.getenv

* Adapt Sys.command

* Adapt Sys.readdir

* Adapt CPLUGINS

* Remove use of FormatMessageA, CreateFileA

* Adapt Unix.mkdir

* Adapt Unix.openfile

* Adapt Unix.readlink

* Adapt Unix.rename

* Adapt Unix.{LargeFile,}.{l,}stat

* Adapt Unix.system

* Adapt Unix.{open,read}dir

* Adapt Unix.link

* Adapt Unix.symlink

* Adapt Unix.getcwd

* Adapt Unix.rmdir

* Adapt Unix.utimes

* Adapt Unix.unlink

* Adapt Unix.chdir

* Adapt Unix.chmod

* Adapt Unix.{execv,execve,execvp,execvpe}

* Compile with -DUNICODE -D_UNICODE under Windows

* Add configure-time switch, Config.windows_unicode

* Adapt Unix.putenv

* Re-implement Unix.environment using GetEnvironmentStrings()

* Use Unicode-aware flexdll

* Adapt Unix.environment

* AppVeyor: bootstrap flexdll

* Adapt tests/embedded/cmmain.c

* Adapt tests/lib-dynlink-csharp/entry.c

* Remove exec tests

* Fixup

* Pass -municode to MinGW compiler

* Try to fix tests/embedded

* Adapt Sys.rename

* Correct Changes entry

* Makefile.several: use $(O) and $(NATIVECODE_ONLY)

* Display => skipped correctly for tests/win-unicode

* Add missing casts to execv* calls

It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).

* Missing header in systhreads (Win32 only)

* Revert "Pass -municode to MinGW compiler"

This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.

* Revert "Try to fix tests/embedded"

This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.

* Revert "Remove exec tests"

This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.

* Don't pass $(LDFLAGS) when build ocamlc.opt

It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).

* Use wmain on Windows for ocamlrun

* Build Unicode applications on Windows

* Use wmain in headernt.c

* Minor correction to win-unicode Makefile

* Switch submodule to FlexDLL 0.36

* Build ocamlyacc as an ANSI application

* Revert "Fixup"

This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.

* Fix casts for execvp/execve

* Remove tabs from test code

* Fix Changes entry

* shell32.lib is no longer necessary

* Free allocated string

* Changes: signal breaking change

* Disable exec_tests

* Protect with CAML_INTERNALS
2017-09-18 17:41:29 +02:00
Sébastien Hinderer b08deacf18 configure should define the CPP build variable
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.
2017-09-18 17:40:14 +02:00
Damien Doligez f086eda9c0 add -no-flat-float-array configure option 2017-09-15 18:24:36 +02:00
Xavier Leroy 967ff73a61 Remove otherlibs/num
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
2017-08-19 10:03:00 +02:00
Hannes Mehnert 27a7226a19 fix speculative usage of <sys/shm.h> in AFL runtime (#1278) 2017-08-09 14:59:05 +01:00
yallop 65c932253b String_val: return 'const char *' when -safe-string is globally enabled (#1274) 2017-08-03 14:19:13 +01:00
Mark Shinwell ba12f90fee Spacetime configure test 2017-08-03 08:20:04 +01:00
Gabriel Scherer 890c8bb2ca [minor] harden config/Makefile against '#' in PREFIX
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
2017-07-23 08:19:55 +02:00
AlexOnWork 72940fe95f Disable cplugins feature by default (#1242)
* Disable cplugins feature by default

* Both --with-cplugins and --no-cplugins configure options

* Added Changes entry for GPR#1242
2017-07-20 15:53:48 +02:00
Damien Doligez e6d64aacbd take @shindere's remarks into account 2017-07-18 13:12:34 +02:00
Damien Doligez f78128a7d7 merge 4.05 into trunk 2017-07-18 13:03:54 +02:00
Damien Doligez 2d03974c12 PR#7452: tweak GCC options to try to work around the Skylake/Kaby lake bug (#1228) 2017-07-12 11:39:26 +02:00
yallop de6ec33c6e Restrict Unix.environment in privileged contexts; add Unix.unsafe_environment (#1217)
* 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.
2017-06-30 11:31:10 +02:00
Damien Doligez fee01100fb Some tweaks for MPR#7557 (#1213)
* 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
2017-06-28 14:08:07 +02:00
Damien Doligez cf100bae04 Some tweaks for MPR#7557 (#1213)
* 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
2017-06-28 14:02:15 +02:00
Damien Doligez 15966dbeaa cherry-pick the fix for MPR#7557 from 4.04 2017-06-23 17:55:46 +02:00
Damien Doligez d4972ea1d3 cherry-pick the fix for MPR#7557 from 4.04 2017-06-23 17:50:53 +02:00
Mark Shinwell 9683393625 Call counts in Spacetime (#1180) 2017-06-16 13:51:12 +01:00
Mark Shinwell 0bf66ce0e1 Suppress trigraph warnings from macOS assembler (#1093)
Also check that trigraphs aren't interpreted
2017-05-16 20:58:23 +01:00
David Allsopp d526e7cce9 Move INT64_LITERAL from byterun/ints.c to m.h 2017-05-16 19:48:37 +01:00
Sébastien Hinderer 40fcbb5f0a Move configuration header files from the config to the byterun/caml directory
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.
2017-04-26 19:28:17 +02:00
Mark Shinwell 3da1c33ffa Unrevert 2017-04-10 12:35:50 +01:00
Mark Shinwell 3efe66e043 Remove SPARC backend 2017-04-10 09:18:13 +01:00
Konstantin Romanov bd8674a041 Support for xlc and bytecode shared libs on AIX.
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.
2017-03-31 13:47:24 -04:00
Sébastien Hinderer dc3038ced6 Adjust C compiler invocation
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.
2017-03-30 16:27:21 +02:00
Sébastien Hinderer eef958007e Build system: rename variables related to manual pages
Rename MANEXT (resp. LIB_MANEXT) to PROGRAMS_MAN_SECTION (resp.
LIBRARIES_MAN_SECTION).

Also get rid of a useless variable assignment in configure.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 5f161087ef Introduce the LIB_MANEXT build variable
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.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer f6386a8e7c configure: export the verbose variable earlier
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.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 3564aade19 Introduce and use the OUTPUTEXE and OUTPUTOBJ build variables 2017-03-29 11:10:06 +02:00
Sébastien Hinderer f2d5d60376 Define new build variables for C compiler and preprocessor flags 2017-03-29 11:10:06 +02:00
Sébastien Hinderer 3262da1839 configure script enhancement
Let the with_sharedlibs variable take boolean values rather than yes
and no. This simplifies tests a bit.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer cc7ad5650a Get rid of BYTECC and NATIVECC
Use the same C compiler, CC, in all the build system.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 1effaeb058 Use only one variable for rpath
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.
2017-03-29 11:10:05 +02:00
Sébastien Hinderer 64c8946828 configure: use cflags and ldflags when calling helper scripts 2017-03-29 11:10:05 +02:00
Sébastien Hinderer 8868a7c023 Rename the BYTECCLINKOPTS build variable to LDFLAGS 2017-03-29 11:10:05 +02:00
Sébastien Hinderer ec6b25b7a0 Get rid of the NATIVECCLINKOPTS build variable.
This variable is empty and actually never used in the build system.
2017-03-29 11:10:05 +02:00
Sébastien Hinderer dcbb7ed26d configure system fixup
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.
2017-03-29 11:10:05 +02:00
David Allsopp 7fefb22da7 Move INT64_LITERAL from byterun/ints.c to m.h 2017-03-28 13:19:21 +00:00
David Allsopp 682da8ebc0 Test objinfo_helper 2017-03-23 22:00:18 +00:00
David Allsopp 28e8cb3b4a Increase the detail given when BFD not found 2017-03-22 10:01:43 +00:00
Sébastien Hinderer 07a6851bdc Remove support for the NeXTStep platform 2017-03-13 13:58:17 +01:00
Mark Shinwell 2ddcd4de9b Enable shared library support on more Linux platforms (was GPR#558) 2017-03-07 11:09:41 +00:00
whitequark 70f84eef2d Build dylibs, not bundles, on macOS. (#988)
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.
2017-02-24 15:41:42 +01:00
Sébastien Hinderer b43fa88e23 Remove unused definitions of the PARTIALLD make variable 2017-02-15 10:45:10 +01:00
Sébastien Hinderer e169dc4bfc Introduce the BYTECODE_C_COMPILER and NATIVE_C_COMPILER make variables
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.)
2017-02-15 10:24:09 +01:00
Sébastien Hinderer 04aa870b9b Define BYTERUN as a real make variable
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.
2017-02-15 10:24:09 +01:00
Xavier Leroy ab4e3beab1 Unix library: better API for "close-on-exec" over file descriptors (#650) 2017-02-13 18:05:19 +01:00
Leo White 709f5c7661 Use -fno-builtin-memcmp with gcc 2017-01-10 10:12:17 +00:00
Prashanth Mundkur eb9cda6491 Fix redundant configure clause for openbsd shared lib options (#945) 2016-12-28 14:55:40 +00:00
Gabriel Scherer d4cd072d4c Merge pull request #935 from ygrek/termux-build
allow build in termux
2016-12-23 16:53:24 -05:00
Sébastien Hinderer 68ad1bb923 Merge Unix and Windows build systems in the asmrun directory (#941)
* 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.
2016-12-20 16:54:20 +01:00
Stephen Dolan a35c6117e6 Instrumentation for american fuzzy lop (afl-fuzz) (#504) 2016-12-06 17:18:04 +01:00
Sébastien Hinderer 757fc5e6da Fix the definition of NATIVECCCOMPOPTS by configure 2016-12-05 16:00:21 +01:00
Bernhard Schommer 6022802ebf Allow -with-frame-pointers for clang under linux. (#887)
GPR#897: allow -with-frame-pointers for clang under linux.
2016-12-04 15:52:49 -05:00
Bernhard Schommer 73b76f80bd Test for ccfamily for preprocessed as. (#919)
GPR#919: Test for ccfamily for preprocessed as.
2016-12-04 10:23:45 -05:00
ygrek 33fa0a0a86 fixup! tweak hashbang test 2016-11-26 19:41:30 -08:00
ygrek f8d443ee47 tweak hashbang test 2016-11-26 16:40:23 -08:00
ygrek 751ba934bb find shell in PATH, do not assume /bin/sh exists 2016-11-26 15:39:59 -08:00
Sébastien Hinderer 54e6aecd77 Improve handling of platforms that do not have gprof profiling support (#933)
This commit modifies these two behaviours:

1. ``make install'' installs libraries with profiling support only when
this makes sense.

2. On platforms that do not support profiling with gprof, the -p option of
ocamlopt produces an error message.
On such platforms, ``make install'' was installing dummy profiling
libraries and ocamlopt's -p option was silently ignored.

In addition, this commit modifies the values of the PROFILING make
variable. Before the commit it was either prof or noprof. After the
commit it is either true or false.

In the asmrun directory, the call to ranlib for libasmrunp.a has also been
removed from the install target because this command is already invoked
in the rule that builds libasmrunp.a.

ocamlc/ocamlopt -config now prints the state of profiling support
2016-11-25 17:24:44 +01:00
Gabriel Scherer 0657fd8193 Revert "Improve handling of platforms that do not have gprof profiling support (#933)"
This reverts commit 8adfe15f18.

This is a temporary revert caused by Continuous Integration
failure. We'll investigate the issue and merge again when it is fixed.
2016-11-25 11:12:56 -05:00
Sébastien Hinderer 8adfe15f18 Improve handling of platforms that do not have gprof profiling support (#933)
This commit modifies these two behaviours:

1. ``make install'' installs libraries with profiling support only when
this makes sense.

2. On platforms that do not support profiling with gprof, the -p option of
ocamlopt produces an error message.
On such platforms, ``make install'' was installing dummy profiling
libraries and ocamlopt's -p option was silently ignored.

In addition, this commit modifies the values of the PROFILING make
variable. Before the commit it was either prof or noprof. After the
commit it is either true or false.

In the asmrun directory, the call to ranlib for libasmrunp.a has also been
removed from the install target because this command is already invoked
in the rule that builds libasmrunp.a.

ocamlc/ocamlopt -config now prints the state of profiling support
2016-11-25 15:57:14 +01:00
Armaël Guéneau 4c52779aad Improve the detection of hashbang support in the configure script
In particular, this adds support for systems where the `cat` binary isn't
located in /usr/bin/ or /bin/, but can be found using /usr/bin/env.
An example of such a system is NixOS (https://nixos.org).
2016-11-18 16:14:32 +01:00
Sébastien Hinderer 13945a71ed Do not use the compatibility macros in the C stub code. (#892)
* Don't use the compatibility macros, neither in the C stub code nor in the testsuite.

* Make sure compiler sources do not use deprecated C identifiers.

This is achieved by ensuring that the CAML_NAME_SPACE macro is defined
everytime a C source file is compiled, rather than being defined only
in a few places. Defining this macro guarantees that the compatibility.h
header (where these deprecated identifiers are defined) will not be
included.
2016-11-17 11:03:09 +01:00
Sébastien Hinderer 3e81da2234 Clarify and slightly modify the use of C compiler related make variables.
Before this commit, there was no distinction between the options
used to compile C source files coming with the OCaml distribution
and third-party C source files compiled by calling ocamlc or ocamlopt.

This commit makes it possible to use options when compiling C source
files that come with OCaml without imposing these options to the compilation
of third-party code.

More specifically, the options in the BYTECCCOMPOPTS and NATIVECCCOMPOPTS
variables are not passed to the C compiler when called by ocamlc and
ocamlopt any longer.

This commit also documents the role of each concerned variable.

In addition:

- On Unix:
  * The -Wall and -Werror options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files

- For the MinGW port:
  * The -O option has been removed from the SHAREDCCCOMPOPTS variable
  * The -Wall and -Wno-unused options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files

- For the msvc port: the
  * The -Ox option has been removed from the SHAREDCCCOMPOPTS variable.
  * The -Wall and -Wno-unused options are no longer passed to the C
    compiler by ocamlc and ocamlopt for third-party C source files
2016-11-16 08:44:47 +01:00
Sébastien Hinderer 4fc73c6333 Remove unused variable from the build system
The DLLCCCOMPOPTS variable is defined in the makefiles but is not
actually used anywhere.
2016-11-10 16:17:39 +01:00
Damien Doligez b4f2b4818f PR#7377: remove -std=gnu99 for newer gcc 2016-10-27 16:36:49 +02:00
Sergey Avseyev fd58d736ce Fix 32-bit build on OpenIndiana (#525) 2016-10-05 16:45:18 +02:00
Fabrice Le Fessant 6b436a43ea Add --reserved-header-bits XX to ./configure
with XX a number smaller than 32 (to leave at least 22 bits for the size)
2016-08-29 22:33:32 +02:00
Markus Pfeiffer a49dfbf23f Add configure detection for DragonFly BSD 2016-08-01 23:13:04 +01:00
Mark Shinwell 234b8ecefc Fixes for 32-bit 2016-08-01 12:59:40 +01:00
Mark Shinwell cd0bd8aa73 Spacetime: a new memory profiler (#585) 2016-07-29 15:07:10 +01:00
alainfrisch 012e1ef878 "./configure -safe-string" to force safe-string mode
When configured with -safe-string, the OCaml tools will default to the
safe-string mode and ignore -unsafe-string command-line arguments.  This
is intended to serve two purposes:

 - Facilitate the detection of packages that are not ready
   for -safe-string ready.  (Perhaps with some OPAM switch?)

 - Enable some optimizations that assume that all linked units are
   compiled with -safe-string.

Note: currently, there is no check that units compiled with an OCaml
configured without -safe-string are not linked in.
2016-07-19 14:28:51 +02:00
Fabrice Le Fessant fe96ec6a77 Merge pull request #668 from lefessan/2016-07-06-cplugins-and-fPIC
Add cplugins and add a configure option `-fPIC`
2016-07-17 10:33:58 +02:00
Fabrice Le Fessant 99b4d7bac9 Add a target `make reconfigure` to restart configure with the same options 2016-07-13 16:02:51 +02:00
Fabrice Le Fessant 6a83bdd593 Add cplugins and option -fPIC to ./configure 2016-07-13 14:00:31 +02:00
Hannes Mehnert d688f23f03 discover nanosleep() availability in configure 2016-06-21 10:33:31 -04:00
Damien Doligez 4e6a825aaf consistency of configure option parsing 2016-06-07 14:40:07 +02:00
Sébastien Hinderer 50147913ac Call the '#' sign hash rather than sharp. 2016-05-09 16:34:40 +02:00
David Allsopp ffec6be51a Remove Cygwin dependency on dos2unix
tr is always installed.
2016-04-26 06:59:17 -04:00
Gabriel Scherer 6aa17e0159 ./configure: set natdynlink=false on -no-native-compiler
In PR#7172, Daniel Bünzli remarks that even if an user does only "make
world install" only, intentionally not installing the native code
compiler, the configuration variables exposed through
$(ocamlc -where)/Makefile.config will be misleading as they indicate
the configuration-time prediction that this installation has a native
compiler and support native dynlink.

The -no-native-compiler switch allows to avoid this issue by
intentionally indicating at configure-time that no native compiler
shall be built. However, its current implementation forgot to also
explicitly disable native dynlinking. Changing this fixes the
Makefile.config information and has no impact on the compiler build
process (a build with ARCH=none will never hit the {all,install}opt of
dynlink/Makefile that inspect NATDYNLINK).

On regression risk: it is easy to check in ./configure that this
change only affects configuration when the -no-native-compiler option
is passed, which did not exist before (late in) 4.03+dev.
2016-04-04 08:44:00 -04:00
Damien Doligez d3d30f3db5 add quotes to avoid breaking RML's configure script 2016-03-03 10:01:27 +09:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Damien Doligez 385ba6d47d tests/lib-dynlink-csharp: fix when shared libs not available; configure: better error message when trying to use shared libs and they are not available 2016-02-03 16:03:06 +01:00
Gabriel Scherer f8f2a6277f remove ocamlbuild from the compiler distribution 2016-02-01 15:05:18 -05:00
David Allsopp 4bf93642af Allow automatic re-running of failed tests
MAX_TESTSUITE_DIR_RETRIES (which defaults to 1 for the native Windows
ports and 0 for all other platforms) causes the `all` and `list` targets
to re-run any given test directory an additional number of times in
order to eliminate random failures during tests.
2016-01-26 14:46:22 +00:00
François Bobot ff0f9b8338 Fix instrumented runtime for glibc < 2.17
- Compile the instrumented runtime, for catching errors in CAML_INSTR
      macros.
   - Compile the debug runtime for compile time errors in Assert.
2016-01-23 11:06:03 +01:00
Pierre Chambart 868b799304 Configure option for flambda 2016-01-14 14:20:23 +01:00
Mark Shinwell d1c05bc963 Merge pull request #383 from tkob/aix-all-source
GPR#383: Define _ALL_SOURCE for AIX 7.1
2016-01-05 13:45:26 +00:00
Gabriel Scherer 3a2848801d configure: add an explicit -no-native-compiler switch 2016-01-01 18:57:41 +01:00
tkob 2ee18856b3 Define _ALL_SOURCE for AIX 7.1
This is needed because some required constants and prototypes are defined
inside `#ifdef _ALL_SOURCE`

Examples are:

- AI_NUMERICHOST constant in netdb.h (used from getaddrinfo.c)
- chroot prototype in unistd.h (used from chroot.c)
2015-12-31 13:54:07 +09:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
Rich Neswold d59bc44b08 NetBSD doesn't have gethostbyname_r or gethostbyaddr_r, yet gets configured as
having them. The config script doesn't fail when there's no prototype to the
functions. It should maybe be compiled as "warnings as errors".

(obtained from PKGSRC patches.)
2015-12-05 10:16:49 -06:00
Rich Neswold 2914b95cbb Add support for NetBSD/arm. 2015-12-05 10:16:48 -06:00
Xavier Leroy 647a8cc438 configure: Typos in messages and comments. 2015-11-27 09:33:28 +01:00