Comment 3 for bug 1518741

Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote : Re: [Bug 1518741] Re: A pkg-config file is need for OpenJDK distributions

I am mostly a user of pkg-config, my experience as a developer using
it directly is somewhat limited. So please understand that I may be
lacking information on pkg-config's scope and usage.

That said, I understand your request (plus the requests made before on
those mailing lists) and what it is expected to achieve.

Previously I quoted a few comments on the other bug which seem to
indicate that pkg-config is not the right tool:

"Basically, it's wrong for fedora packages to link against a specific
JVM. We use alternatives and JAVA_HOME to allow users to select the
right VM at runtime. Linking directly against a VM runs against this.
Individual programs needs to be fixed to use dlopen() on the
appropriate JVM and use that."

"Which still leaves the burden of locating the shared library location
on the application. If pkg-config is not suitable solution, another
locator should be provided."
@ https://bugzilla.redhat.com/show_bug.cgi?id=740762#c27

On Ubuntu we also allow users to select their VM using alternatives,
thus linking directly against a VM through pkg-config will be
problematic as well. If you disagree, could you explain why and
provide some pointers so I can start looking?

Unless there is a way to use pkg-config such as it does not violate
this, we would required another solution. What this "locator" would be
or how it would work is unclear at the moment. Please let me know if
you might have a proposal for this.

On Wed, Nov 25, 2015 at 9:08 AM, sjgcit <email address hidden> wrote:
> My view is that it is not an OpenJDK issue, but a package maintainer's issue.
>
> I think whether other LInux distros want to include a pkg-config file is
> a matter for them to decide. My view is that it's easy to add to a
> distro, but no-one will do it unless someone starts. I don't think
> Ubuntu need follow anyone else's lead on this - they can take the lead,
> as a major distro.
>
> Until someone actually does this, no one will. No consensus will form
> until it's already been done somewhere. I do not see any way for the
> OpenJDK people to maintain pkg-config files for distributions they do
> not ultimately control. So it's down to individual distros. I think
> the very long gestation time we've already had in the community shows
> it's won;t happen until someone takes the lead.
>
> The whole point of a pkg-config is to be provide a method for accessing
> resources that is package independent. Where the package maintainers
> place files should be left to them. But the pkg-config files are so
> useful and simple it's hard to see a justification for omitting them. I
> might suggest they should be standard for practically all applications
> that have developer components, but that's beyond the scope of this bug.
>
> Thanks.
>
> --
> You received this bug notification because you are subscribed to
> openjdk-7 in Ubuntu.
> Matching subscriptions: all openjdk-7 bugs
> https://bugs.launchpad.net/bugs/1518741
>
> Title:
> A pkg-config file is need for OpenJDK distributions
>
> Status in openjdk-7 package in Ubuntu:
> New
>
> Bug description:
> When developing using JNI ( either to start a JVM or to develop native
> support files for classes ), you need to compile and link against
> <jni.h> and libjvm.so.
>
> The normal way for developers to do this on Linux systems is to use
> pkg-config to get the required paths for --cflags and --libs and avoid
> hardwiring paths into make and other build files.
>
> However OpenJDK does not supply a pkg-config file, which is a shame as
> it's a very simple file to add to the package.
>
> I would make three observations in this regards :
>
> 1. In practical terms libraries should be the normal search path for
> Linux libraries, so that they can be found by linkers ( ld ) without
> complex configurations. Having the Java libraries in a completely
> separate location is not ideal. However, failing the uatomatic
> installation of a symbolic link in e.g. /usr/lib to the Java runtime
> libraries, having them accessible via a standard mechanism like pkg-
> config would be some help.
>
> 2. While a pkg-config would be a big help, without libraries being
> installed on standard paths people distributing non-Java applications
> that wish to start their own JVM have problems ensuring the
> application will launch without knowledge of where on the system the
> Java runtime libraries are. A symbolic link or similar to the Java
> libs would be useful in it's own right
>
> 3. Any symbolic links should probably be made against /usr/lib/jvm
> /default-path and not the canonical path to the files proper. This
> allows more flexibility.
>
> Thanks,
>
> Stephen Geary
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/1518741/+subscriptions

--
Tiago Stürmer Daitx
Software Engineer
<email address hidden>