Browse Source

tools: cmake: use pkg-config to discover libcrypto linker flags

LibreSSL's libcrypto.so has an indirect dependency to librt for clock_gettime()
on Linux.

Use pkg-config to portably discover the required linker flags.

Signed-off-by: Jo-Philipp Wich <[email protected]>
Jo-Philipp Wich 8 years ago
parent
commit
f9b253147a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tools/cmake/Makefile

+ 2 - 1
tools/cmake/Makefile

@@ -21,7 +21,8 @@ include $(INCLUDE_DIR)/host-build.mk
 
 HOST_CONFIGURE_CMD := MAKEFLAGS="$(HOST_JOBS)" $(BASH) ./configure
 
-HOST_CONFIGURE_VARS :=
+HOST_CONFIGURE_VARS := \
+	LDFLAGS="$$$$(pkg-config --static --libs libcrypto)"
 
 HOST_CONFIGURE_ARGS := \
 	--prefix=$(STAGING_DIR_HOST)