[LEDE-DEV] [PATCH] tools/cmake: Fix building with openssl libs in non-default location

John Crispin john at phrozen.org
Wed Aug 17 00:20:42 PDT 2016



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. 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 ?

	John

> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> ---
>  tools/cmake/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile
> index 7de0bd8..9985e09 100644
> --- a/tools/cmake/Makefile
> +++ b/tools/cmake/Makefile
> @@ -19,7 +19,7 @@ HOST_CONFIGURE_PARALLEL:=1
>  
>  include $(INCLUDE_DIR)/host-build.mk
>  
> -HOST_CONFIGURE_CMD := MAKEFLAGS="$(HOST_JOBS)" $(BASH) ./configure
> +HOST_CONFIGURE_CMD := MAKEFLAGS="$(HOST_JOBS)" OPENSSL_ROOT_DIR=$(LD_LIBRARY_PATH) $(BASH) ./configure
>  
>  HOST_CONFIGURE_VARS :=
>  
> 



More information about the Lede-dev mailing list