[OpenJDK 2D-Dev] RFR: Allow using a system-installed lcms2

Omair Majid omajid at redhat.com
Thu Feb 20 22:40:45 UTC 2014


The following is a preliminary webrev that allows OpenJDK to build and
run against a system-installed copy of lcms2 rather than the copy
bundled with OpenJDK:

root: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00/
jdk: http://cr.openjdk.java.net/~omajid/webrevs/system-lcms/00-jdk/

The goal is to add a new option `--with-lcms=` with possible values
`bundled` or `system`. Using `--with-lcms=system` builds using the
system-installed copy of lcms2 while `--with-lcms=bundled` builds with
the bundled copy of lcms2 in OpenJDK.

This patch is quite a bit more invasive than the libpng one [1]. There
are a few issues that came up:

1. The sources for the bundled library are contained next to
OpenJDK-specific sources. This is not true for the bundled copies of
zlib, libpng and giflib. On the other hand, the jpeg code in OpenJDK
also mixes OpenJDK-specific code with bundled libjpeg code.  To make it
easier to see (and compile) only non-lcms2 code, I moved the
lcms2-specific code into a separate directory. There are no code changes

2. The library name. The current library name for the combined library
containing lcms and OpenJDK code (that goes under jre/lib/$(ARCH)/) is
currently `liblcms.so` (on my Linux platform). When linked against the
system library, this new `liblcms.so` links to the system-wide
`liblcms2.so`. This looks a little bizarre. I am also afraid of some
distribution packaging the upstream lcms2 as `liblcms.so` which would
cause a name conflict. Following the convention of `libj2gss.so`, I
renamed it to `libj2lcms.so`.

I made changes which made sense to me, but I am not sure how this fits
in with existing conventions. Perhaps people here have suggestions on
how to make this less invasive and still achieve the goal while keep
things separate and distinct?


[1] http://mail.openjdk.java.net/pipermail/build-dev/2014-February/011717.html

PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681

More information about the 2d-dev mailing list