Commit Graph

507 Commits (f7e1a313f57df0c13a50b5e7a16e878593e1a0fc)

Author SHA1 Message Date
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