|
29
|
1 |
|
|
|
2 |
import sys |
|
|
3 |
from jcc import cpp |
|
|
4 |
|
|
|
5 |
if len(sys.argv) == 1 or '--help' in sys.argv: |
|
|
6 |
help = ''' |
|
|
7 |
JCC - C++/Python Java Native Interface Code Generator |
|
|
8 |
|
|
|
9 |
Usage: python -m jcc.__main__ [options] [actions] |
|
|
10 |
|
|
|
11 |
Input options: |
|
|
12 |
--jar JARFILE - make JCC wrap all public classes found in |
|
|
13 |
JARFILE, add it to the module's CLASSPATH and |
|
|
14 |
include it in the distribution |
|
|
15 |
--include JARFILE - include JARFILE in the distribution and add |
|
|
16 |
it to the module's CLASSPATH |
|
|
17 |
--exclude CLASS - explicitly don't wrap CLASS |
|
|
18 |
--package PACKAGE - add PACKAGE to the list of packages from |
|
|
19 |
which dependencies are automatically wrapped |
|
|
20 |
--classpath [PATH|JAR] - add [PATH|JAR] to CLASSPATH while generating |
|
|
21 |
wrappers |
|
|
22 |
--libpath [PATH] - add [PATH] to java.library.path while generating |
|
|
23 |
wrappers |
|
|
24 |
--module MODULE - include Python MODULE in the distribution |
|
|
25 |
--reserved SYMBOL - mark SYMBOL as a reserved word that will be |
|
|
26 |
mangled in the generated C++ code to avoid |
|
|
27 |
clashes with C/C++ reserved words or header |
|
|
28 |
file definitions |
|
|
29 |
--vmarg - add extra Java VM initialization parameter |
|
|
30 |
|
|
|
31 |
Python wrapper generation options: |
|
|
32 |
--python NAME - generate wrappers for use from Python in a module |
|
|
33 |
called NAME |
|
|
34 |
--version VERSION - the generated module's version number |
|
|
35 |
--shared - generate a module that links against a shared |
|
|
36 |
library version of the JCC runtime so that |
|
|
37 |
multiple JCC-wrapped modules can be used within |
|
|
38 |
the same Python runtime |
|
|
39 |
--sequence CLASS METHODSIGNATURE |
|
|
40 |
- generate a pythonic sequence protocol wrapper for |
|
|
41 |
CLASS |
|
|
42 |
--mapping CLASS METHODSIGNATURE1 METHODSIGNATURE2 |
|
|
43 |
- generate a pythonic map protocol wrapper for CLASS |
|
|
44 |
--rename CLASS1=NAME1,CLASS2=NAME2,... |
|
|
45 |
- rename one or more Python wrapper classes to |
|
|
46 |
avoid name clashes due to the flattening of |
|
|
47 |
the Java package namespaces as mapped into |
|
|
48 |
Python |
|
|
49 |
--no-generics - disable support for Java generics |
|
|
50 |
|
|
|
51 |
If you're planning to use pythonic wrappers you should read the relevant |
|
|
52 |
documentation first: |
|
|
53 |
http://lucene.apache.org/pylucene/jcc/documentation/readme.html#python |
|
|
54 |
|
|
|
55 |
Output options: |
|
|
56 |
--debug - generate a module using the C++ compiler's |
|
|
57 |
debug options |
|
|
58 |
--output OUTPUTDIR - the wrapper will be generated in OUTPUTDIR, |
|
|
59 |
'build' by default |
|
|
60 |
--files N - split the generated wrapper file into at least |
|
|
61 |
N files to workaround C++ compiler file size |
|
|
62 |
limitations |
|
|
63 |
--arch - Mac OS X only: filter the -arch parameters |
|
|
64 |
Python was configured with to build leaner |
|
|
65 |
binaries, faster |
|
|
66 |
|
|
|
67 |
Actions: |
|
|
68 |
--build - generate the wrapper and compile it |
|
|
69 |
--compile - recompile the (previously generated) module |
|
|
70 |
--install - install the wrapper in the local site-packages |
|
|
71 |
|
|
|
72 |
Distribution actions: |
|
|
73 |
--use-distutils - use distutils even when setuptools is availble |
|
|
74 |
--bdist - generate a binary distutils-based distribution |
|
|
75 |
or a setuptools-based .egg |
|
|
76 |
--wininst - create an installer application for Microsoft |
|
|
77 |
Windows |
|
|
78 |
|
|
|
79 |
Other distutils/setuptools options (there are passed right through): |
|
|
80 |
--compiler COMPILER - use COMPILER instead of the platform default |
|
|
81 |
--root ROOTDIR |
|
|
82 |
--install-dir INSTALLDIR |
|
|
83 |
--prefix PREFIX |
|
|
84 |
''' |
|
|
85 |
print help |
|
|
86 |
sys.exit(0) |
|
|
87 |
|
|
|
88 |
cpp.jcc(sys.argv) |