On Thu, May 24, 2018 at 12:14:52AM +0300, Dmitry Shachnev wrote:
> On Wed, May 23, 2018 at 08:23:53PM +0200, Helmut Grohne wrote:
> > Thiago Macieira suggested an alternative approach to solving this.
> > Rather than telling qmake to use the "right" pkg-config at runtime, we
> > can tell it at build time.
> >
> > To that end we should build qtbase with a triplet-prefixed pkg-config.
> >
> > That actually works fairly well as the Debian packaging of pkg-config
> > ensures that <nativetriplet>-pkg-config is a symlink to pkg-config. So
> > just using the triplet-prefixed pkg-config always works (native and
> > cross). Where should we reassign this bug to?
> >
> > I think Thiago's approach is strictly better than mine, because it
> > ensures that qmake will always use the right pkg-config even without
> > passing PKG_CONFIG or PKG_CONFIG_EXECUTABLE to qmake. That should be
> > useful to people cross building with qmake without our cross wrapper.
> 
> I wonder how this approach will work.

Unlike the PKG_CONFIG_EXECUTABLE approach, I did not verify that it does
indeed work. So you might very well be correct about this.

> Our triplet-prefixed qmake is a wrapper that calls the native qmake with
> some arguments. If we configure qmake with prefixed pkg-config path, then
> the native qmake will call pkg-config corresponding to *its* (native)
> architecture, not the architecture we are building for.

If I understood the idea correctly, the value gets interpolated into
some .prf file. Those are installed into architecture-dependent
locations, so they can vary per architecture despite being text files.
During cross building, we use the build architecture qmake executable
and the host architecture .prf files, so this may actually work unless I
missing something.

Are the .prf files indeed interpolated at build time the way I am
picturing here? If not, we may need to ask Thiago for a clarification.

I suggest that you simply try building qtbase with the modified
PKG_CONFIG and search the qt5-qmake binary package (not qt5-qmake-bin)
for the value. If it doesn't show up, ask Thiago or fall back to setting
PKG_CONFIG_EXECUTABLE.

Helmut

Reply via email to