This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: update to HACKING


Hi again.

I figured out how this works ...
> Btw: Mark told me that there is some automatic that makes GCJ use the correct
> file when natFooPosix, natFooWindows and natFooEcos are available but only
> natFooPosix is part of the nat_source_files variable. Can someone explain this
> to me or add the neccessary info to HACKING after I applied this patch?

... and updated HACKING accordingly.

Attached is the new variant of the patch. The ChangeLog stays the same.

cya
Robert

Robert Schuster wrote:
> Hi,
> I updated HACKING with some info I found valuable as being not so experienced
> with GCJ build machinery.
> 
> Ok, for commit?
> 
> 
> ChangeLog:
> 
> 2006-10-03  Robert Schuster  <robertschuster@fsfe.org>
> 
>         * HACKING: Added info about adding/removing C++ source files,
>         applied minor corrections, added index and captions.
> 
> cya
> Robert
> 
> 
> ------------------------------------------------------------------------
> 
> Index: HACKING
> ===================================================================
> --- HACKING	(Revision 117275)
> +++ HACKING	(Arbeitskopie)
> @@ -5,8 +5,15 @@
>  following things. There are probably lots of other things that should be
>  explained in this HACKING file. Please add them if you discover them :)
>  
> ---
> +Current items:
> +  - Importing a new GNU Classpath release
> +  - Using a CVS checkout of GNU Classpath
> +  - Adding classes to java.lang, java.io, java.util and subpackages
> +  - Adding or removing C++ source files
>  
> +Importing a new GNU Classpath release
> +-------------------------------------
> +
>  libgcj uses GNU Classpath as an upstream provider.  Snapshots of
>  Classpath are imported into the libgcj source tree.  Some classes are
>  overridden by local versions; these files still appear in the libgcj
> @@ -50,7 +57,7 @@
>  - Use auto* to create configure, Makefile.in, etc
>    Make sure you have Automake 1.9.6 installed. Exactly that version!
>    You have to make sure to use the gcc libtool.m4 and gcc lt* scripts
> -  cd .../classpath
> +  cd classpath
>    cp ../../lt* .
>    cp ../../config.sub ../../config.guess .
>    aclocal -I m4 -I ../.. -I ../../config
> @@ -59,7 +66,7 @@
>    automake
>    rm -rf autom4te.cache
>    cd ..
> -  scripts/makemake.tcl > sources.am
> +  ./scripts/makemake.tcl > sources.am
>    automake
>  - Build, fix, till everything works.
>    Possibly update the gcj/javaprims.h file with scripts/classes.pl
> @@ -86,7 +93,8 @@
>  * On a release branch to fix a bug, where a full-scale import of
>    Classpath is not advisable.
>  
> ---
> +Using a CVS checkout of GNU Classpath
> +-------------------------------------
>  
>  You can develop in a GCC tree using a CVS checkout of Classpath, most
>  of the time.  (The exceptions are when an incompatible change has been
> @@ -101,7 +109,7 @@
>  * cd classpath
>    Now run the auto tools as specified in the import process; then
>    cd ..
> -* Run 'scripts/makemake.tcl > sources.am' in the source tree
> +* Run './scripts/makemake.tcl > sources.am' in the source tree
>  * Run automake for libgcj
>  
>  Now you should be ready to go.
> @@ -110,7 +118,8 @@
>  makemake.tcl and automake whenever you update your embedded classpath
>  tree.
>  
> ---
> +Adding classes to java.lang, java.io, java.util and subpackages
> +---------------------------------------------------------------
>  
>  If you add a class to java.lang, java.io, or java.util
>  (including sub-packages, like java.lang.ref).
> @@ -129,3 +138,10 @@
>  offline `cvs add' (it will fake an `add' if you don't have write
>  permission yet).  Then you can use `cvs diff -N' to generate the
>  patch.  See http://www.red-bean.com/cvsutils/
> +
> +Adding or removing C++ source files
> +-----------------------------------
> +
> +If you add or remove any C++ source files you need to update the 
> +nat_source_files variable in Makefile.am accordingly. After that
> +run automake.
Index: HACKING
===================================================================
--- HACKING	(Revision 117275)
+++ HACKING	(Arbeitskopie)
@@ -5,8 +5,15 @@
 following things. There are probably lots of other things that should be
 explained in this HACKING file. Please add them if you discover them :)
 
---
+Current items:
+  - Importing a new GNU Classpath release
+  - Using a CVS checkout of GNU Classpath
+  - Adding classes to java.lang, java.io, java.util and subpackages
+  - Adding or removing C++ source files
 
+Importing a new GNU Classpath release
+-------------------------------------
+
 libgcj uses GNU Classpath as an upstream provider.  Snapshots of
 Classpath are imported into the libgcj source tree.  Some classes are
 overridden by local versions; these files still appear in the libgcj
@@ -50,7 +57,7 @@
 - Use auto* to create configure, Makefile.in, etc
   Make sure you have Automake 1.9.6 installed. Exactly that version!
   You have to make sure to use the gcc libtool.m4 and gcc lt* scripts
-  cd .../classpath
+  cd classpath
   cp ../../lt* .
   cp ../../config.sub ../../config.guess .
   aclocal -I m4 -I ../.. -I ../../config
@@ -59,7 +66,7 @@
   automake
   rm -rf autom4te.cache
   cd ..
-  scripts/makemake.tcl > sources.am
+  ./scripts/makemake.tcl > sources.am
   automake
 - Build, fix, till everything works.
   Possibly update the gcj/javaprims.h file with scripts/classes.pl
@@ -86,7 +93,8 @@
 * On a release branch to fix a bug, where a full-scale import of
   Classpath is not advisable.
 
---
+Using a CVS checkout of GNU Classpath
+-------------------------------------
 
 You can develop in a GCC tree using a CVS checkout of Classpath, most
 of the time.  (The exceptions are when an incompatible change has been
@@ -101,7 +109,7 @@
 * cd classpath
   Now run the auto tools as specified in the import process; then
   cd ..
-* Run 'scripts/makemake.tcl > sources.am' in the source tree
+* Run './scripts/makemake.tcl > sources.am' in the source tree
 * Run automake for libgcj
 
 Now you should be ready to go.
@@ -110,7 +118,8 @@
 makemake.tcl and automake whenever you update your embedded classpath
 tree.
 
---
+Adding classes to java.lang, java.io, java.util and subpackages
+---------------------------------------------------------------
 
 If you add a class to java.lang, java.io, or java.util
 (including sub-packages, like java.lang.ref).
@@ -129,3 +138,32 @@
 offline `cvs add' (it will fake an `add' if you don't have write
 permission yet).  Then you can use `cvs diff -N' to generate the
 patch.  See http://www.red-bean.com/cvsutils/
+
+Adding or removing C++ source files
+-----------------------------------
+
+If you add or remove C++ source files which are not platform specific
+you need to update the nat_source_files variable in Makefile.am accordingly.
+After that run automake.
+
+If your source file is platform specific and there may be different
+ones for eg. Posix, Windows and Ecos systems apply the following
+pattern for your situation:
+
+Suppose you implement the native part for the Java class: gnu.java.baz.Foo
+
+Name the Posix implementation natFooPosix.cc, the Windows implementation
+natFooWindows.cc and the Ecos variant natFooEcos.cc. Edit configure.ac
+and go to the area where lots of AC_CONFIG_LINKS macros are used.
+
+Add the following check for the directory structure of the files:
+test -d gnu/java/baz || mkdir gnu/java/baz
+
+Add the following AC_CONFIG_LINKS macro:
+AC_CONFIG_LINKS(gnu/java/baz/natFoo.cc:gnu/java/baz/natFoo${PLATFORM}.cc)
+
+Modify Makefile.am and add gnu/java/baz/natFoo.cc to nat_source_files.
+
+Run automake and autoconf afterwards.
+  
+

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]