All of lore.kernel.org
 help / color / mirror / Atom feed
* [fsverity-utils PATCH 1/2] Use pkg-config to get libcrypto build flags
@ 2020-10-22 17:59 luca.boccassi
  2020-10-22 17:59 ` [fsverity-utils PATCH 2/2] Generate and install libfsverity.pc luca.boccassi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: luca.boccassi @ 2020-10-22 17:59 UTC (permalink / raw)
  To: linux-fscrypt

From: Luca Boccassi <luca.boccassi@microsoft.com>

Especially when cross-compiling or other such cases, it might be necessary
to pass additional compiler flags. This is commonly done via pkg-config,
so use it if available, and fall back to the hardcoded -lcrypto if not.

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3fc1bec..122c0a2 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,7 @@ BINDIR          ?= $(PREFIX)/bin
 INCDIR          ?= $(PREFIX)/include
 LIBDIR          ?= $(PREFIX)/lib
 DESTDIR         ?=
+PKGCONF         ?= pkg-config
 
 # Rebuild if a user-specified setting that affects the build changed.
 .build-config: FORCE
@@ -69,7 +70,8 @@ DESTDIR         ?=
 
 DEFAULT_TARGETS :=
 COMMON_HEADERS  := $(wildcard common/*.h)
-LDLIBS          := -lcrypto
+LDLIBS          := $(shell $(PKGCONF) libcrypto --libs 2>/dev/null || echo -lcrypto)
+CFLAGS          += $(shell $(PKGCONF) libcrypto --cflags 2>/dev/null || echo)
 
 # If we are dynamically linking, when running tests we need to override
 # LD_LIBRARY_PATH as no RPATH is set
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-10-26 17:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-22 17:59 [fsverity-utils PATCH 1/2] Use pkg-config to get libcrypto build flags luca.boccassi
2020-10-22 17:59 ` [fsverity-utils PATCH 2/2] Generate and install libfsverity.pc luca.boccassi
2020-10-24  3:56   ` Eric Biggers
2020-10-26 11:16     ` Luca Boccassi
2020-10-24  4:07 ` [fsverity-utils PATCH 1/2] Use pkg-config to get libcrypto build flags Eric Biggers
2020-10-26 11:16   ` Luca Boccassi
2020-10-26 11:15 ` [fsverity-utils PATCH v2 " luca.boccassi
2020-10-26 11:15   ` [fsverity-utils PATCH v2 2/2] Generate and install libfsverity.pc luca.boccassi
2020-10-26 17:32     ` Eric Biggers
2020-10-26 17:32   ` [fsverity-utils PATCH v2 1/2] Use pkg-config to get libcrypto build flags Eric Biggers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.