From: luca.boccassi@gmail.com
To: linux-fscrypt@vger.kernel.org
Subject: [fsverity-utils PATCH 1/2] Use pkg-config to get libcrypto build flags
Date: Thu, 22 Oct 2020 18:59:33 +0100 [thread overview]
Message-ID: <20201022175934.2999543-1-luca.boccassi@gmail.com> (raw)
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
next reply other threads:[~2020-10-22 17:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 17:59 luca.boccassi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201022175934.2999543-1-luca.boccassi@gmail.com \
--to=luca.boccassi@gmail.com \
--cc=linux-fscrypt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox