When a tool cannot be loaded the wrong path was displayed on the error
message. sys.path was always displayed but the actual path used depends
on tooldir being passed and on the value of with_sys_path parameter.
I put the exception handling (raising the fatal) inside load_tool itself
as this is the only place where the exact path is known, without having
to recalculate it outside. To be able to use fatal there also the ctx
has to be passed from the various points.
In this way all load_tool exceptions are caught and reported, while before
an exception during configure was not caught for example, just during the
options.
* use DEST_OS in cfg_cross_gnu
* add an example
* rename cfg_cross_gnu to cross_gnu
* add configure()
* xcheck_envar -> xcheck_var
* xcheck_var to look in environ only if not already set
* protoc: added java support
Modified protoc to support also .proto -> .java generation. the .java file
name generated is not obvious as in C++/Python but follows a couple of rules
that were implemented.
As cxx/python and javaw Tools are quite different the implementation is not
as clean as for cxx/python but is hopefully fine (ie. protoc still uses
sources for input files while javac uses src_dir).
In javaw a small detail was added: a new attribute was added (gencode) that
instructs javac to look for source files also in the build directory. This
are realistically generated code (and .proto -> .java is an example) and
are therefore in the build. Default is false keeping all the previous
behaviour.
* protoc for java enhanchments (protoc version, regex, docs)
In configure stage get protoc version as java naming changes depending on the
version. Implement the version differences between version < 2 and > 2
Improve regex for option catching and implement a mix of them in playground
to verify it.
Add some documentation on how java filenames and paths are generated.
* protoc: build dir with generated code is automatically added, so no need to explicitly use gencode in javac