gcj static builds are failing

Andrew Haley aph@redhat.com
Wed Jan 10 15:38:00 GMT 2007


This is because of a runtime dependency on libmagic.

The neatest way to solve this is to link dynamically to libmagic, even
when an app is compiled statically.  The only place libmagic is needed
is URLConnection.guessContentTypeFromStream(InputStream is), which as
the name suggests is a guess.  If libmagic is absent, we'll return
application.octet-stream, which is always safe.

At the moment we determine the availability of libmagic at libgcj
build time.  This is wrong, because even if libmagic is present when
gcj is built, it isn't necessarily present when libgcj apps are built,
and vice versa.  The right time to detect libmagic is at runtime.

I'm on it.

Andrew.



More information about the Java mailing list