Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] [sm-discuss] some java questions...

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Javier Vasquez <j.e.vasquez.v AT gmail.com>
  • To: "sm, discuss" <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] [sm-discuss] some java questions...
  • Date: Sun, 6 Oct 2013 21:55:37 -0600

...
>
> The gcc spell (4.6.3, this was removed from 4.7.2 for some reason) actually
> downloads ecj.jar and uses that. The version in the gcc spell is pretty old
> and there is a newer version. FYI Gentoo still uses ecj.jar for gcc 4.8, so
> there is a good chance it shouldn't have been removed.
>
> Once you get gcj, you should be able to compile ecj.

gcj 4.8.1 compiles smoothly, and doesn't have the cleanse issues,
which is great.

On the other hand it's sad that to compile ecj, the ecj jar is
required any ways. Kind of an infinite dependency loop, :-) Actually
I have a spell (see attached one) for it, but it fails given the lack
of ecj1, a wrapper to point to the ecj jar. Notice that the wrapper
without the jar doesn't make sense.

Fortunately, I found a couple of links which pointed into the right direction:

http://gcc.gnu.org/ml/java/2008-04/msg00027.html
http://gcc.gnu.org/ml/java/2008-04/msg00006.html

So with them I could take a look at:

file:///usr/src/gcc-gcj/gcc-gcj/again/gcc-4.8.1/INSTALL/configure.html

**
--with-ecj-jar=filename
This option can be used to specify the location of an external jar
file containing the Eclipse Java compiler. A specially modified
version of this compiler is used by gcj to parse .java source files.
If this option is given, the \u2018libjava\u2019 build will create and
install an ecj1 executable which uses this jar file at runtime.

If this option is not given, but an ecj.jar file is found in the
topmost source tree at configure time, then the \u2018libgcj\u2019
build will create and install ecj1, and will also install the
discovered ecj.jar into a suitable place in the install tree.

If ecj1 is not installed, then the user will have to supply one on
his path in order for gcj to properly parse .java source files. A
suitable jar is available from ftp://sourceware.org/pub/java/.
**

There's a script (using ftp) available in contrib under the gcc
sources, but that just hanged on me, so I included another source in
DETAILS:

if list_find "$GCC_COMPILER" "java"; then
VERSION_ECJ_JAR=4.5
SOURCE15=ecj-${VERSION_ECJ_JAR}.jar
SOURCE15_URL[0]=ftp://sourceware.org/pub/java/${SOURCE15}

SOURCE15_HASH=sha512:d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e
fi

which I just renamed for gcj recognition in PRE_BUILD as:

if list_find "$GCC_COMPILER" "java"; then
cd $SOURCE_DIRECTORY &&
cp $SOURCE_CACHE/${SOURCE15} ecj.jar &&
cp ecj.jar $SOURCE_DIRECTORY.bld
fi

With that, the jar ends up placed at:

/usr/share/java/ecj.jar

However no libs get intalled. Forgetting about the libs, no ecj1
executable gets installed either. One can be created:

**
#!/bin/sh

ecj_cp="/usr/share/java/ecj.jar"
if [[ -n "${CLASS_PATH}" ]]; then
ecj_cp="${ecj_cp}:${CLASS_PATH}"
fi
gij -classpath ${ecj_cp}
org.eclipse.jdt.internal.compiler.batch.GCCMain ${1+"$@"}
unset ecj_cp
**

However it didn't seem necessary, since now I could run the ecj
command necessary to compile part of ecj. And it seems to work...

Now the question. Given that by using the recommended by gcj jar for
ecj, it seems no longer necessary to build ecj again, right? So I
don't need to cast the ecj spell I was originally intending to use.
Something else, is that I suppose this jar is not architecture
dependent, so I could use it on whether x86 64 or 32 bits, and non x86
architectures?

Thanks,

--
Javier.

Attachment: ecj.tar.xz
Description: Binary data



  • Re: [SM-Discuss] [sm-discuss] some java questions..., Javier Vasquez, 10/06/2013

Archive powered by MHonArc 2.6.24.

Top of Page