Commit Graph

646 Commits (master)

Author SHA1 Message Date
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
Xavier Leroy 99067ad1e7 z port: do not use locgr instruction for Boolean-valued comparisons
The locgr instruction is not available in z10, the baseline for this port.
Instead, generate pedestrian code with a conditional branch.
Pass -march=z10 to the assembler to enforce z10 compliance.
2015-10-31 07:34:27 -04:00
Xavier Leroy 58db11e051 IBM zSystem port of OCaml
Import of Bill O'Farrell's port, rebased from 4.02.1 to trunk.
2015-10-29 09:55:19 +01:00
Xavier Leroy 4bd9adbdc7 PR#7030: libasmrun_shared.so fails to build on SPARC Solaris 2015-10-27 18:16:08 +01:00
Xavier Leroy 38d9bf4523 GPR#226, continued: reduce optimization level for GCC < 4.2.
Following reports that -fwrapv has known issues in GCC prior to version 4.2,
use '-O' (and warn) for GCC [3.0, 4.2);
use '-O2 -fwrapv -fno-strict-aliasing' for GCC 4.2 and up.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16540 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 10:31:59 +00:00
Damien Doligez c65e735e8c fix configure error for PARTIALLD on PowerPC
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-13 22:13:59 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Xavier Leroy ee9d50e899 asmrun/Makefile: Remove hard-wired '-O' options
configure: uninitialized variable $nativeccprofopts


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16377 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 14:15:54 +00:00
Xavier Leroy 4ee74721a6 Update wrt trunk (r16374).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16375 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 13:40:40 +00:00
Xavier Leroy bdf3fe80d3 Be prudent, select -O2 optimization instead of -O3.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16338 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 09:34:12 +00:00
Xavier Leroy d9ab3bd2c9 When compiling with gcc or clang, use optimization level -O3 with some optimizations prudently turned off.
Auxiliary changes:
- Put GCC in gnu99 mode (= C99 + GNU extensions).
- Check C99 conformance, warn if not.
- Reject if gcc is too old ( < 3.0 )
- Stop C compilation on warnings if this is a development version of OCaml.
  (I'm tired of C warnings being ignored.)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cc-optim@16329 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 12:12:47 +00:00
Xavier Leroy cf87a2c664 Update wrt trunk r16319.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-03 09:18:04 +00:00
Xavier Leroy d232e7d4ff PPC64 little-endian support.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16298 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-30 09:07:09 +00:00
Xavier Leroy 58c07fa89e PR#6722: compatibility with x32 architecture (x86-64 in ILP32 mode)
configure: deselect ocamlopt, which is not supported
signals_machdep.h: use i386 instruction sequence, not amd64.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16243 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 12:31:42 +00:00
Xavier Leroy 8815d7e1a2 PowerPC port of ocamlopt:
- Removed MacOS X support, long dead.
- Added support for PowerPC 64 bits, big-endian, ELF v1 ABI
  (tested, mostly works, some issues remain with marshaling of code pointers)
- Added support for PowerPC 64 bits, little-endian, ELF v2 ABI
  (completely untested)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-20 15:41:44 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Damien Doligez 871de90367 add libbfd configuration for MacOS
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16211 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-15 14:53:12 +00:00
Gabriel Scherer 70450de8a1 PR#6693: also build libasmrun_shared.so and lib{asm,caml}run_pic.a
(Peter Zotov, review by Mark Shinwell)

NB: after applying this change you need to run ./configure again.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-02 15:30:41 +00:00
Gabriel Scherer f6018b0ef1 PR#6846: build failure with prefixed tools
(Niels Ole Salscheider)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16048 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-26 20:50:20 +00:00
Jérémie Dimino 3a903acafb PR#6285: add support for nanosecond precision in Unix.stat()
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15877 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-05 11:02:53 +00:00
Damien Doligez 35c7dac1ad add the version number to the output of configure
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15874 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-04 19:56:45 +00:00
Damien Doligez 0f5046b8b4 configure: add test for cygwin64
Makefile: fix compilation of checkstack
tests/callback: fix compilation



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15809 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-05 04:28:25 +00:00
Damien Doligez abcd4e8f90 PR#6628: Configure script rejects legitimate arguments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15562 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-29 16:29:18 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Gabriel Scherer 230e723a85 minor configure changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 19:26:10 +00:00
Gabriel Scherer d8c147937e sync configure with the bdf.h objinfo change
(Patch by Christopher Zimmermann)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15465 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 19:26:08 +00:00
Xavier Leroy b868c05ec9 PR#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown
types {,u}int{32,64}.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-27 09:58:33 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Mark Shinwell ec96727497 merge from 4.02 (rev. 14929): add configure detection of mkstemp, remove old HAVE_MKSTEMP conditional, rename HAVE_MKSTEMP -> HAS_MKSTEMP
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14930 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-30 12:49:24 +00:00
Mark Shinwell 286af5b06a merge github.com/ocaml/ocaml/pull/56.diff, from Anil, part 1: fix support for PowerPC/BSD backtraces
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14854 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-13 13:14:12 +00:00
Mark Shinwell 881ec04f39 no-naked-pointers patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14791 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 07:29:24 +00:00
Gabriel Scherer d84f8be74c configure: fix as/aspp for FreeBSD (works for both gcc and clang)
(Patch by Andrew Ray)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14727 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 16:35:48 +00:00
Xavier Leroy dd17af8b43 Simpler variant of commit r14635:
- configure: no change necessary
- byterun/config.h: make sure ARCH_INT64_TYPE and related macros
  are always defined, for Coq and others to use.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14636 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 10:00:42 +00:00
Xavier Leroy 86bd9990f4 configure: always define ARCH_INT64_TYPE in config/m.h because Coq
and maybe others rely on it
byterun/config.h: select "long long" in preference to "long" for "int64",
  just because this is how it was done in earlier versions.
  (Minimizing suprises.)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14635 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 09:54:34 +00:00
Xavier Leroy 774e30e138 PR#6075: avoid using unsafe C library functions (strcpy, strcat, sprintf).
An ISO C99-compliant C compiler and standard library is now assumed.
(Plus special exceptions for MSVC.)  In particular, emulation code for
64-bit integer arithmetic was removed, the C compiler must support a
64-bit integer type.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14607 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 17:09:13 +00:00
Jacques Garrigue cfb1250590 Fix PR#6347
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14527 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 03:04:45 +00:00
Damien Doligez c81cc506ec configure: SO must be "so" or "dll" without the dot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14369 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-17 09:58:47 +00:00
Damien Doligez aa58e55958 port to cygwin-64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14337 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-03 14:43:02 +00:00
Xavier Leroy 33f242aaea Reverting the elimination of the ocamlcomp*.sh scripts, namely the following commits:
14278
14277
14276
14176
14175
14173
14172
14171
14169
14168
14167
These changes need to mature on their own branch.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14329 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-29 13:04:38 +00:00
Jérémie Dimino 5d917633ad remove camlp4
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/minus-camlp4@14309 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-21 16:23:28 +00:00
Wojciech Meyer aa7e283b1b build: don't use make's -C; it's not available everywhere.
(Patch by Adrien Nader!)

-C doesn't work on at least openbsd's make so don't use it.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14173 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 12:02:49 +00:00
Wojciech Meyer 241585bc83 build: replace ocamlcomp*.sh.
This script was built from ocamlcomp.sh.in through sed and is called
instead of "ocamlc" (for instance).
It makes it possible to switch from "ocamlc" to "ocamlc.opt" without
changing anything in the Makefiles, only calling sed.

I couldn't cleanly make it handle both a compiler for the target and for
the build. Instead I'm replacing it and doing as much as possible
directly in the Makefiles.
I hoped it would reduce the number of shell invocations, which would
speed things up quite a lot on Windows but I still had to have at least
one since it's not possible to update a make variable from inside a make
rule: i.e. it's not possible to do X=a, build a.opt and update X to be
a.opt.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:22:38 +00:00
Xavier Clerc e82104a755 Remove labltk from the distribution (will be available as a third-party library).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14077 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-09 09:32:00 +00:00
Damien Doligez 7844495624 Merge branch 4.01 from branching point to 4.01.0+rc1
Command line used:
  svn merge --accept postpone -r 13776:14055 $REPO/version/4.01 .


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14060 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-04 15:12:37 +00:00
Wojciech Meyer 79bc2c2efa configure: enable natdynlink for *-*-mingw*.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13944 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-28 15:52:18 +00:00
Wojciech Meyer dda5f84f7c build: allow disabling ocamldoc and ocamlbuild.
(Patch by Adrien Nader!)

This doesn't touch the build system in build/ since it's obsolete and
unmaintained as far as I know (I'll try to remove it in a further
commit).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13943 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-28 15:52:17 +00:00
Wojciech Meyer 6549fe7019 build: prepend "with_" to camlp4/ocamldebug-{en,dis}abling variables.
(Patch by Adrien Nader!)

This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.

This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.

It also adds a configure switch to skip building ocamldebug.

While at it, it fixes a PR number in the Changes file.
build: prepend "with_" to camlp4/ocamldebug-{en,dis}abling variables.

This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.

This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.

It also adds a configure switch to skip building ocamldebug.

While at it, it fixes a PR number in the Changes file.
build: prepend "with_" to camlp4/ocamldebug-{en,dis}abling variables.

This makes the variable names more coherent and is in preparation for
another patch that will allow disabling ocamldoc and ocamlbuild.

This changes the interface of the configuration somewhat but I don't
think anything outside of the ocaml tree reads the Makefile.config file
that gets installed in order to see whether the debugger and camlp4 have
been built. It also changes a .mli which might be problematic but I also
believe it is safe and we have time to see if there's a bad impact.

It also adds a configure switch to skip building ocamldebug.

While at it, it fixes a PR number in the Changes file.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13942 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-28 15:52:14 +00:00
Xavier Leroy 055d5c0379 Port to the ARM 64-bits (AArch64) architecture (experimental).
Merge of branch branches/arm64.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13909 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-18 16:09:20 +00:00
Wojciech Meyer 0425a7246b Revert "build: make building ocamldoc, ocamlbuild and ocamldebug optional."
This patch fixes build failure.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13867 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-01 21:33:22 +00:00
Wojciech Meyer 21b780c0a5 configure: store $target and $host in the build configuration (fix-pt2). (Patch by Adrien Nader!)
Fixing builds continued.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13866 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-01 21:33:21 +00:00
Wojciech Meyer 70659109f2 build: make building ocamldoc, ocamlbuild and ocamldebug optional.
(modified patch from Adrien Nader!)

Add also new comments for the new INSTALL flags.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13864 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-01 19:28:18 +00:00
Wojciech Meyer 086c04495e Revert "configure: store $target and $host in the build configuration." as it breaks several builds.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13858 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 22:01:53 +00:00
Wojciech Meyer e5eeea88af configure: store $target and $host in the build configuration.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13857 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 12:58:35 +00:00
Wojciech Meyer fdf9cde11d build: select win32 variants of unix and graph for mingw.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13856 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 12:58:34 +00:00
Wojciech Meyer edec3c55f6 configure: add a special case to test for BSD sockets for mingw.
(Patch by Adrien Nader!)

I tried to use "hasgot" to test it but proved too difficult since you
must #include <winsock2.h> to make link succeed (windows magic) which
then makes gcc complain about the prototype being wrong.

Since windows already needs a special case in order to add -lws2_32 and
since we know for sure it will be available, skip the hasgot test and
check $target directly.
configure: add a special case to test for BSD sockets for mingw.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13855 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 12:42:24 +00:00
Wojciech Meyer 1e064ceb55 configure: when cross-compiling, set $TOOLPREF and use it.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13854 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 12:42:23 +00:00
Wojciech Meyer feac346c2f configure: add --target and use "target" instead of "host" for variables
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13853 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 11:41:40 +00:00
Wojciech Meyer 9111707486 configure: for cross, a matching ocamlrun must be on the system.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13852 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 11:41:39 +00:00
Wojciech Meyer 7dc8ea2b8f misc: fix indent staircase introduced by revision 13843.
(patch by Adrien Nader!)

While at it also re-add two spaces that were eaten.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13851 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-30 11:03:01 +00:00
Wojciech Meyer d6d2c4b3ea configure: fix detection of non-working C compiler.
(patch by Adrien Nader!)

The test tried to do something like:
  case "$foo,$bar" in
    *,*) echo 1 ;;
    *) echo "compiler not working" ;;
   esac
However the second case cannot match because of the first one.

Instead, check the return code of the command.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13844 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-27 21:09:25 +00:00
Wojciech Meyer 1b39eae0ae configure: remove unused variables from case...in test.
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13843 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-27 19:46:02 +00:00
Wojciech Meyer 41be48ee15 configure: fail if invoked with -param=value (instead of "-param value")
(Patch by Adrien Nader!)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13842 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-27 19:28:27 +00:00
Wojciech Meyer f85aaad77d configure: use inf/wrn/err functions to write messages for the user.
(Patch by Adrien Nader!)

This makes messages to the user more consistent.

Behaviours:
  inf(): writes its arguments to stderr
  wrn(): writes "[WARNING]" to stderr and then its arguments to stderr
  err(): writes "[ERROR!]" to stderr, then its arguments to stderr, and
         calls "exit 2"

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13841 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-27 19:10:08 +00:00
Xavier Leroy bfc08c41ac PR#6049: support for OpenBSD/macppc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13835 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-24 08:17:30 +00:00
Fabrice Le Fessant f4d6eafbd3 Fix PR#6044: enabling frame pointers breaks build on MacOS X
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13826 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-20 16:26:19 +00:00
Fabrice Le Fessant e99f2dde29 Add -fno-omit-frame-pointers to gcc when compiling with -with-frame-pointers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-11 11:58:44 +00:00
Fabrice Le Fessant 9b53f8b10d Re-add configure option -with-frame-pointers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 18:03:59 +00:00
Fabrice Le Fessant 97bc1fa9e2 Reverting -with-frame-pointers
Fails to compile alt-ergo without frame-pointers. No time to debug
before tonight, so I revert and will merge again after fixing the
problem.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13732 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 06:29:33 +00:00
Fabrice Le Fessant 1b2667b9f2 Add -with-frame-pointers to ./configure
This option can be used to tell the native compiler that it should
update frame pointers, so that debuggers and profiling tools 
(especially Linux perf) can use them. For now, it is only supported
by the Unix/amd64 port.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13730 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 04:42:42 +00:00
Damien Doligez 362082e1a8 fix testsuite for cygwin
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13652 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-06 18:01:34 +00:00
Damien Doligez b2636c22d5 PR#5921 "compact unwind" warnings under MacOS
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 17:57:53 +00:00
Damien Doligez c63f9e0957 fix a few problems with whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-09 22:38:52 +00:00
Pierre Weis a81a5b038c Labtk now supports 8.6.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13327 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-02-27 19:31:47 +00:00
Benedikt Meurer dd65af958b Use clang as assembler on Mac OS X if available.
Mac OS X ships with a really old version of as, which does not support
the CFI directives. LLVM itself provides an assembler that is certainly
way more up to date, but currently there's no dedicated frontend, so we
simply use clang in this case.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-13 14:22:14 +00:00
Benedikt Meurer dc0776f551 #5798: Apply patch to add VFPv2 and ARMv6 hard-float support (Jeffrey Scofield, Anil Madhavapeddy).
[PATCH] Detect and support armv6/VFPE2, which is sufficient to get
ocamlopt working on the Raspberry Pi hardfloat Debian variant

Original patch: Jeffrey Scofield via http://psellos.com/pub/ocamlxarm/ocaml4-vfpv2.diff
Fixes from: Anil Madhavapeddy <anil@recoil.org>



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-24 06:20:45 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 0c3a7de507 merge changes from 4.00 branching to 4.00.0 (part 1)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-26 19:21:54 +00:00
Damien Doligez 6973c3b9da PR#5255: natdynlink detection on powerpc, hurd, sparc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12647 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-26 16:01:05 +00:00
Damien Doligez 9cd6b389a3 better formatting of message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12632 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-21 16:22:16 +00:00
Xavier Leroy 28c206ad37 PR#5643: issues with .cfi and .loc directives generated by ocamlopt -g
(Picking commit 12610 from version/4.00)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12611 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-17 08:17:43 +00:00
Xavier Leroy 72ae789dc6 PR#5543: in Bigarray.map_file, try to avoid using lseek() when growing file
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12317 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-04 12:12:02 +00:00
Damien Doligez 7c8fcb37f7 PR#5552 unrecognized gcc option "-no-cpp-precomp"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12283 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-27 14:32:28 +00:00
Alain Frisch 46a196c01d Use flexdll's -stack option, also for Cygwin.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12264 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-23 15:22:13 +00:00
Damien Doligez 6c24f4f90b merge version 3.12 from 3.12.1 to r12205
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-08 19:52:03 +00:00
Xavier Leroy 2eecf2d4c0 PR#5487: addition of CFI directives and a few filename/linenumber info to generated amd64 and i386 assembly files.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12179 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-21 17:41:02 +00:00
Xavier Leroy 5ad47ce4e6 Backtrack previous changes for PowerPC/Linux, which turns out to lack what we need for turning stack overflows into exceptions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-17 10:43:50 +00:00
Xavier Leroy 339bcbb2c6 PR#5064, PR#5485: try to ensure that 4K words of stack are available
before calling into C functions, raising a Stack_overflow exception
otherwise.  This reduces (but does not eliminate) the risk of
segmentation faults due to stack overflow in C code.
Implemented for i386, amd64 and power, under Linux and MacOSX.
Plus: remove some more stuff related to obsoleted platforms (IA64, SunOS 4).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-17 10:12:09 +00:00
Damien Doligez d7cbf2a01a PR5477: (continued) fix Tcl/Tk configuration to use $x11_link instead of $x11_libs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12148 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-10 15:29:36 +00:00
Damien Doligez b392c77aa6 PR#5385: add a warning when MACOSX_DEPLOYMENT_TARGET is set
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12143 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-09 18:41:53 +00:00
Damien Doligez e61911c5c9 PR#4278: configure without graph; fix problem when X11 not found
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12132 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-07 12:43:34 +00:00
Benedikt Meurer 05627e0de4 Merge the new ARM backend into trunk (PR#5433).
Initial merge of the new ARM backend (commit ec5b444c7f) from my development
repository at https://github.com/bmeurer/ocaml-arm/tree/ec5b444c7f .

Compared to the old ARM backend, this one does the following:
- Support for both software and hardware floating-point (VFPv3).
- Properly supports interworking with Thumb/Thumb-2 code for both OCaml and C
  code.
- Supports dynamic linking and large memory models (PR#5049).
- Optional support for position-independent code via a command line option
  -fPIC. This is disabled by default and not required for natdynlink.
- Can emit both ARM and Thumb-2 code, with avg. code size savings of 28% for
  Thumb-2 (quite close the optimal 30% advertised by ARM Ltd.).
- Supports both AAPCS (armel) as well as extended VFP calling conventions
  (armhf).
- Supports several special ARM instructions to reduce code size and latency.
- Uses standard ARM EABI runtime functions instead of relying on GCC internals.
- Supports exception backtraces.
- Supports profiling using gprof.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12124 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-04 10:15:24 +00:00
Damien Doligez fd944666c2 PR#5477 use pkg-config to configure graphics on linux
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12110 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-02-01 21:30:35 +00:00
Damien Doligez 1f493d056e PR#1496: allow configuring LIBDIR, BINDIR, and MANDIR relative to $(PREFIX)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12080 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-26 13:02:51 +00:00
Damien Doligez 38b827b7e4 fix configure on MacOSX after upgrade of config.sub and config.guess
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12074 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-23 15:44:01 +00:00
Damien Doligez e8e3d14e01 fix configure on MacOSX/64-bit; add an option to configure or build without camlp4
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12073 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-23 15:18:22 +00:00
Alain Frisch bfb35c4fce #5478: makes it possible to specify a custom 'ar' command.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12027 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-16 09:05:37 +00:00
Damien Doligez 0c7984afc6 PR#5453: configure doesn't find X11 under Ubuntu/MultiarchSpec
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11978 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-29 20:42:11 +00:00
Jonathan Protzenko 253e88bc67 Fix #5393: make sure -R is only passed to the linker with a BSD that has a BSD userland
Patch by: Stéphane Glondu <stephane@glondu.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11925 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-21 15:56:10 +00:00
Damien Doligez a85549ccf6 cygwin is changing from Windows-based to X-based tcl/tk
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11921 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-21 15:30:54 +00:00
Xavier Leroy 366da2c721 Removed the obsolete native-code generators for Alpha, HPPA, IA64 and MIPS,
part 2: configure.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11883 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-17 11:21:24 +00:00
Xavier Leroy 9178181eae The "DBM" library (interface with Unix DBM key-value stores) is no
longer part of this distribution.  It now lives its own life at
https://forge.ocamlcore.org/projects/camldbm/.  Bye bye, DBM.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11881 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-17 10:45:23 +00:00