Le 21/03/2015 20:50, Bruce Dubbs a écrit :
> Pierre Labastie wrote:
>> Le 20/03/2015 22:40, Bruce Dubbs a écrit :
>>> Pierre Labastie wrote:
>>>> Le 20/03/2015 20:14, Bruce Dubbs a écrit :
>>>>> Pierre Labastie wrote:
>>>>>>
>>>>>> It seems to me that the setqt{4,5} scripts could set PKG_CONFIG_PATH as
>>>>>> well
>>>>>> as PATH. Since autotools now unconditionally use pkgconfig, if the
>>>>>> PKG_CONFIG_PATH is not set, configure scripts may find one version of Qt,
>>>>>> while make would use the other. This seems to be a problem, for example
>>>>>> with
>>>>>> wireshark.
>>>>>>
>>>>>>
>>>>>
>>>>> I'm not sure why this is needed.  There is no conflict between the .pc 
>>>>> files
>>>>> in qt4 and qt5.  My path is:
>>>>>
>>>>> PKG_CONFIG_PATH=/opt/qt/lib/pkgconfig:/opt/kde/lib/pkgconfig:/opt/kde/share/pkgconfig:/opt/qt4/lib/pkgconfig:/opt/qt5/lib/pkgconfig:/opt/xorg/lib/pkgconfig:/opt/xorg/share/pkgconfig
>>>>>
>>>>>
>>>> in the case of wireshark, the configure script
>>>> first checks qt5 (actually, qt modules whose names begin with qt5), then 
>>>> qt4
>>>> (if qt5 is not found), using pkgconfig. So, with the PATH above, it will 
>>>> find
>>>> qt5 modules, and not check qt4. If the user intended to use qt4, the PATH 
>>>> is
>>>> set to /opt/qt4, which is very likely to create a failure when building 
>>>> (and
>>>> it does, in the case of wireshark). The only safe option is to set both
>>>> PKG_CONFIG_PATH and PATH in setqtx
>>>
>>> I see.  But if it's checking for qt5 first then what's needed is:
>>>
>>> pathremove /opt/qt5/lib/pkgconfig PKG_CONFIG_PATH
>>>
>>> otherwise it will find qt5 no matter what the order of the paths in
>>> PKG_CONFIG_PATH.
>>
>> Exact. Actually, the setqt<N> scripts do that with PATH. I suggest to extend
>> that to PKG_CONFIG_PATH. For example:
>> ---
>> cat > /usr/bin/setqt4 << 'EOF'
>> if [ "x$QT5DIR" != "x/usr" ]; then
>>    pathremove  $QT5DIR/bin
>>    pathremove  $QT5DIR/lib/pkgconfig PKG_CONFIG_PATH
>> fi
>> if [ "x$QT4DIR" != "x/usr" ]; then
>>    pathprepend $QT4DIR/bin
>>    pathprepend $QT4DIR/lib/pkgconfig PKG_CONFIG_PATH
>> fi
>> echo PATH=$PATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH
>> EOF
> 
> I really don't want to do that.  It would only be needed when there is a build
> that will insist on preferring one package and not giving an option in a
> reasonable way such as a configure option.  On the other hand, there are other
> packages that can use either, but allow the user to specify the desired
> package.  This would force us to search out and change all packages where this
> would apply.

We already do that,with the setqtX scripts, but those scripts only change the
PATH. I do not understand why it could not change PKG_CONFIG_PATH as well.
> 
> OTOH, if the user has both qt4 and qt5 installed, does it really matter which
> is used for wireshark?

I guess not, but if the user has both versions and runs the setqt4 script as
it is presently in the book (for whatever reason), what happens is that
configure finds qt5 (because PKG_CONFIG_PATH still contains /opt/qt5/lib),
while some parts of the build use Qt4 (because PATH contains only
/opt/qt4/bin) and the build fails. Presently, what is proposed in the book is
to remove any reference to qt5 in the configure script (using a sed). But this
solves only the problem with wireshark. I think setting PKG_CONFIG_PATH in
setqtX would solve any similar problem, which may occur in other packages and
are not yet known...

OTOH, I see that qt5 and qt4 are optional for a majority of packages (they are
optional for wireshark: the book recommends the gtk3 GUI), so maybe all that
is no big deal...

Pierre
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to