]>
Commit | Line | Data |
---|---|---|
a7e96ed4 MW |
1 | Things libgcj hackers should know |
2 | --------------------------------- | |
3 | ||
4 | If you want to hack on the libgcj files you need to be aware of the | |
5 | following things. There are probably lots of other things that should be | |
6 | explained in this HACKING file. Please add them if you discover them :) | |
7 | ||
8 | -- | |
9 | ||
b0fa81ee TT |
10 | libgcj uses GNU Classpath as an upstream provider. Snapshots of |
11 | Classpath are imported into the libgcj source tree. Some classes are | |
12 | overridden by local versions; these files still appear in the libgcj | |
13 | tree. | |
14 | ||
15 | To import a new release: | |
16 | ||
6a70560c | 17 | - Check out a classpath snapshot or take a release tar.gz file. |
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 | |
ac1ed908 MW |
20 | 'libgcj-import-DATE' (when using a tagged checkout do: |
21 | - ./autogen.sh && ./configure && make dist | |
22 | to get a proper .tar.gz for importing below). | |
6a70560c MW |
23 | - Get a svn checkout of |
24 | svn+ssh://gcc.gnu.org/svn/gcc/branches/CLASSPATH/libjava/classpath | |
25 | this contains "pure" GNU Classpath inside the GCC tree. | |
26 | - Clean it up and get the files from a new version: | |
ac1ed908 | 27 | - find classpath -type f | grep -v /\.svn | grep -v /\.cvs | xargs rm |
6a70560c MW |
28 | - tar zxf classpath-x.tar.gz |
29 | - cp -r classpath-x/* classpath | |
30 | - Add/Remove files: | |
31 | - svn status classpath | grep ^\! | cut -c8- | xargs svn remove | |
32 | - svn status classpath | grep ^\? | cut -c8- | xargs svn add | |
ac1ed908 MW |
33 | - If there are any empty directories now they can be removed. You can find |
34 | candidates (dirs with files removed) with: | |
35 | - for i in `svn status classpath | grep ^D | cut -c8-`; \ | |
36 | do ls -d `dirname $i`; done | uniq | |
6a70560c MW |
37 | - Update vendor branch |
38 | - svn commit classpath | |
39 | - Note the new revision number (Xrev) | |
40 | - Get a fresh svn trunk checkout and cd gcc/libjava | |
41 | - Merge the changes between classpath versions into the trunk. | |
42 | svn merge -rXrev-1:Xrev \ | |
43 | svn+ssh://gcc.gnu.org/svn/gcc/branches/CLASSPATH/libjava/classpath \ | |
44 | classpath | |
45 | - Resolve any conflicts pointed out by svn status classpath | grep ^C | |
46 | - Makefile.in files will be regenerated in the next step. | |
47 | - Other files should have a "GCJ LOCAL" comment, and/or are mentioned | |
48 | in the classpath/ChangeLog.gcj file. | |
49 | (Don't forget to svn resolved files.) | |
b0fa81ee | 50 | - Use auto* to create configure, Makefile.in, etc |
ac1ed908 | 51 | Make sure you have Automake 1.9.6 installed. Exactly that version! |
b0fa81ee TT |
52 | You have to make sure to use the gcc libtool.m4 and gcc lt* scripts |
53 | cd .../classpath | |
54 | cp ../../lt* . | |
e7d15bad | 55 | cp ../../config.sub ../../config.guess . |
b0fa81ee TT |
56 | aclocal -I m4 -I ../.. |
57 | autoconf | |
58 | autoheader | |
59 | automake | |
60 | rm -rf autom4te.cache | |
6a70560c MW |
61 | cd .. |
62 | scripts/makemake.tcl > sources.am | |
63 | automake | |
64 | - Build, fix, till everything works. | |
65 | Possibly update the gcj/javaprims.h file with scripts/classes.pl | |
66 | (See below, it can only be done after the first source->bytecode | |
67 | pass has finished.) | |
b0fa81ee TT |
68 | |
69 | Over time we plan to remove as many of the remaining divergences as | |
70 | possible. | |
71 | ||
72 | File additions and deletions require running scripts/makemake.tcl | |
73 | before running automake. | |
74 | ||
a7e96ed4 MW |
75 | -- |
76 | ||
42e13a3f TT |
77 | In general you should not make any changes in the classpath/ |
78 | directory. Changes here should come via imports from upstream. | |
79 | However, there are two (known) exceptions to this rule: | |
80 | ||
81 | * In an emergency, such as a bootstrap breakage, it is ok to commit a | |
82 | patch provided that the problem is resolved (by fixing a compiler | |
83 | bug or fixing the Classpath bug upstream) somehow and the resolution | |
84 | is later checked in (erasing the local diff). | |
85 | ||
86 | * On a release branch to fix a bug, where a full-scale import of | |
87 | Classpath is not advisable. | |
88 | ||
89 | -- | |
a7e96ed4 | 90 | |
aa5190e9 TT |
91 | You can develop in a GCC tree using a CVS checkout of Classpath, most |
92 | of the time. (The exceptions are when an incompatible change has been | |
93 | made in Classpath and some core part of libgcj has not yet been | |
94 | updated.) | |
95 | ||
96 | The way to set this up is very similar to importing a new version of | |
97 | Classpath into the libgcj tree. In your working tree: | |
98 | ||
99 | * cd gcc/libjava; rm -rf classpath | |
100 | * cvs co classpath | |
101 | * cd classpath | |
102 | Now run the auto tools as specified in the import process; then | |
103 | cd .. | |
104 | * Run 'scripts/makemake.tcl > sources.am' in the source tree | |
105 | * Run automake for libgcj | |
106 | ||
107 | Now you should be ready to go. | |
108 | ||
109 | If you are working in a tree like this, you must remember to run | |
110 | makemake.tcl and automake whenever you update your embedded classpath | |
111 | tree. | |
112 | ||
113 | -- | |
114 | ||
7729617c MW |
115 | If you add a class to java.lang, java.io, or java.util |
116 | (including sub-packages, like java.lang.ref). | |
117 | ||
118 | * Edit gcj/javaprims.h | |
119 | ||
120 | * Go to the `namespace java' line, and delete that entire block (the | |
121 | entire contents of the namespace) | |
122 | ||
b0fa81ee TT |
123 | * Then insert the output of `perl scripts/classes.pl' into the file |
124 | at that point. This must be run from the build tree, in | |
125 | <build>/classpath/lib; it uses the .class file name to determine | |
126 | what to print. | |
7729617c MW |
127 | |
128 | If you're generating a patch there is a program you can get to do an | |
129 | offline `cvs add' (it will fake an `add' if you don't have write | |
130 | permission yet). Then you can use `cvs diff -N' to generate the | |
131 | patch. See http://www.red-bean.com/cvsutils/ |