[LEDE-DEV] [PATCH] tools/cmake: Fix building with openssl libs in non-default location
John Crispin
john at phrozen.org
Thu Aug 18 00:40:51 PDT 2016
On 17/08/2016 16:53, Alexey Brodkin wrote:
> Hi John,
>
> On Wed, 2016-08-17 at 16:51 +0200, John Crispin wrote:
>>
>> On 17/08/2016 16:49, Alexey Brodkin wrote:
>>>
>>> Hi John,
>>>
>>> On Wed, 2016-08-17 at 09:20 +0200, John Crispin wrote:
>>>>
>>>>
>>>> On 16/08/2016 12:43, Alexey Brodkin wrote:
>>>>>
>>>>>
>>>>> For some reason CMake's buildsystem searches for openssl libs
>>>>> on Linux either in /usr/libX, /usr/local/libX or in OPENSSL_ROOT_DIR
>>>>> ignoring standard LD_LIBRARY_PATH env var.
>>>>>
>>>>> This behavior breaks CMAke building if openssl libs are in some
>>>>> specific location like ~/.local/lib etc.
>>>>>
>>>>> Solution is simple set OPENSSL_ROOT_DIR env var before calling
>>>>> CMake's configure script. Now openssl libs if they exist in
>>>>> $(LD_LIBRARY_PATH) will be used. What's also nice libs from
>>>>> LD_LIBRARY_PATH will be used instead of system ones (if they exist).
>>>>>
>>>>
>>>> this looks like a very specific hack for a non generic issue.
>>>
>>> And indeed it is. That's for a case if user wants to use libs from
>>> LD_LIBRARY_PATH instead of default system locations.
>>>
>>>>
>>>> looking at
>>>> Modules/FindOpenSSL.cmake i would claim that your pkconfig fails to
>>>> hounor the libs in your home folder and thus the path detection fails.
>>>> might be better to fix the pkgconfig issue ?
>>>
>>> Again pkconfig points to stuff installed in system but if user wants to
>>> use libs from some custom location which was added in LD_LIBRARY_PATH
>>> it won't work without the patch.
>>
>> how about using PKG_CONFIG_PATH ?
>
> But this env var points to pkgconfig script but not libs itself, right?
>
> -Alexey
>
you need to find a way to tell pkgconfig to honour the pc files in your
home folder i guess
John
More information about the Lede-dev
mailing list