This is the mail archive of the java@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: libgcjx.la


Tom Tromey wrote:
> Right now the Xlib-based AWT peers are put into a library named
> `libgcjx.la'.  At install time this is also copied as
> `gnu-awt-xlib.la' (which I think comes from an earlier revision of the
> automatic .so-loading code).
>
> Is there any reason for this?  I think we should rename the library to
> `lib-gnu-awt-xlib.la' and get rid of libgcjx altogether.

I've never looked at that aspect of the thing, but that sounds fine to me.

> Scott, how do you currently make the peers visible to your code?

To use shared libraries, I just add -lgcjx
nd  -Dawt.toolkit=gnu.awt.xlib.XToolkit  to the gcj command line.

For static linking, it's kind of obnoxious at the moment.  I extract all the
objects from libgcjx and stick them in a single object file, which I link
with my application.  I've always meant to get rid of that, but haven't
gotten around to it.  I suspect that I'd be able to do -lgcjx and reference
XToolkit and maybe a couple of other classes in one of my sources.

I have a Main.java (attached) that's used only when doing a gcj build (i.e.,
there's a different mainline to run from a jar file with the Sun JRE).
That's where I reference classes that otherwise fail to appear in a
statically-linked build.  The "FIXME" comment suggests that I have already
tried and failed to use this technique to pull in xlib, but I don't really
remember.

Here's the Makefile rule that creates a single object file for libgcjx:
  libgcjx.o : /usr/lib/libgcjx.a
        rm -rf libgcjx
        mkdir libgcjx
        cd libgcjx ; ar -xo $< ; cd ..
        ld -r -o $@ libgcjx/*.o

I configured libjava as follows (extracted from config.status):
../gcc/configure
--with-gcc-version-trigger=/home/scott/gcc/release321/gcc/gcc/version.c
--prefix=/usr
--mandir=/usr/share/man
--infodir=/usr/share/info
--enable-shared
--enable-threads=posix
--disable-checking
--host=i386-redhat-linux
--enable-java-awt=xlib
--enable-libgcj
--enable-languages=c,c++,java
--with-system-zlib
--enable-__cxa_atexit
--norecursion


Attachment: Main.java
Description: Binary data


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