]> gcc.gnu.org Git - gcc.git/blame - libjava/HACKING
re PR libgomp/27612 (Tests use __sync_lock_test_and_set_4')
[gcc.git] / libjava / HACKING
CommitLineData
a7e96ed4
MW
1Things libgcj hackers should know
2---------------------------------
3
4If you want to hack on the libgcj files you need to be aware of the
5following things. There are probably lots of other things that should be
6explained in this HACKING file. Please add them if you discover them :)
7
8--
9
b0fa81ee
TT
10libgcj uses GNU Classpath as an upstream provider. Snapshots of
11Classpath are imported into the libgcj source tree. Some classes are
12overridden by local versions; these files still appear in the libgcj
13tree.
14
15To import a new release:
16
17- Check out a classpath snapshot
42e13a3f
TT
18 I use 'cvs export' for this. Make a tag to ensure future hackers
19 know exactly what revision was checked out; tags are of the form
20 'libgcj-import-DATE'.
b0fa81ee
TT
21- Use auto* to create configure, Makefile.in, etc
22 You have to make sure to use the gcc libtool.m4 and gcc lt* scripts
23 cd .../classpath
24 cp ../../lt* .
e7d15bad 25 cp ../../config.sub ../../config.guess .
b0fa81ee
TT
26 aclocal -I m4 -I ../..
27 autoconf
28 autoheader
29 automake
30 rm -rf autom4te.cache
31- Test everything first. The simplest way to do this is by overlaying
32 the checked out classpath on your gcc tree and then doing a build.
33- Use 'cvs import' to import. The vendor tag is 'CLASSPATH'. For the
34 release tag, if this is a released classpath version, use something
35 like 'classpath-import-VERSION'; otherwise something like
36 'classpath-import-DATE'.
37 Be sure to use -ko and -I\!
38- Remove any files that were deleted in Classpath
39- Run 'scripts/makemake.tcl > sources.am' in the source tree
40- Run automake for libgcj
41
42Over time we plan to remove as many of the remaining divergences as
43possible.
44
45File additions and deletions require running scripts/makemake.tcl
46before running automake.
47
a7e96ed4
MW
48--
49
42e13a3f
TT
50In general you should not make any changes in the classpath/
51directory. Changes here should come via imports from upstream.
52However, there are two (known) exceptions to this rule:
53
54* In an emergency, such as a bootstrap breakage, it is ok to commit a
55 patch provided that the problem is resolved (by fixing a compiler
56 bug or fixing the Classpath bug upstream) somehow and the resolution
57 is later checked in (erasing the local diff).
58
59* On a release branch to fix a bug, where a full-scale import of
60 Classpath is not advisable.
61
62--
a7e96ed4 63
aa5190e9
TT
64You can develop in a GCC tree using a CVS checkout of Classpath, most
65of the time. (The exceptions are when an incompatible change has been
66made in Classpath and some core part of libgcj has not yet been
67updated.)
68
69The way to set this up is very similar to importing a new version of
70Classpath into the libgcj tree. In your working tree:
71
72* cd gcc/libjava; rm -rf classpath
73* cvs co classpath
74* cd classpath
75 Now run the auto tools as specified in the import process; then
76 cd ..
77* Run 'scripts/makemake.tcl > sources.am' in the source tree
78* Run automake for libgcj
79
80Now you should be ready to go.
81
82If you are working in a tree like this, you must remember to run
83makemake.tcl and automake whenever you update your embedded classpath
84tree.
85
86--
87
7729617c
MW
88If you add a class to java.lang, java.io, or java.util
89(including sub-packages, like java.lang.ref).
90
91* Edit gcj/javaprims.h
92
93* Go to the `namespace java' line, and delete that entire block (the
94 entire contents of the namespace)
95
b0fa81ee
TT
96* Then insert the output of `perl scripts/classes.pl' into the file
97 at that point. This must be run from the build tree, in
98 <build>/classpath/lib; it uses the .class file name to determine
99 what to print.
7729617c
MW
100
101If you're generating a patch there is a program you can get to do an
102offline `cvs add' (it will fake an `add' if you don't have write
103permission yet). Then you can use `cvs diff -N' to generate the
104patch. See http://www.red-bean.com/cvsutils/
This page took 0.447415 seconds and 5 git commands to generate.