public inbox for linux-fscrypt@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Boccassi <luca.boccassi@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org
Subject: Re: [fsverity-utils PATCH 1/2] Use pkg-config to get libcrypto build flags
Date: Mon, 26 Oct 2020 11:16:11 +0000	[thread overview]
Message-ID: <85732884d7a7c256a179701b4b1141552026b0bd.camel@gmail.com> (raw)
In-Reply-To: <20201024040726.GB83494@sol.localdomain>

On Fri, 2020-10-23 at 21:07 -0700, Eric Biggers wrote:
> On Thu, Oct 22, 2020 at 06:59:33PM +0100, luca.boccassi@gmail.com wrote:
> > 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)
> 
> There should be a way to prevent pkg-config from being used if someone wants to
> link to a local copy of libcrypto.  One might expect setting PKGCONF to an empty
> string to work, and it kind of does, but then the shell command executes
> "libcrypto", which is strange.  How about quoting "$(PKGCONF)" so that the shell
> command is guaranteed to fail as expected in that case?
> 
> - Eric

Sure, done in v2.

-- 
Kind regards,
Luca Boccassi


  reply	other threads:[~2020-10-26 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=85732884d7a7c256a179701b4b1141552026b0bd.camel@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=ebiggers@kernel.org \
    --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