-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
55 lines (38 loc) · 1.93 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Build
There are two forms ("d" and "s") of this library. Each of these require
different Java class/library paths for user code to work; see the corresponding
check_? target for details.
The "meat" of this library is the class gcj.math.BigInteger. In GCJ, this class
is simply java.math.BigInteger, but here we rename it so that you can use the
former in a non-GCJ JVM too.
## Build against libgmp-dev and libgcj.jar
libgcj.jar is the GNU Classpath / GCJ implementation of standard java library,
so you need GCJ installed to build and run against this form. Note that this
does *not* mean you need to use GCJ as your JVM; you just need to be able to
link against its jars and libs on your file system.
This is the preferred form if you already have GCJ installed (default on many
GNU/Linux distributions), and results in the least code duplication from GCJ.
# install libgmp-dev, gcj-4.?-jre-lib, and optionally gcj-4.?-source[1]
# edit Makefile vars JUNIT_*, GCJ_*
$ make gmp.jar check_d
[1] if not, we fall back to downloading GCJ source from GNU servers
## Build against libgmp-dev only
This form is useful for people that are unable to, or refuse to, have GCJ
installed on their machines. It copies a minimal set of math-related code from
GCJ and uses it to build this library.
# install libgmp-dev
# edit Makefile vars JUNIT_*
$ make gmp-nogcj.jar libgmp-jni.so check_s
# Quirks
We should probably use ant to do the javac/jar/junit-related stuff. There was
enough non-java stuff that I initially decided to use GNU make, and ended up
sticking with it.
# Credits
Inspired by https://bitbucket.org/dfdeshom/gmp-java/overview
I decided to code this version to be
- easier to track modifications from upstream GCJ
- use the actual BigInteger class, which is immutable, rather than try to
retrofit the lower-level GMP class, which is mutable in GCJ, into a
BigInteger-style interface (i.e. similar methods).
# TODO
debian build script that builds gmp.jar