This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ CVS Quick Start (proposed)
- To: Brad Cox <bcox at virtualschool dot edu>
- Subject: Re: GCJ CVS Quick Start (proposed)
- From: Brad Cox <bcox at virtualschool dot edu>
- Date: Sat, 10 Nov 2001 13:51:13 -0500
- Cc: Jeff Sturm <jsturm at one-point dot com>,Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>,java at gcc dot gnu dot org
On Saturday, November 10, 2001, at 12:10 PM, Brad Cox wrote:
> A quick start README to help other first timers get this far might help
> to cut down questions like these on the list. I could post the one I've
> been writing while the bruises are fresh. Please say if there's interest.
Here's a rough draft of the quick start guide I had in mind.
GCC 3.1 CVS Quick Start
Brad Cox <bcox at virtualschool.edu>
A quick start guide to installing and compiling gcc 3.1 from CVS.
Everything installs into the directory you create below; i.e. this does
not put your trusted compiler at risk.
1) Create a suitable directory. This assumes /usr/local/gcc31 is
suitable; adjust as appropriate.
cd /usr/local
mkdir gcc31
cd gcc31
mkdir cvs # populated by downloading sources from CVS
mkdir dox # populated by downloading documentation from CVS
mkdir build # populated by compiling the cvs sources
Install directories will be created alongside these during the build
2) Download sources and documentation from CVS
See http://gcc.gnu.org/cvs.html and adjust as instructed there.
cd cvs
cvs -d :pserver:anoncvs@gcc.gnu.org:/cvs/gcc -z 9 co gcc
cd ..
cd dox
cvs -d :pserver:anoncvs@gcc.gnu.org:/cvs/gcc -z 9 co wwwdocs
cd ..
3) Build
See http://gcc.gnu.org/java/build-snapshot.html and adjust as
instructed there. Tromey advises skipping the make bootstrap step
recommended in the instructions. (WHY?)
cd build
../src/configure \
--enable-threads=posix \
--prefix=/usr/local/gcc31 \
--enable-shared \
--enable-languages=c++,java \
...other options if desired
make # takes hours; do overnight
cd ..
4) Install. Everything will be installed into new directories that will
be created alongside the three (cvs, build, dox) you made by hand.
cd build
make install
make clean # if space is more important than rebuild time
cd ..
/usr/local/gcc31 should now look like this:
ls -l
total 12
-rw-r--r-- 1 bcox wheel 1173 Nov 10 12:45 README
drwxr-xr-x 2 bcox wheel 1024 Nov 10 10:45 bin
drwxr-xr-x 9 bcox wheel 1024 Nov 10 09:19 build
drwxr-xr-x 7 bcox sdi 1024 May 11 2001 dox
drwxr-xr-x 8 bcox wheel 1024 Nov 10 10:47 include
drwxr-xr-x 2 bcox wheel 1024 Nov 10 10:43 info
drwxr-xr-x 4 bcox wheel 1024 Nov 10 10:47 lib
drwxr-xr-x 3 bcox wheel 1024 Nov 10 10:42 man
drwxr-xr-x 3 bcox wheel 1024 Nov 10 10:46 share
drwxr-xr-x 25 bcox sdi 1024 Nov 9 21:10 cvs
5) Try it out. Start from this Makefile.
# Example GCJ Makefile
# Edit to list your source files at SRC and your jar files at JAR.
SRC=\
HelloWorld.java \
JAR=\
GCC=/usr/local/gcc31
GCJ=export CLASSPATH=$(CP) && $(GCC)/bin/gcj -v
BIN=$(shell echo $(SRC) | sed -e 's/\.java/\.o/g' )
CP=$(shell echo $(JAR) | sed -e 's/ */:/g' )
all: test
test: Test.o
$(GCJ) --main=Test Test.o
a.out
clean:
rm -f $(BIN)
archive.a: $(BIN)
ar rs archive.a $(BIN)
ctags:
ctags -R . $(GCC)/src/libjava/
.SUFFIXES:
.SUFFIXES: .java .o
%.o: %.java
$(GCJ) -c -o $@ $<
6) Periodically update and rebuild to stay on the bleeding edge.
cd src
cvs update -d # The -d ensures any new directories will be downloaded.
cd ..
cd dox
cvs update -d # The -d ensures any new directories will be downloaded.
cd ..
Rebuild as before