Commit Graph

9370 Commits (0f6f367ad4c2210bdf393ac60dbc0b6f7b8c796d)

Author SHA1 Message Date
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
Wojciech Meyer 8104198af7 build: replace build/mk{config,myocamlbuild_config}.sh.
(Patch by Adrien Nader!)

These scripts sed config/Makefile in order to create shell script and
ocaml code that define the same values as the Makefile but in the
corresponding language.
The sed stuff is very difficult to understand, very brittle and
impossible to change.
Remove that altogether and use a Makefile to run commands like
[ echo FOO=$(FOO) ]. There is still some sed involved (to get the list
of variables in the config and to put rewrite the lists into a list of
commands) but much less and all the expressions are put into variables
with meaningful names with lots of comments.

For config.sh, mkconfig.sh generated lines like :
  if [ -z "${FOO}" ]; then FOO=bar; fi
The new script sets the value without checking anything.
I haven't found a reason to do things differently: if there is anything
to override, the right place to do it is after sourcing the shell
script. In any case, I haven't seen any such use.

The mkconfig.sh file also set "WINDOWS=true/false" but the only use is
in the parallel build-system which is implemented in build/ and uses
ocamlbuild as much as possible, and it's going away so it's useless to
set it too.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14167 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:13:23 +00:00
Jacques Garrigue 010728722f PR#6173: Improve error messages for type-based disambiguation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-19 07:25:51 +00:00
Wojciech Meyer e8acf5f821 build: allow $(UNIXDIR) to be "win32unix".
(Patch by Adrien Nader!)

Several commits ago, I made a change that replaced includes for
"otherlibs/unix" with "otherlibs/$(UNIXLIB)", making it possible to
include "win32unix".
Apparently I forgot to do it for debugger/Makefile or skipped it on
purpose since it only matters for cross-compilation and cross-compiling
the debugger is not supported (yet).
Change it now rather than forget it later.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14164 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 20:56:34 +00:00
Wojciech Meyer 908c6e8dfb config/Makefile.{mingw,msvc}{,64}: remove unused DO variable.
(Patch by Adrien Nader!)

This variable is currently unused and it breaks my new script which
replaces mkmyocamlbuild.sh.
The issue is that the "DO" variables becomes "do" in
myocamlbuild_config.ml (lowercased) and "do" is an OCaml keyword.
Since the variable is not used, simply remove it.

Also remove the DBGO variable which only exists in Makefile.msvc64.
Checking for occurrences of this variable elsewhere, I only found
byterun/Makefile.nt which defines it as DBGO=d.$(O) rather than
dbg.$(O).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14163 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 20:56:32 +00:00
Wojciech Meyer 0ebaece612 build: ocamldoc.opt was not built anymore on Windows.
(Patch by Adrien Nader!)

An earlier change I had made conditionalized building ocamldoc.
I mixed up my variable names and set "WITH_OCAMLDOC_OPT" instead of
"OCAMLDOC_OPT". Later on, $(OCAMLDOC_OPT) would evaluate to the
empty-string, failing to add "ocamldoc.opt" to the prerequesites of the
"opt.opt" and "world.opt" rules.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14162 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 20:56:31 +00:00
Alain Frisch 3574cf070c Accept changes (spurious warnings are gone).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14161 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 10:57:29 +00:00
Alain Frisch 76bc019fd3 Wrongly committed bootstrapped compilers with spurious debug output.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 08:48:25 +00:00
Alain Frisch 435535af29 A tiny tool which use the new -keep-locs to find unused exported values in a project.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 14:29:02 +00:00
Alain Frisch c8d20ade02 Do not track unused type declarations created by 'include'.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14158 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 14:28:31 +00:00
Alain Frisch 40117f7480 #5817: new compiler flag (-keep-locs) to keep location in cmi files.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14157 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 12:45:05 +00:00
Alain Frisch 2373f76c36 #6180: efficient creation of uninitialized float arrays.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 11:54:31 +00:00
Alain Frisch 9a4a944363 #6182: better error message for virtual objects and class types.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14155 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 11:28:33 +00:00
Alain Frisch 2691cf5042 Integrate exception_registration banch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14152 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 09:30:41 +00:00
Gabriel Scherer d9a035fa65 ocamlbuild: report location in Tags.acknowledge warnings
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14151 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:58 +00:00
Gabriel Scherer 4c57668e9a ocamlbuild: use Loc.print_loc for lexing errors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14150 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:56 +00:00
Gabriel Scherer dbffb7919a use 'mark_tag_used' to solve all "unused tag" warnings in the distribution
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14149 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:54 +00:00
Gabriel Scherer e69107143d ocamlbuild: rename 'mark_as_used' into 'mark_flag_used' and expose in PLUGIN
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14148 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:52 +00:00
Gabriel Scherer bb514ec5ca ocamlbuild: track location information of tags
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14147 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:50 +00:00
Gabriel Scherer d70b93a252 ocamlbuild: a short location printing implementation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14146 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:47 +00:00
Gabriel Scherer 75beffa385 ocamlbuild: mark ocaml_lib's tag as used
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14145 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:45 +00:00
Gabriel Scherer b9a17966ce ocamlbuild: detect tags in _tags not used by any flag declaration (typos?)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:43 +00:00
Gabriel Scherer 98227477ec minor typos in ocamlbuild/signatures.mli
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14143 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:41 +00:00
Gabriel Scherer 7629d96d21 ocamlbuild: deprecate warn_%c, warn_error_%c (replaced by parametrized tags) and strict-sequence (strict_sequence)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14142 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:39 +00:00
Gabriel Scherer 0f968f11b2 ocamlbuild: allow flag declarations to be marked as deprecated
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14141 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:37 +00:00
Gabriel Scherer 53d1c7c63d ocamlbuild: turn the flags.ml structure into a record to ease adding metadata
I plan to add at least documentation and deprecation information to
each flagset, so structuring it as a record is important.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14140 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:35 +00:00
Gabriel Scherer 9d89a6b2a5 ocamlbuild: move show_documentation's implementation in the respective modules to improve encapsulation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14139 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:33 +00:00
Gabriel Scherer 955877a316 ocamlbuild: add a warn_error(X) parametrized tag to fully deprecate warn_%c, warn_error_%c
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14138 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:31 +00:00
Gabriel Scherer 23803c2515 ocamlbuild testsuite: test -no-plugin and -just-plugin
The second test currently fails, because the plugin is not build if no
target is passed. This will be fixed shortly.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:29 +00:00
Gabriel Scherer c01593d18e ocamlbuild testsuite: minor style change
I just got bitten by a weird issue where the test I expected to run
was ignored, and never appeared in test runs. I just forgot the final
`()` parameter to the `test` function, and `foo;;` was perfectly happy
to accept an input of non-unit type. Now using explicits `let () =` to
avoid that issue in the future.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14136 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:27 +00:00
Gabriel Scherer dad0226a8f ocamlbuild testsuite: fix typo
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14135 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:25 +00:00
Gabriel Scherer 2c71c6fad4 ocamlbuild testsuite: implement negation in Match
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14134 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:24 +00:00
Gabriel Scherer 9636eeec44 ocamlbuild testsuite: preliminary step for an implementation of negation in Match
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14133 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:22 +00:00
Gabriel Scherer 525dae500e ocamlbuild testsuite: clean Match implementation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14132 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:20 +00:00
Gabriel Scherer 0e4b8c1691 ocamlbuild testsuite: add -no-ocamlfind to some tests
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:18 +00:00
Gabriel Scherer da9d0495c8 ocamlbuild testsuite: test modular plugin compilation
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14130 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:16 +00:00
Gabriel Scherer 38e0fba827 ocamlbuild testsuite: fix the PrincipalFlag test
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14129 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:14 +00:00
Gabriel Scherer 34186b97d2 ocamlbuild testsuite: split level0.ml into internal.ml, findlibonly.ml, external.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14128 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:12 +00:00
Gabriel Scherer 89fe1e121e ocamlbuild testsuite: factorize the color-code magic
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14127 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:10 +00:00
Gabriel Scherer 0c83a6f7fa ocamlbuild testsuite: add a "requirements" field to skip tests we cannot run
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14126 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:08 +00:00
Gabriel Scherer dfc06e175c ocamlbuild: document most of the ocaml_specific rules
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:06 +00:00
Gabriel Scherer c19689fc93 ocamlbuild: add a free-form documentation field to rules
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14124 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-15 11:36:02 +00:00
Gabriel Scherer 8ba031a7db Format: pp_print_list and pp_print_text, contributed by Daniel Bünzli
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14123 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-13 15:55:41 +00:00
Alain Frisch b92a3ca792 Continue.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14122 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 15:50:47 +00:00
Damien Doligez fadcc73c50 Merge branch 4.01 from 4.01.0+rc1 to 4.01.0
Command line used:
  svn merge --accept postpone -r 14055:14115 $REPO/version/4.01 .


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14121 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 15:21:52 +00:00
Alain Frisch 884ca00fdf Continue cleanup. driver/errors.ml is no longer needed.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:45:03 +00:00
Alain Frisch 8660e346df Continue.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14119 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:34:13 +00:00
Alain Frisch bc9e5b0a51 Switch {Translmod,Translcore,Translclass}.Error.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14118 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:24:27 +00:00
Alain Frisch 2e16ccd61f Switch Includemod.Error, without trying to split the message (to keep current behavior).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14117 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:21:04 +00:00
Hongbo Zhang 3501cb4d96 fix location bug PR#6170
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14116 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:18:01 +00:00