Commit Graph

9340 Commits (ecde85d3992c94e84d228a292c72f56e6700c656)

Author SHA1 Message Date
Jacques Garrigue ecde85d399 experiment on module aliases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 20:05:12 +00:00
Alain Frisch 6873f39817 Keep attributes on value declarations in .cmi files (but clear all the location fields, except if -keep-locs is used, of course). Use this to report a warning when a value marked as [@@deprecated] is referenced (#5854)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14188 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 15:24:11 +00:00
Alain Frisch f55565753e Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14187 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 09:06:45 +00:00
Alain Frisch e1b2a8b193 Get rid of recursion closing functions, being more explicit on the recursion does not hurt.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14186 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:49:46 +00:00
Alain Frisch 13dd4d972d Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14185 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:36:31 +00:00
Alain Frisch 9e09513778 Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14184 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:34:06 +00:00
Alain Frisch d4230ffaa8 Adapt one more example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14183 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:27:00 +00:00
Alain Frisch 7994b4db28 Functions to close the open recursion in Ast_mapper.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14182 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:24:38 +00:00
Alain Frisch a2735f80c5 Adapt js example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14181 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:11:46 +00:00
Alain Frisch 91b2f18ef8 Cleanup ppx API.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14180 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:03:49 +00:00
Alain Frisch 48edce920b Switch to a record-based API for Ast_mapper, so that it can be used within the compiler itself (where objects are banned). The class-based version will be shipped as part of the ppx_tools package. Only the ifdef example has been adapted in experimental/frisch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14178 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-25 15:14:38 +00:00
Alain Frisch eddb6e86d9 Typo (#6190).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14177 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-25 07:16:21 +00:00
Wojciech Meyer 86f0519755 build: typo on config/Makefile.mingw64, msvc and msvc64.
(Patch by Adrien Nader!)

While trying to come up with the previous commit, I noticed that the
various Windows config files had diverged: all but config/Makefile.mingw
were lacking a '%' in a pattern and this prevents the pattern from matching
anything.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 22:33:23 +00:00
Wojciech Meyer 6e4c597bb1 build: ocamlmklib on Windows expect a Windows-style path, not a UNIX one.
(Patch by Adrien Nader!)

Rev 14168 (build: replace ocamlcomp*.sh.) broke "make world" (but
surprisingly, not "world.opt") because the argument to ocamlmklib's -ocamlc
has to be a Windows path, i.e. C:\...\ocamlc. Instead it gave a UNIX one,
i.e. /home/foo/ocaml/ocamlc.

Call cygpath in otherlibs/Makefile.nt to fix that.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14175 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 22:33:05 +00:00
Gabriel Scherer 5e9a3c5f9d bootstrap ocamlbuild again (needed for the cross-compilation patches)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14174 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-22 10:52:33 +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 0cc184754c build: fix "make clean" failure when ./configure hasn't been run again.
(Patch by Adrien Nader!)

The "make clean" rules were relying on the $(ROOTDIR) variable.
However this variable is only defined when ./configure runs. This broke the
usual "make clean ; ./configure && make world.opt":
  < use old trunk >
  ./configure            # config/Makefile doesn't define ROOTDIR
  make world.opt
  < move to new trunk >
  make clean             # Fails early and doesn't clean all files
  ./configure            # config/Makefile now defines ROOTDIR
  make world.opt         # This fails because of left-over files

An easy solution was to run "make clean" again after configure but this is
not how everyone does and in particular, this is not how the jenkins build
bot seem to do.

The recipes for "make clean" should never rely on values defined by
configure for this exact reason.
As a simple solution, only run the commands that rely on $(ROOTDIR) if
$(ROOTDIR) is set.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14172 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 12:02:48 +00:00
Wojciech Meyer 49a8d15728 build: skip $(IFLEXDIR) in mk_shell_and_ocamlbuild_config.sh.
(Patch by Adrien Nader!)

On Windows, IFLEXDIR is defined as -I"$(FLEXDIR)". The new
mk_shell_and_ocamlbuild_config script outputs:
  echo IFLEXDIR="\"$(IFLEXDIR)\""

However, becauses $(IFLEXDIR) contains quotation marks, this becomes:
  echo IFLEXDIR="\"-I"$(FLEXDIR)"\""

This unquotes $(FLEXDIR) and breaks the program.

Simply exclude IFLEXDIR from the variables that are handled by the
script. This is actually what the previous scripts were doing: the
exclude list was .*FLEXDIR and matched both IFLEXDIR and FLEXDIR while
the one I made only had \<FLEXDIR\> in it.

I've tried to handle it but there are at least three competing languages
and quoting rules: makefile (both gnu make and several bsd makes), shell
script and ocaml.
There's no human way to do string processing given the portability
constraints: both gnu make and pmake (and its descendants) have powerful
string processing functions but they're not the same.
The only sane way would be to store the configuration in a more evolved
language that is portable, has arrays and powerful string handling
routines in standard like C or awk. From there it would be possible to
output make, shell script and OCaml code easily.

One day. Maybe.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-21 10:24:34 +00:00
Alain Frisch b414d57b0e Simplify type_structure.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 16:19:54 +00:00
Wojciech Meyer 0f04aeefa1 build: remove warning 32 (unused variable) in tools.
(Patch by Adrien Nader!)

Among other files, myocamlbuild_config.ml is built in this directory.
This file defines many variables, most of which are not used and
therefore trigger this warning which is then turned into an error
through -warn-error A.
build: remove warning 32 (unused variable) in tools.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14169 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 00:22:40 +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
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